12 |
- (this["webpackJsonpreact-21-22"]=this["webpackJsonpreact-21-22"]||[]).push([[1],{508:function(e,a,n){"use strict";var t=n(138);Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var o=t(n(144)),c=n(7),i=(0,o.default)((0,c.jsx)("path",{d:"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"}),"Folder");a.default=i},595:function(e,a,n){"use strict";n.r(a);var t=n(1),o=n.n(t),c=n(4),i=n(141),r=n(7),d=n(0),l=n(21),s=n.p+"static/media/qrCode_telegram.bb0caf3c.png",m=n(574),u=n(587),b=Object(m.a)({container:{display:"flex",alignItems:"center",alignContent:"center",flexDirection:"column",width:350,margin:"0 auto",paddingTop:64,paddingBottom:24},picture:{marginBottom:16},title:{textAlign:"center",marginBottom:16},titleSpan:{display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center",width:25,height:25,position:"absolute",left:780,backgroundColor:"#5497f0",borderRadius:"50%",color:"#ffffff"},button:{marginTop:20,height:50,color:"#5497f0"}}),p=function(e){var a=e.handleIsQR,n=b();return Object(r.jsxs)("div",{className:n.container,children:[Object(r.jsx)("img",{className:n.picture,alt:"QRCode",src:s,width:"300",height:"300"}),Object(r.jsx)("h2",{className:n.title,children:"Log in to Telegram by QR Code"}),Object(r.jsxs)("h3",{className:n.title,children:[Object(r.jsx)("span",{className:n.titleSpan,children:"1"}),"Open Telegram on your phone"]}),Object(r.jsxs)("h3",{className:n.title,children:[Object(r.jsx)("span",{className:n.titleSpan,children:"2"}),"Go to Settings > Devices > Link Desktop Device"]}),Object(r.jsxs)("h3",{className:n.title,children:[Object(r.jsx)("span",{className:n.titleSpan,children:"3"}),"Log in to Telegram by QR Code"]}),Object(r.jsx)(u.a,{onClick:a,className:n.button,variant:"text",color:"default",fullWidth:!0,children:"LOG IN BY PHONE NUMBER"})]})},g=n.p+"static/media/icons8-telegram-app.be023370.svg",h=n(593),j=n(143),f=n(193),O=n(2),v=n(23),x=n(149),y=n(604),C=n(323),N=n(185),S=n(248),I=n(22),k="undefined"===typeof window?d.useEffect:d.useLayoutEffect,w=d.forwardRef((function(e,a){var n=e.alignItems,t=void 0===n?"center":n,o=e.autoFocus,c=void 0!==o&&o,i=e.button,r=void 0!==i&&i,l=e.children,s=e.classes,m=e.className,u=e.component,b=e.ContainerComponent,p=void 0===b?"li":b,g=e.ContainerProps,h=(g=void 0===g?{}:g).className,f=Object(j.a)(g,["className"]),x=e.dense,w=void 0!==x&&x,B=e.disabled,T=void 0!==B&&B,R=e.disableGutters,P=void 0!==R&&R,A=e.divider,M=void 0!==A&&A,L=e.focusVisibleClassName,F=e.selected,E=void 0!==F&&F,G=Object(j.a)(e,["alignItems","autoFocus","button","children","classes","className","component","ContainerComponent","ContainerProps","dense","disabled","disableGutters","divider","focusVisibleClassName","selected"]),D=d.useContext(S.a),z={dense:w||D.dense||!1,alignItems:t},W=d.useRef(null);k((function(){c&&W.current&&W.current.focus()}),[c]);var V=d.Children.toArray(l),Q=V.length&&Object(C.a)(V[V.length-1],["ListItemSecondaryAction"]),H=d.useCallback((function(e){W.current=I.findDOMNode(e)}),[]),K=Object(N.a)(H,a),U=Object(O.a)({className:Object(v.a)(s.root,m,z.dense&&s.dense,!P&&s.gutters,M&&s.divider,T&&s.disabled,r&&s.button,"center"!==t&&s.alignItemsFlexStart,Q&&s.secondaryAction,E&&s.selected),disabled:T},G),Z=u||"li";return r&&(U.component=u||"div",U.focusVisibleClassName=Object(v.a)(s.focusVisible,L),Z=y.a),Q?(Z=U.component||u?Z:"div","li"===p&&("li"===Z?Z="div":"li"===U.component&&(U.component="div")),d.createElement(S.a.Provider,{value:z},d.createElement(p,Object(O.a)({className:Object(v.a)(s.container,h),ref:K},f),d.createElement(Z,U,V),V.pop()))):d.createElement(S.a.Provider,{value:z},d.createElement(Z,Object(O.a)({ref:K},U),V))})),B=Object(x.a)((function(e){return{root:{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,"&$focusVisible":{backgroundColor:e.palette.action.selected},"&$selected, &$selected:hover":{backgroundColor:e.palette.action.selected},"&$disabled":{opacity:.5}},container:{position:"relative"},focusVisible:{},dense:{paddingTop:4,paddingBottom:4},alignItemsFlexStart:{alignItems:"flex-start"},disabled:{},divider:{borderBottom:"1px solid ".concat(e.palette.divider),backgroundClip:"padding-box"},gutters:{paddingLeft:16,paddingRight:16},button:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:e.palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}},secondaryAction:{paddingRight:48},selected:{}}}),{name:"MuiListItem"})(w),T=d.forwardRef((function(e,a){var n,t=e.classes,o=e.className,c=e.component,i=void 0===c?"li":c,r=e.disableGutters,l=void 0!==r&&r,s=e.ListItemClasses,m=e.role,u=void 0===m?"menuitem":m,b=e.selected,p=e.tabIndex,g=Object(j.a)(e,["classes","className","component","disableGutters","ListItemClasses","role","selected","tabIndex"]);return e.disabled||(n=void 0!==p?p:-1),d.createElement(B,Object(O.a)({button:!0,role:u,tabIndex:n,component:i,selected:b,disableGutters:l,classes:Object(O.a)({dense:t.dense},s),className:Object(v.a)(t.root,o,b&&t.selected,!l&&t.gutters),ref:a},g))})),R=Object(x.a)((function(e){return{root:Object(O.a)({},e.typography.body1,Object(f.a)({minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",width:"auto",overflow:"hidden",whiteSpace:"nowrap"},e.breakpoints.up("sm"),{minHeight:"auto"})),gutters:{},selected:{},dense:Object(O.a)({},e.typography.body2,{minHeight:"auto"})}}),{name:"MuiMenuItem"})(T),P=n(602),A=n(6),M=n(15),L=n(564),F=n(277),E=n(619),G=n(175),D=n(147),z=n(148),W=n(565),V=n(566);function Q(e){return Object(W.a)("MuiFormControlLabel",e)}var H=Object(V.a)("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error"]),K=n(324),U=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","value"],Z=Object(D.a)("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:function(e,a){var n=e.ownerState;return[Object(A.a)({},"& .".concat(H.label),a.label),a.root,a["labelPlacement".concat(Object(G.a)(n.labelPlacement))]]}})((function(e){var a=e.theme,n=e.ownerState;return Object(O.a)(Object(A.a)({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16},"&.".concat(H.disabled),{cursor:"default"}),"start"===n.labelPlacement&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},"top"===n.labelPlacement&&{flexDirection:"column-reverse",marginLeft:16},"bottom"===n.labelPlacement&&{flexDirection:"column",marginLeft:16},Object(A.a)({},"& .".concat(H.label),Object(A.a)({},"&.".concat(H.disabled),{color:a.palette.text.disabled})))})),q=d.forwardRef((function(e,a){var n=Object(z.a)({props:e,name:"MuiFormControlLabel"}),t=n.className,o=n.componentsProps,c=void 0===o?{}:o,i=n.control,l=n.disabled,s=n.disableTypography,m=n.label,u=n.labelPlacement,b=void 0===u?"end":u,p=Object(M.a)(n,U),g=Object(F.a)(),h=l;"undefined"===typeof h&&"undefined"!==typeof i.props.disabled&&(h=i.props.disabled),"undefined"===typeof h&&g&&(h=g.disabled);var j={disabled:h};["checked","name","onChange","value","inputRef"].forEach((function(e){"undefined"===typeof i.props[e]&&"undefined"!==typeof n[e]&&(j[e]=n[e])}));var f=Object(K.a)({props:n,muiFormControl:g,states:["error"]}),x=Object(O.a)({},n,{disabled:h,label:m,labelPlacement:b,error:f.error}),y=function(e){var a=e.classes,n=e.disabled,t=e.labelPlacement,o=e.error,c={root:["root",n&&"disabled","labelPlacement".concat(Object(G.a)(t)),o&&"error"],label:["label",n&&"disabled"]};return Object(L.a)(c,Q,a)}(x);return Object(r.jsxs)(Z,Object(O.a)({className:Object(v.a)(y.root,t),ownerState:x,ref:a},p,{children:[d.cloneElement(i,j),m.type===E.a||s?m:Object(r.jsx)(E.a,Object(O.a)({component:"span",className:y.label},c.typography,{children:m}))]}))})),J=[{code:"+7 840",name:"Abkhazia"},{code:"+93",name:"Afghanistan"},{code:"+355",name:"Albania"},{code:"+213",name:"Algeria"},{code:"+1 684",name:"American Samoa"},{code:"+376",name:"Andorra"},{code:"+244",name:"Angola"},{code:"+1 264",name:"Anguilla"},{code:"+1 268",name:"Antigua and Barbuda"},{code:"+54",name:"Argentina"},{code:"+374",name:"Armenia"},{code:"+297",name:"Aruba"},{code:"+247",name:"Ascension"},{code:"+61",name:"Australia"},{code:"+672",name:"Australian External Territories"},{code:"+43",name:"Austria"},{code:"+994",name:"Azerbaijan"},{code:"+1 242",name:"Bahamas"},{code:"+973",name:"Bahrain"},{code:"+880",name:"Bangladesh"},{code:"+1 246",name:"Barbados"},{code:"+1 268",name:"Barbuda"},{code:"+375",name:"Belarus"},{code:"+32",name:"Belgium"},{code:"+501",name:"Belize"},{code:"+229",name:"Benin"},{code:"+1 441",name:"Bermuda"},{code:"+975",name:"Bhutan"},{code:"+591",name:"Bolivia"},{code:"+387",name:"Bosnia and Herzegovina"},{code:"+267",name:"Botswana"},{code:"+55",name:"Brazil"},{code:"+246",name:"British Indian Ocean Territory"},{code:"+1 284",name:"British Virgin Islands"},{code:"+673",name:"Brunei"},{code:"+359",name:"Bulgaria"},{code:"+226",name:"Burkina Faso"},{code:"+257",name:"Burundi"},{code:"+855",name:"Cambodia"},{code:"+237",name:"Cameroon"},{code:"+1",name:"Canada"},{code:"+238",name:"Cape Verde"},{code:"+ 345",name:"Cayman Islands"},{code:"+236",name:"Central African Republic"},{code:"+235",name:"Chad"},{code:"+56",name:"Chile"},{code:"+86",name:"China"},{code:"+61",name:"Christmas Island"},{code:"+61",name:"Cocos-Keeling Islands"},{code:"+57",name:"Colombia"},{code:"+269",name:"Comoros"},{code:"+242",name:"Congo"},{code:"+243",name:"Congo, Dem. Rep. of (Zaire)"},{code:"+682",name:"Cook Islands"},{code:"+506",name:"Costa Rica"},{code:"+385",name:"Croatia"},{code:"+53",name:"Cuba"},{code:"+599",name:"Curacao"},{code:"+537",name:"Cyprus"},{code:"+420",name:"Czech Republic"},{code:"+45",name:"Denmark"},{code:"+246",name:"Diego Garcia"},{code:"+253",name:"Djibouti"},{code:"+1 767",name:"Dominica"},{code:"+1 809",name:"Dominican Republic"},{code:"+670",name:"East Timor"},{code:"+56",name:"Easter Island"},{code:"+593",name:"Ecuador"},{code:"+20",name:"Egypt"},{code:"+503",name:"El Salvador"},{code:"+240",name:"Equatorial Guinea"},{code:"+291",name:"Eritrea"},{code:"+372",name:"Estonia"},{code:"+251",name:"Ethiopia"},{code:"+500",name:"Falkland Islands"},{code:"+298",name:"Faroe Islands"},{code:"+679",name:"Fiji"},{code:"+358",name:"Finland"},{code:"+33",name:"France"},{code:"+596",name:"French Antilles"},{code:"+594",name:"French Guiana"},{code:"+689",name:"French Polynesia"},{code:"+241",name:"Gabon"},{code:"+220",name:"Gambia"},{code:"+995",name:"Georgia"},{code:"+49",name:"Germany"},{code:"+233",name:"Ghana"},{code:"+350",name:"Gibraltar"},{code:"+30",name:"Greece"},{code:"+299",name:"Greenland"},{code:"+1 473",name:"Grenada"},{code:"+590",name:"Guadeloupe"},{code:"+1 671",name:"Guam"},{code:"+502",name:"Guatemala"},{code:"+224",name:"Guinea"},{code:"+245",name:"Guinea-Bissau"},{code:"+595",name:"Guyana"},{code:"+509",name:"Haiti"},{code:"+504",name:"Honduras"},{code:"+852",name:"Hong Kong SAR China"},{code:"+36",name:"Hungary"},{code:"+354",name:"Iceland"},{code:"+91",name:"India"},{code:"+62",name:"Indonesia"},{code:"+98",name:"Iran"},{code:"+964",name:"Iraq"},{code:"+353",name:"Ireland"},{code:"+972",name:"Israel"},{code:"+39",name:"Italy"},{code:"+225",name:"Ivory Coast"},{code:"+1 876",name:"Jamaica"},{code:"+81",name:"Japan"},{code:"+962",name:"Jordan"},{code:"+7 7",name:"Kazakhstan"},{code:"+254",name:"Kenya"},{code:"+686",name:"Kiribati"},{code:"+965",name:"Kuwait"},{code:"+996",name:"Kyrgyzstan"},{code:"+856",name:"Laos"},{code:"+371",name:"Latvia"},{code:"+961",name:"Lebanon"},{code:"+266",name:"Lesotho"},{code:"+231",name:"Liberia"},{code:"+218",name:"Libya"},{code:"+423",name:"Liechtenstein"},{code:"+370",name:"Lithuania"},{code:"+352",name:"Luxembourg"},{code:"+853",name:"Macau SAR China"},{code:"+389",name:"Macedonia"},{code:"+261",name:"Madagascar"},{code:"+265",name:"Malawi"},{code:"+60",name:"Malaysia"},{code:"+960",name:"Maldives"},{code:"+223",name:"Mali"},{code:"+356",name:"Malta"},{code:"+692",name:"Marshall Islands"},{code:"+596",name:"Martinique"},{code:"+222",name:"Mauritania"},{code:"+230",name:"Mauritius"},{code:"+262",name:"Mayotte"},{code:"+52",name:"Mexico"},{code:"+691",name:"Micronesia"},{code:"+1 808",name:"Midway Island"},{code:"+373",name:"Moldova"},{code:"+377",name:"Monaco"},{code:"+976",name:"Mongolia"},{code:"+382",name:"Montenegro"},{code:"+1664",name:"Montserrat"},{code:"+212",name:"Morocco"},{code:"+95",name:"Myanmar"},{code:"+264",name:"Namibia"},{code:"+674",name:"Nauru"},{code:"+977",name:"Nepal"},{code:"+31",name:"Netherlands"},{code:"+599",name:"Netherlands Antilles"},{code:"+1 869",name:"Nevis"},{code:"+687",name:"New Caledonia"},{code:"+64",name:"New Zealand"},{code:"+505",name:"Nicaragua"},{code:"+227",name:"Niger"},{code:"+234",name:"Nigeria"},{code:"+683",name:"Niue"},{code:"+672",name:"Norfolk Island"},{code:"+850",name:"North Korea"},{code:"+1 670",name:"Northern Mariana Islands"},{code:"+47",name:"Norway"},{code:"+968",name:"Oman"},{code:"+92",name:"Pakistan"},{code:"+680",name:"Palau"},{code:"+970",name:"Palestinian Territory"},{code:"+507",name:"Panama"},{code:"+675",name:"Papua New Guinea"},{code:"+595",name:"Paraguay"},{code:"+51",name:"Peru"},{code:"+63",name:"Philippines"},{code:"+48",name:"Poland"},{code:"+351",name:"Portugal"},{code:"+1 787",name:"Puerto Rico"},{code:"+974",name:"Qatar"},{code:"+262",name:"Reunion"},{code:"+40",name:"Romania"},{code:"+7",name:"Russia"},{code:"+250",name:"Rwanda"},{code:"+685",name:"Samoa"},{code:"+378",name:"San Marino"},{code:"+966",name:"Saudi Arabia"},{code:"+221",name:"Senegal"},{code:"+381",name:"Serbia"},{code:"+248",name:"Seychelles"},{code:"+232",name:"Sierra Leone"},{code:"+65",name:"Singapore"},{code:"+421",name:"Slovakia"},{code:"+386",name:"Slovenia"},{code:"+677",name:"Solomon Islands"},{code:"+27",name:"South Africa"},{code:"+500",name:"South Georgia and the South Sandwich Islands"},{code:"+82",name:"South Korea"},{code:"+34",name:"Spain"},{code:"+94",name:"Sri Lanka"},{code:"+249",name:"Sudan"},{code:"+597",name:"Suriname"},{code:"+268",name:"Swaziland"},{code:"+46",name:"Sweden"},{code:"+41",name:"Switzerland"},{code:"+963",name:"Syria"},{code:"+886",name:"Taiwan"},{code:"+992",name:"Tajikistan"},{code:"+255",name:"Tanzania"},{code:"+66",name:"Thailand"},{code:"+670",name:"Timor Leste"},{code:"+228",name:"Togo"},{code:"+690",name:"Tokelau"},{code:"+676",name:"Tonga"},{code:"+1 868",name:"Trinidad and Tobago"},{code:"+216",name:"Tunisia"},{code:"+90",name:"Turkey"},{code:"+993",name:"Turkmenistan"},{code:"+1 649",name:"Turks and Caicos Islands"},{code:"+688",name:"Tuvalu"},{code:"+1 340",name:"U.S. Virgin Islands"},{code:"+256",name:"Uganda"},{code:"+380",name:"Ukraine"},{code:"+971",name:"United Arab Emirates"},{code:"+44",name:"United Kingdom"},{code:"+1",name:"United States"},{code:"+598",name:"Uruguay"},{code:"+998",name:"Uzbekistan"},{code:"+678",name:"Vanuatu"},{code:"+58",name:"Venezuela"},{code:"+84",name:"Vietnam"},{code:"+1 808",name:"Wake Island"},{code:"+681",name:"Wallis and Futuna"},{code:"+967",name:"Yemen"},{code:"+260",name:"Zambia"},{code:"+255",name:"Zanzibar"},{code:"+263",name:"Zimbabwe"}],Y=Object(m.a)({container:{display:"flex",alignItems:"center",alignContent:"center",flexDirection:"column",width:350,margin:"0 auto",paddingTop:64,paddingBottom:24},picture:{marginBottom:16,paddingLeft:45},title:{textAlign:"center",marginBottom:16},titleConfirm:{color:"#b4b4b4",fontWeight:400},buttonQR:{marginTop:20,height:50,color:"#5497f0"},buttonNext:{marginTop:20,height:50,color:"#f8f8f8",backgroundColor:"#1d74c5"},textField:{marginBottom:20}}),$=function(e){var a=e.handleIsQR,n=e.handleIsCheck,t=e.handleSendCode,o=e.number,c=e.setNumber,i=e.setCountry,d=e.isChecked,l=e.isValidCredentials,s=Y(),m=function(e){var a,n=e.target.value;switch(e.target.name){case"country":i(n);var t=null===(a=J.find((function(e){return e.name===n})))||void 0===a?void 0:a.code;t&&c(t);break;case"number":c(n)}};return Object(r.jsxs)("div",{className:s.container,children:[Object(r.jsx)("img",{className:s.picture,alt:"QRCode",src:g,width:"270",height:"270"}),Object(r.jsx)("h2",{className:s.title,children:"Telegram"}),Object(r.jsx)("h4",{className:s.title+" "+s.titleConfirm,children:"Please confirm your country code and enter your phone number."}),Object(r.jsx)(h.a,{id:"country",name:"country",label:"Country",fullWidth:!0,variant:"outlined",defaultValue:"",select:!0,className:s.textField,onChange:m,children:J.map((function(e){var a=e.name;return Object(r.jsx)(R,{value:a,children:a},a)}))}),Object(r.jsx)(h.a,{id:"number",name:"number",label:"Your phone number",value:o,fullWidth:!0,variant:"outlined",onChange:m}),Object(r.jsx)(q,{label:"Keep me signed in",control:Object(r.jsx)(P.a,{checked:d,onChange:n,inputProps:{"aria-label":"controlled"}})}),l()&&Object(r.jsx)(u.a,{onClick:t,className:s.buttonNext,color:"primary",variant:"contained",fullWidth:!0,children:"NEXT"}),Object(r.jsx)(u.a,{onClick:a,className:s.buttonQR,variant:"text",color:"default",fullWidth:!0,children:"LOG IN BY QR CODE"})]})},_=n.p+"static/media/monkey.ded8ac2a.png",X=n(578),ee=n(589),ae=n(315),ne=n.n(ae),te=Object(m.a)({container:{display:"flex",alignItems:"center",alignContent:"center",flexDirection:"column",width:350,margin:"0 auto",paddingTop:64,paddingBottom:24},picture:{marginBottom:70},titleConfirm:{color:"#b4b4b4",fontWeight:400,textAlign:"center",marginBottom:20},buttonSubmit:{marginTop:20,height:50,color:"#5497f0"},textField:{marginBottom:20}}),oe=function(e){var a=e.handleIsValidCode,n=e.number,t=e.handleResetState,o=te();return Object(r.jsxs)("div",{className:o.container,children:[Object(r.jsx)("img",{className:o.picture,alt:"QRCode",src:_,width:"150",height:"150"}),Object(r.jsxs)(X.a,{variant:"h4",color:"initial",children:[n,Object(r.jsx)(ee.a,{size:"medium","aria-label":"secondary",onClick:t,children:Object(r.jsx)(ne.a,{})})]}),Object(r.jsx)("h3",{className:o.titleConfirm,children:"We've sent the code to the Telegram app on your other device."}),Object(r.jsx)(h.a,{id:"code",name:"code",label:"Code",variant:"outlined",fullWidth:!0,className:o.textField,onChange:a})]})},ce=d.forwardRef((function(e,a){var n=e.classes,t=e.className,o=Object(j.a)(e,["classes","className"]),c=d.useContext(S.a);return d.createElement("div",Object(O.a)({className:Object(v.a)(n.root,t,"flex-start"===c.alignItems&&n.alignItemsFlexStart),ref:a},o))})),ie=Object(x.a)((function(e){return{root:{minWidth:56,color:e.palette.action.active,flexShrink:0,display:"inline-flex"},alignItemsFlexStart:{marginTop:8}}}),{name:"MuiListItemIcon"})(ce),re=d.forwardRef((function(e,a){var n=e.children,t=e.classes,o=e.className,c=e.disableTypography,i=void 0!==c&&c,r=e.inset,l=void 0!==r&&r,s=e.primary,m=e.primaryTypographyProps,u=e.secondary,b=e.secondaryTypographyProps,p=Object(j.a)(e,["children","classes","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"]),g=d.useContext(S.a).dense,h=null!=s?s:n;null==h||h.type===X.a||i||(h=d.createElement(X.a,Object(O.a)({variant:g?"body2":"body1",className:t.primary,component:"span",display:"block"},m),h));var f=u;return null==f||f.type===X.a||i||(f=d.createElement(X.a,Object(O.a)({variant:"body2",className:t.secondary,color:"textSecondary",display:"block"},b),f)),d.createElement("div",Object(O.a)({className:Object(v.a)(t.root,o,g&&t.dense,l&&t.inset,h&&f&&t.multiline),ref:a},p),h,f)})),de=Object(x.a)({root:{flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},multiline:{marginTop:6,marginBottom:6},dense:{},inset:{paddingLeft:56},primary:{},secondary:{}},{name:"MuiListItemText"})(re),le=n(282),se=n.n(le),me=n(14),ue=n(613),be=n(335),pe=n.n(be),ge=n(293),he=Object(m.a)({container:{width:"100%"},dropZone:{display:"flex",flexDirection:"column",alignItems:"center",alignContent:"center",justifyContent:"center",width:"100%",padding:"10px",borderRadius:10,cursor:"pointer",marginBottom:20,outline:"2px solid #959696","&:hover":{outline:"dashed rgb(41, 139, 231)"}},dropZoneActive:{display:"flex",flexDirection:"column",alignItems:"center",alignContent:"center",justifyContent:"center",width:"100%",padding:"10px",borderRadius:10,cursor:"pointer",marginBottom:20,outline:"2px dashed rgb(41, 139, 231)"}}),je=function(e){var a=e.setUpload,n=e.upload,t=e.setSelfie,o=Object(ge.a)({accept:"image/*"}),c=o.acceptedFiles,i=o.getRootProps,l=o.getInputProps;Object(d.useEffect)((function(){a(c[0]),t(null)}),[a,t,c]);var s=he();return Object(r.jsx)("section",{className:s.container,children:Object(r.jsxs)("div",Object(me.a)(Object(me.a)({},i({className:n?s.dropZoneActive:s.dropZone})),{},{children:[Object(r.jsx)(ue.a,{children:"Drag or drop avatar"}),Object(r.jsx)("input",Object(me.a)({},l())),Object(r.jsx)(pe.a,{fontSize:"large",sx:{color:n?"rgb(62, 149, 231)":"#6b6b6b",margin:"15px 0px"}}),Object(r.jsx)(X.a,{variant:"h6",color:"initial",children:"image/*"})]}))})},fe=n(508),Oe=n.n(fe),ve=n(281),xe=n.n(ve),ye=n(283),Ce=n.n(ye),Ne=n(39),Se=n(51),Ie=Object(m.a)({container:{display:"flex",alignItems:"center",alignContent:"center",flexDirection:"column",width:350,margin:"0 auto",paddingTop:64,paddingBottom:24},title:{marginBottom:20,textAlign:"center"},selfieWrapper:{marginBottom:20,display:"flex",justifyContent:"center",alignItems:"center",alignContent:"center"},buttonNext:{marginTop:20,height:50,color:"#f8f8f8",backgroundColor:"#1d74c5"},textField:{marginBottom:20},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center",flexDirection:"column"},capturedPicture:{borderRadius:10,border:"solid 2px rgb(62, 149, 231)"},capturePhoto:{color:"#ffffff",cursor:"pointer","&:hover":{color:"#48ff00",animation:"$rotating 2s linear infinite"}},"@keyframes rotating":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}}),ke=function(){var e=Ie(),a=Object(d.useState)(""),n=Object(i.a)(a,2),t=n[0],s=n[1],m=Object(d.useState)(""),b=Object(i.a)(m,2),p=b[0],g=b[1],j=Object(d.useState)(null),f=Object(i.a)(j,2),O=f[0],v=f[1],x=Object(d.useState)(null),y=Object(i.a)(x,2),C=y[0],N=y[1],S=Object(d.useState)(!1),I=Object(i.a)(S,2),k=I[0],w=I[1],T=Object(l.b)(),R=function(e){var a=Object(Se.f)(e.target.value);switch(e.target.name){case"name":s(a);break;case"lastName":g(a)}},P=function(){var e=Object(c.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!O){e.next=2;break}return e.abrupt("return",T(Object(Ne.a)(t,p,O)));case 2:if(!C){e.next=4;break}return e.abrupt("return",fetch(C).then((function(e){return e.blob()})).then((function(e){var a=new File([e],"selfie",{type:"image/jpeg"});T(Object(Ne.a)(t,p,a))})));case 4:T(Object(Ne.a)(t,p,null));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(r.jsxs)("div",{className:e.container,children:[Object(r.jsxs)("div",{className:e.selfieWrapper,children:[Object(r.jsx)(X.a,{variant:"h6",color:"initial",style:{textAlign:"center",marginRight:10},children:"Capture avatar"}),Object(r.jsx)(se.a,{onClick:function(){w(!0),O&&v(null)},fontSize:"large",sx:{color:C?"rgb(62, 149, 231)":"#6b6b6b","&:hover":{color:"rgb(41, 139, 231)"},cursor:"pointer"}})]}),Object(r.jsx)(je,{setUpload:v,upload:O,setSelfie:N}),Object(r.jsx)("aside",{children:Object(r.jsx)("ul",{children:O||C?Object(r.jsxs)(B,{children:[Object(r.jsx)(ie,{children:Object(r.jsx)(Oe.a,{})}),Object(r.jsx)(de,{primary:"Avatar uploaded",secondary:"".concat(O?O.path:"selfie.jpeg"," -").concat(O?O.size:C.length*(3/4)-2," bytes")})]}):null})}),k&&Object(r.jsx)("div",{onClick:function(e){"overlay"===e.target.id&&w(!1)},id:"overlay",className:e.overlay,children:Object(r.jsx)(xe.a,{audio:!1,screenshotFormat:"image/jpeg",width:"40%",videoConstraints:{width:1280,height:720,facingMode:"user"},style:{marginBottom:30},children:function(a){var n=a.getScreenshot;return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(Ce.a,{onClick:function(){N(n()),Object(Se.j)("".concat(Se.m,"/cameraCapture.mp3"))},className:e.capturePhoto,fontSize:"large",style:{marginBottom:30}}),Object(r.jsx)("img",{className:e.capturedPicture,width:"300",height:"174",style:{visibility:C?"visible":"hidden"},src:C,alt:"chosen pic"})]})}})}),Object(r.jsx)(X.a,{className:e.title,variant:"h5",color:"initial",children:"Fill credentials*"}),Object(r.jsx)(h.a,{id:"name",name:"name",label:"Name",value:t,fullWidth:!0,variant:"outlined",onChange:R,className:e.textField,required:!0}),Object(r.jsx)(h.a,{id:"lastName",name:"lastName",label:"LastName",value:p,fullWidth:!0,variant:"outlined",onChange:R,className:e.textField,required:!0}),function(){var e=t.length,a=p.length;return!(e<3||e>30)&&!(a<3||a>30)}()&&Object(r.jsx)(u.a,{onClick:P,className:e.buttonNext,color:"primary",variant:"contained",fullWidth:!0,children:" NEXT"})]})},we=n(17);a.default=function(){var e=Object(d.useState)(!1),a=Object(i.a)(e,2),n=a[0],t=a[1],s=Object(d.useState)(""),m=Object(i.a)(s,2),u=m[0],b=m[1],g=Object(d.useState)(!0),h=Object(i.a)(g,2),j=h[0],f=h[1],O=Object(d.useState)(!1),v=Object(i.a)(O,2),x=v[0],y=v[1],C=Object(d.useState)("Country"),N=Object(i.a)(C,2),S=N[0],I=N[1],k=Object(d.useState)(""),w=Object(i.a)(k,2),B=w[0],T=w[1],R=Object(l.b)(),P=function(){return t(!n)},A=function(){var e=Object(c.a)(o.a.mark((function e(a){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:u&&Object(Se.f)(a.target.value)===u&&R(Object(Ne.c)(B,u,(function(){return y(!x)})));case 1:case"end":return e.stop()}}),e)})));return function(a){return e.apply(this,arguments)}}(),M=function(){var e=Object(c.a)(o.a.mark((function e(){var a;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(we.b)(Object(Se.f)(B),S);case 2:(a=e.sent)&&b(a);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(d.useEffect)((function(){var e=localStorage.isChecked;e?f("true"===e):localStorage.setItem("isChecked","true")}),[]),x?Object(r.jsx)(ke,{}):u?Object(r.jsx)(oe,{handleIsValidCode:A,number:B,handleResetState:function(){b(""),I("Country"),T("")}}):n?Object(r.jsx)(p,{handleIsQR:P}):Object(r.jsx)($,{handleIsQR:P,handleSendCode:M,handleIsCheck:function(e){var a=e.target.checked;f(a),localStorage.isChecked=a},setNumber:T,number:B,setCountry:I,isChecked:j,isValidCredentials:function(){var e=B.split(" ").join("").trim().length;return!(e<13||e>13)&&(!(!S||"Country"===S)&&(B.slice(0,1),!0))}})}}}]);
- //# sourceMappingURL=AuthPage.8bf438db.chunk.js.map
|