1!function(){try{if("undefined"!=typeof document){var o=document.createElement("style");o.appendChild(document.createTextNode('@import "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap";:root{--chat-color-content-primary:#141415;--chat-color-content-secondary:#9aa1b1;--chat-color-content-chat-primary:#141415;--chat-color-content-chat-secondary:#53575f;--chat-color-content-chat-tertiary:#6f7480;--chat-color-content-on-primary:#fff;--chat-color-content-on-accent:#fff;--chat-color-content-on-informative:#fff;--chat-color-content-informative:#0075ff;--chat-color-content-link:#0075ff;--chat-color-content-negative:#d93600;--chat-color-content-inverted:#141415;--chat-color-content-static-black:#000;--chat-color-content-static-white-secondary:#ffffffad;--chat-color-content-primary-dark:#f0f2f5;--chat-color-content-message:#f0f2f5;--chat-color-content-icon-muted:#797f8b;--chat-color-content-base-primary:#141415;--chat-color-content-tertiary:#6f7480;--chat-color-btn-primary:#0075ff;--chat-color-btn-accent:#00b24b;--chat-color-btn-send:var(--chat-color-btn-primary);--chat-color-content-on-send:var(--chat-color-content-on-primary);--chat-color-surface-secondary:#f5f5f5;--chat-color-surface-message:#b3b6bd14;--chat-color-surface-message-manager:#0075ff1f;--chat-color-surface-message-highlight:#b3b6bd29;--chat-color-control-neutral:#b3b6bd1f;--chat-color-surface-input:#b3b6bd1f;--chat-color-control-bg-unchecked:#a9acb41f;--chat-color-border-error:#d93600;--chat-color-border-focus:#0075ffad;--chat-color-border-chat-alfa-container:#b3b6bd29;--chat-color-border-base-alfa-divider:#b3b6bd1f;--chat-color-border-radio-unchecked:#a3abbb1f;--chat-color-border-divider:#a3abbb1f;--chat-color-border-base-alfa-container:#b3b6bd29;--chat-input-color-border:transparent;--chat-window-color-border:transparent;--chat-color-background-chat-alfa-neutral-12:#a9acb41f;--chat-color-background-base-alfa-neutral-20:#b3b6bd33;--chat-color-background-base-alfa-neutral-12:#a9acb41f;--chat-color-background-base-alfa-neutral-16:#b3b6bd29;--chat-color-background-base-alfa-neutral-30:#b3b6bd4d;--chat-color-background-brand-alfa-68:#0075ffad;--chat-color-bg-negative:#f63d00;--chat-color-bg-positive:#00b24b;--chat-color-bg-mention:#ff5d26;--chat-color-ui-base-default:#3b3d43;--chat-sf-background:#fff;--chat-modal-color-bg:#1d1e20;--chat-notification-color-bg:#fff;--chat-notification-color-border:transparent;--chat-bg-banned-chip:#eddbd8;--chat-color-tab-bg:#f0f2f5;--chat-transactionNotification-color-bg:#2e3035;--chat-color-dropdown-list-bg:#2e3035;--chat-color-red-700:#b30101;--chat-color-red-200:#ff7373;--chat-color-rose-600:#d9005a;--chat-color-rose-200:#ff73ad;--chat-color-blue-700:#0022b2;--chat-color-blue-200:#7f97fe;--chat-color-purple-700:#4f00b3;--chat-color-purple-200:#b173ff;--chat-color-cyan-700:#0071b2;--chat-color-cyan-200:#73ccff;--chat-color-orange-amber-700:#b24a00;--chat-color-orange-amber-200:#ffad73;--chat-color-mint-900:#00662b;--chat-color-mint-200:#73ffae;--chat-color-citron-yellow-700:#b38800;--chat-color-citron-yellow-200:#ffde73;--chat-neutral-neutral-50:#f0f2f5;--chat-colors-foreground-fg-secondary:#53575f;--chat-input-color-caret:#0075ff;--chat-color-solid-sentiment-warning-default:#d97e00;--chat-color-solid-sentiment-negative-default:#d93600;--chat-opacity-item-disabled:.5;--chat-color-content-primary-avatar:#f0f2f5;--chat-color-content-primary-heart:#ff006a;--chat-color-solid-brand-primary-default:var(--color-solid-brand-primary-default,#0075ff);--chat-color-content-base-tertiary:#6f7480;--chat-color-tab-chat-accent-hover:#a3abbb33;--chat-color-tab-chat-accent-selected:#0075ff;--chat-color-bg-scrim:#000000e0;--chat-color-bg-primary:#1d1e20;--chat-color-content-secondary-notification:#53575f;--chat-color-text-banned-chip:#de5f36;--chat-font-sans:"Inter", "Inter Variable", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;--chat-font-heading:var(--chat-font-sans);--chat-font-mono:ui-monospace, monospace;--chat-font-headline-font-family:var(--chat-font-heading);--chat-font-body-font-family:var(--chat-font-sans);--chat-font-caption-font-family:var(--chat-font-sans);--chat-font-headline-h3-mobile-font-size:20px;
1--chat-font-headline-h3-mobile-font-weight:600;--chat-font-headline-h3-mobile-line-height:24px;--chat-font-headline-h3-mobile-letter-spacing:-.33px;--chat-font-headline-h2-mobile-font-size:22px;--chat-font-headline-h2-mobile-font-weight:600;--chat-font-headline-h2-mobile-line-height:26px;--chat-font-headline-h2-mobile-letter-spacing:-.4px;--chat-font-headline-h2-desktop-font-size:28px;--chat-font-headline-h2-desktop-font-weight:600;--chat-font-headline-h2-desktop-line-height:32px;--chat-font-headline-h2-desktop-letter-spacing:-.59px;--chat-font-body-regular-font-size:14px;--chat-font-body-regular-font-weight:400;--chat-font-body-regular-line-height:20px;--chat-font-body-regular-letter-spacing:0;--chat-font-body-semibold-font-size:14px;--chat-font-body-semibold-font-weight:600;--chat-font-body-semibold-line-height:20px;--chat-font-body-semibold-letter-spacing:0;--chat-font-caption-s-regular-font-size:12px;--chat-font-caption-s-regular-font-weight:400;--chat-font-caption-s-regular-line-height:16px;--chat-font-caption-s-regular-letter-spacing:.01px;--chat-font-caption-s-semibold-font-size:12px;--chat-font-caption-s-semibold-font-weight:600;--chat-font-caption-s-semibold-line-height:16px;--chat-font-caption-s-semibold-letter-spacing:.01px;--chat-font-caption-xs-font-size:10px;--chat-font-caption-xs-line-height:14px;--chat-font-caption-xs-letter-spacing:.1px;--chat-footer-info-font-size:14px;--chat-footer-info-line-height:20px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--chat-size-control-xl:44px;--chat-spacing-4:4px;--chat-spacing-8:8px;--chat-spacing-10:10px;--chat-spacing-12:12px;--chat-spacing-16:16px;--chat-spacing-20:20px;--chat-header-padding-vertical:10px;--chat-header-padding-vertical-desktop:14px;--chat-shadow-window:0 4px 20px #00000026;--chat-shadow-header:none;--chat-shadow-dropdown:0 0 4px 0 #0000000a, 0 4px 32px 0 #00000029;--chat-shadow-notification:0px 8px 16px -3px #00000014, 0px 1px 4px 0px #0000000d;--chat-shadow-ping:0 1px 4px 0 #0000000d, 0 8px 16px -3px #00000014, 0 -2px 16px 0 #0000000d;--chat-rounding-control-xl:12px;--chat-rounding-control-l:10px;--chat-rounding-container-m:16px;--chat-rounding-modal:24px;--chat-rounding-l-static:16px;--chat-rounding-m-static:12px;--chat-rounding-s-static:8px;--chat-rounding-ping:999px;--chat-rounding-room-logo:5px;--chat-rounding-window:24px}:root[data-chat-theme="1win_redesign"]{--chat-color-bg-primary:#082432;--chat-modal-color-bg:#11374a;--chat-color-dropdown-list-bg:#123d53;--chat-notification-color-bg:#123d53;--chat-notification-color-border:#53c2fa1f;--chat-window-color-border:#53c2fa1f;--chat-transactionNotification-color-bg:#123d53;--chat-color-bg-scrim:#000c;--chat-color-surface-message:#0fafff14;--chat-color-surface-message-manager:#0066e11f;--chat-color-surface-message-highlight:#66c6f429;--chat-color-surface-input:#00000052;--chat-color-control-neutral:#144b66;--chat-color-background-chat-alfa-neutral-12:#0fafff14;--chat-color-background-base-alfa-neutral-12:#0fafff14;--chat-color-background-base-alfa-neutral-16:#66c6f429;--chat-color-background-base-alfa-neutral-20:#7bc9f033;--chat-color-background-base-alfa-neutral-30:#7bc9f04d;--chat-color-background-brand-alfa-68:#0066e1;--chat-color-ui-base-default:#ff5d26;--chat-color-bg-mention:#ff5d26;--chat-color-content-primary:#ecf5f9;--chat-color-content-primary-dark:#ecf5f9;--chat-color-content-base-primary:#ecf5f9;--chat-color-content-message:#ecf5f9;--chat-color-content-secondary:#91b7ca;--chat-color-content-base-tertiary:#88a4b2;--chat-color-content-tertiary:#88a4b2;--chat-color-content-icon-muted:#88a4b2;--chat-colors-foreground-fg-secondary:#88a4b2;--chat-color-content-informative:#4399ff;--chat-color-content-link:#4399ff;--chat-color-solid-brand-primary-default:#0066e1;--chat-color-content-negative:#ff5e29;--chat-color-solid-sentiment-negative-default:#ff5e29;--chat-color-bg-negative:#ff5e29;--chat-color-btn-primary:#fff;--chat-color-content-on-primary:#000;--chat-color-btn-accent:#0066e1;--chat-color-content-on-accent:#ecf5f9;--chat-color-btn-send:var(--chat-color-btn-accent);--chat-color-content-on-send:var(--chat-color-content-on-accent);--chat-color-border-divider:#53c2fa1f;--chat-color-border-base-alfa-divider:#53c2fa1f;--chat-color-border-base-alfa-container:#53c2fa1f;--chat-color-border-chat-alfa-container:#53c2fa1f;--chat-input-color-border:#144b66;--chat-color-border-focus:#0066e1;--chat-color-border-error:#ff5e29;--chat-input-color-caret:#0066e1;--chat-shadow-window:-30px 4px 40px 0 #141415cc, 0 0 40px 0 #141415;--chat-shadow-header:0 12px 20px 0 #082432;--chat-shadow-dropdown:0 10px 30px 0 #000c;--chat-shadow-notification:0 10px 30px 0 #000c;
1--chat-shadow-ping:0 2px 8px 0 #00000029;--chat-font-sans:"Inter Variable", "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;--chat-footer-info-font-size:12px;--chat-footer-info-line-height:16px;--chat-header-padding-vertical:4px;--chat-header-padding-vertical-desktop:8px;--chat-rounding-control-xl:8px;--chat-rounding-control-l:8px;--chat-rounding-container-m:8px;--chat-rounding-m-static:8px;--chat-rounding-modal:8px;--chat-rounding-ping:8px;--chat-rounding-room-logo:0;--chat-rounding-window:8px}.chat-base-link{color:var(--chat-color-content-link,#0075ff);font-family:var(--chat-font-sans);font-size:var(--chat-font-body-semibold-font-size,14px);font-style:normal;font-weight:var(--chat-font-body-semibold-font-weight,600);line-height:var(--chat-font-body-semibold-line-height,20px);letter-spacing:var(--chat-font-body-semibold-letter-spacing,0);margin:0;text-decoration:none}.chat-body-regular{color:var(--chat-color-content-base-primary,#141415);font-family:var(--chat-font-sans);font-size:var(--chat-font-body-regular-font-size,14px);font-weight:var(--chat-font-body-regular-font-weight,400);line-height:var(--chat-font-body-regular-line-height,20px);letter-spacing:var(--chat-font-body-regular-letter-spacing,0);margin:0}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}(); 2import{St as e,Y as t,_t as a,d as n,dt as s,ft as o,l,u as r,vt as i,xt as u,yt as v}from"../room-7o_ZQ3Wc.js";import{n as c,t as d}from"../constants-D-pH0xH4.js";import{computed as g,createBlock as m,defineAsyncComponent as p,defineComponent as f,openBlock as h,ref as y,toValue as I,unref as S,watch as k}from"vue";var T="/api/PLAYCHAT-API-INTEGRATION",A={getUserToken:`${T}/get-user-token`,registerUser:`${T}/register-user`,getLastMessageTime:`${T}/get-last-message-time`};async function U(e,t={}){const{locale:a="en",...n}=t,s={Accept:"application/json, */*","Accept-Language":a,"X-Origin":window.location.host,...n.headers},o=await fetch(e,{...n,headers:s,credentials:"same-origin"}),l=o.headers.get("content-type");if(!o.ok){let e="ÐÑоизоÑла оÑибка пÑи загÑÑзке даннÑÑ ",t="INTERNAL_ERROR";if(l?.includes("application/json")||l?.includes("application/problem+json"))try{const a=await o.text();if(a){const n=JSON.parse(a),s=n.error??n;e=s.message,t=s.code}}catch{e=`ÐÑибка ${o.status}: ${o.statusText}`}else e=`ÐÑибка ${o.status}: ${o.statusText}`;const a=new Error(e);throw a.code=t,a}if(!l||!l.includes("application/json"))return{};const r=await o.text();return r?JSON.parse(r):{}}var w=i().extend({component:"auth"});function E(e){const a=o(),s={listenToStorageChanges:!1},i=t(l.ACCESS_TOKEN,null,sessionStorage,s),u=t(l.TOKEN_EXPIRES_AT,null,sessionStorage,s),v=t(l.USER_ID,null,sessionStorage,s),c=t(l.PLATFORM_USER_ID,null,sessionStorage,s),d=t(l.IS_REGISTERED_IN_CHAT,null,sessionStorage,s),m=t(l.IS_BANNED,null,sessionStorage,s),p=t(l.BANNED_EXPIRES_AT,null,sessionStorage,s),f=g({get:()=>i.value??void 0,set:e=>{i.value=e??null}}),h=g({get:()=>{const e=u.value;return e?parseInt(e,10):void 0},set:e=>{u.value=void 0===e?null:e.toString()}}),S=g({get:()=>v.value??void 0,set:e=>{v.value=e??null}}),T=g({get:()=>c.value??void 0,set:e=>{c.value=e??null}}),E=g({get:()=>{const e=d.value;if(null!==e)return"true"===e},set:e=>{d.value=void 0===e?null:e?"true":"false"}}),P=g({get:()=>{const e=m.value;if(null!==e)return"true"===e},set:e=>{m.value=void 0===e?null:e?"true":"false"}}),R=g({get:()=>p.value??void 0,set:e=>{p.value=e??null}}),b=y(),x=y(!1),C=y(),_=y(),N=y(),D=y(!1),O=()=>{r(),f.value=void 0,h.value=void 0,S.value=void 0,E.value=void 0,P.value=void 0,R.value=void 0,b.value=void 0,D.value=!1,T.value=void 0,C.value=void 0,_.value=void 0,N.value=void 0},L=()=>{const t=e.platformUserId?.();void 0!==t&&(T.value=t)},M=async()=>{if(!x.value){x.value=!0;try{const e=await U(A.getUserToken,{method:"GET"});!0===e.isRegistered&&e.accessToken?(f.value=e.accessToken,h.value=e.expiresIn?Date.now()+1e3*e.expiresIn:void 0,E.value=!0,S.value=e.userId??void 0,_.value=e.username??void 0,L(),R.value=e.block?.expiresAt??void 0,P.value=!!e.block,b.value=void 0,C.value=e.loyaltyLevel,N.value=e.canWrite):!1===e.isRegistered&&(f.value=void 0,h.value=void 0,S.value=void 0,_.value=void 0,E.value=!1,P.value=void 0,R.value=void 0,C.value=void 0,N.value=e.canWrite,b.value=e.hasCompletedRegistrationRules??void 0),D.value=!0}catch(e){w.error({category:"token",type:"error",name:"get-user-token",message:String(e)})}finally{x.value=!1}}};return k(()=>I(e.isAuthed),async(t,a)=>{const s=void 0===a;if(s||!a||t){if(!s&&!a&&t)return O(),void(await M());if(s){if(!t)return void(f.value&&O());f.value&&!(t=>{if(!t)return!1;if(!f.value)return!1;if(n(h.value))return!1;if(!0!==E.value)return!1;const a=e.platformUserId?.();return void 0!==a&&T.value===a})(t)&&O(),await M()}}else O()},{immediate:!0}),k(()=>e.platformUserId?.(),e=>{void 0!==e&&D.value&&f.value&&void 0===T.value&&(T.value=e)}),{accessToken:f,tokenExpiresAt:h,userId:S,isRegisteredInChat:E,isBanned:P,banExpiresAt:R,hasCompletedRegistrationRules:b,isLoadingToken:x,identityConfirmed:D,loyaltyLevel:C,username:_,canWrite:N,getUserToken:M,registerUser:async e=>{if(!1!==b.value)try{const t=await U(A.registerUser,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e})});
2t.accessToken&&(f.value=t.accessToken,h.value=t.expiresIn?Date.now()+1e3*t.expiresIn:void 0,E.value=!0,S.value=t.userId??void 0,_.value=e,L(),P.value=!1,R.value=void 0,b.value=void 0,C.value=t.loyaltyLevel,N.value=t.canWrite,D.value=!0)}catch(t){throw w.error({category:"token",type:"error",name:"register-user",message:String(t)}),t}else alert(a("register_unavailable"))},unblockUser:async()=>{R.value=void 0,P.value=!1},blockUser:async e=>{R.value=e??void 0,P.value=!0},clearData:O}}var P=/*@__PURE__*/f({__name:"PlatformPlayChat",props:{isAuthed:{type:Boolean},onAuthInPlatform:{type:Function,default:()=>{}},onRegisterInPlatform:{type:Function,default:()=>{}},platformUserId:{},resolveTranslation:{},onAnalyticsEvent:{},config:{}},emits:["blockUser","close"],setup(e,{emit:t}){const a=e,n=t;s(a.resolveTranslation);const o=E({isAuthed:g(()=>a.isAuthed),platformUserId:()=>a.platformUserId}),l=()=>{a.onAuthInPlatform(o.getUserToken)},r=()=>{a.onRegisterInPlatform(o.getUserToken)};return(e,t)=>(h(),m(S(c),{"access-token":S(o).accessToken.value??null,"token-expires-at":S(o).tokenExpiresAt.value??null,"user-id":S(o).userId.value,username:S(o).username.value,"is-registered-in-chat":S(o).isRegisteredInChat.value??null,"is-registered-in-platform":a.isAuthed,"is-auth-on-platform":a.isAuthed,"is-banned":S(o).isBanned.value??null,"ban-expires-at":S(o).banExpiresAt.value??null,"loyalty-level":S(o).loyaltyLevel.value,"identity-confirmed":S(o).identityConfirmed.value,"can-write":S(o).canWrite.value,"on-register-in-chat":S(o).registerUser,"on-get-user-token":S(o).getUserToken,"on-auth-in-platform":l,"on-register-in-platform":r,"on-user-banned":S(o).blockUser,"on-user-unblocked":S(o).unblockUser,"on-analytics-event":a.onAnalyticsEvent,"theme-name":a.config?.themeName,onClose:t[0]||(t[0]=e=>n("close"))},null,8,["access-token","token-expires-at","user-id","username","is-registered-in-chat","is-registered-in-platform","is-auth-on-platform","is-banned","ban-expires-at","loyalty-level","identity-confirmed","can-write","on-register-in-chat","on-get-user-token","on-user-banned","on-user-unblocked","on-analytics-event","theme-name"]))}});var R=i().extend({component:"unread-polling"}),b="play-chat/last-read-timestamp";function x(e){localStorage.setItem(b,e)}var C=function(){let e={},t=null,a=0;const n={hasUnreadMessages:!1,isPolling:!1},s=(t,a=!1)=>{(n.hasUnreadMessages!==t||a)&&(n.hasUnreadMessages=t,e.onChangeUnreadMessages?.(t))},o=()=>{t&&(clearTimeout(t),t=null)},l=e=>{n.isPolling&&!n.hasUnreadMessages&&e===a&&(t=setTimeout(()=>{r(e)},5e3))},r=async t=>{try{if(!n.isPolling||t!==a)return;const r=function(){const e=localStorage.getItem(b);if(e)return e;const t=/* @__PURE__ */new Date(Date.now()-864e5).toISOString();return localStorage.setItem(b,t),t}(),i=await async function(e="en"){const t=new URL(A.getLastMessageTime,window.location.origin);return await U(t.toString(),{method:"GET",locale:e})}(e.locale instanceof Intl.Locale?e.locale.toString():e.locale??"en");if(!n.isPolling||t!==a)return;if(!i)return void l(t);const u=new Date(r);if(Object.values(i).some(e=>new Date(e)>u))return o(),n.isPolling=!1,void s(!0);l(t)}catch(r){R.error({category:"polling",type:"error",name:"check-unreads",message:String(r)}),l(t)}};return{configure(t){e={...e,...t}},start(){n.isPolling||n.hasUnreadMessages||(x(/* @__PURE__ */(new Date).toISOString()),o(),n.isPolling=!0,a+=1,r(a))},stop(){(n.isPolling||n.hasUnreadMessages)&&(n.isPolling=!1,a+=1,o(),s(!1,!0))},markAsRead(){x(/* @__PURE__ */(new Date).toISOString()),s(!1,!0)},getState:()=>({...n})}}();u()||e(v());var _=p(()=>import("../AdminPlayChat-11KTy7SB.js"));export{_ as AdminPlayChat,d as MAX_SELECTED_MESSAGES,a as PLAY_CHAT_OVERLAY_ATTR,P as PlatformPlayChat,c as PlayChat,l as STORAGE_KEYS,i as getChatLogger,C as unreadPollingService};
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.