dappros/ethora

View on GitHub
client-web/build/static/js/971.440deec6.chunk.js

Summary

Maintainability
A
0 mins
Test Coverage
/*! For license information please see 971.440deec6.chunk.js.LICENSE.txt */
(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[971],{56971:function(t,e,r){"use strict";r.r(e);var s=r(1413),i=r(74165),h=r(15861),a=r(70885),o=r(36459),n=r(72791),c=r(74142),u=r(20803),l=r(50228),H=r(4565),_=r(13811),f=r(73978),p=r(59911),S=r(17205),A=r(55705),R=r(74981),d=r(85554),E=r(11210),y=r(73763),C=r(64880),m=r(47409),b=r(52775),X=r(80184);e.default=function(t){(0,o.Z)(t);var e=(0,c.Z)(),r=(0,E.K)((function(t){return t.user})),w=(0,b.D)().showSnackbar,x=(0,n.useState)(!1),v=(0,a.Z)(x,2),k=v[0],O=v[1],g=(0,C.k6)(),T=(0,C.TH)(),B=(0,A.TA)({initialValues:{chatName:"",description:"",chatImage:""},onSubmit:function(){var t=(0,h.Z)((0,i.Z)().mark((function t(e){var s,h,a,o,n,c,u;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(h=e.chatName,a=e.description,o=e.chatImage,O(!0),n=(0,R.sha256)(h),(0,d.$I)(r.walletAddress),d.ZP.createNewRoom(n),d.ZP.setOwner(n),d.ZP.roomConfig(n,{roomName:h,roomDescription:a}),d.ZP.setRoomImage(n,o,"","icon"),d.ZP.subsribe(n+y.Ts),null===(s=T.state)||void 0===s||!s.metaDirection){t.next=15;break}return c={name:h,roomJid:n,from:{direction:T.state.metaDirection,roomJid:T.state.metaRoom.roomJid}},t.next=13,(0,m.Vy)().post("/room",c);case 13:u=t.sent,console.log(null===u||void 0===u?void 0:u.data);case 15:O(!1),w("success","Room created successfully"),g.push("/chat/none");case 18:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}),F=function(){var t=(0,h.Z)((0,i.Z)().mark((function t(e){var r,h;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return O(!0),t.prev=1,(r=new FormData).append("files",e.target.files[0]),t.next=6,(0,m.Vy)().post("/files",r);case 6:h=t.sent,B.setValues((function(t){return(0,s.Z)((0,s.Z)({},t),{},{chatImage:h.data.results[0].location})})),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),console.log(t.t0);case 13:O(!1);case 14:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e){return t.apply(this,arguments)}}();return(0,X.jsx)(u.Z,{maxWidth:"xl",style:{height:"calc(100vh - 80px)"},children:(0,X.jsx)(l.Z,{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:(0,X.jsxs)(l.Z,{children:[(0,X.jsx)(H.Z,{variant:"h4",children:"Create new chat"}),(0,X.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",width:"50vw",gap:"10px"},children:[(0,X.jsxs)(_.Z,{children:[(0,X.jsx)("input",{accept:"image/*",style:{display:"none"},id:"raised-button-file",multiple:!0,type:"file",onChange:F}),(0,X.jsx)("label",{htmlFor:"raised-button-file",children:(0,X.jsx)(f.Z,{sx:{backgroundColor:e.palette.primary.main,width:60,height:60},src:B.values.chatImage})})]}),(0,X.jsx)(p.Z,{margin:"dense",inputProps:{autoComplete:"off"},label:"Chat Name",name:"chatName",type:"text",fullWidth:!0,variant:"outlined",onChange:B.handleChange,value:B.values.chatName})]}),(0,X.jsx)(p.Z,{margin:"dense",inputProps:{autoComplete:"off"},label:"Description",name:"description",type:"text",fullWidth:!0,variant:"outlined",onChange:B.handleChange,value:B.values.description}),(0,X.jsx)(l.Z,{sx:{width:"100%",display:"flex",justifyContent:"center",alignItems:"center",marginTop:"10px"},children:(0,X.jsx)(S.Z,{variant:"outlined",disabled:k,onClick:function(){return B.handleSubmit()},children:"Sumbit"})})]})})})}},74981:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_RESULT__;(function(){"use strict";var ERROR="input is invalid type",WINDOW="object"===typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"===typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"===typeof process&&process.versions&&process.versions.node;NODE_JS?root=__webpack_require__.g:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&module.exports,AMD=__webpack_require__.amdO,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"===typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t,e){return function(r){return new Sha256(e,!0).update(r)[t]()}},createMethod=function(t){var e=createOutputMethod("hex",t);NODE_JS&&(e=nodeWrap(e,t)),e.create=function(){return new Sha256(t)},e.update=function(t){return e.create().update(t)};for(var r=0;r<OUTPUT_TYPES.length;++r){var s=OUTPUT_TYPES[r];e[s]=createOutputMethod(s,t)}return e},nodeWrap=function nodeWrap(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(t){if("string"===typeof t)return crypto.createHash(algorithm).update(t,"utf8").digest("hex");if(null===t||void 0===t)throw new Error(ERROR);return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod},createHmacOutputMethod=function(t,e){return function(r,s){return new HmacSha256(r,e,!0).update(s)[t]()}},createHmacMethod=function(t){var e=createHmacOutputMethod("hex",t);e.create=function(e){return new HmacSha256(e,t)},e.update=function(t,r){return e.create(t).update(r)};for(var r=0;r<OUTPUT_TYPES.length;++r){var s=OUTPUT_TYPES[r];e[s]=createHmacOutputMethod(s,t)}return e};function Sha256(t,e){e?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}function HmacSha256(t,e,r){var s,i=typeof t;if("string"===i){var h,a=[],o=t.length,n=0;for(s=0;s<o;++s)(h=t.charCodeAt(s))<128?a[n++]=h:h<2048?(a[n++]=192|h>>6,a[n++]=128|63&h):h<55296||h>=57344?(a[n++]=224|h>>12,a[n++]=128|h>>6&63,a[n++]=128|63&h):(h=65536+((1023&h)<<10|1023&t.charCodeAt(++s)),a[n++]=240|h>>18,a[n++]=128|h>>12&63,a[n++]=128|h>>6&63,a[n++]=128|63&h);t=a}else{if("object"!==i)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw new Error(ERROR)}t.length>64&&(t=new Sha256(e,!0).update(t).array());var c=[],u=[];for(s=0;s<64;++s){var l=t[s]||0;c[s]=92^l,u[s]=54^l}Sha256.call(this,e,r),this.update(u),this.oKeyPad=c,this.inner=!0,this.sharedMemory=r}Sha256.prototype.update=function(t){if(!this.finalized){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw new Error(ERROR);e=!0}for(var s,i,h=0,a=t.length,o=this.blocks;h<a;){if(this.hashed&&(this.hashed=!1,o[0]=this.block,o[16]=o[1]=o[2]=o[3]=o[4]=o[5]=o[6]=o[7]=o[8]=o[9]=o[10]=o[11]=o[12]=o[13]=o[14]=o[15]=0),e)for(i=this.start;h<a&&i<64;++h)o[i>>2]|=t[h]<<SHIFT[3&i++];else for(i=this.start;h<a&&i<64;++h)(s=t.charCodeAt(h))<128?o[i>>2]|=s<<SHIFT[3&i++]:s<2048?(o[i>>2]|=(192|s>>6)<<SHIFT[3&i++],o[i>>2]|=(128|63&s)<<SHIFT[3&i++]):s<55296||s>=57344?(o[i>>2]|=(224|s>>12)<<SHIFT[3&i++],o[i>>2]|=(128|s>>6&63)<<SHIFT[3&i++],o[i>>2]|=(128|63&s)<<SHIFT[3&i++]):(s=65536+((1023&s)<<10|1023&t.charCodeAt(++h)),o[i>>2]|=(240|s>>18)<<SHIFT[3&i++],o[i>>2]|=(128|s>>12&63)<<SHIFT[3&i++],o[i>>2]|=(128|s>>6&63)<<SHIFT[3&i++],o[i>>2]|=(128|63&s)<<SHIFT[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=o[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=EXTRA[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var t,e,r,s,i,h,a,o,n,c=this.h0,u=this.h1,l=this.h2,H=this.h3,_=this.h4,f=this.h5,p=this.h6,S=this.h7,A=this.blocks;for(t=16;t<64;++t)e=((i=A[t-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,r=((i=A[t-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,A[t]=A[t-16]+e+A[t-7]+r<<0;for(n=u&l,t=0;t<64;t+=4)this.first?(this.is224?(h=300032,S=(i=A[0]-1413257819)-150054599<<0,H=i+24177077<<0):(h=704751109,S=(i=A[0]-210244248)-1521486534<<0,H=i+143694565<<0),this.first=!1):(e=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),s=(h=c&u)^c&l^n,S=H+(i=S+(r=(_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&f^~_&p)+K[t]+A[t])<<0,H=i+(e+s)<<0),e=(H>>>2|H<<30)^(H>>>13|H<<19)^(H>>>22|H<<10),s=(a=H&c)^H&u^h,p=l+(i=p+(r=(S>>>6|S<<26)^(S>>>11|S<<21)^(S>>>25|S<<7))+(S&_^~S&f)+K[t+1]+A[t+1])<<0,e=((l=i+(e+s)<<0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),s=(o=l&H)^l&c^a,f=u+(i=f+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&S^~p&_)+K[t+2]+A[t+2])<<0,e=((u=i+(e+s)<<0)>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),s=(n=u&l)^u&H^o,_=c+(i=_+(r=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&p^~f&S)+K[t+3]+A[t+3])<<0,c=i+(e+s)<<0;this.h0=this.h0+c<<0,this.h1=this.h1+u<<0,this.h2=this.h2+l<<0,this.h3=this.h3+H<<0,this.h4=this.h4+_<<0,this.h5=this.h5+f<<0,this.h6=this.h6+p<<0,this.h7=this.h7+S<<0},Sha256.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,s=this.h3,i=this.h4,h=this.h5,a=this.h6,o=this.h7,n=HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>4&15]+HEX_CHARS[15&h]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a];return this.is224||(n+=HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]),n},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,s=this.h3,i=this.h4,h=this.h5,a=this.h6,o=this.h7,n=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24&255,r>>16&255,r>>8&255,255&r,s>>24&255,s>>16&255,s>>8&255,255&s,i>>24&255,i>>16&255,i>>8&255,255&i,h>>24&255,h>>16&255,h>>8&255,255&h,a>>24&255,a>>16&255,a>>8&255,255&a];return this.is224||n.push(o>>24&255,o>>16&255,o>>8&255,255&o),n},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()}}]);
//# sourceMappingURL=971.440deec6.chunk.js.map