/*! For license information please see 382.353433b4ccc0a182496e.js.LICENSE.txt */ "use strict";(self.webpackChunkchat=self.webpackChunkchat||[]).push([[382],{2517:(e,t,n)=>{n.d(t,{T:()=>o});var r=n(7489),i=n(3190),o={SendMessage:function(e){var t=e.content,n=void 0===t?"":t,o=e.type,a=void 0===o?0:o,s=e.baseMessageId,c=void 0===s?null:s,l=e.timeStamp,d=e.sign;this.name=i.Hj.SendMessage,this.model={content:n,type:a,baseMessageId:c,timeStamp:l,sign:d},this.messagePackModel=(0,r.parseObjectToArray)([a,n,c,d,l])},LikeMessage:function(e){var t=e.messageId,n=void 0===t?0:t;this.name=i.Hj.LikeMessage,this.model={messageId:n},this.messagePackModel=(0,r.parseObjectToArray)([n])},UnLikeMessage:function(e){var t=e.messageId,n=void 0===t?0:t;this.name=i.Hj.UnLikeMessage,this.model={messageId:n},this.messagePackModel=(0,r.parseObjectToArray)([n])},UpdatePlayer:function(e){var t=e.nickName,n=void 0===t?null:t,o=e.defaultAvatarId,a=void 0===o?0:o;this.name=i.Hj.UpdatePlayer,this.model={nickName:n,defaultAvatarId:a},this.messagePackModel=(0,r.parseObjectToArray)([n,a])}}},3414:(e,t,n)=>{n.r(t),n.d(t,{Backdrop:()=>A,default:()=>oe});var r=n(4914),i=n(678),o=n(3444),a=n.n(o),s=n(8874),c=n.n(s),l=n(7800),d=n(5094),u=n.n(d),f=n(6295),m=n(1543),h=n.n(m),p=n(2677),g=n.n(p),v=n(6309),y=n.n(v),b=n(7146),w=n.n(b),x=n(3484),j=n.n(x),k=n(9133),C=n(4228),I=n(2153),M=n(3190),S=n(4848);function O(e){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O(e)}function P(){P=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new E(r||[]);return i(a,"_invoke",{value:M(e,n,s)}),a}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var f="suspendedStart",m="suspendedYield",h="executing",p="completed",g={};function v(){}function y(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,j=x&&x(x(N([])));j&&j!==n&&r.call(j,a)&&(w=j);var k=b.prototype=v.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(i,o,a,s){var c=u(e[i],e,o);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==O(d)&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function M(t,n,r){var i=f;return function(o,a){if(i===h)throw Error("Generator is already running");if(i===p){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=S(s,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===f)throw i=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=h;var l=u(t,n,r);if("normal"===l.type){if(i=r.done?p:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=p,r.method="throw",r.arg=l.arg)}}}function S(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,S(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=u(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function N(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:N(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function L(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n *{color:#76cc3d;}"])),te=(0,r.memo)(c().div.withConfig({componentId:"sc-mebw0j-21"})(["font-size:0.75em;color:#a1a1a1;"])),ne=(0,r.memo)(c().span.withConfig({componentId:"sc-mebw0j-22"})(["display:inline-flex;width:0.875em;height:0.875em;margin-right:0.25em;"])),re=(0,r.memo)(c().span.withConfig({componentId:"sc-mebw0j-23"})(["padding:0.65em 0 0.375em;color:#b92322;display:inline-block;font:0.75em/1.5 var(--mainFont);"]));function ie(e){var t=e.style,n=(0,i.useDispatch)(),o=(0,r.useRef)(),a=N&&!u()(),s=(0,l.shallowSelector)(I.St),c=s.nickName,d=s.avatarUrl,f=s.canChangeNickName,m=(0,l.shallowSelector)(I.mC),p=(0,l.shallowSelector)(I.k9),v=(0,l.shallowSelector)(l.selectResources),b=v.strMyAccount,x=v.strNicknameExists,O=v.strOffensiveLanguage,E=v.strNickGuideline,ie=v.strAvatar,oe=v.strNickname,ae=v.strSubmit,se=v.strAcceptedChar,ce=v.strMin4Char,le=v.strMax12Char,de=_((0,r.useState)(!1),2),ue=de[0],fe=de[1],me=_((0,r.useState)(""),2),he=me[0],pe=me[1],ge=_((0,r.useState)({min:!1,max:!1,charters:!1}),2),ve=ge[0],ye=ge[1],be=_((0,r.useState)(0),2),we=be[0],xe=be[1];(0,r.useEffect)((function(){var e;xe((null===(e=m.find((function(e){return e.url===d})))||void 0===e?void 0:e.id)||1)}),[d]);var je=function(){var e,t=(e=P().mark((function e(){return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fe((function(e){return!e}));case 2:ue?pe(""):o.current.focus(),n(l.actions.setChatError({error:null}));case 4:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){L(o,r,i,a,s,"next",e)}function s(e){L(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}(),ke=(0,r.useMemo)((function(){var e,t=we===(null===(e=m.find((function(e){return e.url===d})))||void 0===e?void 0:e.id);return ue?!!Object.keys(ve).find((function(e){return!1===ve[e]})):t}),[we,d,m,ve,ue]);return(0,S.jsx)(A,{style:t.backdrop,children:(0,S.jsxs)(T,{style:t.container,isLandscape:a,children:[(0,S.jsxs)(B,{style:t.header,children:[(0,S.jsx)(R,{style:t.title,children:b||"_My account"}),(0,S.jsx)(G,{type:"button",style:t.closeBtn,onClick:function(){(0,i.batch)((function(){n(l.actions.closePopup({name:k.BASE_POPUP_NAMES.CHAT_REGISTRY_POPUP})),n(l.actions.setChatError({error:null}))}))},children:(0,S.jsx)(g(),{style:t.close,color:"rgba(var(--white), 0.8)"})})]}),(0,S.jsxs)(U,{style:t.formBlock,isLandscape:a,children:[(0,S.jsxs)(F,{isLandscape:a,px0:!0,children:[(0,S.jsx)(z,{style:t.labelBlock,px1:!0,isLandscape:a,children:(0,S.jsx)(H,{style:t.label,children:ie||"_Avatar"})}),(0,S.jsx)(D,{style:t.avatars,isLandscape:a,children:(0,S.jsx)(W,{style:t.avatarItems,children:m.map((function(e,n){return(0,S.jsx)(Y,{style:t.avatarImg,className:we===e.id?"selected":"",onClick:function(){return xe(e.id)},src:e.url,alt:"Avatar"},"avatar_".concat(n))}))})})]}),(0,S.jsxs)(F,{isLandscape:a,children:[(0,S.jsx)(z,{style:t.labelBlock,isLandscape:a,children:(0,S.jsx)(H,{style:t.label,children:oe||"_Nickname"})}),(0,S.jsxs)($,{style:t.inputBlock,children:[(0,S.jsx)(Z,{ref:o,style:t.inputElement,className:p?"error":"",type:"text",value:ue?he:c,onChange:function(e){var t,n={},r=(null===(t=e.target.value)||void 0===t?void 0:t.trim())||"";n.min=r.length>=4,n.max=!!r.length&&r.length<=12,n.charters=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]+$/.test(e.target.value),pe(e.target.value),ye(n)},readOnly:!ue,autoFocus:ue}),f&&(0,S.jsx)(J,{style:t.inputActionBtn,onClick:je,className:ue?"editMode":"editedMode",children:ue?(0,S.jsx)(y(),{}):(0,S.jsx)(h(),{})})]}),ue&&(0,S.jsxs)(K,{style:t.editModeValidations,children:[p===M.T2.NicknameExist&&(0,S.jsx)(re,{style:t.errorText,children:x||"_The chosen Nickname already exists. Please choose another one."}),p===M.T2.NicknameWithProfanity&&(0,S.jsx)(re,{style:t.errorText,children:O||"_No offensive, explicit, or inappropriate language is allowed."}),(0,S.jsx)(Q,{style:t.editModeInfo,children:E||"_Please make sure your nickname complies with the nickname guideline."}),(0,S.jsxs)(ee,{style:t.editModeValidation,className:ve.min&&null!=he&&he.length?"valid":"invalid",children:[ve.min&&null!=he&&he.length?(0,S.jsx)(ne,{style:t.editModeValidationIcon,children:(0,S.jsx)(w(),{style:t.editModeValidationCheck})}):(0,S.jsx)(ne,{style:t.editModeValidationIcon,children:(0,S.jsx)(j(),{style:t.editModeValidationCancel})}),(0,S.jsx)(te,{style:t.editModeValidationText,children:ce||"_Min. 4 characters"})]}),(0,S.jsxs)(ee,{style:t.editModeValidation,className:ve.max&&null!=he&&he.length?"valid":"invalid",children:[ve.max&&null!=he&&he.length?(0,S.jsx)(ne,{style:t.editModeValidationIcon,children:(0,S.jsx)(w(),{style:t.editModeValidationCheck})}):(0,S.jsx)(ne,{style:t.editModeValidationIcon,children:(0,S.jsx)(j(),{style:t.editModeValidationCancel})}),(0,S.jsx)(te,{style:t.editModeValidationText,children:le||"_Max. 12 characters"})]}),(0,S.jsxs)(ee,{style:t.editModeValidation,className:ve.charters&&null!=he&&he.length?"valid":"invalid",children:[ve.charters&&null!=he&&he.length?(0,S.jsx)(ne,{style:t.editModeValidationIcon,children:(0,S.jsx)(w(),{style:t.editModeValidationCheck})}):(0,S.jsx)(ne,{style:t.editModeValidationIcon,children:(0,S.jsx)(j(),{style:t.editModeValidationCancel})}),(0,S.jsx)(te,{style:t.editModeValidationText,children:se||"_Accepted characters: [a-z A-Z 0-9]"})]})]})]})]}),(0,S.jsx)(V,{style:t.footer,isLandscape:a,children:(0,S.jsx)(X,{style:t.button,className:ke?"disabled":"",type:"button",onClick:function(){var e={defaultAvatarId:we};f&&he&&(e.nickName=he),(0,C.LX)(e)},children:(0,S.jsx)(q,{style:t.buttonTxt,children:ae||"_Submit"})})})]})})}const oe=(0,r.memo)(ie);ie.defaultProps={style:{backdrop:{},container:{},header:{},title:{},closeBtn:{},close:{},formBlock:{},labelBlock:{},label:{},avatars:{},avatarItems:{},avatarImg:{},inputBlock:{},inputElement:{},inputActionBtn:{},editModeValidations:{},editModeInfo:{},editModeValidation:{},editModeValidationIcon:{},editModeValidationCheck:{},editModeValidationCancel:{},editModeValidationText:{}}},ie.propTypes={style:a().object}},1858:(e,t,n)=>{function r(e){var t=(new TextEncoder).encode(e);return crypto.subtle.digest("SHA-256",t).then((function(e){return Array.from(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}))}n.d(t,{t:()=>r})},2213:(e,t,n)=>{n.d(t,{A:()=>c});var r=n(6295),i=n(9133);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;tr?n:r:n},setSharedBigWinCoeff:function(e,t){var n=t.payload;e.gameInfo.sharedBigWinCoefficient=n},resetChatState:function(e){delete e.services.popups[i.BASE_POPUP_NAMES.CHAT_POPUP],delete e.services.popups[i.BASE_POPUP_NAMES.CHAT_REGISTRY_POPUP],e.services.chat={id:0,name:"",configuration:{minShareCoefficient:1e4},player:{id:0,isBlocked:!1,isInfluencer:!1,nickName:"",avatarUrl:"",canChangeNickName:!1},messages:[],pinnedMessages:[],defaultAvatars:[],emojis:[]}}}},7792:(e,t,n)=>{n.d(t,{u:()=>r});var r={services:{popups:{},chat:{id:0,name:"",configuration:{minShareCoefficient:1e4},player:{id:0,isBlocked:!1,isInfluencer:!1,nickName:"",avatarUrl:"",canChangeNickName:!1},messages:[],pinnedMessages:[],defaultAvatars:[],emojis:[]}}}},1020:(e,t,n)=>{var r=n(4914),i=Symbol.for("react.element"),o=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,n){var r,o={},l=null,d=null;for(r in void 0!==n&&(l=""+n),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(d=t.ref),t)a.call(t,r)&&!c.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:l,ref:d,props:o,_owner:s.current}}t.Fragment=o,t.jsx=l,t.jsxs=l},4848:(e,t,n)=>{e.exports=n(1020)}}]);