Explorar o código

Merge remote-tracking branch 'upstream/master' into feature-octal

Matt C %!s(int64=8) %!d(string=hai) anos
pai
achega
a36c9ca339
Modificáronse 100 ficheiros con 703 adicións e 19123 borrados
  1. 12 0
      .babelrc
  2. 1 2
      .gitignore
  3. 32 0
      .travis.yml
  4. 228 415
      Gruntfile.js
  5. 3 8
      README.md
  6. 0 50
      build/prod/.htaccess
  7. 0 47
      build/prod/cyberchef.htm
  8. 0 20
      build/prod/index.html
  9. 0 20
      build/prod/scripts.js
  10. 0 27
      build/prod/styles.css
  11. 48 9
      package.json
  12. 13 34
      src/.eslintrc.json
  13. 7 1
      src/core/Chef.js
  14. 5 0
      src/core/Dish.js
  15. 7 1
      src/core/FlowControl.js
  16. 5 0
      src/core/Ingredient.js
  17. 6 0
      src/core/Operation.js
  18. 6 0
      src/core/Recipe.js
  19. 6 33
      src/core/Utils.js
  20. 3 1
      src/core/config/Categories.js
  21. 41 6
      src/core/config/OperationConfig.js
  22. 0 0
      src/core/lib/bzip2.js
  23. 3 1
      src/core/lib/canvascomponents.js
  24. 8 4
      src/core/lib/uas_parser.js
  25. 16 2
      src/core/operations/Base.js
  26. 6 1
      src/core/operations/Base58.js
  27. 6 1
      src/core/operations/Base64.js
  28. 6 2
      src/core/operations/BitwiseOp.js
  29. 8 4
      src/core/operations/ByteRepr.js
  30. 6 2
      src/core/operations/CharEnc.js
  31. 7 2
      src/core/operations/Checksum.js
  32. 9 4
      src/core/operations/Cipher.js
  33. 15 19
      src/core/operations/Code.js
  34. 22 2
      src/core/operations/Compress.js
  35. 3 1
      src/core/operations/Convert.js
  36. 3 4
      src/core/operations/DateTime.js
  37. 6 1
      src/core/operations/Endian.js
  38. 6 1
      src/core/operations/Entropy.js
  39. 3 1
      src/core/operations/Extract.js
  40. 6 1
      src/core/operations/FileType.js
  41. 6 1
      src/core/operations/HTML.js
  42. 6 3
      src/core/operations/HTTP.js
  43. 8 2
      src/core/operations/Hash.js
  44. 6 2
      src/core/operations/Hexdump.js
  45. 7 3
      src/core/operations/IP.js
  46. 7 2
      src/core/operations/JS.js
  47. 3 1
      src/core/operations/MAC.js
  48. 6 1
      src/core/operations/MorseCode.js
  49. 3 1
      src/core/operations/NetBIOS.js
  50. 3 1
      src/core/operations/Numberwang.js
  51. 3 1
      src/core/operations/OS.js
  52. 33 29
      src/core/operations/PublicKey.js
  53. 7 4
      src/core/operations/Punycode.js
  54. 3 1
      src/core/operations/QuotedPrintable.js
  55. 3 1
      src/core/operations/Rotate.js
  56. 6 1
      src/core/operations/SeqUtils.js
  57. 6 2
      src/core/operations/StrUtils.js
  58. 6 1
      src/core/operations/Tidy.js
  59. 9 1
      src/core/operations/URL.js
  60. 4 2
      src/core/operations/UUID.js
  61. 6 1
      src/core/operations/Unicode.js
  62. 0 13
      src/css/lib/bootstrap-colorpicker.css
  63. 0 221
      src/css/lib/bootstrap-switch.css
  64. 0 6764
      src/css/lib/bootstrap3.min.css
  65. 0 68
      src/css/lib/prettify.css
  66. 0 1271
      src/js/lib/Sortable.js
  67. 0 649
      src/js/lib/blowfish.dojo.js
  68. 0 2372
      src/js/lib/bootstrap-3.3.6.js
  69. 0 1116
      src/js/lib/bootstrap-colorpicker.js
  70. 0 583
      src/js/lib/bootstrap-switch.js
  71. 0 768
      src/js/lib/cryptoapi/crypto-api.js
  72. 0 113
      src/js/lib/cryptoapi/hasher.md2.js
  73. 0 204
      src/js/lib/cryptoapi/hasher.md4.js
  74. 0 125
      src/js/lib/cryptoapi/hasher.sha0.js
  75. 0 213
      src/js/lib/cryptojs/aes.js
  76. 0 864
      src/js/lib/cryptojs/cipher-core.js
  77. 0 713
      src/js/lib/cryptojs/core.js
  78. 0 109
      src/js/lib/cryptojs/enc-base64.js
  79. 0 135
      src/js/lib/cryptojs/enc-utf16.js
  80. 0 118
      src/js/lib/cryptojs/evpkdf.js
  81. 0 52
      src/js/lib/cryptojs/format-hex.js
  82. 0 131
      src/js/lib/cryptojs/hmac.js
  83. 0 62
      src/js/lib/cryptojs/lib-typedarrays.js
  84. 0 254
      src/js/lib/cryptojs/md5.js
  85. 0 64
      src/js/lib/cryptojs/mode-cfb.js
  86. 0 104
      src/js/lib/cryptojs/mode-ctr-gladman.js
  87. 0 44
      src/js/lib/cryptojs/mode-ctr.js
  88. 0 26
      src/js/lib/cryptojs/mode-ecb.js
  89. 0 40
      src/js/lib/cryptojs/mode-ofb.js
  90. 0 35
      src/js/lib/cryptojs/pad-ansix923.js
  91. 0 30
      src/js/lib/cryptojs/pad-iso10126.js
  92. 0 26
      src/js/lib/cryptojs/pad-iso97971.js
  93. 0 16
      src/js/lib/cryptojs/pad-nopadding.js
  94. 0 31
      src/js/lib/cryptojs/pad-zeropadding.js
  95. 0 131
      src/js/lib/cryptojs/pbkdf2.js
  96. 0 176
      src/js/lib/cryptojs/rabbit-legacy.js
  97. 0 178
      src/js/lib/cryptojs/rabbit.js
  98. 0 125
      src/js/lib/cryptojs/rc4.js
  99. 0 255
      src/js/lib/cryptojs/ripemd160.js
  100. 0 136
      src/js/lib/cryptojs/sha1.js

+ 12 - 0
.babelrc

@@ -0,0 +1,12 @@
+{
+    "presets": [
+        ["env", {
+            "targets": {
+                "chrome": 40,
+                "firefox": 35,
+                "edge": 14
+            },
+            "modules": false
+        }]
+    ]
+}

+ 1 - 2
.gitignore

@@ -1,7 +1,6 @@
 node_modules
 npm-debug.log
-build/dev
-build/test
+build
 docs/*
 !docs/*.conf.json
 !docs/*.ico

+ 32 - 0
.travis.yml

@@ -0,0 +1,32 @@
+language: node_js
+node_js:
+  - node
+install: npm install
+before_script:
+  - npm install -g grunt
+script:
+  - grunt lint
+  - grunt test
+  - grunt docs
+  - grunt node
+  - grunt prod
+before_deploy:
+  - grunt copy:ghPages
+deploy:
+  - provider: pages
+    skip_cleanup: true
+    github_token: $GITHUB_TOKEN
+    local_dir: build/prod/
+    target_branch: gh-pages
+    on:
+      branch: master
+  - provider: releases
+    skip_cleaup: true
+    api_key:
+      secure: $GITHUB_API_KEY
+    file:
+      - build/prod/cyberchef.htm
+      - build/node/CyberChef.js
+    on:
+      repo: gchq/CyberChef
+      tags: true

+ 228 - 415
Gruntfile.js

@@ -1,38 +1,40 @@
-/* eslint-env node */
+var webpack = require("webpack"),
+    ExtractTextPlugin = require("extract-text-webpack-plugin"),
+    HtmlWebpackPlugin = require("html-webpack-plugin"),
+    Inliner = require("web-resource-inliner");
 
-module.exports = function(grunt) {
+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:htmlDev", "copy:staticDev", "chmod:build", "watch"]);
+        ["clean:dev", "webpack:webDev"]);
+
+    grunt.registerTask("node",
+        "Compiles CyberChef into a single NodeJS module.",
+        ["clean:node", "webpack:node", "chmod:build"]);
 
     grunt.registerTask("test",
         "A task which runs all the tests in test/tests.",
-        ["clean:test", "concat:jsTest", "copy:htmlTest", "chmod:build", "execute:test"]);
-
-    grunt.registerTask("prod",
-        "Creates a production-ready build. Use the --msg flag to add a compile message.",
-        ["eslint", "exec:stats", "clean", "jsdoc", "concat", "copy:htmlDev", "copy:htmlProd", "copy:htmlInline",
-         "copy:staticDev", "copy:staticProd", "cssmin", "uglify:prod", "inline", "htmlmin", "chmod", "test"]);
+        ["clean:test", "webpack:tests", "execute:test"]);
 
     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:repoSize", "exec:displayStats"]);
-
-    grunt.registerTask("release",
-        "Prepares and deploys a production version of CyberChef to the gh-pages branch.",
-        ["copy:ghPages", "exec:deployGhPages"]);
+    grunt.registerTask("prod",
+        "Creates a production-ready build. Use the --msg flag to add a compile message.",
+        ["eslint", "clean:prod", "webpack:webProd", "inline", "chmod"]);
 
     grunt.registerTask("default",
-        "Lints the code base and shows stats",
-        ["eslint", "exec:stats", "exec:displayStats"]);
+        "Lints the code base",
+        ["eslint", "exec:repoSize"]);
+
+    grunt.registerTask("inline",
+        "Compiles a production build of CyberChef into a single, portable web page.",
+        runInliner);
 
     grunt.registerTask("doc", "docs");
     grunt.registerTask("tests", "test");
@@ -41,179 +43,79 @@ module.exports = function(grunt) {
 
     // Load tasks provided by each plugin
     grunt.loadNpmTasks("grunt-eslint");
+    grunt.loadNpmTasks("grunt-webpack");
     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-execute");
-    grunt.loadNpmTasks("grunt-contrib-watch");
-
-
-    // JS includes
-    var jsIncludes = [
-        // 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/cryptoapi/crypto-api.js",
-        "src/js/lib/cryptoapi/hasher.md2.js",
-        "src/js/lib/cryptoapi/hasher.md4.js",
-        "src/js/lib/cryptoapi/hasher.sha0.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",
-        "src/js/lib/es6-promise.auto.js",
-        "src/js/lib/xpath.js",
-
-        // Custom libraries
-        "src/js/lib/canvascomponents.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",
 
-    ];
-
-    var jsAppFiles = jsIncludes.concat([
-        // Start the main app!
-        "src/js/views/html/main.js",
-    ]);
-
-    var jsTestFiles = jsIncludes.concat([
-        "test/TestRegister.js",
-        "test/tests/**/*.js",
-        "test/TestRunner.js",
-    ]);
-
-    var banner = '/**\n\
- * CyberChef - The Cyber Swiss Army Knife\n\
- *\n\
- * @copyright Crown Copyright 2016\n\
- * @license Apache-2.0\n\
- *\n\
- *   Copyright 2016 Crown Copyright\n\
- *\n\
- * Licensed under the Apache License, Version 2.0 (the "License");\n\
- * you may not use this file except in compliance with the License.\n\
- * You may obtain a copy of the License at\n\
- *\n\
- *     http://www.apache.org/licenses/LICENSE-2.0\n\
- *\n\
- * Unless required by applicable law or agreed to in writing, software\n\
- * distributed under the License is distributed on an "AS IS" BASIS,\n\
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\
- * See the License for the specific language governing permissions and\n\
- * limitations under the License.\n\
- */\n';
+    // Project configuration
+    var compileTime = grunt.template.today("dd/mm/yyyy HH:MM:ss") + " UTC",
+        banner = "/**\n" +
+            "* CyberChef - The Cyber Swiss Army Knife\n" +
+            "*\n" +
+            "* @copyright Crown Copyright 2016\n" +
+            "* @license Apache-2.0\n" +
+            "*\n" +
+            "*   Copyright 2016 Crown Copyright\n" +
+            "*\n" +
+            '* Licensed under the Apache License, Version 2.0 (the "License");\n' +
+            "* you may not use this file except in compliance with the License.\n" +
+            "* You may obtain a copy of the License at\n" +
+            "*\n" +
+            "*     http://www.apache.org/licenses/LICENSE-2.0\n" +
+            "*\n" +
+            "* Unless required by applicable law or agreed to in writing, software\n" +
+            '* distributed under the License is distributed on an "AS IS" BASIS,\n' +
+            "* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
+            "* See the License for the specific language governing permissions and\n" +
+            "* limitations under the License.\n" +
+            "*/\n";
+
+    /**
+     * Compiles a production build of CyberChef into a single, portable web page.
+     */
+    function runInliner() {
+        var inlinerError = false;
+        Inliner.html({
+            relativeTo: "build/prod/",
+            fileContent: grunt.file.read("build/prod/cyberchef.htm"),
+            images: true,
+            svgs: true,
+            scripts: true,
+            links: true,
+            strict: true
+        }, function(error, result) {
+            if (error) {
+                console.log(error);
+                inlinerError = true;
+                return false;
+            }
+            grunt.file.write("build/prod/cyberchef.htm", result);
+        });
 
-    var templateOptions = {
-        data: {
-            compileTime: grunt.template.today("dd/mm/yyyy HH:MM:ss") + " UTC",
-            compileMsg: grunt.option("compile-msg") || grunt.option("msg") || "",
-            codebaseStats: grunt.file.read("src/static/stats.txt").split("\n").join("<br>")
-        }
-    };
+        return !inlinerError;
+    }
 
-    // Project configuration
     grunt.initConfig({
+        clean: {
+            dev: ["build/dev/*"],
+            prod: ["build/prod/*"],
+            test: ["build/test/*"],
+            node: ["build/node/*"],
+            docs: ["docs/*", "!docs/*.conf.json", "!docs/*.ico"],
+        },
         eslint: {
             options: {
-                configFile: "src/js/.eslintrc.json"
+                configFile: "src/.eslintrc.json"
             },
-            gruntfile: ["Gruntfile.js"],
-            core: ["src/js/core/**/*.js"],
-            config: ["src/js/config/**/*.js"],
-            views: ["src/js/views/**/*.js"],
-            operations: ["src/js/operations/**/*.js"],
+            configs: ["Gruntfile.js"],
+            core: ["src/core/**/*.js", "!src/core/lib/**/*"],
+            web: ["src/web/**/*.js"],
+            node: ["src/node/**/*.js"],
             tests: ["test/**/*.js"],
         },
         jsdoc: {
@@ -226,209 +128,183 @@ module.exports = function(grunt) {
             },
             all: {
                 src: [
-                    "src/js/**/*.js",
-                    "!src/js/lib/**/*",
+                    "src/**/*.js",
+                    "!src/core/lib/**/*",
                 ],
             }
         },
-        clean: {
-            dev: ["build/dev/*"],
-            prod: ["build/prod/*"],
-            test: ["build/test/*"],
-            docs: ["docs/*", "!docs/*.conf.json", "!docs/*.ico"],
-        },
-        concat: {
+        webpack: {
             options: {
-                process: templateOptions
-            },
-            css: {
-                options: {
-                    banner: banner.replace(/\/\*\*/g, "/*!"),
-                    process: function(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"
+                plugins: [
+                    new webpack.ProvidePlugin({
+                        $: "jquery",
+                        jQuery: "jquery",
+                        moment: "moment-timezone"
+                    }),
+                    new webpack.BannerPlugin({
+                        banner: banner,
+                        raw: true,
+                        entryOnly: true
+                    }),
+                    new webpack.DefinePlugin({
+                        COMPILE_TIME: JSON.stringify(compileTime),
+                        COMPILE_MSG: JSON.stringify(grunt.option("compile-msg") || grunt.option("msg") || "")
+                    }),
+                    new ExtractTextPlugin("styles.css"),
                 ],
-                dest: "build/dev/styles.css"
-            },
-            js: {
-                options: {
-                    banner: '"use strict";\n'
-                },
-                src: jsAppFiles,
-                dest: "build/dev/scripts.js"
-            },
-            jsTest: {
-                options: {
-                    banner: '"use strict";\n'
-                },
-                src: jsTestFiles,
-                dest: "build/test/tests.js"
-            }
-        },
-        copy: {
-            htmlDev: {
-                options: {
-                    process: function(content, srcpath) {
-                        return grunt.template.process(content, templateOptions);
+                resolve: {
+                    alias: {
+                        jquery: "jquery/src/jquery"
                     }
                 },
-                src: "src/html/index.html",
-                dest: "build/dev/index.html"
-            },
-            htmlTest: {
-                src: "test/test.html",
-                dest: "build/test/index.html"
-            },
-            htmlProd: {
-                options: {
-                    process: function(content, srcpath) {
-                        return grunt.template.process(content, templateOptions);
-                    }
+                module: {
+                    rules: [
+                        {
+                            test: /\.js$/,
+                            exclude: /node_modules/,
+                            loader: "babel-loader?compact=false"
+                        },
+                        {
+                            test: /\.css$/,
+                            use: ExtractTextPlugin.extract({
+                                use: "css-loader?minimize"
+                            })
+                        },
+                        {
+                            test: /\.less$/,
+                            use: ExtractTextPlugin.extract({
+                                use: [
+                                    { loader: "css-loader?minimize" },
+                                    { loader: "less-loader" }
+                                ]
+                            })
+                        },
+                        {
+                            test: /\.(ico|eot|ttf|woff|woff2)$/,
+                            loader: "url-loader",
+                            options: {
+                                limit: 10000
+                            }
+                        },
+                        { // First party images are saved as files to be cached
+                            test: /\.(png|jpg|gif|svg)$/,
+                            exclude: /node_modules/,
+                            loader: "file-loader",
+                            options: {
+                                name: "images/[name].[ext]"
+                            }
+                        },
+                        { // Third party images are inlined
+                            test: /\.(png|jpg|gif|svg)$/,
+                            exclude: /web\/static/,
+                            loader: "url-loader",
+                            options: {
+                                limit: 10000
+                            }
+                        },
+                    ]
                 },
-                src: "src/html/index.html",
-                dest: "build/prod/index.html"
+                stats: {
+                    children: false
+                }
             },
-            htmlInline: {
-                options: {
-                    process: function(content, srcpath) {
-                        // TODO: Do all this in Jade
-                        content = content.replace(
-                            '<a href="cyberchef.htm" style="float: left; margin-left: 10px; margin-right: 80px;" download>Download CyberChef<img src="images/download-24x24.png" /></a>',
-                            '<span style="float: left; margin-left: 10px;">Compile time: ' + grunt.template.today("dd/mm/yyyy HH:MM:ss") + " UTC</span>");
-                        return grunt.template.process(content, templateOptions);
-                    }
+            webDev: {
+                target: "web",
+                entry: "./src/web/index.js",
+                output: {
+                    filename: "scripts.js",
+                    path: __dirname + "/build/dev"
                 },
-                src: "src/html/index.html",
-                dest: "build/prod/cyberchef.htm"
+                plugins: [
+                    new HtmlWebpackPlugin({
+                        filename: "index.html",
+                        template: "./src/web/html/index.html",
+                        compileTime: compileTime
+                    })
+                ],
+                watch: true
             },
-            staticDev: {
-                files: [
-                    {
-                        expand: true,
-                        cwd: "src/static/",
-                        src: [
-                            "**/*",
-                            "**/.*",
-                            "!stats.txt",
-                            "!ga.html"
-                        ],
-                        dest: "build/dev/"
-                    }
+            webProd: {
+                target: "web",
+                entry: "./src/web/index.js",
+                output: {
+                    filename: "scripts.js",
+                    path: __dirname + "/build/prod"
+                },
+                plugins: [
+                    new webpack.optimize.UglifyJsPlugin({
+                        compress: {
+                            "screw_ie8": true,
+                            "dead_code": true,
+                            "unused": true,
+                            "warnings": false
+                        },
+                        comments: false,
+                    }),
+                    new HtmlWebpackPlugin({ // Main version
+                        filename: "index.html",
+                        template: "./src/web/html/index.html",
+                        compileTime: compileTime,
+                        minify: {
+                            removeComments: true,
+                            collapseWhitespace: true,
+                            minifyJS: true,
+                            minifyCSS: true
+                        }
+                    }),
+                    new HtmlWebpackPlugin({ // Inline version
+                        filename: "cyberchef.htm",
+                        template: "./src/web/html/index.html",
+                        compileTime: compileTime,
+                        inline: true,
+                        minify: {
+                            removeComments: true,
+                            collapseWhitespace: true,
+                            minifyJS: true,
+                            minifyCSS: true
+                        }
+                    }),
                 ]
             },
-            staticProd: {
-                files: [
-                    {
-                        expand: true,
-                        cwd: "src/static/",
-                        src: [
-                            "**/*",
-                            "**/.*",
-                            "!stats.txt",
-                            "!ga.html"
-                        ],
-                        dest: "build/prod/"
-                    }
-                ]
+            tests: {
+                target: "node",
+                entry: "./test/index.js",
+                output: {
+                    filename: "index.js",
+                    path: __dirname + "/build/test"
+                }
             },
+            node: {
+                target: "node",
+                entry: "./src/node/index.js",
+                output: {
+                    filename: "CyberChef.js",
+                    path: __dirname + "/build/node",
+                    library: "CyberChef",
+                    libraryTarget: "commonjs2"
+                }
+            }
+        },
+        copy: {
             ghPages: {
                 options: {
-                    process: function(content, srcpath) {
+                    process: function (content, srcpath) {
                         // Add Google Analytics code to index.html
                         content = content.replace("</body></html>",
-                            grunt.file.read("src/static/ga.html") + "</body></html>");
-                        return grunt.template.process(content, templateOptions);
+                            grunt.file.read("src/web/static/ga.html") + "</body></html>");
+                        return grunt.template.process(content);
                     }
                 },
                 src: "build/prod/index.html",
                 dest: "build/prod/index.html"
             }
         },
-        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, // eslint-disable-line camelcase
-                    ascii_only: true, // eslint-disable-line camelcase
-                    screw_ie8: true // eslint-disable-line camelcase
-                },
-                compress: {
-                    screw_ie8: true // eslint-disable-line camelcase
-                },
-                banner: 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
-                },
-                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"
-            }
-        },
-        inline: {
-            options: {
-                tag: "",
-                inlineTagAttributes: {
-                    js: "type='application/javascript'",
-                    css: "type='text/css'"
-                }
-            },
-            compiled: {
-                src: "build/prod/cyberchef.htm",
-                dest: "build/prod/cyberchef.htm"
-            },
-            prod: {
-                options: {
-                    tag: "__inline"
-                },
-                src: "build/prod/index.html",
-                dest: "build/prod/index.html"
-            }
-        },
         chmod: {
             build: {
                 options: {
                     mode: "755",
                 },
-                src: ["build/**/*", "build/**/.htaccess", "build/"]
+                src: ["build/**/*", "build/"]
             },
             docs: {
                 options: {
@@ -445,75 +321,12 @@ module.exports = function(grunt) {
                 ].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/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 '.*\.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
-            },
-            displayStats: {
-                command: "cat src/static/stats.txt"
-            },
             cleanGit: {
                 command: "git gc --prune=now --aggressive"
             },
-            deployGhPages: {
-                command: [
-                        "git add build/prod/index.html -v",
-                        "COMMIT_HASH=$(git rev-parse HEAD)",
-                        "git commit -m \"GitHub Pages release for ${COMMIT_HASH}\"",
-                        "git push origin `git subtree split --prefix build/prod master`:gh-pages --force",
-                        "git reset HEAD~",
-                        "git checkout build/prod/index.html"
-                ].join(";")
-            }
         },
         execute: {
-            test: "test/NodeRunner.js"
-        },
-        watch: {
-            css: {
-                files: "src/css/**/*.css",
-                tasks: ["concat:css", "chmod:build"]
-            },
-            js: {
-                files: "src/js/**/*.js",
-                tasks: ["concat:js", "chmod:build"]
-            },
-            html: {
-                files: "src/html/**/*.html",
-                tasks: ["copy:htmlDev", "chmod:build"]
-            },
-            static: {
-                files: ["src/static/**/*", "src/static/**/.*"],
-                tasks: ["copy:staticDev", "chmod:build"]
-            },
-            grunt: {
-                files: "Gruntfile.js",
-                tasks: ["clean:dev", "concat:css", "concat:js", "copy:htmlDev", "copy:staticDev", "chmod:build"]
-            }
+            test: "build/test/index.js"
         },
     });
 

+ 3 - 8
README.md

@@ -1,6 +1,6 @@
 # CyberChef
 
-####*The Cyber Swiss Army Knife*
+#### *The Cyber Swiss Army Knife*
 
 CyberChef is a simple, intuitive web app for carrying out all manner of "cyber" operations within a web browser. These operations include creating hexdumps, simple encoding like XOR or Base64, more complex encryption like AES, DES and Blowfish, data compression and decompression, calculating hashes and checksums, IPv6 and X.509 parsing, and much more.
 
@@ -13,7 +13,6 @@ CyberChef is still under active development. As a result, it shouldn't be consid
 Cryptographic operations in CyberChef should not be relied upon to provide security in any situation. No guarantee is offered for their correctness.
 
 [A live demo can be found here][1] - have fun!
-Note: Use Chrome or Firefox, see the Browser Support section below for details.
 
 
 ## How it works
@@ -63,11 +62,7 @@ You can use as many operations as you like in simple or complex ways. Some examp
 
 ## Browser support
 
-CyberChef works well in modern versions of Google Chrome and Mozilla Firefox.
-
-To aid in the efficient development of new features and operations, there has been no attempt to maintain support for any version of Microsoft Internet Explorer.
-
-Microsoft Edge is currently unsupported, but if anyone would like to contribute compatibility fixes, they would be appreciated.
+CyberChef is built to support Google Chrome 40+, Mozilla Firefox 35+ and Microsoft Edge 14+.
 
 
 ## Contributing
@@ -91,4 +86,4 @@ CyberChef is released under the [Apache 2.0 Licence](https://www.apache.org/lice
   [5]: https://gchq.github.io/CyberChef/?recipe=%5B%7B%22op%22%3A%22From%20Hexdump%22%2C%22args%22%3A%5B%5D%7D%2C%7B%22op%22%3A%22Gunzip%22%2C%22args%22%3A%5B%5D%7D%5D&input=MDAwMDAwMDAgIDFmIDhiIDA4IDAwIDEyIGJjIGYzIDU3IDAwIGZmIDBkIGM3IGMxIDA5IDAwIDIwICB8Li4uLi6881cu%2Fy7HwS4uIHwKMDAwMDAwMTAgIDA4IDA1IGQwIDU1IGZlIDA0IDJkIGQzIDA0IDFmIGNhIDhjIDQ0IDIxIDViIGZmICB8Li7QVf4uLdMuLsouRCFb%2F3wKMDAwMDAwMjAgIDYwIGM3IGQ3IDAzIDE2IGJlIDQwIDFmIDc4IDRhIDNmIDA5IDg5IDBiIDlhIDdkICB8YMfXLi6%2BQC54Sj8uLi4ufXwKMDAwMDAwMzAgIDRlIGM4IDRlIDZkIDA1IDFlIDAxIDhiIDRjIDI0IDAwIDAwIDAwICAgICAgICAgICB8TshObS4uLi5MJC4uLnw
   [6]: https://gchq.github.io/CyberChef/?recipe=%5B%7B%22op%22%3A%22Fork%22%2C%22args%22%3A%5B%22%5C%5Cn%22%2C%22%5C%5Cn%22%5D%7D%2C%7B%22op%22%3A%22From%20UNIX%20Timestamp%22%2C%22args%22%3A%5B%22Seconds%20(s)%22%5D%7D%5D&input=OTc4MzQ2ODAwCjEwMTI2NTEyMDAKMTA0NjY5NjQwMAoxMDgxMDg3MjAwCjExMTUzMDUyMDAKMTE0OTYwOTYwMA
   [7]: https://gchq.github.io/CyberChef/?recipe=%5B%7B%22op%22%3A%22Fork%22%2C%22args%22%3A%5B%22%5C%5Cn%22%2C%22%5C%5Cn%22%5D%7D%2C%7B%22op%22%3A%22Conditional%20Jump%22%2C%22args%22%3A%5B%221%22%2C%222%22%2C%2210%22%5D%7D%2C%7B%22op%22%3A%22To%20Hex%22%2C%22args%22%3A%5B%22Space%22%5D%7D%2C%7B%22op%22%3A%22Return%22%2C%22args%22%3A%5B%5D%7D%2C%7B%22op%22%3A%22To%20Base64%22%2C%22args%22%3A%5B%22A-Za-z0-9%2B%2F%3D%22%5D%7D%5D&input=U29tZSBkYXRhIHdpdGggYSAxIGluIGl0ClNvbWUgZGF0YSB3aXRoIGEgMiBpbiBpdA
-  [8]: https://gchq.github.io/CyberChef/?recipe=%5B%7B%22op%22%3A%22XOR%22%2C%22args%22%3A%5B%7B%22option%22%3A%22Hex%22%2C%22string%22%3A%223a%22%7D%2Cfalse%2Cfalse%5D%7D%2C%7B%22op%22%3A%22To%20Hexdump%22%2C%22args%22%3A%5B%2216%22%2Cfalse%2Cfalse%5D%7D%5D&input=VGhlIGFuc3dlciB0byB0aGUgdWx0aW1hdGUgcXVlc3Rpb24gb2YgbGlmZSwgdGhlIFVuaXZlcnNlLCBhbmQgZXZlcnl0aGluZyBpcyA0Mi4
+  [8]: https://gchq.github.io/CyberChef/?recipe=%5B%7B%22op%22%3A%22XOR%22%2C%22args%22%3A%5B%7B%22option%22%3A%22Hex%22%2C%22string%22%3A%223a%22%7D%2Cfalse%2Cfalse%5D%7D%2C%7B%22op%22%3A%22To%20Hexdump%22%2C%22args%22%3A%5B%2216%22%2Cfalse%2Cfalse%5D%7D%5D&input=VGhlIGFuc3dlciB0byB0aGUgdWx0aW1hdGUgcXVlc3Rpb24gb2YgbGlmZSwgdGhlIFVuaXZlcnNlLCBhbmQgZXZlcnl0aGluZyBpcyA0Mi4

+ 0 - 50
build/prod/.htaccess

@@ -1,50 +0,0 @@
-# Serve up .htm files as binary files rather than text/html.
-# This allows cyberchef.htm to be downloaded rather than opened in the browser.
-AddType application/octet-stream .htm
-
-# Fix Apache bug #45023 where "-gzip" is appended to all ETags, preventing 304 responses
-<IfModule mod_headers.c>
-    RequestHeader edit "If-None-Match" "^\"(.*)-gzip\"$" "\"$1\""
-    Header edit "ETag" "^\"(.*[^g][^z][^i][^p])\"$" "\"$1-gzip\""
-</IfModule>
-
-# Set gzip compression on all resources that support it
-<IfModule mod_deflate.c>
-    SetOutputFilter DEFLATE
-</IfModule>
-
-# Set Expires headers on various resources
-<IfModule mod_expires.c>
-    ExpiresActive On
-    
-    # 10 minutes
-    ExpiresDefault "access plus 600 seconds"
-    
-    # 30 days
-    ExpiresByType image/x-icon "access plus 2592000 seconds"
-    ExpiresByType image/jpeg "access plus 2592000 seconds"
-    ExpiresByType image/png "access plus 2592000 seconds"
-    ExpiresByType image/gif "access plus 2592000 seconds"
-    
-    # 7 days
-    ExpiresByType text/css "access plus 604800 seconds"
-    ExpiresByType text/javascript "access plus 604800 seconds"
-    ExpiresByType application/javascript "access plus 604800 seconds"
-    ExpiresByType text/html "access plus 604800 seconds"
-</IfModule>
-
-# Set Cache-Control headers on various resources
-<IfModule mod_headers.c>
-    <FilesMatch "\\.(ico|jpe?g|png|gif)$">
-        Header set Cache-Control "max-age=2592000, public"
-    </FilesMatch>
-    <FilesMatch "\\.(css)$">
-        Header set Cache-Control "max-age=600, public"
-    </FilesMatch>
-    <FilesMatch "\\.(js)$">
-        Header set Cache-Control "max-age=600, private, must-revalidate"
-    </FilesMatch>
-    <FilesMatch "\\.(x?html?)$">
-        Header set Cache-Control "max-age=600, private, must-revalidate"
-    </FilesMatch>
-</IfModule>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 47
build/prod/cyberchef.htm


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 20
build/prod/index.html


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 20
build/prod/scripts.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 27
build/prod/styles.css


+ 48 - 9
package.json

@@ -1,6 +1,6 @@
 {
   "name": "cyberchef",
-  "version": "4.0.0",
+  "version": "5.0.1",
   "description": "CyberChef is a simple, intuitive web app for analysing and decoding data within a web browser.",
   "author": "n1474335 <n1474335@gmail.com>",
   "homepage": "https://gchq.github.io/CyberChef",
@@ -26,21 +26,60 @@
     "url": "https://github.com/gchq/CyberChef/"
   },
   "devDependencies": {
-    "grunt": "~1.0.1",
+    "babel-core": "^6.24.0",
+    "babel-loader": "^6.4.0",
+    "babel-polyfill": "^6.23.0",
+    "babel-preset-env": "^1.2.2",
+    "css-loader": "^0.27.3",
+    "exports-loader": "^0.6.4",
+    "extract-text-webpack-plugin": "^2.1.0",
+    "file-loader": "^0.10.1",
+    "grunt": ">=0.4.5",
     "grunt-chmod": "~1.1.1",
     "grunt-contrib-clean": "~1.0.0",
-    "grunt-contrib-concat": "~1.0.0",
     "grunt-contrib-copy": "~1.0.0",
-    "grunt-contrib-cssmin": "~1.0.2",
-    "grunt-contrib-htmlmin": "~2.0.0",
-    "grunt-contrib-uglify": "~2.0.0",
-    "grunt-contrib-watch": "~1.0.0",
     "grunt-eslint": "^19.0.0",
     "grunt-exec": "~1.0.1",
     "grunt-execute": "^0.2.2",
-    "grunt-inline-alt": "~0.3.10",
     "grunt-jsdoc": "^2.1.0",
+    "grunt-webpack": "^2.0.1",
+    "html-webpack-plugin": "^2.28.0",
+    "imports-loader": "^0.7.1",
     "ink-docstrap": "^1.1.4",
-    "phantomjs-prebuilt": "^2.1.14"
+    "less": "^2.7.2",
+    "less-loader": "^4.0.2",
+    "style-loader": "^0.15.0",
+    "url-loader": "^0.5.8",
+    "web-resource-inliner": "^4.1.0",
+    "webpack": "^2.2.1"
+  },
+  "dependencies": {
+    "bootstrap": "^3.3.7",
+    "bootstrap-colorpicker": "^2.5.1",
+    "bootstrap-switch": "^3.3.4",
+    "crypto-api": "^0.6.2",
+    "crypto-js": "^3.1.9-1",
+    "diff": "^3.2.0",
+    "escodegen": "^1.8.1",
+    "esmangle": "^1.0.1",
+    "esprima": "^3.1.3",
+    "google-code-prettify": "^1.0.5",
+    "jquery": "^3.1.1",
+    "jsbn": "^1.1.0",
+    "jsrsasign": "^7.1.0",
+    "moment": "^2.17.1",
+    "moment-timezone": "^0.5.11",
+    "sladex-blowfish": "^0.8.1",
+    "sortablejs": "^1.5.1",
+    "split.js": "^1.2.0",
+    "vkbeautify": "^0.99.1",
+    "xmldom": "^0.1.27",
+    "xpath": "0.0.24",
+    "zlibjs": "^0.2.0"
+  },
+  "scripts": {
+    "build": "grunt prod",
+    "test": "grunt test",
+    "docs": "grunt docs"
   }
 }

+ 13 - 34
src/js/.eslintrc.json → src/.eslintrc.json

@@ -3,13 +3,13 @@
         "ecmaVersion": 6,
         "ecmaFeatures": {
             "impliedStrict": true
-        }
+        },
+        "sourceType": "module"
     },
     "env": {
         "browser": true,
-        "jquery": true,
         "es6": true,
-        "node": false
+        "node": true
     },
     "extends": "eslint:recommended",
     "rules": {
@@ -28,7 +28,11 @@
         // modify rules from base configurations
         "no-unused-vars": ["error", {
             "args": "none",
-            "vars": "local"
+            "vars": "local",
+            // Allow vars that start with a capital letter to be unused.
+            // This is mainly for exported module names which are useful to indicate
+            // the name of the module and may be used to refer to itself in future.
+            "varsIgnorePattern": "^[A-Z]"
         }],
         "no-empty": ["error", {
             "allowEmptyCatch": true
@@ -83,36 +87,11 @@
         "space-in-parens": "error"
     },
     "globals": {
-        /* core/* */
-        "Chef": false,
-        "Dish": false,
-        "Recipe": false,
-        "Ingredient": false,
-        "Operation": false,
-        "Utils": false,
-        
-        /* config/* */
-        "Categories": false,
-        "OperationConfig": false,
-        
-        /* views/html/* */
-        "HTMLApp": false,
-        "HTMLCategory": false,
-        "HTMLOperation": false,
-        "HTMLIngredient": false,
-        "Manager": false,
-        "ControlsWaiter": false,
-        "HighlighterWaiter": false,
-        "InputWaiter": false,
-        "OperationsWaiter": false,
-        "OptionsWaiter": false,
-        "OutputWaiter": false,
-        "RecipeWaiter": false,
-        "SeasonalWaiter": false,
-        "WindowWaiter": false,
+        "$": false,
+        "jQuery": false,
+        "moment": false,
 
-        /* tests */
-        "TestRegister": false,
-        "TestRunner": false
+        "COMPILE_TIME": false,
+        "COMPILE_MSG": false
     }
 }

+ 7 - 1
src/js/core/Chef.js → src/core/Chef.js

@@ -1,3 +1,7 @@
+import Dish from "./Dish.js";
+import Recipe from "./Recipe.js";
+
+
 /**
  * The main controller for CyberChef.
  *
@@ -20,7 +24,7 @@ var Chef = function() {
  * @param {Object} options - The options object storing various user choices
  * @param {boolean} options.attempHighlight - Whether or not to attempt highlighting
  * @param {number} progress - The position in the recipe to start from
- * @param {number} [step] - The number of operations to execute
+ * @param {number} [step] - Whether to only execute one operation in the recipe
  *
  * @returns {Object} response
  * @returns {string} response.result - The output of the recipe
@@ -118,3 +122,5 @@ Chef.prototype.silentBake = function(recipeConfig) {
     }
     return new Date().getTime() - startTime;
 };
+
+export default Chef;

+ 5 - 0
src/js/core/Dish.js → src/core/Dish.js

@@ -1,3 +1,6 @@
+import Utils from "./Utils.js";
+
+
 /**
  * The data being operated on by each operation.
  *
@@ -200,3 +203,5 @@ Dish.prototype.valid = function() {
             return false;
     }
 };
+
+export default Dish;

+ 7 - 1
src/js/core/FlowControl.js → src/core/FlowControl.js

@@ -1,3 +1,7 @@
+import Recipe from "./Recipe.js";
+import Dish from "./Dish.js";
+
+
 /**
  * Flow Control operations.
  *
@@ -7,7 +11,7 @@
  *
  * @namespace
  */
-var FlowControl = {
+const FlowControl = {
 
     /**
      * @constant
@@ -190,3 +194,5 @@ var FlowControl = {
     },
 
 };
+
+export default FlowControl;

+ 5 - 0
src/js/core/Ingredient.js → src/core/Ingredient.js

@@ -1,3 +1,6 @@
+import Utils from "./Utils.js";
+
+
 /**
  * The arguments to operations.
  *
@@ -83,3 +86,5 @@ Ingredient.prepare = function(data, type) {
             return data;
     }
 };
+
+export default Ingredient;

+ 6 - 0
src/js/core/Operation.js → src/core/Operation.js

@@ -1,3 +1,7 @@
+import Dish from "./Dish.js";
+import Ingredient from "./Ingredient.js";
+
+
 /**
  * The Operation specified by the user to be run.
  *
@@ -155,3 +159,5 @@ Operation.prototype.isDisabled = function() {
 Operation.prototype.isFlowControl = function() {
     return this.flowControl;
 };
+
+export default Operation;

+ 6 - 0
src/js/core/Recipe.js → src/core/Recipe.js

@@ -1,3 +1,7 @@
+import Operation from "./Operation.js";
+import OperationConfig from "./config/OperationConfig.js";
+
+
 /**
  * The Recipe controls a list of Operations and the Dish they operate on.
  *
@@ -212,3 +216,5 @@ Recipe.prototype.fromString = function(recipeStr) {
     var recipeConfig = JSON.parse(recipeStr);
     this._parseConfig(recipeConfig);
 };
+
+export default Recipe;

+ 6 - 33
src/js/core/Utils.js → src/core/Utils.js

@@ -1,4 +1,5 @@
-/* globals CryptoJS, moment */
+import CryptoJS from "crypto-js";
+
 
 /**
  * Utility functions for use in operations, the core framework and the stage.
@@ -9,7 +10,7 @@
  *
  * @namespace
  */
-var Utils = {
+const Utils = {
 
     /**
      * Translates an ordinal into a character.
@@ -387,7 +388,7 @@ var Utils = {
         var wordArray = CryptoJS.enc.Utf8.parse(str),
             byteArray = Utils.wordArrayToByteArray(wordArray);
 
-        if (str.length !== wordArray.sigBytes)
+        if (window && str.length !== wordArray.sigBytes)
             window.app.options.attemptHighlight = false;
         return byteArray;
     },
@@ -439,7 +440,7 @@ var Utils = {
             var wordArray = new CryptoJS.lib.WordArray.init(words, byteArray.length),
                 str = CryptoJS.enc.Utf8.stringify(wordArray);
 
-            if (str.length !== wordArray.sigBytes)
+            if (window && str.length !== wordArray.sigBytes)
                 window.app.options.attemptHighlight = false;
             return str;
         } catch (err) {
@@ -1185,35 +1186,7 @@ var Utils = {
 
 };
 
-
-/**
- * A jQuery function to select a range of text.
- *
- * @param {number} start
- * @param {number} end
- *
- * @example
- * // Highlights the 4th, 5th and 6th characters in the element #input-text.
- * $("#input-text").selectRange(3,5);
- *
- * // Places the cursor at the beginning of the element #input-text.
- * $("#input-text").selectRange(0);
- */
-$.fn.selectRange = function(start, end) {
-    if (!end) end = start;
-    return this.each(function() {
-        if (this.setSelectionRange) {
-            this.focus();
-            this.setSelectionRange(start, end);
-        } else if (this.createTextRange) {
-            var range = this.createTextRange();
-            range.collapse(true);
-            range.moveEnd("character", end);
-            range.moveStart("character", start);
-            range.select();
-        }
-    });
-};
+export default Utils;
 
 
 /**

+ 3 - 1
src/js/config/Categories.js → src/core/config/Categories.js

@@ -17,7 +17,7 @@
  * @constant
  * @type {CatConf[]}
  */
-var Categories = [
+const Categories = [
     {
         name: "Favourites",
         ops: []
@@ -293,3 +293,5 @@ var Categories = [
         ]
     },
 ];
+
+export default Categories;

+ 41 - 6
src/js/config/OperationConfig.js → src/core/config/OperationConfig.js

@@ -1,8 +1,41 @@
-/*
- * Tell eslint to ignore "'Object' is not defined" errors in this file, as it references every
- * single operation object by definition.
- */
-/* eslint no-undef: "off" */
+import FlowControl from "../FlowControl.js";
+import Base from "../operations/Base.js";
+import Base58 from "../operations/Base58.js";
+import Base64 from "../operations/Base64.js";
+import BitwiseOp from "../operations/BitwiseOp.js";
+import ByteRepr from "../operations/ByteRepr.js";
+import CharEnc from "../operations/CharEnc.js";
+import Checksum from "../operations/Checksum.js";
+import Cipher from "../operations/Cipher.js";
+import Code from "../operations/Code.js";
+import Compress from "../operations/Compress.js";
+import Convert from "../operations/Convert.js";
+import DateTime from "../operations/DateTime.js";
+import Endian from "../operations/Endian.js";
+import Entropy from "../operations/Entropy.js";
+import Extract from "../operations/Extract.js";
+import FileType from "../operations/FileType.js";
+import Hash from "../operations/Hash.js";
+import Hexdump from "../operations/Hexdump.js";
+import HTML from "../operations/HTML.js";
+import HTTP from "../operations/HTTP.js";
+import IP from "../operations/IP.js";
+import JS from "../operations/JS.js";
+import MAC from "../operations/MAC.js";
+import MorseCode from "../operations/MorseCode.js";
+import NetBIOS from "../operations/NetBIOS.js";
+import Numberwang from "../operations/Numberwang.js";
+import OS from "../operations/OS.js";
+import PublicKey from "../operations/PublicKey.js";
+import Punycode from "../operations/Punycode.js";
+import QuotedPrintable from "../operations/QuotedPrintable.js";
+import Rotate from "../operations/Rotate.js";
+import SeqUtils from "../operations/SeqUtils.js";
+import StrUtils from "../operations/StrUtils.js";
+import Tidy from "../operations/Tidy.js";
+import Unicode from "../operations/Unicode.js";
+import URL_ from "../operations/URL.js";
+import UUID from "../operations/UUID.js";
 
 
 /**
@@ -45,7 +78,7 @@
  * @constant
  * @type {Object.<string, OpConf>}
  */
-var OperationConfig = {
+const OperationConfig = {
     "Fork": {
         description: "Split the input data up based on the specified delimiter and run all subsequent operations on each branch separately.<br><br>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.runFork,
@@ -3165,3 +3198,5 @@ var OperationConfig = {
         ]
     }
 };
+
+export default OperationConfig;

+ 0 - 0
src/js/lib/bzip2.js → src/core/lib/bzip2.js


+ 3 - 1
src/js/lib/canvascomponents.js → src/core/lib/canvascomponents.js

@@ -10,7 +10,7 @@
  * @constant
  * @namespace
  */
-var CanvasComponents = {
+const CanvasComponents = {
 
     drawLine: function(ctx, startX, startY, endX, endY) {
         ctx.beginPath();
@@ -182,3 +182,5 @@ var CanvasComponents = {
     },
 
 };
+
+export default CanvasComponents;

+ 8 - 4
src/js/lib/uas_parser.js → src/core/lib/uas_parser.js

@@ -24,9 +24,10 @@
   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
   WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
-"use strict";
 
-var UAS_parser = {
+import Utils from "../Utils.js";
+
+const UAS_parser = {
 	
 	parse: function (userAgent) {
 		var result = {
@@ -133,7 +134,7 @@ var UAS_parser = {
 	}
 };
 
-var UAS_cache = {
+const UAS_cache = {
 	version: '20131025-01',
 	robots: {
 		'3': {
@@ -25814,4 +25815,7 @@ var UAS_cache = {
 			'35'
 		]
 	}
-};
+};
+
+export {UAS_parser, UAS_cache};
+export default UAS_parser;

+ 16 - 2
src/js/operations/Base.js → src/core/operations/Base.js

@@ -7,7 +7,7 @@
  *
  * @namespace
  */
-var Base = {
+const Base = {
 
     /**
      * @constant
@@ -46,7 +46,21 @@ var Base = {
         if (radix < 2 || radix > 36) {
             throw "Error: Radix argument must be between 2 and 36";
         }
-        return parseInt(input.replace(/\s/g, ""), radix);
+
+        var number = input.replace(/\s/g, "").split("."),
+            result = parseInt(number[0], radix) || 0;
+
+        if (number.length === 1) return result;
+
+        // Fractional part
+        for (var i = 0; i < number[1].length; i++) {
+            var digit = parseInt(number[1][i], radix);
+            result += digit / Math.pow(radix, i+1);
+        }
+
+        return result;
     },
 
 };
+
+export default Base;

+ 6 - 1
src/js/operations/Base58.js → src/core/operations/Base58.js

@@ -1,3 +1,6 @@
+import Utils from "../Utils.js";
+
+
 /**
  * Base58 operations.
  *
@@ -7,7 +10,7 @@
  *
  * @namespace
  */
-var Base58 = {
+const Base58 = {
 
     /**
      * @constant
@@ -130,3 +133,5 @@ var Base58 = {
     },
 
 };
+
+export default Base58;

+ 6 - 1
src/js/operations/Base64.js → src/core/operations/Base64.js

@@ -1,3 +1,6 @@
+import Utils from "../Utils.js";
+
+
 /**
  * Base64 operations.
  *
@@ -7,7 +10,7 @@
  *
  * @namespace
  */
-var Base64 = {
+const Base64 = {
 
     /**
      * @constant
@@ -340,3 +343,5 @@ var Base64 = {
     },
 
 };
+
+export default Base64;

+ 6 - 2
src/js/operations/BitwiseOp.js → src/core/operations/BitwiseOp.js

@@ -1,4 +1,6 @@
-/* globals CryptoJS */
+import Utils from "../Utils.js";
+import CryptoJS from "crypto-js";
+
 
 /**
  * Bitwise operations.
@@ -9,7 +11,7 @@
  *
  * @namespace
  */
-var BitwiseOp = {
+const BitwiseOp = {
 
     /**
      * Runs bitwise operations across the input data.
@@ -304,3 +306,5 @@ var BitwiseOp = {
     },
 
 };
+
+export default BitwiseOp;

+ 8 - 4
src/js/operations/ByteRepr.js → src/core/operations/ByteRepr.js

@@ -1,4 +1,6 @@
 /* globals app */
+import Utils from "../Utils.js";
+
 
 /**
  * Byte representation operations.
@@ -9,7 +11,7 @@
  *
  * @namespace
  */
-var ByteRepr = {
+const ByteRepr = {
 
     /**
      * @constant
@@ -114,11 +116,11 @@ var ByteRepr = {
                 else if (ordinal < 4294967296) padding = 8;
                 else padding = 2;
 
-                if (padding > 2) app.options.attemptHighlight = false;
+                if (padding > 2 && app) app.options.attemptHighlight = false;
 
                 output += Utils.hex(ordinal, padding) + delim;
             } else {
-                app.options.attemptHighlight = false;
+                if (app) app.options.attemptHighlight = false;
                 output += ordinal.toString(base) + delim;
             }
         }
@@ -144,7 +146,7 @@ var ByteRepr = {
             throw "Error: Base argument must be between 2 and 36";
         }
 
-        if (base !== 16) {
+        if (base !== 16 && app) {
             app.options.attemptHighlight = false;
         }
 
@@ -419,3 +421,5 @@ var ByteRepr = {
     },
 
 };
+
+export default ByteRepr;

+ 6 - 2
src/js/operations/CharEnc.js → src/core/operations/CharEnc.js

@@ -1,4 +1,6 @@
-/* globals CryptoJS */
+import Utils from "../Utils.js";
+import CryptoJS from "crypto-js";
+
 
 /**
  * Character encoding operations.
@@ -9,7 +11,7 @@
  *
  * @namespace
  */
-var CharEnc = {
+const CharEnc = {
 
     /**
      * @constant
@@ -44,3 +46,5 @@ var CharEnc = {
     },
 
 };
+
+export default CharEnc;

+ 7 - 2
src/js/operations/Checksum.js → src/core/operations/Checksum.js

@@ -1,3 +1,6 @@
+import Utils from "../Utils.js";
+
+
 /**
  * Checksum operations.
  *
@@ -7,7 +10,7 @@
  *
  * @namespace
  */
-var Checksum = {
+const Checksum = {
 
     /**
      * Fletcher-8 Checksum operation.
@@ -121,7 +124,7 @@ var Checksum = {
      * @returns {string}
      */
     runCRC32: function(input, args) {
-        var crcTable = window.crcTable || (window.crcTable = Checksum._genCRCTable()),
+        var crcTable = global.crcTable || (global.crcTable = Checksum._genCRCTable()),
             crc = 0 ^ (-1);
 
         for (var i = 0; i < input.length; i++) {
@@ -188,3 +191,5 @@ var Checksum = {
     },
 
 };
+
+export default Checksum;

+ 9 - 4
src/js/operations/Cipher.js → src/core/operations/Cipher.js

@@ -1,4 +1,7 @@
-/* globals CryptoJS, blowfish */
+import Utils from "../Utils.js";
+import CryptoJS from "crypto-js";
+import {blowfish as Blowfish} from "sladex-blowfish";
+
 
 /**
  * Cipher operations.
@@ -9,7 +12,7 @@
  *
  * @namespace
  */
-var Cipher = {
+const Cipher = {
 
     /**
      * @constant
@@ -263,7 +266,7 @@ var Cipher = {
 
         if (key.length === 0) return "Enter a key";
 
-        var encHex = blowfish.encrypt(input, key, {
+        var encHex = Blowfish.encrypt(input, key, {
                 outputType: 1,
                 cipherMode: Cipher.BLOWFISH_MODES.indexOf(mode)
             }),
@@ -289,7 +292,7 @@ var Cipher = {
 
         input = Utils.format[inputFormat].parse(input);
 
-        return blowfish.decrypt(input.toString(CryptoJS.enc.Base64), key, {
+        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)
         });
@@ -614,6 +617,8 @@ var Cipher = {
 
 };
 
+export default Cipher;
+
 
 /**
  * Overwriting the CryptoJS OpenSSL key derivation function so that it is possible to not pass a

+ 15 - 19
src/js/operations/Code.js → src/core/operations/Code.js

@@ -1,4 +1,9 @@
-/* globals prettyPrintOne, vkbeautify, xpath */
+import Utils from "../Utils.js";
+import vkbeautify from "vkbeautify";
+import {DOMParser as dom} from "xmldom";
+import xpath from "xpath";
+import prettyPrintOne from "imports-loader?window=>global!exports-loader?prettyPrintOne!google-code-prettify/bin/prettify.min.js";
+
 
 /**
  * Code operations.
@@ -9,7 +14,7 @@
  *
  * @namespace
  */
-var Code = {
+const Code = {
 
     /**
      * @constant
@@ -332,36 +337,25 @@ var Code = {
         var query = args[0],
             delimiter = args[1];
 
-        var xml;
+        var doc;
         try {
-            xml = $.parseXML(input);
+            doc = new dom().parseFromString(input);
         } catch (err) {
             return "Invalid input XML.";
         }
 
-        var result;
+        var nodes;
         try {
-            result = xpath.evaluate(xml, query);
+            nodes = xpath.select(query, doc);
         } catch (err) {
             return "Invalid XPath. Details:\n" + err.message;
         }
 
-        var serializer = new XMLSerializer();
         var nodeToString = function(node) {
-            switch (node.nodeType) {
-                case Node.ELEMENT_NODE: return serializer.serializeToString(node);
-                case Node.ATTRIBUTE_NODE: return node.value;
-                case Node.COMMENT_NODE: return node.data;
-                case Node.DOCUMENT_NODE: return serializer.serializeToString(node);
-                default: throw new Error("Unknown Node Type: " + node.nodeType);
-            }
+            return node.toString();
         };
 
-        return Object.keys(result).map(function(key) {
-            return result[key];
-        }).slice(0, -1) // all values except last (length)
-        .map(nodeToString)
-        .join(delimiter);
+        return nodes.map(nodeToString).join(delimiter);
     },
 
 
@@ -429,3 +423,5 @@ var Code = {
     },
 
 };
+
+export default Code;

+ 22 - 2
src/js/operations/Compress.js → src/core/operations/Compress.js

@@ -1,4 +1,22 @@
-/* globals Zlib, bzip2 */
+import Utils from "../Utils.js";
+import rawdeflate from "zlibjs/bin/rawdeflate.min";
+import rawinflate from "zlibjs/bin/rawinflate.min";
+import zlibAndGzip from "zlibjs/bin/zlib_and_gzip.min";
+import zip from "zlibjs/bin/zip.min";
+import unzip from "zlibjs/bin/unzip.min";
+import bzip2 from "exports-loader?bzip2!../lib/bzip2.js";
+
+var Zlib = {
+    RawDeflate: rawdeflate.Zlib.RawDeflate,
+    RawInflate: rawinflate.Zlib.RawInflate,
+    Deflate: zlibAndGzip.Zlib.Deflate,
+    Inflate: zlibAndGzip.Zlib.Inflate,
+    Gzip: zlibAndGzip.Zlib.Gzip,
+    Gunzip: zlibAndGzip.Zlib.Gunzip,
+    Zip: zip.Zlib.Zip,
+    Unzip: unzip.Zlib.Unzip,
+};
+
 
 /**
  * Compression operations.
@@ -9,7 +27,7 @@
  *
  * @namespace
  */
-var Compress = {
+const Compress = {
 
     /**
      * @constant
@@ -556,3 +574,5 @@ var Compress = {
         return Utils.displayFilesAsHTML(files);
     },
 };
+
+export default Compress;

+ 3 - 1
src/js/operations/Convert.js → src/core/operations/Convert.js

@@ -7,7 +7,7 @@
  *
  * @namespace
  */
-var Convert = {
+const Convert = {
 
     /**
      * @constant
@@ -410,3 +410,5 @@ var Convert = {
     },
 
 };
+
+export default Convert;

+ 3 - 4
src/js/operations/DateTime.js → src/core/operations/DateTime.js

@@ -1,5 +1,3 @@
-/* globals moment */
-
 /**
  * Date and time operations.
  *
@@ -9,7 +7,7 @@
  *
  * @namespace
  */
-var DateTime = {
+const DateTime = {
 
     /**
      * @constant
@@ -450,5 +448,6 @@ var DateTime = {
   </tbody>\
 </table>",
 
-
 };
+
+export default DateTime;

+ 6 - 1
src/js/operations/Endian.js → src/core/operations/Endian.js

@@ -1,3 +1,6 @@
+import Utils from "../Utils.js";
+
+
 /**
  * Endian operations.
  *
@@ -7,7 +10,7 @@
  *
  * @namespace
  */
-var Endian = {
+const Endian = {
 
     /**
      * @constant
@@ -92,3 +95,5 @@ var Endian = {
     },
 
 };
+
+export default Endian;

+ 6 - 1
src/js/operations/Entropy.js → src/core/operations/Entropy.js

@@ -1,3 +1,6 @@
+import Utils from "../Utils.js";
+
+
 /**
  * Entropy operations.
  *
@@ -7,7 +10,7 @@
  *
  * @namespace
  */
-var Entropy = {
+const Entropy = {
 
     /**
      * @constant
@@ -164,3 +167,5 @@ var Entropy = {
     },
 
 };
+
+export default Entropy;

+ 3 - 1
src/js/operations/Extract.js → src/core/operations/Extract.js

@@ -7,7 +7,7 @@
  *
  * @namespace
  */
-var Extract = {
+const Extract = {
 
     /**
      * Runs search operations across the input data using regular expressions.
@@ -295,3 +295,5 @@ var Extract = {
     },
 
 };
+
+export default Extract;

+ 6 - 1
src/js/operations/FileType.js → src/core/operations/FileType.js

@@ -1,3 +1,6 @@
+import Utils from "../Utils.js";
+
+
 /**
  * File type operations.
  *
@@ -7,7 +10,7 @@
  *
  * @namespace
  */
-var FileType = {
+const FileType = {
 
     /**
      * Detect File Type operation.
@@ -524,3 +527,5 @@ var FileType = {
     },
 
 };
+
+export default FileType;

+ 6 - 1
src/js/operations/HTML.js → src/core/operations/HTML.js

@@ -1,3 +1,6 @@
+import Utils from "../Utils.js";
+
+
 /**
  * HTML operations.
  *
@@ -7,7 +10,7 @@
  *
  * @namespace
  */
-var HTML = {
+const HTML = {
 
     /**
      * @constant
@@ -848,3 +851,5 @@ var HTML = {
     },
 
 };
+
+export default HTML;

+ 6 - 3
src/js/operations/HTTP.js → src/core/operations/HTTP.js

@@ -1,4 +1,5 @@
-/* globals UAS_parser */
+import {UAS_parser as UAParser} from "../lib/uas_parser.js";
+
 
 /**
  * HTTP operations.
@@ -9,7 +10,7 @@
  *
  * @namespace
  */
-var HTTP = {
+const HTTP = {
 
     /**
      * Strip HTTP headers operation.
@@ -34,7 +35,7 @@ var HTTP = {
      * @returns {string}
      */
     runParseUserAgent: function(input, args) {
-        var ua = UAS_parser.parse(input); // eslint-disable-line camelcase
+        var ua = UAParser.parse(input);
 
         return "Type: " + ua.type + "\n" +
             "Family: " + ua.uaFamily + "\n" +
@@ -51,3 +52,5 @@ var HTTP = {
     },
 
 };
+
+export default HTTP;

+ 8 - 2
src/js/operations/Hash.js → src/core/operations/Hash.js

@@ -1,4 +1,8 @@
-/* globals CryptoApi, CryptoJS, Checksum */
+import Utils from "../Utils.js";
+import CryptoJS from "crypto-js";
+import CryptoApi from "crypto-api";
+import Checksum from "./Checksum.js";
+
 
 /**
  * Hashing operations.
@@ -9,7 +13,7 @@
  *
  * @namespace
  */
-var Hash = {
+const Hash = {
 
     /**
      * MD2 operation.
@@ -381,3 +385,5 @@ var Hash = {
     },
 
 };
+
+export default Hash;

+ 6 - 2
src/js/operations/Hexdump.js → src/core/operations/Hexdump.js

@@ -1,4 +1,6 @@
 /* globals app */
+import Utils from "../Utils.js";
+
 
 /**
  * Hexdump operations.
@@ -9,7 +11,7 @@
  *
  * @namespace
  */
-var Hexdump = {
+const Hexdump = {
 
     /**
      * @constant
@@ -90,7 +92,7 @@ var Hexdump = {
         var 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.attemptHighlight = false;
+            if (app) app.options.attemptHighlight = false;
         }
         return output;
     },
@@ -196,3 +198,5 @@ var Hexdump = {
     },
 
 };
+
+export default Hexdump;

+ 7 - 3
src/js/operations/IP.js → src/core/operations/IP.js

@@ -1,4 +1,7 @@
-/* globals BigInteger, Checksum */
+import Utils from "../Utils.js";
+import Checksum from "./Checksum.js";
+import {BigInteger} from "jsbn";
+
 
 /**
  * Internet Protocol address operations.
@@ -9,7 +12,7 @@
  *
  * @namespace
  */
-var IP = {
+const IP = {
 
     /**
      * @constant
@@ -1073,5 +1076,6 @@ var IP = {
         255: {keyword: "Reserved", protocol: ""}
     },
 
-
 };
+
+export default IP;

+ 7 - 2
src/js/operations/JS.js → src/core/operations/JS.js

@@ -1,4 +1,7 @@
-/* globals esprima, escodegen, esmangle */
+import esprima from "esprima";
+import escodegen from "escodegen";
+import esmangle from "esmangle";
+
 
 /**
  * JavaScript operations.
@@ -9,7 +12,7 @@
  *
  * @namespace
  */
-var JS = {
+const JS = {
 
     /**
      * @constant
@@ -157,3 +160,5 @@ var JS = {
     },
 
 };
+
+export default JS;

+ 3 - 1
src/js/operations/MAC.js → src/core/operations/MAC.js

@@ -7,7 +7,7 @@
  *
  * @namespace
  */
-var MAC = {
+const MAC = {
 
     /**
      * @constant
@@ -86,3 +86,5 @@ var MAC = {
     },
 
 };
+
+export default MAC;

+ 6 - 1
src/js/operations/MorseCode.js → src/core/operations/MorseCode.js

@@ -1,3 +1,6 @@
+import Utils from "../Utils.js";
+
+
 /**
  * Morse Code translation operations.
  *
@@ -7,7 +10,7 @@
  *
  * @namespace
  */
-var MorseCode = {
+const MorseCode = {
 
     /**
      * @constant
@@ -183,3 +186,5 @@ var MorseCode = {
     })(),
 
 };
+
+export default MorseCode;

+ 3 - 1
src/js/operations/NetBIOS.js → src/core/operations/NetBIOS.js

@@ -7,7 +7,7 @@
  *
  * @namespace
  */
-var NetBIOS = {
+const NetBIOS = {
 
     /**
      * @constant
@@ -55,3 +55,5 @@ var NetBIOS = {
     },
 
 };
+
+export default NetBIOS;

+ 3 - 1
src/js/operations/Numberwang.js → src/core/operations/Numberwang.js

@@ -4,7 +4,7 @@
  * @author Unknown Male 282
  * @namespace
  */
-var Numberwang = {
+const Numberwang = {
 
     /**
      * Numberwang operation. Remain indoors.
@@ -25,3 +25,5 @@ var Numberwang = {
     },
 
 };
+
+export default Numberwang;

+ 3 - 1
src/js/operations/OS.js → src/core/operations/OS.js

@@ -7,7 +7,7 @@
  *
  * @namespace
  */
-var OS = {
+const OS = {
 
     /**
      * Parse UNIX file permissions operation.
@@ -307,3 +307,5 @@ var OS = {
     },
 
 };
+
+export default OS;

+ 33 - 29
src/js/operations/PublicKey.js → src/core/operations/PublicKey.js

@@ -1,4 +1,6 @@
-/* globals X509, KJUR, ASN1HEX, KEYUTIL, BigInteger */
+import Utils from "../Utils.js";
+import * as r from "jsrsasign";
+
 
 /**
  * Public Key operations.
@@ -9,7 +11,7 @@
  *
  * @namespace
  */
-var PublicKey = {
+const PublicKey = {
 
     /**
      * @constant
@@ -25,7 +27,7 @@ var PublicKey = {
      * @returns {string}
      */
     runParseX509: function (input, args) {
-        var cert = new X509(),
+        var cert = new r.X509(),
             inputFormat = args[0];
 
         if (!input.length) {
@@ -36,39 +38,39 @@ var PublicKey = {
             case "DER Hex":
                 input = input.replace(/\s/g, "");
                 cert.hex = input;
-                cert.pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(input, "CERTIFICATE");
+                cert.pem = r.KJUR.asn1.ASN1Util.getPEMStringFromHex(input, "CERTIFICATE");
                 break;
             case "PEM":
-                cert.hex = X509.pemToHex(input);
+                cert.hex = r.X509.pemToHex(input);
                 cert.pem = input;
                 break;
             case "Base64":
                 cert.hex = Utils.toHex(Utils.fromBase64(input, null, "byteArray"), "");
-                cert.pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(cert.hex, "CERTIFICATE");
+                cert.pem = r.KJUR.asn1.ASN1Util.getPEMStringFromHex(cert.hex, "CERTIFICATE");
                 break;
             case "Raw":
                 cert.hex = Utils.toHex(Utils.strToByteArray(input), "");
-                cert.pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(cert.hex, "CERTIFICATE");
+                cert.pem = r.KJUR.asn1.ASN1Util.getPEMStringFromHex(cert.hex, "CERTIFICATE");
                 break;
             default:
                 throw "Undefined input format";
         }
 
-        var version = ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [0, 0, 0]),
+        var version = r.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]))),
+            algorithm = r.KJUR.asn1.x509.OID.oid2name(r.KJUR.asn1.ASN1Util.oidHexToInt(r.ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [0, 2, 0]))),
             issuer = cert.getIssuerString(),
             notBefore = cert.getNotBefore(),
             notAfter = cert.getNotAfter(),
             subject = cert.getSubjectString(),
-            pkAlgorithm = KJUR.asn1.x509.OID.oid2name(KJUR.asn1.ASN1Util.oidHexToInt(ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [0, 6, 0, 0]))),
-            pk = X509.getPublicKeyFromCertPEM(cert.pem),
+            pkAlgorithm = r.KJUR.asn1.x509.OID.oid2name(r.KJUR.asn1.ASN1Util.oidHexToInt(r.ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [0, 6, 0, 0]))),
+            pk = r.X509.getPublicKeyFromCertPEM(cert.pem),
             pkFields = [],
             pkStr = "",
-            certSigAlg = KJUR.asn1.x509.OID.oid2name(KJUR.asn1.ASN1Util.oidHexToInt(ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [1, 0]))),
-            certSig = ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [2]).substr(2),
+            certSigAlg = r.KJUR.asn1.x509.OID.oid2name(r.KJUR.asn1.ASN1Util.oidHexToInt(r.ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [1, 0]))),
+            certSig = r.ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [2]).substr(2),
             sigStr = "",
-            extensions = ASN1HEX.dump(ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [0, 7]));
+            extensions = r.ASN1HEX.dump(r.ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [0, 7]));
 
         // Public Key fields
         if (pk.type === "EC") { // ECDSA
@@ -78,7 +80,7 @@ var PublicKey = {
             });
             pkFields.push({
                 key: "Length",
-                value: (((new BigInteger(pk.pubKeyHex, 16)).bitLength()-3) /2) + " bits"
+                value: (((new r.BigInteger(pk.pubKeyHex, 16)).bitLength()-3) /2) + " bits"
             });
             pkFields.push({
                 key: "pub",
@@ -122,9 +124,9 @@ var PublicKey = {
         }
 
         // Signature fields
-        if (ASN1HEX.dump(certSig).indexOf("SEQUENCE") === 0) { // DSA or ECDSA
-            sigStr = "  r:              " + PublicKey._formatByteStr(ASN1HEX.getDecendantHexVByNthList(certSig, 0, [0]), 16, 18) + "\n" +
-                "  s:              " + PublicKey._formatByteStr(ASN1HEX.getDecendantHexVByNthList(certSig, 0, [1]), 16, 18) + "\n";
+        if (r.ASN1HEX.dump(certSig).indexOf("SEQUENCE") === 0) { // DSA or ECDSA
+            sigStr = "  r:              " + PublicKey._formatByteStr(r.ASN1HEX.getDecendantHexVByNthList(certSig, 0, [0]), 16, 18) + "\n" +
+                "  s:              " + PublicKey._formatByteStr(r.ASN1HEX.getDecendantHexVByNthList(certSig, 0, [1]), 16, 18) + "\n";
         } else { // RSA
             sigStr = "  Signature:      " + PublicKey._formatByteStr(certSig, 16, 18) + "\n";
         }
@@ -145,7 +147,7 @@ var PublicKey = {
             subjectStr = PublicKey._formatDnStr(subject, 2);
 
         var output = "Version:          " + (parseInt(version, 16) + 1) + " (0x" + version + ")\n" +
-            "Serial number:    " + new BigInteger(sn, 16).toString() + " (0x" + sn + ")\n" +
+            "Serial number:    " + new r.BigInteger(sn, 16).toString() + " (0x" + sn + ")\n" +
             "Algorithm ID:     " + algorithm + "\n" +
             "Validity\n" +
             "  Not Before:     " + nbDate + " (dd-mm-yy hh:mm:ss) (" + notBefore + ")\n" +
@@ -183,7 +185,7 @@ var PublicKey = {
             // Add footer so that the KEYUTIL function works
             input = input + "-----END CERTIFICATE-----";
         }
-        return KEYUTIL.getHexFromPEM(input);
+        return r.KEYUTIL.getHexFromPEM(input);
     },
 
 
@@ -201,7 +203,7 @@ var PublicKey = {
      * @returns {string}
      */
     runHexToPem: function(input, args) {
-        return KJUR.asn1.ASN1Util.getPEMStringFromHex(input.replace(/\s/g, ""), args[0]);
+        return r.KJUR.asn1.ASN1Util.getPEMStringFromHex(input.replace(/\s/g, ""), args[0]);
     },
 
 
@@ -213,7 +215,7 @@ var PublicKey = {
      * @returns {string}
      */
     runHexToObjectIdentifier: function(input, args) {
-        return KJUR.asn1.ASN1Util.oidHexToInt(input.replace(/\s/g, ""));
+        return r.KJUR.asn1.ASN1Util.oidHexToInt(input.replace(/\s/g, ""));
     },
 
 
@@ -225,7 +227,7 @@ var PublicKey = {
      * @returns {string}
      */
     runObjectIdentifierToHex: function(input, args) {
-        return KJUR.asn1.ASN1Util.oidIntToHex(input);
+        return r.KJUR.asn1.ASN1Util.oidIntToHex(input);
     },
 
 
@@ -245,7 +247,7 @@ var PublicKey = {
     runParseAsn1HexString: function(input, args) {
         var truncateLen = args[1],
             index = args[0];
-        return ASN1HEX.dump(input.replace(/\s/g, ""), {
+        return r.ASN1HEX.dump(input.replace(/\s/g, ""), {
             "ommitLongOctet": truncateLen
         }, index);
     },
@@ -334,6 +336,8 @@ var PublicKey = {
 
 };
 
+export default PublicKey;
+
 
 /**
  * Overwrite X509.hex2dn function so as to join RDNs with a string which can be split on without
@@ -342,12 +346,12 @@ var PublicKey = {
  * @param {string} hDN - Hex DN string
  * @returns {string}
  */
-X509.hex2dn = function(hDN) {
+r.X509.hex2dn = function(hDN) {
     var s = "";
-    var a = ASN1HEX.getPosArrayOfChildren_AtObj(hDN, 0);
+    var a = r.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);
+        var hRDN = r.ASN1HEX.getHexOfTLV_AtObj(hDN, a[i]);
+        s = s + ",/|" + r.X509.hex2rdn(hRDN);
     }
     return s;
 };
@@ -361,7 +365,7 @@ X509.hex2dn = function(hDN) {
  *
  * @constant
  */
-X509.DN_ATTRHEX = {
+r.X509.DN_ATTRHEX = {
     "0603550403" : "commonName",
     "0603550404" : "surname",
     "0603550406" : "countryName",

+ 7 - 4
src/js/operations/Punycode.js → src/core/operations/Punycode.js

@@ -1,4 +1,5 @@
-/* globals punycode */
+import punycode from "punycode";
+
 
 /**
  * Punycode operations.
@@ -9,7 +10,7 @@
  *
  * @namespace
  */
-var Punycode = {
+const Punycode = {
 
     /**
      * @constant
@@ -28,7 +29,7 @@ var Punycode = {
         var idn = args[0];
 
         if (idn) {
-            return punycode.ToASCII(input);
+            return punycode.toASCII(input);
         } else {
             return punycode.encode(input);
         }
@@ -46,10 +47,12 @@ var Punycode = {
         var idn = args[0];
 
         if (idn) {
-            return punycode.ToUnicode(input);
+            return punycode.toUnicode(input);
         } else {
             return punycode.decode(input);
         }
     },
 
 };
+
+export default Punycode;

+ 3 - 1
src/js/operations/QuotedPrintable.js → src/core/operations/QuotedPrintable.js

@@ -30,7 +30,7 @@
  *
  * @namespace
  */
-var QuotedPrintable = {
+const QuotedPrintable = {
 
     /**
      * To Quoted Printable operation.
@@ -268,3 +268,5 @@ var QuotedPrintable = {
     },
 
 };
+
+export default QuotedPrintable;

+ 3 - 1
src/js/operations/Rotate.js → src/core/operations/Rotate.js

@@ -9,7 +9,7 @@
  *
  * @todo Support for UTF16
  */
-var Rotate = {
+const Rotate = {
 
     /**
      * @constant
@@ -240,3 +240,5 @@ var Rotate = {
     },
 
 };
+
+export default Rotate;

+ 6 - 1
src/js/operations/SeqUtils.js → src/core/operations/SeqUtils.js

@@ -1,3 +1,6 @@
+import Utils from "../Utils.js";
+
+
 /**
  * Sequence utility operations.
  *
@@ -7,7 +10,7 @@
  *
  * @namespace
  */
-var SeqUtils = {
+const SeqUtils = {
 
     /**
      * @constant
@@ -218,3 +221,5 @@ var SeqUtils = {
     },
 
 };
+
+export default SeqUtils;

+ 6 - 2
src/js/operations/StrUtils.js → src/core/operations/StrUtils.js

@@ -1,4 +1,6 @@
-/* globals JsDiff */
+import Utils from "../Utils.js";
+import * as JsDiff from "diff";
+
 
 /**
  * String utility operations.
@@ -9,7 +11,7 @@
  *
  * @namespace
  */
-var StrUtils = {
+const StrUtils = {
 
     /**
      * @constant
@@ -536,3 +538,5 @@ var StrUtils = {
     },
 
 };
+
+export default StrUtils;

+ 6 - 1
src/js/operations/Tidy.js → src/core/operations/Tidy.js

@@ -1,3 +1,6 @@
+import Utils from "../Utils.js";
+
+
 /**
  * Tidy operations.
  *
@@ -7,7 +10,7 @@
  *
  * @namespace
  */
-var Tidy = {
+const Tidy = {
 
     /**
      * @constant
@@ -236,3 +239,5 @@ var Tidy = {
     },
 
 };
+
+export default Tidy;

+ 9 - 1
src/js/operations/URL.js → src/core/operations/URL.js

@@ -1,4 +1,6 @@
 /* globals unescape */
+import Utils from "../Utils.js";
+
 
 /**
  * URL operations.
@@ -10,7 +12,7 @@
  *
  * @namespace
  */
-var URL_ = {
+const URL_ = {
 
     /**
      * @constant
@@ -56,6 +58,10 @@ var URL_ = {
      * @returns {string}
      */
     runParse: function(input, args) {
+        if (!document) {
+            throw "This operation only works in a browser.";
+        }
+
         var a = document.createElement("a");
 
         // Overwrite base href which will be the current CyberChef URL to reduce confusion.
@@ -128,3 +134,5 @@ var URL_ = {
     },
 
 };
+
+export default URL_;

+ 4 - 2
src/js/operations/UUID.js → src/core/operations/UUID.js

@@ -7,7 +7,7 @@
  *
  * @namespace
  */
-var UUID = {
+const UUID = {
 
     /**
      * Generate UUID operation.
@@ -17,7 +17,7 @@ var UUID = {
      * @returns {string}
      */
     runGenerateV4: function(input, args) {
-        if (typeof(window.crypto) !== "undefined" && typeof(window.crypto.getRandomValues) !== "undefined") {
+        if (window && typeof(window.crypto) !== "undefined" && typeof(window.crypto.getRandomValues) !== "undefined") {
             var buf = new Uint32Array(4),
                 i = 0;
             window.crypto.getRandomValues(buf);
@@ -37,3 +37,5 @@ var UUID = {
     },
 
 };
+
+export default UUID;

+ 6 - 1
src/js/operations/Unicode.js → src/core/operations/Unicode.js

@@ -1,3 +1,6 @@
+import Utils from "../Utils.js";
+
+
 /**
  * Unicode operations.
  *
@@ -7,7 +10,7 @@
  *
  * @namespace
  */
-var Unicode = {
+const Unicode = {
 
     /**
      * @constant
@@ -60,3 +63,5 @@ var Unicode = {
     },
 
 };
+
+export default Unicode;

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 13
src/css/lib/bootstrap-colorpicker.css


+ 0 - 221
src/css/lib/bootstrap-switch.css

@@ -1,221 +0,0 @@
-/** @license
-========================================================================
-  bootstrap-switch - v3.1.0
-  http://www.bootstrap-switch.org
-  Copyright 2012-2013 Mattia Larentis
- 
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
- 
-  http://www.apache.org/licenses/LICENSE-2.0
- 
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-*/
-
-.bootstrap-switch {
-  display: inline-block;
-  cursor: pointer;
-  border-radius: 4px;
-  border: 1px solid;
-  border-color: #cccccc;
-  position: relative;
-  text-align: left;
-  overflow: hidden;
-  line-height: 8px;
-  -webkit-user-select: none;
-  -moz-user-select: none;
-  -ms-user-select: none;
-  user-select: none;
-  vertical-align: middle;
-  min-width: 100px;
-  -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-  transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-}
-.bootstrap-switch.bootstrap-switch-mini {
-  min-width: 71px;
-}
-.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,
-.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,
-.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label {
-  padding-bottom: 4px;
-  padding-top: 4px;
-  font-size: 10px;
-  line-height: 9px;
-}
-.bootstrap-switch.bootstrap-switch-small {
-  min-width: 79px;
-}
-.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,
-.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,
-.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label {
-  padding-bottom: 3px;
-  padding-top: 3px;
-  font-size: 12px;
-  line-height: 18px;
-}
-.bootstrap-switch.bootstrap-switch-large {
-  min-width: 120px;
-}
-.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,
-.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,
-.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label {
-  padding-bottom: 9px;
-  padding-top: 9px;
-  font-size: 16px;
-  line-height: normal;
-}
-.bootstrap-switch.bootstrap-switch-disabled,
-.bootstrap-switch.bootstrap-switch-readonly,
-.bootstrap-switch.bootstrap-switch-indeterminate {
-  opacity: 0.5;
-  filter: alpha(opacity=50);
-  cursor: default !important;
-}
-.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,
-.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on,
-.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on,
-.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off,
-.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off,
-.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off,
-.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label,
-.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label,
-.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label {
-  cursor: default !important;
-}
-.bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container {
-  -webkit-transition: margin-left 0.5s;
-  transition: margin-left 0.5s;
-}
-.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-on {
-  border-bottom-left-radius: 0;
-  border-top-left-radius: 0;
-  border-bottom-right-radius: 3px;
-  border-top-right-radius: 3px;
-}
-.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-off {
-  border-bottom-right-radius: 0;
-  border-top-right-radius: 0;
-  border-bottom-left-radius: 3px;
-  border-top-left-radius: 3px;
-}
-.bootstrap-switch.bootstrap-switch-focused {
-  border-color: #66afe9;
-  outline: 0;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
-  box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
-}
-.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-container,
-.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-container {
-  margin-left: 0%;
-}
-.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label,
-.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label {
-  border-bottom-right-radius: 3px;
-  border-top-right-radius: 3px;
-}
-.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-container,
-.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-container {
-  margin-left: -50%;
-}
-.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label,
-.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label {
-  border-bottom-left-radius: 3px;
-  border-top-left-radius: 3px;
-}
-.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-container,
-.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-indeterminate .bootstrap-switch-container {
-  margin-left: -25%;
-}
-.bootstrap-switch .bootstrap-switch-container {
-  display: inline-block;
-  width: 150%;
-  top: 0;
-  border-radius: 4px;
-  -webkit-transform: translate3d(0, 0, 0);
-  transform: translate3d(0, 0, 0);
-}
-.bootstrap-switch .bootstrap-switch-handle-on,
-.bootstrap-switch .bootstrap-switch-handle-off,
-.bootstrap-switch .bootstrap-switch-label {
-  -webkit-box-sizing: border-box;
-  -moz-box-sizing: border-box;
-  box-sizing: border-box;
-  cursor: pointer;
-  display: inline-block !important;
-  height: 100%;
-  padding-bottom: 4px;
-  padding-top: 4px;
-  font-size: 14px;
-  line-height: 20px;
-}
-.bootstrap-switch .bootstrap-switch-handle-on,
-.bootstrap-switch .bootstrap-switch-handle-off {
-  text-align: center;
-  z-index: 1;
-  width: 33.333333333%;
-}
-.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,
-.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary {
-  color: #fff;
-  background: #428bca;
-}
-.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info,
-.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info {
-  color: #fff;
-  background: #5bc0de;
-}
-.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success,
-.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success {
-  color: #fff;
-  background: #5cb85c;
-}
-.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning,
-.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning {
-  background: #f0ad4e;
-  color: #fff;
-}
-.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger,
-.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger {
-  color: #fff;
-  background: #d9534f;
-}
-.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default,
-.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default {
-  color: #000;
-  background: #eeeeee;
-}
-.bootstrap-switch .bootstrap-switch-label {
-  text-align: center;
-  margin-top: -1px;
-  margin-bottom: -1px;
-  z-index: 100;
-  width: 33.333333333%;
-  color: #333333;
-  background: #ffffff;
-}
-.bootstrap-switch .bootstrap-switch-handle-on {
-  border-bottom-left-radius: 3px;
-  border-top-left-radius: 3px;
-}
-.bootstrap-switch .bootstrap-switch-handle-off {
-  border-bottom-right-radius: 3px;
-  border-top-right-radius: 3px;
-}
-.bootstrap-switch input[type='radio'],
-.bootstrap-switch input[type='checkbox'] {
-  position: absolute !important;
-  top: 0;
-  left: 0;
-  opacity: 0;
-  filter: alpha(opacity=0);
-  z-index: -1;
-}
-.bootstrap-switch input[type='radio'].form-control,
-.bootstrap-switch input[type='checkbox'].form-control {
-  height: auto;
-}

+ 0 - 6764
src/css/lib/bootstrap3.min.css

@@ -1,6764 +0,0 @@
-/** @license
-========================================================================
-  Bootstrap v3.3.6 (http://getbootstrap.com)
-  Copyright 2011-2016 Twitter, Inc.
-  Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- 
-  normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css
-*/
-
-html {
-  font-family: sans-serif;
-  -webkit-text-size-adjust: 100%;
-      -ms-text-size-adjust: 100%;
-}
-body {
-  margin: 0;
-}
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-main,
-menu,
-nav,
-section,
-summary {
-  display: block;
-}
-audio,
-canvas,
-progress,
-video {
-  display: inline-block;
-  vertical-align: baseline;
-}
-audio:not([controls]) {
-  display: none;
-  height: 0;
-}
-[hidden],
-template {
-  display: none;
-}
-a {
-  background-color: transparent;
-}
-a:active,
-a:hover {
-  outline: 0;
-}
-abbr[title] {
-  border-bottom: 1px dotted;
-}
-b,
-strong {
-  font-weight: bold;
-}
-dfn {
-  font-style: italic;
-}
-h1 {
-  margin: .67em 0;
-  font-size: 2em;
-}
-mark {
-  color: #000;
-  background: #ff0;
-}
-small {
-  font-size: 80%;
-}
-sub,
-sup {
-  position: relative;
-  font-size: 75%;
-  line-height: 0;
-  vertical-align: baseline;
-}
-sup {
-  top: -.5em;
-}
-sub {
-  bottom: -.25em;
-}
-img {
-  border: 0;
-}
-svg:not(:root) {
-  overflow: hidden;
-}
-figure {
-  margin: 1em 40px;
-}
-hr {
-  height: 0;
-  -webkit-box-sizing: content-box;
-     -moz-box-sizing: content-box;
-          box-sizing: content-box;
-}
-pre {
-  overflow: auto;
-}
-code,
-kbd,
-pre,
-samp {
-  font-family: monospace, monospace;
-  font-size: 1em;
-}
-button,
-input,
-optgroup,
-select,
-textarea {
-  margin: 0;
-  font: inherit;
-  color: inherit;
-}
-button {
-  overflow: visible;
-}
-button,
-select {
-  text-transform: none;
-}
-button,
-html input[type="button"],
-input[type="reset"],
-input[type="submit"] {
-  -webkit-appearance: button;
-  cursor: pointer;
-}
-button[disabled],
-html input[disabled] {
-  cursor: default;
-}
-button::-moz-focus-inner,
-input::-moz-focus-inner {
-  padding: 0;
-  border: 0;
-}
-input {
-  line-height: normal;
-}
-input[type="checkbox"],
-input[type="radio"] {
-  -webkit-box-sizing: border-box;
-     -moz-box-sizing: border-box;
-          box-sizing: border-box;
-  padding: 0;
-}
-input[type="number"]::-webkit-inner-spin-button,
-input[type="number"]::-webkit-outer-spin-button {
-  height: auto;
-}
-input[type="search"] {
-  -webkit-box-sizing: content-box;
-     -moz-box-sizing: content-box;
-          box-sizing: content-box;
-  -webkit-appearance: textfield;
-}
-input[type="search"]::-webkit-search-cancel-button,
-input[type="search"]::-webkit-search-decoration {
-  -webkit-appearance: none;
-}
-fieldset {
-  padding: .35em .625em .75em;
-  margin: 0 2px;
-  border: 1px solid #c0c0c0;
-}
-legend {
-  padding: 0;
-  border: 0;
-}
-textarea {
-  overflow: auto;
-}
-optgroup {
-  font-weight: bold;
-}
-table {
-  border-spacing: 0;
-  border-collapse: collapse;
-}
-td,
-th {
-  padding: 0;
-}
-/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
-@media print {
-  *,
-  *:before,
-  *:after {
-    color: #000 !important;
-    text-shadow: none !important;
-    background: transparent !important;
-    -webkit-box-shadow: none !important;
-            box-shadow: none !important;
-  }
-  a,
-  a:visited {
-    text-decoration: underline;
-  }
-  a[href]:after {
-    content: " (" attr(href) ")";
-  }
-  abbr[title]:after {
-    content: " (" attr(title) ")";
-  }
-  a[href^="#"]:after,
-  a[href^="javascript:"]:after {
-    content: "";
-  }
-  pre,
-  blockquote {
-    border: 1px solid #999;
-
-    page-break-inside: avoid;
-  }
-  thead {
-    display: table-header-group;
-  }
-  tr,
-  img {
-    page-break-inside: avoid;
-  }
-  img {
-    max-width: 100% !important;
-  }
-  p,
-  h2,
-  h3 {
-    orphans: 3;
-    widows: 3;
-  }
-  h2,
-  h3 {
-    page-break-after: avoid;
-  }
-  .navbar {
-    display: none;
-  }
-  .btn > .caret,
-  .dropup > .btn > .caret {
-    border-top-color: #000 !important;
-  }
-  .label {
-    border: 1px solid #000;
-  }
-  .table {
-    border-collapse: collapse !important;
-  }
-  .table td,
-  .table th {
-    background-color: #fff !important;
-  }
-  .table-bordered th,
-  .table-bordered td {
-    border: 1px solid #ddd !important;
-  }
-}
-@font-face {
-  font-family: 'Glyphicons Halflings';
-
-  src: url('../fonts/glyphicons-halflings-regular.eot');
-  src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
-}
-.glyphicon {
-  position: relative;
-  top: 1px;
-  display: inline-block;
-  font-family: 'Glyphicons Halflings';
-  font-style: normal;
-  font-weight: normal;
-  line-height: 1;
-
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-}
-.glyphicon-asterisk:before {
-  content: "\002a";
-}
-.glyphicon-plus:before {
-  content: "\002b";
-}
-.glyphicon-euro:before,
-.glyphicon-eur:before {
-  content: "\20ac";
-}
-.glyphicon-minus:before {
-  content: "\2212";
-}
-.glyphicon-cloud:before {
-  content: "\2601";
-}
-.glyphicon-envelope:before {
-  content: "\2709";
-}
-.glyphicon-pencil:before {
-  content: "\270f";
-}
-.glyphicon-glass:before {
-  content: "\e001";
-}
-.glyphicon-music:before {
-  content: "\e002";
-}
-.glyphicon-search:before {
-  content: "\e003";
-}
-.glyphicon-heart:before {
-  content: "\e005";
-}
-.glyphicon-star:before {
-  content: "\e006";
-}
-.glyphicon-star-empty:before {
-  content: "\e007";
-}
-.glyphicon-user:before {
-  content: "\e008";
-}
-.glyphicon-film:before {
-  content: "\e009";
-}
-.glyphicon-th-large:before {
-  content: "\e010";
-}
-.glyphicon-th:before {
-  content: "\e011";
-}
-.glyphicon-th-list:before {
-  content: "\e012";
-}
-.glyphicon-ok:before {
-  content: "\e013";
-}
-.glyphicon-remove:before {
-  content: "\e014";
-}
-.glyphicon-zoom-in:before {
-  content: "\e015";
-}
-.glyphicon-zoom-out:before {
-  content: "\e016";
-}
-.glyphicon-off:before {
-  content: "\e017";
-}
-.glyphicon-signal:before {
-  content: "\e018";
-}
-.glyphicon-cog:before {
-  content: "\e019";
-}
-.glyphicon-trash:before {
-  content: "\e020";
-}
-.glyphicon-home:before {
-  content: "\e021";
-}
-.glyphicon-file:before {
-  content: "\e022";
-}
-.glyphicon-time:before {
-  content: "\e023";
-}
-.glyphicon-road:before {
-  content: "\e024";
-}
-.glyphicon-download-alt:before {
-  content: "\e025";
-}
-.glyphicon-download:before {
-  content: "\e026";
-}
-.glyphicon-upload:before {
-  content: "\e027";
-}
-.glyphicon-inbox:before {
-  content: "\e028";
-}
-.glyphicon-play-circle:before {
-  content: "\e029";
-}
-.glyphicon-repeat:before {
-  content: "\e030";
-}
-.glyphicon-refresh:before {
-  content: "\e031";
-}
-.glyphicon-list-alt:before {
-  content: "\e032";
-}
-.glyphicon-lock:before {
-  content: "\e033";
-}
-.glyphicon-flag:before {
-  content: "\e034";
-}
-.glyphicon-headphones:before {
-  content: "\e035";
-}
-.glyphicon-volume-off:before {
-  content: "\e036";
-}
-.glyphicon-volume-down:before {
-  content: "\e037";
-}
-.glyphicon-volume-up:before {
-  content: "\e038";
-}
-.glyphicon-qrcode:before {
-  content: "\e039";
-}
-.glyphicon-barcode:before {
-  content: "\e040";
-}
-.glyphicon-tag:before {
-  content: "\e041";
-}
-.glyphicon-tags:before {
-  content: "\e042";
-}
-.glyphicon-book:before {
-  content: "\e043";
-}
-.glyphicon-bookmark:before {
-  content: "\e044";
-}
-.glyphicon-print:before {
-  content: "\e045";
-}
-.glyphicon-camera:before {
-  content: "\e046";
-}
-.glyphicon-font:before {
-  content: "\e047";
-}
-.glyphicon-bold:before {
-  content: "\e048";
-}
-.glyphicon-italic:before {
-  content: "\e049";
-}
-.glyphicon-text-height:before {
-  content: "\e050";
-}
-.glyphicon-text-width:before {
-  content: "\e051";
-}
-.glyphicon-align-left:before {
-  content: "\e052";
-}
-.glyphicon-align-center:before {
-  content: "\e053";
-}
-.glyphicon-align-right:before {
-  content: "\e054";
-}
-.glyphicon-align-justify:before {
-  content: "\e055";
-}
-.glyphicon-list:before {
-  content: "\e056";
-}
-.glyphicon-indent-left:before {
-  content: "\e057";
-}
-.glyphicon-indent-right:before {
-  content: "\e058";
-}
-.glyphicon-facetime-video:before {
-  content: "\e059";
-}
-.glyphicon-picture:before {
-  content: "\e060";
-}
-.glyphicon-map-marker:before {
-  content: "\e062";
-}
-.glyphicon-adjust:before {
-  content: "\e063";
-}
-.glyphicon-tint:before {
-  content: "\e064";
-}
-.glyphicon-edit:before {
-  content: "\e065";
-}
-.glyphicon-share:before {
-  content: "\e066";
-}
-.glyphicon-check:before {
-  content: "\e067";
-}
-.glyphicon-move:before {
-  content: "\e068";
-}
-.glyphicon-step-backward:before {
-  content: "\e069";
-}
-.glyphicon-fast-backward:before {
-  content: "\e070";
-}
-.glyphicon-backward:before {
-  content: "\e071";
-}
-.glyphicon-play:before {
-  content: "\e072";
-}
-.glyphicon-pause:before {
-  content: "\e073";
-}
-.glyphicon-stop:before {
-  content: "\e074";
-}
-.glyphicon-forward:before {
-  content: "\e075";
-}
-.glyphicon-fast-forward:before {
-  content: "\e076";
-}
-.glyphicon-step-forward:before {
-  content: "\e077";
-}
-.glyphicon-eject:before {
-  content: "\e078";
-}
-.glyphicon-chevron-left:before {
-  content: "\e079";
-}
-.glyphicon-chevron-right:before {
-  content: "\e080";
-}
-.glyphicon-plus-sign:before {
-  content: "\e081";
-}
-.glyphicon-minus-sign:before {
-  content: "\e082";
-}
-.glyphicon-remove-sign:before {
-  content: "\e083";
-}
-.glyphicon-ok-sign:before {
-  content: "\e084";
-}
-.glyphicon-question-sign:before {
-  content: "\e085";
-}
-.glyphicon-info-sign:before {
-  content: "\e086";
-}
-.glyphicon-screenshot:before {
-  content: "\e087";
-}
-.glyphicon-remove-circle:before {
-  content: "\e088";
-}
-.glyphicon-ok-circle:before {
-  content: "\e089";
-}
-.glyphicon-ban-circle:before {
-  content: "\e090";
-}
-.glyphicon-arrow-left:before {
-  content: "\e091";
-}
-.glyphicon-arrow-right:before {
-  content: "\e092";
-}
-.glyphicon-arrow-up:before {
-  content: "\e093";
-}
-.glyphicon-arrow-down:before {
-  content: "\e094";
-}
-.glyphicon-share-alt:before {
-  content: "\e095";
-}
-.glyphicon-resize-full:before {
-  content: "\e096";
-}
-.glyphicon-resize-small:before {
-  content: "\e097";
-}
-.glyphicon-exclamation-sign:before {
-  content: "\e101";
-}
-.glyphicon-gift:before {
-  content: "\e102";
-}
-.glyphicon-leaf:before {
-  content: "\e103";
-}
-.glyphicon-fire:before {
-  content: "\e104";
-}
-.glyphicon-eye-open:before {
-  content: "\e105";
-}
-.glyphicon-eye-close:before {
-  content: "\e106";
-}
-.glyphicon-warning-sign:before {
-  content: "\e107";
-}
-.glyphicon-plane:before {
-  content: "\e108";
-}
-.glyphicon-calendar:before {
-  content: "\e109";
-}
-.glyphicon-random:before {
-  content: "\e110";
-}
-.glyphicon-comment:before {
-  content: "\e111";
-}
-.glyphicon-magnet:before {
-  content: "\e112";
-}
-.glyphicon-chevron-up:before {
-  content: "\e113";
-}
-.glyphicon-chevron-down:before {
-  content: "\e114";
-}
-.glyphicon-retweet:before {
-  content: "\e115";
-}
-.glyphicon-shopping-cart:before {
-  content: "\e116";
-}
-.glyphicon-folder-close:before {
-  content: "\e117";
-}
-.glyphicon-folder-open:before {
-  content: "\e118";
-}
-.glyphicon-resize-vertical:before {
-  content: "\e119";
-}
-.glyphicon-resize-horizontal:before {
-  content: "\e120";
-}
-.glyphicon-hdd:before {
-  content: "\e121";
-}
-.glyphicon-bullhorn:before {
-  content: "\e122";
-}
-.glyphicon-bell:before {
-  content: "\e123";
-}
-.glyphicon-certificate:before {
-  content: "\e124";
-}
-.glyphicon-thumbs-up:before {
-  content: "\e125";
-}
-.glyphicon-thumbs-down:before {
-  content: "\e126";
-}
-.glyphicon-hand-right:before {
-  content: "\e127";
-}
-.glyphicon-hand-left:before {
-  content: "\e128";
-}
-.glyphicon-hand-up:before {
-  content: "\e129";
-}
-.glyphicon-hand-down:before {
-  content: "\e130";
-}
-.glyphicon-circle-arrow-right:before {
-  content: "\e131";
-}
-.glyphicon-circle-arrow-left:before {
-  content: "\e132";
-}
-.glyphicon-circle-arrow-up:before {
-  content: "\e133";
-}
-.glyphicon-circle-arrow-down:before {
-  content: "\e134";
-}
-.glyphicon-globe:before {
-  content: "\e135";
-}
-.glyphicon-wrench:before {
-  content: "\e136";
-}
-.glyphicon-tasks:before {
-  content: "\e137";
-}
-.glyphicon-filter:before {
-  content: "\e138";
-}
-.glyphicon-briefcase:before {
-  content: "\e139";
-}
-.glyphicon-fullscreen:before {
-  content: "\e140";
-}
-.glyphicon-dashboard:before {
-  content: "\e141";
-}
-.glyphicon-paperclip:before {
-  content: "\e142";
-}
-.glyphicon-heart-empty:before {
-  content: "\e143";
-}
-.glyphicon-link:before {
-  content: "\e144";
-}
-.glyphicon-phone:before {
-  content: "\e145";
-}
-.glyphicon-pushpin:before {
-  content: "\e146";
-}
-.glyphicon-usd:before {
-  content: "\e148";
-}
-.glyphicon-gbp:before {
-  content: "\e149";
-}
-.glyphicon-sort:before {
-  content: "\e150";
-}
-.glyphicon-sort-by-alphabet:before {
-  content: "\e151";
-}
-.glyphicon-sort-by-alphabet-alt:before {
-  content: "\e152";
-}
-.glyphicon-sort-by-order:before {
-  content: "\e153";
-}
-.glyphicon-sort-by-order-alt:before {
-  content: "\e154";
-}
-.glyphicon-sort-by-attributes:before {
-  content: "\e155";
-}
-.glyphicon-sort-by-attributes-alt:before {
-  content: "\e156";
-}
-.glyphicon-unchecked:before {
-  content: "\e157";
-}
-.glyphicon-expand:before {
-  content: "\e158";
-}
-.glyphicon-collapse-down:before {
-  content: "\e159";
-}
-.glyphicon-collapse-up:before {
-  content: "\e160";
-}
-.glyphicon-log-in:before {
-  content: "\e161";
-}
-.glyphicon-flash:before {
-  content: "\e162";
-}
-.glyphicon-log-out:before {
-  content: "\e163";
-}
-.glyphicon-new-window:before {
-  content: "\e164";
-}
-.glyphicon-record:before {
-  content: "\e165";
-}
-.glyphicon-save:before {
-  content: "\e166";
-}
-.glyphicon-open:before {
-  content: "\e167";
-}
-.glyphicon-saved:before {
-  content: "\e168";
-}
-.glyphicon-import:before {
-  content: "\e169";
-}
-.glyphicon-export:before {
-  content: "\e170";
-}
-.glyphicon-send:before {
-  content: "\e171";
-}
-.glyphicon-floppy-disk:before {
-  content: "\e172";
-}
-.glyphicon-floppy-saved:before {
-  content: "\e173";
-}
-.glyphicon-floppy-remove:before {
-  content: "\e174";
-}
-.glyphicon-floppy-save:before {
-  content: "\e175";
-}
-.glyphicon-floppy-open:before {
-  content: "\e176";
-}
-.glyphicon-credit-card:before {
-  content: "\e177";
-}
-.glyphicon-transfer:before {
-  content: "\e178";
-}
-.glyphicon-cutlery:before {
-  content: "\e179";
-}
-.glyphicon-header:before {
-  content: "\e180";
-}
-.glyphicon-compressed:before {
-  content: "\e181";
-}
-.glyphicon-earphone:before {
-  content: "\e182";
-}
-.glyphicon-phone-alt:before {
-  content: "\e183";
-}
-.glyphicon-tower:before {
-  content: "\e184";
-}
-.glyphicon-stats:before {
-  content: "\e185";
-}
-.glyphicon-sd-video:before {
-  content: "\e186";
-}
-.glyphicon-hd-video:before {
-  content: "\e187";
-}
-.glyphicon-subtitles:before {
-  content: "\e188";
-}
-.glyphicon-sound-stereo:before {
-  content: "\e189";
-}
-.glyphicon-sound-dolby:before {
-  content: "\e190";
-}
-.glyphicon-sound-5-1:before {
-  content: "\e191";
-}
-.glyphicon-sound-6-1:before {
-  content: "\e192";
-}
-.glyphicon-sound-7-1:before {
-  content: "\e193";
-}
-.glyphicon-copyright-mark:before {
-  content: "\e194";
-}
-.glyphicon-registration-mark:before {
-  content: "\e195";
-}
-.glyphicon-cloud-download:before {
-  content: "\e197";
-}
-.glyphicon-cloud-upload:before {
-  content: "\e198";
-}
-.glyphicon-tree-conifer:before {
-  content: "\e199";
-}
-.glyphicon-tree-deciduous:before {
-  content: "\e200";
-}
-.glyphicon-cd:before {
-  content: "\e201";
-}
-.glyphicon-save-file:before {
-  content: "\e202";
-}
-.glyphicon-open-file:before {
-  content: "\e203";
-}
-.glyphicon-level-up:before {
-  content: "\e204";
-}
-.glyphicon-copy:before {
-  content: "\e205";
-}
-.glyphicon-paste:before {
-  content: "\e206";
-}
-.glyphicon-alert:before {
-  content: "\e209";
-}
-.glyphicon-equalizer:before {
-  content: "\e210";
-}
-.glyphicon-king:before {
-  content: "\e211";
-}
-.glyphicon-queen:before {
-  content: "\e212";
-}
-.glyphicon-pawn:before {
-  content: "\e213";
-}
-.glyphicon-bishop:before {
-  content: "\e214";
-}
-.glyphicon-knight:before {
-  content: "\e215";
-}
-.glyphicon-baby-formula:before {
-  content: "\e216";
-}
-.glyphicon-tent:before {
-  content: "\26fa";
-}
-.glyphicon-blackboard:before {
-  content: "\e218";
-}
-.glyphicon-bed:before {
-  content: "\e219";
-}
-.glyphicon-apple:before {
-  content: "\f8ff";
-}
-.glyphicon-erase:before {
-  content: "\e221";
-}
-.glyphicon-hourglass:before {
-  content: "\231b";
-}
-.glyphicon-lamp:before {
-  content: "\e223";
-}
-.glyphicon-duplicate:before {
-  content: "\e224";
-}
-.glyphicon-piggy-bank:before {
-  content: "\e225";
-}
-.glyphicon-scissors:before {
-  content: "\e226";
-}
-.glyphicon-bitcoin:before {
-  content: "\e227";
-}
-.glyphicon-btc:before {
-  content: "\e227";
-}
-.glyphicon-xbt:before {
-  content: "\e227";
-}
-.glyphicon-yen:before {
-  content: "\00a5";
-}
-.glyphicon-jpy:before {
-  content: "\00a5";
-}
-.glyphicon-ruble:before {
-  content: "\20bd";
-}
-.glyphicon-rub:before {
-  content: "\20bd";
-}
-.glyphicon-scale:before {
-  content: "\e230";
-}
-.glyphicon-ice-lolly:before {
-  content: "\e231";
-}
-.glyphicon-ice-lolly-tasted:before {
-  content: "\e232";
-}
-.glyphicon-education:before {
-  content: "\e233";
-}
-.glyphicon-option-horizontal:before {
-  content: "\e234";
-}
-.glyphicon-option-vertical:before {
-  content: "\e235";
-}
-.glyphicon-menu-hamburger:before {
-  content: "\e236";
-}
-.glyphicon-modal-window:before {
-  content: "\e237";
-}
-.glyphicon-oil:before {
-  content: "\e238";
-}
-.glyphicon-grain:before {
-  content: "\e239";
-}
-.glyphicon-sunglasses:before {
-  content: "\e240";
-}
-.glyphicon-text-size:before {
-  content: "\e241";
-}
-.glyphicon-text-color:before {
-  content: "\e242";
-}
-.glyphicon-text-background:before {
-  content: "\e243";
-}
-.glyphicon-object-align-top:before {
-  content: "\e244";
-}
-.glyphicon-object-align-bottom:before {
-  content: "\e245";
-}
-.glyphicon-object-align-horizontal:before {
-  content: "\e246";
-}
-.glyphicon-object-align-left:before {
-  content: "\e247";
-}
-.glyphicon-object-align-vertical:before {
-  content: "\e248";
-}
-.glyphicon-object-align-right:before {
-  content: "\e249";
-}
-.glyphicon-triangle-right:before {
-  content: "\e250";
-}
-.glyphicon-triangle-left:before {
-  content: "\e251";
-}
-.glyphicon-triangle-bottom:before {
-  content: "\e252";
-}
-.glyphicon-triangle-top:before {
-  content: "\e253";
-}
-.glyphicon-console:before {
-  content: "\e254";
-}
-.glyphicon-superscript:before {
-  content: "\e255";
-}
-.glyphicon-subscript:before {
-  content: "\e256";
-}
-.glyphicon-menu-left:before {
-  content: "\e257";
-}
-.glyphicon-menu-right:before {
-  content: "\e258";
-}
-.glyphicon-menu-down:before {
-  content: "\e259";
-}
-.glyphicon-menu-up:before {
-  content: "\e260";
-}
-* {
-  -webkit-box-sizing: border-box;
-     -moz-box-sizing: border-box;
-          box-sizing: border-box;
-}
-*:before,
-*:after {
-  -webkit-box-sizing: border-box;
-     -moz-box-sizing: border-box;
-          box-sizing: border-box;
-}
-html {
-  font-size: 10px;
-
-  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-}
-body {
-  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: 14px;
-  line-height: 1.42857143;
-  color: #333;
-  background-color: #fff;
-}
-input,
-button,
-select,
-textarea {
-  font-family: inherit;
-  font-size: inherit;
-  line-height: inherit;
-}
-a {
-  color: #337ab7;
-  text-decoration: none;
-}
-a:hover,
-a:focus {
-  color: #23527c;
-  text-decoration: underline;
-}
-a:focus {
-  outline: thin dotted;
-  outline: 5px auto -webkit-focus-ring-color;
-  outline-offset: -2px;
-}
-figure {
-  margin: 0;
-}
-img {
-  vertical-align: middle;
-}
-.img-responsive,
-.thumbnail > img,
-.thumbnail a > img,
-.carousel-inner > .item > img,
-.carousel-inner > .item > a > img {
-  display: block;
-  max-width: 100%;
-  height: auto;
-}
-.img-rounded {
-  border-radius: 6px;
-}
-.img-thumbnail {
-  display: inline-block;
-  max-width: 100%;
-  height: auto;
-  padding: 4px;
-  line-height: 1.42857143;
-  background-color: #fff;
-  border: 1px solid #ddd;
-  border-radius: 4px;
-  -webkit-transition: all .2s ease-in-out;
-       -o-transition: all .2s ease-in-out;
-          transition: all .2s ease-in-out;
-}
-.img-circle {
-  border-radius: 50%;
-}
-hr {
-  margin-top: 20px;
-  margin-bottom: 20px;
-  border: 0;
-  border-top: 1px solid #eee;
-}
-.sr-only {
-  position: absolute;
-  width: 1px;
-  height: 1px;
-  padding: 0;
-  margin: -1px;
-  overflow: hidden;
-  clip: rect(0, 0, 0, 0);
-  border: 0;
-}
-.sr-only-focusable:active,
-.sr-only-focusable:focus {
-  position: static;
-  width: auto;
-  height: auto;
-  margin: 0;
-  overflow: visible;
-  clip: auto;
-}
-[role="button"] {
-  cursor: pointer;
-}
-h1,
-h2,
-h3,
-h4,
-h5,
-h6,
-.h1,
-.h2,
-.h3,
-.h4,
-.h5,
-.h6 {
-  font-family: inherit;
-  font-weight: 500;
-  line-height: 1.1;
-  color: inherit;
-}
-h1 small,
-h2 small,
-h3 small,
-h4 small,
-h5 small,
-h6 small,
-.h1 small,
-.h2 small,
-.h3 small,
-.h4 small,
-.h5 small,
-.h6 small,
-h1 .small,
-h2 .small,
-h3 .small,
-h4 .small,
-h5 .small,
-h6 .small,
-.h1 .small,
-.h2 .small,
-.h3 .small,
-.h4 .small,
-.h5 .small,
-.h6 .small {
-  font-weight: normal;
-  line-height: 1;
-  color: #777;
-}
-h1,
-.h1,
-h2,
-.h2,
-h3,
-.h3 {
-  margin-top: 20px;
-  margin-bottom: 10px;
-}
-h1 small,
-.h1 small,
-h2 small,
-.h2 small,
-h3 small,
-.h3 small,
-h1 .small,
-.h1 .small,
-h2 .small,
-.h2 .small,
-h3 .small,
-.h3 .small {
-  font-size: 65%;
-}
-h4,
-.h4,
-h5,
-.h5,
-h6,
-.h6 {
-  margin-top: 10px;
-  margin-bottom: 10px;
-}
-h4 small,
-.h4 small,
-h5 small,
-.h5 small,
-h6 small,
-.h6 small,
-h4 .small,
-.h4 .small,
-h5 .small,
-.h5 .small,
-h6 .small,
-.h6 .small {
-  font-size: 75%;
-}
-h1,
-.h1 {
-  font-size: 36px;
-}
-h2,
-.h2 {
-  font-size: 30px;
-}
-h3,
-.h3 {
-  font-size: 24px;
-}
-h4,
-.h4 {
-  font-size: 18px;
-}
-h5,
-.h5 {
-  font-size: 14px;
-}
-h6,
-.h6 {
-  font-size: 12px;
-}
-p {
-  margin: 0 0 10px;
-}
-.lead {
-  margin-bottom: 20px;
-  font-size: 16px;
-  font-weight: 300;
-  line-height: 1.4;
-}
-@media (min-width: 768px) {
-  .lead {
-    font-size: 21px;
-  }
-}
-small,
-.small {
-  font-size: 85%;
-}
-mark,
-.mark {
-  padding: .2em;
-  background-color: #fcf8e3;
-}
-.text-left {
-  text-align: left;
-}
-.text-right {
-  text-align: right;
-}
-.text-center {
-  text-align: center;
-}
-.text-justify {
-  text-align: justify;
-}
-.text-nowrap {
-  white-space: nowrap;
-}
-.text-lowercase {
-  text-transform: lowercase;
-}
-.text-uppercase {
-  text-transform: uppercase;
-}
-.text-capitalize {
-  text-transform: capitalize;
-}
-.text-muted {
-  color: #777;
-}
-.text-primary {
-  color: #337ab7;
-}
-a.text-primary:hover,
-a.text-primary:focus {
-  color: #286090;
-}
-.text-success {
-  color: #3c763d;
-}
-a.text-success:hover,
-a.text-success:focus {
-  color: #2b542c;
-}
-.text-info {
-  color: #31708f;
-}
-a.text-info:hover,
-a.text-info:focus {
-  color: #245269;
-}
-.text-warning {
-  color: #8a6d3b;
-}
-a.text-warning:hover,
-a.text-warning:focus {
-  color: #66512c;
-}
-.text-danger {
-  color: #a94442;
-}
-a.text-danger:hover,
-a.text-danger:focus {
-  color: #843534;
-}
-.bg-primary {
-  color: #fff;
-  background-color: #337ab7;
-}
-a.bg-primary:hover,
-a.bg-primary:focus {
-  background-color: #286090;
-}
-.bg-success {
-  background-color: #dff0d8;
-}
-a.bg-success:hover,
-a.bg-success:focus {
-  background-color: #c1e2b3;
-}
-.bg-info {
-  background-color: #d9edf7;
-}
-a.bg-info:hover,
-a.bg-info:focus {
-  background-color: #afd9ee;
-}
-.bg-warning {
-  background-color: #fcf8e3;
-}
-a.bg-warning:hover,
-a.bg-warning:focus {
-  background-color: #f7ecb5;
-}
-.bg-danger {
-  background-color: #f2dede;
-}
-a.bg-danger:hover,
-a.bg-danger:focus {
-  background-color: #e4b9b9;
-}
-.page-header {
-  padding-bottom: 9px;
-  margin: 40px 0 20px;
-  border-bottom: 1px solid #eee;
-}
-ul,
-ol {
-  margin-top: 0;
-  margin-bottom: 10px;
-}
-ul ul,
-ol ul,
-ul ol,
-ol ol {
-  margin-bottom: 0;
-}
-.list-unstyled {
-  padding-left: 0;
-  list-style: none;
-}
-.list-inline {
-  padding-left: 0;
-  margin-left: -5px;
-  list-style: none;
-}
-.list-inline > li {
-  display: inline-block;
-  padding-right: 5px;
-  padding-left: 5px;
-}
-dl {
-  margin-top: 0;
-  margin-bottom: 20px;
-}
-dt,
-dd {
-  line-height: 1.42857143;
-}
-dt {
-  font-weight: bold;
-}
-dd {
-  margin-left: 0;
-}
-@media (min-width: 768px) {
-  .dl-horizontal dt {
-    float: left;
-    width: 160px;
-    overflow: hidden;
-    clear: left;
-    text-align: right;
-    text-overflow: ellipsis;
-    white-space: nowrap;
-  }
-  .dl-horizontal dd {
-    margin-left: 180px;
-  }
-}
-abbr[title],
-abbr[data-original-title] {
-  cursor: help;
-  border-bottom: 1px dotted #777;
-}
-.initialism {
-  font-size: 90%;
-  text-transform: uppercase;
-}
-blockquote {
-  padding: 10px 20px;
-  margin: 0 0 20px;
-  font-size: 17.5px;
-  border-left: 5px solid #eee;
-}
-blockquote p:last-child,
-blockquote ul:last-child,
-blockquote ol:last-child {
-  margin-bottom: 0;
-}
-blockquote footer,
-blockquote small,
-blockquote .small {
-  display: block;
-  font-size: 80%;
-  line-height: 1.42857143;
-  color: #777;
-}
-blockquote footer:before,
-blockquote small:before,
-blockquote .small:before {
-  content: '\2014 \00A0';
-}
-.blockquote-reverse,
-blockquote.pull-right {
-  padding-right: 15px;
-  padding-left: 0;
-  text-align: right;
-  border-right: 5px solid #eee;
-  border-left: 0;
-}
-.blockquote-reverse footer:before,
-blockquote.pull-right footer:before,
-.blockquote-reverse small:before,
-blockquote.pull-right small:before,
-.blockquote-reverse .small:before,
-blockquote.pull-right .small:before {
-  content: '';
-}
-.blockquote-reverse footer:after,
-blockquote.pull-right footer:after,
-.blockquote-reverse small:after,
-blockquote.pull-right small:after,
-.blockquote-reverse .small:after,
-blockquote.pull-right .small:after {
-  content: '\00A0 \2014';
-}
-address {
-  margin-bottom: 20px;
-  font-style: normal;
-  line-height: 1.42857143;
-}
-code,
-kbd,
-pre,
-samp {
-  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
-}
-code {
-  padding: 2px 4px;
-  font-size: 90%;
-  color: #c7254e;
-  background-color: #f9f2f4;
-  border-radius: 4px;
-}
-kbd {
-  padding: 2px 4px;
-  font-size: 90%;
-  color: #fff;
-  background-color: #333;
-  border-radius: 3px;
-  -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
-          box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
-}
-kbd kbd {
-  padding: 0;
-  font-size: 100%;
-  font-weight: bold;
-  -webkit-box-shadow: none;
-          box-shadow: none;
-}
-pre {
-  display: block;
-  padding: 9.5px;
-  margin: 0 0 10px;
-  font-size: 13px;
-  line-height: 1.42857143;
-  color: #333;
-  word-break: break-all;
-  word-wrap: break-word;
-  background-color: #f5f5f5;
-  border: 1px solid #ccc;
-  border-radius: 4px;
-}
-pre code {
-  padding: 0;
-  font-size: inherit;
-  color: inherit;
-  white-space: pre-wrap;
-  background-color: transparent;
-  border-radius: 0;
-}
-.pre-scrollable {
-  max-height: 340px;
-  overflow-y: scroll;
-}
-.container {
-  padding-right: 15px;
-  padding-left: 15px;
-  margin-right: auto;
-  margin-left: auto;
-}
-@media (min-width: 768px) {
-  .container {
-    width: 750px;
-  }
-}
-@media (min-width: 992px) {
-  .container {
-    width: 970px;
-  }
-}
-@media (min-width: 1200px) {
-  .container {
-    width: 1170px;
-  }
-}
-.container-fluid {
-  padding-right: 15px;
-  padding-left: 15px;
-  margin-right: auto;
-  margin-left: auto;
-}
-.row {
-  margin-right: -15px;
-  margin-left: -15px;
-}
-.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
-  position: relative;
-  min-height: 1px;
-  padding-right: 15px;
-  padding-left: 15px;
-}
-.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
-  float: left;
-}
-.col-xs-12 {
-  width: 100%;
-}
-.col-xs-11 {
-  width: 91.66666667%;
-}
-.col-xs-10 {
-  width: 83.33333333%;
-}
-.col-xs-9 {
-  width: 75%;
-}
-.col-xs-8 {
-  width: 66.66666667%;
-}
-.col-xs-7 {
-  width: 58.33333333%;
-}
-.col-xs-6 {
-  width: 50%;
-}
-.col-xs-5 {
-  width: 41.66666667%;
-}
-.col-xs-4 {
-  width: 33.33333333%;
-}
-.col-xs-3 {
-  width: 25%;
-}
-.col-xs-2 {
-  width: 16.66666667%;
-}
-.col-xs-1 {
-  width: 8.33333333%;
-}
-.col-xs-pull-12 {
-  right: 100%;
-}
-.col-xs-pull-11 {
-  right: 91.66666667%;
-}
-.col-xs-pull-10 {
-  right: 83.33333333%;
-}
-.col-xs-pull-9 {
-  right: 75%;
-}
-.col-xs-pull-8 {
-  right: 66.66666667%;
-}
-.col-xs-pull-7 {
-  right: 58.33333333%;
-}
-.col-xs-pull-6 {
-  right: 50%;
-}
-.col-xs-pull-5 {
-  right: 41.66666667%;
-}
-.col-xs-pull-4 {
-  right: 33.33333333%;
-}
-.col-xs-pull-3 {
-  right: 25%;
-}
-.col-xs-pull-2 {
-  right: 16.66666667%;
-}
-.col-xs-pull-1 {
-  right: 8.33333333%;
-}
-.col-xs-pull-0 {
-  right: auto;
-}
-.col-xs-push-12 {
-  left: 100%;
-}
-.col-xs-push-11 {
-  left: 91.66666667%;
-}
-.col-xs-push-10 {
-  left: 83.33333333%;
-}
-.col-xs-push-9 {
-  left: 75%;
-}
-.col-xs-push-8 {
-  left: 66.66666667%;
-}
-.col-xs-push-7 {
-  left: 58.33333333%;
-}
-.col-xs-push-6 {
-  left: 50%;
-}
-.col-xs-push-5 {
-  left: 41.66666667%;
-}
-.col-xs-push-4 {
-  left: 33.33333333%;
-}
-.col-xs-push-3 {
-  left: 25%;
-}
-.col-xs-push-2 {
-  left: 16.66666667%;
-}
-.col-xs-push-1 {
-  left: 8.33333333%;
-}
-.col-xs-push-0 {
-  left: auto;
-}
-.col-xs-offset-12 {
-  margin-left: 100%;
-}
-.col-xs-offset-11 {
-  margin-left: 91.66666667%;
-}
-.col-xs-offset-10 {
-  margin-left: 83.33333333%;
-}
-.col-xs-offset-9 {
-  margin-left: 75%;
-}
-.col-xs-offset-8 {
-  margin-left: 66.66666667%;
-}
-.col-xs-offset-7 {
-  margin-left: 58.33333333%;
-}
-.col-xs-offset-6 {
-  margin-left: 50%;
-}
-.col-xs-offset-5 {
-  margin-left: 41.66666667%;
-}
-.col-xs-offset-4 {
-  margin-left: 33.33333333%;
-}
-.col-xs-offset-3 {
-  margin-left: 25%;
-}
-.col-xs-offset-2 {
-  margin-left: 16.66666667%;
-}
-.col-xs-offset-1 {
-  margin-left: 8.33333333%;
-}
-.col-xs-offset-0 {
-  margin-left: 0;
-}
-@media (min-width: 768px) {
-  .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
-    float: left;
-  }
-  .col-sm-12 {
-    width: 100%;
-  }
-  .col-sm-11 {
-    width: 91.66666667%;
-  }
-  .col-sm-10 {
-    width: 83.33333333%;
-  }
-  .col-sm-9 {
-    width: 75%;
-  }
-  .col-sm-8 {
-    width: 66.66666667%;
-  }
-  .col-sm-7 {
-    width: 58.33333333%;
-  }
-  .col-sm-6 {
-    width: 50%;
-  }
-  .col-sm-5 {
-    width: 41.66666667%;
-  }
-  .col-sm-4 {
-    width: 33.33333333%;
-  }
-  .col-sm-3 {
-    width: 25%;
-  }
-  .col-sm-2 {
-    width: 16.66666667%;
-  }
-  .col-sm-1 {
-    width: 8.33333333%;
-  }
-  .col-sm-pull-12 {
-    right: 100%;
-  }
-  .col-sm-pull-11 {
-    right: 91.66666667%;
-  }
-  .col-sm-pull-10 {
-    right: 83.33333333%;
-  }
-  .col-sm-pull-9 {
-    right: 75%;
-  }
-  .col-sm-pull-8 {
-    right: 66.66666667%;
-  }
-  .col-sm-pull-7 {
-    right: 58.33333333%;
-  }
-  .col-sm-pull-6 {
-    right: 50%;
-  }
-  .col-sm-pull-5 {
-    right: 41.66666667%;
-  }
-  .col-sm-pull-4 {
-    right: 33.33333333%;
-  }
-  .col-sm-pull-3 {
-    right: 25%;
-  }
-  .col-sm-pull-2 {
-    right: 16.66666667%;
-  }
-  .col-sm-pull-1 {
-    right: 8.33333333%;
-  }
-  .col-sm-pull-0 {
-    right: auto;
-  }
-  .col-sm-push-12 {
-    left: 100%;
-  }
-  .col-sm-push-11 {
-    left: 91.66666667%;
-  }
-  .col-sm-push-10 {
-    left: 83.33333333%;
-  }
-  .col-sm-push-9 {
-    left: 75%;
-  }
-  .col-sm-push-8 {
-    left: 66.66666667%;
-  }
-  .col-sm-push-7 {
-    left: 58.33333333%;
-  }
-  .col-sm-push-6 {
-    left: 50%;
-  }
-  .col-sm-push-5 {
-    left: 41.66666667%;
-  }
-  .col-sm-push-4 {
-    left: 33.33333333%;
-  }
-  .col-sm-push-3 {
-    left: 25%;
-  }
-  .col-sm-push-2 {
-    left: 16.66666667%;
-  }
-  .col-sm-push-1 {
-    left: 8.33333333%;
-  }
-  .col-sm-push-0 {
-    left: auto;
-  }
-  .col-sm-offset-12 {
-    margin-left: 100%;
-  }
-  .col-sm-offset-11 {
-    margin-left: 91.66666667%;
-  }
-  .col-sm-offset-10 {
-    margin-left: 83.33333333%;
-  }
-  .col-sm-offset-9 {
-    margin-left: 75%;
-  }
-  .col-sm-offset-8 {
-    margin-left: 66.66666667%;
-  }
-  .col-sm-offset-7 {
-    margin-left: 58.33333333%;
-  }
-  .col-sm-offset-6 {
-    margin-left: 50%;
-  }
-  .col-sm-offset-5 {
-    margin-left: 41.66666667%;
-  }
-  .col-sm-offset-4 {
-    margin-left: 33.33333333%;
-  }
-  .col-sm-offset-3 {
-    margin-left: 25%;
-  }
-  .col-sm-offset-2 {
-    margin-left: 16.66666667%;
-  }
-  .col-sm-offset-1 {
-    margin-left: 8.33333333%;
-  }
-  .col-sm-offset-0 {
-    margin-left: 0;
-  }
-}
-@media (min-width: 992px) {
-  .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
-    float: left;
-  }
-  .col-md-12 {
-    width: 100%;
-  }
-  .col-md-11 {
-    width: 91.66666667%;
-  }
-  .col-md-10 {
-    width: 83.33333333%;
-  }
-  .col-md-9 {
-    width: 75%;
-  }
-  .col-md-8 {
-    width: 66.66666667%;
-  }
-  .col-md-7 {
-    width: 58.33333333%;
-  }
-  .col-md-6 {
-    width: 50%;
-  }
-  .col-md-5 {
-    width: 41.66666667%;
-  }
-  .col-md-4 {
-    width: 33.33333333%;
-  }
-  .col-md-3 {
-    width: 25%;
-  }
-  .col-md-2 {
-    width: 16.66666667%;
-  }
-  .col-md-1 {
-    width: 8.33333333%;
-  }
-  .col-md-pull-12 {
-    right: 100%;
-  }
-  .col-md-pull-11 {
-    right: 91.66666667%;
-  }
-  .col-md-pull-10 {
-    right: 83.33333333%;
-  }
-  .col-md-pull-9 {
-    right: 75%;
-  }
-  .col-md-pull-8 {
-    right: 66.66666667%;
-  }
-  .col-md-pull-7 {
-    right: 58.33333333%;
-  }
-  .col-md-pull-6 {
-    right: 50%;
-  }
-  .col-md-pull-5 {
-    right: 41.66666667%;
-  }
-  .col-md-pull-4 {
-    right: 33.33333333%;
-  }
-  .col-md-pull-3 {
-    right: 25%;
-  }
-  .col-md-pull-2 {
-    right: 16.66666667%;
-  }
-  .col-md-pull-1 {
-    right: 8.33333333%;
-  }
-  .col-md-pull-0 {
-    right: auto;
-  }
-  .col-md-push-12 {
-    left: 100%;
-  }
-  .col-md-push-11 {
-    left: 91.66666667%;
-  }
-  .col-md-push-10 {
-    left: 83.33333333%;
-  }
-  .col-md-push-9 {
-    left: 75%;
-  }
-  .col-md-push-8 {
-    left: 66.66666667%;
-  }
-  .col-md-push-7 {
-    left: 58.33333333%;
-  }
-  .col-md-push-6 {
-    left: 50%;
-  }
-  .col-md-push-5 {
-    left: 41.66666667%;
-  }
-  .col-md-push-4 {
-    left: 33.33333333%;
-  }
-  .col-md-push-3 {
-    left: 25%;
-  }
-  .col-md-push-2 {
-    left: 16.66666667%;
-  }
-  .col-md-push-1 {
-    left: 8.33333333%;
-  }
-  .col-md-push-0 {
-    left: auto;
-  }
-  .col-md-offset-12 {
-    margin-left: 100%;
-  }
-  .col-md-offset-11 {
-    margin-left: 91.66666667%;
-  }
-  .col-md-offset-10 {
-    margin-left: 83.33333333%;
-  }
-  .col-md-offset-9 {
-    margin-left: 75%;
-  }
-  .col-md-offset-8 {
-    margin-left: 66.66666667%;
-  }
-  .col-md-offset-7 {
-    margin-left: 58.33333333%;
-  }
-  .col-md-offset-6 {
-    margin-left: 50%;
-  }
-  .col-md-offset-5 {
-    margin-left: 41.66666667%;
-  }
-  .col-md-offset-4 {
-    margin-left: 33.33333333%;
-  }
-  .col-md-offset-3 {
-    margin-left: 25%;
-  }
-  .col-md-offset-2 {
-    margin-left: 16.66666667%;
-  }
-  .col-md-offset-1 {
-    margin-left: 8.33333333%;
-  }
-  .col-md-offset-0 {
-    margin-left: 0;
-  }
-}
-@media (min-width: 1200px) {
-  .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
-    float: left;
-  }
-  .col-lg-12 {
-    width: 100%;
-  }
-  .col-lg-11 {
-    width: 91.66666667%;
-  }
-  .col-lg-10 {
-    width: 83.33333333%;
-  }
-  .col-lg-9 {
-    width: 75%;
-  }
-  .col-lg-8 {
-    width: 66.66666667%;
-  }
-  .col-lg-7 {
-    width: 58.33333333%;
-  }
-  .col-lg-6 {
-    width: 50%;
-  }
-  .col-lg-5 {
-    width: 41.66666667%;
-  }
-  .col-lg-4 {
-    width: 33.33333333%;
-  }
-  .col-lg-3 {
-    width: 25%;
-  }
-  .col-lg-2 {
-    width: 16.66666667%;
-  }
-  .col-lg-1 {
-    width: 8.33333333%;
-  }
-  .col-lg-pull-12 {
-    right: 100%;
-  }
-  .col-lg-pull-11 {
-    right: 91.66666667%;
-  }
-  .col-lg-pull-10 {
-    right: 83.33333333%;
-  }
-  .col-lg-pull-9 {
-    right: 75%;
-  }
-  .col-lg-pull-8 {
-    right: 66.66666667%;
-  }
-  .col-lg-pull-7 {
-    right: 58.33333333%;
-  }
-  .col-lg-pull-6 {
-    right: 50%;
-  }
-  .col-lg-pull-5 {
-    right: 41.66666667%;
-  }
-  .col-lg-pull-4 {
-    right: 33.33333333%;
-  }
-  .col-lg-pull-3 {
-    right: 25%;
-  }
-  .col-lg-pull-2 {
-    right: 16.66666667%;
-  }
-  .col-lg-pull-1 {
-    right: 8.33333333%;
-  }
-  .col-lg-pull-0 {
-    right: auto;
-  }
-  .col-lg-push-12 {
-    left: 100%;
-  }
-  .col-lg-push-11 {
-    left: 91.66666667%;
-  }
-  .col-lg-push-10 {
-    left: 83.33333333%;
-  }
-  .col-lg-push-9 {
-    left: 75%;
-  }
-  .col-lg-push-8 {
-    left: 66.66666667%;
-  }
-  .col-lg-push-7 {
-    left: 58.33333333%;
-  }
-  .col-lg-push-6 {
-    left: 50%;
-  }
-  .col-lg-push-5 {
-    left: 41.66666667%;
-  }
-  .col-lg-push-4 {
-    left: 33.33333333%;
-  }
-  .col-lg-push-3 {
-    left: 25%;
-  }
-  .col-lg-push-2 {
-    left: 16.66666667%;
-  }
-  .col-lg-push-1 {
-    left: 8.33333333%;
-  }
-  .col-lg-push-0 {
-    left: auto;
-  }
-  .col-lg-offset-12 {
-    margin-left: 100%;
-  }
-  .col-lg-offset-11 {
-    margin-left: 91.66666667%;
-  }
-  .col-lg-offset-10 {
-    margin-left: 83.33333333%;
-  }
-  .col-lg-offset-9 {
-    margin-left: 75%;
-  }
-  .col-lg-offset-8 {
-    margin-left: 66.66666667%;
-  }
-  .col-lg-offset-7 {
-    margin-left: 58.33333333%;
-  }
-  .col-lg-offset-6 {
-    margin-left: 50%;
-  }
-  .col-lg-offset-5 {
-    margin-left: 41.66666667%;
-  }
-  .col-lg-offset-4 {
-    margin-left: 33.33333333%;
-  }
-  .col-lg-offset-3 {
-    margin-left: 25%;
-  }
-  .col-lg-offset-2 {
-    margin-left: 16.66666667%;
-  }
-  .col-lg-offset-1 {
-    margin-left: 8.33333333%;
-  }
-  .col-lg-offset-0 {
-    margin-left: 0;
-  }
-}
-table {
-  background-color: transparent;
-}
-caption {
-  padding-top: 8px;
-  padding-bottom: 8px;
-  color: #777;
-  text-align: left;
-}
-th {
-  text-align: left;
-}
-.table {
-  width: 100%;
-  max-width: 100%;
-  margin-bottom: 20px;
-}
-.table > thead > tr > th,
-.table > tbody > tr > th,
-.table > tfoot > tr > th,
-.table > thead > tr > td,
-.table > tbody > tr > td,
-.table > tfoot > tr > td {
-  padding: 8px;
-  line-height: 1.42857143;
-  vertical-align: top;
-  border-top: 1px solid #ddd;
-}
-.table > thead > tr > th {
-  vertical-align: bottom;
-  border-bottom: 2px solid #ddd;
-}
-.table > caption + thead > tr:first-child > th,
-.table > colgroup + thead > tr:first-child > th,
-.table > thead:first-child > tr:first-child > th,
-.table > caption + thead > tr:first-child > td,
-.table > colgroup + thead > tr:first-child > td,
-.table > thead:first-child > tr:first-child > td {
-  border-top: 0;
-}
-.table > tbody + tbody {
-  border-top: 2px solid #ddd;
-}
-.table .table {
-  background-color: #fff;
-}
-.table-condensed > thead > tr > th,
-.table-condensed > tbody > tr > th,
-.table-condensed > tfoot > tr > th,
-.table-condensed > thead > tr > td,
-.table-condensed > tbody > tr > td,
-.table-condensed > tfoot > tr > td {
-  padding: 5px;
-}
-.table-bordered {
-  border: 1px solid #ddd;
-}
-.table-bordered > thead > tr > th,
-.table-bordered > tbody > tr > th,
-.table-bordered > tfoot > tr > th,
-.table-bordered > thead > tr > td,
-.table-bordered > tbody > tr > td,
-.table-bordered > tfoot > tr > td {
-  border: 1px solid #ddd;
-}
-.table-bordered > thead > tr > th,
-.table-bordered > thead > tr > td {
-  border-bottom-width: 2px;
-}
-.table-striped > tbody > tr:nth-of-type(odd) {
-  background-color: #f9f9f9;
-}
-.table-hover > tbody > tr:hover {
-  background-color: #f5f5f5;
-}
-table col[class*="col-"] {
-  position: static;
-  display: table-column;
-  float: none;
-}
-table td[class*="col-"],
-table th[class*="col-"] {
-  position: static;
-  display: table-cell;
-  float: none;
-}
-.table > thead > tr > td.active,
-.table > tbody > tr > td.active,
-.table > tfoot > tr > td.active,
-.table > thead > tr > th.active,
-.table > tbody > tr > th.active,
-.table > tfoot > tr > th.active,
-.table > thead > tr.active > td,
-.table > tbody > tr.active > td,
-.table > tfoot > tr.active > td,
-.table > thead > tr.active > th,
-.table > tbody > tr.active > th,
-.table > tfoot > tr.active > th {
-  background-color: #f5f5f5;
-}
-.table-hover > tbody > tr > td.active:hover,
-.table-hover > tbody > tr > th.active:hover,
-.table-hover > tbody > tr.active:hover > td,
-.table-hover > tbody > tr:hover > .active,
-.table-hover > tbody > tr.active:hover > th {
-  background-color: #e8e8e8;
-}
-.table > thead > tr > td.success,
-.table > tbody > tr > td.success,
-.table > tfoot > tr > td.success,
-.table > thead > tr > th.success,
-.table > tbody > tr > th.success,
-.table > tfoot > tr > th.success,
-.table > thead > tr.success > td,
-.table > tbody > tr.success > td,
-.table > tfoot > tr.success > td,
-.table > thead > tr.success > th,
-.table > tbody > tr.success > th,
-.table > tfoot > tr.success > th {
-  background-color: #dff0d8;
-}
-.table-hover > tbody > tr > td.success:hover,
-.table-hover > tbody > tr > th.success:hover,
-.table-hover > tbody > tr.success:hover > td,
-.table-hover > tbody > tr:hover > .success,
-.table-hover > tbody > tr.success:hover > th {
-  background-color: #d0e9c6;
-}
-.table > thead > tr > td.info,
-.table > tbody > tr > td.info,
-.table > tfoot > tr > td.info,
-.table > thead > tr > th.info,
-.table > tbody > tr > th.info,
-.table > tfoot > tr > th.info,
-.table > thead > tr.info > td,
-.table > tbody > tr.info > td,
-.table > tfoot > tr.info > td,
-.table > thead > tr.info > th,
-.table > tbody > tr.info > th,
-.table > tfoot > tr.info > th {
-  background-color: #d9edf7;
-}
-.table-hover > tbody > tr > td.info:hover,
-.table-hover > tbody > tr > th.info:hover,
-.table-hover > tbody > tr.info:hover > td,
-.table-hover > tbody > tr:hover > .info,
-.table-hover > tbody > tr.info:hover > th {
-  background-color: #c4e3f3;
-}
-.table > thead > tr > td.warning,
-.table > tbody > tr > td.warning,
-.table > tfoot > tr > td.warning,
-.table > thead > tr > th.warning,
-.table > tbody > tr > th.warning,
-.table > tfoot > tr > th.warning,
-.table > thead > tr.warning > td,
-.table > tbody > tr.warning > td,
-.table > tfoot > tr.warning > td,
-.table > thead > tr.warning > th,
-.table > tbody > tr.warning > th,
-.table > tfoot > tr.warning > th {
-  background-color: #fcf8e3;
-}
-.table-hover > tbody > tr > td.warning:hover,
-.table-hover > tbody > tr > th.warning:hover,
-.table-hover > tbody > tr.warning:hover > td,
-.table-hover > tbody > tr:hover > .warning,
-.table-hover > tbody > tr.warning:hover > th {
-  background-color: #faf2cc;
-}
-.table > thead > tr > td.danger,
-.table > tbody > tr > td.danger,
-.table > tfoot > tr > td.danger,
-.table > thead > tr > th.danger,
-.table > tbody > tr > th.danger,
-.table > tfoot > tr > th.danger,
-.table > thead > tr.danger > td,
-.table > tbody > tr.danger > td,
-.table > tfoot > tr.danger > td,
-.table > thead > tr.danger > th,
-.table > tbody > tr.danger > th,
-.table > tfoot > tr.danger > th {
-  background-color: #f2dede;
-}
-.table-hover > tbody > tr > td.danger:hover,
-.table-hover > tbody > tr > th.danger:hover,
-.table-hover > tbody > tr.danger:hover > td,
-.table-hover > tbody > tr:hover > .danger,
-.table-hover > tbody > tr.danger:hover > th {
-  background-color: #ebcccc;
-}
-.table-responsive {
-  min-height: .01%;
-  overflow-x: auto;
-}
-@media screen and (max-width: 767px) {
-  .table-responsive {
-    width: 100%;
-    margin-bottom: 15px;
-    overflow-y: hidden;
-    -ms-overflow-style: -ms-autohiding-scrollbar;
-    border: 1px solid #ddd;
-  }
-  .table-responsive > .table {
-    margin-bottom: 0;
-  }
-  .table-responsive > .table > thead > tr > th,
-  .table-responsive > .table > tbody > tr > th,
-  .table-responsive > .table > tfoot > tr > th,
-  .table-responsive > .table > thead > tr > td,
-  .table-responsive > .table > tbody > tr > td,
-  .table-responsive > .table > tfoot > tr > td {
-    white-space: nowrap;
-  }
-  .table-responsive > .table-bordered {
-    border: 0;
-  }
-  .table-responsive > .table-bordered > thead > tr > th:first-child,
-  .table-responsive > .table-bordered > tbody > tr > th:first-child,
-  .table-responsive > .table-bordered > tfoot > tr > th:first-child,
-  .table-responsive > .table-bordered > thead > tr > td:first-child,
-  .table-responsive > .table-bordered > tbody > tr > td:first-child,
-  .table-responsive > .table-bordered > tfoot > tr > td:first-child {
-    border-left: 0;
-  }
-  .table-responsive > .table-bordered > thead > tr > th:last-child,
-  .table-responsive > .table-bordered > tbody > tr > th:last-child,
-  .table-responsive > .table-bordered > tfoot > tr > th:last-child,
-  .table-responsive > .table-bordered > thead > tr > td:last-child,
-  .table-responsive > .table-bordered > tbody > tr > td:last-child,
-  .table-responsive > .table-bordered > tfoot > tr > td:last-child {
-    border-right: 0;
-  }
-  .table-responsive > .table-bordered > tbody > tr:last-child > th,
-  .table-responsive > .table-bordered > tfoot > tr:last-child > th,
-  .table-responsive > .table-bordered > tbody > tr:last-child > td,
-  .table-responsive > .table-bordered > tfoot > tr:last-child > td {
-    border-bottom: 0;
-  }
-}
-fieldset {
-  min-width: 0;
-  padding: 0;
-  margin: 0;
-  border: 0;
-}
-legend {
-  display: block;
-  width: 100%;
-  padding: 0;
-  margin-bottom: 20px;
-  font-size: 21px;
-  line-height: inherit;
-  color: #333;
-  border: 0;
-  border-bottom: 1px solid #e5e5e5;
-}
-label {
-  display: inline-block;
-  max-width: 100%;
-  margin-bottom: 5px;
-  font-weight: bold;
-}
-input[type="search"] {
-  -webkit-box-sizing: border-box;
-     -moz-box-sizing: border-box;
-          box-sizing: border-box;
-}
-input[type="radio"],
-input[type="checkbox"] {
-  margin: 4px 0 0;
-  margin-top: 1px \9;
-  line-height: normal;
-}
-input[type="file"] {
-  display: block;
-}
-input[type="range"] {
-  display: block;
-  width: 100%;
-}
-select[multiple],
-select[size] {
-  height: auto;
-}
-input[type="file"]:focus,
-input[type="radio"]:focus,
-input[type="checkbox"]:focus {
-  outline: thin dotted;
-  outline: 5px auto -webkit-focus-ring-color;
-  outline-offset: -2px;
-}
-output {
-  display: block;
-  padding-top: 7px;
-  font-size: 14px;
-  line-height: 1.42857143;
-  color: #555;
-}
-.form-control {
-  display: block;
-  width: 100%;
-  height: 34px;
-  padding: 6px 12px;
-  font-size: 14px;
-  line-height: 1.42857143;
-  color: #555;
-  background-color: #fff;
-  background-image: none;
-  border: 1px solid #ccc;
-  border-radius: 4px;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-  -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
-       -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-          transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-}
-.form-control:focus {
-  border-color: #66afe9;
-  outline: 0;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
-          box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
-}
-.form-control::-moz-placeholder {
-  color: #999;
-  opacity: 1;
-}
-.form-control:-ms-input-placeholder {
-  color: #999;
-}
-.form-control::-webkit-input-placeholder {
-  color: #999;
-}
-.form-control::-ms-expand {
-  background-color: transparent;
-  border: 0;
-}
-.form-control[disabled],
-.form-control[readonly],
-fieldset[disabled] .form-control {
-  background-color: #eee;
-  opacity: 1;
-}
-.form-control[disabled],
-fieldset[disabled] .form-control {
-  cursor: not-allowed;
-}
-textarea.form-control {
-  height: auto;
-}
-input[type="search"] {
-  -webkit-appearance: none;
-}
-@media screen and (-webkit-min-device-pixel-ratio: 0) {
-  input[type="date"].form-control,
-  input[type="time"].form-control,
-  input[type="datetime-local"].form-control,
-  input[type="month"].form-control {
-    line-height: 34px;
-  }
-  input[type="date"].input-sm,
-  input[type="time"].input-sm,
-  input[type="datetime-local"].input-sm,
-  input[type="month"].input-sm,
-  .input-group-sm input[type="date"],
-  .input-group-sm input[type="time"],
-  .input-group-sm input[type="datetime-local"],
-  .input-group-sm input[type="month"] {
-    line-height: 30px;
-  }
-  input[type="date"].input-lg,
-  input[type="time"].input-lg,
-  input[type="datetime-local"].input-lg,
-  input[type="month"].input-lg,
-  .input-group-lg input[type="date"],
-  .input-group-lg input[type="time"],
-  .input-group-lg input[type="datetime-local"],
-  .input-group-lg input[type="month"] {
-    line-height: 46px;
-  }
-}
-.form-group {
-  margin-bottom: 15px;
-}
-.radio,
-.checkbox {
-  position: relative;
-  display: block;
-  margin-top: 10px;
-  margin-bottom: 10px;
-}
-.radio label,
-.checkbox label {
-  min-height: 20px;
-  padding-left: 20px;
-  margin-bottom: 0;
-  font-weight: normal;
-  cursor: pointer;
-}
-.radio input[type="radio"],
-.radio-inline input[type="radio"],
-.checkbox input[type="checkbox"],
-.checkbox-inline input[type="checkbox"] {
-  position: absolute;
-  margin-top: 4px \9;
-  margin-left: -20px;
-}
-.radio + .radio,
-.checkbox + .checkbox {
-  margin-top: -5px;
-}
-.radio-inline,
-.checkbox-inline {
-  position: relative;
-  display: inline-block;
-  padding-left: 20px;
-  margin-bottom: 0;
-  font-weight: normal;
-  vertical-align: middle;
-  cursor: pointer;
-}
-.radio-inline + .radio-inline,
-.checkbox-inline + .checkbox-inline {
-  margin-top: 0;
-  margin-left: 10px;
-}
-input[type="radio"][disabled],
-input[type="checkbox"][disabled],
-input[type="radio"].disabled,
-input[type="checkbox"].disabled,
-fieldset[disabled] input[type="radio"],
-fieldset[disabled] input[type="checkbox"] {
-  cursor: not-allowed;
-}
-.radio-inline.disabled,
-.checkbox-inline.disabled,
-fieldset[disabled] .radio-inline,
-fieldset[disabled] .checkbox-inline {
-  cursor: not-allowed;
-}
-.radio.disabled label,
-.checkbox.disabled label,
-fieldset[disabled] .radio label,
-fieldset[disabled] .checkbox label {
-  cursor: not-allowed;
-}
-.form-control-static {
-  min-height: 34px;
-  padding-top: 7px;
-  padding-bottom: 7px;
-  margin-bottom: 0;
-}
-.form-control-static.input-lg,
-.form-control-static.input-sm {
-  padding-right: 0;
-  padding-left: 0;
-}
-.input-sm {
-  height: 30px;
-  padding: 5px 10px;
-  font-size: 12px;
-  line-height: 1.5;
-  border-radius: 3px;
-}
-select.input-sm {
-  height: 30px;
-  line-height: 30px;
-}
-textarea.input-sm,
-select[multiple].input-sm {
-  height: auto;
-}
-.form-group-sm .form-control {
-  height: 30px;
-  padding: 5px 10px;
-  font-size: 12px;
-  line-height: 1.5;
-  border-radius: 3px;
-}
-.form-group-sm select.form-control {
-  height: 30px;
-  line-height: 30px;
-}
-.form-group-sm textarea.form-control,
-.form-group-sm select[multiple].form-control {
-  height: auto;
-}
-.form-group-sm .form-control-static {
-  height: 30px;
-  min-height: 32px;
-  padding: 6px 10px;
-  font-size: 12px;
-  line-height: 1.5;
-}
-.input-lg {
-  height: 46px;
-  padding: 10px 16px;
-  font-size: 18px;
-  line-height: 1.3333333;
-  border-radius: 6px;
-}
-select.input-lg {
-  height: 46px;
-  line-height: 46px;
-}
-textarea.input-lg,
-select[multiple].input-lg {
-  height: auto;
-}
-.form-group-lg .form-control {
-  height: 46px;
-  padding: 10px 16px;
-  font-size: 18px;
-  line-height: 1.3333333;
-  border-radius: 6px;
-}
-.form-group-lg select.form-control {
-  height: 46px;
-  line-height: 46px;
-}
-.form-group-lg textarea.form-control,
-.form-group-lg select[multiple].form-control {
-  height: auto;
-}
-.form-group-lg .form-control-static {
-  height: 46px;
-  min-height: 38px;
-  padding: 11px 16px;
-  font-size: 18px;
-  line-height: 1.3333333;
-}
-.has-feedback {
-  position: relative;
-}
-.has-feedback .form-control {
-  padding-right: 42.5px;
-}
-.form-control-feedback {
-  position: absolute;
-  top: 0;
-  right: 0;
-  z-index: 2;
-  display: block;
-  width: 34px;
-  height: 34px;
-  line-height: 34px;
-  text-align: center;
-  pointer-events: none;
-}
-.input-lg + .form-control-feedback,
-.input-group-lg + .form-control-feedback,
-.form-group-lg .form-control + .form-control-feedback {
-  width: 46px;
-  height: 46px;
-  line-height: 46px;
-}
-.input-sm + .form-control-feedback,
-.input-group-sm + .form-control-feedback,
-.form-group-sm .form-control + .form-control-feedback {
-  width: 30px;
-  height: 30px;
-  line-height: 30px;
-}
-.has-success .help-block,
-.has-success .control-label,
-.has-success .radio,
-.has-success .checkbox,
-.has-success .radio-inline,
-.has-success .checkbox-inline,
-.has-success.radio label,
-.has-success.checkbox label,
-.has-success.radio-inline label,
-.has-success.checkbox-inline label {
-  color: #3c763d;
-}
-.has-success .form-control {
-  border-color: #3c763d;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-}
-.has-success .form-control:focus {
-  border-color: #2b542c;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168;
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168;
-}
-.has-success .input-group-addon {
-  color: #3c763d;
-  background-color: #dff0d8;
-  border-color: #3c763d;
-}
-.has-success .form-control-feedback {
-  color: #3c763d;
-}
-.has-warning .help-block,
-.has-warning .control-label,
-.has-warning .radio,
-.has-warning .checkbox,
-.has-warning .radio-inline,
-.has-warning .checkbox-inline,
-.has-warning.radio label,
-.has-warning.checkbox label,
-.has-warning.radio-inline label,
-.has-warning.checkbox-inline label {
-  color: #8a6d3b;
-}
-.has-warning .form-control {
-  border-color: #8a6d3b;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-}
-.has-warning .form-control:focus {
-  border-color: #66512c;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b;
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b;
-}
-.has-warning .input-group-addon {
-  color: #8a6d3b;
-  background-color: #fcf8e3;
-  border-color: #8a6d3b;
-}
-.has-warning .form-control-feedback {
-  color: #8a6d3b;
-}
-.has-error .help-block,
-.has-error .control-label,
-.has-error .radio,
-.has-error .checkbox,
-.has-error .radio-inline,
-.has-error .checkbox-inline,
-.has-error.radio label,
-.has-error.checkbox label,
-.has-error.radio-inline label,
-.has-error.checkbox-inline label {
-  color: #a94442;
-}
-.has-error .form-control {
-  border-color: #a94442;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-}
-.has-error .form-control:focus {
-  border-color: #843534;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
-}
-.has-error .input-group-addon {
-  color: #a94442;
-  background-color: #f2dede;
-  border-color: #a94442;
-}
-.has-error .form-control-feedback {
-  color: #a94442;
-}
-.has-feedback label ~ .form-control-feedback {
-  top: 25px;
-}
-.has-feedback label.sr-only ~ .form-control-feedback {
-  top: 0;
-}
-.help-block {
-  display: block;
-  margin-top: 5px;
-  margin-bottom: 10px;
-  color: #737373;
-}
-@media (min-width: 768px) {
-  .form-inline .form-group {
-    display: inline-block;
-    margin-bottom: 0;
-    vertical-align: middle;
-  }
-  .form-inline .form-control {
-    display: inline-block;
-    width: auto;
-    vertical-align: middle;
-  }
-  .form-inline .form-control-static {
-    display: inline-block;
-  }
-  .form-inline .input-group {
-    display: inline-table;
-    vertical-align: middle;
-  }
-  .form-inline .input-group .input-group-addon,
-  .form-inline .input-group .input-group-btn,
-  .form-inline .input-group .form-control {
-    width: auto;
-  }
-  .form-inline .input-group > .form-control {
-    width: 100%;
-  }
-  .form-inline .control-label {
-    margin-bottom: 0;
-    vertical-align: middle;
-  }
-  .form-inline .radio,
-  .form-inline .checkbox {
-    display: inline-block;
-    margin-top: 0;
-    margin-bottom: 0;
-    vertical-align: middle;
-  }
-  .form-inline .radio label,
-  .form-inline .checkbox label {
-    padding-left: 0;
-  }
-  .form-inline .radio input[type="radio"],
-  .form-inline .checkbox input[type="checkbox"] {
-    position: relative;
-    margin-left: 0;
-  }
-  .form-inline .has-feedback .form-control-feedback {
-    top: 0;
-  }
-}
-.form-horizontal .radio,
-.form-horizontal .checkbox,
-.form-horizontal .radio-inline,
-.form-horizontal .checkbox-inline {
-  padding-top: 7px;
-  margin-top: 0;
-  margin-bottom: 0;
-}
-.form-horizontal .radio,
-.form-horizontal .checkbox {
-  min-height: 27px;
-}
-.form-horizontal .form-group {
-  margin-right: -15px;
-  margin-left: -15px;
-}
-@media (min-width: 768px) {
-  .form-horizontal .control-label {
-    padding-top: 7px;
-    margin-bottom: 0;
-    text-align: right;
-  }
-}
-.form-horizontal .has-feedback .form-control-feedback {
-  right: 15px;
-}
-@media (min-width: 768px) {
-  .form-horizontal .form-group-lg .control-label {
-    padding-top: 11px;
-    font-size: 18px;
-  }
-}
-@media (min-width: 768px) {
-  .form-horizontal .form-group-sm .control-label {
-    padding-top: 6px;
-    font-size: 12px;
-  }
-}
-.btn {
-  display: inline-block;
-  padding: 6px 12px;
-  margin-bottom: 0;
-  font-size: 14px;
-  font-weight: normal;
-  line-height: 1.42857143;
-  text-align: center;
-  white-space: nowrap;
-  vertical-align: middle;
-  -ms-touch-action: manipulation;
-      touch-action: manipulation;
-  cursor: pointer;
-  -webkit-user-select: none;
-     -moz-user-select: none;
-      -ms-user-select: none;
-          user-select: none;
-  background-image: none;
-  border: 1px solid transparent;
-  border-radius: 4px;
-}
-.btn:focus,
-.btn:active:focus,
-.btn.active:focus,
-.btn.focus,
-.btn:active.focus,
-.btn.active.focus {
-  outline: thin dotted;
-  outline: 5px auto -webkit-focus-ring-color;
-  outline-offset: -2px;
-}
-.btn:hover,
-.btn:focus,
-.btn.focus {
-  color: #333;
-  text-decoration: none;
-}
-.btn:active,
-.btn.active {
-  background-image: none;
-  outline: 0;
-  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
-          box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
-}
-.btn.disabled,
-.btn[disabled],
-fieldset[disabled] .btn {
-  cursor: not-allowed;
-  filter: alpha(opacity=65);
-  -webkit-box-shadow: none;
-          box-shadow: none;
-  opacity: .65;
-}
-a.btn.disabled,
-fieldset[disabled] a.btn {
-  pointer-events: none;
-}
-.btn-default {
-  color: #333;
-  background-color: #fff;
-  border-color: #ccc;
-}
-.btn-default:focus,
-.btn-default.focus {
-  color: #333;
-  background-color: #e6e6e6;
-  border-color: #8c8c8c;
-}
-.btn-default:hover {
-  color: #333;
-  background-color: #e6e6e6;
-  border-color: #adadad;
-}
-.btn-default:active,
-.btn-default.active,
-.open > .dropdown-toggle.btn-default {
-  color: #333;
-  background-color: #e6e6e6;
-  border-color: #adadad;
-}
-.btn-default:active:hover,
-.btn-default.active:hover,
-.open > .dropdown-toggle.btn-default:hover,
-.btn-default:active:focus,
-.btn-default.active:focus,
-.open > .dropdown-toggle.btn-default:focus,
-.btn-default:active.focus,
-.btn-default.active.focus,
-.open > .dropdown-toggle.btn-default.focus {
-  color: #333;
-  background-color: #d4d4d4;
-  border-color: #8c8c8c;
-}
-.btn-default:active,
-.btn-default.active,
-.open > .dropdown-toggle.btn-default {
-  background-image: none;
-}
-.btn-default.disabled:hover,
-.btn-default[disabled]:hover,
-fieldset[disabled] .btn-default:hover,
-.btn-default.disabled:focus,
-.btn-default[disabled]:focus,
-fieldset[disabled] .btn-default:focus,
-.btn-default.disabled.focus,
-.btn-default[disabled].focus,
-fieldset[disabled] .btn-default.focus {
-  background-color: #fff;
-  border-color: #ccc;
-}
-.btn-default .badge {
-  color: #fff;
-  background-color: #333;
-}
-.btn-primary {
-  color: #fff;
-  background-color: #337ab7;
-  border-color: #2e6da4;
-}
-.btn-primary:focus,
-.btn-primary.focus {
-  color: #fff;
-  background-color: #286090;
-  border-color: #122b40;
-}
-.btn-primary:hover {
-  color: #fff;
-  background-color: #286090;
-  border-color: #204d74;
-}
-.btn-primary:active,
-.btn-primary.active,
-.open > .dropdown-toggle.btn-primary {
-  color: #fff;
-  background-color: #286090;
-  border-color: #204d74;
-}
-.btn-primary:active:hover,
-.btn-primary.active:hover,
-.open > .dropdown-toggle.btn-primary:hover,
-.btn-primary:active:focus,
-.btn-primary.active:focus,
-.open > .dropdown-toggle.btn-primary:focus,
-.btn-primary:active.focus,
-.btn-primary.active.focus,
-.open > .dropdown-toggle.btn-primary.focus {
-  color: #fff;
-  background-color: #204d74;
-  border-color: #122b40;
-}
-.btn-primary:active,
-.btn-primary.active,
-.open > .dropdown-toggle.btn-primary {
-  background-image: none;
-}
-.btn-primary.disabled:hover,
-.btn-primary[disabled]:hover,
-fieldset[disabled] .btn-primary:hover,
-.btn-primary.disabled:focus,
-.btn-primary[disabled]:focus,
-fieldset[disabled] .btn-primary:focus,
-.btn-primary.disabled.focus,
-.btn-primary[disabled].focus,
-fieldset[disabled] .btn-primary.focus {
-  background-color: #337ab7;
-  border-color: #2e6da4;
-}
-.btn-primary .badge {
-  color: #337ab7;
-  background-color: #fff;
-}
-.btn-success {
-  color: #fff;
-  background-color: #5cb85c;
-  border-color: #4cae4c;
-}
-.btn-success:focus,
-.btn-success.focus {
-  color: #fff;
-  background-color: #449d44;
-  border-color: #255625;
-}
-.btn-success:hover {
-  color: #fff;
-  background-color: #449d44;
-  border-color: #398439;
-}
-.btn-success:active,
-.btn-success.active,
-.open > .dropdown-toggle.btn-success {
-  color: #fff;
-  background-color: #449d44;
-  border-color: #398439;
-}
-.btn-success:active:hover,
-.btn-success.active:hover,
-.open > .dropdown-toggle.btn-success:hover,
-.btn-success:active:focus,
-.btn-success.active:focus,
-.open > .dropdown-toggle.btn-success:focus,
-.btn-success:active.focus,
-.btn-success.active.focus,
-.open > .dropdown-toggle.btn-success.focus {
-  color: #fff;
-  background-color: #398439;
-  border-color: #255625;
-}
-.btn-success:active,
-.btn-success.active,
-.open > .dropdown-toggle.btn-success {
-  background-image: none;
-}
-.btn-success.disabled:hover,
-.btn-success[disabled]:hover,
-fieldset[disabled] .btn-success:hover,
-.btn-success.disabled:focus,
-.btn-success[disabled]:focus,
-fieldset[disabled] .btn-success:focus,
-.btn-success.disabled.focus,
-.btn-success[disabled].focus,
-fieldset[disabled] .btn-success.focus {
-  background-color: #5cb85c;
-  border-color: #4cae4c;
-}
-.btn-success .badge {
-  color: #5cb85c;
-  background-color: #fff;
-}
-.btn-info {
-  color: #fff;
-  background-color: #5bc0de;
-  border-color: #46b8da;
-}
-.btn-info:focus,
-.btn-info.focus {
-  color: #fff;
-  background-color: #31b0d5;
-  border-color: #1b6d85;
-}
-.btn-info:hover {
-  color: #fff;
-  background-color: #31b0d5;
-  border-color: #269abc;
-}
-.btn-info:active,
-.btn-info.active,
-.open > .dropdown-toggle.btn-info {
-  color: #fff;
-  background-color: #31b0d5;
-  border-color: #269abc;
-}
-.btn-info:active:hover,
-.btn-info.active:hover,
-.open > .dropdown-toggle.btn-info:hover,
-.btn-info:active:focus,
-.btn-info.active:focus,
-.open > .dropdown-toggle.btn-info:focus,
-.btn-info:active.focus,
-.btn-info.active.focus,
-.open > .dropdown-toggle.btn-info.focus {
-  color: #fff;
-  background-color: #269abc;
-  border-color: #1b6d85;
-}
-.btn-info:active,
-.btn-info.active,
-.open > .dropdown-toggle.btn-info {
-  background-image: none;
-}
-.btn-info.disabled:hover,
-.btn-info[disabled]:hover,
-fieldset[disabled] .btn-info:hover,
-.btn-info.disabled:focus,
-.btn-info[disabled]:focus,
-fieldset[disabled] .btn-info:focus,
-.btn-info.disabled.focus,
-.btn-info[disabled].focus,
-fieldset[disabled] .btn-info.focus {
-  background-color: #5bc0de;
-  border-color: #46b8da;
-}
-.btn-info .badge {
-  color: #5bc0de;
-  background-color: #fff;
-}
-.btn-warning {
-  color: #fff;
-  background-color: #f0ad4e;
-  border-color: #eea236;
-}
-.btn-warning:focus,
-.btn-warning.focus {
-  color: #fff;
-  background-color: #ec971f;
-  border-color: #985f0d;
-}
-.btn-warning:hover {
-  color: #fff;
-  background-color: #ec971f;
-  border-color: #d58512;
-}
-.btn-warning:active,
-.btn-warning.active,
-.open > .dropdown-toggle.btn-warning {
-  color: #fff;
-  background-color: #ec971f;
-  border-color: #d58512;
-}
-.btn-warning:active:hover,
-.btn-warning.active:hover,
-.open > .dropdown-toggle.btn-warning:hover,
-.btn-warning:active:focus,
-.btn-warning.active:focus,
-.open > .dropdown-toggle.btn-warning:focus,
-.btn-warning:active.focus,
-.btn-warning.active.focus,
-.open > .dropdown-toggle.btn-warning.focus {
-  color: #fff;
-  background-color: #d58512;
-  border-color: #985f0d;
-}
-.btn-warning:active,
-.btn-warning.active,
-.open > .dropdown-toggle.btn-warning {
-  background-image: none;
-}
-.btn-warning.disabled:hover,
-.btn-warning[disabled]:hover,
-fieldset[disabled] .btn-warning:hover,
-.btn-warning.disabled:focus,
-.btn-warning[disabled]:focus,
-fieldset[disabled] .btn-warning:focus,
-.btn-warning.disabled.focus,
-.btn-warning[disabled].focus,
-fieldset[disabled] .btn-warning.focus {
-  background-color: #f0ad4e;
-  border-color: #eea236;
-}
-.btn-warning .badge {
-  color: #f0ad4e;
-  background-color: #fff;
-}
-.btn-danger {
-  color: #fff;
-  background-color: #d9534f;
-  border-color: #d43f3a;
-}
-.btn-danger:focus,
-.btn-danger.focus {
-  color: #fff;
-  background-color: #c9302c;
-  border-color: #761c19;
-}
-.btn-danger:hover {
-  color: #fff;
-  background-color: #c9302c;
-  border-color: #ac2925;
-}
-.btn-danger:active,
-.btn-danger.active,
-.open > .dropdown-toggle.btn-danger {
-  color: #fff;
-  background-color: #c9302c;
-  border-color: #ac2925;
-}
-.btn-danger:active:hover,
-.btn-danger.active:hover,
-.open > .dropdown-toggle.btn-danger:hover,
-.btn-danger:active:focus,
-.btn-danger.active:focus,
-.open > .dropdown-toggle.btn-danger:focus,
-.btn-danger:active.focus,
-.btn-danger.active.focus,
-.open > .dropdown-toggle.btn-danger.focus {
-  color: #fff;
-  background-color: #ac2925;
-  border-color: #761c19;
-}
-.btn-danger:active,
-.btn-danger.active,
-.open > .dropdown-toggle.btn-danger {
-  background-image: none;
-}
-.btn-danger.disabled:hover,
-.btn-danger[disabled]:hover,
-fieldset[disabled] .btn-danger:hover,
-.btn-danger.disabled:focus,
-.btn-danger[disabled]:focus,
-fieldset[disabled] .btn-danger:focus,
-.btn-danger.disabled.focus,
-.btn-danger[disabled].focus,
-fieldset[disabled] .btn-danger.focus {
-  background-color: #d9534f;
-  border-color: #d43f3a;
-}
-.btn-danger .badge {
-  color: #d9534f;
-  background-color: #fff;
-}
-.btn-link {
-  font-weight: normal;
-  color: #337ab7;
-  border-radius: 0;
-}
-.btn-link,
-.btn-link:active,
-.btn-link.active,
-.btn-link[disabled],
-fieldset[disabled] .btn-link {
-  background-color: transparent;
-  -webkit-box-shadow: none;
-          box-shadow: none;
-}
-.btn-link,
-.btn-link:hover,
-.btn-link:focus,
-.btn-link:active {
-  border-color: transparent;
-}
-.btn-link:hover,
-.btn-link:focus {
-  color: #23527c;
-  text-decoration: underline;
-  background-color: transparent;
-}
-.btn-link[disabled]:hover,
-fieldset[disabled] .btn-link:hover,
-.btn-link[disabled]:focus,
-fieldset[disabled] .btn-link:focus {
-  color: #777;
-  text-decoration: none;
-}
-.btn-lg,
-.btn-group-lg > .btn {
-  padding: 10px 16px;
-  font-size: 18px;
-  line-height: 1.3333333;
-  border-radius: 6px;
-}
-.btn-sm,
-.btn-group-sm > .btn {
-  padding: 5px 10px;
-  font-size: 12px;
-  line-height: 1.5;
-  border-radius: 3px;
-}
-.btn-xs,
-.btn-group-xs > .btn {
-  padding: 1px 5px;
-  font-size: 12px;
-  line-height: 1.5;
-  border-radius: 3px;
-}
-.btn-block {
-  display: block;
-  width: 100%;
-}
-.btn-block + .btn-block {
-  margin-top: 5px;
-}
-input[type="submit"].btn-block,
-input[type="reset"].btn-block,
-input[type="button"].btn-block {
-  width: 100%;
-}
-.fade {
-  opacity: 0;
-  -webkit-transition: opacity .15s linear;
-       -o-transition: opacity .15s linear;
-          transition: opacity .15s linear;
-}
-.fade.in {
-  opacity: 1;
-}
-.collapse {
-  display: none;
-}
-.collapse.in {
-  display: block;
-}
-tr.collapse.in {
-  display: table-row;
-}
-tbody.collapse.in {
-  display: table-row-group;
-}
-.collapsing {
-  position: relative;
-  height: 0;
-  overflow: hidden;
-  -webkit-transition-timing-function: ease;
-       -o-transition-timing-function: ease;
-          transition-timing-function: ease;
-  -webkit-transition-duration: .35s;
-       -o-transition-duration: .35s;
-          transition-duration: .35s;
-  -webkit-transition-property: height, visibility;
-       -o-transition-property: height, visibility;
-          transition-property: height, visibility;
-}
-.caret {
-  display: inline-block;
-  width: 0;
-  height: 0;
-  margin-left: 2px;
-  vertical-align: middle;
-  border-top: 4px dashed;
-  border-top: 4px solid \9;
-  border-right: 4px solid transparent;
-  border-left: 4px solid transparent;
-}
-.dropup,
-.dropdown {
-  position: relative;
-}
-.dropdown-toggle:focus {
-  outline: 0;
-}
-.dropdown-menu {
-  position: absolute;
-  top: 100%;
-  left: 0;
-  z-index: 1000;
-  display: none;
-  float: left;
-  min-width: 160px;
-  padding: 5px 0;
-  margin: 2px 0 0;
-  font-size: 14px;
-  text-align: left;
-  list-style: none;
-  background-color: #fff;
-  -webkit-background-clip: padding-box;
-          background-clip: padding-box;
-  border: 1px solid #ccc;
-  border: 1px solid rgba(0, 0, 0, .15);
-  border-radius: 4px;
-  -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
-          box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
-}
-.dropdown-menu.pull-right {
-  right: 0;
-  left: auto;
-}
-.dropdown-menu .divider {
-  height: 1px;
-  margin: 9px 0;
-  overflow: hidden;
-  background-color: #e5e5e5;
-}
-.dropdown-menu > li > a {
-  display: block;
-  padding: 3px 20px;
-  clear: both;
-  font-weight: normal;
-  line-height: 1.42857143;
-  color: #333;
-  white-space: nowrap;
-}
-.dropdown-menu > li > a:hover,
-.dropdown-menu > li > a:focus {
-  color: #262626;
-  text-decoration: none;
-  background-color: #f5f5f5;
-}
-.dropdown-menu > .active > a,
-.dropdown-menu > .active > a:hover,
-.dropdown-menu > .active > a:focus {
-  color: #fff;
-  text-decoration: none;
-  background-color: #337ab7;
-  outline: 0;
-}
-.dropdown-menu > .disabled > a,
-.dropdown-menu > .disabled > a:hover,
-.dropdown-menu > .disabled > a:focus {
-  color: #777;
-}
-.dropdown-menu > .disabled > a:hover,
-.dropdown-menu > .disabled > a:focus {
-  text-decoration: none;
-  cursor: not-allowed;
-  background-color: transparent;
-  background-image: none;
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-}
-.open > .dropdown-menu {
-  display: block;
-}
-.open > a {
-  outline: 0;
-}
-.dropdown-menu-right {
-  right: 0;
-  left: auto;
-}
-.dropdown-menu-left {
-  right: auto;
-  left: 0;
-}
-.dropdown-header {
-  display: block;
-  padding: 3px 20px;
-  font-size: 12px;
-  line-height: 1.42857143;
-  color: #777;
-  white-space: nowrap;
-}
-.dropdown-backdrop {
-  position: fixed;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  z-index: 990;
-}
-.pull-right > .dropdown-menu {
-  right: 0;
-  left: auto;
-}
-.dropup .caret,
-.navbar-fixed-bottom .dropdown .caret {
-  content: "";
-  border-top: 0;
-  border-bottom: 4px dashed;
-  border-bottom: 4px solid \9;
-}
-.dropup .dropdown-menu,
-.navbar-fixed-bottom .dropdown .dropdown-menu {
-  top: auto;
-  bottom: 100%;
-  margin-bottom: 2px;
-}
-@media (min-width: 768px) {
-  .navbar-right .dropdown-menu {
-    right: 0;
-    left: auto;
-  }
-  .navbar-right .dropdown-menu-left {
-    right: auto;
-    left: 0;
-  }
-}
-.btn-group,
-.btn-group-vertical {
-  position: relative;
-  display: inline-block;
-  vertical-align: middle;
-}
-.btn-group > .btn,
-.btn-group-vertical > .btn {
-  position: relative;
-  float: left;
-}
-.btn-group > .btn:hover,
-.btn-group-vertical > .btn:hover,
-.btn-group > .btn:focus,
-.btn-group-vertical > .btn:focus,
-.btn-group > .btn:active,
-.btn-group-vertical > .btn:active,
-.btn-group > .btn.active,
-.btn-group-vertical > .btn.active {
-  z-index: 2;
-}
-.btn-group .btn + .btn,
-.btn-group .btn + .btn-group,
-.btn-group .btn-group + .btn,
-.btn-group .btn-group + .btn-group {
-  margin-left: -1px;
-}
-.btn-toolbar {
-  margin-left: -5px;
-}
-.btn-toolbar .btn,
-.btn-toolbar .btn-group,
-.btn-toolbar .input-group {
-  float: left;
-}
-.btn-toolbar > .btn,
-.btn-toolbar > .btn-group,
-.btn-toolbar > .input-group {
-  margin-left: 5px;
-}
-.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
-  border-radius: 0;
-}
-.btn-group > .btn:first-child {
-  margin-left: 0;
-}
-.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
-  border-top-right-radius: 0;
-  border-bottom-right-radius: 0;
-}
-.btn-group > .btn:last-child:not(:first-child),
-.btn-group > .dropdown-toggle:not(:first-child) {
-  border-top-left-radius: 0;
-  border-bottom-left-radius: 0;
-}
-.btn-group > .btn-group {
-  float: left;
-}
-.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
-  border-radius: 0;
-}
-.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child,
-.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
-  border-top-right-radius: 0;
-  border-bottom-right-radius: 0;
-}
-.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
-  border-top-left-radius: 0;
-  border-bottom-left-radius: 0;
-}
-.btn-group .dropdown-toggle:active,
-.btn-group.open .dropdown-toggle {
-  outline: 0;
-}
-.btn-group > .btn + .dropdown-toggle {
-  padding-right: 8px;
-  padding-left: 8px;
-}
-.btn-group > .btn-lg + .dropdown-toggle {
-  padding-right: 12px;
-  padding-left: 12px;
-}
-.btn-group.open .dropdown-toggle {
-  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
-          box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
-}
-.btn-group.open .dropdown-toggle.btn-link {
-  -webkit-box-shadow: none;
-          box-shadow: none;
-}
-.btn .caret {
-  margin-left: 0;
-}
-.btn-lg .caret {
-  border-width: 5px 5px 0;
-  border-bottom-width: 0;
-}
-.dropup .btn-lg .caret {
-  border-width: 0 5px 5px;
-}
-.btn-group-vertical > .btn,
-.btn-group-vertical > .btn-group,
-.btn-group-vertical > .btn-group > .btn {
-  display: block;
-  float: none;
-  width: 100%;
-  max-width: 100%;
-}
-.btn-group-vertical > .btn-group > .btn {
-  float: none;
-}
-.btn-group-vertical > .btn + .btn,
-.btn-group-vertical > .btn + .btn-group,
-.btn-group-vertical > .btn-group + .btn,
-.btn-group-vertical > .btn-group + .btn-group {
-  margin-top: -1px;
-  margin-left: 0;
-}
-.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
-  border-radius: 0;
-}
-.btn-group-vertical > .btn:first-child:not(:last-child) {
-  border-top-left-radius: 4px;
-  border-top-right-radius: 4px;
-  border-bottom-right-radius: 0;
-  border-bottom-left-radius: 0;
-}
-.btn-group-vertical > .btn:last-child:not(:first-child) {
-  border-top-left-radius: 0;
-  border-top-right-radius: 0;
-  border-bottom-right-radius: 4px;
-  border-bottom-left-radius: 4px;
-}
-.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
-  border-radius: 0;
-}
-.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,
-.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
-  border-bottom-right-radius: 0;
-  border-bottom-left-radius: 0;
-}
-.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
-  border-top-left-radius: 0;
-  border-top-right-radius: 0;
-}
-.btn-group-justified {
-  display: table;
-  width: 100%;
-  table-layout: fixed;
-  border-collapse: separate;
-}
-.btn-group-justified > .btn,
-.btn-group-justified > .btn-group {
-  display: table-cell;
-  float: none;
-  width: 1%;
-}
-.btn-group-justified > .btn-group .btn {
-  width: 100%;
-}
-.btn-group-justified > .btn-group .dropdown-menu {
-  left: auto;
-}
-[data-toggle="buttons"] > .btn input[type="radio"],
-[data-toggle="buttons"] > .btn-group > .btn input[type="radio"],
-[data-toggle="buttons"] > .btn input[type="checkbox"],
-[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] {
-  position: absolute;
-  clip: rect(0, 0, 0, 0);
-  pointer-events: none;
-}
-.input-group {
-  position: relative;
-  display: table;
-  border-collapse: separate;
-}
-.input-group[class*="col-"] {
-  float: none;
-  padding-right: 0;
-  padding-left: 0;
-}
-.input-group .form-control {
-  position: relative;
-  z-index: 2;
-  float: left;
-  width: 100%;
-  margin-bottom: 0;
-}
-.input-group .form-control:focus {
-  z-index: 3;
-}
-.input-group-lg > .form-control,
-.input-group-lg > .input-group-addon,
-.input-group-lg > .input-group-btn > .btn {
-  height: 46px;
-  padding: 10px 16px;
-  font-size: 18px;
-  line-height: 1.3333333;
-  border-radius: 6px;
-}
-select.input-group-lg > .form-control,
-select.input-group-lg > .input-group-addon,
-select.input-group-lg > .input-group-btn > .btn {
-  height: 46px;
-  line-height: 46px;
-}
-textarea.input-group-lg > .form-control,
-textarea.input-group-lg > .input-group-addon,
-textarea.input-group-lg > .input-group-btn > .btn,
-select[multiple].input-group-lg > .form-control,
-select[multiple].input-group-lg > .input-group-addon,
-select[multiple].input-group-lg > .input-group-btn > .btn {
-  height: auto;
-}
-.input-group-sm > .form-control,
-.input-group-sm > .input-group-addon,
-.input-group-sm > .input-group-btn > .btn {
-  height: 30px;
-  padding: 5px 10px;
-  font-size: 12px;
-  line-height: 1.5;
-  border-radius: 3px;
-}
-select.input-group-sm > .form-control,
-select.input-group-sm > .input-group-addon,
-select.input-group-sm > .input-group-btn > .btn {
-  height: 30px;
-  line-height: 30px;
-}
-textarea.input-group-sm > .form-control,
-textarea.input-group-sm > .input-group-addon,
-textarea.input-group-sm > .input-group-btn > .btn,
-select[multiple].input-group-sm > .form-control,
-select[multiple].input-group-sm > .input-group-addon,
-select[multiple].input-group-sm > .input-group-btn > .btn {
-  height: auto;
-}
-.input-group-addon,
-.input-group-btn,
-.input-group .form-control {
-  display: table-cell;
-}
-.input-group-addon:not(:first-child):not(:last-child),
-.input-group-btn:not(:first-child):not(:last-child),
-.input-group .form-control:not(:first-child):not(:last-child) {
-  border-radius: 0;
-}
-.input-group-addon,
-.input-group-btn {
-  width: 1%;
-  white-space: nowrap;
-  vertical-align: middle;
-}
-.input-group-addon {
-  padding: 6px 12px;
-  font-size: 14px;
-  font-weight: normal;
-  line-height: 1;
-  color: #555;
-  text-align: center;
-  background-color: #eee;
-  border: 1px solid #ccc;
-  border-radius: 4px;
-}
-.input-group-addon.input-sm {
-  padding: 5px 10px;
-  font-size: 12px;
-  border-radius: 3px;
-}
-.input-group-addon.input-lg {
-  padding: 10px 16px;
-  font-size: 18px;
-  border-radius: 6px;
-}
-.input-group-addon input[type="radio"],
-.input-group-addon input[type="checkbox"] {
-  margin-top: 0;
-}
-.input-group .form-control:first-child,
-.input-group-addon:first-child,
-.input-group-btn:first-child > .btn,
-.input-group-btn:first-child > .btn-group > .btn,
-.input-group-btn:first-child > .dropdown-toggle,
-.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
-.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
-  border-top-right-radius: 0;
-  border-bottom-right-radius: 0;
-}
-.input-group-addon:first-child {
-  border-right: 0;
-}
-.input-group .form-control:last-child,
-.input-group-addon:last-child,
-.input-group-btn:last-child > .btn,
-.input-group-btn:last-child > .btn-group > .btn,
-.input-group-btn:last-child > .dropdown-toggle,
-.input-group-btn:first-child > .btn:not(:first-child),
-.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
-  border-top-left-radius: 0;
-  border-bottom-left-radius: 0;
-}
-.input-group-addon:last-child {
-  border-left: 0;
-}
-.input-group-btn {
-  position: relative;
-  font-size: 0;
-  white-space: nowrap;
-}
-.input-group-btn > .btn {
-  position: relative;
-}
-.input-group-btn > .btn + .btn {
-  margin-left: -1px;
-}
-.input-group-btn > .btn:hover,
-.input-group-btn > .btn:focus,
-.input-group-btn > .btn:active {
-  z-index: 2;
-}
-.input-group-btn:first-child > .btn,
-.input-group-btn:first-child > .btn-group {
-  margin-right: -1px;
-}
-.input-group-btn:last-child > .btn,
-.input-group-btn:last-child > .btn-group {
-  z-index: 2;
-  margin-left: -1px;
-}
-.nav {
-  padding-left: 0;
-  margin-bottom: 0;
-  list-style: none;
-}
-.nav > li {
-  position: relative;
-  display: block;
-}
-.nav > li > a {
-  position: relative;
-  display: block;
-  padding: 10px 15px;
-}
-.nav > li > a:hover,
-.nav > li > a:focus {
-  text-decoration: none;
-  background-color: #eee;
-}
-.nav > li.disabled > a {
-  color: #777;
-}
-.nav > li.disabled > a:hover,
-.nav > li.disabled > a:focus {
-  color: #777;
-  text-decoration: none;
-  cursor: not-allowed;
-  background-color: transparent;
-}
-.nav .open > a,
-.nav .open > a:hover,
-.nav .open > a:focus {
-  background-color: #eee;
-  border-color: #337ab7;
-}
-.nav .nav-divider {
-  height: 1px;
-  margin: 9px 0;
-  overflow: hidden;
-  background-color: #e5e5e5;
-}
-.nav > li > a > img {
-  max-width: none;
-}
-.nav-tabs {
-  border-bottom: 1px solid #ddd;
-}
-.nav-tabs > li {
-  float: left;
-  margin-bottom: -1px;
-}
-.nav-tabs > li > a {
-  margin-right: 2px;
-  line-height: 1.42857143;
-  border: 1px solid transparent;
-  border-radius: 4px 4px 0 0;
-}
-.nav-tabs > li > a:hover {
-  border-color: #eee #eee #ddd;
-}
-.nav-tabs > li.active > a,
-.nav-tabs > li.active > a:hover,
-.nav-tabs > li.active > a:focus {
-  color: #555;
-  cursor: default;
-  background-color: #fff;
-  border: 1px solid #ddd;
-  border-bottom-color: transparent;
-}
-.nav-tabs.nav-justified {
-  width: 100%;
-  border-bottom: 0;
-}
-.nav-tabs.nav-justified > li {
-  float: none;
-}
-.nav-tabs.nav-justified > li > a {
-  margin-bottom: 5px;
-  text-align: center;
-}
-.nav-tabs.nav-justified > .dropdown .dropdown-menu {
-  top: auto;
-  left: auto;
-}
-@media (min-width: 768px) {
-  .nav-tabs.nav-justified > li {
-    display: table-cell;
-    width: 1%;
-  }
-  .nav-tabs.nav-justified > li > a {
-    margin-bottom: 0;
-  }
-}
-.nav-tabs.nav-justified > li > a {
-  margin-right: 0;
-  border-radius: 4px;
-}
-.nav-tabs.nav-justified > .active > a,
-.nav-tabs.nav-justified > .active > a:hover,
-.nav-tabs.nav-justified > .active > a:focus {
-  border: 1px solid #ddd;
-}
-@media (min-width: 768px) {
-  .nav-tabs.nav-justified > li > a {
-    border-bottom: 1px solid #ddd;
-    border-radius: 4px 4px 0 0;
-  }
-  .nav-tabs.nav-justified > .active > a,
-  .nav-tabs.nav-justified > .active > a:hover,
-  .nav-tabs.nav-justified > .active > a:focus {
-    border-bottom-color: #fff;
-  }
-}
-.nav-pills > li {
-  float: left;
-}
-.nav-pills > li > a {
-  border-radius: 4px;
-}
-.nav-pills > li + li {
-  margin-left: 2px;
-}
-.nav-pills > li.active > a,
-.nav-pills > li.active > a:hover,
-.nav-pills > li.active > a:focus {
-  color: #fff;
-  background-color: #337ab7;
-}
-.nav-stacked > li {
-  float: none;
-}
-.nav-stacked > li + li {
-  margin-top: 2px;
-  margin-left: 0;
-}
-.nav-justified {
-  width: 100%;
-}
-.nav-justified > li {
-  float: none;
-}
-.nav-justified > li > a {
-  margin-bottom: 5px;
-  text-align: center;
-}
-.nav-justified > .dropdown .dropdown-menu {
-  top: auto;
-  left: auto;
-}
-@media (min-width: 768px) {
-  .nav-justified > li {
-    display: table-cell;
-    width: 1%;
-  }
-  .nav-justified > li > a {
-    margin-bottom: 0;
-  }
-}
-.nav-tabs-justified {
-  border-bottom: 0;
-}
-.nav-tabs-justified > li > a {
-  margin-right: 0;
-  border-radius: 4px;
-}
-.nav-tabs-justified > .active > a,
-.nav-tabs-justified > .active > a:hover,
-.nav-tabs-justified > .active > a:focus {
-  border: 1px solid #ddd;
-}
-@media (min-width: 768px) {
-  .nav-tabs-justified > li > a {
-    border-bottom: 1px solid #ddd;
-    border-radius: 4px 4px 0 0;
-  }
-  .nav-tabs-justified > .active > a,
-  .nav-tabs-justified > .active > a:hover,
-  .nav-tabs-justified > .active > a:focus {
-    border-bottom-color: #fff;
-  }
-}
-.tab-content > .tab-pane {
-  display: none;
-}
-.tab-content > .active {
-  display: block;
-}
-.nav-tabs .dropdown-menu {
-  margin-top: -1px;
-  border-top-left-radius: 0;
-  border-top-right-radius: 0;
-}
-.navbar {
-  position: relative;
-  min-height: 50px;
-  margin-bottom: 20px;
-  border: 1px solid transparent;
-}
-@media (min-width: 768px) {
-  .navbar {
-    border-radius: 4px;
-  }
-}
-@media (min-width: 768px) {
-  .navbar-header {
-    float: left;
-  }
-}
-.navbar-collapse {
-  padding-right: 15px;
-  padding-left: 15px;
-  overflow-x: visible;
-  -webkit-overflow-scrolling: touch;
-  border-top: 1px solid transparent;
-  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
-          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
-}
-.navbar-collapse.in {
-  overflow-y: auto;
-}
-@media (min-width: 768px) {
-  .navbar-collapse {
-    width: auto;
-    border-top: 0;
-    -webkit-box-shadow: none;
-            box-shadow: none;
-  }
-  .navbar-collapse.collapse {
-    display: block !important;
-    height: auto !important;
-    padding-bottom: 0;
-    overflow: visible !important;
-  }
-  .navbar-collapse.in {
-    overflow-y: visible;
-  }
-  .navbar-fixed-top .navbar-collapse,
-  .navbar-static-top .navbar-collapse,
-  .navbar-fixed-bottom .navbar-collapse {
-    padding-right: 0;
-    padding-left: 0;
-  }
-}
-.navbar-fixed-top .navbar-collapse,
-.navbar-fixed-bottom .navbar-collapse {
-  max-height: 340px;
-}
-@media (max-device-width: 480px) and (orientation: landscape) {
-  .navbar-fixed-top .navbar-collapse,
-  .navbar-fixed-bottom .navbar-collapse {
-    max-height: 200px;
-  }
-}
-.container > .navbar-header,
-.container-fluid > .navbar-header,
-.container > .navbar-collapse,
-.container-fluid > .navbar-collapse {
-  margin-right: -15px;
-  margin-left: -15px;
-}
-@media (min-width: 768px) {
-  .container > .navbar-header,
-  .container-fluid > .navbar-header,
-  .container > .navbar-collapse,
-  .container-fluid > .navbar-collapse {
-    margin-right: 0;
-    margin-left: 0;
-  }
-}
-.navbar-static-top {
-  z-index: 1000;
-  border-width: 0 0 1px;
-}
-@media (min-width: 768px) {
-  .navbar-static-top {
-    border-radius: 0;
-  }
-}
-.navbar-fixed-top,
-.navbar-fixed-bottom {
-  position: fixed;
-  right: 0;
-  left: 0;
-  z-index: 1030;
-}
-@media (min-width: 768px) {
-  .navbar-fixed-top,
-  .navbar-fixed-bottom {
-    border-radius: 0;
-  }
-}
-.navbar-fixed-top {
-  top: 0;
-  border-width: 0 0 1px;
-}
-.navbar-fixed-bottom {
-  bottom: 0;
-  margin-bottom: 0;
-  border-width: 1px 0 0;
-}
-.navbar-brand {
-  float: left;
-  height: 50px;
-  padding: 15px 15px;
-  font-size: 18px;
-  line-height: 20px;
-}
-.navbar-brand:hover,
-.navbar-brand:focus {
-  text-decoration: none;
-}
-.navbar-brand > img {
-  display: block;
-}
-@media (min-width: 768px) {
-  .navbar > .container .navbar-brand,
-  .navbar > .container-fluid .navbar-brand {
-    margin-left: -15px;
-  }
-}
-.navbar-toggle {
-  position: relative;
-  float: right;
-  padding: 9px 10px;
-  margin-top: 8px;
-  margin-right: 15px;
-  margin-bottom: 8px;
-  background-color: transparent;
-  background-image: none;
-  border: 1px solid transparent;
-  border-radius: 4px;
-}
-.navbar-toggle:focus {
-  outline: 0;
-}
-.navbar-toggle .icon-bar {
-  display: block;
-  width: 22px;
-  height: 2px;
-  border-radius: 1px;
-}
-.navbar-toggle .icon-bar + .icon-bar {
-  margin-top: 4px;
-}
-@media (min-width: 768px) {
-  .navbar-toggle {
-    display: none;
-  }
-}
-.navbar-nav {
-  margin: 7.5px -15px;
-}
-.navbar-nav > li > a {
-  padding-top: 10px;
-  padding-bottom: 10px;
-  line-height: 20px;
-}
-@media (max-width: 767px) {
-  .navbar-nav .open .dropdown-menu {
-    position: static;
-    float: none;
-    width: auto;
-    margin-top: 0;
-    background-color: transparent;
-    border: 0;
-    -webkit-box-shadow: none;
-            box-shadow: none;
-  }
-  .navbar-nav .open .dropdown-menu > li > a,
-  .navbar-nav .open .dropdown-menu .dropdown-header {
-    padding: 5px 15px 5px 25px;
-  }
-  .navbar-nav .open .dropdown-menu > li > a {
-    line-height: 20px;
-  }
-  .navbar-nav .open .dropdown-menu > li > a:hover,
-  .navbar-nav .open .dropdown-menu > li > a:focus {
-    background-image: none;
-  }
-}
-@media (min-width: 768px) {
-  .navbar-nav {
-    float: left;
-    margin: 0;
-  }
-  .navbar-nav > li {
-    float: left;
-  }
-  .navbar-nav > li > a {
-    padding-top: 15px;
-    padding-bottom: 15px;
-  }
-}
-.navbar-form {
-  padding: 10px 15px;
-  margin-top: 8px;
-  margin-right: -15px;
-  margin-bottom: 8px;
-  margin-left: -15px;
-  border-top: 1px solid transparent;
-  border-bottom: 1px solid transparent;
-  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
-          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
-}
-@media (min-width: 768px) {
-  .navbar-form .form-group {
-    display: inline-block;
-    margin-bottom: 0;
-    vertical-align: middle;
-  }
-  .navbar-form .form-control {
-    display: inline-block;
-    width: auto;
-    vertical-align: middle;
-  }
-  .navbar-form .form-control-static {
-    display: inline-block;
-  }
-  .navbar-form .input-group {
-    display: inline-table;
-    vertical-align: middle;
-  }
-  .navbar-form .input-group .input-group-addon,
-  .navbar-form .input-group .input-group-btn,
-  .navbar-form .input-group .form-control {
-    width: auto;
-  }
-  .navbar-form .input-group > .form-control {
-    width: 100%;
-  }
-  .navbar-form .control-label {
-    margin-bottom: 0;
-    vertical-align: middle;
-  }
-  .navbar-form .radio,
-  .navbar-form .checkbox {
-    display: inline-block;
-    margin-top: 0;
-    margin-bottom: 0;
-    vertical-align: middle;
-  }
-  .navbar-form .radio label,
-  .navbar-form .checkbox label {
-    padding-left: 0;
-  }
-  .navbar-form .radio input[type="radio"],
-  .navbar-form .checkbox input[type="checkbox"] {
-    position: relative;
-    margin-left: 0;
-  }
-  .navbar-form .has-feedback .form-control-feedback {
-    top: 0;
-  }
-}
-@media (max-width: 767px) {
-  .navbar-form .form-group {
-    margin-bottom: 5px;
-  }
-  .navbar-form .form-group:last-child {
-    margin-bottom: 0;
-  }
-}
-@media (min-width: 768px) {
-  .navbar-form {
-    width: auto;
-    padding-top: 0;
-    padding-bottom: 0;
-    margin-right: 0;
-    margin-left: 0;
-    border: 0;
-    -webkit-box-shadow: none;
-            box-shadow: none;
-  }
-}
-.navbar-nav > li > .dropdown-menu {
-  margin-top: 0;
-  border-top-left-radius: 0;
-  border-top-right-radius: 0;
-}
-.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
-  margin-bottom: 0;
-  border-top-left-radius: 4px;
-  border-top-right-radius: 4px;
-  border-bottom-right-radius: 0;
-  border-bottom-left-radius: 0;
-}
-.navbar-btn {
-  margin-top: 8px;
-  margin-bottom: 8px;
-}
-.navbar-btn.btn-sm {
-  margin-top: 10px;
-  margin-bottom: 10px;
-}
-.navbar-btn.btn-xs {
-  margin-top: 14px;
-  margin-bottom: 14px;
-}
-.navbar-text {
-  margin-top: 15px;
-  margin-bottom: 15px;
-}
-@media (min-width: 768px) {
-  .navbar-text {
-    float: left;
-    margin-right: 15px;
-    margin-left: 15px;
-  }
-}
-@media (min-width: 768px) {
-  .navbar-left {
-    float: left !important;
-  }
-  .navbar-right {
-    float: right !important;
-    margin-right: -15px;
-  }
-  .navbar-right ~ .navbar-right {
-    margin-right: 0;
-  }
-}
-.navbar-default {
-  background-color: #f8f8f8;
-  border-color: #e7e7e7;
-}
-.navbar-default .navbar-brand {
-  color: #777;
-}
-.navbar-default .navbar-brand:hover,
-.navbar-default .navbar-brand:focus {
-  color: #5e5e5e;
-  background-color: transparent;
-}
-.navbar-default .navbar-text {
-  color: #777;
-}
-.navbar-default .navbar-nav > li > a {
-  color: #777;
-}
-.navbar-default .navbar-nav > li > a:hover,
-.navbar-default .navbar-nav > li > a:focus {
-  color: #333;
-  background-color: transparent;
-}
-.navbar-default .navbar-nav > .active > a,
-.navbar-default .navbar-nav > .active > a:hover,
-.navbar-default .navbar-nav > .active > a:focus {
-  color: #555;
-  background-color: #e7e7e7;
-}
-.navbar-default .navbar-nav > .disabled > a,
-.navbar-default .navbar-nav > .disabled > a:hover,
-.navbar-default .navbar-nav > .disabled > a:focus {
-  color: #ccc;
-  background-color: transparent;
-}
-.navbar-default .navbar-toggle {
-  border-color: #ddd;
-}
-.navbar-default .navbar-toggle:hover,
-.navbar-default .navbar-toggle:focus {
-  background-color: #ddd;
-}
-.navbar-default .navbar-toggle .icon-bar {
-  background-color: #888;
-}
-.navbar-default .navbar-collapse,
-.navbar-default .navbar-form {
-  border-color: #e7e7e7;
-}
-.navbar-default .navbar-nav > .open > a,
-.navbar-default .navbar-nav > .open > a:hover,
-.navbar-default .navbar-nav > .open > a:focus {
-  color: #555;
-  background-color: #e7e7e7;
-}
-@media (max-width: 767px) {
-  .navbar-default .navbar-nav .open .dropdown-menu > li > a {
-    color: #777;
-  }
-  .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
-  .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
-    color: #333;
-    background-color: transparent;
-  }
-  .navbar-default .navbar-nav .open .dropdown-menu > .active > a,
-  .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
-  .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
-    color: #555;
-    background-color: #e7e7e7;
-  }
-  .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
-  .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
-  .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
-    color: #ccc;
-    background-color: transparent;
-  }
-}
-.navbar-default .navbar-link {
-  color: #777;
-}
-.navbar-default .navbar-link:hover {
-  color: #333;
-}
-.navbar-default .btn-link {
-  color: #777;
-}
-.navbar-default .btn-link:hover,
-.navbar-default .btn-link:focus {
-  color: #333;
-}
-.navbar-default .btn-link[disabled]:hover,
-fieldset[disabled] .navbar-default .btn-link:hover,
-.navbar-default .btn-link[disabled]:focus,
-fieldset[disabled] .navbar-default .btn-link:focus {
-  color: #ccc;
-}
-.navbar-inverse {
-  background-color: #222;
-  border-color: #080808;
-}
-.navbar-inverse .navbar-brand {
-  color: #9d9d9d;
-}
-.navbar-inverse .navbar-brand:hover,
-.navbar-inverse .navbar-brand:focus {
-  color: #fff;
-  background-color: transparent;
-}
-.navbar-inverse .navbar-text {
-  color: #9d9d9d;
-}
-.navbar-inverse .navbar-nav > li > a {
-  color: #9d9d9d;
-}
-.navbar-inverse .navbar-nav > li > a:hover,
-.navbar-inverse .navbar-nav > li > a:focus {
-  color: #fff;
-  background-color: transparent;
-}
-.navbar-inverse .navbar-nav > .active > a,
-.navbar-inverse .navbar-nav > .active > a:hover,
-.navbar-inverse .navbar-nav > .active > a:focus {
-  color: #fff;
-  background-color: #080808;
-}
-.navbar-inverse .navbar-nav > .disabled > a,
-.navbar-inverse .navbar-nav > .disabled > a:hover,
-.navbar-inverse .navbar-nav > .disabled > a:focus {
-  color: #444;
-  background-color: transparent;
-}
-.navbar-inverse .navbar-toggle {
-  border-color: #333;
-}
-.navbar-inverse .navbar-toggle:hover,
-.navbar-inverse .navbar-toggle:focus {
-  background-color: #333;
-}
-.navbar-inverse .navbar-toggle .icon-bar {
-  background-color: #fff;
-}
-.navbar-inverse .navbar-collapse,
-.navbar-inverse .navbar-form {
-  border-color: #101010;
-}
-.navbar-inverse .navbar-nav > .open > a,
-.navbar-inverse .navbar-nav > .open > a:hover,
-.navbar-inverse .navbar-nav > .open > a:focus {
-  color: #fff;
-  background-color: #080808;
-}
-@media (max-width: 767px) {
-  .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
-    border-color: #080808;
-  }
-  .navbar-inverse .navbar-nav .open .dropdown-menu .divider {
-    background-color: #080808;
-  }
-  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
-    color: #9d9d9d;
-  }
-  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
-  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
-    color: #fff;
-    background-color: transparent;
-  }
-  .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
-  .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
-  .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
-    color: #fff;
-    background-color: #080808;
-  }
-  .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
-  .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
-  .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
-    color: #444;
-    background-color: transparent;
-  }
-}
-.navbar-inverse .navbar-link {
-  color: #9d9d9d;
-}
-.navbar-inverse .navbar-link:hover {
-  color: #fff;
-}
-.navbar-inverse .btn-link {
-  color: #9d9d9d;
-}
-.navbar-inverse .btn-link:hover,
-.navbar-inverse .btn-link:focus {
-  color: #fff;
-}
-.navbar-inverse .btn-link[disabled]:hover,
-fieldset[disabled] .navbar-inverse .btn-link:hover,
-.navbar-inverse .btn-link[disabled]:focus,
-fieldset[disabled] .navbar-inverse .btn-link:focus {
-  color: #444;
-}
-.breadcrumb {
-  padding: 8px 15px;
-  margin-bottom: 20px;
-  list-style: none;
-  background-color: #f5f5f5;
-  border-radius: 4px;
-}
-.breadcrumb > li {
-  display: inline-block;
-}
-.breadcrumb > li + li:before {
-  padding: 0 5px;
-  color: #ccc;
-  content: "/\00a0";
-}
-.breadcrumb > .active {
-  color: #777;
-}
-.pagination {
-  display: inline-block;
-  padding-left: 0;
-  margin: 20px 0;
-  border-radius: 4px;
-}
-.pagination > li {
-  display: inline;
-}
-.pagination > li > a,
-.pagination > li > span {
-  position: relative;
-  float: left;
-  padding: 6px 12px;
-  margin-left: -1px;
-  line-height: 1.42857143;
-  color: #337ab7;
-  text-decoration: none;
-  background-color: #fff;
-  border: 1px solid #ddd;
-}
-.pagination > li:first-child > a,
-.pagination > li:first-child > span {
-  margin-left: 0;
-  border-top-left-radius: 4px;
-  border-bottom-left-radius: 4px;
-}
-.pagination > li:last-child > a,
-.pagination > li:last-child > span {
-  border-top-right-radius: 4px;
-  border-bottom-right-radius: 4px;
-}
-.pagination > li > a:hover,
-.pagination > li > span:hover,
-.pagination > li > a:focus,
-.pagination > li > span:focus {
-  z-index: 2;
-  color: #23527c;
-  background-color: #eee;
-  border-color: #ddd;
-}
-.pagination > .active > a,
-.pagination > .active > span,
-.pagination > .active > a:hover,
-.pagination > .active > span:hover,
-.pagination > .active > a:focus,
-.pagination > .active > span:focus {
-  z-index: 3;
-  color: #fff;
-  cursor: default;
-  background-color: #337ab7;
-  border-color: #337ab7;
-}
-.pagination > .disabled > span,
-.pagination > .disabled > span:hover,
-.pagination > .disabled > span:focus,
-.pagination > .disabled > a,
-.pagination > .disabled > a:hover,
-.pagination > .disabled > a:focus {
-  color: #777;
-  pointer-events: none;
-  cursor: not-allowed;
-  background-color: #fff;
-  border-color: #ddd;
-}
-.pagination-lg > li > a,
-.pagination-lg > li > span {
-  padding: 10px 16px;
-  font-size: 18px;
-  line-height: 1.3333333;
-}
-.pagination-lg > li:first-child > a,
-.pagination-lg > li:first-child > span {
-  border-top-left-radius: 6px;
-  border-bottom-left-radius: 6px;
-}
-.pagination-lg > li:last-child > a,
-.pagination-lg > li:last-child > span {
-  border-top-right-radius: 6px;
-  border-bottom-right-radius: 6px;
-}
-.pagination-sm > li > a,
-.pagination-sm > li > span {
-  padding: 5px 10px;
-  font-size: 12px;
-  line-height: 1.5;
-}
-.pagination-sm > li:first-child > a,
-.pagination-sm > li:first-child > span {
-  border-top-left-radius: 3px;
-  border-bottom-left-radius: 3px;
-}
-.pagination-sm > li:last-child > a,
-.pagination-sm > li:last-child > span {
-  border-top-right-radius: 3px;
-  border-bottom-right-radius: 3px;
-}
-.pager {
-  padding-left: 0;
-  margin: 20px 0;
-  text-align: center;
-  list-style: none;
-}
-.pager li {
-  display: inline;
-}
-.pager li > a,
-.pager li > span {
-  display: inline-block;
-  padding: 5px 14px;
-  background-color: #fff;
-  border: 1px solid #ddd;
-  border-radius: 15px;
-}
-.pager li > a:hover,
-.pager li > a:focus {
-  text-decoration: none;
-  background-color: #eee;
-}
-.pager .next > a,
-.pager .next > span {
-  float: right;
-}
-.pager .previous > a,
-.pager .previous > span {
-  float: left;
-}
-.pager .disabled > a,
-.pager .disabled > a:hover,
-.pager .disabled > a:focus,
-.pager .disabled > span {
-  color: #777;
-  pointer-events: none;
-  cursor: not-allowed;
-  background-color: #fff;
-}
-.label {
-  display: inline;
-  padding: .2em .6em .3em;
-  font-size: 75%;
-  font-weight: bold;
-  line-height: 1;
-  color: #fff;
-  text-align: center;
-  white-space: nowrap;
-  vertical-align: baseline;
-  border-radius: .25em;
-}
-a.label:hover,
-a.label:focus {
-  color: #fff;
-  text-decoration: none;
-  cursor: pointer;
-}
-.label:empty {
-  display: none;
-}
-.btn .label {
-  position: relative;
-  top: -1px;
-}
-.label-default {
-  background-color: #777;
-}
-.label-default[href]:hover,
-.label-default[href]:focus {
-  background-color: #5e5e5e;
-}
-.label-primary {
-  background-color: #337ab7;
-}
-.label-primary[href]:hover,
-.label-primary[href]:focus {
-  background-color: #286090;
-}
-.label-success {
-  background-color: #5cb85c;
-}
-.label-success[href]:hover,
-.label-success[href]:focus {
-  background-color: #449d44;
-}
-.label-info {
-  background-color: #5bc0de;
-}
-.label-info[href]:hover,
-.label-info[href]:focus {
-  background-color: #31b0d5;
-}
-.label-warning {
-  background-color: #f0ad4e;
-}
-.label-warning[href]:hover,
-.label-warning[href]:focus {
-  background-color: #ec971f;
-}
-.label-danger {
-  background-color: #d9534f;
-}
-.label-danger[href]:hover,
-.label-danger[href]:focus {
-  background-color: #c9302c;
-}
-.badge {
-  display: inline-block;
-  min-width: 10px;
-  padding: 3px 7px;
-  font-size: 12px;
-  font-weight: bold;
-  line-height: 1;
-  color: #fff;
-  text-align: center;
-  white-space: nowrap;
-  vertical-align: middle;
-  background-color: #777;
-  border-radius: 10px;
-}
-.badge:empty {
-  display: none;
-}
-.btn .badge {
-  position: relative;
-  top: -1px;
-}
-.btn-xs .badge,
-.btn-group-xs > .btn .badge {
-  top: 0;
-  padding: 1px 5px;
-}
-a.badge:hover,
-a.badge:focus {
-  color: #fff;
-  text-decoration: none;
-  cursor: pointer;
-}
-.list-group-item.active > .badge,
-.nav-pills > .active > a > .badge {
-  color: #337ab7;
-  background-color: #fff;
-}
-.list-group-item > .badge {
-  float: right;
-}
-.list-group-item > .badge + .badge {
-  margin-right: 5px;
-}
-.nav-pills > li > a > .badge {
-  margin-left: 3px;
-}
-.jumbotron {
-  padding-top: 30px;
-  padding-bottom: 30px;
-  margin-bottom: 30px;
-  color: inherit;
-  background-color: #eee;
-}
-.jumbotron h1,
-.jumbotron .h1 {
-  color: inherit;
-}
-.jumbotron p {
-  margin-bottom: 15px;
-  font-size: 21px;
-  font-weight: 200;
-}
-.jumbotron > hr {
-  border-top-color: #d5d5d5;
-}
-.container .jumbotron,
-.container-fluid .jumbotron {
-  padding-right: 15px;
-  padding-left: 15px;
-  border-radius: 6px;
-}
-.jumbotron .container {
-  max-width: 100%;
-}
-@media screen and (min-width: 768px) {
-  .jumbotron {
-    padding-top: 48px;
-    padding-bottom: 48px;
-  }
-  .container .jumbotron,
-  .container-fluid .jumbotron {
-    padding-right: 60px;
-    padding-left: 60px;
-  }
-  .jumbotron h1,
-  .jumbotron .h1 {
-    font-size: 63px;
-  }
-}
-.thumbnail {
-  display: block;
-  padding: 4px;
-  margin-bottom: 20px;
-  line-height: 1.42857143;
-  background-color: #fff;
-  border: 1px solid #ddd;
-  border-radius: 4px;
-  -webkit-transition: border .2s ease-in-out;
-       -o-transition: border .2s ease-in-out;
-          transition: border .2s ease-in-out;
-}
-.thumbnail > img,
-.thumbnail a > img {
-  margin-right: auto;
-  margin-left: auto;
-}
-a.thumbnail:hover,
-a.thumbnail:focus,
-a.thumbnail.active {
-  border-color: #337ab7;
-}
-.thumbnail .caption {
-  padding: 9px;
-  color: #333;
-}
-.alert {
-  padding: 15px;
-  margin-bottom: 20px;
-  border: 1px solid transparent;
-  border-radius: 4px;
-}
-.alert h4 {
-  margin-top: 0;
-  color: inherit;
-}
-.alert .alert-link {
-  font-weight: bold;
-}
-.alert > p,
-.alert > ul {
-  margin-bottom: 0;
-}
-.alert > p + p {
-  margin-top: 5px;
-}
-.alert-dismissable,
-.alert-dismissible {
-  padding-right: 35px;
-}
-.alert-dismissable .close,
-.alert-dismissible .close {
-  position: relative;
-  top: -2px;
-  right: -21px;
-  color: inherit;
-}
-.alert-success {
-  color: #3c763d;
-  background-color: #dff0d8;
-  border-color: #d6e9c6;
-}
-.alert-success hr {
-  border-top-color: #c9e2b3;
-}
-.alert-success .alert-link {
-  color: #2b542c;
-}
-.alert-info {
-  color: #31708f;
-  background-color: #d9edf7;
-  border-color: #bce8f1;
-}
-.alert-info hr {
-  border-top-color: #a6e1ec;
-}
-.alert-info .alert-link {
-  color: #245269;
-}
-.alert-warning {
-  color: #8a6d3b;
-  background-color: #fcf8e3;
-  border-color: #faebcc;
-}
-.alert-warning hr {
-  border-top-color: #f7e1b5;
-}
-.alert-warning .alert-link {
-  color: #66512c;
-}
-.alert-danger {
-  color: #a94442;
-  background-color: #f2dede;
-  border-color: #ebccd1;
-}
-.alert-danger hr {
-  border-top-color: #e4b9c0;
-}
-.alert-danger .alert-link {
-  color: #843534;
-}
-@-webkit-keyframes progress-bar-stripes {
-  from {
-    background-position: 40px 0;
-  }
-  to {
-    background-position: 0 0;
-  }
-}
-@-o-keyframes progress-bar-stripes {
-  from {
-    background-position: 40px 0;
-  }
-  to {
-    background-position: 0 0;
-  }
-}
-@keyframes progress-bar-stripes {
-  from {
-    background-position: 40px 0;
-  }
-  to {
-    background-position: 0 0;
-  }
-}
-.progress {
-  height: 20px;
-  margin-bottom: 20px;
-  overflow: hidden;
-  background-color: #f5f5f5;
-  border-radius: 4px;
-  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
-          box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
-}
-.progress-bar {
-  float: left;
-  width: 0;
-  height: 100%;
-  font-size: 12px;
-  line-height: 20px;
-  color: #fff;
-  text-align: center;
-  background-color: #337ab7;
-  -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
-          box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
-  -webkit-transition: width .6s ease;
-       -o-transition: width .6s ease;
-          transition: width .6s ease;
-}
-.progress-striped .progress-bar,
-.progress-bar-striped {
-  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:      -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:         linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  -webkit-background-size: 40px 40px;
-          background-size: 40px 40px;
-}
-.progress.active .progress-bar,
-.progress-bar.active {
-  -webkit-animation: progress-bar-stripes 2s linear infinite;
-       -o-animation: progress-bar-stripes 2s linear infinite;
-          animation: progress-bar-stripes 2s linear infinite;
-}
-.progress-bar-success {
-  background-color: #5cb85c;
-}
-.progress-striped .progress-bar-success {
-  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:      -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:         linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-}
-.progress-bar-info {
-  background-color: #5bc0de;
-}
-.progress-striped .progress-bar-info {
-  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:      -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:         linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-}
-.progress-bar-warning {
-  background-color: #f0ad4e;
-}
-.progress-striped .progress-bar-warning {
-  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:      -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:         linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-}
-.progress-bar-danger {
-  background-color: #d9534f;
-}
-.progress-striped .progress-bar-danger {
-  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:      -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:         linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-}
-.media {
-  margin-top: 15px;
-}
-.media:first-child {
-  margin-top: 0;
-}
-.media,
-.media-body {
-  overflow: hidden;
-  zoom: 1;
-}
-.media-body {
-  width: 10000px;
-}
-.media-object {
-  display: block;
-}
-.media-object.img-thumbnail {
-  max-width: none;
-}
-.media-right,
-.media > .pull-right {
-  padding-left: 10px;
-}
-.media-left,
-.media > .pull-left {
-  padding-right: 10px;
-}
-.media-left,
-.media-right,
-.media-body {
-  display: table-cell;
-  vertical-align: top;
-}
-.media-middle {
-  vertical-align: middle;
-}
-.media-bottom {
-  vertical-align: bottom;
-}
-.media-heading {
-  margin-top: 0;
-  margin-bottom: 5px;
-}
-.media-list {
-  padding-left: 0;
-  list-style: none;
-}
-.list-group {
-  padding-left: 0;
-  margin-bottom: 20px;
-}
-.list-group-item {
-  position: relative;
-  display: block;
-  padding: 10px 15px;
-  margin-bottom: -1px;
-  background-color: #fff;
-  border: 1px solid #ddd;
-}
-.list-group-item:first-child {
-  border-top-left-radius: 4px;
-  border-top-right-radius: 4px;
-}
-.list-group-item:last-child {
-  margin-bottom: 0;
-  border-bottom-right-radius: 4px;
-  border-bottom-left-radius: 4px;
-}
-a.list-group-item,
-button.list-group-item {
-  color: #555;
-}
-a.list-group-item .list-group-item-heading,
-button.list-group-item .list-group-item-heading {
-  color: #333;
-}
-a.list-group-item:hover,
-button.list-group-item:hover,
-a.list-group-item:focus,
-button.list-group-item:focus {
-  color: #555;
-  text-decoration: none;
-  background-color: #f5f5f5;
-}
-button.list-group-item {
-  width: 100%;
-  text-align: left;
-}
-.list-group-item.disabled,
-.list-group-item.disabled:hover,
-.list-group-item.disabled:focus {
-  color: #777;
-  cursor: not-allowed;
-  background-color: #eee;
-}
-.list-group-item.disabled .list-group-item-heading,
-.list-group-item.disabled:hover .list-group-item-heading,
-.list-group-item.disabled:focus .list-group-item-heading {
-  color: inherit;
-}
-.list-group-item.disabled .list-group-item-text,
-.list-group-item.disabled:hover .list-group-item-text,
-.list-group-item.disabled:focus .list-group-item-text {
-  color: #777;
-}
-.list-group-item.active,
-.list-group-item.active:hover,
-.list-group-item.active:focus {
-  z-index: 2;
-  color: #fff;
-  background-color: #337ab7;
-  border-color: #337ab7;
-}
-.list-group-item.active .list-group-item-heading,
-.list-group-item.active:hover .list-group-item-heading,
-.list-group-item.active:focus .list-group-item-heading,
-.list-group-item.active .list-group-item-heading > small,
-.list-group-item.active:hover .list-group-item-heading > small,
-.list-group-item.active:focus .list-group-item-heading > small,
-.list-group-item.active .list-group-item-heading > .small,
-.list-group-item.active:hover .list-group-item-heading > .small,
-.list-group-item.active:focus .list-group-item-heading > .small {
-  color: inherit;
-}
-.list-group-item.active .list-group-item-text,
-.list-group-item.active:hover .list-group-item-text,
-.list-group-item.active:focus .list-group-item-text {
-  color: #c7ddef;
-}
-.list-group-item-success {
-  color: #3c763d;
-  background-color: #dff0d8;
-}
-a.list-group-item-success,
-button.list-group-item-success {
-  color: #3c763d;
-}
-a.list-group-item-success .list-group-item-heading,
-button.list-group-item-success .list-group-item-heading {
-  color: inherit;
-}
-a.list-group-item-success:hover,
-button.list-group-item-success:hover,
-a.list-group-item-success:focus,
-button.list-group-item-success:focus {
-  color: #3c763d;
-  background-color: #d0e9c6;
-}
-a.list-group-item-success.active,
-button.list-group-item-success.active,
-a.list-group-item-success.active:hover,
-button.list-group-item-success.active:hover,
-a.list-group-item-success.active:focus,
-button.list-group-item-success.active:focus {
-  color: #fff;
-  background-color: #3c763d;
-  border-color: #3c763d;
-}
-.list-group-item-info {
-  color: #31708f;
-  background-color: #d9edf7;
-}
-a.list-group-item-info,
-button.list-group-item-info {
-  color: #31708f;
-}
-a.list-group-item-info .list-group-item-heading,
-button.list-group-item-info .list-group-item-heading {
-  color: inherit;
-}
-a.list-group-item-info:hover,
-button.list-group-item-info:hover,
-a.list-group-item-info:focus,
-button.list-group-item-info:focus {
-  color: #31708f;
-  background-color: #c4e3f3;
-}
-a.list-group-item-info.active,
-button.list-group-item-info.active,
-a.list-group-item-info.active:hover,
-button.list-group-item-info.active:hover,
-a.list-group-item-info.active:focus,
-button.list-group-item-info.active:focus {
-  color: #fff;
-  background-color: #31708f;
-  border-color: #31708f;
-}
-.list-group-item-warning {
-  color: #8a6d3b;
-  background-color: #fcf8e3;
-}
-a.list-group-item-warning,
-button.list-group-item-warning {
-  color: #8a6d3b;
-}
-a.list-group-item-warning .list-group-item-heading,
-button.list-group-item-warning .list-group-item-heading {
-  color: inherit;
-}
-a.list-group-item-warning:hover,
-button.list-group-item-warning:hover,
-a.list-group-item-warning:focus,
-button.list-group-item-warning:focus {
-  color: #8a6d3b;
-  background-color: #faf2cc;
-}
-a.list-group-item-warning.active,
-button.list-group-item-warning.active,
-a.list-group-item-warning.active:hover,
-button.list-group-item-warning.active:hover,
-a.list-group-item-warning.active:focus,
-button.list-group-item-warning.active:focus {
-  color: #fff;
-  background-color: #8a6d3b;
-  border-color: #8a6d3b;
-}
-.list-group-item-danger {
-  color: #a94442;
-  background-color: #f2dede;
-}
-a.list-group-item-danger,
-button.list-group-item-danger {
-  color: #a94442;
-}
-a.list-group-item-danger .list-group-item-heading,
-button.list-group-item-danger .list-group-item-heading {
-  color: inherit;
-}
-a.list-group-item-danger:hover,
-button.list-group-item-danger:hover,
-a.list-group-item-danger:focus,
-button.list-group-item-danger:focus {
-  color: #a94442;
-  background-color: #ebcccc;
-}
-a.list-group-item-danger.active,
-button.list-group-item-danger.active,
-a.list-group-item-danger.active:hover,
-button.list-group-item-danger.active:hover,
-a.list-group-item-danger.active:focus,
-button.list-group-item-danger.active:focus {
-  color: #fff;
-  background-color: #a94442;
-  border-color: #a94442;
-}
-.list-group-item-heading {
-  margin-top: 0;
-  margin-bottom: 5px;
-}
-.list-group-item-text {
-  margin-bottom: 0;
-  line-height: 1.3;
-}
-.panel {
-  margin-bottom: 20px;
-  background-color: #fff;
-  border: 1px solid transparent;
-  border-radius: 4px;
-  -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
-          box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
-}
-.panel-body {
-  padding: 15px;
-}
-.panel-heading {
-  padding: 10px 15px;
-  border-bottom: 1px solid transparent;
-  border-top-left-radius: 3px;
-  border-top-right-radius: 3px;
-}
-.panel-heading > .dropdown .dropdown-toggle {
-  color: inherit;
-}
-.panel-title {
-  margin-top: 0;
-  margin-bottom: 0;
-  font-size: 16px;
-  color: inherit;
-}
-.panel-title > a,
-.panel-title > small,
-.panel-title > .small,
-.panel-title > small > a,
-.panel-title > .small > a {
-  color: inherit;
-}
-.panel-footer {
-  padding: 10px 15px;
-  background-color: #f5f5f5;
-  border-top: 1px solid #ddd;
-  border-bottom-right-radius: 3px;
-  border-bottom-left-radius: 3px;
-}
-.panel > .list-group,
-.panel > .panel-collapse > .list-group {
-  margin-bottom: 0;
-}
-.panel > .list-group .list-group-item,
-.panel > .panel-collapse > .list-group .list-group-item {
-  border-width: 1px 0;
-  border-radius: 0;
-}
-.panel > .list-group:first-child .list-group-item:first-child,
-.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {
-  border-top: 0;
-  border-top-left-radius: 3px;
-  border-top-right-radius: 3px;
-}
-.panel > .list-group:last-child .list-group-item:last-child,
-.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {
-  border-bottom: 0;
-  border-bottom-right-radius: 3px;
-  border-bottom-left-radius: 3px;
-}
-.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child {
-  border-top-left-radius: 0;
-  border-top-right-radius: 0;
-}
-.panel-heading + .list-group .list-group-item:first-child {
-  border-top-width: 0;
-}
-.list-group + .panel-footer {
-  border-top-width: 0;
-}
-.panel > .table,
-.panel > .table-responsive > .table,
-.panel > .panel-collapse > .table {
-  margin-bottom: 0;
-}
-.panel > .table caption,
-.panel > .table-responsive > .table caption,
-.panel > .panel-collapse > .table caption {
-  padding-right: 15px;
-  padding-left: 15px;
-}
-.panel > .table:first-child,
-.panel > .table-responsive:first-child > .table:first-child {
-  border-top-left-radius: 3px;
-  border-top-right-radius: 3px;
-}
-.panel > .table:first-child > thead:first-child > tr:first-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child {
-  border-top-left-radius: 3px;
-  border-top-right-radius: 3px;
-}
-.panel > .table:first-child > thead:first-child > tr:first-child td:first-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child,
-.panel > .table:first-child > thead:first-child > tr:first-child th:first-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child {
-  border-top-left-radius: 3px;
-}
-.panel > .table:first-child > thead:first-child > tr:first-child td:last-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child,
-.panel > .table:first-child > thead:first-child > tr:first-child th:last-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child {
-  border-top-right-radius: 3px;
-}
-.panel > .table:last-child,
-.panel > .table-responsive:last-child > .table:last-child {
-  border-bottom-right-radius: 3px;
-  border-bottom-left-radius: 3px;
-}
-.panel > .table:last-child > tbody:last-child > tr:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child {
-  border-bottom-right-radius: 3px;
-  border-bottom-left-radius: 3px;
-}
-.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
-.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child {
-  border-bottom-left-radius: 3px;
-}
-.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
-.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child {
-  border-bottom-right-radius: 3px;
-}
-.panel > .panel-body + .table,
-.panel > .panel-body + .table-responsive,
-.panel > .table + .panel-body,
-.panel > .table-responsive + .panel-body {
-  border-top: 1px solid #ddd;
-}
-.panel > .table > tbody:first-child > tr:first-child th,
-.panel > .table > tbody:first-child > tr:first-child td {
-  border-top: 0;
-}
-.panel > .table-bordered,
-.panel > .table-responsive > .table-bordered {
-  border: 0;
-}
-.panel > .table-bordered > thead > tr > th:first-child,
-.panel > .table-responsive > .table-bordered > thead > tr > th:first-child,
-.panel > .table-bordered > tbody > tr > th:first-child,
-.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,
-.panel > .table-bordered > tfoot > tr > th:first-child,
-.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,
-.panel > .table-bordered > thead > tr > td:first-child,
-.panel > .table-responsive > .table-bordered > thead > tr > td:first-child,
-.panel > .table-bordered > tbody > tr > td:first-child,
-.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,
-.panel > .table-bordered > tfoot > tr > td:first-child,
-.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {
-  border-left: 0;
-}
-.panel > .table-bordered > thead > tr > th:last-child,
-.panel > .table-responsive > .table-bordered > thead > tr > th:last-child,
-.panel > .table-bordered > tbody > tr > th:last-child,
-.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,
-.panel > .table-bordered > tfoot > tr > th:last-child,
-.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,
-.panel > .table-bordered > thead > tr > td:last-child,
-.panel > .table-responsive > .table-bordered > thead > tr > td:last-child,
-.panel > .table-bordered > tbody > tr > td:last-child,
-.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,
-.panel > .table-bordered > tfoot > tr > td:last-child,
-.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {
-  border-right: 0;
-}
-.panel > .table-bordered > thead > tr:first-child > td,
-.panel > .table-responsive > .table-bordered > thead > tr:first-child > td,
-.panel > .table-bordered > tbody > tr:first-child > td,
-.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td,
-.panel > .table-bordered > thead > tr:first-child > th,
-.panel > .table-responsive > .table-bordered > thead > tr:first-child > th,
-.panel > .table-bordered > tbody > tr:first-child > th,
-.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th {
-  border-bottom: 0;
-}
-.panel > .table-bordered > tbody > tr:last-child > td,
-.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,
-.panel > .table-bordered > tfoot > tr:last-child > td,
-.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td,
-.panel > .table-bordered > tbody > tr:last-child > th,
-.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,
-.panel > .table-bordered > tfoot > tr:last-child > th,
-.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {
-  border-bottom: 0;
-}
-.panel > .table-responsive {
-  margin-bottom: 0;
-  border: 0;
-}
-.panel-group {
-  margin-bottom: 20px;
-}
-.panel-group .panel {
-  margin-bottom: 0;
-  border-radius: 4px;
-}
-.panel-group .panel + .panel {
-  margin-top: 5px;
-}
-.panel-group .panel-heading {
-  border-bottom: 0;
-}
-.panel-group .panel-heading + .panel-collapse > .panel-body,
-.panel-group .panel-heading + .panel-collapse > .list-group {
-  border-top: 1px solid #ddd;
-}
-.panel-group .panel-footer {
-  border-top: 0;
-}
-.panel-group .panel-footer + .panel-collapse .panel-body {
-  border-bottom: 1px solid #ddd;
-}
-.panel-default {
-  border-color: #ddd;
-}
-.panel-default > .panel-heading {
-  color: #333;
-  background-color: #f5f5f5;
-  border-color: #ddd;
-}
-.panel-default > .panel-heading + .panel-collapse > .panel-body {
-  border-top-color: #ddd;
-}
-.panel-default > .panel-heading .badge {
-  color: #f5f5f5;
-  background-color: #333;
-}
-.panel-default > .panel-footer + .panel-collapse > .panel-body {
-  border-bottom-color: #ddd;
-}
-.panel-primary {
-  border-color: #337ab7;
-}
-.panel-primary > .panel-heading {
-  color: #fff;
-  background-color: #337ab7;
-  border-color: #337ab7;
-}
-.panel-primary > .panel-heading + .panel-collapse > .panel-body {
-  border-top-color: #337ab7;
-}
-.panel-primary > .panel-heading .badge {
-  color: #337ab7;
-  background-color: #fff;
-}
-.panel-primary > .panel-footer + .panel-collapse > .panel-body {
-  border-bottom-color: #337ab7;
-}
-.panel-success {
-  border-color: #d6e9c6;
-}
-.panel-success > .panel-heading {
-  color: #3c763d;
-  background-color: #dff0d8;
-  border-color: #d6e9c6;
-}
-.panel-success > .panel-heading + .panel-collapse > .panel-body {
-  border-top-color: #d6e9c6;
-}
-.panel-success > .panel-heading .badge {
-  color: #dff0d8;
-  background-color: #3c763d;
-}
-.panel-success > .panel-footer + .panel-collapse > .panel-body {
-  border-bottom-color: #d6e9c6;
-}
-.panel-info {
-  border-color: #bce8f1;
-}
-.panel-info > .panel-heading {
-  color: #31708f;
-  background-color: #d9edf7;
-  border-color: #bce8f1;
-}
-.panel-info > .panel-heading + .panel-collapse > .panel-body {
-  border-top-color: #bce8f1;
-}
-.panel-info > .panel-heading .badge {
-  color: #d9edf7;
-  background-color: #31708f;
-}
-.panel-info > .panel-footer + .panel-collapse > .panel-body {
-  border-bottom-color: #bce8f1;
-}
-.panel-warning {
-  border-color: #faebcc;
-}
-.panel-warning > .panel-heading {
-  color: #8a6d3b;
-  background-color: #fcf8e3;
-  border-color: #faebcc;
-}
-.panel-warning > .panel-heading + .panel-collapse > .panel-body {
-  border-top-color: #faebcc;
-}
-.panel-warning > .panel-heading .badge {
-  color: #fcf8e3;
-  background-color: #8a6d3b;
-}
-.panel-warning > .panel-footer + .panel-collapse > .panel-body {
-  border-bottom-color: #faebcc;
-}
-.panel-danger {
-  border-color: #ebccd1;
-}
-.panel-danger > .panel-heading {
-  color: #a94442;
-  background-color: #f2dede;
-  border-color: #ebccd1;
-}
-.panel-danger > .panel-heading + .panel-collapse > .panel-body {
-  border-top-color: #ebccd1;
-}
-.panel-danger > .panel-heading .badge {
-  color: #f2dede;
-  background-color: #a94442;
-}
-.panel-danger > .panel-footer + .panel-collapse > .panel-body {
-  border-bottom-color: #ebccd1;
-}
-.embed-responsive {
-  position: relative;
-  display: block;
-  height: 0;
-  padding: 0;
-  overflow: hidden;
-}
-.embed-responsive .embed-responsive-item,
-.embed-responsive iframe,
-.embed-responsive embed,
-.embed-responsive object,
-.embed-responsive video {
-  position: absolute;
-  top: 0;
-  bottom: 0;
-  left: 0;
-  width: 100%;
-  height: 100%;
-  border: 0;
-}
-.embed-responsive-16by9 {
-  padding-bottom: 56.25%;
-}
-.embed-responsive-4by3 {
-  padding-bottom: 75%;
-}
-.well {
-  min-height: 20px;
-  padding: 19px;
-  margin-bottom: 20px;
-  background-color: #f5f5f5;
-  border: 1px solid #e3e3e3;
-  border-radius: 4px;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
-}
-.well blockquote {
-  border-color: #ddd;
-  border-color: rgba(0, 0, 0, .15);
-}
-.well-lg {
-  padding: 24px;
-  border-radius: 6px;
-}
-.well-sm {
-  padding: 9px;
-  border-radius: 3px;
-}
-.close {
-  float: right;
-  font-size: 21px;
-  font-weight: bold;
-  line-height: 1;
-  color: #000;
-  text-shadow: 0 1px 0 #fff;
-  filter: alpha(opacity=20);
-  opacity: .2;
-}
-.close:hover,
-.close:focus {
-  color: #000;
-  text-decoration: none;
-  cursor: pointer;
-  filter: alpha(opacity=50);
-  opacity: .5;
-}
-button.close {
-  -webkit-appearance: none;
-  padding: 0;
-  cursor: pointer;
-  background: transparent;
-  border: 0;
-}
-.modal-open {
-  overflow: hidden;
-}
-.modal {
-  position: fixed;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  z-index: 1050;
-  display: none;
-  overflow: hidden;
-  -webkit-overflow-scrolling: touch;
-  outline: 0;
-}
-.modal.fade .modal-dialog {
-  -webkit-transition: -webkit-transform .3s ease-out;
-       -o-transition:      -o-transform .3s ease-out;
-          transition:         transform .3s ease-out;
-  -webkit-transform: translate(0, -25%);
-      -ms-transform: translate(0, -25%);
-       -o-transform: translate(0, -25%);
-          transform: translate(0, -25%);
-}
-.modal.in .modal-dialog {
-  -webkit-transform: translate(0, 0);
-      -ms-transform: translate(0, 0);
-       -o-transform: translate(0, 0);
-          transform: translate(0, 0);
-}
-.modal-open .modal {
-  overflow-x: hidden;
-  overflow-y: auto;
-}
-.modal-dialog {
-  position: relative;
-  width: auto;
-  margin: 10px;
-}
-.modal-content {
-  position: relative;
-  background-color: #fff;
-  -webkit-background-clip: padding-box;
-          background-clip: padding-box;
-  border: 1px solid #999;
-  border: 1px solid rgba(0, 0, 0, .2);
-  border-radius: 6px;
-  outline: 0;
-  -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
-          box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
-}
-.modal-backdrop {
-  position: fixed;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  z-index: 1040;
-  background-color: #000;
-}
-.modal-backdrop.fade {
-  filter: alpha(opacity=0);
-  opacity: 0;
-}
-.modal-backdrop.in {
-  filter: alpha(opacity=50);
-  opacity: .5;
-}
-.modal-header {
-  padding: 15px;
-  border-bottom: 1px solid #e5e5e5;
-}
-.modal-header .close {
-  margin-top: -2px;
-}
-.modal-title {
-  margin: 0;
-  line-height: 1.42857143;
-}
-.modal-body {
-  position: relative;
-  padding: 15px;
-}
-.modal-footer {
-  padding: 15px;
-  text-align: right;
-  border-top: 1px solid #e5e5e5;
-}
-.modal-footer .btn + .btn {
-  margin-bottom: 0;
-  margin-left: 5px;
-}
-.modal-footer .btn-group .btn + .btn {
-  margin-left: -1px;
-}
-.modal-footer .btn-block + .btn-block {
-  margin-left: 0;
-}
-.modal-scrollbar-measure {
-  position: absolute;
-  top: -9999px;
-  width: 50px;
-  height: 50px;
-  overflow: scroll;
-}
-@media (min-width: 768px) {
-  .modal-dialog {
-    width: 600px;
-    margin: 30px auto;
-  }
-  .modal-content {
-    -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
-            box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
-  }
-  .modal-sm {
-    width: 300px;
-  }
-}
-@media (min-width: 992px) {
-  .modal-lg {
-    width: 900px;
-  }
-}
-.tooltip {
-  position: absolute;
-  z-index: 1070;
-  display: block;
-  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: 12px;
-  font-style: normal;
-  font-weight: normal;
-  line-height: 1.42857143;
-  text-align: left;
-  text-align: start;
-  text-decoration: none;
-  text-shadow: none;
-  text-transform: none;
-  letter-spacing: normal;
-  word-break: normal;
-  word-spacing: normal;
-  word-wrap: normal;
-  white-space: normal;
-  filter: alpha(opacity=0);
-  opacity: 0;
-
-  line-break: auto;
-}
-.tooltip.in {
-  filter: alpha(opacity=90);
-  opacity: .9;
-}
-.tooltip.top {
-  padding: 5px 0;
-  margin-top: -3px;
-}
-.tooltip.right {
-  padding: 0 5px;
-  margin-left: 3px;
-}
-.tooltip.bottom {
-  padding: 5px 0;
-  margin-top: 3px;
-}
-.tooltip.left {
-  padding: 0 5px;
-  margin-left: -3px;
-}
-.tooltip-inner {
-  max-width: 200px;
-  padding: 3px 8px;
-  color: #fff;
-  text-align: center;
-  background-color: #000;
-  border-radius: 4px;
-}
-.tooltip-arrow {
-  position: absolute;
-  width: 0;
-  height: 0;
-  border-color: transparent;
-  border-style: solid;
-}
-.tooltip.top .tooltip-arrow {
-  bottom: 0;
-  left: 50%;
-  margin-left: -5px;
-  border-width: 5px 5px 0;
-  border-top-color: #000;
-}
-.tooltip.top-left .tooltip-arrow {
-  right: 5px;
-  bottom: 0;
-  margin-bottom: -5px;
-  border-width: 5px 5px 0;
-  border-top-color: #000;
-}
-.tooltip.top-right .tooltip-arrow {
-  bottom: 0;
-  left: 5px;
-  margin-bottom: -5px;
-  border-width: 5px 5px 0;
-  border-top-color: #000;
-}
-.tooltip.right .tooltip-arrow {
-  top: 50%;
-  left: 0;
-  margin-top: -5px;
-  border-width: 5px 5px 5px 0;
-  border-right-color: #000;
-}
-.tooltip.left .tooltip-arrow {
-  top: 50%;
-  right: 0;
-  margin-top: -5px;
-  border-width: 5px 0 5px 5px;
-  border-left-color: #000;
-}
-.tooltip.bottom .tooltip-arrow {
-  top: 0;
-  left: 50%;
-  margin-left: -5px;
-  border-width: 0 5px 5px;
-  border-bottom-color: #000;
-}
-.tooltip.bottom-left .tooltip-arrow {
-  top: 0;
-  right: 5px;
-  margin-top: -5px;
-  border-width: 0 5px 5px;
-  border-bottom-color: #000;
-}
-.tooltip.bottom-right .tooltip-arrow {
-  top: 0;
-  left: 5px;
-  margin-top: -5px;
-  border-width: 0 5px 5px;
-  border-bottom-color: #000;
-}
-.popover {
-  position: absolute;
-  top: 0;
-  left: 0;
-  z-index: 1060;
-  display: none;
-  max-width: 276px;
-  padding: 1px;
-  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: 14px;
-  font-style: normal;
-  font-weight: normal;
-  line-height: 1.42857143;
-  text-align: left;
-  text-align: start;
-  text-decoration: none;
-  text-shadow: none;
-  text-transform: none;
-  letter-spacing: normal;
-  word-break: normal;
-  word-spacing: normal;
-  word-wrap: normal;
-  white-space: normal;
-  background-color: #fff;
-  -webkit-background-clip: padding-box;
-          background-clip: padding-box;
-  border: 1px solid #ccc;
-  border: 1px solid rgba(0, 0, 0, .2);
-  border-radius: 6px;
-  -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
-          box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
-
-  line-break: auto;
-}
-.popover.top {
-  margin-top: -10px;
-}
-.popover.right {
-  margin-left: 10px;
-}
-.popover.bottom {
-  margin-top: 10px;
-}
-.popover.left {
-  margin-left: -10px;
-}
-.popover-title {
-  padding: 8px 14px;
-  margin: 0;
-  font-size: 14px;
-  background-color: #f7f7f7;
-  border-bottom: 1px solid #ebebeb;
-  border-radius: 5px 5px 0 0;
-}
-.popover-content {
-  padding: 9px 14px;
-}
-.popover > .arrow,
-.popover > .arrow:after {
-  position: absolute;
-  display: block;
-  width: 0;
-  height: 0;
-  border-color: transparent;
-  border-style: solid;
-}
-.popover > .arrow {
-  border-width: 11px;
-}
-.popover > .arrow:after {
-  content: "";
-  border-width: 10px;
-}
-.popover.top > .arrow {
-  bottom: -11px;
-  left: 50%;
-  margin-left: -11px;
-  border-top-color: #999;
-  border-top-color: rgba(0, 0, 0, .25);
-  border-bottom-width: 0;
-}
-.popover.top > .arrow:after {
-  bottom: 1px;
-  margin-left: -10px;
-  content: " ";
-  border-top-color: #fff;
-  border-bottom-width: 0;
-}
-.popover.right > .arrow {
-  top: 50%;
-  left: -11px;
-  margin-top: -11px;
-  border-right-color: #999;
-  border-right-color: rgba(0, 0, 0, .25);
-  border-left-width: 0;
-}
-.popover.right > .arrow:after {
-  bottom: -10px;
-  left: 1px;
-  content: " ";
-  border-right-color: #fff;
-  border-left-width: 0;
-}
-.popover.bottom > .arrow {
-  top: -11px;
-  left: 50%;
-  margin-left: -11px;
-  border-top-width: 0;
-  border-bottom-color: #999;
-  border-bottom-color: rgba(0, 0, 0, .25);
-}
-.popover.bottom > .arrow:after {
-  top: 1px;
-  margin-left: -10px;
-  content: " ";
-  border-top-width: 0;
-  border-bottom-color: #fff;
-}
-.popover.left > .arrow {
-  top: 50%;
-  right: -11px;
-  margin-top: -11px;
-  border-right-width: 0;
-  border-left-color: #999;
-  border-left-color: rgba(0, 0, 0, .25);
-}
-.popover.left > .arrow:after {
-  right: 1px;
-  bottom: -10px;
-  content: " ";
-  border-right-width: 0;
-  border-left-color: #fff;
-}
-.carousel {
-  position: relative;
-}
-.carousel-inner {
-  position: relative;
-  width: 100%;
-  overflow: hidden;
-}
-.carousel-inner > .item {
-  position: relative;
-  display: none;
-  -webkit-transition: .6s ease-in-out left;
-       -o-transition: .6s ease-in-out left;
-          transition: .6s ease-in-out left;
-}
-.carousel-inner > .item > img,
-.carousel-inner > .item > a > img {
-  line-height: 1;
-}
-@media all and (transform-3d), (-webkit-transform-3d) {
-  .carousel-inner > .item {
-    -webkit-transition: -webkit-transform .6s ease-in-out;
-         -o-transition:      -o-transform .6s ease-in-out;
-            transition:         transform .6s ease-in-out;
-
-    -webkit-backface-visibility: hidden;
-            backface-visibility: hidden;
-    -webkit-perspective: 1000px;
-            perspective: 1000px;
-  }
-  .carousel-inner > .item.next,
-  .carousel-inner > .item.active.right {
-    left: 0;
-    -webkit-transform: translate3d(100%, 0, 0);
-            transform: translate3d(100%, 0, 0);
-  }
-  .carousel-inner > .item.prev,
-  .carousel-inner > .item.active.left {
-    left: 0;
-    -webkit-transform: translate3d(-100%, 0, 0);
-            transform: translate3d(-100%, 0, 0);
-  }
-  .carousel-inner > .item.next.left,
-  .carousel-inner > .item.prev.right,
-  .carousel-inner > .item.active {
-    left: 0;
-    -webkit-transform: translate3d(0, 0, 0);
-            transform: translate3d(0, 0, 0);
-  }
-}
-.carousel-inner > .active,
-.carousel-inner > .next,
-.carousel-inner > .prev {
-  display: block;
-}
-.carousel-inner > .active {
-  left: 0;
-}
-.carousel-inner > .next,
-.carousel-inner > .prev {
-  position: absolute;
-  top: 0;
-  width: 100%;
-}
-.carousel-inner > .next {
-  left: 100%;
-}
-.carousel-inner > .prev {
-  left: -100%;
-}
-.carousel-inner > .next.left,
-.carousel-inner > .prev.right {
-  left: 0;
-}
-.carousel-inner > .active.left {
-  left: -100%;
-}
-.carousel-inner > .active.right {
-  left: 100%;
-}
-.carousel-control {
-  position: absolute;
-  top: 0;
-  bottom: 0;
-  left: 0;
-  width: 15%;
-  font-size: 20px;
-  color: #fff;
-  text-align: center;
-  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
-  background-color: rgba(0, 0, 0, 0);
-  filter: alpha(opacity=50);
-  opacity: .5;
-}
-.carousel-control.left {
-  background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
-  background-image:      -o-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
-  background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .5)), to(rgba(0, 0, 0, .0001)));
-  background-image:         linear-gradient(to right, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
-  background-repeat: repeat-x;
-}
-.carousel-control.right {
-  right: 0;
-  left: auto;
-  background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
-  background-image:      -o-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
-  background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .0001)), to(rgba(0, 0, 0, .5)));
-  background-image:         linear-gradient(to right, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
-  background-repeat: repeat-x;
-}
-.carousel-control:hover,
-.carousel-control:focus {
-  color: #fff;
-  text-decoration: none;
-  filter: alpha(opacity=90);
-  outline: 0;
-  opacity: .9;
-}
-.carousel-control .icon-prev,
-.carousel-control .icon-next,
-.carousel-control .glyphicon-chevron-left,
-.carousel-control .glyphicon-chevron-right {
-  position: absolute;
-  top: 50%;
-  z-index: 5;
-  display: inline-block;
-  margin-top: -10px;
-}
-.carousel-control .icon-prev,
-.carousel-control .glyphicon-chevron-left {
-  left: 50%;
-  margin-left: -10px;
-}
-.carousel-control .icon-next,
-.carousel-control .glyphicon-chevron-right {
-  right: 50%;
-  margin-right: -10px;
-}
-.carousel-control .icon-prev,
-.carousel-control .icon-next {
-  width: 20px;
-  height: 20px;
-  font-family: serif;
-  line-height: 1;
-}
-.carousel-control .icon-prev:before {
-  content: '\2039';
-}
-.carousel-control .icon-next:before {
-  content: '\203a';
-}
-.carousel-indicators {
-  position: absolute;
-  bottom: 10px;
-  left: 50%;
-  z-index: 15;
-  width: 60%;
-  padding-left: 0;
-  margin-left: -30%;
-  text-align: center;
-  list-style: none;
-}
-.carousel-indicators li {
-  display: inline-block;
-  width: 10px;
-  height: 10px;
-  margin: 1px;
-  text-indent: -999px;
-  cursor: pointer;
-  background-color: #000 \9;
-  background-color: rgba(0, 0, 0, 0);
-  border: 1px solid #fff;
-  border-radius: 10px;
-}
-.carousel-indicators .active {
-  width: 12px;
-  height: 12px;
-  margin: 0;
-  background-color: #fff;
-}
-.carousel-caption {
-  position: absolute;
-  right: 15%;
-  bottom: 20px;
-  left: 15%;
-  z-index: 10;
-  padding-top: 20px;
-  padding-bottom: 20px;
-  color: #fff;
-  text-align: center;
-  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
-}
-.carousel-caption .btn {
-  text-shadow: none;
-}
-@media screen and (min-width: 768px) {
-  .carousel-control .glyphicon-chevron-left,
-  .carousel-control .glyphicon-chevron-right,
-  .carousel-control .icon-prev,
-  .carousel-control .icon-next {
-    width: 30px;
-    height: 30px;
-    margin-top: -10px;
-    font-size: 30px;
-  }
-  .carousel-control .glyphicon-chevron-left,
-  .carousel-control .icon-prev {
-    margin-left: -10px;
-  }
-  .carousel-control .glyphicon-chevron-right,
-  .carousel-control .icon-next {
-    margin-right: -10px;
-  }
-  .carousel-caption {
-    right: 20%;
-    left: 20%;
-    padding-bottom: 30px;
-  }
-  .carousel-indicators {
-    bottom: 20px;
-  }
-}
-.clearfix:before,
-.clearfix:after,
-.dl-horizontal dd:before,
-.dl-horizontal dd:after,
-.container:before,
-.container:after,
-.container-fluid:before,
-.container-fluid:after,
-.row:before,
-.row:after,
-.form-horizontal .form-group:before,
-.form-horizontal .form-group:after,
-.btn-toolbar:before,
-.btn-toolbar:after,
-.btn-group-vertical > .btn-group:before,
-.btn-group-vertical > .btn-group:after,
-.nav:before,
-.nav:after,
-.navbar:before,
-.navbar:after,
-.navbar-header:before,
-.navbar-header:after,
-.navbar-collapse:before,
-.navbar-collapse:after,
-.pager:before,
-.pager:after,
-.panel-body:before,
-.panel-body:after,
-.modal-header:before,
-.modal-header:after,
-.modal-footer:before,
-.modal-footer:after {
-  display: table;
-  content: " ";
-}
-.clearfix:after,
-.dl-horizontal dd:after,
-.container:after,
-.container-fluid:after,
-.row:after,
-.form-horizontal .form-group:after,
-.btn-toolbar:after,
-.btn-group-vertical > .btn-group:after,
-.nav:after,
-.navbar:after,
-.navbar-header:after,
-.navbar-collapse:after,
-.pager:after,
-.panel-body:after,
-.modal-header:after,
-.modal-footer:after {
-  clear: both;
-}
-.center-block {
-  display: block;
-  margin-right: auto;
-  margin-left: auto;
-}
-.pull-right {
-  float: right !important;
-}
-.pull-left {
-  float: left !important;
-}
-.hide {
-  display: none !important;
-}
-.show {
-  display: block !important;
-}
-.invisible {
-  visibility: hidden;
-}
-.text-hide {
-  font: 0/0 a;
-  color: transparent;
-  text-shadow: none;
-  background-color: transparent;
-  border: 0;
-}
-.hidden {
-  display: none !important;
-}
-.affix {
-  position: fixed;
-}
-@-ms-viewport {
-  width: device-width;
-}
-.visible-xs,
-.visible-sm,
-.visible-md,
-.visible-lg {
-  display: none !important;
-}
-.visible-xs-block,
-.visible-xs-inline,
-.visible-xs-inline-block,
-.visible-sm-block,
-.visible-sm-inline,
-.visible-sm-inline-block,
-.visible-md-block,
-.visible-md-inline,
-.visible-md-inline-block,
-.visible-lg-block,
-.visible-lg-inline,
-.visible-lg-inline-block {
-  display: none !important;
-}
-@media (max-width: 767px) {
-  .visible-xs {
-    display: block !important;
-  }
-  table.visible-xs {
-    display: table !important;
-  }
-  tr.visible-xs {
-    display: table-row !important;
-  }
-  th.visible-xs,
-  td.visible-xs {
-    display: table-cell !important;
-  }
-}
-@media (max-width: 767px) {
-  .visible-xs-block {
-    display: block !important;
-  }
-}
-@media (max-width: 767px) {
-  .visible-xs-inline {
-    display: inline !important;
-  }
-}
-@media (max-width: 767px) {
-  .visible-xs-inline-block {
-    display: inline-block !important;
-  }
-}
-@media (min-width: 768px) and (max-width: 991px) {
-  .visible-sm {
-    display: block !important;
-  }
-  table.visible-sm {
-    display: table !important;
-  }
-  tr.visible-sm {
-    display: table-row !important;
-  }
-  th.visible-sm,
-  td.visible-sm {
-    display: table-cell !important;
-  }
-}
-@media (min-width: 768px) and (max-width: 991px) {
-  .visible-sm-block {
-    display: block !important;
-  }
-}
-@media (min-width: 768px) and (max-width: 991px) {
-  .visible-sm-inline {
-    display: inline !important;
-  }
-}
-@media (min-width: 768px) and (max-width: 991px) {
-  .visible-sm-inline-block {
-    display: inline-block !important;
-  }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
-  .visible-md {
-    display: block !important;
-  }
-  table.visible-md {
-    display: table !important;
-  }
-  tr.visible-md {
-    display: table-row !important;
-  }
-  th.visible-md,
-  td.visible-md {
-    display: table-cell !important;
-  }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
-  .visible-md-block {
-    display: block !important;
-  }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
-  .visible-md-inline {
-    display: inline !important;
-  }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
-  .visible-md-inline-block {
-    display: inline-block !important;
-  }
-}
-@media (min-width: 1200px) {
-  .visible-lg {
-    display: block !important;
-  }
-  table.visible-lg {
-    display: table !important;
-  }
-  tr.visible-lg {
-    display: table-row !important;
-  }
-  th.visible-lg,
-  td.visible-lg {
-    display: table-cell !important;
-  }
-}
-@media (min-width: 1200px) {
-  .visible-lg-block {
-    display: block !important;
-  }
-}
-@media (min-width: 1200px) {
-  .visible-lg-inline {
-    display: inline !important;
-  }
-}
-@media (min-width: 1200px) {
-  .visible-lg-inline-block {
-    display: inline-block !important;
-  }
-}
-@media (max-width: 767px) {
-  .hidden-xs {
-    display: none !important;
-  }
-}
-@media (min-width: 768px) and (max-width: 991px) {
-  .hidden-sm {
-    display: none !important;
-  }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
-  .hidden-md {
-    display: none !important;
-  }
-}
-@media (min-width: 1200px) {
-  .hidden-lg {
-    display: none !important;
-  }
-}
-.visible-print {
-  display: none !important;
-}
-@media print {
-  .visible-print {
-    display: block !important;
-  }
-  table.visible-print {
-    display: table !important;
-  }
-  tr.visible-print {
-    display: table-row !important;
-  }
-  th.visible-print,
-  td.visible-print {
-    display: table-cell !important;
-  }
-}
-.visible-print-block {
-  display: none !important;
-}
-@media print {
-  .visible-print-block {
-    display: block !important;
-  }
-}
-.visible-print-inline {
-  display: none !important;
-}
-@media print {
-  .visible-print-inline {
-    display: inline !important;
-  }
-}
-.visible-print-inline-block {
-  display: none !important;
-}
-@media print {
-  .visible-print-inline-block {
-    display: inline-block !important;
-  }
-}
-@media print {
-  .hidden-print {
-    display: none !important;
-  }
-}

+ 0 - 68
src/css/lib/prettify.css

@@ -1,68 +0,0 @@
-/** @license
-========================================================================
-  StyleSheet for Google Code Prettify
-  Copyright (C) 2006 Google Inc.
- 
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-*/
-
-/* SPAN elements with the classes below are added by prettyprint. */
-.pln { color: #000 }  /* plain text */
-
-@media screen {
-  .str { color: #080 }  /* string content */
-  .kwd { color: #008 }  /* a keyword */
-  .com { color: #800 }  /* a comment */
-  .typ { color: #606 }  /* a type name */
-  .lit { color: #066 }  /* a literal value */
-  /* punctuation, lisp open bracket, lisp close bracket */
-  .pun, .opn, .clo { color: #660 }
-  .tag { color: #008 }  /* a markup tag name */
-  .atn { color: #606 }  /* a markup attribute name */
-  .atv { color: #080 }  /* a markup attribute value */
-  .dec, .var { color: #606 }  /* a declaration; a variable name */
-  .fun { color: red }  /* a function name */
-}
-
-/* Use higher contrast and text-weight for printable form. */
-@media print, projection {
-  .str { color: #060 }
-  .kwd { color: #006; font-weight: bold }
-  .com { color: #600; font-style: italic }
-  .typ { color: #404; font-weight: bold }
-  .lit { color: #044 }
-  .pun, .opn, .clo { color: #440 }
-  .tag { color: #006; font-weight: bold }
-  .atn { color: #404 }
-  .atv { color: #060 }
-}
-
-/* Put a border around prettyprinted code snippets. */
-pre.prettyprint { padding: 2px; border: 1px solid #888 }
-
-/* Specify class=linenums on a pre to get line numbering */
-ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */
-li.L0,
-li.L1,
-li.L2,
-li.L3,
-li.L5,
-li.L6,
-li.L7,
-li.L8 { list-style-type: none }
-/* Alternate shading for lines */
-li.L1,
-li.L3,
-li.L5,
-li.L7,
-li.L9 { background: #eee }

+ 0 - 1271
src/js/lib/Sortable.js

@@ -1,1271 +0,0 @@
-/** @license
-========================================================================
-  Sortable
-  @author	RubaXa   <trash@rubaxa.org>
-  @license MIT
-*/
-
-(function (factory) {
-	"use strict";
-
-	if (typeof define === "function" && define.amd) {
-		define(factory);
-	}
-	else if (typeof module != "undefined" && typeof module.exports != "undefined") {
-		module.exports = factory();
-	}
-	else if (typeof Package !== "undefined") {
-		Sortable = factory();  // export for Meteor.js
-	}
-	else {
-		/* jshint sub:true */
-		window["Sortable"] = factory();
-	}
-})(function () {
-	"use strict";
-	
-	if (typeof window == "undefined" || typeof window.document == "undefined") {
-		return function() {
-			throw new Error( "Sortable.js requires a window with a document" );
-		}
-	}
-
-	var dragEl,
-		parentEl,
-		ghostEl,
-		cloneEl,
-		rootEl,
-		nextEl,
-
-		scrollEl,
-		scrollParentEl,
-
-		lastEl,
-		lastCSS,
-		lastParentCSS,
-
-		oldIndex,
-		newIndex,
-
-		activeGroup,
-		autoScroll = {},
-
-		tapEvt,
-		touchEvt,
-
-		moved,
-
-		/** @const */
-		RSPACE = /\s+/g,
-
-		expando = 'Sortable' + (new Date).getTime(),
-
-		win = window,
-		document = win.document,
-		parseInt = win.parseInt,
-
-		supportDraggable = !!('draggable' in document.createElement('div')),
-		supportCssPointerEvents = (function (el) {
-			el = document.createElement('x');
-			el.style.cssText = 'pointer-events:auto';
-			return el.style.pointerEvents === 'auto';
-		})(),
-
-		_silent = false,
-
-		abs = Math.abs,
-		slice = [].slice,
-
-		touchDragOverListeners = [],
-
-		_autoScroll = _throttle(function (/**Event*/evt, /**Object*/options, /**HTMLElement*/rootEl) {
-			// Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
-			if (rootEl && options.scroll) {
-				var el,
-					rect,
-					sens = options.scrollSensitivity,
-					speed = options.scrollSpeed,
-
-					x = evt.clientX,
-					y = evt.clientY,
-
-					winWidth = window.innerWidth,
-					winHeight = window.innerHeight,
-
-					vx,
-					vy
-				;
-
-				// Delect scrollEl
-				if (scrollParentEl !== rootEl) {
-					scrollEl = options.scroll;
-					scrollParentEl = rootEl;
-
-					if (scrollEl === true) {
-						scrollEl = rootEl;
-
-						do {
-							if ((scrollEl.offsetWidth < scrollEl.scrollWidth) ||
-								(scrollEl.offsetHeight < scrollEl.scrollHeight)
-							) {
-								break;
-							}
-							/* jshint boss:true */
-						} while (scrollEl = scrollEl.parentNode);
-					}
-				}
-
-				if (scrollEl) {
-					el = scrollEl;
-					rect = scrollEl.getBoundingClientRect();
-					vx = (abs(rect.right - x) <= sens) - (abs(rect.left - x) <= sens);
-					vy = (abs(rect.bottom - y) <= sens) - (abs(rect.top - y) <= sens);
-				}
-
-
-				if (!(vx || vy)) {
-					vx = (winWidth - x <= sens) - (x <= sens);
-					vy = (winHeight - y <= sens) - (y <= sens);
-
-					/* jshint expr:true */
-					(vx || vy) && (el = win);
-				}
-
-
-				if (autoScroll.vx !== vx || autoScroll.vy !== vy || autoScroll.el !== el) {
-					autoScroll.el = el;
-					autoScroll.vx = vx;
-					autoScroll.vy = vy;
-
-					clearInterval(autoScroll.pid);
-
-					if (el) {
-						autoScroll.pid = setInterval(function () {
-							if (el === win) {
-								win.scrollTo(win.pageXOffset + vx * speed, win.pageYOffset + vy * speed);
-							} else {
-								vy && (el.scrollTop += vy * speed);
-								vx && (el.scrollLeft += vx * speed);
-							}
-						}, 24);
-					}
-				}
-			}
-		}, 30),
-
-		_prepareGroup = function (options) {
-			var group = options.group;
-
-			if (!group || typeof group != 'object') {
-				group = options.group = {name: group};
-			}
-
-			['pull', 'put'].forEach(function (key) {
-				if (!(key in group)) {
-					group[key] = true;
-				}
-			});
-
-			options.groups = ' ' + group.name + (group.put.join ? ' ' + group.put.join(' ') : '') + ' ';
-		}
-	;
-
-
-
-	/**
-	 * @class  Sortable
-	 * @param  {HTMLElement}  el
-	 * @param  {Object}       [options]
-	 */
-	function Sortable(el, options) {
-		if (!(el && el.nodeType && el.nodeType === 1)) {
-			throw 'Sortable: `el` must be HTMLElement, and not ' + {}.toString.call(el);
-		}
-
-		this.el = el; // root element
-		this.options = options = _extend({}, options);
-
-
-		// Export instance
-		el[expando] = this;
-
-
-		// Default options
-		var defaults = {
-			group: Math.random(),
-			sort: true,
-			disabled: false,
-			store: null,
-			handle: null,
-			scroll: true,
-			scrollSensitivity: 30,
-			scrollSpeed: 10,
-			draggable: /[uo]l/i.test(el.nodeName) ? 'li' : '>*',
-			ghostClass: 'sortable-ghost',
-			chosenClass: 'sortable-chosen',
-			ignore: 'a, img',
-			filter: null,
-			animation: 0,
-			setData: function (dataTransfer, dragEl) {
-				dataTransfer.setData('Text', dragEl.textContent);
-			},
-			dropBubble: false,
-			dragoverBubble: false,
-			dataIdAttr: 'data-id',
-			delay: 0,
-			forceFallback: false,
-			fallbackClass: 'sortable-fallback',
-			fallbackOnBody: false
-		};
-
-
-		// Set default options
-		for (var name in defaults) {
-			!(name in options) && (options[name] = defaults[name]);
-		}
-
-		_prepareGroup(options);
-
-		// Bind all private methods
-		for (var fn in this) {
-			if (fn.charAt(0) === '_') {
-				this[fn] = this[fn].bind(this);
-			}
-		}
-
-		// Setup drag mode
-		this.nativeDraggable = options.forceFallback ? false : supportDraggable;
-
-		// Bind events
-		_on(el, 'mousedown', this._onTapStart);
-		_on(el, 'touchstart', this._onTapStart);
-
-		if (this.nativeDraggable) {
-			_on(el, 'dragover', this);
-			_on(el, 'dragenter', this);
-		}
-
-		touchDragOverListeners.push(this._onDragOver);
-
-		// Restore sorting
-		options.store && this.sort(options.store.get(this));
-	}
-
-
-	Sortable.prototype = /** @lends Sortable.prototype */ {
-		constructor: Sortable,
-
-		_onTapStart: function (/** Event|TouchEvent */evt) {
-			var _this = this,
-				el = this.el,
-				options = this.options,
-				type = evt.type,
-				touch = evt.touches && evt.touches[0],
-				target = (touch || evt).target,
-				originalTarget = target,
-				filter = options.filter;
-
-
-			if (type === 'mousedown' && evt.button !== 0 || options.disabled) {
-				return; // only left button or enabled
-			}
-
-			target = _closest(target, options.draggable, el);
-
-			if (!target) {
-				return;
-			}
-
-			// get the index of the dragged element within its parent
-			oldIndex = _index(target, options.draggable);
-
-			// Check filter
-			if (typeof filter === 'function') {
-				if (filter.call(this, evt, target, this)) {
-					_dispatchEvent(_this, originalTarget, 'filter', target, el, oldIndex);
-					evt.preventDefault();
-					return; // cancel dnd
-				}
-			}
-			else if (filter) {
-				filter = filter.split(',').some(function (criteria) {
-					criteria = _closest(originalTarget, criteria.trim(), el);
-
-					if (criteria) {
-						_dispatchEvent(_this, criteria, 'filter', target, el, oldIndex);
-						return true;
-					}
-				});
-
-				if (filter) {
-					//evt.preventDefault();
-					return; // cancel dnd
-				}
-			}
-
-
-			if (options.handle && !_closest(originalTarget, options.handle, el)) {
-				return;
-			}
-
-
-			// Prepare `dragstart`
-			this._prepareDragStart(evt, touch, target);
-		},
-
-		_prepareDragStart: function (/** Event */evt, /** Touch */touch, /** HTMLElement */target) {
-			var _this = this,
-				el = _this.el,
-				options = _this.options,
-				ownerDocument = el.ownerDocument,
-				dragStartFn;
-
-			if (target && !dragEl && (target.parentNode === el)) {
-				tapEvt = evt;
-
-				rootEl = el;
-				dragEl = target;
-				parentEl = dragEl.parentNode;
-				nextEl = dragEl.nextSibling;
-				activeGroup = options.group;
-
-				dragStartFn = function () {
-					// Delayed drag has been triggered
-					// we can re-enable the events: touchmove/mousemove
-					_this._disableDelayedDrag();
-
-					// Make the element draggable
-					dragEl.draggable = true;
-
-					// Chosen item
-					_toggleClass(dragEl, _this.options.chosenClass, true);
-
-					// Bind the events: dragstart/dragend
-					_this._triggerDragStart(touch);
-				};
-
-				// Disable "draggable"
-				options.ignore.split(',').forEach(function (criteria) {
-					_find(dragEl, criteria.trim(), _disableDraggable);
-				});
-
-				_on(ownerDocument, 'mouseup', _this._onDrop);
-				_on(ownerDocument, 'touchend', _this._onDrop);
-				_on(ownerDocument, 'touchcancel', _this._onDrop);
-
-				if (options.delay) {
-					// If the user moves the pointer or let go the click or touch
-					// before the delay has been reached:
-					// disable the delayed drag
-					_on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
-					_on(ownerDocument, 'touchend', _this._disableDelayedDrag);
-					_on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
-					_on(ownerDocument, 'mousemove', _this._disableDelayedDrag);
-					_on(ownerDocument, 'touchmove', _this._disableDelayedDrag);
-
-					_this._dragStartTimer = setTimeout(dragStartFn, options.delay);
-				} else {
-					dragStartFn();
-				}
-			}
-		},
-
-		_disableDelayedDrag: function () {
-			var ownerDocument = this.el.ownerDocument;
-
-			clearTimeout(this._dragStartTimer);
-			_off(ownerDocument, 'mouseup', this._disableDelayedDrag);
-			_off(ownerDocument, 'touchend', this._disableDelayedDrag);
-			_off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
-			_off(ownerDocument, 'mousemove', this._disableDelayedDrag);
-			_off(ownerDocument, 'touchmove', this._disableDelayedDrag);
-		},
-
-		_triggerDragStart: function (/** Touch */touch) {
-			if (touch) {
-				// Touch device support
-				tapEvt = {
-					target: dragEl,
-					clientX: touch.clientX,
-					clientY: touch.clientY
-				};
-
-				this._onDragStart(tapEvt, 'touch');
-			}
-			else if (!this.nativeDraggable) {
-				this._onDragStart(tapEvt, true);
-			}
-			else {
-				_on(dragEl, 'dragend', this);
-				_on(rootEl, 'dragstart', this._onDragStart);
-			}
-
-			try {
-				if (document.selection) {
-					document.selection.empty();
-				} else {
-					window.getSelection().removeAllRanges();
-				}
-			} catch (err) {
-			}
-		},
-
-		_dragStarted: function () {
-			if (rootEl && dragEl) {
-				// Apply effect
-				_toggleClass(dragEl, this.options.ghostClass, true);
-
-				Sortable.active = this;
-
-				// Drag start event
-				_dispatchEvent(this, rootEl, 'start', dragEl, rootEl, oldIndex);
-			}
-		},
-
-		_emulateDragOver: function () {
-			if (touchEvt) {
-				if (this._lastX === touchEvt.clientX && this._lastY === touchEvt.clientY) {
-					return;
-				}
-
-				this._lastX = touchEvt.clientX;
-				this._lastY = touchEvt.clientY;
-
-				if (!supportCssPointerEvents) {
-					_css(ghostEl, 'display', 'none');
-				}
-
-				var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY),
-					parent = target,
-					groupName = ' ' + this.options.group.name + '',
-					i = touchDragOverListeners.length;
-
-				if (parent) {
-					do {
-						if (parent[expando] && parent[expando].options.groups.indexOf(groupName) > -1) {
-							while (i--) {
-								touchDragOverListeners[i]({
-									clientX: touchEvt.clientX,
-									clientY: touchEvt.clientY,
-									target: target,
-									rootEl: parent
-								});
-							}
-
-							break;
-						}
-
-						target = parent; // store last element
-					}
-					/* jshint boss:true */
-					while (parent = parent.parentNode);
-				}
-
-				if (!supportCssPointerEvents) {
-					_css(ghostEl, 'display', '');
-				}
-			}
-		},
-
-
-		_onTouchMove: function (/**TouchEvent*/evt) {
-			if (tapEvt) {
-				// only set the status to dragging, when we are actually dragging
-				if (!Sortable.active) {
-					this._dragStarted();
-				}
-
-				// as well as creating the ghost element on the document body
-				this._appendGhost();
-
-				var touch = evt.touches ? evt.touches[0] : evt,
-					dx = touch.clientX - tapEvt.clientX,
-					dy = touch.clientY - tapEvt.clientY,
-					translate3d = evt.touches ? 'translate3d(' + dx + 'px,' + dy + 'px,0)' : 'translate(' + dx + 'px,' + dy + 'px)';
-
-				moved = true;
-				touchEvt = touch;
-
-				_css(ghostEl, 'webkitTransform', translate3d);
-				_css(ghostEl, 'mozTransform', translate3d);
-				_css(ghostEl, 'msTransform', translate3d);
-				_css(ghostEl, 'transform', translate3d);
-
-				evt.preventDefault();
-			}
-		},
-
-		_appendGhost: function () {
-			if (!ghostEl) {
-				var rect = dragEl.getBoundingClientRect(),
-					css = _css(dragEl),
-					options = this.options,
-					ghostRect;
-
-				ghostEl = dragEl.cloneNode(true);
-
-				_toggleClass(ghostEl, options.ghostClass, false);
-				_toggleClass(ghostEl, options.fallbackClass, true);
-
-				_css(ghostEl, 'top', rect.top - parseInt(css.marginTop, 10));
-				_css(ghostEl, 'left', rect.left - parseInt(css.marginLeft, 10));
-				_css(ghostEl, 'width', rect.width);
-				_css(ghostEl, 'height', rect.height);
-				_css(ghostEl, 'opacity', '0.8');
-				_css(ghostEl, 'position', 'fixed');
-				_css(ghostEl, 'zIndex', '100000');
-				_css(ghostEl, 'pointerEvents', 'none');
-
-				options.fallbackOnBody && document.body.appendChild(ghostEl) || rootEl.appendChild(ghostEl);
-
-				// Fixing dimensions.
-				ghostRect = ghostEl.getBoundingClientRect();
-				_css(ghostEl, 'width', rect.width * 2 - ghostRect.width);
-				_css(ghostEl, 'height', rect.height * 2 - ghostRect.height);
-			}
-		},
-
-		_onDragStart: function (/**Event*/evt, /**boolean*/useFallback) {
-			var dataTransfer = evt.dataTransfer,
-				options = this.options;
-
-			this._offUpEvents();
-
-			if (activeGroup.pull == 'clone') {
-				cloneEl = dragEl.cloneNode(true);
-				_css(cloneEl, 'display', 'none');
-				rootEl.insertBefore(cloneEl, dragEl);
-			}
-
-			if (useFallback) {
-
-				if (useFallback === 'touch') {
-					// Bind touch events
-					_on(document, 'touchmove', this._onTouchMove);
-					_on(document, 'touchend', this._onDrop);
-					_on(document, 'touchcancel', this._onDrop);
-				} else {
-					// Old brwoser
-					_on(document, 'mousemove', this._onTouchMove);
-					_on(document, 'mouseup', this._onDrop);
-				}
-
-				this._loopId = setInterval(this._emulateDragOver, 50);
-			}
-			else {
-				if (dataTransfer) {
-					dataTransfer.effectAllowed = 'move';
-					options.setData && options.setData.call(this, dataTransfer, dragEl);
-				}
-
-				_on(document, 'drop', this);
-				setTimeout(this._dragStarted, 0);
-			}
-		},
-
-		_onDragOver: function (/**Event*/evt) {
-			var el = this.el,
-				target,
-				dragRect,
-				revert,
-				options = this.options,
-				group = options.group,
-				groupPut = group.put,
-				isOwner = (activeGroup === group),
-				canSort = options.sort;
-
-			if (evt.preventDefault !== void 0) {
-				evt.preventDefault();
-				!options.dragoverBubble && evt.stopPropagation();
-			}
-
-			moved = true;
-
-			if (activeGroup && !options.disabled &&
-				(isOwner
-					? canSort || (revert = !rootEl.contains(dragEl)) // Reverting item into the original list
-					: activeGroup.pull && groupPut && (
-						(activeGroup.name === group.name) || // by Name
-						(groupPut.indexOf && ~groupPut.indexOf(activeGroup.name)) // by Array
-					)
-				) &&
-				(evt.rootEl === void 0 || evt.rootEl === this.el) // touch fallback
-			) {
-				// Smart auto-scrolling
-				_autoScroll(evt, options, this.el);
-
-				if (_silent) {
-					return;
-				}
-
-				target = _closest(evt.target, options.draggable, el);
-				dragRect = dragEl.getBoundingClientRect();
-
-				if (revert) {
-					_cloneHide(true);
-
-					if (cloneEl || nextEl) {
-						rootEl.insertBefore(dragEl, cloneEl || nextEl);
-					}
-					else if (!canSort) {
-						rootEl.appendChild(dragEl);
-					}
-
-					return;
-				}
-
-
-				if ((el.children.length === 0) || (el.children[0] === ghostEl) ||
-					(el === evt.target) && (target = _ghostIsLast(el, evt))
-				) {
-
-					if (target) {
-						if (target.animated) {
-							return;
-						}
-
-						targetRect = target.getBoundingClientRect();
-					}
-
-					_cloneHide(isOwner);
-
-					if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect) !== false) {
-						if (!dragEl.contains(el)) {
-							el.appendChild(dragEl);
-							parentEl = el; // actualization
-						}
-
-						this._animate(dragRect, dragEl);
-						target && this._animate(targetRect, target);
-					}
-				}
-				else if (target && !target.animated && target !== dragEl && (target.parentNode[expando] !== void 0)) {
-					if (lastEl !== target) {
-						lastEl = target;
-						lastCSS = _css(target);
-						lastParentCSS = _css(target.parentNode);
-					}
-
-
-					var targetRect = target.getBoundingClientRect(),
-						width = targetRect.right - targetRect.left,
-						height = targetRect.bottom - targetRect.top,
-						floating = /left|right|inline/.test(lastCSS.cssFloat + lastCSS.display)
-							|| (lastParentCSS.display == 'flex' && lastParentCSS['flex-direction'].indexOf('row') === 0),
-						isWide = (target.offsetWidth > dragEl.offsetWidth),
-						isLong = (target.offsetHeight > dragEl.offsetHeight),
-						halfway = (floating ? (evt.clientX - targetRect.left) / width : (evt.clientY - targetRect.top) / height) > 0.5,
-						nextSibling = target.nextElementSibling,
-						moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect),
-						after
-					;
-
-					if (moveVector !== false) {
-						_silent = true;
-						setTimeout(_unsilent, 30);
-
-						_cloneHide(isOwner);
-
-						if (moveVector === 1 || moveVector === -1) {
-							after = (moveVector === 1);
-						}
-						else if (floating) {
-							var elTop = dragEl.offsetTop,
-								tgTop = target.offsetTop;
-
-							if (elTop === tgTop) {
-								after = (target.previousElementSibling === dragEl) && !isWide || halfway && isWide;
-							} else {
-								after = tgTop > elTop;
-							}
-						} else {
-							after = (nextSibling !== dragEl) && !isLong || halfway && isLong;
-						}
-
-						if (!dragEl.contains(el)) {
-							if (after && !nextSibling) {
-								el.appendChild(dragEl);
-							} else {
-								target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
-							}
-						}
-
-						parentEl = dragEl.parentNode; // actualization
-
-						this._animate(dragRect, dragEl);
-						this._animate(targetRect, target);
-					}
-				}
-			}
-		},
-
-		_animate: function (prevRect, target) {
-			var ms = this.options.animation;
-
-			if (ms) {
-				var currentRect = target.getBoundingClientRect();
-
-				_css(target, 'transition', 'none');
-				_css(target, 'transform', 'translate3d('
-					+ (prevRect.left - currentRect.left) + 'px,'
-					+ (prevRect.top - currentRect.top) + 'px,0)'
-				);
-
-				target.offsetWidth; // repaint
-
-				_css(target, 'transition', 'all ' + ms + 'ms');
-				_css(target, 'transform', 'translate3d(0,0,0)');
-
-				clearTimeout(target.animated);
-				target.animated = setTimeout(function () {
-					_css(target, 'transition', '');
-					_css(target, 'transform', '');
-					target.animated = false;
-				}, ms);
-			}
-		},
-
-		_offUpEvents: function () {
-			var ownerDocument = this.el.ownerDocument;
-
-			_off(document, 'touchmove', this._onTouchMove);
-			_off(ownerDocument, 'mouseup', this._onDrop);
-			_off(ownerDocument, 'touchend', this._onDrop);
-			_off(ownerDocument, 'touchcancel', this._onDrop);
-		},
-
-		_onDrop: function (/**Event*/evt) {
-			var el = this.el,
-				options = this.options;
-
-			clearInterval(this._loopId);
-			clearInterval(autoScroll.pid);
-			clearTimeout(this._dragStartTimer);
-
-			// Unbind events
-			_off(document, 'mousemove', this._onTouchMove);
-
-			if (this.nativeDraggable) {
-				_off(document, 'drop', this);
-				_off(el, 'dragstart', this._onDragStart);
-			}
-
-			this._offUpEvents();
-
-			if (evt) {
-				if (moved) {
-					evt.preventDefault();
-					!options.dropBubble && evt.stopPropagation();
-				}
-
-				ghostEl && ghostEl.parentNode.removeChild(ghostEl);
-
-				if (dragEl) {
-					if (this.nativeDraggable) {
-						_off(dragEl, 'dragend', this);
-					}
-
-					_disableDraggable(dragEl);
-
-					// Remove class's
-					_toggleClass(dragEl, this.options.ghostClass, false);
-					_toggleClass(dragEl, this.options.chosenClass, false);
-
-					if (rootEl !== parentEl) {
-						newIndex = _index(dragEl, options.draggable);
-
-						if (newIndex >= 0) {
-							// drag from one list and drop into another
-							_dispatchEvent(null, parentEl, 'sort', dragEl, rootEl, oldIndex, newIndex);
-							_dispatchEvent(this, rootEl, 'sort', dragEl, rootEl, oldIndex, newIndex);
-
-							// Add event
-							_dispatchEvent(null, parentEl, 'add', dragEl, rootEl, oldIndex, newIndex);
-
-							// Remove event
-							_dispatchEvent(this, rootEl, 'remove', dragEl, rootEl, oldIndex, newIndex);
-						}
-					}
-					else {
-						// Remove clone
-						cloneEl && cloneEl.parentNode.removeChild(cloneEl);
-
-						if (dragEl.nextSibling !== nextEl) {
-							// Get the index of the dragged element within its parent
-							newIndex = _index(dragEl, options.draggable);
-
-							if (newIndex >= 0) {
-								// drag & drop within the same list
-								_dispatchEvent(this, rootEl, 'update', dragEl, rootEl, oldIndex, newIndex);
-								_dispatchEvent(this, rootEl, 'sort', dragEl, rootEl, oldIndex, newIndex);
-							}
-						}
-					}
-
-					if (Sortable.active) {
-						if (newIndex === null || newIndex === -1) {
-							newIndex = oldIndex;
-						}
-
-						_dispatchEvent(this, rootEl, 'end', dragEl, rootEl, oldIndex, newIndex);
-
-						// Save sorting
-						this.save();
-					}
-				}
-
-			}
-			this._nulling();
-		},
-
-		_nulling: function() {
-			// Nulling
-			rootEl =
-			dragEl =
-			parentEl =
-			ghostEl =
-			nextEl =
-			cloneEl =
-
-			scrollEl =
-			scrollParentEl =
-
-			tapEvt =
-			touchEvt =
-
-			moved =
-			newIndex =
-
-			lastEl =
-			lastCSS =
-
-			activeGroup =
-			Sortable.active = null;
-		},
-
-		handleEvent: function (/**Event*/evt) {
-			var type = evt.type;
-
-			if (type === 'dragover' || type === 'dragenter') {
-				if (dragEl) {
-					this._onDragOver(evt);
-					_globalDragOver(evt);
-				}
-			}
-			else if (type === 'drop' || type === 'dragend') {
-				this._onDrop(evt);
-			}
-		},
-
-
-		/**
-		 * Serializes the item into an array of string.
-		 * @returns {String[]}
-		 */
-		toArray: function () {
-			var order = [],
-				el,
-				children = this.el.children,
-				i = 0,
-				n = children.length,
-				options = this.options;
-
-			for (; i < n; i++) {
-				el = children[i];
-				if (_closest(el, options.draggable, this.el)) {
-					order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
-				}
-			}
-
-			return order;
-		},
-
-
-		/**
-		 * Sorts the elements according to the array.
-		 * @param  {String[]}  order  order of the items
-		 */
-		sort: function (order) {
-			var items = {}, rootEl = this.el;
-
-			this.toArray().forEach(function (id, i) {
-				var el = rootEl.children[i];
-
-				if (_closest(el, this.options.draggable, rootEl)) {
-					items[id] = el;
-				}
-			}, this);
-
-			order.forEach(function (id) {
-				if (items[id]) {
-					rootEl.removeChild(items[id]);
-					rootEl.appendChild(items[id]);
-				}
-			});
-		},
-
-
-		/**
-		 * Save the current sorting
-		 */
-		save: function () {
-			var store = this.options.store;
-			store && store.set(this);
-		},
-
-
-		/**
-		 * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
-		 * @param   {HTMLElement}  el
-		 * @param   {String}       [selector]  default: `options.draggable`
-		 * @returns {HTMLElement|null}
-		 */
-		closest: function (el, selector) {
-			return _closest(el, selector || this.options.draggable, this.el);
-		},
-
-
-		/**
-		 * Set/get option
-		 * @param   {string} name
-		 * @param   {*}      [value]
-		 * @returns {*}
-		 */
-		option: function (name, value) {
-			var options = this.options;
-
-			if (value === void 0) {
-				return options[name];
-			} else {
-				options[name] = value;
-
-				if (name === 'group') {
-					_prepareGroup(options);
-				}
-			}
-		},
-
-
-		/**
-		 * Destroy
-		 */
-		destroy: function () {
-			var el = this.el;
-
-			el[expando] = null;
-
-			_off(el, 'mousedown', this._onTapStart);
-			_off(el, 'touchstart', this._onTapStart);
-
-			if (this.nativeDraggable) {
-				_off(el, 'dragover', this);
-				_off(el, 'dragenter', this);
-			}
-
-			// Remove draggable attributes
-			Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
-				el.removeAttribute('draggable');
-			});
-
-			touchDragOverListeners.splice(touchDragOverListeners.indexOf(this._onDragOver), 1);
-
-			this._onDrop();
-
-			this.el = el = null;
-		}
-	};
-
-
-	function _cloneHide(state) {
-		if (cloneEl && (cloneEl.state !== state)) {
-			_css(cloneEl, 'display', state ? 'none' : '');
-			!state && cloneEl.state && rootEl.insertBefore(cloneEl, dragEl);
-			cloneEl.state = state;
-		}
-	}
-
-
-	function _closest(/**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx) {
-		if (el) {
-			ctx = ctx || document;
-
-			do {
-				if (
-					(selector === '>*' && el.parentNode === ctx)
-					|| _matches(el, selector)
-				) {
-					return el;
-				}
-			}
-			while (el !== ctx && (el = el.parentNode));
-		}
-
-		return null;
-	}
-
-
-	function _globalDragOver(/**Event*/evt) {
-		if (evt.dataTransfer) {
-			evt.dataTransfer.dropEffect = 'move';
-		}
-		evt.preventDefault();
-	}
-
-
-	function _on(el, event, fn) {
-		el.addEventListener(event, fn, false);
-	}
-
-
-	function _off(el, event, fn) {
-		el.removeEventListener(event, fn, false);
-	}
-
-
-	function _toggleClass(el, name, state) {
-		if (el) {
-			if (el.classList) {
-				el.classList[state ? 'add' : 'remove'](name);
-			}
-			else {
-				var className = (' ' + el.className + ' ').replace(RSPACE, ' ').replace(' ' + name + ' ', ' ');
-				el.className = (className + (state ? ' ' + name : '')).replace(RSPACE, ' ');
-			}
-		}
-	}
-
-
-	function _css(el, prop, val) {
-		var style = el && el.style;
-
-		if (style) {
-			if (val === void 0) {
-				if (document.defaultView && document.defaultView.getComputedStyle) {
-					val = document.defaultView.getComputedStyle(el, '');
-				}
-				else if (el.currentStyle) {
-					val = el.currentStyle;
-				}
-
-				return prop === void 0 ? val : val[prop];
-			}
-			else {
-				if (!(prop in style)) {
-					prop = '-webkit-' + prop;
-				}
-
-				style[prop] = val + (typeof val === 'string' ? '' : 'px');
-			}
-		}
-	}
-
-
-	function _find(ctx, tagName, iterator) {
-		if (ctx) {
-			var list = ctx.getElementsByTagName(tagName), i = 0, n = list.length;
-
-			if (iterator) {
-				for (; i < n; i++) {
-					iterator(list[i], i);
-				}
-			}
-
-			return list;
-		}
-
-		return [];
-	}
-
-
-
-	function _dispatchEvent(sortable, rootEl, name, targetEl, fromEl, startIndex, newIndex) {
-		var evt = document.createEvent('Event'),
-			options = (sortable || rootEl[expando]).options,
-			onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);
-
-		evt.initEvent(name, true, true);
-
-		evt.to = rootEl;
-		evt.from = fromEl || rootEl;
-		evt.item = targetEl || rootEl;
-		evt.clone = cloneEl;
-
-		evt.oldIndex = startIndex;
-		evt.newIndex = newIndex;
-
-		rootEl.dispatchEvent(evt);
-
-		if (options[onName]) {
-			options[onName].call(sortable, evt);
-		}
-	}
-
-
-	function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect) {
-		var evt,
-			sortable = fromEl[expando],
-			onMoveFn = sortable.options.onMove,
-			retVal;
-
-		evt = document.createEvent('Event');
-		evt.initEvent('move', true, true);
-
-		evt.to = toEl;
-		evt.from = fromEl;
-		evt.dragged = dragEl;
-		evt.draggedRect = dragRect;
-		evt.related = targetEl || toEl;
-		evt.relatedRect = targetRect || toEl.getBoundingClientRect();
-
-		fromEl.dispatchEvent(evt);
-
-		if (onMoveFn) {
-			retVal = onMoveFn.call(sortable, evt);
-		}
-
-		return retVal;
-	}
-
-
-	function _disableDraggable(el) {
-		el.draggable = false;
-	}
-
-
-	function _unsilent() {
-		_silent = false;
-	}
-
-
-	/** @returns {HTMLElement|false} */
-	function _ghostIsLast(el, evt) {
-		var lastEl = el.lastElementChild,
-				rect = lastEl.getBoundingClientRect();
-
-		return ((evt.clientY - (rect.top + rect.height) > 5) || (evt.clientX - (rect.right + rect.width) > 5)) && lastEl; // min delta
-	}
-
-
-	/**
-	 * Generate id
-	 * @param   {HTMLElement} el
-	 * @returns {String}
-	 * @private
-	 */
-	function _generateId(el) {
-		var str = el.tagName + el.className + el.src + el.href + el.textContent,
-			i = str.length,
-			sum = 0;
-
-		while (i--) {
-			sum += str.charCodeAt(i);
-		}
-
-		return sum.toString(36);
-	}
-
-	/**
-	 * Returns the index of an element within its parent for a selected set of
-	 * elements
-	 * @param  {HTMLElement} el
-	 * @param  {selector} selector
-	 * @return {number}
-	 */
-	function _index(el, selector) {
-		var index = 0;
-
-		if (!el || !el.parentNode) {
-			return -1;
-		}
-
-		while (el && (el = el.previousElementSibling)) {
-			if (el.nodeName.toUpperCase() !== 'TEMPLATE'
-					&& _matches(el, selector)) {
-				index++;
-			}
-		}
-
-		return index;
-	}
-
-	function _matches(/**HTMLElement*/el, /**String*/selector) {
-		if (el) {
-			selector = selector.split('.');
-
-			var tag = selector.shift().toUpperCase(),
-				re = new RegExp('\\s(' + selector.join('|') + ')(?=\\s)', 'g');
-
-			return (
-				(tag === '' || el.nodeName.toUpperCase() == tag) &&
-				(!selector.length || ((' ' + el.className + ' ').match(re) || []).length == selector.length)
-			);
-		}
-
-		return false;
-	}
-
-	function _throttle(callback, ms) {
-		var args, _this;
-
-		return function () {
-			if (args === void 0) {
-				args = arguments;
-				_this = this;
-
-				setTimeout(function () {
-					if (args.length === 1) {
-						callback.call(_this, args[0]);
-					} else {
-						callback.apply(_this, args);
-					}
-
-					args = void 0;
-				}, ms);
-			}
-		};
-	}
-
-	function _extend(dst, src) {
-		if (dst && src) {
-			for (var key in src) {
-				if (src.hasOwnProperty(key)) {
-					dst[key] = src[key];
-				}
-			}
-		}
-
-		return dst;
-	}
-
-
-	// Export utils
-	Sortable.utils = {
-		on: _on,
-		off: _off,
-		css: _css,
-		find: _find,
-		is: function (el, selector) {
-			return !!_closest(el, selector, el);
-		},
-		extend: _extend,
-		throttle: _throttle,
-		closest: _closest,
-		toggleClass: _toggleClass,
-		index: _index
-	};
-
-
-	/**
-	 * Create sortable instance
-	 * @param {HTMLElement}  el
-	 * @param {Object}      [options]
-	 */
-	Sortable.create = function (el, options) {
-		return new Sortable(el, options);
-	};
-
-
-	// Export
-	Sortable.version = '1.4.2';
-	return Sortable;
-});

+ 0 - 649
src/js/lib/blowfish.dojo.js

@@ -1,649 +0,0 @@
-/** @license
-========================================================================
-  Blowfish.js from Dojo Toolkit 1.8.1
-  Cut of by Sladex (xslade@gmail.com)
-  
-  Created based on the C# implementation by Marcus Hahn (http://www.hotpixel.net/)
-  Unsigned math based on Paul Johnstone and Peter Wood patches.
-  2005-12-08
-  
-  The Dojo Toolkit (including this package) is dual licensed under BSD 3-Clause and AFL.
-  The Dojo Toolkit is Copyright (c) 2005-2016, The Dojo Foundation.  All rights reserved.
-*/
-
-
-/* 
- * Blowfish.js from Dojo Toolkit 1.8.1
- * Cut of by Sladex (xslade@gmail.com)
- * 
- * Usage:
- * blowfish.encrypt(String 'subj to encrypt', String 'key', Object {outputType: 1, cipherMode: 0});
- * 
- */
-
-
-(function(global){
-
-var crypto = {};
-
-
-
-/* dojo-release-1.8.1/dojox/encoding/crypto/_base.js.uncompressed.js */
-
-crypto.cipherModes = {
-	// summary:
-	//		Enumeration for various cipher modes.
-	ECB:0, CBC:1, PCBC:2, CFB:3, OFB:4, CTR:5
-};
-crypto.outputTypes = {
-	// summary:
-	//		Enumeration for input and output encodings.
-	Base64:0, Hex:1, String:2, Raw:3
-};
-
-
-
-/* dojo-release-1.8.1/dojox/encoding/base64.js.uncompressed.js */
-
-var base64 = {};
-var p="=";
-var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-base64.encode=function(/* byte[] */ba){
-	// summary:
-	//		Encode an array of bytes as a base64-encoded string
-	var s=[], l=ba.length;
-	var rm=l%3;
-	var x=l-rm;
-	for (var i=0; i<x;){
-		var t=ba[i++]<<16|ba[i++]<<8|ba[i++];
-		s.push(tab.charAt((t>>>18)&0x3f));
-		s.push(tab.charAt((t>>>12)&0x3f));
-		s.push(tab.charAt((t>>>6)&0x3f));
-		s.push(tab.charAt(t&0x3f));
-	}
-	//	deal with trailers, based on patch from Peter Wood.
-	switch(rm){
-		case 2:{
-			var t=ba[i++]<<16|ba[i++]<<8;
-			s.push(tab.charAt((t>>>18)&0x3f));
-			s.push(tab.charAt((t>>>12)&0x3f));
-			s.push(tab.charAt((t>>>6)&0x3f));
-			s.push(p);
-			break;
-		}
-		case 1:{
-			var t=ba[i++]<<16;
-			s.push(tab.charAt((t>>>18)&0x3f));
-			s.push(tab.charAt((t>>>12)&0x3f));
-			s.push(p);
-			s.push(p);
-			break;
-		}
-	}
-	return s.join("");	//	string
-};
-
-base64.decode=function(/* string */str){
-	// summary:
-	//		Convert a base64-encoded string to an array of bytes
-	var s=str.split(""), out=[];
-	var l=s.length;
-	while(s[--l]==p){ }	//	strip off trailing padding
-	for (var i=0; i<l;){
-		var t=tab.indexOf(s[i++])<<18;
-		if(i<=l){ t|=tab.indexOf(s[i++])<<12 };
-		if(i<=l){ t|=tab.indexOf(s[i++])<<6 };
-		if(i<=l){ t|=tab.indexOf(s[i++]) };
-		out.push((t>>>16)&0xff);
-		out.push((t>>>8)&0xff);
-		out.push(t&0xff);
-	}
-	//	strip off any null bytes
-	while(out[out.length-1]==0){ out.pop(); }
-	return out;	//	byte[]
-};
-
-
-
-/* dojo-release-1.8.1/dojo/_base/lang.js.uncompressed.js */
-
-var lang = {};
-lang.isString = function(it){
-	// summary:
-	//		Return true if it is a String
-	// it: anything
-	//		Item to test.
-	return (typeof it == "string" || it instanceof String); // Boolean
-};
-
-
-
-/* dojo-release-1.8.1/dojo/_base/array.js.uncompressed.js */
-
-var arrayUtil = {};
-arrayUtil.map = function(arr, callback, thisObject, Ctr){
-	// summary:
-	//		applies callback to each element of arr and returns
-	//		an Array with the results
-	// arr: Array|String
-	//		the array to iterate on. If a string, operates on
-	//		individual characters.
-	// callback: Function|String
-	//		a function is invoked with three arguments, (item, index,
-	//		array),	 and returns a value
-	// thisObject: Object?
-	//		may be used to scope the call to callback
-	// returns: Array
-	// description:
-	//		This function corresponds to the JavaScript 1.6 Array.map() method, with one difference: when
-	//		run over sparse arrays, this implementation passes the "holes" in the sparse array to
-	//		the callback function with a value of undefined. JavaScript 1.6's map skips the holes in the sparse array.
-	//		For more details, see:
-	//		https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
-	// example:
-	//	| // returns [2, 3, 4, 5]
-	//	| array.map([1, 2, 3, 4], function(item){ return item+1 });
-
-	// TODO: why do we have a non-standard signature here? do we need "Ctr"?
-	var i = 0, l = arr && arr.length || 0, out = new (Ctr || Array)(l);
-	if(l && typeof arr == "string") arr = arr.split("");
-	if(typeof callback == "string") callback = cache[callback] || buildFn(callback);
-	if(thisObject){
-		for(; i < l; ++i){
-			out[i] = callback.call(thisObject, arr[i], i, arr);
-		}
-	}else{
-		for(; i < l; ++i){
-			out[i] = callback(arr[i], i, arr);
-		}
-	}
-	return out; // Array
-};
-
-
-
-/* dojo-release-1.8.1/dojox/encoding/crypto/Blowfish.js.uncompressed.js */
-
-/*	Blowfish
- *	Created based on the C# implementation by Marcus Hahn (http://www.hotpixel.net/)
- *	Unsigned math based on Paul Johnstone and Peter Wood patches.
- *	2005-12-08
- */
-crypto.Blowfish = new function(){
-	// summary:
-	//		Object for doing Blowfish encryption/decryption.
-	var POW2=Math.pow(2,2);
-	var POW3=Math.pow(2,3);
-	var POW4=Math.pow(2,4);
-	var POW8=Math.pow(2,8);
-	var POW16=Math.pow(2,16);
-	var POW24=Math.pow(2,24);
-	var iv=null;	//	CBC mode initialization vector
-	var boxes={
-		p:[
-			0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
-			0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
-			0x9216d5d9, 0x8979fb1b
-		],
-		s0:[
-			0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
-			0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,
-			0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
-			0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,
-			0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,
-			0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
-			0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,
-			0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,
-			0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
-			0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,
-			0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,
-			0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
-			0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,
-			0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,
-			0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
-			0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,
-			0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,
-			0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
-			0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,
-			0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,
-			0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
-			0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,
-			0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,
-			0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
-			0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,
-			0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,
-			0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
-			0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,
-			0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,
-			0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
-			0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,
-			0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a
-		],
-		s1:[
-			0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
-			0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,
-			0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
-			0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
-			0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,
-			0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
-			0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
-			0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,
-			0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
-			0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
-			0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,
-			0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
-			0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
-			0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,
-			0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
-			0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
-			0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,
-			0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
-			0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
-			0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,
-			0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
-			0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
-			0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,
-			0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
-			0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
-			0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,
-			0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
-			0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
-			0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,
-			0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
-			0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
-			0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7
-		],
-		s2:[
-			0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,
-			0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
-			0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
-			0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,
-			0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
-			0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
-			0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,
-			0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
-			0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
-			0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,
-			0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
-			0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
-			0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,
-			0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
-			0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
-			0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,
-			0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
-			0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
-			0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,
-			0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
-			0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
-			0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,
-			0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
-			0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
-			0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,
-			0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
-			0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
-			0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,
-			0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
-			0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
-			0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,
-			0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0
-		],
-		s3:[
-			0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,
-			0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,
-			0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
-			0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,
-			0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,
-			0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
-			0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,
-			0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,
-			0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
-			0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,
-			0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,
-			0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
-			0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,
-			0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,
-			0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
-			0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,
-			0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,
-			0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
-			0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,
-			0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,
-			0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
-			0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,
-			0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,
-			0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
-			0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,
-			0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,
-			0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
-			0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,
-			0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,
-			0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
-			0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,
-			0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6
-		]
-	}
-////////////////////////////////////////////////////////////////////////////
-//	fixes based on patch submitted by Peter Wood (#5791)
-	function add(x,y){
-		return (((x>>0x10)+(y>>0x10)+(((x&0xffff)+(y&0xffff))>>0x10))<<0x10)|(((x&0xffff)+(y&0xffff))&0xffff);
-	}
-	function xor(x,y){
-		return (((x>>0x10)^(y>>0x10))<<0x10)|(((x&0xffff)^(y&0xffff))&0xffff);
-	}
-
-	function $(v, box){
-		var d=box.s3[v&0xff]; v>>=8;
-		var c=box.s2[v&0xff]; v>>=8;
-		var b=box.s1[v&0xff]; v>>=8;
-		var a=box.s0[v&0xff];
-
-		var r = (((a>>0x10)+(b>>0x10)+(((a&0xffff)+(b&0xffff))>>0x10))<<0x10)|(((a&0xffff)+(b&0xffff))&0xffff);
-		r = (((r>>0x10)^(c>>0x10))<<0x10)|(((r&0xffff)^(c&0xffff))&0xffff);
-		return (((r>>0x10)+(d>>0x10)+(((r&0xffff)+(d&0xffff))>>0x10))<<0x10)|(((r&0xffff)+(d&0xffff))&0xffff);
-	}
-////////////////////////////////////////////////////////////////////////////
-	function eb(o, box){
-		//	TODO: see if this can't be made more efficient
-		var l=o.left;
-		var r=o.right;
-		l=xor(l,box.p[0]);
-		r=xor(r,xor($(l,box),box.p[1]));
-		l=xor(l,xor($(r,box),box.p[2]));
-		r=xor(r,xor($(l,box),box.p[3]));
-		l=xor(l,xor($(r,box),box.p[4]));
-		r=xor(r,xor($(l,box),box.p[5]));
-		l=xor(l,xor($(r,box),box.p[6]));
-		r=xor(r,xor($(l,box),box.p[7]));
-		l=xor(l,xor($(r,box),box.p[8]));
-		r=xor(r,xor($(l,box),box.p[9]));
-		l=xor(l,xor($(r,box),box.p[10]));
-		r=xor(r,xor($(l,box),box.p[11]));
-		l=xor(l,xor($(r,box),box.p[12]));
-		r=xor(r,xor($(l,box),box.p[13]));
-		l=xor(l,xor($(r,box),box.p[14]));
-		r=xor(r,xor($(l,box),box.p[15]));
-		l=xor(l,xor($(r,box),box.p[16]));
-		o.right=l;
-		o.left=xor(r,box.p[17]);
-	}
-
-	function db(o, box){
-		var l=o.left;
-		var r=o.right;
-		l=xor(l,box.p[17]);
-		r=xor(r,xor($(l,box),box.p[16]));
-		l=xor(l,xor($(r,box),box.p[15]));
-		r=xor(r,xor($(l,box),box.p[14]));
-		l=xor(l,xor($(r,box),box.p[13]));
-		r=xor(r,xor($(l,box),box.p[12]));
-		l=xor(l,xor($(r,box),box.p[11]));
-		r=xor(r,xor($(l,box),box.p[10]));
-		l=xor(l,xor($(r,box),box.p[9]));
-		r=xor(r,xor($(l,box),box.p[8]));
-		l=xor(l,xor($(r,box),box.p[7]));
-		r=xor(r,xor($(l,box),box.p[6]));
-		l=xor(l,xor($(r,box),box.p[5]));
-		r=xor(r,xor($(l,box),box.p[4]));
-		l=xor(l,xor($(r,box),box.p[3]));
-		r=xor(r,xor($(l,box),box.p[2]));
-		l=xor(l,xor($(r,box),box.p[1]));
-		o.right=l;
-		o.left=xor(r,box.p[0]);
-	}
-
-	//	Note that we aren't caching contexts here; it might take a little longer
-	//	but we should be more secure this way.
-	function init(key){
-		var k=key;
-		if(lang.isString(k)){
-			k = arrayUtil.map(k.split(""), function(item){
-				return item.charCodeAt(0) & 0xff;
-			});
-		}
-
-		//	init the boxes
-		var pos=0, data=0, res={ left:0, right:0 }, i, j, l;
-		var box = {
-			p: arrayUtil.map(boxes.p.slice(0), function(item){
-				var l=k.length, j;
-				for(j=0; j<4; j++){ data=(data*POW8)|k[pos++ % l]; }
-				return (((item>>0x10)^(data>>0x10))<<0x10)|(((item&0xffff)^(data&0xffff))&0xffff);
-			}),
-			s0:boxes.s0.slice(0),
-			s1:boxes.s1.slice(0),
-			s2:boxes.s2.slice(0),
-			s3:boxes.s3.slice(0)
-		};
-
-		//	encrypt p and the s boxes
-		for(i=0, l=box.p.length; i<l;){
-			eb(res, box);
-			box.p[i++]=res.left, box.p[i++]=res.right;
-		}
-		for(i=0; i<4; i++){
-			for(j=0, l=box["s"+i].length; j<l;){
-				eb(res, box);
-				box["s"+i][j++]=res.left, box["s"+i][j++]=res.right;
-			}
-		}
-		return box;
-	}
-
-////////////////////////////////////////////////////////////////////////////
-//	PUBLIC FUNCTIONS
-////////////////////////////////////////////////////////////////////////////
-	this.getIV=function(/* dojox.encoding.crypto.outputTypes? */ outputType){
-		// summary:
-		//		returns the initialization vector in the output format specified by outputType
-		var out=outputType||crypto.outputTypes.Base64;
-		switch(out){
-			case crypto.outputTypes.Hex:{
-				return arrayUtil.map(iv, function(item){
-					return (item<=0xf?'0':'')+item.toString(16);
-				}).join("");			//	string
-			}
-			case crypto.outputTypes.String:{
-				return iv.join("");		//	string
-			}
-			case crypto.outputTypes.Raw:{
-				return iv;				//	array
-			}
-			default:{
-				return base64.encode(iv); 	//	 string
-			}
-		}
-	};
-
-	this.setIV=function(/* string */data, /* dojox.encoding.crypto.outputTypes? */inputType){
-		// summary:
-		//		sets the initialization vector to data (as interpreted as inputType)
-		var ip=inputType||crypto.outputTypes.Base64;
-		var ba=null;
-		switch(ip){
-			case crypto.outputTypes.String:{
-				ba = arrayUtil.map(data.split(""), function(item){
-					return item.charCodeAt(0);
-				});
-				break;
-			}
-			case crypto.outputTypes.Hex:{
-				ba=[];
-				for(var i=0, l=data.length-1; i<l; i+=2){
-					ba.push(parseInt(data.substr(i,2), 16));
-				}
-				break;
-			}
-			case crypto.outputTypes.Raw:{
-				ba=data;
-				break;
-			}
-			default:{
-				ba=base64.decode(data);
-				break;
-			}
-		}
-		//	make it a pair of words now
-		iv={};
-		iv.left=ba[0]*POW24|ba[1]*POW16|ba[2]*POW8|ba[3];
-		iv.right=ba[4]*POW24|ba[5]*POW16|ba[6]*POW8|ba[7];
-	};
-
-	this.encrypt = function(/* string */plaintext, /* string */key, /* object? */ao){
-		// summary:
-		//		encrypts plaintext using key; allows user to specify output type and cipher mode via keyword object "ao"
-		var out=crypto.outputTypes.Base64;
-		var mode=crypto.cipherModes.ECB;
-		if (ao){
-			if (ao.outputType) out=ao.outputType;
-			if (ao.cipherMode) mode=ao.cipherMode;
-		}
-
-		var bx = init(key), padding = 8-(plaintext.length&7);
-		for (var i=0; i<padding; i++){ plaintext+=String.fromCharCode(padding); }
-
-		var cipher=[], count=plaintext.length >> 3, pos=0, o={}, isCBC=(mode==crypto.cipherModes.CBC);
-		var vector={left:iv.left||null, right:iv.right||null};
-		for(var i=0; i<count; i++){
-			o.left=plaintext.charCodeAt(pos)*POW24
-				|plaintext.charCodeAt(pos+1)*POW16
-				|plaintext.charCodeAt(pos+2)*POW8
-				|plaintext.charCodeAt(pos+3);
-			o.right=plaintext.charCodeAt(pos+4)*POW24
-				|plaintext.charCodeAt(pos+5)*POW16
-				|plaintext.charCodeAt(pos+6)*POW8
-				|plaintext.charCodeAt(pos+7);
-
-			if(isCBC){
-				o.left=(((o.left>>0x10)^(vector.left>>0x10))<<0x10)|(((o.left&0xffff)^(vector.left&0xffff))&0xffff);
-				o.right=(((o.right>>0x10)^(vector.right>>0x10))<<0x10)|(((o.right&0xffff)^(vector.right&0xffff))&0xffff);
-			}
-
-			eb(o, bx);	//	encrypt the block
-
-			if(isCBC){
-				vector.left=o.left;
-				vector.right=o.right;
-			}
-
-			cipher.push((o.left>>24)&0xff);
-			cipher.push((o.left>>16)&0xff);
-			cipher.push((o.left>>8)&0xff);
-			cipher.push(o.left&0xff);
-			cipher.push((o.right>>24)&0xff);
-			cipher.push((o.right>>16)&0xff);
-			cipher.push((o.right>>8)&0xff);
-			cipher.push(o.right&0xff);
-			pos+=8;
-		}
-
-		switch(out){
-			case crypto.outputTypes.Hex:{
-				return arrayUtil.map(cipher, function(item){
-					return (item<=0xf?'0':'')+item.toString(16);
-				}).join("");	//	string
-			}
-			case crypto.outputTypes.String:{
-				return cipher.join("");	//	string
-			}
-			case crypto.outputTypes.Raw:{
-				return cipher;	//	array
-			}
-			default:{
-				return base64.encode(cipher);	//	string
-			}
-		}
-	};
-
-	this.decrypt = function(/* string */ciphertext, /* string */key, /* object? */ao){
-		// summary:
-		//		decrypts ciphertext using key; allows specification of how ciphertext is encoded via ao.
-		var ip=crypto.outputTypes.Base64;
-		var mode=crypto.cipherModes.ECB;
-		if (ao){
-			if (ao.outputType) ip=ao.outputType;
-			if (ao.cipherMode) mode=ao.cipherMode;
-		}
-		var bx = init(key);
-		var pt=[];
-
-		var c=null;
-		switch(ip){
-			case crypto.outputTypes.Hex:{
-				c = [];
-				for(var i=0, l=ciphertext.length-1; i<l; i+=2){
-					c.push(parseInt(ciphertext.substr(i,2), 16));
-				}
-				break;
-			}
-			case crypto.outputTypes.String:{
-				c = arrayUtil.map(ciphertext.split(""), function(item){
-					return item.charCodeAt(0);
-				});
-				break;
-			}
-			case crypto.outputTypes.Raw:{
-				c=ciphertext;	//	should be a byte array
-				break;
-			}
-			default:{
-				c=base64.decode(ciphertext);
-				break;
-			}
-		}
-
-		var count=c.length >> 3, pos=0, o={}, isCBC=(mode==crypto.cipherModes.CBC);
-		var vector={left:iv.left||null, right:iv.right||null};
-		for(var i=0; i<count; i++){
-			o.left=c[pos]*POW24|c[pos+1]*POW16|c[pos+2]*POW8|c[pos+3];
-			o.right=c[pos+4]*POW24|c[pos+5]*POW16|c[pos+6]*POW8|c[pos+7];
-
-			if(isCBC){
-				var left=o.left;
-				var right=o.right;
-			}
-
-			db(o, bx);	//	decrypt the block
-
-			if(isCBC){
-				o.left=(((o.left>>0x10)^(vector.left>>0x10))<<0x10)|(((o.left&0xffff)^(vector.left&0xffff))&0xffff);
-				o.right=(((o.right>>0x10)^(vector.right>>0x10))<<0x10)|(((o.right&0xffff)^(vector.right&0xffff))&0xffff);
-				vector.left=left;
-				vector.right=right;
-			}
-
-			pt.push((o.left>>24)&0xff);
-			pt.push((o.left>>16)&0xff);
-			pt.push((o.left>>8)&0xff);
-			pt.push(o.left&0xff);
-			pt.push((o.right>>24)&0xff);
-			pt.push((o.right>>16)&0xff);
-			pt.push((o.right>>8)&0xff);
-			pt.push(o.right&0xff);
-			pos+=8;
-		}
-
-		//	check for padding, and remove.
-		if(pt[pt.length-1]==pt[pt.length-2]||pt[pt.length-1]==0x01){
-			var n=pt[pt.length-1];
-			pt.splice(pt.length-n, n);
-		}
-
-		//	convert to string
-		return arrayUtil.map(pt, function(item){
-			return String.fromCharCode(item);
-		}).join("");	//	string
-	};
-
-	this.setIV("0000000000000000", crypto.outputTypes.Hex);
-}();
-
-
-
-if (typeof exports != 'undefined') {
-    exports.blowfish = crypto.Blowfish;
-} else {
-    global.blowfish = crypto.Blowfish;
-}
-
-}(this));

+ 0 - 2372
src/js/lib/bootstrap-3.3.6.js

@@ -1,2372 +0,0 @@
-/** @license
-========================================================================
-  Bootstrap v3.3.6 (http://getbootstrap.com)
-  Copyright 2011-2016 Twitter, Inc.
-  Licensed under the MIT license
-*/
-
-if (typeof jQuery === 'undefined') {
-  throw new Error('Bootstrap\'s JavaScript requires jQuery')
-}
-
-+function ($) {
-  'use strict';
-  var version = $.fn.jquery.split(' ')[0].split('.')
-  if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 2)) {
-    throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3')
-  }
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: transition.js v3.3.6
- * http://getbootstrap.com/javascript/#transitions
- * ========================================================================
- * Copyright 2011-2016 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
-  // ============================================================
-
-  function transitionEnd() {
-    var el = document.createElement('bootstrap')
-
-    var transEndEventNames = {
-      WebkitTransition : 'webkitTransitionEnd',
-      MozTransition    : 'transitionend',
-      OTransition      : 'oTransitionEnd otransitionend',
-      transition       : 'transitionend'
-    }
-
-    for (var name in transEndEventNames) {
-      if (el.style[name] !== undefined) {
-        return { end: transEndEventNames[name] }
-      }
-    }
-
-    return false // explicit for ie8 (  ._.)
-  }
-
-  // http://blog.alexmaccaw.com/css-transitions
-  $.fn.emulateTransitionEnd = function (duration) {
-    var called = false
-    var $el = this
-    $(this).one('bsTransitionEnd', function () { called = true })
-    var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
-    setTimeout(callback, duration)
-    return this
-  }
-
-  $(function () {
-    $.support.transition = transitionEnd()
-
-    if (!$.support.transition) return
-
-    $.event.special.bsTransitionEnd = {
-      bindType: $.support.transition.end,
-      delegateType: $.support.transition.end,
-      handle: function (e) {
-        if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
-      }
-    }
-  })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: alert.js v3.3.6
- * http://getbootstrap.com/javascript/#alerts
- * ========================================================================
- * Copyright 2011-2016 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // ALERT CLASS DEFINITION
-  // ======================
-
-  var dismiss = '[data-dismiss="alert"]'
-  var Alert   = function (el) {
-    $(el).on('click', dismiss, this.close)
-  }
-
-  Alert.VERSION = '3.3.6'
-
-  Alert.TRANSITION_DURATION = 150
-
-  Alert.prototype.close = function (e) {
-    var $this    = $(this)
-    var selector = $this.attr('data-target')
-
-    if (!selector) {
-      selector = $this.attr('href')
-      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
-    }
-
-    var $parent = $(selector)
-
-    if (e) e.preventDefault()
-
-    if (!$parent.length) {
-      $parent = $this.closest('.alert')
-    }
-
-    $parent.trigger(e = $.Event('close.bs.alert'))
-
-    if (e.isDefaultPrevented()) return
-
-    $parent.removeClass('in')
-
-    function removeElement() {
-      // detach from parent, fire event then clean up data
-      $parent.detach().trigger('closed.bs.alert').remove()
-    }
-
-    $.support.transition && $parent.hasClass('fade') ?
-      $parent
-        .one('bsTransitionEnd', removeElement)
-        .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
-      removeElement()
-  }
-
-
-  // ALERT PLUGIN DEFINITION
-  // =======================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this = $(this)
-      var data  = $this.data('bs.alert')
-
-      if (!data) $this.data('bs.alert', (data = new Alert(this)))
-      if (typeof option == 'string') data[option].call($this)
-    })
-  }
-
-  var old = $.fn.alert
-
-  $.fn.alert             = Plugin
-  $.fn.alert.Constructor = Alert
-
-
-  // ALERT NO CONFLICT
-  // =================
-
-  $.fn.alert.noConflict = function () {
-    $.fn.alert = old
-    return this
-  }
-
-
-  // ALERT DATA-API
-  // ==============
-
-  $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: button.js v3.3.6
- * http://getbootstrap.com/javascript/#buttons
- * ========================================================================
- * Copyright 2011-2016 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // BUTTON PUBLIC CLASS DEFINITION
-  // ==============================
-
-  var Button = function (element, options) {
-    this.$element  = $(element)
-    this.options   = $.extend({}, Button.DEFAULTS, options)
-    this.isLoading = false
-  }
-
-  Button.VERSION  = '3.3.6'
-
-  Button.DEFAULTS = {
-    loadingText: 'loading...'
-  }
-
-  Button.prototype.setState = function (state) {
-    var d    = 'disabled'
-    var $el  = this.$element
-    var val  = $el.is('input') ? 'val' : 'html'
-    var data = $el.data()
-
-    state += 'Text'
-
-    if (data.resetText == null) $el.data('resetText', $el[val]())
-
-    // push to event loop to allow forms to submit
-    setTimeout($.proxy(function () {
-      $el[val](data[state] == null ? this.options[state] : data[state])
-
-      if (state == 'loadingText') {
-        this.isLoading = true
-        $el.addClass(d).attr(d, d)
-      } else if (this.isLoading) {
-        this.isLoading = false
-        $el.removeClass(d).removeAttr(d)
-      }
-    }, this), 0)
-  }
-
-  Button.prototype.toggle = function () {
-    var changed = true
-    var $parent = this.$element.closest('[data-toggle="buttons"]')
-
-    if ($parent.length) {
-      var $input = this.$element.find('input')
-      if ($input.prop('type') == 'radio') {
-        if ($input.prop('checked')) changed = false
-        $parent.find('.active').removeClass('active')
-        this.$element.addClass('active')
-      } else if ($input.prop('type') == 'checkbox') {
-        if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
-        this.$element.toggleClass('active')
-      }
-      $input.prop('checked', this.$element.hasClass('active'))
-      if (changed) $input.trigger('change')
-    } else {
-      this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
-      this.$element.toggleClass('active')
-    }
-  }
-
-
-  // BUTTON PLUGIN DEFINITION
-  // ========================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this   = $(this)
-      var data    = $this.data('bs.button')
-      var options = typeof option == 'object' && option
-
-      if (!data) $this.data('bs.button', (data = new Button(this, options)))
-
-      if (option == 'toggle') data.toggle()
-      else if (option) data.setState(option)
-    })
-  }
-
-  var old = $.fn.button
-
-  $.fn.button             = Plugin
-  $.fn.button.Constructor = Button
-
-
-  // BUTTON NO CONFLICT
-  // ==================
-
-  $.fn.button.noConflict = function () {
-    $.fn.button = old
-    return this
-  }
-
-
-  // BUTTON DATA-API
-  // ===============
-
-  $(document)
-    .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
-      var $btn = $(e.target).closest('.btn')
-      Plugin.call($btn, 'toggle')
-      if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) {
-        // Prevent double click on radios, and the double selections (so cancellation) on checkboxes
-        e.preventDefault()
-        // The target component still receive the focus
-        if ($btn.is('input,button')) $btn.trigger('focus')
-        else $btn.find('input:visible,button:visible').first().trigger('focus')
-      }
-    })
-    .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
-      $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
-    })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: carousel.js v3.3.6
- * http://getbootstrap.com/javascript/#carousel
- * ========================================================================
- * Copyright 2011-2016 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // CAROUSEL CLASS DEFINITION
-  // =========================
-
-  var Carousel = function (element, options) {
-    this.$element    = $(element)
-    this.$indicators = this.$element.find('.carousel-indicators')
-    this.options     = options
-    this.paused      = null
-    this.sliding     = null
-    this.interval    = null
-    this.$active     = null
-    this.$items      = null
-
-    this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
-
-    this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
-      .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
-      .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
-  }
-
-  Carousel.VERSION  = '3.3.6'
-
-  Carousel.TRANSITION_DURATION = 600
-
-  Carousel.DEFAULTS = {
-    interval: 5000,
-    pause: 'hover',
-    wrap: true,
-    keyboard: true
-  }
-
-  Carousel.prototype.keydown = function (e) {
-    if (/input|textarea/i.test(e.target.tagName)) return
-    switch (e.which) {
-      case 37: this.prev(); break
-      case 39: this.next(); break
-      default: return
-    }
-
-    e.preventDefault()
-  }
-
-  Carousel.prototype.cycle = function (e) {
-    e || (this.paused = false)
-
-    this.interval && clearInterval(this.interval)
-
-    this.options.interval
-      && !this.paused
-      && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
-
-    return this
-  }
-
-  Carousel.prototype.getItemIndex = function (item) {
-    this.$items = item.parent().children('.item')
-    return this.$items.index(item || this.$active)
-  }
-
-  Carousel.prototype.getItemForDirection = function (direction, active) {
-    var activeIndex = this.getItemIndex(active)
-    var willWrap = (direction == 'prev' && activeIndex === 0)
-                || (direction == 'next' && activeIndex == (this.$items.length - 1))
-    if (willWrap && !this.options.wrap) return active
-    var delta = direction == 'prev' ? -1 : 1
-    var itemIndex = (activeIndex + delta) % this.$items.length
-    return this.$items.eq(itemIndex)
-  }
-
-  Carousel.prototype.to = function (pos) {
-    var that        = this
-    var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
-
-    if (pos > (this.$items.length - 1) || pos < 0) return
-
-    if (this.sliding)       return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
-    if (activeIndex == pos) return this.pause().cycle()
-
-    return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
-  }
-
-  Carousel.prototype.pause = function (e) {
-    e || (this.paused = true)
-
-    if (this.$element.find('.next, .prev').length && $.support.transition) {
-      this.$element.trigger($.support.transition.end)
-      this.cycle(true)
-    }
-
-    this.interval = clearInterval(this.interval)
-
-    return this
-  }
-
-  Carousel.prototype.next = function () {
-    if (this.sliding) return
-    return this.slide('next')
-  }
-
-  Carousel.prototype.prev = function () {
-    if (this.sliding) return
-    return this.slide('prev')
-  }
-
-  Carousel.prototype.slide = function (type, next) {
-    var $active   = this.$element.find('.item.active')
-    var $next     = next || this.getItemForDirection(type, $active)
-    var isCycling = this.interval
-    var direction = type == 'next' ? 'left' : 'right'
-    var that      = this
-
-    if ($next.hasClass('active')) return (this.sliding = false)
-
-    var relatedTarget = $next[0]
-    var slideEvent = $.Event('slide.bs.carousel', {
-      relatedTarget: relatedTarget,
-      direction: direction
-    })
-    this.$element.trigger(slideEvent)
-    if (slideEvent.isDefaultPrevented()) return
-
-    this.sliding = true
-
-    isCycling && this.pause()
-
-    if (this.$indicators.length) {
-      this.$indicators.find('.active').removeClass('active')
-      var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
-      $nextIndicator && $nextIndicator.addClass('active')
-    }
-
-    var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
-    if ($.support.transition && this.$element.hasClass('slide')) {
-      $next.addClass(type)
-      $next[0].offsetWidth // force reflow
-      $active.addClass(direction)
-      $next.addClass(direction)
-      $active
-        .one('bsTransitionEnd', function () {
-          $next.removeClass([type, direction].join(' ')).addClass('active')
-          $active.removeClass(['active', direction].join(' '))
-          that.sliding = false
-          setTimeout(function () {
-            that.$element.trigger(slidEvent)
-          }, 0)
-        })
-        .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
-    } else {
-      $active.removeClass('active')
-      $next.addClass('active')
-      this.sliding = false
-      this.$element.trigger(slidEvent)
-    }
-
-    isCycling && this.cycle()
-
-    return this
-  }
-
-
-  // CAROUSEL PLUGIN DEFINITION
-  // ==========================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this   = $(this)
-      var data    = $this.data('bs.carousel')
-      var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
-      var action  = typeof option == 'string' ? option : options.slide
-
-      if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
-      if (typeof option == 'number') data.to(option)
-      else if (action) data[action]()
-      else if (options.interval) data.pause().cycle()
-    })
-  }
-
-  var old = $.fn.carousel
-
-  $.fn.carousel             = Plugin
-  $.fn.carousel.Constructor = Carousel
-
-
-  // CAROUSEL NO CONFLICT
-  // ====================
-
-  $.fn.carousel.noConflict = function () {
-    $.fn.carousel = old
-    return this
-  }
-
-
-  // CAROUSEL DATA-API
-  // =================
-
-  var clickHandler = function (e) {
-    var href
-    var $this   = $(this)
-    var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
-    if (!$target.hasClass('carousel')) return
-    var options = $.extend({}, $target.data(), $this.data())
-    var slideIndex = $this.attr('data-slide-to')
-    if (slideIndex) options.interval = false
-
-    Plugin.call($target, options)
-
-    if (slideIndex) {
-      $target.data('bs.carousel').to(slideIndex)
-    }
-
-    e.preventDefault()
-  }
-
-  $(document)
-    .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
-    .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
-
-  $(window).on('load', function () {
-    $('[data-ride="carousel"]').each(function () {
-      var $carousel = $(this)
-      Plugin.call($carousel, $carousel.data())
-    })
-  })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: collapse.js v3.3.6
- * http://getbootstrap.com/javascript/#collapse
- * ========================================================================
- * Copyright 2011-2016 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-/* jshint latedef: false */
-
-+function ($) {
-  'use strict';
-
-  // COLLAPSE PUBLIC CLASS DEFINITION
-  // ================================
-
-  var Collapse = function (element, options) {
-    this.$element      = $(element)
-    this.options       = $.extend({}, Collapse.DEFAULTS, options)
-    this.$trigger      = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
-                           '[data-toggle="collapse"][data-target="#' + element.id + '"]')
-    this.transitioning = null
-
-    if (this.options.parent) {
-      this.$parent = this.getParent()
-    } else {
-      this.addAriaAndCollapsedClass(this.$element, this.$trigger)
-    }
-
-    if (this.options.toggle) this.toggle()
-  }
-
-  Collapse.VERSION  = '3.3.6'
-
-  Collapse.TRANSITION_DURATION = 350
-
-  Collapse.DEFAULTS = {
-    toggle: true
-  }
-
-  Collapse.prototype.dimension = function () {
-    var hasWidth = this.$element.hasClass('width')
-    return hasWidth ? 'width' : 'height'
-  }
-
-  Collapse.prototype.show = function () {
-    if (this.transitioning || this.$element.hasClass('in')) return
-
-    var activesData
-    var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
-
-    if (actives && actives.length) {
-      activesData = actives.data('bs.collapse')
-      if (activesData && activesData.transitioning) return
-    }
-
-    var startEvent = $.Event('show.bs.collapse')
-    this.$element.trigger(startEvent)
-    if (startEvent.isDefaultPrevented()) return
-
-    if (actives && actives.length) {
-      Plugin.call(actives, 'hide')
-      activesData || actives.data('bs.collapse', null)
-    }
-
-    var dimension = this.dimension()
-
-    this.$element
-      .removeClass('collapse')
-      .addClass('collapsing')[dimension](0)
-      .attr('aria-expanded', true)
-
-    this.$trigger
-      .removeClass('collapsed')
-      .attr('aria-expanded', true)
-
-    this.transitioning = 1
-
-    var complete = function () {
-      this.$element
-        .removeClass('collapsing')
-        .addClass('collapse in')[dimension]('')
-      this.transitioning = 0
-      this.$element
-        .trigger('shown.bs.collapse')
-    }
-
-    if (!$.support.transition) return complete.call(this)
-
-    var scrollSize = $.camelCase(['scroll', dimension].join('-'))
-
-    this.$element
-      .one('bsTransitionEnd', $.proxy(complete, this))
-      .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
-  }
-
-  Collapse.prototype.hide = function () {
-    if (this.transitioning || !this.$element.hasClass('in')) return
-
-    var startEvent = $.Event('hide.bs.collapse')
-    this.$element.trigger(startEvent)
-    if (startEvent.isDefaultPrevented()) return
-
-    var dimension = this.dimension()
-
-    this.$element[dimension](this.$element[dimension]())[0].offsetHeight
-
-    this.$element
-      .addClass('collapsing')
-      .removeClass('collapse in')
-      .attr('aria-expanded', false)
-
-    this.$trigger
-      .addClass('collapsed')
-      .attr('aria-expanded', false)
-
-    this.transitioning = 1
-
-    var complete = function () {
-      this.transitioning = 0
-      this.$element
-        .removeClass('collapsing')
-        .addClass('collapse')
-        .trigger('hidden.bs.collapse')
-    }
-
-    if (!$.support.transition) return complete.call(this)
-
-    this.$element
-      [dimension](0)
-      .one('bsTransitionEnd', $.proxy(complete, this))
-      .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
-  }
-
-  Collapse.prototype.toggle = function () {
-    this[this.$element.hasClass('in') ? 'hide' : 'show']()
-  }
-
-  Collapse.prototype.getParent = function () {
-    return $(this.options.parent)
-      .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
-      .each($.proxy(function (i, element) {
-        var $element = $(element)
-        this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
-      }, this))
-      .end()
-  }
-
-  Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
-    var isOpen = $element.hasClass('in')
-
-    $element.attr('aria-expanded', isOpen)
-    $trigger
-      .toggleClass('collapsed', !isOpen)
-      .attr('aria-expanded', isOpen)
-  }
-
-  function getTargetFromTrigger($trigger) {
-    var href
-    var target = $trigger.attr('data-target')
-      || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
-
-    return $(target)
-  }
-
-
-  // COLLAPSE PLUGIN DEFINITION
-  // ==========================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this   = $(this)
-      var data    = $this.data('bs.collapse')
-      var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
-
-      if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
-      if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  var old = $.fn.collapse
-
-  $.fn.collapse             = Plugin
-  $.fn.collapse.Constructor = Collapse
-
-
-  // COLLAPSE NO CONFLICT
-  // ====================
-
-  $.fn.collapse.noConflict = function () {
-    $.fn.collapse = old
-    return this
-  }
-
-
-  // COLLAPSE DATA-API
-  // =================
-
-  $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
-    var $this   = $(this)
-
-    if (!$this.attr('data-target')) e.preventDefault()
-
-    var $target = getTargetFromTrigger($this)
-    var data    = $target.data('bs.collapse')
-    var option  = data ? 'toggle' : $this.data()
-
-    Plugin.call($target, option)
-  })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: dropdown.js v3.3.6
- * http://getbootstrap.com/javascript/#dropdowns
- * ========================================================================
- * Copyright 2011-2016 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // DROPDOWN CLASS DEFINITION
-  // =========================
-
-  var backdrop = '.dropdown-backdrop'
-  var toggle   = '[data-toggle="dropdown"]'
-  var Dropdown = function (element) {
-    $(element).on('click.bs.dropdown', this.toggle)
-  }
-
-  Dropdown.VERSION = '3.3.6'
-
-  function getParent($this) {
-    var selector = $this.attr('data-target')
-
-    if (!selector) {
-      selector = $this.attr('href')
-      selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
-    }
-
-    var $parent = selector && $(selector)
-
-    return $parent && $parent.length ? $parent : $this.parent()
-  }
-
-  function clearMenus(e) {
-    if (e && e.which === 3) return
-    $(backdrop).remove()
-    $(toggle).each(function () {
-      var $this         = $(this)
-      var $parent       = getParent($this)
-      var relatedTarget = { relatedTarget: this }
-
-      if (!$parent.hasClass('open')) return
-
-      if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
-
-      $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
-
-      if (e.isDefaultPrevented()) return
-
-      $this.attr('aria-expanded', 'false')
-      $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
-    })
-  }
-
-  Dropdown.prototype.toggle = function (e) {
-    var $this = $(this)
-
-    if ($this.is('.disabled, :disabled')) return
-
-    var $parent  = getParent($this)
-    var isActive = $parent.hasClass('open')
-
-    clearMenus()
-
-    if (!isActive) {
-      if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
-        // if mobile we use a backdrop because click events don't delegate
-        $(document.createElement('div'))
-          .addClass('dropdown-backdrop')
-          .insertAfter($(this))
-          .on('click', clearMenus)
-      }
-
-      var relatedTarget = { relatedTarget: this }
-      $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
-
-      if (e.isDefaultPrevented()) return
-
-      $this
-        .trigger('focus')
-        .attr('aria-expanded', 'true')
-
-      $parent
-        .toggleClass('open')
-        .trigger($.Event('shown.bs.dropdown', relatedTarget))
-    }
-
-    return false
-  }
-
-  Dropdown.prototype.keydown = function (e) {
-    if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
-
-    var $this = $(this)
-
-    e.preventDefault()
-    e.stopPropagation()
-
-    if ($this.is('.disabled, :disabled')) return
-
-    var $parent  = getParent($this)
-    var isActive = $parent.hasClass('open')
-
-    if (!isActive && e.which != 27 || isActive && e.which == 27) {
-      if (e.which == 27) $parent.find(toggle).trigger('focus')
-      return $this.trigger('click')
-    }
-
-    var desc = ' li:not(.disabled):visible a'
-    var $items = $parent.find('.dropdown-menu' + desc)
-
-    if (!$items.length) return
-
-    var index = $items.index(e.target)
-
-    if (e.which == 38 && index > 0)                 index--         // up
-    if (e.which == 40 && index < $items.length - 1) index++         // down
-    if (!~index)                                    index = 0
-
-    $items.eq(index).trigger('focus')
-  }
-
-
-  // DROPDOWN PLUGIN DEFINITION
-  // ==========================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this = $(this)
-      var data  = $this.data('bs.dropdown')
-
-      if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
-      if (typeof option == 'string') data[option].call($this)
-    })
-  }
-
-  var old = $.fn.dropdown
-
-  $.fn.dropdown             = Plugin
-  $.fn.dropdown.Constructor = Dropdown
-
-
-  // DROPDOWN NO CONFLICT
-  // ====================
-
-  $.fn.dropdown.noConflict = function () {
-    $.fn.dropdown = old
-    return this
-  }
-
-
-  // APPLY TO STANDARD DROPDOWN ELEMENTS
-  // ===================================
-
-  $(document)
-    .on('click.bs.dropdown.data-api', clearMenus)
-    .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
-    .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
-    .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
-    .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: modal.js v3.3.6
- * http://getbootstrap.com/javascript/#modals
- * ========================================================================
- * Copyright 2011-2016 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // MODAL CLASS DEFINITION
-  // ======================
-
-  var Modal = function (element, options) {
-    this.options             = options
-    this.$body               = $(document.body)
-    this.$element            = $(element)
-    this.$dialog             = this.$element.find('.modal-dialog')
-    this.$backdrop           = null
-    this.isShown             = null
-    this.originalBodyPad     = null
-    this.scrollbarWidth      = 0
-    this.ignoreBackdropClick = false
-
-    if (this.options.remote) {
-      this.$element
-        .find('.modal-content')
-        .load(this.options.remote, $.proxy(function () {
-          this.$element.trigger('loaded.bs.modal')
-        }, this))
-    }
-  }
-
-  Modal.VERSION  = '3.3.6'
-
-  Modal.TRANSITION_DURATION = 300
-  Modal.BACKDROP_TRANSITION_DURATION = 150
-
-  Modal.DEFAULTS = {
-    backdrop: true,
-    keyboard: true,
-    show: true
-  }
-
-  Modal.prototype.toggle = function (_relatedTarget) {
-    return this.isShown ? this.hide() : this.show(_relatedTarget)
-  }
-
-  Modal.prototype.show = function (_relatedTarget) {
-    var that = this
-    var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
-
-    this.$element.trigger(e)
-
-    if (this.isShown || e.isDefaultPrevented()) return
-
-    this.isShown = true
-
-    this.checkScrollbar()
-    this.setScrollbar()
-    this.$body.addClass('modal-open')
-
-    this.escape()
-    this.resize()
-
-    this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
-
-    this.$dialog.on('mousedown.dismiss.bs.modal', function () {
-      that.$element.one('mouseup.dismiss.bs.modal', function (e) {
-        if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
-      })
-    })
-
-    this.backdrop(function () {
-      var transition = $.support.transition && that.$element.hasClass('fade')
-
-      if (!that.$element.parent().length) {
-        that.$element.appendTo(that.$body) // don't move modals dom position
-      }
-
-      that.$element
-        .show()
-        .scrollTop(0)
-
-      that.adjustDialog()
-
-      if (transition) {
-        that.$element[0].offsetWidth // force reflow
-      }
-
-      that.$element.addClass('in')
-
-      that.enforceFocus()
-
-      var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
-
-      transition ?
-        that.$dialog // wait for modal to slide in
-          .one('bsTransitionEnd', function () {
-            that.$element.trigger('focus').trigger(e)
-          })
-          .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
-        that.$element.trigger('focus').trigger(e)
-    })
-  }
-
-  Modal.prototype.hide = function (e) {
-    if (e) e.preventDefault()
-
-    e = $.Event('hide.bs.modal')
-
-    this.$element.trigger(e)
-
-    if (!this.isShown || e.isDefaultPrevented()) return
-
-    this.isShown = false
-
-    this.escape()
-    this.resize()
-
-    $(document).off('focusin.bs.modal')
-
-    this.$element
-      .removeClass('in')
-      .off('click.dismiss.bs.modal')
-      .off('mouseup.dismiss.bs.modal')
-
-    this.$dialog.off('mousedown.dismiss.bs.modal')
-
-    $.support.transition && this.$element.hasClass('fade') ?
-      this.$element
-        .one('bsTransitionEnd', $.proxy(this.hideModal, this))
-        .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
-      this.hideModal()
-  }
-
-  Modal.prototype.enforceFocus = function () {
-    $(document)
-      .off('focusin.bs.modal') // guard against infinite focus loop
-      .on('focusin.bs.modal', $.proxy(function (e) {
-        if (document !== e.target &&
-            this.$element[0] !== e.target &&
-            !this.$element.has(e.target).length) {
-          this.$element.trigger('focus')
-        }
-      }, this))
-  }
-
-  Modal.prototype.escape = function () {
-    if (this.isShown && this.options.keyboard) {
-      this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
-        e.which == 27 && this.hide()
-      }, this))
-    } else if (!this.isShown) {
-      this.$element.off('keydown.dismiss.bs.modal')
-    }
-  }
-
-  Modal.prototype.resize = function () {
-    if (this.isShown) {
-      $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
-    } else {
-      $(window).off('resize.bs.modal')
-    }
-  }
-
-  Modal.prototype.hideModal = function () {
-    var that = this
-    this.$element.hide()
-    this.backdrop(function () {
-      that.$body.removeClass('modal-open')
-      that.resetAdjustments()
-      that.resetScrollbar()
-      that.$element.trigger('hidden.bs.modal')
-    })
-  }
-
-  Modal.prototype.removeBackdrop = function () {
-    this.$backdrop && this.$backdrop.remove()
-    this.$backdrop = null
-  }
-
-  Modal.prototype.backdrop = function (callback) {
-    var that = this
-    var animate = this.$element.hasClass('fade') ? 'fade' : ''
-
-    if (this.isShown && this.options.backdrop) {
-      var doAnimate = $.support.transition && animate
-
-      this.$backdrop = $(document.createElement('div'))
-        .addClass('modal-backdrop ' + animate)
-        .appendTo(this.$body)
-
-      this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
-        if (this.ignoreBackdropClick) {
-          this.ignoreBackdropClick = false
-          return
-        }
-        if (e.target !== e.currentTarget) return
-        this.options.backdrop == 'static'
-          ? this.$element[0].focus()
-          : this.hide()
-      }, this))
-
-      if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
-
-      this.$backdrop.addClass('in')
-
-      if (!callback) return
-
-      doAnimate ?
-        this.$backdrop
-          .one('bsTransitionEnd', callback)
-          .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
-        callback()
-
-    } else if (!this.isShown && this.$backdrop) {
-      this.$backdrop.removeClass('in')
-
-      var callbackRemove = function () {
-        that.removeBackdrop()
-        callback && callback()
-      }
-      $.support.transition && this.$element.hasClass('fade') ?
-        this.$backdrop
-          .one('bsTransitionEnd', callbackRemove)
-          .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
-        callbackRemove()
-
-    } else if (callback) {
-      callback()
-    }
-  }
-
-  // these following methods are used to handle overflowing modals
-
-  Modal.prototype.handleUpdate = function () {
-    this.adjustDialog()
-  }
-
-  Modal.prototype.adjustDialog = function () {
-    var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
-
-    this.$element.css({
-      paddingLeft:  !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
-      paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
-    })
-  }
-
-  Modal.prototype.resetAdjustments = function () {
-    this.$element.css({
-      paddingLeft: '',
-      paddingRight: ''
-    })
-  }
-
-  Modal.prototype.checkScrollbar = function () {
-    var fullWindowWidth = window.innerWidth
-    if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
-      var documentElementRect = document.documentElement.getBoundingClientRect()
-      fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
-    }
-    this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
-    this.scrollbarWidth = this.measureScrollbar()
-  }
-
-  Modal.prototype.setScrollbar = function () {
-    var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
-    this.originalBodyPad = document.body.style.paddingRight || ''
-    if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
-  }
-
-  Modal.prototype.resetScrollbar = function () {
-    this.$body.css('padding-right', this.originalBodyPad)
-  }
-
-  Modal.prototype.measureScrollbar = function () { // thx walsh
-    var scrollDiv = document.createElement('div')
-    scrollDiv.className = 'modal-scrollbar-measure'
-    this.$body.append(scrollDiv)
-    var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
-    this.$body[0].removeChild(scrollDiv)
-    return scrollbarWidth
-  }
-
-
-  // MODAL PLUGIN DEFINITION
-  // =======================
-
-  function Plugin(option, _relatedTarget) {
-    return this.each(function () {
-      var $this   = $(this)
-      var data    = $this.data('bs.modal')
-      var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
-
-      if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
-      if (typeof option == 'string') data[option](_relatedTarget)
-      else if (options.show) data.show(_relatedTarget)
-    })
-  }
-
-  var old = $.fn.modal
-
-  $.fn.modal             = Plugin
-  $.fn.modal.Constructor = Modal
-
-
-  // MODAL NO CONFLICT
-  // =================
-
-  $.fn.modal.noConflict = function () {
-    $.fn.modal = old
-    return this
-  }
-
-
-  // MODAL DATA-API
-  // ==============
-
-  $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
-    var $this   = $(this)
-    var href    = $this.attr('href')
-    var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
-    var option  = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
-
-    if ($this.is('a')) e.preventDefault()
-
-    $target.one('show.bs.modal', function (showEvent) {
-      if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
-      $target.one('hidden.bs.modal', function () {
-        $this.is(':visible') && $this.trigger('focus')
-      })
-    })
-    Plugin.call($target, option, this)
-  })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: tooltip.js v3.3.6
- * http://getbootstrap.com/javascript/#tooltip
- * Inspired by the original jQuery.tipsy by Jason Frame
- * ========================================================================
- * Copyright 2011-2016 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // TOOLTIP PUBLIC CLASS DEFINITION
-  // ===============================
-
-  var Tooltip = function (element, options) {
-    this.type       = null
-    this.options    = null
-    this.enabled    = null
-    this.timeout    = null
-    this.hoverState = null
-    this.$element   = null
-    this.inState    = null
-
-    this.init('tooltip', element, options)
-  }
-
-  Tooltip.VERSION  = '3.3.6'
-
-  Tooltip.TRANSITION_DURATION = 150
-
-  Tooltip.DEFAULTS = {
-    animation: true,
-    placement: 'top',
-    selector: false,
-    template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
-    trigger: 'hover focus',
-    title: '',
-    delay: 0,
-    html: false,
-    container: false,
-    viewport: {
-      selector: 'body',
-      padding: 0
-    }
-  }
-
-  Tooltip.prototype.init = function (type, element, options) {
-    this.enabled   = true
-    this.type      = type
-    this.$element  = $(element)
-    this.options   = this.getOptions(options)
-    this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
-    this.inState   = { click: false, hover: false, focus: false }
-
-    if (this.$element[0] instanceof document.constructor && !this.options.selector) {
-      throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
-    }
-
-    var triggers = this.options.trigger.split(' ')
-
-    for (var i = triggers.length; i--;) {
-      var trigger = triggers[i]
-
-      if (trigger == 'click') {
-        this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
-      } else if (trigger != 'manual') {
-        var eventIn  = trigger == 'hover' ? 'mouseenter' : 'focusin'
-        var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
-
-        this.$element.on(eventIn  + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
-        this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
-      }
-    }
-
-    this.options.selector ?
-      (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
-      this.fixTitle()
-  }
-
-  Tooltip.prototype.getDefaults = function () {
-    return Tooltip.DEFAULTS
-  }
-
-  Tooltip.prototype.getOptions = function (options) {
-    options = $.extend({}, this.getDefaults(), this.$element.data(), options)
-
-    if (options.delay && typeof options.delay == 'number') {
-      options.delay = {
-        show: options.delay,
-        hide: options.delay
-      }
-    }
-
-    return options
-  }
-
-  Tooltip.prototype.getDelegateOptions = function () {
-    var options  = {}
-    var defaults = this.getDefaults()
-
-    this._options && $.each(this._options, function (key, value) {
-      if (defaults[key] != value) options[key] = value
-    })
-
-    return options
-  }
-
-  Tooltip.prototype.enter = function (obj) {
-    var self = obj instanceof this.constructor ?
-      obj : $(obj.currentTarget).data('bs.' + this.type)
-
-    if (!self) {
-      self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
-      $(obj.currentTarget).data('bs.' + this.type, self)
-    }
-
-    if (obj instanceof $.Event) {
-      self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
-    }
-
-    if (self.tip().hasClass('in') || self.hoverState == 'in') {
-      self.hoverState = 'in'
-      return
-    }
-
-    clearTimeout(self.timeout)
-
-    self.hoverState = 'in'
-
-    if (!self.options.delay || !self.options.delay.show) return self.show()
-
-    self.timeout = setTimeout(function () {
-      if (self.hoverState == 'in') self.show()
-    }, self.options.delay.show)
-  }
-
-  Tooltip.prototype.isInStateTrue = function () {
-    for (var key in this.inState) {
-      if (this.inState[key]) return true
-    }
-
-    return false
-  }
-
-  Tooltip.prototype.leave = function (obj) {
-    var self = obj instanceof this.constructor ?
-      obj : $(obj.currentTarget).data('bs.' + this.type)
-
-    if (!self) {
-      self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
-      $(obj.currentTarget).data('bs.' + this.type, self)
-    }
-
-    if (obj instanceof $.Event) {
-      self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
-    }
-
-    if (self.isInStateTrue()) return
-
-    clearTimeout(self.timeout)
-
-    self.hoverState = 'out'
-
-    if (!self.options.delay || !self.options.delay.hide) return self.hide()
-
-    self.timeout = setTimeout(function () {
-      if (self.hoverState == 'out') self.hide()
-    }, self.options.delay.hide)
-  }
-
-  Tooltip.prototype.show = function () {
-    var e = $.Event('show.bs.' + this.type)
-
-    if (this.hasContent() && this.enabled) {
-      this.$element.trigger(e)
-
-      var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
-      if (e.isDefaultPrevented() || !inDom) return
-      var that = this
-
-      var $tip = this.tip()
-
-      var tipId = this.getUID(this.type)
-
-      this.setContent()
-      $tip.attr('id', tipId)
-      this.$element.attr('aria-describedby', tipId)
-
-      if (this.options.animation) $tip.addClass('fade')
-
-      var placement = typeof this.options.placement == 'function' ?
-        this.options.placement.call(this, $tip[0], this.$element[0]) :
-        this.options.placement
-
-      var autoToken = /\s?auto?\s?/i
-      var autoPlace = autoToken.test(placement)
-      if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
-
-      $tip
-        .detach()
-        .css({ top: 0, left: 0, display: 'block' })
-        .addClass(placement)
-        .data('bs.' + this.type, this)
-
-      this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
-      this.$element.trigger('inserted.bs.' + this.type)
-
-      var pos          = this.getPosition()
-      var actualWidth  = $tip[0].offsetWidth
-      var actualHeight = $tip[0].offsetHeight
-
-      if (autoPlace) {
-        var orgPlacement = placement
-        var viewportDim = this.getPosition(this.$viewport)
-
-        placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top'    :
-                    placement == 'top'    && pos.top    - actualHeight < viewportDim.top    ? 'bottom' :
-                    placement == 'right'  && pos.right  + actualWidth  > viewportDim.width  ? 'left'   :
-                    placement == 'left'   && pos.left   - actualWidth  < viewportDim.left   ? 'right'  :
-                    placement
-
-        $tip
-          .removeClass(orgPlacement)
-          .addClass(placement)
-      }
-
-      var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
-
-      this.applyPlacement(calculatedOffset, placement)
-
-      var complete = function () {
-        var prevHoverState = that.hoverState
-        that.$element.trigger('shown.bs.' + that.type)
-        that.hoverState = null
-
-        if (prevHoverState == 'out') that.leave(that)
-      }
-
-      $.support.transition && this.$tip.hasClass('fade') ?
-        $tip
-          .one('bsTransitionEnd', complete)
-          .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
-        complete()
-    }
-  }
-
-  Tooltip.prototype.applyPlacement = function (offset, placement) {
-    var $tip   = this.tip()
-    var width  = $tip[0].offsetWidth
-    var height = $tip[0].offsetHeight
-
-    // manually read margins because getBoundingClientRect includes difference
-    var marginTop = parseInt($tip.css('margin-top'), 10)
-    var marginLeft = parseInt($tip.css('margin-left'), 10)
-
-    // we must check for NaN for ie 8/9
-    if (isNaN(marginTop))  marginTop  = 0
-    if (isNaN(marginLeft)) marginLeft = 0
-
-    offset.top  += marginTop
-    offset.left += marginLeft
-
-    // $.fn.offset doesn't round pixel values
-    // so we use setOffset directly with our own function B-0
-    $.offset.setOffset($tip[0], $.extend({
-      using: function (props) {
-        $tip.css({
-          top: Math.round(props.top),
-          left: Math.round(props.left)
-        })
-      }
-    }, offset), 0)
-
-    $tip.addClass('in')
-
-    // check to see if placing tip in new offset caused the tip to resize itself
-    var actualWidth  = $tip[0].offsetWidth
-    var actualHeight = $tip[0].offsetHeight
-
-    if (placement == 'top' && actualHeight != height) {
-      offset.top = offset.top + height - actualHeight
-    }
-
-    var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
-
-    if (delta.left) offset.left += delta.left
-    else offset.top += delta.top
-
-    var isVertical          = /top|bottom/.test(placement)
-    var arrowDelta          = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
-    var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
-
-    $tip.offset(offset)
-    this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
-  }
-
-  Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
-    this.arrow()
-      .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
-      .css(isVertical ? 'top' : 'left', '')
-  }
-
-  Tooltip.prototype.setContent = function () {
-    var $tip  = this.tip()
-    var title = this.getTitle()
-
-    $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
-    $tip.removeClass('fade in top bottom left right')
-  }
-
-  Tooltip.prototype.hide = function (callback) {
-    var that = this
-    var $tip = $(this.$tip)
-    var e    = $.Event('hide.bs.' + this.type)
-
-    function complete() {
-      if (that.hoverState != 'in') $tip.detach()
-      that.$element
-        .removeAttr('aria-describedby')
-        .trigger('hidden.bs.' + that.type)
-      callback && callback()
-    }
-
-    this.$element.trigger(e)
-
-    if (e.isDefaultPrevented()) return
-
-    $tip.removeClass('in')
-
-    $.support.transition && $tip.hasClass('fade') ?
-      $tip
-        .one('bsTransitionEnd', complete)
-        .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
-      complete()
-
-    this.hoverState = null
-
-    return this
-  }
-
-  Tooltip.prototype.fixTitle = function () {
-    var $e = this.$element
-    if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
-      $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
-    }
-  }
-
-  Tooltip.prototype.hasContent = function () {
-    return this.getTitle()
-  }
-
-  Tooltip.prototype.getPosition = function ($element) {
-    $element   = $element || this.$element
-
-    var el     = $element[0]
-    var isBody = el.tagName == 'BODY'
-
-    var elRect    = el.getBoundingClientRect()
-    if (elRect.width == null) {
-      // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
-      elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
-    }
-    var elOffset  = isBody ? { top: 0, left: 0 } : $element.offset()
-    var scroll    = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
-    var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
-
-    return $.extend({}, elRect, scroll, outerDims, elOffset)
-  }
-
-  Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
-    return placement == 'bottom' ? { top: pos.top + pos.height,   left: pos.left + pos.width / 2 - actualWidth / 2 } :
-           placement == 'top'    ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
-           placement == 'left'   ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
-        /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
-
-  }
-
-  Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
-    var delta = { top: 0, left: 0 }
-    if (!this.$viewport) return delta
-
-    var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
-    var viewportDimensions = this.getPosition(this.$viewport)
-
-    if (/right|left/.test(placement)) {
-      var topEdgeOffset    = pos.top - viewportPadding - viewportDimensions.scroll
-      var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
-      if (topEdgeOffset < viewportDimensions.top) { // top overflow
-        delta.top = viewportDimensions.top - topEdgeOffset
-      } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
-        delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
-      }
-    } else {
-      var leftEdgeOffset  = pos.left - viewportPadding
-      var rightEdgeOffset = pos.left + viewportPadding + actualWidth
-      if (leftEdgeOffset < viewportDimensions.left) { // left overflow
-        delta.left = viewportDimensions.left - leftEdgeOffset
-      } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
-        delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
-      }
-    }
-
-    return delta
-  }
-
-  Tooltip.prototype.getTitle = function () {
-    var title
-    var $e = this.$element
-    var o  = this.options
-
-    title = $e.attr('data-original-title')
-      || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)
-
-    return title
-  }
-
-  Tooltip.prototype.getUID = function (prefix) {
-    do prefix += ~~(Math.random() * 1000000)
-    while (document.getElementById(prefix))
-    return prefix
-  }
-
-  Tooltip.prototype.tip = function () {
-    if (!this.$tip) {
-      this.$tip = $(this.options.template)
-      if (this.$tip.length != 1) {
-        throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
-      }
-    }
-    return this.$tip
-  }
-
-  Tooltip.prototype.arrow = function () {
-    return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
-  }
-
-  Tooltip.prototype.enable = function () {
-    this.enabled = true
-  }
-
-  Tooltip.prototype.disable = function () {
-    this.enabled = false
-  }
-
-  Tooltip.prototype.toggleEnabled = function () {
-    this.enabled = !this.enabled
-  }
-
-  Tooltip.prototype.toggle = function (e) {
-    var self = this
-    if (e) {
-      self = $(e.currentTarget).data('bs.' + this.type)
-      if (!self) {
-        self = new this.constructor(e.currentTarget, this.getDelegateOptions())
-        $(e.currentTarget).data('bs.' + this.type, self)
-      }
-    }
-
-    if (e) {
-      self.inState.click = !self.inState.click
-      if (self.isInStateTrue()) self.enter(self)
-      else self.leave(self)
-    } else {
-      self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
-    }
-  }
-
-  Tooltip.prototype.destroy = function () {
-    var that = this
-    clearTimeout(this.timeout)
-    this.hide(function () {
-      that.$element.off('.' + that.type).removeData('bs.' + that.type)
-      if (that.$tip) {
-        that.$tip.detach()
-      }
-      that.$tip = null
-      that.$arrow = null
-      that.$viewport = null
-    })
-  }
-
-
-  // TOOLTIP PLUGIN DEFINITION
-  // =========================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this   = $(this)
-      var data    = $this.data('bs.tooltip')
-      var options = typeof option == 'object' && option
-
-      if (!data && /destroy|hide/.test(option)) return
-      if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  var old = $.fn.tooltip
-
-  $.fn.tooltip             = Plugin
-  $.fn.tooltip.Constructor = Tooltip
-
-
-  // TOOLTIP NO CONFLICT
-  // ===================
-
-  $.fn.tooltip.noConflict = function () {
-    $.fn.tooltip = old
-    return this
-  }
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: popover.js v3.3.6
- * http://getbootstrap.com/javascript/#popovers
- * ========================================================================
- * Copyright 2011-2016 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // POPOVER PUBLIC CLASS DEFINITION
-  // ===============================
-
-  var Popover = function (element, options) {
-    this.init('popover', element, options)
-  }
-
-  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
-
-  Popover.VERSION  = '3.3.6'
-
-  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
-    placement: 'right',
-    trigger: 'click',
-    content: '',
-    template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
-  })
-
-
-  // NOTE: POPOVER EXTENDS tooltip.js
-  // ================================
-
-  Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
-
-  Popover.prototype.constructor = Popover
-
-  Popover.prototype.getDefaults = function () {
-    return Popover.DEFAULTS
-  }
-
-  Popover.prototype.setContent = function () {
-    var $tip    = this.tip()
-    var title   = this.getTitle()
-    var content = this.getContent()
-
-    $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
-    $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
-      this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
-    ](content)
-
-    $tip.removeClass('fade top bottom left right in')
-
-    // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
-    // this manually by checking the contents.
-    if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
-  }
-
-  Popover.prototype.hasContent = function () {
-    return this.getTitle() || this.getContent()
-  }
-
-  Popover.prototype.getContent = function () {
-    var $e = this.$element
-    var o  = this.options
-
-    return $e.attr('data-content')
-      || (typeof o.content == 'function' ?
-            o.content.call($e[0]) :
-            o.content)
-  }
-
-  Popover.prototype.arrow = function () {
-    return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
-  }
-
-
-  // POPOVER PLUGIN DEFINITION
-  // =========================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this   = $(this)
-      var data    = $this.data('bs.popover')
-      var options = typeof option == 'object' && option
-
-      if (!data && /destroy|hide/.test(option)) return
-      if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  var old = $.fn.popover
-
-  $.fn.popover             = Plugin
-  $.fn.popover.Constructor = Popover
-
-
-  // POPOVER NO CONFLICT
-  // ===================
-
-  $.fn.popover.noConflict = function () {
-    $.fn.popover = old
-    return this
-  }
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: scrollspy.js v3.3.6
- * http://getbootstrap.com/javascript/#scrollspy
- * ========================================================================
- * Copyright 2011-2016 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // SCROLLSPY CLASS DEFINITION
-  // ==========================
-
-  function ScrollSpy(element, options) {
-    this.$body          = $(document.body)
-    this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
-    this.options        = $.extend({}, ScrollSpy.DEFAULTS, options)
-    this.selector       = (this.options.target || '') + ' .nav li > a'
-    this.offsets        = []
-    this.targets        = []
-    this.activeTarget   = null
-    this.scrollHeight   = 0
-
-    this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
-    this.refresh()
-    this.process()
-  }
-
-  ScrollSpy.VERSION  = '3.3.6'
-
-  ScrollSpy.DEFAULTS = {
-    offset: 10
-  }
-
-  ScrollSpy.prototype.getScrollHeight = function () {
-    return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
-  }
-
-  ScrollSpy.prototype.refresh = function () {
-    var that          = this
-    var offsetMethod  = 'offset'
-    var offsetBase    = 0
-
-    this.offsets      = []
-    this.targets      = []
-    this.scrollHeight = this.getScrollHeight()
-
-    if (!$.isWindow(this.$scrollElement[0])) {
-      offsetMethod = 'position'
-      offsetBase   = this.$scrollElement.scrollTop()
-    }
-
-    this.$body
-      .find(this.selector)
-      .map(function () {
-        var $el   = $(this)
-        var href  = $el.data('target') || $el.attr('href')
-        var $href = /^#./.test(href) && $(href)
-
-        return ($href
-          && $href.length
-          && $href.is(':visible')
-          && [[$href[offsetMethod]().top + offsetBase, href]]) || null
-      })
-      .sort(function (a, b) { return a[0] - b[0] })
-      .each(function () {
-        that.offsets.push(this[0])
-        that.targets.push(this[1])
-      })
-  }
-
-  ScrollSpy.prototype.process = function () {
-    var scrollTop    = this.$scrollElement.scrollTop() + this.options.offset
-    var scrollHeight = this.getScrollHeight()
-    var maxScroll    = this.options.offset + scrollHeight - this.$scrollElement.height()
-    var offsets      = this.offsets
-    var targets      = this.targets
-    var activeTarget = this.activeTarget
-    var i
-
-    if (this.scrollHeight != scrollHeight) {
-      this.refresh()
-    }
-
-    if (scrollTop >= maxScroll) {
-      return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
-    }
-
-    if (activeTarget && scrollTop < offsets[0]) {
-      this.activeTarget = null
-      return this.clear()
-    }
-
-    for (i = offsets.length; i--;) {
-      activeTarget != targets[i]
-        && scrollTop >= offsets[i]
-        && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
-        && this.activate(targets[i])
-    }
-  }
-
-  ScrollSpy.prototype.activate = function (target) {
-    this.activeTarget = target
-
-    this.clear()
-
-    var selector = this.selector +
-      '[data-target="' + target + '"],' +
-      this.selector + '[href="' + target + '"]'
-
-    var active = $(selector)
-      .parents('li')
-      .addClass('active')
-
-    if (active.parent('.dropdown-menu').length) {
-      active = active
-        .closest('li.dropdown')
-        .addClass('active')
-    }
-
-    active.trigger('activate.bs.scrollspy')
-  }
-
-  ScrollSpy.prototype.clear = function () {
-    $(this.selector)
-      .parentsUntil(this.options.target, '.active')
-      .removeClass('active')
-  }
-
-
-  // SCROLLSPY PLUGIN DEFINITION
-  // ===========================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this   = $(this)
-      var data    = $this.data('bs.scrollspy')
-      var options = typeof option == 'object' && option
-
-      if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  var old = $.fn.scrollspy
-
-  $.fn.scrollspy             = Plugin
-  $.fn.scrollspy.Constructor = ScrollSpy
-
-
-  // SCROLLSPY NO CONFLICT
-  // =====================
-
-  $.fn.scrollspy.noConflict = function () {
-    $.fn.scrollspy = old
-    return this
-  }
-
-
-  // SCROLLSPY DATA-API
-  // ==================
-
-  $(window).on('load.bs.scrollspy.data-api', function () {
-    $('[data-spy="scroll"]').each(function () {
-      var $spy = $(this)
-      Plugin.call($spy, $spy.data())
-    })
-  })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: tab.js v3.3.6
- * http://getbootstrap.com/javascript/#tabs
- * ========================================================================
- * Copyright 2011-2016 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // TAB CLASS DEFINITION
-  // ====================
-
-  var Tab = function (element) {
-    // jscs:disable requireDollarBeforejQueryAssignment
-    this.element = $(element)
-    // jscs:enable requireDollarBeforejQueryAssignment
-  }
-
-  Tab.VERSION = '3.3.6'
-
-  Tab.TRANSITION_DURATION = 150
-
-  Tab.prototype.show = function () {
-    var $this    = this.element
-    var $ul      = $this.closest('ul:not(.dropdown-menu)')
-    var selector = $this.data('target')
-
-    if (!selector) {
-      selector = $this.attr('href')
-      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
-    }
-
-    if ($this.parent('li').hasClass('active')) return
-
-    var $previous = $ul.find('.active:last a')
-    var hideEvent = $.Event('hide.bs.tab', {
-      relatedTarget: $this[0]
-    })
-    var showEvent = $.Event('show.bs.tab', {
-      relatedTarget: $previous[0]
-    })
-
-    $previous.trigger(hideEvent)
-    $this.trigger(showEvent)
-
-    if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
-
-    var $target = $(selector)
-
-    this.activate($this.closest('li'), $ul)
-    this.activate($target, $target.parent(), function () {
-      $previous.trigger({
-        type: 'hidden.bs.tab',
-        relatedTarget: $this[0]
-      })
-      $this.trigger({
-        type: 'shown.bs.tab',
-        relatedTarget: $previous[0]
-      })
-    })
-  }
-
-  Tab.prototype.activate = function (element, container, callback) {
-    var $active    = container.find('> .active')
-    var transition = callback
-      && $.support.transition
-      && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
-
-    function next() {
-      $active
-        .removeClass('active')
-        .find('> .dropdown-menu > .active')
-          .removeClass('active')
-        .end()
-        .find('[data-toggle="tab"]')
-          .attr('aria-expanded', false)
-
-      element
-        .addClass('active')
-        .find('[data-toggle="tab"]')
-          .attr('aria-expanded', true)
-
-      if (transition) {
-        element[0].offsetWidth // reflow for transition
-        element.addClass('in')
-      } else {
-        element.removeClass('fade')
-      }
-
-      if (element.parent('.dropdown-menu').length) {
-        element
-          .closest('li.dropdown')
-            .addClass('active')
-          .end()
-          .find('[data-toggle="tab"]')
-            .attr('aria-expanded', true)
-      }
-
-      callback && callback()
-    }
-
-    $active.length && transition ?
-      $active
-        .one('bsTransitionEnd', next)
-        .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
-      next()
-
-    $active.removeClass('in')
-  }
-
-
-  // TAB PLUGIN DEFINITION
-  // =====================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this = $(this)
-      var data  = $this.data('bs.tab')
-
-      if (!data) $this.data('bs.tab', (data = new Tab(this)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  var old = $.fn.tab
-
-  $.fn.tab             = Plugin
-  $.fn.tab.Constructor = Tab
-
-
-  // TAB NO CONFLICT
-  // ===============
-
-  $.fn.tab.noConflict = function () {
-    $.fn.tab = old
-    return this
-  }
-
-
-  // TAB DATA-API
-  // ============
-
-  var clickHandler = function (e) {
-    e.preventDefault()
-    Plugin.call($(this), 'show')
-  }
-
-  $(document)
-    .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
-    .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: affix.js v3.3.6
- * http://getbootstrap.com/javascript/#affix
- * ========================================================================
- * Copyright 2011-2016 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // AFFIX CLASS DEFINITION
-  // ======================
-
-  var Affix = function (element, options) {
-    this.options = $.extend({}, Affix.DEFAULTS, options)
-
-    this.$target = $(this.options.target)
-      .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
-      .on('click.bs.affix.data-api',  $.proxy(this.checkPositionWithEventLoop, this))
-
-    this.$element     = $(element)
-    this.affixed      = null
-    this.unpin        = null
-    this.pinnedOffset = null
-
-    this.checkPosition()
-  }
-
-  Affix.VERSION  = '3.3.6'
-
-  Affix.RESET    = 'affix affix-top affix-bottom'
-
-  Affix.DEFAULTS = {
-    offset: 0,
-    target: window
-  }
-
-  Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
-    var scrollTop    = this.$target.scrollTop()
-    var position     = this.$element.offset()
-    var targetHeight = this.$target.height()
-
-    if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
-
-    if (this.affixed == 'bottom') {
-      if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
-      return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
-    }
-
-    var initializing   = this.affixed == null
-    var colliderTop    = initializing ? scrollTop : position.top
-    var colliderHeight = initializing ? targetHeight : height
-
-    if (offsetTop != null && scrollTop <= offsetTop) return 'top'
-    if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
-
-    return false
-  }
-
-  Affix.prototype.getPinnedOffset = function () {
-    if (this.pinnedOffset) return this.pinnedOffset
-    this.$element.removeClass(Affix.RESET).addClass('affix')
-    var scrollTop = this.$target.scrollTop()
-    var position  = this.$element.offset()
-    return (this.pinnedOffset = position.top - scrollTop)
-  }
-
-  Affix.prototype.checkPositionWithEventLoop = function () {
-    setTimeout($.proxy(this.checkPosition, this), 1)
-  }
-
-  Affix.prototype.checkPosition = function () {
-    if (!this.$element.is(':visible')) return
-
-    var height       = this.$element.height()
-    var offset       = this.options.offset
-    var offsetTop    = offset.top
-    var offsetBottom = offset.bottom
-    var scrollHeight = Math.max($(document).height(), $(document.body).height())
-
-    if (typeof offset != 'object')         offsetBottom = offsetTop = offset
-    if (typeof offsetTop == 'function')    offsetTop    = offset.top(this.$element)
-    if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
-
-    var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
-
-    if (this.affixed != affix) {
-      if (this.unpin != null) this.$element.css('top', '')
-
-      var affixType = 'affix' + (affix ? '-' + affix : '')
-      var e         = $.Event(affixType + '.bs.affix')
-
-      this.$element.trigger(e)
-
-      if (e.isDefaultPrevented()) return
-
-      this.affixed = affix
-      this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
-
-      this.$element
-        .removeClass(Affix.RESET)
-        .addClass(affixType)
-        .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
-    }
-
-    if (affix == 'bottom') {
-      this.$element.offset({
-        top: scrollHeight - height - offsetBottom
-      })
-    }
-  }
-
-
-  // AFFIX PLUGIN DEFINITION
-  // =======================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this   = $(this)
-      var data    = $this.data('bs.affix')
-      var options = typeof option == 'object' && option
-
-      if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  var old = $.fn.affix
-
-  $.fn.affix             = Plugin
-  $.fn.affix.Constructor = Affix
-
-
-  // AFFIX NO CONFLICT
-  // =================
-
-  $.fn.affix.noConflict = function () {
-    $.fn.affix = old
-    return this
-  }
-
-
-  // AFFIX DATA-API
-  // ==============
-
-  $(window).on('load', function () {
-    $('[data-spy="affix"]').each(function () {
-      var $spy = $(this)
-      var data = $spy.data()
-
-      data.offset = data.offset || {}
-
-      if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
-      if (data.offsetTop    != null) data.offset.top    = data.offsetTop
-
-      Plugin.call($spy, data)
-    })
-  })
-
-}(jQuery);

+ 0 - 1116
src/js/lib/bootstrap-colorpicker.js

@@ -1,1116 +0,0 @@
-/*!
- * Bootstrap Colorpicker v2.3.6
- * https://itsjavi.com/bootstrap-colorpicker/
- *
- * Originally written by (c) 2012 Stefan Petre
- * Licensed under the Apache License v2.0
- * http://www.apache.org/licenses/LICENSE-2.0.txt
- *
- */
-
-(function(factory) {
-  "use strict";
-  if (typeof exports === 'object') {
-    module.exports = factory(window.jQuery);
-  } else if (typeof define === 'function' && define.amd) {
-    define(['jquery'], factory);
-  } else if (window.jQuery && !window.jQuery.fn.colorpicker) {
-    factory(window.jQuery);
-  }
-}(function($) {
-  'use strict';
-
-  /**
-   * Color manipulation helper class
-   *
-   * @param {Object|String} val
-   * @param {Object} predefinedColors
-   * @constructor
-   */
-  var Color = function(val, predefinedColors) {
-    this.value = {
-      h: 0,
-      s: 0,
-      b: 0,
-      a: 1
-    };
-    this.origFormat = null; // original string format
-    if (predefinedColors) {
-      $.extend(this.colors, predefinedColors);
-    }
-    if (val) {
-      if (val.toLowerCase !== undefined) {
-        // cast to string
-        val = val + '';
-        this.setColor(val);
-      } else if (val.h !== undefined) {
-        this.value = val;
-      }
-    }
-  };
-
-  Color.prototype = {
-    constructor: Color,
-    // 140 predefined colors from the HTML Colors spec
-    colors: {
-      "aliceblue": "#f0f8ff",
-      "antiquewhite": "#faebd7",
-      "aqua": "#00ffff",
-      "aquamarine": "#7fffd4",
-      "azure": "#f0ffff",
-      "beige": "#f5f5dc",
-      "bisque": "#ffe4c4",
-      "black": "#000000",
-      "blanchedalmond": "#ffebcd",
-      "blue": "#0000ff",
-      "blueviolet": "#8a2be2",
-      "brown": "#a52a2a",
-      "burlywood": "#deb887",
-      "cadetblue": "#5f9ea0",
-      "chartreuse": "#7fff00",
-      "chocolate": "#d2691e",
-      "coral": "#ff7f50",
-      "cornflowerblue": "#6495ed",
-      "cornsilk": "#fff8dc",
-      "crimson": "#dc143c",
-      "cyan": "#00ffff",
-      "darkblue": "#00008b",
-      "darkcyan": "#008b8b",
-      "darkgoldenrod": "#b8860b",
-      "darkgray": "#a9a9a9",
-      "darkgreen": "#006400",
-      "darkkhaki": "#bdb76b",
-      "darkmagenta": "#8b008b",
-      "darkolivegreen": "#556b2f",
-      "darkorange": "#ff8c00",
-      "darkorchid": "#9932cc",
-      "darkred": "#8b0000",
-      "darksalmon": "#e9967a",
-      "darkseagreen": "#8fbc8f",
-      "darkslateblue": "#483d8b",
-      "darkslategray": "#2f4f4f",
-      "darkturquoise": "#00ced1",
-      "darkviolet": "#9400d3",
-      "deeppink": "#ff1493",
-      "deepskyblue": "#00bfff",
-      "dimgray": "#696969",
-      "dodgerblue": "#1e90ff",
-      "firebrick": "#b22222",
-      "floralwhite": "#fffaf0",
-      "forestgreen": "#228b22",
-      "fuchsia": "#ff00ff",
-      "gainsboro": "#dcdcdc",
-      "ghostwhite": "#f8f8ff",
-      "gold": "#ffd700",
-      "goldenrod": "#daa520",
-      "gray": "#808080",
-      "green": "#008000",
-      "greenyellow": "#adff2f",
-      "honeydew": "#f0fff0",
-      "hotpink": "#ff69b4",
-      "indianred": "#cd5c5c",
-      "indigo": "#4b0082",
-      "ivory": "#fffff0",
-      "khaki": "#f0e68c",
-      "lavender": "#e6e6fa",
-      "lavenderblush": "#fff0f5",
-      "lawngreen": "#7cfc00",
-      "lemonchiffon": "#fffacd",
-      "lightblue": "#add8e6",
-      "lightcoral": "#f08080",
-      "lightcyan": "#e0ffff",
-      "lightgoldenrodyellow": "#fafad2",
-      "lightgrey": "#d3d3d3",
-      "lightgreen": "#90ee90",
-      "lightpink": "#ffb6c1",
-      "lightsalmon": "#ffa07a",
-      "lightseagreen": "#20b2aa",
-      "lightskyblue": "#87cefa",
-      "lightslategray": "#778899",
-      "lightsteelblue": "#b0c4de",
-      "lightyellow": "#ffffe0",
-      "lime": "#00ff00",
-      "limegreen": "#32cd32",
-      "linen": "#faf0e6",
-      "magenta": "#ff00ff",
-      "maroon": "#800000",
-      "mediumaquamarine": "#66cdaa",
-      "mediumblue": "#0000cd",
-      "mediumorchid": "#ba55d3",
-      "mediumpurple": "#9370d8",
-      "mediumseagreen": "#3cb371",
-      "mediumslateblue": "#7b68ee",
-      "mediumspringgreen": "#00fa9a",
-      "mediumturquoise": "#48d1cc",
-      "mediumvioletred": "#c71585",
-      "midnightblue": "#191970",
-      "mintcream": "#f5fffa",
-      "mistyrose": "#ffe4e1",
-      "moccasin": "#ffe4b5",
-      "navajowhite": "#ffdead",
-      "navy": "#000080",
-      "oldlace": "#fdf5e6",
-      "olive": "#808000",
-      "olivedrab": "#6b8e23",
-      "orange": "#ffa500",
-      "orangered": "#ff4500",
-      "orchid": "#da70d6",
-      "palegoldenrod": "#eee8aa",
-      "palegreen": "#98fb98",
-      "paleturquoise": "#afeeee",
-      "palevioletred": "#d87093",
-      "papayawhip": "#ffefd5",
-      "peachpuff": "#ffdab9",
-      "peru": "#cd853f",
-      "pink": "#ffc0cb",
-      "plum": "#dda0dd",
-      "powderblue": "#b0e0e6",
-      "purple": "#800080",
-      "red": "#ff0000",
-      "rosybrown": "#bc8f8f",
-      "royalblue": "#4169e1",
-      "saddlebrown": "#8b4513",
-      "salmon": "#fa8072",
-      "sandybrown": "#f4a460",
-      "seagreen": "#2e8b57",
-      "seashell": "#fff5ee",
-      "sienna": "#a0522d",
-      "silver": "#c0c0c0",
-      "skyblue": "#87ceeb",
-      "slateblue": "#6a5acd",
-      "slategray": "#708090",
-      "snow": "#fffafa",
-      "springgreen": "#00ff7f",
-      "steelblue": "#4682b4",
-      "tan": "#d2b48c",
-      "teal": "#008080",
-      "thistle": "#d8bfd8",
-      "tomato": "#ff6347",
-      "turquoise": "#40e0d0",
-      "violet": "#ee82ee",
-      "wheat": "#f5deb3",
-      "white": "#ffffff",
-      "whitesmoke": "#f5f5f5",
-      "yellow": "#ffff00",
-      "yellowgreen": "#9acd32",
-      "transparent": "transparent"
-    },
-    _sanitizeNumber: function(val) {
-      if (typeof val === 'number') {
-        return val;
-      }
-      if (isNaN(val) || (val === null) || (val === '') || (val === undefined)) {
-        return 1;
-      }
-      if (val === '') {
-        return 0;
-      }
-      if (val.toLowerCase !== undefined) {
-        if (val.match(/^\./)) {
-          val = "0" + val;
-        }
-        return Math.ceil(parseFloat(val) * 100) / 100;
-      }
-      return 1;
-    },
-    isTransparent: function(strVal) {
-      if (!strVal) {
-        return false;
-      }
-      strVal = strVal.toLowerCase().trim();
-      return (strVal === 'transparent') || (strVal.match(/#?00000000/)) || (strVal.match(/(rgba|hsla)\(0,0,0,0?\.?0\)/));
-    },
-    rgbaIsTransparent: function(rgba) {
-      return ((rgba.r === 0) && (rgba.g === 0) && (rgba.b === 0) && (rgba.a === 0));
-    },
-    //parse a string to HSB
-    setColor: function(strVal) {
-      strVal = strVal.toLowerCase().trim();
-      if (strVal) {
-        if (this.isTransparent(strVal)) {
-          this.value = {
-            h: 0,
-            s: 0,
-            b: 0,
-            a: 0
-          };
-        } else {
-          this.value = this.stringToHSB(strVal) || {
-            h: 0,
-            s: 0,
-            b: 0,
-            a: 1
-          }; // if parser fails, defaults to black
-        }
-      }
-    },
-    stringToHSB: function(strVal) {
-      strVal = strVal.toLowerCase();
-      var alias;
-      if (typeof this.colors[strVal] !== 'undefined') {
-        strVal = this.colors[strVal];
-        alias = 'alias';
-      }
-      var that = this,
-        result = false;
-      $.each(this.stringParsers, function(i, parser) {
-        var match = parser.re.exec(strVal),
-          values = match && parser.parse.apply(that, [match]),
-          format = alias || parser.format || 'rgba';
-        if (values) {
-          if (format.match(/hsla?/)) {
-            result = that.RGBtoHSB.apply(that, that.HSLtoRGB.apply(that, values));
-          } else {
-            result = that.RGBtoHSB.apply(that, values);
-          }
-          that.origFormat = format;
-          return false;
-        }
-        return true;
-      });
-      return result;
-    },
-    setHue: function(h) {
-      this.value.h = 1 - h;
-    },
-    setSaturation: function(s) {
-      this.value.s = s;
-    },
-    setBrightness: function(b) {
-      this.value.b = 1 - b;
-    },
-    setAlpha: function(a) {
-      this.value.a = Math.round((parseInt((1 - a) * 100, 10) / 100) * 100) / 100;
-    },
-    toRGB: function(h, s, b, a) {
-      if (!h) {
-        h = this.value.h;
-        s = this.value.s;
-        b = this.value.b;
-      }
-      h *= 360;
-      var R, G, B, X, C;
-      h = (h % 360) / 60;
-      C = b * s;
-      X = C * (1 - Math.abs(h % 2 - 1));
-      R = G = B = b - C;
-
-      h = ~~h;
-      R += [C, X, 0, 0, X, C][h];
-      G += [X, C, C, X, 0, 0][h];
-      B += [0, 0, X, C, C, X][h];
-      return {
-        r: Math.round(R * 255),
-        g: Math.round(G * 255),
-        b: Math.round(B * 255),
-        a: a || this.value.a
-      };
-    },
-    toHex: function(h, s, b, a) {
-      var rgb = this.toRGB(h, s, b, a);
-      if (this.rgbaIsTransparent(rgb)) {
-        return 'transparent';
-      }
-      return '#' + ((1 << 24) | (parseInt(rgb.r) << 16) | (parseInt(rgb.g) << 8) | parseInt(rgb.b)).toString(16).substr(1);
-    },
-    toHSL: function(h, s, b, a) {
-      h = h || this.value.h;
-      s = s || this.value.s;
-      b = b || this.value.b;
-      a = a || this.value.a;
-
-      var H = h,
-        L = (2 - s) * b,
-        S = s * b;
-      if (L > 0 && L <= 1) {
-        S /= L;
-      } else {
-        S /= 2 - L;
-      }
-      L /= 2;
-      if (S > 1) {
-        S = 1;
-      }
-      return {
-        h: isNaN(H) ? 0 : H,
-        s: isNaN(S) ? 0 : S,
-        l: isNaN(L) ? 0 : L,
-        a: isNaN(a) ? 0 : a
-      };
-    },
-    toAlias: function(r, g, b, a) {
-      var rgb = this.toHex(r, g, b, a);
-      for (var alias in this.colors) {
-        if (this.colors[alias] === rgb) {
-          return alias;
-        }
-      }
-      return false;
-    },
-    RGBtoHSB: function(r, g, b, a) {
-      r /= 255;
-      g /= 255;
-      b /= 255;
-
-      var H, S, V, C;
-      V = Math.max(r, g, b);
-      C = V - Math.min(r, g, b);
-      H = (C === 0 ? null :
-        V === r ? (g - b) / C :
-        V === g ? (b - r) / C + 2 :
-        (r - g) / C + 4
-      );
-      H = ((H + 360) % 6) * 60 / 360;
-      S = C === 0 ? 0 : C / V;
-      return {
-        h: this._sanitizeNumber(H),
-        s: S,
-        b: V,
-        a: this._sanitizeNumber(a)
-      };
-    },
-    HueToRGB: function(p, q, h) {
-      if (h < 0) {
-        h += 1;
-      } else if (h > 1) {
-        h -= 1;
-      }
-      if ((h * 6) < 1) {
-        return p + (q - p) * h * 6;
-      } else if ((h * 2) < 1) {
-        return q;
-      } else if ((h * 3) < 2) {
-        return p + (q - p) * ((2 / 3) - h) * 6;
-      } else {
-        return p;
-      }
-    },
-    HSLtoRGB: function(h, s, l, a) {
-      if (s < 0) {
-        s = 0;
-      }
-      var q;
-      if (l <= 0.5) {
-        q = l * (1 + s);
-      } else {
-        q = l + s - (l * s);
-      }
-
-      var p = 2 * l - q;
-
-      var tr = h + (1 / 3);
-      var tg = h;
-      var tb = h - (1 / 3);
-
-      var r = Math.round(this.HueToRGB(p, q, tr) * 255);
-      var g = Math.round(this.HueToRGB(p, q, tg) * 255);
-      var b = Math.round(this.HueToRGB(p, q, tb) * 255);
-      return [r, g, b, this._sanitizeNumber(a)];
-    },
-    toString: function(format) {
-      format = format || 'rgba';
-      var c = false;
-      switch (format) {
-        case 'rgb':
-          {
-            c = this.toRGB();
-            if (this.rgbaIsTransparent(c)) {
-              return 'transparent';
-            }
-            return 'rgb(' + c.r + ',' + c.g + ',' + c.b + ')';
-          }
-          break;
-        case 'rgba':
-          {
-            c = this.toRGB();
-            return 'rgba(' + c.r + ',' + c.g + ',' + c.b + ',' + c.a + ')';
-          }
-          break;
-        case 'hsl':
-          {
-            c = this.toHSL();
-            return 'hsl(' + Math.round(c.h * 360) + ',' + Math.round(c.s * 100) + '%,' + Math.round(c.l * 100) + '%)';
-          }
-          break;
-        case 'hsla':
-          {
-            c = this.toHSL();
-            return 'hsla(' + Math.round(c.h * 360) + ',' + Math.round(c.s * 100) + '%,' + Math.round(c.l * 100) + '%,' + c.a + ')';
-          }
-          break;
-        case 'hex':
-          {
-            return this.toHex();
-          }
-          break;
-        case 'alias':
-          return this.toAlias() || this.toHex();
-        default:
-          {
-            return c;
-          }
-          break;
-      }
-    },
-    // a set of RE's that can match strings and generate color tuples.
-    // from John Resig color plugin
-    // https://github.com/jquery/jquery-color/
-    stringParsers: [{
-      re: /rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*?\)/,
-      format: 'rgb',
-      parse: function(execResult) {
-        return [
-          execResult[1],
-          execResult[2],
-          execResult[3],
-          1
-        ];
-      }
-    }, {
-      re: /rgb\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/,
-      format: 'rgb',
-      parse: function(execResult) {
-        return [
-          2.55 * execResult[1],
-          2.55 * execResult[2],
-          2.55 * execResult[3],
-          1
-        ];
-      }
-    }, {
-      re: /rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,
-      format: 'rgba',
-      parse: function(execResult) {
-        return [
-          execResult[1],
-          execResult[2],
-          execResult[3],
-          execResult[4]
-        ];
-      }
-    }, {
-      re: /rgba\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,
-      format: 'rgba',
-      parse: function(execResult) {
-        return [
-          2.55 * execResult[1],
-          2.55 * execResult[2],
-          2.55 * execResult[3],
-          execResult[4]
-        ];
-      }
-    }, {
-      re: /hsl\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/,
-      format: 'hsl',
-      parse: function(execResult) {
-        return [
-          execResult[1] / 360,
-          execResult[2] / 100,
-          execResult[3] / 100,
-          execResult[4]
-        ];
-      }
-    }, {
-      re: /hsla\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,
-      format: 'hsla',
-      parse: function(execResult) {
-        return [
-          execResult[1] / 360,
-          execResult[2] / 100,
-          execResult[3] / 100,
-          execResult[4]
-        ];
-      }
-    }, {
-      re: /#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,
-      format: 'hex',
-      parse: function(execResult) {
-        return [
-          parseInt(execResult[1], 16),
-          parseInt(execResult[2], 16),
-          parseInt(execResult[3], 16),
-          1
-        ];
-      }
-    }, {
-      re: /#?([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,
-      format: 'hex',
-      parse: function(execResult) {
-        return [
-          parseInt(execResult[1] + execResult[1], 16),
-          parseInt(execResult[2] + execResult[2], 16),
-          parseInt(execResult[3] + execResult[3], 16),
-          1
-        ];
-      }
-    }],
-    colorNameToHex: function(name) {
-      if (typeof this.colors[name.toLowerCase()] !== 'undefined') {
-        return this.colors[name.toLowerCase()];
-      }
-      return false;
-    }
-  };
-
-  /*
-   * Default plugin options
-   */
-  var defaults = {
-    horizontal: false, // horizontal mode layout ?
-    inline: false, //forces to show the colorpicker as an inline element
-    color: false, //forces a color
-    format: false, //forces a format
-    input: 'input', // children input selector
-    container: false, // container selector
-    component: '.add-on, .input-group-addon', // children component selector
-    sliders: {
-      saturation: {
-        maxLeft: 100,
-        maxTop: 100,
-        callLeft: 'setSaturation',
-        callTop: 'setBrightness'
-      },
-      hue: {
-        maxLeft: 0,
-        maxTop: 100,
-        callLeft: false,
-        callTop: 'setHue'
-      },
-      alpha: {
-        maxLeft: 0,
-        maxTop: 100,
-        callLeft: false,
-        callTop: 'setAlpha'
-      }
-    },
-    slidersHorz: {
-      saturation: {
-        maxLeft: 100,
-        maxTop: 100,
-        callLeft: 'setSaturation',
-        callTop: 'setBrightness'
-      },
-      hue: {
-        maxLeft: 100,
-        maxTop: 0,
-        callLeft: 'setHue',
-        callTop: false
-      },
-      alpha: {
-        maxLeft: 100,
-        maxTop: 0,
-        callLeft: 'setAlpha',
-        callTop: false
-      }
-    },
-    template: '<div class="colorpicker dropdown-menu">' +
-      '<div class="colorpicker-saturation"><i><b></b></i></div>' +
-      '<div class="colorpicker-hue"><i></i></div>' +
-      '<div class="colorpicker-alpha"><i></i></div>' +
-      '<div class="colorpicker-color"><div /></div>' +
-      '<div class="colorpicker-selectors"></div>' +
-      '</div>',
-    align: 'right',
-    customClass: null,
-    colorSelectors: null
-  };
-
-  /**
-   * Colorpicker component class
-   *
-   * @param {Object|String} element
-   * @param {Object} options
-   * @constructor
-   */
-  var Colorpicker = function(element, options) {
-    this.element = $(element).addClass('colorpicker-element');
-    this.options = $.extend(true, {}, defaults, this.element.data(), options);
-    this.component = this.options.component;
-    this.component = (this.component !== false) ? this.element.find(this.component) : false;
-    if (this.component && (this.component.length === 0)) {
-      this.component = false;
-    }
-    this.container = (this.options.container === true) ? this.element : this.options.container;
-    this.container = (this.container !== false) ? $(this.container) : false;
-
-    // Is the element an input? Should we search inside for any input?
-    this.input = this.element.is('input') ? this.element : (this.options.input ?
-      this.element.find(this.options.input) : false);
-    if (this.input && (this.input.length === 0)) {
-      this.input = false;
-    }
-    // Set HSB color
-    this.color = new Color(this.options.color !== false ? this.options.color : this.getValue(), this.options.colorSelectors);
-    this.format = this.options.format !== false ? this.options.format : this.color.origFormat;
-
-    if (this.options.color !== false) {
-      this.updateInput(this.color);
-      this.updateData(this.color);
-    }
-
-    // Setup picker
-    this.picker = $(this.options.template);
-    if (this.options.customClass) {
-      this.picker.addClass(this.options.customClass);
-    }
-    if (this.options.inline) {
-      this.picker.addClass('colorpicker-inline colorpicker-visible');
-    } else {
-      this.picker.addClass('colorpicker-hidden');
-    }
-    if (this.options.horizontal) {
-      this.picker.addClass('colorpicker-horizontal');
-    }
-    if (this.format === 'rgba' || this.format === 'hsla' || this.options.format === false) {
-      this.picker.addClass('colorpicker-with-alpha');
-    }
-    if (this.options.align === 'right') {
-      this.picker.addClass('colorpicker-right');
-    }
-    if (this.options.inline === true) {
-      this.picker.addClass('colorpicker-no-arrow');
-    }
-    if (this.options.colorSelectors) {
-      var colorpicker = this;
-      $.each(this.options.colorSelectors, function(name, color) {
-        var $btn = $('<i />').css('background-color', color).data('class', name);
-        $btn.click(function() {
-          colorpicker.setValue($(this).css('background-color'));
-        });
-        colorpicker.picker.find('.colorpicker-selectors').append($btn);
-      });
-      this.picker.find('.colorpicker-selectors').show();
-    }
-    this.picker.on('mousedown.colorpicker touchstart.colorpicker', $.proxy(this.mousedown, this));
-    this.picker.appendTo(this.container ? this.container : $('body'));
-
-    // Bind events
-    if (this.input !== false) {
-      this.input.on({
-        'keyup.colorpicker': $.proxy(this.keyup, this)
-      });
-      this.input.on({
-        'change.colorpicker': $.proxy(this.change, this)
-      });
-      if (this.component === false) {
-        this.element.on({
-          'focus.colorpicker': $.proxy(this.show, this)
-        });
-      }
-      if (this.options.inline === false) {
-        this.element.on({
-          'focusout.colorpicker': $.proxy(this.hide, this)
-        });
-      }
-    }
-
-    if (this.component !== false) {
-      this.component.on({
-        'click.colorpicker': $.proxy(this.show, this)
-      });
-    }
-
-    if ((this.input === false) && (this.component === false)) {
-      this.element.on({
-        'click.colorpicker': $.proxy(this.show, this)
-      });
-    }
-
-    // for HTML5 input[type='color']
-    if ((this.input !== false) && (this.component !== false) && (this.input.attr('type') === 'color')) {
-
-      this.input.on({
-        'click.colorpicker': $.proxy(this.show, this),
-        'focus.colorpicker': $.proxy(this.show, this)
-      });
-    }
-    this.update();
-
-    $($.proxy(function() {
-      this.element.trigger('create');
-    }, this));
-  };
-
-  Colorpicker.Color = Color;
-
-  Colorpicker.prototype = {
-    constructor: Colorpicker,
-    destroy: function() {
-      this.picker.remove();
-      this.element.removeData('colorpicker', 'color').off('.colorpicker');
-      if (this.input !== false) {
-        this.input.off('.colorpicker');
-      }
-      if (this.component !== false) {
-        this.component.off('.colorpicker');
-      }
-      this.element.removeClass('colorpicker-element');
-      this.element.trigger({
-        type: 'destroy'
-      });
-    },
-    reposition: function() {
-      if (this.options.inline !== false || this.options.container) {
-        return false;
-      }
-      var type = this.container && this.container[0] !== document.body ? 'position' : 'offset';
-      var element = this.component || this.element;
-      var offset = element[type]();
-      if (this.options.align === 'right') {
-        offset.left -= this.picker.outerWidth() - element.outerWidth();
-      }
-      this.picker.css({
-        top: offset.top + element.outerHeight(),
-        left: offset.left
-      });
-    },
-    show: function(e) {
-      if (this.isDisabled()) {
-        return false;
-      }
-      this.picker.addClass('colorpicker-visible').removeClass('colorpicker-hidden');
-      this.reposition();
-      $(window).on('resize.colorpicker', $.proxy(this.reposition, this));
-      if (e && (!this.hasInput() || this.input.attr('type') === 'color')) {
-        if (e.stopPropagation && e.preventDefault) {
-          e.stopPropagation();
-          e.preventDefault();
-        }
-      }
-      if ((this.component || !this.input) && (this.options.inline === false)) {
-        $(window.document).on({
-          'mousedown.colorpicker': $.proxy(this.hide, this)
-        });
-      }
-      this.element.trigger({
-        type: 'showPicker',
-        color: this.color
-      });
-    },
-    hide: function() {
-      this.picker.addClass('colorpicker-hidden').removeClass('colorpicker-visible');
-      $(window).off('resize.colorpicker', this.reposition);
-      $(document).off({
-        'mousedown.colorpicker': this.hide
-      });
-      this.update();
-      this.element.trigger({
-        type: 'hidePicker',
-        color: this.color
-      });
-    },
-    updateData: function(val) {
-      val = val || this.color.toString(this.format);
-      this.element.data('color', val);
-      return val;
-    },
-    updateInput: function(val) {
-      val = val || this.color.toString(this.format);
-      if (this.input !== false) {
-        if (this.options.colorSelectors) {
-          var color = new Color(val, this.options.colorSelectors);
-          var alias = color.toAlias();
-          if (typeof this.options.colorSelectors[alias] !== 'undefined') {
-            val = alias;
-          }
-        }
-        this.input.prop('value', val);
-      }
-      return val;
-    },
-    updatePicker: function(val) {
-      if (val !== undefined) {
-        this.color = new Color(val, this.options.colorSelectors);
-      }
-      var sl = (this.options.horizontal === false) ? this.options.sliders : this.options.slidersHorz;
-      var icns = this.picker.find('i');
-      if (icns.length === 0) {
-        return;
-      }
-      if (this.options.horizontal === false) {
-        sl = this.options.sliders;
-        icns.eq(1).css('top', sl.hue.maxTop * (1 - this.color.value.h)).end()
-          .eq(2).css('top', sl.alpha.maxTop * (1 - this.color.value.a));
-      } else {
-        sl = this.options.slidersHorz;
-        icns.eq(1).css('left', sl.hue.maxLeft * (1 - this.color.value.h)).end()
-          .eq(2).css('left', sl.alpha.maxLeft * (1 - this.color.value.a));
-      }
-      icns.eq(0).css({
-        'top': sl.saturation.maxTop - this.color.value.b * sl.saturation.maxTop,
-        'left': this.color.value.s * sl.saturation.maxLeft
-      });
-      this.picker.find('.colorpicker-saturation').css('backgroundColor', this.color.toHex(this.color.value.h, 1, 1, 1));
-      this.picker.find('.colorpicker-alpha').css('backgroundColor', this.color.toHex());
-      this.picker.find('.colorpicker-color, .colorpicker-color div').css('backgroundColor', this.color.toString(this.format));
-      return val;
-    },
-    updateComponent: function(val) {
-      val = val || this.color.toString(this.format);
-      if (this.component !== false) {
-        var icn = this.component.find('i').eq(0);
-        if (icn.length > 0) {
-          icn.css({
-            'backgroundColor': val
-          });
-        } else {
-          this.component.css({
-            'backgroundColor': val
-          });
-        }
-      }
-      return val;
-    },
-    update: function(force) {
-      var val;
-      if ((this.getValue(false) !== false) || (force === true)) {
-        // Update input/data only if the current value is not empty
-        val = this.updateComponent();
-        this.updateInput(val);
-        this.updateData(val);
-        this.updatePicker(); // only update picker if value is not empty
-      }
-      return val;
-
-    },
-    setValue: function(val) { // set color manually
-      this.color = new Color(val, this.options.colorSelectors);
-      this.update(true);
-      this.element.trigger({
-        type: 'changeColor',
-        color: this.color,
-        value: val
-      });
-    },
-    getValue: function(defaultValue) {
-      defaultValue = (defaultValue === undefined) ? '#000000' : defaultValue;
-      var val;
-      if (this.hasInput()) {
-        val = this.input.val();
-      } else {
-        val = this.element.data('color');
-      }
-      if ((val === undefined) || (val === '') || (val === null)) {
-        // if not defined or empty, return default
-        val = defaultValue;
-      }
-      return val;
-    },
-    hasInput: function() {
-      return (this.input !== false);
-    },
-    isDisabled: function() {
-      if (this.hasInput()) {
-        return (this.input.prop('disabled') === true);
-      }
-      return false;
-    },
-    disable: function() {
-      if (this.hasInput()) {
-        this.input.prop('disabled', true);
-        this.element.trigger({
-          type: 'disable',
-          color: this.color,
-          value: this.getValue()
-        });
-        return true;
-      }
-      return false;
-    },
-    enable: function() {
-      if (this.hasInput()) {
-        this.input.prop('disabled', false);
-        this.element.trigger({
-          type: 'enable',
-          color: this.color,
-          value: this.getValue()
-        });
-        return true;
-      }
-      return false;
-    },
-    currentSlider: null,
-    mousePointer: {
-      left: 0,
-      top: 0
-    },
-    mousedown: function(e) {
-      if (!e.pageX && !e.pageY && e.originalEvent && e.originalEvent.touches) {
-        e.pageX = e.originalEvent.touches[0].pageX;
-        e.pageY = e.originalEvent.touches[0].pageY;
-      }
-      e.stopPropagation();
-      e.preventDefault();
-
-      var target = $(e.target);
-
-      //detect the slider and set the limits and callbacks
-      var zone = target.closest('div');
-      var sl = this.options.horizontal ? this.options.slidersHorz : this.options.sliders;
-      if (!zone.is('.colorpicker')) {
-        if (zone.is('.colorpicker-saturation')) {
-          this.currentSlider = $.extend({}, sl.saturation);
-        } else if (zone.is('.colorpicker-hue')) {
-          this.currentSlider = $.extend({}, sl.hue);
-        } else if (zone.is('.colorpicker-alpha')) {
-          this.currentSlider = $.extend({}, sl.alpha);
-        } else {
-          return false;
-        }
-        var offset = zone.offset();
-        //reference to guide's style
-        this.currentSlider.guide = zone.find('i')[0].style;
-        this.currentSlider.left = e.pageX - offset.left;
-        this.currentSlider.top = e.pageY - offset.top;
-        this.mousePointer = {
-          left: e.pageX,
-          top: e.pageY
-        };
-        //trigger mousemove to move the guide to the current position
-        $(document).on({
-          'mousemove.colorpicker': $.proxy(this.mousemove, this),
-          'touchmove.colorpicker': $.proxy(this.mousemove, this),
-          'mouseup.colorpicker': $.proxy(this.mouseup, this),
-          'touchend.colorpicker': $.proxy(this.mouseup, this)
-        }).trigger('mousemove');
-      }
-      return false;
-    },
-    mousemove: function(e) {
-      if (!e.pageX && !e.pageY && e.originalEvent && e.originalEvent.touches) {
-        e.pageX = e.originalEvent.touches[0].pageX;
-        e.pageY = e.originalEvent.touches[0].pageY;
-      }
-      e.stopPropagation();
-      e.preventDefault();
-      var left = Math.max(
-        0,
-        Math.min(
-          this.currentSlider.maxLeft,
-          this.currentSlider.left + ((e.pageX || this.mousePointer.left) - this.mousePointer.left)
-        )
-      );
-      var top = Math.max(
-        0,
-        Math.min(
-          this.currentSlider.maxTop,
-          this.currentSlider.top + ((e.pageY || this.mousePointer.top) - this.mousePointer.top)
-        )
-      );
-      this.currentSlider.guide.left = left + 'px';
-      this.currentSlider.guide.top = top + 'px';
-      if (this.currentSlider.callLeft) {
-        this.color[this.currentSlider.callLeft].call(this.color, left / this.currentSlider.maxLeft);
-      }
-      if (this.currentSlider.callTop) {
-        this.color[this.currentSlider.callTop].call(this.color, top / this.currentSlider.maxTop);
-      }
-      // Change format dynamically
-      // Only occurs if user choose the dynamic format by
-      // setting option format to false
-      if (this.currentSlider.callTop === 'setAlpha' && this.options.format === false) {
-
-        // Converting from hex / rgb to rgba
-        if (this.color.value.a !== 1) {
-          this.format = 'rgba';
-          this.color.origFormat = 'rgba';
-        }
-
-        // Converting from rgba to hex
-        else {
-          this.format = 'hex';
-          this.color.origFormat = 'hex';
-        }
-      }
-      this.update(true);
-
-      this.element.trigger({
-        type: 'changeColor',
-        color: this.color
-      });
-      return false;
-    },
-    mouseup: function(e) {
-      e.stopPropagation();
-      e.preventDefault();
-      $(document).off({
-        'mousemove.colorpicker': this.mousemove,
-        'touchmove.colorpicker': this.mousemove,
-        'mouseup.colorpicker': this.mouseup,
-        'touchend.colorpicker': this.mouseup
-      });
-      return false;
-    },
-    change: function(e) {
-      this.keyup(e);
-    },
-    keyup: function(e) {
-      if ((e.keyCode === 38)) {
-        if (this.color.value.a < 1) {
-          this.color.value.a = Math.round((this.color.value.a + 0.01) * 100) / 100;
-        }
-        this.update(true);
-      } else if ((e.keyCode === 40)) {
-        if (this.color.value.a > 0) {
-          this.color.value.a = Math.round((this.color.value.a - 0.01) * 100) / 100;
-        }
-        this.update(true);
-      } else {
-        this.color = new Color(this.input.val(), this.options.colorSelectors);
-        // Change format dynamically
-        // Only occurs if user choose the dynamic format by
-        // setting option format to false
-        if (this.color.origFormat && this.options.format === false) {
-          this.format = this.color.origFormat;
-        }
-        if (this.getValue(false) !== false) {
-          this.updateData();
-          this.updateComponent();
-          this.updatePicker();
-        }
-      }
-      this.element.trigger({
-        type: 'changeColor',
-        color: this.color,
-        value: this.input.val()
-      });
-    }
-  };
-
-  $.colorpicker = Colorpicker;
-
-  $.fn.colorpicker = function(option) {
-    var apiArgs = Array.prototype.slice.call(arguments, 1),
-      isSingleElement = (this.length === 1),
-      returnValue = null;
-
-    var $jq = this.each(function() {
-      var $this = $(this),
-        inst = $this.data('colorpicker'),
-        options = ((typeof option === 'object') ? option : {});
-
-      if (!inst) {
-        inst = new Colorpicker(this, options);
-        $this.data('colorpicker', inst);
-      }
-
-      if (typeof option === 'string') {
-        if ($.isFunction(inst[option])) {
-          returnValue = inst[option].apply(inst, apiArgs);
-        } else { // its a property ?
-          if (apiArgs.length) {
-            // set property
-            inst[option] = apiArgs[0];
-          }
-          returnValue = inst[option];
-        }
-      } else {
-        returnValue = $this;
-      }
-    });
-    return isSingleElement ? returnValue : $jq;
-  };
-
-  $.fn.colorpicker.constructor = Colorpicker;
-
-}));

+ 0 - 583
src/js/lib/bootstrap-switch.js

@@ -1,583 +0,0 @@
-/** @license
-========================================================================
-  bootstrap-switch - v3.1.0
-  http://www.bootstrap-switch.org
-  Copyright 2012-2013 Mattia Larentis
- 
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
- 
-      http://www.apache.org/licenses/LICENSE-2.0
- 
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-*/
-
-(function() {
-  var __slice = [].slice;
-
-  (function($, window) {
-    "use strict";
-    var BootstrapSwitch;
-    BootstrapSwitch = (function() {
-      function BootstrapSwitch(element, options) {
-        if (options == null) {
-          options = {};
-        }
-        this.$element = $(element);
-        this.options = $.extend({}, $.fn.bootstrapSwitch.defaults, {
-          state: this.$element.is(":checked"),
-          size: this.$element.data("size"),
-          animate: this.$element.data("animate"),
-          disabled: this.$element.is(":disabled"),
-          readonly: this.$element.is("[readonly]"),
-          indeterminate: this.$element.data("indeterminate"),
-          inverse: this.$element.data("inverse"),
-          radioAllOff: this.$element.data("radio-all-off"),
-          onColor: this.$element.data("on-color"),
-          offColor: this.$element.data("off-color"),
-          onText: this.$element.data("on-text"),
-          offText: this.$element.data("off-text"),
-          labelText: this.$element.data("label-text"),
-          baseClass: this.$element.data("base-class"),
-          wrapperClass: this.$element.data("wrapper-class")
-        }, options);
-        this.$wrapper = $("<div>", {
-          "class": (function(_this) {
-            return function() {
-              var classes;
-              classes = ["" + _this.options.baseClass].concat(_this._getClasses(_this.options.wrapperClass));
-              classes.push(_this.options.state ? "" + _this.options.baseClass + "-on" : "" + _this.options.baseClass + "-off");
-              if (_this.options.size != null) {
-                classes.push("" + _this.options.baseClass + "-" + _this.options.size);
-              }
-              if (_this.options.animate) {
-                classes.push("" + _this.options.baseClass + "-animate");
-              }
-              if (_this.options.disabled) {
-                classes.push("" + _this.options.baseClass + "-disabled");
-              }
-              if (_this.options.readonly) {
-                classes.push("" + _this.options.baseClass + "-readonly");
-              }
-              if (_this.options.indeterminate) {
-                classes.push("" + _this.options.baseClass + "-indeterminate");
-              }
-              if (_this.options.inverse) {
-                classes.push("" + _this.options.baseClass + "-inverse");
-              }
-              if (_this.$element.attr("id")) {
-                classes.push("" + _this.options.baseClass + "-id-" + (_this.$element.attr("id")));
-              }
-              return classes.join(" ");
-            };
-          })(this)()
-        });
-        this.$container = $("<div>", {
-          "class": "" + this.options.baseClass + "-container"
-        });
-        this.$on = $("<span>", {
-          html: this.options.onText,
-          "class": "" + this.options.baseClass + "-handle-on " + this.options.baseClass + "-" + this.options.onColor
-        });
-        this.$off = $("<span>", {
-          html: this.options.offText,
-          "class": "" + this.options.baseClass + "-handle-off " + this.options.baseClass + "-" + this.options.offColor
-        });
-        this.$label = $("<label>", {
-          html: this.options.labelText,
-          "class": "" + this.options.baseClass + "-label"
-        });
-        if (this.options.indeterminate) {
-          this.$element.prop("indeterminate", true);
-        }
-        this.$element.on("init.bootstrapSwitch", (function(_this) {
-          return function() {
-            return _this.options.onInit.apply(element, arguments);
-          };
-        })(this));
-        this.$element.on("switchChange.bootstrapSwitch", (function(_this) {
-          return function() {
-            return _this.options.onSwitchChange.apply(element, arguments);
-          };
-        })(this));
-        this.$container = this.$element.wrap(this.$container).parent();
-        this.$wrapper = this.$container.wrap(this.$wrapper).parent();
-        this.$element.before(this.options.inverse ? this.$off : this.$on).before(this.$label).before(this.options.inverse ? this.$on : this.$off).trigger("init.bootstrapSwitch");
-        this._elementHandlers();
-        this._handleHandlers();
-        this._labelHandlers();
-        this._formHandler();
-      }
-
-      BootstrapSwitch.prototype._constructor = BootstrapSwitch;
-
-      BootstrapSwitch.prototype.state = function(value, skip) {
-        if (typeof value === "undefined") {
-          return this.options.state;
-        }
-        if (this.options.disabled || this.options.readonly) {
-          return this.$element;
-        }
-        if (this.options.state && !this.options.radioAllOff && this.$element.is(':radio')) {
-          return this.$element;
-        }
-        if (this.options.indeterminate) {
-          this.indeterminate(false);
-          value = true;
-        } else {
-          value = !!value;
-        }
-        this.$element.prop("checked", value).trigger("change.bootstrapSwitch", skip);
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.toggleState = function(skip) {
-        if (this.options.disabled || this.options.readonly) {
-          return this.$element;
-        }
-        if (this.options.indeterminate) {
-          this.indeterminate(false);
-          return this.state(true);
-        } else {
-          return this.$element.prop("checked", !this.options.state).trigger("change.bootstrapSwitch", skip);
-        }
-      };
-
-      BootstrapSwitch.prototype.size = function(value) {
-        if (typeof value === "undefined") {
-          return this.options.size;
-        }
-        if (this.options.size != null) {
-          this.$wrapper.removeClass("" + this.options.baseClass + "-" + this.options.size);
-        }
-        if (value) {
-          this.$wrapper.addClass("" + this.options.baseClass + "-" + value);
-        }
-        this.options.size = value;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.animate = function(value) {
-        if (typeof value === "undefined") {
-          return this.options.animate;
-        }
-        value = !!value;
-        this.$wrapper[value ? "addClass" : "removeClass"]("" + this.options.baseClass + "-animate");
-        this.options.animate = value;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.toggleAnimate = function() {
-        this.$wrapper.toggleClass("" + this.options.baseClass + "-animate");
-        this.options.animate = !this.options.animate;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.disabled = function(value) {
-        if (typeof value === "undefined") {
-          return this.options.disabled;
-        }
-        value = !!value;
-        this.$wrapper[value ? "addClass" : "removeClass"]("" + this.options.baseClass + "-disabled");
-        this.$element.prop("disabled", value);
-        this.options.disabled = value;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.toggleDisabled = function() {
-        this.$element.prop("disabled", !this.options.disabled);
-        this.$wrapper.toggleClass("" + this.options.baseClass + "-disabled");
-        this.options.disabled = !this.options.disabled;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.readonly = function(value) {
-        if (typeof value === "undefined") {
-          return this.options.readonly;
-        }
-        value = !!value;
-        this.$wrapper[value ? "addClass" : "removeClass"]("" + this.options.baseClass + "-readonly");
-        this.$element.prop("readonly", value);
-        this.options.readonly = value;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.toggleReadonly = function() {
-        this.$element.prop("readonly", !this.options.readonly);
-        this.$wrapper.toggleClass("" + this.options.baseClass + "-readonly");
-        this.options.readonly = !this.options.readonly;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.indeterminate = function(value) {
-        if (typeof value === "undefined") {
-          return this.options.indeterminate;
-        }
-        value = !!value;
-        this.$wrapper[value ? "addClass" : "removeClass"]("" + this.options.baseClass + "-indeterminate");
-        this.$element.prop("indeterminate", value);
-        this.options.indeterminate = value;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.toggleIndeterminate = function() {
-        this.$element.prop("indeterminate", !this.options.indeterminate);
-        this.$wrapper.toggleClass("" + this.options.baseClass + "-indeterminate");
-        this.options.indeterminate = !this.options.indeterminate;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.inverse = function(value) {
-        var $off, $on;
-        if (typeof value === "undefined") {
-          return this.options.inverse;
-        }
-        value = !!value;
-        this.$wrapper[value ? "addClass" : "removeClass"]("" + this.options.baseClass + "-inverse");
-        $on = this.$on.clone(true);
-        $off = this.$off.clone(true);
-        this.$on.replaceWith($off);
-        this.$off.replaceWith($on);
-        this.$on = $off;
-        this.$off = $on;
-        this.options.inverse = value;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.toggleInverse = function() {
-        var $off, $on;
-        this.$wrapper.toggleClass("" + this.options.baseClass + "-inverse");
-        $on = this.$on.clone(true);
-        $off = this.$off.clone(true);
-        this.$on.replaceWith($off);
-        this.$off.replaceWith($on);
-        this.$on = $off;
-        this.$off = $on;
-        this.options.inverse = !this.options.inverse;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.onColor = function(value) {
-        var color;
-        color = this.options.onColor;
-        if (typeof value === "undefined") {
-          return color;
-        }
-        if (color != null) {
-          this.$on.removeClass("" + this.options.baseClass + "-" + color);
-        }
-        this.$on.addClass("" + this.options.baseClass + "-" + value);
-        this.options.onColor = value;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.offColor = function(value) {
-        var color;
-        color = this.options.offColor;
-        if (typeof value === "undefined") {
-          return color;
-        }
-        if (color != null) {
-          this.$off.removeClass("" + this.options.baseClass + "-" + color);
-        }
-        this.$off.addClass("" + this.options.baseClass + "-" + value);
-        this.options.offColor = value;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.onText = function(value) {
-        if (typeof value === "undefined") {
-          return this.options.onText;
-        }
-        this.$on.html(value);
-        this.options.onText = value;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.offText = function(value) {
-        if (typeof value === "undefined") {
-          return this.options.offText;
-        }
-        this.$off.html(value);
-        this.options.offText = value;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.labelText = function(value) {
-        if (typeof value === "undefined") {
-          return this.options.labelText;
-        }
-        this.$label.html(value);
-        this.options.labelText = value;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.baseClass = function(value) {
-        return this.options.baseClass;
-      };
-
-      BootstrapSwitch.prototype.wrapperClass = function(value) {
-        if (typeof value === "undefined") {
-          return this.options.wrapperClass;
-        }
-        if (!value) {
-          value = $.fn.bootstrapSwitch.defaults.wrapperClass;
-        }
-        this.$wrapper.removeClass(this._getClasses(this.options.wrapperClass).join(" "));
-        this.$wrapper.addClass(this._getClasses(value).join(" "));
-        this.options.wrapperClass = value;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.radioAllOff = function(value) {
-        if (typeof value === "undefined") {
-          return this.options.radioAllOff;
-        }
-        this.options.radioAllOff = value;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.onInit = function(value) {
-        if (typeof value === "undefined") {
-          return this.options.onInit;
-        }
-        if (!value) {
-          value = $.fn.bootstrapSwitch.defaults.onInit;
-        }
-        this.options.onInit = value;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.onSwitchChange = function(value) {
-        if (typeof value === "undefined") {
-          return this.options.onSwitchChange;
-        }
-        if (!value) {
-          value = $.fn.bootstrapSwitch.defaults.onSwitchChange;
-        }
-        this.options.onSwitchChange = value;
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype.destroy = function() {
-        var $form;
-        $form = this.$element.closest("form");
-        if ($form.length) {
-          $form.off("reset.bootstrapSwitch").removeData("bootstrap-switch");
-        }
-        this.$container.children().not(this.$element).remove();
-        this.$element.unwrap().unwrap().off(".bootstrapSwitch").removeData("bootstrap-switch");
-        return this.$element;
-      };
-
-      BootstrapSwitch.prototype._elementHandlers = function() {
-        return this.$element.on({
-          "change.bootstrapSwitch": (function(_this) {
-            return function(e, skip) {
-              var checked;
-              e.preventDefault();
-              e.stopImmediatePropagation();
-              checked = _this.$element.is(":checked");
-              if (checked === _this.options.state) {
-                return;
-              }
-              _this.options.state = checked;
-              _this.$wrapper.removeClass(checked ? "" + _this.options.baseClass + "-off" : "" + _this.options.baseClass + "-on").addClass(checked ? "" + _this.options.baseClass + "-on" : "" + _this.options.baseClass + "-off");
-              if (!skip) {
-                if (_this.$element.is(":radio")) {
-                  $("[name='" + (_this.$element.attr('name')) + "']").not(_this.$element).prop("checked", false).trigger("change.bootstrapSwitch", true);
-                }
-                return _this.$element.trigger("switchChange.bootstrapSwitch", [checked]);
-              }
-            };
-          })(this),
-          "focus.bootstrapSwitch": (function(_this) {
-            return function(e) {
-              e.preventDefault();
-              return _this.$wrapper.addClass("" + _this.options.baseClass + "-focused");
-            };
-          })(this),
-          "blur.bootstrapSwitch": (function(_this) {
-            return function(e) {
-              e.preventDefault();
-              return _this.$wrapper.removeClass("" + _this.options.baseClass + "-focused");
-            };
-          })(this),
-          "keydown.bootstrapSwitch": (function(_this) {
-            return function(e) {
-              if (!e.which || _this.options.disabled || _this.options.readonly) {
-                return;
-              }
-              switch (e.which) {
-                case 37:
-                  e.preventDefault();
-                  e.stopImmediatePropagation();
-                  return _this.state(false);
-                case 39:
-                  e.preventDefault();
-                  e.stopImmediatePropagation();
-                  return _this.state(true);
-              }
-            };
-          })(this)
-        });
-      };
-
-      BootstrapSwitch.prototype._handleHandlers = function() {
-        this.$on.on("click.bootstrapSwitch", (function(_this) {
-          return function(e) {
-            _this.state(false);
-            return _this.$element.trigger("focus.bootstrapSwitch");
-          };
-        })(this));
-        return this.$off.on("click.bootstrapSwitch", (function(_this) {
-          return function(e) {
-            _this.state(true);
-            return _this.$element.trigger("focus.bootstrapSwitch");
-          };
-        })(this));
-      };
-
-      BootstrapSwitch.prototype._labelHandlers = function() {
-        return this.$label.on({
-          "mousemove.bootstrapSwitch touchmove.bootstrapSwitch": (function(_this) {
-            return function(e) {
-              var left, pageX, percent, right;
-              if (!_this.isLabelDragging) {
-                return;
-              }
-              e.preventDefault();
-              _this.isLabelDragged = true;
-              pageX = e.pageX || e.originalEvent.touches[0].pageX;
-              percent = ((pageX - _this.$wrapper.offset().left) / _this.$wrapper.width()) * 100;
-              left = 25;
-              right = 75;
-              if (_this.options.animate) {
-                _this.$wrapper.removeClass("" + _this.options.baseClass + "-animate");
-              }
-              if (percent < left) {
-                percent = left;
-              } else if (percent > right) {
-                percent = right;
-              }
-              _this.$container.css("margin-left", "" + (percent - right) + "%");
-              return _this.$element.trigger("focus.bootstrapSwitch");
-            };
-          })(this),
-          "mousedown.bootstrapSwitch touchstart.bootstrapSwitch": (function(_this) {
-            return function(e) {
-              if (_this.isLabelDragging || _this.options.disabled || _this.options.readonly) {
-                return;
-              }
-              e.preventDefault();
-              _this.isLabelDragging = true;
-              return _this.$element.trigger("focus.bootstrapSwitch");
-            };
-          })(this),
-          "mouseup.bootstrapSwitch touchend.bootstrapSwitch": (function(_this) {
-            return function(e) {
-              var state;
-              if (!_this.isLabelDragging) {
-                return;
-              }
-              e.preventDefault();
-              if (_this.isLabelDragged) {
-                state = parseInt(_this.$container.css("margin-left"), 10) > -(_this.$container.width() / 6);
-                _this.isLabelDragged = false;
-                _this.state(_this.options.inverse ? !state : state);
-                if (_this.options.animate) {
-                  _this.$wrapper.addClass("" + _this.options.baseClass + "-animate");
-                }
-                _this.$container.css("margin-left", "");
-              } else {
-                _this.state(!_this.options.state);
-              }
-              return _this.isLabelDragging = false;
-            };
-          })(this),
-          "mouseleave.bootstrapSwitch": (function(_this) {
-            return function(e) {
-              return _this.$label.trigger("mouseup.bootstrapSwitch");
-            };
-          })(this)
-        });
-      };
-
-      BootstrapSwitch.prototype._formHandler = function() {
-        var $form;
-        $form = this.$element.closest("form");
-        if ($form.data("bootstrap-switch")) {
-          return;
-        }
-        return $form.on("reset.bootstrapSwitch", function() {
-          return window.setTimeout(function() {
-            return $form.find("input").filter(function() {
-              return $(this).data("bootstrap-switch");
-            }).each(function() {
-              return $(this).bootstrapSwitch("state", this.checked);
-            });
-          }, 1);
-        }).data("bootstrap-switch", true);
-      };
-
-      BootstrapSwitch.prototype._getClasses = function(classes) {
-        var c, cls, _i, _len;
-        if (!$.isArray(classes)) {
-          return ["" + this.options.baseClass + "-" + classes];
-        }
-        cls = [];
-        for (_i = 0, _len = classes.length; _i < _len; _i++) {
-          c = classes[_i];
-          cls.push("" + this.options.baseClass + "-" + c);
-        }
-        return cls;
-      };
-
-      return BootstrapSwitch;
-
-    })();
-    $.fn.bootstrapSwitch = function() {
-      var args, option, ret;
-      option = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
-      ret = this;
-      this.each(function() {
-        var $this, data;
-        $this = $(this);
-        data = $this.data("bootstrap-switch");
-        if (!data) {
-          $this.data("bootstrap-switch", data = new BootstrapSwitch(this, option));
-        }
-        if (typeof option === "string") {
-          return ret = data[option].apply(data, args);
-        }
-      });
-      return ret;
-    };
-    $.fn.bootstrapSwitch.Constructor = BootstrapSwitch;
-    return $.fn.bootstrapSwitch.defaults = {
-      state: true,
-      size: null,
-      animate: true,
-      disabled: false,
-      readonly: false,
-      indeterminate: false,
-      inverse: false,
-      radioAllOff: false,
-      onColor: "primary",
-      offColor: "default",
-      onText: "ON",
-      offText: "OFF",
-      labelText: "&nbsp;",
-      baseClass: "bootstrap-switch",
-      wrapperClass: "wrapper",
-      onInit: function() {},
-      onSwitchChange: function() {}
-    };
-  })(window.jQuery, window);
-
-}).call(this);

+ 0 - 768
src/js/lib/cryptoapi/crypto-api.js

@@ -1,768 +0,0 @@
-/** @license
-========================================================================
-  Crypto API for JavaScript - https://github.com/nf404/crypto-api
-  
-  The MIT License (MIT)
-
-  Copyright (c) 2015 nf404
-
-  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 above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-  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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-/*global module, require */
-(/**
- * @param {Object} root
- * @returns {CryptoApi}
- */
-    function (root) {
-    'use strict';
-    /**
-     * @class CryptoApi
-     * @classdesc Main class
-     * @public
-     */
-    var CryptoApi = function cryptoApi () {
-        /**
-         * @property Hashers
-         * @type {Hashers}
-         */
-        this.Hashers = new Hashers();
-        /**
-         * @property Encodes
-         * @type {Encodes}
-         */
-        this.Encodes = new Encodes();
-        /**
-         * @property Macs
-         * @type {Macs}
-         */
-        this.Macs = new Macs();
-        /**
-         * @property Tools
-         * @type {Tools}
-         */
-        this.Tools = new Tools();
-    };
-
-    /**
-     * @interface HasherInterface
-     * @classdesc All hashers MUST implement this interface
-     * @public
-     */
-    var HasherInterface = function () {};
-    /**
-     * @memberOf HasherInterface
-     * @constructor
-     */
-    HasherInterface.prototype.constructor = function constructor() {};
-    /**
-     * @desc Process ready block
-     * @memberOf HasherInterface
-     * @method processBlock
-     * @param {number[]} block
-     */
-    HasherInterface.prototype.processBlock = function processBlock(block) {};
-    /**
-     * Update message
-     * @memberOf HasherInterface
-     * @method update
-     * @param {string} message
-     */
-    HasherInterface.prototype.update = function update(message) {};
-    /**
-     * @desc Process last block and return hash
-     * @memberOf HasherInterface
-     * @method finalize
-     * @return {HashArray} hash
-     */
-    HasherInterface.prototype.finalize = function finalize() {};
-
-    /**
-     * @class BaseHasher
-     * @param {string} name
-     * @param {Object} options
-     * @public
-     */
-    var BaseHasher = function(name, options) {};
-    BaseHasher.prototype.constructor = function (name, options) {
-        /**
-         * @desc Hasher name
-         * @property name
-         * @type {string}
-         */
-        this.name = name;
-        /**
-         * @desc All algorithm variables that changed during process
-         * @property state
-         * @type {Object}
-         */
-        this.state = {};
-        /**
-         * @desc Unprocessed Message
-         * @memberof! BaseHasher#
-         * @alias state.message
-         * @type {number[]}
-         */
-        this.state.message = [];
-        /**
-         * @desc Length of message
-         * @memberof! BaseHasher#
-         * @alias state.length
-         * @type {number}
-         */
-        this.state.length = 0;
-        /**
-         * @memberof! BaseHasher#
-         * @alias state.options
-         * @type {Object}
-         */
-        this.state.options = options;
-        this.blockUnits = [];
-    };
-
-    /**
-     *  Size of unit in bytes (4 = 32 bits)
-     * @memberOf BaseHasher
-     * @member {number} unitSize
-     * @static
-     */
-    BaseHasher.prototype.unitSize = 4;
-    /**
-     * Bytes order in unit
-     *   0 - normal
-     *   1 - reverse
-     * @memberOf BaseHasher
-     * @member {number} unitOrder
-     * @static
-     */
-    BaseHasher.prototype.unitOrder = 0;
-    /**
-     * Size of block in units
-     * @memberOf BaseHasher
-     * @member {number} blockSize
-     * @static
-     */
-    BaseHasher.prototype.blockSize = 16;
-    /**
-     * Return current state
-     * @memberOf BaseHasher
-     * @method getState
-     * @returns {Object}
-     */
-    BaseHasher.prototype.getState = function getState() {
-        return JSON.parse(JSON.stringify(this.state));
-    };
-    /**
-     * Set state
-     * @memberOf BaseHasher
-     * @method setState
-     * @param {Object} state
-     * @return {HasherInterface}
-     */
-    BaseHasher.prototype.setState = function setState(state) {
-        this.state = state;
-        return this;
-    };
-
-    /**
-     * Update message
-     * @memberOf BaseHasher
-     * @method update
-     * @param {string} message
-     */
-    BaseHasher.prototype.update = function update(message) {
-      var l = 0;
-      for (var i = 0, msgLen = message.length; i < msgLen; i++) {
-        var charcode = message.charCodeAt(i);
-        if (charcode < 0x80) {
-          this.state.message.push(charcode);
-          l += 1;
-        }
-        else if (charcode < 0x800) {
-          this.state.message.push(0xc0 | (charcode >> 6),
-            0x80 | (charcode & 0x3f));
-          l += 2;
-        }
-        else if (charcode < 0xd800 || charcode >= 0xe000) {
-          this.state.message.push(0xe0 | (charcode >> 12),
-            0x80 | ((charcode >> 6) & 0x3f),
-            0x80 | (charcode & 0x3f));
-          l += 3;
-        }
-        // surrogate pair
-        else {
-          i++;
-          // UTF-16 encodes 0x10000-0x10FFFF by
-          // subtracting 0x10000 and splitting the
-          // 20 bits of 0x0-0xFFFFF into two halves
-          charcode = 0x10000 + (((charcode & 0x3ff) << 10)
-            | (message.charCodeAt(i) & 0x3ff));
-          this.state.message.push(0xf0 | (charcode >> 18),
-            0x80 | ((charcode >> 12) & 0x3f),
-            0x80 | ((charcode >> 6) & 0x3f),
-            0x80 | (charcode & 0x3f));
-          l += 4;
-        }
-      }
-      this.state.length += l;
-
-      this.process();
-    };
-
-    /**
-     * Update message from array
-     * @memberOf BaseHasher
-     * @method updateFromArray
-     * @param {number[]} message
-     * @return {BaseHasher}
-     */
-    BaseHasher.prototype.updateFromArray = function updateFromArray(message) {
-      this.state.length += message.length;
-      this.state.message = this.state.message.concat(message);
-      this.process();
-      return this;
-    };
-
-    /**
-     * Process ready blocks
-     * @memberOf BaseHasher
-     * @method process
-     */
-    BaseHasher.prototype.process = function process() {
-      while (this.state.message.length >= this.blockSize * this.unitSize) {
-        var j = 0, b = 0, block = this.state.message.splice(0, this.blockSize * this.unitSize);
-        if (this.unitSize > 1) {
-          this.blockUnits = [];
-          for (var i = 0, u = 0; i < block.length; i += this.unitSize, u++) {
-            if (this.unitOrder === 1) {
-              for (j = this.unitSize - 1, b = 0; j >= 0; j--, b += 8) {
-                this.blockUnits[u] |= (block[i + j] << b);
-              }
-            } else {
-              for (j = 0, b = 0; j < this.unitSize; j++, b += 8) {
-                this.blockUnits[u] |= (block[i + j] << b);
-              }
-            }
-          }
-          this.processBlock(this.blockUnits);
-        } else {
-          this.processBlock(block);
-        }
-      }
-    };
-    /**
-     * @memberOf CryptoApi
-     * @member {BaseHasher} BaseHasher
-     */
-    CryptoApi.prototype.BaseHasher = BaseHasher;
-
-    /**
-     * @class Hasher8
-     * @desc Hasher for 32 bit little endian blocks
-     * @extends BaseHasher
-     * @param {string} name
-     * @param {Object} options
-     * @public
-     */
-    var Hasher8 = function (name, options) {
-      this.constructor(name, options);
-    };
-    Hasher8.prototype = Object.create(BaseHasher.prototype);
-
-    /**
-     * @desc Normal order of bytes
-     * @memberOf Hasher8#
-     * @member {number} unitOrder
-     */
-    Hasher8.prototype.unitOrder = 0;
-    /**
-     * @desc Size of unit = 1 byte
-     * @memberOf Hasher8#
-     * @member {number} unitSize
-     */
-    Hasher8.prototype.unitSize = 1;
-
-    /**
-     * @memberOf Hasher8
-     * @constructor
-     * @param {string} name
-     * @param {Object} options
-     */
-    Hasher8.prototype.constructor = function (name, options) {
-      BaseHasher.prototype.constructor.call(this, name, options);
-    };
-    /**
-     * Process ready blocks
-     * @memberOf Hasher8
-     * @method process
-     */
-    Hasher8.prototype.process = function process() {
-      while (this.state.message.length >= this.blockSize * this.unitSize) {
-        var block = this.state.message.splice(0, this.blockSize * this.unitSize);
-        this.blockUnits = [];
-        for (var i = 0; i < this.blockSize; i++) {
-          this.blockUnits[i] = (block[i]);
-        }
-        this.processBlock(this.blockUnits);
-      }
-    };
-
-    /**
-     * @memberOf CryptoApi
-     * @member {Hasher8} Hasher8
-     */
-    CryptoApi.prototype.Hasher8 = Hasher8;
-
-  /**
-     * @class Hasher32le
-     * @desc Hasher for 32 bit little endian blocks
-     * @extends BaseHasher
-     * @param {string} name
-     * @param {Object} options
-     * @public
-     */
-    var Hasher32le = function (name, options) {
-      this.constructor(name, options);
-    };
-    Hasher32le.prototype = Object.create(BaseHasher.prototype);
-
-    Hasher32le.prototype.unitOrder = 0; // Normal order of bytes
-
-    /**
-     * @memberOf Hasher32le
-     * @constructor
-     * @param {string} name
-     * @param {Object} options
-     */
-    Hasher32le.prototype.constructor = function (name, options) {
-      BaseHasher.prototype.constructor.call(this, name, options);
-    };
-    /**
-     * Process ready blocks
-     * @memberOf Hasher32le
-     * @method process
-     */
-    Hasher32le.prototype.process = function process() {
-      while (this.state.message.length >= this.blockSize * this.unitSize) {
-        var block = this.state.message.splice(0, this.blockSize * this.unitSize);
-        this.blockUnits = [];
-        for (var i = 0, b = 0; i < this.blockSize; i++, b+=4) {
-          this.blockUnits[i] = (block[b]);
-          this.blockUnits[i] |= (block[b + 1] << 8);
-          this.blockUnits[i] |= (block[b + 2] << 16);
-          this.blockUnits[i] |= (block[b + 3] << 24);
-        }
-        this.processBlock(this.blockUnits);
-      }
-    };
-
-    /**
-     * @memberOf CryptoApi
-     * @member {Hasher32le} Hasher32
-     */
-    CryptoApi.prototype.Hasher32le = Hasher32le;
-
-    /**
-     * @class Hasher32be
-     * @desc Hasher for 32 bit big endian blocks
-     * @extends BaseHasher
-     * @param {string} name
-     * @param {Object} options
-     * @public
-     */
-    var Hasher32be = function (name, options) {
-      this.constructor(name, options);
-    };
-    Hasher32be.prototype = Object.create(BaseHasher.prototype);
-
-    Hasher32be.prototype.unitOrder = 1; // Reverse order of bytes
-
-    /**
-     * @memberOf Hasher32be
-     * @constructor
-     * @param {string} name
-     * @param {Object} options
-     */
-    Hasher32be.prototype.constructor = function (name, options) {
-        BaseHasher.prototype.constructor.call(this, name, options);
-    };
-    /**
-     * Process ready blocks
-     * @memberOf Hasher32be
-     * @method process
-     */
-    Hasher32be.prototype.process = function process() {
-      while (this.state.message.length >= this.blockSize * this.unitSize) {
-        var block = this.state.message.splice(0, this.blockSize * this.unitSize);
-        this.blockUnits = [];
-        for (var i = 0, b = 0; i < this.blockSize; i++, b+=4) {
-          this.blockUnits[i] = (block[b] << 24);
-          this.blockUnits[i] |= (block[b + 1] << 16);
-          this.blockUnits[i] |= (block[b + 2] << 8);
-          this.blockUnits[i] |= (block[b + 3]);
-        }
-        this.processBlock(this.blockUnits);
-      }
-    };
-
-    /**
-     * @memberOf CryptoApi
-     * @member {Hasher32be} Hasher32be
-     */
-    CryptoApi.prototype.Hasher32be = Hasher32be;
-
-    /**
-     * @interface MacInterface
-     * @classdesc All coders MUST implement this interface
-     * @public
-     */
-    var MacInterface = function () {};
-    /**
-     * @memberOf MacInterface
-     * @param {string|number[]} key
-     * @param {string} hasher
-     * @param {Object} options
-     * @constructor
-     */
-    MacInterface.prototype.constructor = function constructor(key, hasher, options) {};
-    /**
-     * @desc Process ready block
-     * @memberOf MacInterface
-     * @method processBlock
-     * @param {number[]} block
-     */
-    MacInterface.prototype.processBlock = function processBlock(block) {};
-    /**
-     * Update message
-     * @memberOf MacInterface
-     * @method update
-     * @param {string|number[]} message
-     * @return {MacInterface}
-     */
-    MacInterface.prototype.update = function update(message) {};
-    /**
-     * @desc Process last block and return hash
-     * @memberOf MacInterface
-     * @method finalize
-     * @return {HashArray} hash
-     */
-    MacInterface.prototype.finalize = function finalize() {};
-
-    /**
-     * @class BaseMac
-     * @extends BaseHasher
-     * @param {string|number[]} key
-     * @param {string} hasher
-     * @param {Object} options
-     * @public
-     */
-    var BaseMac = function(key, hasher, options) {};
-    BaseMac.prototype = Object.create(BaseHasher.prototype);
-    BaseMac.prototype.constructor = function (key, hasher, options) {
-        BaseHasher.prototype.constructor.call(this, hasher, options);
-    };
-    /**
-     * @memberOf CryptoApi
-     * @member {BaseMac} BaseMac
-     */
-    CryptoApi.prototype.BaseMac = BaseMac;
-    /**
-     * @interface EncodeInterface
-     * @classdesc All encodes MUST implement this interface
-     * @public
-     */
-    var EncodeInterface = function () {};
-    /**
-     * @memberOf EncodeInterface
-     * @constructor
-     * @param {HashArray} hash
-     */
-    EncodeInterface.prototype.constructor = function constructor(hash) {};
-    /**
-     * @desc Stringify hash
-     * @memberOf EncodeInterface
-     * @method stringify
-     * @returns {string}
-     */
-    EncodeInterface.prototype.stringify = function encode() {};
-
-
-    /**
-     * @class BaseEncode
-     * @desc Encode HashArray
-     * @param {HashArray} hash
-     * @public
-     */
-    var BaseEncode = function (hash) {};
-    /**
-     * @memberOf BaseEncode
-     * @constructor
-     * @param {HashArray} hash
-     */
-    BaseEncode.prototype.constructor = function constructor(hash) {
-        /**
-         * @property hash
-         * @type {HashArray}
-         */
-        this.hash = hash;
-    };
-    /**
-     * @memberOf CryptoApi
-     * @member {BaseEncode} BaseEncode
-     */
-    CryptoApi.prototype.BaseEncode = BaseEncode;
-
-    /**
-     * @class Hashers
-     * @classdesc Collection of hashers
-     */
-    var Hashers = function hashers() {
-        /**
-         * @property hashers
-         * @type {Object}
-         */
-        this.hashers = {};
-    };
-    /**
-     * @memberOf Hashers
-     * @method add
-     * @param {string} name
-     * @param {HasherInterface} hasher
-     */
-    Hashers.prototype.add = function add(name, hasher) {
-        if (hasher === undefined) {
-            throw Error('Error adding hasher: ' + name);
-        }
-        this.hashers[name] = hasher;
-    };
-    /**
-     * @memberOf Hashers
-     * @method add
-     * @param {string} name
-     * @param {Object} options
-     * @returns {HasherInterface}
-     */
-    Hashers.prototype.get = function get(name, options) {
-        var Hasher = this.hashers[name];
-        if ((Hasher === undefined) && (typeof require !== 'undefined')) {
-            var filename = name;
-            if (filename === 'sha224') {
-                filename = 'sha256';
-            }
-            require('./hasher.' + filename);
-            Hasher = this.hashers[name];
-        }
-        if (Hasher === undefined) {
-            throw Error('No hash algorithm: ' + name);
-        }
-        return new Hasher(name, options);
-    };
-
-    /**
-     * @class Encodes
-     * @classdesc Collection of encodes
-     */
-    var Encodes = function encodes() {
-        /**
-         * @property encodes
-         * @type {Object}
-         */
-        this.encodes = {};
-    };
-    /**
-     * @memberOf Encodes
-     * @method add
-     * @param {string} name
-     * @param {BaseEncode} encode
-     */
-    Encodes.prototype.add = function add(name, encode) {
-        if (encode === undefined) {
-            throw Error('Error adding encode: ' + name);
-        }
-        this.encodes[name] = encode;
-    };
-    /**
-     * @memberOf Encodes
-     * @method get
-     * @param {string} name
-     * @param {HashArray} hash
-     * @returns {BaseEncode}
-     */
-    Encodes.prototype.get = function get(name, hash) {
-        var Encode = this.encodes[name];
-        if ((Encode === undefined) && (typeof require !== 'undefined')) {
-            require('./enc.' + name);
-            Encode = this.encodes[name];
-        }
-        if (Encode === undefined) {
-            throw Error('No encode type: ' + name);
-        }
-        return new Encode(hash);
-    };
-
-    /**
-     * @class Macs
-     * @classdesc Collection of macs
-     */
-    var Macs = function macs() {
-        /**
-         * @property macs
-         * @type {Object}
-         */
-        this.macs = {};
-    };
-    /**
-     * @memberOf Macs
-     * @method add
-     * @param {string} name
-     * @param {BaseMac} mac
-     */
-    Macs.prototype.add = function add(name, mac) {
-        if (mac === undefined) {
-            throw Error('Error adding mac: ' + name);
-        }
-        this.macs[name] = mac;
-    };
-    /**
-     * @memberOf Macs
-     * @method get
-     * @param {string} name
-     * @param {string|number[]} key
-     * @param {string} hasher
-     * @param {Object} options
-     * @returns {MacInterface}
-     */
-    Macs.prototype.get = function get(name, key, hasher, options) {
-        var Mac = this.macs[name];
-        if ((Mac === undefined) && (typeof require !== 'undefined')) {
-            require('./mac.' + name);
-            Mac = this.macs[name];
-        }
-        if (Mac === undefined) {
-            throw Error('No mac type: ' + name);
-        }
-        return new Mac(key, hasher, options);
-    };
-
-    /**
-     * @class Tools
-     * @classdesc Helper with some methods
-     */
-    var Tools = function tools() {};
-    /**
-     * Rotate x to n bits left
-     * @memberOf Tools
-     * @method rotateLeft
-     * @param {number} x
-     * @param {number} n
-     * @returns {number}
-     */
-    Tools.prototype.rotateLeft = function rotateLeft(x, n) {
-        return ((x << n) | (x >>> (32 - n))) | 0;
-    };
-    /**
-     * Rotate x to n bits right
-     * @memberOf Tools
-     * @method rotateLeft
-     * @param {number} x
-     * @param {number} n
-     * @returns {number}
-     */
-    Tools.prototype.rotateRight = function rotateLeft(x, n) {
-        return ((x >>> n) | (x << (32 - n))) | 0;
-    };
-    /**
-     * @class HashArray
-     * @classdesc Array of hash bytes
-     * @instanceof {Array}
-     * @param {number[]} hash
-     * @param {Encodes} Encodes
-     * @public
-     */
-    var HashArray = function (hash, Encodes) {
-        Array.prototype.push.apply(this, hash);
-        /**
-         * @property Encodes
-         * @type {Encodes}
-         */
-        this.Encodes = Encodes;
-    };
-    HashArray.prototype = Object.create(Array.prototype);
-    HashArray.prototype.constructor = HashArray;
-
-    /**
-     * Get hash as string
-     * @param {string} method
-     * @returns {string|*}
-     */
-    HashArray.prototype.stringify = function stringify(method) {
-        return this.Encodes.get(method, this).stringify();
-    };
-
-    /**
-     * Hash message with algo
-     *
-     * @memberof CryptoApi
-     * @method hash
-     * @public
-     * @param {string} algo
-     * @param {string} message
-     * @param {Object} options
-     * @return {HashArray} hash
-     */
-    CryptoApi.prototype.hash = function hash(algo, message, options) {
-      var hash = this.hasher(algo, options);
-      hash.update(message);
-        return hash.finalize();
-    };
-    /**
-     * Get new Hasher object
-     *
-     * @memberof CryptoApi
-     * @method hasher
-     * @public
-     * @param {string} algo
-     * @param {Object} options
-     * @returns {HasherInterface}
-     */
-    CryptoApi.prototype.hasher = function hasher(algo, options) {
-        return this.Hashers.get(algo, options);
-    };
-    /**
-     * Get new MAC object
-     *
-     * @memberof CryptoApi
-     * @method mac
-     * @public
-     * @param {string} algo
-     * @param {string|number[]} key
-     * @param {string} hasher
-     * @param {Object} options
-     * @returns {MacInterface}
-     */
-    CryptoApi.prototype.mac = function mac(algo, key, hasher, options) {
-        return this.Macs.get(algo, key, hasher, options);
-    };
-    /**
-     * Get new HashArray
-     *
-     * @memberof CryptoApi
-     * @method hashArray
-     * @public
-     * @param {number[]} hash
-     * @returns {HashArray}
-     */
-    CryptoApi.prototype.hashArray = function hashArray(hash) {
-        return new HashArray(hash, this.Encodes);
-    };
-    root.CryptoApi = new CryptoApi();
-    if (typeof module !== 'undefined' && module.exports) {
-        module.exports = root.CryptoApi;
-    } else {
-        return root.CryptoApi;
-    }
-})(this);

+ 0 - 113
src/js/lib/cryptoapi/hasher.md2.js

@@ -1,113 +0,0 @@
-/*global require */
-(/**
- * @param {CryptoApi} CryptoApi
- * @returns {Md2}
- */
-    function (CryptoApi) {
-    'use strict';
-
-    /**
-     * @class Md2
-     * @extends Hasher8
-     * @implements HasherInterface
-     * @desc Md2 hasher
-     */
-    var Md2 = function (name, options) {
-        this.constructor(name, options);
-    };
-    Md2.prototype = Object.create(CryptoApi.Hasher8.prototype);
-    /**
-     * @memberOf Md2
-     * @constructor
-     */
-    Md2.prototype.constructor = function (name, options) {
-        CryptoApi.Hasher8.prototype.constructor.call(this, name, options);
-        /**
-         * @desc Hash state
-         * @memberOf! Md2#
-         * @alias state.hash
-         * @type {number[]}
-         */
-        this.state.hash = new Array(48);
-        /**
-         * @desc Checksum
-         * @memberOf! Md2#
-         * @alias state.checksum
-         * @type {number[]}
-         */
-        this.state.checksum = new Array(16);
-    };
-
-    /**
-     * @desc Constants from Pi
-     * @link https://github.com/e-sushi/MD2-S-box-creator
-     * @memberOf Md2#
-     * @member {number[]} piSubst
-     */
-    Md2.prototype.piSubst = [
-        0x29, 0x2E, 0x43, 0xC9, 0xA2, 0xD8, 0x7C, 0x01, 0x3D, 0x36, 0x54, 0xA1, 0xEC, 0xF0, 0x06, 0x13,
-        0x62, 0xA7, 0x05, 0xF3, 0xC0, 0xC7, 0x73, 0x8C, 0x98, 0x93, 0x2B, 0xD9, 0xBC, 0x4C, 0x82, 0xCA,
-        0x1E, 0x9B, 0x57, 0x3C, 0xFD, 0xD4, 0xE0, 0x16, 0x67, 0x42, 0x6F, 0x18, 0x8A, 0x17, 0xE5, 0x12,
-        0xBE, 0x4E, 0xC4, 0xD6, 0xDA, 0x9E, 0xDE, 0x49, 0xA0, 0xFB, 0xF5, 0x8E, 0xBB, 0x2F, 0xEE, 0x7A,
-        0xA9, 0x68, 0x79, 0x91, 0x15, 0xB2, 0x07, 0x3F, 0x94, 0xC2, 0x10, 0x89, 0x0B, 0x22, 0x5F, 0x21,
-        0x80, 0x7F, 0x5D, 0x9A, 0x5A, 0x90, 0x32, 0x27, 0x35, 0x3E, 0xCC, 0xE7, 0xBF, 0xF7, 0x97, 0x03,
-        0xFF, 0x19, 0x30, 0xB3, 0x48, 0xA5, 0xB5, 0xD1, 0xD7, 0x5E, 0x92, 0x2A, 0xAC, 0x56, 0xAA, 0xC6,
-        0x4F, 0xB8, 0x38, 0xD2, 0x96, 0xA4, 0x7D, 0xB6, 0x76, 0xFC, 0x6B, 0xE2, 0x9C, 0x74, 0x04, 0xF1,
-        0x45, 0x9D, 0x70, 0x59, 0x64, 0x71, 0x87, 0x20, 0x86, 0x5B, 0xCF, 0x65, 0xE6, 0x2D, 0xA8, 0x02,
-        0x1B, 0x60, 0x25, 0xAD, 0xAE, 0xB0, 0xB9, 0xF6, 0x1C, 0x46, 0x61, 0x69, 0x34, 0x40, 0x7E, 0x0F,
-        0x55, 0x47, 0xA3, 0x23, 0xDD, 0x51, 0xAF, 0x3A, 0xC3, 0x5C, 0xF9, 0xCE, 0xBA, 0xC5, 0xEA, 0x26,
-        0x2C, 0x53, 0x0D, 0x6E, 0x85, 0x28, 0x84, 0x09, 0xD3, 0xDF, 0xCD, 0xF4, 0x41, 0x81, 0x4D, 0x52,
-        0x6A, 0xDC, 0x37, 0xC8, 0x6C, 0xC1, 0xAB, 0xFA, 0x24, 0xE1, 0x7B, 0x08, 0x0C, 0xBD, 0xB1, 0x4A,
-        0x78, 0x88, 0x95, 0x8B, 0xE3, 0x63, 0xE8, 0x6D, 0xE9, 0xCB, 0xD5, 0xFE, 0x3B, 0x00, 0x1D, 0x39,
-        0xF2, 0xEF, 0xB7, 0x0E, 0x66, 0x58, 0xD0, 0xE4, 0xA6, 0x77, 0x72, 0xF8, 0xEB, 0x75, 0x4B, 0x0A,
-        0x31, 0x44, 0x50, 0xB4, 0x8F, 0xED, 0x1F, 0x1A, 0xDB, 0x99, 0x8D, 0x33, 0x9F, 0x11, 0x83, 0x14];
-
-    /**
-     * @memberOf Md2
-     * @method processBlock
-     * @param {number[]} block
-     */
-    Md2.prototype.processBlock = function processBlock(block) {
-        // Append hash
-        for (var i = 0; i < 16; i++) {
-            this.state.hash[16 + i] = block[i];
-            this.state.hash[32 + i] = this.state.hash[16 + i] ^ this.state.hash[i];
-        }
-
-        // 18 Rounds
-        var t = 0;
-        for (i = 0; i < 18; i++) {
-            for (var j = 0; j < 48; j++) {
-                t = this.state.hash[j] ^= this.piSubst[t];
-            }
-            t = (t + i) & 0xff;
-        }
-
-        // Append checksum
-        t = this.state.checksum[15];
-        for (i = 0; i < 16; i++) {
-            t = this.state.checksum[i] ^= this.piSubst[block[i] ^ t];
-        }
-    };
-
-    /**
-     * @memberOf Md2
-     * @method finalize
-     * @return {HashArray}
-     */
-    Md2.prototype.finalize = function finalize() {
-        var padLen = this.state.message.length & 0xf;
-        this.update(new Array(17 - padLen).join(String.fromCharCode(16 - padLen)));
-
-        // Process checksum
-        this.updateFromArray(this.state.checksum);
-
-        // Return hash
-        return CryptoApi.hashArray(this.state.hash.slice(0, 16));
-    };
-
-    CryptoApi.Hashers.add('md2', Md2);
-    return Md2;
-})(
-    this.CryptoApi || require('./crypto-api')
-);

+ 0 - 204
src/js/lib/cryptoapi/hasher.md4.js

@@ -1,204 +0,0 @@
-/*global require */
-(/**
- * @param {CryptoApi} CryptoApi
- * @returns {Md4}
- */
-  function (CryptoApi) {
-  'use strict';
-
-  /**
-   * @class Md4
-   * @desc Md4 hasher
-   * @implements HasherInterface
-   * @extends Hasher32le
-   */
-  var Md4 = function md4(name, options) {
-    this.constructor(name, options);
-  };
-  Md4.prototype = Object.create(CryptoApi.Hasher32le.prototype);
-  /**
-   * @memberOf Md4
-   * @constructor
-   */
-  Md4.prototype.constructor = function (name, options) {
-    CryptoApi.Hasher32le.prototype.constructor.call(this, name, options);
-    /**
-     * @desc Hash state
-     * @memberOf! Md4#
-     * @alias state.hash
-     * @type {number[]}
-     */
-    this.state.hash = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476];
-  };
-
-  /**
-   * @desc Transform constants
-   * @memberOf Md4
-   * @member {number[]} S
-   * @const
-   */
-  Md4.prototype.S = [
-    [3, 7, 11, 19],
-    [3, 5, 9, 13],
-    [3, 9, 11, 15]
-  ];
-  Md4.prototype.F = 0x00000000;
-  Md4.prototype.G = 0x5a827999;
-  Md4.prototype.H = 0x6ed9eba1;
-
-// Transform functions
-  /**
-   * @param {number} x
-   * @param {number} y
-   * @param {number} z
-   * @returns {number}
-   */
-  Md4.prototype.FF = function FF(x, y, z) {
-    return (x & y) | ((~x) & z);
-  };
-  /**
-   * @param {number} x
-   * @param {number} y
-   * @param {number} z
-   * @returns {number}
-   */
-  Md4.prototype.GG = function GG(x, y, z) {
-    return (x & y) | (x & z) | (y & z);
-  };
-  /**
-   * @param {number} x
-   * @param {number} y
-   * @param {number} z
-   * @returns {number}
-   */
-  Md4.prototype.HH = function HH(x, y, z) {
-    return x ^ y ^ z;
-  };
-  /**
-   *
-   * @param {function} f
-   * @param {number} k
-   * @param {number} a
-   * @param {number} x
-   * @param {number} y
-   * @param {number} z
-   * @param {number} m
-   * @param {number} s
-   * @returns {number}
-   * @constructor
-   */
-  Md4.prototype.CC = function CC(f, k, a, x, y, z, m, s) {
-    return CryptoApi.Tools.rotateLeft((a + f(x, y, z) + m + k), s) | 0;
-  };
-
-  /**
-   * @memberOf Md4
-   * @method processBlock
-   * @param {number[]} block
-   */
-  Md4.prototype.processBlock = function processBlock(block) {
-    // Working variables
-    var a = this.state.hash[0] | 0;
-    var b = this.state.hash[1] | 0;
-    var c = this.state.hash[2] | 0;
-    var d = this.state.hash[3] | 0;
-
-    // Round 1
-    a = this.CC(this.FF, this.F, a, b, c, d, block[0], this.S[0][0]);
-    d = this.CC(this.FF, this.F, d, a, b, c, block[1], this.S[0][1]);
-    c = this.CC(this.FF, this.F, c, d, a, b, block[2], this.S[0][2]);
-    b = this.CC(this.FF, this.F, b, c, d, a, block[3], this.S[0][3]);
-    a = this.CC(this.FF, this.F, a, b, c, d, block[4], this.S[0][0]);
-    d = this.CC(this.FF, this.F, d, a, b, c, block[5], this.S[0][1]);
-    c = this.CC(this.FF, this.F, c, d, a, b, block[6], this.S[0][2]);
-    b = this.CC(this.FF, this.F, b, c, d, a, block[7], this.S[0][3]);
-    a = this.CC(this.FF, this.F, a, b, c, d, block[8], this.S[0][0]);
-    d = this.CC(this.FF, this.F, d, a, b, c, block[9], this.S[0][1]);
-    c = this.CC(this.FF, this.F, c, d, a, b, block[10], this.S[0][2]);
-    b = this.CC(this.FF, this.F, b, c, d, a, block[11], this.S[0][3]);
-    a = this.CC(this.FF, this.F, a, b, c, d, block[12], this.S[0][0]);
-    d = this.CC(this.FF, this.F, d, a, b, c, block[13], this.S[0][1]);
-    c = this.CC(this.FF, this.F, c, d, a, b, block[14], this.S[0][2]);
-    b = this.CC(this.FF, this.F, b, c, d, a, block[15], this.S[0][3]);
-
-    // Round 2
-    a = this.CC(this.GG, this.G, a, b, c, d, block[0], this.S[1][0]);
-    d = this.CC(this.GG, this.G, d, a, b, c, block[4], this.S[1][1]);
-    c = this.CC(this.GG, this.G, c, d, a, b, block[8], this.S[1][2]);
-    b = this.CC(this.GG, this.G, b, c, d, a, block[12], this.S[1][3]);
-    a = this.CC(this.GG, this.G, a, b, c, d, block[1], this.S[1][0]);
-    d = this.CC(this.GG, this.G, d, a, b, c, block[5], this.S[1][1]);
-    c = this.CC(this.GG, this.G, c, d, a, b, block[9], this.S[1][2]);
-    b = this.CC(this.GG, this.G, b, c, d, a, block[13], this.S[1][3]);
-    a = this.CC(this.GG, this.G, a, b, c, d, block[2], this.S[1][0]);
-    d = this.CC(this.GG, this.G, d, a, b, c, block[6], this.S[1][1]);
-    c = this.CC(this.GG, this.G, c, d, a, b, block[10], this.S[1][2]);
-    b = this.CC(this.GG, this.G, b, c, d, a, block[14], this.S[1][3]);
-    a = this.CC(this.GG, this.G, a, b, c, d, block[3], this.S[1][0]);
-    d = this.CC(this.GG, this.G, d, a, b, c, block[7], this.S[1][1]);
-    c = this.CC(this.GG, this.G, c, d, a, b, block[11], this.S[1][2]);
-    b = this.CC(this.GG, this.G, b, c, d, a, block[15], this.S[1][3]);
-
-    // Round 3
-    a = this.CC(this.HH, this.H, a, b, c, d, block[0], this.S[2][0]);
-    d = this.CC(this.HH, this.H, d, a, b, c, block[8], this.S[2][1]);
-    c = this.CC(this.HH, this.H, c, d, a, b, block[4], this.S[2][2]);
-    b = this.CC(this.HH, this.H, b, c, d, a, block[12], this.S[2][3]);
-    a = this.CC(this.HH, this.H, a, b, c, d, block[2], this.S[2][0]);
-    d = this.CC(this.HH, this.H, d, a, b, c, block[10], this.S[2][1]);
-    c = this.CC(this.HH, this.H, c, d, a, b, block[6], this.S[2][2]);
-    b = this.CC(this.HH, this.H, b, c, d, a, block[14], this.S[2][3]);
-    a = this.CC(this.HH, this.H, a, b, c, d, block[1], this.S[2][0]);
-    d = this.CC(this.HH, this.H, d, a, b, c, block[9], this.S[2][1]);
-    c = this.CC(this.HH, this.H, c, d, a, b, block[5], this.S[2][2]);
-    b = this.CC(this.HH, this.H, b, c, d, a, block[13], this.S[2][3]);
-    a = this.CC(this.HH, this.H, a, b, c, d, block[3], this.S[2][0]);
-    d = this.CC(this.HH, this.H, d, a, b, c, block[11], this.S[2][1]);
-    c = this.CC(this.HH, this.H, c, d, a, b, block[7], this.S[2][2]);
-    b = this.CC(this.HH, this.H, b, c, d, a, block[15], this.S[2][3]);
-
-    this.state.hash = [
-      (this.state.hash[0] + a) | 0,
-      (this.state.hash[1] + b) | 0,
-      (this.state.hash[2] + c) | 0,
-      (this.state.hash[3] + d) | 0
-    ];
-  };
-  /**
-   * @memberOf Md4
-   * @method finalize
-   * @return {HashArray} hash
-   */
-  Md4.prototype.finalize = function finalize() {
-    // Add padding
-    var padLen = this.state.message.length < 56 ? 56 - this.state.message.length : 120 - this.state.message.length;
-    var padding = new Array(padLen);
-    padding[0] = 0x80;
-
-    // Add length
-    var lengthBits = this.state.length * 8;
-    for (var i = 0; i < 4; i++) {
-      padding.push((lengthBits >> (8 * i)) & 0xff);
-    }
-    // @todo fix length to 64 bit
-    for (i = 0; i < 4; i++) {
-      padding.push(0);
-    }
-    this.updateFromArray(padding);
-
-    var hash = [];
-    for (i = 0; i < this.state.hash.length; i++) {
-      for (var j = 0; j < 4; j++) {
-        hash.push((this.state.hash[i] >> 8 * j) & 0xff);
-      }
-    }
-
-    // Return hash
-    return CryptoApi.hashArray(hash);
-  };
-
-  CryptoApi.Hashers.add('md4', Md4);
-  return Md4;
-})(
-    this.CryptoApi || require('./crypto-api')
-);

+ 0 - 125
src/js/lib/cryptoapi/hasher.sha0.js

@@ -1,125 +0,0 @@
-/*global require */
-(/**
- *
- * @param {CryptoApi} CryptoApi
- * @returns {Sha0}
- */
-  function (CryptoApi) {
-  'use strict';
-
-  // Transform constants
-  var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
-
-  /**
-   * @class Sha0
-   * @desc Sha0 hasher
-   * @implements HasherInterface
-   * @extends Hasher32be
-   */
-  var Sha0 = function sha0(name, options) {
-    this.constructor(name, options);
-  };
-  Sha0.prototype = Object.create(CryptoApi.Hasher32be.prototype);
-  /**
-   * @memberOf Sha0
-   * @constructor
-   */
-  Sha0.prototype.constructor = function (name, options) {
-    CryptoApi.Hasher32be.prototype.constructor.call(this, name, options);
-    /**
-     * @desc Hash state
-     * @memberOf! Sha0#
-     * @alias state.hash
-     * @type {number[]}
-     */
-    this.state.hash = [
-      0x67452301,
-      0xefcdab89,
-      0x98badcfe,
-      0x10325476,
-      0xc3d2e1f0
-    ];
-    this.W = [];
-  };
-
-  /**
-   * @memberOf Sha0
-   * @method processBlock
-   * @param {number[]} M
-   */
-  Sha0.prototype.processBlock = function processBlock(M) {
-    // Working variables
-    var a = this.state.hash[0] | 0;
-    var b = this.state.hash[1] | 0;
-    var c = this.state.hash[2] | 0;
-    var d = this.state.hash[3] | 0;
-    var e = this.state.hash[4] | 0;
-
-    // Calculate hash
-    for (var i = 0; i < 80; i++) {
-      if (i < 16) {
-        this.W[i] = M[i] | 0;
-      } else {
-        this.W[i] = (this.W[i - 3] ^ this.W[i - 8] ^ this.W[i - 14] ^ this.W[i - 16]) | 0;
-      }
-
-      var t = (CryptoApi.Tools.rotateLeft(a, 5) + e + this.W[i] + K[(i / 20) >> 0]) | 0;
-      if (i < 20) {
-        t = (t + ((b & c) | (~b & d))) | 0;
-      } else if (i < 40) {
-        t = (t + (b ^ c ^ d)) | 0;
-      } else if (i < 60) {
-        t = (t + ((b & c) | (b & d) | (c & d))) | 0;
-      } else {
-        t = (t + (b ^ c ^ d)) | 0;
-      }
-      e = d;
-      d = c;
-      c = CryptoApi.Tools.rotateLeft(b, 30) | 0;
-      b = a;
-      a = t;
-    }
-
-    this.state.hash[0] = (this.state.hash[0] + a) | 0;
-    this.state.hash[1] = (this.state.hash[1] + b) | 0;
-    this.state.hash[2] = (this.state.hash[2] + c) | 0;
-    this.state.hash[3] = (this.state.hash[3] + d) | 0;
-    this.state.hash[4] = (this.state.hash[4] + e) | 0;
-  };
-
-  /**
-   * @memberOf Sha0
-   * @method finalize
-   * @return {HashArray} hash
-   */
-  Sha0.prototype.finalize = function finalize() {
-    // Add padding
-    var padLen = this.state.message.length < 56 ? 56 - this.state.message.length : 120 - this.state.message.length;
-    padLen += 4; // @todo fix length to 64 bit
-    var padding = new Array(padLen);
-    padding[0] = 0x80;
-
-    // Add length
-    var lengthBits = this.state.length * 8;
-    for (var i = 3; i >= 0; i--) {
-      padding.push((lengthBits >> (8 * i)) & 0xff);
-    }
-
-    this.updateFromArray(padding);
-
-    var hash = [];
-    for (var k = 0, l = this.state.hash.length; k < l; k++) {
-      for (var j = 3; j >= 0; j--) {
-        hash.push((this.state.hash[k] >> 8 * j) & 0xFF);
-      }
-    }
-
-    // Return hash
-    return CryptoApi.hashArray(hash);
-  };
-
-  CryptoApi.Hashers.add('sha0', Sha0);
-  return Sha0;
-})(
-    this.CryptoApi || require('./crypto-api')
-);

+ 0 - 213
src/js/lib/cryptojs/aes.js

@@ -1,213 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-(function () {
-    // Shortcuts
-    var C = CryptoJS;
-    var C_lib = C.lib;
-    var BlockCipher = C_lib.BlockCipher;
-    var C_algo = C.algo;
-
-    // Lookup tables
-    var SBOX = [];
-    var INV_SBOX = [];
-    var SUB_MIX_0 = [];
-    var SUB_MIX_1 = [];
-    var SUB_MIX_2 = [];
-    var SUB_MIX_3 = [];
-    var INV_SUB_MIX_0 = [];
-    var INV_SUB_MIX_1 = [];
-    var INV_SUB_MIX_2 = [];
-    var INV_SUB_MIX_3 = [];
-
-    // Compute lookup tables
-    (function () {
-        // Compute double table
-        var d = [];
-        for (var i = 0; i < 256; i++) {
-            if (i < 128) {
-                d[i] = i << 1;
-            } else {
-                d[i] = (i << 1) ^ 0x11b;
-            }
-        }
-
-        // Walk GF(2^8)
-        var x = 0;
-        var xi = 0;
-        for (var i = 0; i < 256; i++) {
-            // Compute sbox
-            var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);
-            sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;
-            SBOX[x] = sx;
-            INV_SBOX[sx] = x;
-
-            // Compute multiplication
-            var x2 = d[x];
-            var x4 = d[x2];
-            var x8 = d[x4];
-
-            // Compute sub bytes, mix columns tables
-            var t = (d[sx] * 0x101) ^ (sx * 0x1010100);
-            SUB_MIX_0[x] = (t << 24) | (t >>> 8);
-            SUB_MIX_1[x] = (t << 16) | (t >>> 16);
-            SUB_MIX_2[x] = (t << 8)  | (t >>> 24);
-            SUB_MIX_3[x] = t;
-
-            // Compute inv sub bytes, inv mix columns tables
-            var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);
-            INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8);
-            INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16);
-            INV_SUB_MIX_2[sx] = (t << 8)  | (t >>> 24);
-            INV_SUB_MIX_3[sx] = t;
-
-            // Compute next counter
-            if (!x) {
-                x = xi = 1;
-            } else {
-                x = x2 ^ d[d[d[x8 ^ x2]]];
-                xi ^= d[d[xi]];
-            }
-        }
-    }());
-
-    // Precomputed Rcon lookup
-    var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];
-
-    /**
-     * AES block cipher algorithm.
-     */
-    var AES = C_algo.AES = BlockCipher.extend({
-        _doReset: function () {
-            // Shortcuts
-            var key = this._key;
-            var keyWords = key.words;
-            var keySize = key.sigBytes / 4;
-
-            // Compute number of rounds
-            var nRounds = this._nRounds = keySize + 6
-
-            // Compute number of key schedule rows
-            var ksRows = (nRounds + 1) * 4;
-
-            // Compute key schedule
-            var keySchedule = this._keySchedule = [];
-            for (var ksRow = 0; ksRow < ksRows; ksRow++) {
-                if (ksRow < keySize) {
-                    keySchedule[ksRow] = keyWords[ksRow];
-                } else {
-                    var t = keySchedule[ksRow - 1];
-
-                    if (!(ksRow % keySize)) {
-                        // Rot word
-                        t = (t << 8) | (t >>> 24);
-
-                        // Sub word
-                        t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
-
-                        // Mix Rcon
-                        t ^= RCON[(ksRow / keySize) | 0] << 24;
-                    } else if (keySize > 6 && ksRow % keySize == 4) {
-                        // Sub word
-                        t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
-                    }
-
-                    keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;
-                }
-            }
-
-            // Compute inv key schedule
-            var invKeySchedule = this._invKeySchedule = [];
-            for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {
-                var ksRow = ksRows - invKsRow;
-
-                if (invKsRow % 4) {
-                    var t = keySchedule[ksRow];
-                } else {
-                    var t = keySchedule[ksRow - 4];
-                }
-
-                if (invKsRow < 4 || ksRow <= 4) {
-                    invKeySchedule[invKsRow] = t;
-                } else {
-                    invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^
-                                               INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];
-                }
-            }
-        },
-
-        encryptBlock: function (M, offset) {
-            this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);
-        },
-
-        decryptBlock: function (M, offset) {
-            // Swap 2nd and 4th rows
-            var t = M[offset + 1];
-            M[offset + 1] = M[offset + 3];
-            M[offset + 3] = t;
-
-            this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);
-
-            // Inv swap 2nd and 4th rows
-            var t = M[offset + 1];
-            M[offset + 1] = M[offset + 3];
-            M[offset + 3] = t;
-        },
-
-        _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {
-            // Shortcut
-            var nRounds = this._nRounds;
-
-            // Get input, add round key
-            var s0 = M[offset]     ^ keySchedule[0];
-            var s1 = M[offset + 1] ^ keySchedule[1];
-            var s2 = M[offset + 2] ^ keySchedule[2];
-            var s3 = M[offset + 3] ^ keySchedule[3];
-
-            // Key schedule row counter
-            var ksRow = 4;
-
-            // Rounds
-            for (var round = 1; round < nRounds; round++) {
-                // Shift rows, sub bytes, mix columns, add round key
-                var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++];
-                var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++];
-                var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++];
-                var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++];
-
-                // Update state
-                s0 = t0;
-                s1 = t1;
-                s2 = t2;
-                s3 = t3;
-            }
-
-            // Shift rows, sub bytes, add round key
-            var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];
-            var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];
-            var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];
-            var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];
-
-            // Set output
-            M[offset]     = t0;
-            M[offset + 1] = t1;
-            M[offset + 2] = t2;
-            M[offset + 3] = t3;
-        },
-
-        keySize: 256/32
-    });
-
-    /**
-     * Shortcut functions to the cipher's object interface.
-     *
-     * @example
-     *
-     *     var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);
-     *     var plaintext  = CryptoJS.AES.decrypt(ciphertext, key, cfg);
-     */
-    C.AES = BlockCipher._createHelper(AES);
-}());

+ 0 - 864
src/js/lib/cryptojs/cipher-core.js

@@ -1,864 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-/**
- * Cipher core components.
- */
-CryptoJS.lib.Cipher || (function (undefined) {
-    // Shortcuts
-    var C = CryptoJS;
-    var C_lib = C.lib;
-    var Base = C_lib.Base;
-    var WordArray = C_lib.WordArray;
-    var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;
-    var C_enc = C.enc;
-    var Utf8 = C_enc.Utf8;
-    var Base64 = C_enc.Base64;
-    var C_algo = C.algo;
-    var EvpKDF = C_algo.EvpKDF;
-
-    /**
-     * Abstract base cipher template.
-     *
-     * @property {number} keySize This cipher's key size. Default: 4 (128 bits)
-     * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)
-     * @property {number} _ENC_XFORM_MODE A constant representing encryption mode.
-     * @property {number} _DEC_XFORM_MODE A constant representing decryption mode.
-     */
-    var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({
-        /**
-         * Configuration options.
-         *
-         * @property {WordArray} iv The IV to use for this operation.
-         */
-        cfg: Base.extend(),
-
-        /**
-         * Creates this cipher in encryption mode.
-         *
-         * @param {WordArray} key The key.
-         * @param {Object} cfg (Optional) The configuration options to use for this operation.
-         *
-         * @return {Cipher} A cipher instance.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
-         */
-        createEncryptor: function (key, cfg) {
-            return this.create(this._ENC_XFORM_MODE, key, cfg);
-        },
-
-        /**
-         * Creates this cipher in decryption mode.
-         *
-         * @param {WordArray} key The key.
-         * @param {Object} cfg (Optional) The configuration options to use for this operation.
-         *
-         * @return {Cipher} A cipher instance.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
-         */
-        createDecryptor: function (key, cfg) {
-            return this.create(this._DEC_XFORM_MODE, key, cfg);
-        },
-
-        /**
-         * Initializes a newly created cipher.
-         *
-         * @param {number} xformMode Either the encryption or decryption transormation mode constant.
-         * @param {WordArray} key The key.
-         * @param {Object} cfg (Optional) The configuration options to use for this operation.
-         *
-         * @example
-         *
-         *     var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
-         */
-        init: function (xformMode, key, cfg) {
-            // Apply config defaults
-            this.cfg = this.cfg.extend(cfg);
-
-            // Store transform mode and key
-            this._xformMode = xformMode;
-            this._key = key;
-
-            // Set initial values
-            this.reset();
-        },
-
-        /**
-         * Resets this cipher to its initial state.
-         *
-         * @example
-         *
-         *     cipher.reset();
-         */
-        reset: function () {
-            // Reset data buffer
-            BufferedBlockAlgorithm.reset.call(this);
-
-            // Perform concrete-cipher logic
-            this._doReset();
-        },
-
-        /**
-         * Adds data to be encrypted or decrypted.
-         *
-         * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
-         *
-         * @return {WordArray} The data after processing.
-         *
-         * @example
-         *
-         *     var encrypted = cipher.process('data');
-         *     var encrypted = cipher.process(wordArray);
-         */
-        process: function (dataUpdate) {
-            // Append
-            this._append(dataUpdate);
-
-            // Process available blocks
-            return this._process();
-        },
-
-        /**
-         * Finalizes the encryption or decryption process.
-         * Note that the finalize operation is effectively a destructive, read-once operation.
-         *
-         * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
-         *
-         * @return {WordArray} The data after final processing.
-         *
-         * @example
-         *
-         *     var encrypted = cipher.finalize();
-         *     var encrypted = cipher.finalize('data');
-         *     var encrypted = cipher.finalize(wordArray);
-         */
-        finalize: function (dataUpdate) {
-            // Final data update
-            if (dataUpdate) {
-                this._append(dataUpdate);
-            }
-
-            // Perform concrete-cipher logic
-            var finalProcessedData = this._doFinalize();
-
-            return finalProcessedData;
-        },
-
-        keySize: 128/32,
-
-        ivSize: 128/32,
-
-        _ENC_XFORM_MODE: 1,
-
-        _DEC_XFORM_MODE: 2,
-
-        /**
-         * Creates shortcut functions to a cipher's object interface.
-         *
-         * @param {Cipher} cipher The cipher to create a helper for.
-         *
-         * @return {Object} An object with encrypt and decrypt shortcut functions.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
-         */
-        _createHelper: (function () {
-            function selectCipherStrategy(key) {
-                if (typeof key == 'string') {
-                    return PasswordBasedCipher;
-                } else {
-                    return SerializableCipher;
-                }
-            }
-
-            return function (cipher) {
-                return {
-                    encrypt: function (message, key, cfg) {
-                        return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);
-                    },
-
-                    decrypt: function (ciphertext, key, cfg) {
-                        return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);
-                    }
-                };
-            };
-        }())
-    });
-
-    /**
-     * Abstract base stream cipher template.
-     *
-     * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)
-     */
-    var StreamCipher = C_lib.StreamCipher = Cipher.extend({
-        _doFinalize: function () {
-            // Process partial blocks
-            var finalProcessedBlocks = this._process(!!'flush');
-
-            return finalProcessedBlocks;
-        },
-
-        blockSize: 1
-    });
-
-    /**
-     * Mode namespace.
-     */
-    var C_mode = C.mode = {};
-
-    /**
-     * Abstract base block cipher mode template.
-     */
-    var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({
-        /**
-         * Creates this mode for encryption.
-         *
-         * @param {Cipher} cipher A block cipher instance.
-         * @param {Array} iv The IV words.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
-         */
-        createEncryptor: function (cipher, iv) {
-            return this.Encryptor.create(cipher, iv);
-        },
-
-        /**
-         * Creates this mode for decryption.
-         *
-         * @param {Cipher} cipher A block cipher instance.
-         * @param {Array} iv The IV words.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
-         */
-        createDecryptor: function (cipher, iv) {
-            return this.Decryptor.create(cipher, iv);
-        },
-
-        /**
-         * Initializes a newly created mode.
-         *
-         * @param {Cipher} cipher A block cipher instance.
-         * @param {Array} iv The IV words.
-         *
-         * @example
-         *
-         *     var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
-         */
-        init: function (cipher, iv) {
-            this._cipher = cipher;
-            this._iv = iv;
-        }
-    });
-
-    /**
-     * Cipher Block Chaining mode.
-     */
-    var CBC = C_mode.CBC = (function () {
-        /**
-         * Abstract base CBC mode.
-         */
-        var CBC = BlockCipherMode.extend();
-
-        /**
-         * CBC encryptor.
-         */
-        CBC.Encryptor = CBC.extend({
-            /**
-             * Processes the data block at offset.
-             *
-             * @param {Array} words The data words to operate on.
-             * @param {number} offset The offset where the block starts.
-             *
-             * @example
-             *
-             *     mode.processBlock(data.words, offset);
-             */
-            processBlock: function (words, offset) {
-                // Shortcuts
-                var cipher = this._cipher;
-                var blockSize = cipher.blockSize;
-
-                // XOR and encrypt
-                xorBlock.call(this, words, offset, blockSize);
-                cipher.encryptBlock(words, offset);
-
-                // Remember this block to use with next block
-                this._prevBlock = words.slice(offset, offset + blockSize);
-            }
-        });
-
-        /**
-         * CBC decryptor.
-         */
-        CBC.Decryptor = CBC.extend({
-            /**
-             * Processes the data block at offset.
-             *
-             * @param {Array} words The data words to operate on.
-             * @param {number} offset The offset where the block starts.
-             *
-             * @example
-             *
-             *     mode.processBlock(data.words, offset);
-             */
-            processBlock: function (words, offset) {
-                // Shortcuts
-                var cipher = this._cipher;
-                var blockSize = cipher.blockSize;
-
-                // Remember this block to use with next block
-                var thisBlock = words.slice(offset, offset + blockSize);
-
-                // Decrypt and XOR
-                cipher.decryptBlock(words, offset);
-                xorBlock.call(this, words, offset, blockSize);
-
-                // This block becomes the previous block
-                this._prevBlock = thisBlock;
-            }
-        });
-
-        function xorBlock(words, offset, blockSize) {
-            // Shortcut
-            var iv = this._iv;
-
-            // Choose mixing block
-            if (iv) {
-                var block = iv;
-
-                // Remove IV for subsequent blocks
-                this._iv = undefined;
-            } else {
-                var block = this._prevBlock;
-            }
-
-            // XOR blocks
-            for (var i = 0; i < blockSize; i++) {
-                words[offset + i] ^= block[i];
-            }
-        }
-
-        return CBC;
-    }());
-
-    /**
-     * Padding namespace.
-     */
-    var C_pad = C.pad = {};
-
-    /**
-     * PKCS #5/7 padding strategy.
-     */
-    var Pkcs7 = C_pad.Pkcs7 = {
-        /**
-         * Pads data using the algorithm defined in PKCS #5/7.
-         *
-         * @param {WordArray} data The data to pad.
-         * @param {number} blockSize The multiple that the data should be padded to.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     CryptoJS.pad.Pkcs7.pad(wordArray, 4);
-         */
-        pad: function (data, blockSize) {
-            // Shortcut
-            var blockSizeBytes = blockSize * 4;
-
-            // Count padding bytes
-            var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
-
-            // Create padding word
-            var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes;
-
-            // Create padding
-            var paddingWords = [];
-            for (var i = 0; i < nPaddingBytes; i += 4) {
-                paddingWords.push(paddingWord);
-            }
-            var padding = WordArray.create(paddingWords, nPaddingBytes);
-
-            // Add padding
-            data.concat(padding);
-        },
-
-        /**
-         * Unpads data that had been padded using the algorithm defined in PKCS #5/7.
-         *
-         * @param {WordArray} data The data to unpad.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     CryptoJS.pad.Pkcs7.unpad(wordArray);
-         */
-        unpad: function (data) {
-            // Get number of padding bytes from last byte
-            var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
-
-            // Remove padding
-            data.sigBytes -= nPaddingBytes;
-        }
-    };
-
-    /**
-     * Abstract base block cipher template.
-     *
-     * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)
-     */
-    var BlockCipher = C_lib.BlockCipher = Cipher.extend({
-        /**
-         * Configuration options.
-         *
-         * @property {Mode} mode The block mode to use. Default: CBC
-         * @property {Padding} padding The padding strategy to use. Default: Pkcs7
-         */
-        cfg: Cipher.cfg.extend({
-            mode: CBC,
-            padding: Pkcs7
-        }),
-
-        reset: function () {
-            // Reset cipher
-            Cipher.reset.call(this);
-
-            // Shortcuts
-            var cfg = this.cfg;
-            var iv = cfg.iv;
-            var mode = cfg.mode;
-
-            // Reset block mode
-            if (this._xformMode == this._ENC_XFORM_MODE) {
-                var modeCreator = mode.createEncryptor;
-            } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
-                var modeCreator = mode.createDecryptor;
-
-                // Keep at least one block in the buffer for unpadding
-                this._minBufferSize = 1;
-            }
-            this._mode = modeCreator.call(mode, this, iv && iv.words);
-        },
-
-        _doProcessBlock: function (words, offset) {
-            this._mode.processBlock(words, offset);
-        },
-
-        _doFinalize: function () {
-            // Shortcut
-            var padding = this.cfg.padding;
-
-            // Finalize
-            if (this._xformMode == this._ENC_XFORM_MODE) {
-                // Pad data
-                padding.pad(this._data, this.blockSize);
-
-                // Process final blocks
-                var finalProcessedBlocks = this._process(!!'flush');
-            } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
-                // Process final blocks
-                var finalProcessedBlocks = this._process(!!'flush');
-
-                // Unpad data
-                padding.unpad(finalProcessedBlocks);
-            }
-
-            return finalProcessedBlocks;
-        },
-
-        blockSize: 128/32
-    });
-
-    /**
-     * A collection of cipher parameters.
-     *
-     * @property {WordArray} ciphertext The raw ciphertext.
-     * @property {WordArray} key The key to this ciphertext.
-     * @property {WordArray} iv The IV used in the ciphering operation.
-     * @property {WordArray} salt The salt used with a key derivation function.
-     * @property {Cipher} algorithm The cipher algorithm.
-     * @property {Mode} mode The block mode used in the ciphering operation.
-     * @property {Padding} padding The padding scheme used in the ciphering operation.
-     * @property {number} blockSize The block size of the cipher.
-     * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.
-     */
-    var CipherParams = C_lib.CipherParams = Base.extend({
-        /**
-         * Initializes a newly created cipher params object.
-         *
-         * @param {Object} cipherParams An object with any of the possible cipher parameters.
-         *
-         * @example
-         *
-         *     var cipherParams = CryptoJS.lib.CipherParams.create({
-         *         ciphertext: ciphertextWordArray,
-         *         key: keyWordArray,
-         *         iv: ivWordArray,
-         *         salt: saltWordArray,
-         *         algorithm: CryptoJS.algo.AES,
-         *         mode: CryptoJS.mode.CBC,
-         *         padding: CryptoJS.pad.PKCS7,
-         *         blockSize: 4,
-         *         formatter: CryptoJS.format.OpenSSL
-         *     });
-         */
-        init: function (cipherParams) {
-            this.mixIn(cipherParams);
-        },
-
-        /**
-         * Converts this cipher params object to a string.
-         *
-         * @param {Format} formatter (Optional) The formatting strategy to use.
-         *
-         * @return {string} The stringified cipher params.
-         *
-         * @throws Error If neither the formatter nor the default formatter is set.
-         *
-         * @example
-         *
-         *     var string = cipherParams + '';
-         *     var string = cipherParams.toString();
-         *     var string = cipherParams.toString(CryptoJS.format.OpenSSL);
-         */
-        toString: function (formatter) {
-            return (formatter || this.formatter).stringify(this);
-        }
-    });
-
-    /**
-     * Format namespace.
-     */
-    var C_format = C.format = {};
-
-    /**
-     * OpenSSL formatting strategy.
-     */
-    var OpenSSLFormatter = C_format.OpenSSL = {
-        /**
-         * Converts a cipher params object to an OpenSSL-compatible string.
-         *
-         * @param {CipherParams} cipherParams The cipher params object.
-         *
-         * @return {string} The OpenSSL-compatible string.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
-         */
-        stringify: function (cipherParams) {
-            // Shortcuts
-            var ciphertext = cipherParams.ciphertext;
-            var salt = cipherParams.salt;
-
-            // Format
-            if (salt) {
-                var wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);
-            } else {
-                var wordArray = ciphertext;
-            }
-
-            return wordArray.toString(Base64);
-        },
-
-        /**
-         * Converts an OpenSSL-compatible string to a cipher params object.
-         *
-         * @param {string} openSSLStr The OpenSSL-compatible string.
-         *
-         * @return {CipherParams} The cipher params object.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
-         */
-        parse: function (openSSLStr) {
-            // Parse base64
-            var ciphertext = Base64.parse(openSSLStr);
-
-            // Shortcut
-            var ciphertextWords = ciphertext.words;
-
-            // Test for salt
-            if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {
-                // Extract salt
-                var salt = WordArray.create(ciphertextWords.slice(2, 4));
-
-                // Remove salt from ciphertext
-                ciphertextWords.splice(0, 4);
-                ciphertext.sigBytes -= 16;
-            }
-
-            return CipherParams.create({ ciphertext: ciphertext, salt: salt });
-        }
-    };
-
-    /**
-     * A cipher wrapper that returns ciphertext as a serializable cipher params object.
-     */
-    var SerializableCipher = C_lib.SerializableCipher = Base.extend({
-        /**
-         * Configuration options.
-         *
-         * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
-         */
-        cfg: Base.extend({
-            format: OpenSSLFormatter
-        }),
-
-        /**
-         * Encrypts a message.
-         *
-         * @param {Cipher} cipher The cipher algorithm to use.
-         * @param {WordArray|string} message The message to encrypt.
-         * @param {WordArray} key The key.
-         * @param {Object} cfg (Optional) The configuration options to use for this operation.
-         *
-         * @return {CipherParams} A cipher params object.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
-         *     var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
-         *     var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
-         */
-        encrypt: function (cipher, message, key, cfg) {
-            // Apply config defaults
-            cfg = this.cfg.extend(cfg);
-
-            // Encrypt
-            var encryptor = cipher.createEncryptor(key, cfg);
-            var ciphertext = encryptor.finalize(message);
-
-            // Shortcut
-            var cipherCfg = encryptor.cfg;
-
-            // Create and return serializable cipher params
-            return CipherParams.create({
-                ciphertext: ciphertext,
-                key: key,
-                iv: cipherCfg.iv,
-                algorithm: cipher,
-                mode: cipherCfg.mode,
-                padding: cipherCfg.padding,
-                blockSize: cipher.blockSize,
-                formatter: cfg.format
-            });
-        },
-
-        /**
-         * Decrypts serialized ciphertext.
-         *
-         * @param {Cipher} cipher The cipher algorithm to use.
-         * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
-         * @param {WordArray} key The key.
-         * @param {Object} cfg (Optional) The configuration options to use for this operation.
-         *
-         * @return {WordArray} The plaintext.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
-         *     var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
-         */
-        decrypt: function (cipher, ciphertext, key, cfg) {
-            // Apply config defaults
-            cfg = this.cfg.extend(cfg);
-
-            // Convert string to CipherParams
-            ciphertext = this._parse(ciphertext, cfg.format);
-
-            // Decrypt
-            var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);
-
-            return plaintext;
-        },
-
-        /**
-         * Converts serialized ciphertext to CipherParams,
-         * else assumed CipherParams already and returns ciphertext unchanged.
-         *
-         * @param {CipherParams|string} ciphertext The ciphertext.
-         * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
-         *
-         * @return {CipherParams} The unserialized ciphertext.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
-         */
-        _parse: function (ciphertext, format) {
-            if (typeof ciphertext == 'string') {
-                return format.parse(ciphertext, this);
-            } else {
-                return ciphertext;
-            }
-        }
-    });
-
-    /**
-     * Key derivation function namespace.
-     */
-    var C_kdf = C.kdf = {};
-
-    /**
-     * OpenSSL key derivation function.
-     */
-    var OpenSSLKdf = C_kdf.OpenSSL = {
-        /**
-         * Derives a key and IV from a password.
-         *
-         * @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.
-         * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
-         *
-         * @return {CipherParams} A cipher params object with the key, IV, and salt.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
-         *     var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
-         */
-        execute: function (password, keySize, ivSize, salt) {
-            // Generate random salt
-            if (!salt) {
-                salt = WordArray.random(64/8);
-            }
-
-            // Derive key and IV
-            var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);
-
-            // Separate key and IV
-            var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
-            key.sigBytes = keySize * 4;
-
-            // Return params
-            return CipherParams.create({ key: key, iv: iv, salt: salt });
-        }
-    };
-
-    /**
-     * A serializable cipher wrapper that derives the key from a password,
-     * and returns ciphertext as a serializable cipher params object.
-     */
-    var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({
-        /**
-         * Configuration options.
-         *
-         * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
-         */
-        cfg: SerializableCipher.cfg.extend({
-            kdf: OpenSSLKdf
-        }),
-
-        /**
-         * Encrypts a message using a password.
-         *
-         * @param {Cipher} cipher The cipher algorithm to use.
-         * @param {WordArray|string} message The message to encrypt.
-         * @param {string} password The password.
-         * @param {Object} cfg (Optional) The configuration options to use for this operation.
-         *
-         * @return {CipherParams} A cipher params object.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
-         *     var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
-         */
-        encrypt: function (cipher, message, password, cfg) {
-            // Apply config defaults
-            cfg = this.cfg.extend(cfg);
-
-            // Derive key and other params
-			// MODIFIED: added cfg.salt param
-            var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, cfg.salt);
-
-            // Add IV to config
-            cfg.iv = derivedParams.iv;
-
-            // Encrypt
-            var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);
-
-            // Mix in derived params
-            ciphertext.mixIn(derivedParams);
-
-            return ciphertext;
-        },
-
-        /**
-         * Decrypts serialized ciphertext using a password.
-         *
-         * @param {Cipher} cipher The cipher algorithm to use.
-         * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
-         * @param {string} password The password.
-         * @param {Object} cfg (Optional) The configuration options to use for this operation.
-         *
-         * @return {WordArray} The plaintext.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
-         *     var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
-         */
-        decrypt: function (cipher, ciphertext, password, cfg) {
-            // Apply config defaults
-            cfg = this.cfg.extend(cfg);
-
-            // Convert string to CipherParams
-            ciphertext = this._parse(ciphertext, cfg.format);
-
-            // Derive key and other params
-            var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);
-
-            // Add IV to config
-            cfg.iv = derivedParams.iv;
-
-            // Decrypt
-            var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);
-
-            return plaintext;
-        }
-    });
-}());

+ 0 - 713
src/js/lib/cryptojs/core.js

@@ -1,713 +0,0 @@
-/** @license
-========================================================================
-  CryptoJS v3.1.2
-  code.google.com/p/crypto-js
-  (c) 2009-2013 by Jeff Mott. All rights reserved.
-  code.google.com/p/crypto-js/wiki/License
-*/
-/**
- * CryptoJS core components.
- */
-var CryptoJS = CryptoJS || (function (Math, undefined) {
-    /**
-     * CryptoJS namespace.
-     */
-    var C = {};
-
-    /**
-     * Library namespace.
-     */
-    var C_lib = C.lib = {};
-
-    /**
-     * Base object for prototypal inheritance.
-     */
-    var Base = C_lib.Base = (function () {
-        function F() {}
-
-        return {
-            /**
-             * Creates a new object that inherits from this object.
-             *
-             * @param {Object} overrides Properties to copy into the new object.
-             *
-             * @return {Object} The new object.
-             *
-             * @static
-             *
-             * @example
-             *
-             *     var MyType = CryptoJS.lib.Base.extend({
-             *         field: 'value',
-             *
-             *         method: function () {
-             *         }
-             *     });
-             */
-            extend: function (overrides) {
-                // Spawn
-                F.prototype = this;
-                var subtype = new F();
-
-                // Augment
-                if (overrides) {
-                    subtype.mixIn(overrides);
-                }
-
-                // Create default initializer
-                if (!subtype.hasOwnProperty('init')) {
-                    subtype.init = function () {
-                        subtype.$super.init.apply(this, arguments);
-                    };
-                }
-
-                // Initializer's prototype is the subtype object
-                subtype.init.prototype = subtype;
-
-                // Reference supertype
-                subtype.$super = this;
-
-                return subtype;
-            },
-
-            /**
-             * Extends this object and runs the init method.
-             * Arguments to create() will be passed to init().
-             *
-             * @return {Object} The new object.
-             *
-             * @static
-             *
-             * @example
-             *
-             *     var instance = MyType.create();
-             */
-            create: function () {
-                var instance = this.extend();
-                instance.init.apply(instance, arguments);
-
-                return instance;
-            },
-
-            /**
-             * Initializes a newly created object.
-             * Override this method to add some logic when your objects are created.
-             *
-             * @example
-             *
-             *     var MyType = CryptoJS.lib.Base.extend({
-             *         init: function () {
-             *             // ...
-             *         }
-             *     });
-             */
-            init: function () {
-            },
-
-            /**
-             * Copies properties into this object.
-             *
-             * @param {Object} properties The properties to mix in.
-             *
-             * @example
-             *
-             *     MyType.mixIn({
-             *         field: 'value'
-             *     });
-             */
-            mixIn: function (properties) {
-                for (var propertyName in properties) {
-                    if (properties.hasOwnProperty(propertyName)) {
-                        this[propertyName] = properties[propertyName];
-                    }
-                }
-
-                // IE won't copy toString using the loop above
-                if (properties.hasOwnProperty('toString')) {
-                    this.toString = properties.toString;
-                }
-            },
-
-            /**
-             * Creates a copy of this object.
-             *
-             * @return {Object} The clone.
-             *
-             * @example
-             *
-             *     var clone = instance.clone();
-             */
-            clone: function () {
-                return this.init.prototype.extend(this);
-            }
-        };
-    }());
-
-    /**
-     * An array of 32-bit words.
-     *
-     * @property {Array} words The array of 32-bit words.
-     * @property {number} sigBytes The number of significant bytes in this word array.
-     */
-    var WordArray = C_lib.WordArray = Base.extend({
-        /**
-         * Initializes a newly created word array.
-         *
-         * @param {Array} words (Optional) An array of 32-bit words.
-         * @param {number} sigBytes (Optional) The number of significant bytes in the words.
-         *
-         * @example
-         *
-         *     var wordArray = CryptoJS.lib.WordArray.create();
-         *     var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
-         *     var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
-         */
-        init: function (words, sigBytes) {
-            words = this.words = words || [];
-
-            if (sigBytes != undefined) {
-                this.sigBytes = sigBytes;
-            } else {
-                this.sigBytes = words.length * 4;
-            }
-        },
-
-        /**
-         * Converts this word array to a string.
-         *
-         * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
-         *
-         * @return {string} The stringified word array.
-         *
-         * @example
-         *
-         *     var string = wordArray + '';
-         *     var string = wordArray.toString();
-         *     var string = wordArray.toString(CryptoJS.enc.Utf8);
-         */
-        toString: function (encoder) {
-            return (encoder || Hex).stringify(this);
-        },
-
-        /**
-         * Concatenates a word array to this word array.
-         *
-         * @param {WordArray} wordArray The word array to append.
-         *
-         * @return {WordArray} This word array.
-         *
-         * @example
-         *
-         *     wordArray1.concat(wordArray2);
-         */
-        concat: function (wordArray) {
-            // Shortcuts
-            var thisWords = this.words;
-            var thatWords = wordArray.words;
-            var thisSigBytes = this.sigBytes;
-            var thatSigBytes = wordArray.sigBytes;
-
-            // Clamp excess bits
-            this.clamp();
-
-            // Concat
-            if (thisSigBytes % 4) {
-                // Copy one byte at a time
-                for (var i = 0; i < thatSigBytes; i++) {
-                    var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
-                    thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
-                }
-            } else if (thatWords.length > 0xffff) {
-                // Copy one word at a time
-                for (var i = 0; i < thatSigBytes; i += 4) {
-                    thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
-                }
-            } else {
-                // Copy all words at once
-                thisWords.push.apply(thisWords, thatWords);
-            }
-            this.sigBytes += thatSigBytes;
-
-            // Chainable
-            return this;
-        },
-
-        /**
-         * Removes insignificant bits.
-         *
-         * @example
-         *
-         *     wordArray.clamp();
-         */
-        clamp: function () {
-            // Shortcuts
-            var words = this.words;
-            var sigBytes = this.sigBytes;
-
-            // Clamp
-            words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
-            words.length = Math.ceil(sigBytes / 4);
-        },
-
-        /**
-         * Creates a copy of this word array.
-         *
-         * @return {WordArray} The clone.
-         *
-         * @example
-         *
-         *     var clone = wordArray.clone();
-         */
-        clone: function () {
-            var clone = Base.clone.call(this);
-            clone.words = this.words.slice(0);
-
-            return clone;
-        },
-
-        /**
-         * Creates a word array filled with random bytes.
-         *
-         * @param {number} nBytes The number of random bytes to generate.
-         *
-         * @return {WordArray} The random word array.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var wordArray = CryptoJS.lib.WordArray.random(16);
-         */
-        random: function (nBytes) {
-            var words = [];
-            for (var i = 0; i < nBytes; i += 4) {
-                words.push((Math.random() * 0x100000000) | 0);
-            }
-
-            return new WordArray.init(words, nBytes);
-        }
-    });
-
-    /**
-     * Encoder namespace.
-     */
-    var C_enc = C.enc = {};
-
-    /**
-     * Hex encoding strategy.
-     */
-    var Hex = C_enc.Hex = {
-        /**
-         * Converts a word array to a hex string.
-         *
-         * @param {WordArray} wordArray The word array.
-         *
-         * @return {string} The hex string.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var hexString = CryptoJS.enc.Hex.stringify(wordArray);
-         */
-        stringify: function (wordArray) {
-            // Shortcuts
-            var words = wordArray.words;
-            var sigBytes = wordArray.sigBytes;
-
-            // Convert
-            var hexChars = [];
-            for (var i = 0; i < sigBytes; i++) {
-                var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
-                hexChars.push((bite >>> 4).toString(16));
-                hexChars.push((bite & 0x0f).toString(16));
-            }
-
-            return hexChars.join('');
-        },
-
-        /**
-         * Converts a hex string to a word array.
-         *
-         * @param {string} hexStr The hex string.
-         *
-         * @return {WordArray} The word array.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var wordArray = CryptoJS.enc.Hex.parse(hexString);
-         */
-        parse: function (hexStr) {
-            // Shortcut
-            var hexStrLength = hexStr.length;
-
-            // Convert
-            var words = [];
-            for (var i = 0; i < hexStrLength; i += 2) {
-                words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
-            }
-
-            return new WordArray.init(words, hexStrLength / 2);
-        }
-    };
-
-    /**
-     * Latin1 encoding strategy.
-     */
-    var Latin1 = C_enc.Latin1 = {
-        /**
-         * Converts a word array to a Latin1 string.
-         *
-         * @param {WordArray} wordArray The word array.
-         *
-         * @return {string} The Latin1 string.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
-         */
-        stringify: function (wordArray) {
-            // Shortcuts
-            var words = wordArray.words;
-            var sigBytes = wordArray.sigBytes;
-
-            // Convert
-            var latin1Chars = [];
-            for (var i = 0; i < sigBytes; i++) {
-                var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
-                latin1Chars.push(String.fromCharCode(bite));
-            }
-
-            return latin1Chars.join('');
-        },
-
-        /**
-         * Converts a Latin1 string to a word array.
-         *
-         * @param {string} latin1Str The Latin1 string.
-         *
-         * @return {WordArray} The word array.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
-         */
-        parse: function (latin1Str) {
-            // Shortcut
-            var latin1StrLength = latin1Str.length;
-
-            // Convert
-            var words = [];
-            for (var i = 0; i < latin1StrLength; i++) {
-                words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
-            }
-
-            return new WordArray.init(words, latin1StrLength);
-        }
-    };
-
-    /**
-     * UTF-8 encoding strategy.
-     */
-    var Utf8 = C_enc.Utf8 = {
-        /**
-         * Converts a word array to a UTF-8 string.
-         *
-         * @param {WordArray} wordArray The word array.
-         *
-         * @return {string} The UTF-8 string.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
-         */
-        stringify: function (wordArray) {
-            try {
-                return decodeURIComponent(escape(Latin1.stringify(wordArray)));
-            } catch (e) {
-                throw new Error('Malformed UTF-8 data');
-            }
-        },
-
-        /**
-         * Converts a UTF-8 string to a word array.
-         *
-         * @param {string} utf8Str The UTF-8 string.
-         *
-         * @return {WordArray} The word array.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
-         */
-        parse: function (utf8Str) {
-            return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
-        }
-    };
-
-    /**
-     * Abstract buffered block algorithm template.
-     *
-     * The property blockSize must be implemented in a concrete subtype.
-     *
-     * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
-     */
-    var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
-        /**
-         * Resets this block algorithm's data buffer to its initial state.
-         *
-         * @example
-         *
-         *     bufferedBlockAlgorithm.reset();
-         */
-        reset: function () {
-            // Initial values
-            this._data = new WordArray.init();
-            this._nDataBytes = 0;
-        },
-
-        /**
-         * Adds new data to this block algorithm's buffer.
-         *
-         * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
-         *
-         * @example
-         *
-         *     bufferedBlockAlgorithm._append('data');
-         *     bufferedBlockAlgorithm._append(wordArray);
-         */
-        _append: function (data) {
-            // Convert string to WordArray, else assume WordArray already
-            if (typeof data == 'string') {
-                data = Utf8.parse(data);
-            }
-
-            // Append
-            this._data.concat(data);
-            this._nDataBytes += data.sigBytes;
-        },
-
-        /**
-         * Processes available data blocks.
-         *
-         * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
-         *
-         * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
-         *
-         * @return {WordArray} The processed data.
-         *
-         * @example
-         *
-         *     var processedData = bufferedBlockAlgorithm._process();
-         *     var processedData = bufferedBlockAlgorithm._process(!!'flush');
-         */
-        _process: function (doFlush) {
-            // Shortcuts
-            var data = this._data;
-            var dataWords = data.words;
-            var dataSigBytes = data.sigBytes;
-            var blockSize = this.blockSize;
-            var blockSizeBytes = blockSize * 4;
-
-            // Count blocks ready
-            var nBlocksReady = dataSigBytes / blockSizeBytes;
-            if (doFlush) {
-                // Round up to include partial blocks
-                nBlocksReady = Math.ceil(nBlocksReady);
-            } else {
-                // Round down to include only full blocks,
-                // less the number of blocks that must remain in the buffer
-                nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
-            }
-
-            // Count words ready
-            var nWordsReady = nBlocksReady * blockSize;
-
-            // Count bytes ready
-            var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
-
-            // Process blocks
-            if (nWordsReady) {
-                for (var offset = 0; offset < nWordsReady; offset += blockSize) {
-                    // Perform concrete-algorithm logic
-                    this._doProcessBlock(dataWords, offset);
-                }
-
-                // Remove processed words
-                var processedWords = dataWords.splice(0, nWordsReady);
-                data.sigBytes -= nBytesReady;
-            }
-
-            // Return processed words
-            return new WordArray.init(processedWords, nBytesReady);
-        },
-
-        /**
-         * Creates a copy of this object.
-         *
-         * @return {Object} The clone.
-         *
-         * @example
-         *
-         *     var clone = bufferedBlockAlgorithm.clone();
-         */
-        clone: function () {
-            var clone = Base.clone.call(this);
-            clone._data = this._data.clone();
-
-            return clone;
-        },
-
-        _minBufferSize: 0
-    });
-
-    /**
-     * Abstract hasher template.
-     *
-     * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
-     */
-    var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
-        /**
-         * Configuration options.
-         */
-        cfg: Base.extend(),
-
-        /**
-         * Initializes a newly created hasher.
-         *
-         * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
-         *
-         * @example
-         *
-         *     var hasher = CryptoJS.algo.SHA256.create();
-         */
-        init: function (cfg) {
-            // Apply config defaults
-            this.cfg = this.cfg.extend(cfg);
-
-            // Set initial values
-            this.reset();
-        },
-
-        /**
-         * Resets this hasher to its initial state.
-         *
-         * @example
-         *
-         *     hasher.reset();
-         */
-        reset: function () {
-            // Reset data buffer
-            BufferedBlockAlgorithm.reset.call(this);
-
-            // Perform concrete-hasher logic
-            this._doReset();
-        },
-
-        /**
-         * Updates this hasher with a message.
-         *
-         * @param {WordArray|string} messageUpdate The message to append.
-         *
-         * @return {Hasher} This hasher.
-         *
-         * @example
-         *
-         *     hasher.update('message');
-         *     hasher.update(wordArray);
-         */
-        update: function (messageUpdate) {
-            // Append
-            this._append(messageUpdate);
-
-            // Update the hash
-            this._process();
-
-            // Chainable
-            return this;
-        },
-
-        /**
-         * Finalizes the hash computation.
-         * Note that the finalize operation is effectively a destructive, read-once operation.
-         *
-         * @param {WordArray|string} messageUpdate (Optional) A final message update.
-         *
-         * @return {WordArray} The hash.
-         *
-         * @example
-         *
-         *     var hash = hasher.finalize();
-         *     var hash = hasher.finalize('message');
-         *     var hash = hasher.finalize(wordArray);
-         */
-        finalize: function (messageUpdate) {
-            // Final message update
-            if (messageUpdate) {
-                this._append(messageUpdate);
-            }
-
-            // Perform concrete-hasher logic
-            var hash = this._doFinalize();
-
-            return hash;
-        },
-
-        blockSize: 512/32,
-
-        /**
-         * Creates a shortcut function to a hasher's object interface.
-         *
-         * @param {Hasher} hasher The hasher to create a helper for.
-         *
-         * @return {Function} The shortcut function.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
-         */
-        _createHelper: function (hasher) {
-            return function (message, cfg) {
-                return new hasher.init(cfg).finalize(message);
-            };
-        },
-
-        /**
-         * Creates a shortcut function to the HMAC's object interface.
-         *
-         * @param {Hasher} hasher The hasher to use in this HMAC helper.
-         *
-         * @return {Function} The shortcut function.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
-         */
-        _createHmacHelper: function (hasher) {
-            return function (message, key) {
-                return new C_algo.HMAC.init(hasher, key).finalize(message);
-            };
-        }
-    });
-
-    /**
-     * Algorithm namespace.
-     */
-    var C_algo = C.algo = {};
-
-    return C;
-}(Math));

+ 0 - 109
src/js/lib/cryptojs/enc-base64.js

@@ -1,109 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-(function () {
-    // Shortcuts
-    var C = CryptoJS;
-    var C_lib = C.lib;
-    var WordArray = C_lib.WordArray;
-    var C_enc = C.enc;
-
-    /**
-     * Base64 encoding strategy.
-     */
-    var Base64 = C_enc.Base64 = {
-        /**
-         * Converts a word array to a Base64 string.
-         *
-         * @param {WordArray} wordArray The word array.
-         *
-         * @return {string} The Base64 string.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var base64String = CryptoJS.enc.Base64.stringify(wordArray);
-         */
-        stringify: function (wordArray) {
-            // Shortcuts
-            var words = wordArray.words;
-            var sigBytes = wordArray.sigBytes;
-            var map = this._map;
-
-            // Clamp excess bits
-            wordArray.clamp();
-
-            // Convert
-            var base64Chars = [];
-            for (var i = 0; i < sigBytes; i += 3) {
-                var byte1 = (words[i >>> 2]       >>> (24 - (i % 4) * 8))       & 0xff;
-                var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;
-                var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;
-
-                var triplet = (byte1 << 16) | (byte2 << 8) | byte3;
-
-                for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {
-                    base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));
-                }
-            }
-
-            // Add padding
-            var paddingChar = map.charAt(64);
-            if (paddingChar) {
-                while (base64Chars.length % 4) {
-                    base64Chars.push(paddingChar);
-                }
-            }
-
-            return base64Chars.join('');
-        },
-
-        /**
-         * Converts a Base64 string to a word array.
-         *
-         * @param {string} base64Str The Base64 string.
-         *
-         * @return {WordArray} The word array.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var wordArray = CryptoJS.enc.Base64.parse(base64String);
-         */
-        parse: function (base64Str) {
-            // Shortcuts
-            var base64StrLength = base64Str.length;
-            var map = this._map;
-
-            // Ignore padding
-            var paddingChar = map.charAt(64);
-            if (paddingChar) {
-                var paddingIndex = base64Str.indexOf(paddingChar);
-                if (paddingIndex != -1) {
-                    base64StrLength = paddingIndex;
-                }
-            }
-
-            // Convert
-            var words = [];
-            var nBytes = 0;
-            for (var i = 0; i < base64StrLength; i++) {
-                if (i % 4) {
-                    var bits1 = map.indexOf(base64Str.charAt(i - 1)) << ((i % 4) * 2);
-                    var bits2 = map.indexOf(base64Str.charAt(i)) >>> (6 - (i % 4) * 2);
-                    words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8);
-                    nBytes++;
-                }
-            }
-
-            return WordArray.create(words, nBytes);
-        },
-
-        _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
-    };
-}());

+ 0 - 135
src/js/lib/cryptojs/enc-utf16.js

@@ -1,135 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-(function () {
-    // Shortcuts
-    var C = CryptoJS;
-    var C_lib = C.lib;
-    var WordArray = C_lib.WordArray;
-    var C_enc = C.enc;
-
-    /**
-     * UTF-16 BE encoding strategy.
-     */
-    var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = {
-        /**
-         * Converts a word array to a UTF-16 BE string.
-         *
-         * @param {WordArray} wordArray The word array.
-         *
-         * @return {string} The UTF-16 BE string.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
-         */
-        stringify: function (wordArray) {
-            // Shortcuts
-            var words = wordArray.words;
-            var sigBytes = wordArray.sigBytes;
-
-            // Convert
-            var utf16Chars = [];
-            for (var i = 0; i < sigBytes; i += 2) {
-                var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff;
-                utf16Chars.push(String.fromCharCode(codePoint));
-            }
-
-            return utf16Chars.join('');
-        },
-
-        /**
-         * Converts a UTF-16 BE string to a word array.
-         *
-         * @param {string} utf16Str The UTF-16 BE string.
-         *
-         * @return {WordArray} The word array.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
-         */
-        parse: function (utf16Str) {
-            // Shortcut
-            var utf16StrLength = utf16Str.length;
-
-            // Convert
-            var words = [];
-            for (var i = 0; i < utf16StrLength; i++) {
-                words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16);
-            }
-
-            return WordArray.create(words, utf16StrLength * 2);
-        }
-    };
-
-    /**
-     * UTF-16 LE encoding strategy.
-     */
-    C_enc.Utf16LE = {
-        /**
-         * Converts a word array to a UTF-16 LE string.
-         *
-         * @param {WordArray} wordArray The word array.
-         *
-         * @return {string} The UTF-16 LE string.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);
-         */
-        stringify: function (wordArray) {
-            // Shortcuts
-            var words = wordArray.words;
-            var sigBytes = wordArray.sigBytes;
-
-            // Convert
-            var utf16Chars = [];
-            for (var i = 0; i < sigBytes; i += 2) {
-                var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff);
-                utf16Chars.push(String.fromCharCode(codePoint));
-            }
-
-            return utf16Chars.join('');
-        },
-
-        /**
-         * Converts a UTF-16 LE string to a word array.
-         *
-         * @param {string} utf16Str The UTF-16 LE string.
-         *
-         * @return {WordArray} The word array.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);
-         */
-        parse: function (utf16Str) {
-            // Shortcut
-            var utf16StrLength = utf16Str.length;
-
-            // Convert
-            var words = [];
-            for (var i = 0; i < utf16StrLength; i++) {
-                words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16));
-            }
-
-            return WordArray.create(words, utf16StrLength * 2);
-        }
-    };
-
-    function swapEndian(word) {
-        return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff);
-    }
-}());

+ 0 - 118
src/js/lib/cryptojs/evpkdf.js

@@ -1,118 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-(function () {
-    // Shortcuts
-    var C = CryptoJS;
-    var C_lib = C.lib;
-    var Base = C_lib.Base;
-    var WordArray = C_lib.WordArray;
-    var C_algo = C.algo;
-    var MD5 = C_algo.MD5;
-
-    /**
-     * This key derivation function is meant to conform with EVP_BytesToKey.
-     * www.openssl.org/docs/crypto/EVP_BytesToKey.html
-     */
-    var EvpKDF = C_algo.EvpKDF = Base.extend({
-        /**
-         * Configuration options.
-         *
-         * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
-         * @property {Hasher} hasher The hash algorithm to use. Default: MD5
-         * @property {number} iterations The number of iterations to perform. Default: 1
-         */
-        cfg: Base.extend({
-            keySize: 128/32,
-            hasher: MD5,
-            iterations: 1
-        }),
-
-        /**
-         * Initializes a newly created key derivation function.
-         *
-         * @param {Object} cfg (Optional) The configuration options to use for the derivation.
-         *
-         * @example
-         *
-         *     var kdf = CryptoJS.algo.EvpKDF.create();
-         *     var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
-         *     var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
-         */
-        init: function (cfg) {
-            this.cfg = this.cfg.extend(cfg);
-        },
-
-        /**
-         * Derives a key from a password.
-         *
-         * @param {WordArray|string} password The password.
-         * @param {WordArray|string} salt A salt.
-         *
-         * @return {WordArray} The derived key.
-         *
-         * @example
-         *
-         *     var key = kdf.compute(password, salt);
-         */
-        compute: function (password, salt) {
-            // Shortcut
-            var cfg = this.cfg;
-
-            // Init hasher
-            var hasher = cfg.hasher.create();
-
-            // Initial values
-            var derivedKey = WordArray.create();
-
-            // Shortcuts
-            var derivedKeyWords = derivedKey.words;
-            var keySize = cfg.keySize;
-            var iterations = cfg.iterations;
-
-            // Generate key
-            while (derivedKeyWords.length < keySize) {
-                if (block) {
-                    hasher.update(block);
-                }
-                var block = hasher.update(password).finalize(salt);
-                hasher.reset();
-
-                // Iterations
-                for (var i = 1; i < iterations; i++) {
-                    block = hasher.finalize(block);
-                    hasher.reset();
-                }
-
-                derivedKey.concat(block);
-            }
-            derivedKey.sigBytes = keySize * 4;
-
-            return derivedKey;
-        }
-    });
-
-    /**
-     * Derives a key from a password.
-     *
-     * @param {WordArray|string} password The password.
-     * @param {WordArray|string} salt A salt.
-     * @param {Object} cfg (Optional) The configuration options to use for this computation.
-     *
-     * @return {WordArray} The derived key.
-     *
-     * @static
-     *
-     * @example
-     *
-     *     var key = CryptoJS.EvpKDF(password, salt);
-     *     var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });
-     *     var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });
-     */
-    C.EvpKDF = function (password, salt, cfg) {
-        return EvpKDF.create(cfg).compute(password, salt);
-    };
-}());

+ 0 - 52
src/js/lib/cryptojs/format-hex.js

@@ -1,52 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-(function (undefined) {
-    // Shortcuts
-    var C = CryptoJS;
-    var C_lib = C.lib;
-    var CipherParams = C_lib.CipherParams;
-    var C_enc = C.enc;
-    var Hex = C_enc.Hex;
-    var C_format = C.format;
-
-    var HexFormatter = C_format.Hex = {
-        /**
-         * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.
-         *
-         * @param {CipherParams} cipherParams The cipher params object.
-         *
-         * @return {string} The hexadecimally encoded string.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var hexString = CryptoJS.format.Hex.stringify(cipherParams);
-         */
-        stringify: function (cipherParams) {
-            return cipherParams.ciphertext.toString(Hex);
-        },
-
-        /**
-         * Converts a hexadecimally encoded ciphertext string to a cipher params object.
-         *
-         * @param {string} input The hexadecimally encoded string.
-         *
-         * @return {CipherParams} The cipher params object.
-         *
-         * @static
-         *
-         * @example
-         *
-         *     var cipherParams = CryptoJS.format.Hex.parse(hexString);
-         */
-        parse: function (input) {
-            var ciphertext = Hex.parse(input);
-            return CipherParams.create({ ciphertext: ciphertext });
-        }
-    };
-}());

+ 0 - 131
src/js/lib/cryptojs/hmac.js

@@ -1,131 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-(function () {
-    // Shortcuts
-    var C = CryptoJS;
-    var C_lib = C.lib;
-    var Base = C_lib.Base;
-    var C_enc = C.enc;
-    var Utf8 = C_enc.Utf8;
-    var C_algo = C.algo;
-
-    /**
-     * HMAC algorithm.
-     */
-    var HMAC = C_algo.HMAC = Base.extend({
-        /**
-         * Initializes a newly created HMAC.
-         *
-         * @param {Hasher} hasher The hash algorithm to use.
-         * @param {WordArray|string} key The secret key.
-         *
-         * @example
-         *
-         *     var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
-         */
-        init: function (hasher, key) {
-            // Init hasher
-            hasher = this._hasher = new hasher.init();
-
-            // Convert string to WordArray, else assume WordArray already
-            if (typeof key == 'string') {
-                key = Utf8.parse(key);
-            }
-
-            // Shortcuts
-            var hasherBlockSize = hasher.blockSize;
-            var hasherBlockSizeBytes = hasherBlockSize * 4;
-
-            // Allow arbitrary length keys
-            if (key.sigBytes > hasherBlockSizeBytes) {
-                key = hasher.finalize(key);
-            }
-
-            // Clamp excess bits
-            key.clamp();
-
-            // Clone key for inner and outer pads
-            var oKey = this._oKey = key.clone();
-            var iKey = this._iKey = key.clone();
-
-            // Shortcuts
-            var oKeyWords = oKey.words;
-            var iKeyWords = iKey.words;
-
-            // XOR keys with pad constants
-            for (var i = 0; i < hasherBlockSize; i++) {
-                oKeyWords[i] ^= 0x5c5c5c5c;
-                iKeyWords[i] ^= 0x36363636;
-            }
-            oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;
-
-            // Set initial values
-            this.reset();
-        },
-
-        /**
-         * Resets this HMAC to its initial state.
-         *
-         * @example
-         *
-         *     hmacHasher.reset();
-         */
-        reset: function () {
-            // Shortcut
-            var hasher = this._hasher;
-
-            // Reset
-            hasher.reset();
-            hasher.update(this._iKey);
-        },
-
-        /**
-         * Updates this HMAC with a message.
-         *
-         * @param {WordArray|string} messageUpdate The message to append.
-         *
-         * @return {HMAC} This HMAC instance.
-         *
-         * @example
-         *
-         *     hmacHasher.update('message');
-         *     hmacHasher.update(wordArray);
-         */
-        update: function (messageUpdate) {
-            this._hasher.update(messageUpdate);
-
-            // Chainable
-            return this;
-        },
-
-        /**
-         * Finalizes the HMAC computation.
-         * Note that the finalize operation is effectively a destructive, read-once operation.
-         *
-         * @param {WordArray|string} messageUpdate (Optional) A final message update.
-         *
-         * @return {WordArray} The HMAC.
-         *
-         * @example
-         *
-         *     var hmac = hmacHasher.finalize();
-         *     var hmac = hmacHasher.finalize('message');
-         *     var hmac = hmacHasher.finalize(wordArray);
-         */
-        finalize: function (messageUpdate) {
-            // Shortcut
-            var hasher = this._hasher;
-
-            // Compute HMAC
-            var innerHash = hasher.finalize(messageUpdate);
-            hasher.reset();
-            var hmac = hasher.finalize(this._oKey.clone().concat(innerHash));
-
-            return hmac;
-        }
-    });
-}());

+ 0 - 62
src/js/lib/cryptojs/lib-typedarrays.js

@@ -1,62 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-(function () {
-    // Check if typed arrays are supported
-    if (typeof ArrayBuffer != 'function') {
-        return;
-    }
-
-    // Shortcuts
-    var C = CryptoJS;
-    var C_lib = C.lib;
-    var WordArray = C_lib.WordArray;
-
-    // Reference original init
-    var superInit = WordArray.init;
-
-    // Augment WordArray.init to handle typed arrays
-    var subInit = WordArray.init = function (typedArray) {
-        // Convert buffers to uint8
-        if (typedArray instanceof ArrayBuffer) {
-            typedArray = new Uint8Array(typedArray);
-        }
-
-        // Convert other array views to uint8
-        if (
-            typedArray instanceof Int8Array ||
-            typedArray instanceof Uint8ClampedArray ||
-            typedArray instanceof Int16Array ||
-            typedArray instanceof Uint16Array ||
-            typedArray instanceof Int32Array ||
-            typedArray instanceof Uint32Array ||
-            typedArray instanceof Float32Array ||
-            typedArray instanceof Float64Array
-        ) {
-            typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
-        }
-
-        // Handle Uint8Array
-        if (typedArray instanceof Uint8Array) {
-            // Shortcut
-            var typedArrayByteLength = typedArray.byteLength;
-
-            // Extract bytes
-            var words = [];
-            for (var i = 0; i < typedArrayByteLength; i++) {
-                words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8);
-            }
-
-            // Initialize this word array
-            superInit.call(this, words, typedArrayByteLength);
-        } else {
-            // Else call normal init
-            superInit.apply(this, arguments);
-        }
-    };
-
-    subInit.prototype = WordArray;
-}());

+ 0 - 254
src/js/lib/cryptojs/md5.js

@@ -1,254 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-(function (Math) {
-    // Shortcuts
-    var C = CryptoJS;
-    var C_lib = C.lib;
-    var WordArray = C_lib.WordArray;
-    var Hasher = C_lib.Hasher;
-    var C_algo = C.algo;
-
-    // Constants table
-    var T = [];
-
-    // Compute constants
-    (function () {
-        for (var i = 0; i < 64; i++) {
-            T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;
-        }
-    }());
-
-    /**
-     * MD5 hash algorithm.
-     */
-    var MD5 = C_algo.MD5 = Hasher.extend({
-        _doReset: function () {
-            this._hash = new WordArray.init([
-                0x67452301, 0xefcdab89,
-                0x98badcfe, 0x10325476
-            ]);
-        },
-
-        _doProcessBlock: function (M, offset) {
-            // Swap endian
-            for (var i = 0; i < 16; i++) {
-                // Shortcuts
-                var offset_i = offset + i;
-                var M_offset_i = M[offset_i];
-
-                M[offset_i] = (
-                    (((M_offset_i << 8)  | (M_offset_i >>> 24)) & 0x00ff00ff) |
-                    (((M_offset_i << 24) | (M_offset_i >>> 8))  & 0xff00ff00)
-                );
-            }
-
-            // Shortcuts
-            var H = this._hash.words;
-
-            var M_offset_0  = M[offset + 0];
-            var M_offset_1  = M[offset + 1];
-            var M_offset_2  = M[offset + 2];
-            var M_offset_3  = M[offset + 3];
-            var M_offset_4  = M[offset + 4];
-            var M_offset_5  = M[offset + 5];
-            var M_offset_6  = M[offset + 6];
-            var M_offset_7  = M[offset + 7];
-            var M_offset_8  = M[offset + 8];
-            var M_offset_9  = M[offset + 9];
-            var M_offset_10 = M[offset + 10];
-            var M_offset_11 = M[offset + 11];
-            var M_offset_12 = M[offset + 12];
-            var M_offset_13 = M[offset + 13];
-            var M_offset_14 = M[offset + 14];
-            var M_offset_15 = M[offset + 15];
-
-            // Working variables
-            var a = H[0];
-            var b = H[1];
-            var c = H[2];
-            var d = H[3];
-
-            // Computation
-            a = FF(a, b, c, d, M_offset_0,  7,  T[0]);
-            d = FF(d, a, b, c, M_offset_1,  12, T[1]);
-            c = FF(c, d, a, b, M_offset_2,  17, T[2]);
-            b = FF(b, c, d, a, M_offset_3,  22, T[3]);
-            a = FF(a, b, c, d, M_offset_4,  7,  T[4]);
-            d = FF(d, a, b, c, M_offset_5,  12, T[5]);
-            c = FF(c, d, a, b, M_offset_6,  17, T[6]);
-            b = FF(b, c, d, a, M_offset_7,  22, T[7]);
-            a = FF(a, b, c, d, M_offset_8,  7,  T[8]);
-            d = FF(d, a, b, c, M_offset_9,  12, T[9]);
-            c = FF(c, d, a, b, M_offset_10, 17, T[10]);
-            b = FF(b, c, d, a, M_offset_11, 22, T[11]);
-            a = FF(a, b, c, d, M_offset_12, 7,  T[12]);
-            d = FF(d, a, b, c, M_offset_13, 12, T[13]);
-            c = FF(c, d, a, b, M_offset_14, 17, T[14]);
-            b = FF(b, c, d, a, M_offset_15, 22, T[15]);
-
-            a = GG(a, b, c, d, M_offset_1,  5,  T[16]);
-            d = GG(d, a, b, c, M_offset_6,  9,  T[17]);
-            c = GG(c, d, a, b, M_offset_11, 14, T[18]);
-            b = GG(b, c, d, a, M_offset_0,  20, T[19]);
-            a = GG(a, b, c, d, M_offset_5,  5,  T[20]);
-            d = GG(d, a, b, c, M_offset_10, 9,  T[21]);
-            c = GG(c, d, a, b, M_offset_15, 14, T[22]);
-            b = GG(b, c, d, a, M_offset_4,  20, T[23]);
-            a = GG(a, b, c, d, M_offset_9,  5,  T[24]);
-            d = GG(d, a, b, c, M_offset_14, 9,  T[25]);
-            c = GG(c, d, a, b, M_offset_3,  14, T[26]);
-            b = GG(b, c, d, a, M_offset_8,  20, T[27]);
-            a = GG(a, b, c, d, M_offset_13, 5,  T[28]);
-            d = GG(d, a, b, c, M_offset_2,  9,  T[29]);
-            c = GG(c, d, a, b, M_offset_7,  14, T[30]);
-            b = GG(b, c, d, a, M_offset_12, 20, T[31]);
-
-            a = HH(a, b, c, d, M_offset_5,  4,  T[32]);
-            d = HH(d, a, b, c, M_offset_8,  11, T[33]);
-            c = HH(c, d, a, b, M_offset_11, 16, T[34]);
-            b = HH(b, c, d, a, M_offset_14, 23, T[35]);
-            a = HH(a, b, c, d, M_offset_1,  4,  T[36]);
-            d = HH(d, a, b, c, M_offset_4,  11, T[37]);
-            c = HH(c, d, a, b, M_offset_7,  16, T[38]);
-            b = HH(b, c, d, a, M_offset_10, 23, T[39]);
-            a = HH(a, b, c, d, M_offset_13, 4,  T[40]);
-            d = HH(d, a, b, c, M_offset_0,  11, T[41]);
-            c = HH(c, d, a, b, M_offset_3,  16, T[42]);
-            b = HH(b, c, d, a, M_offset_6,  23, T[43]);
-            a = HH(a, b, c, d, M_offset_9,  4,  T[44]);
-            d = HH(d, a, b, c, M_offset_12, 11, T[45]);
-            c = HH(c, d, a, b, M_offset_15, 16, T[46]);
-            b = HH(b, c, d, a, M_offset_2,  23, T[47]);
-
-            a = II(a, b, c, d, M_offset_0,  6,  T[48]);
-            d = II(d, a, b, c, M_offset_7,  10, T[49]);
-            c = II(c, d, a, b, M_offset_14, 15, T[50]);
-            b = II(b, c, d, a, M_offset_5,  21, T[51]);
-            a = II(a, b, c, d, M_offset_12, 6,  T[52]);
-            d = II(d, a, b, c, M_offset_3,  10, T[53]);
-            c = II(c, d, a, b, M_offset_10, 15, T[54]);
-            b = II(b, c, d, a, M_offset_1,  21, T[55]);
-            a = II(a, b, c, d, M_offset_8,  6,  T[56]);
-            d = II(d, a, b, c, M_offset_15, 10, T[57]);
-            c = II(c, d, a, b, M_offset_6,  15, T[58]);
-            b = II(b, c, d, a, M_offset_13, 21, T[59]);
-            a = II(a, b, c, d, M_offset_4,  6,  T[60]);
-            d = II(d, a, b, c, M_offset_11, 10, T[61]);
-            c = II(c, d, a, b, M_offset_2,  15, T[62]);
-            b = II(b, c, d, a, M_offset_9,  21, T[63]);
-
-            // Intermediate hash value
-            H[0] = (H[0] + a) | 0;
-            H[1] = (H[1] + b) | 0;
-            H[2] = (H[2] + c) | 0;
-            H[3] = (H[3] + d) | 0;
-        },
-
-        _doFinalize: function () {
-            // Shortcuts
-            var data = this._data;
-            var dataWords = data.words;
-
-            var nBitsTotal = this._nDataBytes * 8;
-            var nBitsLeft = data.sigBytes * 8;
-
-            // Add padding
-            dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
-
-            var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);
-            var nBitsTotalL = nBitsTotal;
-            dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = (
-                (((nBitsTotalH << 8)  | (nBitsTotalH >>> 24)) & 0x00ff00ff) |
-                (((nBitsTotalH << 24) | (nBitsTotalH >>> 8))  & 0xff00ff00)
-            );
-            dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
-                (((nBitsTotalL << 8)  | (nBitsTotalL >>> 24)) & 0x00ff00ff) |
-                (((nBitsTotalL << 24) | (nBitsTotalL >>> 8))  & 0xff00ff00)
-            );
-
-            data.sigBytes = (dataWords.length + 1) * 4;
-
-            // Hash final blocks
-            this._process();
-
-            // Shortcuts
-            var hash = this._hash;
-            var H = hash.words;
-
-            // Swap endian
-            for (var i = 0; i < 4; i++) {
-                // Shortcut
-                var H_i = H[i];
-
-                H[i] = (((H_i << 8)  | (H_i >>> 24)) & 0x00ff00ff) |
-                       (((H_i << 24) | (H_i >>> 8))  & 0xff00ff00);
-            }
-
-            // Return final computed hash
-            return hash;
-        },
-
-        clone: function () {
-            var clone = Hasher.clone.call(this);
-            clone._hash = this._hash.clone();
-
-            return clone;
-        }
-    });
-
-    function FF(a, b, c, d, x, s, t) {
-        var n = a + ((b & c) | (~b & d)) + x + t;
-        return ((n << s) | (n >>> (32 - s))) + b;
-    }
-
-    function GG(a, b, c, d, x, s, t) {
-        var n = a + ((b & d) | (c & ~d)) + x + t;
-        return ((n << s) | (n >>> (32 - s))) + b;
-    }
-
-    function HH(a, b, c, d, x, s, t) {
-        var n = a + (b ^ c ^ d) + x + t;
-        return ((n << s) | (n >>> (32 - s))) + b;
-    }
-
-    function II(a, b, c, d, x, s, t) {
-        var n = a + (c ^ (b | ~d)) + x + t;
-        return ((n << s) | (n >>> (32 - s))) + b;
-    }
-
-    /**
-     * Shortcut function to the hasher's object interface.
-     *
-     * @param {WordArray|string} message The message to hash.
-     *
-     * @return {WordArray} The hash.
-     *
-     * @static
-     *
-     * @example
-     *
-     *     var hash = CryptoJS.MD5('message');
-     *     var hash = CryptoJS.MD5(wordArray);
-     */
-    C.MD5 = Hasher._createHelper(MD5);
-
-    /**
-     * Shortcut function to the HMAC's object interface.
-     *
-     * @param {WordArray|string} message The message to hash.
-     * @param {WordArray|string} key The secret key.
-     *
-     * @return {WordArray} The HMAC.
-     *
-     * @static
-     *
-     * @example
-     *
-     *     var hmac = CryptoJS.HmacMD5(message, key);
-     */
-    C.HmacMD5 = Hasher._createHmacHelper(MD5);
-}(Math));

+ 0 - 64
src/js/lib/cryptojs/mode-cfb.js

@@ -1,64 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-/**
- * Cipher Feedback block mode.
- */
-CryptoJS.mode.CFB = (function () {
-    var CFB = CryptoJS.lib.BlockCipherMode.extend();
-
-    CFB.Encryptor = CFB.extend({
-        processBlock: function (words, offset) {
-            // Shortcuts
-            var cipher = this._cipher;
-            var blockSize = cipher.blockSize;
-
-            generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
-
-            // Remember this block to use with next block
-            this._prevBlock = words.slice(offset, offset + blockSize);
-        }
-    });
-
-    CFB.Decryptor = CFB.extend({
-        processBlock: function (words, offset) {
-            // Shortcuts
-            var cipher = this._cipher;
-            var blockSize = cipher.blockSize;
-
-            // Remember this block to use with next block
-            var thisBlock = words.slice(offset, offset + blockSize);
-
-            generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
-
-            // This block becomes the previous block
-            this._prevBlock = thisBlock;
-        }
-    });
-
-    function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {
-        // Shortcut
-        var iv = this._iv;
-
-        // Generate keystream
-        if (iv) {
-            var keystream = iv.slice(0);
-
-            // Remove IV for subsequent blocks
-            this._iv = undefined;
-        } else {
-            var keystream = this._prevBlock;
-        }
-        cipher.encryptBlock(keystream, 0);
-
-        // Encrypt
-        for (var i = 0; i < blockSize; i++) {
-            words[offset + i] ^= keystream[i];
-        }
-    }
-
-    return CFB;
-}());

+ 0 - 104
src/js/lib/cryptojs/mode-ctr-gladman.js

@@ -1,104 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-/** @license
-========================================================================
-  CryptoJS.mode.CTRGladman
-  Counter block mode compatible with  Dr Brian Gladman fileenc.c
-  derived from CryptoJS.mode.CTR 
-  Jan Hruby jhruby.web@gmail.com
-*/
-CryptoJS.mode.CTRGladman = (function () {
-    var CTRGladman = CryptoJS.lib.BlockCipherMode.extend();
-
-	function incWord(word)
-	{	
-		if (((word >> 24) & 0xff) === 0xff) { //overflow
-		var b1 = (word >> 16)&0xff;
-		var b2 = (word >> 8)&0xff;
-		var b3 = word & 0xff;
-
-		if (b1 === 0xff) // overflow b1
-		{		 
-		b1 = 0;
-		if (b2 === 0xff)
-		{
-			b2 = 0;
-			if (b3 === 0xff)
-			{
-				b3 = 0;
-			}
-			else
-			{
-				++b3;
-			}
-		}
-		else
-		{
-			++b2;
-		}
-		}
-		else
-		{
-		++b1;
-		}
-
-		word = 0;	  	  
-		word += (b1 << 16);
-		word += (b2 << 8);
-		word += b3;	  
-		}
-		else
-		{
-		word += (0x01 << 24);
-		}
-		return word;
-	}
-
-	function incCounter(counter)
-	{
-		if ((counter[0] = incWord(counter[0])) === 0)
-		{
-			// encr_data in fileenc.c from  Dr Brian Gladman's counts only with DWORD j < 8
-			counter[1] = incWord(counter[1]);
-		}
-		return counter;
-	}
-	
-    var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({
-        processBlock: function (words, offset) {
-            // Shortcuts
-            var cipher = this._cipher
-            var blockSize = cipher.blockSize;
-            var iv = this._iv;
-            var counter = this._counter;
-
-            // Generate keystream
-            if (iv) {
-                counter = this._counter = iv.slice(0);
-
-                // Remove IV for subsequent blocks
-                this._iv = undefined;
-            }
-            
-			incCounter(counter);
-			
-			var keystream = counter.slice(0);
-            cipher.encryptBlock(keystream, 0);
-
-            // Encrypt
-            for (var i = 0; i < blockSize; i++) {
-                words[offset + i] ^= keystream[i];
-            }
-        }
-    });
-
-    CTRGladman.Decryptor = Encryptor;
-
-    return CTRGladman;
-}());
-
-

+ 0 - 44
src/js/lib/cryptojs/mode-ctr.js

@@ -1,44 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-/**
- * Counter block mode.
- */
-CryptoJS.mode.CTR = (function () {
-    var CTR = CryptoJS.lib.BlockCipherMode.extend();
-
-    var Encryptor = CTR.Encryptor = CTR.extend({
-        processBlock: function (words, offset) {
-            // Shortcuts
-            var cipher = this._cipher
-            var blockSize = cipher.blockSize;
-            var iv = this._iv;
-            var counter = this._counter;
-
-            // Generate keystream
-            if (iv) {
-                counter = this._counter = iv.slice(0);
-
-                // Remove IV for subsequent blocks
-                this._iv = undefined;
-            }
-            var keystream = counter.slice(0);
-            cipher.encryptBlock(keystream, 0);
-
-            // Increment counter
-            counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0
-
-            // Encrypt
-            for (var i = 0; i < blockSize; i++) {
-                words[offset + i] ^= keystream[i];
-            }
-        }
-    });
-
-    CTR.Decryptor = Encryptor;
-
-    return CTR;
-}());

+ 0 - 26
src/js/lib/cryptojs/mode-ecb.js

@@ -1,26 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-/**
- * Electronic Codebook block mode.
- */
-CryptoJS.mode.ECB = (function () {
-    var ECB = CryptoJS.lib.BlockCipherMode.extend();
-
-    ECB.Encryptor = ECB.extend({
-        processBlock: function (words, offset) {
-            this._cipher.encryptBlock(words, offset);
-        }
-    });
-
-    ECB.Decryptor = ECB.extend({
-        processBlock: function (words, offset) {
-            this._cipher.decryptBlock(words, offset);
-        }
-    });
-
-    return ECB;
-}());

+ 0 - 40
src/js/lib/cryptojs/mode-ofb.js

@@ -1,40 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-/**
- * Output Feedback block mode.
- */
-CryptoJS.mode.OFB = (function () {
-    var OFB = CryptoJS.lib.BlockCipherMode.extend();
-
-    var Encryptor = OFB.Encryptor = OFB.extend({
-        processBlock: function (words, offset) {
-            // Shortcuts
-            var cipher = this._cipher
-            var blockSize = cipher.blockSize;
-            var iv = this._iv;
-            var keystream = this._keystream;
-
-            // Generate keystream
-            if (iv) {
-                keystream = this._keystream = iv.slice(0);
-
-                // Remove IV for subsequent blocks
-                this._iv = undefined;
-            }
-            cipher.encryptBlock(keystream, 0);
-
-            // Encrypt
-            for (var i = 0; i < blockSize; i++) {
-                words[offset + i] ^= keystream[i];
-            }
-        }
-    });
-
-    OFB.Decryptor = Encryptor;
-
-    return OFB;
-}());

+ 0 - 35
src/js/lib/cryptojs/pad-ansix923.js

@@ -1,35 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-/**
- * ANSI X.923 padding strategy.
- */
-CryptoJS.pad.AnsiX923 = {
-    pad: function (data, blockSize) {
-        // Shortcuts
-        var dataSigBytes = data.sigBytes;
-        var blockSizeBytes = blockSize * 4;
-
-        // Count padding bytes
-        var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;
-
-        // Compute last byte position
-        var lastBytePos = dataSigBytes + nPaddingBytes - 1;
-
-        // Pad
-        data.clamp();
-        data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8);
-        data.sigBytes += nPaddingBytes;
-    },
-
-    unpad: function (data) {
-        // Get number of padding bytes from last byte
-        var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
-
-        // Remove padding
-        data.sigBytes -= nPaddingBytes;
-    }
-};

+ 0 - 30
src/js/lib/cryptojs/pad-iso10126.js

@@ -1,30 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-/**
- * ISO 10126 padding strategy.
- */
-CryptoJS.pad.Iso10126 = {
-    pad: function (data, blockSize) {
-        // Shortcut
-        var blockSizeBytes = blockSize * 4;
-
-        // Count padding bytes
-        var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
-
-        // Pad
-        data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).
-             concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
-    },
-
-    unpad: function (data) {
-        // Get number of padding bytes from last byte
-        var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
-
-        // Remove padding
-        data.sigBytes -= nPaddingBytes;
-    }
-};

+ 0 - 26
src/js/lib/cryptojs/pad-iso97971.js

@@ -1,26 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-/**
- * ISO/IEC 9797-1 Padding Method 2.
- */
-CryptoJS.pad.Iso97971 = {
-    pad: function (data, blockSize) {
-        // Add 0x80 byte
-        data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));
-
-        // Zero pad the rest
-        CryptoJS.pad.ZeroPadding.pad(data, blockSize);
-    },
-
-    unpad: function (data) {
-        // Remove zero padding
-        CryptoJS.pad.ZeroPadding.unpad(data);
-
-        // Remove one more byte -- the 0x80 byte
-        data.sigBytes--;
-    }
-};

+ 0 - 16
src/js/lib/cryptojs/pad-nopadding.js

@@ -1,16 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-/**
- * A noop padding strategy.
- */
-CryptoJS.pad.NoPadding = {
-    pad: function () {
-    },
-
-    unpad: function () {
-    }
-};

+ 0 - 31
src/js/lib/cryptojs/pad-zeropadding.js

@@ -1,31 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-/**
- * Zero padding strategy.
- */
-CryptoJS.pad.ZeroPadding = {
-    pad: function (data, blockSize) {
-        // Shortcut
-        var blockSizeBytes = blockSize * 4;
-
-        // Pad
-        data.clamp();
-        data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes);
-    },
-
-    unpad: function (data) {
-        // Shortcut
-        var dataWords = data.words;
-
-        // Unpad
-        var i = data.sigBytes - 1;
-        while (!((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) {
-            i--;
-        }
-        data.sigBytes = i + 1;
-    }
-};

+ 0 - 131
src/js/lib/cryptojs/pbkdf2.js

@@ -1,131 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-(function () {
-    // Shortcuts
-    var C = CryptoJS;
-    var C_lib = C.lib;
-    var Base = C_lib.Base;
-    var WordArray = C_lib.WordArray;
-    var C_algo = C.algo;
-    var SHA1 = C_algo.SHA1;
-    var HMAC = C_algo.HMAC;
-
-    /**
-     * Password-Based Key Derivation Function 2 algorithm.
-     */
-    var PBKDF2 = C_algo.PBKDF2 = Base.extend({
-        /**
-         * Configuration options.
-         *
-         * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
-         * @property {Hasher} hasher The hasher to use. Default: SHA1
-         * @property {number} iterations The number of iterations to perform. Default: 1
-         */
-        cfg: Base.extend({
-            keySize: 128/32,
-            hasher: SHA1,
-            iterations: 1
-        }),
-
-        /**
-         * Initializes a newly created key derivation function.
-         *
-         * @param {Object} cfg (Optional) The configuration options to use for the derivation.
-         *
-         * @example
-         *
-         *     var kdf = CryptoJS.algo.PBKDF2.create();
-         *     var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });
-         *     var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });
-         */
-        init: function (cfg) {
-            this.cfg = this.cfg.extend(cfg);
-        },
-
-        /**
-         * Computes the Password-Based Key Derivation Function 2.
-         *
-         * @param {WordArray|string} password The password.
-         * @param {WordArray|string} salt A salt.
-         *
-         * @return {WordArray} The derived key.
-         *
-         * @example
-         *
-         *     var key = kdf.compute(password, salt);
-         */
-        compute: function (password, salt) {
-            // Shortcut
-            var cfg = this.cfg;
-
-            // Init HMAC
-            var hmac = HMAC.create(cfg.hasher, password);
-
-            // Initial values
-            var derivedKey = WordArray.create();
-            var blockIndex = WordArray.create([0x00000001]);
-
-            // Shortcuts
-            var derivedKeyWords = derivedKey.words;
-            var blockIndexWords = blockIndex.words;
-            var keySize = cfg.keySize;
-            var iterations = cfg.iterations;
-
-            // Generate key
-            while (derivedKeyWords.length < keySize) {
-                var block = hmac.update(salt).finalize(blockIndex);
-                hmac.reset();
-
-                // Shortcuts
-                var blockWords = block.words;
-                var blockWordsLength = blockWords.length;
-
-                // Iterations
-                var intermediate = block;
-                for (var i = 1; i < iterations; i++) {
-                    intermediate = hmac.finalize(intermediate);
-                    hmac.reset();
-
-                    // Shortcut
-                    var intermediateWords = intermediate.words;
-
-                    // XOR intermediate with block
-                    for (var j = 0; j < blockWordsLength; j++) {
-                        blockWords[j] ^= intermediateWords[j];
-                    }
-                }
-
-                derivedKey.concat(block);
-                blockIndexWords[0]++;
-            }
-            derivedKey.sigBytes = keySize * 4;
-
-            return derivedKey;
-        }
-    });
-
-    /**
-     * Computes the Password-Based Key Derivation Function 2.
-     *
-     * @param {WordArray|string} password The password.
-     * @param {WordArray|string} salt A salt.
-     * @param {Object} cfg (Optional) The configuration options to use for this computation.
-     *
-     * @return {WordArray} The derived key.
-     *
-     * @static
-     *
-     * @example
-     *
-     *     var key = CryptoJS.PBKDF2(password, salt);
-     *     var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 });
-     *     var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });
-     */
-    C.PBKDF2 = function (password, salt, cfg) {
-        return PBKDF2.create(cfg).compute(password, salt);
-    };
-}());

+ 0 - 176
src/js/lib/cryptojs/rabbit-legacy.js

@@ -1,176 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-(function () {
-    // Shortcuts
-    var C = CryptoJS;
-    var C_lib = C.lib;
-    var StreamCipher = C_lib.StreamCipher;
-    var C_algo = C.algo;
-
-    // Reusable objects
-    var S  = [];
-    var C_ = [];
-    var G  = [];
-
-    /**
-     * Rabbit stream cipher algorithm.
-     *
-     * This is a legacy version that neglected to convert the key to little-endian.
-     * This error doesn't affect the cipher's security,
-     * but it does affect its compatibility with other implementations.
-     */
-    var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({
-        _doReset: function () {
-            // Shortcuts
-            var K = this._key.words;
-            var iv = this.cfg.iv;
-
-            // Generate initial state values
-            var X = this._X = [
-                K[0], (K[3] << 16) | (K[2] >>> 16),
-                K[1], (K[0] << 16) | (K[3] >>> 16),
-                K[2], (K[1] << 16) | (K[0] >>> 16),
-                K[3], (K[2] << 16) | (K[1] >>> 16)
-            ];
-
-            // Generate initial counter values
-            var C = this._C = [
-                (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
-                (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
-                (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
-                (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
-            ];
-
-            // Carry bit
-            this._b = 0;
-
-            // Iterate the system four times
-            for (var i = 0; i < 4; i++) {
-                nextState.call(this);
-            }
-
-            // Modify the counters
-            for (var i = 0; i < 8; i++) {
-                C[i] ^= X[(i + 4) & 7];
-            }
-
-            // IV setup
-            if (iv) {
-                // Shortcuts
-                var IV = iv.words;
-                var IV_0 = IV[0];
-                var IV_1 = IV[1];
-
-                // Generate four subvectors
-                var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
-                var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
-                var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
-                var i3 = (i2 << 16)  | (i0 & 0x0000ffff);
-
-                // Modify counter values
-                C[0] ^= i0;
-                C[1] ^= i1;
-                C[2] ^= i2;
-                C[3] ^= i3;
-                C[4] ^= i0;
-                C[5] ^= i1;
-                C[6] ^= i2;
-                C[7] ^= i3;
-
-                // Iterate the system four times
-                for (var i = 0; i < 4; i++) {
-                    nextState.call(this);
-                }
-            }
-        },
-
-        _doProcessBlock: function (M, offset) {
-            // Shortcut
-            var X = this._X;
-
-            // Iterate the system
-            nextState.call(this);
-
-            // Generate four keystream words
-            S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
-            S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
-            S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
-            S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
-
-            for (var i = 0; i < 4; i++) {
-                // Swap endian
-                S[i] = (((S[i] << 8)  | (S[i] >>> 24)) & 0x00ff00ff) |
-                       (((S[i] << 24) | (S[i] >>> 8))  & 0xff00ff00);
-
-                // Encrypt
-                M[offset + i] ^= S[i];
-            }
-        },
-
-        blockSize: 128/32,
-
-        ivSize: 64/32
-    });
-
-    function nextState() {
-        // Shortcuts
-        var X = this._X;
-        var C = this._C;
-
-        // Save old counter values
-        for (var i = 0; i < 8; i++) {
-            C_[i] = C[i];
-        }
-
-        // Calculate new counter values
-        C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
-        C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
-        C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
-        C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
-        C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
-        C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
-        C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
-        C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
-        this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
-
-        // Calculate the g-values
-        for (var i = 0; i < 8; i++) {
-            var gx = X[i] + C[i];
-
-            // Construct high and low argument for squaring
-            var ga = gx & 0xffff;
-            var gb = gx >>> 16;
-
-            // Calculate high and low result of squaring
-            var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
-            var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
-
-            // High XOR low
-            G[i] = gh ^ gl;
-        }
-
-        // Calculate new state values
-        X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
-        X[1] = (G[1] + ((G[0] << 8)  | (G[0] >>> 24)) + G[7]) | 0;
-        X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
-        X[3] = (G[3] + ((G[2] << 8)  | (G[2] >>> 24)) + G[1]) | 0;
-        X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
-        X[5] = (G[5] + ((G[4] << 8)  | (G[4] >>> 24)) + G[3]) | 0;
-        X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
-        X[7] = (G[7] + ((G[6] << 8)  | (G[6] >>> 24)) + G[5]) | 0;
-    }
-
-    /**
-     * Shortcut functions to the cipher's object interface.
-     *
-     * @example
-     *
-     *     var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg);
-     *     var plaintext  = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg);
-     */
-    C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);
-}());

+ 0 - 178
src/js/lib/cryptojs/rabbit.js

@@ -1,178 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-(function () {
-    // Shortcuts
-    var C = CryptoJS;
-    var C_lib = C.lib;
-    var StreamCipher = C_lib.StreamCipher;
-    var C_algo = C.algo;
-
-    // Reusable objects
-    var S  = [];
-    var C_ = [];
-    var G  = [];
-
-    /**
-     * Rabbit stream cipher algorithm
-     */
-    var Rabbit = C_algo.Rabbit = StreamCipher.extend({
-        _doReset: function () {
-            // Shortcuts
-            var K = this._key.words;
-            var iv = this.cfg.iv;
-
-            // Swap endian
-            for (var i = 0; i < 4; i++) {
-                K[i] = (((K[i] << 8)  | (K[i] >>> 24)) & 0x00ff00ff) |
-                       (((K[i] << 24) | (K[i] >>> 8))  & 0xff00ff00);
-            }
-
-            // Generate initial state values
-            var X = this._X = [
-                K[0], (K[3] << 16) | (K[2] >>> 16),
-                K[1], (K[0] << 16) | (K[3] >>> 16),
-                K[2], (K[1] << 16) | (K[0] >>> 16),
-                K[3], (K[2] << 16) | (K[1] >>> 16)
-            ];
-
-            // Generate initial counter values
-            var C = this._C = [
-                (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
-                (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
-                (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
-                (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
-            ];
-
-            // Carry bit
-            this._b = 0;
-
-            // Iterate the system four times
-            for (var i = 0; i < 4; i++) {
-                nextState.call(this);
-            }
-
-            // Modify the counters
-            for (var i = 0; i < 8; i++) {
-                C[i] ^= X[(i + 4) & 7];
-            }
-
-            // IV setup
-            if (iv) {
-                // Shortcuts
-                var IV = iv.words;
-                var IV_0 = IV[0];
-                var IV_1 = IV[1];
-
-                // Generate four subvectors
-                var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
-                var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
-                var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
-                var i3 = (i2 << 16)  | (i0 & 0x0000ffff);
-
-                // Modify counter values
-                C[0] ^= i0;
-                C[1] ^= i1;
-                C[2] ^= i2;
-                C[3] ^= i3;
-                C[4] ^= i0;
-                C[5] ^= i1;
-                C[6] ^= i2;
-                C[7] ^= i3;
-
-                // Iterate the system four times
-                for (var i = 0; i < 4; i++) {
-                    nextState.call(this);
-                }
-            }
-        },
-
-        _doProcessBlock: function (M, offset) {
-            // Shortcut
-            var X = this._X;
-
-            // Iterate the system
-            nextState.call(this);
-
-            // Generate four keystream words
-            S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
-            S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
-            S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
-            S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
-
-            for (var i = 0; i < 4; i++) {
-                // Swap endian
-                S[i] = (((S[i] << 8)  | (S[i] >>> 24)) & 0x00ff00ff) |
-                       (((S[i] << 24) | (S[i] >>> 8))  & 0xff00ff00);
-
-                // Encrypt
-                M[offset + i] ^= S[i];
-            }
-        },
-
-        blockSize: 128/32,
-
-        ivSize: 64/32
-    });
-
-    function nextState() {
-        // Shortcuts
-        var X = this._X;
-        var C = this._C;
-
-        // Save old counter values
-        for (var i = 0; i < 8; i++) {
-            C_[i] = C[i];
-        }
-
-        // Calculate new counter values
-        C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
-        C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
-        C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
-        C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
-        C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
-        C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
-        C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
-        C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
-        this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
-
-        // Calculate the g-values
-        for (var i = 0; i < 8; i++) {
-            var gx = X[i] + C[i];
-
-            // Construct high and low argument for squaring
-            var ga = gx & 0xffff;
-            var gb = gx >>> 16;
-
-            // Calculate high and low result of squaring
-            var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
-            var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
-
-            // High XOR low
-            G[i] = gh ^ gl;
-        }
-
-        // Calculate new state values
-        X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
-        X[1] = (G[1] + ((G[0] << 8)  | (G[0] >>> 24)) + G[7]) | 0;
-        X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
-        X[3] = (G[3] + ((G[2] << 8)  | (G[2] >>> 24)) + G[1]) | 0;
-        X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
-        X[5] = (G[5] + ((G[4] << 8)  | (G[4] >>> 24)) + G[3]) | 0;
-        X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
-        X[7] = (G[7] + ((G[6] << 8)  | (G[6] >>> 24)) + G[5]) | 0;
-    }
-
-    /**
-     * Shortcut functions to the cipher's object interface.
-     *
-     * @example
-     *
-     *     var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg);
-     *     var plaintext  = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg);
-     */
-    C.Rabbit = StreamCipher._createHelper(Rabbit);
-}());

+ 0 - 125
src/js/lib/cryptojs/rc4.js

@@ -1,125 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-(function () {
-    // Shortcuts
-    var C = CryptoJS;
-    var C_lib = C.lib;
-    var StreamCipher = C_lib.StreamCipher;
-    var C_algo = C.algo;
-
-    /**
-     * RC4 stream cipher algorithm.
-     */
-    var RC4 = C_algo.RC4 = StreamCipher.extend({
-        _doReset: function () {
-            // Shortcuts
-            var key = this._key;
-            var keyWords = key.words;
-            var keySigBytes = key.sigBytes;
-
-            // Init sbox
-            var S = this._S = [];
-            for (var i = 0; i < 256; i++) {
-                S[i] = i;
-            }
-
-            // Key setup
-            for (var i = 0, j = 0; i < 256; i++) {
-                var keyByteIndex = i % keySigBytes;
-                var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff;
-
-                j = (j + S[i] + keyByte) % 256;
-
-                // Swap
-                var t = S[i];
-                S[i] = S[j];
-                S[j] = t;
-            }
-
-            // Counters
-            this._i = this._j = 0;
-        },
-
-        _doProcessBlock: function (M, offset) {
-            M[offset] ^= generateKeystreamWord.call(this);
-        },
-
-        keySize: 256/32,
-
-        ivSize: 0
-    });
-
-    function generateKeystreamWord() {
-        // Shortcuts
-        var S = this._S;
-        var i = this._i;
-        var j = this._j;
-
-        // Generate keystream word
-        var keystreamWord = 0;
-        for (var n = 0; n < 4; n++) {
-            i = (i + 1) % 256;
-            j = (j + S[i]) % 256;
-
-            // Swap
-            var t = S[i];
-            S[i] = S[j];
-            S[j] = t;
-
-            keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8);
-        }
-
-        // Update counters
-        this._i = i;
-        this._j = j;
-
-        return keystreamWord;
-    }
-
-    /**
-     * Shortcut functions to the cipher's object interface.
-     *
-     * @example
-     *
-     *     var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);
-     *     var plaintext  = CryptoJS.RC4.decrypt(ciphertext, key, cfg);
-     */
-    C.RC4 = StreamCipher._createHelper(RC4);
-
-    /**
-     * Modified RC4 stream cipher algorithm.
-     */
-    var RC4Drop = C_algo.RC4Drop = RC4.extend({
-        /**
-         * Configuration options.
-         *
-         * @property {number} drop The number of keystream words to drop. Default 192
-         */
-        cfg: RC4.cfg.extend({
-            drop: 192
-        }),
-
-        _doReset: function () {
-            RC4._doReset.call(this);
-
-            // Drop
-            for (var i = this.cfg.drop; i > 0; i--) {
-                generateKeystreamWord.call(this);
-            }
-        }
-    });
-
-    /**
-     * Shortcut functions to the cipher's object interface.
-     *
-     * @example
-     *
-     *     var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);
-     *     var plaintext  = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);
-     */
-    C.RC4Drop = StreamCipher._createHelper(RC4Drop);
-}());

+ 0 - 255
src/js/lib/cryptojs/ripemd160.js

@@ -1,255 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-/** @license
-========================================================================
-  RIPEMD160
-  (c) 2012 by Cédric Mesnil. All rights reserved.
-
-  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-    - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-    - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-(function (Math) {
-    // Shortcuts
-    var C = CryptoJS;
-    var C_lib = C.lib;
-    var WordArray = C_lib.WordArray;
-    var Hasher = C_lib.Hasher;
-    var C_algo = C.algo;
-
-    // Constants table
-    var _zl = WordArray.create([
-        0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
-        7,  4, 13,  1, 10,  6, 15,  3, 12,  0,  9,  5,  2, 14, 11,  8,
-        3, 10, 14,  4,  9, 15,  8,  1,  2,  7,  0,  6, 13, 11,  5, 12,
-        1,  9, 11, 10,  0,  8, 12,  4, 13,  3,  7, 15, 14,  5,  6,  2,
-        4,  0,  5,  9,  7, 12,  2, 10, 14,  1,  3,  8, 11,  6, 15, 13]);
-    var _zr = WordArray.create([
-        5, 14,  7,  0,  9,  2, 11,  4, 13,  6, 15,  8,  1, 10,  3, 12,
-        6, 11,  3,  7,  0, 13,  5, 10, 14, 15,  8, 12,  4,  9,  1,  2,
-        15,  5,  1,  3,  7, 14,  6,  9, 11,  8, 12,  2, 10,  0,  4, 13,
-        8,  6,  4,  1,  3, 11, 15,  0,  5, 12,  2, 13,  9,  7, 10, 14,
-        12, 15, 10,  4,  1,  5,  8,  7,  6,  2, 13, 14,  0,  3,  9, 11]);
-    var _sl = WordArray.create([
-         11, 14, 15, 12,  5,  8,  7,  9, 11, 13, 14, 15,  6,  7,  9,  8,
-        7, 6,   8, 13, 11,  9,  7, 15,  7, 12, 15,  9, 11,  7, 13, 12,
-        11, 13,  6,  7, 14,  9, 13, 15, 14,  8, 13,  6,  5, 12,  7,  5,
-          11, 12, 14, 15, 14, 15,  9,  8,  9, 14,  5,  6,  8,  6,  5, 12,
-        9, 15,  5, 11,  6,  8, 13, 12,  5, 12, 13, 14, 11,  8,  5,  6 ]);
-    var _sr = WordArray.create([
-        8,  9,  9, 11, 13, 15, 15,  5,  7,  7,  8, 11, 14, 14, 12,  6,
-        9, 13, 15,  7, 12,  8,  9, 11,  7,  7, 12,  7,  6, 15, 13, 11,
-        9,  7, 15, 11,  8,  6,  6, 14, 12, 13,  5, 14, 13, 13,  7,  5,
-        15,  5,  8, 11, 14, 14,  6, 14,  6,  9, 12,  9, 12,  5, 15,  8,
-        8,  5, 12,  9, 12,  5, 14,  6,  8, 13,  6,  5, 15, 13, 11, 11 ]);
-
-    var _hl =  WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]);
-    var _hr =  WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]);
-
-    /**
-     * RIPEMD160 hash algorithm.
-     */
-    var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({
-        _doReset: function () {
-            this._hash  = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);
-        },
-
-        _doProcessBlock: function (M, offset) {
-
-            // Swap endian
-            for (var i = 0; i < 16; i++) {
-                // Shortcuts
-                var offset_i = offset + i;
-                var M_offset_i = M[offset_i];
-
-                // Swap
-                M[offset_i] = (
-                    (((M_offset_i << 8)  | (M_offset_i >>> 24)) & 0x00ff00ff) |
-                    (((M_offset_i << 24) | (M_offset_i >>> 8))  & 0xff00ff00)
-                );
-            }
-            // Shortcut
-            var H  = this._hash.words;
-            var hl = _hl.words;
-            var hr = _hr.words;
-            var zl = _zl.words;
-            var zr = _zr.words;
-            var sl = _sl.words;
-            var sr = _sr.words;
-
-            // Working variables
-            var al, bl, cl, dl, el;
-            var ar, br, cr, dr, er;
-
-            ar = al = H[0];
-            br = bl = H[1];
-            cr = cl = H[2];
-            dr = dl = H[3];
-            er = el = H[4];
-            // Computation
-            var t;
-            for (var i = 0; i < 80; i += 1) {
-                t = (al +  M[offset+zl[i]])|0;
-                if (i<16){
-	            t +=  f1(bl,cl,dl) + hl[0];
-                } else if (i<32) {
-	            t +=  f2(bl,cl,dl) + hl[1];
-                } else if (i<48) {
-	            t +=  f3(bl,cl,dl) + hl[2];
-                } else if (i<64) {
-	            t +=  f4(bl,cl,dl) + hl[3];
-                } else {// if (i<80) {
-	            t +=  f5(bl,cl,dl) + hl[4];
-                }
-                t = t|0;
-                t =  rotl(t,sl[i]);
-                t = (t+el)|0;
-                al = el;
-                el = dl;
-                dl = rotl(cl, 10);
-                cl = bl;
-                bl = t;
-
-                t = (ar + M[offset+zr[i]])|0;
-                if (i<16){
-	            t +=  f5(br,cr,dr) + hr[0];
-                } else if (i<32) {
-	            t +=  f4(br,cr,dr) + hr[1];
-                } else if (i<48) {
-	            t +=  f3(br,cr,dr) + hr[2];
-                } else if (i<64) {
-	            t +=  f2(br,cr,dr) + hr[3];
-                } else {// if (i<80) {
-	            t +=  f1(br,cr,dr) + hr[4];
-                }
-                t = t|0;
-                t =  rotl(t,sr[i]) ;
-                t = (t+er)|0;
-                ar = er;
-                er = dr;
-                dr = rotl(cr, 10);
-                cr = br;
-                br = t;
-            }
-            // Intermediate hash value
-            t    = (H[1] + cl + dr)|0;
-            H[1] = (H[2] + dl + er)|0;
-            H[2] = (H[3] + el + ar)|0;
-            H[3] = (H[4] + al + br)|0;
-            H[4] = (H[0] + bl + cr)|0;
-            H[0] =  t;
-        },
-
-        _doFinalize: function () {
-            // Shortcuts
-            var data = this._data;
-            var dataWords = data.words;
-
-            var nBitsTotal = this._nDataBytes * 8;
-            var nBitsLeft = data.sigBytes * 8;
-
-            // Add padding
-            dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
-            dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
-                (((nBitsTotal << 8)  | (nBitsTotal >>> 24)) & 0x00ff00ff) |
-                (((nBitsTotal << 24) | (nBitsTotal >>> 8))  & 0xff00ff00)
-            );
-            data.sigBytes = (dataWords.length + 1) * 4;
-
-            // Hash final blocks
-            this._process();
-
-            // Shortcuts
-            var hash = this._hash;
-            var H = hash.words;
-
-            // Swap endian
-            for (var i = 0; i < 5; i++) {
-                // Shortcut
-                var H_i = H[i];
-
-                // Swap
-                H[i] = (((H_i << 8)  | (H_i >>> 24)) & 0x00ff00ff) |
-                       (((H_i << 24) | (H_i >>> 8))  & 0xff00ff00);
-            }
-
-            // Return final computed hash
-            return hash;
-        },
-
-        clone: function () {
-            var clone = Hasher.clone.call(this);
-            clone._hash = this._hash.clone();
-
-            return clone;
-        }
-    });
-
-
-    function f1(x, y, z) {
-        return ((x) ^ (y) ^ (z));
-
-    }
-
-    function f2(x, y, z) {
-        return (((x)&(y)) | ((~x)&(z)));
-    }
-
-    function f3(x, y, z) {
-        return (((x) | (~(y))) ^ (z));
-    }
-
-    function f4(x, y, z) {
-        return (((x) & (z)) | ((y)&(~(z))));
-    }
-
-    function f5(x, y, z) {
-        return ((x) ^ ((y) |(~(z))));
-
-    }
-
-    function rotl(x,n) {
-        return (x<<n) | (x>>>(32-n));
-    }
-
-
-    /**
-     * Shortcut function to the hasher's object interface.
-     *
-     * @param {WordArray|string} message The message to hash.
-     *
-     * @return {WordArray} The hash.
-     *
-     * @static
-     *
-     * @example
-     *
-     *     var hash = CryptoJS.RIPEMD160('message');
-     *     var hash = CryptoJS.RIPEMD160(wordArray);
-     */
-    C.RIPEMD160 = Hasher._createHelper(RIPEMD160);
-
-    /**
-     * Shortcut function to the HMAC's object interface.
-     *
-     * @param {WordArray|string} message The message to hash.
-     * @param {WordArray|string} key The secret key.
-     *
-     * @return {WordArray} The HMAC.
-     *
-     * @static
-     *
-     * @example
-     *
-     *     var hmac = CryptoJS.HmacRIPEMD160(message, key);
-     */
-    C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);
-}(Math));

+ 0 - 136
src/js/lib/cryptojs/sha1.js

@@ -1,136 +0,0 @@
-/*
-CryptoJS v3.1.2
-code.google.com/p/crypto-js
-(c) 2009-2013 by Jeff Mott. All rights reserved.
-code.google.com/p/crypto-js/wiki/License
-*/
-(function () {
-    // Shortcuts
-    var C = CryptoJS;
-    var C_lib = C.lib;
-    var WordArray = C_lib.WordArray;
-    var Hasher = C_lib.Hasher;
-    var C_algo = C.algo;
-
-    // Reusable object
-    var W = [];
-
-    /**
-     * SHA-1 hash algorithm.
-     */
-    var SHA1 = C_algo.SHA1 = Hasher.extend({
-        _doReset: function () {
-            this._hash = new WordArray.init([
-                0x67452301, 0xefcdab89,
-                0x98badcfe, 0x10325476,
-                0xc3d2e1f0
-            ]);
-        },
-
-        _doProcessBlock: function (M, offset) {
-            // Shortcut
-            var H = this._hash.words;
-
-            // Working variables
-            var a = H[0];
-            var b = H[1];
-            var c = H[2];
-            var d = H[3];
-            var e = H[4];
-
-            // Computation
-            for (var i = 0; i < 80; i++) {
-                if (i < 16) {
-                    W[i] = M[offset + i] | 0;
-                } else {
-                    var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
-                    W[i] = (n << 1) | (n >>> 31);
-                }
-
-                var t = ((a << 5) | (a >>> 27)) + e + W[i];
-                if (i < 20) {
-                    t += ((b & c) | (~b & d)) + 0x5a827999;
-                } else if (i < 40) {
-                    t += (b ^ c ^ d) + 0x6ed9eba1;
-                } else if (i < 60) {
-                    t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;
-                } else /* if (i < 80) */ {
-                    t += (b ^ c ^ d) - 0x359d3e2a;
-                }
-
-                e = d;
-                d = c;
-                c = (b << 30) | (b >>> 2);
-                b = a;
-                a = t;
-            }
-
-            // Intermediate hash value
-            H[0] = (H[0] + a) | 0;
-            H[1] = (H[1] + b) | 0;
-            H[2] = (H[2] + c) | 0;
-            H[3] = (H[3] + d) | 0;
-            H[4] = (H[4] + e) | 0;
-        },
-
-        _doFinalize: function () {
-            // Shortcuts
-            var data = this._data;
-            var dataWords = data.words;
-
-            var nBitsTotal = this._nDataBytes * 8;
-            var nBitsLeft = data.sigBytes * 8;
-
-            // Add padding
-            dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
-            dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
-            dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
-            data.sigBytes = dataWords.length * 4;
-
-            // Hash final blocks
-            this._process();
-
-            // Return final computed hash
-            return this._hash;
-        },
-
-        clone: function () {
-            var clone = Hasher.clone.call(this);
-            clone._hash = this._hash.clone();
-
-            return clone;
-        }
-    });
-
-    /**
-     * Shortcut function to the hasher's object interface.
-     *
-     * @param {WordArray|string} message The message to hash.
-     *
-     * @return {WordArray} The hash.
-     *
-     * @static
-     *
-     * @example
-     *
-     *     var hash = CryptoJS.SHA1('message');
-     *     var hash = CryptoJS.SHA1(wordArray);
-     */
-    C.SHA1 = Hasher._createHelper(SHA1);
-
-    /**
-     * Shortcut function to the HMAC's object interface.
-     *
-     * @param {WordArray|string} message The message to hash.
-     * @param {WordArray|string} key The secret key.
-     *
-     * @return {WordArray} The HMAC.
-     *
-     * @static
-     *
-     * @example
-     *
-     *     var hmac = CryptoJS.HmacSHA1(message, key);
-     */
-    C.HmacSHA1 = Hasher._createHmacHelper(SHA1);
-}());

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio