This repository has been archived on 2026-02-28. You can view files and clone it, but cannot push or open issues or pull requests.
ServerSpacebarOld/assets/public/thirdparty/4b58fa778cc38e586a72.js
2025-12-12 01:41:33 +02:00

30 lines
28 KiB
JavaScript

(this.webpackChunkdiscord_app=this.webpackChunkdiscord_app||[]).push([[49595],{722182:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.copy=function(t){var e=document.body;if(null==e)throw new Error("[Utils] ClipboardUtils.copy(): assert failed: document.body != null");var n=document.createRange(),r=window.getSelection(),i=document.createElement("textarea");i.value=t;i.contentEditable="true";i.style.visibility="none";e.appendChild(i);n.selectNodeContents(i);null==r||r.removeAllRanges();null==r||r.addRange(n);i.focus();i.setSelectionRange(0,t.length);var o=document.execCommand("copy");e.removeChild(i);return o}},792085:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.astToString=function(t){return n(t).join("")};e.constrainAst=function t(e,n){void 0===n&&(n={limit:200});if(Array.isArray(e))for(var r=e.length,o=0;o<r;o++){var a=t(e[o],n);if(a===i){e.length=o;break}e[o]=a}else if("text"!==e.type){n.limit-=1;if(n.limit<=0)return i
;Array.isArray(e.content)&&(e.content=t(e.content,n))}return e};e.flattenAst=function t(e,n){void 0===n&&(n=null);if(Array.isArray(e)){for(var i=e.length,o=[],a=0;a<i;a++)r(o,t(e[a],n));return o}null!=e.content&&(e.content=t(e.content,e));if(null!=n&&e.type===n.type)return e.content;return e};e.getIndexedAST=function t(e,n){var r=0;return e.map((function(i){var o=0===r?0:e[r-1].endIndex;r++;switch(i.type){case"spoiler":case"u":case"s":case"strong":i.startIndex=n+o;var a=t(i.content,i.startIndex+2);i.endIndex=a[a.length-1].endIndex+2;return i;case"em":case"customEmoji":case"emoji":case"inlineCode":i.startIndex=n+o;var c=t(i.content,i.startIndex+1);i.endIndex=c[c.length-1].endIndex+1;return i;case"text":i.startIndex=n+o;i.endIndex=i.startIndex+i.content.length;return i;default:i.startIndex=n+o;var s=t(i.content,i.startIndex);i.endIndex=s[s.length-1].endIndex;return i}}))};function n(t,e){void 0===e&&(e=[]);Array.isArray(t)?t.forEach((function(t){return n(t,e)
})):"string"==typeof t.content?e.push(t.content):null!=t.content&&n(t.content,e);return e}function r(t,e){if(Array.isArray(e))for(var n=e.length,r=0;r<n;r++)t.push(e[r]);else t.push(e)}var i={}},225887:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={reactParserFor:!0,astParserFor:!0};e.reactParserFor=e.astParserFor=void 0;var i,o=n(792085);Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(r,t)||t in e&&e[t]===o[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}}))}));var a=(i=n(194201).Z).reactParserFor;e.reactParserFor=a;var c=i.astParserFor;e.astParserFor=c},194201:(t,e,n)=>{"use strict";({value:!0});e.Z=void 0;var r,i=(r=n(120053))&&r.__esModule?r:{default:r},o=n(792085);function a(){a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};return a.apply(this,arguments)
}function c(t,e,n,r,i){n||(e+="\n\n");var c;c=t(e,a({inline:n},r));c=(0,o.flattenAst)(c);c=(0,o.constrainAst)(c);null!=i&&(c=i(c,n));return c}var s={reactParserFor:function(t){var e=i.default.parserFor(t),n=i.default.reactFor(i.default.ruleOutput(t,"react"));return function(t,r,i,o){void 0===t&&(t="");void 0===r&&(r=!0);void 0===i&&(i={});void 0===o&&(o=null);return n(c(e,t,r,i,o),i)}},astParserFor:function(t){var e=i.default.parserFor(t);return function(t,n,r,i){void 0===t&&(t="");void 0===n&&(n=!0);void 0===r&&(r={});void 0===i&&(i=null);return c(e,t,n,r,i)}}};e.Z=s},181757:function(t,e){"use strict";var n={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(t){this.toString=function(){return"CORRUPT: "+this.message};this.message=t},invalid:function(t){this.toString=function(){return"INVALID: "+this.message};this.message=t},bug:function(t){this.toString=function(){return"BUG: "+this.message};this.message=t},notReady:function(t){
this.toString=function(){return"NOT READY: "+this.message};this.message=t}}};n.cipher.aes=function(t){this.s[0][0][0]||this.O();var e,r,i,o,a=this.s[0][4],c=this.s[1],s=1;if(4!==(e=t.length)&&6!==e&&8!==e)throw new n.exception.invalid("invalid aes key size");this.b=[i=t.slice(0),o=[]];for(t=e;t<4*e+28;t++){r=i[t-1];(0==t%e||8===e&&4==t%e)&&(r=a[r>>>24]<<24^a[r>>16&255]<<16^a[r>>8&255]<<8^a[255&r],0==t%e&&(r=r<<8^r>>>24^s<<24,s=s<<1^283*(s>>7)));i[t]=i[t-e]^r}for(e=0;t;e++,t--)r=i[3&e?t:t-4],o[e]=4>=t||4>e?r:c[0][a[r>>>24]]^c[1][a[r>>16&255]]^c[2][a[r>>8&255]]^c[3][a[255&r]]};n.cipher.aes.prototype={encrypt:function(t){return r(this,t,0)},decrypt:function(t){return r(this,t,1)},s:[[[],[],[],[],[]],[[],[],[],[],[]]],O:function(){var t,e,n,r,i,o,a,c=this.s[0],s=this.s[1],h=c[4],l=s[4],u=[],d=[];for(t=0;256>t;t++)d[(u[t]=t<<1^283*(t>>7))^t]=t;for(e=n=0;!h[e];e^=r||1,n=d[n]||1)for(o=(o=n^n<<1^n<<2^n<<3^n<<4)>>8^255&o^99,h[e]=o,l[o]=e,a=16843009*(i=u[t=u[r=u[e]]])^65537*t^257*r^16843008*e,
i=257*u[o]^16843008*o,t=0;4>t;t++)c[t][e]=i=i<<24^i>>>8,s[t][o]=a=a<<24^a>>>8;for(t=0;5>t;t++)c[t]=c[t].slice(0),s[t]=s[t].slice(0)}};function r(t,e,r){if(4!==e.length)throw new n.exception.invalid("invalid aes block size");var i=t.b[r],o=e[0]^i[0],a=e[r?3:1]^i[1],c=e[2]^i[2];e=e[r?1:3]^i[3];var s,h,l,u,d=i.length/4-2,f=4,p=[0,0,0,0];t=(s=t.s[r])[0];var m=s[1],y=s[2],g=s[3],v=s[4];for(u=0;u<d;u++)s=t[o>>>24]^m[a>>16&255]^y[c>>8&255]^g[255&e]^i[f],h=t[a>>>24]^m[c>>16&255]^y[e>>8&255]^g[255&o]^i[f+1],l=t[c>>>24]^m[e>>16&255]^y[o>>8&255]^g[255&a]^i[f+2],e=t[e>>>24]^m[o>>16&255]^y[a>>8&255]^g[255&c]^i[f+3],f+=4,o=s,a=h,c=l;for(u=0;4>u;u++)p[r?3&-u:u]=v[o>>>24]<<24^v[a>>16&255]<<16^v[c>>8&255]<<8^v[255&e]^i[f++],s=o,o=a,a=c,c=e,e=s;return p}n.bitArray={bitSlice:function(t,e,r){t=n.bitArray.$(t.slice(e/32),32-(31&e)).slice(1);return void 0===r?t:n.bitArray.clamp(t,r-e)},extract:function(t,e,n){var r=Math.floor(-e-n&31)
;return(-32&(e+n-1^e)?t[e/32|0]<<32-r^t[e/32+1|0]>>>r:t[e/32|0]>>>r)&(1<<n)-1},concat:function(t,e){if(0===t.length||0===e.length)return t.concat(e);var r=t[t.length-1],i=n.bitArray.getPartial(r);return 32===i?t.concat(e):n.bitArray.$(e,i,0|r,t.slice(0,t.length-1))},bitLength:function(t){var e=t.length;return 0===e?0:32*(e-1)+n.bitArray.getPartial(t[e-1])},clamp:function(t,e){if(32*t.length<e)return t;var r=(t=t.slice(0,Math.ceil(e/32))).length;e&=31;0<r&&e&&(t[r-1]=n.bitArray.partial(e,t[r-1]&2147483648>>e-1,1));return t},partial:function(t,e,n){return 32===t?e:(n?0|e:e<<32-t)+1099511627776*t},getPartial:function(t){return Math.round(t/1099511627776)||32},equal:function(t,e){if(n.bitArray.bitLength(t)!==n.bitArray.bitLength(e))return!1;var r,i=0;for(r=0;r<t.length;r++)i|=t[r]^e[r];return 0===i},$:function(t,e,r,i){var o;o=0;for(void 0===i&&(i=[]);32<=e;e-=32)i.push(r),r=0;if(0===e)return i.concat(t);for(o=0;o<t.length;o++)i.push(r|t[o]>>>e),r=t[o]<<32-e;o=t.length?t[t.length-1]:0
;t=n.bitArray.getPartial(o);i.push(n.bitArray.partial(e+t&31,32<e+t?r:i.pop(),1));return i},i:function(t,e){return[t[0]^e[0],t[1]^e[1],t[2]^e[2],t[3]^e[3]]},byteswapM:function(t){var e,n;for(e=0;e<t.length;++e)n=t[e],t[e]=n>>>24|n>>>8&65280|(65280&n)<<8|n<<24;return t}};n.codec.utf8String={fromBits:function(t){var e,r,i="",o=n.bitArray.bitLength(t);for(e=0;e<o/8;e++)0==(3&e)&&(r=t[e/4]),i+=String.fromCharCode(r>>>8>>>8>>>8),r<<=8;return decodeURIComponent(escape(i))},toBits:function(t){t=unescape(encodeURIComponent(t));var e,r=[],i=0;for(e=0;e<t.length;e++)i=i<<8|t.charCodeAt(e),3==(3&e)&&(r.push(i),i=0);3&e&&r.push(n.bitArray.partial(8*(3&e),i));return r}};n.codec.hex={fromBits:function(t){var e,r="";for(e=0;e<t.length;e++)r+=(0xf00000000000+(0|t[e])).toString(16).substr(4);return r.substr(0,n.bitArray.bitLength(t)/4)},toBits:function(t){var e,r,i=[];r=(t=t.replace(/\s|0x/g,"")).length;t+="00000000";for(e=0;e<t.length;e+=8)i.push(0^parseInt(t.substr(e,8),16))
;return n.bitArray.clamp(i,4*r)}};n.codec.base32={B:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",X:"0123456789ABCDEFGHIJKLMNOPQRSTUV",BITS:32,BASE:5,REMAINING:27,fromBits:function(t,e,r){var i=n.codec.base32.BASE,o=n.codec.base32.REMAINING,a="",c=0,s=n.codec.base32.B,h=0,l=n.bitArray.bitLength(t);r&&(s=n.codec.base32.X);for(r=0;a.length*i<l;)a+=s.charAt((h^t[r]>>>c)>>>o),c<i?(h=t[r]<<i-c,c+=o,r++):(h<<=i,c-=i);for(;7&a.length&&!e;)a+="=";return a},toBits:function(t,e){t=t.replace(/\s|=/g,"").toUpperCase();var r,i,o=n.codec.base32.BITS,a=n.codec.base32.BASE,c=n.codec.base32.REMAINING,s=[],h=0,l=n.codec.base32.B,u=0,d="base32";e&&(l=n.codec.base32.X,d="base32hex");for(r=0;r<t.length;r++){if(0>(i=l.indexOf(t.charAt(r)))){if(!e)try{return n.codec.base32hex.toBits(t)}catch(t){}throw new n.exception.invalid("this isn't "+d+"!")}h>c?(h-=c,s.push(u^i>>>h),u=i<<o-h):u^=i<<o-(h+=a)}56&h&&s.push(n.bitArray.partial(56&h,u,1));return s}};n.codec.base32hex={fromBits:function(t,e){
return n.codec.base32.fromBits(t,e,1)},toBits:function(t){return n.codec.base32.toBits(t,1)}};n.codec.base64={B:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fromBits:function(t,e,r){var i="",o=0,a=n.codec.base64.B,c=0,s=n.bitArray.bitLength(t);r&&(a=a.substr(0,62)+"-_");for(r=0;6*i.length<s;)i+=a.charAt((c^t[r]>>>o)>>>26),6>o?(c=t[r]<<6-o,o+=26,r++):(c<<=6,o-=6);for(;3&i.length&&!e;)i+="=";return i},toBits:function(t,e){t=t.replace(/\s|=/g,"");var r,i,o=[],a=0,c=n.codec.base64.B,s=0;e&&(c=c.substr(0,62)+"-_");for(r=0;r<t.length;r++){if(0>(i=c.indexOf(t.charAt(r))))throw new n.exception.invalid("this isn't base64!");26<a?(a-=26,o.push(s^i>>>a),s=i<<32-a):s^=i<<32-(a+=6)}56&a&&o.push(n.bitArray.partial(56&a,s,1));return o}};n.codec.base64url={fromBits:function(t){return n.codec.base64.fromBits(t,1,1)},toBits:function(t){return n.codec.base64.toBits(t,1)}};n.hash.sha256=function(t){this.b[0]||this.O();t?(this.F=t.F.slice(0),this.A=t.A.slice(0),
this.l=t.l):this.reset()};n.hash.sha256.hash=function(t){return(new n.hash.sha256).update(t).finalize()};n.hash.sha256.prototype={blockSize:512,reset:function(){this.F=this.Y.slice(0);this.A=[];this.l=0;return this},update:function(t){"string"==typeof t&&(t=n.codec.utf8String.toBits(t));var e,r=this.A=n.bitArray.concat(this.A,t);e=this.l;if(9007199254740991<(t=this.l=e+n.bitArray.bitLength(t)))throw new n.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){var o=new Uint32Array(r),a=0;for(e=512+e-(512+e&511);e<=t;e+=512)i(this,o.subarray(16*a,16*(a+1))),a+=1;r.splice(0,16*a)}else for(e=512+e-(512+e&511);e<=t;e+=512)i(this,r.splice(0,16));return this},finalize:function(){var t,e=this.A,r=this.F;for(t=(e=n.bitArray.concat(e,[n.bitArray.partial(1,1)])).length+2;15&t;t++)e.push(0);e.push(Math.floor(this.l/4294967296));for(e.push(0|this.l);e.length;)i(this,e.splice(0,16));this.reset();return r},Y:[],b:[],O:function(){function t(t){
return 4294967296*(t-Math.floor(t))|0}for(var e,n,r=0,i=2;64>r;i++){n=!0;for(e=2;e*e<=i;e++)if(0==i%e){n=!1;break}n&&(8>r&&(this.Y[r]=t(Math.pow(i,.5))),this.b[r]=t(Math.pow(i,1/3)),r++)}}};function i(t,e){var n,r,i,o=t.F,a=t.b,c=o[0],s=o[1],h=o[2],l=o[3],u=o[4],d=o[5],f=o[6],p=o[7];for(n=0;64>n;n++)16>n?r=e[n]:(r=e[n+1&15],i=e[n+14&15],r=e[15&n]=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(i>>>17^i>>>19^i>>>10^i<<15^i<<13)+e[15&n]+e[n+9&15]|0),r=r+p+(u>>>6^u>>>11^u>>>25^u<<26^u<<21^u<<7)+(f^u&(d^f))+a[n],p=f,f=d,d=u,u=l+r|0,l=h,h=s,c=r+((s=c)&h^l&(s^h))+(s>>>2^s>>>13^s>>>22^s<<30^s<<19^s<<10)|0;o[0]=o[0]+c|0;o[1]=o[1]+s|0;o[2]=o[2]+h|0;o[3]=o[3]+l|0;o[4]=o[4]+u|0;o[5]=o[5]+d|0;o[6]=o[6]+f|0;o[7]=o[7]+p|0}n.mode.ccm={name:"ccm",G:[],listenProgress:function(t){n.mode.ccm.G.push(t)},unListenProgress:function(t){-1<(t=n.mode.ccm.G.indexOf(t))&&n.mode.ccm.G.splice(t,1)},fa:function(t){var e,r=n.mode.ccm.G.slice();for(e=0;e<r.length;e+=1)r[e](t)},encrypt:function(t,e,r,i,o){
var a,c=e.slice(0),s=n.bitArray,h=s.bitLength(r)/8,l=s.bitLength(c)/8;o=o||64;i=i||[];if(7>h)throw new n.exception.invalid("ccm: iv must be at least 7 bytes");for(a=2;4>a&&l>>>8*a;a++);a<15-h&&(a=15-h);r=s.clamp(r,8*(15-a));e=n.mode.ccm.V(t,e,r,i,o,a);c=n.mode.ccm.C(t,c,r,e,o,a);return s.concat(c.data,c.tag)},decrypt:function(t,e,r,i,o){o=o||64;i=i||[];var a=n.bitArray,c=a.bitLength(r)/8,s=a.bitLength(e),h=a.clamp(e,s-o),l=a.bitSlice(e,s-o);s=(s-o)/8;if(7>c)throw new n.exception.invalid("ccm: iv must be at least 7 bytes");for(e=2;4>e&&s>>>8*e;e++);e<15-c&&(e=15-c);r=a.clamp(r,8*(15-e));h=n.mode.ccm.C(t,h,r,l,o,e);t=n.mode.ccm.V(t,h.data,r,i,o,e);if(!a.equal(h.tag,t))throw new n.exception.corrupt("ccm: tag doesn't match");return h.data},na:function(t,e,r,i,o,a){var c=[],s=n.bitArray,h=s.i;i=[s.partial(8,(e.length?64:0)|i-2<<2|a-1)];(i=s.concat(i,r))[3]|=o;i=t.encrypt(i)
;if(e.length)for(65279>=(r=s.bitLength(e)/8)?c=[s.partial(16,r)]:4294967295>=r&&(c=s.concat([s.partial(16,65534)],[r])),c=s.concat(c,e),e=0;e<c.length;e+=4)i=t.encrypt(h(i,c.slice(e,e+4).concat([0,0,0])));return i},V:function(t,e,r,i,o,a){var c=n.bitArray,s=c.i;if((o/=8)%2||4>o||16<o)throw new n.exception.invalid("ccm: invalid tag length");if(4294967295<i.length||4294967295<e.length)throw new n.exception.bug("ccm: can't deal with 4GiB or more data");r=n.mode.ccm.na(t,i,r,o,c.bitLength(e)/8,a);for(i=0;i<e.length;i+=4)r=t.encrypt(s(r,e.slice(i,i+4).concat([0,0,0])));return c.clamp(r,8*o)},C:function(t,e,r,i,o,a){var c,s=n.bitArray;c=s.i;var h=e.length,l=s.bitLength(e),u=h/50,d=u;r=s.concat([s.partial(8,a-1)],r).concat([0,0,0]).slice(0,4);i=s.bitSlice(c(i,t.encrypt(r)),0,o);if(!h)return{tag:i,data:[]};for(c=0;c<h;c+=4)c>u&&(n.mode.ccm.fa(c/h),u+=d),r[3]++,o=t.encrypt(r),e[c]^=o[0],e[c+1]^=o[1],e[c+2]^=o[2],e[c+3]^=o[3];return{tag:i,data:s.clamp(e,l)}}};n.mode.ocb2={name:"ocb2",
encrypt:function(t,e,r,i,o,a){if(128!==n.bitArray.bitLength(r))throw new n.exception.invalid("ocb iv must be 128 bits");var c,s=n.mode.ocb2.S,h=n.bitArray,l=h.i,u=[0,0,0,0];r=s(t.encrypt(r));var d,f=[];i=i||[];o=o||64;for(c=0;c+4<e.length;c+=4)u=l(u,d=e.slice(c,c+4)),f=f.concat(l(r,t.encrypt(l(r,d)))),r=s(r);d=e.slice(c);e=h.bitLength(d);c=t.encrypt(l(r,[0,0,0,e]));d=h.clamp(l(d.concat([0,0,0]),c),e);u=l(u,l(d.concat([0,0,0]),c));u=t.encrypt(l(u,l(r,s(r))));i.length&&(u=l(u,a?i:n.mode.ocb2.pmac(t,i)));return f.concat(h.concat(d,h.clamp(u,o)))},decrypt:function(t,e,r,i,o,a){if(128!==n.bitArray.bitLength(r))throw new n.exception.invalid("ocb iv must be 128 bits");o=o||64;var c,s,h=n.mode.ocb2.S,l=n.bitArray,u=l.i,d=[0,0,0,0],f=h(t.encrypt(r)),p=n.bitArray.bitLength(e)-o,m=[];i=i||[];for(r=0;r+4<p/32;r+=4)c=u(f,t.decrypt(u(f,e.slice(r,r+4)))),d=u(d,c),m=m.concat(c),f=h(f);s=p-32*r;c=t.encrypt(u(f,[0,0,0,s]));c=u(c,l.clamp(e.slice(r),s).concat([0,0,0]));d=u(d,c);d=t.encrypt(u(d,u(f,h(f))))
;i.length&&(d=u(d,a?i:n.mode.ocb2.pmac(t,i)));if(!l.equal(l.clamp(d,o),l.bitSlice(e,p)))throw new n.exception.corrupt("ocb: tag doesn't match");return m.concat(l.clamp(c,s))},pmac:function(t,e){var r,i=n.mode.ocb2.S,o=n.bitArray,a=o.i,c=[0,0,0,0],s=a(s=t.encrypt([0,0,0,0]),i(i(s)));for(r=0;r+4<e.length;r+=4)s=i(s),c=a(c,t.encrypt(a(s,e.slice(r,r+4))));r=e.slice(r);128>o.bitLength(r)&&(s=a(s,i(s)),r=o.concat(r,[-2147483648,0,0,0]));c=a(c,r);return t.encrypt(a(i(a(s,i(s))),c))},S:function(t){return[t[0]<<1^t[1]>>>31,t[1]<<1^t[2]>>>31,t[2]<<1^t[3]>>>31,t[3]<<1^135*(t[0]>>>31)]}};n.mode.gcm={name:"gcm",encrypt:function(t,e,r,i,o){var a=e.slice(0);e=n.bitArray;i=i||[];t=n.mode.gcm.C(!0,t,a,i,r,o||128);return e.concat(t.data,t.tag)},decrypt:function(t,e,r,i,o){var a=e.slice(0),c=n.bitArray,s=c.bitLength(a);i=i||[];(o=o||128)<=s?(e=c.bitSlice(a,s-o),a=c.bitSlice(a,0,s-o)):(e=a,a=[]);t=n.mode.gcm.C(!1,t,a,i,r,o);if(!c.equal(t.tag,e))throw new n.exception.corrupt("gcm: tag doesn't match")
;return t.data},ka:function(t,e){var r,i,o,a,c,s=n.bitArray.i;o=[0,0,0,0];a=e.slice(0);for(r=0;128>r;r++){(i=0!=(t[Math.floor(r/32)]&1<<31-r%32))&&(o=s(o,a));c=0!=(1&a[3]);for(i=3;0<i;i--)a[i]=a[i]>>>1|(1&a[i-1])<<31;a[0]>>>=1;c&&(a[0]^=-520093696)}return o},j:function(t,e,r){var i,o=r.length;e=e.slice(0);for(i=0;i<o;i+=4)e[0]^=4294967295&r[i],e[1]^=4294967295&r[i+1],e[2]^=4294967295&r[i+2],e[3]^=4294967295&r[i+3],e=n.mode.gcm.ka(e,t);return e},C:function(t,e,r,i,o,a){var c,s,h,l,u,d,f,p,m=n.bitArray;d=r.length;f=m.bitLength(r);p=m.bitLength(i);s=m.bitLength(o);c=e.encrypt([0,0,0,0]);96===s?(o=o.slice(0),o=m.concat(o,[1])):(o=n.mode.gcm.j(c,[0,0,0,0],o),o=n.mode.gcm.j(c,o,[0,0,Math.floor(s/4294967296),4294967295&s]));s=n.mode.gcm.j(c,[0,0,0,0],i);u=o.slice(0);i=s.slice(0);t||(i=n.mode.gcm.j(c,s,r));for(l=0;l<d;l+=4)u[3]++,h=e.encrypt(u),r[l]^=h[0],r[l+1]^=h[1],r[l+2]^=h[2],r[l+3]^=h[3];r=m.clamp(r,f);t&&(i=n.mode.gcm.j(c,s,r))
;t=[Math.floor(p/4294967296),4294967295&p,Math.floor(f/4294967296),4294967295&f];i=n.mode.gcm.j(c,i,t);h=e.encrypt(o);i[0]^=h[0];i[1]^=h[1];i[2]^=h[2];i[3]^=h[3];return{tag:m.bitSlice(i,0,a),data:r}}};n.misc.hmac=function(t,e){this.W=e=e||n.hash.sha256;var r,i=[[],[]],o=e.prototype.blockSize/32;this.w=[new e,new e];t.length>o&&(t=e.hash(t));for(r=0;r<o;r++)i[0][r]=909522486^t[r],i[1][r]=1549556828^t[r];this.w[0].update(i[0]);this.w[1].update(i[1]);this.R=new e(this.w[0])};n.misc.hmac.prototype.encrypt=n.misc.hmac.prototype.mac=function(t){if(this.aa)throw new n.exception.invalid("encrypt on already updated hmac called!");this.update(t);return this.digest(t)};n.misc.hmac.prototype.reset=function(){this.R=new this.W(this.w[0]);this.aa=!1};n.misc.hmac.prototype.update=function(t){this.aa=!0;this.R.update(t)};n.misc.hmac.prototype.digest=function(){var t=this.R.finalize();t=new this.W(this.w[1]).update(t).finalize();this.reset();return t};n.misc.pbkdf2=function(t,e,r,i,o){r=r||1e4
;if(0>i||0>r)throw new n.exception.invalid("invalid params to pbkdf2");"string"==typeof t&&(t=n.codec.utf8String.toBits(t));"string"==typeof e&&(e=n.codec.utf8String.toBits(e));t=new(o=o||n.misc.hmac)(t);var a,c,s,h,l=[],u=n.bitArray;for(h=1;32*l.length<(i||1);h++){o=a=t.encrypt(u.concat(e,[h]));for(c=1;c<r;c++)for(a=t.encrypt(a),s=0;s<a.length;s++)o[s]^=a[s];l=l.concat(o)}i&&(l=u.clamp(l,i));return l};n.prng=function(t){this.c=[new n.hash.sha256];this.m=[0];this.P=0;this.H={};this.N=0;this.U={};this.Z=this.f=this.o=this.ha=0;this.b=[0,0,0,0,0,0,0,0];this.h=[0,0,0,0];this.L=void 0;this.M=t;this.D=!1;this.K={progress:{},seeded:{}};this.u=this.ga=0;this.I=1;this.J=2;this.ca=65536;this.T=[0,48,64,96,128,192,256,384,512,768,1024];this.da=3e4;this.ba=80};n.prng.prototype={randomWords:function(t,e){var r,i,o=[];if((r=this.isReady(e))===this.u)throw new n.exception.notReady("generator isn't seeded");if(r&this.J){r=!(r&this.I);i=[];var a,h=0;this.Z=i[0]=(new Date).valueOf()+this.da
;for(a=0;16>a;a++)i.push(4294967296*Math.random()|0);for(a=0;a<this.c.length&&(i=i.concat(this.c[a].finalize()),h+=this.m[a],this.m[a]=0,r||!(this.P&1<<a));a++);this.P>=1<<this.c.length&&(this.c.push(new n.hash.sha256),this.m.push(0));this.f-=h;h>this.o&&(this.o=h);this.P++;this.b=n.hash.sha256.hash(this.b.concat(i));this.L=new n.cipher.aes(this.b);for(r=0;4>r&&(this.h[r]=this.h[r]+1|0,!this.h[r]);r++);}for(r=0;r<t;r+=4)0==(r+1)%this.ca&&c(this),i=s(this),o.push(i[0],i[1],i[2],i[3]);c(this);return o.slice(0,t)},setDefaultParanoia:function(t,e){if(0===t&&"Setting paranoia=0 will ruin your security; use it only for testing"!==e)throw new n.exception.invalid("Setting paranoia=0 will ruin your security; use it only for testing");this.M=t},addEntropy:function(t,e,r){r=r||"user";var i,a,c=(new Date).valueOf(),s=this.H[r],h=this.isReady(),l=0;void 0===(i=this.U[r])&&(i=this.U[r]=this.ha++);void 0===s&&(s=this.H[r]=0);this.H[r]=(this.H[r]+1)%this.c.length;switch(typeof t){case"number":
void 0===e&&(e=1);this.c[s].update([i,this.N++,1,e,c,1,0|t]);break;case"object":if("[object Uint32Array]"===(r=Object.prototype.toString.call(t))){a=[];for(r=0;r<t.length;r++)a.push(t[r]);t=a}else for("[object Array]"!==r&&(l=1),r=0;r<t.length&&!l;r++)"number"!=typeof t[r]&&(l=1);if(!l){if(void 0===e)for(r=e=0;r<t.length;r++)for(a=t[r];0<a;)e++,a>>>=1;this.c[s].update([i,this.N++,2,e,c,t.length].concat(t))}break;case"string":void 0===e&&(e=t.length);this.c[s].update([i,this.N++,3,e,c,t.length]);this.c[s].update(t);break;default:l=1}if(l)throw new n.exception.bug("random: addEntropy only supports number, array of numbers or string");this.m[s]+=e;this.f+=e;h===this.u&&(this.isReady()!==this.u&&o("seeded",Math.max(this.o,this.f)),o("progress",this.getProgress()))},isReady:function(t){t=this.T[void 0!==t?t:this.M];return this.o&&this.o>=t?this.m[0]>this.ba&&(new Date).valueOf()>this.Z?this.J|this.I:this.I:this.f>=t?this.J|this.u:this.u},getProgress:function(t){t=this.T[t||this.M]
;return this.o>=t||this.f>t?1:this.f/t},startCollectors:function(){if(!this.D){this.a={loadTimeCollector:h(this,this.ma),mouseCollector:h(this,this.oa),keyboardCollector:h(this,this.la),accelerometerCollector:h(this,this.ea),touchCollector:h(this,this.qa)};if(window.addEventListener)window.addEventListener("load",this.a.loadTimeCollector,!1),window.addEventListener("mousemove",this.a.mouseCollector,!1),window.addEventListener("keypress",this.a.keyboardCollector,!1),window.addEventListener("devicemotion",this.a.accelerometerCollector,!1),window.addEventListener("touchmove",this.a.touchCollector,!1);else{if(!document.attachEvent)throw new n.exception.bug("can't attach event");document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector)}this.D=!0}},stopCollectors:function(){this.D&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,!1),
window.removeEventListener("mousemove",this.a.mouseCollector,!1),window.removeEventListener("keypress",this.a.keyboardCollector,!1),window.removeEventListener("devicemotion",this.a.accelerometerCollector,!1),window.removeEventListener("touchmove",this.a.touchCollector,!1)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.D=!1)},addEventListener:function(t,e){this.K[t][this.ga++]=e},removeEventListener:function(t,e){var n,r,i=this.K[t],o=[];for(r in i)i.hasOwnProperty(r)&&i[r]===e&&o.push(r);for(n=0;n<o.length;n++)delete i[r=o[n]]},la:function(){a(this,1)},oa:function(t){var e,n;try{e=t.x||t.clientX||t.offsetX||0,n=t.y||t.clientY||t.offsetY||0}catch(t){n=e=0}0!=e&&0!=n&&this.addEntropy([e,n],2,"mouse");a(this,0)},qa:function(t){t=t.touches[0]||t.changedTouches[0];this.addEntropy([t.pageX||t.clientX,t.pageY||t.clientY],1,"touch")
;a(this,0)},ma:function(){a(this,2)},ea:function(t){t=t.accelerationIncludingGravity.x||t.accelerationIncludingGravity.y||t.accelerationIncludingGravity.z;if(window.orientation){var e=window.orientation;"number"==typeof e&&this.addEntropy(e,1,"accelerometer")}t&&this.addEntropy(t,2,"accelerometer");a(this,0)}};function o(t,e){var r,i=n.random.K[t],o=[];for(r in i)i.hasOwnProperty(r)&&o.push(i[r]);for(r=0;r<o.length;r++)o[r](e)}function a(t,e){"undefined"!=typeof window&&window.performance&&"function"==typeof window.performance.now?t.addEntropy(window.performance.now(),e,"loadtime"):t.addEntropy((new Date).valueOf(),e,"loadtime")}function c(t){t.b=s(t).concat(s(t));t.L=new n.cipher.aes(t.b)}function s(t){for(var e=0;4>e&&(t.h[e]=t.h[e]+1|0,!t.h[e]);e++);return t.L.encrypt(t.h)}function h(t,e){return function(){e.apply(t,arguments)}}n.random=new n.prng(6);t:try{var l,u,d,f;if(f=void 0!==t&&t.exports){var p;try{p=require("crypto")}catch(t){p=null}f=u=p}
if(f&&u.randomBytes)l=u.randomBytes(128),l=new Uint32Array(new Uint8Array(l).buffer),n.random.addEntropy(l,1024,"crypto['randomBytes']");else if("undefined"!=typeof window&&"undefined"!=typeof Uint32Array){d=new Uint32Array(32);if(window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(d);else{if(!window.msCrypto||!window.msCrypto.getRandomValues)break t;window.msCrypto.getRandomValues(d)}n.random.addEntropy(d,1024,"crypto['getRandomValues']")}}catch(t){"undefined"!=typeof window&&window.console&&(console.log("There was an error collecting entropy from the browser:"),console.log(t))}n.json={defaults:{v:1,iter:1e4,ks:128,ts:64,mode:"ccm",adata:"",cipher:"aes"},ja:function(t,e,r,i){r=r||{};i=i||{};var o,a=n.json,c=a.g({iv:n.random.randomWords(4,0)},a.defaults);a.g(c,r);r=c.adata;"string"==typeof c.salt&&(c.salt=n.codec.base64.toBits(c.salt));"string"==typeof c.iv&&(c.iv=n.codec.base64.toBits(c.iv))
;if(!n.mode[c.mode]||!n.cipher[c.cipher]||"string"==typeof t&&100>=c.iter||64!==c.ts&&96!==c.ts&&128!==c.ts||128!==c.ks&&192!==c.ks&&256!==c.ks||2>c.iv.length||4<c.iv.length)throw new n.exception.invalid("json encrypt: invalid parameters");"string"==typeof t?(t=(o=n.misc.cachedPbkdf2(t,c)).key.slice(0,c.ks/32),c.salt=o.salt):n.ecc&&t instanceof n.ecc.elGamal.publicKey&&(o=t.kem(),c.kemtag=o.tag,t=o.key.slice(0,c.ks/32));"string"==typeof e&&(e=n.codec.utf8String.toBits(e));"string"==typeof r&&(c.adata=r=n.codec.utf8String.toBits(r));o=new n.cipher[c.cipher](t);a.g(i,c);i.key=t;c.ct="ccm"===c.mode&&n.arrayBuffer&&n.arrayBuffer.ccm&&e instanceof ArrayBuffer?n.arrayBuffer.ccm.encrypt(o,e,c.iv,r,c.ts):n.mode[c.mode].encrypt(o,e,c.iv,r,c.ts);return c},encrypt:function(t,e,r,i){var o=n.json,a=o.ja.apply(o,arguments);return o.encode(a)},ia:function(t,e,r,i){r=r||{};i=i||{};var o,a,c=n.json;o=(e=c.g(c.g(c.g({},c.defaults),e),r,!0)).adata
;"string"==typeof e.salt&&(e.salt=n.codec.base64.toBits(e.salt));"string"==typeof e.iv&&(e.iv=n.codec.base64.toBits(e.iv));if(!n.mode[e.mode]||!n.cipher[e.cipher]||"string"==typeof t&&100>=e.iter||64!==e.ts&&96!==e.ts&&128!==e.ts||128!==e.ks&&192!==e.ks&&256!==e.ks||!e.iv||2>e.iv.length||4<e.iv.length)throw new n.exception.invalid("json decrypt: invalid parameters");"string"==typeof t?(t=(a=n.misc.cachedPbkdf2(t,e)).key.slice(0,e.ks/32),e.salt=a.salt):n.ecc&&t instanceof n.ecc.elGamal.secretKey&&(t=t.unkem(n.codec.base64.toBits(e.kemtag)).slice(0,e.ks/32));"string"==typeof o&&(o=n.codec.utf8String.toBits(o));a=new n.cipher[e.cipher](t);o="ccm"===e.mode&&n.arrayBuffer&&n.arrayBuffer.ccm&&e.ct instanceof ArrayBuffer?n.arrayBuffer.ccm.decrypt(a,e.ct,e.iv,e.tag,o,e.ts):n.mode[e.mode].decrypt(a,e.ct,e.iv,o,e.ts);c.g(i,e);i.key=t;return 1===r.raw?o:n.codec.utf8String.fromBits(o)},decrypt:function(t,e,r,i){var o=n.json;return o.ia(t,o.decode(e),r,i)},encode:function(t){var e,r="{",i=""
;for(e in t)if(t.hasOwnProperty(e)){if(!e.match(/^[a-z0-9]+$/i))throw new n.exception.invalid("json encode: invalid property name");r+=i+'"'+e+'":';i=",";switch(typeof t[e]){case"number":case"boolean":r+=t[e];break;case"string":r+='"'+escape(t[e])+'"';break;case"object":r+='"'+n.codec.base64.fromBits(t[e],0)+'"';break;default:throw new n.exception.bug("json encode: unsupported type")}}return r+"}"},decode:function(t){if(!(t=t.replace(/\s/g,"")).match(/^\{.*\}$/))throw new n.exception.invalid("json decode: this isn't json!");t=t.replace(/^\{|\}$/g,"").split(/,/);var e,r,i={};for(e=0;e<t.length;e++){if(!(r=t[e].match(/^\s*(?:(["']?)([a-z][a-z0-9]*)\1)\s*:\s*(?:(-?\d+)|"([a-z0-9+\/%*_.@=\-]*)"|(true|false))$/i)))throw new n.exception.invalid("json decode: this isn't json!");null!=r[3]?i[r[2]]=parseInt(r[3],10):null!=r[4]?i[r[2]]=r[2].match(/^(ct|adata|salt|iv)$/)?n.codec.base64.toBits(r[4]):unescape(r[4]):null!=r[5]&&(i[r[2]]="true"===r[5])}return i},g:function(t,e,r){void 0===t&&(t={})
;if(void 0===e)return t;for(var i in e)if(e.hasOwnProperty(i)){if(r&&void 0!==t[i]&&t[i]!==e[i])throw new n.exception.invalid("required parameter overridden");t[i]=e[i]}return t},sa:function(t,e){var n,r={};for(n in t)t.hasOwnProperty(n)&&t[n]!==e[n]&&(r[n]=t[n]);return r},ra:function(t,e){var n,r={};for(n=0;n<e.length;n++)void 0!==t[e[n]]&&(r[e[n]]=t[e[n]]);return r}};n.encrypt=n.json.encrypt;n.decrypt=n.json.decrypt;n.misc.pa={};n.misc.cachedPbkdf2=function(t,e){var r,i=n.misc.pa;r=(e=e||{}).iter||1e3;(r=(i=i[t]=i[t]||{})[r]=i[r]||{firstSalt:e.salt&&e.salt.length?e.salt.slice(0):n.random.randomWords(2,0)})[i=void 0===e.salt?r.firstSalt:e.salt]=r[i]||n.misc.pbkdf2(t,i,e.iter);return{key:r[i].slice(0),salt:i.slice(0)}};void 0!==t&&t.exports&&(t.exports=n);"function"==typeof define&&define([],(function(){return n}))}}]);
//# sourceMappingURL=4b58fa778cc38e586a72.js.map