132 lines
963 KiB
JavaScript
132 lines
963 KiB
JavaScript
|
/**
|
|||
|
* CyberChef - The Cyber Swiss Army Knife
|
|||
|
*
|
|||
|
* @copyright Crown Copyright 2016
|
|||
|
* @license Apache-2.0
|
|||
|
*
|
|||
|
* Copyright 2016 Crown Copyright
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1504)}({0:function(t,e,r){"use strict";var n=r(15),o=r.n(n),i=r(10),l=r(7),a=r(19),h=r(18);function c(t,e,r,n,o,i,l){try{var a=t[i](l),h=a.value}catch(t){return void r(t)}a.done?e(h):Promise.resolve(h).then(n,o)}function u(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function l(t){c(i,n,o,l,a,"next",t)}function a(t){c(i,n,o,l,a,"throw",t)}l(void 0)})}}function f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}
|
|||
|
/**
|
|||
|
* @author n1474335 [n1474335@gmail.com]
|
|||
|
* @copyright Crown Copyright 2016
|
|||
|
* @license Apache-2.0
|
|||
|
*/
|
|||
|
var s=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r,n;return e=t,r=null,n=[{key:"chr",value:function(t){if(t>65535){t-=65536;var e=String.fromCharCode(t>>>10&1023|55296);return t=56320|1023&t,e+String.fromCharCode(t)}return String.fromCharCode(t)}},{key:"ord",value:function(t){if(2===t.length){var e=t.charCodeAt(0),r=t.charCodeAt(1);if(e>=55296&&e<56320&&r>=56320&&r<57344)return 1024*(e-55296)+r-56320+65536}return t.charCodeAt(0)}},{key:"padBytesRight",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new Array(e);return n.fill(r),Array.prototype.map.call(t,function(t,e){n[e]=t}),n}},{key:"truncate",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return t.length>e&&(t=t.slice(0,e-r.length)+r),t}},{key:"hex",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(e="string"==typeof e?t.ord(e):e).toString(16).padStart(r,"0")}},{key:"bin",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return(e="string"==typeof e?t.ord(e):e).toString(2).padStart(r,"0")}},{key:"printable",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"object"==typeof window&&window.app&&!window.app.options.treatAsUtf8&&(e=t.byteArrayToChars(t.strToByteArray(e)));return e=e.replace(/[\0-\x08\x0B-\x0C\x0E-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u
|
|||
|
/**
|
|||
|
* @author n1474335 [n1474335@gmail.com]
|
|||
|
* @copyright Crown Copyright 2016
|
|||
|
* @license Apache-2.0
|
|||
|
*/
|
|||
|
var a=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name="",this.type="",this._value=null,this.disabled=!1,this.hint="",this.rows=0,this.toggleValues=[],this.target=null,this.defaultIndex=0,e&&this._parseConfig(e)}var e,r,n;return e=t,n=[{key:"prepare",value:function(t,e){var r;switch(e){case"binaryString":case"binaryShortString":case"editableOption":case"editableOptionShort":return o.a.parseEscapedChars(t);case"byteArray":return"string"==typeof t?(t=t.replace(/\s+/g,""),Object(i.c)(t)):t;case"number":if(r=parseFloat(t),isNaN(r))throw"Invalid ingredient value. Not a number: "+o.a.truncate(t.toString(),10);return r;default:return t}}}],(r=[{key:"_parseConfig",value:function(t){this.name=t.name,this.type=t.type,this.defaultValue=t.value,this.disabled=!!t.disabled,this.hint=t.hint||!1,this.rows=t.rows||!1,this.toggleValues=t.toggleValues,this.target=void 0!==t.target?t.target:null,this.defaultIndex=void 0!==t.defaultIndex?t.defaultIndex:0}},{key:"config",get:function(){return this._value}},{key:"value",set:function(e){this._value=t.prepare(e,this.type)},get:function(){return this._value}}])&&l(e.prototype,r),n&&l(e,n),t}();function h(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}
|
|||
|
/**
|
|||
|
* @author n1474335 [n1474335@gmail.com]
|
|||
|
* @copyright Crown Copyright 2016
|
|||
|
* @license Apache-2.0
|
|||
|
*/
|
|||
|
var c=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._inputType=-1,this._outputType=-1,this._presentType=-1,this._breakpoint=!1,this._disabled=!1,this._flowControl=!1,this._manualBake=!1,this._ingList=[],this.name="",this.module="",this.description="",this.infoURL=null}var e,r,o;return e=t,(r=[{key:"run",value:function(t,e){return t}},{key:"highlight",value:function(t,e){return!1}},{key:"highlightReverse",value:function(t,e){return!1}},{key:"present",value:function(t,e){return t}},{key:"addIngredient",value:function(t){this._ingList.push(t)}},{key:"inputType",set:function(t){this._inputType=n.a.typeEnum(t)},get:function(){return n.a.enumLookup(this._inputType)}},{key:"outputType",set:function(t){this._outputType=n.a.typeEnum(t),this._presentType<0&&(this._presentType=this._outputType)},get:function(){return n.a.enumLookup(this._outputType)}},{key:"presentType",set:function(t){this._presentType=n.a.typeEnum(t)},get:function(){return n.a.enumLookup(this._presentType)}},{key:"args",set:function(t){var e=this;t.forEach(function(t){var r=new a(t);e.addIngredient(r)})},get:function(){return this._ingList.map(function(t){var e={name:t.name,type:t.type,value:t.defaultValue};return t.toggleValues&&(e.toggleValues=t.toggleValues),t.hint&&(e.hint=t.hint),t.rows&&(e.rows=t.rows),t.disabled&&(e.disabled=t.disabled),t.target&&(e.target=t.target),t.defaultIndex&&(e.defaultIndex=t.defaultIndex),e})}},{key:"config",get:function(){return{op:this.name,args:this._ingList.map(function(t){return t.config})}}},{key:"ingValues",set:function(t){var e=this;t.forEach(function(t,r){e._ingList[r].value=t})},get:function(){return this._ingList.map(function(t){return t.value})}},{key:"breakpoint",set:function(t){this._breakpoint=!!t},get:function(){return this._breakpoint}},{key:"disabled",set:function(t){this._disabled=!!t},get:function(){return this._disabled}},{key:"flowControl",get:function(){return this._flowControl},set:function(t){this._flowControl=!!t}},{key:"manualBake",get:function(){return this._manualBake},set:function(t){this._manualBake=!!t}}])&&h(e.prototype,r),o&&h(e,o),t}();e.a=c},10:function(t,e,r){"use strict";r.d(e,"c",function(){return o}),r.d(e,"b",function(){return i}),r.d(e,"a",function(){return l});var n=r(0);
|
|||
|
/**
|
|||
|
* Base64 functions.
|
|||
|
*
|
|||
|
* @author n1474335 [n1474335@gmail.com]
|
|||
|
* @copyright Crown Copyright 2016
|
|||
|
* @license Apache-2.0
|
|||
|
*/function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=";if(!t)return"";"string"==typeof t&&(t=n.a.strToByteArray(t)),e=n.a.expandAlphRange(e).join("");for(var r,o,i,l,a,h,c,u="",f=0;f<t.length;)l=(r=t[f++])>>2,a=(3&r)<<4|(o=t[f++])>>4,h=(15&o)<<2|(i=t[f++])>>6,c=63&i,isNaN(o)?h=c=64:isNaN(i)&&(c=64),u+=e.charAt(l)+e.charAt(a)+e.charAt(h)+e.charAt(c);return u}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"string",o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!t)return"string"===r?"":[];e=e||"A-Za-z0-9+/=",e=n.a.expandAlphRange(e).join("");var i,l,a,h,c,u,f=[],s=0;if(o){var p=new RegExp("[^"+e.replace(/[[\]\\\-^$]/g,"\\$&")+"]","g");t=t.replace(p,"")}for(;s<t.length;)i=e.indexOf(t.charAt(s++))<<2|(h=-1===(h=e.indexOf(t.charAt(s++)||"="))?64:h)>>4,l=(15&h)<<4|(c=-1===(c=e.indexOf(t.charAt(s++)||"="))?64:c)>>2,a=(3&c)<<6|(u=-1===(u=e.indexOf(t.charAt(s++)||"="))?64:u),f.push(i),64!==c&&f.push(l),64!==u&&f.push(a);return"string"===r?n.a.byteArrayToUtf8(f):f}var l=[{name:"Standard (RFC 4648): A-Za-z0-9+/=",value:"A-Za-z0-9+/="},{name:"URL safe (RFC 4648 §5): A-Za-z0-9-_",value:"A-Za-z0-9-_"},{name:"Filename safe: A-Za-z0-9+-=",value:"A-Za-z0-9+\\-="},{name:"itoa64: ./0-9A-Za-z=",value:"./0-9A-Za-z="},{name:"XML: A-Za-z0-9_.",value:"A-Za-z0-9_."},{name:"y64: A-Za-z0-9._-",value:"A-Za-z0-9._-"},{name:"z64: 0-9a-zA-Z+/=",value:"0-9a-zA-Z+/="},{name:"Radix-64 (RFC 4880): 0-9A-Za-z+/=",value:"0-9A-Za-z+/="},{name:"Uuencoding: [space]-_",value:" -_"},{name:"Xxencoding: +-0-9A-Za-z",value:"+\\-0-9A-Za-z"},{name:"BinHex: !-,-0-689@A-NP-VX-Z[`a-fh-mp-r",value:"!-,-0-689@A-NP-VX-Z[`a-fh-mp-r"},{name:"ROT13: N-ZA-Mn-za-m0-9+/=",value:"N-ZA-Mn-za-m0-9+/="},{name:"UNIX crypt: ./0-9A-Za-z",value:"./0-9A-Za-z"}]},113:function(t,e,r){var n={version:"1.8.0"};n[37]=function(){for(var t="\0\t\v\f\r
\b\n âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHIôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ",e=[],r={},n=0;n!=t.length;++n)65533!==t.charCodeAt(n)&&(r[t.charAt(n)]=n),e[n]=t.charAt(n);return{enc:r,dec:e}}(),n[500]=function(){for(var t="\0\t\v\f\r
\b\n âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHIôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ",e=[],r={},n=0;n!=t.length;++n)65533!==t.charCodeAt(n)&&(r[t.charAt(n)]=n),e[n]=t.charAt(n);return{enc:r,dec:e}}(),n[874]=function(){for(var t="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€<EFBFBD><EFBFBD><EFBFBD><EFBFBD>…<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>‘’“”•–—<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู<EFBFBD><EFBFBD><EFBFBD><EFBFBD>฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",e=[],r={},n=0;n!=t.length;++n)65533!==t.charCodeAt(n)&&(r[t.charAt(n)]=n),e[n]=t.charAt(n);return{enc:r,dec:e}}(),n[932]=function(){var t,e=[],r={},n=[];for(n[0]="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミム
|
|||
|
/**
|
|||
|
* Custom error type for handling Dish type errors.
|
|||
|
* i.e. where the Dish cannot be successfully translated between types
|
|||
|
*
|
|||
|
* @author n1474335 [n1474335@gmail.com]
|
|||
|
* @copyright Crown Copyright 2018
|
|||
|
* @license Apache-2.0
|
|||
|
*/var h=function(t){function e(){var t,r,i,a;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var h=arguments.length,c=new Array(h),u=0;u<h;u++)c[u]=arguments[u];return i=this,(r=!(a=(t=o(e)).call.apply(t,[this].concat(c)))||"object"!==n(a)&&"function"!=typeof a?l(i):a).type="DishError",Error.captureStackTrace&&Error.captureStackTrace(l(l(r)),e),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}(e,a(Error)),e}();e.a=h},1376:function(t,e,r){(function(e){!function(e,n){"use strict";if("undefined"==typeof cptable){var o=r(113);t.exports?t.exports=n(o):e.cptable=n(o)}else cptable=n(cptable)}(this,function(t){"use strict";var r={1200:"utf16le",1201:"utf16be",12000:"utf32le",12001:"utf32be",16969:"utf64le",20127:"ascii",65000:"utf7",65001:"utf8"},n=[874,1250,1251,1252,1253,1254,1255,1256,1e4],o=[932,936,949,950],i=[65001],l={},a={},h={},c={},u=function(t){return String.fromCharCode(t)},f=function(t){return t.charCodeAt(0)},s=void 0!==e;if(s){var p=1024,d=new e(p),g=function(r){var n=function(t){for(var r=new e(65536),n=0;n<65536;++n)r[n]=0;for(var o=Object.keys(t),i=o.length,l=0,a=o[l];l<i;++l)(a=o[l])&&(r[a.charCodeAt(0)]=t[a]);return r}(t[r].enc);return function(t,r){var o,i=t.length,l=0,a=0,h=0,c=0;if("string"==typeof t)for(o=new e(i),l=0;l<i;++l)o[l]=n[t.charCodeAt(l)];else if(e.isBuffer(t)){for(o=new e(2*i),a=0,l=0;l<i;++l)(h=t[l])<128?o[a++]=n[h]:h<224?(o[a++]=n[((31&h)<<6)+(63&t[l+1])],++l):h<240?(o[a++]=n[((15&h)<<12)+((63&t[l+1])<<6)+(63&t[l+2])],l+=2):(c=((7&h)<<18)+((63&t[l+1])<<12)+((63&t[l+2])<<6)+(63&t[l+3]),l+=3,c<65536?o[a++]=n[c]:(c-=65536,o[a++]=n[55296+(c>>10&1023)],o[a++]=n[56320+(1023&c)]));o=o.slice(0,a)}else for(o=new e(i),l=0;l<i;++l)o[l]=n[t[l].charCodeAt(0)];return r&&"buf"!==r?"arr"!==r?o.toString("binary"):[].slice.call(o):o}},A=function(r){var n=t[r].dec,o=new e(131072),i=0,l="";for(i=0;i<n.length;++i)if(l=n[i]){var a=l.charCodeAt(0);o[2*i]=255&a,o[2*i+1]=a>>8}return function(t){var r=t.length,n=0,i=0;if(2*r>p&&(d=new e(p=2*r)),e.isBuffer(t))for(n=0;n<r;n++)i=2*t[n],d[2*n]=o[i],d[2*n+1]=o[i+1];else if("string"==typeof t)for(n=0;n<r;n++)i=2*t.charCodeAt(n),d[2*n]=o[i],d[2*n+1]=o[i+1];else for(n=0;n<r;n++)i=2*t[n],d[2*n]=o[i],d[2*n+1]=o[i+1];return d.slice(0,2*r).toString("ucs2")}},C=function(r){for(var n=t[r].enc,o=new e(131072),i=0;i<131072;++i)o[i]=0;for(var l=Object.keys(n),a=0,h=l[a];a<l.length;++a)if(h=l[a]){var c=h.charCodeAt(0);o[2*c]=255&n[h],o[2*c+1]=n[h]>>8}return function(t,r){var n=t.length,i=new e(2*n),l=0,a=0,h=0,c=0,u=0;if("string"==typeof t){for(l=c=0;l<n;++l)a=2*t.charCodeAt(l),i[c++]=o[a+1]||o[a],o[a+1]>0&&(i[c++]=o[a]);i=i.slice(0,c)}else if(e.isBuffer(t)){for(l=c=0;l<n;++l)(u=t[l])<128?a=u:u<224?(a=((31&u)<<6)+(63&t[l+1]),++l):u<240?(a=((15&u)<<12)+((63&t[l+1])<<6)+(63&t[l+2]),l+=2):(a=((7&u)<<18)+((63&t[l+1])<<12)+((63&t[l+2])<<6)+(63&t[l+3]),l+=3),a<65536?(a*=2,i[c++]=o[a+1]||o[a],o[a+1]>0&&(i[c++]=o[a])):(a=2*(55296+((h=a-65536)>>10&1023)),i[c++]=o[a+1]||o[a],o[a+1]>0&&(i[c++]=o[a]),a=2*(56320+(1023&h)),i[c++]=o[a+1]||o[a],o[a+1]>0&&(i[c++]=o[a]));i=i.slice(0,c)}else for(l=c=0;l<n;l++)a=2*t[l].charCodeAt(0),i[c++]=o[a+1]||o[a],o[a+1]>0&&(i[c++]=o[a]);return r&&"buf"!==r?"arr"!==r?i.toString("binary"):[].slice.call(i):i}},y=function(r){var n,o=t[r].dec,i=new e(131072),l=0,a=0,h=0,c=0;for(c=0;c<65536;++c)i[2*c]=255,i[2*c+1]=253;for(l=0;l<o.length;++l)(n=o[l])&&(a=n.charCodeAt(0),i[h=2*l]=255&a,i[h+1]=a>>8);return function(t){var r=t.length,n=new e(2*r),o=0,l=0,a=0;if(e.isBuffer(t))for(o=0;o<r;o++)l=2*t[o],255===i[l]&&253===i[l+1]&&(l=2*((t[o]<<8)+t[o+1]),++o),n[a++]=i[l],n[a++]=i[l+1];else if("string"==typeof t)for(o=0;o<r;o++)l=2*t.charCodeAt(o),255===i[l]&&253===i[l+1]&&(l=2*((t.charCodeAt(o)<<8)+t.charCodeAt(o+1)),++o),n[a++]=i[l],n[a++]=i[l+1];else for(o=0;o<r;o++)l=2*t[o],255===i[l]&&253===i[l+1]&&(l=2*((t[o]<<8)+t[o+1]),++o),n[a++]=i
|
|||
|
/**
|
|||
|
* @author bwhitn [brian.m.whitney@gmail.com]
|
|||
|
* @copyright Crown Copyright 2018
|
|||
|
* @license Apache-2.0
|
|||
|
*/var s=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=c(this,u(e).call(this))).name="Citrix CTX1 Decode",t.module="Encodings",t.description="Decodes strings in a Citrix CTX1 password format to plaintext.",t.infoURL="https://www.reddit.com/r/AskNetsec/comments/1s3r6y/citrix_ctx1_hash_decoding/",t.inputType="byteArray",t.outputType="string",t.args=[],t}var r,i,a;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(e,n["a"]),r=e,(i=[{key:"run",value:function(t,e){if(t.length%4!=0)throw new o.a("Incorrect hash length");for(var r=t.reverse(),n=[],i=0,a=0;a<r.length;a+=2)i=a+2>=r.length?0:r[a+2]-65&15^r[a+3]-65<<4&240,i=r[a]-65&15^r[a+1]-65<<4&240^165^i,n.push(i);return l.a.utils.decode(1200,n.reverse())}}])&&h(r.prototype,i),a&&h(r,a),e}();function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function g(t,e){return!e||"object"!==p(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function A(t){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function C(t,e){return(C=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}
|
|||
|
/**
|
|||
|
* @author bwhitn [brian.m.whitney@gmail.com]
|
|||
|
* @copyright Crown Copyright 2018
|
|||
|
* @license Apache-2.0
|
|||
|
*/var y=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=g(this,A(e).call(this))).name="Citrix CTX1 Encode",t.module="Encodings",t.description="Encodes strings to Citrix CTX1 password format.",t.infoURL="https://www.reddit.com/r/AskNetsec/comments/1s3r6y/citrix_ctx1_hash_decoding/",t.inputType="string",t.outputType="byteArray",t.args=[],t}var r,o,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&C(t,e)}(e,n["a"]),r=e,(o=[{key:"run",value:function(t,e){for(var r=Array.from(l.a.utils.encode(1200,t)),n=[],o=0,i=0;i<r.length;i++)o=165^r[i]^o,n.push(65+(o>>>4&15)),n.push(65+(15&o));return n}}])&&d(r.prototype,o),i&&d(r,i),e}(),v={"UTF-8 (65001)":65001,"UTF-7 (65000)":65e3,"UTF16LE (1200)":1200,"UTF16BE (1201)":1201,"UTF16 (1201)":1201,"IBM EBCDIC International (500)":500,"IBM EBCDIC US-Canada (37)":37,"Windows-874 Thai (874)":874,"Japanese Shift-JIS (932)":932,"Simplified Chinese GBK (936)":936,"Korean (949)":949,"Traditional Chinese Big5 (950)":950,"Windows-1250 Central European (1250)":1250,"Windows-1251 Cyrillic (1251)":1251,"Windows-1252 Latin (1252)":1252,"Windows-1253 Greek (1253)":1253,"Windows-1254 Turkish (1254)":1254,"Windows-1255 Hebrew (1255)":1255,"Windows-1256 Arabic (1256)":1256,"Windows-1257 Baltic (1257)":1257,"Windows-1258 Vietnam (1258)":1258,"US-ASCII (20127)":20127,"Simplified Chinese GB2312 (20936)":20936,"KOI8-R Russian Cyrillic (20866)":20866,"KOI8-U Ukrainian Cyrillic (21866)":21866,"ISO-8859-1 Latin 1 Western European (28591)":28591,"ISO-8859-2 Latin 2 Central European (28592)":28592,"ISO-8859-3 Latin 3 South European (28593)":28593,"ISO-8859-4 Latin 4 North European (28594)":28594,"ISO-8859-5 Latin/Cyrillic (28595)":28595,"ISO-8859-6 Latin/Arabic (28596)":28596,"ISO-8859-7 Latin/Greek (28597)":28597,"ISO-8859-8 Latin/Hebrew (28598)":28598,"ISO-8859-9 Latin 5 Turkish (28599)":28599,"ISO-8859-10 Latin 6 Nordic (28600)":28600,"ISO-8859-11 Latin/Thai (28601)":28601,"ISO-8859-13 Latin 7 Baltic Rim (28603)":28603,"ISO-8859-14 Latin 8 Celtic (28604)":28604,"ISO-8859-15 Latin 9 (28605)":28605,"ISO-8859-16 Latin 10 (28606)":28606,"ISO-2022 JIS Japanese (50222)":50222,"EUC Japanese (51932)":51932,"EUC Korean (51949)":51949,"Simplified Chinese GB18030 (54936)":54936};function b(t){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function w(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function m(t,e){return!e||"object"!==b(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function E(t){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function F(t,e){return(F=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}
|
|||
|
/**
|
|||
|
* @author n1474335 [n1474335@gmail.com]
|
|||
|
* @copyright Crown Copyright 2016
|
|||
|
* @license Apache-2.0
|
|||
|
*/var B=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=m(this,E(e).call(this))).name="Decode text",t.module="Encodings",t.description=["Decodes text from the chosen character encoding.","<br><br>","Supported charsets are:","<ul>",Object.keys(v).map(function(t){return"<li>".concat(t,"</li>")}).join("\n"),"</ul>"].join("\n"),t.infoURL="https://wikipedia.org/wiki/Character_encoding",t.inputType="byteArray",t.outputType="string",t.args=[{name:"Encoding",type:"option",value:Object.keys(v)}],t}var r,o,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&F(t,e)}(e,n["a"]),r=e,(o=[{key:"run",value:function(t,e){var r=v[e[0]];return l.a.utils.decode(r,t)}}])&&w(r.prototype,o),i&&w(r,i),e}();function S(t){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function O(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _(t,e){return!e||"object"!==S(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function R(t){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function T(t,e){return(T=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}
|
|||
|
/**
|
|||
|
* @author n1474335 [n1474335@gmail.com]
|
|||
|
* @copyright Crown Copyright 2016
|
|||
|
* @license Apache-2.0
|
|||
|
*/var D=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=_(this,R(e).call(this))).name="Encode text",t.module="Encodings",t.description=["Encodes text into the chosen character encoding.","<br><br>","Supported charsets are:","<ul>",Object.keys(v).map(function(t){return"<li>".concat(t,"</li>")}).join("\n"),"</ul>"].join("\n"),t.infoURL="https://wikipedia.org/wiki/Character_encoding",t.inputType="string",t.outputType="byteArray",t.args=[{name:"Encoding",type:"option",value:Object.keys(v)}],t}var r,o,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&T(t,e)}(e,n["a"]),r=e,(o=[{key:"run",value:function(t,e){var r=v[e[0]],n=l.a.utils.encode(r,t);return n=Array.from(n)}}])&&O(r.prototype,o),i&&O(r,i),e}(),k=r(313),x=r.n(k);function I(t){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function P(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function U(t,e){return!e||"object"!==I(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function L(t){return(L=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function N(t,e){return(N=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}
|
|||
|
/**
|
|||
|
* @author n1474335 [n1474335@gmail.com]
|
|||
|
* @copyright Crown Copyright 2016
|
|||
|
* @license Apache-2.0
|
|||
|
*/var j=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=U(this,L(e).call(this))).name="From Punycode",t.module="Encodings",t.description="Punycode is a way to represent Unicode with the limited character subset of ASCII supported by the Domain Name System.<br><br>e.g. <code>mnchen-3ya</code> decodes to <code>münchen</code>",t.infoURL="https://wikipedia.org/wiki/Punycode",t.inputType="string",t.outputType="string",t.args=[{name:"Internationalised domain name",type:"boolean",value:!1}],t}var r,o,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&N(t,e)}(e,n["a"]),r=e,(o=[{key:"run",value:function(t,e){return e[0]?x.a.toUnicode(t):x.a.decode(t)}}])&&P(r.prototype,o),i&&P(r,i),e}(),M=r(0);function Y(t){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function z(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function G(t,e){return!e||"object"!==Y(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function H(t){return(H=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Z(t,e){return(Z=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}
|
|||
|
/**
|
|||
|
* @author Cynser
|
|||
|
* @author n1474335 [n1474335@gmail.com]
|
|||
|
* @copyright Crown Copyright 2018
|
|||
|
* @license Apache-2.0
|
|||
|
*/var J=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=G(this,H(e).call(this))).name="Text Encoding Brute Force",t.module="Encodings",t.description=["Enumerates all supported text encodings for the input, allowing you to quickly spot the correct one.","<br><br>","Supported charsets are:","<ul>",Object.keys(v).map(function(t){return"<li>".concat(t,"</li>")}).join("\n"),"</ul>"].join("\n"),t.infoURL="https://wikipedia.org/wiki/Character_encoding",t.inputType="string",t.outputType="json",t.presentType="html",t.args=[{name:"Mode",type:"option",value:["Encode","Decode"]}],t}var r,o,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Z(t,e)}(e,n["a"]),r=e,(o=[{key:"run",value:function(t,e){var r={},n=Object.keys(v),o=e[0];return n.forEach(function(e){try{r[e]="Decode"===o?l.a.utils.decode(v[e],t):M.a.arrayBufferToStr(l.a.utils.encode(v[e],t))}catch(t){r[e]="Could not decode."}}),r}},{key:"present",value:function(t){var e="<table class='table table-hover table-sm table-bordered table-nonfluid'><tr><th>Encoding</th><th>Value</th></tr>";for(var r in t){var n=M.a.printable(t[r],!0);e+="<tr><td>".concat(r,"</td><td>").concat(n,"</td></tr>")}return e+="<table>"}}])&&z(r.prototype,o),i&&z(r,i),e}();function V(t){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function W(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function $(t,e){return!e||"object"!==V(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function q(t){return(q=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function X(t,e){return(X=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}
|
|||
|
/**
|
|||
|
* @author n1474335 [n1474335@gmail.com]
|
|||
|
* @copyright Crown Copyright 2016
|
|||
|
* @license Apache-2.0
|
|||
|
*/var K=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=$(this,q(e).call(this))).name="To Punycode",t.module="Encodings",t.description="Punycode is a way to represent Unicode with the limited character subset of ASCII supported by the Domain Name System.<br><br>e.g. <code>münchen</code> encodes to <code>mnchen-3ya</code>",t.infoURL="https://wikipedia.org/wiki/Punycode",t.inputType="string",t.outputType="string",t.args=[{name:"Internationalised domain name",type:"boolean",value:!1}],t}var r,o,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&X(t,e)}(e,n["a"]),r=e,(o=[{key:"run",value:function(t,e){return e[0]?x.a.toASCII(t):x.a.encode(t)}}])&&W(r.prototype,o),i&&W(r,i),e}(),Q="undefined"==typeof self?{}:self.OpModules||{};Q.Encodings={"Citrix CTX1 Decode":s,"Citrix CTX1 Encode":y,"Decode text":B,"Encode text":D,"From Punycode":j,"Text Encoding Brute Force":J,"To Punycode":K};e.default=Q},17:function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},18:function(t,e,r){"use strict";r.d(e,"b",function(){return o}),r.d(e,"a",function(){return i});var n=r(0);
|
|||
|
/**
|
|||
|
* Binary functions.
|
|||
|
*
|
|||
|
* @author n1474335 [n1474335@gmail.com]
|
|||
|
* @copyright Crown Copyright 2018
|
|||
|
* @license Apache-2.0
|
|||
|
*/function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Space",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;if(!t)return"";e=n.a.charRep(e);for(var o="",i=0;i<t.length;i++)o+=t[i].toString(2).padStart(r,"0")+e;return e.length?o.slice(0,-e.length):o}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Space",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,o=n.a.regexRep(e);t=t.replace(o,"");for(var i=[],l=0;l<t.length;l+=r)i.push(parseInt(t.substr(l,r),2));return i}},19:function(t,e,r){"use strict";r.d(e,"a",function(){return o});var n=r(0);
|
|||
|
/**
|
|||
|
* Decimal functions.
|
|||
|
*
|
|||
|
* @author n1474335 [n1474335@gmail.com]
|
|||
|
* @copyright Crown Copyright 2018
|
|||
|
* @license Apache-2.0
|
|||
|
*/function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto";e=n.a.charRep(e);var r=[],o=t.split(e);""===o[o.length-1]&&(o=o.slice(0,o.length-1));for(var i=0;i<o.length;i++)r[i]=parseInt(o[i],10);return r}},3:function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a(t){function e(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}
|
|||
|
/**
|
|||
|
* Custom error type for handling operation input errors.
|
|||
|
* i.e. where the operation can handle the error and print a message to the screen.
|
|||
|
*
|
|||
|
* @author d98762625 [d98762625@gmail.com]
|
|||
|
* @copyright Crown Copyright 2018
|
|||
|
* @license Apache-2.0
|
|||
|
*/var h=function(t){function e(){var t,r,i,a;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var h=arguments.length,c=new Array(h),u=0;u<h;u++)c[u]=arguments[u];return i=this,(r=!(a=(t=o(e)).call.apply(t,[this].concat(c)))||"object"!==n(a)&&"function"!=typeof a?l(i):a).type="OperationError",Error.captureStackTrace&&Error.captureStackTrace(l(l(r)),e),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}(e,a(Error)),e}();e.a=h},313:function(t,e,r){(function(t,n){var o;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(i){e&&e.nodeType,t&&t.nodeType;var l="object"==typeof n&&n;l.global!==l&&l.window!==l&&l.self;var a,h=2147483647,c=36,u=1,f=26,s=38,p=700,d=72,g=128,A="-",C=/^xn--/,y=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=c-u,m=Math.floor,E=String.fromCharCode;function F(t){throw new RangeError(b[t])}function B(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function S(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+B((t=t.replace(v,".")).split("."),e).join(".")}function O(t){for(var e,r,n=[],o=0,i=t.length;o<i;)(e=t.charCodeAt(o++))>=55296&&e<=56319&&o<i?56320==(64512&(r=t.charCodeAt(o++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),o--):n.push(e);return n}function _(t){return B(t,function(t){var e="";return t>65535&&(e+=E((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=E(t)}).join("")}function R(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function T(t,e,r){var n=0;for(t=r?m(t/p):t>>1,t+=m(t/e);t>w*f>>1;n+=c)t=m(t/w);return m(n+(w+1)*t/(t+s))}function D(t){var e,r,n,o,i,l,a,s,p,C,y,v=[],b=t.length,w=0,E=g,B=d;for((r=t.lastIndexOf(A))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&F("not-basic"),v.push(t.charCodeAt(n));for(o=r>0?r+1:0;o<b;){for(i=w,l=1,a=c;o>=b&&F("invalid-input"),((s=(y=t.charCodeAt(o++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:c)>=c||s>m((h-w)/l))&&F("overflow"),w+=s*l,!(s<(p=a<=B?u:a>=B+f?f:a-B));a+=c)l>m(h/(C=c-p))&&F("overflow"),l*=C;B=T(w-i,e=v.length+1,0==i),m(w/e)>h-E&&F("overflow"),E+=m(w/e),w%=e,v.splice(w++,0,E)}return _(v)}function k(t){var e,r,n,o,i,l,a,s,p,C,y,v,b,w,B,S=[];for(v=(t=O(t)).length,e=g,r=0,i=d,l=0;l<v;++l)(y=t[l])<128&&S.push(E(y));for(n=o=S.length,o&&S.push(A);n<v;){for(a=h,l=0;l<v;++l)(y=t[l])>=e&&y<a&&(a=y);for(a-e>m((h-r)/(b=n+1))&&F("overflow"),r+=(a-e)*b,e=a,l=0;l<v;++l)if((y=t[l])<e&&++r>h&&F("overflow"),y==e){for(s=r,p=c;!(s<(C=p<=i?u:p>=i+f?f:p-i));p+=c)B=s-C,w=c-C,S.push(E(R(C+B%w,0))),s=m(B/w);S.push(E(R(s,0))),i=T(r,b,n==o),r=0,++n}++r,++e}return S.join("")}a={version:"1.4.1",ucs2:{decode:O,encode:_},decode:D,encode:k,toASCII:function(t){return S(t,function(t){return y.test(t)?"xn--"+k(t):t})},toUnicode:function(t){return S(t,function(t){return C.test(t)?D(t.slice(4).toLowerCase()):t})}},void 0===(o=function(){return a}.call(e,r,e,t))||(t.exports=o)}()}).call(this,r(74)(t),r(17))},4:function(t,e,r){var n;!function(o){"use strict";var i,l=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,h=Math.floor,c="[BigNumber Error] ",u=c+"Number primitive has more than 15 significant digits: ",f=1e14,s=14,p=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],g=1e7,A=1e9;function C(t){var e=0|t;return t>0||t===e?e:e-1}function y(t){for(var e,r,n=1,o=t.length,i=t[0]+"";n<o;){for(e=t[n++]+"",r=s-e.length;r--;e="0"+e);i+=e}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function v(t,e){var r,n,o=t.c,i=e.c,l=t.s,a=e.s,h=t.e,c=e.e;if(!l||!a)return null;if(r=o&&!o[0],n=i&&!i[0],r||n)return r?n?0:-a:l;if(l!=a)return l;if(r=l<0,n=h==c,!o||!i)return n?0:!o^r?1:-1;if(!n)return h>c^r?1:-1;for(a=(h=o.length)<(c=i.length)?h:c,l=0;l<a;l++)if(o[l]!=i[l])return o[l]>i[l]^r?1:-1;return h==c?0:h>c^r?1:-1}function b(t,e,r,
|
|||
|
/*!
|
|||
|
* The buffer module from node.js, for the browser.
|
|||
|
*
|
|||
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|||
|
* @license MIT
|
|||
|
*/
|
|||
|
var n=r(58),o=r(59),i=r(60);function l(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(l()<e)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=h.prototype:(null===t&&(t=new h(e)),t.length=e),t}function h(t,e,r){if(!(h.TYPED_ARRAY_SUPPORT||this instanceof h))return new h(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);h.TYPED_ARRAY_SUPPORT?(t=e).__proto__=h.prototype:t=s(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!h.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=a(t,n)).write(e,r);o!==n&&(t=t.slice(0,o));return t}(t,e,r):function(t,e){if(h.isBuffer(e)){var r=0|p(e.length);return 0===(t=a(t,r)).length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):s(t,e);if("Buffer"===e.type&&i(e.data))return s(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(u(e),t=a(t,e<0?0:0|p(e)),!h.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function s(t,e){var r=e.length<0?0:0|p(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function p(t){if(t>=l())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l().toString(16)+" bytes");return 0|t}function d(t,e){if(h.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(n)return M(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function A(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=h.from(e,n)),h.isBuffer(e))return 0===e.length?-1:C(t,e,r,n,o);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):C(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function C(t,e,r,n,o){var i,l=1,a=t.length,h=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;l=2,a/=2,h/=2,r/=2}function c(t,e){return 1===l?t[e]:t.readUInt16BE(e*l)}if(o){var u=-1;for(i=r;i<a;i++)if(c(t,i)===c(e,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===h)return u*l}else-1!==u&&(i-=i-u),u=-1}else for(r+h>a&&(r=a-h),i=r;i>=0;i--){for(var f=!0,s=0;s<h;s++)if(c(t,i+s)!==c(e,s)){f=!1;break}if(f)return i}return-1}function y(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex s
|
|||
|
/**
|
|||
|
* Hexadecimal functions.
|
|||
|
*
|
|||
|
* @author n1474335 [n1474335@gmail.com]
|
|||
|
* @copyright Crown Copyright 2016
|
|||
|
* @license Apache-2.0
|
|||
|
*/function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(!t)return"";for(var n="",o=0;o<t.length;o++)n+=t[o].toString(16).padStart(r,"0")+e;return"0x"===e&&(n="0x"+n),"\\x"===e&&(n="\\x"+n),e.length?n.slice(0,-e.length):n}function i(t){if(!t)return"";for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")}function l(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if("None"!==e){var o="Auto"===e?/[^a-f\d]/gi:n.a.regexRep(e);t=t.replace(o,"")}for(var i=[],l=0;l<t.length;l+=r)i.push(parseInt(t.substr(l,r),16));return i}var a=["Space","Comma","Semi-colon","Colon","Line feed","CRLF","0x","\\x","None"],h=["Auto"].concat(a)},74:function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},9:function(t,e,r){"use strict";var n=r(0),o=r(12),i=r(4),l=r.n(i),a=r(14),h=r.n(a);function c(t,e,r,n,o,i,l){try{var a=t[i](l),h=a.value}catch(t){return void r(t)}a.done?e(h):Promise.resolve(h).then(n,o)}function u(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function l(t){c(i,n,o,l,a,"next",t)}function a(t){c(i,n,o,l,a,"throw",t)}l(void 0)})}}function f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}
|
|||
|
/**
|
|||
|
* @author n1474335 [n1474335@gmail.com]
|
|||
|
* @author Matt C [matt@artemisbot.uk]
|
|||
|
* @copyright Crown Copyright 2016
|
|||
|
* @license Apache-2.0
|
|||
|
*/
|
|||
|
var s=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.value=[],this.type=t.BYTE_ARRAY,e&&e.hasOwnProperty("value")&&e.hasOwnProperty("type")&&this.set(e.value,e.type)}var e,r,i;return e=t,r=[{key:"set",value:function(e,r){if("string"==typeof r&&(r=t.typeEnum(r)),h.a.debug("Dish type: "+t.enumLookup(r)),this.value=e,this.type=r,!this.valid()){var i=n.a.truncate(JSON.stringify(this.value),13);throw new o.a("Data is not a valid ".concat(t.enumLookup(r),": ").concat(i))}}},{key:"get",value:function(){var e=u(regeneratorRuntime.mark(function e(r){var n,o=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.length>1&&void 0!==o[1]&&o[1],"string"==typeof r&&(r=t.typeEnum(r)),this.type===r){e.next=5;break}return e.next=5,this._translate(r,n);case 5:return e.abrupt("return",this.value);case 6:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"_translate",value:function(){var e=u(regeneratorRuntime.mark(function e(r){var i,a,c=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i=c.length>1&&void 0!==c[1]&&c[1],h.a.debug("Translating Dish from ".concat(t.enumLookup(this.type)," to ").concat(t.enumLookup(r))),a=i?n.a.byteArrayToChars:n.a.byteArrayToUtf8,e.prev=3,e.t0=this.type,e.next=e.t0===t.STRING?7:e.t0===t.NUMBER?9:e.t0===t.HTML?11:e.t0===t.ARRAY_BUFFER?13:e.t0===t.BIG_NUMBER?15:e.t0===t.JSON?17:e.t0===t.FILE?19:e.t0===t.LIST_FILE?24:30;break;case 7:return this.value=this.value?n.a.strToByteArray(this.value):[],e.abrupt("break",31);case 9:return this.value="number"==typeof this.value?n.a.strToByteArray(this.value.toString()):[],e.abrupt("break",31);case 11:return this.value=this.value?n.a.strToByteArray(n.a.unescapeHtml(n.a.stripHtmlTags(this.value,!0))):[],e.abrupt("break",31);case 13:return this.value=Array.prototype.slice.call(new Uint8Array(this.value)),e.abrupt("break",31);case 15:return this.value=l.a.isBigNumber(this.value)?n.a.strToByteArray(this.value.toFixed()):[],e.abrupt("break",31);case 17:return this.value=this.value?n.a.strToByteArray(JSON.stringify(this.value,null,4)):[],e.abrupt("break",31);case 19:return e.next=21,n.a.readFile(this.value);case 21:return this.value=e.sent,this.value=Array.prototype.slice.call(this.value),e.abrupt("break",31);case 24:return e.next=26,Promise.all(this.value.map(function(){var t=u(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",n.a.readFile(e));case 1:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()));case 26:return this.value=e.sent,this.value=this.value.map(function(t){return Array.prototype.slice.call(t)}),this.value=[].concat.apply([],this.value),e.abrupt("break",31);case 30:return e.abrupt("break",31);case 31:e.next=36;break;case 33:throw e.prev=33,e.t1=e.catch(3),new o.a("Error translating from ".concat(t.enumLookup(this.type)," to byteArray: ").concat(e.t1));case 36:this.type=t.BYTE_ARRAY,e.prev=37,e.t2=r,e.next=e.t2===t.STRING?41:e.t2===t.HTML?41:e.t2===t.NUMBER?44:e.t2===t.ARRAY_BUFFER?47:e.t2===t.BIG_NUMBER?50:e.t2===t.JSON?53:e.t2===t.FILE?56:e.t2===t.LIST_FILE?58:61;break;case 41:return this.value=this.value?a(this.value):"",this.type=t.STRING,e.abrupt("break",62);case 44:return this.value=this.value?parseFloat(a(this.value)):0,this.type=t.NUMBER,e.abrupt("break",62);case 47:return this.value=new Uint8Array(this.value).buffer,this.type=t.ARRAY_BUFFER,e.abrupt("break",62);case 50:try{this.value=new l.a(a(this.value))}catch(t){this.value=new l.a(NaN)}return this.type=t.BIG_NUMBER,e.abrupt("break",62);case 53:return this.value=JSON.parse(a(this.value)),this.type=t.JSON,e.abrupt("break",62);case 56:return this.value=new File(this.value,"unknown"),e.abrupt("break",62);case 58:return this.value=[new File(this.value,"unknown")],this.type=t.LIST_FILE,e.abrupt("break",
|