1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[270],{16204:function(e,t,a){"use strict";a.d(t,{Z:function(){return g}});var r=a(87462),o=a(45987),n=a(67294),l=a(33636),i=(0,a(63786).Z)(n.createElement("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel"),c=a(40922),d=a(59693),s=a(17294),p=a(93871),u=a(41810);function h(e){return"Backspace"===e.key||"Delete"===e.key}var m=n.forwardRef(function(e,t){var a=e.avatar,c=e.classes,d=e.className,m=e.clickable,g=e.color,b=void 0===g?"default":g,x=e.component,f=e.deleteIcon,y=e.disabled,v=void 0!==y&&y,C=e.icon,k=e.label,Z=e.onClick,j=e.onDelete,w=e.onKeyDown,I=e.onKeyUp,S=e.size,N=e.variant,R=void 0===N?"default":N,T=(0,o.Z)(e,["avatar","classes","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant"]),E=n.useRef(null),z=(0,s.Z)(E,t),D=function(e){e.stopPropagation(),j&&j(e)},M=!1!==m&&!!Z||m,O="small"===(void 0===S?"medium":S),P=x||(M?u.Z:"div"),$=P===u.Z?{component:"div"}:{},_=null;if(j){var A=(0,l.Z)("default"!==b&&("default"===R?c["deleteIconColor".concat((0,p.Z)(b))]:c["deleteIconOutlinedColor".concat((0,p.Z)(b))]),O&&c.deleteIconSmall);_=f&&n.isValidElement(f)?n.cloneElement(f,{className:(0,l.Z)(f.props.className,c.deleteIcon,A),onClick:D}):n.createElement(i,{className:(0,l.Z)(c.deleteIcon,A),onClick:D})}var L=null;a&&n.isValidElement(a)&&(L=n.cloneElement(a,{className:(0,l.Z)(c.avatar,a.props.className,O&&c.avatarSmall,"default"!==b&&c["avatarColor".concat((0,p.Z)(b))])}));var U=null;return C&&n.isValidElement(C)&&(U=n.cloneElement(C,{className:(0,l.Z)(c.icon,C.props.className,O&&c.iconSmall,"default"!==b&&c["iconColor".concat((0,p.Z)(b))])})),n.createElement(P,(0,r.Z)({role:M||j?"button":void 0,className:(0,l.Z)(c.root,d,"default"!==b&&[c["color".concat((0,p.Z)(b))],M&&c["clickableColor".concat((0,p.Z)(b))],j&&c["deletableColor".concat((0,p.Z)(b))]],"default"!==R&&[c.outlined,{primary:c.outlinedPrimary,secondary:c.outlinedSecondary}[b]],v&&c.disabled,O&&c.sizeSmall,M&&c.clickable,j&&c.deletable),"aria-disabled":!!v||void 0,tabIndex:M||j?0:void 0,onClick:Z,onKeyDown:function(e){e.currentTarget===e.target&&h(e)&&e.preventDefault(),w&&w(e)},onKeyUp:function(e){e.currentTarget===e.target&&(j&&h(e)?j(e):"Escape"===e.key&&E.current&&E.current.blur()),I&&I(e)},ref:z},$,T),L||U,n.createElement("span",{className:(0,l.Z)(c.label,O&&c.labelSmall)},k),_)}),g=(0,c.Z)(function(e){var t="light"===e.palette.type?e.palette.grey[300]:e.palette.grey[700],a=(0,d.Fq)(e.palette.text.primary,.26);return{root:{fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:e.palette.getContrastText(t),backgroundColor:t,borderRadius:16,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"default",outline:0,textDecoration:"none",border:"none",padding:0,verticalAlign:"middle",boxSizing:"border-box","&$disabled":{opacity:.5,pointerEvents:"none"},"& $avatar":{marginLeft:5,marginRight:-6,width:24,height:24,color:"light"===e.palette.type?e.palette.grey[700]:e.palette.grey[300],fontSize:e.typography.pxToRem(12)},"& $avatarColorPrimary":{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.dark},"& $avatarColorSecondary":{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.dark},"& $avatarSmall":{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)}},sizeSmall:{height:24},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},disabled:{},clickable:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover, &:focus":{backgroundColor:(0,d._4)(t,.08)},"&:active":{boxShadow:e.shadows[1]}},clickableColorPrimary:{"&:hover, &:focus":{backgroundColor:(0,d._4)(e.palette.primary.main,.08)}},clickableColorSecondary:{"&:hover, &:focus":{backgroundColor:(0,d._4)(e.palette.secondary.main,.08)}},deletable:{"&:focus":{backgroundColor:(0,d._4)(t,.08)}},deletableColorPrimary:{"&:focus":{backgroundColor:(0,d._4)(e.palette.primary.main,.2)}},deletableColorSecondary:{"&:focus":{backgroundColor:(0,d._4)(e.palette.secondary.main,.2)}},outlined:{backgroundColor:"transparent",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,d.Fq)(e.palette.text.primary,e.palette.action.hoverOpacity)},"& $avatar":{marginLeft:4},"& $avatarSmall":{marginLeft:2},"& $icon":{marginLeft:4},"& $iconSmall":{marginLeft:2},"& $deleteIcon":{marginRight:5},"& $deleteIconSmall":{marginRight:3}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat(e.palette.primary.main),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,d.Fq)(e.palette.primary.main,e.palette.action.hoverOpacity)}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat(e.palette.secondary.main),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,d.Fq)(e.palette.secondary.main,e.palette.action.hoverOpacity)}},avatar:{},avatarSmall:{},avatarColorPrimary:{},avatarColorSecondary:{},icon:{color:"light"===e.palette.type?e.palette.grey[700]:e.palette.grey[300],marginLeft:5,marginRight:-6},iconSmall:{width:18,height:18,marginLeft:4,marginRight:-4},iconColorPrimary:{color:"inherit"},iconColorSecondary:{color:"inherit"},label:{overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},labelSmall:{paddingLeft:8,paddingRight:8},deleteIcon:{WebkitTapHighlightColor:"transparent",color:a,height:22,width:22,curs
1or:"pointer",margin:"0 5px 0 -6px","&:hover":{color:(0,d.Fq)(a,.4)}},deleteIconSmall:{height:16,width:16,marginRight:4,marginLeft:-4},deleteIconColorPrimary:{color:(0,d.Fq)(e.palette.primary.contrastText,.7),"&:hover, &:active":{color:e.palette.primary.contrastText}},deleteIconColorSecondary:{color:(0,d.Fq)(e.palette.secondary.contrastText,.7),"&:hover, &:active":{color:e.palette.secondary.contrastText}},deleteIconOutlinedColorPrimary:{color:(0,d.Fq)(e.palette.primary.main,.7),"&:hover, &:active":{color:e.palette.primary.main}},deleteIconOutlinedColorSecondary:{color:(0,d.Fq)(e.palette.secondary.main,.7),"&:hover, &:active":{color:e.palette.secondary.main}}}},{name:"MuiChip"})(m)},30673:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/messages/new",function(){return a(33709)}])},57343:function(e,t,a){"use strict";var r=a(85893);a(67294);var o=a(39752),n=a(41120),l=a(92037),i=a(7397);let c=(0,n.Z)(e=>({elasInput:{backgroundColor:"#000000"},rounded:{color:e.palette.background.paper,"& notchedOutline":{border:"none"},"& fieldset":{backgroundColor:e.palette.background.paper,zIndex:0},"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:e.palette.background.paper},"&:hover fieldset":{borderColor:e.palette.background.paper},"&.Mui-focused fieldset":{borderWidth:"1px",borderColor:e.palette.secondary.main}},"& div":{justifyContent:"flex-end",zIndex:1,height:"48px",borderRadius:"28px",paddingLeft:"8px","& input":{width:"96%",height:"1rem",minHeight:"1rem",zIndex:1}}},roundedwhite:{color:"rgba(0,0,0)","& notchedOutline":{border:"none"},"& fieldset":{backgroundColor:"white",zIndex:0},"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:"white"},"&:hover fieldset":{borderColor:"white"},"&.Mui-focused fieldset":{borderWidth:"1px",borderColor:e.palette.secondary.main}},"& div":{justifyContent:"flex-end",zIndex:1,height:"48px",borderRadius:"28px",paddingLeft:"8px","& input":{width:"96%",height:"1rem",minHeight:"1rem",zIndex:1,color:"rgba(0,0,0)"}}},roundedicon:{height:"48px",color:e.palette.background.paper,"& notchedOutline":{border:"none"},"& fieldset":{margin:0,backgroundColor:e.palette.background.paper,zIndex:0},"& .MuiOutlinedInput-root":{borderRadius:"24px","& fieldset":{borderColor:e.palette.background.paper},"&:hover fieldset":{borderColor:e.palette.secondary.main},"&.Mui-focused fieldset":{borderColor:e.palette.background.paper}},"& div":{justifyContent:"flex-end",zIndex:1,"& input":{padding:"14px 24px",zIndex:1}}}})),d=(e,t)=>e.icon?(0,r.jsx)(l.Z,{...e,variant:"outlined",InputProps:{endAdornment:(0,r.jsx)(i.Z,{position:"end",children:(0,r.jsx)(e.icon,{})})},className:t}):(0,r.jsx)(l.Z,{...e,label:"",variant:"outlined",className:t});t.Z=e=>{let t=c();switch(e.itype){case o.Je.ROUNDEDSTRINGICON:return d(e,t.roundedicon);case o.Je.ROUNDEDSTRING:return d(e,t.rounded);case o.Je.ROUNDEDSTRINGWHITE:return d(e,t.roundedwhite);case o.Je.STRING:case o.Je.NUMBER:default:return d(e,t.elasInput)}}},68541:function(e,t,a){"use strict";var r=a(9921),o=a(67294),n=a(32572),l=a(39550),i=a(14252);t.Z=()=>{let{user:e,setErrorMsg:t,setThinking:a}=(0,o.useContext)(n.St),{wallet:c}=(0,o.useContext)(n.zM),d=(null==e?void 0:e.handle)+"@signavera.com",[s,p]=(0,l.Z)([]),[u,h]=(0,l.Z)(void 0),m=async e=>{try{a(1);let o=null==s?void 0:s.map(e=>e.includes("@")?e:e+"@signavera.com"),n=new i.K(d,c.PKI),{Message:l,conversationId:p,connectionKey:u,sig:h}=await n.requestConnection(o,null==e?void 0:e.subject),{conversation:m,error:g}=await (0,r.f4)("/api/private/messaging/createConnection",{Message:l,conversationId:p,connectionKey:u,sig:h});if(!m||g)return console.log({createError:g});let b=n.calculatePublicEdges(m),{updated:x,error:f}=await (0,r.f4)("/api/private/messaging/updateConnection",{updatedConversation:{conversationId:p,members:b.members,hasAddedEdges:b.hasAddedEdges}});if(!x||f)return console.log({updateError:f});if((null==e?void 0:e.isNewAccount)&&(null==e?void 0:e.handle)){let a={handle:null==e?void 0:e.handle,conversationId:p};console.log("Updating the conversation id");let o=await (0,r.f4)("/api/private/accounts/setConversationId",a);(null==o?void 0:o.error)&&t("Could not update conversationId")}t("")}catch(e){t(displayErrorString(t)),console.log({error:e})}finally{a(0)}};return{establishConnection:(0,o.useCallback)(m,[c,s,d]),setGroupMembers:p,groupMembers:s,conversationId:u}}},33709:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return N}});var r=a(85893),o=a(24062),n=a(67294),l=a(32572),i=a(65449),c=a(42283),d=a(81160),s=a(11399),p=a(54035),u=a(20595),h=a(57343),m=a(39752);a(14252);var g=a(17812),b=a(68489),x=a(41120),f=a(39550),y=a(9921),v=a(16204),C=a(17625),k=a(59010);let Z=(0,x.Z)(e=>({root:{display:"flex",flexWrap:"wrap"},hidden:{marginTop:"20px",display:"none"},block:{display:"block",marginTop:"10px"},break:{flexBasis:"100%"},chipbox:{paddingRight:e.spacing(2),paddingBottom:e.spacing(2)},chipnbutton:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"nowrap",width:"100%"},chip:{borderRadius:"24px",marginRight:"3px",height:"40px",textAlign:"left",minWidth:"80px","& .MuiChip-label":{minWidth:"58px",textAlign:"center"}},selectedChip:{background:"white !important",color:"black !important",borderRadius:"24px",marginRight:"3px",height:"40px",textAlign:"left",minWidth:"80px","& .MuiChip-label":{minWidth:"54px",textAlign:"center"},"& .MuiChip-deleteIcon":{margin:"0 5px 0 -7px",width:"29px",height:"29px",color:"black"}}})),j=(0,n.forwardRef)((e,t)=>{let{user:a,loading:o,setErrorMsg:c,setThinking:s}=(0,n.useContext)(l.St),g=(0,n.useRef)(t),[b,x]=(0,f.Z)(!1),[j,w]=(0,f.Z)(""),I=Z(),[S,N]=(0,f.Z)(null==e?void 0:e.members),{Reveal:R}=(0,C.Z)(),{clearErrors:T}=e.methods,E=()=>{g.current.value="",w(""),x(!1)};(0,n.useEffect)(()=>
1{(null==e?void 0:e.onChange)&&e.onChange(S)},[S]),(0,n.useEffect)(()=>{0===S.length&&(null==a?void 0:a.handle)&&N([null==a?void 0:a.handle])},[null==a?void 0:a.handle]);let z=e=>{N(S?[...S,e]:[e])},D=()=>{setTimeout(()=>{g.current.focus()},1e3)},M=async e=>{try{s(1),$(e);let{capabilities:t,error:a}=await (0,y.f4)("/api/internal/user/checkPaymailCapabilities",{paymail:e});if(a)return w((0,y.dV)(a));(null==t?void 0:t[m.AU.MESSAGING])?(z(e),E(),c("")):w("That paymail does not support encrypted messaging.")}catch(e){return console.log({error:e}),w((0,y.dV)(e))}finally{s(0)}},O=async e=>{try{if(s(1),$(e)){w("".concat(e," is already a member"));return}(await (0,y.f4)("/api/internal/user/checkMember",{handle:e})).exists?(z(e),E()):(w("User Not Found: ".concat(e)),x(!0))}finally{s(0)}},P=async e=>{if(w(""),x(!1),c(""),S.length+1>m.xA){w("Max 10 signatories");return}let t=RegExp("^[A-Z0-9._%+-]+@".concat("signavera.com","$"),"i").exec(e.toString());!t&&e.match(/^[A-z0-9._%+-]+@[A-z0-9.-]+\.[A-z]{2,}$/i)?M(e):O(t?e.split("@")[0]:e),D()},$=e=>!!S&&-1!==S.indexOf(e),_=e=>{let t=e.currentTarget.previousSibling.innerText;N(S.filter(e=>e!==t))},A={...e};return(null==A?void 0:A.onChange)&&delete A.onChange,(0,r.jsxs)(i.Z,{display:"flex",width:"100%",className:I.root,children:[(0,r.jsx)(i.Z,{justifyContent:"flex-start",display:"flex",flexWrap:"wrap",width:"100%",children:S.map((e,t)=>0===Number(t)?(0,r.jsxs)(i.Z,{display:"flex",alignItems:"center",justifyContent:"flex-start",width:"100%",pb:2,children:[(0,r.jsx)(i.Z,{pb:2,width:"80px",children:(0,r.jsx)(d.D,{variant:"body1",children:"From"})}),(0,r.jsx)(v.Z,{color:"primary",label:e,disabled:o,className:I.chip})]},t):(0,r.jsxs)(i.Z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[1===Number(t)&&(0,r.jsx)(i.Z,{pb:2,width:"80px",children:(0,r.jsx)(d.D,{variant:"body1",children:"To"})}),(0,r.jsx)(k.Z,{index:t,elasMotion:R,children:(0,r.jsx)(i.Z,{className:I.chipbox,children:(0,r.jsx)(v.Z,{label:e,onDelete:e=>_(e),disabled:o,className:I.selectedChip})})},t)]},t))}),(0,r.jsx)(i.Z,{display:"flex",width:"100%",className:I.block,children:(0,r.jsx)(k.Z,{width:"100%",index:1,elasMotion:R,children:(0,r.jsx)(p.Z,{alignItems:"center",justify:"flex-start",children:(0,r.jsx)(u.Z,{span:12,children:(0,r.jsx)(h.Z,{itype:m.Je.ROUNDEDSTRING,name:"userHandle",id:"memberInput",fullWidth:!0,autoFocus:!0,InputLabelProps:{shrink:!0},inputRef:g,helperText:j,autoComplete:"off",label:"User Handle, or Paymail",placeholder:"Enter User Handle, or Paymail",size:"small",error:b,disabled:o,onChange:e=>{x(!1),w(""),T(),c("");let t=e.currentTarget.querySelectorAll("p");t.length&&(t[0].innerText="")},onKeyPress:e=>{e.stopPropagation();let t=e.currentTarget.querySelectorAll("input")[0].value;(";"===e.key||"Enter"===e.key)&&(e.preventDefault(),P(t))}})})})})})]})});var w=a(68541);function I(e){var t;let{methods:a}=e,{loading:o,setErrorMsg:c}=(0,n.useContext)(l.St),{clearErrors:d,register:s,errors:p}=a;return(0,r.jsx)(i.Z,{children:(0,r.jsx)(i.Z,{py:1,children:(0,r.jsx)(h.Z,{itype:m.Je.ROUNDEDSTRINGICON,fullWidth:!0,placeholder:"Enter Subject",name:"subject",label:"Subject",disabled:o,error:!!(null==p?void 0:p.subject),helperText:null==p?void 0:null===(t=p.subject)||void 0===t?void 0:t.message,onChange:()=>{d(),c("")},inputRef:s({required:"Subject is required"})})})})}function S(){let{isMobile:e,isTablet:t,layoutKey:a}=(0,n.useContext)(l.Ly),{errorMsg:o,loading:c,setErrorMsg:h}=(0,n.useContext)(l.St);return(0,r.jsx)(i.Z,{py:3,children:(0,r.jsxs)(p.Z,{columns:e||t?4:12,children:[o&&(0,r.jsx)(i.Z,{style:{width:"100%",textAlign:"center"},my:3,height:"20px",children:(0,r.jsx)(d.D,{variant:"overline",color:"error",children:o})}),(0,r.jsx)(u.Z,{span:e||t?2:10}),(0,r.jsx)(u.Z,{span:2,children:(0,r.jsx)(s.Z,{fullWidth:!0,type:"submit",disabled:c,onClick:()=>h(""),children:"Create"})})]})},a)}var N=()=>{let{isMobile:e,navBack:t}=(0,n.useContext)(l.Ly),{groupMembers:a,setGroupMembers:s,establishConnection:h}=(0,w.Z)(),m=(0,c.cI)({mode:"onSubmit",reValidateMode:"onChange",resolver:void 0,context:void 0,criteriaMode:"all",shouldFocusError:!0,shouldUnregister:!0}),{handleSubmit:x}=m;return(0,r.jsx)(o.Z,{align:"center",details:{title:"UltraMega"},children:(0,r.jsxs)(i.Z,{justifyContent:"left",width:"100%",children:[!e&&(0,r.jsxs)(p.Z,{container:!0,justify:"flex-start",alignItems:"center",spacing:2,columns:12,children:[(0,r.jsx)(u.Z,{span:1,children:(0,r.jsx)(g.Z,{size:"medium",onClick:()=>t("/"),children:(0,r.jsx)(b.eJ,{})})}),(0,r.jsx)(u.Z,{span:5,children:(0,r.jsx)(d.D,{variant:"h5",children:"New Conversation"})})]}),(0,r.jsx)(i.Z,{py:5,width:"100%",children:(0,r.jsxs)("form",{onSubmit:x(h),style:{width:"inherit"},children:[(0,r.jsx)(i.Z,{mb:3,children:(0,r.jsx)(j,{editmode:!1,isChat:!0,invitedMembers:[],setInvitedMembers:null,members:a,onChange:e=>{s(e)},methods:m})}),(0,r.jsx)(i.Z,{mb:3,children:(0,r.jsx)(d.D,{variant:"body1",children:"Subject"})}),(0,r.jsx)(I,{methods:m}),(0,r.jsx)(S,{})]})})]})})}}},function(e){e.O(0,[272,700,230,37,221,62,774,888,179],function(){return e(e.s=30673)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.