-
This site will encrypt a file in your browser using the Triplesec library with a random key generated for you by the SJCL library PRNG.
+
This site will encrypt a file in your browser using the Triplesec library with a random key generated for you by its PRNG.
The encrypted data is uploaded to us and you get a unique URL that will allow someone to download and decrypt your file.
Files are removed from the server as soon as they are downloaded or once they are over 24hrs old.
Disclaimer: This is just an experiment, if you have something important to encrypt you should probably aim to know much more about encryption than me.
@@ -81,7 +62,7 @@
@@ -92,11 +73,11 @@
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
ga('create', 'UA-46060890-1', 'auto');
ga('send', 'pageview');
-
+
+
\ No newline at end of file
diff --git a/public/js/app.js b/public/js/app.js
new file mode 100644
index 0000000..943dcc8
--- /dev/null
+++ b/public/js/app.js
@@ -0,0 +1,463 @@
+var sendshit = angular.module('sendsh.it', ['ngRoute', 'ngSanitize', 'ngProgressLite']);
+
+sendshit.config(['$routeProvider', 'ngProgressLiteProvider', function($routeProvider, ngProgressLiteProvider) {
+
+ if(!window.FileReader || !window.FormData || !window.Blob) {
+ throw new Error('Your browser does not support required features.');
+ }
+
+ $routeProvider.when('/', {
+
+ controller: 'UploadController',
+ templateUrl: 'views/upload.html'
+
+ }).when('/:downloadId/:downloadPassword', {
+
+ controller: 'DownloadController',
+ templateUrl: 'views/download.html'
+
+ }).otherwise({
+
+ redirectTo: '/'
+
+ });
+
+ ngProgressLiteProvider.settings.speed = 1;
+ ngProgressLiteProvider.settings.minimum = 0.1;
+ ngProgressLiteProvider.settings.ease = 'linear';
+
+}]);
+
+sendshit.factory('messages', ['$rootScope', function($rootScope){
+
+ var message = '';
+ var messages = {};
+
+ messages.addMsg = function(msg, ellipsis) {
+
+ ellipsis = typeof ellipsis !== 'undefined' ? ellipsis : false;
+
+ if(ellipsis === true) {
+ msg = msg + '
...';
+ }
+
+ message = msg;
+
+ $rootScope.$broadcast('message:updated', message);
+
+ };
+
+ messages.getMsg = function() {
+ return message;
+ };
+
+ return messages;
+
+}]);
+
+sendshit.factory('triplesecProgress', ['$log', 'ngProgressLite', function($log, ngProgressLite) {
+
+ var triplesecProgress = {};
+
+ triplesecProgress.updateProgress = function(obj) {
+
+ var percent = obj.i / obj.total;
+
+ if(obj.what == 'pbkdf2 (pass 1)' || obj.what == 'pbkdf2 (pass 2)'){
+ this.logProgress('Running PBKDF2', percent);
+ }
+
+ if(obj.what == 'scrypt'){
+ this.logProgress('Scrypt', percent);
+ }
+
+ if(obj.what == 'salsa20'){
+ this.logProgress('Salsa20', percent);
+ }
+
+ if(obj.what == 'twofish'){
+ this.logProgress('Twofish-CTR', percent);
+ }
+
+ if(obj.what == 'aes'){
+ this.logProgress('AES-256-CTR', percent);
+ }
+
+ if(obj.what == 'HMAC-SHA512-SHA3'){
+ this.logProgress('Generating HMAC', percent);
+ }
+
+ };
+
+ triplesecProgress.logProgress = function(text, percent)
+ {
+ $log.log(text + ': ' + Math.round(percent * 100) + '%');
+ ngProgressLite.set(parseFloat(percent.toFixed(1)));
+ };
+
+ return triplesecProgress;
+
+}]);
+sendshit.controller('DownloadController', ['$scope', '$routeParams', 'decryptor', 'fileReader', 'messages', function($scope, $routeParams, decryptor, fileReader, messages) {
+
+ var password = $routeParams.downloadPassword;
+
+ decryptor.downloadFile('download?id=' + $routeParams.downloadId).then(function(data) {
+
+ var blob = new Blob([data], {type: 'application/octet-stream'});
+
+ return fileReader.readAsText(blob);
+
+ }).then(function(file) {
+
+ return decryptor.decryptFile(file, password);
+
+ }).then(function(decrypted) {
+
+ messages.addMsg('Done');
+ saveAs(decrypted.blob, decrypted.name);
+
+ }, function(error) {
+
+ messages.addMsg(error);
+
+ });
+
+ $scope.$on('message:updated', function(event, message) {
+ $scope.message = message;
+ });
+
+}]);
+sendshit.controller('UploadController', ['$scope', '$q', 'encryptor', 'fileReader', 'messages', function($scope, $q, encryptor, fileReader, messages) {
+
+ $scope.fileUploaded = false;
+
+ $scope.uploadFile = function(event) {
+
+ var file = $scope.uploadedFile;
+
+ if(file.size > 5000000) {
+ messages.addMsg('File must be under 5MB');
+ return false;
+ }
+
+ $scope.uploadFieldText = file.name;
+
+ $q.all([fileReader.readAsDataUrl(file), encryptor.generateKey()]).then(function(data){
+
+ return encryptor.encryptFile(data[0].name, data[0].reader, data[1]);
+
+ }).then(function(encrypted) {
+
+ return encryptor.uploadFile(encrypted);
+
+ }).then(function(link) {
+
+ $scope.fileUploaded = true;
+ $scope.uploadLink = link;
+
+ }, function(error) {
+
+ messages.addMsg(error);
+
+ });
+
+ };
+
+ $scope.$on('message:updated', function(event, message) {
+ $scope.message = message;
+ });
+
+}]);
+sendshit.directive('selectOnClick', function () {
+ return {
+ restrict: 'A',
+ link: function (scope, element) {
+ var focusedElement;
+ element.on('click', function () {
+ if (focusedElement != this) {
+ this.select();
+ focusedElement = this;
+ }
+ });
+ element.on('blur', function () {
+ focusedElement = null;
+ });
+ }
+ };
+});
+sendshit.directive('uploadOnChange', function() {
+ return {
+ require:"ngModel",
+ restrict: 'A',
+ link: function($scope, el, attrs, ngModel){
+ el.bind('change', function(event){
+ ngModel.$setViewValue(event.target.files[0]);
+ $scope.$apply();
+ });
+ }
+ };
+});
+sendshit.service('decryptor', ['$http', '$q', 'messages', 'triplesecProgress', function ($http, $q, messages, triplesecProgress) {
+
+ var downloadFile = function(url) {
+
+ var deferred = $q.defer();
+
+ messages.addMsg('Downloading', true);
+
+ var httpPromise = $http.get(url).then(function(response) {
+
+ if(response.data.error){
+
+ deferred.reject(response.data.error);
+
+ } else {
+
+ messages.addMsg('Downloaded');
+ deferred.resolve(response.data);
+
+ }
+
+ }, function(error) {
+
+ deferred.reject(error.data);
+
+ });
+
+ return deferred.promise;
+
+ };
+
+ var decryptFile = function(file, password) {
+
+ var deferred = $q.defer();
+
+ messages.addMsg('Decrypting', true);
+
+ triplesec.decrypt ({
+
+ data: new triplesec.Buffer(file, 'hex'),
+ key: new triplesec.Buffer(password),
+
+ progress_hook: function (obj) {
+ triplesecProgress.updateProgress(obj);
+ }
+
+ }, function (err, buff) {
+
+ if (err) {
+ return deferred.reject(err.message);
+ }
+
+ messages.addMsg('Decrypted');
+
+ var decrypted = JSON.parse(buff.toString());
+ var mimeString = decrypted.file.split(',')[0].split(':')[1].split(';')[0];
+ var blob = b64toBlob(decrypted.file.split(',')[1], mimeString);
+
+ deferred.resolve({
+ blob: blob,
+ name: decrypted.name
+ });
+
+ });
+
+ return deferred.promise;
+
+ };
+
+ // http://stackoverflow.com/a/16245768
+ var b64toBlob = function (b64Data, contentType, sliceSize) {
+
+ contentType = contentType || '';
+ sliceSize = sliceSize || 512;
+
+ var byteCharacters = atob(b64Data);
+ var byteArrays = [];
+
+ for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {
+
+ var slice = byteCharacters.slice(offset, offset + sliceSize);
+
+ var byteNumbers = new Array(slice.length);
+
+ for (var i = 0; i < slice.length; i++) {
+ byteNumbers[i] = slice.charCodeAt(i);
+ }
+
+ var byteArray = new Uint8Array(byteNumbers);
+
+ byteArrays.push(byteArray);
+
+ }
+
+ var blob = new Blob(byteArrays, {type: contentType});
+
+ return blob;
+
+ };
+
+ return {
+ downloadFile: downloadFile,
+ decryptFile: decryptFile
+ };
+
+}]);
+sendshit.service('encryptor', ['$http', '$q', 'messages', 'triplesecProgress', function ($http, $q, messages, triplesecProgress) {
+
+ var password;
+
+ var generateKey = function() {
+
+ var deferred = $q.defer();
+
+ messages.addMsg('Generating key');
+
+ triplesec.prng.generate(24, function(words) {
+
+ password = words.to_hex();
+ deferred.resolve(password);
+
+ });
+
+ return deferred.promise;
+
+ };
+
+ var encryptFile = function(name, file, password) {
+
+ var deferred = $q.defer();
+
+ messages.addMsg('Encrypting', true);
+
+ triplesec.encrypt({
+
+ data: new triplesec.Buffer(JSON.stringify({
+ file: file,
+ name: name
+ })),
+
+ key: new triplesec.Buffer(password),
+
+ progress_hook: function (obj) {
+ triplesecProgress.updateProgress(obj);
+ }
+
+ }, function(err, buff) {
+
+ if (err) {
+ return deferred.reject(err.message);
+ }
+
+ messages.addMsg('Encrypted');
+ deferred.resolve(buff.toString('hex'));
+
+ });
+
+ return deferred.promise;
+
+ };
+
+ var uploadFile = function(encrypted) {
+
+ var deferred = $q.defer();
+
+ messages.addMsg('Uploading', true);
+
+ var xhr = new XMLHttpRequest();
+ var formData = new FormData();
+ var blob = new Blob([encrypted], { type: 'application/octet-stream'});
+
+ formData.append('file', blob, 'encrypted');
+
+ xhr.upload.onprogress = function(e) {
+
+ triplesecProgress.logProgress('Uploading', e.loaded/e.total);
+
+ };
+
+ xhr.onreadystatechange = function(e) {
+
+ if (xhr.readyState == 4) {
+
+ if (xhr.status === 200) {
+
+ messages.addMsg('Done');
+ return deferred.resolve(location.origin + '/#/' + JSON.parse(xhr.response).id + '/' + password);
+
+ } else {
+
+ return deferred.reject("Error", xhr.statusText);
+
+ }
+ }
+ };
+
+ xhr.open('POST', 'upload', true);
+ xhr.send(formData);
+
+ return deferred.promise;
+
+ };
+
+ return {
+ generateKey: generateKey,
+ encryptFile: encryptFile,
+ uploadFile: uploadFile
+ };
+
+}]);
+sendshit.factory('fileReader', function($q, $window) {
+
+ var readAsDataUrl = function(file) {
+
+ var deferred = $q.defer();
+
+ var reader = new $window.FileReader();
+
+ reader.onload = function(reader) {
+
+ deferred.resolve({
+ name: file.name,
+ reader: reader.target.result
+ });
+
+ };
+
+ reader.onerror = function(event) {
+ deferred.reject(event.target.error.name);
+ };
+
+ reader.readAsDataURL(file);
+
+ return deferred.promise;
+
+ };
+
+ var readAsText = function(blob) {
+
+ var deferred = $q.defer();
+
+ var reader = new $window.FileReader();
+
+ reader.onload = function(reader) {
+ deferred.resolve(reader.target.result);
+ };
+
+ reader.onerror = function(event) {
+ deferred.reject(event.target.error.name);
+ };
+
+ reader.readAsText(blob);
+
+ return deferred.promise;
+
+ };
+
+ return {
+ readAsDataUrl: readAsDataUrl,
+ readAsText: readAsText
+ };
+
+});
\ No newline at end of file
diff --git a/public/js/script.js b/public/js/script.js
deleted file mode 100644
index c410fcd..0000000
--- a/public/js/script.js
+++ /dev/null
@@ -1,326 +0,0 @@
-if(!window.FileReader || !window.FormData || !window.File || !window.Blob) {
- sendshit.logMessage('Your browser does not support required features.');
-}
-
-var hash = location.href.substr(location.href.indexOf('#')+1);
-
-sjcl.random.startCollectors();
-
-$(function() {
-
- $('#encrypt-input').bootstrapFileInput();
-
- if(hash != location.href) {
-
- sendshit.download(hash.split('/')[0], hash.split('/')[1]);
-
- } else {
-
- $('.encrypt').removeClass('hide');
-
- $('#encrypt-input').change(function(e) {
-
- var files = e.target.files;
-
- if(files.length != 1) {
- sendshit.logMessage('Please select a file to encrypt!');
- return false;
- }
-
- var file = e.target.files[0];
-
- if(file.size > 5000000) {
- sendshit.logMessage('File must be under 5MB');
- return false;
- }
-
- sendshit.logMessage('Generating key', true);
-
- if (sjcl.random.getProgress(10)) {
- sendshit.encrypt(file);
- } else {
- sjcl.random.addEventListener('seeded', function() {
- sendshit.encrypt(file);
- });
- }
-
- });
-
- }
-
- NProgress.configure({
- trickle: false,
- ease: 'linear',
- speed: 1,
- minimum: 0.1
- });
-
-});
-
-function SelectAll(id) {
- document.getElementById(id).focus();
- document.getElementById(id).select();
-}
-
-var sendshit = (function () {
-
- var sendshit = {},
- password = '',
- reader = new FileReader();
-
- sendshit.encrypt = function (file) {
-
- reader.onload = function (e) {
-
- password = sjcl.random.randomWords(6,10);
-
- if (typeof password !== 'string') {
- password = sjcl.codec.hex.fromBits(password);
- }
- password = password.replace(/ /g,'').replace(/(.{8})/g, "$1").replace(/ $/, '');
-
- NProgress.start();
-
- sendshit.logMessage('Encrypting', true);
-
- triplesec.encrypt ({
-
- data: new triplesec.Buffer(JSON.stringify({
- file: e.target.result,
- name: file.name
- })),
-
- key: new triplesec.Buffer(password),
-
- progress_hook: function (obj) {
- _triplesecProgress(obj);
- }
-
- }, function(err, buff) {
-
- NProgress.done();
-
- sendshit.logMessage('Encrypted');
-
- if (! err) {
-
- NProgress.start();
-
- sendshit.logMessage('Uploading', true);
-
- var encrypted = buff.toString('hex');
- var formData = new FormData();
- var blob = new Blob([encrypted], { type: 'application/octet-stream'});
-
- formData.append('file', blob, 'encrypted');
- formData.append('_token', $('[name="csrf_token"]').attr('content'));
-
- $.ajax({
-
- type: 'post',
- url: 'upload',
- data: formData,
- xhr: function() {
-
- var myXhr = $.ajaxSettings.xhr();
-
- if(myXhr.upload){
-
- myXhr.upload.addEventListener('progress', function(e) {
-
- var done = e.position || e.loaded, total = e.totalSize || e.total;
- sendshit.logMessage('Upload progress: ' + (Math.floor(done/total*1000)/10) + '%');
- NProgress.set(Math.floor(done/total*10)/10);
-
- }, false);
-
- }
-
- return myXhr;
- },
- success: function (data) {
-
- NProgress.done();
-
- sendshit.logMessage('Done');
-
- $('#link').val(location.href+'#'+data.id+'/'+password);
-
- $('.link-group').removeClass('hide');
- $('.file-group').addClass('hide');
-
- },
- error: function (jqxhr) {
-
- NProgress.done();
-
- var error = JSON.parse(jqxhr.responseText);
-
- sendshit.logMessage(error.file);
-
- },
-
- cache: false,
- processData: false,
- contentType: false
- });
- }
- });
- };
-
- sendshit.logMessage('Reading file', true);
-
- reader.readAsDataURL(file);
-
- };
-
- sendshit.download = function (id, key) {
-
- password = key;
-
- sendshit.logMessage('Downloading', true);
-
- $.get('download?id=' + id, function(data) {
-
- if(data.error){
-
- sendshit.logMessage(data.error);
-
- } else {
-
- sendshit.logMessage('Downloaded');
- decrypt(data);
-
- }
- });
-
- };
-
- var decrypt = function (data) {
-
- reader.onload = function(e){
-
- NProgress.start();
-
- sendshit.logMessage('Decrypting', true);
-
- triplesec.decrypt ({
-
- data: new triplesec.Buffer(e.target.result, 'hex'),
- key: new triplesec.Buffer(password),
-
- progress_hook: function (obj) {
- _triplesecProgress(obj);
- }
-
- }, function (err, buff) {
-
- NProgress.done();
-
- sendshit.logMessage('Decrypted');
-
- if (err) {
-
- sendshit.logMessage(err.message);
- return false;
-
- }
-
- var decrypted = JSON.parse(buff.toString());
- var mimeString = decrypted.file.split(',')[0].split(':')[1].split(';')[0];
- var blob = _b64toBlob(decrypted.file.split(',')[1], mimeString);
-
- saveAs(blob, decrypted.name);
-
- sendshit.logMessage('Done');
-
- });
-
- };
-
- var blob = new Blob([data], {type: 'application/octet-stream'});
- reader.readAsText(blob);
-
-
- };
-
- sendshit.logMessage = function (message, ellipsis) {
-
- ellipsis = typeof ellipsis !== 'undefined' ? ellipsis : false;
-
- if(ellipsis === true) {
- message = message + '
...';
- }
-
- $('#status').html(message);
-
- if (!window.console){
- console.log(message);
- }
-
- };
-
- var _triplesecProgress = function (obj) {
-
- var percent = obj.i / obj.total;
-
- if(obj.what == 'pbkdf2 (pass 1)' || obj.what == 'pbkdf2 (pass 2)'){
- console.log('Running PBKDF2: '+Math.round(percent * 100)+'%');
- NProgress.set(parseFloat(percent.toFixed(1)));
- }
-
- if(obj.what == 'scrypt'){
- console.log('Scrypt: '+Math.round(percent * 100)+'%');
- NProgress.set(parseFloat(percent.toFixed(1)));
- }
-
- if(obj.what == 'salsa20'){
- console.log('Salsa20: '+Math.round(percent * 100)+'%');
- NProgress.set(parseFloat(percent.toFixed(1)));
- }
-
- if(obj.what == 'twofish'){
- console.log('Twofish-CTR: '+Math.round(percent * 100)+'%');
- NProgress.set(parseFloat(percent.toFixed(1)));
- }
-
- if(obj.what == 'aes'){
- console.log('AES-256-CTR: '+Math.round(percent * 100)+'%');
- NProgress.set(parseFloat(percent.toFixed(1)));
- }
-
- if(obj.what == 'HMAC-SHA512-SHA3'){
- console.log('Generating HMAC: '+Math.round(percent * 100)+'%');
- NProgress.set(parseFloat(percent.toFixed(1)));
- }
-
- };
-
- // http://stackoverflow.com/a/16245768
- var _b64toBlob = function (b64Data, contentType, sliceSize) {
- contentType = contentType || '';
- sliceSize = sliceSize || 512;
-
- var byteCharacters = atob(b64Data);
- var byteArrays = [];
-
- for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {
- var slice = byteCharacters.slice(offset, offset + sliceSize);
-
- var byteNumbers = new Array(slice.length);
- for (var i = 0; i < slice.length; i++) {
- byteNumbers[i] = slice.charCodeAt(i);
- }
-
- var byteArray = new Uint8Array(byteNumbers);
-
- byteArrays.push(byteArray);
- }
-
- var blob = new Blob(byteArrays, {type: contentType});
- return blob;
- };
-
- return sendshit;
-
-}());
\ No newline at end of file
diff --git a/public/js/vendor.js b/public/js/vendor.js
new file mode 100644
index 0000000..b75a723
--- /dev/null
+++ b/public/js/vendor.js
@@ -0,0 +1,12 @@
+!function(t,e,n){"use strict";function r(t,e){return e=e||Error,function(){var n,r,i=2,o=arguments,s=o[0],u="["+(t?t+":":"")+s+"] ",a=o[1];for(u+=a.replace(/\{\d+\}/g,function(t){var e=+t.slice(1,-1),n=e+i;return n
0&&e-1 in t}function o(t,e,n){var r,s;if(t)if(E(t))for(r in t)"prototype"==r||"length"==r||"name"==r||t.hasOwnProperty&&!t.hasOwnProperty(r)||e.call(n,t[r],r,t);else if(Rr(t)||i(t)){var u="object"!=typeof t;for(r=0,s=t.length;s>r;r++)(u||r in t)&&e.call(n,t[r],r,t)}else if(t.forEach&&t.forEach!==o)t.forEach(e,n,t);else if(b(t))for(r in t)e.call(n,t[r],r,t);else if("function"==typeof t.hasOwnProperty)for(r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r,t);else for(r in t)wr.call(t,r)&&e.call(n,t[r],r,t);return t}function s(t,e,n){for(var r=Object.keys(t).sort(),i=0;ii;++i){var s=e[i];if(w(s)||E(s))for(var u=Object.keys(s),a=0,f=u.length;f>a;a++){var h=u[a],p=s[h];n&&w(p)?S(p)?t[h]=new Date(p.valueOf()):(w(t[h])||(t[h]=Rr(p)?[]:{}),l(t[h],[p],!0)):t[h]=p}}return c(t,r),t}function f(t){return l(t,Cr.call(arguments,1),!1)}function h(t){return l(t,Cr.call(arguments,1),!0)}function p(t){return parseInt(t,10)}function d(t,e){return f(Object.create(t),e)}function g(){}function y(t){return t}function m(t){return function(){return t}}function v(t){return E(t.toString)&&t.toString!==Object.prototype.toString}function $(t){return"undefined"==typeof t}function _(t){return"undefined"!=typeof t}function w(t){return null!==t&&"object"==typeof t}function b(t){return null!==t&&"object"==typeof t&&!Mr(t)}function k(t){return"string"==typeof t}function x(t){return"number"==typeof t}function S(t){return"[object Date]"===Dr.call(t)}function E(t){return"function"==typeof t}function A(t){return"[object RegExp]"===Dr.call(t)}function B(t){return t&&t.window===t}function C(t){return t&&t.$evalAsync&&t.$watch}function T(t){return"[object File]"===Dr.call(t)}function O(t){return"[object FormData]"===Dr.call(t)}function D(t){return"[object Blob]"===Dr.call(t)}function M(t){return"boolean"==typeof t}function P(t){return t&&E(t.then)}function I(t){return Ur.test(Dr.call(t))}function N(t){return!(!t||!(t.nodeName||t.prop&&t.attr&&t.find))}function z(t){var e,n={},r=t.split(",");for(e=0;e=0&&t.splice(n,1),n}function j(t,e,n,r){if(B(t)||C(t))throw Pr("cpws","Can't copy! Making copies of Window or Scope instances is not supported.");if(I(e))throw Pr("cpta","Can't copy! TypedArray destination cannot be mutated.");if(e){if(t===e)throw Pr("cpi","Can't copy! Source and destination are identical.");n=n||[],r=r||[],w(t)&&(n.push(t),r.push(e));var i;if(Rr(t)){e.length=0;for(var s=0;sn;n++)e[n]=t[n]}else if(w(t)){e=e||{};for(var i in t)("$"!==i.charAt(0)||"$"!==i.charAt(1))&&(e[i]=t[i])}return e||t}function F(t,e){if(t===e)return!0;if(null===t||null===e)return!1;if(t!==t&&e!==e)return!0;var r,i,o,s=typeof t,u=typeof e;if(s==u&&"object"==s){if(!Rr(t)){if(S(t))return S(e)?F(t.getTime(),e.getTime()):!1;if(A(t))return A(e)?t.toString()==e.toString():!1;if(C(t)||C(e)||B(t)||B(e)||Rr(e)||S(e)||A(e))return!1;o=yt();for(i in t)if("$"!==i.charAt(0)&&!E(t[i])){if(!F(t[i],e[i]))return!1;o[i]=!0}for(i in e)if(!(i in o||"$"===i.charAt(0)||e[i]===n||E(e[i])))return!1;return!0}if(!Rr(e))return!1;if((r=t.length)==e.length){for(i=0;r>i;i++)if(!F(t[i],e[i]))return!1;return!0}}return!1}function L(t,e,n){return t.concat(Cr.call(e,n))}function H(t,e){return Cr.call(t,e||0)}function q(t,e){var n=arguments.length>2?H(arguments,2):[];return!E(e)||e instanceof RegExp?e:n.length?function(){return arguments.length?e.apply(t,L(n,arguments,0)):e.apply(t,n)}:function(){return arguments.length?e.apply(t,arguments):e.call(t)}}function W(t,r){var i=r;return"string"==typeof t&&"$"===t.charAt(0)&&"$"===t.charAt(1)?i=n:B(r)?i="$WINDOW":r&&e===r?i="$DOCUMENT":C(r)&&(i="$SCOPE"),i}function K(t,e){return"undefined"==typeof t?n:(x(e)||(e=e?2:null),JSON.stringify(t,W,e))}function G(t){return k(t)?JSON.parse(t):t}function X(t,e){var n=Date.parse("Jan 01, 1970 00:00:00 "+t)/6e4;return isNaN(n)?e:n}function Y(t,e){return t=new Date(t.getTime()),t.setMinutes(t.getMinutes()+e),t}function J(t,e,n){n=n?-1:1;var r=X(e,t.getTimezoneOffset());return Y(t,n*(r-t.getTimezoneOffset()))}function Z(t){t=Er(t).clone();try{t.empty()}catch(e){}var n=Er("").append(t).html();try{return t[0].nodeType===Xr?_r(n):n.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(t,e){return"<"+_r(e)})}catch(e){return _r(n)}}function Q(t){try{return decodeURIComponent(t)}catch(e){}}function tt(t){var e,n,r={};return o((t||"").split("&"),function(t){if(t&&(e=t.replace(/\+/g,"%20").split("="),n=Q(e[0]),_(n))){var i=_(e[1])?Q(e[1]):!0;wr.call(r,n)?Rr(r[n])?r[n].push(i):r[n]=[r[n],i]:r[n]=i}}),r}function et(t){var e=[];return o(t,function(t,n){Rr(t)?o(t,function(t){e.push(rt(n,!0)+(t===!0?"":"="+rt(t,!0)))}):e.push(rt(n,!0)+(t===!0?"":"="+rt(t,!0)))}),e.length?e.join("&"):""}function nt(t){return rt(t,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function rt(t,e){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,e?"%20":"+")}function it(t,e){var n,r,i=Hr.length;for(r=0;i>r;++r)if(n=Hr[r]+e,k(n=t.getAttribute(n)))return n;return null}function ot(t,e){var n,r,i={};o(Hr,function(e){var i=e+"app";!n&&t.hasAttribute&&t.hasAttribute(i)&&(n=t,r=t.getAttribute(i))}),o(Hr,function(e){var i,o=e+"app";!n&&(i=t.querySelector("["+o.replace(":","\\:")+"]"))&&(n=i,r=i.getAttribute(o))}),n&&(i.strictDi=null!==it(n,"strict-di"),e(n,r?[r]:[],i))}function st(n,r,i){w(i)||(i={});var s={strictDi:!1};i=f(s,i);var u=function(){if(n=Er(n),n.injector()){var t=n[0]===e?"document":Z(n);throw Pr("btstrpd","App Already Bootstrapped with this Element '{0}'",t.replace(/,"<").replace(/>/,">"))}r=r||[],r.unshift(["$provide",function(t){t.value("$rootElement",n)}]),i.debugInfoEnabled&&r.push(["$compileProvider",function(t){t.debugInfoEnabled(!0)}]),r.unshift("ng");var o=Zt(r,i.strictDi);return o.invoke(["$rootScope","$rootElement","$compile","$injector",function(t,e,n,r){t.$apply(function(){e.data("$injector",r),n(e)(t)})}]),o},a=/^NG_ENABLE_DEBUG_INFO!/,c=/^NG_DEFER_BOOTSTRAP!/;return t&&a.test(t.name)&&(i.debugInfoEnabled=!0,t.name=t.name.replace(a,"")),t&&!c.test(t.name)?u():(t.name=t.name.replace(c,""),Ir.resumeBootstrap=function(t){return o(t,function(t){r.push(t)}),u()},void(E(Ir.resumeDeferredBootstrap)&&Ir.resumeDeferredBootstrap()))}function ut(){t.name="NG_ENABLE_DEBUG_INFO!"+t.name,t.location.reload()}function at(t){var e=Ir.element(t).injector();if(!e)throw Pr("test","no injector found for element argument to getTestability");return e.get("$$testability")}function ct(t,e){return e=e||"_",t.replace(qr,function(t,n){return(n?e:"")+t.toLowerCase()})}function lt(){var e;if(!Wr){var r=Lr();Ar=t.jQuery,_(r)&&(Ar=null===r?n:t[r]),Ar&&Ar.fn.on?(Er=Ar,f(Ar.fn,{scope:pi.scope,isolateScope:pi.isolateScope,controller:pi.controller,injector:pi.injector,inheritedData:pi.inheritedData}),e=Ar.cleanData,Ar.cleanData=function(t){var n;if(zr)zr=!1;else for(var r,i=0;null!=(r=t[i]);i++)n=Ar._data(r,"events"),n&&n.$destroy&&Ar(r).triggerHandler("$destroy");e(t)}):Er=Bt,Ir.element=Er,Wr=!0}}function ft(t,e,n){if(!t)throw Pr("areq","Argument '{0}' is {1}",e||"?",n||"required");return t}function ht(t,e,n){return n&&Rr(t)&&(t=t[t.length-1]),ft(E(t),e,"not a function, got "+(t&&"object"==typeof t?t.constructor.name||"Object":typeof t)),t}function pt(t,e){if("hasOwnProperty"===t)throw Pr("badname","hasOwnProperty is not a valid {0} name",e)}function dt(t,e,n){if(!e)return t;for(var r,i=e.split("."),o=t,s=i.length,u=0;s>u;u++)r=i[u],t&&(t=(o=t)[r]);return!n&&E(t)?q(o,t):t}function gt(t){var e=t[0],n=t[t.length-1],r=[e];do{if(e=e.nextSibling,!e)break;r.push(e)}while(e!==n);return Er(r)}function yt(){return Object.create(null)}function mt(t){function e(t,e,n){return t[e]||(t[e]=n())}var n=r("$injector"),i=r("ng"),o=e(t,"angular",Object);return o.$$minErr=o.$$minErr||r,e(o,"module",function(){var t={};return function(r,o,s){var u=function(t,e){if("hasOwnProperty"===t)throw i("badname","hasOwnProperty is not a valid {0} name",e)};return u(r,"module"),o&&t.hasOwnProperty(r)&&(t[r]=null),e(t,r,function(){function t(t,e,n,r){return r||(r=i),function(){return r[n||"push"]([t,e,arguments]),l}}function e(t,e){return function(n,o){return o&&E(o)&&(o.$$moduleName=r),i.push([t,e,arguments]),l}}if(!o)throw n("nomod","Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.",r);var i=[],u=[],a=[],c=t("$injector","invoke","push",u),l={_invokeQueue:i,_configBlocks:u,_runBlocks:a,requires:o,name:r,provider:e("$provide","provider"),factory:e("$provide","factory"),service:e("$provide","service"),value:t("$provide","value"),constant:t("$provide","constant","unshift"),decorator:e("$provide","decorator"),animation:e("$animateProvider","register"),filter:e("$filterProvider","register"),controller:e("$controllerProvider","register"),directive:e("$compileProvider","directive"),config:c,run:function(t){return a.push(t),this}};return s&&c(s),l})}})}function vt(t){var e=[];return JSON.stringify(t,function(t,n){if(n=W(t,n),w(n)){if(e.indexOf(n)>=0)return"<
>";e.push(n)}return n})}function $t(t){return"function"==typeof t?t.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof t?"undefined":"string"!=typeof t?vt(t):t}function _t(e){f(e,{bootstrap:st,copy:j,extend:f,merge:h,equals:F,element:Er,forEach:o,injector:Zt,noop:g,bind:q,toJson:K,fromJson:G,identity:y,isUndefined:$,isDefined:_,isString:k,isFunction:E,isObject:w,isNumber:x,isElement:N,isArray:Rr,version:Qr,isDate:S,lowercase:_r,uppercase:br,callbacks:{counter:0},getTestability:at,$$minErr:r,$$csp:Fr,reloadWithDebugInfo:ut}),Br=mt(t);try{Br("ngLocale")}catch(n){Br("ngLocale",[]).provider("$locale",Oe)}Br("ng",["ngLocale"],["$provide",function(t){t.provider({$$sanitizeUri:mn}),t.provider("$compile",ae).directive({a:co,input:Ao,textarea:Ao,form:go,script:$s,select:bs,style:xs,option:ks,ngBind:To,ngBindHtml:Do,ngBindTemplate:Oo,ngClass:Po,ngClassEven:No,ngClassOdd:Io,ngCloak:zo,ngController:Ro,ngForm:yo,ngHide:ps,ngIf:Vo,ngInclude:Fo,ngInit:Ho,ngNonBindable:is,ngPluralize:as,ngRepeat:cs,ngShow:hs,ngStyle:ds,ngSwitch:gs,ngSwitchWhen:ys,ngSwitchDefault:ms,ngOptions:us,ngTransclude:vs,ngModel:es,ngList:qo,ngChange:Mo,pattern:Es,ngPattern:Es,required:Ss,ngRequired:Ss,minlength:Bs,ngMinlength:Bs,maxlength:As,ngMaxlength:As,ngValue:Co,ngModelOptions:rs}).directive({ngInclude:Lo}).directive(lo).directive(Uo),t.provider({$anchorScroll:Qt,$animate:Bi,$$animateQueue:Ai,$$AnimateRunner:Ei,$browser:oe,$cacheFactory:se,$controller:pe,$document:de,$exceptionHandler:ge,$filter:On,$interpolate:Ce,$interval:Te,$http:Se,$httpParamSerializer:me,$httpParamSerializerJQLike:ve,$httpBackend:Ae,$location:qe,$log:We,$parse:fn,$rootScope:yn,$q:hn,$$q:pn,$sce:wn,$sceDelegate:_n,$sniffer:bn,$templateCache:ue,$templateRequest:kn,$$testability:xn,$timeout:Sn,$window:Bn,$$rAF:gn,$$jqLite:Kt,$$HashMap:mi,$$cookieReader:Tn})}])}function wt(){return++ei}function bt(t){return t.replace(ii,function(t,e,n,r){return r?n.toUpperCase():n}).replace(oi,"Moz$1")}function kt(t){return!ci.test(t)}function xt(t){var e=t.nodeType;return e===Kr||!e||e===Jr}function St(t){for(var e in ti[t.ng339])return!0;return!1}function Et(t,e){var n,r,i,s,u=e.createDocumentFragment(),a=[];if(kt(t))a.push(e.createTextNode(t));else{for(n=n||u.appendChild(e.createElement("div")),r=(li.exec(t)||["",""])[1].toLowerCase(),i=hi[r]||hi._default,n.innerHTML=i[1]+t.replace(fi,"<$1>$2>")+i[2],s=i[0];s--;)n=n.lastChild;a=L(a,n.childNodes),n=u.firstChild,n.textContent=""}return u.textContent="",u.innerHTML="",o(a,function(t){u.appendChild(t)}),u}function At(t,n){n=n||e;var r;return(r=ai.exec(t))?[n.createElement(r[1])]:(r=Et(t,n))?r.childNodes:[]}function Bt(t){if(t instanceof Bt)return t;var e;if(k(t)&&(t=jr(t),e=!0),!(this instanceof Bt)){if(e&&"<"!=t.charAt(0))throw ui("nosel","Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element");return new Bt(t)}e?Rt(this,At(t)):Rt(this,t)}function Ct(t){return t.cloneNode(!0)}function Tt(t,e){if(e||Dt(t),t.querySelectorAll)for(var n=t.querySelectorAll("*"),r=0,i=n.length;i>r;r++)Dt(n[r])}function Ot(t,e,n,r){if(_(r))throw ui("offargs","jqLite#off() does not support the `selector` argument");var i=Mt(t),s=i&&i.events,u=i&&i.handle;if(u)if(e)o(e.split(" "),function(e){if(_(n)){var r=s[e];if(U(r||[],n),r&&r.length>0)return}ri(t,e,u),delete s[e]});else for(e in s)"$destroy"!==e&&ri(t,e,u),delete s[e]}function Dt(t,e){var r=t.ng339,i=r&&ti[r];if(i){if(e)return void delete i.data[e];i.handle&&(i.events.$destroy&&i.handle({},"$destroy"),Ot(t)),delete ti[r],t.ng339=n}}function Mt(t,e){var r=t.ng339,i=r&&ti[r];return e&&!i&&(t.ng339=r=wt(),i=ti[r]={events:{},data:{},handle:n}),i}function Pt(t,e,n){if(xt(t)){var r=_(n),i=!r&&e&&!w(e),o=!e,s=Mt(t,!i),u=s&&s.data;if(r)u[e]=n;else{if(o)return u;if(i)return u&&u[e];f(u,e)}}}function It(t,e){return t.getAttribute?(" "+(t.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+e+" ")>-1:!1}function Nt(t,e){e&&t.setAttribute&&o(e.split(" "),function(e){t.setAttribute("class",jr((" "+(t.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+jr(e)+" "," ")))})}function zt(t,e){if(e&&t.setAttribute){var n=(" "+(t.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");o(e.split(" "),function(t){t=jr(t),-1===n.indexOf(" "+t+" ")&&(n+=t+" ")}),t.setAttribute("class",jr(n))}}function Rt(t,e){if(e)if(e.nodeType)t[t.length++]=e;else{var n=e.length;if("number"==typeof n&&e.window!==e){if(n)for(var r=0;n>r;r++)t[t.length++]=e[r]}else t[t.length++]=e}}function Ut(t,e){return jt(t,"$"+(e||"ngController")+"Controller")}function jt(t,e,r){t.nodeType==Jr&&(t=t.documentElement);for(var i=Rr(e)?e:[e];t;){for(var o=0,s=i.length;s>o;o++)if((r=Er.data(t,i[o]))!==n)return r;t=t.parentNode||t.nodeType===Zr&&t.host}}function Vt(t){for(Tt(t,!0);t.firstChild;)t.removeChild(t.firstChild)}function Ft(t,e){e||Tt(t);var n=t.parentNode;n&&n.removeChild(t)}function Lt(e,n){n=n||t,"complete"===n.document.readyState?n.setTimeout(e):Er(n).on("load",e)}function Ht(t,e){var n=di[e.toLowerCase()];return n&&gi[R(t)]&&n}function qt(t,e){var n=t.nodeName;return("INPUT"===n||"TEXTAREA"===n)&&yi[e]}function Wt(t,e){var n=function(n,r){n.isDefaultPrevented=function(){return n.defaultPrevented};var i=e[r||n.type],o=i?i.length:0;if(o){if($(n.immediatePropagationStopped)){var s=n.stopImmediatePropagation;n.stopImmediatePropagation=function(){n.immediatePropagationStopped=!0,n.stopPropagation&&n.stopPropagation(),s&&s.call(n)}}n.isImmediatePropagationStopped=function(){return n.immediatePropagationStopped===!0},o>1&&(i=V(i));for(var u=0;o>u;u++)n.isImmediatePropagationStopped()||i[u].call(t,n)}};return n.elem=t,n}function Kt(){this.$get=function(){return f(Bt,{hasClass:function(t,e){return t.attr&&(t=t[0]),It(t,e)},addClass:function(t,e){return t.attr&&(t=t[0]),zt(t,e)},removeClass:function(t,e){return t.attr&&(t=t[0]),Nt(t,e)}})}}function Gt(t,e){var n=t&&t.$$hashKey;if(n)return"function"==typeof n&&(n=t.$$hashKey()),n;var r=typeof t;return n="function"==r||"object"==r&&null!==t?t.$$hashKey=r+":"+(e||a)():r+":"+t}function Xt(t,e){if(e){var n=0;this.nextUid=function(){return++n}}o(t,this.put,this)}function Yt(t){var e=t.toString().replace(wi,""),n=e.match(vi);return n?"function("+(n[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function Jt(t,e,n){var r,i,s,u;if("function"==typeof t){if(!(r=t.$inject)){if(r=[],t.length){if(e)throw k(n)&&n||(n=t.name||Yt(t)),bi("strictdi","{0} is not using explicit annotation and cannot be invoked in strict mode",n);i=t.toString().replace(wi,""),s=i.match(vi),o(s[1].split($i),function(t){t.replace(_i,function(t,e,n){r.push(n)})})}t.$inject=r}}else Rr(t)?(u=t.length-1,ht(t[u],"fn"),r=t.slice(0,u)):ht(t,"fn",!0);return r}function Zt(t,e){function r(t){return function(e,n){return w(e)?void o(e,u(t)):t(e,n)}}function i(t,e){if(pt(t,"service"),(E(e)||Rr(e))&&(e=x.instantiate(e)),!e.$get)throw bi("pget","Provider '{0}' must define $get factory method.",t);return b[t+y]=e}function s(t,e){return function(){var n=A.invoke(e,this);if($(n))throw bi("undef","Provider '{0}' must return a value from $get factory method.",t);return n}}function a(t,e,n){return i(t,{$get:n!==!1?s(t,e):e})}function c(t,e){return a(t,["$injector",function(t){return t.instantiate(e)}])}function l(t,e){return a(t,m(e),!1)}function f(t,e){pt(t,"constant"),b[t]=e,S[t]=e}function h(t,e){var n=x.get(t+y),r=n.$get;n.$get=function(){var t=A.invoke(r,n);return A.invoke(e,null,{$delegate:t})}}function p(t){var e,n=[];return o(t,function(t){function r(t){var e,n;for(e=0,n=t.length;n>e;e++){var r=t[e],i=x.get(r[0]);i[r[1]].apply(i,r[2])}}if(!_.get(t)){_.put(t,!0);try{k(t)?(e=Br(t),n=n.concat(p(e.requires)).concat(e._runBlocks),r(e._invokeQueue),r(e._configBlocks)):E(t)?n.push(x.invoke(t)):Rr(t)?n.push(x.invoke(t)):ht(t,"module")}catch(i){throw Rr(t)&&(t=t[t.length-1]),i.message&&i.stack&&-1==i.stack.indexOf(i.message)&&(i=i.message+"\n"+i.stack),bi("modulerr","Failed to instantiate module {0} due to:\n{1}",t,i.stack||i.message||i)}}}),n}function d(t,n){function r(e,r){if(t.hasOwnProperty(e)){if(t[e]===g)throw bi("cdep","Circular dependency found: {0}",e+" <- "+v.join(" <- "));return t[e]}try{return v.unshift(e),t[e]=g,t[e]=n(e,r)}catch(i){throw t[e]===g&&delete t[e],i}finally{v.shift()}}function i(t,n,i,o){"string"==typeof i&&(o=i,i=null);var s,u,a,c=[],l=Zt.$$annotate(t,e,o);for(u=0,s=l.length;s>u;u++){if(a=l[u],"string"!=typeof a)throw bi("itkn","Incorrect injection token! Expected service name as string, got {0}",a);c.push(i&&i.hasOwnProperty(a)?i[a]:r(a,o))}return Rr(t)&&(t=t[s]),t.apply(n,c)}function o(t,e,n){var r=Object.create((Rr(t)?t[t.length-1]:t).prototype||null),o=i(t,r,e,n);return w(o)||E(o)?o:r}return{invoke:i,instantiate:o,get:r,annotate:Zt.$$annotate,has:function(e){return b.hasOwnProperty(e+y)||t.hasOwnProperty(e)}}}e=e===!0;var g={},y="Provider",v=[],_=new Xt([],!0),b={$provide:{provider:r(i),factory:r(a),service:r(c),value:r(l),constant:r(f),decorator:h}},x=b.$injector=d(b,function(t,e){throw Ir.isString(e)&&v.push(e),bi("unpr","Unknown provider: {0}",v.join(" <- "))}),S={},A=S.$injector=d(S,function(t,e){var r=x.get(t+y,e);return A.invoke(r.$get,r,n,t)});return o(p(t),function(t){t&&A.invoke(t)}),A}function Qt(){var t=!0;this.disableAutoScrolling=function(){t=!1},this.$get=["$window","$location","$rootScope",function(e,n,r){function i(t){var e=null;return Array.prototype.some.call(t,function(t){return"a"===R(t)?(e=t,!0):void 0}),e}function o(){var t=u.yOffset;if(E(t))t=t();else if(N(t)){var n=t[0],r=e.getComputedStyle(n);t="fixed"!==r.position?0:n.getBoundingClientRect().bottom}else x(t)||(t=0);return t}function s(t){if(t){t.scrollIntoView();var n=o();if(n){var r=t.getBoundingClientRect().top;e.scrollBy(0,r-n)}}else e.scrollTo(0,0)}function u(t){t=k(t)?t:n.hash();var e;t?(e=a.getElementById(t))?s(e):(e=i(a.getElementsByName(t)))?s(e):"top"===t&&s(null):s(null)}var a=e.document;return t&&r.$watch(function(){return n.hash()},function(t,e){(t!==e||""!==t)&&Lt(function(){r.$evalAsync(u)})}),u}]}function te(t,e){return t||e?t?e?(Rr(t)&&(t=t.join(" ")),Rr(e)&&(e=e.join(" ")),t+" "+e):t:e:""}function ee(t){for(var e=0;ec&&this.remove(p.key),e}},get:function(t){if(c").parent()[0])});var s=M(t,e,t,n,r,i);O.$$addScopeClass(t);var u=null;return function(e,n,r){ft(e,"scope"),r=r||{};var i=r.parentBoundTranscludeFn,o=r.transcludeControllers,a=r.futureParentElement;i&&i.$$boundTransclude&&(i=i.$$boundTransclude),u||(u=D(a));var c;if(c="html"!==u?Er(J(u,Er("").append(t).html())):n?pi.clone.call(t):t,o)for(var l in o)c.data("$"+l+"Controller",o[l].instance);return O.$$addScopeInfo(c,e),n&&n(c,e),s&&s(e,c,c,i),c}}function D(t){var e=t&&t[0];return e&&"foreignobject"!==R(e)&&e.toString().match(/SVG/)?"svg":"html"}function M(t,e,r,i,o,s){function u(t,r,i,o){var s,u,a,c,l,f,h,p,y;if(d){var m=r.length;for(y=new Array(m),l=0;l
l;)if(a=y[g[l++]],s=g[l++],u=g[l++],s){if(s.scope){c=t.$new(),O.$$addScopeInfo(Er(a),c);var v=s.$$destroyBindings;v&&(s.$$destroyBindings=null,c.$on("$destroyed",v))}else c=t;p=s.transcludeOnThisElement?P(t,s.transclude,o):!s.templateOnThisElement&&o?o:!o&&e?P(t,e):null,s(u,c,a,i,p,s)}else u&&u(t,a.childNodes,n,o)}for(var a,c,l,f,h,p,d,g=[],y=0;yv;v++){var _=!1,b=!1;c=m[v],l=c.name,g=jr(c.value),d=ce(l),(y=lt.test(d))&&(l=l.replace(Ti,"").substr(8).replace(/_(.)/g,function(t,e){return e.toUpperCase()}));var x=d.replace(/(Start|End)$/,"");q(x)&&d===x+"Start"&&(_=l,b=l.substr(0,l.length-5)+"end",l=l.substr(0,l.length-6)),f=ce(l.toLowerCase()),a[f]=l,(y||!n.hasOwnProperty(f))&&(n[f]=g,Ht(t,f)&&(n[f]=!0)),tt(t,e,g,f,y),L(e,f,"A",r,i,_,b)}if(s=t.className,w(s)&&(s=s.animVal),k(s)&&""!==s)for(;o=p.exec(s);)f=ce(o[2]),L(e,f,"C",r,i)&&(n[f]=jr(o[3])),s=s.substr(o.index+o[0].length);break;case Xr:if(11===Sr)for(;t.parentNode&&t.nextSibling&&t.nextSibling.nodeType===Xr;)t.nodeValue=t.nodeValue+t.nextSibling.nodeValue,t.parentNode.removeChild(t.nextSibling);Y(e,t.nodeValue);break;case Yr:try{o=h.exec(t.nodeValue),o&&(f=ce(o[1]),L(e,f,"M",r,i)&&(n[f]=jr(o[2])))}catch(S){}}return e.sort(G),e}function N(t,e,n){var r=[],i=0;if(e&&t.hasAttribute&&t.hasAttribute(e)){do{if(!t)throw Ci("uterdir","Unterminated attribute, found '{0}' but no matching '{1}' found.",e,n);t.nodeType==Kr&&(t.hasAttribute(e)&&i++,t.hasAttribute(n)&&i--),r.push(t),t=t.nextSibling}while(i>0)}else r.push(t);return Er(r)}function z(t,e,n){return function(r,i,o,s,u){return i=N(i[0],e,n),t(r,i,o,s,u)}}function j(t,r,o,s,u,c,l,f,h){function p(t,e,n,r){t&&(n&&(t=z(t,n,r)),t.require=m.require,t.directiveName=v,(T===m||m.$$isolateScope)&&(t=nt(t,{isolateScope:!0})),l.push(t)),e&&(n&&(e=z(e,n,r)),e.require=m.require,e.directiveName=v,(T===m||m.$$isolateScope)&&(e=nt(e,{isolateScope:!0})),f.push(e))}function d(t,e,n,r){var i;if(k(e)){var o=e.match($),s=e.substring(o[0].length),u=o[1]||o[3],a="?"===o[2];if("^^"===u?n=n.parent():(i=r&&r[s],i=i&&i.instance),!i){var c="$"+s+"Controller";i=u?n.inheritedData(c):n.data(c)}if(!i&&!a)throw Ci("ctreq","Controller '{0}', required by directive '{1}', can't be found!",s,t)}else if(Rr(e)){i=[];for(var l=0,f=e.length;f>l;l++)i[l]=d(t,e[l],n,r)}return i||null}function g(t,e,n,r,i,o){var s=yt();for(var u in r){var c=r[u],l={$scope:c===T||c.$$isolateScope?i:o,$element:t,$attrs:e,$transclude:n},f=c.controller;"@"==f&&(f=e[c.name]);var h=a(f,l,!0,c.controllerAs);s[c.name]=h,U||t.data("$"+c.name+"Controller",h.instance)}return s}function y(t,e,i,s,u,a){function c(t,e,r){var i;return C(t)||(r=e,e=t,t=n),U&&(i=$),r||(r=U?w.parent():w),u(t,e,i,r,M)}var h,p,y,m,v,$,_,w,b;if(r===i?(b=o,w=o.$$element):(w=Er(i),b=new ot(w,o)),T&&(v=e.$new(!0)),u&&(_=c,_.$$boundTransclude=u),B&&($=g(w,b,_,B,v,e)),T&&(O.$$addScopeInfo(w,v,!0,!(D&&(D===T||D===T.$$originalDirective))),O.$$addScopeClass(w,!0),v.$$isolateBindings=T.$$isolateBindings,it(e,b,v,v.$$isolateBindings,T,v)),$){var k,x,S=T||A;S&&$[S.name]&&(k=S.$$bindings.bindToController,m=$[S.name],m&&m.identifier&&k&&(x=m,a.$$destroyBindings=it(e,b,m.instance,k,S)));for(h in $){m=$[h];var E=m();E!==m.instance&&(m.instance=E,w.data("$"+h+"Controller",E),m===x&&(a.$$destroyBindings(),a.$$destroyBindings=it(e,b,E,k,S)))}}for(h=0,p=l.length;p>h;h++)y=l[h],rt(y,y.isolateScope?v:e,w,b,y.require&&d(y.directiveName,y.require,w,$),_);var M=e;for(T&&(T.template||null===T.templateUrl)&&(M=v),t&&t(M,i.childNodes,n,u),h=f.length-1;h>=0;h--)y=f[h],rt(y,y.isolateScope?v:e,w,b,y.require&&d(y.directiveName,y.require,w,$),_)}h=h||{};for(var m,v,_,b,x,S=-Number.MAX_VALUE,A=h.newScopeDirective,B=h.controllerDirectives,T=h.newIsolateScopeDirective,D=h.templateDirective,M=h.nonTlbTranscludeDirective,P=!1,R=!1,U=h.hasElementTranscludeDirective,j=o.$$element=Er(r),F=c,L=s,q=0,G=t.length;G>q;q++){m=t[q];var Y=m.$$start,Q=m.$$end;if(Y&&(j=N(r,Y,Q)),_=n,S>m.priority)break;if((x=m.scope)&&(m.templateUrl||(w(x)?(X("new/isolated scope",T||A,m,j),T=m):X("new/isolated scope",T,m,j)),A=A||m),v=m.name,!m.templateUrl&&m.controller&&(x=m.controller,B=B||yt(),X("'"+v+"' controller",B[v],m,j),B[v]=m),(x=m.transclude)&&(P=!0,m.$$tlb||(X("transclusion",M,m,j),M=m),"element"==x?(U=!0,
+S=m.priority,_=j,j=o.$$element=Er(e.createComment(" "+v+": "+o[v]+" ")),r=j[0],et(u,H(_),r),L=O(_,s,S,F&&F.name,{nonTlbTranscludeDirective:M})):(_=Er(Ct(r)).contents(),j.empty(),L=O(_,s))),m.template)if(R=!0,X("template",D,m,j),D=m,x=E(m.template)?m.template(j,o):m.template,x=at(x),m.replace){if(F=m,_=kt(x)?[]:fe(J(m.templateNamespace,jr(x))),r=_[0],1!=_.length||r.nodeType!==Kr)throw Ci("tplrt","Template for directive '{0}' must have exactly one root element. {1}",v,"");et(u,j,r);var tt={$attr:{}},st=I(r,[],tt),ut=t.splice(q+1,t.length-(q+1));T&&V(st),t=t.concat(st).concat(ut),W(o,tt),G=t.length}else j.html(x);if(m.templateUrl)R=!0,X("template",D,m,j),D=m,m.replace&&(F=m),y=K(t.splice(q,t.length-q),j,o,u,P&&L,l,f,{controllerDirectives:B,newScopeDirective:A!==m&&A,newIsolateScopeDirective:T,templateDirective:D,nonTlbTranscludeDirective:M}),G=t.length;else if(m.compile)try{b=m.compile(j,o,L),E(b)?p(null,b,Y,Q):b&&p(b.pre,b.post,Y,Q)}catch(ct){i(ct,Z(j))}m.terminal&&(y.terminal=!0,S=Math.max(S,m.priority))}return y.scope=A&&A.scope===!0,y.transcludeOnThisElement=P,y.templateOnThisElement=R,y.transclude=L,h.hasElementTranscludeDirective=U,y}function V(t){for(var e=0,n=t.length;n>e;e++)t[e]=d(t[e],{$$isolateScope:!0})}function L(e,r,o,s,u,a,f){if(r===u)return null;var h=null;if(c.hasOwnProperty(r))for(var p,g=t.get(r+l),y=0,m=g.length;m>y;y++)try{p=g[y],(s===n||s>p.priority)&&-1!=p.restrict.indexOf(o)&&(a&&(p=d(p,{$$start:a,$$end:f})),e.push(p),h=p)}catch(v){i(v)}return h}function q(e){if(c.hasOwnProperty(e))for(var n,r=t.get(e+l),i=0,o=r.length;o>i;i++)if(n=r[i],n.multiElement)return!0;return!1}function W(t,e){var n=e.$attr,r=t.$attr,i=t.$$element;o(t,function(r,i){"$"!=i.charAt(0)&&(e[i]&&e[i]!==r&&(r+=("style"===i?";":" ")+e[i]),t.$set(i,r,!0,n[i]))}),o(e,function(e,o){"class"==o?(T(i,e),t["class"]=(t["class"]?t["class"]+" ":"")+e):"style"==o?(i.attr("style",i.attr("style")+";"+e),t.style=(t.style?t.style+";":"")+e):"$"==o.charAt(0)||t.hasOwnProperty(o)||(t[o]=e,r[o]=n[o])})}function K(t,e,n,r,i,u,a,c){var l,f,h=[],p=e[0],g=t.shift(),y=d(g,{templateUrl:null,transclude:null,replace:null,$$originalDirective:g}),m=E(g.templateUrl)?g.templateUrl(e,n):g.templateUrl,v=g.templateNamespace;return e.empty(),s(m).then(function(s){var d,$,_,b;if(s=at(s),g.replace){if(_=kt(s)?[]:fe(J(v,jr(s))),d=_[0],1!=_.length||d.nodeType!==Kr)throw Ci("tplrt","Template for directive '{0}' must have exactly one root element. {1}",g.name,m);$={$attr:{}},et(r,e,d);var k=I(d,[],$);w(g.scope)&&V(k),t=k.concat(t),W(n,$)}else d=p,e.html(s);for(t.unshift(y),l=j(t,d,n,i,e,g,u,a,c),o(r,function(t,n){t==d&&(r[n]=e[0])}),f=M(e[0].childNodes,i);h.length;){var x=h.shift(),S=h.shift(),E=h.shift(),A=h.shift(),B=e[0];if(!x.$$destroyed){if(S!==p){var C=S.className;c.hasElementTranscludeDirective&&g.replace||(B=Ct(d)),et(E,Er(S),B),T(Er(B),C)}b=l.transcludeOnThisElement?P(x,l.transclude,A):A,l(f,x,B,r,b,l)}}h=null}),function(t,e,n,r,i){var o=i;e.$$destroyed||(h?h.push(e,n,r,o):(l.transcludeOnThisElement&&(o=P(e,l.transclude,i)),l(f,e,n,r,o,l)))}}function G(t,e){var n=e.priority-t.priority;return 0!==n?n:t.name!==e.name?t.name"+n+""+t+">",r.childNodes[0].childNodes;default:return n}}function Q(t,e){if("srcdoc"==e)return S.HTML;var n=R(t);return"xlinkHref"==e||"form"==n&&"action"==e||"img"!=n&&("src"==e||"ngSrc"==e)?S.RESOURCE_URL:void 0}function tt(t,e,n,i,o){var s=Q(t,i);o=v[i]||o;var u=r(n,!0,s,o);if(u){if("multiple"===i&&"select"===R(t))throw Ci("selmulti","Binding to the 'multiple' attribute is not supported. Element: {0}",Z(t));e.push({priority:100,compile:function(){return{pre:function(t,e,a){var c=a.$$observers||(a.$$observers={});if(b.test(i))throw Ci("nodomevents","Interpolations for HTML DOM event attributes are disallowed. Please use the ng- versions (such as ng-click instead of onclick) instead.");var l=a[i];l!==n&&(u=l&&r(l,!0,s,o),n=l),u&&(a[i]=u(t),(c[i]||(c[i]=[])).$$inter=!0,(a.$$observers&&a.$$observers[i].$$scope||t).$watch(u,function(t,e){"class"===i&&t!=e?a.$updateClass(t,e):a.$set(i,t)}))}}}})}}function et(t,n,r){var i,o,s=n[0],u=n.length,a=s.parentNode;if(t)for(i=0,o=t.length;o>i;i++)if(t[i]==s){t[i++]=r;for(var c=i,l=c+u-1,f=t.length;f>c;c++,l++)f>l?t[c]=t[l]:delete t[c];t.length-=u-1,t.context===s&&(t.context=r);break}a&&a.replaceChild(r,s);var h=e.createDocumentFragment();h.appendChild(s),Er.hasData(s)&&(Er(r).data(Er(s).data()),Ar?(zr=!0,Ar.cleanData([s])):delete Er.cache[s[Er.expando]]);for(var p=1,d=n.length;d>p;p++){var g=n[p];Er(g).remove(),h.appendChild(g),delete n[p]}n[0]=r,n.length=1}function nt(t,e){return f(function(){return t.apply(null,arguments)},t,e)}function rt(t,e,n,r,o,s){try{t(e,n,r,o,s)}catch(u){i(u,Z(n))}}function it(t,e,i,s,a,c){var l;o(s,function(o,s){var c,f,h,p,d=o.attrName,y=o.optional,m=o.mode;switch(wr.call(e,d)||(e[d]=n),m){case"@":e[d]||y||(i[s]=n),e.$observe(d,function(t){i[s]=t}),e.$$observers[d].$$scope=t,e[d]&&(i[s]=r(e[d])(t));break;case"=":if(y&&!e[d])return;f=u(e[d]),p=f.literal?F:function(t,e){return t===e||t!==t&&e!==e},h=f.assign||function(){throw c=i[s]=f(t),Ci("nonassign","Expression '{0}' used with directive '{1}' is non-assignable!",e[d],a.name)},c=i[s]=f(t);var v=function(e){return p(e,i[s])||(p(e,c)?h(t,e=i[s]):i[s]=e),c=e};v.$stateful=!0;var $;$=o.collection?t.$watchCollection(e[d],v):t.$watch(u(e[d],v),null,f.literal),l=l||[],l.push($);break;case"&":if(f=u(e[d]),f===g&&y)break;i[s]=function(e){return f(t,e)}}});var f=l?function(){for(var t=0,e=l.length;e>t;++t)l[t]()}:g;return c&&f!==g?(c.$on("$destroy",f),g):f}var ot=function(t,e){if(e){var n,r,i,o=Object.keys(e);for(n=0,r=o.length;r>n;n++)i=o[n],this[i]=e[i]}else this.$attr={};this.$$element=t};ot.prototype={$normalize:ce,$addClass:function(t){t&&t.length>0&&A.addClass(this.$$element,t)},$removeClass:function(t){t&&t.length>0&&A.removeClass(this.$$element,t)},$updateClass:function(t,e){var n=le(t,e);n&&n.length&&A.addClass(this.$$element,n);var r=le(e,t);r&&r.length&&A.removeClass(this.$$element,r)},$set:function(t,e,r,s){var u,a=this.$$element[0],c=Ht(a,t),l=qt(a,t),f=t;if(c?(this.$$element.prop(t,e),s=c):l&&(this[l]=e,f=l),this[t]=e,s?this.$attr[t]=s:(s=this.$attr[t],s||(this.$attr[t]=s=ct(t,"-"))),u=R(this.$$element),"a"===u&&"href"===t||"img"===u&&"src"===t)this[t]=e=B(e,"src"===t);else if("img"===u&&"srcset"===t){for(var h="",p=jr(e),d=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,g=/\s/.test(p)?d:/(,)/,y=p.split(g),m=Math.floor(y.length/2),v=0;m>v;v++){var $=2*v;h+=B(jr(y[$]),!0),h+=" "+jr(y[$+1])}var _=jr(y[2*v]).split(/\s/);h+=B(jr(_[0]),!0),2===_.length&&(h+=" "+jr(_[1])),this[t]=e=h}r!==!1&&(null===e||e===n?this.$$element.removeAttr(s):this.$$element.attr(s,e));var w=this.$$observers;w&&o(w[f],function(t){try{t(e)}catch(n){i(n)}})},$observe:function(t,e){var n=this,r=n.$$observers||(n.$$observers=yt()),i=r[t]||(r[t]=[]);return i.push(e),m.$evalAsync(function(){!i.$$inter&&n.hasOwnProperty(t)&&e(n[t])}),function(){U(i,e)}}};var st=r.startSymbol(),ut=r.endSymbol(),at="{{"==st||"}}"==ut?y:function(t){return t.replace(/\{\{/g,st).replace(/}}/g,ut)},lt=/^ngAttr[A-Z]/;return O.$$addBindingInfo=x?function(t,e){var n=t.data("$binding")||[];Rr(e)?n=n.concat(e):n.push(e),t.data("$binding",n)}:g,O.$$addBindingClass=x?function(t){T(t,"ng-binding")}:g,O.$$addScopeInfo=x?function(t,e,n,r){var i=n?r?"$isolateScopeNoTemplate":"$isolateScope":"$scope";t.data(i,e)}:g,O.$$addScopeClass=x?function(t,e){T(t,e?"ng-isolate-scope":"ng-scope")}:g,O}]}function ce(t){return bt(t.replace(Ti,""))}function le(t,e){var n="",r=t.split(/\s+/),i=e.split(/\s+/);t:for(var o=0;o0?" ":"")+s}return n}function fe(t){t=Er(t);var e=t.length;if(1>=e)return t;for(;e--;){var n=t[e];n.nodeType===Yr&&Tr.call(t,e,1)}return t}function he(t,e){if(e&&k(e))return e;if(k(t)){var n=Di.exec(t);if(n)return n[3]}}function pe(){var t={},e=!1;this.register=function(e,n){pt(e,"controller"),w(e)?f(t,e):t[e]=n},this.allowGlobals=function(){e=!0},this.$get=["$injector","$window",function(i,o){function s(t,e,n,i){if(!t||!w(t.$scope))throw r("$controller")("noscp","Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",i,e);t.$scope[e]=n}return function(r,u,a,c){var l,h,p,d;if(a=a===!0,c&&k(c)&&(d=c),k(r)){if(h=r.match(Di),!h)throw Oi("ctrlfmt","Badly formed controller string '{0}'. Must match `__name__ as __id__` or `__name__`.",r);p=h[1],d=d||h[3],r=t.hasOwnProperty(p)?t[p]:dt(u.$scope,p,!0)||(e?dt(o,p,!0):n),ht(r,p,!0)}if(a){var g=(Rr(r)?r[r.length-1]:r).prototype;l=Object.create(g||null),d&&s(u,d,l,p||r.name);var y;return y=f(function(){var t=i.invoke(r,l,u,p);return t!==l&&(w(t)||E(t))&&(l=t,d&&s(u,d,l,p||r.name)),l},{instance:l,identifier:d})}return l=i.instantiate(r,u,p),d&&s(u,d,l,p||r.name),l}}]}function de(){this.$get=["$window",function(t){return Er(t.document)}]}function ge(){this.$get=["$log",function(t){return function(e,n){t.error.apply(t,arguments)}}]}function ye(t){return w(t)?S(t)?t.toISOString():K(t):t}function me(){this.$get=function(){return function(t){if(!t)return"";var e=[];return s(t,function(t,n){null===t||$(t)||(Rr(t)?o(t,function(t,r){e.push(rt(n)+"="+rt(ye(t)))}):e.push(rt(n)+"="+rt(ye(t))))}),e.join("&")}}}function ve(){this.$get=function(){return function(t){function e(t,r,i){null===t||$(t)||(Rr(t)?o(t,function(t){e(t,r+"[]")}):w(t)&&!S(t)?s(t,function(t,n){e(t,r+(i?"":"[")+n+(i?"":"]"))}):n.push(rt(r)+"="+rt(ye(t))))}if(!t)return"";var n=[];return e(t,"",!0),n.join("&")}}}function $e(t,e){if(k(t)){var n=t.replace(zi,"").trim();if(n){var r=e("Content-Type");(r&&0===r.indexOf(Mi)||_e(n))&&(t=G(n))}}return t}function _e(t){var e=t.match(Ii);return e&&Ni[e[0]].test(t)}function we(t){function e(t,e){t&&(r[t]=r[t]?r[t]+", "+e:e)}var n,r=yt();return k(t)?o(t.split("\n"),function(t){n=t.indexOf(":"),e(_r(jr(t.substr(0,n))),jr(t.substr(n+1)))}):w(t)&&o(t,function(t,n){e(_r(n),jr(t))}),r}function be(t){var e;return function(n){if(e||(e=we(t)),n){var r=e[_r(n)];return void 0===r&&(r=null),r}return e}}function ke(t,e,n,r){return E(r)?r(t,e,n):(o(r,function(r){t=r(t,e,n)}),t)}function xe(t){return t>=200&&300>t}function Se(){var t=this.defaults={transformResponse:[$e],transformRequest:[function(t){return!w(t)||T(t)||D(t)||O(t)?t:K(t)}],headers:{common:{Accept:"application/json, text/plain, */*"},post:V(Pi),put:V(Pi),patch:V(Pi)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer"},e=!1;this.useApplyAsync=function(t){return _(t)?(e=!!t,this):e};var i=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(s,u,a,c,l,h){function p(e){function i(t){var e=f({},t);return e.data=t.data?ke(t.data,t.headers,t.status,a.transformResponse):t.data,xe(t.status)?e:l.reject(e)}function s(t,e){var n,r={};return o(t,function(t,i){E(t)?(n=t(e),null!=n&&(r[i]=n)):r[i]=t}),r}function u(e){var n,r,i,o=t.headers,u=f({},e.headers);o=f({},o.common,o[_r(e.method)]);t:for(n in o){r=_r(n);for(i in u)if(_r(i)===r)continue t;u[n]=o[n]}return s(u,V(e))}if(!Ir.isObject(e))throw r("$http")("badreq","Http request configuration must be an object. Received: {0}",e);var a=f({method:"get",transformRequest:t.transformRequest,transformResponse:t.transformResponse,paramSerializer:t.paramSerializer},e);a.headers=u(e),a.method=br(a.method),a.paramSerializer=k(a.paramSerializer)?h.get(a.paramSerializer):a.paramSerializer;var c=function(e){var r=e.headers,s=ke(e.data,be(r),n,e.transformRequest);return $(s)&&o(r,function(t,e){"content-type"===_r(e)&&delete r[e]}),$(e.withCredentials)&&!$(t.withCredentials)&&(e.withCredentials=t.withCredentials),y(e,s).then(i,i)},p=[c,n],d=l.when(a);for(o(b,function(t){(t.request||t.requestError)&&p.unshift(t.request,t.requestError),(t.response||t.responseError)&&p.push(t.response,t.responseError)});p.length;){var g=p.shift(),m=p.shift();d=d.then(g,m)}return d.success=function(t){return ht(t,"fn"),d.then(function(e){t(e.data,e.status,e.headers,a)}),d},d.error=function(t){return ht(t,"fn"),d.then(null,function(e){t(e.data,e.status,e.headers,a)}),d},d}function d(t){o(arguments,function(t){p[t]=function(e,n){return p(f({},n||{},{method:t,url:e}))}})}function g(t){o(arguments,function(t){p[t]=function(e,n,r){return p(f({},r||{},{method:t,url:e,data:n}))}})}function y(r,i){function o(t,n,r,i){function o(){a(n,t,r,i)}d&&(xe(t)?d.put(x,[t,n,we(r),i]):d.remove(x)),e?c.$applyAsync(o):(o(),c.$$phase||c.$apply())}function a(t,e,n,i){e=Math.max(e,0),(xe(e)?y.resolve:y.reject)({data:t,status:e,headers:be(n),config:r,statusText:i})}function f(t){a(t.data,t.status,V(t.headers()),t.statusText)}function h(){var t=p.pendingRequests.indexOf(r);-1!==t&&p.pendingRequests.splice(t,1)}var d,g,y=l.defer(),b=y.promise,k=r.headers,x=m(r.url,r.paramSerializer(r.params));if(p.pendingRequests.push(r),b.then(h,h),!r.cache&&!t.cache||r.cache===!1||"GET"!==r.method&&"JSONP"!==r.method||(d=w(r.cache)?r.cache:w(t.cache)?t.cache:v),d&&(g=d.get(x),_(g)?P(g)?g.then(f,f):Rr(g)?a(g[1],g[0],V(g[2]),g[3]):a(g,200,{},"OK"):d.put(x,b)),$(g)){var S=An(r.url)?u()[r.xsrfCookieName||t.xsrfCookieName]:n;S&&(k[r.xsrfHeaderName||t.xsrfHeaderName]=S),s(r.method,x,i,o,k,r.timeout,r.withCredentials,r.responseType)}return b}function m(t,e){return e.length>0&&(t+=(-1==t.indexOf("?")?"?":"&")+e),t}var v=a("$http");t.paramSerializer=k(t.paramSerializer)?h.get(t.paramSerializer):t.paramSerializer;var b=[];return o(i,function(t){b.unshift(k(t)?h.get(t):h.invoke(t))}),p.pendingRequests=[],d("get","delete","head","jsonp"),g("post","put","patch"),p.defaults=t,p}]}function Ee(){return new t.XMLHttpRequest}function Ae(){this.$get=["$browser","$window","$document",function(t,e,n){return Be(t,Ee,t.defer,e.angular.callbacks,n[0])}]}function Be(t,e,r,i,s){function u(t,e,n){var r=s.createElement("script"),o=null;return r.type="text/javascript",r.src=t,r.async=!0,o=function(t){ri(r,"load",o),ri(r,"error",o),s.body.removeChild(r),r=null;var u=-1,a="unknown";t&&("load"!==t.type||i[e].called||(t={type:"error"}),a=t.type,u="error"===t.type?404:200),n&&n(u,a)},ni(r,"load",o),ni(r,"error",o),s.body.appendChild(r),o}return function(s,a,c,l,f,h,p,d){function y(){$&&$(),w&&w.abort()}function m(e,i,o,s,u){x!==n&&r.cancel(x),$=w=null,e(i,o,s,u),t.$$completeOutstandingRequest(g)}if(t.$$incOutstandingRequestCount(),a=a||t.url(),"jsonp"==_r(s)){var v="_"+(i.counter++).toString(36);i[v]=function(t){i[v].data=t,i[v].called=!0};var $=u(a.replace("JSON_CALLBACK","angular.callbacks."+v),v,function(t,e){m(l,t,i[v].data,"",e),i[v]=g})}else{var w=e();w.open(s,a,!0),o(f,function(t,e){_(t)&&w.setRequestHeader(e,t)}),w.onload=function(){var t=w.statusText||"",e="response"in w?w.response:w.responseText,n=1223===w.status?204:w.status;0===n&&(n=e?200:"file"==En(a).protocol?404:0),m(l,n,e,w.getAllResponseHeaders(),t)};var b=function(){m(l,-1,null,null,"")};if(w.onerror=b,w.onabort=b,p&&(w.withCredentials=!0),d)try{w.responseType=d}catch(k){if("json"!==d)throw k}w.send(c)}if(h>0)var x=r(y,h);else P(h)&&h.then(y)}}function Ce(){var t="{{",e="}}";this.startSymbol=function(e){return e?(t=e,this):t},this.endSymbol=function(t){return t?(e=t,this):e},this.$get=["$parse","$exceptionHandler","$sce",function(n,r,i){function o(t){return"\\\\\\"+t}function s(n){return n.replace(h,t).replace(p,e)}function u(t){if(null==t)return"";switch(typeof t){case"string":break;case"number":t=""+t;break;default:t=K(t)}return t}function a(o,a,h,p){function d(t){try{return t=B(t),p&&!_(t)?t:u(t)}catch(e){r(Ri.interr(o,e))}}p=!!p;for(var g,y,m,v=0,w=[],b=[],k=o.length,x=[],S=[];k>v;){if(-1==(g=o.indexOf(t,v))||-1==(y=o.indexOf(e,g+c))){v!==k&&x.push(s(o.substring(v)));break}v!==g&&x.push(s(o.substring(v,g))),m=o.substring(g+c,y),w.push(m),b.push(n(m,d)),v=y+l,S.push(x.length),x.push("")}if(h&&x.length>1&&Ri.throwNoconcat(o),!a||w.length){var A=function(t){for(var e=0,n=w.length;n>e;e++){if(p&&$(t[e]))return;x[S[e]]=t[e]}return x.join("")},B=function(t){return h?i.getTrusted(h,t):i.valueOf(t)};return f(function(t){var e=0,n=w.length,i=new Array(n);try{for(;n>e;e++)i[e]=b[e](t);return A(i)}catch(s){r(Ri.interr(o,s))}},{exp:o,expressions:w,$$watchDelegate:function(t,e){var n;return t.$watchGroup(b,function(r,i){var o=A(r);E(e)&&e.call(this,o,r!==i?n:o,t),n=o})}})}}var c=t.length,l=e.length,h=new RegExp(t.replace(/./g,o),"g"),p=new RegExp(e.replace(/./g,o),"g");return a.startSymbol=function(){return t},a.endSymbol=function(){return e},a}]}function Te(){this.$get=["$rootScope","$window","$q","$$q",function(t,e,n,r){function i(i,s,u,a){var c=arguments.length>4,l=c?H(arguments,4):[],f=e.setInterval,h=e.clearInterval,p=0,d=_(a)&&!a,g=(d?r:n).defer(),y=g.promise;return u=_(u)?u:0,y.then(null,null,c?function(){i.apply(null,l)}:i),y.$$intervalId=f(function(){g.notify(p++),u>0&&p>=u&&(g.resolve(p),h(y.$$intervalId),delete o[y.$$intervalId]),d||t.$apply()},s),o[y.$$intervalId]=g,y}var o={};return i.cancel=function(t){return t&&t.$$intervalId in o?(o[t.$$intervalId].reject("canceled"),e.clearInterval(t.$$intervalId),delete o[t.$$intervalId],!0):!1},i}]}function Oe(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"¤",posSuf:"",negPre:"(¤",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a",ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"]},pluralCat:function(t){return 1===t?"one":"other"}}}}function De(t){for(var e=t.split("/"),n=e.length;n--;)e[n]=nt(e[n]);return e.join("/")}function Me(t,e){var n=En(t);e.$$protocol=n.protocol,e.$$host=n.hostname,e.$$port=p(n.port)||ji[n.protocol]||null}function Pe(t,e){var n="/"!==t.charAt(0);n&&(t="/"+t);var r=En(t);e.$$path=decodeURIComponent(n&&"/"===r.pathname.charAt(0)?r.pathname.substring(1):r.pathname),e.$$search=tt(r.search),e.$$hash=decodeURIComponent(r.hash),e.$$path&&"/"!=e.$$path.charAt(0)&&(e.$$path="/"+e.$$path)}function Ie(t,e){return 0===e.indexOf(t)?e.substr(t.length):void 0}function Ne(t){var e=t.indexOf("#");return-1==e?t:t.substr(0,e)}function ze(t){return t.replace(/(#.+)|#$/,"$1")}function Re(t){return t.substr(0,Ne(t).lastIndexOf("/")+1)}function Ue(t){return t.substring(0,t.indexOf("/",t.indexOf("//")+2))}function je(t,e){this.$$html5=!0,e=e||"";var r=Re(t);Me(t,this),this.$$parse=function(t){var e=Ie(r,t);if(!k(e))throw Vi("ipthprfx",'Invalid url "{0}", missing path prefix "{1}".',t,r);Pe(e,this),this.$$path||(this.$$path="/"),this.$$compose()},this.$$compose=function(){var t=et(this.$$search),e=this.$$hash?"#"+nt(this.$$hash):"";this.$$url=De(this.$$path)+(t?"?"+t:"")+e,this.$$absUrl=r+this.$$url.substr(1)},this.$$parseLinkUrl=function(i,o){if(o&&"#"===o[0])return this.hash(o.slice(1)),!0;var s,u,a;return(s=Ie(t,i))!==n?(u=s,a=(s=Ie(e,s))!==n?r+(Ie("/",s)||s):t+u):(s=Ie(r,i))!==n?a=r+s:r==i+"/"&&(a=r),a&&this.$$parse(a),!!a}}function Ve(t,e){var n=Re(t);Me(t,this),this.$$parse=function(r){function i(t,e,n){var r,i=/^\/[A-Z]:(\/.*)/;return 0===e.indexOf(n)&&(e=e.replace(n,"")),i.exec(e)?t:(r=i.exec(t),r?r[1]:t)}var o,s=Ie(t,r)||Ie(n,r);$(s)||"#"!==s.charAt(0)?this.$$html5?o=s:(o="",$(s)&&(t=r,this.replace())):(o=Ie(e,s),$(o)&&(o=s)),Pe(o,this),this.$$path=i(this.$$path,o,t),this.$$compose()},this.$$compose=function(){var n=et(this.$$search),r=this.$$hash?"#"+nt(this.$$hash):"";this.$$url=De(this.$$path)+(n?"?"+n:"")+r,this.$$absUrl=t+(this.$$url?e+this.$$url:"")},this.$$parseLinkUrl=function(e,n){return Ne(t)==Ne(e)?(this.$$parse(e),!0):!1}}function Fe(t,e){this.$$html5=!0,Ve.apply(this,arguments);var n=Re(t);this.$$parseLinkUrl=function(r,i){if(i&&"#"===i[0])return this.hash(i.slice(1)),!0;var o,s;return t==Ne(r)?o=r:(s=Ie(n,r))?o=t+e+s:n===r+"/"&&(o=n),o&&this.$$parse(o),!!o},this.$$compose=function(){var n=et(this.$$search),r=this.$$hash?"#"+nt(this.$$hash):"";this.$$url=De(this.$$path)+(n?"?"+n:"")+r,this.$$absUrl=t+e+this.$$url}}function Le(t){return function(){return this[t]}}function He(t,e){return function(n){return $(n)?this[t]:(this[t]=e(n),this.$$compose(),this)}}function qe(){var t="",e={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(e){return _(e)?(t=e,this):t},this.html5Mode=function(t){return M(t)?(e.enabled=t,this):w(t)?(M(t.enabled)&&(e.enabled=t.enabled),M(t.requireBase)&&(e.requireBase=t.requireBase),M(t.rewriteLinks)&&(e.rewriteLinks=t.rewriteLinks),this):e},this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(n,r,i,o,s){function u(t,e,n){var i=c.url(),o=c.$$state;try{r.url(t,e,n),c.$$state=r.state()}catch(s){throw c.url(i),c.$$state=o,s}}function a(t,e){n.$broadcast("$locationChangeSuccess",c.absUrl(),t,c.$$state,e)}var c,l,f,h=r.baseHref(),p=r.url();if(e.enabled){if(!h&&e.requireBase)throw Vi("nobase","$location in HTML5 mode requires a tag to be present!");f=Ue(p)+(h||"/"),l=i.history?je:Fe}else f=Ne(p),l=Ve;c=new l(f,"#"+t),c.$$parseLinkUrl(p,p),c.$$state=r.state();var d=/^\s*(javascript|mailto):/i;o.on("click",function(t){if(e.rewriteLinks&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey&&2!=t.which&&2!=t.button){for(var i=Er(t.target);"a"!==R(i[0]);)if(i[0]===o[0]||!(i=i.parent())[0])return;var u=i.prop("href"),a=i.attr("href")||i.attr("xlink:href");w(u)&&"[object SVGAnimatedString]"===u.toString()&&(u=En(u.animVal).href),d.test(u)||!u||i.attr("target")||t.isDefaultPrevented()||c.$$parseLinkUrl(u,a)&&(t.preventDefault(),c.absUrl()!=r.url()&&(n.$apply(),s.angular["ff-684208-preventDefault"]=!0))}}),ze(c.absUrl())!=ze(p)&&r.url(c.absUrl(),!0);var g=!0;return r.onUrlChange(function(t,e){n.$evalAsync(function(){var r,i=c.absUrl(),o=c.$$state;c.$$parse(t),c.$$state=e,r=n.$broadcast("$locationChangeStart",t,i,e,o).defaultPrevented,c.absUrl()===t&&(r?(c.$$parse(i),c.$$state=o,u(i,!1,o)):(g=!1,a(i,o)))}),n.$$phase||n.$digest()}),n.$watch(function(){var t=ze(r.url()),e=ze(c.absUrl()),o=r.state(),s=c.$$replace,l=t!==e||c.$$html5&&i.history&&o!==c.$$state;(g||l)&&(g=!1,n.$evalAsync(function(){var e=c.absUrl(),r=n.$broadcast("$locationChangeStart",e,t,c.$$state,o).defaultPrevented;c.absUrl()===e&&(r?(c.$$parse(t),c.$$state=o):(l&&u(e,s,o===c.$$state?null:c.$$state),a(t,o)))})),c.$$replace=!1}),c}]}function We(){var t=!0,e=this;this.debugEnabled=function(e){return _(e)?(t=e,this):t},this.$get=["$window",function(n){function r(t){return t instanceof Error&&(t.stack?t=t.message&&-1===t.stack.indexOf(t.message)?"Error: "+t.message+"\n"+t.stack:t.stack:t.sourceURL&&(t=t.message+"\n"+t.sourceURL+":"+t.line)),t}function i(t){var e=n.console||{},i=e[t]||e.log||g,s=!1;try{s=!!i.apply}catch(u){}return s?function(){var t=[];return o(arguments,function(e){t.push(r(e))}),i.apply(e,t)}:function(t,e){i(t,null==e?"":e)}}return{log:i("log"),info:i("info"),warn:i("warn"),error:i("error"),debug:function(){var n=i("debug");return function(){t&&n.apply(e,arguments)}}()}}]}function Ke(t,e){if("__defineGetter__"===t||"__defineSetter__"===t||"__lookupGetter__"===t||"__lookupSetter__"===t||"__proto__"===t)throw Li("isecfld","Attempting to access a disallowed field in Angular expressions! Expression: {0}",e);return t}function Ge(t,e){if(t){if(t.constructor===t)throw Li("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",e);if(t.window===t)throw Li("isecwindow","Referencing the Window in Angular expressions is disallowed! Expression: {0}",e);if(t.children&&(t.nodeName||t.prop&&t.attr&&t.find))throw Li("isecdom","Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}",e);if(t===Object)throw Li("isecobj","Referencing Object in Angular expressions is disallowed! Expression: {0}",e)}return t}function Xe(t,e){if(t){if(t.constructor===t)throw Li("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",e);if(t===Hi||t===qi||t===Wi)throw Li("isecff","Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}",e)}}function Ye(t,e){return"undefined"!=typeof t?t:e}function Je(t,e){return"undefined"==typeof t?e:"undefined"==typeof e?t:t+e}function Ze(t,e){var n=t(e);return!n.$stateful}function Qe(t,e){var n,r;switch(t.type){case Yi.Program:n=!0,o(t.body,function(t){Qe(t.expression,e),n=n&&t.expression.constant}),t.constant=n;break;case Yi.Literal:t.constant=!0,t.toWatch=[];break;case Yi.UnaryExpression:Qe(t.argument,e),t.constant=t.argument.constant,t.toWatch=t.argument.toWatch;break;case Yi.BinaryExpression:Qe(t.left,e),Qe(t.right,e),t.constant=t.left.constant&&t.right.constant,t.toWatch=t.left.toWatch.concat(t.right.toWatch);break;case Yi.LogicalExpression:Qe(t.left,e),Qe(t.right,e),t.constant=t.left.constant&&t.right.constant,t.toWatch=t.constant?[]:[t];break;case Yi.ConditionalExpression:Qe(t.test,e),Qe(t.alternate,e),Qe(t.consequent,e),t.constant=t.test.constant&&t.alternate.constant&&t.consequent.constant,t.toWatch=t.constant?[]:[t];break;case Yi.Identifier:t.constant=!1,t.toWatch=[t];break;case Yi.MemberExpression:Qe(t.object,e),t.computed&&Qe(t.property,e),t.constant=t.object.constant&&(!t.computed||t.property.constant),t.toWatch=[t];break;case Yi.CallExpression:n=t.filter?Ze(e,t.callee.name):!1,r=[],o(t.arguments,function(t){Qe(t,e),n=n&&t.constant,t.constant||r.push.apply(r,t.toWatch)}),t.constant=n,t.toWatch=t.filter&&Ze(e,t.callee.name)?r:[t];break;case Yi.AssignmentExpression:Qe(t.left,e),Qe(t.right,e),t.constant=t.left.constant&&t.right.constant,t.toWatch=[t];break;case Yi.ArrayExpression:n=!0,r=[],o(t.elements,function(t){Qe(t,e),n=n&&t.constant,t.constant||r.push.apply(r,t.toWatch)}),t.constant=n,t.toWatch=r;break;case Yi.ObjectExpression:n=!0,r=[],o(t.properties,function(t){Qe(t.value,e),n=n&&t.value.constant,t.value.constant||r.push.apply(r,t.value.toWatch)}),t.constant=n,t.toWatch=r;break;case Yi.ThisExpression:t.constant=!1,t.toWatch=[]}}function tn(t){if(1==t.length){var e=t[0].expression,r=e.toWatch;return 1!==r.length?r:r[0]!==e?r:n}}function en(t){return t.type===Yi.Identifier||t.type===Yi.MemberExpression}function nn(t){return 1===t.body.length&&en(t.body[0].expression)?{type:Yi.AssignmentExpression,left:t.body[0].expression,right:{type:Yi.NGValueParameter},operator:"="}:void 0}function rn(t){return 0===t.body.length||1===t.body.length&&(t.body[0].expression.type===Yi.Literal||t.body[0].expression.type===Yi.ArrayExpression||t.body[0].expression.type===Yi.ObjectExpression)}function on(t){return t.constant}function sn(t,e){this.astBuilder=t,this.$filter=e}function un(t,e){this.astBuilder=t,this.$filter=e}function an(t,e,n,r){Ge(t,r);for(var i,o=e.split("."),s=0;o.length>1;s++){i=Ke(o.shift(),r);var u=Ge(t[i],r);u||(u={},t[i]=u),t=u}return i=Ke(o.shift(),r),Ge(t[i],r),t[i]=n,n}function cn(t){return"constructor"==t}function ln(t){return E(t.valueOf)?t.valueOf():Zi.call(t)}function fn(){var t=yt(),e=yt();this.$get=["$filter","$sniffer",function(r,i){function s(t,e){return null==t||null==e?t===e:"object"==typeof t&&(t=ln(t),"object"==typeof t)?!1:t===e||t!==t&&e!==e}function u(t,e,r,i,o){var u,a=i.inputs;if(1===a.length){var c=s;return a=a[0],t.$watch(function(t){var e=a(t);return s(e,c)||(u=i(t,n,n,[e]),c=e&&ln(e)),u},e,r,o)}for(var l=[],f=[],h=0,p=a.length;p>h;h++)l[h]=s,f[h]=null;return t.$watch(function(t){for(var e=!1,r=0,o=a.length;o>r;r++){var c=a[r](t);(e||(e=!s(c,l[r])))&&(f[r]=c,l[r]=c&&ln(c))}return e&&(u=i(t,n,n,f)),u},e,r,o)}function a(t,e,n,r){var i,o;return i=t.$watch(function(t){return r(t)},function(t,n,r){o=t,E(e)&&e.apply(this,arguments),_(t)&&r.$$postDigest(function(){_(o)&&i()})},n)}function c(t,e,n,r){function i(t){var e=!0;return o(t,function(t){_(t)||(e=!1)}),e}var s,u;return s=t.$watch(function(t){return r(t)},function(t,n,r){u=t,E(e)&&e.call(this,t,n,r),i(t)&&r.$$postDigest(function(){i(u)&&s()})},n)}function l(t,e,n,r){var i;return i=t.$watch(function(t){return r(t)},function(t,n,r){E(e)&&e.apply(this,arguments),i()},n)}function f(t,e){if(!e)return t;var n=t.$$watchDelegate,r=n!==c&&n!==a,i=r?function(n,r,i,o){var s=t(n,r,i,o);return e(s,n,r)}:function(n,r,i,o){var s=t(n,r,i,o),u=e(s,n,r);return _(s)?u:s};return t.$$watchDelegate&&t.$$watchDelegate!==u?i.$$watchDelegate=t.$$watchDelegate:e.$stateful||(i.$$watchDelegate=u,i.inputs=t.inputs?t.inputs:[t]),i}var h={csp:i.csp,expensiveChecks:!1},p={csp:i.csp,expensiveChecks:!0};return function(n,i,o){var s,d,y;switch(typeof n){case"string":n=n.trim(),y=n;var m=o?e:t;if(s=m[y],!s){":"===n.charAt(0)&&":"===n.charAt(1)&&(d=!0,n=n.substring(2));var v=o?p:h,$=new Xi(v),_=new Ji($,r,v);s=_.parse(n),s.constant?s.$$watchDelegate=l:d?s.$$watchDelegate=s.literal?c:a:s.inputs&&(s.$$watchDelegate=u),m[y]=s}return f(s,i);case"function":return f(n,i);default:return g}}}]}function hn(){this.$get=["$rootScope","$exceptionHandler",function(t,e){return dn(function(e){t.$evalAsync(e)},e)}]}function pn(){this.$get=["$browser","$exceptionHandler",function(t,e){return dn(function(e){t.defer(e)},e)}]}function dn(t,e){function i(t,e,n){function r(e){return function(n){i||(i=!0,e.call(t,n))}}var i=!1;return[r(e),r(n)]}function s(){this.$$state={status:0}}function u(t,e){return function(n){e.call(t,n)}}function a(t){var r,i,o;o=t.pending,t.processScheduled=!1,t.pending=n;for(var s=0,u=o.length;u>s;++s){i=o[s][0],r=o[s][t.status];try{E(r)?i.resolve(r(t.value)):1===t.status?i.resolve(t.value):i.reject(t.value)}catch(a){i.reject(a),e(a)}}}function c(e){!e.processScheduled&&e.pending&&(e.processScheduled=!0,t(function(){a(e)}))}function l(){this.promise=new s,this.resolve=u(this,this.resolve),this.reject=u(this,this.reject),this.notify=u(this,this.notify)}function f(t){var e=new l,n=0,r=Rr(t)?[]:{};return o(t,function(t,i){n++,m(t).then(function(t){r.hasOwnProperty(i)||(r[i]=t,--n||e.resolve(r))},function(t){r.hasOwnProperty(i)||e.reject(t)})}),0===n&&e.resolve(r),e.promise}var h=r("$q",TypeError),p=function(){return new l};s.prototype={then:function(t,e,n){var r=new l;return this.$$state.pending=this.$$state.pending||[],this.$$state.pending.push([r,t,e,n]),this.$$state.status>0&&c(this.$$state),r.promise},"catch":function(t){return this.then(null,t)},"finally":function(t,e){return this.then(function(e){return y(e,!0,t)},function(e){return y(e,!1,t)},e)}},l.prototype={resolve:function(t){this.promise.$$state.status||(t===this.promise?this.$$reject(h("qcycle","Expected promise to be resolved with value other than itself '{0}'",t)):this.$$resolve(t))},$$resolve:function(t){var n,r;r=i(this,this.$$resolve,this.$$reject);try{(w(t)||E(t))&&(n=t&&t.then),E(n)?(this.promise.$$state.status=-1,n.call(t,r[0],r[1],this.notify)):(this.promise.$$state.value=t,this.promise.$$state.status=1,c(this.promise.$$state))}catch(o){r[1](o),e(o)}},reject:function(t){this.promise.$$state.status||this.$$reject(t)},$$reject:function(t){this.promise.$$state.value=t,this.promise.$$state.status=2,c(this.promise.$$state)},notify:function(n){var r=this.promise.$$state.pending;
+
+this.promise.$$state.status<=0&&r&&r.length&&t(function(){for(var t,i,o=0,s=r.length;s>o;o++){i=r[o][0],t=r[o][3];try{i.notify(E(t)?t(n):n)}catch(u){e(u)}}})}};var d=function(t){var e=new l;return e.reject(t),e.promise},g=function(t,e){var n=new l;return e?n.resolve(t):n.reject(t),n.promise},y=function(t,e,n){var r=null;try{E(n)&&(r=n())}catch(i){return g(i,!1)}return P(r)?r.then(function(){return g(t,e)},function(t){return g(t,!1)}):g(t,e)},m=function(t,e,n,r){var i=new l;return i.resolve(t),i.promise.then(e,n,r)},v=m,$=function _(t){function e(t){r.resolve(t)}function n(t){r.reject(t)}if(!E(t))throw h("norslvr","Expected resolverFn, got '{0}'",t);if(!(this instanceof _))return new _(t);var r=new l;return t(e,n),r.promise};return $.defer=p,$.reject=d,$.when=m,$.resolve=v,$.all=f,$}function gn(){this.$get=["$window","$timeout",function(t,e){function n(){for(var t=0;t=0&&(l[e]=null,e=null,0===--c&&a&&(a(),a=null,l.length=0))}}var i=t.requestAnimationFrame||t.webkitRequestAnimationFrame,o=t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.webkitCancelRequestAnimationFrame,s=!!i,u=s?function(t){var e=i(t);return function(){o(e)}}:function(t){var n=e(t,16.66,!1);return function(){e.cancel(n)}};r.supported=s;var a,c=0,l=[];return r}]}function yn(){function t(t){function e(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$id=a(),this.$$ChildScope=null}return e.prototype=t,e}var e=10,n=r("$rootScope"),s=null,u=null;this.digestTtl=function(t){return arguments.length&&(e=t),e},this.$get=["$injector","$exceptionHandler","$parse","$browser",function(r,c,l,f){function h(t){t.currentScope.$$destroyed=!0}function p(){this.$id=a(),this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null,this.$root=this,this.$$destroyed=!1,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$$isolateBindings=null}function d(t){if(x.$$phase)throw n("inprog","{0} already in progress",x.$$phase);x.$$phase=t}function y(){x.$$phase=null}function m(t,e){do t.$$watchersCount+=e;while(t=t.$parent)}function v(t,e,n){do t.$$listenerCount[n]-=e,0===t.$$listenerCount[n]&&delete t.$$listenerCount[n];while(t=t.$parent)}function _(){}function b(){for(;B.length;)try{B.shift()()}catch(t){c(t)}u=null}function k(){null===u&&(u=f.defer(function(){x.$apply(b)}))}p.prototype={constructor:p,$new:function(e,n){var r;return n=n||this,e?(r=new p,r.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=t(this)),r=new this.$$ChildScope),r.$parent=n,r.$$prevSibling=n.$$childTail,n.$$childHead?(n.$$childTail.$$nextSibling=r,n.$$childTail=r):n.$$childHead=n.$$childTail=r,(e||n!=this)&&r.$on("$destroy",h),r},$watch:function(t,e,n,r){var i=l(t);if(i.$$watchDelegate)return i.$$watchDelegate(this,e,n,i,t);var o=this,u=o.$$watchers,a={fn:e,last:_,get:i,exp:r||t,eq:!!n};return s=null,E(e)||(a.fn=g),u||(u=o.$$watchers=[]),u.unshift(a),m(this,1),function(){U(u,a)>=0&&m(o,-1),s=null}},$watchGroup:function(t,e){function n(){a=!1,c?(c=!1,e(i,i,u)):e(i,r,u)}var r=new Array(t.length),i=new Array(t.length),s=[],u=this,a=!1,c=!0;if(!t.length){var l=!0;return u.$evalAsync(function(){l&&e(i,i,u)}),function(){l=!1}}return 1===t.length?this.$watch(t[0],function(t,n,o){i[0]=t,r[0]=n,e(i,t===n?i:r,o)}):(o(t,function(t,e){var o=u.$watch(t,function(t,o){i[e]=t,r[e]=o,a||(a=!0,u.$evalAsync(n))});s.push(o)}),function(){for(;s.length;)s.shift()()})},$watchCollection:function(t,e){function n(t){o=t;var e,n,r,u,a;if(!$(o)){if(w(o))if(i(o)){s!==p&&(s=p,y=s.length=0,f++),e=o.length,y!==e&&(f++,s.length=y=e);for(var c=0;e>c;c++)a=s[c],u=o[c],r=a!==a&&u!==u,r||a===u||(f++,s[c]=u)}else{s!==d&&(s=d={},y=0,f++),e=0;for(n in o)o.hasOwnProperty(n)&&(e++,u=o[n],a=s[n],n in s?(r=a!==a&&u!==u,r||a===u||(f++,s[n]=u)):(y++,s[n]=u,f++));if(y>e){f++;for(n in s)o.hasOwnProperty(n)||(y--,delete s[n])}}else s!==o&&(s=o,f++);return f}}function r(){if(g?(g=!1,e(o,o,a)):e(o,u,a),c)if(w(o))if(i(o)){u=new Array(o.length);for(var t=0;t1,f=0,h=l(t,n),p=[],d={},g=!0,y=0;return this.$watch(h,r)},$digest:function(){var t,r,i,o,a,l,h,p,g,m,v=e,$=this,w=[];d("$digest"),f.$$checkUrlChange(),this===x&&null!==u&&(f.defer.cancel(u),b()),s=null;do{for(l=!1,p=$;S.length;){try{m=S.shift(),m.scope.$eval(m.expression,m.locals)}catch(k){c(k)}s=null}t:do{if(o=p.$$watchers)for(a=o.length;a--;)try{if(t=o[a])if((r=t.get(p))===(i=t.last)||(t.eq?F(r,i):"number"==typeof r&&"number"==typeof i&&isNaN(r)&&isNaN(i))){if(t===s){l=!1;break t}}else l=!0,s=t,t.last=t.eq?j(r,null):r,t.fn(r,i===_?r:i,p),5>v&&(g=4-v,w[g]||(w[g]=[]),w[g].push({msg:E(t.exp)?"fn: "+(t.exp.name||t.exp.toString()):t.exp,newVal:r,oldVal:i}))}catch(k){c(k)}if(!(h=p.$$watchersCount&&p.$$childHead||p!==$&&p.$$nextSibling))for(;p!==$&&!(h=p.$$nextSibling);)p=p.$parent}while(p=h);if((l||S.length)&&!v--)throw y(),n("infdig","{0} $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: {1}",e,w)}while(l||S.length);for(y();A.length;)try{A.shift()()}catch(k){c(k)}},$destroy:function(){if(!this.$$destroyed){var t=this.$parent;this.$broadcast("$destroy"),this.$$destroyed=!0,this===x&&f.$$applicationDestroyed(),m(this,-this.$$watchersCount);for(var e in this.$$listenerCount)v(this,this.$$listenerCount[e],e);t&&t.$$childHead==this&&(t.$$childHead=this.$$nextSibling),t&&t.$$childTail==this&&(t.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=g,this.$on=this.$watch=this.$watchGroup=function(){return g},this.$$listeners={},this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=this.$$watchers=null}},$eval:function(t,e){return l(t)(this,e)},$evalAsync:function(t,e){x.$$phase||S.length||f.defer(function(){S.length&&x.$digest()}),S.push({scope:this,expression:t,locals:e})},$$postDigest:function(t){A.push(t)},$apply:function(t){try{return d("$apply"),this.$eval(t)}catch(e){c(e)}finally{y();try{x.$digest()}catch(e){throw c(e),e}}},$applyAsync:function(t){function e(){n.$eval(t)}var n=this;t&&B.push(e),k()},$on:function(t,e){var n=this.$$listeners[t];n||(this.$$listeners[t]=n=[]),n.push(e);var r=this;do r.$$listenerCount[t]||(r.$$listenerCount[t]=0),r.$$listenerCount[t]++;while(r=r.$parent);var i=this;return function(){var r=n.indexOf(e);-1!==r&&(n[r]=null,v(i,1,t))}},$emit:function(t,e){var n,r,i,o=[],s=this,u=!1,a={name:t,targetScope:s,stopPropagation:function(){u=!0},preventDefault:function(){a.defaultPrevented=!0},defaultPrevented:!1},l=L([a],arguments,1);do{for(n=s.$$listeners[t]||o,a.currentScope=s,r=0,i=n.length;i>r;r++)if(n[r])try{n[r].apply(null,l)}catch(f){c(f)}else n.splice(r,1),r--,i--;if(u)return a.currentScope=null,a;s=s.$parent}while(s);return a.currentScope=null,a},$broadcast:function(t,e){var n=this,r=n,i=n,o={name:t,targetScope:n,preventDefault:function(){o.defaultPrevented=!0},defaultPrevented:!1};if(!n.$$listenerCount[t])return o;for(var s,u,a,l=L([o],arguments,1);r=i;){for(o.currentScope=r,s=r.$$listeners[t]||[],u=0,a=s.length;a>u;u++)if(s[u])try{s[u].apply(null,l)}catch(f){c(f)}else s.splice(u,1),u--,a--;if(!(i=r.$$listenerCount[t]&&r.$$childHead||r!==n&&r.$$nextSibling))for(;r!==n&&!(i=r.$$nextSibling);)r=r.$parent}return o.currentScope=null,o}};var x=new p,S=x.$$asyncQueue=[],A=x.$$postDigestQueue=[],B=x.$$applyAsyncQueue=[];return x}]}function mn(){var t=/^\s*(https?|ftp|mailto|tel|file):/,e=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(e){return _(e)?(t=e,this):t},this.imgSrcSanitizationWhitelist=function(t){return _(t)?(e=t,this):e},this.$get=function(){return function(n,r){var i,o=r?e:t;return i=En(n).href,""===i||i.match(o)?n:"unsafe:"+i}}}function vn(t){if("self"===t)return t;if(k(t)){if(t.indexOf("***")>-1)throw Qi("iwcard","Illegal sequence *** in string matcher. String: {0}",t);return t=Vr(t).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*"),new RegExp("^"+t+"$")}if(A(t))return new RegExp("^"+t.source+"$");throw Qi("imatcher",'Matchers may only be "self", string patterns or RegExp objects')}function $n(t){var e=[];return _(t)&&o(t,function(t){e.push(vn(t))}),e}function _n(){this.SCE_CONTEXTS=to;var t=["self"],e=[];this.resourceUrlWhitelist=function(e){return arguments.length&&(t=$n(e)),t},this.resourceUrlBlacklist=function(t){return arguments.length&&(e=$n(t)),e},this.$get=["$injector",function(r){function i(t,e){return"self"===t?An(e):!!t.exec(e.href)}function o(n){var r,o,s=En(n.toString()),u=!1;for(r=0,o=t.length;o>r;r++)if(i(t[r],s)){u=!0;break}if(u)for(r=0,o=e.length;o>r;r++)if(i(e[r],s)){u=!1;break}return u}function s(t){var e=function(t){this.$$unwrapTrustedValue=function(){return t}};return t&&(e.prototype=new t),e.prototype.valueOf=function(){return this.$$unwrapTrustedValue()},e.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()},e}function u(t,e){var r=h.hasOwnProperty(t)?h[t]:null;if(!r)throw Qi("icontext","Attempted to trust a value in invalid context. Context: {0}; Value: {1}",t,e);if(null===e||e===n||""===e)return e;if("string"!=typeof e)throw Qi("itype","Attempted to trust a non-string value in a content requiring a string: Context: {0}",t);return new r(e)}function a(t){return t instanceof f?t.$$unwrapTrustedValue():t}function c(t,e){if(null===e||e===n||""===e)return e;var r=h.hasOwnProperty(t)?h[t]:null;if(r&&e instanceof r)return e.$$unwrapTrustedValue();if(t===to.RESOURCE_URL){if(o(e))return e;throw Qi("insecurl","Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}",e.toString())}if(t===to.HTML)return l(e);throw Qi("unsafe","Attempting to use an unsafe value in a safe context.")}var l=function(t){throw Qi("unsafe","Attempting to use an unsafe value in a safe context.")};r.has("$sanitize")&&(l=r.get("$sanitize"));var f=s(),h={};return h[to.HTML]=s(f),h[to.CSS]=s(f),h[to.URL]=s(f),h[to.JS]=s(f),h[to.RESOURCE_URL]=s(h[to.URL]),{trustAs:u,getTrusted:c,valueOf:a}}]}function wn(){var t=!0;this.enabled=function(e){return arguments.length&&(t=!!e),t},this.$get=["$parse","$sceDelegate",function(e,n){if(t&&8>Sr)throw Qi("iequirks","Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks mode. You can fix this by adding the text to the top of your HTML document. See http://docs.angularjs.org/api/ng.$sce for more information.");var r=V(to);r.isEnabled=function(){return t},r.trustAs=n.trustAs,r.getTrusted=n.getTrusted,r.valueOf=n.valueOf,t||(r.trustAs=r.getTrusted=function(t,e){return e},r.valueOf=y),r.parseAs=function(t,n){var i=e(n);return i.literal&&i.constant?i:e(n,function(e){return r.getTrusted(t,e)})};var i=r.parseAs,s=r.getTrusted,u=r.trustAs;return o(to,function(t,e){var n=_r(e);r[bt("parse_as_"+n)]=function(e){return i(t,e)},r[bt("get_trusted_"+n)]=function(e){return s(t,e)},r[bt("trust_as_"+n)]=function(e){return u(t,e)}}),r}]}function bn(){this.$get=["$window","$document",function(t,e){var n,r,i={},o=p((/android (\d+)/.exec(_r((t.navigator||{}).userAgent))||[])[1]),s=/Boxee/i.test((t.navigator||{}).userAgent),u=e[0]||{},a=/^(Moz|webkit|ms)(?=[A-Z])/,c=u.body&&u.body.style,l=!1,f=!1;if(c){for(var h in c)if(r=a.exec(h)){n=r[0],n=n.substr(0,1).toUpperCase()+n.substr(1);break}n||(n="WebkitOpacity"in c&&"webkit"),l=!!("transition"in c||n+"Transition"in c),f=!!("animation"in c||n+"Animation"in c),!o||l&&f||(l=k(c.webkitTransition),f=k(c.webkitAnimation))}return{history:!(!t.history||!t.history.pushState||4>o||s),hasEvent:function(t){if("input"===t&&11>=Sr)return!1;if($(i[t])){var e=u.createElement("div");i[t]="on"+t in e}return i[t]},csp:Fr(),vendorPrefix:n,transitions:l,animations:f,android:o}}]}function kn(){this.$get=["$templateCache","$http","$q","$sce",function(t,e,n,r){function i(o,s){function u(t){if(!s)throw Ci("tpload","Failed to load template: {0} (HTTP status: {1} {2})",o,t.status,t.statusText);return n.reject(t)}i.totalPendingRequests++,k(o)&&t.get(o)||(o=r.getTrustedResourceUrl(o));var a=e.defaults&&e.defaults.transformResponse;Rr(a)?a=a.filter(function(t){return t!==$e}):a===$e&&(a=null);var c={cache:t,transformResponse:a};return e.get(o,c)["finally"](function(){i.totalPendingRequests--}).then(function(e){return t.put(o,e.data),e.data},u)}return i.totalPendingRequests=0,i}]}function xn(){this.$get=["$rootScope","$browser","$location",function(t,e,n){var r={};return r.findBindings=function(t,e,n){var r=t.getElementsByClassName("ng-binding"),i=[];return o(r,function(t){var r=Ir.element(t).data("$binding");r&&o(r,function(r){if(n){var o=new RegExp("(^|\\s)"+Vr(e)+"(\\s|\\||$)");o.test(r)&&i.push(t)}else-1!=r.indexOf(e)&&i.push(t)})}),i},r.findModels=function(t,e,n){for(var r=["ng-","data-ng-","ng\\:"],i=0;i0&&(c=e(s.substring(0,a)),i[c]===n&&(i[c]=e(s.substring(a+1))));return i}}function Tn(){this.$get=Cn}function On(t){function e(r,i){if(w(r)){var s={};return o(r,function(t,n){s[n]=e(n,t)}),s}return t.factory(r+n,i)}var n="Filter";this.register=e,this.$get=["$injector",function(t){return function(e){return t.get(e+n)}}],e("currency",Nn),e("date",Xn),e("filter",Dn),e("json",Yn),e("limitTo",Jn),e("lowercase",uo),e("number",zn),e("orderBy",Zn),e("uppercase",ao)}function Dn(){return function(t,e,n){if(!i(t)){if(null==t)return t;throw r("filter")("notarray","Expected array but received: {0}",t)}var o,s,u=In(e);switch(u){case"function":o=e;break;case"boolean":case"null":case"number":case"string":s=!0;case"object":o=Mn(e,n,s);break;default:return t}return Array.prototype.filter.call(t,o)}}function Mn(t,e,n){var r,i=w(t)&&"$"in t;return e===!0?e=F:E(e)||(e=function(t,e){return $(t)?!1:null===t||null===e?t===e:w(e)||w(t)&&!v(t)?!1:(t=_r(""+t),e=_r(""+e),-1!==t.indexOf(e))}),r=function(r){return i&&!w(r)?Pn(r,t.$,e,!1):Pn(r,t,e,n)}}function Pn(t,e,n,r,i){var o=In(t),s=In(e);if("string"===s&&"!"===e.charAt(0))return!Pn(t,e.substring(1),n,r);if(Rr(t))return t.some(function(t){return Pn(t,e,n,r)});switch(o){case"object":var u;if(r){for(u in t)if("$"!==u.charAt(0)&&Pn(t[u],e,n,!0))return!0;return i?!1:Pn(t,e,n,!1)}if("object"===s){for(u in e){var a=e[u];if(!E(a)&&!$(a)){var c="$"===u,l=c?t:t[u];if(!Pn(l,a,n,c,c))return!1}}return!0}return n(t,e);case"function":return!1;default:return n(t,e)}}function In(t){return null===t?"null":typeof t}function Nn(t){var e=t.NUMBER_FORMATS;return function(t,n,r){return $(n)&&(n=e.CURRENCY_SYM),$(r)&&(r=e.PATTERNS[1].maxFrac),null==t?t:Rn(t,e.PATTERNS[1],e.GROUP_SEP,e.DECIMAL_SEP,r).replace(/\u00A4/g,n)}}function zn(t){var e=t.NUMBER_FORMATS;return function(t,n){return null==t?t:Rn(t,e.PATTERNS[0],e.GROUP_SEP,e.DECIMAL_SEP,n)}}function Rn(t,e,n,r,i){if(w(t))return"";var o=0>t;t=Math.abs(t);var s=t===1/0;if(!s&&!isFinite(t))return"";var u=t+"",a="",c=!1,l=[];if(s&&(a="∞"),!s&&-1!==u.indexOf("e")){var f=u.match(/([\d\.]+)e(-?)(\d+)/);f&&"-"==f[2]&&f[3]>i+1?t=0:(a=u,c=!0)}if(s||c)i>0&&1>t&&(a=t.toFixed(i),t=parseFloat(a));else{var h=(u.split(ro)[1]||"").length;$(i)&&(i=Math.min(Math.max(e.minFrac,h),e.maxFrac)),t=+(Math.round(+(t.toString()+"e"+i)).toString()+"e"+-i);var p=(""+t).split(ro),d=p[0];p=p[1]||"";var g,y=0,m=e.lgSize,v=e.gSize;if(d.length>=m+v)for(y=d.length-m,g=0;y>g;g++)(y-g)%v===0&&0!==g&&(a+=n),a+=d.charAt(g);for(g=y;gt&&(r="-",t=-t),t=""+t;t.length0||o>-n)&&(o+=n),0===o&&-12==n&&(o=12),Un(o,e,r)}}function Vn(t,e){return function(n,r){var i=n["get"+t](),o=br(e?"SHORT"+t:t);return r[o][i]}}function Fn(t,e,n){var r=-1*n,i=r>=0?"+":"";return i+=Un(Math[r>0?"floor":"ceil"](r/60),2)+Un(Math.abs(r%60),2)}function Ln(t){var e=new Date(t,0,1).getDay();return new Date(t,0,(4>=e?5:12)-e)}function Hn(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+(4-t.getDay()))}function qn(t){return function(e){var n=Ln(e.getFullYear()),r=Hn(e),i=+r-+n,o=1+Math.round(i/6048e5);return Un(o,t)}}function Wn(t,e){return t.getHours()<12?e.AMPMS[0]:e.AMPMS[1]}function Kn(t,e){return t.getFullYear()<=0?e.ERAS[0]:e.ERAS[1]}function Gn(t,e){return t.getFullYear()<=0?e.ERANAMES[0]:e.ERANAMES[1]}function Xn(t){function e(t){var e;if(e=t.match(n)){var r=new Date(0),i=0,o=0,s=e[8]?r.setUTCFullYear:r.setFullYear,u=e[8]?r.setUTCHours:r.setHours;e[9]&&(i=p(e[9]+e[10]),o=p(e[9]+e[11])),s.call(r,p(e[1]),p(e[2])-1,p(e[3]));var a=p(e[4]||0)-i,c=p(e[5]||0)-o,l=p(e[6]||0),f=Math.round(1e3*parseFloat("0."+(e[7]||0)));return u.call(r,a,c,l,f),r}return t}var n=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(n,r,i){var s,u,a="",c=[];if(r=r||"mediumDate",r=t.DATETIME_FORMATS[r]||r,k(n)&&(n=so.test(n)?p(n):e(n)),x(n)&&(n=new Date(n)),!S(n)||!isFinite(n.getTime()))return n;for(;r;)u=oo.exec(r),u?(c=L(c,u,1),r=c.pop()):(c.push(r),r=null);var l=n.getTimezoneOffset();return i&&(l=X(i,n.getTimezoneOffset()),n=J(n,i,!0)),o(c,function(e){s=io[e],a+=s?s(n,t.DATETIME_FORMATS,l):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),a}}function Yn(){return function(t,e){return $(e)&&(e=2),K(t,e)}}function Jn(){return function(t,e,n){return e=Math.abs(Number(e))===1/0?Number(e):p(e),isNaN(e)?t:(x(t)&&(t=t.toString()),Rr(t)||k(t)?(n=!n||isNaN(n)?0:p(n),n=0>n&&n>=-t.length?t.length+n:n,e>=0?t.slice(n,n+e):0===n?t.slice(e,t.length):t.slice(Math.max(0,n+e),n)):t)}}function Zn(t){function e(e,n){return n=n?-1:1,e.map(function(e){var r=1,i=y;if(E(e))i=e;else if(k(e)&&(("+"==e.charAt(0)||"-"==e.charAt(0))&&(r="-"==e.charAt(0)?-1:1,e=e.substring(1)),""!==e&&(i=t(e),i.constant))){var o=i();i=function(t){return t[o]}}return{get:i,descending:r*n}})}function n(t){switch(typeof t){case"number":case"boolean":case"string":return!0;default:return!1}}function r(t,e){return"function"==typeof t.valueOf&&(t=t.valueOf(),n(t))?t:v(t)&&(t=t.toString(),n(t))?t:e}function o(t,e){var n=typeof t;return null===t?(n="string",t="null"):"string"===n?t=t.toLowerCase():"object"===n&&(t=r(t,e)),{value:t,type:n}}function s(t,e){var n=0;return t.type===e.type?t.value!==e.value&&(n=t.valuer&&!(n=s(t.predicateValues[r],e.predicateValues[r])*c[r].descending);++r);return n}if(!i(t))return t;Rr(n)||(n=[n]),0===n.length&&(n=["+"]);var c=e(n,r),l=Array.prototype.map.call(t,u);return l.sort(a),t=l.map(function(t){return t.value})}}function Qn(t){return E(t)&&(t={link:t}),t.restrict=t.restrict||"AC",m(t)}function tr(t,e){t.$name=e}function er(t,e,r,i,s){var u=this,a=[],c=u.$$parentForm=t.parent().controller("form")||fo;u.$error={},u.$$success={},u.$pending=n,u.$name=s(e.name||e.ngForm||"")(r),u.$dirty=!1,u.$pristine=!0,u.$valid=!0,u.$invalid=!1,u.$submitted=!1,c.$addControl(u),u.$rollbackViewValue=function(){o(a,function(t){t.$rollbackViewValue()})},u.$commitViewValue=function(){o(a,function(t){t.$commitViewValue()})},u.$addControl=function(t){pt(t.$name,"input"),a.push(t),t.$name&&(u[t.$name]=t)},u.$$renameControl=function(t,e){var n=t.$name;u[n]===t&&delete u[n],u[e]=t,t.$name=e},u.$removeControl=function(t){t.$name&&u[t.$name]===t&&delete u[t.$name],o(u.$pending,function(e,n){u.$setValidity(n,null,t)}),o(u.$error,function(e,n){u.$setValidity(n,null,t)}),o(u.$$success,function(e,n){u.$setValidity(n,null,t)}),U(a,t)},yr({ctrl:this,$element:t,set:function(t,e,n){var r=t[e];if(r){var i=r.indexOf(n);-1===i&&r.push(n)}else t[e]=[n]},unset:function(t,e,n){var r=t[e];r&&(U(r,n),0===r.length&&delete t[e])},parentForm:c,$animate:i}),u.$setDirty=function(){i.removeClass(t,Go),i.addClass(t,Xo),u.$dirty=!0,u.$pristine=!1,c.$setDirty()},u.$setPristine=function(){i.setClass(t,Go,Xo+" "+ho),u.$dirty=!1,u.$pristine=!0,u.$submitted=!1,o(a,function(t){t.$setPristine()})},u.$setUntouched=function(){o(a,function(t){t.$setUntouched()})},u.$setSubmitted=function(){i.addClass(t,ho),u.$submitted=!0,c.$setSubmitted()}}function nr(t){t.$formatters.push(function(e){return t.$isEmpty(e)?e:e.toString()})}function rr(t,e,n,r,i,o){ir(t,e,n,r,i,o),nr(r)}function ir(t,e,n,r,i,o){var s=_r(e[0].type);if(!i.android){var u=!1;e.on("compositionstart",function(t){u=!0}),e.on("compositionend",function(){u=!1,a()})}var a=function(t){if(c&&(o.defer.cancel(c),c=null),!u){var i=e.val(),a=t&&t.type;"password"===s||n.ngTrim&&"false"===n.ngTrim||(i=jr(i)),(r.$viewValue!==i||""===i&&r.$$hasNativeValidators)&&r.$setViewValue(i,a)}};if(i.hasEvent("input"))e.on("input",a);else{var c,l=function(t,e,n){c||(c=o.defer(function(){c=null,e&&e.value===n||a(t)}))};e.on("keydown",function(t){var e=t.keyCode;91===e||e>15&&19>e||e>=37&&40>=e||l(t,this,this.value)}),i.hasEvent("paste")&&e.on("paste cut",l)}e.on("change",a),r.$render=function(){e.val(r.$isEmpty(r.$viewValue)?"":r.$viewValue)}}function or(t,e){if(S(t))return t;if(k(t)){ko.lastIndex=0;var n=ko.exec(t);if(n){var r=+n[1],i=+n[2],o=0,s=0,u=0,a=0,c=Ln(r),l=7*(i-1);return e&&(o=e.getHours(),s=e.getMinutes(),u=e.getSeconds(),a=e.getMilliseconds()),new Date(r,0,c.getDate()+l,o,s,u,a)}}return 0/0}function sr(t,e){return function(n,r){var i,s;if(S(n))return n;if(k(n)){if('"'==n.charAt(0)&&'"'==n.charAt(n.length-1)&&(n=n.substring(1,n.length-1)),mo.test(n))return new Date(n);if(t.lastIndex=0,i=t.exec(n))return i.shift(),s=r?{yyyy:r.getFullYear(),MM:r.getMonth()+1,dd:r.getDate(),HH:r.getHours(),mm:r.getMinutes(),ss:r.getSeconds(),sss:r.getMilliseconds()/1e3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},o(i,function(t,n){n=y},u.$observe("min",function(t){y=p(t),a.$validate()})}if(_(u.max)||u.ngMax){var m;a.$validators.max=function(t){return!h(t)||$(m)||r(t)<=m},u.$observe("max",function(t){m=p(t),a.$validate()})}}}function ar(t,e,r,i){var o=e[0],s=i.$$hasNativeValidators=w(o.validity);s&&i.$parsers.push(function(t){var r=e.prop($r)||{};return r.badInput&&!r.typeMismatch?n:t})}function cr(t,e,r,i,o,s){if(ar(t,e,r,i),ir(t,e,r,i,o,s),i.$$parserName="number",i.$parsers.push(function(t){return i.$isEmpty(t)?null:_o.test(t)?parseFloat(t):n}),i.$formatters.push(function(t){if(!i.$isEmpty(t)){if(!x(t))throw Qo("numfmt","Expected `{0}` to be a number",t);t=t.toString()}return t}),_(r.min)||r.ngMin){var u;i.$validators.min=function(t){return i.$isEmpty(t)||$(u)||t>=u},r.$observe("min",function(t){_(t)&&!x(t)&&(t=parseFloat(t,10)),u=x(t)&&!isNaN(t)?t:n,i.$validate()})}if(_(r.max)||r.ngMax){var a;i.$validators.max=function(t){return i.$isEmpty(t)||$(a)||a>=t},r.$observe("max",function(t){_(t)&&!x(t)&&(t=parseFloat(t,10)),a=x(t)&&!isNaN(t)?t:n,i.$validate()})}}function lr(t,e,n,r,i,o){ir(t,e,n,r,i,o),nr(r),r.$$parserName="url",r.$validators.url=function(t,e){var n=t||e;return r.$isEmpty(n)||vo.test(n)}}function fr(t,e,n,r,i,o){ir(t,e,n,r,i,o),nr(r),r.$$parserName="email",r.$validators.email=function(t,e){var n=t||e;return r.$isEmpty(n)||$o.test(n)}}function hr(t,e,n,r){$(n.name)&&e.attr("name",a());var i=function(t){e[0].checked&&r.$setViewValue(n.value,t&&t.type)};e.on("click",i),r.$render=function(){var t=n.value;e[0].checked=t==r.$viewValue},n.$observe("value",r.$render)}function pr(t,e,n,i,o){var s;if(_(i)){if(s=t(i),!s.constant)throw r("ngModel")("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",n,i);return s(e)}return o}function dr(t,e,n,r,i,o,s,u){var a=pr(u,t,"ngTrueValue",n.ngTrueValue,!0),c=pr(u,t,"ngFalseValue",n.ngFalseValue,!1),l=function(t){r.$setViewValue(e[0].checked,t&&t.type)};e.on("click",l),r.$render=function(){e[0].checked=r.$viewValue},r.$isEmpty=function(t){return t===!1},r.$formatters.push(function(t){return F(t,a)}),r.$parsers.push(function(t){return t?a:c})}function gr(t,e){return t="ngClass"+t,["$animate",function(n){function r(t,e){var n=[];t:for(var r=0;r0||n[t])&&(n[t]=(n[t]||0)+e,n[t]===+(e>0)&&r.push(t))}),u.data("$classCounts",n),r.join(" ")}function h(t,e){var i=r(e,t),o=r(t,e);i=f(i,1),o=f(o,-1),i&&i.length&&n.addClass(u,i),o&&o.length&&n.removeClass(u,o)}function p(t){if(e===!0||s.$index%2===e){var n=i(t||[]);if(d){if(!F(t,d)){var r=i(d);h(r,n)}}else c(n)}d=V(t)}var d;s.$watch(a[t],p,!0),a.$observe("class",function(e){p(s.$eval(a[t]))}),"ngClass"!==t&&s.$watch("$index",function(n,r){var o=1&n;if(o!==(1&r)){var u=i(s.$eval(a[t]));o===e?c(u):l(u)}})}}}]}function yr(t){function e(t,e,a){e===n?r("$pending",t,a):i("$pending",t,a),M(e)?e?(f(u.$error,t,a),l(u.$$success,t,a)):(l(u.$error,t,a),f(u.$$success,t,a)):(f(u.$error,t,a),f(u.$$success,t,a)),u.$pending?(o(Zo,!0),u.$valid=u.$invalid=n,s("",null)):(o(Zo,!1),u.$valid=mr(u.$error),u.$invalid=!u.$valid,s("",u.$valid));var c;c=u.$pending&&u.$pending[t]?n:u.$error[t]?!1:u.$$success[t]?!0:null,s(t,c),h.$setValidity(t,c,u)}function r(t,e,n){u[t]||(u[t]={}),l(u[t],e,n)}function i(t,e,r){u[t]&&f(u[t],e,r),mr(u[t])&&(u[t]=n)}function o(t,e){e&&!c[t]?(p.addClass(a,t),c[t]=!0):!e&&c[t]&&(p.removeClass(a,t),c[t]=!1)}function s(t,e){t=t?"-"+ct(t,"-"):"",o(Wo+t,e===!0),o(Ko+t,e===!1)}var u=t.ctrl,a=t.$element,c={},l=t.set,f=t.unset,h=t.parentForm,p=t.$animate;c[Ko]=!(c[Wo]=a.hasClass(Wo)),u.$setValidity=e}function mr(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}var vr=/^\/(.+)\/([a-z]*)$/,$r="validity",_r=function(t){return k(t)?t.toLowerCase():t},wr=Object.prototype.hasOwnProperty,br=function(t){return k(t)?t.toUpperCase():t},kr=function(t){return k(t)?t.replace(/[A-Z]/g,function(t){return String.fromCharCode(32|t.charCodeAt(0))}):t},xr=function(t){return k(t)?t.replace(/[a-z]/g,function(t){return String.fromCharCode(-33&t.charCodeAt(0))}):t};"i"!=="I".toLowerCase()&&(_r=kr,br=xr);var Sr,Er,Ar,Br,Cr=[].slice,Tr=[].splice,Or=[].push,Dr=Object.prototype.toString,Mr=Object.getPrototypeOf,Pr=r("ng"),Ir=t.angular||(t.angular={}),Nr=0;Sr=e.documentMode,g.$inject=[],y.$inject=[];var zr,Rr=Array.isArray,Ur=/^\[object (Uint8(Clamped)?)|(Uint16)|(Uint32)|(Int8)|(Int16)|(Int32)|(Float(32)|(64))Array\]$/,jr=function(t){return k(t)?t.trim():t},Vr=function(t){return t.replace(/([-()\[\]{}+?*.$\^|,:#n;++n)if(r=Hr[n],t=e.querySelector("["+r.replace(":","\\:")+"jq]")){i=t.getAttribute(r+"jq");break}return Lr.name_=i},Hr=["ng-","data-ng-","ng:","x-ng-"],qr=/[A-Z]/g,Wr=!1,Kr=1,Gr=2,Xr=3,Yr=8,Jr=9,Zr=11,Qr={full:"1.4.3",major:1,minor:4,dot:3,codeName:"foam-acceleration"};Bt.expando="ng339";var ti=Bt.cache={},ei=1,ni=function(t,e,n){t.addEventListener(e,n,!1)},ri=function(t,e,n){t.removeEventListener(e,n,!1)};Bt._data=function(t){return this.cache[t[this.expando]]||{}};var ii=/([\:\-\_]+(.))/g,oi=/^moz([A-Z])/,si={mouseleave:"mouseout",mouseenter:"mouseover"},ui=r("jqLite"),ai=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ci=/<|?\w+;/,li=/<([\w:]+)/,fi=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,hi={option:[1,'"],thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};hi.optgroup=hi.option,hi.tbody=hi.tfoot=hi.colgroup=hi.caption=hi.thead,hi.th=hi.td;var pi=Bt.prototype={ready:function(n){function r(){i||(i=!0,n())}var i=!1;"complete"===e.readyState?setTimeout(r):(this.on("DOMContentLoaded",r),Bt(t).on("load",r))},toString:function(){var t=[];return o(this,function(e){t.push(""+e)}),"["+t.join(", ")+"]"},eq:function(t){return Er(t>=0?this[t]:this[this.length+t])},length:0,push:Or,sort:[].sort,splice:[].splice},di={};o("multiple,selected,checked,disabled,readOnly,required,open".split(","),function(t){di[_r(t)]=t});var gi={};o("input,select,option,textarea,button,form,details".split(","),function(t){gi[t]=!0});var yi={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};o({data:Pt,removeData:Dt,hasData:St},function(t,e){Bt[e]=t}),o({data:Pt,inheritedData:jt,scope:function(t){return Er.data(t,"$scope")||jt(t.parentNode||t,["$isolateScope","$scope"])},isolateScope:function(t){return Er.data(t,"$isolateScope")||Er.data(t,"$isolateScopeNoTemplate")},controller:Ut,injector:function(t){return jt(t,"$injector")},removeAttr:function(t,e){t.removeAttribute(e)},hasClass:It,css:function(t,e,n){return e=bt(e),_(n)?void(t.style[e]=n):t.style[e]},attr:function(t,e,r){var i=t.nodeType;if(i!==Xr&&i!==Gr&&i!==Yr){var o=_r(e);if(di[o]){if(!_(r))return t[e]||(t.attributes.getNamedItem(e)||g).specified?o:n;r?(t[e]=!0,
+t.setAttribute(e,o)):(t[e]=!1,t.removeAttribute(o))}else if(_(r))t.setAttribute(e,r);else if(t.getAttribute){var s=t.getAttribute(e,2);return null===s?n:s}}},prop:function(t,e,n){return _(n)?void(t[e]=n):t[e]},text:function(){function t(t,e){if($(e)){var n=t.nodeType;return n===Kr||n===Xr?t.textContent:""}t.textContent=e}return t.$dv="",t}(),val:function(t,e){if($(e)){if(t.multiple&&"select"===R(t)){var n=[];return o(t.options,function(t){t.selected&&n.push(t.value||t.text)}),0===n.length?null:n}return t.value}t.value=e},html:function(t,e){return $(e)?t.innerHTML:(Tt(t,!0),void(t.innerHTML=e))},empty:Vt},function(t,e){Bt.prototype[e]=function(e,r){var i,o,s=this.length;if(t!==Vt&&(2==t.length&&t!==It&&t!==Ut?e:r)===n){if(w(e)){for(i=0;s>i;i++)if(t===Pt)t(this[i],e);else for(o in e)t(this[i],o,e[o]);return this}for(var u=t.$dv,a=u===n?Math.min(s,1):s,c=0;a>c;c++){var l=t(this[c],e,r);u=u?u+l:l}return u}for(i=0;s>i;i++)t(this[i],e,r);return this}}),o({removeData:Dt,on:function Cs(t,e,n,r){if(_(r))throw ui("onargs","jqLite#on() does not support the `selector` or `eventData` parameters");if(xt(t)){var i=Mt(t,!0),o=i.events,s=i.handle;s||(s=i.handle=Wt(t,o));for(var u=e.indexOf(" ")>=0?e.split(" "):[e],a=u.length;a--;){e=u[a];var c=o[e];c||(o[e]=[],"mouseenter"===e||"mouseleave"===e?Cs(t,si[e],function(t){var n=this,r=t.relatedTarget;(!r||r!==n&&!n.contains(r))&&s(t,e)}):"$destroy"!==e&&ni(t,e,s),c=o[e]),c.push(n)}}},off:Ot,one:function(t,e,n){t=Er(t),t.on(e,function r(){t.off(e,n),t.off(e,r)}),t.on(e,n)},replaceWith:function(t,e){var n,r=t.parentNode;Tt(t),o(new Bt(e),function(e){n?r.insertBefore(e,n.nextSibling):r.replaceChild(e,t),n=e})},children:function(t){var e=[];return o(t.childNodes,function(t){t.nodeType===Kr&&e.push(t)}),e},contents:function(t){return t.contentDocument||t.childNodes||[]},append:function(t,e){var n=t.nodeType;if(n===Kr||n===Zr){e=new Bt(e);for(var r=0,i=e.length;i>r;r++){var o=e[r];t.appendChild(o)}}},prepend:function(t,e){if(t.nodeType===Kr){var n=t.firstChild;o(new Bt(e),function(e){t.insertBefore(e,n)})}},wrap:function(t,e){e=Er(e).eq(0).clone()[0];var n=t.parentNode;n&&n.replaceChild(e,t),e.appendChild(t)},remove:Ft,detach:function(t){Ft(t,!0)},after:function(t,e){var n=t,r=t.parentNode;e=new Bt(e);for(var i=0,o=e.length;o>i;i++){var s=e[i];r.insertBefore(s,n.nextSibling),n=s}},addClass:zt,removeClass:Nt,toggleClass:function(t,e,n){e&&o(e.split(" "),function(e){var r=n;$(r)&&(r=!It(t,e)),(r?zt:Nt)(t,e)})},parent:function(t){var e=t.parentNode;return e&&e.nodeType!==Zr?e:null},next:function(t){return t.nextElementSibling},find:function(t,e){return t.getElementsByTagName?t.getElementsByTagName(e):[]},clone:Ct,triggerHandler:function(t,e,n){var r,i,s,u=e.type||e,a=Mt(t),c=a&&a.events,l=c&&c[u];l&&(r={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return this.defaultPrevented===!0},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return this.immediatePropagationStopped===!0},stopPropagation:g,type:u,target:t},e.type&&(r=f(r,e)),i=V(l),s=n?[r].concat(n):[r],o(i,function(e){r.isImmediatePropagationStopped()||e.apply(t,s)}))}},function(t,e){Bt.prototype[e]=function(e,n,r){for(var i,o=0,s=this.length;s>o;o++)$(i)?(i=t(this[o],e,n,r),_(i)&&(i=Er(i))):Rt(i,t(this[o],e,n,r));return _(i)?i:this},Bt.prototype.bind=Bt.prototype.on,Bt.prototype.unbind=Bt.prototype.off}),Xt.prototype={put:function(t,e){this[Gt(t,this.nextUid)]=e},get:function(t){return this[Gt(t,this.nextUid)]},remove:function(t){var e=this[t=Gt(t,this.nextUid)];return delete this[t],e}};var mi=[function(){this.$get=[function(){return Xt}]}],vi=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,$i=/,/,_i=/^\s*(_?)(\S+?)\1\s*$/,wi=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,bi=r("$injector");Zt.$$annotate=Jt;var ki=r("$animate"),xi=1,Si="ng-animate",Ei=function(){this.$get=["$q","$$rAF",function(t,e){function n(){}return n.all=g,n.chain=g,n.prototype={end:g,cancel:g,resume:g,pause:g,complete:g,then:function(n,r){return t(function(t){e(function(){t()})}).then(n,r)}},n}]},Ai=function(){var t=new Xt,e=[];this.$get=["$$AnimateRunner","$rootScope",function(n,r){function i(n,i,s){var u=t.get(n);u||(t.put(n,u={}),e.push(n)),i&&o(i.split(" "),function(t){t&&(u[t]=!0)}),s&&o(s.split(" "),function(t){t&&(u[t]=!1)}),e.length>1||r.$$postDigest(function(){o(e,function(e){var n=t.get(e);if(n){var r=ne(e.attr("class")),i="",s="";o(n,function(t,e){var n=!!r[e];t!==n&&(t?i+=(i.length?" ":"")+e:s+=(s.length?" ":"")+e)}),o(e,function(t){i&&zt(t,i),s&&Nt(t,s)}),t.remove(e)}}),e.length=0})}return{enabled:g,on:g,off:g,pin:g,push:function(t,e,r,o){return o&&o(),r=r||{},r.from&&t.css(r.from),r.to&&t.css(r.to),(r.addClass||r.removeClass)&&i(t,r.addClass,r.removeClass),new n}}}]},Bi=["$provide",function(t){var e=this;this.$$registeredAnimations=Object.create(null),this.register=function(n,r){if(n&&"."!==n.charAt(0))throw ki("notcsel","Expecting class selector starting with '.' got '{0}'.",n);var i=n+"-animation";e.$$registeredAnimations[n.substr(1)]=i,t.factory(i,r)},this.classNameFilter=function(t){if(1===arguments.length&&(this.$$classNameFilter=t instanceof RegExp?t:null,this.$$classNameFilter)){var e=new RegExp("(\\s+|\\/)"+Si+"(\\s+|\\/)");if(e.test(this.$$classNameFilter.toString()))throw ki("nongcls",'$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the "{0}" CSS class.',Si)}return this.$$classNameFilter},this.$get=["$$animateQueue",function(t){function e(t,e,n){if(n){var r=ee(n);!r||r.parentNode||r.previousElementSibling||(n=null)}n?n.after(t):e.prepend(t)}return{on:t.on,off:t.off,pin:t.pin,enabled:t.enabled,cancel:function(t){t.end&&t.end()},enter:function(n,r,i,o){return r=r&&Er(r),i=i&&Er(i),r=r||i.parent(),e(n,r,i),t.push(n,"enter",re(o))},move:function(n,r,i,o){return r=r&&Er(r),i=i&&Er(i),r=r||i.parent(),e(n,r,i),t.push(n,"move",re(o))},leave:function(e,n){return t.push(e,"leave",re(n),function(){e.remove()})},addClass:function(e,n,r){return r=re(r),r.addClass=te(r.addclass,n),t.push(e,"addClass",r)},removeClass:function(e,n,r){return r=re(r),r.removeClass=te(r.removeClass,n),t.push(e,"removeClass",r)},setClass:function(e,n,r,i){return i=re(i),i.addClass=te(i.addClass,n),i.removeClass=te(i.removeClass,r),t.push(e,"setClass",i)},animate:function(e,n,r,i,o){return o=re(o),o.from=o.from?f(o.from,n):n,o.to=o.to?f(o.to,r):r,i=i||"ng-inline-animate",o.tempClasses=te(o.tempClasses,i),t.push(e,"animate",o)}}}]}],Ci=r("$compile");ae.$inject=["$provide","$$sanitizeUriProvider"];var Ti=/^((?:x|data)[\:\-_])/i,Oi=r("$controller"),Di=/^(\S+)(\s+as\s+(\w+))?$/,Mi="application/json",Pi={"Content-Type":Mi+";charset=utf-8"},Ii=/^\[|^\{(?!\{)/,Ni={"[":/]$/,"{":/}$/},zi=/^\)\]\}',?\n/,Ri=Ir.$interpolateMinErr=r("$interpolate");Ri.throwNoconcat=function(t){throw Ri("noconcat","Error while interpolating: {0}\nStrict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce",t)},Ri.interr=function(t,e){return Ri("interr","Can't interpolate: {0}\n{1}",t,e.toString())};var Ui=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,ji={http:80,https:443,ftp:21},Vi=r("$location"),Fi={$$html5:!1,$$replace:!1,absUrl:Le("$$absUrl"),url:function(t){if($(t))return this.$$url;var e=Ui.exec(t);return(e[1]||""===t)&&this.path(decodeURIComponent(e[1])),(e[2]||e[1]||""===t)&&this.search(e[3]||""),this.hash(e[5]||""),this},protocol:Le("$$protocol"),host:Le("$$host"),port:Le("$$port"),path:He("$$path",function(t){return t=null!==t?t.toString():"","/"==t.charAt(0)?t:"/"+t}),search:function(t,e){switch(arguments.length){case 0:return this.$$search;case 1:if(k(t)||x(t))t=t.toString(),this.$$search=tt(t);else{if(!w(t))throw Vi("isrcharg","The first argument of the `$location#search()` call must be a string or an object.");t=j(t,{}),o(t,function(e,n){null==e&&delete t[n]}),this.$$search=t}break;default:$(e)||null===e?delete this.$$search[t]:this.$$search[t]=e}return this.$$compose(),this},hash:He("$$hash",function(t){return null!==t?t.toString():""}),replace:function(){return this.$$replace=!0,this}};o([Fe,Ve,je],function(t){t.prototype=Object.create(Fi),t.prototype.state=function(e){if(!arguments.length)return this.$$state;if(t!==je||!this.$$html5)throw Vi("nostate","History API state support is available only in HTML5 mode and only in browsers supporting HTML5 History API");return this.$$state=$(e)?null:e,this}});var Li=r("$parse"),Hi=Function.prototype.call,qi=Function.prototype.apply,Wi=Function.prototype.bind,Ki=yt();o("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(t){Ki[t]=!0});var Gi={n:"\n",f:"\f",r:"\r",t:" ",v:"","'":"'",'"':'"'},Xi=function(t){this.options=t};Xi.prototype={constructor:Xi,lex:function(t){for(this.text=t,this.index=0,this.tokens=[];this.index="0"&&"9">=t&&"string"==typeof t},isWhitespace:function(t){return" "===t||"\r"===t||" "===t||"\n"===t||""===t||" "===t},isIdent:function(t){return t>="a"&&"z">=t||t>="A"&&"Z">=t||"_"===t||"$"===t},isExpOperator:function(t){return"-"===t||"+"===t||this.isNumber(t)},throwError:function(t,e,n){n=n||this.index;var r=_(e)?"s "+e+"-"+this.index+" ["+this.text.substring(e,n)+"]":" "+n;throw Li("lexerr","Lexer Error: {0} at column{1} in expression [{2}].",t,r,this.text)},readNumber:function(){for(var t="",e=this.index;this.index0&&!this.peek("}",")",";","]")&&t.push(this.expressionStatement()),!this.expect(";"))return{type:Yi.Program,body:t}},expressionStatement:function(){return{type:Yi.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var t,e=this.expression();t=this.expect("|");)e=this.filter(e);return e},expression:function(){return this.assignment()},assignment:function(){var t=this.ternary();return this.expect("=")&&(t={type:Yi.AssignmentExpression,left:t,right:this.assignment(),operator:"="}),t},ternary:function(){var t,e,n=this.logicalOR();return this.expect("?")&&(t=this.expression(),this.consume(":"))?(e=this.expression(),{type:Yi.ConditionalExpression,test:n,alternate:t,consequent:e}):n},logicalOR:function(){for(var t=this.logicalAND();this.expect("||");)t={type:Yi.LogicalExpression,operator:"||",left:t,right:this.logicalAND()};return t},logicalAND:function(){for(var t=this.equality();this.expect("&&");)t={type:Yi.LogicalExpression,operator:"&&",left:t,right:this.equality()};return t},equality:function(){for(var t,e=this.relational();t=this.expect("==","!=","===","!==");)e={type:Yi.BinaryExpression,operator:t.text,left:e,right:this.relational()};return e},relational:function(){for(var t,e=this.additive();t=this.expect("<",">","<=",">=");)e={type:Yi.BinaryExpression,operator:t.text,left:e,right:this.additive()};return e},additive:function(){for(var t,e=this.multiplicative();t=this.expect("+","-");)e={type:Yi.BinaryExpression,operator:t.text,left:e,right:this.multiplicative()};return e},multiplicative:function(){for(var t,e=this.unary();t=this.expect("*","/","%");)e={type:Yi.BinaryExpression,operator:t.text,left:e,right:this.unary()};return e},unary:function(){var t;return(t=this.expect("+","-","!"))?{type:Yi.UnaryExpression,operator:t.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var t;this.expect("(")?(t=this.filterChain(),this.consume(")")):this.expect("[")?t=this.arrayDeclaration():this.expect("{")?t=this.object():this.constants.hasOwnProperty(this.peek().text)?t=j(this.constants[this.consume().text]):this.peek().identifier?t=this.identifier():this.peek().constant?t=this.constant():this.throwError("not a primary expression",this.peek());for(var e;e=this.expect("(","[",".");)"("===e.text?(t={type:Yi.CallExpression,callee:t,arguments:this.parseArguments()},this.consume(")")):"["===e.text?(t={type:Yi.MemberExpression,object:t,property:this.expression(),computed:!0},this.consume("]")):"."===e.text?t={type:Yi.MemberExpression,object:t,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return t},filter:function(t){for(var e=[t],n={type:Yi.CallExpression,callee:this.identifier(),arguments:e,filter:!0};this.expect(":");)e.push(this.expression());return n},parseArguments:function(){var t=[];if(")"!==this.peekToken().text)do t.push(this.expression());while(this.expect(","));return t},identifier:function(){var t=this.consume();return t.identifier||this.throwError("is not a valid identifier",t),{type:Yi.Identifier,name:t.text}},constant:function(){return{type:Yi.Literal,value:this.consume().value}},arrayDeclaration:function(){var t=[];if("]"!==this.peekToken().text)do{if(this.peek("]"))break;t.push(this.expression())}while(this.expect(","));return this.consume("]"),{type:Yi.ArrayExpression,elements:t}},object:function(){var t,e=[];if("}"!==this.peekToken().text)do{if(this.peek("}"))break;t={type:Yi.Property,kind:"init"},this.peek().constant?t.key=this.constant():this.peek().identifier?t.key=this.identifier():this.throwError("invalid key",this.peek()),this.consume(":"),t.value=this.expression(),e.push(t)}while(this.expect(","));return this.consume("}"),{type:Yi.ObjectExpression,properties:e}},throwError:function(t,e){throw Li("syntax","Syntax Error: Token '{0}' {1} at column {2} of the expression [{3}] starting at [{4}].",e.text,t,e.index+1,this.text,this.text.substring(e.index))},consume:function(t){if(0===this.tokens.length)throw Li("ueoe","Unexpected end of expression: {0}",this.text);var e=this.expect(t);return e||this.throwError("is unexpected, expecting ["+t+"]",this.peek()),e},peekToken:function(){if(0===this.tokens.length)throw Li("ueoe","Unexpected end of expression: {0}",this.text);return this.tokens[0]},peek:function(t,e,n,r){return this.peekAhead(0,t,e,n,r)},peekAhead:function(t,e,n,r,i){if(this.tokens.length>t){var o=this.tokens[t],s=o.text;if(s===e||s===n||s===r||s===i||!e&&!n&&!r&&!i)return o}return!1},expect:function(t,e,n,r){var i=this.peek(t,e,n,r);return i?(this.tokens.shift(),i):!1},constants:{"true":{type:Yi.Literal,value:!0},"false":{type:Yi.Literal,value:!1},"null":{type:Yi.Literal,value:null},undefined:{type:Yi.Literal,value:n},"this":{type:Yi.ThisExpression}}},sn.prototype={compile:function(t,e){var r=this,i=this.astBuilder.ast(t);this.state={nextId:0,filters:{},expensiveChecks:e,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]},Qe(i,r.$filter);var s,u="";if(this.stage="assign",s=nn(i)){this.state.computing="assign";var a=this.nextId();this.recurse(s,a),u="fn.assign="+this.generateFunction("assign","s,v,l")}var c=tn(i.body);r.stage="inputs",o(c,function(t,e){var n="fn"+e;r.state[n]={vars:[],body:[],own:{}},r.state.computing=n;var i=r.nextId();r.recurse(t,i),r.return_(i),r.state.inputs.push(n),t.watchId=e}),this.state.computing="fn",this.stage="main",this.recurse(i);var l='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+u+this.watchFns()+"return fn;",f=new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","ifDefined","plus","text",l)(this.$filter,Ke,Ge,Xe,Ye,Je,t);return this.state=this.stage=n,f.literal=rn(i),f.constant=on(i),f},USE:"use",STRICT:"strict",watchFns:function(){var t=[],e=this.state.inputs,n=this;return o(e,function(e){t.push("var "+e+"="+n.generateFunction(e,"s"))}),e.length&&t.push("fn.inputs=["+e.join(",")+"];"),t.join("")},generateFunction:function(t,e){return"function("+e+"){"+this.varsPrefix(t)+this.body(t)+"};"},filterPrefix:function(){var t=[],e=this;return o(this.state.filters,function(n,r){t.push(n+"=$filter("+e.escape(r)+")")}),t.length?"var "+t.join(",")+";":""},varsPrefix:function(t){return this.state[t].vars.length?"var "+this.state[t].vars.join(",")+";":""},body:function(t){return this.state[t].body.join("")},recurse:function(t,e,r,i,s,u){var a,c,l,f,h=this;if(i=i||g,!u&&_(t.watchId))return e=e||this.nextId(),void this.if_("i",this.lazyAssign(e,this.computedMember("i",t.watchId)),this.lazyRecurse(t,e,r,i,s,!0));switch(t.type){case Yi.Program:o(t.body,function(e,r){h.recurse(e.expression,n,n,function(t){c=t}),r!==t.body.length-1?h.current().body.push(c,";"):h.return_(c)});break;case Yi.Literal:f=this.escape(t.value),this.assign(e,f),i(f);break;case Yi.UnaryExpression:this.recurse(t.argument,n,n,function(t){c=t}),f=t.operator+"("+this.ifDefined(c,0)+")",this.assign(e,f),i(f);break;case Yi.BinaryExpression:this.recurse(t.left,n,n,function(t){a=t}),this.recurse(t.right,n,n,function(t){c=t}),f="+"===t.operator?this.plus(a,c):"-"===t.operator?this.ifDefined(a,0)+t.operator+this.ifDefined(c,0):"("+a+")"+t.operator+"("+c+")",this.assign(e,f),i(f);break;case Yi.LogicalExpression:e=e||this.nextId(),h.recurse(t.left,e),h.if_("&&"===t.operator?e:h.not(e),h.lazyRecurse(t.right,e)),i(e);break;case Yi.ConditionalExpression:e=e||this.nextId(),h.recurse(t.test,e),h.if_(e,h.lazyRecurse(t.alternate,e),h.lazyRecurse(t.consequent,e)),i(e);break;case Yi.Identifier:e=e||this.nextId(),r&&(r.context="inputs"===h.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",t.name)+"?l:s"),r.computed=!1,r.name=t.name),Ke(t.name),h.if_("inputs"===h.stage||h.not(h.getHasOwnProperty("l",t.name)),function(){h.if_("inputs"===h.stage||"s",function(){s&&1!==s&&h.if_(h.not(h.nonComputedMember("s",t.name)),h.lazyAssign(h.nonComputedMember("s",t.name),"{}")),h.assign(e,h.nonComputedMember("s",t.name))})},e&&h.lazyAssign(e,h.nonComputedMember("l",t.name))),(h.state.expensiveChecks||cn(t.name))&&h.addEnsureSafeObject(e),i(e);break;case Yi.MemberExpression:a=r&&(r.context=this.nextId())||this.nextId(),e=e||this.nextId(),h.recurse(t.object,a,n,function(){h.if_(h.notNull(a),function(){t.computed?(c=h.nextId(),h.recurse(t.property,c),h.addEnsureSafeMemberName(c),s&&1!==s&&h.if_(h.not(h.computedMember(a,c)),h.lazyAssign(h.computedMember(a,c),"{}")),f=h.ensureSafeObject(h.computedMember(a,c)),h.assign(e,f),r&&(r.computed=!0,r.name=c)):(Ke(t.property.name),s&&1!==s&&h.if_(h.not(h.nonComputedMember(a,t.property.name)),h.lazyAssign(h.nonComputedMember(a,t.property.name),"{}")),f=h.nonComputedMember(a,t.property.name),(h.state.expensiveChecks||cn(t.property.name))&&(f=h.ensureSafeObject(f)),h.assign(e,f),r&&(r.computed=!1,r.name=t.property.name))},function(){h.assign(e,"undefined")}),i(e)},!!s);break;case Yi.CallExpression:e=e||this.nextId(),t.filter?(c=h.filter(t.callee.name),l=[],o(t.arguments,function(t){var e=h.nextId();h.recurse(t,e),l.push(e)}),f=c+"("+l.join(",")+")",h.assign(e,f),i(e)):(c=h.nextId(),a={},l=[],h.recurse(t.callee,c,a,function(){h.if_(h.notNull(c),function(){h.addEnsureSafeFunction(c),o(t.arguments,function(t){h.recurse(t,h.nextId(),n,function(t){l.push(h.ensureSafeObject(t))})}),a.name?(h.state.expensiveChecks||h.addEnsureSafeObject(a.context),f=h.member(a.context,a.name,a.computed)+"("+l.join(",")+")"):f=c+"("+l.join(",")+")",f=h.ensureSafeObject(f),h.assign(e,f)},function(){h.assign(e,"undefined")}),i(e)}));break;case Yi.AssignmentExpression:if(c=this.nextId(),a={},!en(t.left))throw Li("lval","Trying to assing a value to a non l-value");this.recurse(t.left,n,a,function(){h.if_(h.notNull(a.context),function(){h.recurse(t.right,c),h.addEnsureSafeObject(h.member(a.context,a.name,a.computed)),f=h.member(a.context,a.name,a.computed)+t.operator+c,h.assign(e,f),i(e||f)})},1);break;case Yi.ArrayExpression:l=[],o(t.elements,function(t){h.recurse(t,h.nextId(),n,function(t){l.push(t)})}),f="["+l.join(",")+"]",this.assign(e,f),i(f);break;case Yi.ObjectExpression:l=[],o(t.properties,function(t){h.recurse(t.value,h.nextId(),n,function(e){l.push(h.escape(t.key.type===Yi.Identifier?t.key.name:""+t.key.value)+":"+e)})}),f="{"+l.join(",")+"}",this.assign(e,f),i(f);break;case Yi.ThisExpression:this.assign(e,"s"),i("s");break;case Yi.NGValueParameter:this.assign(e,"v"),i("v")}},getHasOwnProperty:function(t,e){var n=t+"."+e,r=this.current().own;return r.hasOwnProperty(n)||(r[n]=this.nextId(!1,t+"&&("+this.escape(e)+" in "+t+")")),r[n]},assign:function(t,e){return t?(this.current().body.push(t,"=",e,";"),t):void 0},filter:function(t){return this.state.filters.hasOwnProperty(t)||(this.state.filters[t]=this.nextId(!0)),this.state.filters[t]},ifDefined:function(t,e){return"ifDefined("+t+","+this.escape(e)+")"},plus:function(t,e){return"plus("+t+","+e+")"},return_:function(t){this.current().body.push("return ",t,";")},if_:function(t,e,n){if(t===!0)e();else{var r=this.current().body;r.push("if(",t,"){"),e(),r.push("}"),n&&(r.push("else{"),n(),r.push("}"))}},not:function(t){return"!("+t+")"},notNull:function(t){return t+"!=null"},nonComputedMember:function(t,e){return t+"."+e},computedMember:function(t,e){return t+"["+e+"]"},member:function(t,e,n){return n?this.computedMember(t,e):this.nonComputedMember(t,e)},addEnsureSafeObject:function(t){this.current().body.push(this.ensureSafeObject(t),";")},addEnsureSafeMemberName:function(t){this.current().body.push(this.ensureSafeMemberName(t),";")},addEnsureSafeFunction:function(t){this.current().body.push(this.ensureSafeFunction(t),";")},ensureSafeObject:function(t){return"ensureSafeObject("+t+",text)"},ensureSafeMemberName:function(t){return"ensureSafeMemberName("+t+",text)"},ensureSafeFunction:function(t){return"ensureSafeFunction("+t+",text)"},lazyRecurse:function(t,e,n,r,i,o){var s=this;return function(){s.recurse(t,e,n,r,i,o)}},lazyAssign:function(t,e){var n=this;return function(){n.assign(t,e)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)},escape:function(t){if(k(t))return"'"+t.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(x(t))return t.toString();if(t===!0)return"true";if(t===!1)return"false";if(null===t)return"null";if("undefined"==typeof t)return"undefined";throw Li("esc","IMPOSSIBLE")},nextId:function(t,e){var n="v"+this.state.nextId++;return t||this.current().vars.push(n+(e?"="+e:"")),n},current:function(){return this.state[this.state.computing]}},un.prototype={compile:function(t,e){var n=this,r=this.astBuilder.ast(t);this.expression=t,this.expensiveChecks=e,Qe(r,n.$filter);var i,s;(i=nn(r))&&(s=this.recurse(i));var u,a=tn(r.body);a&&(u=[],o(a,function(t,e){var r=n.recurse(t);t.input=r,u.push(r),t.watchId=e}));var c=[];o(r.body,function(t){c.push(n.recurse(t.expression))});var l=0===r.body.length?function(){}:1===r.body.length?c[0]:function(t,e){var n;return o(c,function(r){n=r(t,e)}),n};return s&&(l.assign=function(t,e,n){return s(t,n,e)}),u&&(l.inputs=u),l.literal=rn(r),l.constant=on(r),l},recurse:function(t,e,r){var i,s,u,a=this;if(t.input)return this.inputs(t.input,t.watchId);switch(t.type){case Yi.Literal:return this.value(t.value,e);case Yi.UnaryExpression:return s=this.recurse(t.argument),this["unary"+t.operator](s,e);case Yi.BinaryExpression:return i=this.recurse(t.left),s=this.recurse(t.right),this["binary"+t.operator](i,s,e);case Yi.LogicalExpression:return i=this.recurse(t.left),s=this.recurse(t.right),this["binary"+t.operator](i,s,e);case Yi.ConditionalExpression:return this["ternary?:"](this.recurse(t.test),this.recurse(t.alternate),this.recurse(t.consequent),e);case Yi.Identifier:return Ke(t.name,a.expression),a.identifier(t.name,a.expensiveChecks||cn(t.name),e,r,a.expression);case Yi.MemberExpression:return i=this.recurse(t.object,!1,!!r),t.computed||(Ke(t.property.name,a.expression),s=t.property.name),t.computed&&(s=this.recurse(t.property)),t.computed?this.computedMember(i,s,e,r,a.expression):this.nonComputedMember(i,s,a.expensiveChecks,e,r,a.expression);case Yi.CallExpression:return u=[],o(t.arguments,function(t){u.push(a.recurse(t))}),t.filter&&(s=this.$filter(t.callee.name)),t.filter||(s=this.recurse(t.callee,!0)),t.filter?function(t,r,i,o){for(var a=[],c=0;c":function(t,e,n){return function(r,i,o,s){var u=t(r,i,o,s)>e(r,i,o,s);return n?{value:u}:u}},"binary<=":function(t,e,n){return function(r,i,o,s){var u=t(r,i,o,s)<=e(r,i,o,s);return n?{value:u}:u}},"binary>=":function(t,e,n){return function(r,i,o,s){var u=t(r,i,o,s)>=e(r,i,o,s);return n?{value:u}:u}},"binary&&":function(t,e,n){return function(r,i,o,s){var u=t(r,i,o,s)&&e(r,i,o,s);return n?{value:u}:u}},"binary||":function(t,e,n){return function(r,i,o,s){var u=t(r,i,o,s)||e(r,i,o,s);return n?{value:u}:u}},"ternary?:":function(t,e,n,r){return function(i,o,s,u){var a=t(i,o,s,u)?e(i,o,s,u):n(i,o,s,u);return r?{value:a}:a}},value:function(t,e){return function(){return e?{context:n,name:n,value:t}:t}},identifier:function(t,e,r,i,o){return function(s,u,a,c){var l=u&&t in u?u:s;i&&1!==i&&l&&!l[t]&&(l[t]={});var f=l?l[t]:n;return e&&Ge(f,o),r?{context:l,name:t,value:f}:f}},computedMember:function(t,e,n,r,i){return function(o,s,u,a){var c,l,f=t(o,s,u,a);return null!=f&&(c=e(o,s,u,a),Ke(c,i),r&&1!==r&&f&&!f[c]&&(f[c]={}),l=f[c],Ge(l,i)),n?{context:f,name:c,value:l}:l}},nonComputedMember:function(t,e,r,i,o,s){return function(u,a,c,l){var f=t(u,a,c,l);o&&1!==o&&f&&!f[e]&&(f[e]={});var h=null!=f?f[e]:n;return(r||cn(e))&&Ge(h,s),i?{context:f,name:e,value:h}:h}},inputs:function(t,e){return function(n,r,i,o){return o?o[e]:t(n,r,i)}}};var Ji=function(t,e,n){this.lexer=t,this.$filter=e,this.options=n,this.ast=new Yi(this.lexer),this.astCompiler=n.csp?new un(this.ast,e):new sn(this.ast,e)};Ji.prototype={constructor:Ji,parse:function(t){return this.astCompiler.compile(t,this.options.expensiveChecks)}};var Zi=(yt(),yt(),Object.prototype.valueOf),Qi=r("$sce"),to={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},Ci=r("$compile"),eo=e.createElement("a"),no=En(t.location.href);Cn.$inject=["$document"],On.$inject=["$provide"],Nn.$inject=["$locale"],zn.$inject=["$locale"];var ro=".",io={yyyy:jn("FullYear",4),yy:jn("FullYear",2,0,!0),y:jn("FullYear",1),MMMM:Vn("Month"),MMM:Vn("Month",!0),MM:jn("Month",2,1),M:jn("Month",1,1),dd:jn("Date",2),d:jn("Date",1),HH:jn("Hours",2),H:jn("Hours",1),hh:jn("Hours",2,-12),h:jn("Hours",1,-12),mm:jn("Minutes",2),m:jn("Minutes",1),ss:jn("Seconds",2),s:jn("Seconds",1),sss:jn("Milliseconds",3),EEEE:Vn("Day"),EEE:Vn("Day",!0),a:Wn,Z:Fn,ww:qn(2),w:qn(1),G:Kn,GG:Kn,GGG:Kn,GGGG:Gn},oo=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,so=/^\-?\d+$/;Xn.$inject=["$locale"];var uo=m(_r),ao=m(br);Zn.$inject=["$parse"];var co=m({restrict:"E",compile:function(t,e){return e.href||e.xlinkHref?void 0:function(t,e){if("a"===e[0].nodeName.toLowerCase()){var n="[object SVGAnimatedString]"===Dr.call(e.prop("href"))?"xlink:href":"href";e.on("click",function(t){e.attr(n)||t.preventDefault()})}}}}),lo={};o(di,function(t,e){function n(t,n,i){t.$watch(i[r],function(t){i.$set(e,!!t)})}if("multiple"!=t){var r=ce("ng-"+e),i=n;"checked"===t&&(i=function(t,e,i){i.ngModel!==i[r]&&n(t,e,i);
+
+}),lo[r]=function(){return{restrict:"A",priority:100,link:i}}}}),o(yi,function(t,e){lo[e]=function(){return{priority:100,link:function(t,n,r){if("ngPattern"===e&&"/"==r.ngPattern.charAt(0)){var i=r.ngPattern.match(vr);if(i)return void r.$set("ngPattern",new RegExp(i[1],i[2]))}t.$watch(r[e],function(t){r.$set(e,t)})}}}}),o(["src","srcset","href"],function(t){var e=ce("ng-"+t);lo[e]=function(){return{priority:99,link:function(n,r,i){var o=t,s=t;"href"===t&&"[object SVGAnimatedString]"===Dr.call(r.prop("href"))&&(s="xlinkHref",i.$attr[s]="xlink:href",o=null),i.$observe(e,function(e){return e?(i.$set(s,e),void(Sr&&o&&r.prop(o,i[s]))):void("href"===t&&i.$set(s,null))})}}}});var fo={$addControl:g,$$renameControl:tr,$removeControl:g,$setValidity:g,$setDirty:g,$setPristine:g,$setSubmitted:g},ho="ng-submitted";er.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var po=function(t){return["$timeout",function(e){var r={name:"form",restrict:t?"EAC":"E",controller:er,compile:function(r,i){r.addClass(Go).addClass(Wo);var o=i.name?"name":t&&i.ngForm?"ngForm":!1;return{pre:function(t,r,i,s){if(!("action"in i)){var u=function(e){t.$apply(function(){s.$commitViewValue(),s.$setSubmitted()}),e.preventDefault()};ni(r[0],"submit",u),r.on("$destroy",function(){e(function(){ri(r[0],"submit",u)},0,!1)})}var a=s.$$parentForm;o&&(an(t,s.$name,s,s.$name),i.$observe(o,function(e){s.$name!==e&&(an(t,s.$name,n,s.$name),a.$$renameControl(s,e),an(t,s.$name,s,s.$name))})),r.on("$destroy",function(){a.$removeControl(s),o&&an(t,i[o],n,s.$name),f(s,fo)})}}}};return r}]},go=po(),yo=po(!0),mo=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,vo=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,$o=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,_o=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,wo=/^(\d{4})-(\d{2})-(\d{2})$/,bo=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,ko=/^(\d{4})-W(\d\d)$/,xo=/^(\d{4})-(\d\d)$/,So=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Eo={text:rr,date:ur("date",wo,sr(wo,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":ur("datetimelocal",bo,sr(bo,["yyyy","MM","dd","HH","mm","ss","sss"]),"yyyy-MM-ddTHH:mm:ss.sss"),time:ur("time",So,sr(So,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:ur("week",ko,or,"yyyy-Www"),month:ur("month",xo,sr(xo,["yyyy","MM"]),"yyyy-MM"),number:cr,url:lr,email:fr,radio:hr,checkbox:dr,hidden:g,button:g,submit:g,reset:g,file:g},Ao=["$browser","$sniffer","$filter","$parse",function(t,e,n,r){return{restrict:"E",require:["?ngModel"],link:{pre:function(i,o,s,u){u[0]&&(Eo[_r(s.type)]||Eo.text)(i,o,s,u[0],e,t,n,r)}}}}],Bo=/^(true|false|\d+)$/,Co=function(){return{restrict:"A",priority:100,compile:function(t,e){return Bo.test(e.ngValue)?function(t,e,n){n.$set("value",t.$eval(n.ngValue))}:function(t,e,n){t.$watch(n.ngValue,function(t){n.$set("value",t)})}}}},To=["$compile",function(t){return{restrict:"AC",compile:function(e){return t.$$addBindingClass(e),function(e,r,i){t.$$addBindingInfo(r,i.ngBind),r=r[0],e.$watch(i.ngBind,function(t){r.textContent=t===n?"":t})}}}}],Oo=["$interpolate","$compile",function(t,e){return{compile:function(r){return e.$$addBindingClass(r),function(r,i,o){var s=t(i.attr(o.$attr.ngBindTemplate));e.$$addBindingInfo(i,s.expressions),i=i[0],o.$observe("ngBindTemplate",function(t){i.textContent=t===n?"":t})}}}}],Do=["$sce","$parse","$compile",function(t,e,n){return{restrict:"A",compile:function(r,i){var o=e(i.ngBindHtml),s=e(i.ngBindHtml,function(t){return(t||"").toString()});return n.$$addBindingClass(r),function(e,r,i){n.$$addBindingInfo(r,i.ngBindHtml),e.$watch(s,function(){r.html(t.getTrustedHtml(o(e))||"")})}}}}],Mo=m({restrict:"A",require:"ngModel",link:function(t,e,n,r){r.$viewChangeListeners.push(function(){t.$eval(n.ngChange)})}}),Po=gr("",!0),Io=gr("Odd",0),No=gr("Even",1),zo=Qn({compile:function(t,e){e.$set("ngCloak",n),t.removeClass("ng-cloak")}}),Ro=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],Uo={},jo={blur:!0,focus:!0};o("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(t){var e=ce("ng-"+t);Uo[e]=["$parse","$rootScope",function(n,r){return{restrict:"A",compile:function(i,o){var s=n(o[e],null,!0);return function(e,n){n.on(t,function(n){var i=function(){s(e,{$event:n})};jo[t]&&r.$$phase?e.$evalAsync(i):e.$apply(i)})}}}}]});var Vo=["$animate",function(t){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(n,r,i,o,s){var u,a,c;n.$watch(i.ngIf,function(n){n?a||s(function(n,o){a=o,n[n.length++]=e.createComment(" end ngIf: "+i.ngIf+" "),u={clone:n},t.enter(n,r.parent(),r)}):(c&&(c.remove(),c=null),a&&(a.$destroy(),a=null),u&&(c=gt(u.clone),t.leave(c).then(function(){c=null}),u=null))})}}}],Fo=["$templateRequest","$anchorScroll","$animate",function(t,e,n){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:Ir.noop,compile:function(r,i){var o=i.ngInclude||i.src,s=i.onload||"",u=i.autoscroll;return function(r,i,a,c,l){var f,h,p,d=0,g=function(){h&&(h.remove(),h=null),f&&(f.$destroy(),f=null),p&&(n.leave(p).then(function(){h=null}),h=p,p=null)};r.$watch(o,function(o){var a=function(){!_(u)||u&&!r.$eval(u)||e()},h=++d;o?(t(o,!0).then(function(t){if(h===d){var e=r.$new();c.template=t;var u=l(e,function(t){g(),n.enter(t,null,i).then(a)});f=e,p=u,f.$emit("$includeContentLoaded",o),r.$eval(s)}},function(){h===d&&(g(),r.$emit("$includeContentError",o))}),r.$emit("$includeContentRequested",o)):(g(),c.template=null)})}}}}],Lo=["$compile",function(t){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(n,r,i,o){return/SVG/.test(r[0].toString())?(r.empty(),void t(Et(o.template,e).childNodes)(n,function(t){r.append(t)},{futureParentElement:r})):(r.html(o.template),void t(r.contents())(n))}}}],Ho=Qn({priority:450,compile:function(){return{pre:function(t,e,n){t.$eval(n.ngInit)}}}}),qo=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(t,e,r,i){var s=e.attr(r.$attr.ngList)||", ",u="false"!==r.ngTrim,a=u?jr(s):s,c=function(t){if(!$(t)){var e=[];return t&&o(t.split(a),function(t){t&&e.push(u?jr(t):t)}),e}};i.$parsers.push(c),i.$formatters.push(function(t){return Rr(t)?t.join(s):n}),i.$isEmpty=function(t){return!t||!t.length}}}},Wo="ng-valid",Ko="ng-invalid",Go="ng-pristine",Xo="ng-dirty",Yo="ng-untouched",Jo="ng-touched",Zo="ng-pending",Qo=new r("ngModel"),ts=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(t,e,r,i,s,u,a,c,l,f){this.$viewValue=Number.NaN,this.$modelValue=Number.NaN,this.$$rawModelValue=n,this.$validators={},this.$asyncValidators={},this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$untouched=!0,this.$touched=!1,this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$error={},this.$$success={},this.$pending=n,this.$name=f(r.name||"",!1)(t);var h,p=s(r.ngModel),d=p.assign,y=p,m=d,v=null,w=this;this.$$setOptions=function(t){if(w.$options=t,t&&t.getterSetter){var e=s(r.ngModel+"()"),n=s(r.ngModel+"($$$p)");y=function(t){var n=p(t);return E(n)&&(n=e(t)),n},m=function(t,e){E(p(t))?n(t,{$$$p:w.$modelValue}):d(t,w.$modelValue)}}else if(!p.assign)throw Qo("nonassign","Expression '{0}' is non-assignable. Element: {1}",r.ngModel,Z(i))},this.$render=g,this.$isEmpty=function(t){return $(t)||""===t||null===t||t!==t};var b=i.inheritedData("$formController")||fo,k=0;yr({ctrl:this,$element:i,set:function(t,e){t[e]=!0},unset:function(t,e){delete t[e]},parentForm:b,$animate:u}),this.$setPristine=function(){w.$dirty=!1,w.$pristine=!0,u.removeClass(i,Xo),u.addClass(i,Go)},this.$setDirty=function(){w.$dirty=!0,w.$pristine=!1,u.removeClass(i,Go),u.addClass(i,Xo),b.$setDirty()},this.$setUntouched=function(){w.$touched=!1,w.$untouched=!0,u.setClass(i,Yo,Jo)},this.$setTouched=function(){w.$touched=!0,w.$untouched=!1,u.setClass(i,Jo,Yo)},this.$rollbackViewValue=function(){a.cancel(v),w.$viewValue=w.$$lastCommittedViewValue,w.$render()},this.$validate=function(){if(!x(w.$modelValue)||!isNaN(w.$modelValue)){var t=w.$$lastCommittedViewValue,e=w.$$rawModelValue,r=w.$valid,i=w.$modelValue,o=w.$options&&w.$options.allowInvalid;w.$$runValidators(e,t,function(t){o||r===t||(w.$modelValue=t?e:n,w.$modelValue!==i&&w.$$writeModelToScope())})}},this.$$runValidators=function(t,e,r){function i(){var t=w.$$parserName||"parse";return h!==n?(h||(o(w.$validators,function(t,e){a(e,null)}),o(w.$asyncValidators,function(t,e){a(e,null)})),a(t,h),h):(a(t,null),!0)}function s(){var n=!0;return o(w.$validators,function(r,i){var o=r(t,e);n=n&&o,a(i,o)}),n?!0:(o(w.$asyncValidators,function(t,e){a(e,null)}),!1)}function u(){var r=[],i=!0;o(w.$asyncValidators,function(o,s){var u=o(t,e);if(!P(u))throw Qo("$asyncValidators","Expected asynchronous validator to return a promise but got '{0}' instead.",u);a(s,n),r.push(u.then(function(){a(s,!0)},function(t){i=!1,a(s,!1)}))}),r.length?l.all(r).then(function(){c(i)},g):c(!0)}function a(t,e){f===k&&w.$setValidity(t,e)}function c(t){f===k&&r(t)}k++;var f=k;return i()&&s()?void u():void c(!1)},this.$commitViewValue=function(){var t=w.$viewValue;a.cancel(v),(w.$$lastCommittedViewValue!==t||""===t&&w.$$hasNativeValidators)&&(w.$$lastCommittedViewValue=t,w.$pristine&&this.$setDirty(),this.$$parseAndValidate())},this.$$parseAndValidate=function(){function e(){w.$modelValue!==s&&w.$$writeModelToScope()}var r=w.$$lastCommittedViewValue,i=r;if(h=$(i)?n:!0)for(var o=0;oo;o++){var a=t===n?o:n[o],c=(t[a],k(t[a],a)),l=y(t[a],c);if(e.push(l),u[2]||u[1]){var f=v(r,c);e.push(f)}if(u[4]){var h=_(r,c);e.push(h)}}return e}),getOptions:function(){for(var t=[],e={},n=w(r)||[],i=s(n),u=i.length,a=0;u>a;a++){var c=n===i?a:i[a],l=n[c],h=k(l,c),p=d(r,h),g=y(p,h),b=v(r,h),x=$(r,h),S=_(r,h),E=new o(g,p,b,x,S);t.push(E),e[g]=E}return{items:t,selectValueMap:e,getOptionFromViewValue:function(t){return e[m(t)]},getViewValueFromOption:function(t){return f?Ir.copy(t.viewValue):t.viewValue}}}}}var s=e.createElement("option"),u=e.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","?ngModel"],link:function(e,n,i,a){function c(t,e){t.element=e,e.disabled=t.disabled,t.value!==e.value&&(e.value=t.selectValue),t.label!==e.label&&(e.label=t.label,e.textContent=t.label)}function l(t,e,n,r){var i;return e&&_r(e.nodeName)===n?i=e:(i=r.cloneNode(!1),e?t.insertBefore(i,e):t.appendChild(i)),i}function f(t){for(var e;t;)e=t.nextSibling,Ft(t),t=e}function h(t){var e=g&&g[0],n=b&&b[0];if(e||n)for(;t&&(t===e||t===n);)t=t.nextSibling;return t}function p(){var t=k&&y.readValue();k=x.getOptions();var e={},r=n[0].firstChild;if(w&&n.prepend(g),r=h(r),k.items.forEach(function(t){var i,o,a;t.group?(i=e[t.group],i||(o=l(n[0],r,"optgroup",u),r=o.nextSibling,o.label=t.group,i=e[t.group]={groupElement:o,currentOptionElement:o.firstChild}),a=l(i.groupElement,i.currentOptionElement,"option",s),c(t,a),i.currentOptionElement=a.nextSibling):(a=l(n[0],r,"option",s),c(t,a),r=a.nextSibling)}),Object.keys(e).forEach(function(t){f(e[t].currentOptionElement)}),f(r),d.$render(),!d.$isEmpty(t)){var i=y.readValue();(x.trackBy?F(t,i):t===i)||(d.$setViewValue(i),d.$render())}}var d=a[1];if(d){for(var g,y=a[0],m=i.multiple,v=0,$=n.children(),_=$.length;_>v;v++)if(""===$[v].value){g=$.eq(v);break}var w=!!g,b=Er(s.cloneNode(!1));b.val("?");var k,x=r(i.ngOptions,n,e),S=function(){w||n.prepend(g),n.val(""),g.prop("selected",!0),g.attr("selected",!0)},E=function(){w||g.remove()},A=function(){n.prepend(b),n.val("?"),b.prop("selected",!0),b.attr("selected",!0)},B=function(){b.remove()};m?(d.$isEmpty=function(t){return!t||0===t.length},y.writeValue=function(t){k.items.forEach(function(t){t.element.selected=!1}),t&&t.forEach(function(t){var e=k.getOptionFromViewValue(t);e&&!e.disabled&&(e.element.selected=!0)})},y.readValue=function(){var t=n.val()||[],e=[];return o(t,function(t){var n=k.selectValueMap[t];n.disabled||e.push(k.getViewValueFromOption(n))}),e},x.trackBy&&e.$watchCollection(function(){return Rr(d.$viewValue)?d.$viewValue.map(function(t){return x.getTrackByValue(t)}):void 0},function(){d.$render()})):(y.writeValue=function(t){var e=k.getOptionFromViewValue(t);e&&!e.disabled?n[0].value!==e.selectValue&&(B(),E(),n[0].value=e.selectValue,e.element.selected=!0,e.element.setAttribute("selected","selected")):null===t||w?(B(),S()):(E(),A())},y.readValue=function(){var t=k.selectValueMap[n.val()];return t&&!t.disabled?(E(),B(),k.getViewValueFromOption(t)):null},x.trackBy&&e.$watch(function(){return x.getTrackByValue(d.$viewValue)},function(){d.$render()})),w?(g.remove(),t(g)(e),g.removeClass("ng-scope")):g=Er(s.cloneNode(!1)),p(),e.$watchCollection(x.getWatchables,p)}}}}],as=["$locale","$interpolate","$log",function(t,e,n){var r=/{}/g,i=/^when(Minus)?(.+)$/;return{link:function(s,u,a){function c(t){u.text(t||"")}var l,f=a.count,h=a.$attr.when&&u.attr(a.$attr.when),p=a.offset||0,d=s.$eval(h)||{},y={},m=e.startSymbol(),v=e.endSymbol(),_=m+f+"-"+p+v,w=Ir.noop;o(a,function(t,e){var n=i.exec(e);if(n){var r=(n[1]?"-":"")+_r(n[2]);d[r]=u.attr(a.$attr[e])}}),o(d,function(t,n){y[n]=e(t.replace(r,_))}),s.$watch(f,function(e){var r=parseFloat(e),i=isNaN(r);if(i||r in d||(r=t.pluralCat(r-p)),r!==l&&!(i&&x(l)&&isNaN(l))){w();var o=y[r];$(o)?(null!=e&&n.debug("ngPluralize: no rule defined for '"+r+"' in "+h),w=g,c()):w=s.$watch(o,c),l=r}})}}}],cs=["$parse","$animate",function(t,s){var u="$$NG_REMOVED",a=r("ngRepeat"),c=function(t,e,n,r,i,o,s){t[n]=r,i&&(t[i]=o),t.$index=e,t.$first=0===e,t.$last=e===s-1,t.$middle=!(t.$first||t.$last),t.$odd=!(t.$even=0===(1&e))},l=function(t){return t.clone[0]},f=function(t){return t.clone[t.clone.length-1]};return{restrict:"A",multiElement:!0,transclude:"element",priority:1e3,terminal:!0,$$tlb:!0,compile:function(r,h){var p=h.ngRepeat,d=e.createComment(" end ngRepeat: "+p+" "),g=p.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!g)throw a("iexp","Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",p);var y=g[1],m=g[2],v=g[3],$=g[4];if(g=y.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/),!g)throw a("iidexp","'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",y);var _=g[3]||g[1],w=g[2];if(v&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(v)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(v)))throw a("badident","alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.",v);var b,k,x,S,E={$id:Gt};return $?b=t($):(x=function(t,e){return Gt(e)},S=function(t){return t}),function(t,e,r,h,g){b&&(k=function(e,n,r){return w&&(E[w]=e),E[_]=n,E.$index=r,b(t,E)});var y=yt();t.$watchCollection(m,function(r){var h,m,$,b,E,A,B,C,T,O,D,M,P=e[0],I=yt();if(v&&(t[v]=r),i(r))T=r,C=k||x;else{C=k||S,T=[];for(var N in r)r.hasOwnProperty(N)&&"$"!==N.charAt(0)&&T.push(N)}for(b=T.length,D=new Array(b),h=0;b>h;h++)if(E=r===T?h:T[h],A=r[E],B=C(E,A,h),y[B])O=y[B],delete y[B],I[B]=O,D[h]=O;else{if(I[B])throw o(D,function(t){t&&t.scope&&(y[t.id]=t)}),a("dupes","Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}",p,B,A);D[h]={id:B,scope:n,clone:n},I[B]=!0}for(var z in y){if(O=y[z],M=gt(O.clone),s.leave(M),M[0].parentNode)for(h=0,m=M.length;m>h;h++)M[h][u]=!0;O.scope.$destroy()}for(h=0;b>h;h++)if(E=r===T?h:T[h],A=r[E],O=D[h],O.scope){$=P;do $=$.nextSibling;while($&&$[u]);l(O)!=$&&s.move(gt(O.clone),null,Er(P)),P=f(O),c(O.scope,h,_,A,w,E,b)}else g(function(t,e){O.scope=e;var n=d.cloneNode(!1);t[t.length++]=n,s.enter(t,null,Er(P)),P=n,O.clone=t,I[O.id]=O,c(O.scope,h,_,A,w,E,b)});y=I})}}}}],ls="ng-hide",fs="ng-hide-animate",hs=["$animate",function(t){return{restrict:"A",multiElement:!0,link:function(e,n,r){e.$watch(r.ngShow,function(e){t[e?"removeClass":"addClass"](n,ls,{tempClasses:fs})})}}}],ps=["$animate",function(t){return{restrict:"A",multiElement:!0,link:function(e,n,r){e.$watch(r.ngHide,function(e){t[e?"addClass":"removeClass"](n,ls,{tempClasses:fs})})}}}],ds=Qn(function(t,e,n){t.$watch(n.ngStyle,function(t,n){n&&t!==n&&o(n,function(t,n){e.css(n,"")}),t&&e.css(t)},!0)}),gs=["$animate",function(t){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(n,r,i,s){var u=i.ngSwitch||i.on,a=[],c=[],l=[],f=[],h=function(t,e){return function(){t.splice(e,1)}};n.$watch(u,function(n){var r,i;for(r=0,i=l.length;i>r;++r)t.cancel(l[r]);for(l.length=0,r=0,i=f.length;i>r;++r){var u=gt(c[r].clone);f[r].$destroy();var p=l[r]=t.leave(u);p.then(h(l,r))}c.length=0,f.length=0,(a=s.cases["!"+n]||s.cases["?"])&&o(a,function(n){n.transclude(function(r,i){f.push(i);var o=n.element;r[r.length++]=e.createComment(" end ngSwitchWhen: ");var s={clone:r};c.push(s),t.enter(r,o.parent(),o)})})})}}}],ys=Qn({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(t,e,n,r,i){r.cases["!"+n.ngSwitchWhen]=r.cases["!"+n.ngSwitchWhen]||[],r.cases["!"+n.ngSwitchWhen].push({transclude:i,element:e})}}),ms=Qn({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(t,e,n,r,i){r.cases["?"]=r.cases["?"]||[],r.cases["?"].push({transclude:i,element:e})}}),vs=Qn({restrict:"EAC",link:function(t,e,n,i,o){if(!o)throw r("ngTransclude")("orphan","Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}",Z(e));o(function(t){e.empty(),e.append(t)})}}),$s=["$templateCache",function(t){return{restrict:"E",terminal:!0,compile:function(e,n){if("text/ng-template"==n.type){var r=n.id,i=e[0].text;t.put(r,i)}}}}],_s={$setViewValue:g,$render:g},ws=["$element","$scope","$attrs",function(t,r,i){var o=this,s=new Xt;o.ngModelCtrl=_s,o.unknownOption=Er(e.createElement("option")),o.renderUnknownOption=function(e){var n="? "+Gt(e)+" ?";o.unknownOption.val(n),t.prepend(o.unknownOption),t.val(n)},r.$on("$destroy",function(){o.renderUnknownOption=g}),o.removeUnknownOption=function(){o.unknownOption.parent()&&o.unknownOption.remove()},o.readValue=function(){return o.removeUnknownOption(),t.val()},o.writeValue=function(e){o.hasOption(e)?(o.removeUnknownOption(),t.val(e),""===e&&o.emptyOption.prop("selected",!0)):null==e&&o.emptyOption?(o.removeUnknownOption(),t.val("")):o.renderUnknownOption(e)},o.addOption=function(t,e){pt(t,'"option value"'),""===t&&(o.emptyOption=e);var n=s.get(t)||0;s.put(t,n+1)},o.removeOption=function(t){var e=s.get(t);e&&(1===e?(s.remove(t),""===t&&(o.emptyOption=n)):s.put(t,e-1))},o.hasOption=function(t){return!!s.get(t)}}],bs=function(){return{restrict:"E",require:["select","?ngModel"],controller:ws,link:function(t,e,n,r){var i=r[1];if(i){var s=r[0];if(s.ngModelCtrl=i,i.$render=function(){s.writeValue(i.$viewValue)},e.on("change",function(){t.$apply(function(){i.$setViewValue(s.readValue())})}),n.multiple){s.readValue=function(){var t=[];return o(e.find("option"),function(e){e.selected&&t.push(e.value)}),t},s.writeValue=function(t){var n=new Xt(t);o(e.find("option"),function(t){t.selected=_(n.get(t.value))})};var u,a=0/0;t.$watch(function(){a!==i.$viewValue||F(u,i.$viewValue)||(u=V(i.$viewValue),i.$render()),a=i.$viewValue}),i.$isEmpty=function(t){return!t||0===t.length}}}}}},ks=["$interpolate",function(t){function e(t){t[0].hasAttribute("selected")&&(t[0].selected=!0)}return{restrict:"E",priority:100,compile:function(n,r){if($(r.value)){var i=t(n.text(),!0);i||r.$set("value",n.text())}return function(t,n,r){var o="$selectController",s=n.parent(),u=s.data(o)||s.parent().data(o);u&&u.ngModelCtrl&&(i?t.$watch(i,function(t,i){r.$set("value",t),i!==t&&u.removeOption(i),u.addOption(t,n),u.ngModelCtrl.$render(),e(n)}):(u.addOption(r.value,n),u.ngModelCtrl.$render(),e(n)),n.on("$destroy",function(){u.removeOption(r.value),u.ngModelCtrl.$render()}))}}}}],xs=m({restrict:"E",terminal:!1}),Ss=function(){return{restrict:"A",require:"?ngModel",link:function(t,e,n,r){r&&(n.required=!0,r.$validators.required=function(t,e){return!n.required||!r.$isEmpty(e)},n.$observe("required",function(){r.$validate()}))}}},Es=function(){return{restrict:"A",require:"?ngModel",link:function(t,e,i,o){if(o){var s,u=i.ngPattern||i.pattern;i.$observe("pattern",function(t){if(k(t)&&t.length>0&&(t=new RegExp("^"+t+"$")),t&&!t.test)throw r("ngPattern")("noregexp","Expected {0} to be a RegExp but was {1}. Element: {2}",u,t,Z(e));s=t||n,o.$validate()}),o.$validators.pattern=function(t){return o.$isEmpty(t)||$(s)||s.test(t)}}}}},As=function(){return{restrict:"A",require:"?ngModel",link:function(t,e,n,r){if(r){var i=-1;n.$observe("maxlength",function(t){var e=p(t);i=isNaN(e)?-1:e,r.$validate()}),r.$validators.maxlength=function(t,e){return 0>i||r.$isEmpty(e)||e.length<=i}}}}},Bs=function(){return{restrict:"A",require:"?ngModel",link:function(t,e,n,r){if(r){var i=0;n.$observe("minlength",function(t){i=p(t)||0,r.$validate()}),r.$validators.minlength=function(t,e){return r.$isEmpty(e)||e.length>=i}}}}};return t.angular.bootstrap?void console.log("WARNING: Tried to load angular more than once."):(lt(),_t(Ir),void Er(e).ready(function(){ot(e,st)}))}(window,document),!window.angular.$$csp()&&window.angular.element(document.head).prepend(''),function(t,e,n){"use strict";function r(){this.$get=["$$sanitizeUri",function(t){return function(e){var n=[];return s(e,c(n,function(e,n){return!/^unsafe/.test(t(e,n))})),n.join("")}}]}function i(t){var n=[],r=c(n,e.noop);return r.chars(t),n.join("")}function o(t,n){var r,i={},o=t.split(",");for(r=0;r=0&&$[o]!=r;o--);if(o>=0){for(i=$.length-1;i>=o;i--)n.end&&n.end($[i]);$.length=o}}"string"!=typeof t&&(t=null===t||"undefined"==typeof t?"":""+t);var o,s,a,c,$=[],_=t;for($.last=function(){return $[$.length-1]};t;){if(c="",s=!0,$.last()&&B[$.last()]?(t=t.replace(new RegExp("([\\W\\w]*)<\\s*\\/\\s*"+$.last()+"[^>]*>","i"),function(t,e){return e=e.replace(y,"$1").replace(v,"$1"),n.chars&&n.chars(u(e)),""}),i("",$.last())):(0===t.indexOf("",o)===o&&(n.comment&&n.comment(t.substring(4,o)),t=t.substring(o+3),s=!1)):m.test(t)?(a=t.match(m),a&&(t=t.replace(a[0],""),s=!1)):g.test(t)?(a=t.match(h),a&&(t=t.substring(a[0].length),a[0].replace(h,i),s=!1)):d.test(t)&&(a=t.match(f),a?(a[4]&&(t=t.substring(a[0].length),a[0].replace(f,r)),s=!1):(c+="<",t=t.substring(1))),s&&(o=t.indexOf("<"),c+=0>o?t:t.substring(0,o),t=0>o?"":t.substring(o),n.chars&&n.chars(u(c)))),t==_)throw l("badparse","The sanitizer was unable to parse the following block of html: {0}",t);_=t}i()}function u(t){return t?(P.innerHTML=t.replace(//g,">")}function c(t,n){var r=!1,i=e.bind(t,t.push);return{start:function(t,o,s){t=e.lowercase(t),!r&&B[t]&&(r=t),r||C[t]!==!0||(i("<"),i(t),e.forEach(o,function(r,o){var s=e.lowercase(o),u="img"===t&&"src"===s||"background"===s;M[s]!==!0||T[s]===!0&&!n(r,u)||(i(" "),i(o),i('="'),i(a(r)),i('"'))}),i(s?"/>":">"))},end:function(t){t=e.lowercase(t),r||C[t]!==!0||(i(""),i(t),i(">")),t==r&&(r=!1)},chars:function(t){r||i(a(t))}}}var l=e.$$minErr("$sanitize"),f=/^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/,h=/^<\/\s*([\w:-]+)[^>]*>/,p=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,d=/^,g=/^<\//,y=//g,m=/]*?)>/i,v=//g,$=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,_=/([^\#-~| |!])/g,w=o("area,br,col,hr,img,wbr"),b=o("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),k=o("rp,rt"),x=e.extend({},k,b),S=e.extend({},b,o("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul")),E=e.extend({},k,o("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),A=o("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan,use"),B=o("script,style"),C=e.extend({},w,S,E,x,A),T=o("background,cite,href,longdesc,src,usemap,xlink:href"),O=o("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),D=o("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",!0),M=e.extend({},T,D,O),P=document.createElement("pre");e.module("ngSanitize",[]).provider("$sanitize",r),e.module("ngSanitize").filter("linky",["$sanitize",function(t){var n=/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"”’]/i,r=/^mailto:/i;return function(o,s){function u(t){t&&p.push(i(t))}function a(t,n){p.push("'),u(n),p.push("")}if(!o)return o;for(var c,l,f,h=o,p=[];c=h.match(n);)l=c[0],c[2]||c[4]||(l=(c[3]?"http://":"mailto:")+l),f=c.index,u(h.substr(0,f)),a(l,c[0].replace(r,"")),h=h.substring(f+c[0].length);return u(h),t(p.join(""))}}])}(window,window.angular);var saveAs=saveAs||function(t){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var e=t.document,n=function(){return t.URL||t.webkitURL||t},r=e.createElementNS("http://www.w3.org/1999/xhtml","a"),i="download"in r,o=function(n){var r=e.createEvent("MouseEvents");r.initMouseEvent("click",!0,!1,t,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(r)},s=t.webkitRequestFileSystem,u=t.requestFileSystem||s||t.mozRequestFileSystem,a=function(e){(t.setImmediate||t.setTimeout)(function(){throw e},0)},c="application/octet-stream",l=0,f=500,h=function(e){var r=function(){"string"==typeof e?n().revokeObjectURL(e):e.remove()};t.chrome?r():setTimeout(r,f)},p=function(t,e,n){e=[].concat(e);for(var r=e.length;r--;){var i=t["on"+e[r]];if("function"==typeof i)try{i.call(t,n||t)}catch(o){a(o)}}},d=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t},g=function(e,a){
+e=d(e);var f,g,y,m=this,v=e.type,$=!1,_=function(){p(m,"writestart progress write writeend".split(" "))},w=function(){if(($||!f)&&(f=n().createObjectURL(e)),g)g.location.href=f;else{var r=t.open(f,"_blank");void 0==r&&"undefined"!=typeof safari&&(t.location.href=f)}m.readyState=m.DONE,_(),h(f)},b=function(t){return function(){return m.readyState!==m.DONE?t.apply(this,arguments):void 0}},k={create:!0,exclusive:!1};return m.readyState=m.INIT,a||(a="download"),i?(f=n().createObjectURL(e),r.href=f,r.download=a,o(r),m.readyState=m.DONE,_(),void h(f)):(t.chrome&&v&&v!==c&&(y=e.slice||e.webkitSlice,e=y.call(e,0,e.size,c),$=!0),s&&"download"!==a&&(a+=".download"),(v===c||s)&&(g=t),u?(l+=e.size,void u(t.TEMPORARY,l,b(function(t){t.root.getDirectory("saved",k,b(function(t){var n=function(){t.getFile(a,k,b(function(t){t.createWriter(b(function(n){n.onwriteend=function(e){g.location.href=t.toURL(),m.readyState=m.DONE,p(m,"writeend",e),h(t)},n.onerror=function(){var t=n.error;t.code!==t.ABORT_ERR&&w()},"writestart progress write abort".split(" ").forEach(function(t){n["on"+t]=m["on"+t]}),n.write(e),m.abort=function(){n.abort(),m.readyState=m.DONE},m.readyState=m.WRITING}),w)}),w)};t.getFile(a,{create:!1},b(function(t){t.remove(),n()}),b(function(t){t.code===t.NOT_FOUND_ERR?n():w()}))}),w)}),w)):void w())},y=g.prototype,m=function(t,e){return new g(t,e)};return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e){return navigator.msSaveOrOpenBlob(d(t),e)}:(y.abort=function(){var t=this;t.readyState=t.DONE,p(t,"abort")},y.readyState=y.INIT=0,y.WRITING=1,y.DONE=2,y.error=y.onwritestart=y.onprogress=y.onwrite=y.onabort=y.onerror=y.onwriteend=null,m)}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);"undefined"!=typeof module&&module.exports?module.exports.saveAs=saveAs:"undefined"!=typeof define&&null!==define&&null!=define.amd&&define([],function(){return saveAs}),function(t,e,n){"use strict";function r(){function t(t,n){return e.extend(Object.create(t),n)}function n(t,e){var n=e.caseInsensitiveMatch,r={originalPath:t,regexp:t},i=r.keys=[];return t=t.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,function(t,e,n,r){var o="?"===r?r:null,s="*"===r?r:null;return i.push({name:n,optional:!!o}),e=e||"",""+(o?"":e)+"(?:"+(o?e:"")+(s&&"(.+?)"||"([^/]+)")+(o||"")+")"+(o||"")}).replace(/([\/$\*])/g,"\\$1"),r.regexp=new RegExp("^"+t+"$",n?"i":""),r}var r={};this.when=function(t,i){var o=e.copy(i);if(e.isUndefined(o.reloadOnSearch)&&(o.reloadOnSearch=!0),e.isUndefined(o.caseInsensitiveMatch)&&(o.caseInsensitiveMatch=this.caseInsensitiveMatch),r[t]=e.extend(o,t&&n(t,o)),t){var s="/"==t[t.length-1]?t.substr(0,t.length-1):t+"/";r[s]=e.extend({redirectTo:t},n(s,o))}return this},this.caseInsensitiveMatch=!1,this.otherwise=function(t){return"string"==typeof t&&(t={redirectTo:t}),this.when(null,t),this},this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce",function(n,i,o,s,u,c,l){function f(t,e){var n=e.keys,r={};if(!e.regexp)return null;var i=e.regexp.exec(t);if(!i)return null;for(var o=1,s=i.length;s>o;++o){var u=n[o-1],a=i[o];u&&a&&(r[u.name]=a)}return r}function h(t){var r=$.current;y=d(),m=y&&r&&y.$$route===r.$$route&&e.equals(y.pathParams,r.pathParams)&&!y.reloadOnSearch&&!v,m||!r&&!y||n.$broadcast("$routeChangeStart",y,r).defaultPrevented&&t&&t.preventDefault()}function p(){var t=$.current,r=y;m?(t.params=r.params,e.copy(t.params,o),n.$broadcast("$routeUpdate",t)):(r||t)&&(v=!1,$.current=r,r&&r.redirectTo&&(e.isString(r.redirectTo)?i.path(g(r.redirectTo,r.params)).search(r.params).replace():i.url(r.redirectTo(r.pathParams,i.path(),i.search())).replace()),s.when(r).then(function(){if(r){var t,n,i=e.extend({},r.resolve);return e.forEach(i,function(t,n){i[n]=e.isString(t)?u.get(t):u.invoke(t,null,null,n)}),e.isDefined(t=r.template)?e.isFunction(t)&&(t=t(r.params)):e.isDefined(n=r.templateUrl)&&(e.isFunction(n)&&(n=n(r.params)),e.isDefined(n)&&(r.loadedTemplateUrl=l.valueOf(n),t=c(n))),e.isDefined(t)&&(i.$template=t),s.all(i)}}).then(function(i){r==$.current&&(r&&(r.locals=i,e.copy(r.params,o)),n.$broadcast("$routeChangeSuccess",r,t))},function(e){r==$.current&&n.$broadcast("$routeChangeError",r,t,e)}))}function d(){var n,o;return e.forEach(r,function(r,s){!o&&(n=f(i.path(),r))&&(o=t(r,{params:e.extend({},i.search(),n),pathParams:n}),o.$$route=r)}),o||r[null]&&t(r[null],{params:{},pathParams:{}})}function g(t,n){var r=[];return e.forEach((t||"").split(":"),function(t,e){if(0===e)r.push(t);else{var i=t.match(/(\w+)(?:[?*])?(.*)/),o=i[1];r.push(n[o]),r.push(i[2]||""),delete n[o]}}),r.join("")}var y,m,v=!1,$={routes:r,reload:function(){v=!0,n.$evalAsync(function(){h(),p()})},updateParams:function(t){if(!this.current||!this.current.$$route)throw a("norout","Tried updating route when with no current route");t=e.extend({},this.current.params,t),i.path(g(this.current.$$route.originalPath,t)),i.search(t)}};return n.$on("$locationChangeStart",h),n.$on("$locationChangeSuccess",p),$}]}function i(){this.$get=function(){return{}}}function o(t,n,r){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(i,o,s,u,a){function c(){p&&(r.cancel(p),p=null),f&&(f.$destroy(),f=null),h&&(p=r.leave(h),p.then(function(){p=null}),h=null)}function l(){var s=t.current&&t.current.locals,u=s&&s.$template;if(e.isDefined(u)){var l=i.$new(),p=t.current,y=a(l,function(t){r.enter(t,null,h||o).then(function(){!e.isDefined(d)||d&&!i.$eval(d)||n()}),c()});h=y,f=p.scope=l,f.$emit("$viewContentLoaded"),f.$eval(g)}else c()}var f,h,p,d=s.autoscroll,g=s.onload||"";i.$on("$routeChangeSuccess",l),l()}}}function s(t,e,n){return{restrict:"ECA",priority:-400,link:function(r,i){var o=n.current,s=o.locals;i.html(s.$template);var u=t(i.contents());if(o.controller){s.$scope=r;var a=e(o.controller,s);o.controllerAs&&(r[o.controllerAs]=a),i.data("$ngControllerController",a),i.children().data("$ngControllerController",a)}u(r)}}}var u=e.module("ngRoute",["ng"]).provider("$route",r),a=e.$$minErr("ngRoute");u.provider("$routeParams",i),u.directive("ngView",o),u.directive("ngView",s),o.$inject=["$route","$anchorScroll","$animate"],s.$inject=["$compile","$controller","$route"]}(window,window.angular),function(t,e){"undefined"!=typeof module&&module.exports?module.exports=e(require("angular")):"function"==typeof define&&define.amd?define(["angular"],e):e(t.angular)}(this,function(t,e){"use strict";t.module("ngProgressLite",[]).provider("ngProgressLite",function(){var e=this.settings={minimum:.08,speed:300,ease:"ease",trickleRate:.02,trickleSpeed:500,template:''};this.$get=["$document",function(n){var r,i,o,s=n.find("body"),u={render:function(){return this.isRendered()?r:(s.addClass("ngProgressLite-on"),r=t.element(e.template),s.append(r),o=!1,r)},remove:function(){s.removeClass("ngProgressLite-on"),r.remove(),o=!0},isRendered:function(){return r&&r.children().length>0&&!o},trickle:function(){return a.inc(Math.random()*e.trickleRate)},clamp:function(t,e,n){return e>t?e:t>n?n:t},toBarPercents:function(t){return 100*t},positioning:function(t,e,n){return{width:this.toBarPercents(t)+"%",transition:"all "+e+"ms "+n}}},a={set:function(t){var n=u.render();return t=u.clamp(t,e.minimum,1),i=1===t?null:t,setTimeout(function(){n.children().eq(0).css(u.positioning(t,e.speed,e.ease))},100),1===t&&setTimeout(function(){n.css({transition:"all "+e.speed+"ms linear",opacity:0}),setTimeout(function(){u.remove()},e.speed)},e.speed),a},get:function(){return i},start:function(){i||a.set(0);var t=function(){setTimeout(function(){i&&(u.trickle(),t())},e.trickleSpeed)};return t(),a},inc:function(t){var e=i;return e?("number"!=typeof t&&(t=(1-e)*u.clamp(Math.random()*e,.1,.95)),e=u.clamp(e+t,0,.994),a.set(e)):a.start()},done:function(){i&&a.inc(.3+.5*Math.random()).set(1)}};return a}]})}),!function(t){"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):"undefined"!=typeof window?window.triplesec=t():"undefined"!=typeof global?global.triplesec=t():"undefined"!=typeof self&&(self.triplesec=t())}(function(){return function t(e,n,r){function i(s,u){if(!n[s]){if(!e[s]){var a="function"==typeof require&&require;if(!u&&a)return a(s,!0);if(o)return o(s,!0);throw new Error("Cannot find module '"+s+"'")}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;se;t=++e)n.push([]);return n}(),this.INV_SUB_MIX=function(){var e,n;for(n=[],t=e=0;4>e;t=++e)n.push([]);return n}(),this.init(),this.RCON=[0,1,2,4,8,16,32,64,128,27,54]}return t.prototype.init=function(){var t,e,n,r,i,o,s,u,a,c;for(t=function(){var t,n;for(n=[],e=t=0;256>t;e=++t)n.push(128>e?e<<1:e<<1^283);return n}(),i=0,a=0,e=c=0;256>c;e=++c)n=a^a<<1^a<<2^a<<3^a<<4,n=n>>>8^255&n^99,this.SBOX[i]=n,this.INV_SBOX[n]=i,o=t[i],s=t[o],u=t[s],r=257*t[n]^16843008*n,this.SUB_MIX[0][i]=r<<24|r>>>8,this.SUB_MIX[1][i]=r<<16|r>>>16,this.SUB_MIX[2][i]=r<<8|r>>>24,this.SUB_MIX[3][i]=r,r=16843009*u^65537*s^257*o^16843008*i,this.INV_SUB_MIX[0][n]=r<<24|r>>>8,this.INV_SUB_MIX[1][n]=r<<16|r>>>16,this.INV_SUB_MIX[2][n]=r<<8|r>>>24,this.INV_SUB_MIX[3][n]=r,0===i?i=a=1:(i=o^t[t[t[u^o]]],a^=t[t[a]]);return!0},t}(),i=new o,e=function(t){function e(t){this._key=t.clone(),this._doReset()}return a(e,t),e.blockSize=16,e.prototype.blockSize=e.blockSize,e.keySize=32,e.prototype.keySize=e.keySize,e.ivSize=e.blockSize,e.prototype.ivSize=e.ivSize,e.prototype._doReset=function(){var t,e,n,r,o,s,u,a;for(n=this._key.words,e=this._key.sigBytes/4,this._nRounds=e+6,o=4*(this._nRounds+1),this._keySchedule=[],r=u=0;o>=0?o>u:u>o;r=o>=0?++u:--u)this._keySchedule[r]=e>r?n[r]:(s=this._keySchedule[r-1],r%e===0?(s=s<<8|s>>>24,s=i.SBOX[s>>>24]<<24|i.SBOX[s>>>16&255]<<16|i.SBOX[s>>>8&255]<<8|i.SBOX[255&s],s^=i.RCON[r/e|0]<<24):e>6&&r%e===4?s=i.SBOX[s>>>24]<<24|i.SBOX[s>>>16&255]<<16|i.SBOX[s>>>8&255]<<8|i.SBOX[255&s]:void 0,this._keySchedule[r-e]^s);for(this._invKeySchedule=[],t=a=0;o>=0?o>a:a>o;t=o>=0?++a:--a)r=o-t,s=this._keySchedule[r-(t%4?0:4)],this._invKeySchedule[t]=4>t||4>=r?s:i.INV_SUB_MIX[0][i.SBOX[s>>>24]]^i.INV_SUB_MIX[1][i.SBOX[s>>>16&255]]^i.INV_SUB_MIX[2][i.SBOX[s>>>8&255]]^i.INV_SUB_MIX[3][i.SBOX[255&s]];return!0},e.prototype.encryptBlock=function(t,e){return null==e&&(e=0),this._doCryptBlock(t,e,this._keySchedule,i.SUB_MIX,i.SBOX)},e.prototype.decryptBlock=function(t,e){var n,r;return null==e&&(e=0),n=[t[e+3],t[e+1]],t[e+1]=n[0],t[e+3]=n[1],this._doCryptBlock(t,e,this._invKeySchedule,i.INV_SUB_MIX,i.INV_SBOX),r=[t[e+3],t[e+1]],t[e+1]=r[0],t[e+3]=r[1],r},e.prototype.scrub=function(){return s(this._keySchedule),s(this._invKeySchedule),this._key.scrub()},e.prototype._doCryptBlock=function(t,e,n,r,i){var o,s,u,a,c,l,f,h,p,d,g,y;for(u=t[e]^n[0],a=t[e+1]^n[1],c=t[e+2]^n[2],l=t[e+3]^n[3],o=4,s=g=1,y=this._nRounds;y>=1?y>g:g>y;s=y>=1?++g:--g)f=r[0][u>>>24]^r[1][a>>>16&255]^r[2][c>>>8&255]^r[3][255&l]^n[o++],h=r[0][a>>>24]^r[1][c>>>16&255]^r[2][l>>>8&255]^r[3][255&u]^n[o++],p=r[0][c>>>24]^r[1][l>>>16&255]^r[2][u>>>8&255]^r[3][255&a]^n[o++],d=r[0][l>>>24]^r[1][u>>>16&255]^r[2][a>>>8&255]^r[3][255&c]^n[o++],u=f,a=h,c=p,l=d;return f=(i[u>>>24]<<24|i[a>>>16&255]<<16|i[c>>>8&255]<<8|i[255&l])^n[o++],h=(i[a>>>24]<<24|i[c>>>16&255]<<16|i[l>>>8&255]<<8|i[255&u])^n[o++],p=(i[c>>>24]<<24|i[l>>>16&255]<<16|i[u>>>8&255]<<8|i[255&a])^n[o++],d=(i[l>>>24]<<24|i[u>>>16&255]<<16|i[a>>>8&255]<<8|i[255&c])^n[o++],t[e]=f,t[e+1]=h,t[e+2]=p,t[e+3]=d},e}(r),n.AES=e}).call(this)},{"./algbase":2,"./util":23}],2:[function(t,e,n){(function(){var e,r,i,o,s,u,a={}.hasOwnProperty,c=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};s=t("./wordarray").WordArray,u=t("./util"),r=function(){function t(){this.reset()}return t.prototype._minBufferSize=0,t.prototype.reset=function(){return this._data=new s,this._nDataBytes=0},t.prototype._append=function(t){return this._data.concat(t),this._nDataBytes+=t.sigBytes},t.prototype._process=function(t){var e,n,r,i,o,u,a,c,l,f,h;if(n=this._data,i=n.words,r=n.sigBytes,e=4*this.blockSize,o=r/e,o=t?Math.ceil(o):Math.max((0|o)-this._minBufferSize,0),a=o*this.blockSize,u=Math.min(4*a,r),a){for(c=f=0,h=this.blockSize;h>0?a>f:f>a;c=f+=h)this._doProcessBlock(i,c);l=i.splice(0,a),n.sigBytes-=u}return new s(l,u)},t.prototype.copy_to=function(t){return t._data=this._data.clone(),t._nDataBytes=this._nDataBytes},t.prototype.clone=function(){var e;return e=new t,this.copy_to(e),e},t}(),i=function(t){function e(){e.__super__.constructor.call(this)}return c(e,t),e.prototype.reset=function(){return e.__super__.reset.call(this),this._doReset(),this},e.prototype.update=function(t){return this._append(t),this._process(),this},e.prototype.finalize=function(t){return t&&this._append(t),this._doFinalize()},e.prototype.bufhash=function(t){var e,n,r;return n=s.from_buffer(t),r=this.finalize(n),e=r.to_buffer(),n.scrub(),r.scrub(),e},e}(r),n.BlockCipher=e=function(){function t(t){}return t.prototype.encryptBlock=function(t,e){},t}(),o=function(){function t(){}return t.prototype.encryptBlock=function(t,e){var n,r;return null==e&&(e=0),r=this.get_pad(),n=Math.min(t.words.length-e,this.bsiw),t.xor(r,{dst_offset:e,n_words:n}),r.scrub(),this.bsiw},t.prototype.encrypt=function(t){var e,n,r,i;for(e=n=0,r=t.words.length,i=this.bsiw;i>0?r>n:n>r;e=n+=i)this.encryptBlock(t,e);return t},t.prototype.bulk_encrypt=function(t,e){var n,r,i,o,s;return r=t.input,i=t.progress_hook,s=t.what,o={update:function(t){return function(e,n){var i,o,s,u;for(u=[],i=o=e,s=t.bsiw;s>0?n>o:o>n;i=o+=s)u.push(t.encryptBlock(r,i));return u}}(this),finalize:function(){return r},default_n:1024*this.bsiw},n={progress_hook:i,cb:e,what:s},u.bulk(r.sigBytes,o,n)},t}(),n.BlockCipher=e,n.Hasher=i,n.BufferedBlockAlgorithm=r,n.StreamCipher=o}).call(this)},{"./util":23,"./wordarray":24}],3:[function(t,e,n){(function(){var e,r,i,o,s,u,a,c,l,f={}.hasOwnProperty,h=function(t,e){function n(){this.constructor=t}for(var r in e)f.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};l=t("./hmac"),i=l.HMAC,c=l.bulk_sign,s=t("./sha512").SHA512,o=t("./sha3").SHA3,u=t("./wordarray").WordArray,e=function(){function t(){this.hasherBlockSize=this.hashers[0].hasherBlockSize,this.hasherBlockSizeBytes=4*this.hasherBlockSize,this.reset()}return t.prototype.reset=function(){var t,e,n,r;for(r=this.hashers,e=0,n=r.length;n>e;e++)t=r[e],t.reset();return this},t.prototype.update=function(t){var e,n,r,i;for(i=this.hashers,n=0,r=i.length;r>n;n++)e=i[n],e.update(t);return this},t.prototype.scrub=function(){var t,e,n,r;for(r=this.hashers,e=0,n=r.length;n>e;e++)t=r[e],t.scrub();return this},t.prototype.finalize=function(t){var e,n,r,i,o,s;for(n=function(){var n,r,i,o;for(i=this.hashers,o=[],n=0,r=i.length;r>n;n++)e=i[n],o.push(e.finalize(t));return o}.call(this),r=n[0],s=n.slice(1),i=0,o=s.length;o>i;i++)e=s[i],this._coalesce(r,e),e.scrub();return r},t}(),r=function(t){function e(t,n){var r,u,a,c,l;null==n&&(n=[s,o]),l=t.split(n.length),this.hashers=function(){var t,e,o;for(o=[],u=t=0,e=n.length;e>t;u=++t)a=n[u],c=l[u],r=new i(c,a),c.scrub(),o.push(r);return o}(),e.__super__.constructor.call(this)}return h(e,t),e.get_output_size=function(){return s.output_size+o.output_size},e.prototype._coalesce=function(t,e){return t.concat(e)},e.prototype.get_output_size=function(){var t,e,n,r,i;for(e=0,i=this.hashers,n=0,r=i.length;r>n;n++)t=i[n],e+=t.get_output_size();return e},e.sign=function(t){var n,r;return r=t.key,n=t.input,new e(r).finalize(n)},e.bulk_sign=function(t,n){return t.klass=e,t.what="HMAC-SHA512-SHA3",c(t,n)},e}(e),a=function(t){function e(t,n){var r;null==n&&(n=[s,o]),this.hashers=function(){var e,o,s;for(s=[],e=0,o=n.length;o>e;e++)r=n[e],s.push(new i(t,r));return s}(),e.__super__.constructor.call(this)}return h(e,t),e.prototype.reset=function(){var t,n,r,i,o;for(e.__super__.reset.call(this),o=this.hashers,n=r=0,i=o.length;i>r;n=++r)t=o[n],t.update(new u([n]));return this},e.get_output_size=function(){return Math.max(s.output_size,o.output_size)},e.prototype._coalesce=function(t,e){return t.xor(e,{})},e.prototype.get_output_size=function(){var t;return Math.max.apply(Math,function(){var e,n,r,i;for(r=this.hashers,i=[],e=0,n=r.length;n>e;e++)t=r[e],i.push(t.get_output_size());return i}.call(this))},e.sign=function(t){var n,r;return r=t.key,n=t.input,new e(r).finalize(n)},e.bulk_sign=function(t,n){return t.klass=e,t.what="HMAC-SHA512-XOR-SHA3",c(t,n)},e}(e),n.Concat=r,n.XOR=a}).call(this)},{"./hmac":8,"./sha3":19,"./sha512":21,"./wordarray":24}],4:[function(t,e,n){(function(){var e,r,i,o,s,u,a,c,l,f={}.hasOwnProperty,h=function(t,e){function n(){this.constructor=t}for(var r in e)f.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};a=t("iced-runtime"),c=l=function(){},o=t("./wordarray").WordArray,i=t("./algbase").StreamCipher,r=function(){function t(t){var e,n,r;r=t.value,n=t.len,this._value=null!=r?r.clone():(null==n?n=2:void 0,new o(function(){var t,r;for(r=[],e=t=0;n>=0?n>t:t>n;e=n>=0?++t:--t)r.push(0);return r}()))}return t.prototype.WORD_MAX=4294967295,t.prototype.inc=function(){var e,n;for(e=!0,n=this._value.words.length-1;e&&n>=0;)++this._value.words[n]>t.WORD_MAX?this._value.words[n]=0:e=!1,n--;return this},t.prototype.inc_le=function(){var e,n;for(e=!0,n=0;e&&nt.WORD_MAX?this._value.words[n]=0:e=!1,n++;return this},t.prototype.get=function(){return this._value},t.prototype.copy=function(){return this._value.clone()},t}(),e=function(t){function e(t){if(this.block_cipher=t.block_cipher,this.iv=t.iv,e.__super__.constructor.call(this),this.bsiw=this.block_cipher.blockSize/4,this.iv.sigBytes!==this.block_cipher.blockSize)throw new Error("IV is wrong length ("+this.iv.sigBytes+")");this.ctr=new r({value:this.iv})}return h(e,t),e.prototype.scrub=function(){return this.block_cipher.scrub()},e.prototype.get_pad=function(){var t;return t=this.ctr.copy(),this.ctr.inc(),this.block_cipher.encryptBlock(t.words),t},e}(i),u=function(t){var n,r,i,o,s;return n=t.block_cipher,o=t.iv,i=t.input,r=new e({block_cipher:n,iv:o}),s=r.encrypt(i),r.scrub(),s},s=function(t,n){var r,i,o,s,u,c,f,h,p,d;d=l,h=a.findDeferral(arguments),r=t.block_cipher,s=t.iv,o=t.input,u=t.progress_hook,f=t.what,i=new e({block_cipher:r,iv:s}),function(t){return function(t){p=new a.Deferrals(t,{parent:h,filename:"/home/max/src/keybase/triplesec/src/ctr.iced"}),i.bulk_encrypt({input:o,progress_hook:u,what:f},p.defer({assign_fn:function(){return function(){return c=arguments[0]}}(),lineno:121})),p._fulfill()}}(this)(function(t){return function(){return n(c)}}(this))},n.Counter=r,n.Cipher=e,n.encrypt=u,n.bulk_encrypt=s}).call(this)},{"./algbase":2,"./wordarray":24,"iced-runtime":38}],5:[function(t,e,n){(function(){var e,r,i,o,s,u,a,c,l,f,h,p,d,g,y,m,v,$={}.hasOwnProperty,_=function(t,e){function n(){this.constructor=t}for(var r in e)$.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};p=t("iced-runtime"),y=m=function(){},l=t("./wordarray").WordArray,g=t("./salsa20"),e=t("./aes").AES,a=t("./twofish").TwoFish,f=t("./ctr"),i=t("./combine").Concat,s=t("./sha512").SHA512,u=t("./salsa20").Salsa20,v=t("./enc"),r=v.Base,c=v.V,d=t("iced-error").make_esc,o=function(t){function n(t){var e,r;r=t.key,e=t.enc,n.__super__.constructor.call(this,{key:r}),null!=e&&(this.key=e.key,this.derived_keys=e.derived_keys)}return _(n,t),n.prototype.read_header=function(t){var e,n;return e=null==(n=this.ct.unshift(2))?new Error("Ciphertext underrun in header"):null==(this.version=c[n.words[1]])?new Error("bad header; couldn't find a good version (got "+n.words[1]+")"):n.words[0]!==this.version.header[0]?new Error("Bad header: unrecognized magic value"):null,t(e)},n.prototype.verify_sig=function(t,e){var n,r,o,s,u,a;a=m,s=p.findDeferral(arguments),function(e){return function(a){return null==(o=e.ct.unshift(i.get_output_size()/4))?a(r=new Error("Ciphertext underrun in signature")):void!function(i){u=new p.Deferrals(i,{parent:s,filename:"/home/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.verify_sig"}),e.sign({input:e.ct,key:t,salt:e.salt},u.defer({assign_fn:function(){return function(){return r=arguments[0],n=arguments[1]}}(),lineno:63})),u._fulfill()}(function(){return a(r=null!=r?r:o.equal(n)?null:new Error("Signature mismatch or bad decryption key"))})}}(this)(function(t){return function(){return e(r)}}(this))},n.prototype.unshift_iv=function(t,e,n){var r,i;return r=null!=(i=this.ct.unshift(t/4))?null:new Error("Ciphertext underrun in "+e),n(r,i)},n.prototype.read_salt=function(t){var e;return e=null==(this.salt=this.ct.unshift(this.version.salt_size/4))?new Error("Ciphertext underrrun in read_salt"):null,t(e)},n.prototype.generate_keys=function(t,e){var n,r,i,o,s,u;u=m,o=p.findDeferral(arguments),i=t.progress_hook,function(t){return function(e){s=new p.Deferrals(e,{parent:o,filename:"/home/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.generate_keys"}),t.kdf({salt:t.salt,progress_hook:i},s.defer({assign_fn:function(){return function(){return n=arguments[0],r=arguments[1]}}(),lineno:114})),s._fulfill()}}(this)(function(t){return function(){return e(n,r)}}(this))},n.prototype.run=function(t,n){var r,i,o,s,c,f,h,g,y,v;v=m,g=p.findDeferral(arguments),o=t.data,f=t.progress_hook,s=d(n,"Decryptor::run"),this.ct=l.from_buffer(o),function(t){return function(e){y=new p.Deferrals(e,{parent:g,filename:"/home/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.run"}),t.read_header(s(y.defer({lineno:141}))),y._fulfill()}}(this)(function(t){return function(){!function(e){y=new p.Deferrals(e,{parent:g,filename:"/home/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.run"}),t.read_salt(s(y.defer({lineno:142}))),y._fulfill()}(function(){!function(e){y=new p.Deferrals(e,{parent:g,filename:"/home/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.run"}),t.generate_keys({progress_hook:f},s(y.defer({assign_fn:function(t){return function(){return t.keys=arguments[0]}}(t),lineno:143}))),y._fulfill()}(function(){!function(e){y=new p.Deferrals(e,{parent:g,filename:"/home/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.run"}),t.verify_sig(t.keys.hmac,s(y.defer({lineno:144}))),y._fulfill()}(function(){!function(n){y=new p.Deferrals(n,{parent:g,filename:"/home/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.run"}),t.unshift_iv(e.ivSize,"AES",s(y.defer({assign_fn:function(){return function(){return c=arguments[0]}}(),lineno:145}))),y._fulfill()}(function(){!function(e){y=new p.Deferrals(e,{parent:g,filename:"/home/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.run"}),t.run_aes({iv:c,input:t.ct,key:t.keys.aes,progress_hook:f},s(y.defer({assign_fn:function(){return function(){return i=arguments[0]}}(),lineno:146}))),y._fulfill()}(function(){!function(e){y=new p.Deferrals(e,{parent:g,filename:"/home/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.run"}),t.unshift_iv(a.ivSize,"2fish",s(y.defer({assign_fn:function(){return function(){return c=arguments[0]}}(),lineno:147}))),y._fulfill()}(function(){!function(e){y=new p.Deferrals(e,{parent:g,filename:"/home/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.run"}),t.run_twofish({iv:c,input:t.ct,key:t.keys.twofish,progress_hook:f},s(y.defer({assign_fn:function(){return function(){return r=arguments[0]}}(),lineno:148}))),y._fulfill()}(function(){!function(e){y=new p.Deferrals(e,{parent:g,filename:"/home/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.run"}),t.unshift_iv(u.ivSize,"Salsa",s(y.defer({assign_fn:function(){return function(){return c=arguments[0]}}(),lineno:149}))),y._fulfill()}(function(){!function(e){y=new p.Deferrals(e,{parent:g,filename:"/home/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.run"}),t.run_salsa20({iv:c,input:t.ct,key:t.keys.salsa20,output_iv:!1,progress_hook:f},s(y.defer({assign_fn:function(){return function(){return h=arguments[0]}}(),lineno:150}))),y._fulfill()}(function(){return n(null,h.to_buffer())})})})})})})})})})}}(this))},n}(r),h=function(t,e){var n,r,i,s,u,a,c,l,f;f=m,c=p.findDeferral(arguments),s=t.key,n=t.data,u=t.progress_hook,r=new o({key:s}),function(t){return function(t){l=new p.Deferrals(t,{parent:c,filename:"/home/max/src/keybase/triplesec/src/dec.iced"}),r.run({data:n,progress_hook:u},l.defer({assign_fn:function(){return function(){return i=arguments[0],a=arguments[1]}}(),lineno:168})),l._fulfill()}}(this)(function(t){return function(){return r.scrub(),e(i,a)}}(this))},n.Decryptor=o,n.decrypt=h}).call(this)},{"./aes":1,"./combine":3,"./ctr":4,"./enc":7,"./salsa20":14,"./sha512":21,"./twofish":22,"./wordarray":24,"iced-error":30,"iced-runtime":38}],6:[function(t,e,n){var r=t("__browserify_Buffer");(function(){var e,i,o,s,u,a,c,l,f,h,p;c=t("iced-runtime"),h=p=function(){},a=t("./hmac"),u=t("./combine").XOR,f=t("./sha512"),l=t("./sha3"),s=t("./wordarray").WordArray,o=t("iced-lock").Lock,i=function(){function t(t,e,n){this.hmac=n||a.sign,this.security_strength=256,t=this.check_entropy(t),e||(e=new s([])),this._instantiate(t,e)}return t.prototype.check_entropy=function(t,e){if(null==e&&(e=!1),8*t.sigBytes*2<(e?2:3)*this.security_strength)throw new Error("entropy must be at least "+1.5*this.security_strength+" bits.");return t},t.prototype._hmac=function(t,e){return this.hmac({key:t,input:e})},t.prototype._update=function(t){var e,n;return e=new s([0],1),null!=t&&(e=e.concat(t)),n=this.V.clone().concat(e),this.K=this._hmac(this.K,n),n.scrub(),e.scrub(),this.V=this._hmac(this.K,this.V),null!=t&&(n=this.V.clone().concat(new s([1<<24],1)).concat(t),this.K=this._hmac(this.K,n),n.scrub(),this.V=this._hmac(this.K,this.V)),null!=t?t.scrub():void 0},t.prototype._instantiate=function(t,e){var n,i,o;return o=t.concat(e),i=64,this.K=s.from_buffer(new r(function(){var t,e;for(e=[],n=t=0;i>=0?i>t:t>i;n=i>=0?++t:--t)e.push(0);return e}())),this.V=s.from_buffer(new r(function(){var t,e;for(e=[],n=t=0;i>=0?i>t:t>i;n=i>=0?++t:--t)e.push(1);return e}())),this._update(o),t.scrub(),this.reseed_counter=1},t.prototype.reseed=function(t){return this._update(this.check_entropy(t,!0)),this.reseed_counter=1},t.prototype.generate=function(t){var e,n,r;if(8*t>7500)throw new Error("generate cannot generate > 7500 bits in 1 call.");if(this.reseed_counter>=1e4)throw new Error("Need a reseed!");for(n=[],e=0;0===n.length||n.length*n[0].length*4100?void!function(t){s=new c.Deferrals(t,{parent:o,filename:"/home/max/src/keybase/triplesec/src/drbg.iced",funcname:"ADRBG.generate"}),u.gen_seed(256,s.defer({assign_fn:function(){return function(){return r=arguments[0]}}(),lineno:153})),s._fulfill()}(function(){return t(u.drbg.reseed(r))}):t()}(function(){return n=u.drbg.generate(t),u.lock.release(),e(n)})})}}(this))},t}(),n.DRBG=i,n.ADRBG=e}).call(this)},{"./combine":3,"./hmac":8,"./sha3":19,"./sha512":21,"./wordarray":24,__browserify_Buffer:26,"iced-lock":31,"iced-runtime":38}],7:[function(t,e,n){(function(){var e,r,i,o,s,u,a,c,l,f,h,p,d,g,y,m,v,$,_,w,b,k,x,S={}.hasOwnProperty,E=function(t,e){function n(){this.constructor=t}for(var r in e)S.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};m=t("iced-runtime"),b=k=function(){},p=t("./wordarray").WordArray,_=t("./salsa20"),e=t("./aes").AES,f=t("./twofish").TwoFish,g=t("./ctr"),x=t("./combine"),d=x.XOR,o=x.Concat,c=t("./sha512").SHA512,a=t("./pbkdf2").PBKDF2,l=t("./scrypt").Scrypt,w=t("./util"),$=t("./prng"),v=t("iced-error").make_esc,u=t("./hmac").HMAC_SHA256,h={1:{header:[479516638,1],salt_size:8,xsalsa20_rev:!0,kdf:{klass:a,opts:{c:1024,klass:d}},hmac_key_size:96},2:{header:[479516638,2],salt_size:16,xsalsa20_rev:!0,kdf:{klass:l,opts:{c:64,klass:d,N:12,r:8,p:1}},hmac_key_size:96},3:{header:[479516638,3],salt_size:16,xsalsa20_rev:!1,kdf:{klass:l,opts:{c:1,klass:u,N:15,r:8,p:1}},hmac_key_size:96}},n.CURRENT_VERSION=i=3,r=function(){function t(t){var e,n;if(e=t.key,n=t.version,this.version=h[null!=n?n:i],null==this.version)throw new Error("unknown version: "+n);this.set_key(e),this.derived_keys={}}return t.prototype.kdf=function(t,n){var r,i,o,s,u,a,c,l,h,d,g,y,v,$,w,b,x,S,E;E=k,x=m.findDeferral(arguments),$=t.salt,s=t.extra_keymaterial,y=t.progress_hook,function(t){return function(e){S=new m.Deferrals(e,{parent:x,filename:"/home/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.kdf"}),t._check_scrubbed(t.key,"in KDF",n,S.defer({lineno:94})),S._fulfill()}}(this)(function(t){return function(){w=$.to_hex(),c=t.key.clone(),function(e){S=new m.Deferrals(e,{parent:x,filename:"/home/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.kdf"}),t._check_scrubbed(c,"KDF",n,S.defer({lineno:102})),S._fulfill()}(function(){!function(n){if(null!=(l=t.derived_keys[w]))return n();t._kdf=new t.version.kdf.klass(t.version.kdf.opts),d={hmac:t.version.hmac_key_size,aes:e.keySize,twofish:f.keySize,salsa20:_.Salsa20.keySize},g=["hmac","aes","twofish","salsa20"],i=s||0;for(a in d)b=d[a],i+=b;r={dkLen:i,key:c,progress_hook:y,salt:$},function(e){S=new m.Deferrals(e,{parent:x,filename:"/home/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.kdf"}),t._kdf.run(r,S.defer({assign_fn:function(){return function(){return v=arguments[0]}}(),lineno:121})),S._fulfill()}(function(){var e,r;for(l={},u=0,e=0,r=g.length;r>e;e++)a=g[e],b=d[a],h=b/4,o=u+h,l[a]=new p(v.words.slice(u,o)),u=o;return l.extra=new p(v.words.slice(o)).to_buffer(),n(t.derived_keys[w]=l)})}(function(){return n(null,l)})})}}(this))},t.prototype.set_key=function(t){var e;return null==t?this.scrub():(e=p.from_buffer(t),this.key&&this.key.equal(e)?void 0:(this.scrub(),this.key=e))},t.prototype._check_scrubbed=function(t,e,n,r){return null==t||t.is_scrubbed()?n(new Error(""+e+": Failed due to scrubbed key!"),null):r()},t.prototype.sign=function(t,e){var n,r,i,s,u,a,c,l;l=k,a=m.findDeferral(arguments),n=t.input,r=t.key,u=t.salt,s=t.progress_hook,function(t){return function(n){c=new m.Deferrals(n,{parent:a,filename:"/home/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.sign"}),t._check_scrubbed(r,"HMAC",e,c.defer({lineno:179})),c._fulfill()}}(this)(function(t){return function(){n=new p(t.version.header).concat(u).concat(n),function(t){c=new m.Deferrals(t,{parent:a,filename:"/home/max/src/keybase/triplesec/src/enc.iced",
+funcname:"Base.sign"}),o.bulk_sign({key:r,input:n,progress_hook:s},c.defer({assign_fn:function(){return function(){return i=arguments[0]}}(),lineno:181})),c._fulfill()}(function(){return n.scrub(),e(null,i)})}}(this))},t.prototype.run_salsa20=function(t,e){var n,r,i,o,s,u,a,c,l,f;f=k,c=m.findDeferral(arguments),i=t.input,s=t.key,o=t.iv,u=t.output_iv,a=t.progress_hook,function(t){return function(n){l=new m.Deferrals(n,{parent:c,filename:"/home/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.run_salsa20"}),t._check_scrubbed(s,"Salsa20",e,l.defer({lineno:197})),l._fulfill()}}(this)(function(t){return function(){n={input:i,progress_hook:a,key:s,iv:o},t.version.xsalsa20_rev&&(n.key=s.clone().endian_reverse(),n.iv=o.clone().endian_reverse()),function(t){l=new m.Deferrals(t,{parent:c,filename:"/home/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.run_salsa20"}),_.bulk_encrypt(n,l.defer({assign_fn:function(){return function(){return r=arguments[0]}}(),lineno:209})),l._fulfill()}(function(){return u&&(r=o.clone().concat(r)),t.version.xsalsa20_rev&&(n.key.scrub(),n.iv.scrub()),e(null,r)})}}(this))},t.prototype.run_twofish=function(t,e){var n,r,i,o,s,u,a,c,l;l=k,a=m.findDeferral(arguments),i=t.input,s=t.key,o=t.iv,u=t.progress_hook,function(t){return function(n){c=new m.Deferrals(n,{parent:a,filename:"/home/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.run_twofish"}),t._check_scrubbed(s,"TwoFish",e,c.defer({lineno:232})),c._fulfill()}}(this)(function(t){return function(){n=new f(s),function(t){c=new m.Deferrals(t,{parent:a,filename:"/home/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.run_twofish"}),g.bulk_encrypt({block_cipher:n,iv:o,input:i,progress_hook:u,what:"twofish"},c.defer({assign_fn:function(){return function(){return r=arguments[0]}}(),lineno:234})),c._fulfill()}(function(){return n.scrub(),e(null,o.clone().concat(r))})}}(this))},t.prototype.run_aes=function(t,n){var r,i,o,s,u,a,c,l,f;f=k,c=m.findDeferral(arguments),o=t.input,u=t.key,s=t.iv,a=t.progress_hook,function(t){return function(e){l=new m.Deferrals(e,{parent:c,filename:"/home/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.run_aes"}),t._check_scrubbed(u,"AES",n,l.defer({lineno:249})),l._fulfill()}}(this)(function(t){return function(){r=new e(u),function(t){l=new m.Deferrals(t,{parent:c,filename:"/home/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.run_aes"}),g.bulk_encrypt({block_cipher:r,iv:s,input:o,progress_hook:a,what:"aes"},l.defer({assign_fn:function(){return function(){return i=arguments[0]}}(),lineno:251})),l._fulfill()}(function(){return r.scrub(),n(null,s.clone().concat(i))})}}(this))},t.prototype.scrub=function(){var t,e,n,r,i,o;if(null!=this.key&&this.key.scrub(),null!=this.derived_keys){o=this.derived_keys;for(n in o)for(e=o[n],r=0,i=e.length;i>r;r++)t=e[r],t.scrub()}return this.derived_keys={},null!=this.salt&&this.salt.scrub(),this.salt=null,this.key=null},t}(),s=function(t){function n(t){var e,r,i;e=t.key,r=t.rng,i=t.version,n.__super__.constructor.call(this,{key:e,version:i}),this.rng=r||$.generate}return E(n,t),n.prototype.pick_random_ivs=function(t,n){var r,i,o,s,u,a,c,l;l=k,a=m.findDeferral(arguments),s=t.progress_hook,r={aes:e.ivSize,twofish:f.ivSize,salsa20:_.Salsa20.ivSize},i={},function(t){return function(e){var n,s,l,f,h,p;f=r,l=function(){var t;t=[];for(s in f)t.push(s);return t}(),n=0,h=[],(p=function(e){var r,s,d;return r=function(){return e(h)},s=function(){return m.trampoline(function(){return++n,p(e)})},d=function(t){return h.push(t),s()},nthis.hasherBlockSizeBytes&&(this.key=this.hasher.finalize(this.key)),this.key.clamp(),this._oKey=this.key.clone(),this._iKey=this.key.clone(),n=r=0,i=this.hasherBlockSize;i>=0?i>r:r>i;n=i>=0?++r:--r)this._oKey.words[n]^=1549556828,this._iKey.words[n]^=909522486;this._oKey.sigBytes=this._iKey.sigBytes=this.hasherBlockSizeBytes,this.reset()}return t.outputSize=64,t.prototype.outputSize=t.outputSize,t.prototype.get_output_size=function(){return this.hasher.output_size},t.prototype.reset=function(){return this.hasher.reset().update(this._iKey)},t.prototype.update=function(t){return this.hasher.update(t),this},t.prototype.finalize=function(t){var e,n,r;return e=this.hasher.finalize(t),this.hasher.reset(),n=this._oKey.clone().concat(e),r=this.hasher.finalize(n),e.scrub(),n.scrub(),r},t.prototype.scrub=function(){return this.key.scrub(),this._iKey.scrub(),this._oKey.scrub()},t}(),a=function(t){var n,r,i,o,s;return o=t.key,i=t.input,r=t.hash_class,n=new e(o,r),s=n.finalize(i.clamp()),n.scrub(),s},s=function(t,n){var r,i,o,s,a,l,h,p,d,g,y;y=f,d=u.findDeferral(arguments),o=t.key,i=t.input,a=t.progress_hook,s=t.klass,p=t.what,s||(s=e),p||(p="hmac_sha512"),r=new s(o),i.clamp(),h={update:function(t,e){return r.update(i.slice(t,e))},finalize:function(){return r.finalize()},default_n:1e3*r.hasherBlockSize},function(t){return function(t){g=new u.Deferrals(t,{parent:d,filename:"/home/max/src/keybase/triplesec/src/hmac.iced"}),c.bulk(i.sigBytes,h,{what:p,progress_hook:a,cb:g.defer({assign_fn:function(){return function(){return l=arguments[0]}}(),lineno:137})}),g._fulfill()}}(this)(function(t){return function(){return r.scrub(),n(l)}}(this))},n.HMAC_SHA256=r=function(t){function e(t){e.__super__.constructor.call(this,t,i)}return p(e,t),e}(e),n.HMAC=e,n.sign=a,n.bulk_sign=s}).call(this)},{"./sha256":18,"./sha512":21,"./util":23,"iced-runtime":38}],9:[function(t,e,n){var r=t("__browserify_Buffer");(function(){var e,i,o,s,u;s=t("./enc");for(i in s)o=s[i],n[i]=o;u=t("./dec");for(i in u)o=u[i],n[i]=o;n.prng=t("./prng"),n.Buffer=r,n.WordArray=t("./wordarray").WordArray,n.util=t("./util"),n.ciphers={AES:t("./aes").AES,TwoFish:t("./twofish").TwoFish,Salsa20:t("./salsa20").Salsa20},n.hash={SHA1:t("./sha1").SHA1,SHA224:t("./sha224").SHA224,SHA256:t("./sha256").SHA256,SHA384:t("./sha384").SHA384,SHA512:t("./sha512").SHA512,SHA3:t("./sha3").SHA3,MD5:t("./md5").MD5,RIPEMD160:t("./ripemd160").RIPEMD160},n.modes={CTR:t("./ctr")},n.scrypt=t("./scrypt").scrypt,n.pbkdf2=t("./pbkdf2").pbkdf2,n.hmac=e=t("./hmac"),n.HMAC_SHA256=e.HMAC_SHA256,n.HMAC=e.HMAC}).call(this)},{"./aes":1,"./ctr":4,"./dec":5,"./enc":7,"./hmac":8,"./md5":10,"./pbkdf2":11,"./prng":12,"./ripemd160":13,"./salsa20":14,"./scrypt":15,"./sha1":16,"./sha224":17,"./sha256":18,"./sha3":19,"./sha384":20,"./sha512":21,"./twofish":22,"./util":23,"./wordarray":24,__browserify_Buffer:26}],10:[function(t,e,n){(function(){var e,r,i,o,s,u,a,c,l,f={}.hasOwnProperty,h=function(t,e){function n(){this.constructor=t}for(var r in e)f.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};c=t("./wordarray").WordArray,s=t("./algbase").Hasher,i=function(){function t(){var t;this.T=function(){var e,n;for(n=[],t=e=0;64>e;t=++e)n.push(4294967296*Math.abs(Math.sin(t+1))|0);return n}()}return t}(),l=new i,n.MD5=a=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return h(n,t),n.blockSize=16,n.prototype.blockSize=n.blockSize,n.output_size=16,n.prototype.output_size=n.output_size,n.prototype._doReset=function(){return this._hash=new c([1732584193,4023233417,2562383102,271733878])},n.prototype._doProcessBlock=function(t,n){var i,s,a,c,f,h,p,d,g,y,m,v,$,_,w,b,k,x,S,E,A,B,C,T,O;for(C=O=0;16>O;C=++O)T=n+C,x=t[T],t[T]=16711935&(x<<8|x>>>24)|4278255360&(x<<24|x>>>8);return i=this._hash.words,s=t[n+0],a=t[n+1],y=t[n+2],m=t[n+3],v=t[n+4],$=t[n+5],_=t[n+6],w=t[n+7],b=t[n+8],k=t[n+9],c=t[n+10],f=t[n+11],h=t[n+12],p=t[n+13],d=t[n+14],g=t[n+15],S=i[0],E=i[1],A=i[2],B=i[3],S=e(S,E,A,B,s,7,l.T[0]),B=e(B,S,E,A,a,12,l.T[1]),A=e(A,B,S,E,y,17,l.T[2]),E=e(E,A,B,S,m,22,l.T[3]),S=e(S,E,A,B,v,7,l.T[4]),B=e(B,S,E,A,$,12,l.T[5]),A=e(A,B,S,E,_,17,l.T[6]),E=e(E,A,B,S,w,22,l.T[7]),S=e(S,E,A,B,b,7,l.T[8]),B=e(B,S,E,A,k,12,l.T[9]),A=e(A,B,S,E,c,17,l.T[10]),E=e(E,A,B,S,f,22,l.T[11]),S=e(S,E,A,B,h,7,l.T[12]),B=e(B,S,E,A,p,12,l.T[13]),A=e(A,B,S,E,d,17,l.T[14]),E=e(E,A,B,S,g,22,l.T[15]),S=r(S,E,A,B,a,5,l.T[16]),B=r(B,S,E,A,_,9,l.T[17]),A=r(A,B,S,E,f,14,l.T[18]),E=r(E,A,B,S,s,20,l.T[19]),S=r(S,E,A,B,$,5,l.T[20]),B=r(B,S,E,A,c,9,l.T[21]),A=r(A,B,S,E,g,14,l.T[22]),E=r(E,A,B,S,v,20,l.T[23]),S=r(S,E,A,B,k,5,l.T[24]),B=r(B,S,E,A,d,9,l.T[25]),A=r(A,B,S,E,m,14,l.T[26]),E=r(E,A,B,S,b,20,l.T[27]),S=r(S,E,A,B,p,5,l.T[28]),B=r(B,S,E,A,y,9,l.T[29]),A=r(A,B,S,E,w,14,l.T[30]),E=r(E,A,B,S,h,20,l.T[31]),S=o(S,E,A,B,$,4,l.T[32]),B=o(B,S,E,A,b,11,l.T[33]),A=o(A,B,S,E,f,16,l.T[34]),E=o(E,A,B,S,d,23,l.T[35]),S=o(S,E,A,B,a,4,l.T[36]),B=o(B,S,E,A,v,11,l.T[37]),A=o(A,B,S,E,w,16,l.T[38]),E=o(E,A,B,S,c,23,l.T[39]),S=o(S,E,A,B,p,4,l.T[40]),B=o(B,S,E,A,s,11,l.T[41]),A=o(A,B,S,E,m,16,l.T[42]),E=o(E,A,B,S,_,23,l.T[43]),S=o(S,E,A,B,k,4,l.T[44]),B=o(B,S,E,A,h,11,l.T[45]),A=o(A,B,S,E,g,16,l.T[46]),E=o(E,A,B,S,y,23,l.T[47]),S=u(S,E,A,B,s,6,l.T[48]),B=u(B,S,E,A,w,10,l.T[49]),A=u(A,B,S,E,d,15,l.T[50]),E=u(E,A,B,S,$,21,l.T[51]),S=u(S,E,A,B,h,6,l.T[52]),B=u(B,S,E,A,m,10,l.T[53]),A=u(A,B,S,E,c,15,l.T[54]),E=u(E,A,B,S,a,21,l.T[55]),S=u(S,E,A,B,b,6,l.T[56]),B=u(B,S,E,A,g,10,l.T[57]),A=u(A,B,S,E,_,15,l.T[58]),E=u(E,A,B,S,p,21,l.T[59]),S=u(S,E,A,B,v,6,l.T[60]),B=u(B,S,E,A,f,10,l.T[61]),A=u(A,B,S,E,y,15,l.T[62]),E=u(E,A,B,S,k,21,l.T[63]),i[0]=i[0]+S|0,i[1]=i[1]+E|0,i[2]=i[2]+A|0,i[3]=i[3]+B|0},n.prototype._doFinalize=function(){var t,e,n,r,i,o,s,u,a,c,l;for(n=this._data,r=n.words,u=8*this._nDataBytes,s=8*n.sigBytes,r[s>>>5]|=128<<24-s%32,a=Math.floor(u/4294967296),c=u,r[(s+64>>>9<<4)+15]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[(s+64>>>9<<4)+14]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),n.sigBytes=4*(r.length+1),this._process(),i=this._hash,t=i.words,o=l=0;4>l;o=++l)e=t[o],t[o]=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8);return i},n.prototype.copy_to=function(t){return n.__super__.copy_to.call(this,t),t._hash=this._hash.clone()},n.prototype.clone=function(){var t;return t=new n,this.copy_to(t),t},n}(s),e=function(t,e,n,r,i,o,s){var u;return u=t+(e&n|~e&r)+i+s,(u<>>32-o)+e},r=function(t,e,n,r,i,o,s){var u;return u=t+(e&r|n&~r)+i+s,(u<>>32-o)+e},o=function(t,e,n,r,i,o,s){var u;return u=t+(e^n^r)+i+s,(u<>>32-o)+e},u=function(t,e,n,r,i,o,s){var u;return u=t+(n^(e|~r))+i+s,(u<>>32-o)+e},n.transform=function(t){var e;return e=(new a).finalize(t),t.scrub(),e}}).call(this)},{"./algbase":2,"./wordarray":24}],11:[function(t,e,n){(function(){var e,r,i,o,s,u,a,c;o=t("iced-runtime"),a=c=function(){},e=t("./hmac").HMAC,i=t("./wordarray").WordArray,u=t("./util"),r=function(){function t(t){this.klass=t.klass,this.c=t.c,this.c||(this.c=1024),this.klass||(this.klass=e)}return t.prototype._PRF=function(t){return this.prf.reset(),this.prf.finalize(t)},t.prototype._gen_T_i=function(t,e){var n,r,s,a,l,f,h,p,d,g;g=c,p=o.findDeferral(arguments),l=t.salt,r=t.i,s=t.progress_hook,s(0),f=l.clone().concat(new i([r])),n=this._PRF(f),a=n.clone(),r=1,function(t){return function(e){var i,c;i=[],(c=function(e){var l,f,g;if(l=function(){return e(i)},f=function(){return o.trampoline(function(){return c(e)})},g=function(t){return i.push(t),f()},!(rr;)n=t._PRF(n),a.xor(n,{}),r++;s(r),function(t){d=new o.Deferrals(t,{parent:p,filename:"/home/max/src/keybase/triplesec/src/pbkdf2.iced",funcname:"PBKDF2._gen_T_i"}),u.default_delay(0,0,d.defer({lineno:57})),d._fulfill()}(function(){return g(null)})})(e)}}(this)(function(t){return function(){return s(r),e(a)}}(this))},t.prototype.run=function(t,e){var n,r,s,u,a,l,f,h,p,d,g,y,m,v,$,_,w,b;$=c,m=o.findDeferral(arguments),a=t.key,p=t.salt,r=t.dkLen,h=t.progress_hook,this.prf=new this.klass(a),n=this.prf.get_output_size(),l=Math.ceil(r/n),y=[],g=null,f=function(t){return function(e){return function(n){return"function"==typeof h?h({what:"pbkdf2",total:l*t.c,i:e*t.c+n}):void 0}}}(this),f(0)(0),function(t){return function(e){var n,r;u=1,_=1,w=l,b=w>_,n=[],(r=function(e){var i,s,a;return i=function(){return e(n)},s=function(){return o.trampoline(function(){return b?u+=1:u-=1,r(e)})},a=function(t){return n.push(t),s()},b===!0&&u>l||b===!1&&l>u?i():void!function(e){v=new o.Deferrals(e,{parent:m,filename:"/home/max/src/keybase/triplesec/src/pbkdf2.iced",funcname:"PBKDF2.run"}),t._gen_T_i({salt:p,i:u,progress_hook:f(u-1)},v.defer({assign_fn:function(){return function(){return d=arguments[0]}}(),lineno:80})),v._fulfill()}(function(){return a(y.push(d.words))})})(e)}}(this)(function(t){return function(){var n;return f(l)(0),s=(n=[]).concat.apply(n,y),a.scrub(),t.prf.scrub(),t.prf=null,e(new i(s,r))}}(this))},t}(),s=function(t,e){var n,i,s,u,a,l,f,h,p,d,g;g=c,p=o.findDeferral(arguments),u=t.key,h=t.salt,a=t.klass,n=t.c,i=t.dkLen,f=t.progress_hook,s=new r({klass:a,c:n}),function(t){return function(t){d=new o.Deferrals(t,{parent:p,filename:"/home/max/src/keybase/triplesec/src/pbkdf2.iced"}),s.run({key:u,salt:h,dkLen:i,progress_hook:f},d.defer({assign_fn:function(){return function(){return l=arguments[0]}}(),lineno:106})),d._fulfill()}}(this)(function(t){return function(){return e(l)}}(this))},n.pbkdf2=s,n.PBKDF2=r}).call(this)},{"./hmac":8,"./util":23,"./wordarray":24,"iced-runtime":38}],12:[function(t,e,n){var r=t("__browserify_Buffer");(function(){var e,i,o,s,u,a,c,l,f,h,p,d,g,y,m,v,$,_,w,b;if(l=t("iced-runtime"),y=m=function(){},h=t("more-entropy"),e=t("./drbg").ADRBG,o=t("./wordarray").WordArray,s=t("./combine").XOR,g=t("./util"),v=null,u=function(t){var e;return e=new Uint8Array(t),v(e),new r(e)},v=null!=(f="undefined"!=typeof window&&null!==window&&null!=(w=window.crypto)?w.getRandomValues:void 0)?f.bind(window.crypto):null!=(f="undefined"!=typeof window&&null!==window&&null!=(b=window.msCrypto)?b.getRandomValues:void 0)?f.bind(window.msCrypto):null,null!=v)$=u;else try{d=t("crypto").rng,null!=d&&($=d)}catch(k){a=k}p=function(t){if(null==$)throw new Error('No rng found; tried requiring "crypto" and window.crypto');return $(t)},i=function(){function t(){this.meg=new h.Generator,this.adrbg=new e(function(t){return function(e,n){return t.gen_seed(e,n)}}(this),s.sign)}return t.prototype.now_to_buffer=function(){var t,e,n,i;return e=Date.now(),n=e%1e3,i=Math.floor(e/1e3),t=new r(8),t.writeUInt32BE(i,0),t.writeUInt32BE(n,4),t},t.prototype.gen_seed=function(t,e){var n,i,s,u,a,c,f,h,d;d=m,f=l.findDeferral(arguments),u=t/8,i=[],i.push(this.now_to_buffer()),function(e){return function(n){h=new l.Deferrals(n,{parent:f,filename:"/Users/chris/git/keybase/triplesec/src/prng.iced",funcname:"PRNG.gen_seed"}),e.meg.generate(t,h.defer({assign_fn:function(){return function(){return c=arguments[0]}}(),lineno:83})),h._fulfill()}}(this)(function(t){return function(){var l,f;for(i.push(t.now_to_buffer()),i.push(new r(c)),i.push(p(u)),i.push(t.now_to_buffer()),s=r.concat(i),a=o.from_buffer(s),g.scrub_buffer(s),l=0,f=i.length;f>l;l++)n=i[l],g.scrub_buffer(n);return e(a)}}(this))},t.prototype.generate=function(t,e){return this.adrbg.generate(t,e)},t}(),_=null,c=function(t,e){return null==_&&(_=new i),_.generate(t,e)},n.PRNG=i,n.generate=c,n.native_rng=p}).call(this)},{"./combine":3,"./drbg":6,"./util":23,"./wordarray":24,__browserify_Buffer:26,"iced-runtime":38,"more-entropy":41}],13:[function(t,e,n){(function(){var e,r,i,o,s,u,a,c,l,f,h,p,d,g,y,m={}.hasOwnProperty,v=function(t,e){function n(){this.constructor=t}for(var r in e)m.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};y=t("./wordarray"),s=y.WordArray,u=y.X64Word,a=y.X64WordArray,i=t("./algbase").Hasher,r=function(){function t(){this._zl=new s([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]),this._zr=new s([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]),this._sl=new s([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]),this._sr=new s([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]),this._hl=new s([0,1518500249,1859775393,2400959708,2840853838]),this._hr=new s([1352829926,1548603684,1836072691,2053994217,0])}return t}(),e=new r,o=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return v(n,t),n.blockSize=16,n.prototype.blockSize=n.blockSize,n.output_size=20,n.prototype.output_size=n.output_size,n.prototype._doReset=function(){return this._hash=new s([1732584193,4023233417,2562383102,271733878,3285377520])},n.prototype.get_output_size=function(){return this.output_size},n.prototype._doProcessBlock=function(t,n){var r,i,o,s,u,a,g,y,m,v,$,_,w,b,k,x,S,E,A,B,C,T,O;for(k=T=0;16>T;k=++T)x=n+k,i=t[x],t[x]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);for(r=this._hash.words,w=e._hl.words,b=e._hr.words,B=e._zl.words,C=e._zr.words,S=e._sl.words,E=e._sr.words,s=o=r[0],a=u=r[1],y=g=r[2],v=m=r[3],_=$=r[4],k=O=0;80>O;k=++O)A=o+t[n+B[k]]|0,A+=16>k?c(u,g,m)+w[0]:32>k?l(u,g,m)+w[1]:48>k?f(u,g,m)+w[2]:64>k?h(u,g,m)+w[3]:p(u,g,m)+w[4],A=0|A,A=d(A,S[k]),A=A+$|0,o=$,$=m,m=d(g,10),g=u,u=A,A=s+t[n+C[k]]|0,A+=16>k?p(a,y,v)+b[0]:32>k?h(a,y,v)+b[1]:48>k?f(a,y,v)+b[2]:64>k?l(a,y,v)+b[3]:c(a,y,v)+b[4],A=0|A,A=d(A,E[k]),A=A+_|0,s=_,_=v,v=d(y,10),y=a,a=A;return A=r[1]+g+v|0,r[1]=r[2]+m+_|0,r[2]=r[3]+$+s|0,r[3]=r[4]+o+a|0,r[4]=r[0]+u+y|0,r[0]=A},n.prototype._doFinalize=function(){var t,e,n,r,i,o,s,u,a;for(n=this._data,r=n.words,u=8*this._nDataBytes,s=8*n.sigBytes,r[s>>>5]|=128<<24-s%32,r[(s+64>>>9<<4)+14]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8),n.sigBytes=4*(r.length+1),this._process(),i=this._hash,t=i.words,o=a=0;5>a;o=++a)e=t[o],t[o]=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8);return i},n.prototype.scrub=function(){return this._hash.scrub()},n.prototype.copy_to=function(t){return n.__super__.copy_to.call(this,t),t._hash=this._hash.clone()},n.prototype.clone=function(){var t;return t=new n,this.copy_to(t),t},n}(i),c=function(t,e,n){return t^e^n},l=function(t,e,n){return t&e|~t&n},f=function(t,e,n){return(t|~e)^n},h=function(t,e,n){return t&n|e&~n},p=function(t,e,n){return t^(e|~n)},d=function(t,e){return t<>>32-e},g=function(t){var e;return e=(new o).finalize(t),t.scrub(),e},n.RIPEMD160=o,n.transform=g}).call(this)},{"./algbase":2,"./wordarray":24}],14:[function(t,e,n){var r=t("__browserify_Buffer");(function(){var e,i,o,s,u,a,c,l,f,h,p,d,g,y,m,v,$,_,w={}.hasOwnProperty,b=function(t,e){function n(){this.constructor=t}for(var r in e)w.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};y=t("iced-runtime"),v=$=function(){},_=t("./wordarray"),d=_.endian_reverse,l=_.WordArray,i=t("./ctr").Counter,g=t("./util").fixup_uint32,c=t("./algbase").StreamCipher,m=t("./util"),f=function(t,e){var n,r,i,o;for(r=i=0,o=e.length;o>i;r=++i)n=e[r],t[r]+=n;return!1},u=function(){function t(t){this.rounds=t}return t.prototype._core=function(t){"use asm";var e,n,r,i,o,s,u,a,c,l,f,h,p,d,g,y,m,v,$,_;for(r=t[0],i=t[1],f=t[2],h=t[3],p=t[4],d=t[5],g=t[6],y=t[7],m=t[8],v=t[9],o=t[10],s=t[11],u=t[12],a=t[13],c=t[14],l=t[15],e=$=0,_=this.rounds;$<_;e=$+=2)n=r+u|0,p^=n<<7|n>>>25,n=p+r|0,m^=n<<9|n>>>23,n=m+p|0,u^=n<<13|n>>>19,n=u+m|0,r^=n<<18|n>>>14,n=d+i|0,v^=n<<7|n>>>25,n=v+d|0,a^=n<<9|n>>>23,n=a+v|0,i^=n<<13|n>>>19,n=i+a|0,d^=n<<18|n>>>14,n=o+g|0,c^=n<<7|n>>>25,n=c+o|0,f^=n<<9|n>>>23,n=f+c|0,g^=n<<13|n>>>19,n=g+f|0,o^=n<<18|n>>>14,n=l+s|0,h^=n<<7|n>>>25,n=h+l|0,y^=n<<9|n>>>23,n=y+h|0,s^=n<<13|n>>>19,n=s+y|0,l^=n<<18|n>>>14,n=r+h|0,i^=n<<7|n>>>25,n=i+r|0,f^=n<<9|n>>>23,n=f+i|0,h^=n<<13|n>>>19,n=h+f|0,r^=n<<18|n>>>14,n=d+p|0,g^=n<<7|n>>>25,n=g+d|0,y^=n<<9|n>>>23,n=y+g|0,p^=n<<13|n>>>19,n=p+y|0,d^=n<<18|n>>>14,n=o+v|0,s^=n<<7|n>>>25,n=s+o|0,m^=n<<9|n>>>23,n=m+s|0,v^=n<<13|n>>>19,n=v+m|0,o^=n<<18|n>>>14,n=l+c|0,u^=n<<7|n>>>25,n=u+l|0,a^=n<<9|n>>>23,n=a+u|0,c^=n<<13|n>>>19,n=c+a|0,l^=n<<18|n>>>14;return[r,i,f,h,p,d,g,y,m,v,o,s,u,a,c,l]},t}(),s=function(t){function e(t,n){var r;if(e.__super__.constructor.call(this,20),this.key=t.clone().endian_reverse(),this.nonce=n.clone().endian_reverse(),(16!==this.key.sigBytes||8!==this.nonce.sigBytes)&&(32!==this.key.sigBytes||8!==(r=this.nonce.sigBytes)&&24!==r))throw new Error("Bad key/nonce lengths");24===this.nonce.sigBytes&&this.xsalsa_setup(),this.input=this.key_iv_setup(this.nonce,this.key),this._reset()}return b(e,t),e.prototype.sigma=l.from_buffer_le(new r("expand 32-byte k")),e.prototype.tau=l.from_buffer_le(new r("expand 16-byte k")),e.blockSize=64,e.prototype.blockSize=e.blockSize,e.keySize=32,e.prototype.keySize=e.keySize,e.ivSize=24,e.prototype.ivSize=e.ivSize,e.prototype.scrub=function(){return this.key.scrub(),this.nonce.scrub(),m.scrub_vec(this.input)},e.prototype.xsalsa_setup=function(){var t,e;return t=new l(this.nonce.words.slice(0,4)),this.nonce=e=new l(this.nonce.words.slice(4)),this.key=this.hsalsa20(t,this.key)},e.prototype.hsalsa20=function(t,e){var n,r,i,o;return i=this.key_iv_setup(t,e),i[8]=t.words[2],i[9]=t.words[3],o=this._core(i),r=[0,5,10,15,6,7,8,9],o=function(){var t,e,i;for(i=[],t=0,e=r.length;e>t;t++)n=r[t],i.push(g(o[n]));return i}(),m.scrub_vec(i),new l(o)},e.prototype.key_iv_setup=function(t,e){var n,r,i,o,s,u,a,c;for(o=[],i=s=0;4>s;i=++s)o[i+1]=e.words[i];for(c=32===e.sigBytes?[this.sigma,e.words.slice(4)]:[this.tau,e.words],r=c[0],n=c[1],i=u=0;4>u;i=++u)o[i+11]=n[i];for(i=a=0;4>a;i=++a)o[5*i]=r.words[i];return o[6]=t.words[0],o[7]=t.words[1],o},e.prototype.counter_setup=function(){return this.input[8]=this.counter.get().words[0],this.input[9]=this.counter.get().words[1]},e.prototype._reset=function(){return this.counter=new i({len:2})},e.prototype._generateBlock=function(){var t;return this.counter_setup(),t=this._core(this.input),f(t,this.input),this.counter.inc_le(),t},e}(u),n.Salsa20WordStream=a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return b(e,t),e.prototype._reset=function(){return e.__super__._reset.call(this)},e.prototype.getWordArray=function(t){var e,n,r,i,o,s,u,a;for(null==t||t===this.blockSize?o=this._generateBlock():(r=Math.ceil(t/this.blockSize),e=function(){var t,e;for(e=[],n=t=0;r>=0?r>t:t>r;n=r>=0?++t:--t)e.push(this._generateBlock());return e}.call(this),o=(a=[]).concat.apply(a,e)),n=s=0,u=o.length;u>s;n=++s)i=o[n],o[n]=d(i);return new l(o,t)},e}(s),n.Salsa20=o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return b(e,t),e.prototype._reset=function(){return e.__super__._reset.call(this),this._i=this.blockSize},e.prototype.getBytes=function(t){var e,n,i;if(null==t&&(t=this.blockSize),i=[],e=this.blockSize,this._i===e&&t===e)return this._generateBlockBuffer();for(;t>0;)this._i===e&&(this._generateBlockBuffer(),this._i=0),n=Math.min(t,e-this._i),i.push(n===e?this._buf:this._buf.slice(this._i,this._i+n)),this._i+=n,t-=n;return r.concat(i)},e.prototype._generateBlockBuffer=function(){var t,e,n,i,o;for(this._buf=new r(this.blockSize),n=this._generateBlock(),e=i=0,o=n.length;o>i;e=++i)t=n[e],this._buf.writeUInt32LE(g(t),4*e);return this._buf},e}(s),n.Cipher=e=function(t){function e(t){var n,r;r=t.key,n=t.iv,e.__super__.constructor.call(this),this.salsa=new a(r,n),this.bsiw=this.salsa.blockSize/4}return b(e,t),e.prototype.scrub=function(){return this.salsa.scrub()},e.prototype.get_pad=function(){var t;return t=this.salsa.getWordArray()},e}(c),n.encrypt=p=function(t){var n,r,i,o,s;return o=t.key,i=t.iv,r=t.input,n=new e({key:o,iv:i}),s=n.encrypt(r),n.scrub(),s},n.bulk_encrypt=h=function(t,n){var r,i,o,s,u,a,c,l,f;f=$,c=y.findDeferral(arguments),s=t.key,o=t.iv,i=t.input,u=t.progress_hook,r=new e({key:s,iv:o}),function(t){return function(t){l=new y.Deferrals(t,{parent:c,filename:"/home/max/src/keybase/triplesec/src/salsa20.iced"}),r.bulk_encrypt({input:i,progress_hook:u,what:"salsa20"},l.defer({assign_fn:function(){return function(){return a=arguments[0]}}(),lineno:257})),l._fulfill()}}(this)(function(t){return function(){return r.scrub(),n(a)}}(this))},n.Salsa20InnerCore=u,n.endian_reverse=d,n.asum=f}).call(this)},{"./algbase":2,"./ctr":4,"./util":23,"./wordarray":24,__browserify_Buffer:26,"iced-runtime":38}],15:[function(t,e,n){(function(){var e,r,i,o,s,u,a,c,l,f,h,p,d,g,y,m,v,$,_,w,b,k;h=t("iced-runtime"),$=_=function(){},e=t("./hmac").HMAC_SHA256,p=t("./pbkdf2").pbkdf2,w=t("./salsa20"),l=w.endian_reverse,r=w.Salsa20InnerCore,b=t("./wordarray"),m=b.ui8a_to_buffer,s=b.WordArray,k=t("./util"),f=k.fixup_uint32,c=k.default_delay,d=k.scrub_vec,o=function(){function t(){this.tot=0}return t.prototype.start=function(){return this._t=Date.now()},t.prototype.stop=function(){return this.tot+=Date.now()-this._t},t}(),y=new o,u=function(t,e,n,r,i){"use asm";var o,s,u;for(u=n<<4|0,s=r<<4|0,o=s+(i<<4)|0;sr;n=++r)e=t[n],t[n]=l(e);return!0},i=function(){function t(t){var n,i,o,s;n=t.N,this.r=t.r,this.p=t.p,i=t.c,o=t.c0,s=t.c1,this.klass=t.klass,this.N||(this.N=1<<(n||15)),this.r||(this.r=8),this.p||(this.p=1),this.c0=o||i||1,this.c1=s||i||1,this.klass||(this.klass=e),this.X16_tmp=new Int32Array(16),this.s20ic=new r(8)}return t.prototype.salsa20_8=function(t){var e,n,r,i,o;for(e=this.s20ic._core(t),n=i=0,o=e.length;o>i;n=++i)r=e[n],t[n]+=r;return!0},t.prototype.pbkdf2=function(t,e){var n,r,i,o,s,u,a,c,l;l=_,a=h.findDeferral(arguments),i=t.key,s=t.salt,r=t.dkLen,o=t.progress_hook,n=t.c,function(t){return function(e){c=new h.Deferrals(e,{parent:a,filename:"/home/max/src/keybase/triplesec/src/scrypt.iced",funcname:"Scrypt.pbkdf2"}),p({key:i,salt:s,c:n,dkLen:r,klass:t.klass,progress_hook:o},c.defer({assign_fn:function(){return function(){return u=arguments[0]}}(),lineno:113})),c._fulfill()}}(this)(function(t){return function(){return e(u)}}(this))},t.prototype.blockmix_salsa8=function(t,e){var n,r,i,o;for(n=this.X16_tmp,u(n,t,0,2*this.r-1,1),r=i=0,o=2*this.r;o>=0?o>i:i>o;r=o>=0?++i:--i)a(n,t,r,1),this.salsa20_8(n),u(e,n,r,0,1);for(r=0;rl;)u(r,i,d*l,0,d),t.blockmix_salsa8(i,s),l++;"function"==typeof g&&g(l),function(t){v=new h.Deferrals(t,{parent:m,filename:"/home/max/src/keybase/triplesec/src/scrypt.iced",funcname:"Scrypt.smix"}),c(0,0,v.defer({lineno:170})),v._fulfill()}(p)})(e)}}(this)(function(t){return function(){l=0,function(e){var n,o;n=[],(o=function(e){var u,$,_;if(u=function(){return e(n)},$=function(){return h.trampoline(function(){return o(e)})},_=function(t){return n.push(t),$()},!(ll;)p=f(i[16*(d-1)])&t.N-1,a(i,r,p*d,d),t.blockmix_salsa8(i,s),l++;"function"==typeof g&&g(l+t.N),function(t){v=new h.Deferrals(t,{parent:m,filename:"/home/max/src/keybase/triplesec/src/scrypt.iced",funcname:"Scrypt.smix"}),c(0,0,v.defer({lineno:187})),v._fulfill()}(_)})(e)}(function(){return u(n,i,0,0,d),e()})}}(this))},t.prototype.run=function(t,e){var n,r,i,o,u,a,c,l,f,p,g,y,m,$,w,b,k,x,S;b=_,$=h.findDeferral(arguments),l=t.key,m=t.salt,u=t.dkLen,g=t.progress_hook,r=4294967295,a=y=null,a=u>r?a=new Error("asked for too much data"):this.r*this.p>=1<<30?new Error("r & p are too big"):this.r>r/128/this.p||this.r>r/256||this.N>r/128/this.r?new Error("N is too big"):null,o=new Int32Array(64*this.r),i=new Int32Array(32*this.r*this.N),f=function(t){return t.what+=" (pass 1)","function"==typeof g?g(t):void 0},function(t){return function(e){w=new h.Deferrals(e,{parent:$,filename:"/home/max/src/keybase/triplesec/src/scrypt.iced",funcname:"Scrypt.run"}),t.pbkdf2({key:l.clone(),salt:m,dkLen:128*t.r*t.p,c:t.c0,progress_hook:f},w.defer({assign_fn:function(){return function(){return n=arguments[0]}}(),lineno:218})),w._fulfill()}}(this)(function(t){return function(){n=new Int32Array(n.words),v(n),f=function(e){return function(n){return"function"==typeof g?g({i:n+e*t.N*2,what:"scrypt",total:t.p*t.N*2}):void 0}},function(e){var r,s;c=0,k=0,x=t.p,S=x>k,r=[],(s=function(e){var u,a,l;return u=function(){return e(r)},a=function(){return h.trampoline(function(){return S?c+=1:c-=1,s(e)})},l=function(t){return r.push(t),a()},S===!0&&c>=t.p||S===!1&&c<=t.p?u():void!function(e){w=new h.Deferrals(e,{parent:$,filename:"/home/max/src/keybase/triplesec/src/scrypt.iced",funcname:"Scrypt.run"}),t.smix({B:n.subarray(32*t.r*c),V:i,XY:o,progress_hook:f(c)},w.defer({lineno:225})),w._fulfill()}(l)})(e)}(function(){v(n),f=function(t){return t.what+=" (pass 2)","function"==typeof g?g(t):void 0},function(e){w=new h.Deferrals(e,{parent:$,filename:"/home/max/src/keybase/triplesec/src/scrypt.iced",funcname:"Scrypt.run"}),t.pbkdf2({key:l,salt:s.from_i32a(n),dkLen:u,c:t.c1,progress_hook:f},w.defer({assign_fn:function(){return function(){return p=arguments[0]}}(),lineno:233})),w._fulfill()}(function(){return d(o),d(i),d(n),l.scrub(),e(p)})})}}(this))},t}(),g=function(t,e){var n,r,o,s,u,a,c,l,f,p,d,g,y,m,v,$;$=_,m=h.findDeferral(arguments),c=t.key,g=t.salt,d=t.r,n=t.N,f=t.p,o=t.c0,s=t.c1,r=t.c,l=t.klass,p=t.progress_hook,u=t.dkLen,a=new i({r:d,N:n,p:f,c:r,c0:o,c1:s,klass:l}),function(t){return function(t){v=new h.Deferrals(t,{parent:m,filename:"/home/max/src/keybase/triplesec/src/scrypt.iced"}),a.run({key:c,salt:g,progress_hook:p,dkLen:u},v.defer({assign_fn:function(){return function(){return y=arguments[0]}}(),lineno:263})),v._fulfill()}}(this)(function(t){return function(){return e(y)}}(this))},n.Scrypt=i,n.scrypt=g,n.v_endian_reverse=v}).call(this)},{"./hmac":8,"./pbkdf2":11,"./salsa20":14,"./util":23,"./wordarray":24,"iced-runtime":38}],16:[function(t,e,n){(function(){var e,r,i,o,s,u={}.hasOwnProperty,a=function(t,e){function n(){this.constructor=t}for(var r in e)u.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};o=t("./wordarray").WordArray,e=t("./algbase").Hasher,i=[],r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.blockSize=16,e.prototype.blockSize=e.blockSize,e.output_size=20,e.prototype.output_size=e.output_size,e.prototype._doReset=function(){return this._hash=new o([1732584193,4023233417,2562383102,271733878,3285377520])},e.prototype._doProcessBlock=function(t,e){var n,r,o,s,u,a,c,l,f,h;for(n=this._hash.words,r=n[0],o=n[1],s=n[2],u=n[3],a=n[4],c=h=0;80>h;c=++h)16>c?i[c]=0|t[e+c]:(l=i[c-3]^i[c-8]^i[c-14]^i[c-16],i[c]=l<<1|l>>>31),f=(r<<5|r>>>27)+a+i[c],f+=20>c?(o&s|~o&u)+1518500249:40>c?(o^s^u)+1859775393:60>c?(o&s|o&u|s&u)-1894007588:(o^s^u)-899497514,a=u,u=s,s=o<<30|o>>>2,o=r,r=f;return n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+s|0,n[3]=n[3]+u|0,n[4]=n[4]+a|0},e.prototype._doFinalize=function(){var t,e,n,r;return t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes,e[n>>>5]|=128<<24-n%32,e[(n+64>>>9<<4)+14]=Math.floor(r/4294967296),e[(n+64>>>9<<4)+15]=r,t.sigBytes=4*e.length,this._process(),this._hash},e.prototype.copy_to=function(t){return e.__super__.copy_to.call(this,t),t._hash=this._hash.clone()},e.prototype.clone=function(){var t;return t=new e,this.copy_to(t),t},e}(e),s=s=function(t){var e;return e=(new r).finalize(t),t.scrub(),e},n.SHA1=r,n.transform=s}).call(this)},{"./algbase":2,"./wordarray":24}],17:[function(t,e,n){(function(){var e,r,i,o,s={}.hasOwnProperty,u=function(t,e){function n(){this.constructor=t}for(var r in e)s.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};i=t("./wordarray").WordArray,r=t("./sha256").SHA256,e=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.output_size=28,e.prototype.output_size=e.output_size,e.prototype._doReset=function(){return this._hash=new i([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},e.prototype._doFinalize=function(){var t;return t=e.__super__._doFinalize.call(this),t.sigBytes-=4,t},e.prototype.clone=function(){var t;return t=new e,this.copy_to(t),t},e}(r),o=function(t){var n;return n=(new e).finalize(t),t.scrub(),n},n.SHA224=e,n.transform=o}).call(this)},{"./sha256":18,"./wordarray":24}],18:[function(t,e,n){(function(){var e,r,i,o,s,u,a={}.hasOwnProperty,c=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};o=t("./wordarray").WordArray,r=t("./algbase").Hasher,e=function(){function t(){this.H=[],this.K=[],this.W=[],this.init()}return t.prototype.isPrime=function(t){var e,n,r;if(2===t||3===t||5===t||7===t)return!0;if(1===t||4===t||6===t||8===t||9===t)return!1;for(n=Math.ceil(Math.sqrt(t)),e=r=2;n>=2?n>=r:r>=n;e=n>=2?++r:--r)if(t%e===0)return!1;return!0},t.prototype.getFractionalBits=function(t){return 4294967296*(t-(0|t))|0},t.prototype.init=function(){var t,e,n;for(t=2,e=0,n=[];64>e;)this.isPrime(t)&&(8>e&&(this.H[e]=this.getFractionalBits(Math.pow(t,.5))),this.K[e]=this.getFractionalBits(Math.pow(t,1/3)),e++),n.push(t++);return n},t}(),s=new e,i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return c(e,t),e.blockSize=16,e.prototype.blockSize=e.blockSize,e.output_size=32,e.prototype.output_size=e.output_size,e.prototype._doReset=function(){return this._hash=new o(s.H.slice(0))},e.prototype.get_output_size=function(){return this.output_size},e.prototype._doProcessBlock=function(t,e){var n,r,i,o,u,a,c,l,f,h,p,d,g,y,m,v,$,_,w,b,k,x,S;for(n=this._hash.words,i=s.W,r=s.K,o=n[0],u=n[1],a=n[2],l=n[3],f=n[4],h=n[5],p=n[6],v=n[7],$=S=0;64>S;$=++S)16>$?i[$]=0|t[e+$]:(g=i[$-15],d=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,m=i[$-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10,i[$]=d+i[$-7]+y+i[$-16]),c=f&h^~f&p,_=o&u^o&a^u&a,w=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),b=(f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25),k=v+b+c+r[$]+i[$],x=w+_,v=p,p=h,h=f,f=l+k|0,l=a,a=u,u=o,o=k+x|0;return n[0]=n[0]+o|0,n[1]=n[1]+u|0,n[2]=n[2]+a|0,n[3]=n[3]+l|0,n[4]=n[4]+f|0,n[5]=n[5]+h|0,n[6]=n[6]+p|0,n[7]=n[7]+v|0},e.prototype._doFinalize=function(){var t,e,n,r;return t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes,e[n>>>5]|=128<<24-n%32,e[(n+64>>>9<<4)+14]=Math.floor(r/4294967296),e[(n+64>>>9<<4)+15]=r,t.sigBytes=4*e.length,this._process(),this._hash},e.prototype.scrub=function(){return this._hash.scrub()},e.prototype.copy_to=function(t){return e.__super__.copy_to.call(this,t),t._hash=this._hash.clone()},e.prototype.clone=function(){var t;return t=new e,this.copy_to(t),t},e}(r),u=function(t){var e;return e=(new i).finalize(t),t.scrub(),e},n.SHA256=i,n.transform=u}).call(this)},{"./algbase":2,"./wordarray":24}],19:[function(t,e,n){(function(){var e,r,i,o,s,u,a,c,l={}.hasOwnProperty,f=function(t,e){function n(){this.constructor=t}for(var r in e)l.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};c=t("./wordarray"),o=c.WordArray,s=c.X64Word,u=c.X64WordArray,r=t("./algbase").Hasher,e=function(){function t(){this.RHO_OFFSETS=[],this.PI_INDEXES=[],this.ROUND_CONSTANTS=[],this.T=[],this.compute_rho_offsets(),this.compute_pi_indexes(),this.compute_round_constants(),this.make_reusables()}return t.prototype.compute_rho_offsets=function(){var t,e,n,r,i,o,s;for(r=1,i=0,s=[],n=o=0;24>o;n=++o)this.RHO_OFFSETS[r+5*i]=(n+1)*(n+2)/2%64,t=i%5,e=(2*r+3*i)%5,r=t,s.push(i=e);return s},t.prototype.compute_pi_indexes=function(){var t,e,n,r;for(r=[],t=n=0;5>n;t=++n)r.push(function(){var n,r;for(r=[],e=n=0;5>n;e=++n)r.push(this.PI_INDEXES[t+5*e]=e+(2*t+3*e)%5*5);return r}.call(this));return r},t.prototype.compute_round_constants=function(){var t,e,n,r,i,o,u,a,c;for(t=1,c=[],n=u=0;24>u;n=++u){for(o=0,i=0,r=a=0;7>a;r=++a)1&t&&(e=(1<e?i^=1<e;t=++e)n.push(new s(0,0));return n}()},t}(),a=new e,n.SHA3=i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,t),e.outputLength=512,e.prototype.outputLength=e.outputLength,e.blockSize=(1600-2*e.outputLength)/32,e.prototype.blockSize=e.blockSize,e.output_size=e.outputLength/8,e.prototype.output_size=e.output_size,e.prototype._doReset=function(){var t;return this._state=function(){var e,n;for(n=[],t=e=0;25>e;t=++e)n.push(new s(0,0));return n}()},e.prototype._doProcessBlock=function(t,e){var n,r,i,o,s,u,c,l,f,h,p,d,g,y,m,v,$,_,w,b,k,x,S,E,A,B,C,T,O,D,M,P,I,N,z,R,U,j;for(n=a,S=this._state,w=this.blockSize/2,y=O=0;w>=0?w>O:O>w;y=w>=0?++O:--O)r=t[e+2*y],i=t[e+2*y+1],r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),i=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),m=S[y],m.high^=i,m.low^=r;for(j=[],k=D=0;24>D;k=++D){for(C=M=0;5>M;C=++M){for(B=A=0,T=P=0;5>P;T=++P)m=S[C+5*T],B^=m.high,A^=m.low;c=n.T[C],c.high=B,c.low=A}for(C=I=0;5>I;C=++I)for(g=n.T[(C+4)%5],l=n.T[(C+1)%5],p=l.high,h=l.low,B=g.high^(p<<1|h>>>31),A=g.low^(h<<1|p>>>31),T=N=0;5>N;T=++N)m=S[C+5*T],m.high^=B,m.low^=A;for(v=z=1;25>z;v=++z)m=S[v],_=m.high,$=m.low,b=n.RHO_OFFSETS[v],32>b?(B=_<>>32-b,A=$<>>32-b):(B=$<>>64-b,A=_<>>64-b),u=n.T[n.PI_INDEXES[v]],u.high=B,u.low=A;for(o=n.T[0],E=S[0],o.high=E.high,o.low=E.low,C=R=0;5>R;C=++R)for(T=U=0;5>U;T=++U)v=C+5*T,m=S[v],s=n.T[v],f=n.T[(C+1)%5+5*T],d=n.T[(C+2)%5+5*T],m.high=s.high^~f.high&d.high,m.low=s.low^~f.low&d.low;m=S[0],x=n.ROUND_CONSTANTS[k],m.high^=x.high,j.push(m.low^=x.low)}return j},e.prototype._doFinalize=function(){var t,e,n,r,i,s,u,a,c,l,f,h,p,d;for(e=this._data,n=e.words,l=8*this._nDataBytes,c=8*e.sigBytes,t=32*this.blockSize,n[c>>>5]|=1<<24-c%32,n[(Math.ceil((c+1)/t)*t>>>5)-1]|=128,e.sigBytes=4*n.length,this._process(),p=this._state,f=this.outputLength/8,h=f/8,r=[],i=d=0;h>=0?h>d:d>h;i=h>=0?++d:--d)s=p[i],a=s.high,u=s.low,a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8),r.push(u),r.push(a);return new o(r,f)},e.prototype.copy_to=function(t){var n;return e.__super__.copy_to.call(this,t),t._state=function(){var t,e,r,i;for(r=this._state,i=[],t=0,e=r.length;e>t;t++)n=r[t],i.push(n.clone());return i}.call(this)},e.prototype.scrub=function(){},e.prototype.clone=function(){var t;return t=new e,this.copy_to(t),t},e}(r),n.transform=function(t){var e;return e=(new i).finalize(t),t.scrub(),e}}).call(this)},{"./algbase":2,"./wordarray":24}],20:[function(t,e,n){(function(){var e,r,i,o,s,u,a,c,l={}.hasOwnProperty,f=function(t,e){function n(){this.constructor=t}for(var r in e)l.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};a=t("./wordarray"),s=a.X64WordArray,o=a.WordArray,c=t("./sha512"),i=c.SHA512,e=c.Global,r=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return f(n,t),n.output_size=48,n.prototype.output_size=n.output_size,n.prototype._doReset=function(){return this._hash=new s(e.convert([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]))},n.prototype._doFinalize=function(){var t;return t=n.__super__._doFinalize.call(this),t.sigBytes-=16,t},n.prototype.clone=function(){var t;return t=new n,this.copy_to(t),t},n}(i),u=function(t){var e;return e=(new r).finalize(t),t.scrub(),e},n.SHA384=r,n.transform=u}).call(this)},{"./sha512":21,"./wordarray":24}],21:[function(t,e,n){(function(){var e,r,i,o,s,u,a,c={}.hasOwnProperty,l=function(t,e){function n(){this.constructor=t}for(var r in e)c.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};a=t("./wordarray"),o=a.X64Word,s=a.X64WordArray,r=t("./algbase").Hasher,e=function(){function t(){var t;this.K=this.convert([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]),this.I=new s(this.convert([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])),this.W=function(){var e,n;for(n=[],t=e=0;80>e;t=++e)n.push(new o(0,0));return n}()}return t.convert=function(t){var e,n,r,i;for(i=[],e=n=0,r=t.length;r>n;e=n+=2)i.push(new o(t[e],t[e+1]));return i},t.prototype.convert=function(e){return t.convert(e)},t}(),n.Global=e,u=new e,n.SHA512=i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.blockSize=32,e.prototype.blockSize=e.blockSize,e.output_size=64,e.prototype.output_size=e.output_size,e.prototype._doReset=function(){return this._hash=u.I.clone()},e.prototype._doProcessBlock=function(t,e){var n,r,i,o,s,a,c,l,f,h,p,d,g,y,m,v,$,_,w,b,k,x,S,E,A,B,C,T,O,D,M,P,I,N,z,R,U,j,V,F,L,H,q,W,K,G,X,Y,J,Z,Q,tt,et,nt,rt,it,ot,st,ut,at,ct,lt,ft,ht,pt,dt,gt,yt,mt,vt,$t,_t,wt,bt,kt,xt,St,Et;for(n=this._hash.words,O=u.W,r=n[0],s=n[1],l=n[2],p=n[3],y=n[4],$=n[5],b=n[6],S=n[7],i=r.high,o=r.low,a=s.high,c=s.low,f=l.high,h=l.low,d=p.high,g=p.low,m=y.high,v=y.low,_=$.high,w=$.low,k=b.high,x=b.low,E=S.high,A=S.low,V=i,F=o,L=a,H=c,q=f,G=h,X=d,Y=g,J=m,Z=v,Q=_,tt=w,ft=k,ht=x,pt=E,dt=A,gt=Et=0;80>Et;gt=++Et)D=O[gt],16>gt?(U=D.high=0|t[e+2*gt],j=D.low=0|t[e+2*gt+1]):(rt=O[gt-15],it=rt.high,ot=rt.low,et=(it>>>1|ot<<31)^(it>>>8|ot<<24)^it>>>7,nt=(ot>>>1|it<<31)^(ot>>>8|it<<24)^(ot>>>7|it<<25),at=O[gt-2],ct=at.high,lt=at.low,st=(ct>>>19|lt<<13)^(ct<<3|lt>>>29)^ct>>>6,ut=(lt>>>19|ct<<13)^(lt<<3|ct>>>29)^(lt>>>6|ct<<26),N=O[gt-7],z=N.high,R=N.low,M=O[gt-16],P=M.high,I=M.low,j=nt+R,U=et+z+(nt>>>0>j>>>0?1:0),j+=ut,U=U+st+(ut>>>0>j>>>0?1:0),j+=I,U=U+P+(I>>>0>j>>>0?1:0),D.high=U,D.low=j),W=J&Q^~J&ft,K=Z&tt^~Z&ht,yt=V&L^V&q^L&q,mt=F&H^F&G^H&G,vt=(V>>>28|F<<4)^(V<<30|F>>>2)^(V<<25|F>>>7),$t=(F>>>28|V<<4)^(F<<30|V>>>2)^(F<<25|V>>>7),_t=(J>>>14|Z<<18)^(J>>>18|Z<<14)^(J<<23|Z>>>9),wt=(Z>>>14|J<<18)^(Z>>>18|J<<14)^(Z<<23|J>>>9),B=u.K[gt],C=B.high,T=B.low,kt=dt+wt,bt=pt+_t+(dt>>>0>kt>>>0?1:0),kt+=K,bt=bt+W+(K>>>0>kt>>>0?1:0),kt+=T,bt=bt+C+(T>>>0>kt>>>0?1:0),kt+=j,bt=bt+U+(j>>>0>kt>>>0?1:0),St=$t+mt,xt=vt+yt+($t>>>0>St>>>0?1:0),pt=ft,dt=ht,ft=Q,ht=tt,Q=J,tt=Z,Z=Y+kt|0,J=X+bt+(Y>>>0>Z>>>0?1:0)|0,X=q,Y=G,q=L,G=H,L=V,H=F,F=kt+St|0,V=bt+xt+(kt>>>0>F>>>0?1:0)|0;return o=r.low=o+F,r.high=i+V+(F>>>0>o>>>0?1:0),c=s.low=c+H,s.high=a+L+(H>>>0>c>>>0?1:0),h=l.low=h+G,l.high=f+q+(G>>>0>h>>>0?1:0),g=p.low=g+Y,p.high=d+X+(Y>>>0>g>>>0?1:0),v=y.low=v+Z,y.high=m+J+(Z>>>0>v>>>0?1:0),w=$.low=w+tt,$.high=_+Q+(tt>>>0>w>>>0?1:0),x=b.low=x+ht,b.high=k+ft+(ht>>>0>x>>>0?1:0),A=S.low=A+dt,S.high=E+pt+(dt>>>0>A>>>0?1:0)},e.prototype._doFinalize=function(){var t,e,n;return t=this._data.words,n=8*this._nDataBytes,e=8*this._data.sigBytes,t[e>>>5]|=128<<24-e%32,t[(e+128>>>10<<5)+30]=Math.floor(n/4294967296),t[(e+128>>>10<<5)+31]=n,this._data.sigBytes=4*t.length,this._process(),this._hash.toX32()},e.prototype.copy_to=function(t){return e.__super__.copy_to.call(this,t),t._hash=this._hash.clone()},e.prototype.clone=function(){var t;return t=new e,this.copy_to(t),t},e}(r),n.transform=function(t){var e;return e=(new i).finalize(t),t.scrub(),e}}).call(this)},{"./algbase":2,"./wordarray":24}],22:[function(t,e,n){(function(){var e,r,i,o,s,u={}.hasOwnProperty,a=function(t,e){function n(){this.constructor=t}for(var r in e)u.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};e=t("./algbase").BlockCipher,s=t("./util").scrub_vec,i=function(){function t(){this.P=[[169,103,179,232,4,253,163,118,154,146,128,120,228,221,209,56,13,198,53,152,24,247,236,108,67,117,55,38,250,19,148,72,242,208,139,48,132,84,223,35,25,91,61,89,243,174,162,130,99,1,131,46,217,81,155,124,166,235,165,190,22,12,227,97,192,140,58,245,115,44,37,11,187,78,137,107,83,106,180,241,225,230,189,69,226,244,182,102,204,149,3,86,212,28,30,215,251,195,142,181,233,207,191,186,234,119,57,175,51,201,98,113,129,121,9,173,36,205,249,216,229,197,185,77,68,8,134,231,161,29,170,237,6,112,178,210,65,123,160,17,49,194,39,144,32,246,96,255,150,92,177,171,158,156,82,27,95,147,10,239,145,133,73,238,45,79,143,59,71,135,109,70,214,62,105,100,42,206,203,47,252,151,5,122,172,127,213,26,75,14,167,90,40,20,63,41,136,60,76,2,184,218,176,23,85,31,138,125,87,199,141,116,183,196,159,114,126,21,34,18,88,7,153,52,110,80,222,104,101,188,219,248,200,168,43,64,220,254,50,164,202,16,33,240,211,93,15,0,111,157,54,66,74,94,193,224],[117,243,198,244,219,123,251,200,74,211,230,107,69,125,232,75,214,50,216,253,55,113,241,225,48,15,248,27,135,250,6,63,94,186,174,91,138,0,188,157,109,193,177,14,128,93,210,213,160,132,7,20,181,144,44,163,178,115,76,84,146,116,54,81,56,176,189,90,252,96,98,150,108,66,247,16,124,40,39,140,19,149,156,199,36,70,59,112,202,227,133,203,17,208,147,184,166,131,32,255,159,119,195,204,3,111,8,191,64,231,43,226,121,12,170,130,65,58,234,185,228,154,164,151,126,218,122,23,102,148,161,29,61,240,222,179,11,114,167,28,239,209,83,62,143,51,38,95,236,118,42,73,129,136,238,33,196,26,235,217,197,57,153,205,173,49,139,1,24,35,221,31,78,45,249,72,79,242,101,142,120,92,88,25,141,229,152,87,103,127,5,100,175,99,182,254,245,183,60,165,206,233,104,68,224,77,67,105,41,46,172,21,89,168,10,158,110,71,223,52,53,106,207,220,34,201,192,155,137,212,237,171,18,162,13,82,187,2,47,169,215,97,30,180,80,4,246,194,22,37,134,86,85,9,190,145]],this.P_00=1,this.P_01=0,this.P_02=0,this.P_03=1,this.P_04=1,this.P_10=0,this.P_11=0,this.P_12=1,this.P_13=1,this.P_14=0,this.P_20=1,this.P_21=1,this.P_22=0,this.P_23=0,this.P_24=0,this.P_30=0,this.P_31=1,this.P_32=1,this.P_33=0,this.P_34=1,this.GF256_FDBK=361,this.GF256_FDBK_2=this.GF256_FDBK/2,this.GF256_FDBK_4=this.GF256_FDBK/4,this.RS_GF_FDBK=333,this.SK_STEP=33686018,this.SK_BUMP=16843009,this.SK_ROTL=9}return t}(),r=new i,n.TwoFish=o=function(t){function e(t){this._key=t.clone(),this.gMDS0=[],this.gMDS1=[],this.gMDS2=[],this.gMDS3=[],this.gSubKeys=[],this.gSBox=[],this.k64Cnt=0,this._doReset()}return a(e,t),e.blockSize=16,e.prototype.blockSize=e.blockSize,e.keySize=32,e.prototype.keySize=e.keySize,e.ivSize=e.blockSize,e.prototype.ivSize=e.ivSize,e.prototype.getByte=function(t,e){return t>>>8*e&255},e.prototype.switchEndianness=function(t){return(255&t)<<24|(t>>8&255)<<16|(t>>16&255)<<8|t>>24&255},e.prototype.LFSR1=function(t){return t>>1^(0!==(1&t)?r.GF256_FDBK_2:0)},e.prototype.LFSR2=function(t){return t>>2^(0!==(2&t)?r.GF256_FDBK_2:0)^(0!==(1&t)?r.GF256_FDBK_4:0)},e.prototype.Mx_X=function(t){return t^this.LFSR2(t)},e.prototype.Mx_Y=function(t){return t^this.LFSR1(t)^this.LFSR2(t)},e.prototype.RS_rem=function(t){var e,n,i;return e=t>>>24&255,n=255&(e<<1^(0!==(128&e)?r.RS_GF_FDBK:0)),i=e>>>1^(0!==(1&e)?r.RS_GF_FDBK>>>1:0)^n,t<<8^i<<24^n<<16^i<<8^e},e.prototype.RS_MDS_Encode=function(t,e){var n,r,i,o;for(r=e,n=i=0;4>i;n=++i)r=this.RS_rem(r);for(r^=t,n=o=0;4>o;n=++o)r=this.RS_rem(r);return r},e.prototype.F32=function(t,e){var n,i,o,s,u,a,c,l,f,h;return n=this.getByte(t,0),i=this.getByte(t,1),o=this.getByte(t,2),s=this.getByte(t,3),u=e[0],a=e[1],c=e[2],l=e[3],f=3&this.k64Cnt,h=1===f?this.gMDS0[255&r.P[r.P_01][n]^this.getByte(u,0)]^this.gMDS1[255&r.P[r.P_11][i]^this.getByte(u,1)]^this.gMDS2[255&r.P[r.P_21][o]^this.getByte(u,2)]^this.gMDS3[255&r.P[r.P_31][s]^this.getByte(u,3)]:(0===f?(n=255&r.P[r.P_04][n]^this.getByte(l,0),i=255&r.P[r.P_14][i]^this.getByte(l,1),o=255&r.P[r.P_24][o]^this.getByte(l,2),s=255&r.P[r.P_34][s]^this.getByte(l,3)):void 0,0===f||3===f?(n=255&r.P[r.P_03][n]^this.getByte(c,0),i=255&r.P[r.P_13][i]^this.getByte(c,1),o=255&r.P[r.P_23][o]^this.getByte(c,2),s=255&r.P[r.P_33][s]^this.getByte(c,3)):void 0,this.gMDS0[255&r.P[r.P_01][255&r.P[r.P_02][n]^this.getByte(a,0)]^this.getByte(u,0)]^this.gMDS1[255&r.P[r.P_11][255&r.P[r.P_12][i]^this.getByte(a,1)]^this.getByte(u,1)]^this.gMDS2[255&r.P[r.P_21][255&r.P[r.P_22][o]^this.getByte(a,2)]^this.getByte(u,2)]^this.gMDS3[255&r.P[r.P_31][255&r.P[r.P_32][s]^this.getByte(a,3)]^this.getByte(u,3)])},e.prototype.Fe32_0=function(t){return this.gSBox[0+2*(255&t)]^this.gSBox[1+2*(t>>>8&255)]^this.gSBox[512+2*(t>>>16&255)]^this.gSBox[513+2*(t>>>24&255)]},e.prototype.Fe32_3=function(t){return this.gSBox[0+2*(t>>>24&255)]^this.gSBox[1+2*(255&t)]^this.gSBox[512+2*(t>>>8&255)]^this.gSBox[513+2*(t>>>16&255)]},e.prototype._doReset=function(){var t,e,n,i,o,s,u,a,c,l,f,h,p,d,g,y,m,v,$,_,w,b,k,x,S,E,A,B;if(p=[],d=[],w=[],y=[],m=[],v=[],this.k64Cnt=this._key.words.length/2,this.k64Cnt<1)throw"Key size less than 64 bits";if(this.k64Cnt>4)throw"Key size larger than 256 bits";for(u=b=0;256>b;u=++b)a=255&r.P[0][u],y[0]=a,m[0]=255&this.Mx_X(a),v[0]=255&this.Mx_Y(a),a=255&r.P[1][u],y[1]=a,m[1]=255&this.Mx_X(a),v[1]=255&this.Mx_Y(a),this.gMDS0[u]=y[r.P_00]|m[r.P_00]<<8|v[r.P_00]<<16|v[r.P_00]<<24,this.gMDS1[u]=v[r.P_10]|v[r.P_10]<<8|m[r.P_10]<<16|y[r.P_10]<<24,this.gMDS2[u]=m[r.P_20]|v[r.P_20]<<8|y[r.P_20]<<16|v[r.P_20]<<24,this.gMDS3[u]=m[r.P_30]|y[r.P_30]<<8|v[r.P_30]<<16|m[r.P_30]<<24;for(u=k=0,E=this.k64Cnt;E>=0?E>k:k>E;u=E>=0?++k:--k)$=2*u,p[u]=this.switchEndianness(this._key.words[$]),d[u]=this.switchEndianness(this._key.words[$+1]),w[this.k64Cnt-1-u]=this.RS_MDS_Encode(p[u],d[u]);for(u=x=0,A=20;A>=0?A>x:x>A;u=A>=0?++x:--x)_=u*r.SK_STEP,t=this.F32(_,p),e=this.F32(_+r.SK_BUMP,d),e=e<<8|e>>>24,t+=e,this.gSubKeys[2*u]=t,t+=e,this.gSubKeys[2*u+1]=t<>>32-r.SK_ROTL;for(c=w[0],l=w[1],f=w[2],h=w[3],this.gSBox=[],B=[],u=S=0;256>S;u=++S)n=i=o=s=u,g=3&this.k64Cnt,1===g?(this.gSBox[2*u]=this.gMDS0[255&r.P[r.P_01][n]^this.getByte(c,0)],this.gSBox[2*u+1]=this.gMDS1[255&r.P[r.P_11][i]^this.getByte(c,1)],this.gSBox[2*u+512]=this.gMDS2[255&r.P[r.P_21][o]^this.getByte(c,2)],B.push(this.gSBox[2*u+513]=this.gMDS3[255&r.P[r.P_31][s]^this.getByte(c,3)])):(0===g&&(n=255&r.P[r.P_04][n]^this.getByte(h,0),i=255&r.P[r.P_14][i]^this.getByte(h,1),o=255&r.P[r.P_24][o]^this.getByte(h,2),s=255&r.P[r.P_34][s]^this.getByte(h,3)),(0===g||3===g)&&(n=255&r.P[r.P_03][n]^this.getByte(f,0),i=255&r.P[r.P_13][i]^this.getByte(f,1),o=255&r.P[r.P_23][o]^this.getByte(f,2),s=255&r.P[r.P_33][s]^this.getByte(f,3)),this.gSBox[2*u]=this.gMDS0[255&r.P[r.P_01][255&r.P[r.P_02][n]^this.getByte(l,0)]^this.getByte(c,0)],this.gSBox[2*u+1]=this.gMDS1[255&r.P[r.P_11][255&r.P[r.P_12][i]^this.getByte(l,1)]^this.getByte(c,1)],this.gSBox[2*u+512]=this.gMDS2[255&r.P[r.P_21][255&r.P[r.P_22][o]^this.getByte(l,2)]^this.getByte(c,2)],B.push(this.gSBox[2*u+513]=this.gMDS3[255&r.P[r.P_31][255&r.P[r.P_32][s]^this.getByte(l,3)]^this.getByte(c,3)]));return B},e.prototype.scrub=function(){return s(this.gSubKeys),s(this.gSBox),this._key.scrub()},e.prototype.decryptBlock=function(t,e){var n,r,i,o,s,u,a,c,l;for(null==e&&(e=0),a=this.switchEndianness(t[e])^this.gSubKeys[4],c=this.switchEndianness(t[e+1])^this.gSubKeys[5],s=this.switchEndianness(t[e+2])^this.gSubKeys[6],u=this.switchEndianness(t[e+3])^this.gSubKeys[7],n=39,r=l=0;16>l;r=l+=2)i=this.Fe32_0(a),o=this.Fe32_3(c),u^=i+2*o+this.gSubKeys[n--],s=(s<<1|s>>>31)^i+o+this.gSubKeys[n--],u=u>>>1|u<<31,i=this.Fe32_0(s),o=this.Fe32_3(u),c^=i+2*o+this.gSubKeys[n--],a=(a<<1|a>>>31)^i+o+this.gSubKeys[n--],c=c>>>1|c<<31;return t[e]=this.switchEndianness(s^this.gSubKeys[0]),t[e+1]=this.switchEndianness(u^this.gSubKeys[1]),t[e+2]=this.switchEndianness(a^this.gSubKeys[2]),t[e+3]=this.switchEndianness(c^this.gSubKeys[3])},e.prototype.encryptBlock=function(t,e){var n,r,i,o,s,u,a,c,l;for(null==e&&(e=0),s=this.switchEndianness(t[e])^this.gSubKeys[0],u=this.switchEndianness(t[e+1])^this.gSubKeys[1],a=this.switchEndianness(t[e+2])^this.gSubKeys[2],c=this.switchEndianness(t[e+3])^this.gSubKeys[3],n=8,r=l=0;16>l;r=l+=2)i=this.Fe32_0(s),o=this.Fe32_3(u),a^=i+o+this.gSubKeys[n++],a=a>>>1|a<<31,c=(c<<1|c>>>31)^i+2*o+this.gSubKeys[n++],i=this.Fe32_0(a),o=this.Fe32_3(c),s^=i+o+this.gSubKeys[n++],s=s>>>1|s<<31,u=(u<<1|u>>>31)^i+2*o+this.gSubKeys[n++];return t[e]=this.switchEndianness(a^this.gSubKeys[4]),t[e+1]=this.switchEndianness(c^this.gSubKeys[5]),t[e+2]=this.switchEndianness(s^this.gSubKeys[6]),t[e+3]=this.switchEndianness(u^this.gSubKeys[7])},e}(e)}).call(this)},{"./algbase":2,"./util":23}],23:[function(t,e,n){(function(){var e,r,i,o,s;r=t("iced-runtime"),o=s=function(){},i=Math.pow(2,32),n.fixup_uint32=function(t){var e,n;return e=t>i||0>t?(n=Math.abs(t)%i,0>t?i-n:n):t},n.scrub_buffer=function(t){var e,n;for(n=t.length>>2,e=0;n>e;)t.writeUInt32LE(0,e),e+=4;for(;e=0?r>n:n>r;e=r>=0?++n:--n)t[e]=0;return!1},n.default_delay=e=function(t,e,n){var i,o,u;u=s,i=r.findDeferral(arguments),function(t){return function(t){"undefined"!=typeof setImmediate&&null!==setImmediate?!function(t){o=new r.Deferrals(t,{parent:i,filename:"/home/max/src/keybase/triplesec/src/util.iced"}),setImmediate(o.defer({lineno:37})),o._fulfill()}(t):!function(t){o=new r.Deferrals(t,{parent:i,filename:"/home/max/src/keybase/triplesec/src/util.iced"}),setTimeout(o.defer({lineno:39}),1),o._fulfill()}(t)}}(this)(function(t){return function(){return n()}}(this))},n.buffer_cmp_ule=function(t,e){var n,r,i,o,s,u;for(i=o=0,n=t.length,r=e.length;n>i&&0===t.readUInt8(i);)i++;for(;r>o&&0===e.readUInt8(o);)o++;if(n-i>r-o)return 1;if(r-o>n-i)return-1;for(;n>i;){if((s=t.readUInt8(i))<(u=e.readUInt8(o)))return-1;if(s>u)return 1;i++,o++}return 0},n.bulk=function(t,n,i){var o,u,a,c,l,f,h,p,d,g,y,m,v,$,_,w,b;b=s,_=r.findDeferral(arguments),v=n.update,l=n.finalize,a=n.default_n,c=i.delay,p=i.n,u=i.cb,$=i.what,g=i.progress_hook,f=0,h=0,m=Math.ceil(t/4),c||(c=e),p||(p=a),o=function(t){return"function"==typeof g?g({what:$,i:t,total:m}):void 0},o(0),function(t){return function(t){var e,n;e=[],(n=function(t){var i,s,u;return i=function(){return t(e)},s=function(){return r.trampoline(function(){return n(t)})},u=function(t){return e.push(t),s()},(h=m-f)>0?(d=Math.min(p,h),v(f,f+d),o(f),function(t){w=new r.Deferrals(t,{parent:_,filename:"/home/max/src/keybase/triplesec/src/util.iced",funcname:"bulk"}),c(f,m,w.defer({lineno:97})),w._fulfill()}(function(){return u(f+=d)}),void 0):i()})(t)}}(this)(function(t){return function(){return o(m),y=l(),u(y)}}(this))}}).call(this)},{"iced-runtime":38}],24:[function(t,e,n){var r=t("__browserify_Buffer");(function(){var e,i,o,s,u,a,c;c=t("./util"),s=function(t){var e,n,r,i;for(n=new Uint8Array(t.length),e=r=0,i=t.length;i>=0?i>r:r>i;e=i>=0?++r:--r)n[e]=t.readUInt8(e);return n},a=function(t){var e,n,i,o;for(n=new r(t.length),e=i=0,o=t.length;o>=0?o>i:i>o;e=o>=0?++i:--i)n.writeUInt8(t[e],e);return n},u=function(t){return t>>>24&255|(t>>>16&255)<<8|(t>>>8&255)<<16|(255&t)<<24},n.WordArray=e=function(){function t(t,e){this.words=t||[],this.sigBytes=null!=e?e:4*this.words.length}return t.prototype.concat=function(t){var e,n,r,i,o;if(i=t.words,r=t.sigBytes,this.clamp(),this.sigBytes%4)for(e=o=0;r>=0?r>o:o>r;e=r>=0?++o:--o)n=i[e>>>2]>>>24-e%4*8&255,this.words[this.sigBytes+e>>>2]|=n<<24-(this.sigBytes+e)%4*8;else this.words=this.words.concat(i);return this.sigBytes+=r,this},t.prototype.clamp=function(){return this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this},t.prototype.clone=function(){return new t(this.words.slice(0),this.sigBytes)},t.prototype.to_buffer=function(){var t,e,n,i,o,s,u;for(e=new r(this.sigBytes),n=0,u=this.words,o=0,s=u.length;s>o;o++)i=u[o],this.sigBytes-n>=4&&(i=c.fixup_uint32(i),e.writeUInt32BE(i,n),n+=4);for(;n>>2]>>>24-n%4*8&255,e.writeUInt8(t,n),n++;return e},t.prototype.endian_reverse=function(){var t,e,n,r,i;for(i=this.words,t=n=0,r=i.length;r>n;t=++n)e=i[t],this.words[t]=u(e);return this},t.prototype.split=function(e){var n,r,i;if(this.sigBytes%4!==0||this.words.length%e!==0)throw new Error("bad key alignment");return i=this.words.length/e,r=function(){var e,r,o;for(o=[],n=e=0,r=this.words.length;i>0?r>e:e>r;n=e+=i)o.push(new t(this.words.slice(n,n+i)));return o}.call(this)},t.prototype.to_utf8=function(){return this.to_buffer().toString("utf8")},t.prototype.to_hex=function(){return this.to_buffer().toString("hex")},t.prototype.to_ui8a=function(){return s(this.to_buffer())},t.alloc=function(e){return r.isBuffer(e)?t.from_buffer(e):"object"==typeof e&&e instanceof t?e:"string"==typeof e?t.from_hex(e):null},t.from_buffer=function(e){var n,r,i,o;for(o=[],i=0;e.length-i>=4;)o.push(e.readUInt32BE(i)),i+=4;if(i=4;)o.push(e.readUInt32LE(i)),
+i+=4;if(ii;e=++i)r=s[e],c.fixup_uint32(r)!==c.fixup_uint32(t.words[e])&&(n=!1);return n},t.prototype.xor=function(t,e){var n,r,i,o,s,u;if(n=e.dst_offset,o=e.src_offset,i=e.n_words,n||(n=0),o||(o=0),null==i&&(i=t.words.length-o),this.words.length=0?i>u:u>i;r=i>=0?++u:--u)s=this.words[n+r]^t.words[o+r],this.words[n+r]=c.fixup_uint32(s);return this},t.prototype.truncate=function(e){var n;if(!(e<=this.sigBytes))throw new Error("Cannot truncate: "+e+" > "+this.sigBytes);return n=Math.ceil(e/4),new t(this.words.slice(0,n),e)},t.prototype.unshift=function(e){var n;return this.words.length>=e?(n=this.words.splice(0,e),this.sigBytes-=4*e,new t(n)):null},t.prototype.is_scrubbed=function(){var t,e,n,r;for(r=this.words,e=0,n=r.length;n>e;e++)if(t=r[e],0!==t)return!1;return!0},t.prototype.scrub=function(){return c.scrub_vec(this.words)},t.prototype.cmp_ule=function(t){return c.buffer_cmp_ule(this.to_buffer(),t.to_buffer())},t.prototype.slice=function(e,n){var r,i;if(r=this.words.length,!(n>e&&r>=n))throw new Error("Bad WordArray slice ["+e+","+n+")] when only "+r+" avail");return i=4*(n-e),n===r&&(i-=4*r-this.sigBytes),new t(this.words.slice(e,n),i)},t}(),n.X64Word=i=function(){function t(t,e){this.high=t,this.low=e}return t.prototype.clone=function(){return new t(this.high,this.low)},t}(),n.X64WordArray=o=function(){function t(t,e){this.sigBytes=e,this.words=t||[],this.sigBytes||(this.sigBytes=8*this.words.length)}return t.prototype.toX32=function(){var t,n,r,i,o;for(t=[],o=this.words,r=0,i=o.length;i>r;r++)n=o[r],t.push(n.high),t.push(n.low);return new e(t,this.sigBytes)},t.prototype.clone=function(){var e;return new t(function(){var t,n,r,i;for(r=this.words,i=[],t=0,n=r.length;n>t;t++)e=r[t],i.push(e.clone());return i}.call(this),this.sigBytes)},t}(),n.buffer_to_ui8a=s,n.ui8a_to_buffer=a,n.endian_reverse=u}).call(this)},{"./util":23,__browserify_Buffer:26}],25:[function(t,e,n){e.exports="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},{}],26:[function(t,e,n){t=function r(e,n,i){function o(u,a){if(!n[u]){if(!e[u]){var c="function"==typeof t&&t;if(!a&&c)return c(u,!0);if(s)return s(u,!0);throw new Error("Cannot find module '"+u+"'")}var l=n[u]={exports:{}};e[u][0].call(l.exports,function(t){var n=e[u][1][t];return o(n?n:t)},l,l.exports,r,e,n,i)}return n[u].exports}for(var s="function"==typeof t&&t,u=0;us;s++)o[s]=r.isBuffer(t)?t.readUInt8(s):t[s];else"string"===n&&o.write(t,0,e);return o}function i(t,e,n,i){n=Number(n)||0;var o=t.length-n;i?(i=Number(i),i>o&&(i=o)):i=o;var s=e.length;if(s%2!==0)throw new Error("Invalid hex string");i>s/2&&(i=s/2);for(var u=0;i>u;u++){var a=parseInt(e.substr(2*u,2),16);if(isNaN(a))throw new Error("Invalid hex string");t[n+u]=a}return r._charsWritten=2*u,u}function o(t,e,n,i){return r._charsWritten=$t(yt(e),t,n,i)}function s(t,e,n,i){return r._charsWritten=$t(mt(e),t,n,i)}function u(t,e,n,r){return s(t,e,n,r)}function a(t,e,n,i){return r._charsWritten=$t(vt(e),t,n,i)}function c(t,e,n,r){if(isFinite(e))isFinite(n)||(r=n,n=void 0);else{var c=r;r=e,e=n,n=c}e=Number(e)||0;var l=this.length-e;switch(n?(n=Number(n),n>l&&(n=l)):n=l,r=String(r||"utf8").toLowerCase()){case"hex":return i(this,t,e,n);case"utf8":case"utf-8":return o(this,t,e,n);case"ascii":return s(this,t,e,n);case"binary":return u(this,t,e,n);case"base64":return a(this,t,e,n);default:throw new Error("Unknown encoding")}}function l(t,e,n){var r=this instanceof lt?this._proxy:this;if(t=String(t||"utf8").toLowerCase(),e=Number(e)||0,n=void 0!==n?Number(n):n=r.length,n===e)return"";switch(t){case"hex":return m(r,e,n);case"utf8":case"utf-8":return d(r,e,n);case"ascii":return g(r,e,n);case"binary":return y(r,e,n);case"base64":return p(r,e,n);default:throw new Error("Unknown encoding")}}function f(){return{type:"Buffer",data:Array.prototype.slice.call(this,0)}}function h(t,e,n,r){var i=this;if(n||(n=0),r||0===r||(r=this.length),e||(e=0),r!==n&&0!==t.length&&0!==i.length){if(n>r)throw new Error("sourceEnd < sourceStart");if(0>e||e>=t.length)throw new Error("targetStart out of bounds");if(0>n||n>=i.length)throw new Error("sourceStart out of bounds");if(0>r||r>i.length)throw new Error("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-eo;o++)t[o+e]=this[o+n]}}function p(e,n,r){var i=e.slice(n,r);return t("base64-js").fromByteArray(i)}function d(t,e,n){for(var r=t.slice(e,n),i="",o="",s=0;se)&&(e=0),(!n||0>n||n>r)&&(n=r);for(var i="",o=e;n>o;o++)i+=gt(t[o]);return i}function v(t,e){var n=this.length;return t=ht(t,n,0),e=ht(e,n,n),ft(this.subarray(t,e))}function $(t,e){var n=this;return e||(xt(void 0!==t&&null!==t,"missing offset"),xt(t=n.length?void 0:n[t]}function _(t,e,n,r){r||(xt("boolean"==typeof n,"missing or invalid endian"),xt(void 0!==e&&null!==e,"missing offset"),xt(e+1=i)){if(e+1===i){var o=new Et(new At(2));return o.setUint8(0,t[i-1]),o.getUint16(0,n)}return t._dataview.getUint16(e,n)}}function w(t,e){return _(this,t,!0,e)}function b(t,e){return _(this,t,!1,e)}function k(t,e,n,r){r||(xt("boolean"==typeof n,"missing or invalid endian"),xt(void 0!==e&&null!==e,"missing offset"),xt(e+3=i)){if(e+3>=i){for(var o=new Et(new At(4)),s=0;i>s+e;s++)o.setUint8(s,t[s+e]);return o.getUint32(0,n)}return t._dataview.getUint32(e,n)}}function x(t,e){return k(this,t,!0,e)}function S(t,e){return k(this,t,!1,e)}function E(t,e){var n=this;return e||(xt(void 0!==t&&null!==t,"missing offset"),xt(t=n.length?void 0:n._dataview.getInt8(t)}function A(t,e,n,r){r||(xt("boolean"==typeof n,"missing or invalid endian"),xt(void 0!==e&&null!==e,"missing offset"),xt(e+1=i)){if(e+1===i){var o=new Et(new At(2));return o.setUint8(0,t[i-1]),o.getInt16(0,n)}return t._dataview.getInt16(e,n)}}function B(t,e){return A(this,t,!0,e)}function C(t,e){return A(this,t,!1,e)}function T(t,e,n,r){r||(xt("boolean"==typeof n,"missing or invalid endian"),xt(void 0!==e&&null!==e,"missing offset"),xt(e+3=i)){if(e+3>=i){for(var o=new Et(new At(4)),s=0;i>s+e;s++)o.setUint8(s,t[s+e]);return o.getInt32(0,n)}return t._dataview.getInt32(e,n)}}function O(t,e){return T(this,t,!0,e)}function D(t,e){return T(this,t,!1,e)}function M(t,e,n,r){return r||(xt("boolean"==typeof n,"missing or invalid endian"),xt(e+3=r.length||(r[e]=t)}function j(t,e,n,r,i){i||(xt(void 0!==e&&null!==e,"missing value"),xt("boolean"==typeof r,"missing or invalid endian"),xt(void 0!==n&&null!==n,"missing offset"),xt(n+1=o))if(n+1===o){var s=new Et(new At(2));s.setUint16(0,e,r),t[n]=s.getUint8(0)}else t._dataview.setUint16(n,e,r)}function V(t,e,n){j(this,t,e,!0,n)}function F(t,e,n){j(this,t,e,!1,n)}function L(t,e,n,r,i){i||(xt(void 0!==e&&null!==e,"missing value"),xt("boolean"==typeof r,"missing or invalid endian"),xt(void 0!==n&&null!==n,"missing offset"),xt(n+3=o))if(n+3>=o){var s=new Et(new At(4));s.setUint32(0,e,r);for(var u=0;o>u+n;u++)t[u+n]=s.getUint8(u)}else t._dataview.setUint32(n,e,r)}function H(t,e,n){L(this,t,e,!0,n)}function q(t,e,n){L(this,t,e,!1,n)}function W(t,e,n){var r=this;n||(xt(void 0!==t&&null!==t,"missing value"),xt(void 0!==e&&null!==e,"missing offset"),xt(e=r.length||r._dataview.setInt8(e,t)}function K(t,e,n,r,i){i||(xt(void 0!==e&&null!==e,"missing value"),xt("boolean"==typeof r,"missing or invalid endian"),xt(void 0!==n&&null!==n,"missing offset"),xt(n+1=o))if(n+1===o){var s=new Et(new At(2));s.setInt16(0,e,r),t[n]=s.getUint8(0)}else t._dataview.setInt16(n,e,r)}function G(t,e,n){K(this,t,e,!0,n)}function X(t,e,n){K(this,t,e,!1,n)}function Y(t,e,n,r,i){i||(xt(void 0!==e&&null!==e,"missing value"),xt("boolean"==typeof r,"missing or invalid endian"),xt(void 0!==n&&null!==n,"missing offset"),xt(n+3=o))if(n+3>=o){var s=new Et(new At(4));s.setInt32(0,e,r);for(var u=0;o>u+n;u++)t[u+n]=s.getUint8(u)}else t._dataview.setInt32(n,e,r)}function J(t,e,n){Y(this,t,e,!0,n)}function Z(t,e,n){Y(this,t,e,!1,n)}function Q(t,e,n,r,i){i||(xt(void 0!==e&&null!==e,"missing value"),xt("boolean"==typeof r,"missing or invalid endian"),xt(void 0!==n&&null!==n,"missing offset"),xt(n+3=o))if(n+3>=o){var s=new Et(new At(4));s.setFloat32(0,e,r);for(var u=0;o>u+n;u++)t[u+n]=s.getUint8(u)}else t._dataview.setFloat32(n,e,r)}function tt(t,e,n){Q(this,t,e,!0,n)}function et(t,e,n){Q(this,t,e,!1,n)}function nt(t,e,n,r,i){i||(xt(void 0!==e&&null!==e,"missing value"),xt("boolean"==typeof r,"missing or invalid endian"),xt(void 0!==n&&null!==n,"missing offset"),xt(n+7=o))if(n+7>=o){var s=new Et(new At(8));s.setFloat64(0,e,r);for(var u=0;o>u+n;u++)t[u+n]=s.getUint8(u)}else t._dataview.setFloat64(n,e,r)}function rt(t,e,n){nt(this,t,e,!0,n)}function it(t,e,n){nt(this,t,e,!1,n)}function ot(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),"string"==typeof t&&(t=t.charCodeAt(0)),"number"!=typeof t||isNaN(t))throw new Error("value is not a number");if(e>n)throw new Error("end < start");if(n!==e&&0!==this.length){if(0>e||e>=this.length)throw new Error("start out of bounds");if(0>n||n>this.length)throw new Error("end out of bounds");for(var r=e;n>r;r++)this[r]=t}}function st(){for(var t=[],e=this.length,r=0;e>r;r++)if(t[r]=gt(this[r]),r===n.INSPECT_MAX_BYTES){t[r+1]="...";break}return""}function ut(){return new r(this).buffer}function at(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function ct(){var t=new Bt(0);t.foo=function(){return 42};try{return 42===t.foo()}catch(e){return!1}}function lt(t){this._arr=t,0!==t.byteLength&&(this._dataview=new Et(t.buffer,t.byteOffset,t.byteLength))}function ft(t){if(void 0===Ct&&(Ct=ct()),Ct)return t.write=c,t.toString=l,t.toLocaleString=l,t.toJSON=f,t.copy=h,t.slice=v,t.readUInt8=$,t.readUInt16LE=w,t.readUInt16BE=b,t.readUInt32LE=x,t.readUInt32BE=S,t.readInt8=E,t.readInt16LE=B,t.readInt16BE=C,t.readInt32LE=O,t.readInt32BE=D,t.readFloatLE=P,t.readFloatBE=I,t.readDoubleLE=z,t.readDoubleBE=R,t.writeUInt8=U,t.writeUInt16LE=V,t.writeUInt16BE=F,t.writeUInt32LE=H,t.writeUInt32BE=q,t.writeInt8=W,t.writeInt16LE=G,t.writeInt16BE=X,t.writeInt32LE=J,t.writeInt32BE=Z,t.writeFloatLE=tt,t.writeFloatBE=et,t.writeDoubleLE=rt,t.writeDoubleBE=it,t.fill=ot,t.inspect=st,t.toArrayBuffer=ut,t._isBuffer=!0,0!==t.byteLength&&(t._dataview=new Et(t.buffer,t.byteOffset,t.byteLength)),t;var e=new lt(t),n=new Proxy(e,Tt);return e._proxy=n,n}function ht(t,e,n){return"number"!=typeof t?n:(t=~~t,t>=e?e:t>=0?t:(t+=e,t>=0?t:0))}function pt(t){return t=~~Math.ceil(+t),0>t?0:t}function dt(t){return Array.isArray(t)||r.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function gt(t){return 16>t?"0"+t.toString(16):t.toString(16)}function yt(t){for(var e=[],n=0;ni&&!(i+n>=e.length||i>=t.length);)e[i+n]=t[i],i++;return i}function _t(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}function wt(t,e){xt("number"==typeof t,"cannot write a non-number as a number"),xt(t>=0,"specified a negative value for writing an unsigned value"),xt(e>=t,"value is larger than maximum value for type"),xt(Math.floor(t)===t,"value has a fractional component")}function bt(t,e,n){xt("number"==typeof t,"cannot write a non-number as a number"),xt(e>=t,"value larger than maximum allowed value"),xt(t>=n,"value smaller than minimum allowed value"),xt(Math.floor(t)===t,"value has a fractional component")}function kt(t,e,n){xt("number"==typeof t,"cannot write a non-number as a number"),xt(e>=t,"value larger than maximum allowed value"),xt(t>=n,"value smaller than minimum allowed value")}function xt(t,e){if(!t)throw new Error(e||"Failed assertion")}var St=t("typedarray"),Et="undefined"==typeof DataView?St.DataView:DataView,At="undefined"==typeof ArrayBuffer?St.ArrayBuffer:ArrayBuffer,Bt="undefined"==typeof Uint8Array?St.Uint8Array:Uint8Array;n.Buffer=r,n.SlowBuffer=r,n.INSPECT_MAX_BYTES=50,r.poolSize=8192;var Ct;r.isEncoding=function(t){switch((t+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},r.isBuffer=function(t){return t&&t._isBuffer},r.byteLength=function(t,e){switch(e||"utf8"){case"hex":return t.length/2;case"utf8":case"utf-8":return yt(t).length;case"ascii":case"binary":return t.length;case"base64":return vt(t).length;default:throw new Error("Unknown encoding")}},r.concat=function(t,e){if(!Array.isArray(t))throw new Error("Usage: Buffer.concat(list, [totalLength])\nlist should be an Array.");var n,i;if(0===t.length)return new r(0);if(1===t.length)return t[0];if("number"!=typeof e)for(e=0,n=0;n0)throw"Invalid string. Length must be a multiple of 4";for(s=t.indexOf("="),s=s>0?t.length-s:0,u=[],r=s>0?t.length-4:t.length,e=0,n=0;r>e;e+=4,n+=3)o=i.indexOf(t[e])<<18|i.indexOf(t[e+1])<<12|i.indexOf(t[e+2])<<6|i.indexOf(t[e+3]),u.push((16711680&o)>>16),u.push((65280&o)>>8),u.push(255&o);return 2===s?(o=i.indexOf(t[e])<<2|i.indexOf(t[e+1])>>4,u.push(255&o)):1===s&&(o=i.indexOf(t[e])<<10|i.indexOf(t[e+1])<<4|i.indexOf(t[e+2])>>2,u.push(o>>8&255),u.push(255&o)),u}function r(t){function e(t){return i[t>>18&63]+i[t>>12&63]+i[t>>6&63]+i[63&t]}var n,r,o,s=t.length%3,u="";for(n=0,o=t.length-s;o>n;n+=3)r=(t[n]<<16)+(t[n+1]<<8)+t[n+2],u+=e(r);switch(s){case 1:r=t[t.length-1],u+=i[r>>2],u+=i[r<<4&63],u+="==";break;case 2:r=(t[t.length-2]<<8)+t[t.length-1],u+=i[r>>10],u+=i[r>>4&63],u+=i[r<<2&63],u+="="}return u}var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";e.exports.toByteArray=n,e.exports.fromByteArray=r}()},{}],4:[function(t,e,n){function r(t){if(z&&N){var e,n=z(t);for(e=0;eA)throw new RangeError("Array too large for polyfill");var n;for(n=0;n>n}function s(t,e){var n=32-e;return t<>>n}function u(t){return[255&t]}function a(t){return o(t[0],8)}function c(t){return[255&t]}function l(t){return s(t[0],8)}function f(t){return t=I(Number(t)),[0>t?0:t>255?255:255&t]}function h(t){return[t>>8&255,255&t]}function p(t){return o(t[0]<<8|t[1],16)}function d(t){return[t>>8&255,255&t]}function g(t){return s(t[0]<<8|t[1],16)}function y(t){return[t>>24&255,t>>16&255,t>>8&255,255&t]}function m(t){return o(t[0]<<24|t[1]<<16|t[2]<<8|t[3],32)}function v(t){return[t>>24&255,t>>16&255,t>>8&255,255&t]}function $(t){return s(t[0]<<24|t[1]<<16|t[2]<<8|t[3],32)}function _(t,e,n){function r(t){var e=O(t),n=t-e;return.5>n?e:n>.5?e+1:e%2?e+1:e}var i,o,s,u,a,c,l,f=(1<t?1:0):0===t?(o=0,s=0,i=1/t===-(1/0)?1:0):(i=0>t,t=T(t),t>=P(2,1-f)?(o=M(O(D(t)/C),1023),s=r(t/P(2,o)*P(2,n)),s/P(2,n)>=2&&(o+=1,s=1),o>f?(o=(1<>=1;return f.reverse(),s=f.join(""),u=(1<0?a*P(2,c-u)*(1+l/P(2,n)):0!==l?a*P(2,-(u-1))*(l/P(2,n)):0>a?-0:0}function b(t){return w(t,11,52)}function k(t){return _(t,11,52)}function x(t){return w(t,8,23)}function S(t){return _(t,8,23)}var E=void 0,A=1e5,B=function(){var t=Object.prototype.toString,e=Object.prototype.hasOwnProperty;return{Class:function(e){return t.call(e).replace(/^\[object *|\]$/g,"")},HasProperty:function(t,e){return e in t},HasOwnProperty:function(t,n){return e.call(t,n)},IsCallable:function(t){return"function"==typeof t},ToInt32:function(t){return t>>0},ToUint32:function(t){return t>>>0}}}(),C=Math.LN2,T=Math.abs,O=Math.floor,D=Math.log,M=Math.min,P=Math.pow,I=Math.round,N=Object.defineProperty||function(t,e,n){if(!t===Object(t))throw new TypeError("Object.defineProperty called on non-object");return B.HasProperty(n,"get")&&Object.prototype.__defineGetter__&&Object.prototype.__defineGetter__.call(t,e,n.get),B.HasProperty(n,"set")&&Object.prototype.__defineSetter__&&Object.prototype.__defineSetter__.call(t,e,n.set),B.HasProperty(n,"value")&&(t[e]=n.value),t},z=Object.getOwnPropertyNames||function(t){if(t!==Object(t))throw new TypeError("Object.getOwnPropertyNames called on non-object");var e,n=[];for(e in t)B.HasOwnProperty(t,e)&&n.push(e);return n};!function(){function t(t,n,s){var u;return u=function(t,n,o){var s,a,c,l;if(arguments.length&&"number"!=typeof arguments[0])if("object"==typeof arguments[0]&&arguments[0].constructor===u)for(s=arguments[0],this.length=s.length,this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new e(this.byteLength),this.byteOffset=0,c=0;cthis.buffer.byteLength)throw new RangeError("byteOffset out of range");if(this.byteOffset%this.BYTES_PER_ELEMENT)throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size.");if(arguments.length<3){if(this.byteLength=this.buffer.byteLength-this.byteOffset,this.byteLength%this.BYTES_PER_ELEMENT)throw new RangeError("length of buffer minus byteOffset not a multiple of the element size");this.length=this.byteLength/this.BYTES_PER_ELEMENT}else this.length=B.ToUint32(o),this.byteLength=this.length*this.BYTES_PER_ELEMENT;if(this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer")}else for(a=arguments[0],this.length=B.ToUint32(a.length),this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new e(this.byteLength),this.byteOffset=0,c=0;co)throw new RangeError("ArrayBufferView size is not a small enough positive integer");this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new e(this.byteLength),this.byteOffset=0}this.constructor=u,r(this),i(this)},u.prototype=new o,u.prototype.BYTES_PER_ELEMENT=t,u.prototype._pack=n,u.prototype._unpack=s,u.BYTES_PER_ELEMENT=t,u.prototype._getter=function(t){if(arguments.length<1)throw new SyntaxError("Not enough arguments");if(t=B.ToUint32(t),t>=this.length)return E;var e,n,r=[];for(e=0,n=this.byteOffset+t*this.BYTES_PER_ELEMENT;e=this.length)return E;var n,r,i=this._pack(e);for(n=0,r=this.byteOffset+t*this.BYTES_PER_ELEMENT;nthis.length)throw new RangeError("Offset plus length of array is out of range");if(c=this.byteOffset+i*this.BYTES_PER_ELEMENT,l=n.length*this.BYTES_PER_ELEMENT,n.buffer===this.buffer){for(f=[],s=0,u=n.byteOffset;l>s;s+=1,u+=1)f[s]=n.buffer._bytes[u];for(s=0,a=c;l>s;s+=1,a+=1)this.buffer._bytes[a]=f[s]}else for(s=0,u=n.byteOffset,a=c;l>s;s+=1,u+=1,a+=1)this.buffer._bytes[a]=n.buffer._bytes[u]}else{if("object"!=typeof arguments[0]||"undefined"==typeof arguments[0].length)throw new TypeError("Unexpected argument type(s)");if(r=arguments[0],o=B.ToUint32(r.length),i=B.ToUint32(arguments[1]),i+o>this.length)throw new RangeError("Offset plus length of array is out of range");for(s=0;o>s;s+=1)u=r[s],this._setter(i+s,Number(u))}},u.prototype.subarray=function(t,e){function n(t,e,n){return e>t?e:t>n?n:t}t=B.ToInt32(t),e=B.ToInt32(e),arguments.length<1&&(t=0),arguments.length<2&&(e=this.length),0>t&&(t=this.length+t),0>e&&(e=this.length+e),t=n(t,0,this.length),e=n(e,0,this.length);var r=e-t;return 0>r&&(r=0),new this.constructor(this.buffer,this.byteOffset+t*this.BYTES_PER_ELEMENT,r)},u}var e=function(t){if(t=B.ToInt32(t),0>t)throw new RangeError("ArrayBuffer size is not a small enough positive integer");this.byteLength=t,this._bytes=[],this._bytes.length=t;var e;for(e=0;ethis.byteLength)throw new RangeError("Array index out of range");n+=this.byteOffset;var i,s=new Uint8Array(this.buffer,n,e.BYTES_PER_ELEMENT),u=[];for(i=0;ithis.byteLength)throw new RangeError("Array index out of range");var s,u,a=new e([r]),c=new Uint8Array(a.buffer),l=[];for(s=0;sthis.buffer.byteLength)throw new RangeError("byteOffset out of range");if(this.byteLength=arguments.length<3?this.buffer.byteLength-this.byteOffset:B.ToUint32(n),this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");r(this)};s.prototype.getUint8=e(n.Uint8Array),s.prototype.getInt8=e(n.Int8Array),s.prototype.getUint16=e(n.Uint16Array),s.prototype.getInt16=e(n.Int16Array),s.prototype.getUint32=e(n.Uint32Array),s.prototype.getInt32=e(n.Int32Array),s.prototype.getFloat32=e(n.Float32Array),s.prototype.getFloat64=e(n.Float64Array),s.prototype.setUint8=i(n.Uint8Array),s.prototype.setInt8=i(n.Int8Array),s.prototype.setUint16=i(n.Uint16Array),s.prototype.setInt16=i(n.Int16Array),s.prototype.setUint32=i(n.Uint32Array),s.prototype.setInt32=i(n.Int32Array),s.prototype.setFloat32=i(n.Float32Array),s.prototype.setFloat64=i(n.Float64Array),n.DataView=n.DataView||s}()},{}]},{},[]),e.exports=t("native-buffer-browserify").Buffer},{}],27:[function(t,e,n){var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")}},{}],28:[function(t,e,n){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],29:[function(t,e,n){function r(t,e){var r={seen:[],stylize:o};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(e)?r.showHidden=e:e&&n._extend(r,e),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=i),u(r,t,r.depth)}function i(t,e){var n=r.styles[e];return n?"["+r.colors[n][0]+"m"+t+"["+r.colors[n][1]+"m":t}function o(t,e){return t}function s(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}function u(t,e,r){if(t.customInspect&&e&&S(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return v(i)||(i=u(t,i,r)),i}var o=a(t,e);if(o)return o;var d=Object.keys(e),g=s(d);if(t.showHidden&&(d=Object.getOwnPropertyNames(e)),x(e)&&(d.indexOf("message")>=0||d.indexOf("description")>=0))return c(e);if(0===d.length){if(S(e)){var y=e.name?": "+e.name:"";return t.stylize("[Function"+y+"]","special")}if(w(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(k(e))return t.stylize(Date.prototype.toString.call(e),"date");if(x(e))return c(e)}var m="",$=!1,_=["{","}"];if(p(e)&&($=!0,_=["[","]"]),S(e)){var b=e.name?": "+e.name:"";m=" [Function"+b+"]"}if(w(e)&&(m=" "+RegExp.prototype.toString.call(e)),k(e)&&(m=" "+Date.prototype.toUTCString.call(e)),x(e)&&(m=" "+c(e)),0===d.length&&(!$||0==e.length))return _[0]+m+_[1];if(0>r)return w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var E;return E=$?l(t,e,r,g,d):d.map(function(n){return f(t,e,r,g,n,$)}),t.seen.pop(),h(E,m,_)}function a(t,e){if(_(e))return t.stylize("undefined","undefined");if(v(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return m(e)?t.stylize(""+e,"number"):d(e)?t.stylize(""+e,"boolean"):g(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function l(t,e,n,r,i){for(var o=[],s=0,u=e.length;u>s;++s)o.push(T(e,String(s))?f(t,e,n,r,String(s),!0):"");return i.forEach(function(i){i.match(/^\d+$/)||o.push(f(t,e,n,r,i,!0))}),o}function f(t,e,n,r,i,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},c.get?a=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(a=t.stylize("[Setter]","special")),T(r,i)||(s="["+i+"]"),a||(t.seen.indexOf(c.value)<0?(a=g(n)?u(t,c.value,null):u(t,c.value,n-1),
+a.indexOf("\n")>-1&&(a=o?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n"))):a=t.stylize("[Circular]","special")),_(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function h(t,e,n){var r=0,i=t.reduce(function(t,e){return r++,e.indexOf("\n")>=0&&r++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function g(t){return null===t}function y(t){return null==t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function $(t){return"symbol"==typeof t}function _(t){return void 0===t}function w(t){return b(t)&&"[object RegExp]"===A(t)}function b(t){return"object"==typeof t&&null!==t}function k(t){return b(t)&&"[object Date]"===A(t)}function x(t){return b(t)&&("[object Error]"===A(t)||t instanceof Error)}function S(t){return"function"==typeof t}function E(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function A(t){return Object.prototype.toString.call(t)}function B(t){return 10>t?"0"+t.toString(10):t.toString(10)}function C(){var t=new Date,e=[B(t.getHours()),B(t.getMinutes()),B(t.getSeconds())].join(":");return[t.getDate(),N[t.getMonth()],e].join(" ")}function T(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var O=t("__browserify_process"),D="undefined"!=typeof self?self:"undefined"!=typeof window?window:{},M=/%[sdj%]/g;n.format=function(t){if(!v(t)){for(var e=[],n=0;n=o)return t;switch(t){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(e){return"[Circular]"}default:return t}}),u=i[n];o>n;u=i[++n])s+=g(u)||!b(u)?" "+u:" "+r(u);return s},n.deprecate=function(t,e){function r(){if(!i){if(O.throwDeprecation)throw new Error(e);O.traceDeprecation?console.trace(e):console.error(e),i=!0}return t.apply(this,arguments)}if(_(D.process))return function(){return n.deprecate(t,e).apply(this,arguments)};if(O.noDeprecation===!0)return t;var i=!1;return r};var P,I={};n.debuglog=function(t){if(_(P)&&(P=O.env.NODE_DEBUG||""),t=t.toUpperCase(),!I[t])if(new RegExp("\\b"+t+"\\b","i").test(P)){var e=O.pid;I[t]=function(){var r=n.format.apply(n,arguments);console.error("%s %d: %s",t,e,r)}}else I[t]=function(){};return I[t]},n.inspect=r,r.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=p,n.isBoolean=d,n.isNull=g,n.isNullOrUndefined=y,n.isNumber=m,n.isString=v,n.isSymbol=$,n.isUndefined=_,n.isRegExp=w,n.isObject=b,n.isDate=k,n.isError=x,n.isFunction=S,n.isPrimitive=E,n.isBuffer=t("./support/isBuffer");var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",C(),n.format.apply(n,arguments))},n.inherits=t("inherits"),n._extend=function(t,e){if(!e||!b(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}},{"./support/isBuffer":28,__browserify_process:27,inherits:25}],30:[function(t,e,n){(function(){var e,r,i,o,s,u,a,c,l,f,h,p=[].slice;h=t("util"),n.BaseError=e=function(t,e){return Error.captureStackTrace(this,this.constructor),this.message=t||"Error"},h.inherits(e,Error),e.prototype.name="BaseError",f=function(t){return t[0].toUpperCase()+t.slice(1).toLowerCase()},s=function(t){var e;return function(){var n,r,i,o;for(i=t.split(/_/),o=[],n=0,r=i.length;r>n;n++)e=i[n],o.push(f(e));return o}().join("")},a=function(t,n,r){var i;return i=function(t){return e.call(this,t||r,this.constructor),this.istack=[],this.code=n,this},h.inherits(i,e),i.prototype.name=t,i.prototype.inspect=function(){return"["+t+": "+this.message+" (code "+this.code+")]"},i},n.make_errors=c=function(t){var e,n,r,i,o,u;o={msg:{},name:{},code:{}},t.OK="Success",n=100;for(r in t)i=t[r],"OK"!==r?(e=s(r)+"Error",u=n++,o[e]=a(e,u,i)):u=0,o[r]=u,o.msg[r]=o.msg[u]=i,o.name[r]=o.name[u]=r,o.code[r]=u;return o},u=function(t,e){return null!=e?(null==t.istack&&(t.istack=[]),t.istack.push(e)):void 0},n.make_esc=l=function(t,e){return function(n){return function(){var r,i;return i=arguments[0],r=2<=arguments.length?p.call(arguments,1):[],null==i?n.apply(null,r):t.__esc?void 0:(t.__esc=!0,u(i,e),t(i))}}},n.EscOk=o=function(){function t(t,e){this.gcb=t,this.where=e}return t.prototype.bailout=function(){var t;return this.gcb?(t=this.gcb,this.gcb=null,t(!1)):void 0},t.prototype.check_ok=function(t){return function(e){return function(){var n,r;return r=arguments[0],n=2<=arguments.length?p.call(arguments,1):[],r?t.apply(null,n):e.bailout()}}(this)},t.prototype.check_err=function(t){return function(e){return function(){var n,r;return r=arguments[0],n=2<=arguments.length?p.call(arguments,1):[],null!=r?(u(r,e.where),e.bailout()):t.apply(null,n)}}(this)},t.prototype.check_non_null=function(t){return function(e){return function(){var n;return n=1<=arguments.length?p.call(arguments,0):[],null==n[0]?e.bailout():t.apply(null,n)}}(this)},t}(),n.EscErr=i=function(){function t(t,e){this.gcb=t,this.where=e}return t.prototype.finish=function(t){var e;return this.gcb?(e=this.gcb,this.gcb=null,e(t)):void 0},t.prototype.check_ok=function(t,e,n){return null==e&&(e=Error),null==n&&(n=null),function(){var r,i,o;return o=arguments[0],r=2<=arguments.length?p.call(arguments,1):[],o?t.apply(null,r):(i=new e(n),u(i,this.where),this.finish(i))}},t.prototype.check_err=function(t){return function(){var e,n;return n=arguments[0],e=2<=arguments.length?p.call(arguments,1):[],null!=n?(u(n,this.where),this.finish(n)):t.apply(null,e)}},t}(),n.Canceler=r=function(){function t(t){this.klass=null!=t?t:Error,this._canceled=!1}return t.prototype.is_canceled=function(){return this._canceled},t.prototype.is_ok=function(){return!this._canceled},t.prototype.cancel=function(){return this._canceled=!0},t.prototype.err=function(){return this._canceled?new this.klass("Aborted"):null},t}(),n.chain=function(t,e){return function(){var n;return n=1<=arguments.length?p.call(arguments,0):[],e(function(){return t.apply(null,n)})}},n.chain_err=function(t,e){return function(){var n;return n=1<=arguments.length?p.call(arguments,0):[],e(function(){var e;return e=1<=arguments.length?p.call(arguments,0):[],t.apply(null,null!=e[0]&&null==n[0]?e:n)})}}}).call(this)},{util:29}],31:[function(t,e,n){(function(){var e,r,i,o,s,u,a={}.hasOwnProperty,c=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};o=t("iced-runtime"),s=u=function(){},n.Lock=e=function(){function t(){this._open=!0,this._waiters=[]}return t.prototype.acquire=function(t){return this._open?(this._open=!1,t()):this._waiters.push(t)},t.prototype.release=function(){var t;return this._waiters.length?(t=this._waiters.shift())():this._open=!0},t.prototype.open=function(){return this._open},t}(),r=function(t){function e(t,n){this.tab=t,this.name=n,e.__super__.constructor.call(this),this.refs=0}return c(e,t),e.prototype.incref=function(){return++this.refs},e.prototype.decref=function(){return--this.refs},e.prototype.release=function(){return e.__super__.release.call(this),0===this.decref()?delete this.tab.locks[this.name]:void 0},e}(e),n.Table=i=function(){function t(){this.locks={}}return t.prototype.create=function(t){var e;return e=new r(this,t),this.locks[t]=e},t.prototype.acquire=function(t,e,n){var r,i,s,a,c;c=u,s=o.findDeferral(arguments),r=this.locks[t]||this.create(t),i=r._open,r.incref(),function(t){return function(t){return n||r._open?void!function(t){a=new o.Deferrals(t,{parent:s,filename:"/home/max/src/iced/iced-lock/index.iced",funcname:"Table.acquire"}),r.acquire(a.defer({lineno:47})),a._fulfill()}(t):t(r=null)}}(this)(function(t){return function(){return e(r,i)}}(this))},t.prototype.lookup=function(t){return this.locks[t]},t}()}).call(this)},{"iced-runtime":34}],32:[function(t,e,n){(function(){e.exports={k:"__iced_k",k_noop:"__iced_k_noop",param:"__iced_p_",ns:"iced",runtime:"runtime",Deferrals:"Deferrals",deferrals:"__iced_deferrals",fulfill:"_fulfill",b_while:"_break",t_while:"_while",c_while:"_continue",n_while:"_next",n_arg:"__iced_next_arg",defer_method:"defer",slot:"__slot",assign_fn:"assign_fn",autocb:"autocb",retslot:"ret",trace:"__iced_trace",passed_deferral:"__iced_passed_deferral",findDeferral:"findDeferral",lineno:"lineno",parent:"parent",filename:"filename",funcname:"funcname",catchExceptions:"catchExceptions",runtime_modes:["node","inline","window","none","browserify","interp"],trampoline:"trampoline",context:"context"}}).call(this)},{}],33:[function(t,e,n){(function(){var e,r,i,o,s,u,a,c,l=[].slice;o=s=function(){},e=t("./const"),n.iced=i=t("./runtime"),c=function(t,e,n,r){var o,u,a,c,f,h;h=s,c=i.findDeferral(arguments),u=new i.Rendezvous,r[0]=u.id(!0).defer({assign_fn:function(t){return function(){return function(){return o=l.call(arguments,0)}}}(this)(),lineno:20,context:f}),setTimeout(u.id(!1).defer({lineno:21,context:f}),e),function(t){return function(t){f=new i.Deferrals(t,{parent:c,filename:"/Users/max/src/iced/iced-runtime/src/library.iced"}),u.wait(f.defer({assign_fn:function(){return function(){return a=arguments[0]}}(),lineno:22})),f._fulfill()}}(this)(function(e){return function(){return n&&(n[0]=a),t.apply(null,o)}}(this))},n.timeout=function(t,e,n){var r;return r=[],c(t,e,n,r),r[0]},u=function(t,e,n){var r,o,u,a;a=s,o=i.findDeferral(arguments),function(t){return function(t){u=new i.Deferrals(t,{parent:o,filename:"/Users/max/src/iced/iced-runtime/src/library.iced"}),n[0]=u.defer({assign_fn:function(){return function(){return r=arguments[0]}}(),lineno:39}),u._fulfill()}}(this)(function(n){return function(){return r||(e[0]=!1),t()}}(this))},n.iand=function(t,e){var n;return n=[],u(t,e,n),n[0]},a=function(t,e,n){var r,o,u,a;a=s,o=i.findDeferral(arguments),function(t){return function(t){u=new i.Deferrals(t,{parent:o,filename:"/Users/max/src/iced/iced-runtime/src/library.iced"}),n[0]=u.defer({assign_fn:function(){return function(){return r=arguments[0]}}(),lineno:58}),u._fulfill()}}(this)(function(n){return function(){return r&&(e[0]=!0),t()}}(this))},n.ior=function(t,e){var n;return n=[],a(t,e,n),n[0]},n.Pipeliner=r=function(){function t(t,n){this.window=t||1,this.delay=n||0,this.queue=[],this.n_out=0,this.cb=null,this[e.deferrals]=this,this.defer=this._defer}return t.prototype.waitInQueue=function(t){var e,n,r;r=s,e=i.findDeferral(arguments),function(t){return function(r){var o,s;o=[],(s=function(r){var u,a,c;return u=function(){return r(o)},a=function(){return i.trampoline(function(){return s(r)})},c=function(t){return o.push(t),a()},t.n_out>=t.window?void!function(r){n=new i.Deferrals(r,{parent:e,filename:"/Users/max/src/iced/iced-runtime/src/library.iced",funcname:"Pipeliner.waitInQueue"}),t.cb=n.defer({lineno:100}),n._fulfill()}(c):u()})(r)}}(this)(function(r){return function(){r.n_out++,function(t){return r.delay?void!function(t){n=new i.Deferrals(t,{parent:e,filename:"/Users/max/src/iced/iced-runtime/src/library.iced",funcname:"Pipeliner.waitInQueue"}),setTimeout(n.defer({lineno:108}),r.delay),n._fulfill()}(t):t()}(function(){return t()})}}(this))},t.prototype.__defer=function(t,e){var n,r,o,u,a;a=s,o=i.findDeferral(arguments),function(n){return function(n){u=new i.Deferrals(n,{parent:o,filename:"/Users/max/src/iced/iced-runtime/src/library.iced",funcname:"Pipeliner.__defer"}),r=u.defer({lineno:122}),t[0]=function(){var t,n;return t=1<=arguments.length?l.call(arguments,0):[],null!=(n=e.assign_fn)&&n.apply(null,t),r()},u._fulfill()}}(this)(function(t){return function(){return t.n_out--,t.cb?(n=t.cb,t.cb=null,n()):void 0}}(this))},t.prototype._defer=function(t){var e;return e=[],this.__defer(e,t),e[0]},t.prototype.flush=function(t){var e,n,r,o;n=t,e=i.findDeferral(arguments),r=[],(o=function(t){var n;return function(s){var u,a,c;return u=function(){return s(r)},a=function(){return i.trampoline(function(){return o(s)})},c=function(t){return r.push(t),a()},t.n_out?void!function(r){n=new i.Deferrals(r,{parent:e,filename:"/Users/max/src/iced/iced-runtime/src/library.iced",funcname:"Pipeliner.flush"}),t.cb=n.defer({lineno:151}),n._fulfill()}(c):u()}}(this))(n)},t}()}).call(this)},{"./const":32,"./runtime":35}],34:[function(t,e,n){(function(){var e,r,i,o,s,u;for(n["const"]=t("./const"),i=[t("./runtime"),t("./library")],s=0,u=i.length;u>s;s++){r=i[s];for(e in r)o=r[e],n[e]=o}}).call(this)},{"./const":32,"./library":33,"./runtime":35}],35:[function(t,e,n){var r=t("__browserify_process");(function(){var e,i,o,s,u,a,c,l,f,h,p,d,g,y=[].slice;e=t("./const"),a=function(t,n,r,i,o){var s,u,a,c;a={};for(s in i)c=i[s],a[s]=c;return a[e.lineno]=null!=n?n[e.lineno]:void 0,u=function(){var e,i,s;return e=1<=arguments.length?y.call(arguments,0):[],null!=n&&null!=(s=n.assign_fn)&&s.apply(null,e),t?(i=t,o||(t=null),i._fulfill(r,a)):h("overused deferral at "+g(a))},u[e.trace]=a,u},d=0,l=function(t){return d++,d%t===0?(d=0,!0):!1},p=null,g=function(t){var n;return n=t[e.funcname]||"",""+n+" ("+t[e.filename]+":"+(t[e.lineno]+1)+")"},h=function(t){return"undefined"!=typeof console&&null!==console?console.error("ICED warning: "+t):void 0},n.trampoline=f=function(t){return l(500)?"undefined"!=typeof r&&null!==r?r.nextTick(t):setTimeout(t):t()},n.Deferrals=i=function(){function t(t,e){this.trace=e,this.continuation=t,this.count=1,this.ret=null}return t.prototype._call=function(t){var e;return this.continuation?(p=t,e=this.continuation,this.continuation=null,e(this.ret)):h("Entered dead await at "+g(t))},t.prototype._fulfill=function(t,e){return--this.count>0?void 0:f(function(t){return function(){return t._call(e)}}(this))},t.prototype.defer=function(t){var e;return this.count++,e=this,a(e,t,null,this.trace)},t}(),n.findDeferral=u=function(t){var n,r,i;for(r=0,i=t.length;i>r;r++)if(n=t[r],null!=n?n[e.trace]:void 0)return n;return null},n.Rendezvous=o=function(){function t(){this.completed=[],this.waiters=[],this.defer_id=0}var e;return e=function(){function t(t,e,n){this.rv=t,this.id=e,this.multi=n}return t.prototype.defer=function(t){return this.rv._defer_with_id(this.id,t,this.multi)},t}(),t.prototype.wait=function(t){var e;return this.completed.length?(e=this.completed.shift(),t(e)):this.waiters.push(t)},t.prototype.defer=function(t){var e;return e=this.defer_id++,this._defer_with_id(e,t)},t.prototype.id=function(t,n){return n=!!n,new e(this,t,n)},t.prototype._fulfill=function(t,e){var n;return this.waiters.length?(n=this.waiters.shift())(t):this.completed.push(t)},t.prototype._defer_with_id=function(t,e,n){return this.count++,a(this,e,t,{},n)},t}(),n.stackWalk=c=function(t){var n,r,i,o;for(r=[],i=t?t[e.trace]:p;i;)n=" at "+g(i),r.push(n),i=null!=i&&null!=(o=i[e.parent])?o[e.trace]:void 0;return r},n.exceptionHandler=s=function(t,e){var n;return e||(e=console.error),e(t.stack),n=c(),n.length?(e("Iced 'stack' trace (w/ real line numbers):"),e(n.join("\n"))):void 0},n.catchExceptions=function(t){return"undefined"!=typeof r&&null!==r?r.on("uncaughtException",function(e){return s(e,t),r.exit(1)}):void 0}}).call(this)},{"./const":32,__browserify_process:27}],36:[function(t,e,n){e.exports=t(32)},{}],37:[function(t,e,n){arguments[4][33][0].apply(n,arguments)},{"./const":36,"./runtime":39}],38:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"./const":36,"./library":37,"./runtime":39}],39:[function(t,e,n){var r=t("__browserify_process");(function(){var e,i,o,s,u,a,c,l,f,h,p,d,g,y=[].slice;e=t("./const"),a=function(t,n,r,i,o){var s,u,a,c;a={};for(s in i)c=i[s],a[s]=c;return a[e.lineno]=null!=n?n[e.lineno]:void 0,u=function(){var e,i,s;return e=1<=arguments.length?y.call(arguments,0):[],null!=n&&null!=(s=n.assign_fn)&&s.apply(null,e),t?(i=t,o||(t=null),i._fulfill(r,a)):h("overused deferral at "+intern._trace_to_string(a))},u[e.trace]=a,u},d=0,l=function(t){return d++,d%t===0?(d=0,!0):!1},p=null,g=function(t){var n;return n=t[e.funcname]||"",""+n+" ("+t[e.filename]+":"+(t[e.lineno]+1)+")"},h=function(t){return"undefined"!=typeof console&&null!==console?console.error("ICED warning: "+t):void 0},n.trampoline=f=function(t){return l(500)?"undefined"!=typeof r&&null!==r?r.nextTick(t):setTimeout(t):t()},n.Deferrals=i=function(){function t(t,e){this.trace=e,this.continuation=t,this.count=1,this.ret=null}return t.prototype._call=function(t){var e;return this.continuation?(p=t,e=this.continuation,this.continuation=null,e(this.ret)):h("Entered dead await at "+g(t))},t.prototype._fulfill=function(t,e){return--this.count>0?void 0:f(function(t){return function(){return t._call(e)}}(this))},t.prototype.defer=function(t){var e;return this.count++,e=this,a(e,t,null,this.trace)},t}(),n.findDeferral=u=function(t){var n,r,i;for(r=0,i=t.length;i>r;r++)if(n=t[r],null!=n?n[e.trace]:void 0)return n;return null},n.Rendezvous=o=function(){function t(){this.completed=[],this.waiters=[],this.defer_id=0}var e;return e=function(){function t(t,e,n){this.rv=t,this.id=e,this.multi=n}return t.prototype.defer=function(t){return this.rv._defer_with_id(this.id,t,this.multi)},t}(),t.prototype.wait=function(t){var e;return this.completed.length?(e=this.completed.shift(),t(e)):this.waiters.push(t)},t.prototype.defer=function(t){var e;return e=this.defer_id++,this._defer_with_id(e,t)},t.prototype.id=function(t,n){return n=!!n,new e(this,t,n)},t.prototype._fulfill=function(t,e){var n;return this.waiters.length?(n=this.waiters.shift())(t):this.completed.push(t)},t.prototype._defer_with_id=function(t,e,n){return this.count++,a(this,e,t,{},n)},t}(),n.stackWalk=c=function(t){var n,r,i,o;for(r=[],i=t?t[e.trace]:p;i;)n=" at "+g(i),r.push(n),i=null!=i&&null!=(o=i[e.parent])?o[e.trace]:void 0;return r},n.exceptionHandler=s=function(t,e){var n;return e||(e=console.error),e(t.stack),n=c(),n.length?(e("Iced 'stack' trace (w/ real line numbers):"),e(n.join("\n"))):void 0},n.catchExceptions=function(t){return"undefined"!=typeof r&&null!==r?r.on("uncaughtException",function(e){return s(e,t),r.exit(1)}):void 0}}).call(this)},{"./const":36,__browserify_process:27}],40:[function(t,e,n){(function(){var e,r,i,o;r=t("iced-runtime"),i=o=function(){},e=e=function(){function t(t){t=t||{},this.lazy_loop_delay=t.lazy_loop_delay||30,this.loop_delay=t.loop_delay||5,this.work_min=t.work_min||1,this.auto_stop_bits=t.auto_stop_bits||4096,this.max_bits_per_delta=t.max_bits_per_delta||4,this.auto_stop=t.auto_stop?t.auto_stop:!0,this.entropies=[],this.running=!0,this.is_generating=!1,this.timer_race_loop()}return t.prototype.generate=function(t,e){var n,i,s,u,a,c;c=o,u=r.findDeferral(arguments),this.is_generating=!0,this.running||this.resume(),i=0,s=[],function(e){return function(o){var c,l;c=[],(l=function(o){var f,h,p;return f=function(){return o(c)},h=function(){return r.trampoline(function(){return l(o)})},p=function(t){return c.push(t),h()},t>i?void!function(t){return e.entropies.length?(n=e.entropies.splice(0,1)[0],i+=n[1],t(s.push(n[0]))):void!function(t){a=new r.Deferrals(t,{parent:u,filename:"/Users/chris/git/more-entropy/src/generator.iced",funcname:"Generator.generate"}),e.delay(a.defer({lineno:28})),a._fulfill()}(t)}(p):f()})(o)}}(this)(function(t){return function(){return t.auto_stop&&t.stop(),t.is_generating=!1,e(s)}}(this))},t.prototype.stop=function(){return this.running=!1},t.prototype.resume=function(){return this.running=!0,this.timer_race_loop()},t.prototype.reset=function(){return this.entropies=[],this.total_bits=0},t.prototype.count_unused_bits=function(){var t,e,n,r,i;for(t=0,i=this.entropies,n=0,r=i.length;r>n;n++)e=i[n],t+=e[1];return t},t.prototype.delay=function(t){var e,n,i,s;s=o,n=r.findDeferral(arguments),e=this.is_generating?this.loop_delay:this.lazy_loop_delay,function(t){return function(t){i=new r.Deferrals(t,{parent:n,filename:"/Users/chris/git/more-entropy/src/generator.iced",funcname:"Generator.delay"}),setTimeout(i.defer({lineno:50}),e),i._fulfill()}}(this)(function(e){return function(){return t()}}(this))},t.prototype.timer_race_loop=function(){var t,e,n,i;e=o,t=r.findDeferral(arguments),this._last_count=null,n=[],(i=function(e){var o,s,u,a,c;return function(l){var f,h,p;return f=function(){return l(n)},h=function(){return r.trampoline(function(){return i(l)})},p=function(t){return n.push(t),h()},e.running?(e.count_unused_bits()
- into Bootstrap buttons
- Browse
-
-*/
-(function($) {
-
-$.fn.bootstrapFileInput = function() {
-
- this.each(function(i,elem){
-
- var $elem = $(elem);
-
- // Maybe some fields don't need to be standardized.
- if (typeof $elem.attr('data-bfi-disabled') != 'undefined') {
- return;
- }
-
- // Set the word to be displayed on the button
- var buttonWord = 'Browse';
-
- if (typeof $elem.attr('title') != 'undefined') {
- buttonWord = $elem.attr('title');
- }
-
- var className = '';
-
- if (!!$elem.attr('class')) {
- className = ' ' + $elem.attr('class');
- }
-
- // Now we're going to wrap that input field with a Bootstrap button.
- // The input will actually still be there, it will just be float above and transparent (done with the CSS).
- $elem.wrap('').parent().prepend($('').html(buttonWord));
- })
-
- // After we have found all of the file inputs let's apply a listener for tracking the mouse movement.
- // This is important because the in order to give the illusion that this is a button in FF we actually need to move the button from the file input under the cursor. Ugh.
- .promise().done( function(){
-
- // As the cursor moves over our new Bootstrap button we need to adjust the position of the invisible file input Browse button to be under the cursor.
- // This gives us the pointer cursor that FF denies us
- $('.file-input-wrapper').mousemove(function(cursor) {
-
- var input, wrapper,
- wrapperX, wrapperY,
- inputWidth, inputHeight,
- cursorX, cursorY;
-
- // This wrapper element (the button surround this file input)
- wrapper = $(this);
- // The invisible file input element
- input = wrapper.find("input");
- // The left-most position of the wrapper
- wrapperX = wrapper.offset().left;
- // The top-most position of the wrapper
- wrapperY = wrapper.offset().top;
- // The with of the browsers input field
- inputWidth= input.width();
- // The height of the browsers input field
- inputHeight= input.height();
- //The position of the cursor in the wrapper
- cursorX = cursor.pageX;
- cursorY = cursor.pageY;
-
- //The positions we are to move the invisible file input
- // The 20 at the end is an arbitrary number of pixels that we can shift the input such that cursor is not pointing at the end of the Browse button but somewhere nearer the middle
- moveInputX = cursorX - wrapperX - inputWidth + 20;
- // Slides the invisible input Browse button to be positioned middle under the cursor
- moveInputY = cursorY- wrapperY - (inputHeight/2);
-
- // Apply the positioning styles to actually move the invisible file input
- input.css({
- left:moveInputX,
- top:moveInputY
- });
- });
-
- $('body').on('change', '.file-input-wrapper input[type=file]', function(){
-
- var fileName;
- fileName = $(this).val();
-
- // Remove any previous file names
- $(this).parent().next('.file-input-name').remove();
- if (!!$(this).prop('files') && $(this).prop('files').length > 1) {
- fileName = $(this)[0].files.length+' files';
- }
- else {
- fileName = fileName.substring(fileName.lastIndexOf('\\') + 1, fileName.length);
- }
-
- // Don't try to show the name if there is none
- if (!fileName) {
- return;
- }
-
- var selectedFileNamePlacement = $(this).data('filename-placement');
- if (selectedFileNamePlacement === 'inside') {
- // Print the fileName inside
- $(this).siblings('span').html(fileName);
- $(this).attr('title', fileName);
- } else {
- // Print the fileName aside (right after the the button)
- $(this).parent().after(''+fileName+'');
- }
- });
-
- });
-
-};
-
-// Add the styles before the first stylesheet
-// This ensures they can be easily overridden with developer styles
-var cssHtml = '';
-$('link[rel=stylesheet]').eq(0).before(cssHtml);
-
-})(jQuery);
diff --git a/public/js/vendor/bootstrap.js b/public/js/vendor/bootstrap.js
deleted file mode 100644
index 8ae571b..0000000
--- a/public/js/vendor/bootstrap.js
+++ /dev/null
@@ -1,1951 +0,0 @@
-/*!
- * Bootstrap v3.1.1 (http://getbootstrap.com)
- * Copyright 2011-2014 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- */
-
-if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') }
-
-/* ========================================================================
- * Bootstrap: transition.js v3.1.1
- * http://getbootstrap.com/javascript/#transitions
- * ========================================================================
- * Copyright 2011-2014 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, $el = this
- $(this).one($.support.transition.end, function () { called = true })
- var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
- setTimeout(callback, duration)
- return this
- }
-
- $(function () {
- $.support.transition = transitionEnd()
- })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: alert.js v3.1.1
- * http://getbootstrap.com/javascript/#alerts
- * ========================================================================
- * Copyright 2011-2014 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.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.hasClass('alert') ? $this : $this.parent()
- }
-
- $parent.trigger(e = $.Event('close.bs.alert'))
-
- if (e.isDefaultPrevented()) return
-
- $parent.removeClass('in')
-
- function removeElement() {
- $parent.trigger('closed.bs.alert').remove()
- }
-
- $.support.transition && $parent.hasClass('fade') ?
- $parent
- .one($.support.transition.end, removeElement)
- .emulateTransitionEnd(150) :
- removeElement()
- }
-
-
- // ALERT PLUGIN DEFINITION
- // =======================
-
- var old = $.fn.alert
-
- $.fn.alert = function (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)
- })
- }
-
- $.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.1.1
- * http://getbootstrap.com/javascript/#buttons
- * ========================================================================
- * Copyright 2011-2014 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.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 = state + 'Text'
-
- if (!data.resetText) $el.data('resetText', $el[val]())
-
- $el[val](data[state] || this.options[state])
-
- // push to event loop to allow forms to submit
- setTimeout($.proxy(function () {
- 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') && this.$element.hasClass('active')) changed = false
- else $parent.find('.active').removeClass('active')
- }
- if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
- }
-
- if (changed) this.$element.toggleClass('active')
- }
-
-
- // BUTTON PLUGIN DEFINITION
- // ========================
-
- var old = $.fn.button
-
- $.fn.button = function (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)
- })
- }
-
- $.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)
- if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
- $btn.button('toggle')
- e.preventDefault()
- })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: carousel.js v3.1.1
- * http://getbootstrap.com/javascript/#carousel
- * ========================================================================
- * Copyright 2011-2014 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 =
- this.sliding =
- this.interval =
- this.$active =
- this.$items = null
-
- this.options.pause == 'hover' && this.$element
- .on('mouseenter', $.proxy(this.pause, this))
- .on('mouseleave', $.proxy(this.cycle, this))
- }
-
- Carousel.DEFAULTS = {
- interval: 5000,
- pause: 'hover',
- wrap: true
- }
-
- 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.getActiveIndex = function () {
- this.$active = this.$element.find('.item.active')
- this.$items = this.$active.parent().children()
-
- return this.$items.index(this.$active)
- }
-
- Carousel.prototype.to = function (pos) {
- var that = this
- var activeIndex = this.getActiveIndex()
-
- if (pos > (this.$items.length - 1) || pos < 0) return
-
- if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
- if (activeIndex == pos) return this.pause().cycle()
-
- return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[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 || $active[type]()
- var isCycling = this.interval
- var direction = type == 'next' ? 'left' : 'right'
- var fallback = type == 'next' ? 'first' : 'last'
- var that = this
-
- if (!$next.length) {
- if (!this.options.wrap) return
- $next = this.$element.find('.item')[fallback]()
- }
-
- if ($next.hasClass('active')) return this.sliding = false
-
- var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
- this.$element.trigger(e)
- if (e.isDefaultPrevented()) return
-
- this.sliding = true
-
- isCycling && this.pause()
-
- if (this.$indicators.length) {
- this.$indicators.find('.active').removeClass('active')
- this.$element.one('slid.bs.carousel', function () {
- var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
- $nextIndicator && $nextIndicator.addClass('active')
- })
- }
-
- if ($.support.transition && this.$element.hasClass('slide')) {
- $next.addClass(type)
- $next[0].offsetWidth // force reflow
- $active.addClass(direction)
- $next.addClass(direction)
- $active
- .one($.support.transition.end, function () {
- $next.removeClass([type, direction].join(' ')).addClass('active')
- $active.removeClass(['active', direction].join(' '))
- that.sliding = false
- setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
- })
- .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
- } else {
- $active.removeClass('active')
- $next.addClass('active')
- this.sliding = false
- this.$element.trigger('slid.bs.carousel')
- }
-
- isCycling && this.cycle()
-
- return this
- }
-
-
- // CAROUSEL PLUGIN DEFINITION
- // ==========================
-
- var old = $.fn.carousel
-
- $.fn.carousel = function (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()
- })
- }
-
- $.fn.carousel.Constructor = Carousel
-
-
- // CAROUSEL NO CONFLICT
- // ====================
-
- $.fn.carousel.noConflict = function () {
- $.fn.carousel = old
- return this
- }
-
-
- // CAROUSEL DATA-API
- // =================
-
- $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
- var $this = $(this), href
- var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
- var options = $.extend({}, $target.data(), $this.data())
- var slideIndex = $this.attr('data-slide-to')
- if (slideIndex) options.interval = false
-
- $target.carousel(options)
-
- if (slideIndex = $this.attr('data-slide-to')) {
- $target.data('bs.carousel').to(slideIndex)
- }
-
- e.preventDefault()
- })
-
- $(window).on('load', function () {
- $('[data-ride="carousel"]').each(function () {
- var $carousel = $(this)
- $carousel.carousel($carousel.data())
- })
- })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: collapse.js v3.1.1
- * http://getbootstrap.com/javascript/#collapse
- * ========================================================================
- * Copyright 2011-2014 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
- 'use strict';
-
- // COLLAPSE PUBLIC CLASS DEFINITION
- // ================================
-
- var Collapse = function (element, options) {
- this.$element = $(element)
- this.options = $.extend({}, Collapse.DEFAULTS, options)
- this.transitioning = null
-
- if (this.options.parent) this.$parent = $(this.options.parent)
- if (this.options.toggle) this.toggle()
- }
-
- 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 startEvent = $.Event('show.bs.collapse')
- this.$element.trigger(startEvent)
- if (startEvent.isDefaultPrevented()) return
-
- var actives = this.$parent && this.$parent.find('> .panel > .in')
-
- if (actives && actives.length) {
- var hasData = actives.data('bs.collapse')
- if (hasData && hasData.transitioning) return
- actives.collapse('hide')
- hasData || actives.data('bs.collapse', null)
- }
-
- var dimension = this.dimension()
-
- this.$element
- .removeClass('collapse')
- .addClass('collapsing')
- [dimension](0)
-
- this.transitioning = 1
-
- var complete = function () {
- this.$element
- .removeClass('collapsing')
- .addClass('collapse in')
- [dimension]('auto')
- 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($.support.transition.end, $.proxy(complete, this))
- .emulateTransitionEnd(350)
- [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')
- .removeClass('in')
-
- this.transitioning = 1
-
- var complete = function () {
- this.transitioning = 0
- this.$element
- .trigger('hidden.bs.collapse')
- .removeClass('collapsing')
- .addClass('collapse')
- }
-
- if (!$.support.transition) return complete.call(this)
-
- this.$element
- [dimension](0)
- .one($.support.transition.end, $.proxy(complete, this))
- .emulateTransitionEnd(350)
- }
-
- Collapse.prototype.toggle = function () {
- this[this.$element.hasClass('in') ? 'hide' : 'show']()
- }
-
-
- // COLLAPSE PLUGIN DEFINITION
- // ==========================
-
- var old = $.fn.collapse
-
- $.fn.collapse = function (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 && option == 'show') option = !option
- if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.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), href
- var target = $this.attr('data-target')
- || e.preventDefault()
- || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
- var $target = $(target)
- var data = $target.data('bs.collapse')
- var option = data ? 'toggle' : $this.data()
- var parent = $this.attr('data-parent')
- var $parent = parent && $(parent)
-
- if (!data || !data.transitioning) {
- if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
- $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
- }
-
- $target.collapse(option)
- })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: dropdown.js v3.1.1
- * http://getbootstrap.com/javascript/#dropdowns
- * ========================================================================
- * Copyright 2011-2014 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.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
- $('').insertAfter($(this)).on('click', clearMenus)
- }
-
- var relatedTarget = { relatedTarget: this }
- $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
-
- if (e.isDefaultPrevented()) return
-
- $parent
- .toggleClass('open')
- .trigger('shown.bs.dropdown', relatedTarget)
-
- $this.focus()
- }
-
- return false
- }
-
- Dropdown.prototype.keydown = function (e) {
- if (!/(38|40|27)/.test(e.keyCode)) 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 || (isActive && e.keyCode == 27)) {
- if (e.which == 27) $parent.find(toggle).focus()
- return $this.click()
- }
-
- var desc = ' li:not(.divider):visible a'
- var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
-
- if (!$items.length) return
-
- var index = $items.index($items.filter(':focus'))
-
- if (e.keyCode == 38 && index > 0) index-- // up
- if (e.keyCode == 40 && index < $items.length - 1) index++ // down
- if (!~index) index = 0
-
- $items.eq(index).focus()
- }
-
- function clearMenus(e) {
- $(backdrop).remove()
- $(toggle).each(function () {
- var $parent = getParent($(this))
- var relatedTarget = { relatedTarget: this }
- if (!$parent.hasClass('open')) return
- $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
- if (e.isDefaultPrevented()) return
- $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
- })
- }
-
- 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()
- }
-
-
- // DROPDOWN PLUGIN DEFINITION
- // ==========================
-
- var old = $.fn.dropdown
-
- $.fn.dropdown = function (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)
- })
- }
-
- $.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 + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: modal.js v3.1.1
- * http://getbootstrap.com/javascript/#modals
- * ========================================================================
- * Copyright 2011-2014 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.$element = $(element)
- this.$backdrop =
- this.isShown = null
-
- if (this.options.remote) {
- this.$element
- .find('.modal-content')
- .load(this.options.remote, $.proxy(function () {
- this.$element.trigger('loaded.bs.modal')
- }, this))
- }
- }
-
- Modal.DEFAULTS = {
- backdrop: true,
- keyboard: true,
- show: true
- }
-
- Modal.prototype.toggle = function (_relatedTarget) {
- return this[!this.isShown ? 'show' : 'hide'](_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.escape()
-
- this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
-
- this.backdrop(function () {
- var transition = $.support.transition && that.$element.hasClass('fade')
-
- if (!that.$element.parent().length) {
- that.$element.appendTo(document.body) // don't move modals dom position
- }
-
- that.$element
- .show()
- .scrollTop(0)
-
- if (transition) {
- that.$element[0].offsetWidth // force reflow
- }
-
- that.$element
- .addClass('in')
- .attr('aria-hidden', false)
-
- that.enforceFocus()
-
- var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
-
- transition ?
- that.$element.find('.modal-dialog') // wait for modal to slide in
- .one($.support.transition.end, function () {
- that.$element.focus().trigger(e)
- })
- .emulateTransitionEnd(300) :
- that.$element.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()
-
- $(document).off('focusin.bs.modal')
-
- this.$element
- .removeClass('in')
- .attr('aria-hidden', true)
- .off('click.dismiss.bs.modal')
-
- $.support.transition && this.$element.hasClass('fade') ?
- this.$element
- .one($.support.transition.end, $.proxy(this.hideModal, this))
- .emulateTransitionEnd(300) :
- this.hideModal()
- }
-
- Modal.prototype.enforceFocus = function () {
- $(document)
- .off('focusin.bs.modal') // guard against infinite focus loop
- .on('focusin.bs.modal', $.proxy(function (e) {
- if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
- this.$element.focus()
- }
- }, this))
- }
-
- Modal.prototype.escape = function () {
- if (this.isShown && this.options.keyboard) {
- this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
- e.which == 27 && this.hide()
- }, this))
- } else if (!this.isShown) {
- this.$element.off('keyup.dismiss.bs.modal')
- }
- }
-
- Modal.prototype.hideModal = function () {
- var that = this
- this.$element.hide()
- this.backdrop(function () {
- that.removeBackdrop()
- that.$element.trigger('hidden.bs.modal')
- })
- }
-
- Modal.prototype.removeBackdrop = function () {
- this.$backdrop && this.$backdrop.remove()
- this.$backdrop = null
- }
-
- Modal.prototype.backdrop = function (callback) {
- var animate = this.$element.hasClass('fade') ? 'fade' : ''
-
- if (this.isShown && this.options.backdrop) {
- var doAnimate = $.support.transition && animate
-
- this.$backdrop = $('')
- .appendTo(document.body)
-
- this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
- if (e.target !== e.currentTarget) return
- this.options.backdrop == 'static'
- ? this.$element[0].focus.call(this.$element[0])
- : this.hide.call(this)
- }, this))
-
- if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
-
- this.$backdrop.addClass('in')
-
- if (!callback) return
-
- doAnimate ?
- this.$backdrop
- .one($.support.transition.end, callback)
- .emulateTransitionEnd(150) :
- callback()
-
- } else if (!this.isShown && this.$backdrop) {
- this.$backdrop.removeClass('in')
-
- $.support.transition && this.$element.hasClass('fade') ?
- this.$backdrop
- .one($.support.transition.end, callback)
- .emulateTransitionEnd(150) :
- callback()
-
- } else if (callback) {
- callback()
- }
- }
-
-
- // MODAL PLUGIN DEFINITION
- // =======================
-
- var old = $.fn.modal
-
- $.fn.modal = function (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)
- })
- }
-
- $.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
- .modal(option, this)
- .one('hide', function () {
- $this.is(':visible') && $this.focus()
- })
- })
-
- $(document)
- .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
- .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: tooltip.js v3.1.1
- * http://getbootstrap.com/javascript/#tooltip
- * Inspired by the original jQuery.tipsy by Jason Frame
- * ========================================================================
- * Copyright 2011-2014 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 =
- this.options =
- this.enabled =
- this.timeout =
- this.hoverState =
- this.$element = null
-
- this.init('tooltip', element, options)
- }
-
- Tooltip.DEFAULTS = {
- animation: true,
- placement: 'top',
- selector: false,
- template: '',
- trigger: 'hover focus',
- title: '',
- delay: 0,
- html: false,
- container: false
- }
-
- Tooltip.prototype.init = function (type, element, options) {
- this.enabled = true
- this.type = type
- this.$element = $(element)
- this.options = this.getOptions(options)
-
- 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)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
-
- 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.leave = function (obj) {
- var self = obj instanceof this.constructor ?
- obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
-
- 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)
-
- if (e.isDefaultPrevented()) return
- var that = this;
-
- var $tip = this.tip()
-
- this.setContent()
-
- 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)
-
- this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
-
- var pos = this.getPosition()
- var actualWidth = $tip[0].offsetWidth
- var actualHeight = $tip[0].offsetHeight
-
- if (autoPlace) {
- var $parent = this.$element.parent()
-
- var orgPlacement = placement
- var docScroll = document.documentElement.scrollTop || document.body.scrollTop
- var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth()
- var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()
- var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left
-
- placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' :
- placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' :
- placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' :
- placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' :
- placement
-
- $tip
- .removeClass(orgPlacement)
- .addClass(placement)
- }
-
- var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
-
- this.applyPlacement(calculatedOffset, placement)
- this.hoverState = null
-
- var complete = function() {
- that.$element.trigger('shown.bs.' + that.type)
- }
-
- $.support.transition && this.$tip.hasClass('fade') ?
- $tip
- .one($.support.transition.end, complete)
- .emulateTransitionEnd(150) :
- complete()
- }
- }
-
- Tooltip.prototype.applyPlacement = function (offset, placement) {
- var replace
- 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 = offset.top + marginTop
- offset.left = 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) {
- replace = true
- offset.top = offset.top + height - actualHeight
- }
-
- if (/bottom|top/.test(placement)) {
- var delta = 0
-
- if (offset.left < 0) {
- delta = offset.left * -2
- offset.left = 0
-
- $tip.offset(offset)
-
- actualWidth = $tip[0].offsetWidth
- actualHeight = $tip[0].offsetHeight
- }
-
- this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
- } else {
- this.replaceArrow(actualHeight - height, actualHeight, 'top')
- }
-
- if (replace) $tip.offset(offset)
- }
-
- Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
- this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '')
- }
-
- 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 () {
- var that = this
- var $tip = this.tip()
- var e = $.Event('hide.bs.' + this.type)
-
- function complete() {
- if (that.hoverState != 'in') $tip.detach()
- that.$element.trigger('hidden.bs.' + that.type)
- }
-
- this.$element.trigger(e)
-
- if (e.isDefaultPrevented()) return
-
- $tip.removeClass('in')
-
- $.support.transition && this.$tip.hasClass('fade') ?
- $tip
- .one($.support.transition.end, complete)
- .emulateTransitionEnd(150) :
- 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 () {
- var el = this.$element[0]
- return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
- width: el.offsetWidth,
- height: el.offsetHeight
- }, this.$element.offset())
- }
-
- 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.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.tip = function () {
- return this.$tip = this.$tip || $(this.options.template)
- }
-
- Tooltip.prototype.arrow = function () {
- return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
- }
-
- Tooltip.prototype.validate = function () {
- if (!this.$element[0].parentNode) {
- this.hide()
- this.$element = null
- this.options = null
- }
- }
-
- 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 = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
- self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
- }
-
- Tooltip.prototype.destroy = function () {
- clearTimeout(this.timeout)
- this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
- }
-
-
- // TOOLTIP PLUGIN DEFINITION
- // =========================
-
- var old = $.fn.tooltip
-
- $.fn.tooltip = function (option) {
- return this.each(function () {
- var $this = $(this)
- var data = $this.data('bs.tooltip')
- var options = typeof option == 'object' && option
-
- if (!data && option == 'destroy') return
- if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.tooltip.Constructor = Tooltip
-
-
- // TOOLTIP NO CONFLICT
- // ===================
-
- $.fn.tooltip.noConflict = function () {
- $.fn.tooltip = old
- return this
- }
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: popover.js v3.1.1
- * http://getbootstrap.com/javascript/#popovers
- * ========================================================================
- * Copyright 2011-2014 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.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
- placement: 'right',
- trigger: 'click',
- content: '',
- template: ''
- })
-
-
- // 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')[ // 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.prototype.tip = function () {
- if (!this.$tip) this.$tip = $(this.options.template)
- return this.$tip
- }
-
-
- // POPOVER PLUGIN DEFINITION
- // =========================
-
- var old = $.fn.popover
-
- $.fn.popover = function (option) {
- return this.each(function () {
- var $this = $(this)
- var data = $this.data('bs.popover')
- var options = typeof option == 'object' && option
-
- if (!data && option == 'destroy') return
- if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.popover.Constructor = Popover
-
-
- // POPOVER NO CONFLICT
- // ===================
-
- $.fn.popover.noConflict = function () {
- $.fn.popover = old
- return this
- }
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: scrollspy.js v3.1.1
- * http://getbootstrap.com/javascript/#scrollspy
- * ========================================================================
- * Copyright 2011-2014 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
- 'use strict';
-
- // SCROLLSPY CLASS DEFINITION
- // ==========================
-
- function ScrollSpy(element, options) {
- var href
- var process = $.proxy(this.process, this)
-
- this.$element = $(element).is('body') ? $(window) : $(element)
- this.$body = $('body')
- this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
- this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
- this.selector = (this.options.target
- || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
- || '') + ' .nav li > a'
- this.offsets = $([])
- this.targets = $([])
- this.activeTarget = null
-
- this.refresh()
- this.process()
- }
-
- ScrollSpy.DEFAULTS = {
- offset: 10
- }
-
- ScrollSpy.prototype.refresh = function () {
- var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
-
- this.offsets = $([])
- this.targets = $([])
-
- var self = this
- var $targets = 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 + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
- })
- .sort(function (a, b) { return a[0] - b[0] })
- .each(function () {
- self.offsets.push(this[0])
- self.targets.push(this[1])
- })
- }
-
- ScrollSpy.prototype.process = function () {
- var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
- var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
- var maxScroll = scrollHeight - this.$scrollElement.height()
- var offsets = this.offsets
- var targets = this.targets
- var activeTarget = this.activeTarget
- var i
-
- if (scrollTop >= maxScroll) {
- return activeTarget != (i = targets.last()[0]) && this.activate(i)
- }
-
- if (activeTarget && scrollTop <= offsets[0]) {
- return activeTarget != (i = targets[0]) && this.activate(i)
- }
-
- for (i = offsets.length; i--;) {
- activeTarget != targets[i]
- && scrollTop >= offsets[i]
- && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
- && this.activate( targets[i] )
- }
- }
-
- ScrollSpy.prototype.activate = function (target) {
- this.activeTarget = target
-
- $(this.selector)
- .parentsUntil(this.options.target, '.active')
- .removeClass('active')
-
- 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 PLUGIN DEFINITION
- // ===========================
-
- var old = $.fn.scrollspy
-
- $.fn.scrollspy = function (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]()
- })
- }
-
- $.fn.scrollspy.Constructor = ScrollSpy
-
-
- // SCROLLSPY NO CONFLICT
- // =====================
-
- $.fn.scrollspy.noConflict = function () {
- $.fn.scrollspy = old
- return this
- }
-
-
- // SCROLLSPY DATA-API
- // ==================
-
- $(window).on('load', function () {
- $('[data-spy="scroll"]').each(function () {
- var $spy = $(this)
- $spy.scrollspy($spy.data())
- })
- })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: tab.js v3.1.1
- * http://getbootstrap.com/javascript/#tabs
- * ========================================================================
- * Copyright 2011-2014 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
- 'use strict';
-
- // TAB CLASS DEFINITION
- // ====================
-
- var Tab = function (element) {
- this.element = $(element)
- }
-
- 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')[0]
- var e = $.Event('show.bs.tab', {
- relatedTarget: previous
- })
-
- $this.trigger(e)
-
- if (e.isDefaultPrevented()) return
-
- var $target = $(selector)
-
- this.activate($this.parent('li'), $ul)
- this.activate($target, $target.parent(), function () {
- $this.trigger({
- type: 'shown.bs.tab',
- relatedTarget: previous
- })
- })
- }
-
- Tab.prototype.activate = function (element, container, callback) {
- var $active = container.find('> .active')
- var transition = callback
- && $.support.transition
- && $active.hasClass('fade')
-
- function next() {
- $active
- .removeClass('active')
- .find('> .dropdown-menu > .active')
- .removeClass('active')
-
- element.addClass('active')
-
- if (transition) {
- element[0].offsetWidth // reflow for transition
- element.addClass('in')
- } else {
- element.removeClass('fade')
- }
-
- if (element.parent('.dropdown-menu')) {
- element.closest('li.dropdown').addClass('active')
- }
-
- callback && callback()
- }
-
- transition ?
- $active
- .one($.support.transition.end, next)
- .emulateTransitionEnd(150) :
- next()
-
- $active.removeClass('in')
- }
-
-
- // TAB PLUGIN DEFINITION
- // =====================
-
- var old = $.fn.tab
-
- $.fn.tab = function ( 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]()
- })
- }
-
- $.fn.tab.Constructor = Tab
-
-
- // TAB NO CONFLICT
- // ===============
-
- $.fn.tab.noConflict = function () {
- $.fn.tab = old
- return this
- }
-
-
- // TAB DATA-API
- // ============
-
- $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
- e.preventDefault()
- $(this).tab('show')
- })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: affix.js v3.1.1
- * http://getbootstrap.com/javascript/#affix
- * ========================================================================
- * Copyright 2011-2014 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.$window = $(window)
- .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 =
- this.unpin =
- this.pinnedOffset = null
-
- this.checkPosition()
- }
-
- Affix.RESET = 'affix affix-top affix-bottom'
-
- Affix.DEFAULTS = {
- offset: 0
- }
-
- Affix.prototype.getPinnedOffset = function () {
- if (this.pinnedOffset) return this.pinnedOffset
- this.$element.removeClass(Affix.RESET).addClass('affix')
- var scrollTop = this.$window.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 scrollHeight = $(document).height()
- var scrollTop = this.$window.scrollTop()
- var position = this.$element.offset()
- var offset = this.options.offset
- var offsetTop = offset.top
- var offsetBottom = offset.bottom
-
- if (this.affixed == 'top') position.top += scrollTop
-
- 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.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
- offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
- offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
-
- if (this.affixed === affix) return
- if (this.unpin) 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($.Event(affixType.replace('affix', 'affixed')))
-
- if (affix == 'bottom') {
- this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() })
- }
- }
-
-
- // AFFIX PLUGIN DEFINITION
- // =======================
-
- var old = $.fn.affix
-
- $.fn.affix = function (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]()
- })
- }
-
- $.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) data.offset.bottom = data.offsetBottom
- if (data.offsetTop) data.offset.top = data.offsetTop
-
- $spy.affix(data)
- })
- })
-
-}(jQuery);
diff --git a/public/js/vendor/jquery.min.js b/public/js/vendor/jquery.min.js
deleted file mode 100755
index 73f33fb..0000000
--- a/public/js/vendor/jquery.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
-!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f
-}}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML=" a",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/\s*$/g,sb={option:[1,""],legend:[1,""],area:[1,""],param:[1,""],thead:[1,""],tr:[2,""],col:[2,""],td:[3,""],_default:l.htmlSerialize?[0,"",""]:[1,"X","
"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1>$2>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?""!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1>$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("")).appendTo(b.documentElement),b=(Db[0].contentWindow||Db[0].contentDocument).document,b.write(),b.close(),c=Fb(a,b),Db.detach()),Eb[a]=c),c}!function(){var a,b,c=z.createElement("div"),d="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";c.innerHTML=" a",a=c.getElementsByTagName("a")[0],a.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(a.style.opacity),l.cssFloat=!!a.style.cssFloat,c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===c.style.backgroundClip,a=c=null,l.shrinkWrapBlocks=function(){var a,c,e,f;if(null==b){if(a=z.getElementsByTagName("body")[0],!a)return;f="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",c=z.createElement("div"),e=z.createElement("div"),a.appendChild(c).appendChild(e),b=!1,typeof e.style.zoom!==L&&(e.style.cssText=d+";width:1px;padding:1px;zoom:1",e.innerHTML="",e.firstChild.style.width="5px",b=3!==e.offsetWidth),a.removeChild(c),a=c=e=null}return b}}();var Hb=/^margin/,Ib=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Jb,Kb,Lb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Jb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),Ib.test(g)&&Hb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):z.documentElement.currentStyle&&(Jb=function(a){return a.currentStyle},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ib.test(g)&&!Lb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Mb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h=z.createElement("div"),i="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",j="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";h.innerHTML=" a",b=h.getElementsByTagName("a")[0],b.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(b.style.opacity),l.cssFloat=!!b.style.cssFloat,h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,b=h=null,n.extend(l,{reliableHiddenOffsets:function(){if(null!=c)return c;var a,b,d,e=z.createElement("div"),f=z.getElementsByTagName("body")[0];if(f)return e.setAttribute("className","t"),e.innerHTML=" a",a=z.createElement("div"),a.style.cssText=i,f.appendChild(a).appendChild(e),e.innerHTML="",b=e.getElementsByTagName("td"),b[0].style.cssText="padding:0;margin:0;border:0;display:none",d=0===b[0].offsetHeight,b[0].style.display="",b[1].style.display="none",c=d&&0===b[0].offsetHeight,f.removeChild(a),e=f=null,c},boxSizing:function(){return null==d&&k(),d},boxSizingReliable:function(){return null==e&&k(),e},pixelPosition:function(){return null==f&&k(),f},reliableMarginRight:function(){var b,c,d,e;if(null==g&&a.getComputedStyle){if(b=z.getElementsByTagName("body")[0],!b)return;c=z.createElement("div"),d=z.createElement("div"),c.style.cssText=i,b.appendChild(c).appendChild(d),e=d.appendChild(z.createElement("div")),e.style.cssText=d.style.cssText=j,e.style.marginRight=e.style.width="0",d.style.width="1px",g=!parseFloat((a.getComputedStyle(e,null)||{}).marginRight),b.removeChild(c)}return g}});function k(){var b,c,h=z.getElementsByTagName("body")[0];h&&(b=z.createElement("div"),c=z.createElement("div"),b.style.cssText=i,h.appendChild(b).appendChild(c),c.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;display:block;padding:1px;border:1px;width:4px;margin-top:1%;top:1%",n.swap(h,null!=h.style.zoom?{zoom:1}:{},function(){d=4===c.offsetWidth}),e=!0,f=!1,g=!0,a.getComputedStyle&&(f="1%"!==(a.getComputedStyle(c,null)||{}).top,e="4px"===(a.getComputedStyle(c,null)||{width:"4px"}).width),h.removeChild(b),c=h=null)}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Nb=/alpha\([^)]*\)/i,Ob=/opacity\s*=\s*([^)]*)/,Pb=/^(none|table(?!-c[ea]).+)/,Qb=new RegExp("^("+T+")(.*)$","i"),Rb=new RegExp("^([+-])=("+T+")","i"),Sb={position:"absolute",visibility:"hidden",display:"block"},Tb={letterSpacing:0,fontWeight:400},Ub=["Webkit","O","Moz","ms"];function Vb(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ub.length;while(e--)if(b=Ub[e]+c,b in a)return b;return d}function Wb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=n._data(d,"olddisplay",Gb(d.nodeName)))):f[g]||(e=V(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Xb(a,b,c){var d=Qb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Yb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Zb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Jb(a),g=l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Kb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ib.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Yb(a,b,c||(g?"border":"content"),d,f)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Kb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=Vb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Rb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]="",i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Vb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Kb(a,b,d)),"normal"===f&&b in Tb&&(f=Tb[b]),""===c||c?(e=parseFloat(f),c===!0||n.isNumeric(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&Pb.test(n.css(a,"display"))?n.swap(a,Sb,function(){return Zb(a,b,d)}):Zb(a,b,d):void 0},set:function(a,c,d){var e=d&&Jb(a);return Xb(a,c,d?Yb(a,b,d,l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Ob.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Nb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Nb.test(f)?f.replace(Nb,e):f+" "+e)}}),n.cssHooks.marginRight=Mb(l.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},Kb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Hb.test(a)||(n.cssHooks[a+b].set=Xb)}),n.fn.extend({css:function(a,b){return W(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Jb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)
-},a,b,arguments.length>1)},show:function(){return Wb(this,!0)},hide:function(){return Wb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function $b(a,b,c,d,e){return new $b.prototype.init(a,b,c,d,e)}n.Tween=$b,$b.prototype={constructor:$b,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=$b.propHooks[this.prop];return a&&a.get?a.get(this):$b.propHooks._default.get(this)},run:function(a){var b,c=$b.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):$b.propHooks._default.set(this),this}},$b.prototype.init.prototype=$b.prototype,$b.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},$b.propHooks.scrollTop=$b.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=$b.prototype.init,n.fx.step={};var _b,ac,bc=/^(?:toggle|show|hide)$/,cc=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),dc=/queueHooks$/,ec=[jc],fc={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=cc.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&cc.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function gc(){return setTimeout(function(){_b=void 0}),_b=n.now()}function hc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=U[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function ic(a,b,c){for(var d,e=(fc[b]||[]).concat(fc["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function jc(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&V(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k=Gb(a.nodeName),"none"===j&&(j=k),"inline"===j&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==k?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],bc.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}if(!n.isEmptyObject(o)){r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=ic(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function kc(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function lc(a,b,c){var d,e,f=0,g=ec.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=_b||gc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:_b||gc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(kc(k,j.opts.specialEasing);g>f;f++)if(d=ec[f].call(j,a,k,j.opts))return d;return n.map(k,ic,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(lc,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],fc[c]=fc[c]||[],fc[c].unshift(b)},prefilter:function(a,b){b?ec.unshift(a):ec.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=lc(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&dc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(hc(b,!0),a,d,e)}}),n.each({slideDown:hc("show"),slideUp:hc("hide"),slideToggle:hc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(_b=n.now();ca",a=e.getElementsByTagName("a")[0],c=z.createElement("select"),d=c.appendChild(z.createElement("option")),b=e.getElementsByTagName("input")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==e.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=d.selected,l.enctype=!!z.createElement("form").enctype,c.disabled=!0,l.optDisabled=!d.disabled,b=z.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value,a=b=c=d=e=null}();var mc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(mc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.text(a)}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(l.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var nc,oc,pc=n.expr.attrHandle,qc=/^(?:checked|selected)$/i,rc=l.getSetAttribute,sc=l.input;n.fn.extend({attr:function(a,b){return W(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===L?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?oc:nc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(F);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?sc&&rc||!qc.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(rc?c:d)},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),oc={set:function(a,b,c){return b===!1?n.removeAttr(a,c):sc&&rc||!qc.test(c)?a.setAttribute(!rc&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=pc[b]||n.find.attr;pc[b]=sc&&rc||!qc.test(b)?function(a,b,d){var e,f;return d||(f=pc[b],pc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,pc[b]=f),e}:function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),sc&&rc||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):nc&&nc.set(a,b,c)}}),rc||(nc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},pc.id=pc.name=pc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:nc.set},n.attrHooks.contenteditable={set:function(a,b,c){nc.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var tc=/^(?:input|select|textarea|button|object)$/i,uc=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return W(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):tc.test(a.nodeName)||uc.test(a.nodeName)&&a.href?0:-1}}}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var vc=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(F)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===L||"boolean"===c)&&(this.className&&n._data(this,"__className__",this.className),this.className=this.className||a===!1?"":n._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(vc," ").indexOf(b)>=0)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var wc=n.now(),xc=/\?/,yc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(yc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var zc,Ac,Bc=/#.*$/,Cc=/([?&])_=[^&]*/,Dc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ec=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Fc=/^(?:GET|HEAD)$/,Gc=/^\/\//,Hc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ic={},Jc={},Kc="*/".concat("*");try{Ac=location.href}catch(Lc){Ac=z.createElement("a"),Ac.href="",Ac=Ac.href}zc=Hc.exec(Ac.toLowerCase())||[];function Mc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(F)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nc(a,b,c,d){var e={},f=a===Jc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Oc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Pc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Qc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ac,type:"GET",isLocal:Ec.test(zc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Oc(Oc(a,n.ajaxSettings),b):Oc(n.ajaxSettings,a)},ajaxPrefilter:Mc(Ic),ajaxTransport:Mc(Jc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Dc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||Ac)+"").replace(Bc,"").replace(Gc,zc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(F)||[""],null==k.crossDomain&&(c=Hc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===zc[1]&&c[2]===zc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(zc[3]||("http:"===zc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),Nc(Ic,k,b,v),2===t)return v;h=k.global,h&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Fc.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(xc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Cc.test(e)?e.replace(Cc,"$1_="+wc++):e+(xc.test(e)?"&":"?")+"_="+wc++)),k.ifModified&&(n.lastModified[e]&&v.setRequestHeader("If-Modified-Since",n.lastModified[e]),n.etag[e]&&v.setRequestHeader("If-None-Match",n.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Kc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Nc(Jc,k,b,v)){v.readyState=1,h&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Pc(k,v,c)),u=Qc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(n.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!l.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||n.css(a,"display"))},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var Rc=/%20/g,Sc=/\[\]$/,Tc=/\r?\n/g,Uc=/^(?:submit|button|image|reset|file)$/i,Vc=/^(?:input|select|textarea|keygen)/i;function Wc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Sc.test(a)?d(a,e):Wc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Wc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Wc(c,a[c],b,e);return d.join("&").replace(Rc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Vc.test(this.nodeName)&&!Uc.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Tc,"\r\n")}}):{name:b.name,value:c.replace(Tc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&$c()||_c()}:$c;var Xc=0,Yc={},Zc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Yc)Yc[a](void 0,!0)}),l.cors=!!Zc&&"withCredentials"in Zc,Zc=l.ajax=!!Zc,Zc&&n.ajaxTransport(function(a){if(!a.crossDomain||l.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Xc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Yc[g],b=void 0,f.onreadystatechange=n.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Yc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function $c(){try{return new a.XMLHttpRequest}catch(b){}}function _c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=z.head||n("head")[0]||z.documentElement;return{send:function(d,e){b=z.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var ad=[],bd=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ad.pop()||n.expando+"_"+wc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(bd.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&bd.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(bd,"$1"+e):b.jsonp!==!1&&(b.url+=(xc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,ad.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||z;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var cd=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&cd)return cd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=a.slice(h,a.length),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&n.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?n("").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var dd=a.document.documentElement;function ed(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?(typeof e.getBoundingClientRect!==L&&(d=e.getBoundingClientRect()),c=ed(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||dd;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||dd})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return W(this,function(a,d,e){var f=ed(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Mb(l.pixelPosition,function(a,c){return c?(c=Kb(a,b),Ib.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return W(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var fd=a.jQuery,gd=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=gd),b&&a.jQuery===n&&(a.jQuery=fd),n},typeof b===L&&(a.jQuery=a.$=n),n});
diff --git a/public/js/vendor/nprogress.js b/public/js/vendor/nprogress.js
deleted file mode 100755
index f8f0d68..0000000
--- a/public/js/vendor/nprogress.js
+++ /dev/null
@@ -1,275 +0,0 @@
-/*! NProgress (c) 2013, Rico Sta. Cruz
- * http://ricostacruz.com/nprogress */
-
-;(function(factory) {
-
- if (typeof module === 'function') {
- module.exports = factory(this.jQuery || require('jquery'));
- } else {
- this.NProgress = factory(this.jQuery);
- }
-
-})(function($) {
- var NProgress = {};
-
- NProgress.version = '0.1.2';
-
- var Settings = NProgress.settings = {
- minimum: 0.08,
- easing: 'ease',
- positionUsing: '',
- speed: 200,
- trickle: true,
- trickleRate: 0.02,
- trickleSpeed: 800,
- showSpinner: true,
- template: '
'
- };
-
- /**
- * Updates configuration.
- *
- * NProgress.configure({
- * minimum: 0.1
- * });
- */
- NProgress.configure = function(options) {
- $.extend(Settings, options);
- return this;
- };
-
- /**
- * Last number.
- */
-
- NProgress.status = null;
-
- /**
- * Sets the progress bar status, where `n` is a number from `0.0` to `1.0`.
- *
- * NProgress.set(0.4);
- * NProgress.set(1.0);
- */
-
- NProgress.set = function(n) {
- var started = NProgress.isStarted();
-
- n = clamp(n, Settings.minimum, 1);
- NProgress.status = (n === 1 ? null : n);
-
- var $progress = NProgress.render(!started),
- $bar = $progress.find('[role="bar"]'),
- speed = Settings.speed,
- ease = Settings.easing;
-
- $progress[0].offsetWidth; /* Repaint */
-
- $progress.queue(function(next) {
- // Set positionUsing if it hasn't already been set
- if (Settings.positionUsing === '') Settings.positionUsing = NProgress.getPositioningCSS();
-
- // Add transition
- $bar.css(barPositionCSS(n, speed, ease));
-
- if (n === 1) {
- // Fade out
- $progress.css({ transition: 'none', opacity: 1 });
- $progress[0].offsetWidth; /* Repaint */
-
- setTimeout(function() {
- $progress.css({ transition: 'all '+speed+'ms linear', opacity: 0 });
- setTimeout(function() {
- NProgress.remove();
- next();
- }, speed);
- }, speed);
- } else {
- setTimeout(next, speed);
- }
- });
-
- return this;
- };
-
- NProgress.isStarted = function() {
- return typeof NProgress.status === 'number';
- };
-
- /**
- * Shows the progress bar.
- * This is the same as setting the status to 0%, except that it doesn't go backwards.
- *
- * NProgress.start();
- *
- */
- NProgress.start = function() {
- if (!NProgress.status) NProgress.set(0);
-
- var work = function() {
- setTimeout(function() {
- if (!NProgress.status) return;
- NProgress.trickle();
- work();
- }, Settings.trickleSpeed);
- };
-
- if (Settings.trickle) work();
-
- return this;
- };
-
- /**
- * Hides the progress bar.
- * This is the *sort of* the same as setting the status to 100%, with the
- * difference being `done()` makes some placebo effect of some realistic motion.
- *
- * NProgress.done();
- *
- * If `true` is passed, it will show the progress bar even if its hidden.
- *
- * NProgress.done(true);
- */
-
- NProgress.done = function(force) {
- if (!force && !NProgress.status) return this;
-
- return NProgress.inc(0.3 + 0.5 * Math.random()).set(1);
- };
-
- /**
- * Increments by a random amount.
- */
-
- NProgress.inc = function(amount) {
- var n = NProgress.status;
-
- if (!n) {
- return NProgress.start();
- } else {
- if (typeof amount !== 'number') {
- amount = (1 - n) * clamp(Math.random() * n, 0.1, 0.95);
- }
-
- n = clamp(n + amount, 0, 0.994);
- return NProgress.set(n);
- }
- };
-
- NProgress.trickle = function() {
- return NProgress.inc(Math.random() * Settings.trickleRate);
- };
-
- /**
- * (Internal) renders the progress bar markup based on the `template`
- * setting.
- */
-
- NProgress.render = function(fromStart) {
- if (NProgress.isRendered()) return $("#nprogress");
- $('html').addClass('nprogress-busy');
-
- var $el = $("
")
- .html(Settings.template);
-
- var perc = fromStart ? '-100' : toBarPerc(NProgress.status || 0);
-
- $el.find('[role="bar"]').css({
- transition: 'all 0 linear',
- transform: 'translate3d('+perc+'%,0,0)'
- });
-
- if (!Settings.showSpinner)
- $el.find('[role="spinner"]').remove();
-
- $el.appendTo(document.body);
-
- return $el;
- };
-
- /**
- * Removes the element. Opposite of render().
- */
-
- NProgress.remove = function() {
- $('html').removeClass('nprogress-busy');
- $('#nprogress').remove();
- };
-
- /**
- * Checks if the progress bar is rendered.
- */
-
- NProgress.isRendered = function() {
- return ($("#nprogress").length > 0);
- };
-
- /**
- * Determine which positioning CSS rule to use.
- */
-
- NProgress.getPositioningCSS = function() {
- // Sniff on document.body.style
- var bodyStyle = document.body.style;
-
- // Sniff prefixes
- var vendorPrefix = ('WebkitTransform' in bodyStyle) ? 'Webkit' :
- ('MozTransform' in bodyStyle) ? 'Moz' :
- ('msTransform' in bodyStyle) ? 'ms' :
- ('OTransform' in bodyStyle) ? 'O' : '';
-
- if (vendorPrefix + 'Perspective' in bodyStyle) {
- // Modern browsers with 3D support, e.g. Webkit, IE10
- return 'translate3d';
- } else if (vendorPrefix + 'Transform' in bodyStyle) {
- // Browsers without 3D support, e.g. IE9
- return 'translate';
- } else {
- // Browsers without translate() support, e.g. IE7-8
- return 'margin';
- }
- };
-
- /**
- * Helpers
- */
-
- function clamp(n, min, max) {
- if (n < min) return min;
- if (n > max) return max;
- return n;
- }
-
- /**
- * (Internal) converts a percentage (`0..1`) to a bar translateX
- * percentage (`-100%..0%`).
- */
-
- function toBarPerc(n) {
- return (-1 + n) * 100;
- }
-
-
- /**
- * (Internal) returns the correct CSS for changing the bar's
- * position given an n percentage, and speed and ease from Settings
- */
-
- function barPositionCSS(n, speed, ease) {
- var barCSS;
-
- if (Settings.positionUsing === 'translate3d') {
- barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' };
- } else if (Settings.positionUsing === 'translate') {
- barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' };
- } else {
- barCSS = { 'margin-left': toBarPerc(n)+'%' };
- }
-
- barCSS.transition = 'all '+speed+'ms '+ease;
-
- return barCSS;
- }
-
- return NProgress;
-});
-
diff --git a/public/js/vendor/sjcl.js b/public/js/vendor/sjcl.js
deleted file mode 100755
index 3a1c15b..0000000
--- a/public/js/vendor/sjcl.js
+++ /dev/null
@@ -1,47 +0,0 @@
-"use strict";function q(a){throw a;}var t=void 0,u=!1;var sjcl={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(a){this.toString=function(){return"CORRUPT: "+this.message};this.message=a},invalid:function(a){this.toString=function(){return"INVALID: "+this.message};this.message=a},bug:function(a){this.toString=function(){return"BUG: "+this.message};this.message=a},notReady:function(a){this.toString=function(){return"NOT READY: "+this.message};this.message=a}}};
-"undefined"!=typeof module&&module.exports&&(module.exports=sjcl);
-sjcl.cipher.aes=function(a){this.j[0][0][0]||this.D();var b,c,d,e,f=this.j[0][4],g=this.j[1];b=a.length;var h=1;4!==b&&(6!==b&&8!==b)&&q(new sjcl.exception.invalid("invalid aes key size"));this.a=[d=a.slice(0),e=[]];for(a=b;a<4*b+28;a++){c=d[a-1];if(0===a%b||8===b&&4===a%b)c=f[c>>>24]<<24^f[c>>16&255]<<16^f[c>>8&255]<<8^f[c&255],0===a%b&&(c=c<<8^c>>>24^h<<24,h=h<<1^283*(h>>7));d[a]=d[a-b]^c}for(b=0;a;b++,a--)c=d[b&3?a:a-4],e[b]=4>=a||4>b?c:g[0][f[c>>>24]]^g[1][f[c>>16&255]]^g[2][f[c>>8&255]]^g[3][f[c&
-255]]};
-sjcl.cipher.aes.prototype={encrypt:function(a){return y(this,a,0)},decrypt:function(a){return y(this,a,1)},j:[[[],[],[],[],[]],[[],[],[],[],[]]],D:function(){var a=this.j[0],b=this.j[1],c=a[4],d=b[4],e,f,g,h=[],l=[],k,n,m,p;for(e=0;0x100>e;e++)l[(h[e]=e<<1^283*(e>>7))^e]=e;for(f=g=0;!c[f];f^=k||1,g=l[g]||1){m=g^g<<1^g<<2^g<<3^g<<4;m=m>>8^m&255^99;c[f]=m;d[m]=f;n=h[e=h[k=h[f]]];p=0x1010101*n^0x10001*e^0x101*k^0x1010100*f;n=0x101*h[m]^0x1010100*m;for(e=0;4>e;e++)a[e][f]=n=n<<24^n>>>8,b[e][m]=p=p<<24^p>>>8}for(e=
-0;5>e;e++)a[e]=a[e].slice(0),b[e]=b[e].slice(0)}};
-function y(a,b,c){4!==b.length&&q(new sjcl.exception.invalid("invalid aes block size"));var d=a.a[c],e=b[0]^d[0],f=b[c?3:1]^d[1],g=b[2]^d[2];b=b[c?1:3]^d[3];var h,l,k,n=d.length/4-2,m,p=4,s=[0,0,0,0];h=a.j[c];a=h[0];var r=h[1],v=h[2],w=h[3],x=h[4];for(m=0;m
>>24]^r[f>>16&255]^v[g>>8&255]^w[b&255]^d[p],l=a[f>>>24]^r[g>>16&255]^v[b>>8&255]^w[e&255]^d[p+1],k=a[g>>>24]^r[b>>16&255]^v[e>>8&255]^w[f&255]^d[p+2],b=a[b>>>24]^r[e>>16&255]^v[f>>8&255]^w[g&255]^d[p+3],p+=4,e=h,f=l,g=k;for(m=0;4>
-m;m++)s[c?3&-m:m]=x[e>>>24]<<24^x[f>>16&255]<<16^x[g>>8&255]<<8^x[b&255]^d[p++],h=e,e=f,f=g,g=b,b=h;return s}
-sjcl.bitArray={bitSlice:function(a,b,c){a=sjcl.bitArray.O(a.slice(b/32),32-(b&31)).slice(1);return c===t?a:sjcl.bitArray.clamp(a,c-b)},extract:function(a,b,c){var d=Math.floor(-b-c&31);return((b+c-1^b)&-32?a[b/32|0]<<32-d^a[b/32+1|0]>>>d:a[b/32|0]>>>d)&(1<>b-1,1));return a},partial:function(a,b,c){return 32===a?b:(c?b|0:b<<32-a)+0x10000000000*a},getPartial:function(a){return Math.round(a/0x10000000000)||32},equal:function(a,b){if(sjcl.bitArray.bitLength(a)!==sjcl.bitArray.bitLength(b))return u;var c=0,d;for(d=0;d>>b),c=a[e]<<32-b;e=a.length?a[a.length-1]:0;a=sjcl.bitArray.getPartial(e);d.push(sjcl.bitArray.partial(b+a&31,32>>24),e<<=8;return decodeURIComponent(escape(b))},toBits:function(a){a=unescape(encodeURIComponent(a));var b=[],c,d=0;for(c=0;c>>e)>>>26),6>e?(g=a[c]<<6-e,e+=26,c++):(g<<=6,e-=6);for(;d.length&3&&!b;)d+="=";return d},toBits:function(a,b){a=a.replace(/\s|=/g,"");var c=[],d,e=0,f=sjcl.codec.base64.I,g=0,h;b&&(f=f.substr(0,62)+"-_");for(d=0;dh&&q(new sjcl.exception.invalid("this isn't base64!")),26>>e),g=h<<32-e):(e+=6,g^=h<<32-e);e&56&&c.push(sjcl.bitArray.partial(e&56,g,1));return c}};sjcl.codec.base64url={fromBits:function(a){return sjcl.codec.base64.fromBits(a,1,1)},toBits:function(a){return sjcl.codec.base64.toBits(a,1)}};sjcl.hash.sha256=function(a){this.a[0]||this.D();a?(this.q=a.q.slice(0),this.m=a.m.slice(0),this.g=a.g):this.reset()};sjcl.hash.sha256.hash=function(a){return(new sjcl.hash.sha256).update(a).finalize()};
-sjcl.hash.sha256.prototype={blockSize:512,reset:function(){this.q=this.M.slice(0);this.m=[];this.g=0;return this},update:function(a){"string"===typeof a&&(a=sjcl.codec.utf8String.toBits(a));var b,c=this.m=sjcl.bitArray.concat(this.m,a);b=this.g;a=this.g=b+sjcl.bitArray.bitLength(a);for(b=512+b&-512;b<=a;b+=512)z(this,c.splice(0,16));return this},finalize:function(){var a,b=this.m,c=this.q,b=sjcl.bitArray.concat(b,[sjcl.bitArray.partial(1,1)]);for(a=b.length+2;a&15;a++)b.push(0);b.push(Math.floor(this.g/
-4294967296));for(b.push(this.g|0);b.length;)z(this,b.splice(0,16));this.reset();return c},M:[],a:[],D:function(){function a(a){return 0x100000000*(a-Math.floor(a))|0}var b=0,c=2,d;a:for(;64>b;c++){for(d=2;d*d<=c;d++)if(0===c%d)continue a;8>b&&(this.M[b]=a(Math.pow(c,0.5)));this.a[b]=a(Math.pow(c,1/3));b++}}};
-function z(a,b){var c,d,e,f=b.slice(0),g=a.q,h=a.a,l=g[0],k=g[1],n=g[2],m=g[3],p=g[4],s=g[5],r=g[6],v=g[7];for(c=0;64>c;c++)16>c?d=f[c]:(d=f[c+1&15],e=f[c+14&15],d=f[c&15]=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+f[c&15]+f[c+9&15]|0),d=d+v+(p>>>6^p>>>11^p>>>25^p<<26^p<<21^p<<7)+(r^p&(s^r))+h[c],v=r,r=s,s=p,p=m+d|0,m=n,n=k,k=l,l=d+(k&n^m&(k^n))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;g[0]=g[0]+l|0;g[1]=g[1]+k|0;g[2]=g[2]+n|0;g[3]=g[3]+m|0;g[4]=g[4]+p|0;g[5]=g[5]+s|0;g[6]=
-g[6]+r|0;g[7]=g[7]+v|0}
-sjcl.mode.ccm={name:"ccm",encrypt:function(a,b,c,d,e){var f,g=b.slice(0),h=sjcl.bitArray,l=h.bitLength(c)/8,k=h.bitLength(g)/8;e=e||64;d=d||[];7>l&&q(new sjcl.exception.invalid("ccm: iv must be at least 7 bytes"));for(f=2;4>f&&k>>>8*f;f++);f<15-l&&(f=15-l);c=h.clamp(c,8*(15-f));b=sjcl.mode.ccm.K(a,b,c,d,e,f);g=sjcl.mode.ccm.n(a,g,c,b,e,f);return h.concat(g.data,g.tag)},decrypt:function(a,b,c,d,e){e=e||64;d=d||[];var f=sjcl.bitArray,g=f.bitLength(c)/8,h=f.bitLength(b),l=f.clamp(b,h-e),k=f.bitSlice(b,
-h-e),h=(h-e)/8;7>g&&q(new sjcl.exception.invalid("ccm: iv must be at least 7 bytes"));for(b=2;4>b&&h>>>8*b;b++);b<15-g&&(b=15-g);c=f.clamp(c,8*(15-b));l=sjcl.mode.ccm.n(a,l,c,k,e,b);a=sjcl.mode.ccm.K(a,l.data,c,d,e,b);f.equal(l.tag,a)||q(new sjcl.exception.corrupt("ccm: tag doesn't match"));return l.data},K:function(a,b,c,d,e,f){var g=[],h=sjcl.bitArray,l=h.k;e/=8;(e%2||4>e||16=c?g=[h.partial(16,c)]:0xffffffff>=c&&(g=h.concat([h.partial(16,65534)],[c]));g=h.concat(g,d);for(d=0;de.bitLength(c)&&(h=f(h,d(h)),c=e.concat(c,[-2147483648,0,0,0]));g=f(g,c);return a.encrypt(f(d(f(h,
-d(h))),g))},G:function(a){return[a[0]<<1^a[1]>>>31,a[1]<<1^a[2]>>>31,a[2]<<1^a[3]>>>31,a[3]<<1^135*(a[0]>>>31)]}};
-sjcl.mode.gcm={name:"gcm",encrypt:function(a,b,c,d,e){var f=b.slice(0);b=sjcl.bitArray;d=d||[];a=sjcl.mode.gcm.n(!0,a,f,d,c,e||128);return b.concat(a.data,a.tag)},decrypt:function(a,b,c,d,e){var f=b.slice(0),g=sjcl.bitArray,h=g.bitLength(f);e=e||128;d=d||[];e<=h?(b=g.bitSlice(f,h-e),f=g.bitSlice(f,0,h-e)):(b=f,f=[]);a=sjcl.mode.gcm.n(u,a,f,d,c,e);g.equal(a.tag,b)||q(new sjcl.exception.corrupt("gcm: tag doesn't match"));return a.data},U:function(a,b){var c,d,e,f,g,h=sjcl.bitArray.k;e=[0,0,0,0];f=b.slice(0);
-for(c=0;128>c;c++){(d=0!==(a[Math.floor(c/32)]&1<<31-c%32))&&(e=h(e,f));g=0!==(f[3]&1);for(d=3;0>>1|(f[d-1]&1)<<31;f[0]>>>=1;g&&(f[0]^=-0x1f000000)}return e},f:function(a,b,c){var d,e=c.length;b=b.slice(0);for(d=0;de&&(a=b.hash(a));for(d=0;dd||0>c)&&q(sjcl.exception.invalid("invalid params to pbkdf2"));"string"===typeof a&&(a=sjcl.codec.utf8String.toBits(a));e=e||sjcl.misc.hmac;a=new e(a);var f,g,h,l,k=[],n=sjcl.bitArray;for(l=1;32*k.length<(d||1);l++){e=f=a.encrypt(n.concat(b,[l]));for(g=1;gg;g++)e.push(0x100000000*Math.random()|0);for(g=0;g=1<this.i&&(this.i=f);this.F++;
-this.a=sjcl.hash.sha256.hash(this.a.concat(e));this.A=new sjcl.cipher.aes(this.a);for(d=0;4>d&&!(this.e[d]=this.e[d]+1|0,this.e[d]);d++);}for(d=0;d>>=1;this.b[g].update([d,this.C++,2,b,f,a.length].concat(a))}break;case "string":b===t&&(b=a.length);this.b[g].update([d,this.C++,3,b,f,a.length]);this.b[g].update(a);
-break;default:l=1}l&&q(new sjcl.exception.bug("random: addEntropy only supports number, array of numbers or string"));this.h[g]+=b;this.c+=b;h===this.l&&(this.isReady()!==this.l&&C("seeded",Math.max(this.i,this.c)),C("progress",this.getProgress()))},isReady:function(a){a=this.H[a!==t?a:this.B];return this.i&&this.i>=a?this.h[0]>this.P&&(new Date).valueOf()>this.N?this.w|this.u:this.u:this.c>=a?this.w|this.l:this.l},getProgress:function(a){a=this.H[a?a:this.B];return this.i>=a?1:this.c>a?1:this.c/
-a},startCollectors:function(){this.p||(window.addEventListener?(window.addEventListener("load",this.r,u),window.addEventListener("mousemove",this.s,u)):document.attachEvent?(document.attachEvent("onload",this.r),document.attachEvent("onmousemove",this.s)):q(new sjcl.exception.bug("can't attach event")),this.p=!0)},stopCollectors:function(){this.p&&(window.removeEventListener?(window.removeEventListener("load",this.r,u),window.removeEventListener("mousemove",this.s,u)):window.detachEvent&&(window.detachEvent("onload",
-this.r),window.detachEvent("onmousemove",this.s)),this.p=u)},addEventListener:function(a,b){this.z[a][this.S++]=b},removeEventListener:function(a,b){var c,d,e=this.z[a],f=[];for(d in e)e.hasOwnProperty(d)&&e[d]===b&&f.push(d);for(c=0;cb&&!(a.e[b]=a.e[b]+1|0,a.e[b]);b++);return a.A.encrypt(a.e)}sjcl.random=new sjcl.prng(6);try{var D=new Uint32Array(32);crypto.getRandomValues(D);sjcl.random.addEntropy(D,1024,"crypto['getRandomValues']")}catch(E){}
-sjcl.json={defaults:{v:1,iter:1E3,ks:128,ts:64,mode:"ccm",adata:"",cipher:"aes"},encrypt:function(a,b,c,d){c=c||{};d=d||{};var e=sjcl.json,f=e.d({iv:sjcl.random.randomWords(4,0)},e.defaults),g;e.d(f,c);c=f.adata;"string"===typeof f.salt&&(f.salt=sjcl.codec.base64.toBits(f.salt));"string"===typeof f.iv&&(f.iv=sjcl.codec.base64.toBits(f.iv));(!sjcl.mode[f.mode]||!sjcl.cipher[f.cipher]||"string"===typeof a&&100>=f.iter||64!==f.ts&&96!==f.ts&&128!==f.ts||128!==f.ks&&192!==f.ks&&0x100!==f.ks||2>f.iv.length||
-4=b.iter||64!==b.ts&&96!==b.ts&&128!==b.ts||128!==b.ks&&192!==b.ks&&0x100!==b.ks||!b.iv||2>b.iv.length||4>> 8) ^ (sx & 0xff) ^ 0x63;
- this.SBOX[x] = sx;
- this.INV_SBOX[sx] = x;
- x2 = d[x];
- x4 = d[x2];
- x8 = d[x4];
- t = (d[sx] * 0x101) ^ (sx * 0x1010100);
- this.SUB_MIX[0][x] = (t << 24) | (t >>> 8);
- this.SUB_MIX[1][x] = (t << 16) | (t >>> 16);
- this.SUB_MIX[2][x] = (t << 8) | (t >>> 24);
- this.SUB_MIX[3][x] = t;
- t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);
- this.INV_SUB_MIX[0][sx] = (t << 24) | (t >>> 8);
- this.INV_SUB_MIX[1][sx] = (t << 16) | (t >>> 16);
- this.INV_SUB_MIX[2][sx] = (t << 8) | (t >>> 24);
- this.INV_SUB_MIX[3][sx] = t;
- if (x === 0) {
- x = xi = 1;
- } else {
- x = x2 ^ d[d[d[x8 ^ x2]]];
- xi ^= d[d[xi]];
- }
- }
- return true;
- };
-
- return Global;
-
- })();
-
- G = new Global();
-
- AES = (function(_super) {
- __extends(AES, _super);
-
- AES.blockSize = 4 * 4;
-
- AES.prototype.blockSize = AES.blockSize;
-
- AES.keySize = 256 / 8;
-
- AES.prototype.keySize = AES.keySize;
-
- AES.ivSize = AES.blockSize;
-
- AES.prototype.ivSize = AES.ivSize;
-
- function AES(key) {
- this._key = key.clone();
- this._doReset();
- }
-
- AES.prototype._doReset = function() {
- var invKsRow, keySize, keyWords, ksRow, ksRows, t, _i, _j;
- keyWords = this._key.words;
- keySize = this._key.sigBytes / 4;
- this._nRounds = keySize + 6;
- ksRows = (this._nRounds + 1) * 4;
- this._keySchedule = [];
- for (ksRow = _i = 0; 0 <= ksRows ? _i < ksRows : _i > ksRows; ksRow = 0 <= ksRows ? ++_i : --_i) {
- this._keySchedule[ksRow] = ksRow < keySize ? keyWords[ksRow] : (t = this._keySchedule[ksRow - 1], (ksRow % keySize) === 0 ? (t = (t << 8) | (t >>> 24), t = (G.SBOX[t >>> 24] << 24) | (G.SBOX[(t >>> 16) & 0xff] << 16) | (G.SBOX[(t >>> 8) & 0xff] << 8) | G.SBOX[t & 0xff], t ^= G.RCON[(ksRow / keySize) | 0] << 24) : keySize > 6 && ksRow % keySize === 4 ? t = (G.SBOX[t >>> 24] << 24) | (G.SBOX[(t >>> 16) & 0xff] << 16) | (G.SBOX[(t >>> 8) & 0xff] << 8) | G.SBOX[t & 0xff] : void 0, this._keySchedule[ksRow - keySize] ^ t);
- }
- this._invKeySchedule = [];
- for (invKsRow = _j = 0; 0 <= ksRows ? _j < ksRows : _j > ksRows; invKsRow = 0 <= ksRows ? ++_j : --_j) {
- ksRow = ksRows - invKsRow;
- t = this._keySchedule[ksRow - (invKsRow % 4 ? 0 : 4)];
- this._invKeySchedule[invKsRow] = invKsRow < 4 || ksRow <= 4 ? t : G.INV_SUB_MIX[0][G.SBOX[t >>> 24]] ^ G.INV_SUB_MIX[1][G.SBOX[(t >>> 16) & 0xff]] ^ G.INV_SUB_MIX[2][G.SBOX[(t >>> 8) & 0xff]] ^ G.INV_SUB_MIX[3][G.SBOX[t & 0xff]];
- }
- return true;
- };
-
- AES.prototype.encryptBlock = function(M, offset) {
- if (offset == null) {
- offset = 0;
- }
- return this._doCryptBlock(M, offset, this._keySchedule, G.SUB_MIX, G.SBOX);
- };
-
- AES.prototype.decryptBlock = function(M, offset) {
- var _ref, _ref1;
- if (offset == null) {
- offset = 0;
- }
- _ref = [M[offset + 3], M[offset + 1]], M[offset + 1] = _ref[0], M[offset + 3] = _ref[1];
- this._doCryptBlock(M, offset, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX);
- return _ref1 = [M[offset + 3], M[offset + 1]], M[offset + 1] = _ref1[0], M[offset + 3] = _ref1[1], _ref1;
- };
-
- AES.prototype.scrub = function() {
- scrub_vec(this._keySchedule);
- scrub_vec(this._invKeySchedule);
- return this._key.scrub();
- };
-
- AES.prototype._doCryptBlock = function(M, offset, keySchedule, SUB_MIX, SBOX) {
- var ksRow, round, s0, s1, s2, s3, t0, t1, t2, t3, _i, _ref;
- s0 = M[offset] ^ keySchedule[0];
- s1 = M[offset + 1] ^ keySchedule[1];
- s2 = M[offset + 2] ^ keySchedule[2];
- s3 = M[offset + 3] ^ keySchedule[3];
- ksRow = 4;
- for (round = _i = 1, _ref = this._nRounds; 1 <= _ref ? _i < _ref : _i > _ref; round = 1 <= _ref ? ++_i : --_i) {
- 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++];
- 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++];
- 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++];
- 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++];
- s0 = t0;
- s1 = t1;
- s2 = t2;
- s3 = t3;
- }
- t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];
- t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];
- t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];
- t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];
- M[offset] = t0;
- M[offset + 1] = t1;
- M[offset + 2] = t2;
- return M[offset + 3] = t3;
- };
-
- return AES;
-
- })(BlockCipher);
-
- exports.AES = AES;
-
-}).call(this);
-
-},{"./algbase":2,"./util":23}],2:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var BlockCipher, BufferedBlockAlgorithm, Hasher, StreamCipher, WordArray, util,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
-
- WordArray = require('./wordarray').WordArray;
-
- util = require('./util');
-
- BufferedBlockAlgorithm = (function() {
- BufferedBlockAlgorithm.prototype._minBufferSize = 0;
-
- function BufferedBlockAlgorithm() {
- this.reset();
- }
-
- BufferedBlockAlgorithm.prototype.reset = function() {
- this._data = new WordArray();
- return this._nDataBytes = 0;
- };
-
- BufferedBlockAlgorithm.prototype._append = function(data) {
- this._data.concat(data);
- return this._nDataBytes += data.sigBytes;
- };
-
- BufferedBlockAlgorithm.prototype._process = function(doFlush) {
- var blockSizeBytes, data, dataSigBytes, dataWords, nBlocksReady, nBytesReady, nWordsReady, offset, processedWords, _i, _ref;
- data = this._data;
- dataWords = data.words;
- dataSigBytes = data.sigBytes;
- blockSizeBytes = this.blockSize * 4;
- nBlocksReady = dataSigBytes / blockSizeBytes;
- if (doFlush) {
- nBlocksReady = Math.ceil(nBlocksReady);
- } else {
- nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
- }
- nWordsReady = nBlocksReady * this.blockSize;
- nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
- if (nWordsReady) {
- for (offset = _i = 0, _ref = this.blockSize; _ref > 0 ? _i < nWordsReady : _i > nWordsReady; offset = _i += _ref) {
- this._doProcessBlock(dataWords, offset);
- }
- processedWords = dataWords.splice(0, nWordsReady);
- data.sigBytes -= nBytesReady;
- }
- return new WordArray(processedWords, nBytesReady);
- };
-
- BufferedBlockAlgorithm.prototype.copy_to = function(out) {
- out._data = this._data.clone();
- return out._nDataBytes = this._nDataBytes;
- };
-
- BufferedBlockAlgorithm.prototype.clone = function() {
- var obj;
- obj = new BufferedBlockAlgorithm();
- this.copy_to(obj);
- return obj;
- };
-
- return BufferedBlockAlgorithm;
-
- })();
-
- Hasher = (function(_super) {
- __extends(Hasher, _super);
-
- function Hasher() {
- Hasher.__super__.constructor.call(this);
- }
-
- Hasher.prototype.reset = function() {
- Hasher.__super__.reset.call(this);
- this._doReset();
- return this;
- };
-
- Hasher.prototype.update = function(messageUpdate) {
- this._append(messageUpdate);
- this._process();
- return this;
- };
-
- Hasher.prototype.finalize = function(messageUpdate) {
- if (messageUpdate) {
- this._append(messageUpdate);
- }
- return this._doFinalize();
- };
-
- Hasher.prototype.bufhash = function(input) {
- var out, wa_in, wa_out;
- wa_in = WordArray.from_buffer(input);
- wa_out = this.finalize(wa_in);
- out = wa_out.to_buffer();
- wa_in.scrub();
- wa_out.scrub();
- return out;
- };
-
- return Hasher;
-
- })(BufferedBlockAlgorithm);
-
- exports.BlockCipher = BlockCipher = (function() {
- function BlockCipher(key) {}
-
- BlockCipher.prototype.encryptBlock = function(M, offset) {};
-
- return BlockCipher;
-
- })();
-
- StreamCipher = (function() {
- function StreamCipher() {}
-
- StreamCipher.prototype.encryptBlock = function(word_array, dst_offset) {
- var n_words, pad;
- if (dst_offset == null) {
- dst_offset = 0;
- }
- pad = this.get_pad();
- n_words = Math.min(word_array.words.length - dst_offset, this.bsiw);
- word_array.xor(pad, {
- dst_offset: dst_offset,
- n_words: n_words
- });
- pad.scrub();
- return this.bsiw;
- };
-
- StreamCipher.prototype.encrypt = function(word_array) {
- var i, _i, _ref, _ref1;
- for (i = _i = 0, _ref = word_array.words.length, _ref1 = this.bsiw; _ref1 > 0 ? _i < _ref : _i > _ref; i = _i += _ref1) {
- this.encryptBlock(word_array, i);
- }
- return word_array;
- };
-
- StreamCipher.prototype.bulk_encrypt = function(_arg, cb) {
- var async_args, input, progress_hook, slice_args, what;
- input = _arg.input, progress_hook = _arg.progress_hook, what = _arg.what;
- slice_args = {
- update: (function(_this) {
- return function(lo, hi) {
- var i, _i, _ref, _results;
- _results = [];
- for (i = _i = lo, _ref = _this.bsiw; _ref > 0 ? _i < hi : _i > hi; i = _i += _ref) {
- _results.push(_this.encryptBlock(input, i));
- }
- return _results;
- };
- })(this),
- finalize: function() {
- return input;
- },
- default_n: this.bsiw * 1024
- };
- async_args = {
- progress_hook: progress_hook,
- cb: cb,
- what: what
- };
- return util.bulk(input.sigBytes, slice_args, async_args);
- };
-
- return StreamCipher;
-
- })();
-
- exports.BlockCipher = BlockCipher;
-
- exports.Hasher = Hasher;
-
- exports.BufferedBlockAlgorithm = BufferedBlockAlgorithm;
-
- exports.StreamCipher = StreamCipher;
-
-}).call(this);
-
-},{"./util":23,"./wordarray":24}],3:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var CombineBase, Concat, HMAC, SHA3, SHA512, WordArray, XOR, bulk_sign, _ref,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
-
- _ref = require('./hmac'), HMAC = _ref.HMAC, bulk_sign = _ref.bulk_sign;
-
- SHA512 = require('./sha512').SHA512;
-
- SHA3 = require('./sha3').SHA3;
-
- WordArray = require('./wordarray').WordArray;
-
- CombineBase = (function() {
- function CombineBase() {
- this.hasherBlockSize = this.hashers[0].hasherBlockSize;
- this.hasherBlockSizeBytes = this.hasherBlockSize * 4;
- this.reset();
- }
-
- CombineBase.prototype.reset = function() {
- var h, _i, _len, _ref1;
- _ref1 = this.hashers;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- h = _ref1[_i];
- h.reset();
- }
- return this;
- };
-
- CombineBase.prototype.update = function(w) {
- var h, _i, _len, _ref1;
- _ref1 = this.hashers;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- h = _ref1[_i];
- h.update(w);
- }
- return this;
- };
-
- CombineBase.prototype.scrub = function() {
- var h, _i, _len, _ref1;
- _ref1 = this.hashers;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- h = _ref1[_i];
- h.scrub();
- }
- return this;
- };
-
- CombineBase.prototype.finalize = function(w) {
- var h, hashes, out, _i, _len, _ref1;
- hashes = (function() {
- var _i, _len, _ref1, _results;
- _ref1 = this.hashers;
- _results = [];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- h = _ref1[_i];
- _results.push(h.finalize(w));
- }
- return _results;
- }).call(this);
- out = hashes[0];
- _ref1 = hashes.slice(1);
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- h = _ref1[_i];
- this._coalesce(out, h);
- h.scrub();
- }
- return out;
- };
-
- return CombineBase;
-
- })();
-
- Concat = (function(_super) {
- __extends(Concat, _super);
-
- function Concat(key, klasses) {
- var hm, i, klass, subkey, subkeys;
- if (klasses == null) {
- klasses = [SHA512, SHA3];
- }
- subkeys = key.split(klasses.length);
- this.hashers = (function() {
- var _i, _len, _results;
- _results = [];
- for (i = _i = 0, _len = klasses.length; _i < _len; i = ++_i) {
- klass = klasses[i];
- subkey = subkeys[i];
- hm = new HMAC(subkey, klass);
- subkey.scrub();
- _results.push(hm);
- }
- return _results;
- })();
- Concat.__super__.constructor.call(this);
- }
-
- Concat.get_output_size = function() {
- return SHA512.output_size + SHA3.output_size;
- };
-
- Concat.prototype._coalesce = function(out, h) {
- return out.concat(h);
- };
-
- Concat.prototype.get_output_size = function() {
- var h, tot, _i, _len, _ref1;
- tot = 0;
- _ref1 = this.hashers;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- h = _ref1[_i];
- tot += h.get_output_size();
- }
- return tot;
- };
-
- Concat.sign = function(_arg) {
- var input, key;
- key = _arg.key, input = _arg.input;
- return (new Concat(key)).finalize(input);
- };
-
- Concat.bulk_sign = function(args, cb) {
- args.klass = Concat;
- args.what = "HMAC-SHA512-SHA3";
- return bulk_sign(args, cb);
- };
-
- return Concat;
-
- })(CombineBase);
-
- XOR = (function(_super) {
- __extends(XOR, _super);
-
- function XOR(key, klasses) {
- var klass;
- if (klasses == null) {
- klasses = [SHA512, SHA3];
- }
- this.hashers = (function() {
- var _i, _len, _results;
- _results = [];
- for (_i = 0, _len = klasses.length; _i < _len; _i++) {
- klass = klasses[_i];
- _results.push(new HMAC(key, klass));
- }
- return _results;
- })();
- XOR.__super__.constructor.call(this);
- }
-
- XOR.prototype.reset = function() {
- var h, i, _i, _len, _ref1;
- XOR.__super__.reset.call(this);
- _ref1 = this.hashers;
- for (i = _i = 0, _len = _ref1.length; _i < _len; i = ++_i) {
- h = _ref1[i];
- h.update(new WordArray([i]));
- }
- return this;
- };
-
- XOR.get_output_size = function() {
- return Math.max(SHA512.output_size, SHA3.output_size);
- };
-
- XOR.prototype._coalesce = function(out, h) {
- return out.xor(h, {});
- };
-
- XOR.prototype.get_output_size = function() {
- var h;
- return Math.max.apply(Math, (function() {
- var _i, _len, _ref1, _results;
- _ref1 = this.hashers;
- _results = [];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- h = _ref1[_i];
- _results.push(h.get_output_size());
- }
- return _results;
- }).call(this));
- };
-
- XOR.sign = function(_arg) {
- var input, key;
- key = _arg.key, input = _arg.input;
- return (new XOR(key)).finalize(input);
- };
-
- XOR.bulk_sign = function(arg, cb) {
- arg.klass = XOR;
- arg.what = "HMAC-SHA512-XOR-SHA3";
- return bulk_sign(arg, cb);
- };
-
- return XOR;
-
- })(CombineBase);
-
- exports.Concat = Concat;
-
- exports.XOR = XOR;
-
-}).call(this);
-
-},{"./hmac":8,"./sha3":19,"./sha512":21,"./wordarray":24}],4:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var Cipher, Counter, StreamCipher, WordArray, bulk_encrypt, encrypt, iced, __iced_k, __iced_k_noop,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
-
- iced = require('iced-runtime');
- __iced_k = __iced_k_noop = function() {};
-
- WordArray = require('./wordarray').WordArray;
-
- StreamCipher = require('./algbase').StreamCipher;
-
- Counter = (function() {
- Counter.prototype.WORD_MAX = 0xffffffff;
-
- function Counter(_arg) {
- var i, len, value;
- value = _arg.value, len = _arg.len;
- this._value = value != null ? value.clone() : (len == null ? len = 2 : void 0, new WordArray((function() {
- var _i, _results;
- _results = [];
- for (i = _i = 0; 0 <= len ? _i < len : _i > len; i = 0 <= len ? ++_i : --_i) {
- _results.push(0);
- }
- return _results;
- })()));
- }
-
- Counter.prototype.inc = function() {
- var go, i;
- go = true;
- i = this._value.words.length - 1;
- while (go && i >= 0) {
- if ((++this._value.words[i]) > Counter.WORD_MAX) {
- this._value.words[i] = 0;
- } else {
- go = false;
- }
- i--;
- }
- return this;
- };
-
- Counter.prototype.inc_le = function() {
- var go, i;
- go = true;
- i = 0;
- while (go && i < this._value.words.length) {
- if ((++this._value.words[i]) > Counter.WORD_MAX) {
- this._value.words[i] = 0;
- } else {
- go = false;
- }
- i++;
- }
- return this;
- };
-
- Counter.prototype.get = function() {
- return this._value;
- };
-
- Counter.prototype.copy = function() {
- return this._value.clone();
- };
-
- return Counter;
-
- })();
-
- Cipher = (function(_super) {
- __extends(Cipher, _super);
-
- function Cipher(_arg) {
- this.block_cipher = _arg.block_cipher, this.iv = _arg.iv;
- Cipher.__super__.constructor.call(this);
- this.bsiw = this.block_cipher.blockSize / 4;
- if (!(this.iv.sigBytes === this.block_cipher.blockSize)) {
- throw new Error("IV is wrong length (" + this.iv.sigBytes + ")");
- }
- this.ctr = new Counter({
- value: this.iv
- });
- }
-
- Cipher.prototype.scrub = function() {
- return this.block_cipher.scrub();
- };
-
- Cipher.prototype.get_pad = function() {
- var pad;
- pad = this.ctr.copy();
- this.ctr.inc();
- this.block_cipher.encryptBlock(pad.words);
- return pad;
- };
-
- return Cipher;
-
- })(StreamCipher);
-
- encrypt = function(_arg) {
- var block_cipher, cipher, input, iv, ret;
- block_cipher = _arg.block_cipher, iv = _arg.iv, input = _arg.input;
- cipher = new Cipher({
- block_cipher: block_cipher,
- iv: iv
- });
- ret = cipher.encrypt(input);
- cipher.scrub();
- return ret;
- };
-
- bulk_encrypt = function(_arg, cb) {
- var block_cipher, cipher, input, iv, progress_hook, ret, what, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- block_cipher = _arg.block_cipher, iv = _arg.iv, input = _arg.input, progress_hook = _arg.progress_hook, what = _arg.what;
- cipher = new Cipher({
- block_cipher: block_cipher,
- iv: iv
- });
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/ctr.iced"
- });
- cipher.bulk_encrypt({
- input: input,
- progress_hook: progress_hook,
- what: what
- }, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return ret = arguments[0];
- };
- })(),
- lineno: 121
- }));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- return cb(ret);
- };
- })(this));
- };
-
- exports.Counter = Counter;
-
- exports.Cipher = Cipher;
-
- exports.encrypt = encrypt;
-
- exports.bulk_encrypt = bulk_encrypt;
-
-}).call(this);
-
-},{"./algbase":2,"./wordarray":24,"iced-runtime":38}],5:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var AES, Base, Concat, Decryptor, SHA512, Salsa20, TwoFish, V, WordArray, ctr, decrypt, iced, make_esc, salsa20, __iced_k, __iced_k_noop, _ref,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
-
- iced = require('iced-runtime');
- __iced_k = __iced_k_noop = function() {};
-
- WordArray = require('./wordarray').WordArray;
-
- salsa20 = require('./salsa20');
-
- AES = require('./aes').AES;
-
- TwoFish = require('./twofish').TwoFish;
-
- ctr = require('./ctr');
-
- Concat = require('./combine').Concat;
-
- SHA512 = require('./sha512').SHA512;
-
- Salsa20 = require('./salsa20').Salsa20;
-
- _ref = require('./enc'), Base = _ref.Base, V = _ref.V;
-
- make_esc = require('iced-error').make_esc;
-
- Decryptor = (function(_super) {
- __extends(Decryptor, _super);
-
- function Decryptor(_arg) {
- var enc, key;
- key = _arg.key, enc = _arg.enc;
- Decryptor.__super__.constructor.call(this, {
- key: key
- });
- if (enc != null) {
- this.key = enc.key;
- this.derived_keys = enc.derived_keys;
- }
- }
-
- Decryptor.prototype.read_header = function(cb) {
- var err, wa;
- err = (wa = this.ct.unshift(2)) == null ? new Error("Ciphertext underrun in header") : (this.version = V[wa.words[1]]) == null ? new Error("bad header; couldn't find a good version (got " + wa.words[1] + ")") : wa.words[0] !== this.version.header[0] ? new Error("Bad header: unrecognized magic value") : null;
- return cb(err);
- };
-
- Decryptor.prototype.verify_sig = function(key, cb) {
- var computed, err, received, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- (function(_this) {
- return (function(__iced_k) {
- if ((received = _this.ct.unshift(Concat.get_output_size() / 4)) == null) {
- return __iced_k(err = new Error("Ciphertext underrun in signature"));
- } else {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/dec.iced",
- funcname: "Decryptor.verify_sig"
- });
- _this.sign({
- input: _this.ct,
- key: key,
- salt: _this.salt
- }, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- err = arguments[0];
- return computed = arguments[1];
- };
- })(),
- lineno: 63
- }));
- __iced_deferrals._fulfill();
- })(function() {
- return __iced_k(err = err != null ? err : received.equal(computed) ? null : new Error('Signature mismatch or bad decryption key'));
- });
- }
- });
- })(this)((function(_this) {
- return function() {
- return cb(err);
- };
- })(this));
- };
-
- Decryptor.prototype.unshift_iv = function(n_bytes, which, cb) {
- var err, iv;
- err = (iv = this.ct.unshift(n_bytes / 4)) != null ? null : new Error("Ciphertext underrun in " + which);
- return cb(err, iv);
- };
-
- Decryptor.prototype.read_salt = function(cb) {
- var err;
- err = (this.salt = this.ct.unshift(this.version.salt_size / 4)) == null ? new Error("Ciphertext underrrun in read_salt") : null;
- return cb(err);
- };
-
- Decryptor.prototype.generate_keys = function(_arg, cb) {
- var err, keys, progress_hook, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- progress_hook = _arg.progress_hook;
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/dec.iced",
- funcname: "Decryptor.generate_keys"
- });
- _this.kdf({
- salt: _this.salt,
- progress_hook: progress_hook
- }, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- err = arguments[0];
- return keys = arguments[1];
- };
- })(),
- lineno: 114
- }));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- return cb(err, keys);
- };
- })(this));
- };
-
- Decryptor.prototype.run = function(_arg, cb) {
- var ct1, ct2, data, esc, iv, progress_hook, pt, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- data = _arg.data, progress_hook = _arg.progress_hook;
- esc = make_esc(cb, "Decryptor::run");
- this.ct = WordArray.from_buffer(data);
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/dec.iced",
- funcname: "Decryptor.run"
- });
- _this.read_header(esc(__iced_deferrals.defer({
- lineno: 141
- })));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/dec.iced",
- funcname: "Decryptor.run"
- });
- _this.read_salt(esc(__iced_deferrals.defer({
- lineno: 142
- })));
- __iced_deferrals._fulfill();
- })(function() {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/dec.iced",
- funcname: "Decryptor.run"
- });
- _this.generate_keys({
- progress_hook: progress_hook
- }, esc(__iced_deferrals.defer({
- assign_fn: (function(__slot_1) {
- return function() {
- return __slot_1.keys = arguments[0];
- };
- })(_this),
- lineno: 143
- })));
- __iced_deferrals._fulfill();
- })(function() {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/dec.iced",
- funcname: "Decryptor.run"
- });
- _this.verify_sig(_this.keys.hmac, esc(__iced_deferrals.defer({
- lineno: 144
- })));
- __iced_deferrals._fulfill();
- })(function() {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/dec.iced",
- funcname: "Decryptor.run"
- });
- _this.unshift_iv(AES.ivSize, "AES", esc(__iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return iv = arguments[0];
- };
- })(),
- lineno: 145
- })));
- __iced_deferrals._fulfill();
- })(function() {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/dec.iced",
- funcname: "Decryptor.run"
- });
- _this.run_aes({
- iv: iv,
- input: _this.ct,
- key: _this.keys.aes,
- progress_hook: progress_hook
- }, esc(__iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return ct2 = arguments[0];
- };
- })(),
- lineno: 146
- })));
- __iced_deferrals._fulfill();
- })(function() {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/dec.iced",
- funcname: "Decryptor.run"
- });
- _this.unshift_iv(TwoFish.ivSize, "2fish", esc(__iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return iv = arguments[0];
- };
- })(),
- lineno: 147
- })));
- __iced_deferrals._fulfill();
- })(function() {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/dec.iced",
- funcname: "Decryptor.run"
- });
- _this.run_twofish({
- iv: iv,
- input: _this.ct,
- key: _this.keys.twofish,
- progress_hook: progress_hook
- }, esc(__iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return ct1 = arguments[0];
- };
- })(),
- lineno: 148
- })));
- __iced_deferrals._fulfill();
- })(function() {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/dec.iced",
- funcname: "Decryptor.run"
- });
- _this.unshift_iv(Salsa20.ivSize, "Salsa", esc(__iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return iv = arguments[0];
- };
- })(),
- lineno: 149
- })));
- __iced_deferrals._fulfill();
- })(function() {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/dec.iced",
- funcname: "Decryptor.run"
- });
- _this.run_salsa20({
- iv: iv,
- input: _this.ct,
- key: _this.keys.salsa20,
- output_iv: false,
- progress_hook: progress_hook
- }, esc(__iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return pt = arguments[0];
- };
- })(),
- lineno: 150
- })));
- __iced_deferrals._fulfill();
- })(function() {
- return cb(null, pt.to_buffer());
- });
- });
- });
- });
- });
- });
- });
- });
- });
- };
- })(this));
- };
-
- return Decryptor;
-
- })(Base);
-
- decrypt = function(_arg, cb) {
- var data, dec, err, key, progress_hook, pt, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- key = _arg.key, data = _arg.data, progress_hook = _arg.progress_hook;
- dec = new Decryptor({
- key: key
- });
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/dec.iced"
- });
- dec.run({
- data: data,
- progress_hook: progress_hook
- }, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- err = arguments[0];
- return pt = arguments[1];
- };
- })(),
- lineno: 168
- }));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- dec.scrub();
- return cb(err, pt);
- };
- })(this));
- };
-
- exports.Decryptor = Decryptor;
-
- exports.decrypt = decrypt;
-
-}).call(this);
-
-},{"./aes":1,"./combine":3,"./ctr":4,"./enc":7,"./salsa20":14,"./sha512":21,"./twofish":22,"./wordarray":24,"iced-error":35,"iced-runtime":38}],6:[function(require,module,exports){
-var Buffer=require("__browserify_Buffer");// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var ADRBG, DRBG, Lock, WordArray, XOR, hmac, iced, sha3, sha512, __iced_k, __iced_k_noop;
-
- iced = require('iced-runtime');
- __iced_k = __iced_k_noop = function() {};
-
- hmac = require('./hmac');
-
- XOR = require('./combine').XOR;
-
- sha512 = require('./sha512');
-
- sha3 = require('./sha3');
-
- WordArray = require('./wordarray').WordArray;
-
- Lock = require('./lock').Lock;
-
- DRBG = (function() {
- function DRBG(entropy, personalization_string, hmac_func) {
- this.hmac = hmac_func || hmac.sign;
- this.security_strength = 256;
- entropy = this.check_entropy(entropy);
- personalization_string || (personalization_string = new WordArray([]));
- this._instantiate(entropy, personalization_string);
- }
-
- DRBG.prototype.check_entropy = function(entropy, reseed) {
- if (reseed == null) {
- reseed = false;
- }
- if ((entropy.sigBytes * 8 * 2) < ((reseed ? 2 : 3) * this.security_strength)) {
- throw new Error("entropy must be at least " + (1.5 * this.security_strength) + " bits.");
- }
- return entropy;
- };
-
- DRBG.prototype._hmac = function(key, input) {
- return this.hmac({
- key: key,
- input: input
- });
- };
-
- DRBG.prototype._update = function(provided_data) {
- var V, V_in;
- V = new WordArray([0], 1);
- if (provided_data != null) {
- V = V.concat(provided_data);
- }
- V_in = this.V.clone().concat(V);
- this.K = this._hmac(this.K, V_in);
- V_in.scrub();
- V.scrub();
- this.V = this._hmac(this.K, this.V);
- if (provided_data != null) {
- V_in = this.V.clone().concat(new WordArray([1 << 24], 1)).concat(provided_data);
- this.K = this._hmac(this.K, V_in);
- V_in.scrub();
- this.V = this._hmac(this.K, this.V);
- }
- return provided_data != null ? provided_data.scrub() : void 0;
- };
-
- DRBG.prototype._instantiate = function(entropy, personalization_string) {
- var i, n, seed_material;
- seed_material = entropy.concat(personalization_string);
- n = 64;
- this.K = WordArray.from_buffer(new Buffer((function() {
- var _i, _results;
- _results = [];
- for (i = _i = 0; 0 <= n ? _i < n : _i > n; i = 0 <= n ? ++_i : --_i) {
- _results.push(0);
- }
- return _results;
- })()));
- this.V = WordArray.from_buffer(new Buffer((function() {
- var _i, _results;
- _results = [];
- for (i = _i = 0; 0 <= n ? _i < n : _i > n; i = 0 <= n ? ++_i : --_i) {
- _results.push(1);
- }
- return _results;
- })()));
- this._update(seed_material);
- entropy.scrub();
- return this.reseed_counter = 1;
- };
-
- DRBG.prototype.reseed = function(entropy) {
- this._update(this.check_entropy(entropy, true));
- return this.reseed_counter = 1;
- };
-
- DRBG.prototype.generate = function(num_bytes) {
- var i, tmp, _ref;
- if ((num_bytes * 8) > 7500) {
- throw new Error("generate cannot generate > 7500 bits in 1 call.");
- }
- if (this.reseed_counter >= 10000) {
- throw new Error("Need a reseed!");
- }
- tmp = [];
- i = 0;
- while ((tmp.length === 0) || (tmp.length * tmp[0].length * 4) < num_bytes) {
- this.V = this._hmac(this.K, this.V);
- tmp.push(this.V.words);
- }
- this._update();
- this.reseed_counter += 1;
- return (new WordArray((_ref = []).concat.apply(_ref, tmp))).truncate(num_bytes);
- };
-
- return DRBG;
-
- })();
-
- ADRBG = (function() {
- function ADRBG(gen_seed, hmac) {
- this.gen_seed = gen_seed;
- this.hmac = hmac;
- this.drbg = null;
- this.lock = new Lock();
- }
-
- ADRBG.prototype.generate = function(n, cb) {
- var ret, seed, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/drbg.iced",
- funcname: "ADRBG.generate"
- });
- _this.lock.acquire(__iced_deferrals.defer({
- lineno: 148
- }));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- (function(__iced_k) {
- if (_this.drbg == null) {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/drbg.iced",
- funcname: "ADRBG.generate"
- });
- _this.gen_seed(256, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return seed = arguments[0];
- };
- })(),
- lineno: 150
- }));
- __iced_deferrals._fulfill();
- })(function() {
- return __iced_k(_this.drbg = new DRBG(seed, null, _this.hmac));
- });
- } else {
- return __iced_k();
- }
- })(function() {
- (function(__iced_k) {
- if (_this.drbg.reseed_counter > 100) {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/drbg.iced",
- funcname: "ADRBG.generate"
- });
- _this.gen_seed(256, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return seed = arguments[0];
- };
- })(),
- lineno: 153
- }));
- __iced_deferrals._fulfill();
- })(function() {
- return __iced_k(_this.drbg.reseed(seed));
- });
- } else {
- return __iced_k();
- }
- })(function() {
- ret = _this.drbg.generate(n);
- _this.lock.release();
- return cb(ret);
- });
- });
- };
- })(this));
- };
-
- return ADRBG;
-
- })();
-
- exports.DRBG = DRBG;
-
- exports.ADRBG = ADRBG;
-
-}).call(this);
-
-},{"./combine":3,"./hmac":8,"./lock":9,"./sha3":19,"./sha512":21,"./wordarray":24,"__browserify_Buffer":26,"iced-runtime":38}],7:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var AES, Base, CURRENT_VERSION, Concat, Encryptor, HMAC_SHA256, PBKDF2, SHA512, Scrypt, TwoFish, V, WordArray, XOR, ctr, encrypt, iced, make_esc, prng, salsa20, util, __iced_k, __iced_k_noop, _ref,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
-
- iced = require('iced-runtime');
- __iced_k = __iced_k_noop = function() {};
-
- WordArray = require('./wordarray').WordArray;
-
- salsa20 = require('./salsa20');
-
- AES = require('./aes').AES;
-
- TwoFish = require('./twofish').TwoFish;
-
- ctr = require('./ctr');
-
- _ref = require('./combine'), XOR = _ref.XOR, Concat = _ref.Concat;
-
- SHA512 = require('./sha512').SHA512;
-
- PBKDF2 = require('./pbkdf2').PBKDF2;
-
- Scrypt = require('./scrypt').Scrypt;
-
- util = require('./util');
-
- prng = require('./prng');
-
- make_esc = require('iced-error').make_esc;
-
- HMAC_SHA256 = require('./hmac').HMAC_SHA256;
-
- V = {
- "1": {
- header: [0x1c94d7de, 1],
- salt_size: 8,
- xsalsa20_rev: true,
- kdf: {
- klass: PBKDF2,
- opts: {
- c: 1024,
- klass: XOR
- }
- },
- hmac_key_size: 768 / 8
- },
- "2": {
- header: [0x1c94d7de, 2],
- salt_size: 16,
- xsalsa20_rev: true,
- kdf: {
- klass: Scrypt,
- opts: {
- c: 64,
- klass: XOR,
- N: 12,
- r: 8,
- p: 1
- }
- },
- hmac_key_size: 768 / 8
- },
- "3": {
- header: [0x1c94d7de, 3],
- salt_size: 16,
- xsalsa20_rev: false,
- kdf: {
- klass: Scrypt,
- opts: {
- c: 1,
- klass: HMAC_SHA256,
- N: 15,
- r: 8,
- p: 1
- }
- },
- hmac_key_size: 768 / 8
- }
- };
-
- exports.CURRENT_VERSION = CURRENT_VERSION = 3;
-
- Base = (function() {
- function Base(_arg) {
- var key, version;
- key = _arg.key, version = _arg.version;
- this.version = V[version != null ? version : CURRENT_VERSION];
- if (this.version == null) {
- throw new Error("unknown version: " + version);
- }
- this.set_key(key);
- this.derived_keys = {};
- }
-
- Base.prototype.kdf = function(_arg, cb) {
- var args, dkLen, end, extra_keymaterial, i, k, key, keys, len, lens, order, progress_hook, raw, salt, salt_hex, v, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- salt = _arg.salt, extra_keymaterial = _arg.extra_keymaterial, progress_hook = _arg.progress_hook;
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Base.kdf"
- });
- _this._check_scrubbed(_this.key, "in KDF", cb, __iced_deferrals.defer({
- lineno: 94
- }));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- salt_hex = salt.to_hex();
- key = _this.key.clone();
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Base.kdf"
- });
- _this._check_scrubbed(key, "KDF", cb, __iced_deferrals.defer({
- lineno: 102
- }));
- __iced_deferrals._fulfill();
- })(function() {
- (function(__iced_k) {
- if ((keys = _this.derived_keys[salt_hex]) == null) {
- _this._kdf = new _this.version.kdf.klass(_this.version.kdf.opts);
- lens = {
- hmac: _this.version.hmac_key_size,
- aes: AES.keySize,
- twofish: TwoFish.keySize,
- salsa20: salsa20.Salsa20.keySize
- };
- order = ['hmac', 'aes', 'twofish', 'salsa20'];
- dkLen = extra_keymaterial || 0;
- for (k in lens) {
- v = lens[k];
- dkLen += v;
- }
- args = {
- dkLen: dkLen,
- key: key,
- progress_hook: progress_hook,
- salt: salt
- };
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Base.kdf"
- });
- _this._kdf.run(args, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return raw = arguments[0];
- };
- })(),
- lineno: 121
- }));
- __iced_deferrals._fulfill();
- })(function() {
- var _i, _len;
- keys = {};
- i = 0;
- for (_i = 0, _len = order.length; _i < _len; _i++) {
- k = order[_i];
- v = lens[k];
- len = v / 4;
- end = i + len;
- keys[k] = new WordArray(raw.words.slice(i, end));
- i = end;
- }
- keys.extra = (new WordArray(raw.words.slice(end))).to_buffer();
- return __iced_k(_this.derived_keys[salt_hex] = keys);
- });
- } else {
- return __iced_k();
- }
- })(function() {
- return cb(null, keys);
- });
- });
- };
- })(this));
- };
-
- Base.prototype.set_key = function(key) {
- var wakey;
- if (key != null) {
- wakey = WordArray.from_buffer(key);
- if (!this.key || !this.key.equal(wakey)) {
- this.scrub();
- return this.key = wakey;
- }
- } else {
- return this.scrub();
- }
- };
-
- Base.prototype._check_scrubbed = function(key, where, ecb, okcb) {
- if ((key != null) && !key.is_scrubbed()) {
- return okcb();
- } else {
- return ecb(new Error("" + where + ": Failed due to scrubbed key!"), null);
- }
- };
-
- Base.prototype.sign = function(_arg, cb) {
- var input, key, out, progress_hook, salt, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- input = _arg.input, key = _arg.key, salt = _arg.salt, progress_hook = _arg.progress_hook;
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Base.sign"
- });
- _this._check_scrubbed(key, "HMAC", cb, __iced_deferrals.defer({
- lineno: 179
- }));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- input = (new WordArray(_this.version.header)).concat(salt).concat(input);
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Base.sign"
- });
- Concat.bulk_sign({
- key: key,
- input: input,
- progress_hook: progress_hook
- }, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return out = arguments[0];
- };
- })(),
- lineno: 181
- }));
- __iced_deferrals._fulfill();
- })(function() {
- input.scrub();
- return cb(null, out);
- });
- };
- })(this));
- };
-
- Base.prototype.run_salsa20 = function(_arg, cb) {
- var args, ct, input, iv, key, output_iv, progress_hook, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- input = _arg.input, key = _arg.key, iv = _arg.iv, output_iv = _arg.output_iv, progress_hook = _arg.progress_hook;
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Base.run_salsa20"
- });
- _this._check_scrubbed(key, "Salsa20", cb, __iced_deferrals.defer({
- lineno: 197
- }));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- args = {
- input: input,
- progress_hook: progress_hook,
- key: key,
- iv: iv
- };
- if (_this.version.xsalsa20_rev) {
- args.key = key.clone().endian_reverse();
- args.iv = iv.clone().endian_reverse();
- }
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Base.run_salsa20"
- });
- salsa20.bulk_encrypt(args, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return ct = arguments[0];
- };
- })(),
- lineno: 209
- }));
- __iced_deferrals._fulfill();
- })(function() {
- if (output_iv) {
- ct = iv.clone().concat(ct);
- }
- if (_this.version.xsalsa20_rev) {
- args.key.scrub();
- args.iv.scrub();
- }
- return cb(null, ct);
- });
- };
- })(this));
- };
-
- Base.prototype.run_twofish = function(_arg, cb) {
- var block_cipher, ct, input, iv, key, progress_hook, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- input = _arg.input, key = _arg.key, iv = _arg.iv, progress_hook = _arg.progress_hook;
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Base.run_twofish"
- });
- _this._check_scrubbed(key, "TwoFish", cb, __iced_deferrals.defer({
- lineno: 232
- }));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- block_cipher = new TwoFish(key);
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Base.run_twofish"
- });
- ctr.bulk_encrypt({
- block_cipher: block_cipher,
- iv: iv,
- input: input,
- progress_hook: progress_hook,
- what: "twofish"
- }, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return ct = arguments[0];
- };
- })(),
- lineno: 234
- }));
- __iced_deferrals._fulfill();
- })(function() {
- block_cipher.scrub();
- return cb(null, iv.clone().concat(ct));
- });
- };
- })(this));
- };
-
- Base.prototype.run_aes = function(_arg, cb) {
- var block_cipher, ct, input, iv, key, progress_hook, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- input = _arg.input, key = _arg.key, iv = _arg.iv, progress_hook = _arg.progress_hook;
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Base.run_aes"
- });
- _this._check_scrubbed(key, "AES", cb, __iced_deferrals.defer({
- lineno: 249
- }));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- block_cipher = new AES(key);
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Base.run_aes"
- });
- ctr.bulk_encrypt({
- block_cipher: block_cipher,
- iv: iv,
- input: input,
- progress_hook: progress_hook,
- what: "aes"
- }, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return ct = arguments[0];
- };
- })(),
- lineno: 251
- }));
- __iced_deferrals._fulfill();
- })(function() {
- block_cipher.scrub();
- return cb(null, iv.clone().concat(ct));
- });
- };
- })(this));
- };
-
- Base.prototype.scrub = function() {
- var key, key_ring, salt, _i, _len, _ref1;
- if (this.key != null) {
- this.key.scrub();
- }
- if (this.derived_keys != null) {
- _ref1 = this.derived_keys;
- for (salt in _ref1) {
- key_ring = _ref1[salt];
- for (_i = 0, _len = key_ring.length; _i < _len; _i++) {
- key = key_ring[_i];
- key.scrub();
- }
- }
- }
- this.derived_keys = {};
- if (this.salt != null) {
- this.salt.scrub();
- }
- this.salt = null;
- return this.key = null;
- };
-
- return Base;
-
- })();
-
- Encryptor = (function(_super) {
- __extends(Encryptor, _super);
-
- function Encryptor(_arg) {
- var key, rng, version;
- key = _arg.key, rng = _arg.rng, version = _arg.version;
- Encryptor.__super__.constructor.call(this, {
- key: key,
- version: version
- });
- this.rng = rng || prng.generate;
- }
-
- Encryptor.prototype.pick_random_ivs = function(_arg, cb) {
- var iv_lens, ivs, k, progress_hook, v, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- progress_hook = _arg.progress_hook;
- iv_lens = {
- aes: AES.ivSize,
- twofish: TwoFish.ivSize,
- salsa20: salsa20.Salsa20.ivSize
- };
- ivs = {};
- (function(_this) {
- return (function(__iced_k) {
- var _i, _k, _keys, _ref1, _results, _while;
- _ref1 = iv_lens;
- _keys = (function() {
- var _results1;
- _results1 = [];
- for (_k in _ref1) {
- _results1.push(_k);
- }
- return _results1;
- })();
- _i = 0;
- _results = [];
- _while = function(__iced_k) {
- var _break, _continue, _next;
- _break = function() {
- return __iced_k(_results);
- };
- _continue = function() {
- return iced.trampoline(function() {
- ++_i;
- return _while(__iced_k);
- });
- };
- _next = function(__iced_next_arg) {
- _results.push(__iced_next_arg);
- return _continue();
- };
- if (!(_i < _keys.length)) {
- return _break();
- } else {
- k = _keys[_i];
- v = _ref1[k];
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Encryptor.pick_random_ivs"
- });
- _this.rng(v, __iced_deferrals.defer({
- assign_fn: (function(__slot_1, __slot_2) {
- return function() {
- return __slot_1[__slot_2] = arguments[0];
- };
- })(ivs, k),
- lineno: 353
- }));
- __iced_deferrals._fulfill();
- })(_next);
- }
- };
- _while(__iced_k);
- });
- })(this)((function(_this) {
- return function() {
- return cb(ivs);
- };
- })(this));
- };
-
- Encryptor.prototype.resalt = function(_arg, cb) {
- var err, extra_keymaterial, progress_hook, salt, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- salt = _arg.salt, extra_keymaterial = _arg.extra_keymaterial, progress_hook = _arg.progress_hook;
- err = null;
- (function(_this) {
- return (function(__iced_k) {
- if (salt == null) {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Encryptor.resalt"
- });
- _this.rng(_this.version.salt_size, __iced_deferrals.defer({
- assign_fn: (function(__slot_1) {
- return function() {
- return __slot_1.salt = arguments[0];
- };
- })(_this),
- lineno: 369
- }));
- __iced_deferrals._fulfill();
- })(__iced_k);
- } else {
- return __iced_k(salt.length !== _this.version.salt_size ? err = new Error("Need a salt of exactly " + _this.version.salt_size + " bytes (got " + salt.length + ")") : _this.salt = WordArray.alloc(salt));
- }
- });
- })(this)((function(_this) {
- return function() {
- (function(__iced_k) {
- if (err == null) {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Encryptor.resalt"
- });
- _this.kdf({
- extra_keymaterial: extra_keymaterial,
- progress_hook: progress_hook,
- salt: _this.salt
- }, __iced_deferrals.defer({
- assign_fn: (function(__slot_1) {
- return function() {
- err = arguments[0];
- return __slot_1.keys = arguments[1];
- };
- })(_this),
- lineno: 375
- }));
- __iced_deferrals._fulfill();
- })(__iced_k);
- } else {
- return __iced_k();
- }
- })(function() {
- return cb(err, _this.keys);
- });
- };
- })(this));
- };
-
- Encryptor.prototype.run = function(_arg, cb) {
- var ct1, ct2, ct3, data, esc, extra_keymaterial, ivs, progress_hook, pt, ret, salt, sig, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- data = _arg.data, salt = _arg.salt, extra_keymaterial = _arg.extra_keymaterial, progress_hook = _arg.progress_hook;
- esc = make_esc(cb, "Encryptor::run");
- (function(_this) {
- return (function(__iced_k) {
- if ((salt != null) || (_this.salt == null)) {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Encryptor.run"
- });
- _this.resalt({
- salt: salt,
- extra_keymaterial: extra_keymaterial,
- progress_hook: progress_hook
- }, esc(__iced_deferrals.defer({
- lineno: 406
- })));
- __iced_deferrals._fulfill();
- })(__iced_k);
- } else {
- return __iced_k();
- }
- });
- })(this)((function(_this) {
- return function() {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Encryptor.run"
- });
- _this.pick_random_ivs({
- progress_hook: progress_hook
- }, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return ivs = arguments[0];
- };
- })(),
- lineno: 407
- }));
- __iced_deferrals._fulfill();
- })(function() {
- pt = WordArray.from_buffer(data);
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Encryptor.run"
- });
- _this.run_salsa20({
- input: pt,
- key: _this.keys.salsa20,
- progress_hook: progress_hook,
- iv: ivs.salsa20,
- output_iv: true
- }, esc(__iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return ct1 = arguments[0];
- };
- })(),
- lineno: 409
- })));
- __iced_deferrals._fulfill();
- })(function() {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Encryptor.run"
- });
- _this.run_twofish({
- input: ct1,
- key: _this.keys.twofish,
- progress_hook: progress_hook,
- iv: ivs.twofish
- }, esc(__iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return ct2 = arguments[0];
- };
- })(),
- lineno: 410
- })));
- __iced_deferrals._fulfill();
- })(function() {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Encryptor.run"
- });
- _this.run_aes({
- input: ct2,
- key: _this.keys.aes,
- progress_hook: progress_hook,
- iv: ivs.aes
- }, esc(__iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return ct3 = arguments[0];
- };
- })(),
- lineno: 411
- })));
- __iced_deferrals._fulfill();
- })(function() {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced",
- funcname: "Encryptor.run"
- });
- _this.sign({
- input: ct3,
- key: _this.keys.hmac,
- progress_hook: progress_hook,
- salt: _this.salt
- }, esc(__iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return sig = arguments[0];
- };
- })(),
- lineno: 412
- })));
- __iced_deferrals._fulfill();
- })(function() {
- ret = (new WordArray(_this.version.header)).concat(_this.salt).concat(sig).concat(ct3).to_buffer();
- util.scrub_buffer(data);
- return cb(null, ret);
- });
- });
- });
- });
- });
- };
- })(this));
- };
-
- return Encryptor;
-
- })(Base);
-
- encrypt = function(_arg, cb) {
- var data, enc, err, key, progress_hook, ret, rng, version, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- key = _arg.key, data = _arg.data, rng = _arg.rng, progress_hook = _arg.progress_hook, version = _arg.version;
- enc = new Encryptor({
- key: key,
- rng: rng,
- version: version
- });
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/enc.iced"
- });
- enc.run({
- data: data,
- progress_hook: progress_hook
- }, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- err = arguments[0];
- return ret = arguments[1];
- };
- })(),
- lineno: 440
- }));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- enc.scrub();
- return cb(err, ret);
- };
- })(this));
- };
-
- exports.V = V;
-
- exports.encrypt = encrypt;
-
- exports.Base = Base;
-
- exports.Encryptor = Encryptor;
-
-}).call(this);
-
-},{"./aes":1,"./combine":3,"./ctr":4,"./hmac":8,"./pbkdf2":12,"./prng":13,"./salsa20":14,"./scrypt":15,"./sha512":21,"./twofish":22,"./util":23,"./wordarray":24,"iced-error":35,"iced-runtime":38}],8:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var HMAC, HMAC_SHA256, SHA256, SHA512, bulk_sign, iced, sign, util, __iced_k, __iced_k_noop,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
-
- iced = require('iced-runtime');
- __iced_k = __iced_k_noop = function() {};
-
- SHA512 = require('./sha512').SHA512;
-
- SHA256 = require('./sha256').SHA256;
-
- util = require('./util');
-
- HMAC = (function() {
- HMAC.outputSize = 512 / 8;
-
- HMAC.prototype.outputSize = HMAC.outputSize;
-
- function HMAC(key, klass) {
- var i, _i, _ref;
- if (klass == null) {
- klass = SHA512;
- }
- this.key = key.clone();
- this.hasher = new klass();
- this.hasherBlockSize = this.hasher.blockSize;
- this.hasherBlockSizeBytes = this.hasherBlockSize * 4;
- if (this.key.sigBytes > this.hasherBlockSizeBytes) {
- this.key = this.hasher.finalize(this.key);
- }
- this.key.clamp();
- this._oKey = this.key.clone();
- this._iKey = this.key.clone();
- for (i = _i = 0, _ref = this.hasherBlockSize; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
- this._oKey.words[i] ^= 0x5c5c5c5c;
- this._iKey.words[i] ^= 0x36363636;
- }
- this._oKey.sigBytes = this._iKey.sigBytes = this.hasherBlockSizeBytes;
- this.reset();
- }
-
- HMAC.prototype.get_output_size = function() {
- return this.hasher.output_size;
- };
-
- HMAC.prototype.reset = function() {
- return this.hasher.reset().update(this._iKey);
- };
-
- HMAC.prototype.update = function(wa) {
- this.hasher.update(wa);
- return this;
- };
-
- HMAC.prototype.finalize = function(wa) {
- var innerHash, innerHash2, out;
- innerHash = this.hasher.finalize(wa);
- this.hasher.reset();
- innerHash2 = this._oKey.clone().concat(innerHash);
- out = this.hasher.finalize(innerHash2);
- innerHash.scrub();
- innerHash2.scrub();
- return out;
- };
-
- HMAC.prototype.scrub = function() {
- this.key.scrub();
- this._iKey.scrub();
- return this._oKey.scrub();
- };
-
- return HMAC;
-
- })();
-
- sign = function(_arg) {
- var eng, hash_class, input, key, out;
- key = _arg.key, input = _arg.input, hash_class = _arg.hash_class;
- eng = new HMAC(key, hash_class);
- out = eng.finalize(input.clamp());
- eng.scrub();
- return out;
- };
-
- bulk_sign = function(_arg, cb) {
- var eng, input, key, klass, progress_hook, res, slice_args, what, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- key = _arg.key, input = _arg.input, progress_hook = _arg.progress_hook, klass = _arg.klass, what = _arg.what;
- klass || (klass = HMAC);
- what || (what = "hmac_sha512");
- eng = new klass(key);
- input.clamp();
- slice_args = {
- update: function(lo, hi) {
- return eng.update(input.slice(lo, hi));
- },
- finalize: function() {
- return eng.finalize();
- },
- default_n: eng.hasherBlockSize * 1000
- };
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/hmac.iced"
- });
- util.bulk(input.sigBytes, slice_args, {
- what: what,
- progress_hook: progress_hook,
- cb: __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return res = arguments[0];
- };
- })(),
- lineno: 137
- })
- });
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- eng.scrub();
- return cb(res);
- };
- })(this));
- };
-
- exports.HMAC_SHA256 = HMAC_SHA256 = (function(_super) {
- __extends(HMAC_SHA256, _super);
-
- function HMAC_SHA256(key) {
- HMAC_SHA256.__super__.constructor.call(this, key, SHA256);
- }
-
- return HMAC_SHA256;
-
- })(HMAC);
-
- exports.HMAC = HMAC;
-
- exports.sign = sign;
-
- exports.bulk_sign = bulk_sign;
-
-}).call(this);
-
-},{"./sha256":18,"./sha512":21,"./util":23,"iced-runtime":38}],9:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var Lock, NamedLock, Table, iced, __iced_k, __iced_k_noop,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
-
- iced = require('iced-runtime');
- __iced_k = __iced_k_noop = function() {};
-
- Lock = (function() {
- function Lock() {
- this._open = true;
- this._waiters = [];
- }
-
- Lock.prototype.acquire = function(cb) {
- if (this._open) {
- this._open = false;
- return cb();
- } else {
- return this._waiters.push(cb);
- }
- };
-
- Lock.prototype.release = function() {
- var w;
- if (this._waiters.length) {
- w = this._waiters.shift();
- return w();
- } else {
- return this._open = true;
- }
- };
-
- Lock.prototype.open = function() {
- return this._open;
- };
-
- return Lock;
-
- })();
-
- NamedLock = (function(_super) {
- __extends(NamedLock, _super);
-
- function NamedLock(tab, name) {
- this.tab = tab;
- this.name = name;
- NamedLock.__super__.constructor.call(this);
- this.refs = 0;
- }
-
- NamedLock.prototype.incref = function() {
- return ++this.refs;
- };
-
- NamedLock.prototype.decref = function() {
- return --this.refs;
- };
-
- NamedLock.prototype.release = function() {
- NamedLock.__super__.release.call(this);
- if (this.decref() === 0) {
- return delete this.tab[this.name];
- }
- };
-
- return NamedLock;
-
- })(Lock);
-
- Table = (function() {
- function Table() {
- this.locks = {};
- }
-
- Table.prototype.create = function(name) {
- var l;
- l = new NamedLock(this, name);
- return this.locks[name] = l;
- };
-
- Table.prototype.acquire = function(name, cb, wait) {
- var l, was_open, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- l = this.locks[name] || this.create(name);
- was_open = l._open;
- l.incref();
- (function(_this) {
- return (function(__iced_k) {
- if (wait || l._open) {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/lock.iced",
- funcname: "Table.acquire"
- });
- l.acquire(__iced_deferrals.defer({
- lineno: 68
- }));
- __iced_deferrals._fulfill();
- })(__iced_k);
- } else {
- return __iced_k(l = null);
- }
- });
- })(this)((function(_this) {
- return function() {
- return cb(l, was_open);
- };
- })(this));
- };
-
- Table.prototype.lookup = function(name) {
- return this.locks[name];
- };
-
- return Table;
-
- })();
-
- exports.Lock = Lock;
-
- exports.Table = Table;
-
-}).call(this);
-
-},{"iced-runtime":38}],10:[function(require,module,exports){
-var Buffer=require("__browserify_Buffer");// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var hmac, k, v, _ref, _ref1;
-
- _ref = require('./enc');
- for (k in _ref) {
- v = _ref[k];
- exports[k] = v;
- }
-
- _ref1 = require('./dec');
- for (k in _ref1) {
- v = _ref1[k];
- exports[k] = v;
- }
-
- exports.prng = require('./prng');
-
- exports.Buffer = Buffer;
-
- exports.WordArray = require('./wordarray').WordArray;
-
- exports.util = require('./util');
-
- exports.ciphers = {
- AES: require('./aes').AES,
- TwoFish: require('./twofish').TwoFish,
- Salsa20: require('./salsa20').Salsa20
- };
-
- exports.hash = {
- SHA1: require('./sha1').SHA1,
- SHA224: require('./sha224').SHA224,
- SHA256: require('./sha256').SHA256,
- SHA384: require('./sha384').SHA384,
- SHA512: require('./sha512').SHA512,
- SHA3: require('./sha3').SHA3,
- MD5: require('./md5').MD5
- };
-
- exports.modes = {
- CTR: require('./ctr')
- };
-
- exports.scrypt = require('./scrypt').scrypt;
-
- exports.pbkdf2 = require('./pbkdf2').pbkdf2;
-
- exports.hmac = hmac = require('./hmac');
-
- exports.HMAC_SHA256 = hmac.HMAC_SHA256;
-
- exports.HMAC = hmac.HMAC;
-
-}).call(this);
-
-},{"./aes":1,"./ctr":4,"./dec":5,"./enc":7,"./hmac":8,"./md5":11,"./pbkdf2":12,"./prng":13,"./salsa20":14,"./scrypt":15,"./sha1":16,"./sha224":17,"./sha256":18,"./sha3":19,"./sha384":20,"./sha512":21,"./twofish":22,"./util":23,"./wordarray":24,"__browserify_Buffer":26}],11:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var FF, GG, Global, HH, Hasher, II, MD5, WordArray, glbl,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
-
- WordArray = require('./wordarray').WordArray;
-
- Hasher = require('./algbase').Hasher;
-
- Global = (function() {
- function Global() {
- var i;
- this.T = (function() {
- var _i, _results;
- _results = [];
- for (i = _i = 0; _i < 64; i = ++_i) {
- _results.push((Math.abs(Math.sin(i + 1)) * 0x100000000) | 0);
- }
- return _results;
- })();
- }
-
- return Global;
-
- })();
-
- glbl = new Global();
-
- exports.MD5 = MD5 = (function(_super) {
- __extends(MD5, _super);
-
- function MD5() {
- return MD5.__super__.constructor.apply(this, arguments);
- }
-
- MD5.blockSize = 512 / 32;
-
- MD5.prototype.blockSize = MD5.blockSize;
-
- MD5.output_size = 16;
-
- MD5.prototype.output_size = MD5.output_size;
-
- MD5.prototype._doReset = function() {
- return this._hash = new WordArray([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476]);
- };
-
- MD5.prototype._doProcessBlock = function(M, offset) {
- var H, M_offset_0, M_offset_1, M_offset_10, M_offset_11, M_offset_12, M_offset_13, M_offset_14, M_offset_15, M_offset_2, M_offset_3, M_offset_4, M_offset_5, M_offset_6, M_offset_7, M_offset_8, M_offset_9, M_offset_i, a, b, c, d, i, offset_i, _i;
- for (i = _i = 0; _i < 16; i = ++_i) {
- offset_i = offset + i;
- 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);
- }
- H = this._hash.words;
- M_offset_0 = M[offset + 0];
- M_offset_1 = M[offset + 1];
- M_offset_2 = M[offset + 2];
- M_offset_3 = M[offset + 3];
- M_offset_4 = M[offset + 4];
- M_offset_5 = M[offset + 5];
- M_offset_6 = M[offset + 6];
- M_offset_7 = M[offset + 7];
- M_offset_8 = M[offset + 8];
- M_offset_9 = M[offset + 9];
- M_offset_10 = M[offset + 10];
- M_offset_11 = M[offset + 11];
- M_offset_12 = M[offset + 12];
- M_offset_13 = M[offset + 13];
- M_offset_14 = M[offset + 14];
- M_offset_15 = M[offset + 15];
- a = H[0];
- b = H[1];
- c = H[2];
- d = H[3];
- a = FF(a, b, c, d, M_offset_0, 7, glbl.T[0]);
- d = FF(d, a, b, c, M_offset_1, 12, glbl.T[1]);
- c = FF(c, d, a, b, M_offset_2, 17, glbl.T[2]);
- b = FF(b, c, d, a, M_offset_3, 22, glbl.T[3]);
- a = FF(a, b, c, d, M_offset_4, 7, glbl.T[4]);
- d = FF(d, a, b, c, M_offset_5, 12, glbl.T[5]);
- c = FF(c, d, a, b, M_offset_6, 17, glbl.T[6]);
- b = FF(b, c, d, a, M_offset_7, 22, glbl.T[7]);
- a = FF(a, b, c, d, M_offset_8, 7, glbl.T[8]);
- d = FF(d, a, b, c, M_offset_9, 12, glbl.T[9]);
- c = FF(c, d, a, b, M_offset_10, 17, glbl.T[10]);
- b = FF(b, c, d, a, M_offset_11, 22, glbl.T[11]);
- a = FF(a, b, c, d, M_offset_12, 7, glbl.T[12]);
- d = FF(d, a, b, c, M_offset_13, 12, glbl.T[13]);
- c = FF(c, d, a, b, M_offset_14, 17, glbl.T[14]);
- b = FF(b, c, d, a, M_offset_15, 22, glbl.T[15]);
- a = GG(a, b, c, d, M_offset_1, 5, glbl.T[16]);
- d = GG(d, a, b, c, M_offset_6, 9, glbl.T[17]);
- c = GG(c, d, a, b, M_offset_11, 14, glbl.T[18]);
- b = GG(b, c, d, a, M_offset_0, 20, glbl.T[19]);
- a = GG(a, b, c, d, M_offset_5, 5, glbl.T[20]);
- d = GG(d, a, b, c, M_offset_10, 9, glbl.T[21]);
- c = GG(c, d, a, b, M_offset_15, 14, glbl.T[22]);
- b = GG(b, c, d, a, M_offset_4, 20, glbl.T[23]);
- a = GG(a, b, c, d, M_offset_9, 5, glbl.T[24]);
- d = GG(d, a, b, c, M_offset_14, 9, glbl.T[25]);
- c = GG(c, d, a, b, M_offset_3, 14, glbl.T[26]);
- b = GG(b, c, d, a, M_offset_8, 20, glbl.T[27]);
- a = GG(a, b, c, d, M_offset_13, 5, glbl.T[28]);
- d = GG(d, a, b, c, M_offset_2, 9, glbl.T[29]);
- c = GG(c, d, a, b, M_offset_7, 14, glbl.T[30]);
- b = GG(b, c, d, a, M_offset_12, 20, glbl.T[31]);
- a = HH(a, b, c, d, M_offset_5, 4, glbl.T[32]);
- d = HH(d, a, b, c, M_offset_8, 11, glbl.T[33]);
- c = HH(c, d, a, b, M_offset_11, 16, glbl.T[34]);
- b = HH(b, c, d, a, M_offset_14, 23, glbl.T[35]);
- a = HH(a, b, c, d, M_offset_1, 4, glbl.T[36]);
- d = HH(d, a, b, c, M_offset_4, 11, glbl.T[37]);
- c = HH(c, d, a, b, M_offset_7, 16, glbl.T[38]);
- b = HH(b, c, d, a, M_offset_10, 23, glbl.T[39]);
- a = HH(a, b, c, d, M_offset_13, 4, glbl.T[40]);
- d = HH(d, a, b, c, M_offset_0, 11, glbl.T[41]);
- c = HH(c, d, a, b, M_offset_3, 16, glbl.T[42]);
- b = HH(b, c, d, a, M_offset_6, 23, glbl.T[43]);
- a = HH(a, b, c, d, M_offset_9, 4, glbl.T[44]);
- d = HH(d, a, b, c, M_offset_12, 11, glbl.T[45]);
- c = HH(c, d, a, b, M_offset_15, 16, glbl.T[46]);
- b = HH(b, c, d, a, M_offset_2, 23, glbl.T[47]);
- a = II(a, b, c, d, M_offset_0, 6, glbl.T[48]);
- d = II(d, a, b, c, M_offset_7, 10, glbl.T[49]);
- c = II(c, d, a, b, M_offset_14, 15, glbl.T[50]);
- b = II(b, c, d, a, M_offset_5, 21, glbl.T[51]);
- a = II(a, b, c, d, M_offset_12, 6, glbl.T[52]);
- d = II(d, a, b, c, M_offset_3, 10, glbl.T[53]);
- c = II(c, d, a, b, M_offset_10, 15, glbl.T[54]);
- b = II(b, c, d, a, M_offset_1, 21, glbl.T[55]);
- a = II(a, b, c, d, M_offset_8, 6, glbl.T[56]);
- d = II(d, a, b, c, M_offset_15, 10, glbl.T[57]);
- c = II(c, d, a, b, M_offset_6, 15, glbl.T[58]);
- b = II(b, c, d, a, M_offset_13, 21, glbl.T[59]);
- a = II(a, b, c, d, M_offset_4, 6, glbl.T[60]);
- d = II(d, a, b, c, M_offset_11, 10, glbl.T[61]);
- c = II(c, d, a, b, M_offset_2, 15, glbl.T[62]);
- b = II(b, c, d, a, M_offset_9, 21, glbl.T[63]);
- H[0] = (H[0] + a) | 0;
- H[1] = (H[1] + b) | 0;
- H[2] = (H[2] + c) | 0;
- return H[3] = (H[3] + d) | 0;
- };
-
- MD5.prototype._doFinalize = function() {
- var H, H_i, data, dataWords, hash, i, nBitsLeft, nBitsTotal, nBitsTotalH, nBitsTotalL, _i;
- data = this._data;
- dataWords = data.words;
- nBitsTotal = this._nDataBytes * 8;
- nBitsLeft = data.sigBytes * 8;
- dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
- nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);
- 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;
- this._process();
- hash = this._hash;
- H = hash.words;
- for (i = _i = 0; _i < 4; i = ++_i) {
- H_i = H[i];
- H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
- }
- return hash;
- };
-
- MD5.prototype.copy_to = function(obj) {
- MD5.__super__.copy_to.call(this, obj);
- return obj._hash = this._hash.clone();
- };
-
- MD5.prototype.clone = function() {
- var out;
- out = new MD5();
- this.copy_to(out);
- return out;
- };
-
- return MD5;
-
- })(Hasher);
-
- FF = function(a, b, c, d, x, s, t) {
- var n;
- n = a + ((b & c) | (~b & d)) + x + t;
- return ((n << s) | (n >>> (32 - s))) + b;
- };
-
- GG = function(a, b, c, d, x, s, t) {
- var n;
- n = a + ((b & d) | (c & ~d)) + x + t;
- return ((n << s) | (n >>> (32 - s))) + b;
- };
-
- HH = function(a, b, c, d, x, s, t) {
- var n;
- n = a + (b ^ c ^ d) + x + t;
- return ((n << s) | (n >>> (32 - s))) + b;
- };
-
- II = function(a, b, c, d, x, s, t) {
- var n;
- n = a + (c ^ (b | ~d)) + x + t;
- return ((n << s) | (n >>> (32 - s))) + b;
- };
-
- exports.transform = function(x) {
- var out;
- out = (new MD5).finalize(x);
- x.scrub();
- return out;
- };
-
-}).call(this);
-
-},{"./algbase":2,"./wordarray":24}],12:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var HMAC, PBKDF2, WordArray, iced, pbkdf2, util, __iced_k, __iced_k_noop;
-
- iced = require('iced-runtime');
- __iced_k = __iced_k_noop = function() {};
-
- HMAC = require('./hmac').HMAC;
-
- WordArray = require('./wordarray').WordArray;
-
- util = require('./util');
-
- PBKDF2 = (function() {
- function PBKDF2(_arg) {
- this.klass = _arg.klass, this.c = _arg.c;
- this.c || (this.c = 1024);
- this.klass || (this.klass = HMAC);
- }
-
- PBKDF2.prototype._PRF = function(input) {
- this.prf.reset();
- return this.prf.finalize(input);
- };
-
- PBKDF2.prototype._gen_T_i = function(_arg, cb) {
- var U, i, progress_hook, ret, salt, seed, stop, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- salt = _arg.salt, i = _arg.i, progress_hook = _arg.progress_hook;
- progress_hook(0);
- seed = salt.clone().concat(new WordArray([i]));
- U = this._PRF(seed);
- ret = U.clone();
- i = 1;
- (function(_this) {
- return (function(__iced_k) {
- var _results, _while;
- _results = [];
- _while = function(__iced_k) {
- var _break, _continue, _next;
- _break = function() {
- return __iced_k(_results);
- };
- _continue = function() {
- return iced.trampoline(function() {
- return _while(__iced_k);
- });
- };
- _next = function(__iced_next_arg) {
- _results.push(__iced_next_arg);
- return _continue();
- };
- if (!(i < _this.c)) {
- return _break();
- } else {
- stop = Math.min(_this.c, i + 128);
- while (i < stop) {
- U = _this._PRF(U);
- ret.xor(U, {});
- i++;
- }
- progress_hook(i);
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/pbkdf2.iced",
- funcname: "PBKDF2._gen_T_i"
- });
- util.default_delay(0, 0, __iced_deferrals.defer({
- lineno: 57
- }));
- __iced_deferrals._fulfill();
- })(function() {
- return _next(null);
- });
- }
- };
- _while(__iced_k);
- });
- })(this)((function(_this) {
- return function() {
- progress_hook(i);
- return cb(ret);
- };
- })(this));
- };
-
- PBKDF2.prototype.run = function(_arg, cb) {
- var bs, dkLen, flat, i, key, n, ph, progress_hook, salt, tmp, tph, words, ___iced_passed_deferral, __iced_deferrals, __iced_k, _begin, _end, _positive;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- key = _arg.key, salt = _arg.salt, dkLen = _arg.dkLen, progress_hook = _arg.progress_hook;
- this.prf = new this.klass(key);
- bs = this.prf.get_output_size();
- n = Math.ceil(dkLen / bs);
- words = [];
- tph = null;
- ph = (function(_this) {
- return function(block) {
- return function(iter) {
- return typeof progress_hook === "function" ? progress_hook({
- what: "pbkdf2",
- total: n * _this.c,
- i: block * _this.c + iter
- }) : void 0;
- };
- };
- })(this);
- ph(0)(0);
- (function(_this) {
- return (function(__iced_k) {
- var _i, _results, _while;
- i = 1;
- _begin = 1;
- _end = n;
- _positive = _end > _begin;
- _results = [];
- _while = function(__iced_k) {
- var _break, _continue, _next;
- _break = function() {
- return __iced_k(_results);
- };
- _continue = function() {
- return iced.trampoline(function() {
- if (_positive) {
- i += 1;
- } else {
- i -= 1;
- }
- return _while(__iced_k);
- });
- };
- _next = function(__iced_next_arg) {
- _results.push(__iced_next_arg);
- return _continue();
- };
- if (!!((_positive === true && i > n) || (_positive === false && i < n))) {
- return _break();
- } else {
-
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/pbkdf2.iced",
- funcname: "PBKDF2.run"
- });
- _this._gen_T_i({
- salt: salt,
- i: i,
- progress_hook: ph(i - 1)
- }, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return tmp = arguments[0];
- };
- })(),
- lineno: 80
- }));
- __iced_deferrals._fulfill();
- })(function() {
- return _next(words.push(tmp.words));
- });
- }
- };
- _while(__iced_k);
- });
- })(this)((function(_this) {
- return function() {
- var _ref;
- ph(n)(0);
- flat = (_ref = []).concat.apply(_ref, words);
- key.scrub();
- _this.prf.scrub();
- _this.prf = null;
- return cb(new WordArray(flat, dkLen));
- };
- })(this));
- };
-
- return PBKDF2;
-
- })();
-
- pbkdf2 = function(_arg, cb) {
- var c, dkLen, eng, key, klass, out, progress_hook, salt, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- key = _arg.key, salt = _arg.salt, klass = _arg.klass, c = _arg.c, dkLen = _arg.dkLen, progress_hook = _arg.progress_hook;
- eng = new PBKDF2({
- klass: klass,
- c: c
- });
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/pbkdf2.iced"
- });
- eng.run({
- key: key,
- salt: salt,
- dkLen: dkLen,
- progress_hook: progress_hook
- }, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return out = arguments[0];
- };
- })(),
- lineno: 106
- }));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- return cb(out);
- };
- })(this));
- };
-
- exports.pbkdf2 = pbkdf2;
-
- exports.PBKDF2 = PBKDF2;
-
-}).call(this);
-
-},{"./hmac":8,"./util":23,"./wordarray":24,"iced-runtime":38}],13:[function(require,module,exports){
-var Buffer=require("__browserify_Buffer");// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var ADRBG, PRNG, WordArray, XOR, browser_rng, e, generate, iced, m, more_entropy, native_rng, rng, util, __iced_k, __iced_k_noop, _browser_rng_primitive, _native_rng, _prng, _ref, _ref1;
-
- iced = require('iced-runtime');
- __iced_k = __iced_k_noop = function() {};
-
- more_entropy = require('more-entropy');
-
- ADRBG = require('./drbg').ADRBG;
-
- WordArray = require('./wordarray').WordArray;
-
- XOR = require('./combine').XOR;
-
- util = require('./util');
-
- _browser_rng_primitive = null;
-
- browser_rng = function(n) {
- var v;
- v = new Uint8Array(n);
- _browser_rng_primitive(v);
- return new Buffer(v);
- };
-
- _browser_rng_primitive = (m = typeof window !== "undefined" && window !== null ? (_ref = window.crypto) != null ? _ref.getRandomValues : void 0 : void 0) != null ? m.bind(window.crypto) : (m = typeof window !== "undefined" && window !== null ? (_ref1 = window.msCrypto) != null ? _ref1.getRandomValues : void 0 : void 0) != null ? m.bind(window.msCrypto) : null;
-
- if (_browser_rng_primitive != null) {
- _native_rng = browser_rng;
- } else {
- try {
- rng = require('cry' + 'pto').rng;
- if (rng != null) {
- _native_rng = rng;
- }
- } catch (_error) {
- e = _error;
- }
- }
-
- native_rng = function(x) {
- if (_native_rng == null) {
- throw new Error('No rng found; tried requiring "crypto" and window.crypto');
- }
- return _native_rng(x);
- };
-
- PRNG = (function() {
- function PRNG() {
- this.meg = new more_entropy.Generator();
- this.adrbg = new ADRBG(((function(_this) {
- return function(n, cb) {
- return _this.gen_seed(n, cb);
- };
- })(this)), XOR.sign);
- }
-
- PRNG.prototype.now_to_buffer = function() {
- var buf, d, ms, s;
- d = Date.now();
- ms = d % 1000;
- s = Math.floor(d / 1000);
- buf = new Buffer(8);
- buf.writeUInt32BE(s, 0);
- buf.writeUInt32BE(ms, 4);
- return buf;
- };
-
- PRNG.prototype.gen_seed = function(nbits, cb) {
- var b, bufs, cat, nbytes, wa, words, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- nbytes = nbits / 8;
- bufs = [];
- bufs.push(this.now_to_buffer());
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/prng.iced",
- funcname: "PRNG.gen_seed"
- });
- _this.meg.generate(nbits, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return words = arguments[0];
- };
- })(),
- lineno: 83
- }));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- var _i, _len;
- bufs.push(_this.now_to_buffer());
- bufs.push(new Buffer(words));
- bufs.push(native_rng(nbytes));
- bufs.push(_this.now_to_buffer());
- cat = Buffer.concat(bufs);
- wa = WordArray.from_buffer(cat);
- util.scrub_buffer(cat);
- for (_i = 0, _len = bufs.length; _i < _len; _i++) {
- b = bufs[_i];
- util.scrub_buffer(b);
- }
- return cb(wa);
- };
- })(this));
- };
-
- PRNG.prototype.generate = function(n, cb) {
- return this.adrbg.generate(n, cb);
- };
-
- return PRNG;
-
- })();
-
- _prng = null;
-
- generate = function(n, cb) {
- if (_prng == null) {
- _prng = new PRNG();
- }
- return _prng.generate(n, cb);
- };
-
- exports.PRNG = PRNG;
-
- exports.generate = generate;
-
- exports.native_rng = native_rng;
-
-}).call(this);
-
-},{"./combine":3,"./drbg":6,"./util":23,"./wordarray":24,"__browserify_Buffer":26,"iced-runtime":38,"more-entropy":41}],14:[function(require,module,exports){
-var Buffer=require("__browserify_Buffer");// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var Cipher, Counter, Salsa20, Salsa20Core, Salsa20InnerCore, Salsa20WordStream, StreamCipher, WordArray, asum, bulk_encrypt, encrypt, endian_reverse, fixup_uint32, iced, util, __iced_k, __iced_k_noop, _ref,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
-
- iced = require('iced-runtime');
- __iced_k = __iced_k_noop = function() {};
-
- _ref = require('./wordarray'), endian_reverse = _ref.endian_reverse, WordArray = _ref.WordArray;
-
- Counter = require('./ctr').Counter;
-
- fixup_uint32 = require('./util').fixup_uint32;
-
- StreamCipher = require('./algbase').StreamCipher;
-
- util = require('./util');
-
- asum = function(out, v) {
- var e, i, _i, _len;
- for (i = _i = 0, _len = v.length; _i < _len; i = ++_i) {
- e = v[i];
- out[i] += e;
- }
- return false;
- };
-
- Salsa20InnerCore = (function() {
- function Salsa20InnerCore(rounds) {
- this.rounds = rounds;
- }
-
- Salsa20InnerCore.prototype._core = function(v) {
- "use asm";
- var i, u, x0, x1, x10, x11, x12, x13, x14, x15, x2, x3, x4, x5, x6, x7, x8, x9, _i, _ref1;
- x0 = v[0], x1 = v[1], x2 = v[2], x3 = v[3], x4 = v[4], x5 = v[5], x6 = v[6], x7 = v[7], x8 = v[8], x9 = v[9], x10 = v[10], x11 = v[11], x12 = v[12], x13 = v[13], x14 = v[14], x15 = v[15];
- for (i = _i = 0, _ref1 = this.rounds; _i < _ref1; i = _i += 2) {
- u = (x0 + x12) | 0;
- x4 ^= (u << 7) | (u >>> 25);
- u = (x4 + x0) | 0;
- x8 ^= (u << 9) | (u >>> 23);
- u = (x8 + x4) | 0;
- x12 ^= (u << 13) | (u >>> 19);
- u = (x12 + x8) | 0;
- x0 ^= (u << 18) | (u >>> 14);
- u = (x5 + x1) | 0;
- x9 ^= (u << 7) | (u >>> 25);
- u = (x9 + x5) | 0;
- x13 ^= (u << 9) | (u >>> 23);
- u = (x13 + x9) | 0;
- x1 ^= (u << 13) | (u >>> 19);
- u = (x1 + x13) | 0;
- x5 ^= (u << 18) | (u >>> 14);
- u = (x10 + x6) | 0;
- x14 ^= (u << 7) | (u >>> 25);
- u = (x14 + x10) | 0;
- x2 ^= (u << 9) | (u >>> 23);
- u = (x2 + x14) | 0;
- x6 ^= (u << 13) | (u >>> 19);
- u = (x6 + x2) | 0;
- x10 ^= (u << 18) | (u >>> 14);
- u = (x15 + x11) | 0;
- x3 ^= (u << 7) | (u >>> 25);
- u = (x3 + x15) | 0;
- x7 ^= (u << 9) | (u >>> 23);
- u = (x7 + x3) | 0;
- x11 ^= (u << 13) | (u >>> 19);
- u = (x11 + x7) | 0;
- x15 ^= (u << 18) | (u >>> 14);
- u = (x0 + x3) | 0;
- x1 ^= (u << 7) | (u >>> 25);
- u = (x1 + x0) | 0;
- x2 ^= (u << 9) | (u >>> 23);
- u = (x2 + x1) | 0;
- x3 ^= (u << 13) | (u >>> 19);
- u = (x3 + x2) | 0;
- x0 ^= (u << 18) | (u >>> 14);
- u = (x5 + x4) | 0;
- x6 ^= (u << 7) | (u >>> 25);
- u = (x6 + x5) | 0;
- x7 ^= (u << 9) | (u >>> 23);
- u = (x7 + x6) | 0;
- x4 ^= (u << 13) | (u >>> 19);
- u = (x4 + x7) | 0;
- x5 ^= (u << 18) | (u >>> 14);
- u = (x10 + x9) | 0;
- x11 ^= (u << 7) | (u >>> 25);
- u = (x11 + x10) | 0;
- x8 ^= (u << 9) | (u >>> 23);
- u = (x8 + x11) | 0;
- x9 ^= (u << 13) | (u >>> 19);
- u = (x9 + x8) | 0;
- x10 ^= (u << 18) | (u >>> 14);
- u = (x15 + x14) | 0;
- x12 ^= (u << 7) | (u >>> 25);
- u = (x12 + x15) | 0;
- x13 ^= (u << 9) | (u >>> 23);
- u = (x13 + x12) | 0;
- x14 ^= (u << 13) | (u >>> 19);
- u = (x14 + x13) | 0;
- x15 ^= (u << 18) | (u >>> 14);
- }
- return [x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15];
- };
-
- return Salsa20InnerCore;
-
- })();
-
- Salsa20Core = (function(_super) {
- __extends(Salsa20Core, _super);
-
- Salsa20Core.prototype.sigma = WordArray.from_buffer_le(new Buffer("expand 32-byte k"));
-
- Salsa20Core.prototype.tau = WordArray.from_buffer_le(new Buffer("expand 16-byte k"));
-
- Salsa20Core.blockSize = 64;
-
- Salsa20Core.prototype.blockSize = Salsa20Core.blockSize;
-
- Salsa20Core.keySize = 32;
-
- Salsa20Core.prototype.keySize = Salsa20Core.keySize;
-
- Salsa20Core.ivSize = 192 / 8;
-
- Salsa20Core.prototype.ivSize = Salsa20Core.ivSize;
-
- function Salsa20Core(key, nonce) {
- var _ref1;
- Salsa20Core.__super__.constructor.call(this, 20);
- this.key = key.clone().endian_reverse();
- this.nonce = nonce.clone().endian_reverse();
- if (!(((this.key.sigBytes === 16) && (this.nonce.sigBytes === 8)) || ((this.key.sigBytes === 32) && ((_ref1 = this.nonce.sigBytes) === 8 || _ref1 === 24)))) {
- throw new Error("Bad key/nonce lengths");
- }
- if (this.nonce.sigBytes === 24) {
- this.xsalsa_setup();
- }
- this.input = this.key_iv_setup(this.nonce, this.key);
- this._reset();
- }
-
- Salsa20Core.prototype.scrub = function() {
- this.key.scrub();
- this.nonce.scrub();
- return util.scrub_vec(this.input);
- };
-
- Salsa20Core.prototype.xsalsa_setup = function() {
- var n0, n1;
- n0 = new WordArray(this.nonce.words.slice(0, 4));
- this.nonce = n1 = new WordArray(this.nonce.words.slice(4));
- return this.key = this.hsalsa20(n0, this.key);
- };
-
- Salsa20Core.prototype.hsalsa20 = function(nonce, key) {
- var i, indexes, input, v;
- input = this.key_iv_setup(nonce, key);
- input[8] = nonce.words[2];
- input[9] = nonce.words[3];
- v = this._core(input);
- indexes = [0, 5, 10, 15, 6, 7, 8, 9];
- v = (function() {
- var _i, _len, _results;
- _results = [];
- for (_i = 0, _len = indexes.length; _i < _len; _i++) {
- i = indexes[_i];
- _results.push(fixup_uint32(v[i]));
- }
- return _results;
- })();
- util.scrub_vec(input);
- return new WordArray(v);
- };
-
- Salsa20Core.prototype.key_iv_setup = function(nonce, key) {
- var A, C, i, out, _i, _j, _k, _ref1;
- out = [];
- for (i = _i = 0; _i < 4; i = ++_i) {
- out[i + 1] = key.words[i];
- }
- _ref1 = key.sigBytes === 32 ? [this.sigma, key.words.slice(4)] : [this.tau, key.words], C = _ref1[0], A = _ref1[1];
- for (i = _j = 0; _j < 4; i = ++_j) {
- out[i + 11] = A[i];
- }
- for (i = _k = 0; _k < 4; i = ++_k) {
- out[i * 5] = C.words[i];
- }
- out[6] = nonce.words[0];
- out[7] = nonce.words[1];
- return out;
- };
-
- Salsa20Core.prototype.counter_setup = function() {
- this.input[8] = this.counter.get().words[0];
- return this.input[9] = this.counter.get().words[1];
- };
-
- Salsa20Core.prototype._reset = function() {
- return this.counter = new Counter({
- len: 2
- });
- };
-
- Salsa20Core.prototype._generateBlock = function() {
- var v;
- this.counter_setup();
- v = this._core(this.input);
- asum(v, this.input);
- this.counter.inc_le();
- return v;
- };
-
- return Salsa20Core;
-
- })(Salsa20InnerCore);
-
- exports.Salsa20WordStream = Salsa20WordStream = (function(_super) {
- __extends(Salsa20WordStream, _super);
-
- function Salsa20WordStream() {
- return Salsa20WordStream.__super__.constructor.apply(this, arguments);
- }
-
- Salsa20WordStream.prototype._reset = function() {
- return Salsa20WordStream.__super__._reset.call(this);
- };
-
- Salsa20WordStream.prototype.getWordArray = function(nbytes) {
- var blocks, i, nblocks, w, words, _i, _len, _ref1;
- if ((nbytes == null) || nbytes === this.blockSize) {
- words = this._generateBlock();
- } else {
- nblocks = Math.ceil(nbytes / this.blockSize);
- blocks = (function() {
- var _i, _results;
- _results = [];
- for (i = _i = 0; 0 <= nblocks ? _i < nblocks : _i > nblocks; i = 0 <= nblocks ? ++_i : --_i) {
- _results.push(this._generateBlock());
- }
- return _results;
- }).call(this);
- words = (_ref1 = []).concat.apply(_ref1, blocks);
- }
- for (i = _i = 0, _len = words.length; _i < _len; i = ++_i) {
- w = words[i];
- words[i] = endian_reverse(w);
- }
- return new WordArray(words, nbytes);
- };
-
- return Salsa20WordStream;
-
- })(Salsa20Core);
-
- exports.Salsa20 = Salsa20 = (function(_super) {
- __extends(Salsa20, _super);
-
- function Salsa20() {
- return Salsa20.__super__.constructor.apply(this, arguments);
- }
-
- Salsa20.prototype._reset = function() {
- Salsa20.__super__._reset.call(this);
- return this._i = this.blockSize;
- };
-
- Salsa20.prototype.getBytes = function(needed) {
- var bsz, n, v;
- if (needed == null) {
- needed = this.blockSize;
- }
- v = [];
- bsz = this.blockSize;
- if ((this._i === bsz) && (needed === bsz)) {
- return this._generateBlockBuffer();
- } else {
- while (needed > 0) {
- if (this._i === bsz) {
- this._generateBlockBuffer();
- this._i = 0;
- }
- n = Math.min(needed, bsz - this._i);
- v.push((n === bsz ? this._buf : this._buf.slice(this._i, this._i + n)));
- this._i += n;
- needed -= n;
- }
- return Buffer.concat(v);
- }
- };
-
- Salsa20.prototype._generateBlockBuffer = function() {
- var e, i, v, _i, _len;
- this._buf = new Buffer(this.blockSize);
- v = this._generateBlock();
- for (i = _i = 0, _len = v.length; _i < _len; i = ++_i) {
- e = v[i];
- this._buf.writeUInt32LE(fixup_uint32(e), i * 4);
- }
- return this._buf;
- };
-
- return Salsa20;
-
- })(Salsa20Core);
-
- exports.Cipher = Cipher = (function(_super) {
- __extends(Cipher, _super);
-
- function Cipher(_arg) {
- var iv, key;
- key = _arg.key, iv = _arg.iv;
- Cipher.__super__.constructor.call(this);
- this.salsa = new Salsa20WordStream(key, iv);
- this.bsiw = this.salsa.blockSize / 4;
- }
-
- Cipher.prototype.scrub = function() {
- return this.salsa.scrub();
- };
-
- Cipher.prototype.get_pad = function() {
- var pad;
- pad = this.salsa.getWordArray();
- return pad;
- };
-
- return Cipher;
-
- })(StreamCipher);
-
- exports.encrypt = encrypt = function(_arg) {
- var cipher, input, iv, key, ret;
- key = _arg.key, iv = _arg.iv, input = _arg.input;
- cipher = new Cipher({
- key: key,
- iv: iv
- });
- ret = cipher.encrypt(input);
- cipher.scrub();
- return ret;
- };
-
- exports.bulk_encrypt = bulk_encrypt = function(_arg, cb) {
- var cipher, input, iv, key, progress_hook, ret, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- key = _arg.key, iv = _arg.iv, input = _arg.input, progress_hook = _arg.progress_hook;
- cipher = new Cipher({
- key: key,
- iv: iv
- });
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/salsa20.iced"
- });
- cipher.bulk_encrypt({
- input: input,
- progress_hook: progress_hook,
- what: "salsa20"
- }, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return ret = arguments[0];
- };
- })(),
- lineno: 257
- }));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- cipher.scrub();
- return cb(ret);
- };
- })(this));
- };
-
- exports.Salsa20InnerCore = Salsa20InnerCore;
-
- exports.endian_reverse = endian_reverse;
-
- exports.asum = asum;
-
-}).call(this);
-
-},{"./algbase":2,"./ctr":4,"./util":23,"./wordarray":24,"__browserify_Buffer":26,"iced-runtime":38}],15:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var HMAC_SHA256, Salsa20InnerCore, Scrypt, Timer, WordArray, blkcpy, blkxor, default_delay, endian_reverse, fixup_uint32, iced, pbkdf2, scrub_vec, scrypt, timer, ui8a_to_buffer, v_endian_reverse, __iced_k, __iced_k_noop, _ref, _ref1, _ref2;
-
- iced = require('iced-runtime');
- __iced_k = __iced_k_noop = function() {};
-
- HMAC_SHA256 = require('./hmac').HMAC_SHA256;
-
- pbkdf2 = require('./pbkdf2').pbkdf2;
-
- _ref = require('./salsa20'), endian_reverse = _ref.endian_reverse, Salsa20InnerCore = _ref.Salsa20InnerCore;
-
- _ref1 = require('./wordarray'), ui8a_to_buffer = _ref1.ui8a_to_buffer, WordArray = _ref1.WordArray;
-
- _ref2 = require('./util'), fixup_uint32 = _ref2.fixup_uint32, default_delay = _ref2.default_delay, scrub_vec = _ref2.scrub_vec;
-
- Timer = (function() {
- function Timer() {
- this.tot = 0;
- }
-
- Timer.prototype.start = function() {
- return this._t = Date.now();
- };
-
- Timer.prototype.stop = function() {
- return this.tot += Date.now() - this._t;
- };
-
- return Timer;
-
- })();
-
- timer = new Timer();
-
- blkcpy = function(D, S, d_offset, s_offset, len) {
- "use asm";
- var end, i, j;
- j = (d_offset << 4) | 0;
- i = (s_offset << 4) | 0;
- end = (i + (len << 4)) | 0;
- while (i < end) {
- D[j] = S[i];
- D[j + 1] = S[i + 1];
- D[j + 2] = S[i + 2];
- D[j + 3] = S[i + 3];
- D[j + 4] = S[i + 4];
- D[j + 5] = S[i + 5];
- D[j + 6] = S[i + 6];
- D[j + 7] = S[i + 7];
- D[j + 8] = S[i + 8];
- D[j + 9] = S[i + 9];
- D[j + 10] = S[i + 10];
- D[j + 11] = S[i + 11];
- D[j + 12] = S[i + 12];
- D[j + 13] = S[i + 13];
- D[j + 14] = S[i + 14];
- D[j + 15] = S[i + 15];
- i += 16;
- j += 16;
- }
- return true;
- };
-
- blkxor = function(D, S, s_offset, len) {
- "use asm";
- var i, j;
- len = (len << 4) | 0;
- i = 0;
- j = (s_offset << 4) | 0;
- while (i < len) {
- D[i] ^= S[j];
- D[i + 1] ^= S[j + 1];
- D[i + 2] ^= S[j + 2];
- D[i + 3] ^= S[j + 3];
- D[i + 4] ^= S[j + 4];
- D[i + 5] ^= S[j + 5];
- D[i + 6] ^= S[j + 6];
- D[i + 7] ^= S[j + 7];
- D[i + 8] ^= S[j + 8];
- D[i + 9] ^= S[j + 9];
- D[i + 10] ^= S[j + 10];
- D[i + 11] ^= S[j + 11];
- D[i + 12] ^= S[j + 12];
- D[i + 13] ^= S[j + 13];
- D[i + 14] ^= S[j + 14];
- D[i + 15] ^= S[j + 15];
- i += 16;
- j += 16;
- }
- return true;
- };
-
- v_endian_reverse = function(v) {
- var e, i, _i, _len;
- for (i = _i = 0, _len = v.length; _i < _len; i = ++_i) {
- e = v[i];
- v[i] = endian_reverse(e);
- }
- return true;
- };
-
- Scrypt = (function() {
- function Scrypt(_arg) {
- var N, c, c0, c1;
- N = _arg.N, this.r = _arg.r, this.p = _arg.p, c = _arg.c, c0 = _arg.c0, c1 = _arg.c1, this.klass = _arg.klass;
- this.N || (this.N = 1 << (N || 15));
- this.r || (this.r = 8);
- this.p || (this.p = 1);
- this.c0 = c0 || c || 1;
- this.c1 = c1 || c || 1;
- this.klass || (this.klass = HMAC_SHA256);
- this.X16_tmp = new Int32Array(0x10);
- this.s20ic = new Salsa20InnerCore(8);
- }
-
- Scrypt.prototype.salsa20_8 = function(B) {
- var X, i, x, _i, _len;
- X = this.s20ic._core(B);
- for (i = _i = 0, _len = X.length; _i < _len; i = ++_i) {
- x = X[i];
- B[i] += x;
- }
- return true;
- };
-
- Scrypt.prototype.pbkdf2 = function(_arg, cb) {
- var c, dkLen, key, progress_hook, salt, wa, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- key = _arg.key, salt = _arg.salt, dkLen = _arg.dkLen, progress_hook = _arg.progress_hook, c = _arg.c;
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/scrypt.iced",
- funcname: "Scrypt.pbkdf2"
- });
- pbkdf2({
- key: key,
- salt: salt,
- c: c,
- dkLen: dkLen,
- klass: _this.klass,
- progress_hook: progress_hook
- }, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return wa = arguments[0];
- };
- })(),
- lineno: 113
- }));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- return cb(wa);
- };
- })(this));
- };
-
- Scrypt.prototype.blockmix_salsa8 = function(B, Y) {
- var X, i, _i, _ref3;
- X = this.X16_tmp;
- blkcpy(X, B, 0, 2 * this.r - 1, 1);
- for (i = _i = 0, _ref3 = 2 * this.r; 0 <= _ref3 ? _i < _ref3 : _i > _ref3; i = 0 <= _ref3 ? ++_i : --_i) {
- blkxor(X, B, i, 1);
- this.salsa20_8(X);
- blkcpy(Y, X, i, 0, 1);
- }
- i = 0;
- while (i < this.r) {
- blkcpy(B, Y, i, i * 2, 1);
- i++;
- }
- i = 0;
- while (i < this.r) {
- blkcpy(B, Y, i + this.r, i * 2 + 1, 1);
- i++;
- }
- return true;
- };
-
- Scrypt.prototype.smix = function(_arg, cb) {
- var B, V, X, XY, Y, i, j, lim, progress_hook, stop, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- B = _arg.B, V = _arg.V, XY = _arg.XY, progress_hook = _arg.progress_hook;
- X = XY;
- lim = 2 * this.r;
- Y = XY.subarray(0x10 * lim);
- blkcpy(X, B, 0, 0, lim);
- i = 0;
- (function(_this) {
- return (function(__iced_k) {
- var _results, _while;
- _results = [];
- _while = function(__iced_k) {
- var _break, _continue, _next;
- _break = function() {
- return __iced_k(_results);
- };
- _continue = function() {
- return iced.trampoline(function() {
- return _while(__iced_k);
- });
- };
- _next = function(__iced_next_arg) {
- _results.push(__iced_next_arg);
- return _continue();
- };
- if (!(i < _this.N)) {
- return _break();
- } else {
- stop = Math.min(_this.N, i + 2048);
- while (i < stop) {
- blkcpy(V, X, lim * i, 0, lim);
- _this.blockmix_salsa8(X, Y);
- i++;
- }
- if (typeof progress_hook === "function") {
- progress_hook(i);
- }
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/scrypt.iced",
- funcname: "Scrypt.smix"
- });
- default_delay(0, 0, __iced_deferrals.defer({
- lineno: 170
- }));
- __iced_deferrals._fulfill();
- })(_next);
- }
- };
- _while(__iced_k);
- });
- })(this)((function(_this) {
- return function() {
- i = 0;
- (function(__iced_k) {
- var _results, _while;
- _results = [];
- _while = function(__iced_k) {
- var _break, _continue, _next;
- _break = function() {
- return __iced_k(_results);
- };
- _continue = function() {
- return iced.trampoline(function() {
- return _while(__iced_k);
- });
- };
- _next = function(__iced_next_arg) {
- _results.push(__iced_next_arg);
- return _continue();
- };
- if (!(i < _this.N)) {
- return _break();
- } else {
- stop = Math.min(_this.N, i + 256);
- while (i < stop) {
- j = fixup_uint32(X[0x10 * (lim - 1)]) & (_this.N - 1);
- blkxor(X, V, j * lim, lim);
- _this.blockmix_salsa8(X, Y);
- i++;
- }
- if (typeof progress_hook === "function") {
- progress_hook(i + _this.N);
- }
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/scrypt.iced",
- funcname: "Scrypt.smix"
- });
- default_delay(0, 0, __iced_deferrals.defer({
- lineno: 187
- }));
- __iced_deferrals._fulfill();
- })(_next);
- }
- };
- _while(__iced_k);
- })(function() {
- blkcpy(B, X, 0, 0, lim);
- return cb();
- });
- };
- })(this));
- };
-
- Scrypt.prototype.run = function(_arg, cb) {
- var B, MAX, V, XY, dkLen, err, j, key, lph, out, progress_hook, ret, salt, ___iced_passed_deferral, __iced_deferrals, __iced_k, _begin, _end, _positive;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- key = _arg.key, salt = _arg.salt, dkLen = _arg.dkLen, progress_hook = _arg.progress_hook;
- MAX = 0xffffffff;
- err = ret = null;
- err = dkLen > MAX ? err = new Error("asked for too much data") : this.r * this.p >= (1 << 30) ? new Error("r & p are too big") : (this.r > MAX / 128 / this.p) || (this.r > MAX / 256) || (this.N > MAX / 128 / this.r) ? new Error("N is too big") : null;
- XY = new Int32Array(64 * this.r);
- V = new Int32Array(32 * this.r * this.N);
- lph = function(o) {
- o.what += " (pass 1)";
- return typeof progress_hook === "function" ? progress_hook(o) : void 0;
- };
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/scrypt.iced",
- funcname: "Scrypt.run"
- });
- _this.pbkdf2({
- key: key.clone(),
- salt: salt,
- dkLen: 128 * _this.r * _this.p,
- c: _this.c0,
- progress_hook: lph
- }, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return B = arguments[0];
- };
- })(),
- lineno: 218
- }));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- B = new Int32Array(B.words);
- v_endian_reverse(B);
- lph = function(j) {
- return function(i) {
- return typeof progress_hook === "function" ? progress_hook({
- i: i + j * _this.N * 2,
- what: "scrypt",
- total: _this.p * _this.N * 2
- }) : void 0;
- };
- };
- (function(__iced_k) {
- var _i, _results, _while;
- j = 0;
- _begin = 0;
- _end = _this.p;
- _positive = _end > _begin;
- _results = [];
- _while = function(__iced_k) {
- var _break, _continue, _next;
- _break = function() {
- return __iced_k(_results);
- };
- _continue = function() {
- return iced.trampoline(function() {
- if (_positive) {
- j += 1;
- } else {
- j -= 1;
- }
- return _while(__iced_k);
- });
- };
- _next = function(__iced_next_arg) {
- _results.push(__iced_next_arg);
- return _continue();
- };
- if (!!((_positive === true && j >= _this.p) || (_positive === false && j <= _this.p))) {
- return _break();
- } else {
-
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/scrypt.iced",
- funcname: "Scrypt.run"
- });
- _this.smix({
- B: B.subarray(32 * _this.r * j),
- V: V,
- XY: XY,
- progress_hook: lph(j)
- }, __iced_deferrals.defer({
- lineno: 225
- }));
- __iced_deferrals._fulfill();
- })(_next);
- }
- };
- _while(__iced_k);
- })(function() {
- v_endian_reverse(B);
- lph = function(o) {
- o.what += " (pass 2)";
- return typeof progress_hook === "function" ? progress_hook(o) : void 0;
- };
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/scrypt.iced",
- funcname: "Scrypt.run"
- });
- _this.pbkdf2({
- key: key,
- salt: WordArray.from_i32a(B),
- dkLen: dkLen,
- c: _this.c1,
- progress_hook: lph
- }, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return out = arguments[0];
- };
- })(),
- lineno: 233
- }));
- __iced_deferrals._fulfill();
- })(function() {
- scrub_vec(XY);
- scrub_vec(V);
- scrub_vec(B);
- key.scrub();
- return cb(out);
- });
- });
- };
- })(this));
- };
-
- return Scrypt;
-
- })();
-
- scrypt = function(_arg, cb) {
- var N, c, c0, c1, dkLen, eng, key, klass, p, progress_hook, r, salt, wa, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- key = _arg.key, salt = _arg.salt, r = _arg.r, N = _arg.N, p = _arg.p, c0 = _arg.c0, c1 = _arg.c1, c = _arg.c, klass = _arg.klass, progress_hook = _arg.progress_hook, dkLen = _arg.dkLen;
- eng = new Scrypt({
- r: r,
- N: N,
- p: p,
- c: c,
- c0: c0,
- c1: c1,
- klass: klass
- });
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/scrypt.iced"
- });
- eng.run({
- key: key,
- salt: salt,
- progress_hook: progress_hook,
- dkLen: dkLen
- }, __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return wa = arguments[0];
- };
- })(),
- lineno: 263
- }));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- return cb(wa);
- };
- })(this));
- };
-
- exports.Scrypt = Scrypt;
-
- exports.scrypt = scrypt;
-
- exports.v_endian_reverse = v_endian_reverse;
-
-}).call(this);
-
-},{"./hmac":8,"./pbkdf2":12,"./salsa20":14,"./util":23,"./wordarray":24,"iced-runtime":38}],16:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var Hasher, SHA1, W, WordArray, transform,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
-
- WordArray = require('./wordarray').WordArray;
-
- Hasher = require('./algbase').Hasher;
-
- W = [];
-
- SHA1 = (function(_super) {
- __extends(SHA1, _super);
-
- function SHA1() {
- return SHA1.__super__.constructor.apply(this, arguments);
- }
-
- SHA1.blockSize = 512 / 32;
-
- SHA1.prototype.blockSize = SHA1.blockSize;
-
- SHA1.output_size = 20;
-
- SHA1.prototype.output_size = SHA1.output_size;
-
- SHA1.prototype._doReset = function() {
- return this._hash = new WordArray([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]);
- };
-
- SHA1.prototype._doProcessBlock = function(M, offset) {
- var H, a, b, c, d, e, i, n, t, _i;
- H = this._hash.words;
- a = H[0];
- b = H[1];
- c = H[2];
- d = H[3];
- e = H[4];
- for (i = _i = 0; _i < 80; i = ++_i) {
- if (i < 16) {
- W[i] = M[offset + i] | 0;
- } else {
- n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
- W[i] = (n << 1) | (n >>> 31);
- }
- 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 {
- t += (b ^ c ^ d) - 0x359d3e2a;
- }
- e = d;
- d = c;
- c = (b << 30) | (b >>> 2);
- b = a;
- a = t;
- }
- H[0] = (H[0] + a) | 0;
- H[1] = (H[1] + b) | 0;
- H[2] = (H[2] + c) | 0;
- H[3] = (H[3] + d) | 0;
- return H[4] = (H[4] + e) | 0;
- };
-
- SHA1.prototype._doFinalize = function() {
- var data, dataWords, nBitsLeft, nBitsTotal;
- data = this._data;
- dataWords = data.words;
- nBitsTotal = this._nDataBytes * 8;
- nBitsLeft = data.sigBytes * 8;
- 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;
- this._process();
- return this._hash;
- };
-
- SHA1.prototype.copy_to = function(obj) {
- SHA1.__super__.copy_to.call(this, obj);
- return obj._hash = this._hash.clone();
- };
-
- SHA1.prototype.clone = function() {
- var out;
- out = new SHA1();
- this.copy_to(out);
- return out;
- };
-
- return SHA1;
-
- })(Hasher);
-
- transform = transform = function(x) {
- var out;
- out = (new SHA1).finalize(x);
- x.scrub();
- return out;
- };
-
- exports.SHA1 = SHA1;
-
- exports.transform = transform;
-
-}).call(this);
-
-},{"./algbase":2,"./wordarray":24}],17:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var SHA224, SHA256, WordArray, transform,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
-
- WordArray = require('./wordarray').WordArray;
-
- SHA256 = require('./sha256').SHA256;
-
- SHA224 = (function(_super) {
- __extends(SHA224, _super);
-
- function SHA224() {
- return SHA224.__super__.constructor.apply(this, arguments);
- }
-
- SHA224.output_size = 224 / 8;
-
- SHA224.prototype.output_size = SHA224.output_size;
-
- SHA224.prototype._doReset = function() {
- return this._hash = new WordArray([0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4]);
- };
-
- SHA224.prototype._doFinalize = function() {
- var hash;
- hash = SHA224.__super__._doFinalize.call(this);
- hash.sigBytes -= 4;
- return hash;
- };
-
- SHA224.prototype.clone = function() {
- var out;
- out = new SHA224();
- this.copy_to(out);
- return out;
- };
-
- return SHA224;
-
- })(SHA256);
-
- transform = function(x) {
- var out;
- out = (new SHA224).finalize(x);
- x.scrub();
- return out;
- };
-
- exports.SHA224 = SHA224;
-
- exports.transform = transform;
-
-}).call(this);
-
-},{"./sha256":18,"./wordarray":24}],18:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var Global, Hasher, SHA256, WordArray, glbl, transform,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
-
- WordArray = require('./wordarray').WordArray;
-
- Hasher = require('./algbase').Hasher;
-
- Global = (function() {
- function Global() {
- this.H = [];
- this.K = [];
- this.W = [];
- this.init();
- }
-
- Global.prototype.isPrime = function(n) {
- var f, sqn, _i;
- if (n === 2 || n === 3 || n === 5 || n === 7) {
- return true;
- }
- if (n === 1 || n === 4 || n === 6 || n === 8 || n === 9) {
- return false;
- }
- sqn = Math.ceil(Math.sqrt(n));
- for (f = _i = 2; 2 <= sqn ? _i <= sqn : _i >= sqn; f = 2 <= sqn ? ++_i : --_i) {
- if ((n % f) === 0) {
- return false;
- }
- }
- return true;
- };
-
- Global.prototype.getFractionalBits = function(n) {
- return ((n - (n | 0)) * 0x100000000) | 0;
- };
-
- Global.prototype.init = function() {
- var n, nPrime, _results;
- n = 2;
- nPrime = 0;
- _results = [];
- while (nPrime < 64) {
- if (this.isPrime(n)) {
- if (nPrime < 8) {
- this.H[nPrime] = this.getFractionalBits(Math.pow(n, 1 / 2));
- }
- this.K[nPrime] = this.getFractionalBits(Math.pow(n, 1 / 3));
- nPrime++;
- }
- _results.push(n++);
- }
- return _results;
- };
-
- return Global;
-
- })();
-
- glbl = new Global();
-
- SHA256 = (function(_super) {
- __extends(SHA256, _super);
-
- function SHA256() {
- return SHA256.__super__.constructor.apply(this, arguments);
- }
-
- SHA256.blockSize = 512 / 32;
-
- SHA256.prototype.blockSize = SHA256.blockSize;
-
- SHA256.output_size = 256 / 8;
-
- SHA256.prototype.output_size = SHA256.output_size;
-
- SHA256.prototype._doReset = function() {
- return this._hash = new WordArray(glbl.H.slice(0));
- };
-
- SHA256.prototype.get_output_size = function() {
- return this.output_size;
- };
-
- SHA256.prototype._doProcessBlock = function(M, offset) {
- var H, K, W, a, b, c, ch, d, e, f, g, gamma0, gamma0x, gamma1, gamma1x, h, i, maj, sigma0, sigma1, t1, t2, _i;
- H = this._hash.words;
- W = glbl.W;
- K = glbl.K;
- a = H[0];
- b = H[1];
- c = H[2];
- d = H[3];
- e = H[4];
- f = H[5];
- g = H[6];
- h = H[7];
- for (i = _i = 0; _i < 64; i = ++_i) {
- if (i < 16) {
- W[i] = M[offset + i] | 0;
- } else {
- gamma0x = W[i - 15];
- gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ ((gamma0x << 14) | (gamma0x >>> 18)) ^ (gamma0x >>> 3);
- gamma1x = W[i - 2];
- gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ ((gamma1x << 13) | (gamma1x >>> 19)) ^ (gamma1x >>> 10);
- W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
- }
- ch = (e & f) ^ (~e & g);
- maj = (a & b) ^ (a & c) ^ (b & c);
- sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));
- sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));
- t1 = h + sigma1 + ch + K[i] + W[i];
- t2 = sigma0 + maj;
- h = g;
- g = f;
- f = e;
- e = (d + t1) | 0;
- d = c;
- c = b;
- b = a;
- a = (t1 + t2) | 0;
- }
- 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;
- H[5] = (H[5] + f) | 0;
- H[6] = (H[6] + g) | 0;
- return H[7] = (H[7] + h) | 0;
- };
-
- SHA256.prototype._doFinalize = function() {
- var data, dataWords, nBitsLeft, nBitsTotal;
- data = this._data;
- dataWords = data.words;
- nBitsTotal = this._nDataBytes * 8;
- nBitsLeft = data.sigBytes * 8;
- 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;
- this._process();
- return this._hash;
- };
-
- SHA256.prototype.scrub = function() {
- return this._hash.scrub();
- };
-
- SHA256.prototype.copy_to = function(obj) {
- SHA256.__super__.copy_to.call(this, obj);
- return obj._hash = this._hash.clone();
- };
-
- SHA256.prototype.clone = function() {
- var out;
- out = new SHA256();
- this.copy_to(out);
- return out;
- };
-
- return SHA256;
-
- })(Hasher);
-
- transform = function(x) {
- var out;
- out = (new SHA256).finalize(x);
- x.scrub();
- return out;
- };
-
- exports.SHA256 = SHA256;
-
- exports.transform = transform;
-
-}).call(this);
-
-},{"./algbase":2,"./wordarray":24}],19:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var Global, Hasher, SHA3, WordArray, X64Word, X64WordArray, glbl, _ref,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
-
- _ref = require('./wordarray'), WordArray = _ref.WordArray, X64Word = _ref.X64Word, X64WordArray = _ref.X64WordArray;
-
- Hasher = require('./algbase').Hasher;
-
- Global = (function() {
- function Global() {
- this.RHO_OFFSETS = [];
- this.PI_INDEXES = [];
- this.ROUND_CONSTANTS = [];
- this.T = [];
- this.compute_rho_offsets();
- this.compute_pi_indexes();
- this.compute_round_constants();
- this.make_reusables();
- }
-
- Global.prototype.compute_rho_offsets = function() {
- var newX, newY, t, x, y, _i, _results;
- x = 1;
- y = 0;
- _results = [];
- for (t = _i = 0; _i < 24; t = ++_i) {
- this.RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64;
- newX = y % 5;
- newY = (2 * x + 3 * y) % 5;
- x = newX;
- _results.push(y = newY);
- }
- return _results;
- };
-
- Global.prototype.compute_pi_indexes = function() {
- var x, y, _i, _results;
- _results = [];
- for (x = _i = 0; _i < 5; x = ++_i) {
- _results.push((function() {
- var _j, _results1;
- _results1 = [];
- for (y = _j = 0; _j < 5; y = ++_j) {
- _results1.push(this.PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5);
- }
- return _results1;
- }).call(this));
- }
- return _results;
- };
-
- Global.prototype.compute_round_constants = function() {
- var LFSR, bitPosition, i, j, roundConstantLsw, roundConstantMsw, _i, _j, _results;
- LFSR = 0x01;
- _results = [];
- for (i = _i = 0; _i < 24; i = ++_i) {
- roundConstantMsw = 0;
- roundConstantLsw = 0;
- for (j = _j = 0; _j < 7; j = ++_j) {
- if (LFSR & 0x01) {
- bitPosition = (1 << j) - 1;
- if (bitPosition < 32) {
- roundConstantLsw ^= 1 << bitPosition;
- } else {
- roundConstantMsw ^= 1 << (bitPosition - 32);
- }
- }
- if (LFSR & 0x80) {
- LFSR = (LFSR << 1) ^ 0x71;
- } else {
- LFSR <<= 1;
- }
- }
- _results.push(this.ROUND_CONSTANTS[i] = new X64Word(roundConstantMsw, roundConstantLsw));
- }
- return _results;
- };
-
- Global.prototype.make_reusables = function() {
- var i;
- return this.T = (function() {
- var _i, _results;
- _results = [];
- for (i = _i = 0; _i < 25; i = ++_i) {
- _results.push(new X64Word(0, 0));
- }
- return _results;
- })();
- };
-
- return Global;
-
- })();
-
- glbl = new Global();
-
- exports.SHA3 = SHA3 = (function(_super) {
- __extends(SHA3, _super);
-
- function SHA3() {
- return SHA3.__super__.constructor.apply(this, arguments);
- }
-
- SHA3.outputLength = 512;
-
- SHA3.prototype.outputLength = SHA3.outputLength;
-
- SHA3.blockSize = (1600 - 2 * SHA3.outputLength) / 32;
-
- SHA3.prototype.blockSize = SHA3.blockSize;
-
- SHA3.output_size = SHA3.outputLength / 8;
-
- SHA3.prototype.output_size = SHA3.output_size;
-
- SHA3.prototype._doReset = function() {
- var i;
- return this._state = (function() {
- var _i, _results;
- _results = [];
- for (i = _i = 0; _i < 25; i = ++_i) {
- _results.push(new X64Word(0, 0));
- }
- return _results;
- })();
- };
-
- SHA3.prototype._doProcessBlock = function(M, offset) {
- var G, M2i, M2i1, T0, TLane, TPiLane, Tx, Tx1, Tx1Lane, Tx1Lsw, Tx1Msw, Tx2Lane, Tx4, i, lane, laneIndex, laneLsw, laneMsw, nBlockSizeLanes, rhoOffset, round, roundConstant, state, state0, tLsw, tMsw, x, y, _i, _j, _k, _l, _m, _n, _o, _p, _q, _results;
- G = glbl;
- state = this._state;
- nBlockSizeLanes = this.blockSize / 2;
- for (i = _i = 0; 0 <= nBlockSizeLanes ? _i < nBlockSizeLanes : _i > nBlockSizeLanes; i = 0 <= nBlockSizeLanes ? ++_i : --_i) {
- M2i = M[offset + 2 * i];
- M2i1 = M[offset + 2 * i + 1];
- M2i = (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) | (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00);
- M2i1 = (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) | (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00);
- lane = state[i];
- lane.high ^= M2i1;
- lane.low ^= M2i;
- }
- _results = [];
- for (round = _j = 0; _j < 24; round = ++_j) {
- for (x = _k = 0; _k < 5; x = ++_k) {
- tMsw = tLsw = 0;
- for (y = _l = 0; _l < 5; y = ++_l) {
- lane = state[x + 5 * y];
- tMsw ^= lane.high;
- tLsw ^= lane.low;
- }
- Tx = G.T[x];
- Tx.high = tMsw;
- Tx.low = tLsw;
- }
- for (x = _m = 0; _m < 5; x = ++_m) {
- Tx4 = G.T[(x + 4) % 5];
- Tx1 = G.T[(x + 1) % 5];
- Tx1Msw = Tx1.high;
- Tx1Lsw = Tx1.low;
- tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31));
- tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31));
- for (y = _n = 0; _n < 5; y = ++_n) {
- lane = state[x + 5 * y];
- lane.high ^= tMsw;
- lane.low ^= tLsw;
- }
- }
- for (laneIndex = _o = 1; _o < 25; laneIndex = ++_o) {
- lane = state[laneIndex];
- laneMsw = lane.high;
- laneLsw = lane.low;
- rhoOffset = G.RHO_OFFSETS[laneIndex];
- if (rhoOffset < 32) {
- tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset));
- tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset));
- } else {
- tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset));
- tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset));
- }
- TPiLane = G.T[G.PI_INDEXES[laneIndex]];
- TPiLane.high = tMsw;
- TPiLane.low = tLsw;
- }
- T0 = G.T[0];
- state0 = state[0];
- T0.high = state0.high;
- T0.low = state0.low;
- for (x = _p = 0; _p < 5; x = ++_p) {
- for (y = _q = 0; _q < 5; y = ++_q) {
- laneIndex = x + 5 * y;
- lane = state[laneIndex];
- TLane = G.T[laneIndex];
- Tx1Lane = G.T[((x + 1) % 5) + 5 * y];
- Tx2Lane = G.T[((x + 2) % 5) + 5 * y];
- lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high);
- lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low);
- }
- }
- lane = state[0];
- roundConstant = G.ROUND_CONSTANTS[round];
- lane.high ^= roundConstant.high;
- _results.push(lane.low ^= roundConstant.low);
- }
- return _results;
- };
-
- SHA3.prototype._doFinalize = function() {
- var blockSizeBits, data, dataWords, hashWords, i, lane, laneLsw, laneMsw, nBitsLeft, nBitsTotal, outputLengthBytes, outputLengthLanes, state, _i;
- data = this._data;
- dataWords = data.words;
- nBitsTotal = this._nDataBytes * 8;
- nBitsLeft = data.sigBytes * 8;
- blockSizeBits = this.blockSize * 32;
- dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32);
- dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80;
- data.sigBytes = dataWords.length * 4;
- this._process();
- state = this._state;
- outputLengthBytes = this.outputLength / 8;
- outputLengthLanes = outputLengthBytes / 8;
- hashWords = [];
- for (i = _i = 0; 0 <= outputLengthLanes ? _i < outputLengthLanes : _i > outputLengthLanes; i = 0 <= outputLengthLanes ? ++_i : --_i) {
- lane = state[i];
- laneMsw = lane.high;
- laneLsw = lane.low;
- laneMsw = (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) | (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00);
- laneLsw = (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) | (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00);
- hashWords.push(laneLsw);
- hashWords.push(laneMsw);
- }
- return new WordArray(hashWords, outputLengthBytes);
- };
-
- SHA3.prototype.copy_to = function(obj) {
- var s;
- SHA3.__super__.copy_to.call(this, obj);
- return obj._state = (function() {
- var _i, _len, _ref1, _results;
- _ref1 = this._state;
- _results = [];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- s = _ref1[_i];
- _results.push(s.clone());
- }
- return _results;
- }).call(this);
- };
-
- SHA3.prototype.scrub = function() {};
-
- SHA3.prototype.clone = function() {
- var out;
- out = new SHA3();
- this.copy_to(out);
- return out;
- };
-
- return SHA3;
-
- })(Hasher);
-
- exports.transform = function(x) {
- var out;
- out = (new SHA3).finalize(x);
- x.scrub();
- return out;
- };
-
-}).call(this);
-
-},{"./algbase":2,"./wordarray":24}],20:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var Global, SHA384, SHA512, WordArray, X64WordArray, transform, _ref, _ref1,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
-
- _ref = require('./wordarray'), X64WordArray = _ref.X64WordArray, WordArray = _ref.WordArray;
-
- _ref1 = require('./sha512'), SHA512 = _ref1.SHA512, Global = _ref1.Global;
-
- SHA384 = (function(_super) {
- __extends(SHA384, _super);
-
- function SHA384() {
- return SHA384.__super__.constructor.apply(this, arguments);
- }
-
- SHA384.output_size = 384 / 8;
-
- SHA384.prototype.output_size = SHA384.output_size;
-
- SHA384.prototype._doReset = function() {
- return this._hash = new X64WordArray(Global.convert([0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939, 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4]));
- };
-
- SHA384.prototype._doFinalize = function() {
- var hash;
- hash = SHA384.__super__._doFinalize.call(this);
- hash.sigBytes -= 16;
- return hash;
- };
-
- SHA384.prototype.clone = function() {
- var out;
- out = new SHA384();
- this.copy_to(out);
- return out;
- };
-
- return SHA384;
-
- })(SHA512);
-
- transform = function(x) {
- var out;
- out = (new SHA384).finalize(x);
- x.scrub();
- return out;
- };
-
- exports.SHA384 = SHA384;
-
- exports.transform = transform;
-
-}).call(this);
-
-},{"./sha512":21,"./wordarray":24}],21:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var Global, Hasher, SHA512, X64Word, X64WordArray, glbl, _ref,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
-
- _ref = require('./wordarray'), X64Word = _ref.X64Word, X64WordArray = _ref.X64WordArray;
-
- Hasher = require('./algbase').Hasher;
-
- Global = (function() {
- Global.convert = function(raw) {
- var i, _i, _ref1, _results;
- _results = [];
- for (i = _i = 0, _ref1 = raw.length; _i < _ref1; i = _i += 2) {
- _results.push(new X64Word(raw[i], raw[i + 1]));
- }
- return _results;
- };
-
- Global.prototype.convert = function(raw) {
- return Global.convert(raw);
- };
-
- function Global() {
- var i;
- this.K = this.convert([0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817]);
- this.I = new X64WordArray(this.convert([0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179]));
- this.W = (function() {
- var _i, _results;
- _results = [];
- for (i = _i = 0; _i < 80; i = ++_i) {
- _results.push(new X64Word(0, 0));
- }
- return _results;
- })();
- }
-
- return Global;
-
- })();
-
- exports.Global = Global;
-
- glbl = new Global();
-
- exports.SHA512 = SHA512 = (function(_super) {
- __extends(SHA512, _super);
-
- function SHA512() {
- return SHA512.__super__.constructor.apply(this, arguments);
- }
-
- SHA512.blockSize = 1024 / 32;
-
- SHA512.prototype.blockSize = SHA512.blockSize;
-
- SHA512.output_size = 512 / 8;
-
- SHA512.prototype.output_size = SHA512.output_size;
-
- SHA512.prototype._doReset = function() {
- return this._hash = glbl.I.clone();
- };
-
- SHA512.prototype._doProcessBlock = function(M, offset) {
- var H, H0, H0h, H0l, H1, H1h, H1l, H2, H2h, H2l, H3, H3h, H3l, H4, H4h, H4l, H5, H5h, H5l, H6, H6h, H6l, H7, H7h, H7l, Ki, Kih, Kil, W, Wi, Wi16, Wi16h, Wi16l, Wi7, Wi7h, Wi7l, Wih, Wil, ah, al, bh, bl, ch, chh, chl, cl, dh, dl, eh, el, fh, fl, gamma0h, gamma0l, gamma0x, gamma0xh, gamma0xl, gamma1h, gamma1l, gamma1x, gamma1xh, gamma1xl, gh, gl, hh, hl, i, majh, majl, sigma0h, sigma0l, sigma1h, sigma1l, t1h, t1l, t2h, t2l, _i;
- H = this._hash.words;
- W = glbl.W;
- H0 = H[0];
- H1 = H[1];
- H2 = H[2];
- H3 = H[3];
- H4 = H[4];
- H5 = H[5];
- H6 = H[6];
- H7 = H[7];
- H0h = H0.high;
- H0l = H0.low;
- H1h = H1.high;
- H1l = H1.low;
- H2h = H2.high;
- H2l = H2.low;
- H3h = H3.high;
- H3l = H3.low;
- H4h = H4.high;
- H4l = H4.low;
- H5h = H5.high;
- H5l = H5.low;
- H6h = H6.high;
- H6l = H6.low;
- H7h = H7.high;
- H7l = H7.low;
- ah = H0h;
- al = H0l;
- bh = H1h;
- bl = H1l;
- ch = H2h;
- cl = H2l;
- dh = H3h;
- dl = H3l;
- eh = H4h;
- el = H4l;
- fh = H5h;
- fl = H5l;
- gh = H6h;
- gl = H6l;
- hh = H7h;
- hl = H7l;
- for (i = _i = 0; _i < 80; i = ++_i) {
- Wi = W[i];
- if (i < 16) {
- Wih = Wi.high = M[offset + i * 2] | 0;
- Wil = Wi.low = M[offset + i * 2 + 1] | 0;
- } else {
- gamma0x = W[i - 15];
- gamma0xh = gamma0x.high;
- gamma0xl = gamma0x.low;
- gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7);
- gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25));
- gamma1x = W[i - 2];
- gamma1xh = gamma1x.high;
- gamma1xl = gamma1x.low;
- gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6);
- gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26));
- Wi7 = W[i - 7];
- Wi7h = Wi7.high;
- Wi7l = Wi7.low;
- Wi16 = W[i - 16];
- Wi16h = Wi16.high;
- Wi16l = Wi16.low;
- Wil = gamma0l + Wi7l;
- Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0);
- Wil = Wil + gamma1l;
- Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0);
- Wil = Wil + Wi16l;
- Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0);
- Wi.high = Wih;
- Wi.low = Wil;
- }
- chh = (eh & fh) ^ (~eh & gh);
- chl = (el & fl) ^ (~el & gl);
- majh = (ah & bh) ^ (ah & ch) ^ (bh & ch);
- majl = (al & bl) ^ (al & cl) ^ (bl & cl);
- sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7));
- sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7));
- sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9));
- sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9));
- Ki = glbl.K[i];
- Kih = Ki.high;
- Kil = Ki.low;
- t1l = hl + sigma1l;
- t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0);
- t1l = t1l + chl;
- t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0);
- t1l = t1l + Kil;
- t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0);
- t1l = t1l + Wil;
- t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0);
- t2l = sigma0l + majl;
- t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0);
- hh = gh;
- hl = gl;
- gh = fh;
- gl = fl;
- fh = eh;
- fl = el;
- el = (dl + t1l) | 0;
- eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
- dh = ch;
- dl = cl;
- ch = bh;
- cl = bl;
- bh = ah;
- bl = al;
- al = (t1l + t2l) | 0;
- ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0;
- }
- H0l = H0.low = H0l + al;
- H0.high = H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0);
- H1l = H1.low = H1l + bl;
- H1.high = H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0);
- H2l = H2.low = H2l + cl;
- H2.high = H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0);
- H3l = H3.low = H3l + dl;
- H3.high = H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0);
- H4l = H4.low = H4l + el;
- H4.high = H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0);
- H5l = H5.low = H5l + fl;
- H5.high = H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0);
- H6l = H6.low = H6l + gl;
- H6.high = H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0);
- H7l = H7.low = H7l + hl;
- return H7.high = H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0);
- };
-
- SHA512.prototype._doFinalize = function() {
- var dataWords, nBitsLeft, nBitsTotal;
- dataWords = this._data.words;
- nBitsTotal = this._nDataBytes * 8;
- nBitsLeft = this._data.sigBytes * 8;
- dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
- dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000);
- dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal;
- this._data.sigBytes = dataWords.length * 4;
- this._process();
- return this._hash.toX32();
- };
-
- SHA512.prototype.copy_to = function(obj) {
- SHA512.__super__.copy_to.call(this, obj);
- return obj._hash = this._hash.clone();
- };
-
- SHA512.prototype.clone = function() {
- var out;
- out = new SHA512();
- this.copy_to(out);
- return out;
- };
-
- return SHA512;
-
- })(Hasher);
-
- exports.transform = function(x) {
- var out;
- out = (new SHA512).finalize(x);
- x.scrub();
- return out;
- };
-
-}).call(this);
-
-},{"./algbase":2,"./wordarray":24}],22:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var BlockCipher, G, Global, TwoFish, scrub_vec,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
-
- BlockCipher = require('./algbase').BlockCipher;
-
- scrub_vec = require('./util').scrub_vec;
-
- Global = (function() {
- function Global() {
- this.P = [[0xA9, 0x67, 0xB3, 0xE8, 0x04, 0xFD, 0xA3, 0x76, 0x9A, 0x92, 0x80, 0x78, 0xE4, 0xDD, 0xD1, 0x38, 0x0D, 0xC6, 0x35, 0x98, 0x18, 0xF7, 0xEC, 0x6C, 0x43, 0x75, 0x37, 0x26, 0xFA, 0x13, 0x94, 0x48, 0xF2, 0xD0, 0x8B, 0x30, 0x84, 0x54, 0xDF, 0x23, 0x19, 0x5B, 0x3D, 0x59, 0xF3, 0xAE, 0xA2, 0x82, 0x63, 0x01, 0x83, 0x2E, 0xD9, 0x51, 0x9B, 0x7C, 0xA6, 0xEB, 0xA5, 0xBE, 0x16, 0x0C, 0xE3, 0x61, 0xC0, 0x8C, 0x3A, 0xF5, 0x73, 0x2C, 0x25, 0x0B, 0xBB, 0x4E, 0x89, 0x6B, 0x53, 0x6A, 0xB4, 0xF1, 0xE1, 0xE6, 0xBD, 0x45, 0xE2, 0xF4, 0xB6, 0x66, 0xCC, 0x95, 0x03, 0x56, 0xD4, 0x1C, 0x1E, 0xD7, 0xFB, 0xC3, 0x8E, 0xB5, 0xE9, 0xCF, 0xBF, 0xBA, 0xEA, 0x77, 0x39, 0xAF, 0x33, 0xC9, 0x62, 0x71, 0x81, 0x79, 0x09, 0xAD, 0x24, 0xCD, 0xF9, 0xD8, 0xE5, 0xC5, 0xB9, 0x4D, 0x44, 0x08, 0x86, 0xE7, 0xA1, 0x1D, 0xAA, 0xED, 0x06, 0x70, 0xB2, 0xD2, 0x41, 0x7B, 0xA0, 0x11, 0x31, 0xC2, 0x27, 0x90, 0x20, 0xF6, 0x60, 0xFF, 0x96, 0x5C, 0xB1, 0xAB, 0x9E, 0x9C, 0x52, 0x1B, 0x5F, 0x93, 0x0A, 0xEF, 0x91, 0x85, 0x49, 0xEE, 0x2D, 0x4F, 0x8F, 0x3B, 0x47, 0x87, 0x6D, 0x46, 0xD6, 0x3E, 0x69, 0x64, 0x2A, 0xCE, 0xCB, 0x2F, 0xFC, 0x97, 0x05, 0x7A, 0xAC, 0x7F, 0xD5, 0x1A, 0x4B, 0x0E, 0xA7, 0x5A, 0x28, 0x14, 0x3F, 0x29, 0x88, 0x3C, 0x4C, 0x02, 0xB8, 0xDA, 0xB0, 0x17, 0x55, 0x1F, 0x8A, 0x7D, 0x57, 0xC7, 0x8D, 0x74, 0xB7, 0xC4, 0x9F, 0x72, 0x7E, 0x15, 0x22, 0x12, 0x58, 0x07, 0x99, 0x34, 0x6E, 0x50, 0xDE, 0x68, 0x65, 0xBC, 0xDB, 0xF8, 0xC8, 0xA8, 0x2B, 0x40, 0xDC, 0xFE, 0x32, 0xA4, 0xCA, 0x10, 0x21, 0xF0, 0xD3, 0x5D, 0x0F, 0x00, 0x6F, 0x9D, 0x36, 0x42, 0x4A, 0x5E, 0xC1, 0xE0], [0x75, 0xF3, 0xC6, 0xF4, 0xDB, 0x7B, 0xFB, 0xC8, 0x4A, 0xD3, 0xE6, 0x6B, 0x45, 0x7D, 0xE8, 0x4B, 0xD6, 0x32, 0xD8, 0xFD, 0x37, 0x71, 0xF1, 0xE1, 0x30, 0x0F, 0xF8, 0x1B, 0x87, 0xFA, 0x06, 0x3F, 0x5E, 0xBA, 0xAE, 0x5B, 0x8A, 0x00, 0xBC, 0x9D, 0x6D, 0xC1, 0xB1, 0x0E, 0x80, 0x5D, 0xD2, 0xD5, 0xA0, 0x84, 0x07, 0x14, 0xB5, 0x90, 0x2C, 0xA3, 0xB2, 0x73, 0x4C, 0x54, 0x92, 0x74, 0x36, 0x51, 0x38, 0xB0, 0xBD, 0x5A, 0xFC, 0x60, 0x62, 0x96, 0x6C, 0x42, 0xF7, 0x10, 0x7C, 0x28, 0x27, 0x8C, 0x13, 0x95, 0x9C, 0xC7, 0x24, 0x46, 0x3B, 0x70, 0xCA, 0xE3, 0x85, 0xCB, 0x11, 0xD0, 0x93, 0xB8, 0xA6, 0x83, 0x20, 0xFF, 0x9F, 0x77, 0xC3, 0xCC, 0x03, 0x6F, 0x08, 0xBF, 0x40, 0xE7, 0x2B, 0xE2, 0x79, 0x0C, 0xAA, 0x82, 0x41, 0x3A, 0xEA, 0xB9, 0xE4, 0x9A, 0xA4, 0x97, 0x7E, 0xDA, 0x7A, 0x17, 0x66, 0x94, 0xA1, 0x1D, 0x3D, 0xF0, 0xDE, 0xB3, 0x0B, 0x72, 0xA7, 0x1C, 0xEF, 0xD1, 0x53, 0x3E, 0x8F, 0x33, 0x26, 0x5F, 0xEC, 0x76, 0x2A, 0x49, 0x81, 0x88, 0xEE, 0x21, 0xC4, 0x1A, 0xEB, 0xD9, 0xC5, 0x39, 0x99, 0xCD, 0xAD, 0x31, 0x8B, 0x01, 0x18, 0x23, 0xDD, 0x1F, 0x4E, 0x2D, 0xF9, 0x48, 0x4F, 0xF2, 0x65, 0x8E, 0x78, 0x5C, 0x58, 0x19, 0x8D, 0xE5, 0x98, 0x57, 0x67, 0x7F, 0x05, 0x64, 0xAF, 0x63, 0xB6, 0xFE, 0xF5, 0xB7, 0x3C, 0xA5, 0xCE, 0xE9, 0x68, 0x44, 0xE0, 0x4D, 0x43, 0x69, 0x29, 0x2E, 0xAC, 0x15, 0x59, 0xA8, 0x0A, 0x9E, 0x6E, 0x47, 0xDF, 0x34, 0x35, 0x6A, 0xCF, 0xDC, 0x22, 0xC9, 0xC0, 0x9B, 0x89, 0xD4, 0xED, 0xAB, 0x12, 0xA2, 0x0D, 0x52, 0xBB, 0x02, 0x2F, 0xA9, 0xD7, 0x61, 0x1E, 0xB4, 0x50, 0x04, 0xF6, 0xC2, 0x16, 0x25, 0x86, 0x56, 0x55, 0x09, 0xBE, 0x91]];
- this.P_00 = 1;
- this.P_01 = 0;
- this.P_02 = 0;
- this.P_03 = 1;
- this.P_04 = 1;
- this.P_10 = 0;
- this.P_11 = 0;
- this.P_12 = 1;
- this.P_13 = 1;
- this.P_14 = 0;
- this.P_20 = 1;
- this.P_21 = 1;
- this.P_22 = 0;
- this.P_23 = 0;
- this.P_24 = 0;
- this.P_30 = 0;
- this.P_31 = 1;
- this.P_32 = 1;
- this.P_33 = 0;
- this.P_34 = 1;
- this.GF256_FDBK = 0x169;
- this.GF256_FDBK_2 = this.GF256_FDBK / 2;
- this.GF256_FDBK_4 = this.GF256_FDBK / 4;
- this.RS_GF_FDBK = 0x14D;
- this.SK_STEP = 0x02020202;
- this.SK_BUMP = 0x01010101;
- this.SK_ROTL = 9;
- }
-
- return Global;
-
- })();
-
- G = new Global();
-
- exports.TwoFish = TwoFish = (function(_super) {
- __extends(TwoFish, _super);
-
- TwoFish.blockSize = 4 * 4;
-
- TwoFish.prototype.blockSize = TwoFish.blockSize;
-
- TwoFish.keySize = 256 / 8;
-
- TwoFish.prototype.keySize = TwoFish.keySize;
-
- TwoFish.ivSize = TwoFish.blockSize;
-
- TwoFish.prototype.ivSize = TwoFish.ivSize;
-
- function TwoFish(key) {
- this._key = key.clone();
- this.gMDS0 = [];
- this.gMDS1 = [];
- this.gMDS2 = [];
- this.gMDS3 = [];
- this.gSubKeys = [];
- this.gSBox = [];
- this.k64Cnt = 0;
- this._doReset();
- }
-
- TwoFish.prototype.getByte = function(x, n) {
- return (x >>> (n * 8)) & 0xFF;
- };
-
- TwoFish.prototype.switchEndianness = function(word) {
- return ((word & 0xff) << 24) | (((word >> 8) & 0xff) << 16) | (((word >> 16) & 0xff) << 8) | ((word >> 24) & 0xff);
- };
-
- TwoFish.prototype.LFSR1 = function(x) {
- return (x >> 1) ^ ((x & 0x01) !== 0 ? G.GF256_FDBK_2 : 0);
- };
-
- TwoFish.prototype.LFSR2 = function(x) {
- return (x >> 2) ^ ((x & 0x02) !== 0 ? G.GF256_FDBK_2 : 0) ^ ((x & 0x01) !== 0 ? G.GF256_FDBK_4 : 0);
- };
-
- TwoFish.prototype.Mx_X = function(x) {
- return x ^ this.LFSR2(x);
- };
-
- TwoFish.prototype.Mx_Y = function(x) {
- return x ^ this.LFSR1(x) ^ this.LFSR2(x);
- };
-
- TwoFish.prototype.RS_rem = function(x) {
- var b, g2, g3;
- b = (x >>> 24) & 0xff;
- g2 = ((b << 1) ^ ((b & 0x80) !== 0 ? G.RS_GF_FDBK : 0)) & 0xff;
- g3 = ((b >>> 1) ^ ((b & 0x01) !== 0 ? G.RS_GF_FDBK >>> 1 : 0)) ^ g2;
- return (x << 8) ^ (g3 << 24) ^ (g2 << 16) ^ (g3 << 8) ^ b;
- };
-
- TwoFish.prototype.RS_MDS_Encode = function(k0, k1) {
- var i, r, _i, _j;
- r = k1;
- for (i = _i = 0; _i < 4; i = ++_i) {
- r = this.RS_rem(r);
- }
- r ^= k0;
- for (i = _j = 0; _j < 4; i = ++_j) {
- r = this.RS_rem(r);
- }
- return r;
- };
-
- TwoFish.prototype.F32 = function(x, k32) {
- var b0, b1, b2, b3, k0, k1, k2, k3, m, res;
- b0 = this.getByte(x, 0);
- b1 = this.getByte(x, 1);
- b2 = this.getByte(x, 2);
- b3 = this.getByte(x, 3);
- k0 = k32[0];
- k1 = k32[1];
- k2 = k32[2];
- k3 = k32[3];
- m = this.k64Cnt & 3;
- res = m === 1 ? this.gMDS0[(G.P[G.P_01][b0] & 0xff) ^ this.getByte(k0, 0)] ^ this.gMDS1[(G.P[G.P_11][b1] & 0xff) ^ this.getByte(k0, 1)] ^ this.gMDS2[(G.P[G.P_21][b2] & 0xff) ^ this.getByte(k0, 2)] ^ this.gMDS3[(G.P[G.P_31][b3] & 0xff) ^ this.getByte(k0, 3)] : (m === 0 ? (b0 = (G.P[G.P_04][b0] & 0xff) ^ this.getByte(k3, 0), b1 = (G.P[G.P_14][b1] & 0xff) ^ this.getByte(k3, 1), b2 = (G.P[G.P_24][b2] & 0xff) ^ this.getByte(k3, 2), b3 = (G.P[G.P_34][b3] & 0xff) ^ this.getByte(k3, 3)) : void 0, m === 0 || m === 3 ? (b0 = (G.P[G.P_03][b0] & 0xff) ^ this.getByte(k2, 0), b1 = (G.P[G.P_13][b1] & 0xff) ^ this.getByte(k2, 1), b2 = (G.P[G.P_23][b2] & 0xff) ^ this.getByte(k2, 2), b3 = (G.P[G.P_33][b3] & 0xff) ^ this.getByte(k2, 3)) : void 0, this.gMDS0[(G.P[G.P_01][(G.P[G.P_02][b0] & 0xff) ^ this.getByte(k1, 0)] & 0xff) ^ this.getByte(k0, 0)] ^ this.gMDS1[(G.P[G.P_11][(G.P[G.P_12][b1] & 0xff) ^ this.getByte(k1, 1)] & 0xff) ^ this.getByte(k0, 1)] ^ this.gMDS2[(G.P[G.P_21][(G.P[G.P_22][b2] & 0xff) ^ this.getByte(k1, 2)] & 0xff) ^ this.getByte(k0, 2)] ^ this.gMDS3[(G.P[G.P_31][(G.P[G.P_32][b3] & 0xff) ^ this.getByte(k1, 3)] & 0xff) ^ this.getByte(k0, 3)]);
- return res;
- };
-
- TwoFish.prototype.Fe32_0 = function(x) {
- return this.gSBox[0x000 + 2 * (x & 0xff)] ^ this.gSBox[0x001 + 2 * ((x >>> 8) & 0xff)] ^ this.gSBox[0x200 + 2 * ((x >>> 16) & 0xff)] ^ this.gSBox[0x201 + 2 * ((x >>> 24) & 0xff)];
- };
-
- TwoFish.prototype.Fe32_3 = function(x) {
- return this.gSBox[0x000 + 2 * ((x >>> 24) & 0xff)] ^ this.gSBox[0x001 + 2 * (x & 0xff)] ^ this.gSBox[0x200 + 2 * ((x >>> 8) & 0xff)] ^ this.gSBox[0x201 + 2 * ((x >>> 16) & 0xff)];
- };
-
- TwoFish.prototype._doReset = function() {
- var A, B, b0, b1, b2, b3, i, j, k0, k1, k2, k3, k32e, k32o, m, m1, mX, mY, p, q, sBoxKeys, _i, _j, _k, _l, _ref, _ref1, _results;
- k32e = [];
- k32o = [];
- sBoxKeys = [];
- m1 = [];
- mX = [];
- mY = [];
- this.k64Cnt = this._key.words.length / 2;
- if (this.k64Cnt < 1) {
- throw "Key size less than 64 bits";
- }
- if (this.k64Cnt > 4) {
- throw "Key size larger than 256 bits";
- }
- for (i = _i = 0; _i < 256; i = ++_i) {
- j = G.P[0][i] & 0xff;
- m1[0] = j;
- mX[0] = this.Mx_X(j) & 0xff;
- mY[0] = this.Mx_Y(j) & 0xff;
- j = G.P[1][i] & 0xff;
- m1[1] = j;
- mX[1] = this.Mx_X(j) & 0xff;
- mY[1] = this.Mx_Y(j) & 0xff;
- this.gMDS0[i] = m1[G.P_00] | mX[G.P_00] << 8 | mY[G.P_00] << 16 | mY[G.P_00] << 24;
- this.gMDS1[i] = mY[G.P_10] | mY[G.P_10] << 8 | mX[G.P_10] << 16 | m1[G.P_10] << 24;
- this.gMDS2[i] = mX[G.P_20] | mY[G.P_20] << 8 | m1[G.P_20] << 16 | mY[G.P_20] << 24;
- this.gMDS3[i] = mX[G.P_30] | m1[G.P_30] << 8 | mY[G.P_30] << 16 | mX[G.P_30] << 24;
- }
- for (i = _j = 0, _ref = this.k64Cnt; 0 <= _ref ? _j < _ref : _j > _ref; i = 0 <= _ref ? ++_j : --_j) {
- p = i * 2;
- k32e[i] = this.switchEndianness(this._key.words[p]);
- k32o[i] = this.switchEndianness(this._key.words[p + 1]);
- sBoxKeys[this.k64Cnt - 1 - i] = this.RS_MDS_Encode(k32e[i], k32o[i]);
- }
- for (i = _k = 0, _ref1 = 40 / 2; 0 <= _ref1 ? _k < _ref1 : _k > _ref1; i = 0 <= _ref1 ? ++_k : --_k) {
- q = i * G.SK_STEP;
- A = this.F32(q, k32e);
- B = this.F32(q + G.SK_BUMP, k32o);
- B = B << 8 | B >>> 24;
- A += B;
- this.gSubKeys[i * 2] = A;
- A += B;
- this.gSubKeys[i * 2 + 1] = A << G.SK_ROTL | A >>> (32 - G.SK_ROTL);
- }
- k0 = sBoxKeys[0];
- k1 = sBoxKeys[1];
- k2 = sBoxKeys[2];
- k3 = sBoxKeys[3];
- this.gSBox = [];
- _results = [];
- for (i = _l = 0; _l < 256; i = ++_l) {
- b0 = b1 = b2 = b3 = i;
- m = this.k64Cnt & 3;
- if (m === 1) {
- this.gSBox[i * 2] = this.gMDS0[(G.P[G.P_01][b0] & 0xff) ^ this.getByte(k0, 0)];
- this.gSBox[i * 2 + 1] = this.gMDS1[(G.P[G.P_11][b1] & 0xff) ^ this.getByte(k0, 1)];
- this.gSBox[i * 2 + 0x200] = this.gMDS2[(G.P[G.P_21][b2] & 0xff) ^ this.getByte(k0, 2)];
- _results.push(this.gSBox[i * 2 + 0x201] = this.gMDS3[(G.P[G.P_31][b3] & 0xff) ^ this.getByte(k0, 3)]);
- } else {
- if (m === 0) {
- b0 = (G.P[G.P_04][b0] & 0xff) ^ this.getByte(k3, 0);
- b1 = (G.P[G.P_14][b1] & 0xff) ^ this.getByte(k3, 1);
- b2 = (G.P[G.P_24][b2] & 0xff) ^ this.getByte(k3, 2);
- b3 = (G.P[G.P_34][b3] & 0xff) ^ this.getByte(k3, 3);
- }
- if (m === 0 || m === 3) {
- b0 = (G.P[G.P_03][b0] & 0xff) ^ this.getByte(k2, 0);
- b1 = (G.P[G.P_13][b1] & 0xff) ^ this.getByte(k2, 1);
- b2 = (G.P[G.P_23][b2] & 0xff) ^ this.getByte(k2, 2);
- b3 = (G.P[G.P_33][b3] & 0xff) ^ this.getByte(k2, 3);
- }
- this.gSBox[i * 2] = this.gMDS0[(G.P[G.P_01][(G.P[G.P_02][b0] & 0xff) ^ this.getByte(k1, 0)] & 0xff) ^ this.getByte(k0, 0)];
- this.gSBox[i * 2 + 1] = this.gMDS1[(G.P[G.P_11][(G.P[G.P_12][b1] & 0xff) ^ this.getByte(k1, 1)] & 0xff) ^ this.getByte(k0, 1)];
- this.gSBox[i * 2 + 0x200] = this.gMDS2[(G.P[G.P_21][(G.P[G.P_22][b2] & 0xff) ^ this.getByte(k1, 2)] & 0xff) ^ this.getByte(k0, 2)];
- _results.push(this.gSBox[i * 2 + 0x201] = this.gMDS3[(G.P[G.P_31][(G.P[G.P_32][b3] & 0xff) ^ this.getByte(k1, 3)] & 0xff) ^ this.getByte(k0, 3)]);
- }
- }
- return _results;
- };
-
- TwoFish.prototype.scrub = function() {
- scrub_vec(this.gSubKeys);
- scrub_vec(this.gSBox);
- return this._key.scrub();
- };
-
- TwoFish.prototype.decryptBlock = function(M, offset) {
- var k, r, t0, t1, x0, x1, x2, x3, _i;
- if (offset == null) {
- offset = 0;
- }
- x2 = this.switchEndianness(M[offset]) ^ this.gSubKeys[4];
- x3 = this.switchEndianness(M[offset + 1]) ^ this.gSubKeys[5];
- x0 = this.switchEndianness(M[offset + 2]) ^ this.gSubKeys[6];
- x1 = this.switchEndianness(M[offset + 3]) ^ this.gSubKeys[7];
- k = 8 + 2 * 16 - 1;
- for (r = _i = 0; _i < 16; r = _i += 2) {
- t0 = this.Fe32_0(x2);
- t1 = this.Fe32_3(x3);
- x1 ^= t0 + 2 * t1 + this.gSubKeys[k--];
- x0 = (x0 << 1 | x0 >>> 31) ^ (t0 + t1 + this.gSubKeys[k--]);
- x1 = x1 >>> 1 | x1 << 31;
- t0 = this.Fe32_0(x0);
- t1 = this.Fe32_3(x1);
- x3 ^= t0 + 2 * t1 + this.gSubKeys[k--];
- x2 = (x2 << 1 | x2 >>> 31) ^ (t0 + t1 + this.gSubKeys[k--]);
- x3 = x3 >>> 1 | x3 << 31;
- }
- M[offset] = this.switchEndianness(x0 ^ this.gSubKeys[0]);
- M[offset + 1] = this.switchEndianness(x1 ^ this.gSubKeys[1]);
- M[offset + 2] = this.switchEndianness(x2 ^ this.gSubKeys[2]);
- return M[offset + 3] = this.switchEndianness(x3 ^ this.gSubKeys[3]);
- };
-
- TwoFish.prototype.encryptBlock = function(M, offset) {
- var k, r, t0, t1, x0, x1, x2, x3, _i;
- if (offset == null) {
- offset = 0;
- }
- x0 = this.switchEndianness(M[offset]) ^ this.gSubKeys[0];
- x1 = this.switchEndianness(M[offset + 1]) ^ this.gSubKeys[1];
- x2 = this.switchEndianness(M[offset + 2]) ^ this.gSubKeys[2];
- x3 = this.switchEndianness(M[offset + 3]) ^ this.gSubKeys[3];
- k = 8;
- for (r = _i = 0; _i < 16; r = _i += 2) {
- t0 = this.Fe32_0(x0);
- t1 = this.Fe32_3(x1);
- x2 ^= t0 + t1 + this.gSubKeys[k++];
- x2 = x2 >>> 1 | x2 << 31;
- x3 = (x3 << 1 | x3 >>> 31) ^ (t0 + 2 * t1 + this.gSubKeys[k++]);
- t0 = this.Fe32_0(x2);
- t1 = this.Fe32_3(x3);
- x0 ^= t0 + t1 + this.gSubKeys[k++];
- x0 = x0 >>> 1 | x0 << 31;
- x1 = (x1 << 1 | x1 >>> 31) ^ (t0 + 2 * t1 + this.gSubKeys[k++]);
- }
- M[offset] = this.switchEndianness(x2 ^ this.gSubKeys[4]);
- M[offset + 1] = this.switchEndianness(x3 ^ this.gSubKeys[5]);
- M[offset + 2] = this.switchEndianness(x0 ^ this.gSubKeys[6]);
- return M[offset + 3] = this.switchEndianness(x1 ^ this.gSubKeys[7]);
- };
-
- return TwoFish;
-
- })(BlockCipher);
-
-}).call(this);
-
-},{"./algbase":2,"./util":23}],23:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var default_delay, iced, uint_max, __iced_k, __iced_k_noop;
-
- iced = require('iced-runtime');
- __iced_k = __iced_k_noop = function() {};
-
- uint_max = Math.pow(2, 32);
-
- exports.fixup_uint32 = function(x) {
- var ret, x_pos;
- ret = x > uint_max || x < 0 ? (x_pos = Math.abs(x) % uint_max, x < 0 ? uint_max - x_pos : x_pos) : x;
- return ret;
- };
-
- exports.scrub_buffer = function(b) {
- var i, n_full_words;
- n_full_words = b.length >> 2;
- i = 0;
- while (i < n_full_words) {
- b.writeUInt32LE(0, i);
- i += 4;
- }
- while (i < b.length) {
- b.writeUInt8(0, i);
- i++;
- }
- return false;
- };
-
- exports.scrub_vec = function(v) {
- var i, _i, _ref;
- for (i = _i = 0, _ref = v.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
- v[i] = 0;
- }
- return false;
- };
-
- exports.default_delay = default_delay = function(i, n, cb) {
- var ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- (function(_this) {
- return (function(__iced_k) {
- if (typeof setImmediate !== "undefined" && setImmediate !== null) {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/util.iced"
- });
- setImmediate(__iced_deferrals.defer({
- lineno: 37
- }));
- __iced_deferrals._fulfill();
- })(__iced_k);
- } else {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/util.iced"
- });
- setTimeout(__iced_deferrals.defer({
- lineno: 39
- }), 1);
- __iced_deferrals._fulfill();
- })(__iced_k);
- }
- });
- })(this)((function(_this) {
- return function() {
- return cb();
- };
- })(this));
- };
-
- exports.buffer_cmp_ule = function(b1, b2) {
- var I, J, i, j, x, y;
- i = j = 0;
- I = b1.length;
- J = b2.length;
- while (i < I && b1.readUInt8(i) === 0) {
- i++;
- }
- while (j < J && b2.readUInt8(j) === 0) {
- j++;
- }
- if ((I - i) > (J - j)) {
- return 1;
- } else if ((J - j) > (I - i)) {
- return -1;
- }
- while (i < I) {
- if ((x = b1.readUInt8(i)) < (y = b2.readUInt8(j))) {
- return -1;
- } else if (y < x) {
- return 1;
- }
- i++;
- j++;
- }
- return 0;
- };
-
- exports.bulk = function(n_input_bytes, _arg, _arg1) {
- var call_ph, cb, default_n, delay, finalize, i, left, n, n_words, progress_hook, ret, total_words, update, what, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- update = _arg.update, finalize = _arg.finalize, default_n = _arg.default_n;
- delay = _arg1.delay, n = _arg1.n, cb = _arg1.cb, what = _arg1.what, progress_hook = _arg1.progress_hook;
- i = 0;
- left = 0;
- total_words = Math.ceil(n_input_bytes / 4);
- delay || (delay = default_delay);
- n || (n = default_n);
- call_ph = function(i) {
- return typeof progress_hook === "function" ? progress_hook({
- what: what,
- i: i,
- total: total_words
- }) : void 0;
- };
- call_ph(0);
- (function(_this) {
- return (function(__iced_k) {
- var _results, _while;
- _results = [];
- _while = function(__iced_k) {
- var _break, _continue, _next;
- _break = function() {
- return __iced_k(_results);
- };
- _continue = function() {
- return iced.trampoline(function() {
- return _while(__iced_k);
- });
- };
- _next = function(__iced_next_arg) {
- _results.push(__iced_next_arg);
- return _continue();
- };
- if (!((left = total_words - i) > 0)) {
- return _break();
- } else {
- n_words = Math.min(n, left);
- update(i, i + n_words);
- call_ph(i);
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/keybase/triplesec/src/util.iced",
- funcname: "bulk"
- });
- delay(i, total_words, __iced_deferrals.defer({
- lineno: 97
- }));
- __iced_deferrals._fulfill();
- })(function() {
- return _next(i += n_words);
- });
- }
- };
- _while(__iced_k);
- });
- })(this)((function(_this) {
- return function() {
- call_ph(total_words);
- ret = finalize();
- return cb(ret);
- };
- })(this));
- };
-
-}).call(this);
-
-},{"iced-runtime":38}],24:[function(require,module,exports){
-var Buffer=require("__browserify_Buffer");// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- var WordArray, X64Word, X64WordArray, buffer_to_ui8a, endian_reverse, ui8a_to_buffer, util;
-
- util = require('./util');
-
- buffer_to_ui8a = function(b) {
- var i, ret, _i, _ref;
- ret = new Uint8Array(b.length);
- for (i = _i = 0, _ref = b.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
- ret[i] = b.readUInt8(i);
- }
- return ret;
- };
-
- ui8a_to_buffer = function(v) {
- var i, ret, _i, _ref;
- ret = new Buffer(v.length);
- for (i = _i = 0, _ref = v.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
- ret.writeUInt8(v[i], i);
- }
- return ret;
- };
-
- endian_reverse = function(x) {
- return ((x >>> 24) & 0xff) | (((x >>> 16) & 0xff) << 8) | (((x >>> 8) & 0xff) << 16) | ((x & 0xff) << 24);
- };
-
- exports.WordArray = WordArray = (function() {
- function WordArray(words, sigBytes) {
- this.words = words || [];
- this.sigBytes = sigBytes != null ? sigBytes : this.words.length * 4;
- }
-
- WordArray.prototype.concat = function(wordArray) {
- var i, thatByte, thatSigBytes, thatWords, _i;
- thatWords = wordArray.words;
- thatSigBytes = wordArray.sigBytes;
- this.clamp();
- if (this.sigBytes % 4) {
- for (i = _i = 0; 0 <= thatSigBytes ? _i < thatSigBytes : _i > thatSigBytes; i = 0 <= thatSigBytes ? ++_i : --_i) {
- thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
- this.words[(this.sigBytes + i) >>> 2] |= thatByte << (24 - ((this.sigBytes + i) % 4) * 8);
- }
- } else {
- this.words = this.words.concat(thatWords);
- }
- this.sigBytes += thatSigBytes;
- return this;
- };
-
- WordArray.prototype.clamp = function() {
- this.words[this.sigBytes >>> 2] &= 0xffffffff << (32 - (this.sigBytes % 4) * 8);
- this.words.length = Math.ceil(this.sigBytes / 4);
- return this;
- };
-
- WordArray.prototype.clone = function() {
- return new WordArray(this.words.slice(0), this.sigBytes);
- };
-
- WordArray.prototype.to_buffer = function() {
- var ch, out, p, w, _i, _len, _ref;
- out = new Buffer(this.sigBytes);
- p = 0;
- _ref = this.words;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- w = _ref[_i];
- if (!((this.sigBytes - p) >= 4)) {
- continue;
- }
- w = util.fixup_uint32(w);
- out.writeUInt32BE(w, p);
- p += 4;
- }
- while (p < this.sigBytes) {
- ch = (this.words[p >>> 2] >>> (24 - (p % 4) * 8)) & 0xff;
- out.writeUInt8(ch, p);
- p++;
- }
- return out;
- };
-
- WordArray.prototype.endian_reverse = function() {
- var i, w, _i, _len, _ref;
- _ref = this.words;
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- w = _ref[i];
- this.words[i] = endian_reverse(w);
- }
- return this;
- };
-
- WordArray.prototype.split = function(n) {
- var i, out, sz;
- if (!(((this.sigBytes % 4) === 0) && ((this.words.length % n) === 0))) {
- throw new Error("bad key alignment");
- }
- sz = this.words.length / n;
- out = (function() {
- var _i, _ref, _results;
- _results = [];
- for (i = _i = 0, _ref = this.words.length; sz > 0 ? _i < _ref : _i > _ref; i = _i += sz) {
- _results.push(new WordArray(this.words.slice(i, i + sz)));
- }
- return _results;
- }).call(this);
- return out;
- };
-
- WordArray.prototype.to_utf8 = function() {
- return this.to_buffer().toString('utf8');
- };
-
- WordArray.prototype.to_hex = function() {
- return this.to_buffer().toString('hex');
- };
-
- WordArray.prototype.to_ui8a = function() {
- return buffer_to_ui8a(this.to_buffer());
- };
-
- WordArray.alloc = function(b) {
- if (Buffer.isBuffer(b)) {
- return WordArray.from_buffer(b);
- } else if ((typeof b === 'object') && (b instanceof WordArray)) {
- return b;
- } else if (typeof b === 'string') {
- return WordArray.from_hex(b);
- } else {
- return null;
- }
- };
-
- WordArray.from_buffer = function(b) {
- var ch, last, p, words;
- words = [];
- p = 0;
- while ((b.length - p) >= 4) {
- words.push(b.readUInt32BE(p));
- p += 4;
- }
- if (p < b.length) {
- last = 0;
- while (p < b.length) {
- ch = b.readUInt8(p);
- last |= ch << (24 - (p % 4) * 8);
- p++;
- }
- last = util.fixup_uint32(last);
- words.push(last);
- }
- return new WordArray(words, b.length);
- };
-
- WordArray.from_buffer_le = function(b) {
- var ch, last, p, words;
- words = [];
- p = 0;
- while ((b.length - p) >= 4) {
- words.push(b.readUInt32LE(p));
- p += 4;
- }
- if (p < b.length) {
- last = 0;
- while (p < b.length) {
- ch = b.readUInt8(p);
- last |= ch << ((p % 4) * 8);
- p++;
- }
- last = util.fixup_uint32(last);
- words.push(last);
- }
- return new WordArray(words, b.length);
- };
-
- WordArray.from_utf8 = function(s) {
- return WordArray.from_buffer(new Buffer(s, 'utf8'));
- };
-
- WordArray.from_utf8_le = function(s) {
- return WordArray.from_buffer_le(new Buffer(s, 'utf8'));
- };
-
- WordArray.from_hex = function(s) {
- return WordArray.from_buffer(new Buffer(s, 'hex'));
- };
-
- WordArray.from_hex_le = function(s) {
- return WordArray.from_buffer_le(new Buffer(s, 'hex'));
- };
-
- WordArray.from_ui8a = function(v) {
- return WordArray.from_buffer(ui8a_to_buffer(v));
- };
-
- WordArray.from_i32a = function(v) {
- return new WordArray(Array.apply([], v));
- };
-
- WordArray.prototype.equal = function(wa) {
- var i, ret, w, _i, _len, _ref;
- ret = true;
- if (wa.sigBytes !== this.sigBytes) {
- ret = false;
- } else {
- _ref = this.words;
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- w = _ref[i];
- if (util.fixup_uint32(w) !== util.fixup_uint32(wa.words[i])) {
- ret = false;
- }
- }
- }
- return ret;
- };
-
- WordArray.prototype.xor = function(wa2, _arg) {
- var dst_offset, i, n_words, src_offset, tmp, _i;
- dst_offset = _arg.dst_offset, src_offset = _arg.src_offset, n_words = _arg.n_words;
- if (!dst_offset) {
- dst_offset = 0;
- }
- if (!src_offset) {
- src_offset = 0;
- }
- if (n_words == null) {
- n_words = wa2.words.length - src_offset;
- }
- if (this.words.length < dst_offset + n_words) {
- throw new Error("dest range exceeded (" + this.words.length + " < " + (dst_offset + n_words) + ")");
- }
- if (wa2.words.length < src_offset + n_words) {
- throw new Error("source range exceeded");
- }
- for (i = _i = 0; 0 <= n_words ? _i < n_words : _i > n_words; i = 0 <= n_words ? ++_i : --_i) {
- tmp = this.words[dst_offset + i] ^ wa2.words[src_offset + i];
- this.words[dst_offset + i] = util.fixup_uint32(tmp);
- }
- return this;
- };
-
- WordArray.prototype.truncate = function(n_bytes) {
- var n_words;
- if (!(n_bytes <= this.sigBytes)) {
- throw new Error("Cannot truncate: " + n_bytes + " > " + this.sigBytes);
- }
- n_words = Math.ceil(n_bytes / 4);
- return new WordArray(this.words.slice(0, n_words), n_bytes);
- };
-
- WordArray.prototype.unshift = function(n_words) {
- var ret;
- if (this.words.length >= n_words) {
- ret = this.words.splice(0, n_words);
- this.sigBytes -= n_words * 4;
- return new WordArray(ret);
- } else {
- return null;
- }
- };
-
- WordArray.prototype.is_scrubbed = function() {
- var w, _i, _len, _ref;
- _ref = this.words;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- w = _ref[_i];
- if (w !== 0) {
- return false;
- }
- }
- return true;
- };
-
- WordArray.prototype.scrub = function() {
- return util.scrub_vec(this.words);
- };
-
- WordArray.prototype.cmp_ule = function(wa2) {
- return util.buffer_cmp_ule(this.to_buffer(), wa2.to_buffer());
- };
-
- WordArray.prototype.slice = function(low, hi) {
- var n, sb;
- n = this.words.length;
- if (!((low < hi) && (hi <= n))) {
- throw new Error("Bad WordArray slice [" + low + "," + hi + ")] when only " + n + " avail");
- }
- sb = (hi - low) * 4;
- if (hi === n) {
- sb -= n * 4 - this.sigBytes;
- }
- return new WordArray(this.words.slice(low, hi), sb);
- };
-
- return WordArray;
-
- })();
-
- exports.X64Word = X64Word = (function() {
- function X64Word(high, low) {
- this.high = high;
- this.low = low;
- }
-
- X64Word.prototype.clone = function() {
- return new X64Word(this.high, this.low);
- };
-
- return X64Word;
-
- })();
-
- exports.X64WordArray = X64WordArray = (function() {
- function X64WordArray(words, sigBytes) {
- this.sigBytes = sigBytes;
- this.words = words || [];
- if (!this.sigBytes) {
- this.sigBytes = this.words.length * 8;
- }
- }
-
- X64WordArray.prototype.toX32 = function() {
- var v, w, _i, _len, _ref;
- v = [];
- _ref = this.words;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- w = _ref[_i];
- v.push(w.high);
- v.push(w.low);
- }
- return new WordArray(v, this.sigBytes);
- };
-
- X64WordArray.prototype.clone = function() {
- var w;
- return new X64WordArray((function() {
- var _i, _len, _ref, _results;
- _ref = this.words;
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- w = _ref[_i];
- _results.push(w.clone());
- }
- return _results;
- }).call(this), this.sigBytes);
- };
-
- return X64WordArray;
-
- })();
-
- exports.buffer_to_ui8a = buffer_to_ui8a;
-
- exports.ui8a_to_buffer = ui8a_to_buffer;
-
- exports.endian_reverse = endian_reverse;
-
-}).call(this);
-
-},{"./util":23,"__browserify_Buffer":26}],25:[function(require,module,exports){
-if (typeof Object.create === 'function') {
- // implementation from standard node.js 'util' module
- module.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
- };
-} else {
- // old school shim for old browsers
- module.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor
- var TempCtor = function () {}
- TempCtor.prototype = superCtor.prototype
- ctor.prototype = new TempCtor()
- ctor.prototype.constructor = ctor
- }
-}
-
-},{}],26:[function(require,module,exports){
-require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o remaining) {
- length = remaining
- }
- }
-
- // must be an even number of digits
- var strLen = string.length
- if (strLen % 2 !== 0) {
- throw new Error('Invalid hex string')
- }
- if (length > strLen / 2) {
- length = strLen / 2
- }
- for (var i = 0; i < length; i++) {
- var byte = parseInt(string.substr(i * 2, 2), 16)
- if (isNaN(byte)) throw new Error('Invalid hex string')
- buf[offset + i] = byte
- }
- Buffer._charsWritten = i * 2
- return i
-}
-
-function _utf8Write (buf, string, offset, length) {
- var bytes, pos
- return Buffer._charsWritten = blitBuffer(utf8ToBytes(string), buf, offset, length)
-}
-
-function _asciiWrite (buf, string, offset, length) {
- var bytes, pos
- return Buffer._charsWritten = blitBuffer(asciiToBytes(string), buf, offset, length)
-}
-
-function _binaryWrite (buf, string, offset, length) {
- return _asciiWrite(buf, string, offset, length)
-}
-
-function _base64Write (buf, string, offset, length) {
- var bytes, pos
- return Buffer._charsWritten = blitBuffer(base64ToBytes(string), buf, offset, length)
-}
-
-function BufferWrite (string, offset, length, encoding) {
- // Support both (string, offset, length, encoding)
- // and the legacy (string, encoding, offset, length)
- if (isFinite(offset)) {
- if (!isFinite(length)) {
- encoding = length
- length = undefined
- }
- } else { // legacy
- var swap = encoding
- encoding = offset
- offset = length
- length = swap
- }
-
- offset = Number(offset) || 0
- var remaining = this.length - offset
- if (!length) {
- length = remaining
- } else {
- length = Number(length)
- if (length > remaining) {
- length = remaining
- }
- }
- encoding = String(encoding || 'utf8').toLowerCase()
-
- switch (encoding) {
- case 'hex':
- return _hexWrite(this, string, offset, length)
-
- case 'utf8':
- case 'utf-8':
- return _utf8Write(this, string, offset, length)
-
- case 'ascii':
- return _asciiWrite(this, string, offset, length)
-
- case 'binary':
- return _binaryWrite(this, string, offset, length)
-
- case 'base64':
- return _base64Write(this, string, offset, length)
-
- default:
- throw new Error('Unknown encoding')
- }
-}
-
-function BufferToString (encoding, start, end) {
- var self = (this instanceof ProxyBuffer)
- ? this._proxy
- : this
-
- encoding = String(encoding || 'utf8').toLowerCase()
- start = Number(start) || 0
- end = (end !== undefined)
- ? Number(end)
- : end = self.length
-
- // Fastpath empty strings
- if (end === start)
- return ''
-
- switch (encoding) {
- case 'hex':
- return _hexSlice(self, start, end)
-
- case 'utf8':
- case 'utf-8':
- return _utf8Slice(self, start, end)
-
- case 'ascii':
- return _asciiSlice(self, start, end)
-
- case 'binary':
- return _binarySlice(self, start, end)
-
- case 'base64':
- return _base64Slice(self, start, end)
-
- default:
- throw new Error('Unknown encoding')
- }
-}
-
-function BufferToJSON () {
- return {
- type: 'Buffer',
- data: Array.prototype.slice.call(this, 0)
- }
-}
-
-// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
-function BufferCopy (target, target_start, start, end) {
- var source = this
-
- if (!start) start = 0
- if (!end && end !== 0) end = this.length
- if (!target_start) target_start = 0
-
- // Copy 0 bytes; we're done
- if (end === start) return
- if (target.length === 0 || source.length === 0) return
-
- // Fatal error conditions
- if (end < start)
- throw new Error('sourceEnd < sourceStart')
- if (target_start < 0 || target_start >= target.length)
- throw new Error('targetStart out of bounds')
- if (start < 0 || start >= source.length)
- throw new Error('sourceStart out of bounds')
- if (end < 0 || end > source.length)
- throw new Error('sourceEnd out of bounds')
-
- // Are we oob?
- if (end > this.length)
- end = this.length
- if (target.length - target_start < end - start)
- end = target.length - target_start + start
-
- // copy!
- for (var i = 0; i < end - start; i++)
- target[i + target_start] = this[i + start]
-}
-
-function _base64Slice (buf, start, end) {
- var bytes = buf.slice(start, end)
- return require('base64-js').fromByteArray(bytes)
-}
-
-function _utf8Slice (buf, start, end) {
- var bytes = buf.slice(start, end)
- var res = ''
- var tmp = ''
- var i = 0
- while (i < bytes.length) {
- if (bytes[i] <= 0x7F) {
- res += decodeUtf8Char(tmp) + String.fromCharCode(bytes[i])
- tmp = ''
- } else {
- tmp += '%' + bytes[i].toString(16)
- }
-
- i++
- }
-
- return res + decodeUtf8Char(tmp)
-}
-
-function _asciiSlice (buf, start, end) {
- var bytes = buf.slice(start, end)
- var ret = ''
- for (var i = 0; i < bytes.length; i++)
- ret += String.fromCharCode(bytes[i])
- return ret
-}
-
-function _binarySlice (buf, start, end) {
- return _asciiSlice(buf, start, end)
-}
-
-function _hexSlice (buf, start, end) {
- var len = buf.length
-
- if (!start || start < 0) start = 0
- if (!end || end < 0 || end > len) end = len
-
- var out = ''
- for (var i = start; i < end; i++) {
- out += toHex(buf[i])
- }
- return out
-}
-
-// TODO: add test that modifying the new buffer slice will modify memory in the
-// original buffer! Use code from:
-// http://nodejs.org/api/buffer.html#buffer_buf_slice_start_end
-function BufferSlice (start, end) {
- var len = this.length
- start = clamp(start, len, 0)
- end = clamp(end, len, len)
- return augment(this.subarray(start, end)) // Uint8Array built-in method
-}
-
-function BufferReadUInt8 (offset, noAssert) {
- var buf = this
- if (!noAssert) {
- assert(offset !== undefined && offset !== null, 'missing offset')
- assert(offset < buf.length, 'Trying to read beyond buffer length')
- }
-
- if (offset >= buf.length)
- return
-
- return buf[offset]
-}
-
-function _readUInt16 (buf, offset, littleEndian, noAssert) {
- if (!noAssert) {
- assert(typeof (littleEndian) === 'boolean',
- 'missing or invalid endian')
- assert(offset !== undefined && offset !== null, 'missing offset')
- assert(offset + 1 < buf.length, 'Trying to read beyond buffer length')
- }
-
- var len = buf.length
- if (offset >= len) {
- return
- } else if (offset + 1 === len) {
- var dv = new xDataView(new xArrayBuffer(2))
- dv.setUint8(0, buf[len - 1])
- return dv.getUint16(0, littleEndian)
- } else {
- return buf._dataview.getUint16(offset, littleEndian)
- }
-}
-
-function BufferReadUInt16LE (offset, noAssert) {
- return _readUInt16(this, offset, true, noAssert)
-}
-
-function BufferReadUInt16BE (offset, noAssert) {
- return _readUInt16(this, offset, false, noAssert)
-}
-
-function _readUInt32 (buf, offset, littleEndian, noAssert) {
- if (!noAssert) {
- assert(typeof (littleEndian) === 'boolean',
- 'missing or invalid endian')
- assert(offset !== undefined && offset !== null, 'missing offset')
- assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
- }
-
- var len = buf.length
- if (offset >= len) {
- return
- } else if (offset + 3 >= len) {
- var dv = new xDataView(new xArrayBuffer(4))
- for (var i = 0; i + offset < len; i++) {
- dv.setUint8(i, buf[i + offset])
- }
- return dv.getUint32(0, littleEndian)
- } else {
- return buf._dataview.getUint32(offset, littleEndian)
- }
-}
-
-function BufferReadUInt32LE (offset, noAssert) {
- return _readUInt32(this, offset, true, noAssert)
-}
-
-function BufferReadUInt32BE (offset, noAssert) {
- return _readUInt32(this, offset, false, noAssert)
-}
-
-function BufferReadInt8 (offset, noAssert) {
- var buf = this
- if (!noAssert) {
- assert(offset !== undefined && offset !== null,
- 'missing offset')
- assert(offset < buf.length, 'Trying to read beyond buffer length')
- }
-
- if (offset >= buf.length)
- return
-
- return buf._dataview.getInt8(offset)
-}
-
-function _readInt16 (buf, offset, littleEndian, noAssert) {
- if (!noAssert) {
- assert(typeof (littleEndian) === 'boolean',
- 'missing or invalid endian')
- assert(offset !== undefined && offset !== null,
- 'missing offset')
- assert(offset + 1 < buf.length, 'Trying to read beyond buffer length')
- }
-
- var len = buf.length
- if (offset >= len) {
- return
- } else if (offset + 1 === len) {
- var dv = new xDataView(new xArrayBuffer(2))
- dv.setUint8(0, buf[len - 1])
- return dv.getInt16(0, littleEndian)
- } else {
- return buf._dataview.getInt16(offset, littleEndian)
- }
-}
-
-function BufferReadInt16LE (offset, noAssert) {
- return _readInt16(this, offset, true, noAssert)
-}
-
-function BufferReadInt16BE (offset, noAssert) {
- return _readInt16(this, offset, false, noAssert)
-}
-
-function _readInt32 (buf, offset, littleEndian, noAssert) {
- if (!noAssert) {
- assert(typeof (littleEndian) === 'boolean',
- 'missing or invalid endian')
- assert(offset !== undefined && offset !== null, 'missing offset')
- assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
- }
-
- var len = buf.length
- if (offset >= len) {
- return
- } else if (offset + 3 >= len) {
- var dv = new xDataView(new xArrayBuffer(4))
- for (var i = 0; i + offset < len; i++) {
- dv.setUint8(i, buf[i + offset])
- }
- return dv.getInt32(0, littleEndian)
- } else {
- return buf._dataview.getInt32(offset, littleEndian)
- }
-}
-
-function BufferReadInt32LE (offset, noAssert) {
- return _readInt32(this, offset, true, noAssert)
-}
-
-function BufferReadInt32BE (offset, noAssert) {
- return _readInt32(this, offset, false, noAssert)
-}
-
-function _readFloat (buf, offset, littleEndian, noAssert) {
- if (!noAssert) {
- assert(typeof (littleEndian) === 'boolean',
- 'missing or invalid endian')
- assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
- }
-
- return buf._dataview.getFloat32(offset, littleEndian)
-}
-
-function BufferReadFloatLE (offset, noAssert) {
- return _readFloat(this, offset, true, noAssert)
-}
-
-function BufferReadFloatBE (offset, noAssert) {
- return _readFloat(this, offset, false, noAssert)
-}
-
-function _readDouble (buf, offset, littleEndian, noAssert) {
- if (!noAssert) {
- assert(typeof (littleEndian) === 'boolean',
- 'missing or invalid endian')
- assert(offset + 7 < buf.length, 'Trying to read beyond buffer length')
- }
-
- return buf._dataview.getFloat64(offset, littleEndian)
-}
-
-function BufferReadDoubleLE (offset, noAssert) {
- return _readDouble(this, offset, true, noAssert)
-}
-
-function BufferReadDoubleBE (offset, noAssert) {
- return _readDouble(this, offset, false, noAssert)
-}
-
-function BufferWriteUInt8 (value, offset, noAssert) {
- var buf = this
- if (!noAssert) {
- assert(value !== undefined && value !== null, 'missing value')
- assert(offset !== undefined && offset !== null, 'missing offset')
- assert(offset < buf.length, 'trying to write beyond buffer length')
- verifuint(value, 0xff)
- }
-
- if (offset >= buf.length) return
-
- buf[offset] = value
-}
-
-function _writeUInt16 (buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- assert(value !== undefined && value !== null, 'missing value')
- assert(typeof (littleEndian) === 'boolean',
- 'missing or invalid endian')
- assert(offset !== undefined && offset !== null, 'missing offset')
- assert(offset + 1 < buf.length, 'trying to write beyond buffer length')
- verifuint(value, 0xffff)
- }
-
- var len = buf.length
- if (offset >= len) {
- return
- } else if (offset + 1 === len) {
- var dv = new xDataView(new xArrayBuffer(2))
- dv.setUint16(0, value, littleEndian)
- buf[offset] = dv.getUint8(0)
- } else {
- buf._dataview.setUint16(offset, value, littleEndian)
- }
-}
-
-function BufferWriteUInt16LE (value, offset, noAssert) {
- _writeUInt16(this, value, offset, true, noAssert)
-}
-
-function BufferWriteUInt16BE (value, offset, noAssert) {
- _writeUInt16(this, value, offset, false, noAssert)
-}
-
-function _writeUInt32 (buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- assert(value !== undefined && value !== null, 'missing value')
- assert(typeof (littleEndian) === 'boolean',
- 'missing or invalid endian')
- assert(offset !== undefined && offset !== null, 'missing offset')
- assert(offset + 3 < buf.length, 'trying to write beyond buffer length')
- verifuint(value, 0xffffffff)
- }
-
- var len = buf.length
- if (offset >= len) {
- return
- } else if (offset + 3 >= len) {
- var dv = new xDataView(new xArrayBuffer(4))
- dv.setUint32(0, value, littleEndian)
- for (var i = 0; i + offset < len; i++) {
- buf[i + offset] = dv.getUint8(i)
- }
- } else {
- buf._dataview.setUint32(offset, value, littleEndian)
- }
-}
-
-function BufferWriteUInt32LE (value, offset, noAssert) {
- _writeUInt32(this, value, offset, true, noAssert)
-}
-
-function BufferWriteUInt32BE (value, offset, noAssert) {
- _writeUInt32(this, value, offset, false, noAssert)
-}
-
-function BufferWriteInt8 (value, offset, noAssert) {
- var buf = this
- if (!noAssert) {
- assert(value !== undefined && value !== null, 'missing value')
- assert(offset !== undefined && offset !== null, 'missing offset')
- assert(offset < buf.length, 'Trying to write beyond buffer length')
- verifsint(value, 0x7f, -0x80)
- }
-
- if (offset >= buf.length) return
-
- buf._dataview.setInt8(offset, value)
-}
-
-function _writeInt16 (buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- assert(value !== undefined && value !== null, 'missing value')
- assert(typeof (littleEndian) === 'boolean',
- 'missing or invalid endian')
- assert(offset !== undefined && offset !== null, 'missing offset')
- assert(offset + 1 < buf.length, 'Trying to write beyond buffer length')
- verifsint(value, 0x7fff, -0x8000)
- }
-
- var len = buf.length
- if (offset >= len) {
- return
- } else if (offset + 1 === len) {
- var dv = new xDataView(new xArrayBuffer(2))
- dv.setInt16(0, value, littleEndian)
- buf[offset] = dv.getUint8(0)
- } else {
- buf._dataview.setInt16(offset, value, littleEndian)
- }
-}
-
-function BufferWriteInt16LE (value, offset, noAssert) {
- _writeInt16(this, value, offset, true, noAssert)
-}
-
-function BufferWriteInt16BE (value, offset, noAssert) {
- _writeInt16(this, value, offset, false, noAssert)
-}
-
-function _writeInt32 (buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- assert(value !== undefined && value !== null, 'missing value')
- assert(typeof (littleEndian) === 'boolean',
- 'missing or invalid endian')
- assert(offset !== undefined && offset !== null, 'missing offset')
- assert(offset + 3 < buf.length, 'Trying to write beyond buffer length')
- verifsint(value, 0x7fffffff, -0x80000000)
- }
-
- var len = buf.length
- if (offset >= len) {
- return
- } else if (offset + 3 >= len) {
- var dv = new xDataView(new xArrayBuffer(4))
- dv.setInt32(0, value, littleEndian)
- for (var i = 0; i + offset < len; i++) {
- buf[i + offset] = dv.getUint8(i)
- }
- } else {
- buf._dataview.setInt32(offset, value, littleEndian)
- }
-}
-
-function BufferWriteInt32LE (value, offset, noAssert) {
- _writeInt32(this, value, offset, true, noAssert)
-}
-
-function BufferWriteInt32BE (value, offset, noAssert) {
- _writeInt32(this, value, offset, false, noAssert)
-}
-
-function _writeFloat (buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- assert(value !== undefined && value !== null, 'missing value')
- assert(typeof (littleEndian) === 'boolean',
- 'missing or invalid endian')
- assert(offset !== undefined && offset !== null, 'missing offset')
- assert(offset + 3 < buf.length, 'Trying to write beyond buffer length')
- verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38)
- }
-
- var len = buf.length
- if (offset >= len) {
- return
- } else if (offset + 3 >= len) {
- var dv = new xDataView(new xArrayBuffer(4))
- dv.setFloat32(0, value, littleEndian)
- for (var i = 0; i + offset < len; i++) {
- buf[i + offset] = dv.getUint8(i)
- }
- } else {
- buf._dataview.setFloat32(offset, value, littleEndian)
- }
-}
-
-function BufferWriteFloatLE (value, offset, noAssert) {
- _writeFloat(this, value, offset, true, noAssert)
-}
-
-function BufferWriteFloatBE (value, offset, noAssert) {
- _writeFloat(this, value, offset, false, noAssert)
-}
-
-function _writeDouble (buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- assert(value !== undefined && value !== null, 'missing value')
- assert(typeof (littleEndian) === 'boolean',
- 'missing or invalid endian')
- assert(offset !== undefined && offset !== null, 'missing offset')
- assert(offset + 7 < buf.length,
- 'Trying to write beyond buffer length')
- verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308)
- }
-
- var len = buf.length
- if (offset >= len) {
- return
- } else if (offset + 7 >= len) {
- var dv = new xDataView(new xArrayBuffer(8))
- dv.setFloat64(0, value, littleEndian)
- for (var i = 0; i + offset < len; i++) {
- buf[i + offset] = dv.getUint8(i)
- }
- } else {
- buf._dataview.setFloat64(offset, value, littleEndian)
- }
-}
-
-function BufferWriteDoubleLE (value, offset, noAssert) {
- _writeDouble(this, value, offset, true, noAssert)
-}
-
-function BufferWriteDoubleBE (value, offset, noAssert) {
- _writeDouble(this, value, offset, false, noAssert)
-}
-
-// fill(value, start=0, end=buffer.length)
-function BufferFill (value, start, end) {
- if (!value) value = 0
- if (!start) start = 0
- if (!end) end = this.length
-
- if (typeof value === 'string') {
- value = value.charCodeAt(0)
- }
-
- if (typeof value !== 'number' || isNaN(value)) {
- throw new Error('value is not a number')
- }
-
- if (end < start) throw new Error('end < start')
-
- // Fill 0 bytes; we're done
- if (end === start) return
- if (this.length === 0) return
-
- if (start < 0 || start >= this.length) {
- throw new Error('start out of bounds')
- }
-
- if (end < 0 || end > this.length) {
- throw new Error('end out of bounds')
- }
-
- for (var i = start; i < end; i++) {
- this[i] = value
- }
-}
-
-function BufferInspect () {
- var out = []
- var len = this.length
- for (var i = 0; i < len; i++) {
- out[i] = toHex(this[i])
- if (i === exports.INSPECT_MAX_BYTES) {
- out[i + 1] = '...'
- break
- }
- }
- return ''
-}
-
-// Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance.
-// Added in Node 0.12.
-function BufferToArrayBuffer () {
- return (new Buffer(this)).buffer
-}
-
-
-// HELPER FUNCTIONS
-// ================
-
-function stringtrim (str) {
- if (str.trim) return str.trim()
- return str.replace(/^\s+|\s+$/g, '')
-}
-
-/**
- * Check to see if the browser supports augmenting a `Uint8Array` instance.
- * @return {boolean}
- */
-function _browserSupport () {
- var arr = new xUint8Array(0)
- arr.foo = function () { return 42 }
-
- try {
- return (42 === arr.foo())
- } catch (e) {
- return false
- }
-}
-
-/**
- * Class: ProxyBuffer
- * ==================
- *
- * Only used in Firefox, since Firefox does not allow augmenting "native"
- * objects (like Uint8Array instances) with new properties for some unknown
- * (probably silly) reason. So we'll use an ES6 Proxy (supported since
- * Firefox 18) to wrap the Uint8Array instance without actually adding any
- * properties to it.
- *
- * Instances of this "fake" Buffer class are the "target" of the
- * ES6 Proxy (see `augment` function).
- *
- * We couldn't just use the `Uint8Array` as the target of the `Proxy` because
- * Proxies have an important limitation on trapping the `toString` method.
- * `Object.prototype.toString.call(proxy)` gets called whenever something is
- * implicitly cast to a String. Unfortunately, with a `Proxy` this
- * unconditionally returns `Object.prototype.toString.call(target)` which would
- * always return "[object Uint8Array]" if we used the `Uint8Array` instance as
- * the target. And, remember, in Firefox we cannot redefine the `Uint8Array`
- * instance's `toString` method.
- *
- * So, we use this `ProxyBuffer` class as the proxy's "target". Since this class
- * has its own custom `toString` method, it will get called whenever `toString`
- * gets called, implicitly or explicitly, on the `Proxy` instance.
- *
- * We also have to define the Uint8Array methods `subarray` and `set` on
- * `ProxyBuffer` because if we didn't then `proxy.subarray(0)` would have its
- * `this` set to `proxy` (a `Proxy` instance) which throws an exception in
- * Firefox which expects it to be a `TypedArray` instance.
- */
-function ProxyBuffer (arr) {
- this._arr = arr
-
- if (arr.byteLength !== 0)
- this._dataview = new xDataView(arr.buffer, arr.byteOffset, arr.byteLength)
-}
-
-ProxyBuffer.prototype.write = BufferWrite
-ProxyBuffer.prototype.toString = BufferToString
-ProxyBuffer.prototype.toLocaleString = BufferToString
-ProxyBuffer.prototype.toJSON = BufferToJSON
-ProxyBuffer.prototype.copy = BufferCopy
-ProxyBuffer.prototype.slice = BufferSlice
-ProxyBuffer.prototype.readUInt8 = BufferReadUInt8
-ProxyBuffer.prototype.readUInt16LE = BufferReadUInt16LE
-ProxyBuffer.prototype.readUInt16BE = BufferReadUInt16BE
-ProxyBuffer.prototype.readUInt32LE = BufferReadUInt32LE
-ProxyBuffer.prototype.readUInt32BE = BufferReadUInt32BE
-ProxyBuffer.prototype.readInt8 = BufferReadInt8
-ProxyBuffer.prototype.readInt16LE = BufferReadInt16LE
-ProxyBuffer.prototype.readInt16BE = BufferReadInt16BE
-ProxyBuffer.prototype.readInt32LE = BufferReadInt32LE
-ProxyBuffer.prototype.readInt32BE = BufferReadInt32BE
-ProxyBuffer.prototype.readFloatLE = BufferReadFloatLE
-ProxyBuffer.prototype.readFloatBE = BufferReadFloatBE
-ProxyBuffer.prototype.readDoubleLE = BufferReadDoubleLE
-ProxyBuffer.prototype.readDoubleBE = BufferReadDoubleBE
-ProxyBuffer.prototype.writeUInt8 = BufferWriteUInt8
-ProxyBuffer.prototype.writeUInt16LE = BufferWriteUInt16LE
-ProxyBuffer.prototype.writeUInt16BE = BufferWriteUInt16BE
-ProxyBuffer.prototype.writeUInt32LE = BufferWriteUInt32LE
-ProxyBuffer.prototype.writeUInt32BE = BufferWriteUInt32BE
-ProxyBuffer.prototype.writeInt8 = BufferWriteInt8
-ProxyBuffer.prototype.writeInt16LE = BufferWriteInt16LE
-ProxyBuffer.prototype.writeInt16BE = BufferWriteInt16BE
-ProxyBuffer.prototype.writeInt32LE = BufferWriteInt32LE
-ProxyBuffer.prototype.writeInt32BE = BufferWriteInt32BE
-ProxyBuffer.prototype.writeFloatLE = BufferWriteFloatLE
-ProxyBuffer.prototype.writeFloatBE = BufferWriteFloatBE
-ProxyBuffer.prototype.writeDoubleLE = BufferWriteDoubleLE
-ProxyBuffer.prototype.writeDoubleBE = BufferWriteDoubleBE
-ProxyBuffer.prototype.fill = BufferFill
-ProxyBuffer.prototype.inspect = BufferInspect
-ProxyBuffer.prototype.toArrayBuffer = BufferToArrayBuffer
-ProxyBuffer.prototype._isBuffer = true
-ProxyBuffer.prototype.subarray = function () {
- return this._arr.subarray.apply(this._arr, arguments)
-}
-ProxyBuffer.prototype.set = function () {
- return this._arr.set.apply(this._arr, arguments)
-}
-
-var ProxyHandler = {
- get: function (target, name) {
- if (name in target) return target[name]
- else return target._arr[name]
- },
- set: function (target, name, value) {
- target._arr[name] = value
- }
-}
-
-function augment (arr) {
- if (browserSupport === undefined) {
- browserSupport = _browserSupport()
- }
-
- if (browserSupport) {
- // Augment the Uint8Array *instance* (not the class!) with Buffer methods
- arr.write = BufferWrite
- arr.toString = BufferToString
- arr.toLocaleString = BufferToString
- arr.toJSON = BufferToJSON
- arr.copy = BufferCopy
- arr.slice = BufferSlice
- arr.readUInt8 = BufferReadUInt8
- arr.readUInt16LE = BufferReadUInt16LE
- arr.readUInt16BE = BufferReadUInt16BE
- arr.readUInt32LE = BufferReadUInt32LE
- arr.readUInt32BE = BufferReadUInt32BE
- arr.readInt8 = BufferReadInt8
- arr.readInt16LE = BufferReadInt16LE
- arr.readInt16BE = BufferReadInt16BE
- arr.readInt32LE = BufferReadInt32LE
- arr.readInt32BE = BufferReadInt32BE
- arr.readFloatLE = BufferReadFloatLE
- arr.readFloatBE = BufferReadFloatBE
- arr.readDoubleLE = BufferReadDoubleLE
- arr.readDoubleBE = BufferReadDoubleBE
- arr.writeUInt8 = BufferWriteUInt8
- arr.writeUInt16LE = BufferWriteUInt16LE
- arr.writeUInt16BE = BufferWriteUInt16BE
- arr.writeUInt32LE = BufferWriteUInt32LE
- arr.writeUInt32BE = BufferWriteUInt32BE
- arr.writeInt8 = BufferWriteInt8
- arr.writeInt16LE = BufferWriteInt16LE
- arr.writeInt16BE = BufferWriteInt16BE
- arr.writeInt32LE = BufferWriteInt32LE
- arr.writeInt32BE = BufferWriteInt32BE
- arr.writeFloatLE = BufferWriteFloatLE
- arr.writeFloatBE = BufferWriteFloatBE
- arr.writeDoubleLE = BufferWriteDoubleLE
- arr.writeDoubleBE = BufferWriteDoubleBE
- arr.fill = BufferFill
- arr.inspect = BufferInspect
- arr.toArrayBuffer = BufferToArrayBuffer
- arr._isBuffer = true
-
- if (arr.byteLength !== 0)
- arr._dataview = new xDataView(arr.buffer, arr.byteOffset, arr.byteLength)
-
- return arr
-
- } else {
- // This is a browser that doesn't support augmenting the `Uint8Array`
- // instance (*ahem* Firefox) so use an ES6 `Proxy`.
- var proxyBuffer = new ProxyBuffer(arr)
- var proxy = new Proxy(proxyBuffer, ProxyHandler)
- proxyBuffer._proxy = proxy
- return proxy
- }
-}
-
-// slice(start, end)
-function clamp (index, len, defaultValue) {
- if (typeof index !== 'number') return defaultValue
- index = ~~index; // Coerce to integer.
- if (index >= len) return len
- if (index >= 0) return index
- index += len
- if (index >= 0) return index
- return 0
-}
-
-function coerce (length) {
- // Coerce length to a number (possibly NaN), round up
- // in case it's fractional (e.g. 123.456) then do a
- // double negate to coerce a NaN to 0. Easy, right?
- length = ~~Math.ceil(+length)
- return length < 0 ? 0 : length
-}
-
-function isArrayIsh (subject) {
- return Array.isArray(subject) || Buffer.isBuffer(subject) ||
- subject && typeof subject === 'object' &&
- typeof subject.length === 'number'
-}
-
-function toHex (n) {
- if (n < 16) return '0' + n.toString(16)
- return n.toString(16)
-}
-
-function utf8ToBytes (str) {
- var byteArray = []
- for (var i = 0; i < str.length; i++)
- if (str.charCodeAt(i) <= 0x7F)
- byteArray.push(str.charCodeAt(i))
- else {
- var h = encodeURIComponent(str.charAt(i)).substr(1).split('%')
- for (var j = 0; j < h.length; j++)
- byteArray.push(parseInt(h[j], 16))
- }
-
- return byteArray
-}
-
-function asciiToBytes (str) {
- var byteArray = []
- for (var i = 0; i < str.length; i++) {
- // Node's code seems to be doing this and not & 0x7F..
- byteArray.push(str.charCodeAt(i) & 0xFF)
- }
-
- return byteArray
-}
-
-function base64ToBytes (str) {
- return require('base64-js').toByteArray(str)
-}
-
-function blitBuffer (src, dst, offset, length) {
- var pos, i = 0
- while (i < length) {
- if ((i + offset >= dst.length) || (i >= src.length))
- break
-
- dst[i + offset] = src[i]
- i++
- }
- return i
-}
-
-function decodeUtf8Char (str) {
- try {
- return decodeURIComponent(str)
- } catch (err) {
- return String.fromCharCode(0xFFFD) // UTF 8 invalid char
- }
-}
-
-/*
- * We have to make sure that the value is a valid integer. This means that it
- * is non-negative. It has no fractional component and that it does not
- * exceed the maximum allowed value.
- *
- * value The number to check for validity
- *
- * max The maximum value
- */
-function verifuint (value, max) {
- assert(typeof (value) == 'number', 'cannot write a non-number as a number')
- assert(value >= 0,
- 'specified a negative value for writing an unsigned value')
- assert(value <= max, 'value is larger than maximum value for type')
- assert(Math.floor(value) === value, 'value has a fractional component')
-}
-
-/*
- * A series of checks to make sure we actually have a signed 32-bit number
- */
-function verifsint(value, max, min) {
- assert(typeof (value) == 'number', 'cannot write a non-number as a number')
- assert(value <= max, 'value larger than maximum allowed value')
- assert(value >= min, 'value smaller than minimum allowed value')
- assert(Math.floor(value) === value, 'value has a fractional component')
-}
-
-function verifIEEE754(value, max, min) {
- assert(typeof (value) == 'number', 'cannot write a non-number as a number')
- assert(value <= max, 'value larger than maximum allowed value')
- assert(value >= min, 'value smaller than minimum allowed value')
-}
-
-function assert (test, message) {
- if (!test) throw new Error(message || 'Failed assertion')
-}
-
-},{"base64-js":3,"typedarray":4}],"native-buffer-browserify":[function(require,module,exports){
-module.exports=require('PcZj9L');
-},{}],3:[function(require,module,exports){
-(function (exports) {
- 'use strict';
-
- var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
-
- function b64ToByteArray(b64) {
- var i, j, l, tmp, placeHolders, arr;
-
- if (b64.length % 4 > 0) {
- throw 'Invalid string. Length must be a multiple of 4';
- }
-
- // the number of equal signs (place holders)
- // if there are two placeholders, than the two characters before it
- // represent one byte
- // if there is only one, then the three characters before it represent 2 bytes
- // this is just a cheap hack to not do indexOf twice
- placeHolders = b64.indexOf('=');
- placeHolders = placeHolders > 0 ? b64.length - placeHolders : 0;
-
- // base64 is 4/3 + up to two characters of the original data
- arr = [];//new Uint8Array(b64.length * 3 / 4 - placeHolders);
-
- // if there are placeholders, only get up to the last complete 4 chars
- l = placeHolders > 0 ? b64.length - 4 : b64.length;
-
- for (i = 0, j = 0; i < l; i += 4, j += 3) {
- tmp = (lookup.indexOf(b64[i]) << 18) | (lookup.indexOf(b64[i + 1]) << 12) | (lookup.indexOf(b64[i + 2]) << 6) | lookup.indexOf(b64[i + 3]);
- arr.push((tmp & 0xFF0000) >> 16);
- arr.push((tmp & 0xFF00) >> 8);
- arr.push(tmp & 0xFF);
- }
-
- if (placeHolders === 2) {
- tmp = (lookup.indexOf(b64[i]) << 2) | (lookup.indexOf(b64[i + 1]) >> 4);
- arr.push(tmp & 0xFF);
- } else if (placeHolders === 1) {
- tmp = (lookup.indexOf(b64[i]) << 10) | (lookup.indexOf(b64[i + 1]) << 4) | (lookup.indexOf(b64[i + 2]) >> 2);
- arr.push((tmp >> 8) & 0xFF);
- arr.push(tmp & 0xFF);
- }
-
- return arr;
- }
-
- function uint8ToBase64(uint8) {
- var i,
- extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
- output = "",
- temp, length;
-
- function tripletToBase64 (num) {
- return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];
- };
-
- // go through the array every three bytes, we'll deal with trailing stuff later
- for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
- temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]);
- output += tripletToBase64(temp);
- }
-
- // pad the end with zeros, but make sure to not forget the extra bytes
- switch (extraBytes) {
- case 1:
- temp = uint8[uint8.length - 1];
- output += lookup[temp >> 2];
- output += lookup[(temp << 4) & 0x3F];
- output += '==';
- break;
- case 2:
- temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]);
- output += lookup[temp >> 10];
- output += lookup[(temp >> 4) & 0x3F];
- output += lookup[(temp << 2) & 0x3F];
- output += '=';
- break;
- }
-
- return output;
- }
-
- module.exports.toByteArray = b64ToByteArray;
- module.exports.fromByteArray = uint8ToBase64;
-}());
-
-},{}],4:[function(require,module,exports){
-var undefined = (void 0); // Paranoia
-
-// Beyond this value, index getters/setters (i.e. array[0], array[1]) are so slow to
-// create, and consume so much memory, that the browser appears frozen.
-var MAX_ARRAY_LENGTH = 1e5;
-
-// Approximations of internal ECMAScript conversion functions
-var ECMAScript = (function() {
- // Stash a copy in case other scripts modify these
- var opts = Object.prototype.toString,
- ophop = Object.prototype.hasOwnProperty;
-
- return {
- // Class returns internal [[Class]] property, used to avoid cross-frame instanceof issues:
- Class: function(v) { return opts.call(v).replace(/^\[object *|\]$/g, ''); },
- HasProperty: function(o, p) { return p in o; },
- HasOwnProperty: function(o, p) { return ophop.call(o, p); },
- IsCallable: function(o) { return typeof o === 'function'; },
- ToInt32: function(v) { return v >> 0; },
- ToUint32: function(v) { return v >>> 0; }
- };
-}());
-
-// Snapshot intrinsics
-var LN2 = Math.LN2,
- abs = Math.abs,
- floor = Math.floor,
- log = Math.log,
- min = Math.min,
- pow = Math.pow,
- round = Math.round;
-
-// ES5: lock down object properties
-function configureProperties(obj) {
- if (getOwnPropertyNames && defineProperty) {
- var props = getOwnPropertyNames(obj), i;
- for (i = 0; i < props.length; i += 1) {
- defineProperty(obj, props[i], {
- value: obj[props[i]],
- writable: false,
- enumerable: false,
- configurable: false
- });
- }
- }
-}
-
-// emulate ES5 getter/setter API using legacy APIs
-// http://blogs.msdn.com/b/ie/archive/2010/09/07/transitioning-existing-code-to-the-es5-getter-setter-apis.aspx
-// (second clause tests for Object.defineProperty() in IE<9 that only supports extending DOM prototypes, but
-// note that IE<9 does not support __defineGetter__ or __defineSetter__ so it just renders the method harmless)
-var defineProperty = Object.defineProperty || function(o, p, desc) {
- if (!o === Object(o)) throw new TypeError("Object.defineProperty called on non-object");
- if (ECMAScript.HasProperty(desc, 'get') && Object.prototype.__defineGetter__) { Object.prototype.__defineGetter__.call(o, p, desc.get); }
- if (ECMAScript.HasProperty(desc, 'set') && Object.prototype.__defineSetter__) { Object.prototype.__defineSetter__.call(o, p, desc.set); }
- if (ECMAScript.HasProperty(desc, 'value')) { o[p] = desc.value; }
- return o;
-};
-
-var getOwnPropertyNames = Object.getOwnPropertyNames || function getOwnPropertyNames(o) {
- if (o !== Object(o)) throw new TypeError("Object.getOwnPropertyNames called on non-object");
- var props = [], p;
- for (p in o) {
- if (ECMAScript.HasOwnProperty(o, p)) {
- props.push(p);
- }
- }
- return props;
-};
-
-// ES5: Make obj[index] an alias for obj._getter(index)/obj._setter(index, value)
-// for index in 0 ... obj.length
-function makeArrayAccessors(obj) {
- if (!defineProperty) { return; }
-
- if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError("Array too large for polyfill");
-
- function makeArrayAccessor(index) {
- defineProperty(obj, index, {
- 'get': function() { return obj._getter(index); },
- 'set': function(v) { obj._setter(index, v); },
- enumerable: true,
- configurable: false
- });
- }
-
- var i;
- for (i = 0; i < obj.length; i += 1) {
- makeArrayAccessor(i);
- }
-}
-
-// Internal conversion functions:
-// pack() - take a number (interpreted as Type), output a byte array
-// unpack() - take a byte array, output a Type-like number
-
-function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }
-function as_unsigned(value, bits) { var s = 32 - bits; return (value << s) >>> s; }
-
-function packI8(n) { return [n & 0xff]; }
-function unpackI8(bytes) { return as_signed(bytes[0], 8); }
-
-function packU8(n) { return [n & 0xff]; }
-function unpackU8(bytes) { return as_unsigned(bytes[0], 8); }
-
-function packU8Clamped(n) { n = round(Number(n)); return [n < 0 ? 0 : n > 0xff ? 0xff : n & 0xff]; }
-
-function packI16(n) { return [(n >> 8) & 0xff, n & 0xff]; }
-function unpackI16(bytes) { return as_signed(bytes[0] << 8 | bytes[1], 16); }
-
-function packU16(n) { return [(n >> 8) & 0xff, n & 0xff]; }
-function unpackU16(bytes) { return as_unsigned(bytes[0] << 8 | bytes[1], 16); }
-
-function packI32(n) { return [(n >> 24) & 0xff, (n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff]; }
-function unpackI32(bytes) { return as_signed(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); }
-
-function packU32(n) { return [(n >> 24) & 0xff, (n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff]; }
-function unpackU32(bytes) { return as_unsigned(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); }
-
-function packIEEE754(v, ebits, fbits) {
-
- var bias = (1 << (ebits - 1)) - 1,
- s, e, f, ln,
- i, bits, str, bytes;
-
- function roundToEven(n) {
- var w = floor(n), f = n - w;
- if (f < 0.5)
- return w;
- if (f > 0.5)
- return w + 1;
- return w % 2 ? w + 1 : w;
- }
-
- // Compute sign, exponent, fraction
- if (v !== v) {
- // NaN
- // http://dev.w3.org/2006/webapi/WebIDL/#es-type-mapping
- e = (1 << ebits) - 1; f = pow(2, fbits - 1); s = 0;
- } else if (v === Infinity || v === -Infinity) {
- e = (1 << ebits) - 1; f = 0; s = (v < 0) ? 1 : 0;
- } else if (v === 0) {
- e = 0; f = 0; s = (1 / v === -Infinity) ? 1 : 0;
- } else {
- s = v < 0;
- v = abs(v);
-
- if (v >= pow(2, 1 - bias)) {
- e = min(floor(log(v) / LN2), 1023);
- f = roundToEven(v / pow(2, e) * pow(2, fbits));
- if (f / pow(2, fbits) >= 2) {
- e = e + 1;
- f = 1;
- }
- if (e > bias) {
- // Overflow
- e = (1 << ebits) - 1;
- f = 0;
- } else {
- // Normalized
- e = e + bias;
- f = f - pow(2, fbits);
- }
- } else {
- // Denormalized
- e = 0;
- f = roundToEven(v / pow(2, 1 - bias - fbits));
- }
- }
-
- // Pack sign, exponent, fraction
- bits = [];
- for (i = fbits; i; i -= 1) { bits.push(f % 2 ? 1 : 0); f = floor(f / 2); }
- for (i = ebits; i; i -= 1) { bits.push(e % 2 ? 1 : 0); e = floor(e / 2); }
- bits.push(s ? 1 : 0);
- bits.reverse();
- str = bits.join('');
-
- // Bits to bytes
- bytes = [];
- while (str.length) {
- bytes.push(parseInt(str.substring(0, 8), 2));
- str = str.substring(8);
- }
- return bytes;
-}
-
-function unpackIEEE754(bytes, ebits, fbits) {
-
- // Bytes to bits
- var bits = [], i, j, b, str,
- bias, s, e, f;
-
- for (i = bytes.length; i; i -= 1) {
- b = bytes[i - 1];
- for (j = 8; j; j -= 1) {
- bits.push(b % 2 ? 1 : 0); b = b >> 1;
- }
- }
- bits.reverse();
- str = bits.join('');
-
- // Unpack sign, exponent, fraction
- bias = (1 << (ebits - 1)) - 1;
- s = parseInt(str.substring(0, 1), 2) ? -1 : 1;
- e = parseInt(str.substring(1, 1 + ebits), 2);
- f = parseInt(str.substring(1 + ebits), 2);
-
- // Produce number
- if (e === (1 << ebits) - 1) {
- return f !== 0 ? NaN : s * Infinity;
- } else if (e > 0) {
- // Normalized
- return s * pow(2, e - bias) * (1 + f / pow(2, fbits));
- } else if (f !== 0) {
- // Denormalized
- return s * pow(2, -(bias - 1)) * (f / pow(2, fbits));
- } else {
- return s < 0 ? -0 : 0;
- }
-}
-
-function unpackF64(b) { return unpackIEEE754(b, 11, 52); }
-function packF64(v) { return packIEEE754(v, 11, 52); }
-function unpackF32(b) { return unpackIEEE754(b, 8, 23); }
-function packF32(v) { return packIEEE754(v, 8, 23); }
-
-
-//
-// 3 The ArrayBuffer Type
-//
-
-(function() {
-
- /** @constructor */
- var ArrayBuffer = function ArrayBuffer(length) {
- length = ECMAScript.ToInt32(length);
- if (length < 0) throw new RangeError('ArrayBuffer size is not a small enough positive integer');
-
- this.byteLength = length;
- this._bytes = [];
- this._bytes.length = length;
-
- var i;
- for (i = 0; i < this.byteLength; i += 1) {
- this._bytes[i] = 0;
- }
-
- configureProperties(this);
- };
-
- exports.ArrayBuffer = exports.ArrayBuffer || ArrayBuffer;
-
- //
- // 4 The ArrayBufferView Type
- //
-
- // NOTE: this constructor is not exported
- /** @constructor */
- var ArrayBufferView = function ArrayBufferView() {
- //this.buffer = null;
- //this.byteOffset = 0;
- //this.byteLength = 0;
- };
-
- //
- // 5 The Typed Array View Types
- //
-
- function makeConstructor(bytesPerElement, pack, unpack) {
- // Each TypedArray type requires a distinct constructor instance with
- // identical logic, which this produces.
-
- var ctor;
- ctor = function(buffer, byteOffset, length) {
- var array, sequence, i, s;
-
- if (!arguments.length || typeof arguments[0] === 'number') {
- // Constructor(unsigned long length)
- this.length = ECMAScript.ToInt32(arguments[0]);
- if (length < 0) throw new RangeError('ArrayBufferView size is not a small enough positive integer');
-
- this.byteLength = this.length * this.BYTES_PER_ELEMENT;
- this.buffer = new ArrayBuffer(this.byteLength);
- this.byteOffset = 0;
- } else if (typeof arguments[0] === 'object' && arguments[0].constructor === ctor) {
- // Constructor(TypedArray array)
- array = arguments[0];
-
- this.length = array.length;
- this.byteLength = this.length * this.BYTES_PER_ELEMENT;
- this.buffer = new ArrayBuffer(this.byteLength);
- this.byteOffset = 0;
-
- for (i = 0; i < this.length; i += 1) {
- this._setter(i, array._getter(i));
- }
- } else if (typeof arguments[0] === 'object' &&
- !(arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) {
- // Constructor(sequence array)
- sequence = arguments[0];
-
- this.length = ECMAScript.ToUint32(sequence.length);
- this.byteLength = this.length * this.BYTES_PER_ELEMENT;
- this.buffer = new ArrayBuffer(this.byteLength);
- this.byteOffset = 0;
-
- for (i = 0; i < this.length; i += 1) {
- s = sequence[i];
- this._setter(i, Number(s));
- }
- } else if (typeof arguments[0] === 'object' &&
- (arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) {
- // Constructor(ArrayBuffer buffer,
- // optional unsigned long byteOffset, optional unsigned long length)
- this.buffer = buffer;
-
- this.byteOffset = ECMAScript.ToUint32(byteOffset);
- if (this.byteOffset > this.buffer.byteLength) {
- throw new RangeError("byteOffset out of range");
- }
-
- if (this.byteOffset % this.BYTES_PER_ELEMENT) {
- // The given byteOffset must be a multiple of the element
- // size of the specific type, otherwise an exception is raised.
- throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size.");
- }
-
- if (arguments.length < 3) {
- this.byteLength = this.buffer.byteLength - this.byteOffset;
-
- if (this.byteLength % this.BYTES_PER_ELEMENT) {
- throw new RangeError("length of buffer minus byteOffset not a multiple of the element size");
- }
- this.length = this.byteLength / this.BYTES_PER_ELEMENT;
- } else {
- this.length = ECMAScript.ToUint32(length);
- this.byteLength = this.length * this.BYTES_PER_ELEMENT;
- }
-
- if ((this.byteOffset + this.byteLength) > this.buffer.byteLength) {
- throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");
- }
- } else {
- throw new TypeError("Unexpected argument type(s)");
- }
-
- this.constructor = ctor;
-
- configureProperties(this);
- makeArrayAccessors(this);
- };
-
- ctor.prototype = new ArrayBufferView();
- ctor.prototype.BYTES_PER_ELEMENT = bytesPerElement;
- ctor.prototype._pack = pack;
- ctor.prototype._unpack = unpack;
- ctor.BYTES_PER_ELEMENT = bytesPerElement;
-
- // getter type (unsigned long index);
- ctor.prototype._getter = function(index) {
- if (arguments.length < 1) throw new SyntaxError("Not enough arguments");
-
- index = ECMAScript.ToUint32(index);
- if (index >= this.length) {
- return undefined;
- }
-
- var bytes = [], i, o;
- for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT;
- i < this.BYTES_PER_ELEMENT;
- i += 1, o += 1) {
- bytes.push(this.buffer._bytes[o]);
- }
- return this._unpack(bytes);
- };
-
- // NONSTANDARD: convenience alias for getter: type get(unsigned long index);
- ctor.prototype.get = ctor.prototype._getter;
-
- // setter void (unsigned long index, type value);
- ctor.prototype._setter = function(index, value) {
- if (arguments.length < 2) throw new SyntaxError("Not enough arguments");
-
- index = ECMAScript.ToUint32(index);
- if (index >= this.length) {
- return undefined;
- }
-
- var bytes = this._pack(value), i, o;
- for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT;
- i < this.BYTES_PER_ELEMENT;
- i += 1, o += 1) {
- this.buffer._bytes[o] = bytes[i];
- }
- };
-
- // void set(TypedArray array, optional unsigned long offset);
- // void set(sequence array, optional unsigned long offset);
- ctor.prototype.set = function(index, value) {
- if (arguments.length < 1) throw new SyntaxError("Not enough arguments");
- var array, sequence, offset, len,
- i, s, d,
- byteOffset, byteLength, tmp;
-
- if (typeof arguments[0] === 'object' && arguments[0].constructor === this.constructor) {
- // void set(TypedArray array, optional unsigned long offset);
- array = arguments[0];
- offset = ECMAScript.ToUint32(arguments[1]);
-
- if (offset + array.length > this.length) {
- throw new RangeError("Offset plus length of array is out of range");
- }
-
- byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT;
- byteLength = array.length * this.BYTES_PER_ELEMENT;
-
- if (array.buffer === this.buffer) {
- tmp = [];
- for (i = 0, s = array.byteOffset; i < byteLength; i += 1, s += 1) {
- tmp[i] = array.buffer._bytes[s];
- }
- for (i = 0, d = byteOffset; i < byteLength; i += 1, d += 1) {
- this.buffer._bytes[d] = tmp[i];
- }
- } else {
- for (i = 0, s = array.byteOffset, d = byteOffset;
- i < byteLength; i += 1, s += 1, d += 1) {
- this.buffer._bytes[d] = array.buffer._bytes[s];
- }
- }
- } else if (typeof arguments[0] === 'object' && typeof arguments[0].length !== 'undefined') {
- // void set(sequence array, optional unsigned long offset);
- sequence = arguments[0];
- len = ECMAScript.ToUint32(sequence.length);
- offset = ECMAScript.ToUint32(arguments[1]);
-
- if (offset + len > this.length) {
- throw new RangeError("Offset plus length of array is out of range");
- }
-
- for (i = 0; i < len; i += 1) {
- s = sequence[i];
- this._setter(offset + i, Number(s));
- }
- } else {
- throw new TypeError("Unexpected argument type(s)");
- }
- };
-
- // TypedArray subarray(long begin, optional long end);
- ctor.prototype.subarray = function(start, end) {
- function clamp(v, min, max) { return v < min ? min : v > max ? max : v; }
-
- start = ECMAScript.ToInt32(start);
- end = ECMAScript.ToInt32(end);
-
- if (arguments.length < 1) { start = 0; }
- if (arguments.length < 2) { end = this.length; }
-
- if (start < 0) { start = this.length + start; }
- if (end < 0) { end = this.length + end; }
-
- start = clamp(start, 0, this.length);
- end = clamp(end, 0, this.length);
-
- var len = end - start;
- if (len < 0) {
- len = 0;
- }
-
- return new this.constructor(
- this.buffer, this.byteOffset + start * this.BYTES_PER_ELEMENT, len);
- };
-
- return ctor;
- }
-
- var Int8Array = makeConstructor(1, packI8, unpackI8);
- var Uint8Array = makeConstructor(1, packU8, unpackU8);
- var Uint8ClampedArray = makeConstructor(1, packU8Clamped, unpackU8);
- var Int16Array = makeConstructor(2, packI16, unpackI16);
- var Uint16Array = makeConstructor(2, packU16, unpackU16);
- var Int32Array = makeConstructor(4, packI32, unpackI32);
- var Uint32Array = makeConstructor(4, packU32, unpackU32);
- var Float32Array = makeConstructor(4, packF32, unpackF32);
- var Float64Array = makeConstructor(8, packF64, unpackF64);
-
- exports.Int8Array = exports.Int8Array || Int8Array;
- exports.Uint8Array = exports.Uint8Array || Uint8Array;
- exports.Uint8ClampedArray = exports.Uint8ClampedArray || Uint8ClampedArray;
- exports.Int16Array = exports.Int16Array || Int16Array;
- exports.Uint16Array = exports.Uint16Array || Uint16Array;
- exports.Int32Array = exports.Int32Array || Int32Array;
- exports.Uint32Array = exports.Uint32Array || Uint32Array;
- exports.Float32Array = exports.Float32Array || Float32Array;
- exports.Float64Array = exports.Float64Array || Float64Array;
-}());
-
-//
-// 6 The DataView View Type
-//
-
-(function() {
- function r(array, index) {
- return ECMAScript.IsCallable(array.get) ? array.get(index) : array[index];
- }
-
- var IS_BIG_ENDIAN = (function() {
- var u16array = new(exports.Uint16Array)([0x1234]),
- u8array = new(exports.Uint8Array)(u16array.buffer);
- return r(u8array, 0) === 0x12;
- }());
-
- // Constructor(ArrayBuffer buffer,
- // optional unsigned long byteOffset,
- // optional unsigned long byteLength)
- /** @constructor */
- var DataView = function DataView(buffer, byteOffset, byteLength) {
- if (arguments.length === 0) {
- buffer = new ArrayBuffer(0);
- } else if (!(buffer instanceof ArrayBuffer || ECMAScript.Class(buffer) === 'ArrayBuffer')) {
- throw new TypeError("TypeError");
- }
-
- this.buffer = buffer || new ArrayBuffer(0);
-
- this.byteOffset = ECMAScript.ToUint32(byteOffset);
- if (this.byteOffset > this.buffer.byteLength) {
- throw new RangeError("byteOffset out of range");
- }
-
- if (arguments.length < 3) {
- this.byteLength = this.buffer.byteLength - this.byteOffset;
- } else {
- this.byteLength = ECMAScript.ToUint32(byteLength);
- }
-
- if ((this.byteOffset + this.byteLength) > this.buffer.byteLength) {
- throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");
- }
-
- configureProperties(this);
- };
-
- function makeGetter(arrayType) {
- return function(byteOffset, littleEndian) {
-
- byteOffset = ECMAScript.ToUint32(byteOffset);
-
- if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) {
- throw new RangeError("Array index out of range");
- }
- byteOffset += this.byteOffset;
-
- var uint8Array = new Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT),
- bytes = [], i;
- for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) {
- bytes.push(r(uint8Array, i));
- }
-
- if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) {
- bytes.reverse();
- }
-
- return r(new arrayType(new Uint8Array(bytes).buffer), 0);
- };
- }
-
- DataView.prototype.getUint8 = makeGetter(exports.Uint8Array);
- DataView.prototype.getInt8 = makeGetter(exports.Int8Array);
- DataView.prototype.getUint16 = makeGetter(exports.Uint16Array);
- DataView.prototype.getInt16 = makeGetter(exports.Int16Array);
- DataView.prototype.getUint32 = makeGetter(exports.Uint32Array);
- DataView.prototype.getInt32 = makeGetter(exports.Int32Array);
- DataView.prototype.getFloat32 = makeGetter(exports.Float32Array);
- DataView.prototype.getFloat64 = makeGetter(exports.Float64Array);
-
- function makeSetter(arrayType) {
- return function(byteOffset, value, littleEndian) {
-
- byteOffset = ECMAScript.ToUint32(byteOffset);
- if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) {
- throw new RangeError("Array index out of range");
- }
-
- // Get bytes
- var typeArray = new arrayType([value]),
- byteArray = new Uint8Array(typeArray.buffer),
- bytes = [], i, byteView;
-
- for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) {
- bytes.push(r(byteArray, i));
- }
-
- // Flip if necessary
- if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) {
- bytes.reverse();
- }
-
- // Write them
- byteView = new Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT);
- byteView.set(bytes);
- };
- }
-
- DataView.prototype.setUint8 = makeSetter(exports.Uint8Array);
- DataView.prototype.setInt8 = makeSetter(exports.Int8Array);
- DataView.prototype.setUint16 = makeSetter(exports.Uint16Array);
- DataView.prototype.setInt16 = makeSetter(exports.Int16Array);
- DataView.prototype.setUint32 = makeSetter(exports.Uint32Array);
- DataView.prototype.setInt32 = makeSetter(exports.Int32Array);
- DataView.prototype.setFloat32 = makeSetter(exports.Float32Array);
- DataView.prototype.setFloat64 = makeSetter(exports.Float64Array);
-
- exports.DataView = exports.DataView || DataView;
-
-}());
-
-},{}]},{},[])
-;;module.exports=require("native-buffer-browserify").Buffer
-
-},{}],27:[function(require,module,exports){
-// shim for using process in browser
-
-var process = module.exports = {};
-
-process.nextTick = (function () {
- var canSetImmediate = typeof window !== 'undefined'
- && window.setImmediate;
- var canPost = typeof window !== 'undefined'
- && window.postMessage && window.addEventListener
- ;
-
- if (canSetImmediate) {
- return function (f) { return window.setImmediate(f) };
- }
-
- if (canPost) {
- var queue = [];
- window.addEventListener('message', function (ev) {
- var source = ev.source;
- if ((source === window || source === null) && ev.data === 'process-tick') {
- ev.stopPropagation();
- if (queue.length > 0) {
- var fn = queue.shift();
- fn();
- }
- }
- }, true);
-
- return function nextTick(fn) {
- queue.push(fn);
- window.postMessage('process-tick', '*');
- };
- }
-
- return function nextTick(fn) {
- setTimeout(fn, 0);
- };
-})();
-
-process.title = 'browser';
-process.browser = true;
-process.env = {};
-process.argv = [];
-
-process.binding = function (name) {
- throw new Error('process.binding is not supported');
-}
-
-// TODO(shtylman)
-process.cwd = function () { return '/' };
-process.chdir = function (dir) {
- throw new Error('process.chdir is not supported');
-};
-
-},{}],28:[function(require,module,exports){
-module.exports = function isBuffer(arg) {
- return arg && typeof arg === 'object'
- && typeof arg.copy === 'function'
- && typeof arg.fill === 'function'
- && typeof arg.readUInt8 === 'function';
-}
-},{}],29:[function(require,module,exports){
-var process=require("__browserify_process"),global=typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};// Copyright Joyent, Inc. and other Node contributors.
-//
-// 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.
-
-var formatRegExp = /%[sdj%]/g;
-exports.format = function(f) {
- if (!isString(f)) {
- var objects = [];
- for (var i = 0; i < arguments.length; i++) {
- objects.push(inspect(arguments[i]));
- }
- return objects.join(' ');
- }
-
- var i = 1;
- var args = arguments;
- var len = args.length;
- var str = String(f).replace(formatRegExp, function(x) {
- if (x === '%%') return '%';
- if (i >= len) return x;
- switch (x) {
- case '%s': return String(args[i++]);
- case '%d': return Number(args[i++]);
- case '%j':
- try {
- return JSON.stringify(args[i++]);
- } catch (_) {
- return '[Circular]';
- }
- default:
- return x;
- }
- });
- for (var x = args[i]; i < len; x = args[++i]) {
- if (isNull(x) || !isObject(x)) {
- str += ' ' + x;
- } else {
- str += ' ' + inspect(x);
- }
- }
- return str;
-};
-
-
-// Mark that a method should not be used.
-// Returns a modified function which warns once by default.
-// If --no-deprecation is set, then it is a no-op.
-exports.deprecate = function(fn, msg) {
- // Allow for deprecating things in the process of starting up.
- if (isUndefined(global.process)) {
- return function() {
- return exports.deprecate(fn, msg).apply(this, arguments);
- };
- }
-
- if (process.noDeprecation === true) {
- return fn;
- }
-
- var warned = false;
- function deprecated() {
- if (!warned) {
- if (process.throwDeprecation) {
- throw new Error(msg);
- } else if (process.traceDeprecation) {
- console.trace(msg);
- } else {
- console.error(msg);
- }
- warned = true;
- }
- return fn.apply(this, arguments);
- }
-
- return deprecated;
-};
-
-
-var debugs = {};
-var debugEnviron;
-exports.debuglog = function(set) {
- if (isUndefined(debugEnviron))
- debugEnviron = process.env.NODE_DEBUG || '';
- set = set.toUpperCase();
- if (!debugs[set]) {
- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
- var pid = process.pid;
- debugs[set] = function() {
- var msg = exports.format.apply(exports, arguments);
- console.error('%s %d: %s', set, pid, msg);
- };
- } else {
- debugs[set] = function() {};
- }
- }
- return debugs[set];
-};
-
-
-/**
- * Echos the value of a value. Trys to print the value out
- * in the best way possible given the different types.
- *
- * @param {Object} obj The object to print out.
- * @param {Object} opts Optional options object that alters the output.
- */
-/* legacy: obj, showHidden, depth, colors*/
-function inspect(obj, opts) {
- // default options
- var ctx = {
- seen: [],
- stylize: stylizeNoColor
- };
- // legacy...
- if (arguments.length >= 3) ctx.depth = arguments[2];
- if (arguments.length >= 4) ctx.colors = arguments[3];
- if (isBoolean(opts)) {
- // legacy...
- ctx.showHidden = opts;
- } else if (opts) {
- // got an "options" object
- exports._extend(ctx, opts);
- }
- // set default options
- if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
- if (isUndefined(ctx.depth)) ctx.depth = 2;
- if (isUndefined(ctx.colors)) ctx.colors = false;
- if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
- if (ctx.colors) ctx.stylize = stylizeWithColor;
- return formatValue(ctx, obj, ctx.depth);
-}
-exports.inspect = inspect;
-
-
-// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
-inspect.colors = {
- 'bold' : [1, 22],
- 'italic' : [3, 23],
- 'underline' : [4, 24],
- 'inverse' : [7, 27],
- 'white' : [37, 39],
- 'grey' : [90, 39],
- 'black' : [30, 39],
- 'blue' : [34, 39],
- 'cyan' : [36, 39],
- 'green' : [32, 39],
- 'magenta' : [35, 39],
- 'red' : [31, 39],
- 'yellow' : [33, 39]
-};
-
-// Don't use 'blue' not visible on cmd.exe
-inspect.styles = {
- 'special': 'cyan',
- 'number': 'yellow',
- 'boolean': 'yellow',
- 'undefined': 'grey',
- 'null': 'bold',
- 'string': 'green',
- 'date': 'magenta',
- // "name": intentionally not styling
- 'regexp': 'red'
-};
-
-
-function stylizeWithColor(str, styleType) {
- var style = inspect.styles[styleType];
-
- if (style) {
- return '\u001b[' + inspect.colors[style][0] + 'm' + str +
- '\u001b[' + inspect.colors[style][1] + 'm';
- } else {
- return str;
- }
-}
-
-
-function stylizeNoColor(str, styleType) {
- return str;
-}
-
-
-function arrayToHash(array) {
- var hash = {};
-
- array.forEach(function(val, idx) {
- hash[val] = true;
- });
-
- return hash;
-}
-
-
-function formatValue(ctx, value, recurseTimes) {
- // Provide a hook for user-specified inspect functions.
- // Check that value is an object with an inspect function on it
- if (ctx.customInspect &&
- value &&
- isFunction(value.inspect) &&
- // Filter out the util module, it's inspect function is special
- value.inspect !== exports.inspect &&
- // Also filter out any prototype objects using the circular check.
- !(value.constructor && value.constructor.prototype === value)) {
- var ret = value.inspect(recurseTimes, ctx);
- if (!isString(ret)) {
- ret = formatValue(ctx, ret, recurseTimes);
- }
- return ret;
- }
-
- // Primitive types cannot have properties
- var primitive = formatPrimitive(ctx, value);
- if (primitive) {
- return primitive;
- }
-
- // Look up the keys of the object.
- var keys = Object.keys(value);
- var visibleKeys = arrayToHash(keys);
-
- if (ctx.showHidden) {
- keys = Object.getOwnPropertyNames(value);
- }
-
- // IE doesn't make error fields non-enumerable
- // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
- if (isError(value)
- && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
- return formatError(value);
- }
-
- // Some type of object without properties can be shortcutted.
- if (keys.length === 0) {
- if (isFunction(value)) {
- var name = value.name ? ': ' + value.name : '';
- return ctx.stylize('[Function' + name + ']', 'special');
- }
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
- }
- if (isDate(value)) {
- return ctx.stylize(Date.prototype.toString.call(value), 'date');
- }
- if (isError(value)) {
- return formatError(value);
- }
- }
-
- var base = '', array = false, braces = ['{', '}'];
-
- // Make Array say that they are Array
- if (isArray(value)) {
- array = true;
- braces = ['[', ']'];
- }
-
- // Make functions say that they are functions
- if (isFunction(value)) {
- var n = value.name ? ': ' + value.name : '';
- base = ' [Function' + n + ']';
- }
-
- // Make RegExps say that they are RegExps
- if (isRegExp(value)) {
- base = ' ' + RegExp.prototype.toString.call(value);
- }
-
- // Make dates with properties first say the date
- if (isDate(value)) {
- base = ' ' + Date.prototype.toUTCString.call(value);
- }
-
- // Make error with message first say the error
- if (isError(value)) {
- base = ' ' + formatError(value);
- }
-
- if (keys.length === 0 && (!array || value.length == 0)) {
- return braces[0] + base + braces[1];
- }
-
- if (recurseTimes < 0) {
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
- } else {
- return ctx.stylize('[Object]', 'special');
- }
- }
-
- ctx.seen.push(value);
-
- var output;
- if (array) {
- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
- } else {
- output = keys.map(function(key) {
- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
- });
- }
-
- ctx.seen.pop();
-
- return reduceToSingleString(output, base, braces);
-}
-
-
-function formatPrimitive(ctx, value) {
- if (isUndefined(value))
- return ctx.stylize('undefined', 'undefined');
- if (isString(value)) {
- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
- .replace(/'/g, "\\'")
- .replace(/\\"/g, '"') + '\'';
- return ctx.stylize(simple, 'string');
- }
- if (isNumber(value))
- return ctx.stylize('' + value, 'number');
- if (isBoolean(value))
- return ctx.stylize('' + value, 'boolean');
- // For some reason typeof null is "object", so special case here.
- if (isNull(value))
- return ctx.stylize('null', 'null');
-}
-
-
-function formatError(value) {
- return '[' + Error.prototype.toString.call(value) + ']';
-}
-
-
-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
- var output = [];
- for (var i = 0, l = value.length; i < l; ++i) {
- if (hasOwnProperty(value, String(i))) {
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
- String(i), true));
- } else {
- output.push('');
- }
- }
- keys.forEach(function(key) {
- if (!key.match(/^\d+$/)) {
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
- key, true));
- }
- });
- return output;
-}
-
-
-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
- var name, str, desc;
- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
- if (desc.get) {
- if (desc.set) {
- str = ctx.stylize('[Getter/Setter]', 'special');
- } else {
- str = ctx.stylize('[Getter]', 'special');
- }
- } else {
- if (desc.set) {
- str = ctx.stylize('[Setter]', 'special');
- }
- }
- if (!hasOwnProperty(visibleKeys, key)) {
- name = '[' + key + ']';
- }
- if (!str) {
- if (ctx.seen.indexOf(desc.value) < 0) {
- if (isNull(recurseTimes)) {
- str = formatValue(ctx, desc.value, null);
- } else {
- str = formatValue(ctx, desc.value, recurseTimes - 1);
- }
- if (str.indexOf('\n') > -1) {
- if (array) {
- str = str.split('\n').map(function(line) {
- return ' ' + line;
- }).join('\n').substr(2);
- } else {
- str = '\n' + str.split('\n').map(function(line) {
- return ' ' + line;
- }).join('\n');
- }
- }
- } else {
- str = ctx.stylize('[Circular]', 'special');
- }
- }
- if (isUndefined(name)) {
- if (array && key.match(/^\d+$/)) {
- return str;
- }
- name = JSON.stringify('' + key);
- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
- name = name.substr(1, name.length - 2);
- name = ctx.stylize(name, 'name');
- } else {
- name = name.replace(/'/g, "\\'")
- .replace(/\\"/g, '"')
- .replace(/(^"|"$)/g, "'");
- name = ctx.stylize(name, 'string');
- }
- }
-
- return name + ': ' + str;
-}
-
-
-function reduceToSingleString(output, base, braces) {
- var numLinesEst = 0;
- var length = output.reduce(function(prev, cur) {
- numLinesEst++;
- if (cur.indexOf('\n') >= 0) numLinesEst++;
- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
- }, 0);
-
- if (length > 60) {
- return braces[0] +
- (base === '' ? '' : base + '\n ') +
- ' ' +
- output.join(',\n ') +
- ' ' +
- braces[1];
- }
-
- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
-}
-
-
-// NOTE: These type checking functions intentionally don't use `instanceof`
-// because it is fragile and can be easily faked with `Object.create()`.
-function isArray(ar) {
- return Array.isArray(ar);
-}
-exports.isArray = isArray;
-
-function isBoolean(arg) {
- return typeof arg === 'boolean';
-}
-exports.isBoolean = isBoolean;
-
-function isNull(arg) {
- return arg === null;
-}
-exports.isNull = isNull;
-
-function isNullOrUndefined(arg) {
- return arg == null;
-}
-exports.isNullOrUndefined = isNullOrUndefined;
-
-function isNumber(arg) {
- return typeof arg === 'number';
-}
-exports.isNumber = isNumber;
-
-function isString(arg) {
- return typeof arg === 'string';
-}
-exports.isString = isString;
-
-function isSymbol(arg) {
- return typeof arg === 'symbol';
-}
-exports.isSymbol = isSymbol;
-
-function isUndefined(arg) {
- return arg === void 0;
-}
-exports.isUndefined = isUndefined;
-
-function isRegExp(re) {
- return isObject(re) && objectToString(re) === '[object RegExp]';
-}
-exports.isRegExp = isRegExp;
-
-function isObject(arg) {
- return typeof arg === 'object' && arg !== null;
-}
-exports.isObject = isObject;
-
-function isDate(d) {
- return isObject(d) && objectToString(d) === '[object Date]';
-}
-exports.isDate = isDate;
-
-function isError(e) {
- return isObject(e) &&
- (objectToString(e) === '[object Error]' || e instanceof Error);
-}
-exports.isError = isError;
-
-function isFunction(arg) {
- return typeof arg === 'function';
-}
-exports.isFunction = isFunction;
-
-function isPrimitive(arg) {
- return arg === null ||
- typeof arg === 'boolean' ||
- typeof arg === 'number' ||
- typeof arg === 'string' ||
- typeof arg === 'symbol' || // ES6 symbol
- typeof arg === 'undefined';
-}
-exports.isPrimitive = isPrimitive;
-
-exports.isBuffer = require('./support/isBuffer');
-
-function objectToString(o) {
- return Object.prototype.toString.call(o);
-}
-
-
-function pad(n) {
- return n < 10 ? '0' + n.toString(10) : n.toString(10);
-}
-
-
-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
- 'Oct', 'Nov', 'Dec'];
-
-// 26 Feb 16:19:34
-function timestamp() {
- var d = new Date();
- var time = [pad(d.getHours()),
- pad(d.getMinutes()),
- pad(d.getSeconds())].join(':');
- return [d.getDate(), months[d.getMonth()], time].join(' ');
-}
-
-
-// log is just a thin wrapper to console.log that prepends a timestamp
-exports.log = function() {
- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
-};
-
-
-/**
- * Inherit the prototype methods from one constructor into another.
- *
- * The Function.prototype.inherits from lang.js rewritten as a standalone
- * function (not on Function.prototype). NOTE: If this file is to be loaded
- * during bootstrapping this function needs to be rewritten using some native
- * functions as prototype setup using normal JavaScript does not work as
- * expected during bootstrapping (see mirror.js in r114903).
- *
- * @param {function} ctor Constructor function which needs to inherit the
- * prototype.
- * @param {function} superCtor Constructor function to inherit prototype from.
- */
-exports.inherits = require('inherits');
-
-exports._extend = function(origin, add) {
- // Don't do anything if add isn't an object
- if (!add || !isObject(add)) return origin;
-
- var keys = Object.keys(add);
- var i = keys.length;
- while (i--) {
- origin[keys[i]] = add[keys[i]];
- }
- return origin;
-};
-
-function hasOwnProperty(obj, prop) {
- return Object.prototype.hasOwnProperty.call(obj, prop);
-}
-
-},{"./support/isBuffer":28,"__browserify_process":27,"inherits":25}],30:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-d
-(function() {
- exports.transform = function(x, options) {
- return x.icedTransform(options);
- };
-
- exports.runtime = require('iced-runtime');
-
-}).call(this);
-
-},{"iced-runtime":33}],31:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-b
-(function() {
- module.exports = {
- k: "__iced_k",
- k_noop: "__iced_k_noop",
- param: "__iced_p_",
- ns: "iced",
- runtime: "runtime",
- Deferrals: "Deferrals",
- deferrals: "__iced_deferrals",
- fulfill: "_fulfill",
- b_while: "_break",
- t_while: "_while",
- c_while: "_continue",
- n_while: "_next",
- n_arg: "__iced_next_arg",
- defer_method: "defer",
- slot: "__slot",
- assign_fn: "assign_fn",
- autocb: "autocb",
- retslot: "ret",
- trace: "__iced_trace",
- passed_deferral: "__iced_passed_deferral",
- findDeferral: "findDeferral",
- lineno: "lineno",
- parent: "parent",
- filename: "filename",
- funcname: "funcname",
- catchExceptions: 'catchExceptions',
- runtime_modes: ["node", "inline", "window", "none", "browserify"],
- trampoline: "trampoline",
- context: "context"
- };
-
-}).call(this);
-
-},{}],32:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-b
-(function() {
- var C, Pipeliner, iced, __iced_k, __iced_k_noop, _iand, _ior, _timeout,
- __slice = [].slice;
-
- __iced_k = __iced_k_noop = function() {};
-
- C = require('./const');
-
- exports.iced = iced = require('./runtime');
-
- _timeout = function(cb, t, res, tmp) {
- var arr, rv, which, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- rv = new iced.Rendezvous;
- tmp[0] = rv.id(true).defer({
- assign_fn: (function(_this) {
- return function() {
- return function() {
- return arr = __slice.call(arguments, 0);
- };
- };
- })(this)(),
- lineno: 20,
- context: __iced_deferrals
- });
- setTimeout(rv.id(false).defer({
- lineno: 21,
- context: __iced_deferrals
- }), t);
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/iced/iced-runtime/src/library.iced"
- });
- rv.wait(__iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return which = arguments[0];
- };
- })(),
- lineno: 22
- }));
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- if (res) {
- res[0] = which;
- }
- return cb.apply(null, arr);
- };
- })(this));
- };
-
- exports.timeout = function(cb, t, res) {
- var tmp;
- tmp = [];
- _timeout(cb, t, res, tmp);
- return tmp[0];
- };
-
- _iand = function(cb, res, tmp) {
- var ok, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/iced/iced-runtime/src/library.iced"
- });
- tmp[0] = __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return ok = arguments[0];
- };
- })(),
- lineno: 39
- });
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- if (!ok) {
- res[0] = false;
- }
- return cb();
- };
- })(this));
- };
-
- exports.iand = function(cb, res) {
- var tmp;
- tmp = [];
- _iand(cb, res, tmp);
- return tmp[0];
- };
-
- _ior = function(cb, res, tmp) {
- var ok, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/iced/iced-runtime/src/library.iced"
- });
- tmp[0] = __iced_deferrals.defer({
- assign_fn: (function() {
- return function() {
- return ok = arguments[0];
- };
- })(),
- lineno: 58
- });
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- if (ok) {
- res[0] = true;
- }
- return cb();
- };
- })(this));
- };
-
- exports.ior = function(cb, res) {
- var tmp;
- tmp = [];
- _ior(cb, res, tmp);
- return tmp[0];
- };
-
- exports.Pipeliner = Pipeliner = (function() {
- function Pipeliner(window, delay) {
- this.window = window || 1;
- this.delay = delay || 0;
- this.queue = [];
- this.n_out = 0;
- this.cb = null;
- this[C.deferrals] = this;
- this["defer"] = this._defer;
- }
-
- Pipeliner.prototype.waitInQueue = function(cb) {
- var ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- (function(_this) {
- return (function(__iced_k) {
- var _results, _while;
- _results = [];
- _while = function(__iced_k) {
- var _break, _continue, _next;
- _break = function() {
- return __iced_k(_results);
- };
- _continue = function() {
- return iced.trampoline(function() {
- return _while(__iced_k);
- });
- };
- _next = function(__iced_next_arg) {
- _results.push(__iced_next_arg);
- return _continue();
- };
- if (!(_this.n_out >= _this.window)) {
- return _break();
- } else {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/iced/iced-runtime/src/library.iced",
- funcname: "Pipeliner.waitInQueue"
- });
- _this.cb = __iced_deferrals.defer({
- lineno: 100
- });
- __iced_deferrals._fulfill();
- })(_next);
- }
- };
- _while(__iced_k);
- });
- })(this)((function(_this) {
- return function() {
- _this.n_out++;
- (function(__iced_k) {
- if (_this.delay) {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/iced/iced-runtime/src/library.iced",
- funcname: "Pipeliner.waitInQueue"
- });
- setTimeout(__iced_deferrals.defer({
- lineno: 108
- }), _this.delay);
- __iced_deferrals._fulfill();
- })(__iced_k);
- } else {
- return __iced_k();
- }
- })(function() {
- return cb();
- });
- };
- })(this));
- };
-
- Pipeliner.prototype.__defer = function(out, deferArgs) {
- var tmp, voidCb, ___iced_passed_deferral, __iced_deferrals, __iced_k;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- (function(_this) {
- return (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/iced/iced-runtime/src/library.iced",
- funcname: "Pipeliner.__defer"
- });
- voidCb = __iced_deferrals.defer({
- lineno: 122
- });
- out[0] = function() {
- var args, _ref;
- args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
- if ((_ref = deferArgs.assign_fn) != null) {
- _ref.apply(null, args);
- }
- return voidCb();
- };
- __iced_deferrals._fulfill();
- });
- })(this)((function(_this) {
- return function() {
- _this.n_out--;
- if (_this.cb) {
- tmp = _this.cb;
- _this.cb = null;
- return tmp();
- }
- };
- })(this));
- };
-
- Pipeliner.prototype._defer = function(deferArgs) {
- var tmp;
- tmp = [];
- this.__defer(tmp, deferArgs);
- return tmp[0];
- };
-
- Pipeliner.prototype.flush = function(autocb) {
- var ___iced_passed_deferral, __iced_k, _results, _while;
- __iced_k = autocb;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- _results = [];
- _while = (function(_this) {
- var __iced_deferrals;
- return function(__iced_k) {
- var _break, _continue, _next;
- _break = function() {
- return __iced_k(_results);
- };
- _continue = function() {
- return iced.trampoline(function() {
- return _while(__iced_k);
- });
- };
- _next = function(__iced_next_arg) {
- _results.push(__iced_next_arg);
- return _continue();
- };
- if (!_this.n_out) {
- return _break();
- } else {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "/Users/max/src/iced/iced-runtime/src/library.iced",
- funcname: "Pipeliner.flush"
- });
- _this.cb = __iced_deferrals.defer({
- lineno: 151
- });
- __iced_deferrals._fulfill();
- })(_next);
- }
- };
- })(this);
- _while(__iced_k);
- };
-
- return Pipeliner;
-
- })();
-
-}).call(this);
-
-},{"./const":31,"./runtime":34}],33:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.7.1-b
-(function() {
- var k, mod, mods, v, _i, _len;
-
- exports["const"] = require('./const');
-
- mods = [require('./runtime'), require('./library')];
-
- for (_i = 0, _len = mods.length; _i < _len; _i++) {
- mod = mods[_i];
- for (k in mod) {
- v = mod[k];
- exports[k] = v;
- }
- }
-
-}).call(this);
-
-},{"./const":31,"./library":32,"./runtime":34}],34:[function(require,module,exports){
-var process=require("__browserify_process");// Generated by IcedCoffeeScript 1.7.1-b
-(function() {
- var C, Deferrals, Rendezvous, exceptionHandler, findDeferral, make_defer_return, stackWalk, tick_counter, trampoline, warn, __active_trace, __c, _trace_to_string,
- __slice = [].slice;
-
- C = require('./const');
-
- make_defer_return = function(obj, defer_args, id, trace_template, multi) {
- var k, ret, trace, v;
- trace = {};
- for (k in trace_template) {
- v = trace_template[k];
- trace[k] = v;
- }
- trace[C.lineno] = defer_args != null ? defer_args[C.lineno] : void 0;
- ret = function() {
- var inner_args, o, _ref;
- inner_args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
- if (defer_args != null) {
- if ((_ref = defer_args.assign_fn) != null) {
- _ref.apply(null, inner_args);
- }
- }
- if (obj) {
- o = obj;
- if (!multi) {
- obj = null;
- }
- return o._fulfill(id, trace);
- } else {
- return warn("overused deferral at " + (intern._trace_to_string(trace)));
- }
- };
- ret[C.trace] = trace;
- return ret;
- };
-
- __c = 0;
-
- tick_counter = function(mod) {
- __c++;
- if ((__c % mod) === 0) {
- __c = 0;
- return true;
- } else {
- return false;
- }
- };
-
- __active_trace = null;
-
- _trace_to_string = function(tr) {
- var fn;
- fn = tr[C.funcname] || "";
- return "" + fn + " (" + tr[C.filename] + ":" + (tr[C.lineno] + 1) + ")";
- };
-
- warn = function(m) {
- return typeof console !== "undefined" && console !== null ? console.error("ICED warning: " + m) : void 0;
- };
-
- exports.trampoline = trampoline = function(fn) {
- if (!tick_counter(500)) {
- return fn();
- } else if (typeof process !== "undefined" && process !== null) {
- return process.nextTick(fn);
- } else {
- return setTimeout(fn);
- }
- };
-
- exports.Deferrals = Deferrals = (function() {
- function Deferrals(k, trace) {
- this.trace = trace;
- this.continuation = k;
- this.count = 1;
- this.ret = null;
- }
-
- Deferrals.prototype._call = function(trace) {
- var c;
- if (this.continuation) {
- __active_trace = trace;
- c = this.continuation;
- this.continuation = null;
- return c(this.ret);
- } else {
- return warn("Entered dead await at " + (_trace_to_string(trace)));
- }
- };
-
- Deferrals.prototype._fulfill = function(id, trace) {
- if (--this.count > 0) {
-
- } else {
- return trampoline(((function(_this) {
- return function() {
- return _this._call(trace);
- };
- })(this)));
- }
- };
-
- Deferrals.prototype.defer = function(args) {
- var self;
- this.count++;
- self = this;
- return make_defer_return(self, args, null, this.trace);
- };
-
- return Deferrals;
-
- })();
-
- exports.findDeferral = findDeferral = function(args) {
- var a, _i, _len;
- for (_i = 0, _len = args.length; _i < _len; _i++) {
- a = args[_i];
- if (a != null ? a[C.trace] : void 0) {
- return a;
- }
- }
- return null;
- };
-
- exports.Rendezvous = Rendezvous = (function() {
- var RvId;
-
- function Rendezvous() {
- this.completed = [];
- this.waiters = [];
- this.defer_id = 0;
- }
-
- RvId = (function() {
- function RvId(rv, id, multi) {
- this.rv = rv;
- this.id = id;
- this.multi = multi;
- }
-
- RvId.prototype.defer = function(defer_args) {
- return this.rv._defer_with_id(this.id, defer_args, this.multi);
- };
-
- return RvId;
-
- })();
-
- Rendezvous.prototype.wait = function(cb) {
- var x;
- if (this.completed.length) {
- x = this.completed.shift();
- return cb(x);
- } else {
- return this.waiters.push(cb);
- }
- };
-
- Rendezvous.prototype.defer = function(defer_args) {
- var id;
- id = this.defer_id++;
- return this._defer_with_id(id, defer_args);
- };
-
- Rendezvous.prototype.id = function(i, multi) {
- multi = !!multi;
- return new RvId(this, i, multi);
- };
-
- Rendezvous.prototype._fulfill = function(id, trace) {
- var cb;
- if (this.waiters.length) {
- cb = this.waiters.shift();
- return cb(id);
- } else {
- return this.completed.push(id);
- }
- };
-
- Rendezvous.prototype._defer_with_id = function(id, defer_args, multi) {
- this.count++;
- return make_defer_return(this, defer_args, id, {}, multi);
- };
-
- return Rendezvous;
-
- })();
-
- exports.stackWalk = stackWalk = function(cb) {
- var line, ret, tr, _ref;
- ret = [];
- tr = cb ? cb[C.trace] : __active_trace;
- while (tr) {
- line = " at " + (_trace_to_string(tr));
- ret.push(line);
- tr = tr != null ? (_ref = tr[C.parent]) != null ? _ref[C.trace] : void 0 : void 0;
- }
- return ret;
- };
-
- exports.exceptionHandler = exceptionHandler = function(err, logger) {
- var stack;
- if (!logger) {
- logger = console.error;
- }
- logger(err.stack);
- stack = stackWalk();
- if (stack.length) {
- logger("Iced 'stack' trace (w/ real line numbers):");
- return logger(stack.join("\n"));
- }
- };
-
- exports.catchExceptions = function(logger) {
- return typeof process !== "undefined" && process !== null ? process.on('uncaughtException', function(err) {
- exceptionHandler(err, logger);
- return process.exit(1);
- }) : void 0;
- };
-
-}).call(this);
-
-},{"./const":31,"__browserify_process":27}],35:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.6.3-j
-(function() {
- var BaseError, Canceler, EscErr, EscOk, c_to_camel, ipush, make_error_klass, make_errors, make_esc, to_lower, util,
- __slice = [].slice;
-
- util = require('util');
-
- exports.BaseError = BaseError = function(msg, constructor) {
- Error.captureStackTrace(this, this.constructor);
- return this.message = msg || 'Error';
- };
-
- util.inherits(BaseError, Error);
-
- BaseError.prototype.name = "BaseError";
-
- to_lower = function(s) {
- return s[0].toUpperCase() + s.slice(1).toLowerCase();
- };
-
- c_to_camel = function(s) {
- var p;
- return ((function() {
- var _i, _len, _ref, _results;
- _ref = s.split(/_/);
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- p = _ref[_i];
- _results.push(to_lower(p));
- }
- return _results;
- })()).join('');
- };
-
- make_error_klass = function(k, code, default_msg) {
- var ctor;
- ctor = function(msg) {
- BaseError.call(this, msg || default_msg, this.constructor);
- this.istack = [];
- this.code = code;
- return this;
- };
- util.inherits(ctor, BaseError);
- ctor.prototype.name = k;
- ctor.prototype.inspect = function() {
- return "[" + k + ": " + this.message + " (code " + this.code + ")]";
- };
- return ctor;
- };
-
- exports.make_errors = make_errors = function(d) {
- var enam, errno, k, msg, out, val;
- out = {
- msg: {},
- name: {},
- code: {}
- };
- d.OK = "Success";
- errno = 100;
- for (k in d) {
- msg = d[k];
- if (k !== "OK") {
- enam = (c_to_camel(k)) + "Error";
- val = errno++;
- out[enam] = make_error_klass(enam, val, msg);
- } else {
- val = 0;
- }
- out[k] = val;
- out.msg[k] = out.msg[val] = msg;
- out.name[k] = out.name[val] = k;
- out.code[k] = val;
- }
- return out;
- };
-
- ipush = function(e, msg) {
- if (msg != null) {
- if (e.istack == null) {
- e.istack = [];
- }
- return e.istack.push(msg);
- }
- };
-
- exports.make_esc = make_esc = function(gcb, where) {
- return function(lcb) {
- return function() {
- var args, err;
- err = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
- if (err == null) {
- return lcb.apply(null, args);
- } else if (!gcb.__esc) {
- gcb.__esc = true;
- ipush(err, where);
- return gcb(err);
- }
- };
- };
- };
-
- exports.EscOk = EscOk = (function() {
- function EscOk(gcb, where) {
- this.gcb = gcb;
- this.where = where;
- }
-
- EscOk.prototype.bailout = function() {
- var t;
- if (this.gcb) {
- t = this.gcb;
- this.gcb = null;
- return t(false);
- }
- };
-
- EscOk.prototype.check_ok = function(cb) {
- return (function(_this) {
- return function() {
- var args, ok;
- ok = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
- if (!ok) {
- return _this.bailout();
- } else {
- return cb.apply(null, args);
- }
- };
- })(this);
- };
-
- EscOk.prototype.check_err = function(cb) {
- return (function(_this) {
- return function() {
- var args, err;
- err = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
- if (err != null) {
- ipush(err, _this.where);
- return _this.bailout();
- } else {
- return cb.apply(null, args);
- }
- };
- })(this);
- };
-
- EscOk.prototype.check_non_null = function(cb) {
- return (function(_this) {
- return function() {
- var args;
- args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
- if (args[0] == null) {
- return _this.bailout();
- } else {
- return cb.apply(null, args);
- }
- };
- })(this);
- };
-
- return EscOk;
-
- })();
-
- exports.EscErr = EscErr = (function() {
- function EscErr(gcb, where) {
- this.gcb = gcb;
- this.where = where;
- }
-
- EscErr.prototype.finish = function(err) {
- var t;
- if (this.gcb) {
- t = this.gcb;
- this.gcb = null;
- return t(err);
- }
- };
-
- EscErr.prototype.check_ok = function(cb, eclass, emsg) {
- if (eclass == null) {
- eclass = Error;
- }
- if (emsg == null) {
- emsg = null;
- }
- return function() {
- var args, err, ok;
- ok = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
- if (!ok) {
- err = new eclass(emsg);
- ipush(err, this.where);
- return this.finish(err);
- } else {
- return cb.apply(null, args);
- }
- };
- };
-
- EscErr.prototype.check_err = function(cb) {
- return function() {
- var args, err;
- err = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
- if (err != null) {
- ipush(err, this.where);
- return this.finish(err);
- } else {
- return cb.apply(null, args);
- }
- };
- };
-
- return EscErr;
-
- })();
-
- exports.Canceler = Canceler = (function() {
- function Canceler(klass) {
- this.klass = klass != null ? klass : Error;
- this._canceled = false;
- }
-
- Canceler.prototype.is_canceled = function() {
- return this._canceled;
- };
-
- Canceler.prototype.is_ok = function() {
- return !this._canceled;
- };
-
- Canceler.prototype.cancel = function() {
- return this._canceled = true;
- };
-
- Canceler.prototype.err = function() {
- if (this._canceled) {
- return new this.klass("Aborted");
- } else {
- return null;
- }
- };
-
- return Canceler;
-
- })();
-
- exports.chain = function(cb, f) {
- return function() {
- var args;
- args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
- return f(function() {
- return cb.apply(null, args);
- });
- };
- };
-
- exports.chain_err = function(cb, f) {
- return function() {
- var args0;
- args0 = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
- return f(function() {
- var args1;
- args1 = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
- return cb.apply(null, ((args1[0] != null) && !(args0[0] != null) ? args1 : args0));
- });
- };
- };
-
-}).call(this);
-
-//# sourceMappingURL=index.map
-
-},{"util":29}],36:[function(require,module,exports){
-module.exports=require(31)
-},{}],37:[function(require,module,exports){
-arguments[4][32][0].apply(exports,arguments)
-},{"./const":36,"./runtime":39}],38:[function(require,module,exports){
-arguments[4][33][0].apply(exports,arguments)
-},{"./const":36,"./library":37,"./runtime":39}],39:[function(require,module,exports){
-module.exports=require(34)
-},{"./const":36,"__browserify_process":27}],40:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.6.3-g
-(function() {
- var Generator, iced, __iced_k, __iced_k_noop;
-
- iced = require('iced-coffee-script/lib/coffee-script/iced').runtime;
- __iced_k = __iced_k_noop = function() {};
-
- Generator = Generator = (function() {
- function Generator(opts) {
- opts = opts || {};
- this.loop_delay = opts.loop_delay || 10;
- this.work_min = opts.work_min || 1;
- this.auto_stop_bits = opts.auto_stop_bits || 4096;
- this.max_bits_per_delta = opts.max_bits_per_delta || 4;
- this.entropies = [];
- this.running = true;
- this.timer_race_loop();
- }
-
- Generator.prototype.generate = function(bits_wanted, cb) {
- var e, harvested_bits, res, ___iced_passed_deferral, __iced_deferrals, __iced_k,
- _this = this;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- harvested_bits = 0;
- res = [];
- (function(__iced_k) {
- var _results, _while;
- _results = [];
- _while = function(__iced_k) {
- var _break, _continue, _next;
- _break = function() {
- return __iced_k(_results);
- };
- _continue = function() {
- return iced.trampoline(function() {
- return _while(__iced_k);
- });
- };
- _next = function(__iced_next_arg) {
- _results.push(__iced_next_arg);
- return _continue();
- };
- if (!(harvested_bits < bits_wanted)) {
- return _break();
- } else {
- (function(__iced_k) {
- if (_this.entropies.length) {
- e = _this.entropies.splice(0, 1)[0];
- harvested_bits += e[1];
- return __iced_k(res.push(e[0]));
- } else {
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "src/generator.iced",
- funcname: "Generator.generate"
- });
- setTimeout(__iced_deferrals.defer({
- lineno: 22
- }), _this.loop_delay);
- __iced_deferrals._fulfill();
- })(__iced_k);
- }
- })(_next);
- }
- };
- _while(__iced_k);
- })(function() {
- return cb(res);
- });
- };
-
- Generator.prototype.stop = function() {
- return this.running = false;
- };
-
- Generator.prototype.resume = function() {
- return this.running = true;
- };
-
- Generator.prototype.reset = function() {
- this.entropies = [];
- return this.total_bits = 0;
- };
-
- Generator.prototype.count_unused_bits = function() {
- var bits, e, _i, _len, _ref;
- bits = 0;
- _ref = this.entropies;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- e = _ref[_i];
- bits += e[1];
- }
- return bits;
- };
-
- Generator.prototype.timer_race_loop = function() {
- var count, delta, entropy, v, ___iced_passed_deferral, __iced_deferrals, __iced_k, _results, _while,
- _this = this;
- __iced_k = __iced_k_noop;
- ___iced_passed_deferral = iced.findDeferral(arguments);
- this._last_count = null;
- _results = [];
- _while = function(__iced_k) {
- var _break, _continue, _next;
- _break = function() {
- return __iced_k(_results);
- };
- _continue = function() {
- return iced.trampoline(function() {
- return _while(__iced_k);
- });
- };
- _next = function(__iced_next_arg) {
- _results.push(__iced_next_arg);
- return _continue();
- };
- if (!true) {
- return _break();
- } else {
- if (_this.running && (_this.count_unused_bits() < _this.auto_stop_bits)) {
- count = _this.millisecond_count();
- if ((_this._last_count != null) && (delta = count - _this._last_count)) {
- entropy = Math.floor(_this.log_2(Math.abs(delta)));
- entropy = Math.min(_this.max_bits_per_delta, entropy);
- v = [delta, entropy];
- _this.entropies.push(v);
- }
- _this._last_count = count;
- }
- (function(__iced_k) {
- __iced_deferrals = new iced.Deferrals(__iced_k, {
- parent: ___iced_passed_deferral,
- filename: "src/generator.iced",
- funcname: "Generator.timer_race_loop"
- });
- setTimeout(__iced_deferrals.defer({
- lineno: 48
- }), _this.loop_delay);
- __iced_deferrals._fulfill();
- })(_next);
- }
- };
- _while(__iced_k);
- };
-
- Generator.prototype.log_2 = function(x) {
- return Math.log(x) / Math.LN2;
- };
-
- Generator.prototype.millisecond_count = function() {
- var d, i, x;
- d = Date.now();
- i = x = 0;
- while (Date.now() < d + this.work_min + 1) {
- i++;
- x = Math.sin(Math.sqrt(Math.log(i + x)));
- }
- return i;
- };
-
- return Generator;
-
- })();
-
- if (typeof window !== "undefined" && window !== null) {
- window.Generator = Generator;
- }
-
- if (typeof exports !== "undefined" && exports !== null) {
- exports.Generator = Generator;
- }
-
-}).call(this);
-
-},{"iced-coffee-script/lib/coffee-script/iced":30}],41:[function(require,module,exports){
-// Generated by IcedCoffeeScript 1.6.3-g
-(function() {
-
-
- exports.Generator = require('../lib/generator').Generator;
-
-}).call(this);
-
-},{"../lib/generator":40}]},{},[10])
-(10)
-});
-;
\ No newline at end of file
diff --git a/public/views/download.html b/public/views/download.html
new file mode 100644
index 0000000..45198a1
--- /dev/null
+++ b/public/views/download.html
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/public/views/upload.html b/public/views/upload.html
new file mode 100644
index 0000000..a1de4c4
--- /dev/null
+++ b/public/views/upload.html
@@ -0,0 +1,29 @@
+
+
+
\ No newline at end of file
diff --git a/app.js b/server.js
similarity index 97%
rename from app.js
rename to server.js
index b89e3f8..cb98b96 100644
--- a/app.js
+++ b/server.js
@@ -14,7 +14,7 @@ var db_host = process.env.OPENSHIFT_MONGODB_DB_HOST || '127.0.0.1';
var db_port = process.env.OPENSHIFT_MONGODB_DB_PORT || 27017;
var db_name = process.env.OPENSHIFT_APP_NAME || 'sendshit';
var db_user = process.env.OPENSHIFT_MONGODB_DB_USERNAME || 'admin';
-var db_pass = process.env.OPENSHIFT_MONGODB_DB_PASSWORD || null;
+var db_pass = process.env.OPENSHIFT_MONGODB_DB_PASSWORD || '123456';
var db = new mongo.Db(db_name, new mongo.Server(db_host, db_port), { safe : false });
var gfs = new Grid(db, mongo);