(self.webpackChunk_multimediallc_cb_ts=self.webpackChunk_multimediallc_cb_ts||[]).push([[62],{4918:function(e,t){"use strict";var n,i;function o(e){switch(e){case n.All:case n.Male:case n.Female:case n.Couple:case n.Trans:return e;case n.OldTrans:case i.Transfemme:case i.Transmasc:case i.Nonbinary:return n.Trans;default:return n.All}}t.ej=t.BK=t.aI=t.$p=t.dW=t.Y0=void 0,function(e){e.All="",e.Male="m",e.Female="f",e.Couple="c",e.Trans="t",e.OldTrans="s"}(n||(t.Y0=n={})),function(e){e.Transfemme="tf",e.Transmasc="tm",e.Nonbinary="tn"}(i||(t.dW=i={})),t.$p=o,t.aI=new Map([[n.All,""],[n.Male,"male"],[n.Female,"female"],[n.Couple,"couple"],[n.Trans,"trans"],[n.OldTrans,"trans"]]),t.BK=new Map,t.aI.forEach(((e,n)=>t.BK.set(e,n))),t.BK.set("trans",n.Trans),t.ej=function(){var e,i;const r=window.location.pathname.split("/"),s=window.location.pathname.endsWith("/")?2:1,a=null!==(e=r[r.length-s])&&void 0!==e?e:"",l=a.endsWith("-cams")?a.slice(0,-5):a,c=null!==(i=t.BK.get(l))&&void 0!==i?i:o(l);if(c!==n.All)return c;const u=new URLSearchParams(window.location.search);for(const e of["gender","genders","g"]){const t=u.get(e);if(null!==t)return o(t.split(",")[0])}return n.All}},1896:function(e,t,n){"use strict";n.d(t,{fF:function(){return c},vU:function(){return l},um:function(){return s},ZK:function(){return a}});const i=!1;let o;try{o=!0}catch(e){console.error("@multimediallc/logging failed to initialize, probably due to undefined process.env.NODE_ENV.",e),o=!0}const r=window.newrelic;function s(e,t){i||void 0!==window.console&&(void 0!==console.info||o?console.info(e,h(t)):console.log("INFO ",e,h(t)))}function a(e,t,n=""){if(i)return;let r;void 0!==window.console&&(void 0!==console.warn||o?console.warn(n.concat("WARN "),e,h(t)):console.log(n.concat("WARN "),e,h(t)),u());try{r="object"==typeof e?JSON.stringify(e):e.toString()}catch(t){r=`${e}`}d(n.concat("WARN"),new Error(r),t)}function l(e,t,n=""){if(i)return;let r;void 0!==window.console&&(void 0!==console.error||o?console.error(n.concat("ERROR "),e,h(t)):console.log(n.concat("ERROR "),e,h(t)),u());try{r="object"==typeof e?JSON.stringify(e):e.toString()}catch(t){r=`${e}`}d(n.concat("ERROR"),new Error(r),t)}function c(e,t){i||o||void 0!==window.console&&(void 0!==console.debug||o?console.debug(e,h(t)):console.log("DEBUG ",e,h(t)))}function u(){i||o||void 0!==window.console&&void 0!==console.trace&&console.trace()}function d(e,t,n={}){try{if(void 0===r)return;const i={};if(i["attributes.level"]=e,"object"==typeof n)for(const e in n)"xhrErrorAttributes"!==e?i[`attributes.${e}`]=n[e]:(i["attributes.xhrError"]=!0,i["attributes.xhrState"]=n[e].readyState,i["attributes.xhrStatus"]=n[e].status,i["attributes.xhrReason"]=n[e].reason);else i["attributes.extra"]=n;r.noticeError(t,i)}catch(e){console.error(`New Relic Error in reportError: ${e.toString()}`)}}function h(e){return void 0===e?"":e}},8759:function(e,t,n){"use strict";n.d(t,{qq:function(){return G},I3:function(){return w},jI:function(){return T},IF:function(){return Q},jB:function(){return Z},sQ:function(){return F},Dt:function(){return X},BR:function(){return v},Ii:function(){return u},i7:function(){return P},bf:function(){return R},tF:function(){return Y},vU:function(){return M},nv:function(){return c},fh:function(){return b},w1:function(){return N},NP:function(){return j},IU:function(){return l},s2:function(){return _},B3:function(){return g},iC:function(){return y},CG:function(){return C},vA:function(){return I},v8:function(){return W},G6:function(){return A},op:function(){return B},Iq:function(){return E},GR:function(){return $},H$:function(){return z},Fz:function(){return x},E$:function(){return K},AQ:function(){return q},Tt:function(){return U},_1:function(){return O},sg:function(){return L},z8:function(){return D},BV:function(){return V}});var i=n(1896);const o=window.Hls;let r;const s={chrome:79,firefox:78,edge:90,safari:13},a={chrome:79,crios:79,firefox:115,fxios:115,safari:13,samsungbrowser:15};function l(){if(void 0===r){const e="cbModernizr";let t=!0;try{window.localStorage.setItem(e,e),window.localStorage.removeItem(e)}catch(e){t=!1}(0,i.fF)(`local storage support = ${t}`),r=t}return r}function c(){return void 0!==window.history&&void 0!==window.history.pushState}function u(){try{return!!document.createElement("audio").canPlayType}catch(e){return!1}}let d,h,f,p,m;function v(){if(void 0!==d)return d;let e;d=!1;try{if("webkitAudioContext"in window)e=new webkitAudioContext;else{if(!("AudioContext"in window))return d;e=new AudioContext}if(null===e)return d;d="function"==typeof e.createGain&&"function"==typeof e.decodeAudioData&&"function"==typeof e.createBufferSource&&"function"==typeof e.createBufferSource().start,"function"==typeof e.close&&e.close()}catch(e){(0,i.vU)("Error checking for audio context",{reason:e.toString()})}return d}function g(){if(void 0!==h)return h;const e=document.createElement("audio");return h="function"==typeof e.canPlayType&&""!==e.canPlayType("audio/mpeg;codecs=mp3"),h}function y(){const e=document.createElement("video").canPlayType("application/vnd.apple.mpegurl");return"probably"===e||"maybe"===e}function b(){return y()||o.isSupported()}function w(){return window.hasOwnProperty("requestAnimationFrame")?window.requestAnimationFrame:window.hasOwnProperty("webkitRequestAnimationFrame")?window.webkitRequestAnimationFrame:window.hasOwnProperty("mozRequestAnimationFrame")?window.mozRequestAnimationFrame:e=>(window.setTimeout((()=>{e(0)}),1e3/7),Date.now())}function C(){if(void 0!==f)return f;try{const e=Object.defineProperty({},"passive",{get:function(){f=!0}});window.addEventListener("testPassive",(()=>{}),e),window.removeEventListener("testPassive",(()=>{}),e),void 0===f&&(f=!1)}catch(e){f=!1}return f}function x(){if(void 0!==p)return p;try{const e=document.createElement("audio");e.volume=.5,p=.5===e.volume}catch(e){p=!1}return p}let k,S=!1;function T(){if(null!==document.scrollingElement)return document.scrollingElement;if(void 0!==m&&!S)return m;const e=document.documentElement.scrollTop;return document.documentElement.style.height=`${window.innerHeight+1}px`,document.documentElement.scrollTop=e+1,m=document.documentElement.scrollTop!==e?document.documentElement:document.body,document.documentElement.style.height="",document.documentElement.scrollTop=e,S=!1,m}function I(){return void 0!==window.performance&&void 0!==window.performance.now}function P(){return void 0!==window.chrome&&(!!window.chrome.loadTimes||!!window.chrome.webstore||!!window.chrome.runtime)||/CriOS/i.test(navigator.userAgent)}function R(){return/Edge\//i.test(navigator.userAgent)}function M(){return null!==/Firefox/.exec(navigator.userAgent)||void 0!==window.InstallTrigger}function A(){if(U()&&/WebKit/i.test(navigator.userAgent)&&!/CriOS/i.test(navigator.userAgent))return!0;let e=!1;return void 0!==window.safari&&void 0!==window.safari.pushNotification&&(e="[object SafariRemoteNotification]"===window.safari.pushNotification.toString()),/constructor/i.test(window.HTMLElement)||e}function E(){return[/SM-T827R4/,/SM-T550/,/SM-T330/,/SM-T232/,/SM-T335/,/SM-T813/,/SM-T510/].some((e=>e.test(navigator.userAgent)))}function B(){return/SamsungBrowser/i.test(navigator.userAgent)}function O(){return(/iPad/i.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&void 0===window.MSStream}function L(){return/iPhone/i.test(navigator.userAgent)&&void 0===window.MSStream}function D(){return/iPod/i.test(navigator.userAgent)&&void 0===window.MSStream}function U(){return D()||L()||O()}function Z(){if(U()){let e=navigator.userAgent.match(/OS (\d+)_(\d+)_?(\d+)?/);if(null===e&&(e=navigator.userAgent.match(/Version\/(\d+)/),null===e))return;return parseInt(e[1])}}function F(){const e=navigator.userAgent.match(/OS (\d+)_(\d+)_?(\d+)?/);if(U()&&null!==e)return{major:parseInt(e[1]),minor:parseInt(e[2]),patch:parseInt(e[3])}}function _(){return/Android|webOS|BlackBerry|IEMobile|Opera Mini|SamsungBrowser/i.test(navigator.userAgent)||U()}function N(){return!!document.documentMode}function j(){return N()&&void 0===window.atob}function H(e,t){const n=_()?a:s;return n.hasOwnProperty(e)&&t>=n[e]}function z(){const e=window.navigator.userAgent.toLowerCase(),t=e.match(/edg\/(\d+)/);if(t)return H("edge",parseFloat(t[1]));if(A()){const t=e.match(/version\/([\d.]+)/);if(t)return H("safari",parseFloat(t[1]))}const n=e.match(/(chrome|firefox|samsungbrowser|crios|fxios)/),i=e.match(/(chrome|firefox|samsungbrowser|crios|fxios)[\s\/](\d+)/);if(n&&i){const e=parseFloat(i[2]);return H(n[1],e)}return!1}function W(){return/Puffin/i.test(navigator.userAgent)}function V(){let e="unload";return U()&&A()&&(e="pagehide"),e}function q(){return"object"==typeof navigator&&"object"==typeof navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getUserMedia}function K(){return Boolean(navigator.userAgent.match(/Puffin/i))}function J(){const e=/Edg(|e|A|iOS)\/\d+/.exec(navigator.userAgent);return null!==e?parseInt(e[0].split("/")[1],10):0}function G(){const e=F();return{platform:navigator.platform,userAgent:navigator.userAgent,maxTouchPoints:void 0!==navigator.maxTouchPoints?navigator.maxTouchPoints:0,iosVersionMajor:void 0!==e?e.major:0,iosVersionMinor:void 0!==e?e.minor:0,iosVersionPatch:void 0!==e?e.patch:0,edgeVersionMajor:J(),isDefinedMSStream:void 0!==window.MSStream,isDefinedInstallTrigger:void 0!==window.InstallTrigger,isPresentChromeLoadTimes:void 0!==window.chrome&&!!window.chrome.loadTimes,isPresentChromeWebStore:void 0!==window.chrome&&!!window.chrome.webstore,isPresentChromeRunTime:void 0!==window.chrome&&!!window.chrome.runtime,isConstructorPresentInHTMLElement:void 0!==window.HTMLElement&&/constructor/i.test(window.HTMLElement),safariPushNotifications:void 0!==window.safari?window.safari.pushNotification.toString():""}}function Y(){return!0===k}window.setTimeout((()=>{S=!0}),200),new Promise((e=>{if(void 0!==k)e(k);else{const t=new Image;t.onerror=()=>{e(!1)},t.onload=()=>{k=2!==t.width,e(k)},t.src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QAiRXhpZgAASUkqAAgAAAABABIBAwABAAAABgASAAAAAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAABAAIDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/iiiigD/2Q=="}})).then((e=>{k=e,(0,i.fF)("exif: ",k)})).catch((()=>{}));const $="scroll-behavior"in document.createElement("div").style;function Q(){return!!(/Android/i.test(navigator.userAgent)||U()||navigator.userAgent.indexOf("Mac"))}function X(){return/Android/i.test(navigator.userAgent)}},3618:function(e,t,n){"use strict";function i(e){return new RegExp("\\b".concat(e,"\\b")).test(window.active_feature_flags)}n.d(t,{F6:function(){return r},lr:function(){return o}});var o=function(){return i("HmpgFilt")},r=function(){return i("PvtCrsl")}},7654:function(e,t,n){"use strict";n.d(t,{$O:function(){return f},B8:function(){return h},DT:function(){return Z},FZ:function(){return U},I5:function(){return z},IQ:function(){return W},PR:function(){return T},R7:function(){return v},RT:function(){return N},SW:function(){return O},W1:function(){return j},Zv:function(){return D},_A:function(){return H},a0:function(){return w},ip:function(){return I},nA:function(){return b},un:function(){return _},vk:function(){return g}});var i=n(126),o=n(4649),r=n(5809),s=n(4918),a=n(3618);function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(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)?c(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&(e.regions=Array.from(i).map((function(e){return e.value})).join(","))}var o=document.querySelector("#id_enable_recommendations");return null!==o&&(e.enable_recommendations=!o.disabled&&o.checked),e}()),function(e){var t={},n=O(),i=D(e),o=(0,r.Z)(i,2),s=o[0],a=o[1];return void 0!==n&&a.push(n),s.length>0&&(t.keywords=s.join(" ").slice(0,y)),a.length>0&&(t.hashtags=a.join(",")),t}(e)),function(){if(!(0,a.lr)())return{};var e=new URLSearchParams(window.location.search),t={},n=e.get(C),o=e.get(x),r=e.get(k);return t=function(e,t){if(null!==e){var n=e.match(w);if(null!==n){var i=n[0].split("-"),o=parseInt(i[0]),r=Math.min(parseInt(i[1])+1,200);t.from_age=o,t.to_age=r}}return t}(n,t),t=function(e,t){if(null!==e){var n,i=[],o=l(e.split(","));try{for(o.s();!(n=o.n()).done;){var r=n.value,s=S.get(r);void 0!==s&&i.push(s)}}catch(e){o.e(e)}finally{o.f()}i.length>0&&(t.regions=i.join(","))}return t}(o,t),function(e,t){if(null!==e){var n,o=[],r=l(e.split(","));try{for(r.s();!(n=r.n()).done;){var s=n.value,a=M.get(s);void 0!==a&&o.push.apply(o,(0,i.Z)(a))}}catch(e){r.e(e)}finally{r.f()}t.private_prices=o}return t}(r,t)}());var t,n}var w=/^\d{1,2}-(\d{1,2}|100)$/g,C="age",x="region",k="private_prices",S=new Map([["north-american-cams","NA"],["south-american-cams","SA"],["asian-cams","AS"],["euro-russian-cams","ER"],["other-region-cams","O"]]),T=["NA","SA","AS","ER","O"];function I(){var e=_();return S.get(e)}var P=new Map([["teen-cams",[18,20]],["18to21-cams",[18,22]],["20to30-cams",[20,31]],["30to50-cams",[30,51]],["mature-cams",[50,200]],["18to20-cams",[18,21]],["21to35-cams",[21,36]]]);function R(){var e=_();return P.get(e)}var M=new Map([["6-tokens-per-minute-private-cams",[6]],["12-tokens-per-minute-private-cams",[12]],["18-tokens-per-minute-private-cams",[18]],["30-tokens-per-minute-private-cams",[30,42]],["60-tokens-per-minute-private-cams",[60,72]],["90-tokens-per-minute-private-cams",[90,120,150,180,240]]]);function A(){var e=_();return M.get(e)}var E=new Map([["exhibitionist-cams","exhib"],["new-cams","new_cams"],["gaming-cams","gaming"]]),B=new Map([["spy-on-cams","private"],["followed-cams","follow"]]);function O(){var e=F().split("/");if("tag"===e[0])return e[1]}var L=/[^a-zA-Z0-9_]+/g;function D(e){var t;void 0===e&&(e=null!==(t=new URLSearchParams(window.location.search).get("keywords"))&&void 0!==t?t:"");var n=O(),i=[],o=[];return e.split(" ").forEach((function(e){var t=e.startsWith("#");(e=e.replace(L,"")).length<=0||(t?e!==n&&o.push(e):i.push(e))})),[i,o]}function U(e){var t;e=null!==(t=e)&&void 0!==t?t:"page";var n=new URLSearchParams(window.location.search).get(e);if(null!==n){var i=parseInt(n);if(!isNaN(i))return Math.min(Math.max(i,1),p)}return 1}function Z(e,t){var n,i;return{offset:((e=null!==(n=e)&&void 0!==n?n:U())-1)*(t=null!==(i=t)&&void 0!==i?i:h),limit:t}}function F(e){var t=null!=e?e:window.location.pathname;return t.match(/^\/\w{2}\//)?t=t.slice(4):t.startsWith("/")&&(t=t.slice(1)),t.endsWith("/")&&(t=t.slice(0,-1)),t}function _(e){var t;return null!==(t=F(e).split("/")[0])&&void 0!==t?t:""}function N(e){return"followed-cams"===_(e)}function j(){var e,t=null!==(e=F().split("/")[1])&&void 0!==e?e:"";return N()&&"offline"===t}function H(){var e;return[I(),R(),A(),(e=_(),E.get(e))].some((function(e){return void 0!==e}))}function z(){return"spy-on-cams"===_()}function W(e){var t=F(e);return["","top","female-cams","male-cams","trans-cams","couple-cams","accounts/welcome"].includes(t)}},949:function(e,t,n){"use strict";n.d(t,{Ld:function(){return q},Bz:function(){return W},J:function(){return V}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(8759),c=n(7693),u=n(3753),d=n(9),h=n(8263),f=n(1794),p=n(6921),m=n(3705),v=n(9545),g=n(3543),y=n(47),b=n(3243),w=n(7654),C=n(7585),x=n(2080),k=n(8871),S=n(1185);var T=function(e){(0,r.Z)(c,e);var t,n,l=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function c(){return(0,i.Z)(this,c),l.apply(this,arguments)}return(0,o.Z)(c,[{key:"styleRow",value:function(e){}},{key:"styleLabelContainer",value:function(e){}},{key:"styleLabel",value:function(e){(0,S.vP)(e,S.ql.defaultColor)}},{key:"styleFieldContainer",value:function(e){(0,S.vP)(e,S.ql.defaultColor)}},{key:"styleField",value:function(e){}},{key:"styleHelpText",value:function(e){(0,S.vP)(e,S.ql.defaultColor)}}]),c}(n(8785).wj);var I=[{label:g.ag.showLocations,value:!0}],P=[{label:g.ag.showRecommendedCams,value:!0}],R=[{label:g.ag.previewRooms,value:!0}],M=function(e){(0,r.Z)(c,e);var t,n,l=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function c(){return(0,i.Z)(this,c),l.apply(this,arguments)}return(0,o.Z)(c,[{key:"initData",value:function(e){var t=this;(0,b.Z)((0,a.Z)(c.prototype),"initData",this).call(this,e),k.M4.listen((function(){return t.setHidden(t.showLocationCheckboxes,(0,w.W1)())}))}},{key:"createElement",value:function(e){return this.showLocationCheckboxes=new x.Zf({choices:I,name:"show_location",defaultValue:e.showLocation,styles:new T}),this.enableRecommendationsCheckbox=new x.Zf({choices:P,name:"enable_recommendations",defaultValue:e.enableRecommendations,disabled:e.enableRecommendationsDisabled,styles:new T}),this.setDisabled(this.enableRecommendationsCheckbox,e.enableRecommendationsDisabled),this.animateThumbnailsCheckboxes=new x.Zf({choices:R,name:"animate_thumbnails",defaultValue:e.animateThumbnails,disabled:e.animateThumbnailsDisabled,styles:new T}),this.setDisabled(this.animateThumbnailsCheckboxes,e.animateThumbnailsDisabled),this.setHidden(this.showLocationCheckboxes,(0,w.W1)()),(0,y.vz)("div",{id:"advanced_options"},(0,y.vz)("label",null,g.ag.settings,":"),(0,y.vz)("form",{id:"filter_options_form",action:"/ax/update_option_filters/",method:"post"},this.showLocationCheckboxes.getField(),this.enableRecommendationsCheckbox.getField()),(0,y.vz)("form",{id:"animate_thumbnails_form",action:"/ax/update_animate_thumbnails_options/",method:"post"},this.animateThumbnailsCheckboxes.getField()))}},{key:"initUI",value:function(e){(0,b.Z)((0,a.Z)(c.prototype),"initUI",this).call(this,e),this.setIdAndForAttribute(this.showLocationCheckboxes,"id_show_location"),this.setIdAndForAttribute(this.enableRecommendationsCheckbox,"id_enable_recommendations"),this.setIdAndForAttribute(this.animateThumbnailsCheckboxes,"id_animate_thumbnails")}},{key:"setDisabled",value:function(e,t){var n=e.getField().querySelector("input");null!==n&&(n.disabled=t)}},{key:"setHidden",value:function(e,t){e.getField().style.display=t?"none":"block",this.setDisabled(e,t)}},{key:"setIdAndForAttribute",value:function(e,t){var n=e.getField().querySelector("input");if(null!==n){n.id=t;var i=n.closest("td label");null!==i&&(i.htmlFor=n.id)}}}]),c}(C.I);var A=[{label:g.ag.refresh30Seconds,value:"30"},{label:g.ag.refresh45Seconds,value:"45"},{label:g.ag.refresh60Seconds,value:"60"},{label:g.ag.refresh90Seconds,value:"90"},{label:g.ag.refreshDisable,value:"0"}],E=function(e){(0,r.Z)(c,e);var t,n,l=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function c(){return(0,i.Z)(this,c),l.apply(this,arguments)}return(0,o.Z)(c,[{key:"createElement",value:function(e){var t;return this.refreshThumbnailsSelect=new x.Ph({choices:A,name:"refresh_frequency",defaultValue:(null!==(t=e.initial)&&void 0!==t?t:60).toString()}),(0,y.vz)("div",{className:"refresh"},(0,y.vz)("form",{id:"refresh_cams_form",action:"/ax/update_refresh_frequency/",method:"post"},(0,y.vz)("label",null,g.ag.refreshThumbnailsEvery,":"),this.refreshThumbnailsSelect.getField()))}},{key:"initUI",value:function(e){(0,b.Z)((0,a.Z)(c.prototype),"initUI",this).call(this,e);var t=this.element.querySelector("select");null!==t&&(t.id="id_refresh_frequency",t.dataset.testid="refresh-frequency-select",(0,h.Zs)(t,{marginTop:"4px"}))}}]),c}(C.I);var B=[{label:g.ag.northAmericaTitle,value:"NA"},{label:g.ag.southAmericaTitle,value:"SA"},{label:g.ag.asiaTitle,value:"AS"},{label:g.ag.europeRussiaTitle,value:"ER"},{label:g.ag.otherTitle,value:"O"}],O=function(e){(0,r.Z)(c,e);var t,n,l=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function c(){return(0,i.Z)(this,c),l.apply(this,arguments)}return(0,o.Z)(c,[{key:"createElement",value:function(e){var t={choices:B,name:"visible_regions",defaultValue:""!==e.initial?e.initial:"NA,SA,AS,ER,O",styles:new T};return this.checkboxes=new x.Zf(t),(0,y.vz)("div",{className:"filter_location checkboxes"},(0,y.vz)("label",null,g.ag.visibleRegionsTag,":"),(0,y.vz)("form",{id:"filter_location_form",method:"post",action:"/ax/update_location_filters/"},this.checkboxes.getField()))}},{key:"initUI",value:function(e){(0,b.Z)((0,a.Z)(c.prototype),"initUI",this).call(this,e),this.bindElementIdsAndForAttributes()}},{key:"bindElementIdsAndForAttributes",value:function(){var e=0;this.element.querySelectorAll("input[type=checkbox]").forEach((function(t){t.id="id_visible_regions_".concat(e),t.closest("label[class=checkboxFieldLabel]").htmlFor=t.id,e+=1}))}}]),c}(C.I),L=n(2800),D=n(6698),U=n(4493);var Z={display:"none",top:"26px",width:"100%",right:"-1px",overflow:""},F=function(e){(0,r.Z)(c,e);var t,n,l=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function c(e,t){var n;(0,i.Z)(this,c),n=l.call(this,e,t);var o=document.getElementById("mobile_advanced_options_container");return null!==o&&(o.dataset.testid="advanced-search-options-component",n.mobileAdvancedOptionsContainer=o),(0,h.Zs)(n.element,Z),n}return(0,o.Z)(c,[{key:"hideSuggestions",value:function(){(0,b.Z)((0,a.Z)(c.prototype),"hideSuggestions",this).call(this),(0,h.Zs)(this.mobileAdvancedOptionsContainer,{overflow:"hidden"})}},{key:"showSuggestions",value:function(){(0,b.Z)((0,a.Z)(c.prototype),"showSuggestions",this).call(this),(0,h.Zs)(this.mobileAdvancedOptionsContainer,{overflow:this.suggestionsList.length?"visible":"hidden"})}}]),c}(U.KI),_=n(9395);var N={overflow:"",width:"100%",display:"block",zIndex:106},j={width:"23px",height:"23px",display:"block",position:"absolute",top:"13%",right:"2px",backgroundPosition:"50% top",backgroundSize:"14px 14px"},H=function(e){(0,r.Z)(c,e);var t,n,l=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function c(){var e;(0,i.Z)(this,c),e=l.call(this),(0,h.Zs)(e.element,N),(0,h.Zs)(e.delete,j);var t=(0,y.vz)("button",{className:"submit",onClick:function(t){t.preventDefault(),e.onSubmitSearchInput()}},"search");return e.form.element.appendChild(t),e.handleMobileSortDisplay(),e}return(0,o.Z)(c,[{key:"initSuggestions",value:function(){this.suggestionsDiv=new F(this.input,this)}},{key:"onSubmitSearchInput",value:function(){(0,b.Z)((0,a.Z)(c.prototype),"onSubmitSearchInput",this).call(this),this.handleMobileSortDisplay()}},{key:"handleMobileSortDisplay",value:function(){var e=document.querySelector("#mobile-sort-container");e&&(""!==this.searchKeywords?e.style.display="none":e.style.display="block")}}]),c}(_.Mj),z=n(407);var W=new f.xB("showSearchingOverlay"),V=new f.xB("updateShowLocation"),q=function(e){(0,r.Z)(b,e);var t,n,d=(t=b,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function b(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,i.Z)(this,b),(e=d.call(this)).isMobile=t,e.skipOverlays=n,e.isAnimThumbUnlocked=!1,e.showAnimateThumbnails=!1,e.regionsChanged=new f.xB("regionsChanged"),e.enableRecommendationsChanged=new f.xB("enableRecommendationsChanged"),e.toggle=function(){e.toggleShowHide(),(0,m.fg)("AdvancedSearchOptionsClicked")},e.bindAdvancedSearchRegion=function(){var t=document.querySelectorAll(".advanced_search_region"),n=document.querySelector("#main");null!==n&&t.forEach((function(t){t.onclick=function(){e.showElement(),(0,l.jI)().scrollTop>n.offsetTop&&n.scrollIntoView()}}))},e.setShowAnimateThumbnails=function(){e.showAnimateThumbnails=null!==e.animateThumbnailsInput&&e.animateThumbnailsInput.checked};var o=document.querySelector("#advanced_search_options");if(null!==o){e.element=o,e.element.dataset.testid="advanced-search-options-component";var r=e.createAdvancedSearchForms(),s=o.firstElementChild;null!==s&&s.insertAdjacentElement("afterend",r)}return e.bindAnimateThumbnailForm(),e.bindFloatingPlayerOption(),e.bindFilterLocationForm(),e.bindFilterOptionsForm(),e.bindAdvancedSearchRegion(),e.bindRefreshCamForm(),e.bindEnableRecommendations(),e.bindShowLocationOptionsForm(),e.bindSearchInput(),e.bindCloseButton(),e.bindOpenCloseButtons(),e.isAnimThumbUnlocked&&(0,D.X7)(e.showAnimateThumbnails),W.listen((function(t){t?e.showSearchingOverlays():e.hideSearchingOverlays()})),e}return(0,o.Z)(b,[{key:"createAdvancedSearchForms",value:function(){var e=!L.J.current.loggedInUser||!L.J.current.loggedInUser.isSupporter;return(0,y.vz)("div",{className:"advance-search-element"},(0,y.vz)(O,{initial:L.J.current.regions}),(0,y.vz)(M,{showLocation:L.J.current.showLocation,enableRecommendations:L.J.current.showRecommendations,enableRecommendationsDisabled:!L.J.current.loggedInUser,animateThumbnails:L.J.current.animateThumbnails,animateThumbnailsDisabled:e}),(0,y.vz)(E,{initial:L.J.current.refreshFrequency}))}},{key:"setTooltipDisplayBehavior",value:function(e,t){e.onmouseover=function(){e.style.display="block"};var n=function(e){return e.matches(":hover")};e.onmouseout=function(){window.setTimeout((function(){n(e)||n(t)||(e.style.display="none")}),75)},t.onmouseover=function(){e.style.display="block"},t.onmouseout=function(){window.setTimeout((function(){n(e)||n(t)||(e.style.display="none")}),75)}}},{key:"createShowRecTooltip",value:function(e,t){t.style.cursor="default",t.style.opacity="0.5",e.style.cursor="default";var n=(0,z.T)({content:g.ag.signUpToUseFeature(),hasHTML:"true",width:"auto",divotPosition:"0",divotLeftOrTop:"40px"});(0,h.Zs)(n,{marginTop:"5px",marginLeft:"42px",borderStyle:"solid"});var i=n.querySelector(".divotTop"),o=n.querySelector(".divotBorder"),r=n.querySelector(".divotBackground");return null!==i&&null!==o&&null!==r&&((0,h.Zs)(i,{top:"-5px"}),(0,h.Zs)(o,{borderWidth:"4px"}),(0,h.Zs)(r,{borderWidth:"5px",top:"1px",left:"-1px"})),this.setTooltipDisplayBehavior(n,t),e.readOnly=!0,e.onclick=function(){},n}},{key:"createRoomAnimTooltip",value:function(e,t){t.style.cursor="default",t.style.opacity="0.5",e.style.cursor="default";var n=(0,z.T)({content:g.ag.supporterToUseFeature(L.J.current.PurchaseEventSources.SUPPORTER_SOURCE_PREVIEW_ROOMS_UPSELL),hasHTML:"true",width:"auto",divotPosition:"0",divotLeftOrTop:"40px"}),i=n.querySelector("a");return null!==i&&(i.onclick=function(){(0,m.fg)("SupporterPageOpened",{source:"AnimateRoomImagesTooltip"})}),(0,h.Zs)(n,{marginTop:"5px",marginLeft:"42px",borderStyle:"solid"}),this.setTooltipDisplayBehavior(n,t),e.readOnly=!0,e.onclick=function(){},n}},{key:"bindFilterLocationForm",value:function(){var e=this,t=document.querySelector("#filter_location_form");null!==t&&(t.onchange=function(){e.onFilterFormChange(t)},t.querySelectorAll("input[type=checkbox]").forEach((function(n){(0,c.j9)("change",n,(function(){var i=new FormData(t).getAll("visible_regions").join(",");e.regionsChanged.fire(i),(0,m.fg)("RoomsFilterRegionClicked",{region:n.value,checked:n.checked})}))})))}},{key:"bindFilterOptionsForm",value:function(){var e=this,t=document.querySelector("#filter_options_form");null!==t&&(t.onchange=function(){e.onFilterFormChange(t)})}},{key:"bindAnimateThumbnailForm",value:function(){var e=this,t=document.querySelector("#animate_thumbnails_form");if(this.animateThumbnailsInput=document.querySelector("#id_animate_thumbnails"),null!==t&&null!==this.animateThumbnailsInput&&(this.animateThumbnailsInput.disabled||(this.isAnimThumbUnlocked=!0),this.showAnimateThumbnails=this.animateThumbnailsInput.checked,(0,c.j9)("change",this.animateThumbnailsInput,(function(){e.isAnimThumbUnlocked&&(e.onFilterFormChange(t),void 0!==document.setAnimateFollowedTab&&document.setAnimateFollowedTab(e.showAnimateThumbnails))})),(this.isAnimThumbUnlocked?this.animateThumbnailsInput:t).onclick=function(t){var n;(0,m.fg)("AnimateRoomImagesClicked",{checked:null===(n=e.animateThumbnailsInput)||void 0===n?void 0:n.checked})},!this.isAnimThumbUnlocked)){var n=t.querySelector("label[for='id_animate_thumbnails']");if(null!==n){var i=this.createRoomAnimTooltip(this.animateThumbnailsInput,n);t.appendChild(i)}}}},{key:"bindOpenCloseButtons",value:function(){var e=document.querySelector(".advanced_search_button");null!==e&&(e.dataset.testid="advanced-search-button",e.onclick=this.toggle)}},{key:"showEnableFloatingPlayerOption",value:function(){this.showElement();var e=document.querySelector("label[for='id_enable_floatingplayer']");if(null!==e){var t=e.style.color;e.style.color="#ff6b00",this.enableFloatingPlayerForm.onclick=function(){e.style.color=t}}}},{key:"bindFloatingPlayerOption",value:function(){var e=this,t=document.querySelector("#floatingplayer_options_form");if(null!==t){this.enableFloatingPlayerForm=t,window.location.search.includes("advanced_options")&&this.showEnableFloatingPlayerOption();var n=document.querySelector("#id_enable_floatingplayer");null!==n&&(0,c.j9)("change",n,(function(){(0,u.I5)(t.action,new FormData(e.enableFloatingPlayerForm)).then((function(){var e=n.checked;(0,m.fg)("EnableFloatingPlayerOption",{isEnabled:e}),e||void 0!==document.disableFloatingPlayer&&document.disableFloatingPlayer()})).catch(v.Gr)}))}}},{key:"showSearchingOverlays",value:function(){var e=this;clearTimeout(this.optionsUpdateTimeout),document.querySelectorAll(".searching-overlay").forEach((function(t){e.updateOverlayPosition(t),t.style.display="block"}))}},{key:"hideSearchingOverlays",value:function(){var e=this,t=document.querySelectorAll(".searching-overlay");t.forEach((function(t){e.updateOverlayPosition(t)})),clearTimeout(this.optionsUpdateTimeout),this.optionsUpdateTimeout=window.setTimeout((function(){t.forEach((function(e){e.style.display="none"}))}),300)}},{key:"onFilterFormChange",value:function(e){var t=this;this.setShowAnimateThumbnails(),this.skipOverlays||W.fire(!0),(0,u.I5)(e.action,new FormData(e)).then((function(){t.isAnimThumbUnlocked&&(0,D.X7)(t.showAnimateThumbnails),t.bindAdvancedSearchRegion(),D.Bb.getInstance().loadRooms((function(){t.skipOverlays||W.fire(!1)}))})).catch(v.Gr)}},{key:"getTargetedOverlayContainer",value:function(e){var t=e.nextElementSibling;if(null!==t){if("discover_root"===t.id)return t;var n=t.querySelector(".list");return null===n&&(n=t.lastElementChild),null===n?void 0:n}}},{key:"updateOverlayPosition",value:function(e){var t=this.getTargetedOverlayContainer(e);if(void 0!==t){var n=t,i=n.getBoundingClientRect().width,o=n.getBoundingClientRect().height;e.style.height="".concat(o,"px"),e.style.left="".concat(n.offsetLeft,"px"),e.style.top="".concat(n.offsetTop,"px"),e.style.right="".concat(document.documentElement.clientWidth-n.offsetLeft-i,"px"),e.style.lineHeight="".concat(o,"px");var r=e.querySelector(".searching-overlay-spinner");null!==r&&(o<50?(r.classList.add("searching-overlay-spinner-very-small"),r.classList.remove("searching-overlay-spinner-small"),r.classList.remove("searching-overlay-spinner-medium")):o>=50&&o<200?(r.classList.remove("searching-overlay-spinner-very-small"),r.classList.add("searching-overlay-spinner-small"),r.classList.remove("searching-overlay-spinner-medium")):o>=200&&o<550?(r.classList.remove("searching-overlay-spinner-very-small"),r.classList.remove("searching-overlay-spinner-small"),r.classList.add("searching-overlay-spinner-medium")):(r.classList.remove("searching-overlay-spinner-very-small"),r.classList.remove("searching-overlay-spinner-small"),r.classList.remove("searching-overlay-spinner-medium")))}}},{key:"bindEnableRecommendations",value:function(){var e=this,t=document.querySelector("#filter_options_form"),n=document.querySelector("#id_enable_recommendations"),i=!1;if(null!==t){null!==n&&((0,c.j9)("change",n,(function(){(0,m.fg)("EnableRecommendationsOptionClicked",{isEnabled:n.checked}),e.enableRecommendationsChanged.fire()})),n.disabled||(i=!0));var o=t.querySelector("label[for='id_enable_recommendations']");if(!i&&null!==n&&null!==o){var r=this.createShowRecTooltip(n,o);t.appendChild(r)}}}},{key:"bindRefreshCamForm",value:function(){var e=this,t=document.querySelector("#refresh_cams_form");null!==t&&(t.onchange=function(){var n=t.querySelector("#id_refresh_frequency");if(null!==n){var i=parseInt(n.value);e.setShowAnimateThumbnails(),(0,u.I5)(t.action,new FormData(t)).then((function(){(0,m.fg)("RefreshFrequencyChanged",{seconds:i}),e.isAnimThumbUnlocked&&(0,D.X7)(e.showAnimateThumbnails),D.Bb.scheduleImageRefresh(i)})).catch(v.Gr)}})}},{key:"showElement",value:function(){this.isShown()||this.element.classList.remove("collapsed")}},{key:"hideElement",value:function(){this.isShown()&&this.element.classList.add("collapsed")}},{key:"isShown",value:function(){return!this.element.classList.contains("collapsed")}},{key:"bindSearchInput",value:function(){if(this.isMobile){var e=new H,t=document.getElementById("SearchInputEntry");null!==t&&t.appendChild(e.element)}var n=document.querySelector(".search_input"),i=document.querySelector("#search_icon"),o=document.querySelector(".suggestionsDiv");if(null!==n&&null!==i&&null!==o){var r=function(){(0,m.fg)("RoomsFilterSearchClicked",{keyword:n.value})};[i,o].forEach((function(e){(0,c.j9)("click",e,(function(e){r()}),!0)})),[n,i,o].forEach((function(e){(0,c.j9)("keydown",e,(function(e){(0,p.r$)(e)&&r()}),!0)}))}}},{key:"bindCloseButton",value:function(){if(!this.isMobile){var e=(0,y.vz)("img",{style:{position:"absolute",height:"12px",width:"14px",right:"16px",top:"13px",cursor:"pointer"},src:"".concat(STATIC_URL,"option_close.svg"),onClick:this.toggle});this.element.appendChild(e)}}},{key:"bindShowLocationOptionsForm",value:function(){var e=document.querySelector("#id_show_location");null!==e&&(0,c.j9)("change",e,(function(){(0,m.fg)("ShowLocationClicked",{checked:e.checked}),V.fire(e.checked)}))}}]),b}(d.w)},2018:function(e,t,n){"use strict";n.d(t,{AB:function(){return d},Bk:function(){return v},Fq:function(){return I},HV:function(){return b},KT:function(){return x},L5:function(){return C},Sd:function(){return R},Y2:function(){return k},dk:function(){return y},jO:function(){return S},oz:function(){return w},yk:function(){return g}});var i,o=n(7791),r=n(5809),s=n(824),a=n.n(s),l=n(3753),c=n(391),u=n(2748);function d(e){return(0,l.Ue)("api/public/asp/control/app/".concat(e,"/")).then((function(e){return function(e){var t,n=new c.j(e);if(void 0!==n.getAny("settingsValues")){var i=new c.j(n.getObjectString("settingsValues"));t={},i.keys().map((function(e){t[e]=i.getAny(e)}))}return{id:n.getString("id"),name:n.getString("name"),isPublic:n.getBoolean("isPublic",!1,!1),isInstalled:n.getBoolean("isInstalled",!1,!1),isActive:n.getBoolean("isActive",!1,!1),hasUpdate:n.getBoolean("hasUpdate",!1,!1),installed:void 0!==n.getAny("installed")?f(n.getObjectString("installed")):void 0,latest:f(n.getObjectString("latest")),settingsValues:t,permissionsValues:void 0!==n.getAny("permissionsValues")?h(n.getObjectString("permissionsValues")):void 0,reason:n.getStringOrUndefined("reason"),slot:n.getNumberOrUndefined("slot")}}(e.responseText)}))}function h(e){var t=new c.j(e);return{videoPanel:t.getBoolean("videoPanel"),rewriteMessages:t.getBoolean("rewriteMessages"),tipOptions:t.getBoolean("tipOptions")}}function f(e){var t=new c.j(e);return{version:t.getString("version"),id:t.getString("id"),summary:t.getString("summary"),description:t.getString("description"),author:t.getString("author"),settings:p(t.getObjectString("settings")),permissions:m(t.getObjectString("permissions"))}}function p(e){var t={},n=new c.j(e);return n.keys().map((function(e){t[e]=function(e){var t=new c.j(e);return{type:t.getString("type"),title:t.getStringOrUndefined("title",!1),description:t.getStringOrUndefined("description",!1),minimum:t.getNumberOrUndefined("minimum",!1),maximum:t.getNumberOrUndefined("maximum",!1),minLength:t.getNumberOrUndefined("minLength",!1),maxLength:t.getNumberOrUndefined("maxLength",!1),pattern:t.getStringOrUndefined("pattern",!1),default:t.getAny("default"),required:t.getBoolean("required",!1,!1),order:t.getNumberOrUndefined("order"),enum:t.getStringListOrUndefined("enum")}}(n.getObjectString(e))})),t}function m(e){function t(e){return{settings:new c.j(e).getString("settings")}}var n=new c.j(e);return{videoPanel:t(n.getObjectString("videoPanel")),rewriteMessages:t(n.getObjectString("rewriteMessages")),tipOptions:t(n.getObjectString("tipOptions"))}}function v(e){return{appList:e.getStringList("order").map((function(e){return t=e,{id:(n=new c.j(t)).getString("id"),name:n.getString("name"),panelType:n.getString("system")};var t,n})),appName:e.getString("app_name",!1),template:e.getString("template",!1),layers:e.getList("layers"),url:e.getStringOrUndefined("url",!1),error:e.getStringOrUndefined("error",!1)}}function g(e){for(var t=new FormData,n=function(){var e=(0,r.Z)(o[i],2),n=e[0],s=e[1];Array.isArray(s)?s.forEach((function(e){t.append(n,e)})):t.set(n,s)},i=0,o=Object.entries(e);i0&&void 0!==arguments[0]&&arguments[0]&&f(),c}function m(e){var t=p();return void 0===t?(error("ignoreSet should not be undefined"),!1):t.has(e)}},6474:function(e,t,n){"use strict";n.d(t,{Fh:function(){return b},I_:function(){return w},SX:function(){return I},Ug:function(){return P},bG:function(){return B},iT:function(){return C},kG:function(){return g},lW:function(){return y},pc:function(){return M},rw:function(){return x},yW:function(){return T}});var i=n(7791),o=n(824),r=n.n(o),s=n(1522),a=n(3753),l=n(391),c=n(5011),u=n(1794),d=n(3705),h=n(1392),f=n(3543),p=n(1289),m=n(2800),v=n(8626),g=50,y=new u.xB("createNewSession");function b(){return m.J.current.dmsEnabled}function w(e){return{message:e.getString("m"),numUnread:e.getNumber("num_unread"),time:1e3*e.getNumber("created_at"),fromUsername:e.getString("from_user"),otherUser:(0,c.yp)(new l.j(e.getObject("other_user"))),hasMedia:e.getBoolean("has_media")}}function C(e){return{username:e,isBroadcaster:!0,inFanclub:!1,hasTokens:!1,isMod:!1,tippedRecently:!1,tippedALotRecently:!1,tippedTonsRecently:!1,exploringHashTag:"",sourceName:"df"}}function x(e){return{message:"",numUnread:0,fromUsername:e,hasMedia:!1,otherUser:C(e)}}function k(e){var t=e.getList("messages");return void 0===t?{messages:[],numUnread:0}:{messages:t.map((function(e){return(0,c.p0)(e)})),numUnread:e.getNumber("num_unread")}}var S=new Map;function T(e,t,n){if(void 0===n)return Promise.resolve({messages:[],numUnread:0});var i="".concat(e,"-").concat(t,"-").concat(n),o=S.get(i);if(void 0===o){var r=(0,p.Ie)({offset:n,room:t});o=(0,a.Ue)("api/ts/chatmessages/pm_list/".concat(e,"/?").concat(r)).then((function(e){return k(new l.j(e.responseText))})),S.set(i,o),window.setTimeout((function(){S.delete(i)}),100)}return o}function I(e,t){var n="api/ts/chatmessages/pm_history/".concat(e,"/");return void 0!==t&&(n+="?".concat((0,p.Ie)({offset:t}))),(0,a.Ue)(n).then((function(e){return k(new l.j(e.responseText))}))}var P=["roomviewPM","mobilePM","mobile","DM"];function R(e,t){var n={m:e.message};if(void 0!==e.media&&(n.media_id=e.media.map((function(e){return e.mediaId}))),void 0!==t)for(var i=0,o=Object.keys(t);ie.length)&&(t=e.length);for(var n=0,i=new Array(t);nf)n=Promise.reject("file_too_large");else{var o=new FormData;o.append("media",e),n=(0,i.I5)("api/ts/chatmessages/media/upload/",o).then((function(e){var t=JSON.parse(e.responseText).payload;return{mediaId:t.media_id,url:t.media_url,thumbnailUrl:t.media_thumbnail_url,opened:!1,fromUserUID:t.user_uid}}))}return u.fire({toUser:t,promise:n}),n}function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.ec,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(0,i.Ue)("api/ts/chatmessages/media/?media_type=I&limit=".concat(e,"&offset=").concat(t)).then((function(e){var t,n=[],i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return a(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)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw r}}}}(JSON.parse(e.responseText).media);try{for(i.s();!(t=i.n()).done;){var o=t.value;n.push({mediaId:o.media_id,url:o.media_url,thumbnailUrl:o.media_thumbnail_url,opened:!1,fromUserUID:o.user_uid})}}catch(e){i.e(e)}finally{i.f()}return n.sort((function(e,t){return Number(t.mediaId)-Number(e.mediaId)})),n}))}var v=new o.d((function(){l=m()}),{bounceLimitMS:10,debounceType:0});function g(){return v.callFunc(),l}function y(e){return(0,i.I5)("api/ts/chatmessages/media/delete/",{media_id:e.toString()}).then((function(t){return 200===t.status?(d.fire(e),Promise.resolve()):Promise.reject()})).catch((function(e){return Promise.reject()}))}function b(e,t,n){var o=new FormData;return o.append("from_user_uid",e),o.append("message_id",t),o.append("media_id",n.toString()),(0,i.I5)("api/ts/chatmessages/media/opened/",o).then((function(e){return 204===e.status})).catch((function(){return!1}))}},7804:function(e,t,n){"use strict";n.d(t,{h:function(){return r}});var i=n(3753),o=n(8959);function r(e){return new Promise((function(t,n){(0,i.I5)("api/ts/accounts/editsubgender/",e).then((function(){t(e.get("subgender")),"function"==typeof window[o.Z]&&window[o.Z]()})).catch((function(){n()}))}))}},6272:function(e,t,n){"use strict";n.d(t,{A3:function(){return c},Co:function(){return u},H2:function(){return l},d1:function(){return p},yX:function(){return h}});var i=n(3753),o=n(391),r=n(1794),s=n(2800);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw r}}}}(JSON.parse(e));try{for(i.s();!(t=i.n()).done;){var r=t.value,s=new o.j(JSON.stringify(r));n.push({label:s.getAsString("label")}),s.logUnusedDebugging("parseOptions")}}catch(e){i.e(e)}finally{i.f()}return n}function h(e){return new Promise((function(t,n){(0,i.Ue)("tipping/current_tokens/?room=".concat(e)).then((function(e){var n,i,r,s,a=(n=e.responseText,i=new o.j(n),r={tokenBalance:i.getNumber("token_balance")},void 0!==(s=i.getStringOrUndefined("tip_options"))&&(r.tipOptions=function(e){var t=new o.j(e),n=t.getObjectStringOrUndefined("tip_options");if(void 0!==n){var i={label:(t=new o.j(n)).getAsString("label"),options:d(t.getObjectString("options"))};return t.logUnusedDebugging("parseTipOptions"),i}}(s)),i.logUnusedDebugging("parseCurrentTokensResponse"),r);c.fire({tokens:a.tokenBalance}),t(a)})).catch((function(e){n(e.status)}))}))}var f=!1;function p(e){return new Promise((function(t,n){var r,a;f||(f=!0,(0,i.I5)("tipping/send_tip/".concat(e.roomName,"/"),{tip_amount:e.tipAmount,message:e.message,source:e.source,tip_room_type:e.tipRoomType,tip_type:e.tipType,video_mode:e.videoMode,from_username:null!==(r=null===(a=s.J.current.loggedInUser)||void 0===a?void 0:a.username)&&void 0!==r?r:""}).then((function(e){f=!1;var n=function(e){var t=new o.j(e),n={success:t.getBoolean("success")},i=t.getStringOrUndefined("error",!1);return void 0!==i?(n.error=i,n.showPurchaseLink=t.getBoolean("show_purchase_tokens",!1,!1)):(n.tokenBalance=t.getNumber("token_balance"),n.tipsInPast24Hours=t.getNumber("tipped_performer_last_24hrs")),t.logUnusedDebugging("parseSendTipResponse"),n}(e.responseText);void 0!==n.tokenBalance&&c.fire({tokens:n.tokenBalance}),t(n)})).catch((function(e){f=!1,n(e.xhr.status)})))}))}},2915:function(e,t,n){"use strict";n.d(t,{zv:function(){return W},G0:function(){return z},Nt:function(){return H}});var i=n(3243),o=n(7591),r=n(9492),s=n(7597),a=n(2951),l=n(1976),c=n(8759),u=n(7804),d=n(4028),h=n(7693),f=n(1522),p=n(2394),m=n(2400),v=function(){function e(t){(0,a.Z)(this,e),this.algorithm=2,this.level=0,void 0!==t&&(this.algorithm=t)}return(0,l.Z)(e,[{key:"avgAlgorithm",value:function(e){var t=e.reduce((function(e,t){return e+t*t}));this.level=Math.sqrt(t/e.length)}},{key:"maxAlgorithm",value:function(e){var t=Number.MIN_SAFE_INTEGER;e.map((function(e){return e>t&&(t=e),e})),0===e.length||t<0?t=0:t>1?t=1:this.level=t}},{key:"connect",value:function(e){var t=this;this.level=0,(0,c.BR)()&&("webkitAudioContext"in window?this.context=new webkitAudioContext:this.context=new AudioContext,this.script=this.context.createScriptProcessor(2048,1,1),this.mic=this.context.createMediaStreamSource(e),this.mic.connect(this.script),this.script.connect(this.context.destination),this.script.onaudioprocess=function(e){var n=e.inputBuffer.getChannelData(0);1===t.algorithm?t.avgAlgorithm(n):2===t.algorithm?t.maxAlgorithm(n):error("invalid algorithm choice",t.algorithm)})}},{key:"stop",value:function(){return(0,c.BR)()?(this.mic.disconnect(),this.script.disconnect(),this.context.close()):Promise.resolve()}}]),e}(),g=n(1986),y=n(6767),b=n(9),w=n(8263),C=n(9165),x=n(3682),k=n(3705),S=n(3544),T=n(3543),I=n(7906),P=n(1185),R=n(6547),M=n(851),A=n(2800);function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&(e.volumeMeter=new v,e.volumeMeter.connect(e.streamer.stream),e.volumeMeterInterval=window.setInterval((function(){if(void 0!==e.volumeMeter&&void 0!==e.volumeRange){var t=100*e.volumeMeter.level;e.volumeRange.style.width="".concat(t,"%")}})))})).catch((function(){}))}},{key:"updateResolution",value:function(e){var t=this.devices.cams.get(this.constraints.camId);if(void 0!==t){var n=t.resolutions.get(e.value);void 0!==n&&(this.constraints.width=n.width,this.constraints.height=n.height,this.videoRatio=n.ratio,void 0!==this.hdLabel&&(n.isHD?this.hdLabel.style.visibility="visible":this.hdLabel.style.visibility="hidden"),this.start())}}},{key:"updateResolutions",value:function(){var e=this,t=this.devices.cams.get(this.constraints.camId);if(void 0!==t){for(var n=this.resSelect.options.length-1;n>=0;n-=1)this.resSelect.removeChild(this.resSelect.options[n]);var i=(0,y.sv)("selected_res"),o=0,r=-1,s=(0,c.op)();t.resolutions.forEach((function(t){if(!s||960!==t.width){var n=document.createElement("option");n.label=t.label,n.text=t.label,n.value=t.id,e.resSelect.add(n),n.value===i&&(r=o),o+=1}})),-1===r&&(r=Math.floor(this.resSelect.options.length/2));var a=this.resSelect.options[r];a.selected=!0,this.updateResolution(a)}}},{key:"onCamChange",value:function(){var e=this.camSelect.selectedIndex;if(e>=0){var t=this.camSelect.options[e];this.constraints.camId=t.value,(0,y.C)("selected_cam",t.value,60),(0,y.C)("selected_res","",0),this.updateResolutions()}}},{key:"onResChange",value:function(){var e=this.resSelect.selectedIndex;if(e>=0){var t=this.resSelect.options[e];(0,y.C)("selected_res",t.value,60),this.updateResolution(t)}}},{key:"createPreviewPanel",value:function(){(0,P.vP)(this.element,"previewPanel"),this.element.style.height=L,this.element.style.width="488px",this.element.style.paddingLeft="5px",this.element.appendChild(this.createTitle()),this.element.appendChild(this.createMediaSettingsPanel()),this.element.appendChild(this.createVideoPanel())}},{key:"createTitle",value:function(){var e=document.createElement("div");(0,P.vP)(e,"welcomeTitle"),e.style.width="100%",e.style.height="32px";var t=document.createElement("span");return t.style.paddingLeft="10px",t.style.verticalAlign="sub",t.style.lineHeight="32px",t.textContent="".concat(T.ag.welcomeBack,", ").concat(this.dossier.room),e.appendChild(t),e}},{key:"createMediaSettingsPanel",value:function(){var e=this,t=document.createElement("div");return t.style.width="198px",t.style.cssFloat="left",t.style.height="318px",t.style.padding="10px 0 10px 0",t.appendChild(this.createCamSettingsPanel()),t.appendChild(this.createMicSettingsPanel()),(0,p.N2)().then((function(t){t?e.getUserMedia():(e.setStartButtonDisabled(!0),e.showHelpOverlay())})).catch((function(){e.getUserMedia()})),t}},{key:"getUserMedia",value:function(){var e=this;this.hideHelpOverlay(),(0,p.Ru)(!1).then((function(t){if(e.setStartButtonDisabled(!1),e.devices=t,t.mics.size>0&&void 0!==e.micSelect){var n=document.createElement("option");n.label=T.ag.noMicrophone,n.text=n.label,n.value=O,e.micSelect.add(n);var i=(0,y.sv)("selected_mic"),o=1,r=1;n.value===i&&(r=0),t.mics.forEach((function(t){var n=document.createElement("option");n.label=t.label,n.text=t.label,n.value=t.id,void 0!==e.micSelect&&e.micSelect.add(n),n.value===i&&(r=o),o+=1}));var s=e.micSelect.options[r];s.selected=!0,e.constraints.micId=s.value}if(t.cams.size>0){var a=(0,y.sv)("selected_cam"),l=0,c=0;t.cams.forEach((function(t){var n=document.createElement("option");n.label=t.label,n.text=t.label,n.value=t.id,e.camSelect.add(n),n.value===a&&(c=l),l+=1}));var u=e.camSelect.options[c];u.selected=!0,e.constraints.camId=u.value,e.updateResolutions()}})).catch((function(t){e.setStartButtonDisabled(!0);var n="",i="";null!==t.message&&void 0!==t.message?n="OverconstrainedError"===t.name||"NotFoundError"===t.name||"DevicesNotFoundError"===t.name?T.ag.noCameraFound:"PermissionDeniedError"===t.name||"NotAllowedError"===t.name?T.ag.camAndMicPermissionDenied:"NotReadableError"===t.name?"".concat(t.message,". ").concat(T.ag.noOtherTabsOpen):t.message:null!==t.name&&void 0!==t.name&&(n=t.name),""!==n&&(i=". "),e.showHelpOverlay("".concat(T.ag.couldNotGetDevices).concat(i).concat(n))}))}},{key:"hideHelpOverlay",value:function(){for(var e=0,t=[this.camSelect,this.resSelect,this.micSelect];e=0){var n=i.options[t];e.constraints.micId=n.value,(0,y.C)("selected_mic",n.value,60),e.start()}};var o=(0,c.BR)();if(o){var r=document.createElement("div"),s=Z("".concat(T.ag.inputLevelLabel,":"));s.style.paddingTop="16px",s.style.paddingLeft="8px",s.style.display="inline-block";for(var a=16;(0,w.WG)("".concat(T.ag.inputLevelLabel,":"),"".concat(a,"px UbuntuRegular"))>85&&a>1;)a-=1;s.style.fontSize="".concat(a,"px"),r.appendChild(s);var l=document.createElement("div");(0,P.vP)(l,"inputLevelBar"),l.style.width="82px",l.style.margin="23px 8px 0 10px",l.style.borderWidth="1px",l.style.borderStyle="solid",l.style.display="inline-block",l.style.height="7px";var u=document.createElement("div");u.style.width="78px",u.style.height="7px",u.style.width="0%",u.style.backgroundColor="lightgreen",this.volumeRange=u,l.appendChild(u),r.appendChild(l),t.appendChild(r)}var d=document.createElement("div"),h=new M.S(16,!1,(function(){var t=!e.constraints.muted;p(t)&&(e.constraints.muted=t)}));h.setCheckboxValue("Mute"),h.element.id="mutebox",h.element.style.marginTop="8px",h.element.style.marginLeft="8px",h.disable();var f=window.setInterval((function(){p(e.constraints.muted)&&(h.enable(),clearInterval(f))}),200);d.appendChild(h.element);var p=function(t){return void 0!==e.streamer&&!!e.streamer.setMute(t)&&(t?h.setCheckedDirectly(!0):h.setCheckedDirectly(!1),(0,y.C)("broadcast_muted",String(t),60),!0)},m=document.createElement("label");return m.textContent=T.ag.muteLabel,m.htmlFor="mutebox",m.style.paddingLeft="5px",m.style.transform="translateY(-4px)",m.style.fontFamily="UbuntuRegular",m.style.fontSize="14px",m.style.display="inline-block",m.style.lineHeight="22px",d.appendChild(m),o||(h.element.style.marginTop="100px",m.style.marginTop="70px"),t.appendChild(d),this.micSelect=i,t}},{key:"createVideoPanel",value:function(){var e=this,t=document.createElement("div");t.style.width="289px",t.style.cssFloat="left",t.style.height="318px",t.style.padding="10px 0 10px 0";var n=_();n.style.width="".concat(this.videoWidth,"px"),n.style.height="150px",n.style.marginLeft="10px",n.style.marginRight="10px",t.appendChild(n),this.video=n;var i=document.createElement("div");(0,P.vP)(i,"hdLabel"),i.style.fontSize="24px",i.style.fontFamily="UbuntuBold",i.style.marginLeft="10px",i.style.marginTop="10px",i.textContent="HD",i.style.visibility="hidden",this.hdLabel=i,t.appendChild(i),t.appendChild(this.createStartButton());var o=Z("".concat(T.ag.highQualityStream,":"));o.style.fontSize="11px",o.style.paddingLeft="0",o.style.paddingTop="5px",o.style.textAlign="center",t.appendChild(o);var r=document.createElement("div");r.style.textAlign="center";var s=document.createElement("a");return(0,P.vP)(s,P.ql.hrefColor),s.style.fontSize="12px",s.text=T.ag.useOBS,s.style.cursor="pointer",r.appendChild(s),t.appendChild(r),s.onclick=function(){e.config.onOBSClick()},t}},{key:"createStartButton",value:function(){var e=this,t=document.createElement("div");t.style.textAlign="center";var n=document.createElement("button");if((0,P.vP)(n,"startButton"),n.style.marginTop="75px",n.style.width="268px",n.style.height="32px",n.style.fontWeight="normal",n.style.fontSize="14px",n.textContent=T.ag.startBroadcasting,n.style.fontFamily="UbuntuBold",n.style.cursor="pointer",t.appendChild(n),n.disabled=!0,n.onclick=function(){if(e.user)if(e.user.gender===C.Y0.OldTrans&&void 0===e.user.subgender){var t=new d.i,n={acceptText:T.ag.subgenderSelectionConfirm,separator:!1,allowDecline:!1,orange:!0};(0,f.F1)(t.element,(function(){(0,u.h)(new FormData(t.element)).then((function(t){e.user&&(e.user.subgender=t),e.startBroadcast()})).catch((function(){}))}),void 0,void 0,n)}else e.startBroadcast();(0,h.j9)("keydown",window,(function(e){"Escape"===e.key&&e.stopImmediatePropagation()}),!0)},this.startButton=n,(0,c.vU)()){var i=Z("".concat(T.ag.firefoxWarning));(0,w.Zs)(i,{fontSize:"11px",paddingLeft:"5px",textAlign:"center"}),n.before(i),n.style.marginTop="15px"}return t}},{key:"setStartButtonDisabled",value:function(e){this.startButton.disabled=e,this.startButton.style.opacity=e?".5":"1",this.startButton.style.cursor=e?"default":"pointer"}},{key:"startBroadcast",value:function(){var e=this;(0,m.m)((function(){(0,R.Iu)().then((function(t){""!==t?((0,f.Cj)(T.ag.showMyCamCurrentlySharing(t)),e.setStartButtonDisabled(!0),(0,R.bG)((function(){e.setStartButtonDisabled(!1)}))):e.stop().then((function(){e.config.onStartBroadcast()})).catch((function(){}))})).catch((function(){}))}))}}]),n}(b.w),H=function(e){(0,o.Z)(n,e);var t=B(n);function n(e,i,o){return(0,a.Z)(this,n),t.call(this,e,i,o)}return(0,l.Z)(n,[{key:"stop",value:function(){return(0,i.Z)((0,s.Z)(n.prototype),"stop",this).call(this)}},{key:"start",value:function(){(0,i.Z)((0,s.Z)(n.prototype),"start",this).call(this)}},{key:"createPreviewPanel",value:function(){this.element.style.width="402px",this.element.style.backgroundColor="transparent",this.element.style.position="relative",this.element.appendChild(this.createTitle()),this.element.appendChild(this.createClose()),this.element.appendChild(this.createVideoPanel()),this.element.appendChild(this.createInfoPanel()),this.element.appendChild(this.createMediaSettingsPanel()),this.element.appendChild(this.createStartButton())}},{key:"createTitle",value:function(){var e=document.createElement("div");e.style.width="200px",e.style.height="26px",e.style.display="inline-block";var t=document.createElement("div");return(0,P.vP)(t,"title"),t.style.fontFamily="UbuntuBold",t.style.fontSize="18px",t.textContent=this.config.title,e.appendChild(t),e}},{key:"createClose",value:function(){var e=document.createElement("div");e.style.display="inline-block",e.style.position="relative",e.style.right="-1px",e.style.width=e.style.height="17px",e.style.cssFloat="right",e.style.cursor="pointer",e.onclick=this.config.onClose;var t=document.createElement("img");return t.src="".concat(STATIC_URL_ROOT,"tsdefaultassets/close-gray.svg"),t.style.width=t.style.height="100%",e.appendChild(t),e}},{key:"createVideoPanel",value:function(){this.videoWidth=400;var e=document.createElement("div");e.style.textAlign="center";var t=_();return t.style.width="".concat(this.videoWidth,"px"),t.style.height="".concat(this.videoWidth/this.videoRatio,"px"),e.appendChild(t),this.video=t,e}},{key:"createInfoPanel",value:function(){var e=document.createElement("div");(0,P.vP)(e,"infoPanel"),e.style.marginTop="6px",e.style.padding="6px 5px 9px 4px",e.style.borderWidth="1px",e.style.borderStyle="solid",e.style.boxSizing="border-box";var t,n,i=function(){var e=document.createElement("div");return e.style.fontFamily="UbuntuRegular",e.style.fontStyle="normal",e.style.fontWeight="bold",e.style.fontSize="12px",e.style.lineHeight="14px",e.style.textAlign="center",e},o=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=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&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(this.config.infoText);try{for(o.s();!(n=o.n()).done;){t=n.value;var r=i();r.textContent=t,e.appendChild(r)}}catch(e){o.e(e)}finally{o.f()}return e}},{key:"createMediaSettingsPanel",value:function(){var e=(0,i.Z)((0,s.Z)(n.prototype),"createMediaSettingsPanel",this).call(this);return e.style.width="100%",e.style.height="auto",e.style.padding="9px 0px 0px 0px",e.style.cssFloat="",e}},{key:"createHelpOverlay",value:function(){var e=(0,i.Z)((0,s.Z)(n.prototype),"createHelpOverlay",this).call(this);return e.style.top="11%",e}},{key:"createCamSettingsPanel",value:function(){var e=this,t=document.createElement("div");(0,P.vP)(t,"settingsPanel"),t.style.width="100%",t.style.height="68px",t.style.paddingTop="5px",t.style.borderWidth="2px",t.style.borderStyle="solid",t.style.boxSizing="border-box";var n=document.createElement("div");n.style.display="inline-block";var i=this.createMediaSettingLabel(T.ag.cameraLabel),o=F();o.style.marginLeft="8px",o.style.marginTop="8px",n.appendChild(i),n.appendChild(o);var r=document.createElement("div");r.style.display="inline-block",r.style.paddingLeft="16px";var s=this.createMediaSettingLabel(T.ag.resolutionLabel);s.style.paddingLeft="10px";var a=F();return a.style.marginTop="8px",r.appendChild(s),r.appendChild(a),t.appendChild(n),t.appendChild(r),o.onchange=function(){e.onCamChange()},a.onchange=function(){e.onResChange()},this.camSelect=o,this.resSelect=a,t}},{key:"createMicSettingsPanel",value:function(){this.constraints.micId=O;var e=document.createElement("div");return e.style.display="none",e}},{key:"createStartButton",value:function(){var e=this,t=document.createElement("div");t.style.textAlign="center",t.style.paddingTop="10px";var n=document.createElement("button");return(0,P.vP)(n,"startButton"),n.style.width="305px",n.style.height="27px",n.style.borderWidth="1px",n.style.borderStyle="solid",n.style.borderRadius="4px",n.textContent=this.config.startButtonText,n.style.fontFamily="UbuntuBold",n.style.fontSize="16px",n.style.cursor="pointer",n.style.whiteSpace="nowrap",n.style.overflow="hidden",n.style.textOverflow="ellipsis",t.appendChild(n),n.disabled=!0,n.onclick=function(){n.disabled=!0,e.startBroadcast()},this.startButton=n,t}},{key:"createMediaSettingLabel",value:function(e){var t=document.createElement("div");return t.style.paddingLeft="8px",t.style.paddingTop="3px",t.style.fontSize="16px",t.style.fontFamily="UbuntuBold",t.textContent=e,t}}]),n}(j),z=function(e){(0,o.Z)(n,e);var t=B(n);function n(e,i,o){var r;(0,a.Z)(this,n),(r=t.call(this)).stopping=!1,r.timeStarted=0,r.dossier=e,r.config=o,r.constraints=i,r.createBroadcastPanel();var s=!1,l=!1,c=!1,u=!0,d=function(e,t){void 0!==r.status&&void 0!==r.warning&&(!0!==t||l?!0!==t&&l&&(r.status.style.color="black",r.status.style.fontFamily="UbuntuRegular",r.status.style.width="",r.status.style.paddingLeft="0px",r.status.style.cssFloat="none",r.status.title="",r.warning.style.display="none",l=!1):(l=!0,r.status.style.color="#D80000",r.status.style.fontFamily="UbuntuBold",r.status.style.width="28%",r.status.style.paddingLeft="18%",r.status.style.cssFloat="left",r.status.title=r.warning.title=T.ag.poorBroadcast,r.warning.style.display=""),r.status.textContent=e,e.length>27?r.status.style.paddingTop="2px":r.status.style.paddingTop="10px")},h=function(){var e=performance.now(),t=window.setInterval((function(){if(u){var n=performance.now(),i=Math.floor((n-e)/1e3);i<1||(i>=10&&(e=n),void 0!==r.fps&&(r.fps.textContent=""),void 0!==r.status&&(r.status.textContent="".concat(T.ag.pleaseWaitConnecting," ").concat(10-i+1,"..."),r.status.textContent.length>33?r.status.style.paddingTop="2px":"ja"===A.J.current.languageCode?r.status.style.fontSize="14px":r.status.style.paddingTop="10px"))}else clearInterval(t)}),200)};return h(),r.onStreamStatusUpdate=function(e){if(void 0!==r.streamer&&r.streamer.uuid===e.uuid){var t=e.data;if(void 0!==t.fps&&(s=!r.setFPS(t.fps)),void 0!==t.status){var n=t.status;if("connecting"!==n&&(u=!1),r.isStatusOffline(n))return void d("(Offline)");if("away"!==n||c)if("away"!==n&&c)void 0!==r.away&&(r.away.style.display="none"),r.main.style.display="",c=!1;else{var i=n.charAt(0).toUpperCase()+n.slice(1);"connecting"===n?u||(u=!0,h()):s&&r.timeStarted>0&&performance.now()-r.timeStarted>5e3?d(T.ag.lowFPS,!0):d("(".concat(i," Broadcasting)"))}else r.main.style.display="none",void 0!==r.away&&(r.away.style.display=""),c=!0}}},r.onStreamStop=function(e){void 0===r.streamer||r.streamer.uuid!==e||r.stopping||r.stop(!0)},g.QU.listen(r.onStreamStatusUpdate),g.uT.listen(r.onStreamStop),r.start(),r}return(0,l.Z)(n,[{key:"createBroadcastPanel",value:function(){var e=this.createMain();e.appendChild(this.createVideo()),e.appendChild(this.createControls());var t=document.createElement("div");t.innerText=T.ag.incorrectOrientation,(0,w.Zs)(t,{color:"#ffffff",position:"absolute",fontSize:"1.0em",fontWeight:"bold",top:"8px",left:"8px",zIndex:100,display:"none",backgroundColor:"rgba(255, 255, 255, 0.5)",lineHeight:"150%",padding:"1px"}),t.setAttribute("draggable","false"),(0,h.j9)("orientationchange",window,(function(){(0,x.qn)()&&!(0,x.P0)()?(t.style.display="",(0,x.gr)()?t.innerText=T.ag.incorrectPortrait:t.innerText=T.ag.incorrectLandscape):t.style.display="none"})),e.appendChild(t);var n=this.createAway();n.appendChild(this.createTitle()),n.appendChild(this.createMessage()),n.appendChild(this.createLink()),(0,P.vP)(this.element,"broadcastPanel"),this.element.appendChild(e),this.element.appendChild(n),this.main=e,this.away=n}},{key:"isBroadcasting",value:function(){return void 0!==this.streamer&&this.streamer.broadcasting}},{key:"start",value:function(){var e=this;this.stop().then((function(){var t=0;new Promise((function n(i,o){e.streamer=new N,e.streamer.setup(e.video,e.dossier,e.constraints).then((function(){void 0!==e.streamer&&e.streamer.start().then((function(){e.onBeforeUnload=function(e){return e.preventDefault(),e.returnValue=!1,T.ag.wantToLeaveConfirmation},(0,h.j9)("beforeunload",window,e.onBeforeUnload),e.onUnload=function(){e.stop(!0)},(0,h.j9)((0,c.BV)(),window,e.onUnload),I.PU.fire(!0),i()})).catch((function(e){o("".concat(T.ag.couldNotStartBroadcast,": ").concat(e.message))}))})).catch((function(r){if((0,c._1)()&&"Invalid constraint"===r.message){if((t+=1)<=5)return void e.stop().then((function(){window.setTimeout((function(){n(i,o)}),500)})).catch((function(){}));o(T.ag.ipadFailedToSetup)}o("".concat(T.ag.couldNotSetupBroadcast,": ").concat(r.message))}))})).catch((function(t){(0,f.Cj)(t),e.stop(!0)}))})).catch((function(){}))}},{key:"stop",value:function(e){var t=this;this.stopping=!0,void 0!==this.onBeforeUnload&&((0,h.SC)("beforeunload",window,this.onBeforeUnload),this.onBeforeUnload=void 0),void 0!==this.onUnload&&((0,h.SC)((0,c.BV)(),window,this.onUnload),this.onUnload=void 0);var n=Promise.resolve();return void 0!==this.streamer&&(n=this.streamer.stop()),!0===e&&(0,y.C)("last_broadcast_dt",Date.now().toString(10),1),new Promise((function(i,o){n.then((function(){t.stopping=!1,!0===e&&(g.QU.removeListener(t.onStreamStatusUpdate),g.uT.removeListener(t.onStreamStop),t.config.onStopBroadcast(),I.PU.fire(!1)),i()})).catch(o)}))}},{key:"setFPS",value:function(e){var t=20,n=15;(0,c.s2)()&&(t=12,n=9);var i,o=!0;return(e=Math.round(e))>=t?i="frameRateGood":e>=n?i="frameRateAvg":(i="frameRateBad",o=!1),void 0!==this.fps&&(this.fps.className="",(0,P.vP)(this.fps,i),this.fps.textContent="".concat(e," FPS")),o}},{key:"createMain",value:function(){var e=document.createElement("div");return e.style.height=L,e.style.width="100%",e.style.overflow="unset",e}},{key:"createAway",value:function(){var e=document.createElement("div");return e.style.height=L,e.style.width="100%",e.style.backgroundColor="black",e.style.display="none",e}},{key:"createVideo",value:function(){var e=_();return e.style.width="100%",e.style.height="370px",e.style.backgroundColor="black",this.video=e,e}},{key:"createControls",value:function(){var e=this,t=document.createElement("div");(0,P.vP)(t,"controls"),t.style.width="100%",t.style.height="35px";var n=document.createElement("button");n.style.border="0px";var i=document.createElement("div");(0,P.vP)(i,"muteImg"),i.textContent="",i.style.height="20px",i.style.width="20px",i.style.border="0px",i.style.paddingTop="9px",(0,c.G6)()&&!(0,c.s2)()&&(i.style.paddingTop="3px"),i.style.outline="none",n.appendChild(i);var o=document.createElement("div");o.style.cssFloat="left",o.style.textAlign="center",o.style.height="34px",o.style.borderRight="1px solid black",o.style.width="10%",(0,c.Tt)()&&(0,c.G6)()&&(o.style.width="12%"),o.appendChild(n),t.appendChild(o);var r=function(t){return void 0!==e.streamer&&!!e.streamer.setMute(t)&&(t?(0,P.vP)(i,"muted"):(0,P.FU)(i,"muted"),(0,y.C)("broadcast_muted",String(t),60),!0)};n.onclick=function(){var t=!e.constraints.muted;r(t)&&(e.constraints.muted=t)},n.disabled=!0;var s=window.setInterval((function(){r(e.constraints.muted)&&(n.disabled=!1,clearInterval(s))}),200),a=document.createElement("div");(0,P.vP)(a,"inBrowserStatus"),a.style.cssFloat="left",a.style.textAlign="center",a.style.height="34px",a.style.width="51%",a.dataset.testid="stream-status",(0,c.Tt)()&&(a.style.width="44%"),a.style.borderRight="1px solid black",a.style.padding="0px",a.style.fontFamily="UbuntuRegular";var l=U("");l.style.cssFloat="left",l.style.paddingLeft="5px",l.style.paddingTop="10px";var u=Z("");u.style.paddingLeft="0px";var d=document.createElement("img");d.src="".concat(STATIC_URL_ROOT,"broadcastassets/warning.png"),d.style.height="16px",d.style.paddingTop="9px",d.style.paddingLeft="5px",d.style.display="none",d.style.cssFloat="left",a.appendChild(l),a.appendChild(u),a.appendChild(d),this.fps=l,this.status=u,this.warning=d,t.appendChild(a);var h=document.createElement("button"),f=document.createElement("input");f.type="image",f.src="".concat(STATIC_URL_ROOT,"broadcastassets/stop.svg"),f.style.verticalAlign="middle",f.style.height="16px",f.style.paddingTop="1px",h.appendChild(f);var p=document.createElement("span");p.style.fontFamily="UbuntuRegular",p.textContent=p.innerText=T.ag.stopBroadcasting;var m=p.innerText.length;m>24?(p.style.fontSize="11px",p.style.paddingLeft="1px"):m<24&&m>18?(p.style.fontSize="13px",p.style.paddingLeft="2px"):(p.style.fontSize="18px",p.style.paddingLeft="7px"),p.style.verticalAlign="middle",h.appendChild(p),h.style.paddingTop="5px",h.style.cssFloat="right",h.style.border="0",h.dataset.testid="stop-broadcasting-web-rtc-button";var v=document.createElement("div");return v.style.cssFloat="left",v.style.textAlign="center",v.style.height="34px",v.appendChild(h),t.appendChild(v),h.onclick=function(){e.stop(!0)},t}},{key:"createTitle",value:function(){var e=document.createElement("div");e.style.textAlign="center",e.style.paddingTop="90px";var t=document.createElement("span");return(0,P.vP)(t,"awayTitle"),t.textContent=T.ag.youAreAway,t.style.fontFamily="UbuntuRegular",t.style.fontSize="40px",e.appendChild(t),e}},{key:"createMessage",value:function(){var e=document.createElement("div");e.style.textAlign="center",e.style.paddingLeft="16%",e.style.paddingRight="16%",e.style.paddingTop="50px";var t=document.createElement("span");return(0,P.vP)(t,"inBrowserAwayMessage"),t.style.fontFamily="UbuntuRegular",t.style.fontSize="14px",t.textContent=T.ag.wentToAway,e.appendChild(t),e}},{key:"createLink",value:function(){var e=document.createElement("div");e.style.textAlign="center",e.style.paddingTop="35px";var t=document.createElement("a");return(0,P.vP)(t,"awayLink"),t.text=T.ag.exitAwayMode,t.style.fontFamily="UbuntuRegular",t.style.fontSize="20px",t.style.cursor="pointer",t.style.textDecoration="underline",e.appendChild(t),t.onclick=function(){(0,S.ve)()},e}},{key:"isStatusOffline",value:function(e){return!D.some((function(t){return t===e}))}}]),n}(b.w),W=function(e){(0,o.Z)(n,e);var t=B(n);function n(e,i,o){var r;(0,a.Z)(this,n),(r=t.call(this)).startCounter=1,r.dossier=e,r.user=o,r.config=i;var s=(0,y.ld)("broadcast_muted");return r.constraints={micId:"",camId:"",width:0,height:0,muted:void 0!==s&&s},(0,P.vP)(r.element,"Broadcast"),r.element.style.width="498px",r.element.style.height="407px",r.element.style.fontFamily="UbuntuBold",r.element.style.fontSize="18px",r.element.style.position="relative",r.previewPanel=r.createPreview(),r.addChild(r.previewPanel),r}return(0,l.Z)(n,[{key:"isBroadcasting",value:function(){return void 0!==this.broadcastPanel&&this.broadcastPanel.isBroadcasting()}},{key:"createPreview",value:function(){var e=this;return new j(this.dossier,this.constraints,{onOBSClick:this.config.onOBSClick,onStartBroadcast:function(){void 0!==e.previewPanel&&(e.removeChild(e.previewPanel),e.previewPanel=void 0),(0,k.fg)("WebRTCBroadcastStart",{startCount:e.startCounter}),e.startCounter+=1,e.broadcastPanel=e.createBroadcast(),e.addChild(e.broadcastPanel)}},this.user)}},{key:"createBroadcast",value:function(){var e=this;return new z(this.dossier,this.constraints,{onStopBroadcast:function(){void 0!==e.broadcastPanel&&(e.removeChild(e.broadcastPanel),e.broadcastPanel=void 0),e.previewPanel=e.createPreview(),e.addChild(e.previewPanel)}})}}]),n}(b.w)},7906:function(e,t,n){"use strict";n.d(t,{PE:function(){return s},PU:function(){return r},c6:function(){return o}});var i=n(1794),o=new i.xB("anyRTCBroadcastStartStop"),r=new i.xB("webRTCBroadcastStartStop"),s=new i.xB("OBSBroadcastStartStop"),a=function(e){o.fire(e)};r.listen(a),s.listen(a)},1185:function(e,t,n){"use strict";n.d(t,{FU:function(){return s},ql:function(){return o},vP:function(){return r}});var i=n(9),o={textColor:"textColor",bgColor:"bgColor",tabSectionBorder:"tabSectionBorder",tabBorder:"tabBorder",tabActiveBorder:"tabActiveBorder",tabInactiveBgColor:"tabInactiveBgColor",tabInactiveColor:"tabInactiveColor",tabActiveBgColor:"tabActiveBgColor",tabActiveColor:"tabActiveColor",chatAreaTabColor:"chatAreaTabColor",defaultColor:"defaultColor",defaultTooltipColor:"defaultTooltipColor",disabledTooltipColor:"disabledTooltipColor",roomSubjectToolTipColor:"roomSubjectToolTipColor",hrefColor:"hrefColor",tagFontColor:"tagFontColor",tagExhibColor:"tagExhibColor",tagNewColor:"tagNewColor",tagLineColor:"tagLineColor",tagOfflineColor:"tagOfflineColor",tagPrivateGroupColor:"tagPrivateGroupColor",tagGamingColor:"tagGamingColor",camBgColor:"camBgColor",camBorderColor:"camBorderColor",camSubjectColor:"camSubjectColor",camSubjectTagColor:"camSubjectTagColor",camAltTextColor:"camAltTextColor",camHrefColor:"camHrefColor",nextCamBgColor:"nextCamBgColor",navigationAlt2BgImage:"navigationAlt2BgImage",navigationAlt2BgColor:"navigationAlt2BgColor",dismissibleMessageColor:"dismissibleMessageColor",userInfoDropdownBgColor:"userInfoDropdownBgColor",userInfoDropdownHighlightColor:"userInfoDropdownHighlightColor",userInfoDropdownTextColor:"userInfoDropdownTextColor"};function r(e,t){(e instanceof i.w?e.element:e).classList.add(t)}function s(e,t){(e instanceof i.w?e.element:e).classList.remove(t)}},1194:function(e,t,n){"use strict";n.d(t,{d:function(){return c}});var i=n(7591),o=n(9492),r=n(7597),s=n(2951),a=n(1976);var l=function(e){(0,i.Z)(c,e);var t,n,l=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,r.Z)(t);if(n){var s=(0,r.Z)(this).constructor;e=Reflect.construct(i,arguments,s)}else e=i.apply(this,arguments);return(0,o.Z)(this,e)});function c(e,t){var n;(0,s.Z)(this,c),n=l.call(this);var i=document.createElement("span");return i.style.color="red",i.textContent="Error loading component",t.appendChild(i),warn("Created dummy React component"),n}return(0,a.Z)(c,[{key:"update",value:function(e){warn("Update called on dummy React component")}},{key:"dispose",value:function(){warn("Dispose called on dummy React component")}}]),c}(function(){function e(){(0,s.Z)(this,e)}return(0,a.Z)(e,[{key:"update",value:function(e){}},{key:"dispose",value:function(){}}]),e}()),c=function(){function e(){(0,s.Z)(this,e)}return(0,a.Z)(e,null,[{key:"get",value:function(e){return void 0===window.ReactComponentRegistry?(error("ReactComponentRegistry is undefined - React code is likely not loaded",{argument:e}),l):void 0===window.ReactComponentRegistry[e]?(error("ReactComponentRegistry does not contain component ".concat(e," - React code may not be up to date"),{argument:e}),l):window.ReactComponentRegistry[e]}}]),e}()},8542:function(e,t,n){"use strict";n.d(t,{MH:function(){return M},bY:function(){return C},sQ:function(){return w}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(4649),u=n(391),d=n(7968),h=n(7585),f=n(3543),p=n(47),m=n(2750),v=n(2018),g=n(1185);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function b(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n2&&void 0!==arguments[2]&&arguments[2];if(e in o.APP_PERMISSIONS){var i=o.APP_PERMISSIONS[e],r=this.checkboxElement(e,t);return(0,f.vz)("li",{style:{display:"flex",justifyContent:"left",cssFloat:"none",alignItems:"center",borderBottom:"1px solid #E5E5E5",padding:"10px",margin:"0"}},(0,f.vz)("div",{style:{minWidth:"220px",margin:"0 8px 0 0"}},(0,f.vz)("p",{style:{fontSize:"12px",margin:0,padding:0,fontFamily:"ubuntumedium",fontWeight:500}},i.label),(0,f.vz)("p",{style:{fontSize:"10px",margin:0,padding:0},colorClass:"subText"},i.description)),r,n?"":this.exclusiveAppTextElement(e))}}},{key:"updateStatusText",value:function(){void 0!==this.permissionsStatus&&(this.permissionsStatus.innerText=this.getStatusText(),(0,r.Z)(this.permissionsForm.elements).forEach((function(e){if(e.checked){var t=e.nextSibling;""!==t.innerText&&(t.innerText="")}})))}},{key:"formData",value:function(){for(var e=o.ALL_PERMISSIONS,t={},n=0,i=Object.values(e);n0}},{key:"confirmModalForm",value:function(){var e=this,t=this.getSelectedExclusiveConflicts();return(0,f.vz)("form",null,(0,f.vz)("ul",null,t.map((function(n,i){var o=e.renderPermission(n,!0,!0);return void 0!==o&&t.length===i+1&&(o.style.borderBottom="none"),o}))))}},{key:"render",value:function(){return this.element}}]),o}(d.w);(i=w).EXCLUSIVE_PERMISSIONS={videoPanel:"videoPanel",tipOptions:"tipOptions"},i.ALL_PERMISSIONS=g(g({},i.EXCLUSIVE_PERMISSIONS),{},{rewriteMessages:"rewriteMessages"}),i.APP_PERMISSIONS={videoPanel:{label:h.ag.videoPanelLabel,description:h.ag.exclusiveAppPermissionText,exclusiveText:h.ag.aspPermissionOverrideText},rewriteMessages:{label:h.ag.transformMessagesLabel,description:"",exclusiveText:""},tipOptions:{label:h.ag.tipOptionsLabel,description:h.ag.exclusiveAppPermissionText,exclusiveText:""}}},8945:function(e,t,n){"use strict";n.d(t,{X:function(){return v}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(7585),u=n(9598),d=n(3543),h=n(47),f=n(2800),p=n(6265);function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,a.Z)(this,n)}}var v=function(e){(0,s.Z)(n,e);var t=m(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"callFollowApi",value:function(e){var t,n=e?(0,u.kr)(this.props.slug,u.wk,this.isAnonymous):(0,u.c5)(this.props.slug,u.wk,this.isAnonymous);return null!==(t=null==n?void 0:n.then((function(e){return e?Promise.resolve():Promise.reject()})))&&void 0!==t?t:Promise.reject()}}]),n}(function(e){(0,s.Z)(n,e);var t=m(n);function n(e){var o;return(0,i.Z)(this,n),(o=t.call(this,e)).props=e,o.isAnonymous=void 0===f.J.current.loggedInUser,o.isMobile=f.J.current.isMobile,o}return(0,o.Z)(n,[{key:"initData",value:function(e){(0,r.Z)((0,l.Z)(n.prototype),"initData",this).call(this,e),this.setState({isActive:e.isFollowing})}},{key:"createElement",value:function(e){var t=this;return this.hideTitle=void 0!==e.hideTitle&&e.hideTitle,(0,h.vz)("div",{bind:{className:function(){return"follow_star ".concat(t.getIconClass())},title:function(){return t.getTitle()},style:function(){return t.getStyle()}},"data-slug":e.slug,onClick:function(n){t.handleClick(),!0!==e.allowPropagation&&n.stopPropagation(),n.preventDefault()},"data-testid":"follow-star"})}},{key:"getIconClass",value:function(){return void 0===this.state.isActive?"icon_update_following":this.state.isActive?"icon_following":"icon_not_following"}},{key:"getTitle",value:function(){return this.hideTitle||void 0===this.state.isActive?"":this.state.isActive?d.ag.unfollowText:d.ag.followText}},{key:"getStyle",value:function(){return{}}},{key:"setHover",value:function(){var e=this;this.element.classList.add("no_hover"),window.setTimeout((function(){e.element.classList.remove("no_hover")}),3e3)}},{key:"setFollowing",value:function(e){this.setState({isActive:e})}},{key:"handleClick",value:function(){var e=this;if(!this.isAnonymous||this.isMobile){var t=!0===this.state.isActive;this.setState({isActive:void 0}),this.callFollowApi(!t).then((function(){e.setState({isActive:!t}),e.setHover()})).catch((function(){e.setState({isActive:t})}))}else(0,p.iW)({fromFeature:!0})}}]),n}(c.I))},6853:function(e,t,n){"use strict";n.d(t,{GB:function(){return I},KR:function(){return h},MG:function(){return u},On:function(){return w},RH:function(){return T},Ve:function(){return v},YX:function(){return g},_t:function(){return y},iq:function(){return m},js:function(){return b},yY:function(){return d}});var i=n(8759),o=n(7693),r=n(3753),s=n(391),a=n(1794);function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(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)?c(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return(0,s.Z)(this,S),(t=k.call(this)).totalGames=i,t.currentPage=o,t.searchQuery=r,t.OBS_TUTORIAL_URL="https://support.chaturbate.com/hc/en-us/articles/360037971952-How-do-I-set-up-OBS-",t.SEARCH_DELAY=500,(0,y.Zs)(t.element,{position:"relative",width:"unset",height:"unset"}),t.element.appendChild(t.render()),t.searchAPIResults=n,t.renderSearchResults(),t.renderPagination(),null===(e=document.getElementById("search_games_input"))||void 0===e||e.focus(),t.searchTimer=void 0,t}return(0,a.Z)(S,[{key:"render",value:function(){var e,t=this,n=document.body.classList.contains("darkmode");return(0,C.vz)("div",{className:"GameSelection",ref:function(e){t.displayElement=e}},(0,C.vz)("div",{className:"title"},(0,C.vz)("h1",{style:{color:"#494949",marginBottom:"0px",fontSize:"1.3em",fontWeight:"bolder"},"data-testid":"select-game-header-text"},w.ag.selectGameHeaderText),(0,C.vz)("p",{style:{fontSize:"14px",lineHeight:"22px",margin:"12px 0 0"},className:"title"},P(w.ag.selectGameSectionText(x.w.sanitizedSiteName,x.w.cbGamesUrl)))),(0,C.vz)("div",null,(0,C.vz)("div",{style:{borderRadius:"4px",display:"inline-block",padding:"5px 8px",verticalAlign:"middle",fontSize:"14px"},className:"searchBar"},(0,C.vz)("input",{id:"search_games_input",type:"text",placeholder:"Search Games",style:{width:"210px",border:"0",outline:"none"},onInput:function(e){t.searchQueryChanged(e)},value:null!==(e=this.searchQuery)&&void 0!==e?e:"",maxLength:50}),(0,C.vz)("label",{for:"search_games_input"},(0,C.vz)("img",{src:"".concat(STATIC_URL_ROOT,"images/search").concat(n?"_dm":"",".svg"),width:"12",height:"12",style:{verticalAlign:"middle"}})))),(0,C.vz)("div",{ref:function(e){t.searchResults=e}}),(0,C.vz)("ul",{ref:function(e){t.paginationDOM=e}}))}},{key:"renderSearchResults",value:function(){var e;if(void 0!==this.searchAPIResults){var t=this.searchAPIResults.length>0?(0,C.vz)("div",null,this.searchAPIResults.map((function(e){return(0,C.vz)(I,{name:e.name,gameUrl:e.gameUrl,viewers:e.viewers,image:e.image,uid:e.uid,onClick:function(){window.location.href=(0,m.BN)(encodeURI("/games/confirm_game/".concat(e.uid,"/")))}})}))):(0,C.vz)("h3",{style:{fontSize:"14px",color:"#0B5D81"}},"No Results"),n=(0,C.vz)("div",null,t);null===(e=this.displayElement)||void 0===e||e.replaceChild(n,this.searchResults),this.searchResults=n}}},{key:"renderPagination",value:function(){var e,t=this,n=Math.floor(this.totalGames/20);this.totalGames%20>0&&(n+=1);var i,o=""===this.searchQuery?"?":"?q=".concat(this.searchQuery,"&"),s=(0,r.Z)((i=n,Array.from({length:i},(function(e,t){return t})))).map((function(e){e+=1;var n=t.currentPage===e?"active":"ok";return(0,C.vz)("li",{className:n,style:{margin:"0 2px",display:t.totalGames<=20?"none":""}},(0,C.vz)("a",{href:encodeURI("".concat(o,"p=").concat(e))},"".concat(e)))})),a=(0,C.vz)("ul",{className:"paging",style:{display:"flex",justifyContent:"center"}},(0,C.vz)("li",{style:{display:1===this.currentPage?"none":"inline-block",cursor:"pointer"}},(0,C.vz)("a",{className:"prev",style:{height:"100%"},href:encodeURI("".concat(o,"p=").concat(this.currentPage-1))})),s,(0,C.vz)("li",{style:{display:this.totalGames<20||this.currentPage===n?"none":"inline-block",cursor:"pointer"}},(0,C.vz)("a",{href:encodeURI("".concat(o,"p=").concat(this.currentPage+1)),className:"next",style:{height:"100%"}})));null===(e=this.displayElement)||void 0===e||e.replaceChild(a,this.paginationDOM),this.paginationDOM=a}},{key:"searchQueryChanged",value:function(e){if(e.stopPropagation(),this.searchQuery=e.target.value,0===this.searchQuery.length||this.searchQuery.length>1){this.currentPage=1,this.scheduleSearch();var t=document.getElementsByTagName("title")[0].innerHTML,n=0===this.searchQuery.length?{}:{q:this.searchQuery},i=0===this.searchQuery.length?"".concat(location.pathname):"".concat(location.pathname,"?q=").concat(this.searchQuery);window.history.replaceState(n,t,(0,m.BN)(i))}}},{key:"scheduleSearch",value:function(){var e=this;void 0!==this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=window.setTimeout((0,o.Z)(f().mark((function t(){return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.doSearch();case 2:case"end":return t.stop()}}),t)}))),this.SEARCH_DELAY)}},{key:"doSearch",value:(h=(0,o.Z)(f().mark((function e(){var t,n,i,o,r;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n="".concat(S.GAME_QUERY_URL,"?q=").concat(encodeURI(this.searchQuery)),1!==this.currentPage&&(n+="&p=".concat(this.currentPage)),e.next=5,(0,m.Ue)(n);case 5:i=e.sent,o=new v.j(i.responseText),this.totalGames=o.getNumber("total"),r=o.getList("games"),this.searchAPIResults=void 0!==r?S.parseSearchResults(r):[],this.renderSearchResults(),this.renderPagination(),null===(t=document.getElementById("search_games_input"))||void 0===t||t.focus(),(0,p.jI)().scrollTop=0,this.searchTimer=void 0,e.next=20;break;case 17:e.prev=17,e.t0=e.catch(0),this.searchTimer=void 0;case 20:case"end":return e.stop()}}),e,this,[[0,17]])}))),function(){return h.apply(this,arguments)})},{key:"selectGameAndClose",value:(d=(0,o.Z)(f().mark((function e(t){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S.selectGame(t);case 2:case"end":return e.stop()}}),e)}))),function(e){return d.apply(this,arguments)})}],[{key:"selectGame",value:(i=(0,o.Z)(f().mark((function e(t){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=(0,o.Z)(f().mark((function e(n){var i,o;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,m.I5)(S.GAME_SELECT_URL,{uid:t});case 3:i=e.sent,o=S.parseSelection(i.responseText),S.selectionChange.fire(o),n(!0),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),n(!1);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"deselectGame",value:(n=(0,o.Z)(f().mark((function e(){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,m.I5)(S.GAME_DESELECT_URL,{});case 2:S.selectionChange.fire(void 0);case 3:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"getCurrentGame",value:(t=(0,o.Z)(f().mark((function e(t){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=(0,o.Z)(f().mark((function e(n){var i;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,m.Ue)("".concat(S.GAME_CURRENT_URL).concat(encodeURI(t)));case 2:i=e.sent,n(S.parseSelection(i.responseText));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"parseSearchResults",value:function(e){return e.map((function(e){var t=e.getNumberOrUndefined("viewers");return{image:e.getString("image_64x64"),name:e.getString("name"),gameUrl:e.getString("game_url"),uid:e.getString("uid"),viewers:void 0===t?0:t}}))}},{key:"parseSelection",value:function(e){if(void 0!==e){var t=JSON.parse(e);if(null!==t)return{description:t.description,gameUrl:t.game_url,image:t.image_64x64,name:t.name,uid:t.uid,viewers:t.viewers}}}},{key:"generateHeader",value:function(){var e=(0,C.vz)("a",null),t=(0,C.vz)("div",null);return{headerContainer:(0,C.vz)("div",{className:"OBSInfoSection"},(0,C.vz)("div",null,(0,C.vz)(T,null)),(0,C.vz)("div",{className:"title"},(0,C.vz)("a",{href:"#",style:{display:"none"},ref:function(t){e=t}},(0,C.vz)("p",{style:{fontSize:"24px",lineHeight:"32px",fontFamily:"UbuntuMedium, Helvetica, Arial, sans-serif",margin:"16px 0 10px",color:"#0a5a83"}},"Games")),(0,C.vz)("p",{ref:function(e){t=e},style:{fontSize:"24px",lineHeight:"32px",fontFamily:"UbuntuMedium, Helvetica, Arial, sans-serif",margin:"16px 0 10px",display:"block"}},"Games"))),headerWithPageLink:e,header:t}}}]),S}(g.w);(i=R).GAME_QUERY_URL="api/ts/games/search/",i.GAME_SELECT_URL="api/ts/games/select/",i.GAME_INFO_URL="api/ts/games/info/",i.GAME_DESELECT_URL="api/ts/games/deselect/",i.GAME_CURRENT_URL="api/ts/games/current/room/",i.selectionChange=new b.xB("gameSelectionChanged")},5755:function(e,t,n){"use strict";n.d(t,{t:function(){return P}});var i=n(126),o=n(4649),r=n(3243),s=n(2951),a=n(1976),l=n(7591),c=n(9492),u=n(7597);function d(e,t){return Array.from(Array(t-e+1).keys()).map((function(t){return t+e}))}var h=n(7585),f=n(1794),p=n(47),m=n(3753),v=n(1289);function g(e,t,n){var i;n=null!==(i=n)&&void 0!==i?i:"page";var o="",r="";if(void 0!==t){var s=t.split("?");2===s.length?(o=s[0],r=s[1]):s.length<=1&&(o=t)}else o=window.location.pathname,r=window.location.search;var a=(0,v.dD)(r);return a[n]="".concat(e),"".concat(o,"?").concat((0,v.Ie)(a))}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var b=function(e){(0,l.Z)(r,e);var t,n,i=(t=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,u.Z)(t);if(n){var o=(0,u.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,c.Z)(this,e)});function r(){return(0,s.Z)(this,r),i.apply(this,arguments)}return(0,a.Z)(r,[{key:"createElement",value:function(e){var t=this,n=e.reloadOnPageChange?{"data-floatingnav":""}:{};return(0,p.vz)("li",null,(0,p.vz)("a",function(e){for(var t=1;tthis.maxPages||this.state.currentPagen.MAX_PAGE_NUMBERS_PER_SIDE&&(s[0]=n.LOWEST_PAGE_NUMBER,e=!0);var a=this.maxPages-this.state.currentPage,l=Math.min(a,n.MAX_PAGE_NUMBERS_PER_SIDE),c=d(this.state.currentPage+1,this.state.currentPage+l);return a>n.MAX_PAGE_NUMBERS_PER_SIDE&&(c[l-1]=this.maxPages,t=!0),{pageNumbers:[].concat((0,i.Z)(s),[this.state.currentPage],(0,i.Z)(c)),showPreviousEllipses:e,showNextEllipses:t}}},{key:"createDirectionalButton",value:function(e,t){var n=this,i=this.nextNavigationLink,o=this.maxPages;"prev"===e&&(i=this.prevNavigationLink,o=1);var r=new b({direction:e,baseUrl:this.props.baseUrl,onClick:function(e){e instanceof MouseEvent&&(e.ctrlKey||e.metaKey||e.shiftKey)||(n.props.reloadOnPageChange||e.preventDefault(),i.isDisabled()||n.onUserInitiatedPageChange(t))},page:t,reloadOnPageChange:this.props.reloadOnPageChange,pageParam:this.props.pageParam});return r.toggleDisable(this.state.currentPage===o),r}},{key:"createPageNumber",value:function(e,t){var n=this,i=new x({baseUrl:this.props.baseUrl,onClick:function(t){!function(t,i){t instanceof MouseEvent&&(t.ctrlKey||t.metaKey||t.shiftKey)||(n.props.reloadOnPageChange||t.preventDefault(),i.isSelected()||n.onUserInitiatedPageChange(e))}(t,i)},page:e,reloadOnPageChange:this.props.reloadOnPageChange,pageParam:this.props.pageParam});return i.toggleSelected(t),i}},{key:"rearrangePaginationButtons",value:function(e){this.removeAllDOMChildren(),this.addChild(this.createDirectionalButton("prev",this.state.currentPage-1));for(var t=0;t1?"flex":"none"}}],[{key:"calculateMaxPages",value:function(e,t){return Math.max(Math.ceil(e/t),n.LOWEST_PAGE_NUMBER)}}]),n}(h.I);(C=P).MAX_PAGE_NUMBERS_PER_SIDE=4,C.LOWEST_PAGE_NUMBER=1,C.pageNumberChanged=new f.xB("pageNumberChanged")},9809:function(e,t,n){"use strict";n.d(t,{kK:function(){return g},k5:function(){return y},Q1:function(){return b}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(7693),u=n(9874),d=n(47),h=n(8213),f=n(2800),p=n(9839),m=n(3871);function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n(null!==(o=null===(r=visualViewport)||void 0===r?void 0:r.width)&&void 0!==o?o:window.innerWidth),a="calc(100% - ".concat(s?72:20,"px)"),l="calc(100% - ".concat(s?20:72,"px)");this.mediaList.length>1&&(l="calc(100% - ".concat(f.J.current.isMobile?92:180,"px)"));var c,u=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return v(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)?v(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(this.mediaList);try{for(u.s();!(c=u.n()).done;){var h=c.value;if(void 0!==h.imageElement)break;h.imageElement=(0,d.vz)("img",{src:h.url,style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",maxHeight:a,maxWidth:l},onLoad:function(){var e;null===(e=g.instance)||void 0===e||e.repositionChildren()}})}}catch(e){u.e(e)}finally{u.f()}this.rebuildUI()}},{key:"rebuildUI",value:function(){var e,t,n=this;this.arrowContainers=void 0,this.mediaList.filter((function(e){return""!==e.thumbnailUrl})).length>1&&(this.arrowContainers=new p.u((function(){n.previous()}),(function(){n.next()})),this.arrowContainers.shiftArrows(f.J.current.isMobile?8:25)),this.element=(0,d.vz)("div",{tabIndex:-1,style:{position:"fixed",zIndex:1101,outline:"none",width:"80vw",height:"80vh",top:"50%",left:"50%",transform:"translate(-50%, -50%)",boxSizing:"border-box"},colorClass:"ChatMediaCarousel"},(e=function(){n.hide()},t=(0,d.vz)("path",{fill:"#E2E2E2",d:"M11.7255 0.392534C11.6095 0.276307 11.4717 0.184097 11.32 0.121183C11.1684 0.0582692 11.0058 0.0258858 10.8415 0.0258858C10.6773 0.0258858 10.5147 0.0582692 10.363 0.121183C10.2113 0.184097 10.0735 0.276307 9.95753 0.392534L6.23553 4.11453C6.18867 4.16125 6.1252 4.18748 6.05903 4.18748C5.99287 4.18748 5.9294 4.16125 5.88253 4.11453L2.15953 0.392534C2.0448 0.270837 1.90682 0.173402 1.75375 0.106C1.60068 0.0385979 1.43564 0.00259895 1.26841 0.000135597C1.10118 -0.00232775 0.935151 0.0287947 0.780163 0.0916592C0.625176 0.154524 0.484381 0.247852 0.366117 0.366117C0.247852 0.484381 0.154524 0.625176 0.0916592 0.780163C0.0287947 0.935151 -0.00232775 1.10118 0.000135597 1.26841C0.00259895 1.43564 0.0385979 1.60068 0.106 1.75375C0.173402 1.90682 0.270837 2.0448 0.392534 2.15953L4.11453 5.88153C4.13782 5.90476 4.15629 5.93234 4.16889 5.96272C4.18149 5.99309 4.18798 6.02565 4.18798 6.05853C4.18798 6.09142 4.18149 6.12398 4.16889 6.15435C4.15629 6.18472 4.13782 6.21231 4.11453 6.23553L0.392534 9.95953C0.158287 10.1941 0.0267145 10.512 0.0267145 10.8435C0.0267145 11.175 0.158287 11.493 0.392534 11.7275C0.629353 11.9575 0.946449 12.0861 1.27653 12.0861C1.60662 12.0861 1.92371 11.9575 2.16053 11.7275L5.88253 8.00553C5.90567 7.98228 5.93317 7.96383 5.96346 7.95124C5.99375 7.93865 6.02623 7.93217 6.05903 7.93217C6.09184 7.93217 6.12431 7.93865 6.1546 7.95124C6.18489 7.96383 6.2124 7.98228 6.23553 8.00553L9.95953 11.7255C10.1967 11.9548 10.5137 12.0829 10.8435 12.0829C11.1734 12.0829 11.4904 11.9548 11.7275 11.7255C11.9618 11.491 12.0934 11.173 12.0934 10.8415C12.0934 10.51 11.9618 10.1921 11.7275 9.95753L8.00553 6.23553C7.98225 6.21231 7.96378 6.18472 7.95118 6.15435C7.93857 6.12398 7.93209 6.09142 7.93209 6.05853C7.93209 6.02565 7.93857 5.99309 7.95118 5.96272C7.96378 5.93234 7.98225 5.90476 8.00553 5.88153L11.7255 2.15953C11.8416 2.04354 11.9337 1.90581 11.9965 1.75422C12.0593 1.60262 12.0917 1.44013 12.0917 1.27603C12.0917 1.11194 12.0593 0.949446 11.9965 0.797851C11.9337 0.646255 11.8416 0.508526 11.7255 0.392534Z"}),(0,d.vz)("div",{className:"closeButton",style:{position:"absolute",width:"15px",padding:"15px",right:"0px",zIndex:1102,cursor:"pointer"},onMouseEnter:function(){t.style.fill="#B8B8B8"},onMouseLeave:function(){t.style.fill="#E2E2E2"},onClick:e},(0,d.vz)("svg",{viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t))),void 0!==this.arrowContainers?this.arrowContainers.leftContainer:void 0,void 0!==this.arrowContainers?this.arrowContainers.rightContainer:void 0),(0,c.j9)("keydown",this.element,(function(e){switch(e.key){case"Left":case"ArrowLeft":n.previous();break;case"Right":case"ArrowRight":n.next();break;case"Esc":case"Escape":n.hide()}}))}},{key:"clearCurrent",value:function(){var e;null===(e=this.currentItem)||void 0===e||null===(e=e.imageElement)||void 0===e||null===(e=e.parentElement)||void 0===e||e.removeChild(this.currentItem.imageElement)}},{key:"displayImage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.show(),this.clearCurrent(),this.currentIndex=e,void 0!==this.currentItem&&void 0!==this.currentItem.imageElement&&(this.element.appendChild(this.currentItem.imageElement),this.mediasetProps.outgoing||!1!==this.currentItem.opened||(this.currentItem.opened=!0,(0,h.$6)(this.currentItem.fromUserUID,this.mediasetProps.messageId,this.currentItem.mediaId),m.s.markOpened(this.mediasetProps.messageId,this.currentItem.mediaId))),this.repositionChildren()}},{key:"hide",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];(0,r.Z)((0,l.Z)(g.prototype),"hide",this).call(this,e),this.clearCurrent()}},{key:"deleteMedia",value:function(e){var t,n=this.mediaList.findIndex((function(t){return t.mediaId===e}));-1!==n&&(this.currentIndex===n&&this.hide(),this.mediaList.splice(n,1),this.currentIndex>n&&(this.currentIndex-=1),1===this.mediaList.length&&(null===(t=this.arrowContainers)||void 0===t||t.hideArrows()))}},{key:"next",value:function(){for(var e=(this.currentIndex+1)%this.mediaList.length;""===this.mediaList[e].thumbnailUrl;)e=(e+1)%this.mediaList.length;this.displayImage(e)}},{key:"previous",value:function(){for(var e=this.currentIndex>0?this.currentIndex-1:this.mediaList.length-1;""===this.mediaList[e].thumbnailUrl;)e=e>0?e-1:this.mediaList.length-1;this.displayImage(e)}},{key:"repositionChildren",value:function(){var e;null===(e=this.arrowContainers)||void 0===e||e.repositionArrows(this.element.offsetHeight)}}],[{key:"loadMedia",value:function(e,t){void 0===g.instance&&(g.instance=new g),g.instance.mediasetProps!==e&&g.instance.init(e),g.instance.displayImage(g.instance.mediaList.indexOf(t))}}]),g}(u.z),y=64,b={width:"".concat(y,"px"),height:"".concat(y,"px"),margin:"0px 1px",display:"inline-block",backgroundSize:"cover",backgroundPosition:"center",position:"relative",cursor:"pointer",borderRadius:"4px",overflow:"hidden",zIndex:0}},7510:function(e,t,n){"use strict";n.d(t,{p:function(){return $},L:function(){return Y}});var i=n(7791),o=n(4649),r=n(2951),s=n(1976),a=n(7169),l=n(3243),c=n(7591),u=n(9492),d=n(7597),h=n(824),f=n.n(h),p=n(695),m=n(4793),v=n(9),g=n(1794),y=n(3705),b=n(9545),w=n(3543),C=n(47),x=n(9420),k=n(6474),S=n(1185),T=n(2800),I=n(1612),P=n(6208),R=n(6832),M=n(8759),A=n(9493),E=n(8263),B=n(6479),O=n(9482),L=n(9491),D=n(1006),U=n(1359);function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function F(e){for(var t=1;t0&&(""!==this.message||this.hasMedia);this.numUnreadContainer=(0,C.vz)("span",null,l?" (".concat(this.numUnread,")"):""),this.elapsedTimeContainer=(0,C.vz)("div",{className:"timeString",style:{fontSize:"10px",position:"absolute",right:"8px",textAlign:"right",top:"8px"},"data-testid":"message-timestamp"},r),this.usernameSpan=this.getUsernameSpan({fontFamily:"Tahoma, Arial, Helvetica, sans-serif",fontWeight:"bold",overflow:"hidden",textOverflow:"ellipsis",display:"inline-block",verticalAlign:"bottom"}),this.updateUsernameMaxWidth(),this.element=(0,C.vz)("div",{colorClass:["conversationListItem","".concat(l?"unreadBg":"")],style:{borderBottomWidth:"1px",borderBottomStyle:"solid",cursor:"pointer",fontFamily:"Tahoma, Arial, Helvetica, sans-serif",fontSize:"12px",height:"40px",lineHeight:"14px",overflowX:"hidden",padding:"8px",position:"relative",textAlign:"left"},"data-testid":"conversation-list-item",onClick:function(){e.openConversationEvent.fire(t.otherUsername)}},(0,C.vz)(j,{name:this.otherUsername,style:{marginTop:"-16px",position:"absolute",top:"50%"},color:"",size:"32px",userColorClass:this.userColorClass}),(0,C.vz)("div",{style:n,ref:function(e){return t.chatHeader=e}},this.usernameSpan,this.numUnreadContainer,(0,D.gH)()&&!this.isDropdown&&(0,C.vz)(U.T,{classRef:function(e){return t.inRoomIndicator=e},username:this.otherUsername,style:{verticalAlign:"middle",position:"relative",top:"-1px"}})),this.elapsedTimeContainer,(0,C.vz)("div",{colorClass:"messageDiv",style:i,ref:function(e){return t.messageDiv=e}},a&&""!==this.message?(0,L.WX)("replyIconSvg",{display:"inline-block",verticalAlign:"top"}):"",s))}},{key:"render",value:function(){return this.element}},{key:"hide",value:function(){var e;null===(e=this.parent)||void 0===e||e.removeChild(this),this.element.remove(),this.dispose()}},{key:"dispose",value:function(){var e;null===(e=this.inRoomIndicator)||void 0===e||e.dispose()}},{key:"repositionChildren",value:function(){(0,l.Z)((0,d.Z)(o.prototype),"repositionChildren",this).call(this),this.hideElapsedTimeResponsive()}},{key:"afterDOMConstructed",value:function(){(0,l.Z)((0,d.Z)(o.prototype),"afterDOMConstructed",this).call(this),this.hideElapsedTimeResponsive()}},{key:"updateTimeContainer",value:function(){var e=void 0===this.time||this.isEmptyMessage()?"":(0,A.ek)(new Date(this.time));this.elapsedTimeContainer.innerText=e,this.updateUsernameMaxWidth(),this.updateCloseButtonTop()}},{key:"updateUsernameMaxWidth",value:function(){var e,t;if(this.isDropdown){var n=228-(0,E.mY)(null!==(e=this.elapsedTimeContainer.textContent)&&void 0!==e?e:"",this.elapsedTimeContainer)-(0,E.mY)(null!==(t=this.numUnreadContainer.textContent)&&void 0!==t?t:"",this.numUnreadContainer);this.usernameSpan.style.maxWidth="".concat(n,"px")}}},{key:"getUsernameSpan",value:function(e){return(0,C.vz)("span",{colorClass:this.userColorClass,style:e,"data-testid":"conversation-list-username"},this.otherUsername)}},{key:"addCloseBtn",value:function(){var e=this;this.closeButton=(0,L.bo)();var t=this.closeButton;(0,E.Zs)(t,{position:"absolute",right:"8px"}),t.onclick=function(t){t.stopPropagation(),t.preventDefault(),Y(e.otherUsername,e.isDropdown)},(0,M.s2)()?(t.style.display="block",this.messageDiv.style.width="calc(".concat(_," - 20px)")):(t.style.display="none",(0,E.nH)(this.element).listen((function(n){n?(t.style.display="block",e.elapsedTimeContainer.style.display="none",e.messageDiv.style.width="calc(".concat(_," - 20px)")):(t.style.display="none",e.elapsedTimeContainer.style.display="block",e.messageDiv.style.width=_)}))),this.updateCloseButtonTop(),this.element.appendChild(t)}},{key:"updateCloseButtonTop",value:function(){void 0!==this.closeButton&&((0,M.s2)()&&""!==this.elapsedTimeContainer.textContent?this.closeButton.style.top="50%":this.closeButton.style.top="calc(50% - 8px)")}},{key:"hideElapsedTimeResponsive",value:function(){if(this.element.clientWidth>0){var e=this.chatHeader.clientWidth>this.element.clientWidth-o.CHAT_HEADER_LEFT_PX-8-this.elapsedTimeContainer.clientWidth;this.elapsedTimeContainer.style.visibility=e?"hidden":""}}},{key:"getOtherUsername",value:function(){return this.otherUsername}},{key:"getNumUnread",value:function(){return this.numUnread}},{key:"setNumUnread",value:function(e){this.numUnread=e,0===this.numUnread?(this.numUnreadContainer.innerText="",(0,S.FU)(this.element,"unreadBg")):(this.numUnreadContainer.innerText=" (".concat(this.numUnread,")"),(0,S.vP)(this.element,"unreadBg"))}},{key:"getUserColorClass",value:function(){return this.userColorClass}},{key:"getMessagePreview",value:function(){if(""===this.message&&this.hasMedia)return(0,C.vz)("span",null,w.ag.imageAttached);for(var e=new B.w(this.message),t=e.stringParts()[0],n=(0,C.vz)("span",{style:{maxWidth:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"inline-block"},"data-testid":"message-preview"},t.split("\n")[0]),i=1;i=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n-1}},{key:"initData",value:function(e){this.isDms=!0===e.isDms,this.isFullVideoMode=e.isFullVideoMode,this.inBroadcast=!0===e.inBroadcast,this.listenerGroup=new g.mM,this.renderedConversations=[],(0,p.TF)()||(this.conversationListData=R.zS.getInstance()),this.openConversationEvent=e.openConversationEvent,this.room="",this.emptyListMessage=(0,C.vz)(Q,null)}},{key:"initUI",value:function(e){var t=q({fontSize:"12px",fontFamily:"UbuntuRegular, Tahoma, Arial, Helvetica, sans-serif",height:"100%",lineHeight:"16px",overflowX:"hidden",overflowY:"hidden",position:"relative",textAlign:"left",width:"100%",zIndex:2},this.isDms&&{flex:1,display:"flex",flexDirection:"column"}),n=q({maxHeight:"calc(100% - 32px)",overflowY:"auto",width:"100%"},this.isDms&&{flex:1});this.conversationBodyRoot=(0,C.vz)("div",{style:n,colorClass:"conversationBodyRoot","data-testid":"conversation-body-root"},(0,C.vz)("div",{className:"loadingDiv",style:{position:"absolute",top:"60px",left:"50%",transform:"translateX(-50%)"}},(0,C.vz)(P.L,null))),this.element=(0,C.vz)("div",{style:t,colorClass:"conversationList"},this.conversationBodyRoot),this.renderSearchBar()}},{key:"render",value:function(){return this.element}},{key:"repositionChildrenRecursive",value:function(){(0,l.Z)((0,d.Z)(I.prototype),"repositionChildrenRecursive",this).call(this);var e,t=K(this.renderedConversations);try{for(t.s();!(e=t.n()).done;)e.value.repositionChildrenRecursive()}catch(e){t.e(e)}finally{t.f()}}},{key:"afterDOMConstructedIncludingChildren",value:function(){(0,l.Z)((0,d.Z)(I.prototype),"afterDOMConstructedIncludingChildren",this).call(this);var e,t=K(this.renderedConversations);try{for(t.s();!(e=t.n()).done;)e.value.afterDOMConstructedIncludingChildren()}catch(e){t.e(e)}finally{t.f()}}},{key:"renderSearchBar",value:function(){var e=this;this.searchBar=new z.E({isFullVideoMode:this.isFullVideoMode,room:this.room}),this.searchBar.events.navigateSuggestions.listen((function(t){e.navigateSuggestions(t.event)})).addTo(this.listenerGroup),this.searchBar.events.openCurrentSuggestion.listen((function(){e.openCurrentSuggestion()})).addTo(this.listenerGroup),this.searchBar.events.inputChange.listen((function(t){t.isFullVideo===e.isFullVideoMode&&(e.currentIndex=-1,t.isValid?e.filterConversations(t.prefix):e.clearConversationListDOM())})).addTo(this.listenerGroup);var t=(0,C.vz)("div",null,this.searchBar.element);this.element.insertBefore(t,this.element.firstChild)}},{key:"updateList",value:(o=(0,i.Z)(f().mark((function e(){var t,n,i,o=this;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0,p.TF)()){e.next=2;break}return e.abrupt("return");case 2:return this.clearConversationListDOM(),e.next=5,this.addBroadcasterToTopOfDOM();case 5:t=e.sent,void 0!==this.conversationListData&&(n=this.isDms?this.conversationListData.getDms():this.conversationListData.getPms(),i=n.filter((function(e){return o.conversationMatchesPrefix(e)})),this.populateConversationsToDOM(i,t));case 7:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"dispose",value:function(){this.listenerGroup.removeAll(),this.searchBar.dispose()}},{key:"clearConversationListDOM",value:function(){for(;null!==this.conversationBodyRoot.firstChild;)this.conversationBodyRoot.removeChild(this.conversationBodyRoot.firstChild);this.renderedConversations.forEach((function(e){return e.dispose()})),this.renderedConversations=[]}},{key:"getRoomUserCount",value:function(){return this.conversationBodyRoot.childNodes.length}},{key:"shouldAddBroadcaster",value:function(e){var t,n=(null===(t=T.J.current.loggedInUser)||void 0===t?void 0:t.username)===this.room;if(""===this.room||n)return!1;var i=void 0===e||this.room.startsWith(e);return!this.isDms&&i&&!this.inBroadcast&&((0,p.TF)()||!n)}},{key:"addBroadcasterToTopOfDOM",value:(n=(0,i.Z)(f().mark((function e(){var t,n,i,o;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=this.shouldAddBroadcaster())){e.next=18;break}if(!(0,p.TF)()){e.next=8;break}this.clearConversationListDOM(),n=(0,k.rw)(this.room),this.addConversationIfPrefixMatch(n),e.next=18;break;case 8:if(void 0===this.conversationListData){e.next=18;break}if(void 0!==(i=this.conversationListData.getConversation(this.room))){e.next=16;break}return e.next=13,(0,k.bG)(this.room,this.room);case 13:return o=e.sent,void 0===this.conversationListData.getConversation(this.room)&&(this.clearConversationListDOM(),this.addConversationIfPrefixMatch({message:"",numUnread:o.numUnread,fromUsername:o.user.username,otherUser:o.user,hasMedia:!1})),e.abrupt("return",t);case 16:this.clearConversationListDOM(),this.addConversationIfPrefixMatch(i);case 18:return e.abrupt("return",t);case 19:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"shouldSkipPopulating",value:function(e,t){return R.wV.have(e.otherUser.username)?!R.wV.isShowing(e.otherUser.username):!(!t||this.room!==e.otherUser.username)}},{key:"maybeAddEmptyListMessage",value:function(){this.isDms&&""===this.searchPrefix&&0===this.renderedConversations.length&&this.conversationBodyRoot.appendChild(this.emptyListMessage)}},{key:"populateConversationsToDOM",value:function(e,t){var n=this;e.forEach((function(e){n.shouldSkipPopulating(e,t)||(n.addConversationListItemToDOM(e),n.isDms||k.lW.fire(e.otherUser.username))})),this.maybeAddEmptyListMessage()}},{key:"addConversationListItemToDOM",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.conversationIsRendered(e.otherUser.username)){var i=(0,C.vz)(N,{rawData:e,openConversationEvent:this.openConversationEvent,isDropdown:this.isDms,classRef:function(i){var o=e.otherUser.username===t.room;t.isDms||o||i.addCloseBtn(),n?t.isDms||o?t.renderedConversations.unshift(i):t.renderedConversations.splice(1,0,i):t.renderedConversations.push(i)}});if(n){var o,r=this.conversationBodyRoot.firstChild,s=(null===(o=T.J.current.loggedInUser)||void 0===o?void 0:o.username)===this.room,a=e.otherUser.username===this.room;this.isDms||a||s||null===r?this.conversationBodyRoot.insertBefore(i,r):this.conversationBodyRoot.insertBefore(i,r.nextSibling)}else this.conversationBodyRoot.appendChild(i);e.otherUser.username===this.currentConversation&&(0,S.vP)(i,this.currentConversationColorClass),this.repositionChildrenRecursive(),(0,y.fg)("PmListItemAdded",{rendered_pm_count:this.renderedConversations.length,other_user:e.otherUser.username})}}},{key:"hideConversation",value:function(e){var t=this.renderedConversations.find((function(t){return t.getOtherUsername()===e})),n=!this.isDms&&(null==t?void 0:t.getOtherUsername())===this.room;void 0===t||n||(this.renderedConversations.splice(this.renderedConversations.indexOf(t),1),t.hide(),(0,y.fg)("PmListItemRemoved",{rendered_pm_count:this.renderedConversations.length,other_user:e})),this.maybeAddEmptyListMessage()}},{key:"filterConversations",value:(t=(0,i.Z)(f().mark((function e(t){var n,i,o,r,s,a=this;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=!1,void 0!==this.conversationListData&&(this.clearConversationListDOM(),i=this.isDms?this.conversationListData.getDms():this.conversationListData.getPms(),this.shouldAddBroadcaster(t)&&(r=this.conversationListData.getConversation(this.room),o=void 0!==r?r:(0,k.rw)(this.room),this.addConversationListItemToDOM(o),n=!0),s=i.filter((function(e){return a.conversationMatchesPrefix(e,t)})),this.populateConversationsToDOM(s,n));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"conversationMatchesPrefix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.searchPrefix;return 0===t.length||e.otherUser.username.startsWith(t)}},{key:"addConversationIfPrefixMatch",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;this.conversationMatchesPrefix(e,n)&&this.addConversationListItemToDOM(e,t)}},{key:"removeOldConversation",value:function(e){for(var t,n=this.renderedConversations.length-1;n>=0;n-=1){var i=this.renderedConversations[n];i.getOtherUsername()===e&&(t=i,this.renderedConversations.splice(n,1),i.element.remove())}return t}},{key:"navigateSuggestions",value:function(e){if(this.unHighlightSelectedIndex(this.currentIndex),"ArrowDown"===e.key||40===e.keyCode?this.currentIndex=this.currentIndex+1>=this.renderedConversations.length?-1:this.currentIndex+1:"ArrowUp"!==e.key&&38!==e.keyCode||(this.currentIndex=this.currentIndex-1<-1?this.renderedConversations.length-1:this.currentIndex-1),this.currentIndex>-1){var t=this.renderedConversations[this.currentIndex].getOtherUsername();this.highlightSelectedIndex(this.currentIndex,!0),this.searchBar.events.suggestionActiveEvent.fire({slug:t})}else this.searchBar.events.suggestionActiveEvent.fire({slug:""})}},{key:"openCurrentSuggestion",value:function(){if(this.currentIndex>-1){var e=this.renderedConversations[this.currentIndex],t=""===this.room?"PMWindow":"PMTab",n=e.getUserColorClass();(0,y.fg)("PMSearchResultClicked",{location:t,color:n}),this.searchBar.events.suggestionActiveEvent.fire({slug:""}),this.openConversationEvent.fire(e.getOtherUsername())}}},{key:"highlightSelectedIndex",value:function(e,t){if(e>-1){var n=this.renderedConversations[e];if(t){var i=this.conversationBodyRoot.clientHeight,o=n.element.clientHeight;this.conversationBodyRoot.scrollTop=this.currentIndex*o-i/2}(0,S.FU)(n.element,"unreadBg"),(0,S.vP)(n.element,"selected")}}},{key:"unHighlightSelectedIndex",value:function(e){if(e>-1){var t=this.renderedConversations[e];(0,S.FU)(t.element,"selected"),t.getNumUnread()>0?(0,S.vP)(t.element,"unreadBg"):(0,S.FU)(t.element,"unreadBg")}}},{key:"setCurrentConversation",value:function(e){var t=this;this.currentConversation=e,this.renderedConversations.forEach((function(n){n.getOtherUsername()===e?(0,S.vP)(n.element,t.currentConversationColorClass):(0,S.FU)(n.element,t.currentConversationColorClass)}))}},{key:"focusSearchBar",value:function(){this.searchBar.focus()}}]),I}(v.w),Q=function(){return(0,C.vz)("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",textAlign:"center",lineHeight:"20px",padding:"50px",boxSizing:"border-box"}},(0,C.vz)("img",{src:"".concat(STATIC_URL,"pms/empty-chat-state.svg"),style:{margin:"13px",width:"30px"},alt:"empty-chat-state"}),(0,C.vz)("span",{style:{fontFamily:"UbuntuBold, Arial, Helvetica, sans-serif",fontSize:"14px"},colorClass:"sendDmPrompt"},w.ag.sendDirectMessage),(0,C.vz)("span",{colorClass:"cautionMessage"},w.ag.conversationCautionMessage(I.w.siteName)))}},6832:function(e,t,n){"use strict";n.d(t,{zS:function(){return K},wV:function(){return q}});var i=n(126),o=n(7791),r=n(4649),s=n(2951),a=n(1976),l=n(824),c=n.n(l),u=n(3753),d=n(391),h=n(695),f=n(9617),p=n(4793),m=n(1794),v=n(9545),g=n(1289),y=n(9420),b=n(3243),w=n(7591),C=n(9492),x=n(7597),k=n(8759),S=n(7693),T=n(6767),I=n(8069);function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,x.Z)(e);if(t){var o=(0,x.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,C.Z)(this,n)}}var R=function(){function e(){var t=this;(0,s.Z)(this,e),this.queuedPmReads=new Set,this.sendDebouncer=new I.d((function(){t.sendPost()}),{bounceLimitMS:0,debounceType:1}),(0,S.j9)((0,k.Tt)()?"pagehide":"beforeunload",window,(function(){return t.sendBeacon()}))}return(0,a.Z)(e,[{key:"sendRead",value:function(e){this.queuedPmReads.add(e),this.sendDebouncer.callFunc()}},{key:"getFormData",value:function(){if(0!==this.queuedPmReads.size){this.pmReadsBatch=new Set(this.queuedPmReads),this.queuedPmReads.clear();var e=new FormData;return this.pmReadsBatch.forEach((function(t){e.append("from_usernames",t)})),e.append("csrfmiddlewaretoken",(0,T.ve)("csrftoken")),e}}},{key:"requeueData",value:function(){var e,t=this;null===(e=this.pmReadsBatch)||void 0===e||e.forEach((function(e){return t.queuedPmReads.add(e)}))}},{key:"sendPost",value:function(){var t=this,n=this.getFormData();void 0!==n&&(0,u.I5)(e.endpoint,n).catch((function(e){error("post error marking PMs as read",e),t.requeueData()}))}},{key:"sendBeacon",value:function(){var t=this.getFormData();void 0!==t&&(navigator.sendBeacon((0,u.BN)(e.endpoint),t)||(error("beacon error marking PMs as read"),this.requeueData()))}}]),e}();R.endpoint="api/ts/chatmessages/update_pms_last_seen/";var M,A,E,B=function(e){(0,w.Z)(n,e);var t=P(n);function n(){var e;return(0,s.Z)(this,n),e=t.call(this),p.kN.listen((function(t){e.room=t.chatConnection.room()})),p.QN.listen((function(){e.sendPost()})),e}return(0,a.Z)(n,[{key:"getFormData",value:function(){var e=(0,b.Z)((0,x.Z)(n.prototype),"getFormData",this).call(this);return void 0!==e&&void 0!==this.room?(e.append("room",this.room),e):void 0}}]),n}(R),O=function(e){(0,w.Z)(n,e);var t=P(n);function n(){return(0,s.Z)(this,n),t.apply(this,arguments)}return(0,a.Z)(n)}(R),L=n(6474),D=n(8213),U=n(2800),Z=n(7600),F=n(7212),_=n(8016),N=n(7397),j=n(3871),H=n(8015);function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function W(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(t.dms.values());try{for(r.s();!(o=r.n()).done;){var s=o.value;s.otherUser.isBroadcaster=s.otherUser.username===t.room}}catch(e){r.e(e)}finally{r.f()}void 0!==e.instance&&e.conversationDataChanged.fire(n),(null===(i=U.J.current.loggedInUser)||void 0===i?void 0:i.username)!==t.room&&(0,L.bG)(t.room,t.room).then((function(e){t.addConversation({message:"",numUnread:0,time:Date.now(),fromUsername:t.room,otherUser:e.user,hasMedia:!1,room:t.room})})).catch(v.$x),t.listenToRoomPushTopics(n.dossier.roomUid)})),p.QN.listen((function(){t.roomListeners.removeAll()})),y.sC.listen((function(n){n.focus&&(t.pms.has(n.username)?e.conversationDataChanged.fire(void 0):(0,L.bG)(n.username,t.room).then((function(e){t.addConversation({message:"",numUnread:0,time:Date.now(),fromUsername:t.room,otherUser:e.user,hasMedia:!1,room:t.room})})).catch(v.$x))})),y.CD.listen((function(n){var i,o=!1,r=t.pms.get(n.username);if(void 0!==r&&(r.otherUser.isMod=n.isMod,o=!0),(null===(i=U.J.current.loggedInUser)||void 0===i?void 0:i.username)===t.room){var s=t.dms.get(n.username);void 0!==s&&(s.otherUser.isMod=n.isMod,o=!0)}o&&e.conversationDataChanged.fire(void 0)})),e.conversationLoaded.listen((function(e){var n,i,o=t.getConversation(e.otherUser.username,void 0===e.room||""===e.room),r=""===(null!==(n=null==o?void 0:o.message)&&void 0!==n?n:"")&&!(null!==(i=null==o?void 0:o.hasMedia)&&void 0!==i&&i),s=""===e.message&&!e.hasMedia;r&&!s&&t.addConversation(e)})),this.fetchInitialDms().finally((function(){N.nh.listen((function(e){void 0===t.getConversation(e,!0)&&(0,L.bG)(e).then((function(n){t.addConversation({message:"",numUnread:0,time:Date.now(),fromUsername:e,otherUser:n.user,hasMedia:!1,room:""})})).catch(v.$x)}))}))}var t;return(0,a.Z)(e,[{key:"fetchInitialDms",value:function(){var t=this;if(!(0,L.Fh)()||(0,h.TF)())return Promise.resolve();var n=(0,g.Ie)({offset:"0"});return(0,u.Ue)("api/ts/chatmessages/pm_users/?".concat(n)).then((function(n){JSON.parse(n.responseText).reverse().forEach((function(e){var n=(0,L.I_)(new d.j(e));t.addConversation(W(W({},n),{},{room:""}))})),e.conversationDataChanged.fire(void 0)})).catch((function(e){error("Error fetching dm conversations",e)}))}},{key:"getDms",value:function(){return Array.from(this.dms.values()).reverse()}},{key:"getPms",value:function(){return Array.from(this.pms.values()).reverse()}},{key:"handleIncomingMessage",value:(t=(0,o.Z)(c().mark((function e(t,n){var i,o,r,s;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==(i=this.removeConversation(t.otherUsername,n))){e.next=9;break}return e.next=4,(0,L.bG)(t.otherUsername,n?void 0:this.room);case 4:s=e.sent,o=s.user,r=n||!0===U.J.current.mergePmDm?s.numUnread:1,e.next=11;break;case 9:o=i.otherUser,r=i.numUnread+1;case 11:t.fromUser.username!==t.otherUsername&&(r=0),this.addConversation({message:t.message,time:Date.now(),numUnread:r,fromUsername:t.fromUser.username,otherUser:o,hasMedia:t.mediaList.length>0,room:n?"":this.room});case 13:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"addConversation",value:function(t){var n,i=""===t.room,o=i?this.dms:this.pms;o.delete(t.otherUser.username),o.set(t.otherUser.username,t),e.conversationItemAdded.fire(t),t.fromUsername===(null===(n=U.J.current.loggedInUser)||void 0===n?void 0:n.username)&&e.conversationRead.fire({username:t.otherUser.username,isDm:i}),this.updateUnreadCount()}},{key:"getConversation",value:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1]?this.dms:this.pms).get(e)}},{key:"removeConversation",value:function(e,t){var n=t?this.dms:this.pms,i=n.get(e);return n.delete(e),i}},{key:"removeEmptyDms",value:function(){var e,t=this,n=null===(e=N.qd.getInstance())||void 0===e?void 0:e.shownWindowUsername();this.dms.forEach((function(e,i){""!==e.message||e.hasMedia||i===n||t.dms.delete(i)}))}},{key:"markAsRead",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=(n?this.dms:this.pms).get(t);void 0!==o&&0!==o.numUnread&&(o.numUnread=0,e.conversationRead.fire({username:t,isDm:n}),this.updateUnreadCount(),i||function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]?(void 0===A&&(A=new O),A.sendRead(e)):(void 0===M&&(M=new B),M.sendRead(e))}(t,n))}},{key:"updateUnreadCount",value:function(){e.unreadConversationsCountUpdate.fire({dmsCount:(0,i.Z)(this.dms.values()).filter((function(e){return e.numUnread>0})).length,pmsCount:(0,i.Z)(this.pms.values()).filter((function(e){return e.numUnread>0})).length})}},{key:"listenToMessagePushTopics",value:function(){var e,t=this,n=null===(e=U.J.current.loggedInUser)||void 0===e?void 0:e.userUid;void 0!==n&&(new _.Tz(n).onMessage.listen((function(e){Z._.isEnabledForPM()&&(0,f.SZ)(e,t.room,e.room)})),new _.Zv(n).onMessage.listen((function(e){j.s.markOpened(e.messageId,e.mediaId)})),new _.Ol(n).onMessage.listen((function(e){e.isCompliance?D.lk.fire(e.mediaId):D.zA.fire(e.mediaId)})),new _.l7(n).onMessage.listen((function(e){!0===U.J.current.mergePmDm?(t.markAsRead(e.otherUsername,!0,!0),t.markAsRead(e.otherUsername,!1,!0)):void 0===e.room||e.room?t.markAsRead(e.otherUsername,!0,!0):e.room===t.room&&t.markAsRead(e.otherUsername,!1,!0)})))}},{key:"listenToRoomPushTopics",value:function(t){var n=this;new F.AE(t).onMessage.listen((function(t){var i,o=!1,r=n.pms.get(t.fromUser.username);if(void 0!==r&&(r.otherUser.inFanclub=!0,o=!0),(null===(i=U.J.current.loggedInUser)||void 0===i?void 0:i.username)===n.room){var s=n.dms.get(t.fromUser.username);void 0!==s&&(s.otherUser.inFanclub=!0,o=!0)}o&&e.conversationDataChanged.fire(void 0)})).addTo(this.roomListeners),new F.nf(t).onMessage.listen((function(e){var t,i=null===(t=U.J.current.loggedInUser)||void 0===t?void 0:t.username;i===n.room?N.Lj.fire({username:e.username}):i===e.username&&N.Lj.fire({username:n.room})})).addTo(this.roomListeners)}}],[{key:"getInstance",value:function(){return void 0===e.instance&&(e.instance=new e),e.instance}}]),e}();(E=K).conversationDataChanged=new m.xB("conversationDataChanged"),E.conversationItemAdded=new m.xB("conversationItemAdded"),E.unreadConversationsCountUpdate=new m.xB("unreadConversationsCountUpdate"),E.conversationRead=new m.xB("conversationRead"),E.conversationLoaded=new m.xB("conversationLoaded")},2952:function(e,t,n){"use strict";n.d(t,{a:function(){return T},y:function(){return S}});var i=n(3243),o=n(7591),r=n(9492),s=n(7597),a=n(2951),l=n(1976),c=n(8759),u=n(3753),d=n(9),h=n(1794),f=n(3543),p=n(47),m=n(2750),v=n(2800),g=n(7510),y=n(6832),b=n(932),w=n(7397),C=n(1994),x=n(8015);var k="changePopoutConvo",S=function(){function e(){(0,a.Z)(this,e)}return(0,l.Z)(e,null,[{key:"show",value:function(t){var n=this;if(e.showingEvent.fire(),void 0!==this.popout&&!this.popout.closed)if((0,c.Tt)())this.popout.close();else if(void 0!==this.popout[k])return this.popout.focus(),void window.setTimeout((function(){document.hasFocus()?e.openNewPopoutWindow(t):void 0!==n.popout&&n.popout[k](t)}),0);e.openNewPopoutWindow(t)}},{key:"openNewPopoutWindow",value:function(e){var t=this,n="/dm/";void 0!==e&&(n+="".concat(e,"/"));var i=(screen.width/2-425).toString(),o=(screen.height/2-384).toString(),r="resizable,dependent,scrollbars,height=".concat(768,",width=").concat(850,",top=").concat(o,",left=").concat(i);(0,m.MY)(n,"dmpopout",r).then((function(e){t.popout=e})).catch((function(){}))}}]),e}();S.showingEvent=new h.xB("DmPopoutShowingEvent");var T=function(e){(0,o.Z)(d,e);var t,n,c=(t=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,s.Z)(t);if(n){var o=(0,s.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,r.Z)(this,e)});function d(e){var t,n;return(0,a.Z)(this,d),(n=c.call(this,"div",e)).bindListeners(),window[k]=function(e){void 0!==e&&n.showConversation(e)},void 0!==e.username&&e.username!==(null===(t=v.J.current.loggedInUser)||void 0===t?void 0:t.username)&&w.nh.fire(e.username),n}return(0,l.Z)(d,[{key:"initData",value:function(e){(0,i.Z)((0,s.Z)(d.prototype),"initData",this).call(this,e),this.dmList=new g.p({isDms:!0,clearSearchOnSelect:!1,isFullVideoMode:!1,openConversationEvent:w.nh}),this.dmWindowsMap=new Map}},{key:"initUI",value:function(e){var t=this;(0,i.Z)((0,s.Z)(d.prototype),"initUI",this).call(this,e),this.element=(0,p.vz)("div",{style:{display:"flex",justifyContent:"space-between",height:"100%"},colorClass:"DmPopout",className:"fill-view-height"},(0,p.vz)("div",{style:{width:"300px",display:"inline-flex",flexDirection:"column",borderRightStyle:"solid",borderRightWidth:"1px",flexShrink:0},colorClass:"dmListContainer","data-testid":"dm-convo-list"},(0,p.vz)("div",{style:{paddingLeft:"8px",height:"34px",display:"flex",flexDirection:"column",justifyContent:"center",borderBottomWidth:"2px",borderBottomStyle:"solid",fontFamily:"UbuntuRegular, Tahoma, Arial, Helvetica, sans-serif",fontSize:"14px"},colorClass:"header"},(0,p.vz)("span",null,f.ag.directMessageLabel,(0,p.vz)("span",{style:{marginLeft:"4px"},ref:function(e){return t.numUnreadDOM=e}}))),this.dmList.element),(0,p.vz)("div",{style:{width:"calc(100vw - 301px)",display:"inline-block",flexGrow:1},ref:function(e){return t.dmWindowContainer=e}}))}},{key:"bindListeners",value:function(){var e=this;x.Kd.listen((function(t){var n;null===(n=e.dmWindowsMap.get(t.otherUsername))||void 0===n||n.handleNewMessage(t)})),w.nh.listen((function(t){e.showConversation(t)})),w.Lj.listen((function(t){var n,i=t.username,o=t.deleteWindow;(null===(n=e.currentDmWindow)||void 0===n?void 0:n.username)===i&&e.hideCurrentDmWindow(),!0===o&&e.dmWindowsMap.delete(i)})),y.zS.conversationRead.listen((function(t){var n=t.username;if(t.isDm){var i=e.dmWindowsMap.get(n);null==i||i.markRead()}})),y.zS.unreadConversationsCountUpdate.listen((function(t){var n=t.dmsCount;e.updateNumUnread(n)})),(0,C.I)((function(t){return e.dmWindowsMap.get(t)}))}},{key:"showConversation",value:function(e){var t,n,i=this.dmWindowsMap.get(e);if(void 0===i)i=new b.MA(e),this.dmWindowsMap.set(e,i);else if(i===this.currentDmWindow)return void i.scrollAndFocus();this.hideCurrentDmWindow(),this.dmWindowContainer.appendChild(i.element),i.setIsShowing(!0),i.openOrCollapseWindow(!0,!0),this.dmList.setCurrentConversation(e),this.currentDmWindow=i,document.title=f.ag.directMessagesPageTitle(null!==(t=null===(n=v.J.current.loggedInUser)||void 0===n?void 0:n.username)&&void 0!==t?t:"",e),window.history.pushState("","",(0,u.BN)("/dm/".concat(e)))}},{key:"hideCurrentDmWindow",value:function(){var e;null===(e=this.currentDmWindow)||void 0===e||e.removeFromDOM(),this.currentDmWindow=void 0}},{key:"updateNumUnread",value:function(e){this.numUnreadDOM.textContent=e>0?"(".concat(e,")"):""}}]),d}(d.w)},2906:function(e,t,n){"use strict";n.d(t,{e:function(){return i},o:function(){return o}});var i=new(n(1794).xB)("requestDmInputFocus",{listenersWarningThreshold:1,reportIfNoListeners:!1});function o(e){i.listenerCount()>0?i.fire(e):e instanceof HTMLElement&&e.focus()}},932:function(e,t,n){"use strict";n.d(t,{PZ:function(){return De},Tx:function(){return Ue},Dv:function(){return Ze},MA:function(){return Fe},kb:function(){return Oe}});var i=n(3243),o=n(126),r=n(2951),s=n(1976),a=n(7591),l=n(9492),c=n(7597),u=n(4649),d=n(8759),h=n(7693),f=n(1522),p=n(3753),m=n(391),v=n(4793),g=n(9),y=n(8263),b=n(1794),w=n(9598),C=n(3705),x=n(9545),k=n(3543),S=n(47),T=n(2974),I=n(6272),P=n(2800),R=n(795),M=n(2906);var A=function(e){(0,a.Z)(o,e);var t,n,i=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function o(e,t){var n;return(0,r.Z)(this,o),(n=i.call(this)).username=e,n.removeUI=t,n.handleTipKeyPress=function(e){e.metaKey||8===e.charCode||0===e.charCode||(n.tipInputDOM.value.length>R.oV?e.preventDefault():e.charCode>=48&&e.charCode<=57||(13===e.keyCode&&n.sendTipFn(),e.preventDefault()))},n.handlePaste=function(){window.setTimeout((function(){/^[1-9]\d*$/.test(n.tipInputDOM.value)||(n.tipInputDOM.value=""),n.tipInputDOM.value=n.tipInputDOM.value.substring(0,R.oV)}),0)},n.handleTipKeyUp=function(e){n.isHighTipAmountWarningActive&&13!==e.keyCode&&n.resetTipButtonText(),n.checkValidTip()},n.sendTipFn=function(){if("none"===n.wrongTipNoticeDOM.style.display){var e=parseInt(n.tipInputDOM.value);if(!isNaN(e))if(P.J.current.isNoninteractiveUser)(0,f.Cj)(k.ag.internalStaffTip);else{if((0,C.fg)("SendTipClicked",{amount:e,location:"DmWindow"}),e>100&&!n.isHighTipAmountWarningActive)return n.setTipButtonText(k.ag.tipConfirmationMessage(e)),n.isHighTipAmountWarningActive=!0,void n.sendTipButtonDOM.focus();(0,I.d1)({roomName:n.username,tipAmount:n.tipInputDOM.value,message:n.tipMessageDOM.value,source:"DM",tipRoomType:"sitewidePMs",tipType:"public",videoMode:T.S.getVideoMode()}).then((function(t){t.success?((0,C.fg)("SendTipSuccess",{amount:e,location:"DmWindow"}),n.hideTipping()):void 0!==t.error?!0===t.showPurchaseLink?(0,R.dg)(t.error):(0,f.Cj)(t.error):(error("unknown send tip error"),(0,f.Cj)(k.ag.errorSendingTip)),n.tipMessageDOM.value="",void 0!==t.tipsInPast24Hours&&I.H2.fire({tokens:t.tipsInPast24Hours,roomName:n.username})})).catch((function(e){error("Error sending tip (".concat(e,")")),(0,f.Cj)(k.ag.errorSendingTip)})).finally((function(){n.resetTipButtonText()}))}}},n.hideTipping=function(){n.removeUI()},n.listenerGroup=new b.mM,n.isHighTipAmountWarningActive=!1,n.updateCurrentTipBalance(),I.A3.listen((function(e){n.updateTokenBalance(e.tokens)}),!1).addTo(n.listenerGroup),n}return(0,s.Z)(o,[{key:"createOverlay",value:function(){var e={display:"block",width:"100%",height:"calc(100% - ".concat(Ue.headerHeight,")"),position:"absolute",bottom:0,left:0,cursor:"pointer"};return this.overlay=(0,S.vz)("div",{style:e,colorClass:"dmWindowTipOverlay",onClick:this.hideTipping}),this.overlay}},{key:"createUI",value:function(){var e=this;return this.element=(0,S.vz)("div",{colorClass:"dmWindowTipCallout",style:{position:"absolute",bottom:"0px",right:"0px",height:"183px",minWidth:"280px",maxWidth:"100%",fontSize:"12px",zIndex:999}},(0,S.vz)("div",{style:{height:"31px",lineHeight:"31px",borderRadius:"4px 4px 0px 0px",padding:"0 6px"},colorClass:"titleBar"},(0,S.vz)("span",{style:{fontSize:"14px",fontWeight:"bold"}},k.ag.sendTipText),(0,S.vz)(De,{style:{right:"5px",top:"-4px",cursor:"pointer"},clickHandler:this.hideTipping})),(0,S.vz)("div",{style:{padding:"6px",boxSizing:"border-box"}},(0,S.vz)("div",null,(0,S.vz)("span",null,k.ag.currentBalanceText),(0,S.vz)("span",{style:{margin:"0 5px",display:"inline-block",width:"90px"},colorClass:"tokenBalance",ref:function(t){return e.currentBalanceDOM=t}}),(0,S.vz)("a",{onClick:function(){(0,R.Hi)({source:P.J.current.PurchaseEventSources.TOKEN_SOURCE_PRIVATE_MESSAGE_WINDOW})},colorClass:"purchaseLink",style:{textDecoration:"underline",cursor:"pointer"},ref:function(t){return e.getMoreLinkDOM=t}},k.ag.getMoreLabel)),(0,S.vz)("div",null,(0,S.vz)("span",null,k.ag.tipAmountText),(0,S.vz)("input",{type:"text",style:{width:"69px",height:"24px",borderWidth:"1px",borderStyle:"solid",boxSizing:"border-box",borderRadius:"4px",marginLeft:"5px"},colorClass:"tipInput",value:25,onKeyPress:this.handleTipKeyPress,onPaste:this.handlePaste,onKeyUp:this.handleTipKeyUp,onPointerDown:M.o,ref:function(t){e.tipInputDOM=t}}),(0,S.vz)("span",{style:{marginLeft:"8px",display:"none"},colorClass:"tokenInputError",ref:function(t){e.wrongTipNoticeDOM=t}},k.ag.invalidAmount)),(0,S.vz)("div",null,k.ag.TipOptionalMessageLabel),(0,S.vz)("textarea",{style:{width:"100%",height:"32px",borderRadius:"4px",resize:"none",borderWidth:"1px",borderStyle:"solid",margin:"5px 0 0 0",boxSizing:"border-box"},colorClass:"tipMessage",onPointerDown:M.o,ref:function(t){return e.tipMessageDOM=t}}),(0,S.vz)("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end",marginTop:"5px"}},(0,S.vz)("button",{style:{boxSizing:"border-box",maxWidth:"100%",height:"32px",fontSize:"14px",fontWeight:"bold",cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},colorClass:"sendTipButton","data-testid":"send-tip-button",onClick:this.sendTipFn,ref:function(t){return e.sendTipButtonDOM=t}},k.ag.sendTipToUser(this.username))))),this.element}},{key:"dispose",value:function(){this.listenerGroup.removeAll()}},{key:"focus",value:function(){(0,M.o)(this.tipInputDOM),this.tipInputDOM.setSelectionRange(0,9999)}},{key:"setFields",value:function(e,t){void 0!==e&&(this.tipInputDOM.value=String(e)),void 0!==t&&(this.tipMessageDOM.value=t),this.checkValidTip(),this.updateCurrentTipBalance()}},{key:"updateCurrentTipBalance",value:function(){var e=this;(0,I.yX)(this.username).then((function(t){e.currentBalanceDOM.innerText="".concat(t.tokenBalance," ").concat(k.ag.tokenOrTokensText(t.tokenBalance,!1))})).catch(x.$x)}},{key:"updateTokenBalance",value:function(e){this.currentBalanceDOM.innerText="".concat(e," ").concat(k.ag.tokenOrTokensText(e,!1))}},{key:"checkValidTip",value:function(){/^[1-9]\d*$/.test(this.tipInputDOM.value)?(this.hideInvalidTipNotice(),this.sendTipButtonDOM.style.cursor="pointer",this.sendTipButtonDOM.disabled=!1):(this.showInvalidTipNotice(),this.sendTipButtonDOM.style.cursor="",this.sendTipButtonDOM.disabled=!0)}},{key:"showInvalidTipNotice",value:function(){this.wrongTipNoticeDOM.style.display=""}},{key:"hideInvalidTipNotice",value:function(){this.wrongTipNoticeDOM.style.display="none"}},{key:"setTipButtonText",value:function(e){this.sendTipButtonDOM.textContent=e,this.sendTipButtonDOM.title=e}},{key:"resetTipButtonText",value:function(){this.setTipButtonText(k.ag.sendTipToUser(this.username)),this.isHighTipAmountWarningActive=!1}}]),o}(g.w),E=n(5937);var B,O=function(e){(0,a.Z)(u,e);var t,n,o=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function u(e,t){return(0,r.Z)(this,u),o.call(this,e,t)}return(0,s.Z)(u,[{key:"createOverlay",value:function(){return this.overlay=(0,S.vz)("div",{style:{display:"block",width:"100%",position:"absolute",top:0,right:0,bottom:0,left:0},colorClass:"dmWindowTipOverlay",onClick:this.hideTipping}),this.overlay}},{key:"createUI",value:function(){var e=(0,i.Z)((0,c.Z)(u.prototype),"createUI",this).call(this);return this.tipInputDOM.type=(0,E.JR)()?"number":"tel",(0,y.Zs)(e,{bottom:"",height:"",top:"50%",left:"50%",transform:"translate(-50%, -50%"}),(0,y.Zs)(this.tipInputDOM,{fontSize:"16px",fontFamily:"UbuntuRegular, Helvetica, Arial, sans-serif"}),(0,y.Zs)(this.tipMessageDOM,{fontSize:"16px",fontFamily:"UbuntuRegular, Helvetica, Arial, sans-serif"}),(0,y.Zs)(this.wrongTipNoticeDOM,{marginLeft:""}),(0,y.Zs)(this.getMoreLinkDOM,{display:"block",textAlign:"right"}),e}},{key:"showInvalidTipNotice",value:function(){this.wrongTipNoticeDOM.style.display="block"}}]),u}(A),L=n(1392),D=n(9420),U=n(6474),Z=n(1185),F=n(7397);var _=function(e){(0,a.Z)(o,e);var t,n,i=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function o(e){var t;return(0,r.Z)(this,o),(t=i.call(this,"div",e)).props=e,t.isInputExpanded=!1,t.disableSend=!0,t.disableTip=!0,t}return(0,s.Z)(o,[{key:"initData",value:function(e){var t=this;this.listenerGroup=new b.mM,D.He.listen((function(e){t.emojiButton})).addTo(this.listenerGroup)}},{key:"initUI",value:function(e){var t=this,n={position:"absolute",bottom:"0",width:"calc(100% - 4px)",height:this.trueHeight(!1),margin:"0px 2px 3px",boxSizing:"border-box",borderWidth:"1px",borderStyle:"solid",borderRadius:"2px"};this.element=(0,S.vz)("div",{style:n,colorClass:"dmWindowInput"},(0,S.vz)("textarea",{style:{position:"absolute",width:"100%",resize:"none",boxSizing:"border-box",backgroundColor:"transparent",border:"none",outline:"none",fontFamily:"Tahoma, Helvetica, Arial, sans-serif",fontSize:"12px",padding:"8px 0 0 8px"},className:"noScrollbar",placeholder:k.ag.sendAMessageDesktop,maxLength:Oe,ref:function(e){return t.inputBar=e},onKeyDown:function(e){return t.keyDownHandler(e)},onInput:function(){return t.expandOrCollapseInputBar()},onFocus:e.onFocus,onPointerDown:function(e){return t.focus(e)},"data-testid":"dm-input"}),(0,S.vz)("div",{style:{position:"absolute",bottom:"4px",right:"0px",padding:"2px 6px 0px",margin:"4px 0px"},ref:function(e){return t.buttonsContainer=e}},(0,S.vz)("span",{style:{height:"23px",width:"47px",borderRadius:"4px",fontSize:"12px",lineHeight:"14px",cursor:"pointer",padding:"4px"},colorClass:["sendButton","disabled"],onClick:function(){return t.submit()},ref:function(e){return t.sendDmButton=e},"data-testid":"dm-send-button"},k.ag.sendCAPS),(0,S.vz)("span",{style:{height:"23px",width:"47px",borderRadius:"4px",fontSize:"12px",lineHeight:"14px",padding:"4px",cursor:"pointer",marginLeft:"4px",display:"none"},colorClass:["tipButton"],onClick:function(){return t.props.showTipping()},ref:function(e){return t.sendTipButton=e},"data-testid":"dm-tip-button"},k.ag.tipCAPS)))}},{key:"enableSend",value:function(){this.disableSend=!1,(0,Z.FU)(this.sendDmButton,"disabled")}},{key:"enableTip",value:function(){this.disableTip=!1,this.sendTipButton.style.display=""}},{key:"focus",value:function(e){(0,M.o)(null!=e?e:this.inputBar)}},{key:"blur",value:function(){this.inputBar.blur()}},{key:"isFocused",value:function(){return document.activeElement===this.inputBar}},{key:"dispose",value:function(){this.listenerGroup.removeAll()}},{key:"submit",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.disableSend)if(P.J.current.isNoninteractiveUser)(0,f.Cj)(k.ag.internalStaffMessage);else{var n=this.inputBar.value.trim();if(this.inputBar.value="",this.expandOrCollapseInputBar(),t&&this.focus(),""!==n){var i=(0,L.DO)(n,"DM");if(1===i.messageType){var o=i;this.handleTipRequestMessage(o)}else(0,U.pc)({message:n,username:this.props.toUsername,source:"DM"}).catch((function(t){e.props.sendDmFailedCallback(t)}))}}}},{key:"handleTipRequestMessage",value:function(e){this.disableTip||this.props.showTipping(e.messageData.amount,e.messageData.message)}},{key:"keyDownHandler",value:function(e){switch(e.keyCode){case 76:(e.ctrlKey||e.metaKey)&&(e.preventDefault(),e.stopPropagation(),F.Lj.fire({username:this.props.toUsername}));break;case 13:e.shiftKey||(e.preventDefault(),this.submit())}}},{key:"expandOrCollapseInputBar",value:function(){var e=this,t=this.buttonsContainer.getBoundingClientRect().x-this.element.getBoundingClientRect().x;(0,y.mY)(this.inputBar.value,this.inputBar)>=t-20||this.inputBar.value.includes("\n")?e.isInputExpanded||(e.props.onInputExpand(),e.element.style.height=e.trueHeight(!0),e.isInputExpanded=!0):e.isInputExpanded&&(e.props.onInputCollapse(),e.element.style.height=e.trueHeight(!1),e.isInputExpanded=!1)}},{key:"render",value:function(){return this.element}},{key:"trueHeight",value:function(e){var t=e?o.expandedHeight:o.height;return"calc(".concat(t," - 3px)")}}]),o}(g.w);(B=_).height="38px",B.expandedHeight="76px";var N=function(e){(0,a.Z)(o,e);var t,n,i=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function o(e){return(0,r.Z)(this,o),i.call(this,e)}return(0,s.Z)(o,[{key:"initUI",value:function(e){var t=this;this.element=(0,S.vz)("div",{style:{bottom:"1px",width:"100%",height:"33px",borderWidth:"1px",borderStyle:"solid",borderRadius:"2px",boxSizing:"border-box",display:"flex"},colorClass:"dmWindowInput"},(0,S.vz)("textarea",{style:{width:"274px",resize:"none",boxSizing:"border-box",backgroundColor:"transparent",border:"none",outline:"none",fontFamily:"Tahoma, Helvetica, Arial, sans-serif",fontSize:"16px",padding:"6px 0 0 6px"},className:"noScrollbar",placeholder:k.ag.sendAMessageDesktop,maxLength:Oe,ref:function(e){return t.inputBar=e},onKeyDown:function(e){return t.keyDownHandler(e)},onInput:function(){return t.expandOrCollapseInputBar()}}),(0,S.vz)("div",{style:{padding:"0 3px 3px 3px",display:"flex",alignItems:"flex-end"},ref:function(e){return t.buttonsContainer=e}},(0,S.vz)("span",{style:{borderRadius:"4px",fontSize:"12px",lineHeight:"14px",cursor:"pointer",padding:"4px"},colorClass:["sendButton","disabled"],onClick:function(){return t.submit(!1)},ref:function(e){return t.sendDmButton=e}},k.ag.sendCAPS),(0,S.vz)("span",{style:{borderRadius:"4px",fontSize:"12px",lineHeight:"14px",padding:"4px",cursor:"pointer",marginLeft:"4px",display:"none"},colorClass:["tipButton"],onClick:function(){return t.props.showTipping()},ref:function(e){return t.sendTipButton=e}},k.ag.tipCAPS)))}},{key:"handleTipRequestMessage",value:function(e){this.disableTip||this.props.showTipping(e.messageData.amount,e.messageData.message,(0,d.Tt)())}}]),o}(_),j=n(4043),H=n(5004),z=n(3607),W=n(9482),V=n(5925),q=n(8016),K=n(1612),J=n(6208),G=n(8945),Y=n(6832),$=function(){function e(){(0,r.Z)(this,e),this.historyDms=new Set,this.newDms=new Set}return(0,s.Z)(e,[{key:"filterDuplicates",value:function(e,t){var n=t?this.historyDms:this.newDms,i=t?this.newDms:this.historyDms;if(void 0===n||void 0===i)return e;if(0===i.size)return e.forEach((function(e){return n.add(e.messageID)})),e;var o=e.filter((function(e){return!i.has(e.messageID)}));return o.length>0&&(this.historyDms=void 0,this.newDms=void 0),o}},{key:"isMessageDuplicate",value:function(e,t){return 0===this.filterDuplicates([e],t).length}}]),e}(),Q=n(9493),X=n(7201),ee=n(10);function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ne(e){for(var t=1;tthis.timestampThresholdSeconds}}]),u}(g.w),re=n(2952),se=n(695),ae=n(2008),le=n(27),ce=n(2896),ue=n(7108),de=n(1194);function he(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function fe(e){for(var t=1;t=18&&(i=e.menuData.displayAge),n.background="",(0,S.vz)("span",{style:n,colorClass:"ageIcon","data-testid":"age"},i)},ye=function(e){var t=fe({display:"inline-block",width:"15px",height:"14px",verticalAlign:"top"},e.newGenderSpanStyle),n=fe({display:"inline-block",width:"14px",height:"14px"},e.newGenderIconStyle),i=(0,S.vz)("img",null);return void 0!==e.gender&&""!==e.gender&&(i=(0,S.vz)("img",{style:n,src:(0,W.Fg)(e.gender),title:k.ag.genderSymbolToIconTitle(e.gender),"data-testid":"gender-icon"})),(0,S.vz)("span",{style:t},i)},be=function(e){var t=(0,W.Lj)(e.user),n=(0,W.c9)(e.user),i=(0,W.Ow)(e.user);if(void 0!==t){var o="";return void 0!==i&&(o=(0,S.vz)("div",{style:{height:"10px",fontSize:"10px",marginTop:"4px",WebkitTextSizeAdjust:"none"}},i)),(0,S.vz)("div",{style:{padding:"9px 10px",borderTopWidth:"1px",borderTopStyle:"solid",fontSize:"12px"},colorClass:"pmUcmDescription"},(0,S.vz)("div",{style:{height:"12px",width:"100%",fontWeight:"bold"},colorClass:n,"data-testid":"user-label"},t),o)}},we=function(e){var t=fe({display:"flex",padding:"3px 8px 3px 12px",whiteSpace:"nowrap",fontWeight:"normal",fontFamily:"Tahoma, Arial, Helvetica, sans-serif",fontSize:"12px",WebkitTextSizeAdjust:"none",cursor:"pointer",boxSizing:"border-box"},e.newLinkItemStyle),n=fe({flexShrink:0,padding:"0px 4px 0px 0px",width:"14px",height:"14px",display:"inline-block",marginRight:"4px",marginTop:"2px"},e.newIconStyle);return(0,S.vz)("li",{style:t,onClick:e.clickHandler,colorClass:"pmUcmLinkItem",title:e.innerText},(0,S.vz)("span",{style:n,colorClass:e.iconColorClass}),(0,S.vz)("span",{style:{fontWeight:"normal",fontFamily:"Tahoma, Arial, Helvetica, sans-serif",fontSize:"12px",overflow:"hidden",textOverflow:"ellipsis",WebkitTextSizeAdjust:"none"},"data-testid":e.dataid},e.innerText))},Ce=n(407);var xe=function(e){(0,a.Z)(o,e);var t,n,i=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function o(e){return(0,r.Z)(this,o),i.call(this,"div",e)}return(0,s.Z)(o,[{key:"initUI",value:function(e){var t=void 0!==e.divotPosition?e.divotPosition:1;this.element=(0,Ce.T)({content:e.message,hasHTML:!1,width:"auto",divotPosition:t,divotLeftOrTop:"auto"}),(0,y.Zs)(this.element,{fontFamily:"Tahoma, Arial, Helvetica, sans-serif",lineHeight:"27px",bottom:void 0===e.toolTipBottom?"40px":e.toolTipBottom,right:void 0===e.toolTipRight?"0px":e.toolTipRight,padding:"0px 8px",whiteSpace:"nowrap"});var n=this.element.querySelector(".divot");null!==n&&(0,y.Zs)(n,{right:void 0===e.caretRight?"21px":e.caretRight,bottom:void 0===e.caretBottom?"auto":e.caretBottom})}},{key:"changeMessage",value:function(e){this.element.firstChild&&(this.element.firstChild.textContent=e)}},{key:"show",value:function(){this.element.style.display="block"}},{key:"hide",value:function(){this.element.style.display="none"}},{key:"render",value:function(){return this.element}}]),o}(g.w),ke=n(8015);function Se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Te(e){for(var t=1;t0?(this.element.style.display="inline-block",this.numDisplay.textContent=e>9?"9+":"".concat(e),this.numDisplay.style.width="".concat((0,y.mY)(this.numDisplay.textContent,this.numDisplay)+4,"px")):this.element.style.display="none"}},{key:"getNum",value:function(){return this.numUnread}},{key:"toggleDot",value:function(e){e?(this.numDisplay.style.display="none",this.dot.style.display=""):(this.numDisplay.style.display="",this.dot.style.display="none")}},{key:"usingDot",value:function(){return""===this.dot.style.display}},{key:"render",value:function(){return this.element}}]),n}(g.w);function Ae(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,c.Z)(e);if(t){var o=(0,c.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,l.Z)(this,n)}}function Ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Be(e){for(var t=1;t0?k.ag.receivedTipDmNoticeWithMessage(this.username,e.amount,e.message):k.ag.receivedTipDmNotice(this.username,e.amount);var i=this.createLogMessage(t,n?2:1,"tipNotice");(0,y.Zs)(i,{fontWeight:"bold"}),this.appendRoomNotice(i)}},{key:"getNumUnread",value:function(){var e;return null!==(e=this.numUnread)&&void 0!==e?e:0}},{key:"createChatDiv",value:function(){var e,t,i=this,o={height:"calc(100% - ".concat(n.headerHeight,")"),position:"relative",fontFamily:"Tahoma, Arial, Helvetica, sans-serif",fontSize:"12px"},r={position:"relative",height:"calc(100% - ".concat(_.height,")"),paddingBottom:"8px",boxSizing:"border-box",overflowY:"auto"};this.chatDiv=(0,S.vz)("div",{style:o,ref:function(e){i.chatDiv=e}},(0,S.vz)("div",{style:r,onScroll:function(){i.handleChatDivScroll()},onMouseDown:function(n){e=n.pageX,t=n.pageY},onMouseUp:function(n){var o=n.pageX-e,r=n.pageY-t;Math.sqrt(o*o+r*r)<2&&i.input.focus()},ref:function(e){return i.messageDiv=e}},(0,S.vz)("div",{style:{width:"100%",boxSizing:"border-box",padding:"0px 4px"},ref:function(e){return i.messageList=e}},this.createLogMessage(k.ag.privateConversationWithText(this.username)),this.createLogMessage(k.ag.conversationCautionMessage(K.w.siteName)),(0,S.vz)("div",{ref:function(e){return i.messageHistoryDiv=e}},(0,S.vz)("div",{style:{marginTop:"44px"},ref:function(e){return i.loadingDiv=e}},(0,S.vz)(J.L,{extraStyle:{margin:"auto"}}))))),(0,S.vz)(_,{classRef:function(e){return i.input=e},toUsername:this.username,onInputExpand:function(){return i.onInputExpand()},onInputCollapse:function(){return i.onInputCollapse()},showTipping:function(e,t){return i.showTipping(e,t)},sendDmFailedCallback:function(e){i.appendRoomNotice(i.createLogMessage(e.errorMessage))},onFocus:function(){return i.onInputFocus()}}))}},{key:"handleChatDivScroll",value:function(){var e=this.messageDiv.scrollTop;0!==e||this.isAllHistoryLoaded||this.fetchConversation(!0,this.earliestMessageId),this.messageDiv.scrollHeight-e-this.messageDiv.clientHeight<2&&this.fireDmsRead()}},{key:"createFollowStar",value:function(){var e=this;(0,w.w5)(this.username).then((function(t){e.followProhibited=!t,(0,p.Ue)("follow/is_following/".concat(e.username,"/")).then((function(n){var i=JSON.parse(n.responseText).following;(t||i)&&e.constructFollowStarUI(i)})).catch(x.$x)})).catch(x.$x)}},{key:"constructFollowStarUI",value:function(e){var t=this;this.followButton=(0,S.vz)(Le,{parentDiv:this.headerBar,testID:"dm-follow-button",style:{right:"30px"},clickHandler:function(){}}),this.followStar=new G.X({slug:this.username,isFollowing:e,hideTitle:!0}),(0,y.Zs)(this.followStar,{height:"20px",width:"20px",backgroundSize:"20px 20px",backgroundPosition:"center",padding:"2px 3px",margin:"0px"}),this.constructFollowToolTip(e),(0,h.j9)("mouseenter",this.followButton,(function(){var e;t.followStar.isShown()&&(null===(e=t.followToolTip)||void 0===e||e.show())})),(0,h.j9)("mouseleave",this.followButton,(function(){var e;null===(e=t.followToolTip)||void 0===e||e.hide()})),this.followButton.appendChild(this.followStar.element),void 0!==this.followToolTip&&this.followButton.appendChild(this.followToolTip.element),this.headerBar.appendChild(this.followButton)}},{key:"constructFollowToolTip",value:function(e){this.followToolTip=new xe({message:e?k.ag.unfollowText:k.ag.followText})}},{key:"followUnfollow",value:function(e){var t;this.followStar.setFollowing(e),null===(t=this.followToolTip)||void 0===t||t.changeMessage(e?k.ag.unfollowText:k.ag.followText),this.followProhibited&&!e&&(this.followButton.style.display="none")}},{key:"getUserInfo",value:function(){return this.userInfo}},{key:"setUserInfo",value:function(e){this.userInfo=Be(Be({},this.userInfo),e),this.usernameLabel.applyColor((0,W.c9)(this.userInfo))}},{key:"openWindow",value:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.chatDiv.style.display="block",(0,Z.FU)(this.element,"collapsed"),this.element.style.bottom=n.expandedHeight,this.element.style.height=n.expandedHeight,null===(t=this.closeToolTip)||void 0===t||t.changeMessage(k.ag.dmCloseTabShortcut),this.usernameLabel.toggleUnreadDot(!0),e&&(i||this.scrollAndFocus(),this.fireDmsRead()),void 0!==this.followButton&&(this.followButton.style.display="block")}},{key:"collapseWindow",value:function(){var e;this.chatDiv.style.display="none",(0,Z.vP)(this.element,"collapsed"),this.element.style.bottom="36px",this.element.style.height="36px",null===(e=this.closeToolTip)||void 0===e||e.changeMessage(k.ag.dmCloseTab),this.usernameLabel.toggleUnreadDot(!1),this.getNumUnread()>0&&this.usernameLabel.updateNumUnread(this.getNumUnread()),void 0!==this.followButton&&(this.followButton.style.display="none"),this.hideTipping()}},{key:"openOrCollapseWindow",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.isOpen=e,e?this.openWindow(t,n):this.collapseWindow();var i={username:this.username,isOpen:e};F.Ql.fire(i),F._j.fire(void 0)}},{key:"setIsShowing",value:function(e){this.isShowing=e,e&&this.fetchFailed&&this.fetchConversation(!0)}},{key:"removeFromDOM",value:function(){var e;null===(e=this.closeToolTip)||void 0===e||e.hide(),this.hideTipping(),this.element.remove(),this.setIsShowing(!1)}},{key:"isWindowOpen",value:function(){return this.isOpen}},{key:"isInputFocused",value:function(){return this.input.isFocused()}},{key:"blurInput",value:function(){this.input.blur()}},{key:"isScrolledUp",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40;return this.messageList.offsetHeight-(this.messageDiv.scrollTop+this.messageDiv.offsetHeight)>e}},{key:"scrollToBottom",value:function(){this.messageDiv.scrollTop=this.messageList.offsetHeight}},{key:"handleImageLoadScrolling",value:function(e){var t=this;this.isScrolledUp()||e.querySelectorAll("img").forEach((function(e){var n=e.src;e.src="",e.onload=function(){return t.scrollToBottom()},e.src=n}))}},{key:"scrollAndFocus",value:function(){this.scrollToBottom(),document.activeElement!==this.input.element&&this.input.focus()}},{key:"onInputFocus",value:function(){this.isScrolledUp()||this.fireDmsRead()}},{key:"onInputExpand",value:function(){var e=this.isScrolledUp();this.messageDiv.style.height="calc(100% - ".concat(_.expandedHeight,")"),e||this.scrollToBottom()}},{key:"onInputCollapse",value:function(){this.messageDiv.style.height="calc(100% - ".concat(_.height,")")}},{key:"fetchConversation",value:function(e,t){var n=this;(0,U.SX)(this.username,t).then((function(i){var r=i.messages;if(r.length0)if(n.earliestMessageId=r[0].messageID,void 0===n.lastReceivedMessage&&(n.lastReceivedMessage=(0,o.Z)(r).reverse().find((function(e){return e.fromUser.username===n.username}))),void 0===n.latestTimestamp&&(n.latestTimestamp=r[r.length-1].createdAt),void 0===t){var s=n.dmDuplicateChecker.filterDuplicates(r,!0);n.addPreviousBatch(s),n.maybeAddCanDmNotice(),n.scrollToBottom(),n.handleImageLoadScrolling(n.messageHistoryDiv)}else n.addPreviousBatch(r);else void 0===t&&n.maybeAddCanDmNotice();n.maybeUpdateConversationListItem(r)})).catch((function(){n.appendRoomNotice(n.createLogMessage(k.ag.errorLoadingConversationHistory)),n.loadingDiv.remove(),n.fetchFailed=!0}))}},{key:"maybeUpdateConversationListItem",value:function(e){var t,n;if(0!==e.length){var i=e[e.length-1];Y.zS.conversationLoaded.fire({message:i.message,numUnread:null!==(t=this.numUnread)&&void 0!==t?t:0,time:null===(n=this.latestTimestamp)||void 0===n?void 0:n.getTime(),fromUsername:i.fromUser.username,otherUser:this.userInfo,hasMedia:i.mediaList.length>0,room:""})}}},{key:"addPreviousBatch",value:function(e){var t=this;if(0!==e.length){var n,i,o=(0,S.vz)("div",null);void 0!==this.oldestMessage&&this.oldestMessage.updateForPrevTimestamp(e[e.length-1].createdAt),e.forEach((function(e,r){var s=e.fromUser.username===t.myUsername;n=new oe({dm:e,isMine:s,prevTimestamp:i}),o.appendChild(n.element),i=e.createdAt,0===r&&(n.showTimestamp(),t.oldestMessage=n)})),this.messageHistoryDiv.insertBefore(o,this.messageHistoryDiv.firstChild),this.messageDiv.scrollTop=o.offsetHeight}}},{key:"createLogMessage",value:function(e){var t=arguments.length>2?arguments[2]:void 0;switch(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0){case 0:return(0,S.vz)("div",{style:{maxWidth:"271px",textAlign:"center",fontSize:"11px",lineHeight:"12px",padding:"4px",margin:"auto"},colorClass:"logMessage"},e);case 2:return ie(e,!0,"logMessage",t);case 1:return ie(e,!1,"logMessage",t)}}},{key:"appendRoomNotice",value:function(e){this.messageList.appendChild(e),this.scrollToBottom()}},{key:"addMessageToEnd",value:function(e){var t=e.fromUser.username===this.myUsername;t||(this.lastReceivedMessage=e);var n=new oe({dm:e,isMine:t,prevTimestamp:this.latestTimestamp});this.handleImageLoadScrolling(n.element),this.messageList.appendChild(n.element),this.latestTimestamp=e.createdAt,void 0===this.oldestMessage&&(n.showTimestamp(),this.oldestMessage=n)}},{key:"maybeAddCanDmNotice",value:function(){if(!this.canSendDm){var e,t=!0===(null===(e=P.J.current.loggedInUser)||void 0===e?void 0:e.isAgeVerified)?k.ag.dmSupporterNoticeAgeVerified:k.ag.dmSupporterNotice;this.appendRoomNotice(this.createLogMessage(t))}}},{key:"handleNewMessage",value:function(e){if(!this.dmDuplicateChecker.isMessageDuplicate(e,!1)){var t=e.fromUser.username===this.myUsername,n=t?0:this.getNumUnread()+1,i=this.isScrolledUp();this.addMessageToEnd(e),!t&&i||this.scrollToBottom(),t||this.setNumUnread(n),this.isOpen&&this.isShowing&&!i&&this.fireDmsRead()}}},{key:"setNumUnread",value:function(e){0!==e?(this.numUnread=e,this.usernameLabel.updateNumUnread(e)):this.fireDmsRead()}},{key:"fireDmsRead",value:function(){0!==this.getNumUnread()&&document.hasFocus()&&(this.markRead(),ke.Zn.fire({username:this.username}))}},{key:"markRead",value:function(){0!==this.getNumUnread()&&(this.numUnread=0,this.usernameLabel.updateNumUnread(0))}},{key:"highlightHeader",value:function(){(0,Z.vP)(this.headerBar,"highlight")}},{key:"unHighlightHeader",value:function(){(0,Z.FU)(this.headerBar,"highlight")}},{key:"highlightHeaderForShow",value:function(){var e=this;(0,Z.vP)(this.headerBar,"loadedHighlight"),window.clearTimeout(this.loadedHighlightTimeout),this.loadedHighlightTimeout=window.setTimeout((function(){return(0,Z.FU)(e.headerBar,"loadedHighlight")}),4e3)}}]),n}(g.w);(Pe=Ue).headerHeight="34px",Pe.expandedHeight="260px";var Ze=function(e){(0,a.Z)(n,e);var t=Ae(n);function n(e){var i;return(0,r.Z)(this,n),i=t.call(this,e),"ResizeObserver"in window&&new ResizeObserver((function(){return i.onResize()})).observe(i.messageDiv),i}return(0,s.Z)(n,[{key:"constructElement",value:function(){var e=this;this.createHeaderBar(),this.createChatDiv(),this.createFollowStar(),this.element=(0,S.vz)("div",{colorClass:"dmWindow",style:{boxShadow:"none",display:"flex",flexDirection:"column",flex:1,height:"1px"}},this.headerBar,this.chatDiv,(0,S.vz)(N,{classRef:function(t){return e.input=t},toUsername:this.username,onInputExpand:function(){},onInputCollapse:function(){},showTipping:function(t,n,i){return e.showTipping(t,n,i)},sendDmFailedCallback:function(t){e.appendRoomNotice(e.createLogMessage(t.errorMessage))},onFocus:function(){return e.onInputFocus()}}))}},{key:"createHeaderBar",value:function(){var e=this;this.headerBar=(0,S.vz)("div",{style:{position:"relative",height:"34px",borderRadius:"4px 4px 0px 0px",borderBottomWidth:"1px",borderBottomStyle:"solid"},colorClass:"dmWindowHeader"}),this.usernameLabel=new Re({username:this.username,colorClass:this.colorClass,clickUsernameFn:function(){return e.showUserPanel()}}),this.headerBar.appendChild(this.usernameLabel.element)}},{key:"createChatDiv",value:function(){var e=this;this.chatDiv=(0,S.vz)("div",{style:{fontFamily:"Tahoma, Arial, Helvetica, sans-serif",fontSize:"12px",flex:1,height:"1px",display:"flex"},ref:function(t){e.chatDiv=t}},(0,S.vz)("div",{style:{width:"100%",height:"100%",overflowY:"auto"},onScroll:function(){e.handleChatDivScroll()},ref:function(t){return e.messageDiv=t}},(0,S.vz)("div",{style:{width:"100%",boxSizing:"border-box",padding:"4px 4px 8px 4px"},ref:function(t){return e.messageList=t}},this.createLogMessage(k.ag.privateConversationWithText(this.username)),this.createLogMessage(k.ag.conversationCautionMessage(K.w.siteName)),(0,S.vz)("div",{ref:function(t){return e.messageHistoryDiv=t}},(0,S.vz)("div",{style:{marginTop:"44px"},ref:function(t){return e.loadingDiv=t}},(0,S.vz)(J.L,{extraStyle:{margin:"auto"}}))))))}},{key:"initTippingUI",value:function(){var e=this;this.tippingUI=new O(this.username,(function(){return e.hideTipping()})),this.tippingWindow=this.tippingUI.createUI(),this.tippingOverlay=this.tippingUI.createOverlay()}},{key:"constructFollowStarUI",value:function(e){this.followStar=new G.X({slug:this.username,isFollowing:e}),(0,y.Zs)(this.followStar,{height:"20px",width:"20px",backgroundSize:"20px 20px",backgroundPosition:"center",padding:"2px 3px",margin:"0px"}),this.followButton=(0,S.vz)(Le,{style:{right:"8px"},clickHandler:function(){}}),this.followButton.appendChild(this.followStar.element),this.headerBar.appendChild(this.followButton)}},{key:"openOrCollapseWindow",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e?this.showElement():this.hideElement(),(0,i.Z)((0,c.Z)(n.prototype),"openOrCollapseWindow",this).call(this,e,t)}},{key:"openWindow",value:function(e){this.chatDiv.style.display="flex",(0,Z.FU)(this.element,"collapsed"),this.scrollToBottom(),e&&this.fireDmsRead(),void 0!==this.followButton&&(this.followButton.style.display="block")}},{key:"resizeTipCallout",value:function(){var e=(0,z.mP)();e<250?(0,y.Zs)(this.tippingUI,{height:"".concat(e,"px"),overflow:"scroll",transform:"translate(-50%)",top:"",bottom:"0",overscrollBehavior:"contain"}):(0,y.Zs)(this.tippingUI,{height:"",overflow:"",transform:"translate(-50%, -50%)",top:"50%",bottom:"",overscrollBehavior:""})}},{key:"showUCM",value:function(){}},{key:"showUserPanel",value:function(){var e=this;void 0===this.userPanel&&(this.userPanel=new H.w,(0,y.Zs)(this.userPanel.element,{top:"".concat(this.headerBar.offsetHeight,"px"),backgroundColor:"#FFF",fontSize:"12px"}),j.ah.listen((function(){e.removeUserPanelDOM()})).addTo(this.listenerGroup),this.userPanel.overlayClick.listen((function(){e.removeUserPanelDOM()})).addTo(this.listenerGroup)),this.userPanel.updateContents(this.username,this.lastReceivedMessage),this.headerBar.appendChild(this.userPanel.overlay),this.headerBar.appendChild(this.userPanel.element),this.userPanel.showOverlay()}},{key:"removeUserPanelDOM",value:function(){var e;null===(e=this.userPanel)||void 0===e||e.hideOverlay(),void 0!==this.userPanel&&null!==this.userPanel.element.parentElement&&this.userPanel.element.parentElement.removeChild(this.userPanel.element)}},{key:"showElement",value:function(){(0,i.Z)((0,c.Z)(n.prototype),"showElement",this).call(this,"flex")}},{key:"highlightHeaderForLoad",value:function(){}},{key:"onResize",value:function(){this.isScrolledUp(600)||this.scrollToBottom()}}]),n}(Ue),Fe=function(e){(0,a.Z)(n,e);var t=Ae(n);function n(e){var i,o,s;return(0,r.Z)(this,n),s=t.call(this,{username:e,myUsername:null!==(i=null===(o=P.J.current.loggedInUser)||void 0===o?void 0:o.username)&&void 0!==i?i:"",open:!0,markAsRead:!0,raiseWindowZIndexToTop:function(){}}),new ResizeObserver((function(){return s.onResize()})).observe(s.messageDiv),s}return(0,s.Z)(n,[{key:"constructElement",value:function(){this.createHeaderBar(),this.createFollowStar(),this.createChatDiv(),this.element=(0,S.vz)("div",{colorClass:"dmWindow",style:{position:"relative",height:"100%"},"data-testid":"dm-window"},this.headerBar,this.chatDiv)}},{key:"createHeaderBar",value:function(){var e=this;this.headerBar=(0,S.vz)("div",{style:{position:"relative",height:"34px",borderRadius:"4px 4px 0px 0px",borderBottomWidth:"2px",borderBottomStyle:"solid"},colorClass:"dmWindowHeader"}),this.usernameLabel=new Re({username:this.username,colorClass:this.colorClass,clickUsernameFn:function(){return e.showUCM()}}),this.headerBar.appendChild(this.usernameLabel.element)}},{key:"constructFollowStarUI",value:function(e){(0,i.Z)((0,c.Z)(n.prototype),"constructFollowStarUI",this).call(this,e),this.followButton.style.right="8px"}},{key:"constructFollowToolTip",value:function(e){this.followToolTip=new xe({message:e?k.ag.unfollowText:k.ag.followText,toolTipBottom:"auto",toolTipRight:"40px",divotPosition:3,caretRight:"0px",caretBottom:"24px"})}},{key:"openWindow",value:function(e){(0,i.Z)((0,c.Z)(n.prototype),"openWindow",this).call(this,e),this.element.style.bottom="",this.element.style.height="100%"}},{key:"highlightHeaderForLoad",value:function(){}},{key:"onResize",value:function(){this.isScrolledUp(600)||this.scrollToBottom()}}]),n}(Ue)},1994:function(e,t,n){"use strict";n.d(t,{I:function(){return l},p:function(){return a}});var i=n(9598),o=n(2800),r=n(7212),s=n(8016);function a(e){var t=(e||document).querySelectorAll(".dmWindow");return Array.from(t).reduce((function(e,t){return Math.max(e,t.offsetHeight)}),0)}function l(e){var t,n=null===(t=o.J.current.loggedInUser)||void 0===t?void 0:t.userUid;void 0!==n&&(new s._G(n).onMessage.listen((function(t){var n,i=null===(n=o.J.current.loggedInUser)||void 0===n?void 0:n.username,r=t.fromUser.username!==i?t.fromUser.username:t.toUsername,s=e(null!=r?r:"");null==s||s.onTip(t)})),new s.zw(n).onMessage.listen((function(t){var n=e(t.username);null==n||n.onIgnoreUnignore(t.isIgnored)})),i.wk.listen((function(t){var n=e(t.roomName);null==n||n.followUnfollow(t.following)})),new r.AE(n).onMessage.listen((function(t){var n=e(t.fromUser.username);null==n||n.setUserInfo({inFanclub:!0})})))}},7397:function(e,t,n){"use strict";n.d(t,{FP:function(){return L},GH:function(){return A},Lj:function(){return P},Ql:function(){return R},S_:function(){return M},_j:function(){return E},nh:function(){return I},qd:function(){return O}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(8759),u=n(7693),d=n(9),h=n(1794),f=n(3607),p=n(3682),m=n(3276),v=n(47),g=n(9420),y=n(5925),b=n(2800),w=n(2358),C=n(6832),x=n(2906),k=n(932),S=n(1994),T=n(8015);var I=new h.xB("createDmWindowRequest"),P=new h.xB("removeDMWindowRequest"),R=new h.xB("updateWindowIsOpenEvent"),M=new h.xB("removeDmChatBarRequest"),A=new h.xB("restoreDmChatBarRequest"),E=new h.xB("repositionFloatingPlayer");E.listen((function(){void 0!==document.repositionFloatingPlayer&&document.repositionFloatingPlayer()}));var B="pmChatWindow",O=function(e){(0,s.Z)(h,e);var t,n,d=(t=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function h(e){var t;return(0,i.Z)(this,h),(t=d.call(this)).allDmWindowsMap=new Map,t.focusingTablet=!1,t.tabletFocusState=2,t.raiseWindowZIndexToTop=function(e){t.allDmWindowsMap.forEach((function(t,n){n===e?t.changeWindowZIndex(2):t.changeWindowZIndex(1)}))},t.myUsername=e,t.bindListeners(),(0,u.j9)("mousedown",t.element,(function(){return(0,m.ZE)(!1)})),(0,u.j9)("mouseup",window,(function(){return(0,m.ZE)(!0)})),t}return(0,o.Z)(h,[{key:"initData",value:function(){this.manuallyHandlingTabletKeyboard=(0,c.s2)()&&!!window.visualViewport&&void 0===navigator.virtualKeyboard}},{key:"initUI",value:function(){var e,t,n=this;if((0,r.Z)((0,l.Z)(h.prototype),"initUI",this).call(this),this.shownDmContainer=(0,v.vz)("div",{style:{display:"inline-block",cssFloat:"right"}}),this.element=(0,v.vz)("div",{id:"DmWindowBar",style:{position:"fixed",bottom:"0px",right:"10px",minWidth:"350px",width:"100vw",height:"0px",backgroundColor:"rgba(255, 255, 255, 0.5)",zIndex:1005}},this.shownDmContainer),x.e.listen((function(e){return n.handleInputFocus(e)})),this.manuallyHandlingTabletKeyboard)(0,u.j9)("focus",this.element,(function(){return n.onTabletFocus()}),!0),(0,u.j9)("blur",this.element,(function(){return n.onTabletBlur()}),!0),(0,w._V)(document,(function(){n.focusingTablet||n.blur()})),(0,u.j9)("touchstart",document,(function(e){e.target instanceof Element&&!n.element.contains(e.target)&&n.blur()}));else if(void 0!==navigator.virtualKeyboard){var i=navigator.virtualKeyboard;(0,u.j9)("focus",document,(function(e){i.overlaysContent=e.target instanceof Element&&n.element.contains(e.target)}),!0),(0,u.j9)("blur",this.element,(function(){n.element.style.bottom="0px"}),!0),i.addEventListener("geometrychange",(function(e){n.element.contains(document.activeElement)&&(n.element.style.bottom="".concat(e.target.boundingRect.height,"px"))}))}(0,c.s2)()&&((0,u.j9)("focusin",document,(function(e){e.target instanceof HTMLElement&&(["input","textarea"].includes(e.target.tagName.toLowerCase())||"true"===e.target.contentEditable)&&!n.element.contains(e.target)&&(n.element.style.visibility="hidden")})),(0,u.j9)("focusout",document,(function(){n.element.style.visibility=""})),null===(e=window.visualViewport)||void 0===e||e.addEventListener("resize",(function(){var e=window.visualViewport?Math.round(10*window.visualViewport.scale):void 0;void 0!==t&&e!==t&&n.blur(),t=e})))}},{key:"handleInputFocus",value:function(e){if(this.manuallyHandlingTabletKeyboard){var t;if(e instanceof HTMLElement)t=e;else{if(!(e.target instanceof HTMLElement))return;if(document.activeElement===e.target&&(0,c.Tt)()&&this.isPositionedForKeyboard())return;e.preventDefault(),t=e.target}this.handleTabletInputFocus(t)}else e instanceof HTMLElement&&e.focus()}},{key:"handleTabletInputFocus",value:function(e){var t=this;e.blur();var n=window.scrollX,i=window.scrollY;this.maxZoomedTabletTop=document.body.offsetHeight,this.focusingTablet=!0;var o=function(){window.scrollTo(n,i),(0,f.Fd)()&&t.setTabletStyleForZoomFocus()};(0,u.j9)("scroll",document,o),window.setTimeout((function(){(0,u.SC)("scroll",document,o),t.focusingTablet=!1}),1e3),this.setTabletStyleForFocus(0),e.focus()}},{key:"onTabletFocus",value:function(){var e=this;window.setTimeout((function(){e.setTabletStyleForFocus(1)}),(0,c.Tt)()?75:350)}},{key:"onTabletBlur",value:function(){var e=this;window.setTimeout((function(){e.setTabletStyleForFocus(0),window.setTimeout((function(){e.element.contains(document.activeElement)?(0,c.Tt)()&&e.setTabletStyleForFocus(1):e.setTabletStyleForFocus(2)}),0)}),0)}},{key:"setTabletStyleForFocus",value:function(e){if(e!==this.tabletFocusState)if(this.tabletFocusState=e,(0,f.Fd)())this.setTabletStyleForZoomFocus();else if(!(0,c.op)()){var t=!this.isPositionedForKeyboard();switch(this.element.style.top="unset",this.element.style.bottom="unset",this.element.style.visibility="",e){case 0:t?(0,c.Tt)()?(this.element.style.visibility="none",this.element.style.bottom="60vh"):this.element.style.bottom=(0,p.gr)()?"35vh":"60vh":this.element.style.top="calc(var(--vh, 1vh) * 100 - 2px)";break;case 1:this.element.style.top="calc(var(--vh, 1vh) * 100)";break;case 2:this.element.style.bottom="0px";break;default:error("DmWindowManager - invalid focusState"),this.element.style.bottom="0px"}}}},{key:"setTabletStyleForZoomFocus",value:function(){if(!(0,c.Tt)())return this.element.style.position="fixed",void(this.element.style.bottom="0px");switch(this.element.style.top="unset",this.element.style.bottom="unset",this.tabletFocusState){case 0:case 1:if(window.visualViewport){this.element.style.position="absolute";var e=Math.min(window.scrollY+window.visualViewport.height,this.maxZoomedTabletTop);this.element.style.top="".concat(e,"px")}break;case 2:this.element.style.position="fixed",this.element.style.bottom="0px";break;default:error("DmWindowManager - invalid zoom focusState"),this.element.style.position="fixed",this.element.style.bottom="0px"}}},{key:"isPositionedForKeyboard",value:function(){return this.element.getBoundingClientRect().bottom<=window.innerHeight-5}},{key:"blur",value:function(){document.activeElement instanceof HTMLElement&&this.element.contains(document.activeElement)&&document.activeElement.blur()}},{key:"bindListeners",value:function(){var e=this;P.listen((function(t){var n,i=t.username,o=t.deleteWindow;(null===(n=e.shownWindow)||void 0===n?void 0:n.username)===i&&e.removeShownWindow(),!0===o&&e.allDmWindowsMap.delete(i)})),R.listen((function(){e.updateLocalStorage()})),T.Kd.listen((function(t){var n=e.allDmWindowsMap.get(t.otherUsername);null==n||n.handleNewMessage(t)})),C.zS.conversationRead.listen((function(t){var n=t.username;if(t.isDm){var i=e.allDmWindowsMap.get(n);null==i||i.markRead()}})),b.J.current.isBroadcast&&g.CD.listen((function(t){var n=e.allDmWindowsMap.get(t.username);null==n||n.setUserInfo({isMod:t.isMod})})),(0,S.I)((function(t){return e.allDmWindowsMap.get(t)}))}},{key:"shownWindowUsername",value:function(){var e;return null===(e=this.shownWindow)||void 0===e?void 0:e.username}},{key:"showUserConversation",value:function(e,t,n){if(!this.transferToShown(e,n)){var i=new k.Tx({username:e,myUsername:this.myUsername,open:t,markAsRead:n,raiseWindowZIndexToTop:this.raiseWindowZIndexToTop});this.allDmWindowsMap.set(e,i),this.shownDmContainer.appendChild(i.element),this.showWindow(i,t,n)}}},{key:"removeShownWindow",value:function(){void 0!==this.shownWindow&&(this.shownWindow.removeFromDOM(),this.shownWindow=void 0,this.updateLocalStorage(),E.fire(void 0))}},{key:"transferToShown",value:function(e,t){var n=this.allDmWindowsMap.get(e);return void 0!==n&&(this.shownDmContainer.appendChild(n.element),this.showWindow(n,!0,t),!0)}},{key:"showWindow",value:function(e,t,n){this.removeShownWindow(),this.shownDmContainer.appendChild(e.element),e.setIsShowing(!0),e.openOrCollapseWindow(t,n,!n),n&&e.highlightHeaderForShow(),this.shownWindow=e,this.updateLocalStorage(),E.fire(void 0)}},{key:"updateLocalStorage",value:function(){if((0,c.IU)()){var e;void 0!==this.shownWindow&&(e={username:this.shownWindow.username,isOpen:this.shownWindow.isWindowOpen()});var t=window.localStorage.getItem(B),n=null!==t?JSON.parse(t):{};n[this.myUsername]=JSON.stringify(e),window.localStorage.setItem(B,JSON.stringify(n))}}}],[{key:"getOrCreateInstance",value:function(e){return void 0===h.instance&&(h.instance=new h(e)),h.instance}},{key:"getInstance",value:function(){return h.instance}}]),h}(d.w);function L(e){var t,n=!1;(0,y.Rp)();var i=function(n,i,o){e!==n&&(void 0===t&&(t=O.getOrCreateInstance(e),document.body.appendChild(t.element)),t.showUserConversation(n,i,o))},o=function(){if((0,c.IU)()){var t=window.localStorage.getItem(B);if(null!==t){var n=JSON.parse(t)[e];if(void 0===n)return;var o=JSON.parse(n);i(o.username,o.isOpen,!1),E.fire(void 0)}}};o(),M.listen((function(e){e&&(n=!0),void 0!==t&&(document.body.removeChild(t.element),t=void 0)})),A.listen((function(){n&&(o(),n=!1)})),I.listen((function(e){n||i(e,!0,!0)}))}},1359:function(e,t,n){"use strict";n.d(t,{T:function(){return C}});var i,o=n(4649),r=n(2951),s=n(1976),a=n(7591),l=n(9492),c=n(7597),u=n(7693),d=n(9),h=n(8263),f=n(1794),p=n(3543),m=n(47),v=n(1185),g=n(1006),y=n(407);function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function w(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=new Array(t);n0?"block":"none",this.scrollRightBtn.style.display=e.scrollLeft0;)this.items().forEach((function(e){e.remove()}))}},{key:"isEmpty",value:function(){return 0===this.items().length}},{key:"mediaList",value:(t=(0,s.Z)(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(this.items().map((function(e){return e.mediaPromise}))));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"onHide",value:function(){}}]),i}(b.w);D.padding=5;var U=function(e){(0,c.Z)(n,e);var t=A(n);function n(e,i){var o;return(0,a.Z)(this,n),(o=t.call(this)).mediaPromise=e,o.parentDock=i,o.element=(0,k.vz)("div",{style:B(B({},O),{},{backgroundImage:""}),colorClass:"mediaDockItem"},(0,k.vz)("img",{src:"".concat(STATIC_URL_ROOT,"tsdefaultassets/mediaDock/closeButton.svg"),onClick:function(e){e.stopPropagation(),o.remove()},ref:function(e){return o.removeBtn=e},style:{position:"absolute",top:0,right:0,zIndex:1,cursor:"pointer"}}),(0,k.vz)("div",{style:B(B({},O),{},{position:"absolute"}),ref:function(e){return o.imageContainer=e}},(0,k.vz)(P.I,{myRef:function(e){o.loadingSpinner=e}}))),e.then((function(e){o.onload(e)})),o.loadingSpinner.dataset.testid="chat-image-loading-spinner",o}return(0,l.Z)(n,[{key:"onload",value:function(e){var t=this;this.media=e;var n=new Image;n.onload=function(){var e=new Image;e.src=n.src,e.style.width="100%",e.style.height="auto",t.imageContainer.appendChild(e),t.loadingSpinner.style.display="none"},n.src=e.thumbnailUrl}},{key:"removeElement",value:function(){this.parentDock.removeItem(this)}}]),n}(b.w);U.itemWidth=R.k5+2;var Z=function(e){(0,c.Z)(h,e);var t,n,u=A(h);function h(e,t,n){var r;(0,a.Z)(this,h),(r=u.call(this,e)).toUser=t,r.videoModes=n,r.fileInput=(0,k.vz)("input",{type:"file",accept:"image/*",multiple:!0}),r.loadingSpinner=new F,r.initSibling();var s=(0,k.vz)("div",{style:B(B({},O),{},{cursor:"pointer",backgroundImage:"none",backgroundColor:"#2C2C2C"})},(0,k.vz)("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%) scale(1.5)"}},(0,k.vz)("img",{src:"".concat(STATIC_URL_ROOT,"tsdefaultassets/mediaDock/uploadBackground.svg")}),(0,k.vz)("img",{src:"".concat(STATIC_URL_ROOT,"tsdefaultassets/mediaDock/uploadSymbol.svg"),style:{position:"absolute",bottom:0,right:0,transform:"translate(50%, 25%) scale(0.66)"}})));return s.dataset.testid="upload-image-button",s.onclick=function(){r.showSelectDialog()},r.dock.element.appendChild(s),r.dock.element.dataset.testid="image-dock",r.fileInput.onchange=function(){r.onFileInputChange()},(0,y.TF)()||r.getLatest(),S.S.changeVideoMode.listen((function(e){r.videoModes.includes(e.currentMode)&&!(0,y.TF)()&&r.getLatest()})).addTo(r.listeners),T.zB.listen((function(e){var t,n=S.S.getVideoMode();r.videoModes.includes(n)&&r.toUser===e.toUser&&((t=r).handleFileUpload.apply(t,(0,i.Z)(e.files)),r.show())})).addTo(r.listeners),T.aC.listen((function(e){r.videoModes.includes(S.S.getVideoMode())&&r.addItem(new _(e.promise,(0,o.Z)(r),r.toUser===e.toUser))}),!1).addTo(r.listeners),r}return(0,l.Z)(h,[{key:"initSibling",value:function(){this.sibling=new N(this.parentContents),this.sibling.sibling=this}},{key:"dispose",value:function(){this.listeners.removeAll(),this.sibling.dispose()}},{key:"onFileInputChange",value:(n=(0,s.Z)(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null!==this.fileInput.files&&(this.handleFileUpload.apply(this,(0,i.Z)(this.fileInput.files)),this.fileInput.value="");case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"handleFileUpload",value:(t=(0,s.Z)(p().mark((function e(){var t,n,i,o,r,s,a=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=a.length,n=new Array(t),i=0;i1&&void 0!==arguments[1]&&arguments[1])&&this.items().length>0?this.dock.addChildBeforeIndex(e,0):this.dock.addChild(e),e.mediaPromise.then((function(n){var i=t.sibling.getImageById(n.mediaId);void 0!==i&&e.setSibling(i)}));this.items().length>L;)this.dock.removeChild(this.dock.lastChild());this.setScrollButtonVisibility()}},{key:"getImageById",value:function(e){return this.items().find((function(t){var n;return(null===(n=t.media)||void 0===n?void 0:n.mediaId)===e}))}},{key:"getLatest",value:function(){var e=this;this.dock.removeAllChildren(),this.dock.addChild(this.loadingSpinner),this.setScrollButtonVisibility(),(0,T.SZ)().then((function(t){e.dock.removeAllChildren(),e.loadingSpinner.element.style.display="none";var n,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return M(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)?M(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;e.addItem(new _(Promise.resolve(o),e),!0)}}catch(e){i.e(e)}finally{i.f()}e.setScrollButtonVisibility()})).catch((function(){e.loadingSpinner.element.style.display="none",e.setScrollButtonVisibility()}))}},{key:"items",value:function(){return(0,r.Z)((0,d.Z)(h.prototype),"items",this).call(this)}},{key:"show",value:function(){(0,r.Z)((0,d.Z)(h.prototype),"show",this).call(this),this.sibling.showIfNonempty()}},{key:"hide",value:function(){(0,r.Z)((0,d.Z)(h.prototype),"hide",this).call(this),this.sibling.hide()}}]),h}(D),F=function(e){(0,c.Z)(n,e);var t=A(n);function n(){var e;return(0,a.Z)(this,n),(e=t.call(this)).element=(0,k.vz)("div",{style:B(B({},O),{},{backgroundImage:""})},(0,k.vz)("div",{style:B(B({},O),{},{position:"absolute"})},(0,k.vz)(P.I,null))),e}return(0,l.Z)(n)}(b.w),_=function(e){(0,c.Z)(n,e);var t=A(n);function n(e,i){var o,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,a.Z)(this,n),(o=t.call(this,e,i)).autoselect=r,o.selected=!1,o.rejected=!1,e.catch((function(e){if(o.removeElement(),e instanceof g.GM){if(400===e.xhr.status){var t=JSON.parse(e.xhr.responseText).errors;if(void 0!==t&&"invalid_media"===t.media)return void(0,v.Cj)(x.ag.invalidFileErrorUploadingMedia)}(0,v.Cj)(x.ag.errorUploadingMedia)}else"file_too_large"===e&&(0,v.Cj)(x.ag.fileSizeErrorUploadingMedia)})),o.selectedIcon=(0,k.vz)("img",{ref:function(e){return o.selectedIcon=e},src:"".concat(STATIC_URL_ROOT,"tsdefaultassets/mediaDock/selected.svg"),style:{position:"absolute",bottom:0,right:0,zIndex:1,display:"none"}}),o.element.appendChild(o.selectedIcon),o.removeBtn.style.display="none",o}return(0,l.Z)(n,[{key:"onload",value:function(e){var t=this;(0,r.Z)((0,d.Z)(n.prototype),"onload",this).call(this,e),this.removeBtn.style.display="block",this.autoselect&&window.setTimeout((function(){t.select()}),0),this.element.onclick=function(){t.toggleSelect()}}},{key:"toggleSelect",value:function(){this.selected?this.deselect():this.select()}},{key:"select",value:function(){this.selected||(this.selected=!0,this.removeBtn.style.display="none",this.selectedIcon.style.display="block",this.createSibling(),this.parentDock.sibling.addItem(this.sibling),this.parentDock.sibling.show(),this.parentDock.sibling.setScrollButtonVisibility())}},{key:"createSibling",value:function(){void 0===this.sibling&&(this.sibling=new j(this.mediaPromise,this.parentDock.sibling),this.sibling.sibling=this)}},{key:"setSibling",value:function(e){void 0===this.sibling?(this.selected=!0,this.removeBtn.style.display="none",this.selectedIcon.style.display="block",this.sibling=e,this.sibling.sibling=this):error("LibraryMediaDockItem sibling exists")}},{key:"deselect",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.selected=!1,this.removeBtn.style.display="block",this.selectedIcon.style.display="none",t||null===(e=this.sibling)||void 0===e||e.remove(!0)}},{key:"remove",value:function(){var e=this;this.rejected?this.removeElement():(0,v.oB)(x.ag.confirmPhotoDelete,(function(){if(void 0!==e.media){e.loadingSpinner.style.display="block";var t=e.imageContainer.querySelector("img");e.imageContainer.removeChild(t),(0,T.JJ)(e.media.mediaId).then((function(){})).catch((function(){e.loadingSpinner.style.display="none",e.imageContainer.appendChild(t),(0,v.Cj)(x.ag.errorDeletingMedia)}))}else error("Attempting to delete media before it is loaded")}))}},{key:"markRejected",value:function(){this.element.removeChild(this.imageContainer),this.element.onclick=null;var e=(0,k.vz)("div",{style:{whiteSpace:"break-spaces",fontSize:"11px",width:"100%",height:"100%",padding:"2px"},colorClass:"rejected"},x.ag.removedForViolation);this.element.appendChild(e),this.rejected=!0}},{key:"removeElement",value:function(){var e,t=this;(0,r.Z)((0,d.Z)(n.prototype),"removeElement",this).call(this),(0,T.GY)(1,L-1).then((function(e){var i;if(e.length>0){var o=new n(Promise.resolve(e[0]),t.parentDock);t.parentDock.addItem(o,!0)}null===(i=t.parentDock)||void 0===i||i.setScrollButtonVisibility()})),this.loadingSpinner.style.display="none",null===(e=this.parentDock)||void 0===e||e.setScrollButtonVisibility()}}]),n}(U),N=function(e){(0,c.Z)(n,e);var t=A(n);function n(e){var i;return(0,a.Z)(this,n),(i=t.call(this,e)).element.style.boxSizing="border-box",i.element.style.borderTopLeftRadius="4px",i.element.style.borderTopRightRadius="4px",i.element.style.borderBottom="none",i.element.dataset.testid="staged-image-dock",(0,I.vP)(i.element,"SelectedMediaDock"),i}return(0,l.Z)(n,[{key:"addItem",value:function(e){this.dock.addChild(e)}},{key:"getImageById",value:function(e){return(0,r.Z)((0,d.Z)(n.prototype),"getImageById",this).call(this,e)}},{key:"showIfNonempty",value:function(){this.isEmpty()||this.show()}},{key:"hideIfEmpty",value:function(){this.isEmpty()&&this.hide()}},{key:"onHide",value:function(){this.clear()}},{key:"dispose",value:function(){this.listeners.removeAll()}}]),n}(D),j=function(e){(0,c.Z)(n,e);var t=A(n);function n(e,i){return(0,a.Z)(this,n),t.call(this,e,i)}return(0,l.Z)(n,[{key:"remove",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.removeElement(),this.parentDock.setScrollButtonVisibility(),this.parentDock.hideIfEmpty(),t||null===(e=this.sibling)||void 0===e||e.deselect(!0)}},{key:"markRejected",value:function(){this.remove()}}]),n}(U);function H(e,t){var n=(0,k.vz)("div",{style:{position:"absolute",top:"0",left:"0",boxSizing:"border-box",height:"100%",width:"100%",background:"rgba(0,0,0,0.5)",padding:"10px",display:"none",zIndex:1e3}},(0,k.vz)("div",{style:{border:"3px dashed white",padding:"10px",height:"calc(100% - 26px)"}}));e.appendChild(n),(0,m.Zf)(["dragenter","dragover","dragleave","drop"],e,(function(e){e.preventDefault(),e.stopPropagation()})),(0,m.Zf)(["dragenter","dragover"],e,(function(e){e.dataTransfer&&e.dataTransfer.types.includes("Files")&&(n.style.display="block")})),(0,m.Zf)(["dragleave","drop"],n,(function(e){n.style.display="none"})),(0,m.j9)("drop",n,(function(e){var n,i,o=Array.from(null!==(n=null===(i=e.dataTransfer)||void 0===i?void 0:i.files)&&void 0!==n?n:[]);T.zB.fire({toUser:t,files:o})}))}},3871:function(e,t,n){"use strict";n.d(t,{s:function(){return k}});var i,o=n(126),r=n(4649),s=n(7791),a=n(2951),l=n(1976),c=n(824),u=n.n(c),d=n(8759),h=n(1522),f=n(8263),p=n(3543),m=n(47),v=n(8213),g=n(6208),y=n(9809);function b(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return w(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)?w(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:"unknown";if(void 0!==e){var n=a(e);if(o(n))return n.toLowerCase()}return t}function a(e){switch(e){case"Recommended":return"Recommended";case"Recommended_popular":return"Recommended_popular";default:return"unknown"}}function l(e){switch(e){case"recommended":return i.ag.recommendedCAPS;case"recommended_popular":return i.ag.recommendedPopularCAPS;default:return e}}},4189:function(e,t,n){"use strict";n.d(t,{bp:function(){return E},jD:function(){return R},dt:function(){return B},vx:function(){return P}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(7693),u=n(1903),d=n(7585),h=n(6921),f=n(1301),p=n(6422),m=n(3543),v=n(47),g=n(1185),y=n(6698),b=n(8945),w=n(322),C=n(8871);function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(this.element.querySelectorAll("a"));try{for(t.s();!(e=t.n()).done;){var n=e.value;(0,g.vP)(n,g.ql.camSubjectTagColor),(0,c.j9)("click",n,(function(e){C.k4.fire(e)}))}}catch(e){t.e(e)}finally{t.f()}(0,y.Iu)(this.element)}},{key:"createElement",value:function(e){var t=(0,v.vz)("ul",{className:"subject ".concat(g.ql.camSubjectColor)},(0,v.vz)("li",{dangerouslySetInnerHTML:{__html:e.subject}}));return t.title=t.textContent,t}}]),u}(d.I);var S,T=function(e){(0,s.Z)(c,e);var t,n,r=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function c(){return(0,i.Z)(this,c),r.apply(this,arguments)}return(0,o.Z)(c,[{key:"createElement",value:function(e){var t=e.roomInfo.viewers,n=t>-1?m.ag.numViewerOrViewers(t):"",i=""!==n&&""!==e.roomInfo.timeOnline;return(0,v.vz)("div",{className:"details"},(0,v.vz)("div",{className:"cardTitle title"},(0,h.HK)((0,v.vz)("a",{href:"/".concat(e.roomInfo.room,"/"),"data-room":e.roomInfo.room,"data-room-nav":"true","data-testid":"room-card-username"},e.roomInfo.room)),(0,v.vz)("div",{className:"age_gender_container"},(0,v.vz)("span",{className:"age","data-testid":"room-card-age"},e.roomInfo.displayAge),(0,v.vz)("span",{className:"".concat(g.ql.camAltTextColor," ").concat(c.getGenderClassName(e.roomInfo.gender)),title:m.ag.genderSymbolToIconTitle(e.roomInfo.gender),"data-testid":"room-card-gender"}))),(0,v.vz)(k,{subject:e.roomInfo.subject}),(0,v.vz)("ul",{className:"sub-info ".concat(g.ql.camAltTextColor)},void 0!==e.roomInfo.location?(0,v.vz)("li",{className:"location",style:c.subInfoItemStyle,"data-testid":"room-card-location"},e.roomInfo.location):"",(0,v.vz)("li",{className:"cams ".concat(i?"":"no-viewers"),style:c.subInfoItemStyle},(0,v.vz)("span",{className:"time".concat(-1===e.roomInfo.viewers?" time-since":"")},e.roomInfo.timeOnline),(0,v.vz)("span",{className:"comma"},i?", ":""),(0,v.vz)("span",{className:"viewers"},n))))}}],[{key:"getGenderClassName",value:function(e){return e.includes("t")?"genders":"gender".concat(e)}}]),c}(d.I);function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,a.Z)(this,n)}}function P(e){var t=function(e,t){var n=e.getNumber(t,!1);return isNaN(n)?-1:n},n=e.getString("label",!1),i=e.getNumberOrUndefined("start_timestamp",!1);return{room:e.getString("room",!1)||e.getString("username",!1),label:n,img:e.getString("img"),gender:e.getString("gender"),subject:e.getString("subject",!1)||e.getString("room_subject",!1),timeOnline:(0,u.J7)("offline"===n,0===i?void 0:i),viewers:Math.max(t(e,"viewers"),t(e,"num_users")),location:e.getStringOrUndefined("location"),displayAge:e.getStringWithNumbers("display_age",!1)||e.getStringWithNumbers("age",!1),isFollowing:e.getBoolean("is_following",!1,!1),sourceName:(0,y.AY)(e.getStringOrUndefined("source_name")),sourcePosition:e.getNumberOrUndefined("source_position"),sourceInfo:e.getStringOrUndefined("source_info"),startTimestamp:i}}T.subInfoItemStyle={whiteSpace:"nowrap"};var R=function(e){(0,s.Z)(n,e);var t=I(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"initUI",value:function(e){var t=this;this.props=e,this.setImageStreamer(),(0,c.Zf)(["click","mousedown","touchstart"],this.element,(function(e){t.fireBeforeRoomClick(e)}))}},{key:"fireBeforeRoomClick",value:function(e){e.target instanceof HTMLElement&&null!==e.target.getAttribute("data-room-nav")&&this.props.roomList.roomBeforeClickEvent.fire({index:this.props.roomIndex,roomInfo:this.props.roomInfo,event:e})}},{key:"fireRoomClick",value:function(e){e.target instanceof HTMLElement&&null!==e.target.getAttribute("data-room-nav")&&this.props.roomList.roomClickEvent.fire({index:this.props.roomIndex,roomInfo:this.props.roomInfo,event:e})}},{key:"onRoomClick",value:function(e){var t=this;this.element.querySelector("a[".concat(f.rt,"]"))?p.ly.listen((function(){return t.fireRoomClick(e)})):this.fireRoomClick(e)}},{key:"createElement",value:function(e){var t=this,i=(0,w.yE)(e.roomInfo.sourceInfo,e.roomInfo.label);return(0,v.vz)("li",{className:"roomCard ".concat(g.ql.camBgColor),"data-testid":"room-card",style:n.roomStyle,onClick:function(e){return t.onRoomClick(e)}},(0,h.HK)((0,v.vz)("a",{href:"/".concat(e.roomInfo.room,"/"),"data-room-nav":"true","data-room":e.roomInfo.room},(0,v.vz)("img",{width:180,height:101,src:e.roomInfo.img,loading:"lazy",alt:e.roomInfo.room,"data-room-nav":"true",ref:function(e){t.img=e},className:"room_thumbnail"}))),(0,v.vz)(M,{roomLabel:i}),(0,v.vz)(T,{roomInfo:e.roomInfo}),this.createFollowStar(e))}},{key:"createFollowStar",value:function(e){var t=this;return(0,v.vz)(b.X,{slug:e.roomInfo.room,isFollowing:e.roomInfo.isFollowing,classRef:function(e){return t.followStar=e}})}},{key:"setImageStreamer",value:function(){var e=this;(0,c.j9)("mouseenter",this.element,(function(){(0,y.fr)()&&(e.img.removeAttribute("loading"),(0,y._M)(e.props.roomInfo.room,e.img))})),(0,c.j9)("mouseleave",this.element,(function(){(0,y.fr)()&&(0,y.E9)(e.props.roomInfo.room)}))}},{key:"afterRemovedFromParent",value:function(){(0,y.fr)()&&void 0!==this.props&&(0,y.E9)(this.props.roomInfo.room),(0,r.Z)((0,l.Z)(n.prototype),"afterRemovedFromParent",this).call(this)}},{key:"getRoomName",value:function(){return this.props.roomInfo.room}},{key:"updateFollowStar",value:function(e){var t;null===(t=this.followStar)||void 0===t||t.setFollowing(e)}}]),n}(d.I);(S=R).labelTextMap={promoted:m.ag.promotedCAPS,recommended:m.ag.recommendedCAPS,recommended_popular:m.ag.recommendedPopularCAPS,offline:m.ag.offlineCAPS,exhib:m.ag.exhibitionistCAPS,new:m.ag.newCAPS,private:m.ag.inPrivateCAPS,gaming:m.ag.gamingCAPS},S.labelClassMap={promoted:"thumbnail_label thumbnail_label_c_promoted",offline:"thumbnail_label thumbnail_label_offline",exhib:"thumbnail_label thumbnail_label_exhibitionist",new:"thumbnail_label thumbnail_label_c_new",private:"thumbnail_label_featured thumbnail_label_c_private_show",gaming:"thumbnail_label thumbnail_label_c_gaming",recommended:"thumbnail_label thumbnail_label_c thumbnail_label_recommender",recommended_popular:"thumbnail_label thumbnail_label_c thumbnail_label_recommender"},S.roomStyle={margin:"0 7px 7px 0"};var M=function(e){var t,n;return(0,v.vz)("div",{className:null!==(t=R.labelClassMap[e.roomLabel])&&void 0!==t?t:"thumbnail_label","data-testid":"thumbnail-label"},null!==(n=R.labelTextMap[e.roomLabel])&&void 0!==n?n:"")},A=function(e){(0,s.Z)(n,e);var t=I(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"initUI",value:function(e){}},{key:"createElement",value:function(e){return(0,v.vz)("li",{className:"roomCard placeholder ".concat(g.ql.camBgColor),style:R.roomStyle},(0,v.vz)("a",null,(0,v.vz)("div",{className:"room_thumbnail"})),(0,v.vz)("div",{className:"details"},(0,v.vz)("div",{className:"title"}," "),(0,v.vz)("div",{className:"subject"}," "),(0,v.vz)("div",{className:"sub-info"}," ")))}}]),n}(R),E={roomList:{},roomIndex:0,roomInfo:{},animate:!1},B=function(){return new A(E)}},9808:function(e,t,n){"use strict";n.d(t,{P:function(){return x},x:function(){return k}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(7654),u=n(7693),d=n(3753),h=n(391),f=n(7585),p=n(1794),m=n(3340),v=n(4043),g=n(9545),y=n(47),b=n(949),w=n(2800),C=n(6698);var x=function(e){(0,s.Z)(x,e);var t,n,f=(t=x,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function x(e){var t;return(0,i.Z)(this,x),(t=f.call(this,e)).rooms=[],t.bindCachedFollowStarFix(),t}return(0,o.Z)(x,[{key:"createElement",value:function(){return(0,y.vz)("ul",{className:"list"})}},{key:"initData",value:function(e){this.listeners=new p.mM}},{key:"initUI",value:function(e){var t=this;(0,r.Z)((0,l.Z)(x.prototype),"initUI",this).call(this,e),this.roomListProps=e,this.roomClickEvent=new p.xB("roomClick"),this.listeners.add(this.roomClickEvent.listen((function(e){var t=e.event;t.ctrlKey||t.metaKey||t.shiftKey||(w.J.current.isMobile?v.WP.fire(e.roomInfo.room):(e.event.preventDefault(),m.WP.fire(e.roomInfo.room)))}))),this.roomBeforeClickEvent=new p.xB("roomBeforeClick"),this.listeners.add(this.roomBeforeClickEvent.listen((function(n){t.saveRoomListSourceCookie(n,e)}))),this.updateShowLocation(e.showLocation),this.listeners.add(b.J.listen((function(e){return t.updateShowLocation(e)})))}},{key:"bindCachedFollowStarFix",value:function(){var e=this;(0,u.ER)("pageshow",window,(function(){e.updateFollowStars()}))}},{key:"saveRoomListSourceCookie",value:function(e,t){var n="un"===e.roomInfo.sourceName?t.roomListSource:e.roomInfo.sourceName;(0,C.bc)(e.roomInfo.room,n,e.index,this.getOptionalSourceInfo(e,t))}},{key:"getOptionalSourceInfo",value:function(e,t){return{sourceIndex:void 0===t.sourceIndex?e.roomInfo.sourcePosition:t.sourceIndex(e),hashtag:void 0===t.hashtag?void 0:t.hashtag(e),sourceInfo:void 0===t.sourceInfo?void 0:t.sourceInfo(e)}}},{key:"updateState",value:function(){(0,r.Z)((0,l.Z)(x.prototype),"updateState",this).call(this),this.resetRooms()}},{key:"resetRooms",value:function(){var e=this;this.removeAllChildren(),this.rooms=[];var t=this.roomListProps.rooms(),n=!1;t.forEach((function(t,i){e.appendRoomCard(i+1,t),n=n||void 0!==t.location})),k(this.element,n&&this.showLocation)}},{key:"appendRoomCard",value:function(e,t){var n=this.createRoomCard({roomList:this,roomIndex:e,roomInfo:t,animate:(0,C.fr)()});this.rooms.push(n),this.addChild(n)}},{key:"updateShowLocation",value:function(e){this.showLocation=e,k(this.element,e)}},{key:"updateFollowStars",value:function(){var e=this;if(void 0!==w.J.current.loggedInUser&&!(0,c.RT)()&&0!==this.rooms.length){var t=this.rooms.map((function(e){return e.getRoomName()})),n="api/ts/follow/followed_usernames/?usernames=".concat(encodeURIComponent(t.join(",")));(0,d.Ue)(n).then((function(t){var n=new h.j(t.responseText).getStringList("followed_usernames"),i=new Set(n);e.rooms.forEach((function(e){e.updateFollowStar(i.has(e.getRoomName()))}))})).catch(g.Gr)}}},{key:"dispose",value:function(){this.listeners.removeAll()}}]),x}(f.I);function k(e,t){t?e.classList.add("show-location"):e.classList.remove("show-location")}},3515:function(e,t,n){"use strict";n.d(t,{G:function(){return g},x:function(){return v}});var i=n(126),o=n(5809),r=n(2951),s=n(1976),a=n(7591),l=n(9492),c=n(7597),u=n(7654),d=n(7585),h=n(1794),f=n(3543),p=n(47),m=n(9395);var v=new h.xB("updateNoResultsMessage"),g=function(e){(0,a.Z)(g,e);var t,n,d=(t=g,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function g(){return(0,r.Z)(this,g),d.apply(this,arguments)}return(0,s.Z)(g,[{key:"createElement",value:function(){return(0,p.vz)("div",{className:"searching-keyword"})}},{key:"initData",value:function(e){this.listeners=new h.mM}},{key:"initUI",value:function(){var e=this;this.updateMessage(),this.listeners.add(m.Mj.onSubmit.listen((function(t){e.updateMessage(t)}))),this.listeners.add(v.listen((function(t){0!==t.length&&e.updateNoSearchResultsMessage(t)})))}},{key:"updateMessage",value:function(e){var t=(0,u.SW)(),n=(0,u.Zv)(e),r=(0,o.Z)(n,2),s=r[0],a=r[1];if(0===s.length&&0===a.length)this.removeAllDOMChildren();else{var l=a.map((function(e){return"#".concat(e)}));Boolean(t)&&l.push("#".concat(t));var c=[].concat((0,i.Z)(s),(0,i.Z)(l)).join(" ");this.removeAllDOMChildren(),this.element.appendChild((0,p.vz)("p",null,f.ag.searchResultsFor(c)))}}},{key:"updateNoSearchResultsMessage",value:function(e){var t=document.querySelector(".endless_page_template .no-rooms-available");null!==t&&(t.textContent=this.constructNoResultsMessage(e))}},{key:"constructNoResultsMessage",value:function(e){var t=(0,u.SW)(),n=(0,u.Zv)(e),r=(0,o.Z)(n,2),s=r[0],a=r[1].map((function(e){return"#".concat(e)}));Boolean(t)&&a.push("#".concat(t));var l=[].concat((0,i.Z)(s),(0,i.Z)(a)).join(" ");return f.ag.noSearchResultsMatch(l)}},{key:"dispose",value:function(){this.listeners.removeAll()}}]),g}(d.I)},8871:function(e,t,n){"use strict";n.d(t,{$n:function(){return d},Ek:function(){return m},M4:function(){return p},Me:function(){return h},e2:function(){return g},k4:function(){return f},qh:function(){return y}});var i=n(7654),o=n(6767),r=n(1794),s=n(9165),a=n(8978),l=n(3543),c=n(2800),u=n(1612);function d(){var e=[],t=(0,i.SW)(),n=(0,s.ej)(),o=u.w.siteName;return void 0!==t&&e.push(l.ag.roomlistPageTitleHashtag((0,a.Qs)(t),o)),n===s.Y0.Female?e.push(l.ag.roomlistPageTitleFemale(o)):n===s.Y0.Male?e.push(l.ag.roomlistPageTitleMale(o)):n===s.Y0.Couple?e.push(l.ag.roomlistPageTitleCouple(o)):n===s.Y0.Trans||n===s.Y0.OldTrans?e.push(l.ag.roomlistPageTitleTrans(o)):void 0!==t||(0,i.I5)()||e.push(l.ag.roomlistPageTitleDefault(o)),(0,i.I5)()&&e.push(l.ag.roomlistPageTitlePremium(o)),e.join(" ")}var h=new r.xB("genderFilterUpdateFromNav"),f=new r.xB("spaNavigation"),p=new r.xB("newSpaLoad"),m="data-roomlist-spa-nav",v="jnoldsms";function g(){(0,o.Uj)(v,"1")}function y(e){return!(void 0!==e&&(e.classList.contains("nooverlay")||e.classList.contains("purchase_tokens")||"#"===e.getAttribute("href"))||void 0!==c.J.current.loggedInUser||"1"===(0,o.sv)(v))}},6079:function(e,t,n){"use strict";n.d(t,{M:function(){return Y},D:function(){return ee}});var i=n(3243),o=n(2951),r=n(1976),s=n(7591),a=n(9492),l=n(7597),c=n(8759),u=n(7693),d=n(1522),h=n(3753),f=n(391),p=n(4406),m=n(6464),v=n(1090),g=n(2008),y=n(9),b=n(5392),w=n(1794),C=n(5726),x=n(3705),k=n(710),S=n(6893),T=n(928),I=n(9584),P=n(5190),R=n(758),M=n(3543),A=n(2750),E=n(7906),B=n(1185),O=n(2800),L=n(8016),D=[];function U(e){if(!D.some((function(t){return t.getUserUid()===e}))){var t=new L.Xv(e);t.enterPresence(),D.push(t)}}function Z(e){void 0!==e?D=D.filter((function(t){return t.getUserUid()!==e||(t.leavePresence(),!1)})):(D.forEach((function(e){e.leavePresence()})),D=[])}var F=n(7376),_=n(9760),N=n(7397),j=n(1994),H=n(6547);function z(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return W(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)?W(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n5||Math.abs(d)>5)&&(u=!0,e.forEachPlayer((function(e,t){t.setDragging(!0)}))),a=e.getCorrectedBottom(r-d),s=e.getCorrectedRight(o-i),e.element.style.bottom="".concat(a,"px"),e.element.style.right="".concat(s,"px"),e.forEachPlayer((function(e,t){t.positionChanged()}))},end:function(){e.right=s,e.bottom=a,e.cachedBottom=a,e.saveSettingsLocalstorage(),u=!1,window.setTimeout((function(){e.forEachPlayer((function(e,t){t.setDragging(!1)}))}),100)}}}))}},{key:"addResize",value:function(){var e=this;(0,F.$)(this.element,(function(t){return function(n,i,o){n.stopPropagation();var r={initialBottom:e.bottom,initialRight:e.right,initialWidth:e.width,initialX:i,initialY:o,minWidth:200,ratio:q},s=e.right,a=e.bottom,l=e.width;return{enabled:!0,move:function(n,i){var o=(0,F.G)(r,n,i,t),c=[o.right,o.bottom,o.width];s=c[0],a=c[1],l=c[2],s=e.getCorrectedRight(s,l),e.element.style.right="".concat(s,"px"),e.element.style.width="".concat(l,"px"),e.forEachPlayer((function(e,t){t.updateHeight()}));var u=e.element.offsetHeight;a=e.getCorrectedBottom(a,u),e.element.style.bottom="".concat(a,"px"),e.forEachPlayer((function(e,t){t.positionChanged()}))},end:function(){e.bottom=a,e.cachedBottom=a,e.right=s,e.width=l,e.height=e.element.getBoundingClientRect().height,e.saveSettingsLocalstorage()}}}}))}},{key:"getCorrectedBottom",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.height;return Math.max(0,Math.min(window.innerHeight-t,e))}},{key:"getCorrectedRight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.width;return Math.max(0,Math.min(window.innerWidth-t,e))}},{key:"recalcPosition",value:function(){var e=(0,j.p)();this.bottom=e>0?Math.max(this.cachedBottom,e+4):this.cachedBottom,this.element.style.bottom="".concat(this.getCorrectedBottom(this.bottom),"px"),this.element.style.right="".concat(this.getCorrectedRight(this.right),"px")}},{key:"getSettingsLocalstorage",value:function(){if((0,c.IU)()){var e=window.localStorage.getItem(K);if(null!==e){var t=JSON.parse(e);this.bottom=t.bottom,this.cachedBottom=t.bottom,this.right=t.right,this.width=t.width}}}},{key:"saveSettingsLocalstorage",value:function(){if((0,c.IU)()){var e={bottom:this.bottom,right:this.right,width:this.width};window.localStorage.setItem(K,JSON.stringify(e))}}},{key:"startViewingCam",value:function(e){var t=this;return this.unsetNoticeRateLimit(e),this.numCams>=5?((0,d.Cj)(M.ag.showMyCamTooManyCams),(0,x.fg)("SharedCamViewStartFailed",{cam_user:e}),void(0,x.fg)("SharedCamViewStartTooManyCams",{cam_user:e})):2===this.getCamState(e)?(error("smcBroadcaster - no such cam"),void(0,x.fg)("SharedCamViewStartFailed",{cam_user:e})):void(0,H.cr)(e).then((function(n){n?(0,T.ss)(e).then((function(n){var i=t.cams.get(e);if(void 0===i||void 0===i.player){t.element.style.display="table";var o=new $(n,t.roomChatConn,t.dummyRoomStatusNotifier);t.playerContainer.appendChild(o.element),o.updateHeight(),o.startViewing(),t.numCams+=1,t.height=t.element.getBoundingClientRect().height,t.recalcPosition(),(0,x.fg)("SharedCamViewStarted",{cam_user:e,num_cams_open:t.numCams}),t.setCamState(e,1,o);var r=window.setTimeout((function(){var n=t.cams.get(e);void 0!==(null==n?void 0:n.player)&&t.stopViewingCam(e),s.removeListener(),(0,x.fg)("SharedCamViewStartFailed",{cam_user:e})}),1e3*(S.g1-1)),s=o.playerComponent.playbackStart.once((function(){var i=t.cams.get(e);if(void 0!==i&&o===i.player){var s;t.setCamState(e,0,o),U(n.roomUid),null===(s=t.viewCamFailedListeners.get(e))||void 0===s||s.removeListener();var a=new L.Xv(n.roomUid).onAuthFail.listen((function(){0===t.getCamState(e)&&(t.stopViewingCam(e),(0,d.Cj)(M.ag.showMyCamCouldNotView))}));t.viewCamFailedListeners.set(e,a),clearTimeout(r)}})),a=o.playerComponent.videoOfflineChange.listen((function(n){n&&(t.stopViewingCam(e),a.removeListener())}))}})).catch((function(){})):(t.setCamState(e,2),(0,d.Cj)(M.ag.showMyCamCamOffline),(0,x.fg)("SharedCamViewStartFailed",{cam_user:e}))})).catch((function(){}))}},{key:"stopViewingCam",value:function(e){var t,n=this;null===(t=this.viewCamFailedListeners.get(e))||void 0===t||t.removeListener();var i=this.getCamState(e),o=this.cams.get(e);if((0,P.s6)(!1,1),void 0!==o&&void 0!==o.player){o.player.stopViewing(),this.setCamState(e,1);var r=o.player;void 0!==o.player.reportMenu?o.player.reportMenu.closeChatReportRequest.once((function(){n.cleanUpCam(e,r)})):this.cleanUpCam(e,r)}else warn("stopViewingCam no player for cam",{camUser:e,state:i})}},{key:"cleanUpCam",value:function(e,t){t.element.style.height="0",t.element.style.width="0",this.numCams-=1,this.height=this.element.getBoundingClientRect().height,this.recalcPosition(),0===this.numCams&&(this.element.style.display="none"),(0,x.fg)("SharedCamPlayerRemoved",{cam_user:e,num_cams_open:this.numCams})}},{key:"forEachPlayer",value:function(e){var t,n=z(this.cams.keys());try{for(n.s();!(t=n.n()).done;){var i=t.value,o=this.cams.get(i);void 0!==o&&void 0!==o.player&&e(i,o.player)}}catch(e){n.e(e)}finally{n.f()}}},{key:"stopAllCams",value:function(){var e=this;this.forEachPlayer((function(t,n){e.stopViewingCam(t)}))}},{key:"endAllCamsExcept",value:function(e){var t,n=z(this.cams.keys());try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i!==e){var o=this.cams.get(i);void 0!==o&&void 0!==o.player&&this.stopViewingCam(i),this.setCamState(i,2)}}}catch(e){n.e(e)}finally{n.f()}}},{key:"monitorInactive",value:function(){var e,t=this,n=z(this.cams.keys());try{var i=function(){var n=e.value;2!==t.getCamState(n)&&(0,H.cr)(n).then((function(e){if(!e){var i=t.cams.get(n);void 0!==(null==i?void 0:i.player)&&t.stopViewingCam(n),t.setCamState(n,2)}})).catch((function(){}))};for(n.s();!(e=n.n()).done;)i()}catch(e){n.e(e)}finally{n.f()}}},{key:"getCamState",value:function(e){var t=this.cams.get(e);return void 0!==t?t.state:2}},{key:"setCamState",value:function(e,t,n){var i=this.camUserInfos.get(e),o=this.getCamState(e);switch(t){case 2:this.cams.delete(e),this.camUserInfos.delete(e),2!==o&&(0,x.fg)("SharedCamViewerBroadcastStopped",{cam_user:e,num_cams_total:this.cams.size});break;case 1:this.cams.set(e,{state:1,player:n}),2===o&&(0,x.fg)("SharedCamViewerBroadcastStarted",{cam_user:e,num_cams_total:this.cams.size});break;case 0:void 0!==n?this.cams.set(e,{state:0,player:n}):error("smcBroadcaster - no player provided for active cam")}this.updateChatBadges(e),void 0!==i&&this.sendChatNoticeForStateChange(i,o,t)}},{key:"sendChatNoticeForStateChange",value:function(e,t,n){var i;if(t!==n&&(2===t&&2!==n&&(i=this.getCamStartNotice(e.username)),void 0!==i)){var o=(0,C.Ng)(this.roomChatConn.room(),e);this.roomChatConn.event.roomNotice.fire({messages:[[(0,v.vK)("User "===o?M.ag.showMyCamSharingPrefix:o),(0,v.iL)(e),(0,v.vK)(i)]],showInPrivateMessage:!1})}}},{key:"getCamStartNotice",value:function(e){var t=this.noticeRateLimits.get(e);if(!0!==(null==t?void 0:t.preventStartNotice))return this.setNoticeRateLimit(e),M.ag.showMyCamStartedSharing}},{key:"setNoticeRateLimit",value:function(e){var t,n,i=this;switch(this.noticeRateLimitSetting){case"0":t=!1;break;case"300":t=!0,n=window.setTimeout((function(){return i.unsetNoticeRateLimit(e)}),3e5);break;case"-1":t=!0;break;default:error("smcBroadcaster - invalid rate limit setting",this.noticeRateLimitSetting),t=!1}this.noticeRateLimits.set(e,{preventStartNotice:t,timeout:n})}},{key:"unsetNoticeRateLimit",value:function(e){var t=this.noticeRateLimits.get(e);void 0!==t?(window.clearTimeout(t.timeout),this.noticeRateLimits.set(e,{preventStartNotice:!1})):error("smcBroadcaster - no notice rate limit to unset")}},{key:"getContextMenuLinkInfo",value:function(e){var t=this,n=this.getCamState(e);if(2===n)return{linkText:"",icon:"",action:function(){}};var i,o,r,s=this.cams.get(e);return o="".concat(STATIC_URL_ROOT,1===n?"broadcastassets/inactive-cam.svg":"broadcastassets/active-cam.svg"),void 0!==s&&void 0!==s.player?(i=M.ag.showMyCamStopView,r=function(){(0,x.fg)("SharedCamViewStopClicked",{cam_user:e}),t.stopViewingCam(e)}):(i=M.ag.showMyCamView,r=function(){(0,x.fg)("SharedCamViewStartClicked",{cam_user:e}),t.startViewingCam(e)}),{linkText:i,icon:o,action:r}}},{key:"createChatBadge",value:function(e){var t=this.getCamState(e),n=document.createElement("img");return n.style.marginRight=".2em",n.style.height="1.2em",n.style.position="relative",n.title=M.ag.sharingCam,2===t?n.style.display="none":n.src="".concat(STATIC_URL_ROOT,1===t?"broadcastassets/inactive-cam.svg":"broadcastassets/active-cam.svg"),n}},{key:"updateChatBadges",value:function(e){var t=this.getCamState(e),n=p.x.getBadgeElements("smcBadge",e),i="";1===t?i="".concat(STATIC_URL_ROOT,"broadcastassets/inactive-cam.svg"):0===t&&(i="".concat(STATIC_URL_ROOT,"broadcastassets/active-cam.svg"));for(var o=n.length-1;o>=0;o-=1){var r=n[o];r.src=i,r.style.display=""!==i?"":"none"}}}],[{key:"getOrCreateInstance",value:function(e){return void 0===n.singletonInstance&&(n.singletonInstance=new n(e)),n.singletonInstance}},{key:"getInstance",value:function(){return n.singletonInstance}}]),n}(y.w),$=function(e){(0,s.Z)(n,e);var t=V(n);function n(e,i,r){var s;(0,o.Z)(this,n),(s=t.call(this,!0,r)).camDossier=e,s.roomChatConn=i,s.dragging=!1,s.hideAllTooltips=new w.xB("hideAllTooltips"),s.blockMouseEvent=function(e){e.stopPropagation()},s.watermark.style.visibility="hidden",s.element.style.position="relative",s.element.style.width="100%",s.element.style.minWidth="".concat(200,"px"),s.element.style.backgroundColor="#000",s.element.style.border="1px solid #FFF",s.element.style.marginTop="-1px",s.element.style.overflow="visible",(0,u.j9)("mouseenter",s.element,(function(e){s.controls.style.display="block"})),(0,u.j9)("mouseleave",s.element,(function(e){s.controlsFrozen||(s.controls.style.display="none")}));var a=0;return(0,u.j9)("touchstart",s.element,(function(e){"none"===s.controls.style.display?(s.controls.style.display="block",a=1):a+=1})),(0,u.j9)("touchend",s.element,(function(e){window.setTimeout((function(){(a>1||s.dragging)&&!s.controlsFrozen&&(s.controls.style.display="none")}),0)})),(0,u.j9)("touchstart",document,(function(e){s.element.contains(e.target)||s.controlsFrozen||(s.controls.style.display="none")})),s.username=e.room,s.element.appendChild(s.createUsernameBar()),s.element.appendChild(s.createControls()),s.element.appendChild(s.createReportDiv()),s}return(0,r.Z)(n,[{key:"startViewing",value:function(){this.chatConn=new m.E(this.camDossier),this.playerComponent.handleRoomLoaded({dossier:this.camDossier,chatConnection:this.chatConn})}},{key:"stopViewing",value:function(){var e,t=this;this.playerComponent.stop(),void 0===this.popoutWindow||this.popoutWindow.closed||this.popoutWindow.close(),this.chatConn.leaveRoom(),Z(this.camDossier.roomUid),void 0!==this.reportMenu?(null!==(null===(e=this.usernameBar)||void 0===e?void 0:e.firstChild)&&(this.usernameBar.firstChild.textContent+=" ".concat(M.ag.showMyCamConnectionClosed)),this.reportMenu.closeChatReportRequest.once((function(){t.attemptRemoveFromDom()}))):this.attemptRemoveFromDom()}},{key:"setDragging",value:function(e){this.dragging=e}},{key:"reportCam",value:function(){var e=this,t=new Q(this,this.username,this.roomChatConn);t.closeChatReportRequest.listen((function(t){void 0!==e.reportMenu&&(e.reportDiv.removeChild(e.reportMenu.element),e.reportMenu.tearDown(),e.reportMenu=void 0),t?((0,x.fg)("SharedCamReportSent",{cam_user:e.username}),e.attemptRemoveFromDom()):(e.reportDiv.style.display="none",e.controls.style.display="none",e.hideAllTooltips.fire(!0),e.freezeControls(!1))})),this.freezeControls(!0),this.reportDiv.appendChild(t.element),this.reportMenu=t,this.reportDiv.style.display="block",this.reportMenu.focusForm()}},{key:"freezeControls",value:function(e){this.controlsFrozen=e,e?((0,u.j9)("mouseenter",this.element,this.blockMouseEvent,!0),(0,u.j9)("mouseleave",this.element,this.blockMouseEvent,!0)):((0,u.SC)("mouseenter",this.element,this.blockMouseEvent,!0),(0,u.SC)("mouseleave",this.element,this.blockMouseEvent,!0))}},{key:"popoutCam",value:function(){var e=this;if(void 0===this.popoutWindow||this.popoutWindow.closed){var t=(screen.width/2-425).toString(),n=(screen.height/2-384).toString(),i="resizable,dependent,scrollbars,height=".concat(768,",width=").concat(850,",top=").concat(n,",left=").concat(t);(0,A.MY)("/popout/".concat(this.username),"_blank",i).then((function(t){e.popoutWindow=t})).catch((function(){}))}else this.popoutWindow.focus()}},{key:"attemptRemoveFromDom",value:function(){null!==this.element.parentElement&&this.element.parentElement.removeChild(this.element)}},{key:"createUsernameBar",value:function(){var e=document.createElement("div");e.style.position="absolute",e.style.bottom="0px",e.style.width="100%",e.style.height="auto",e.style.minHeight="20px",e.style.maxHeight="40px",e.style.color="#FFF",e.style.backgroundColor="rgba(0, 0, 0, 0.4)",e.style.zIndex="".concat(H.AR);var t=document.createElement("span");return t.style.zIndex="".concat(H.AR),t.textContent=this.username,t.style.fontFamily="UbuntuRegular",t.style.fontSize="12px",t.style.color="#EEE",t.style.position="relative",t.style.left="5px",t.style.bottom="-3px",e.appendChild(t),this.usernameBar=e,e}},{key:"createControls",value:function(){var e=this,t=(0,H.kK)(),n=(0,H.vx)({iconAsset:"broadcastassets/close.svg",tooltipText:M.ag.showMyCamCloseCam,iconSize:23,centerTop:"50%",onClick:function(){e.controlsFrozen||e.dragging||((0,x.fg)("SharedCamViewStopClicked",{cam_user:e.username}),J.fire(e))},hideAllTooltips:this.hideAllTooltips});n.style.left="50%",n.style.transform="translateX(-50%) translateX(-50px)",t.appendChild(n);var i=(0,H.vx)({iconAsset:"tsdefaultassets/smc_popout.svg",tooltipText:M.ag.showMyCamPopoutCam,iconSize:23,centerTop:"50%",onClick:function(){e.controlsFrozen||e.dragging||e.popoutCam()},hideAllTooltips:this.hideAllTooltips});i.style.left="50%",i.style.transform="translateX(-50%)",t.appendChild(i);var o=(0,H.vx)({iconAsset:"broadcastassets/report.svg",tooltipText:M.ag.showMyCamReportCam,iconSize:23,centerTop:"50%",onClick:function(){e.controlsFrozen||e.dragging||e.reportCam()},hideAllTooltips:this.hideAllTooltips});return o.style.left="50%",o.style.transform="translateX(-50%) translateX(50px)",t.appendChild(o),this.controls=t,t}},{key:"createReportDiv",value:function(){var e=document.createElement("div");return(0,B.vP)(e,"reportDiv"),e.style.width="207px",e.style.borderWidth="1px",e.style.borderStyle="solid",e.style.position="absolute",e.style.transform="translate(-100%, -100%) translateX(-5px)",e.style.borderRadius="4px",e.style.display="none",e.style.zIndex="999",e.style.fontWeight="normal",e.style.fontSize="12px",e.onmouseenter=function(){e.style.cursor="default"},this.reportDiv=e,e}},{key:"updateHeight",value:function(){this.element.style.height="".concat(this.element.offsetWidth*q,"px")}},{key:"positionChanged",value:function(){this.element.getBoundingClientRect().left-this.reportDiv.offsetWidth<0?this.reportDiv.style.transform="translateY(-100%) translateX(".concat(this.element.offsetWidth+5,"px)"):this.reportDiv.style.transform="translate(-100%, -100%) translateX(-5px)"}}]),n}(k.r),Q=function(e){(0,s.Z)(n,e);var t=V(n);function n(e,i,r){var s;return(0,o.Z)(this,n),(s=t.call(this,i,void 0,r)).cam=e,s.username=i,s.chatConnection=r,(0,u.j9)("touchstart",s.element,(function(e){e.stopPropagation()})),(0,u.j9)("mousedown",s.element,(function(e){e.stopPropagation()})),s}return(0,r.Z)(n,[{key:"categories",value:function(){return{public:M.ag.showMyCamReportPublic,rude:M.ag.showMyCamReportRude,intoxicated:M.ag.showMyCamReportIntoxicated,sleeping:M.ag.showMyCamReportSleeping,spam:M.ag.showMyCamReportSpamming,underage:M.ag.showMyCamReportUnderage,other:M.ag.reportMessageOther}}},{key:"reportEndpoint",value:function(){return"abuse/report/".concat(this.username,"/")}},{key:"additionalFinishReportLinks",value:function(){var e=this,t=this.chatConnection.room(),n=document.createElement("button"),i=document.createElement("button");return(0,B.vP)(n,B.ql.hrefColor),(0,B.vP)(i,B.ql.hrefColor),n.textContent=M.ag.silenceDurationMessage,i.textContent=M.ag.kickBan,i.dataset.testid="kick-ban",n.onclick=function(i){i.preventDefault(),(0,h.I5)("roomsilence/".concat(e.username,"/").concat(t,"/"),{}).catch((function(n){error("smcBroadcaster Unable to silence user",{room:t,username:e.username,reason:n.toString()}),(0,d.Cj)("Error silencing user ".concat(e.username))})),n.style.color="",n.style.cursor="",n.onclick=function(){}},i.onclick=function(o){o.preventDefault(),(0,h.I5)("roomban/".concat(e.username,"/").concat(e.chatConnection.room(),"/"),{}).catch((function(n){error("smcBroadcaster Unable to ban user",{room:t,username:e.username,reason:n.toString()}),(0,d.Cj)(M.ag.banUserError(e.username))})),n.style.color="",n.style.cursor="",n.onclick=function(){},i.style.color="",i.style.cursor="",i.onclick=function(){}},[n,i]}},{key:"onChatReportClosed",value:function(e){(0,i.Z)((0,l.Z)(n.prototype),"onChatReportClosed",this).call(this,e),e&&J.fire(this.cam)}}]),n}(g.P),X=!1;function ee(e,t){var n;X||(X=!0,""!==e.roomUid&&new L.Xv(e.roomUid).onAuthFail.listen((function(){t.stop(),(0,d.Cj)(M.ag.showMyCamCouldNotView),Z(e.roomUid)})),!0===(null===(n=O.J.current)||void 0===n||null===(n=n.loggedInUser)||void 0===n?void 0:n.isBroadcasting)&&(Z(),(0,h.Ue)("api/ts/chat/share-my-cam/").then((function(t){var n=new f.j(t.responseText).getList("shared_rooms");if(void 0!==n){var i,o=z(n);try{for(o.s();!(i=o.n()).done;)i.value.getString("username")===e.room&&U(e.roomUid)}catch(e){o.e(e)}finally{o.f()}}})).catch((function(){}))))}},6547:function(e,t,n){"use strict";n.d(t,{AR:function(){return r},Iu:function(){return c},bG:function(){return u},cr:function(){return l},kK:function(){return s},pb:function(){return d},vx:function(){return a}});var i=n(7693),o=n(3753),r=1003;function s(){var e=document.createElement("div");return e.style.position="absolute",e.style.width="100%",e.style.height="100%",e.style.top="0px",e.style.left="0px",e.style.display="none",e.style.zIndex="".concat(r+1),e.style.backgroundColor="rgba(0, 0, 0, .3)",e.style.boxShadow="0px 0px 4px rgba(0, 0, 0, 0.5)",e}function a(e){var t=Math.floor(e.iconSize/2),n=document.createElement("div");n.style.display="inline-block",n.style.position="absolute",n.style.width=n.style.height="".concat(e.iconSize,"px"),n.style.top="calc(".concat(e.centerTop," - ").concat(t,"px)");var o=document.createElement("img");o.src="".concat(STATIC_URL_ROOT).concat(e.iconAsset),o.style.position="relative",o.style.height="100%",o.style.width="100%",o.style.zIndex="1",n.appendChild(o);var r=document.createElement("div");r.style.position="absolute",r.style.display="none",r.style.width="39px",r.style.height="39px",r.style.top="".concat(-19+t,"px"),r.style.left="".concat(-19+t,"px"),r.style.borderRadius="4px",r.style.zIndex="0",r.style.backgroundColor="rgba(255, 255, 255, .25)";var s=document.createElement("div");s.textContent=e.tooltipText,s.style.position="relative",s.style.display="inline-block",s.style.top="42px",s.style.left="50%",s.style.transform="translateX(-50%)",s.style.padding="0px 7px",s.style.whiteSpace="nowrap",s.style.fontFamily="UbuntuRegular",s.style.fontSize="12px",s.style.color="#FFF",s.style.backgroundColor="rgba(0, 0, 0, .9)",s.style.border="1px solid #8A8A8A",r.appendChild(s),n.appendChild(r),void 0!==e.hideAllTooltips&&e.hideAllTooltips.listen((function(){r.style.display="none"})),void 0!==e.onClick&&(o.style.cursor="pointer",(0,i.j9)("click",o,e.onClick)),(0,i.j9)("mouseenter",o,(function(){r.style.display="block"})),(0,i.j9)("mouseleave",o,(function(){r.style.display="none"}));var a=!1,l=function e(t){t.target!==o&&(r.style.display="none",a=!1,(0,i.SC)("touchstart",document,e,!0))};return(0,i.j9)("touchstart",o,(function(t){a?void 0!==e.onClick&&(0,i.w$)("touchend",o,e.onClick):(r.style.display="block",a=!0,(0,i.j9)("touchstart",document,l,!0),t.preventDefault(),t.stopPropagation())})),n}function l(e){return(0,o.Ue)("api/online/".concat(e,"/")).then((function(e){return JSON.parse(e.responseText).online}))}function c(){return(0,o.Ue)("api/ts/chat/share-my-cam/").then((function(e){var t=JSON.parse(e.responseText).cam_room;return t.length>0?t[0]:""}))}function u(e){!function t(){c().then((function(n){""===n?e():window.setTimeout(t,5e3)})).catch((function(){}))}()}function d(e){return{username:e.getString("username"),isBroadcaster:!1,inFanclub:e.getBoolean("in_fanclub"),hasTokens:e.getBoolean("has_tokens"),isMod:e.getBoolean("is_mod"),tippedRecently:e.getBoolean("tipped_recently"),tippedALotRecently:e.getBoolean("tipped_alot_recently"),tippedTonsRecently:e.getBoolean("tipped_tons_recently"),exploringHashTag:"",sourceName:"df"}}},9784:function(e,t,n){"use strict";n.d(t,{RH:function(){return W},lO:function(){return q}});var i=n(3243),o=n(7591),r=n(9492),s=n(7597),a=n(2951),l=n(1976),c=n(8759),u=n(7693),d=n(1522),h=n(3753),f=n(391);var p=n(1986),m=n(7611),v=n(1090),g=n(4793),y=n(3149),b=n(5392),w=n(1794),C=n(1625),x=n(9874),k=n(3705),S=n(1809),T=n(3543),I=n(2750),P=n(6474),R=n(2915),M=n(1185),A=n(2800),E=n(8016),B=n(6265),O=n(9760),L=n(7397),D=n(1994),U=n(6547);function Z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,s.Z)(e);if(t){var o=(0,s.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,r.Z)(this,n)}}function F(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return _(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,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0?((0,d.Cj)(T.ag.showMyCamAlreadyBroadcasting),(0,k.fg)("SharedCamAlreadySharing")):(0,d.Cj)(t.getString("message")),V.fire(void 0))})).catch((function(){}))};j.setOnStart((function(){n.fire("started"),t.fire((function(){(0,k.fg)("SharedCamBroadcastStopClicked"),void 0!==j&&j.stopCam(!0)}))})),j.setOnStop((function(){n.fire("inactiveStopped"),t.fire((function(){(0,d.Cj)(T.ag.showMyCamCooldownAlert(H/1e3))})),window.setTimeout((function(){n.fire("stopped"),t.fire((function(){r()}))}),H)})),t.fire((function(){r()}))}})),0));var i}(t,n,i)}var K=function(){function e(t,n){var i,o=this;(0,a.Z)(this,e),this.onStartBroadcast=[],this.onStopBroadcast=[],this.listenerGroup=new w.mM,this.startBroadcast=function(){if(void 0!==o.previewModal&&o.previewModal.hide(),(0,k.fg)("SharedCamBroadcastStartClicked"),o.roomOffline||o.chatOffline)return(0,d.Cj)(T.ag.showMyCamMustBeConnected),void V.fire(void 0);var e=o.onStopBroadcast;o.onStopBroadcast=[],o.stopCam().then((function(){o.onStopBroadcast=e;var t=!1,n=window.setTimeout((function(){void 0!==o.broadcastModal&&o.broadcastModal.stopBroadcast(),(0,k.fg)("SharedCamBroadcastStartTimedOut"),(0,d.Cj)(T.ag.showMyCamBroadcastTimeoutError),error("smcViewer - timeout starting cam"),t=!0}),2e4);(0,h.I5)("api/ts/chat/share-my-cam/",{username:o.roomChatConn.room()}).then((function(){if(!t){o.broadcastModal=new G(o.camDossier,o.constraints,o.broadcastStop,o.roomChatConn,n),o.broadcastModal.showBroadcast(),o.fullscreenChangeListener=C.gH.listen(o.broadcastModal.showBroadcast);var e,i=F(o.onStartBroadcast);try{for(i.s();!(e=i.n()).done;)(0,e.value)()}catch(e){i.e(e)}finally{i.f()}}})).catch((function(){t||((0,d.Cj)(T.ag.showMyCamBroadcastError),V.fire(void 0))}))})).catch((function(){}))},this.broadcastStop=function(){var e;void 0!==o.broadcastModal&&(null===(e=o.fullscreenChangeListener)||void 0===e||e.removeListener(),o.fullscreenChangeListener=void 0,o.broadcastModal.currentlyViewed&&o.roomChatConn.event.roomNotice.fire({messages:[[(0,v.iL)((0,P.iT)(o.roomChatConn.room())),(0,v.vK)(T.ag.showMyCamStoppedViewing)]],showInPrivateMessage:!0})),o.broadcastModal=void 0;var t,n=F(o.onStopBroadcast);try{for(n.s();!(t=n.n()).done;)(0,t.value)()}catch(e){n.e(e)}finally{n.f()}},this.roomChatConn=t,this.constraints={micId:"",camId:"",width:0,height:0,muted:!0},this.roomOffline=!0,n.listen((function(e){o.roomOffline=e,e&&o.stopCam()}),!1).addTo(this.listenerGroup),this.chatOffline=!0,t.event.statusChange.listen((function(e){switch(o.chatOffline="notconnected"===e.currentStatus,e.currentStatus){case"privatenotwatching":case"privatespying":case"passwordprotected":case"notconnected":o.stopCam()}})).addTo(this.listenerGroup);var r=null===(i=A.J.current.loggedInUser)||void 0===i?void 0:i.userUid;void 0!==r&&new E.HS(r).onMessage.listen((function(e){e.started?E.C$.fire(e):E.qZ.fire(e)})).addTo(this.listenerGroup)}return(0,l.Z)(e,[{key:"startCam",value:function(){var e=this;if((0,k.fg)("SharedCamStartClicked"),this.roomOffline||this.chatOffline)return(0,d.Cj)(T.ag.showMyCamMustBeConnected),void V.fire(void 0);(0,U.cr)(this.roomChatConn.username()).then((function(t){t?((0,d.Cj)(T.ag.showMyCamAlreadyBroadcasting),V.fire(void 0)):m.c.areTermsAccepted()?e.showBroadcastPreview():new m.c(!1,(function(){e.showBroadcastPreview()}),(function(){V.fire(void 0)})).show()})).catch((function(){}))}},{key:"stopCam",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return void 0!==this.broadcastModal?this.broadcastModal.stopBroadcast(e):Promise.resolve()}},{key:"cleanup",value:function(){this.stopCam(),this.listenerGroup.removeAll()}},{key:"showBroadcastPreview",value:function(){var e=this;if(this.roomOffline||this.chatOffline)return(0,d.Cj)(T.ag.showMyCamMustBeConnected),void V.fire(void 0);new Promise((function(e,t){(0,h.Ue)("api/broadcastvideocontext/").then((function(t){var n;e((n=t.responseText,new Promise((function(e,t){var i=new f.j(n);i.getNumber("status",!1)>=400?t("Bad response from server: ".concat(n)):e({room:i.getString("room"),originHost:i.getString("originHost"),originPassword:i.getString("originPassword"),originWSEndpoint:i.getString("originWSEndpoint")})}))))})).catch(t)})).then((function(t){e.camDossier=t,void 0!==e.previewModal&&e.previewModal.hide(),e.previewModal=new J(e.camDossier,e.constraints,e.startBroadcast,e.roomChatConn.room()),e.previewModal.show()})).catch((function(){}))}},{key:"setOnStart",value:function(e){this.onStartBroadcast.push(e)}},{key:"setOnStop",value:function(e){this.onStopBroadcast.push(e)}},{key:"isBroadcasting",value:function(){return void 0!==this.broadcastModal}}]),e}(),J=function(e){(0,o.Z)(n,e);var t=Z(n);function n(e,i,o,r){var s;return(0,a.Z)(this,n),(s=t.call(this)).paused=!1,s.preventChatFocus=!0,s.overlay.style.backgroundColor="rgba(0, 0, 0, 0.4)",(0,M.vP)(s.element,"smc-preview-modal"),s.element.style.boxShadow="0px 0px 10px rgba(0, 0, 0, 0.3)",s.element.style.position="fixed",s.element.style.overflow="hidden",s.element.style.height="auto",s.element.style.width="422px",s.element.style.top="50%",s.element.style.left="50%",s.element.style.transform="translate(-50%, -56%)",s.element.style.borderRadius="6px",s.previewPanel=new R.Nt(e,i,{onOBSClick:function(){},onStartBroadcast:o,title:T.ag.showMyCamPreviewTitle,infoText:[T.ag.showMyCamPreviewInfo1(r),T.ag.showMyCamPreviewInfo2],startButtonText:T.ag.showMyCamStart(r),onClose:function(){V.fire(void 0),s.hide()}}),s.element.style.padding="8px 10px",s.element.style.boxSizing="border-box",s.overlayClick.listen((function(){V.fire(void 0),s.hide()})),s.addChild(s.previewPanel),s}return(0,l.Z)(n,[{key:"show",value:function(){this.paused&&this.previewPanel.start(),(0,i.Z)((0,s.Z)(n.prototype),"show",this).call(this),(0,k.fg)("SharedCamPreviewDisplayed")}},{key:"hide",value:function(){(0,i.Z)((0,s.Z)(n.prototype),"hide",this).call(this),this.previewPanel.stop(),this.paused=!0}}]),n}(x.z),G=function(e){(0,o.Z)(n,e);var t=Z(n);function n(e,i,o,r,s){var l;(0,a.Z)(this,n),(l=t.call(this,e,i,{onStopBroadcast:function(){(0,h.Z2)("api/ts/chat/share-my-cam/?",{username:l.roomUsername}),l.removeFromDom(),l.listenerGroup.removeAll(),N=void 0,o()}})).roomChatConn=r,l.currentlyViewed=!1,l.listenerGroup=new w.mM,l.bottom=16,l.cachedBottom=l.bottom,l.right=16,l.fullscreenBottom=32,l.fullscreenRight=0,l.currentWatchers=new Map,l.showBroadcast=function(){var e=(0,C.Gd)();(0,C.rm)()&&void 0!==e?(e.appendChild(l.element),l.main.style.bottom="".concat(l.fullscreenBottom,"px"),l.main.style.right="".concat(l.fullscreenRight,"px")):(document.body.appendChild(l.element),l.main.style.bottom="".concat(l.bottom,"px"),l.main.style.right="".concat(l.right,"px"))},l.roomUsername=r.room(),l.getSettingsLocalstorage(),l.createBroadcastDisplay(),O.nR.listen((function(){l.recalcPosition()}));var c=!0;return p.QU.listen((function(e){var t=e.data.status;"connecting"!==t&&c&&"hidden"===t?(clearTimeout(s),c=!1,l.onConnected()):!c&&l.isStatusOffline(t)&&(l.stopBroadcast(),(0,d.Cj)(T.ag.showMyCamBroadcastError),error("smcViewer - cam went offline"))}),!1).addTo(l.listenerGroup),L._j.listen((function(){l.recalcPosition()})).addTo(l.listenerGroup),l}return(0,l.Z)(n,[{key:"onConnected",value:function(){var e=this;(0,k.fg)("SharedCamBroadcastStarted"),N=this.roomUsername,E.C$.listen((function(t){e.updateCamStatus(!0,t)}),!1).addTo(this.listenerGroup),E.qZ.listen((function(t){e.updateCamStatus(!1,t)}),!1).addTo(this.listenerGroup)}},{key:"stopBroadcast",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,u.j9)("mouseenter",this.element,(function(e){e.stopPropagation()}),!0),(0,u.j9)("mouseleave",this.element,(function(e){e.stopPropagation()}),!0),e&&(0,k.fg)("SharedCamBroadcastStopClicked",{is_broadcaster_viewing:this.currentlyViewed}),this.stop(!0)}},{key:"removeFromDom",value:function(){null!==this.element.parentElement&&this.element.parentElement.removeChild(this.element)}},{key:"updateCamStatus",value:function(e,t){var n;this.currentlyViewed=e,e?this.currentWatchers.has(t.username)||(this.statusIcon.src="".concat(STATIC_URL_ROOT,"broadcastassets/active-cam-overlaying-video.svg"),this.statusTooltipText.textContent="".concat(this.roomUsername," ").concat(T.ag.showMyCamIsViewing),this.currentWatchers.set(t.username,t),n=T.ag.showMyCamStartedViewing):this.currentWatchers.has(t.username)&&(this.statusIcon.src="".concat(STATIC_URL_ROOT,"broadcastassets/inactive-cam-overlaying-video.svg"),this.statusTooltipText.textContent="".concat(this.roomUsername," ").concat(T.ag.showMyCamNotViewing),this.currentWatchers.delete(t.username),n=T.ag.showMyCamStoppedViewing),void 0!==n&&this.roomChatConn.event.roomNotice.fire({messages:[[(0,v.iL)((0,P.iT)(t.username)),(0,v.vK)(n)]],showInPrivateMessage:!0})}},{key:"createBroadcastPanel",value:function(){}},{key:"createBroadcastDisplay",value:function(){this.element.style.height="auto",this.element.style.width="auto",this.main=this.createMain(),this.main.appendChild(this.createCamStatus()),this.main.appendChild(this.createVideo()),this.main.appendChild(this.createControls()),this.element.appendChild(this.main),this.setupUIEventListeners()}},{key:"createMain",value:function(){var e=document.createElement("div");return e.style.height="117px",e.style.width="".concat(117*this.constraints.width/this.constraints.height,"px"),e.style.backgroundColor="#000",e.style.position="fixed",e.style.zIndex="".concat(U.AR),e.style.border="1px solid #FFF",e}},{key:"createCamStatus",value:function(){var e=document.createElement("div");e.style.position="absolute",e.style.right="5px",e.style.top="5px",e.style.width=e.style.height="15px",e.style.zIndex="".concat(U.AR+2);var t=document.createElement("img");t.src="".concat(STATIC_URL_ROOT,"broadcastassets/inactive-cam-overlaying-video.svg");var n=document.createElement("div");(0,M.vP)(n,"smc-status-tooltip"),n.style.position="absolute",n.style.width="175px",n.style.padding="9px",n.style.borderRadius="4px",n.style.fontSize="14px",n.style.display="none",n.style.zIndex="5",n.style.bottom="25px",n.style.left="-168px";var i=document.createElement("span");i.textContent="".concat(this.roomUsername," ").concat(T.ag.showMyCamNotViewing),n.appendChild(i);var o=(0,y.G3)("","","168px",2);return(0,M.vP)(o,"divotBottom"),n.appendChild(o),e.appendChild(t),e.appendChild(n),this.statusIcon=t,this.statusTooltip=n,this.statusTooltipText=i,e}},{key:"createVideo",value:function(){var e=(0,i.Z)((0,s.Z)(n.prototype),"createVideo",this).call(this);return e.style.height="100%",e}},{key:"createControls",value:function(){var e=this,t=(0,U.kK)(),n=document.createElement("div");n.style.width="100%",n.style.height="26px",n.style.backgroundColor="rgba(0, 0, 0, 0.4)",n.style.cursor="move",this.addDrag(n);var i=document.createElement("div");i.style.paddingLeft="10px",i.style.position="relative",i.style.top="50%",i.style.transform="translateY(-50%)",i.style.color="#FFF",i.style.cursor="default",i.textContent=T.ag.showMyCamMyCam,i.style.cursor="move",this.addDrag(i),n.appendChild(i),t.appendChild(n);var o=(0,U.vx)({iconAsset:"broadcastassets/volume-mute-grey.svg",tooltipText:T.ag.showMyCamMuted,iconSize:31,centerTop:"60%"});o.style.left="50%",o.style.transform="translateX(calc(-50% - 30px))",t.appendChild(o);var r=(0,U.vx)({iconAsset:"broadcastassets/close.svg",tooltipText:T.ag.showMyCamCloseCam,iconSize:23,centerTop:"60%",onClick:function(){e.stopBroadcast(!0)}});return r.style.left="50%",r.style.transform="translateX(calc(-50% + 30px))",t.appendChild(r),this.controls=t,t}},{key:"setupUIEventListeners",value:function(){var e=this,t=function(){e.controls.style.display="block",e.currentlyViewed?e.statusIcon.src="".concat(STATIC_URL_ROOT,"broadcastassets/active-cam.svg"):e.statusIcon.src="".concat(STATIC_URL_ROOT,"broadcastassets/inactive-cam.svg")},n=function(){e.controls.style.display="none",e.currentlyViewed?e.statusIcon.src="".concat(STATIC_URL_ROOT,"broadcastassets/active-cam-overlaying-video.svg"):e.statusIcon.src="".concat(STATIC_URL_ROOT,"broadcastassets/inactive-cam-overlaying-video.svg")};(0,u.j9)("mouseenter",this.main,t),(0,u.j9)("mouseleave",this.main,n);var i=0;(0,u.j9)("touchstart",this.main,(function(n){"none"===e.controls.style.display?(t(),i=1):i+=1})),(0,u.j9)("touchend",this.main,(function(e){i>1&&n()})),(0,u.j9)("touchstart",document,(function(t){e.element.contains(t.target)||n()})),(0,u.j9)("mouseenter",this.statusIcon,(function(t){e.statusTooltip.style.display="block"})),(0,u.j9)("mouseleave",this.statusIcon,(function(t){e.statusTooltip.style.display="none"})),(0,u.j9)("touchstart",this.statusIcon,(function(t){e.statusTooltip.style.display="block"})),(0,u.j9)("touchstart",document,(function(t){e.statusTooltip.style.display="none"}),!0)}},{key:"addDrag",value:function(e){var t=this;(0,b.T)(e,(function(e,n,i){var o=t.getCorrectedRight((0,C.rm)()?t.fullscreenRight:t.right),r=t.getCorrectedBottom((0,C.rm)()?t.fullscreenBottom:t.bottom),s=o,a=r,l=n,c=i;return{enabled:!0,move:function(e,n){var i=e-l,u=n-c;a=t.getCorrectedBottom(r-u),s=t.getCorrectedRight(o-i),t.main.style.bottom="".concat(a,"px"),t.main.style.right="".concat(s,"px")},end:function(){(0,C.rm)()?(t.fullscreenRight=s,t.fullscreenBottom=a):(t.right=s,t.bottom=a,t.cachedBottom=a),t.saveSettingsLocalstorage()}}}))}},{key:"getCorrectedBottom",value:function(e){return Math.max(0,Math.min(window.innerHeight-this.main.offsetHeight,e))}},{key:"getCorrectedRight",value:function(e){return Math.max(0,Math.min(window.innerWidth-this.main.offsetWidth,e))}},{key:"recalcPosition",value:function(){if((0,C.rm)())this.main.style.bottom="".concat(this.getCorrectedBottom(this.fullscreenBottom),"px"),this.main.style.right="".concat(this.getCorrectedRight(this.fullscreenRight),"px");else{var e=(0,D.p)();this.bottom=e>0?Math.max(this.cachedBottom,e+4):this.cachedBottom,this.main.style.bottom="".concat(this.getCorrectedBottom(this.bottom),"px"),this.main.style.right="".concat(this.getCorrectedRight(this.right),"px")}}},{key:"getSettingsLocalstorage",value:function(){if((0,c.IU)()){var e=window.localStorage.getItem(z);if(null!==e){var t=JSON.parse(e);this.bottom=t.bottom,this.cachedBottom=t.bottom,this.right=t.right,this.fullscreenBottom=t.fullscreenBottom,this.fullscreenRight=t.fullscreenRight}}}},{key:"saveSettingsLocalstorage",value:function(){if((0,c.IU)()){var e={bottom:this.bottom,right:this.right,fullscreenBottom:this.fullscreenBottom,fullscreenRight:this.fullscreenRight};window.localStorage.setItem(z,JSON.stringify(e))}}}]),n}(R.G0)},851:function(e,t,n){"use strict";n.d(t,{S:function(){return h},Z:function(){return p}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(9),c=n(1185);function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,a.Z)(e);if(t){var o=(0,a.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,s.Z)(this,n)}}var d=function(e){(0,r.Z)(n,e);var t=u(n);function n(e,o,r){var s;return(0,i.Z)(this,n),(s=t.call(this)).checkbox=document.createElement("input"),s.onChange=function(){},s.disabled=!1,s.checkbox.type="checkbox",s.element.style.overflow="visible",s.element.style.position="relative",(0,c.vP)(s.element,"checkboxComponent"),s.subclassInit(r),void 0!==e&&s.setChecked(e),void 0!==o&&s.setOnChange(o),s.element.appendChild(s.checkbox),s.updateStyles(),s.element.onclick=function(e){s.disabled||e.target===s.checkbox||(s.toggle(),s.checkbox.focus(),e.preventDefault())},s.checkbox.onchange=function(){s.updateStyles(),s.onChange()},s}return(0,o.Z)(n,[{key:"toggle",value:function(){this.checkbox.click()}},{key:"focus",value:function(){this.checkbox.focus()}},{key:"blur",value:function(){this.checkbox.blur()}},{key:"isActiveElement",value:function(){return document.activeElement===this.checkbox}},{key:"isChecked",value:function(){return this.checkbox.checked}},{key:"setChecked",value:function(e){this.checkbox.checked=e,this.updateStyles(),this.onChange()}},{key:"setCheckedDirectly",value:function(e){this.checkbox.checked=e,this.updateStyles()}},{key:"setOnChange",value:function(e){this.onChange=e}},{key:"disable",value:function(){this.disabled=!0,this.checkbox.tabIndex=-1,this.updateStyles()}},{key:"enable",value:function(){this.disabled=!1,this.checkbox.removeAttribute("tabindex"),this.updateStyles()}},{key:"setCheckboxValue",value:function(e){this.checkbox.value=e}},{key:"getCheckboxValue",value:function(){return this.checkbox.value}}]),n}(l.w),h=function(e){(0,r.Z)(n,e);var t=u(n);function n(e,o,r){var s;return(0,i.Z)(this,n),(s=t.call(this,o,r)).element.style.height="".concat(e,"px"),s.element.style.width="".concat(e,"px"),s}return(0,o.Z)(n,[{key:"subclassInit",value:function(){(0,c.vP)(this.element,"transparentCheckbox")}},{key:"updateStyles",value:function(){this.checkbox.checked?(0,c.vP)(this.element,"checked"):(0,c.FU)(this.element,"checked"),this.disabled?((0,c.vP)(this.element,"disabled"),this.element.style.cursor="default"):((0,c.FU)(this.element,"disabled"),this.element.style.cursor="pointer")}},{key:"setName",value:function(e){this.checkbox.name=e}},{key:"getName",value:function(){return this.checkbox.name}},{key:"setTitle",value:function(e){this.checkbox.title=e}}]),n}(d),f="rgb(246, 115, 0)",p=function(e){(0,r.Z)(n,e);var t=u(n);function n(e,o,r){return(0,i.Z)(this,n),t.call(this,e,o,r)}return(0,o.Z)(n,[{key:"subclassInit",value:function(e){var t,n,i=null!==(t=null==e?void 0:e.width)&&void 0!==t?t:50,o=null!==(n=null==e?void 0:e.height)&&void 0!==n?n:30,r="".concat(i,"px"),s="".concat(o,"px"),a="".concat(2*o/3,"px");this.toggledOnLeftStyle="".concat(i-o,"px"),this.element.style.width=r,this.element.style.height=s,this.element.style.borderRadius=a,this.element.style.lineHeight=s,(0,c.vP)(this.element,"toggle"),this.button=document.createElement("div"),this.button.style.height=s,this.button.style.width=s,(0,c.vP)(this.button,"toggleButton"),this.element.appendChild(this.button)}},{key:"updateStyles",value:function(){this.checkbox.checked?(this.element.style.backgroundColor="".concat(f),this.element.style.boxShadow="".concat(f," 0 0 0 16px inset"),this.element.style.border="1px solid ".concat(f),this.button.style.left=this.toggledOnLeftStyle):(this.element.style.backgroundColor="rgb(233, 233, 233)",this.element.style.boxShadow="rgb(233, 233, 233) 0 0 0 16px inset",this.element.style.border="1px solid rgb(223, 223, 223)",this.button.style.left="0")}}]),n}(d)},5712:function(e,t,n){"use strict";n.d(t,{n:function(){return d}});var i=n(2951),o=n(1976),r=n(4793),s=n(1794),a=n(1006),l=n(822);function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(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)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&void 0!==arguments[0])||arguments[0];return void 0!==this.userListPromise||(this.userListPromise=this.refreshUserList(e),this.scheduleUserListPromiseReset()),this.userListPromise}},{key:"clearList",value:function(){this.userList=[]}},{key:"clearUserListPromise",value:function(){this.userListPromise=void 0}},{key:"scheduleUserListPromiseReset",value:function(){var e=this;window.setTimeout((function(){e.clearUserListPromise()}),6e4)}},{key:"getSortedList",value:function(){return this.sorted||(this.userList.sort((function(e,t){return e.user.username.toLowerCase()t.user.username.toLowerCase()?1:0})),this.sorted=!0),this.userList}},{key:"users",value:function(){return this.userList.map((function(e){return e.user}))}},{key:"count",get:function(){return this.userList.length}},{key:"refreshUserList",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return a._B.getInstance().fetchRoomUsers().then((function(n){var i=document.createElement("div");t?e.removeNonRecentUsers():e.userList=[];var o,r=c(n.roomUsers);try{for(r.s();!(o=r.n()).done;){var s=o.value;e.userInList(s.username)||e.userList.push({user:s,element:i,visible:!1,recent:!1}),e.invalidMentions.has(s.username)&&(l.it.fire(void 0),e.invalidMentions.delete(s.username))}}catch(e){r.e(e)}finally{r.f()}return e.userList})).catch((function(t){return error("Error loading username autocomplete",t),e.userList}))}},{key:"addRecentUser",value:function(e){var t=document.createElement("div");this.sorted=!1;var n=this.getUser(e.username);void 0===n?this.userList.push({user:e,element:t,visible:!1,recent:!0}):(n.user=e,n.recent=!0),this.invalidMentions.has(e.username)&&(l.it.fire(void 0),this.invalidMentions.delete(e.username))}},{key:"addInvalidUsers",value:function(e){var t,n=c(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.invalidMentions.add(i)}}catch(e){n.e(e)}finally{n.f()}}},{key:"shouldNotRefresh",value:function(e){return["offline","notconnected","hidden","passwordprotected"].indexOf(e)>-1}},{key:"statusChangeShouldRefresh",value:function(e,t){if(!this.isAnonymous&&!this.shouldNotRefresh(e)){var n="privatespying"!==t&&"privatewatching"!==t,i="privatespying"!==e&&"privatewatching"!==e;!n&&i?(this.clearUserListPromise(),this.mentionUserList()):n&&!i?(this.clearUserListPromise(),this.mentionUserList(!1)):this.mentionUserList()}}},{key:"removeNonRecentUsers",value:function(){this.userList=this.userList.filter((function(e){return e.recent}))}},{key:"getUser",value:function(e){return this.userList.find((function(t){return t.user.username===e}))}},{key:"userInList",value:function(e){return void 0!==this.getUser(e)}}],[{key:"getInstance",value:function(){return void 0===e.instance&&(e.instance=new e),e.instance}}]),e}()},822:function(e,t,n){"use strict";n.d(t,{AL:function(){return M},W8:function(){return R},it:function(){return T}});var i=n(3243),o=n(7791),r=n(2951),s=n(1976),a=n(7591),l=n(9492),c=n(7597),u=n(824),d=n.n(u),h=n(8759),f=n(7693),p=n(4793),m=n(1794),v=n(2923),g=n(3682),y=n(7108),b=n(9482),w=n(758),C=n(1185),x=n(2800),k=n(5712);function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,c.Z)(e);if(t){var o=(0,c.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,l.Z)(this,n)}}var T=new m.xB("updateUserMention",{reportIfNoListeners:!1}),I=[40,37,39,38,13,27,32,9],P=new m.xB("hideUserList",{listenersWarningThreshold:20}),R=function(e){(0,a.Z)(i,e);var t,n=S(i);function i(e){var t;return(0,r.Z)(this,i),(t=n.call(this,e)).config=e,t.listenerGroup=new m.mM,t.visible=!1,t.started=!1,t.userList=k.n.getInstance(),t.element.style.visibility="hidden",t.element.style.width="auto",t.element.style.height="auto",t.element.style.borderBottom="none",t.element.style.fontFamily="Helvetica, Arial, sans-serif",t.element.style.cursor="pointer",t.element.style.userSelect="none",t.overlayClick.listen((function(){t.isValidSelectionIndex()&&t.config.inputElement.appendText(" "),t.hide()})),t.list=document.createElement("div"),t.list.style.width="260px",t.list.style.maxHeight="180px",t.list.style.overflowY="scroll",t.element.appendChild(t.list),(0,f.j9)("keyup",t.config.inputElement.element,(function(e){t.config.inputElement.getAvailableLength()>36&&(t.handleInputChange(e),t.repositionChildren())})),(0,f.j9)("keydown",t.config.inputElement.element,(function(e){(t.visible||t.started)&&t.handleKeyPress(e)})),w.gO.listen((function(e){t.delay=parseInt(e.emoticonAutocompleteDelay)})).addTo(t.listenerGroup),P.listen((function(){t.hide()})).addTo(t.listenerGroup),p.kN.listen((function(e){t.delay=parseInt(e.dossier.userChatSettings.emoticonAutocompleteDelay),t.hide(),t.clearList(),t.userList.clearList()})).addTo(t.listenerGroup),(0,C.vP)(t.element,"userMentionModal"),t}return(0,s.Z)(i,[{key:"dispose",value:function(){this.listenerGroup.removeAll()}},{key:"repositionChildren",value:function(){var e=this.config.inputElement.caretXPos(!0)+this.config.leftOffset,t=this.config.inputElement.element.clientWidth-this.config.rightOffset;this.element.style.left="".concat(Math.max(4,Math.min(e,t)),"px")}},{key:"handleInputChange",value:(t=(0,o.Z)(d().mark((function e(t){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.delay>=0&&-1===I.indexOf(t.keyCode))){e.next=11;break}if(null===(n=this.config.inputElement.getCurrentNodeText().match(/(^|\s)@([\w-]*)$/))||!this.config.inputElement.caretAtEndOfInput()){e.next=10;break}return e.next=5,this.userList.mentionUserList();case 5:this.prefix=n[2],this.inputString=this.prefix,this.updateList(),e.next=11;break;case 10:this.hide();case 11:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"handleKeyPress",value:function(e){38===e.keyCode||40===e.keyCode?(e.preventDefault(),this.scrollList(38===e.keyCode)):[9,39,32,13].includes(e.keyCode)?(e.preventDefault(),e.stopPropagation(),this.hide(),x.J.current.isMobile&&13===e.keyCode||this.config.inputElement.appendText(" ")):27!==e.keyCode&&37!==e.keyCode||(e.preventDefault(),this.hide(),this.deleteHighlightedSuffix())}},{key:"clearList",value:function(){for(;null!==this.list.firstChild;)this.list.removeChild(this.list.firstChild);this.selectedIndex=-1}},{key:"updateList",value:function(){var e=this;this.clearList()," "===this.prefix[this.prefix.length-1]&&this.hide();var t=!1;if(this.selectedList=this.userList.getSortedList(),this.selectedList.forEach((function(n,i){""===e.prefix||n.user.username.toLowerCase().startsWith(e.prefix.toLowerCase())?(e.appendUserList(n,i),t=!0):n.visible=!1})),!t)return this.hide(),void(this.started=!0);var n=this.list.children.length<=0?0:this.list.children.item(this.list.children.length-1).offsetTop;this.list.scrollTop=n,this.visible||this.show()}},{key:"appendUserList",value:function(e,t){var n=this,i=document.createElement("div");i.classList.add("userMentionModalItem"),(0,C.vP)(i,(0,b.c9)(e.user)),i.innerText=e.user.username,i.style.padding="2px 8px",i.onclick=function(){n.selectedIndex=t,n.highlightSelectedIndex(!1),n.config.inputElement.focus(),n.hide(),n.config.inputElement.appendText(" ")},i.style.fontWeight="bold",i.style.textOverflow="ellipsis",i.style.overflow="hidden",e.element=i,e.visible=!0,this.list.appendChild(i)}},{key:"scrollList",value:function(e){this.inputString=this.isValidSelectionIndex()?this.selectedList[this.selectedIndex].user.username:this.prefix;var t=!1;this.clearSelection();do{var n;if(this.selectedIndex=this.isValidSelectionIndex()?this.selectedIndex+(e?-1:1):e?this.selectedList.length-1:0,this.selectedIndex<0){if(t)break;this.selectedIndex=this.selectedList.length-1,t=!0}else if(this.selectedIndex>=this.selectedList.length){if(t)break;this.selectedIndex=0,t=!0}}while(null===(n=this.selectedList[this.selectedIndex])||void 0===n||!n.visible);this.highlightSelectedIndex(!0)}},{key:"clearSelection",value:function(){this.list.querySelectorAll("div.highlight").forEach((function(e){var t=e;(0,C.FU)(t,"highlight")}))}},{key:"highlightSelectedIndex",value:function(e){if(this.isValidSelectionIndex()){this.clearSelection();var t=this.selectedList[this.selectedIndex],n=this.list.clientHeight,i=this.list.firstChild.getBoundingClientRect().height;e&&(this.list.scrollTop=this.selectedIndex*i-n/2),(0,C.vP)(t.element,"highlight");var o=t.user.username;this.config.inputElement.setCurrentNodeText(this.config.inputElement.getCurrentNodeText().replace(new RegExp("".concat(this.inputString,"$")),o)),this.inputString=o;var r=this.config.inputElement.getCurrentNodeText().lastIndexOf(o);r>-1&&this.config.inputElement.selectCurrentNodeTail(r)}}},{key:"deleteHighlightedSuffix",value:function(){this.config.inputElement.deleteSelection()}},{key:"show",value:function(){var e=this;this.started=!0,this.delay>=0&&window.setTimeout((function(){e.element.style.visibility="",e.showOverlay(),e.repositionChildrenRecursive(),e.visible=!0}),this.delay)}},{key:"hide",value:function(){this.hideOverlay(),this.element.style.visibility="hidden",this.visible=!1,this.started=!1,this.clearList()}},{key:"isVisible",value:function(){return this.visible}},{key:"isValidSelectionIndex",value:function(){return-1!==this.selectedIndex&&this.selectedIndex>>0).toString(16)}function P(){return Array.from(S).some((function(e){return e.isShown()}))}function R(e,t){var n;if(null===(n=e.rulesModal)||void 0===n||n.dispose(),!(0,h.TF)()&&t.chatRules.trim().length>0&&!function(e,t){var n,i=null===(n=k.J.current.loggedInUser)||void 0===n?void 0:n.username;if(i===e)return!0;var o=I(t.trim()),r="rules_accepted_".concat(i,"_").concat(e);return(0,u.IU)()?localStorage.getItem(r)===o:(0,p.sv)(r)===o}(t.room,t.chatRules)){if(e instanceof g.Q){var i=new M({inputContainer:e.centerControlsDiv,customInputField:e.chatInput,roomName:t.room,chatRules:t.chatRules,container:e.getMobileRoot(),chatSettings:t.userChatSettings},!0);return i.element.style.position="fixed",i.element.style.zIndex="999999",i}var o=new M({inputContainer:e.inputDiv,customInputField:e.customInputField,roomName:t.room,chatRules:t.chatRules,container:e,chatSettings:t.userChatSettings});return o.element.style.zIndex="1001",o}}f.y.listen((function(e){T(e.room)}));var M=function(e){(0,a.Z)(f,e);var t,n,h=(t=f,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function f(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,i.Z)(this,f),(t=h.call(this,e)).visibilityChanged=new m.xB("visibilityChanged",{reportIfNoListeners:!1}),t.showFunction=function(e){t.show()},t.listenerAdded=!1,t.listenerGroup=new m.mM,t.isVisible=!1,t.captureKeys=function(e){"Tab"===e.key?(document.activeElement===t.acceptBtn?t.closeBtn.focus():t.acceptBtn.focus(),e.stopPropagation(),e.preventDefault()):"Escape"===e.key?(t.hide(),e.stopPropagation(),e.preventDefault()):"Enter"!==e.key&&(e.stopPropagation(),e.preventDefault())},t.overlayClick.listen((function(){t.hide()})),S.add((0,r.Z)(t)),n?(t.element.style.width="70%",t.element.style.left="15%"):(t.element.style.width="95%",t.element.style.left="2.5%"),t.bindListeners(),t.updateScrollIndicator(),t}return(0,o.Z)(f,[{key:"applyChatSettingsFontStyles",value:function(e){this.element.style.fontFamily=e.fontFamily,this.element.style.fontSize=e.fontSize}},{key:"initData",value:function(e){this.chatRules=e.chatRules.trim()}},{key:"initUI",value:function(e){(0,s.Z)((0,c.Z)(f.prototype),"initUI",this).call(this),this.element.style.bottom="10px",this.element.style.borderWidth="1px",this.element.style.borderStyle="solid",this.element.style.borderRadius="4px",this.element.style.margin="0 auto",this.element.style.padding="10px",this.element.style.boxSizing="border-box",this.element.style.maxHeight="95%",this.applyChatSettingsFontStyles(e.chatSettings),(0,x.vP)(this.element,"rulesModal"),this.inputContainer=e.inputContainer,this.customInput=e.customInputField,this.roomName=e.roomName,this.container=e.container,this.element.style.position="absolute",this.element.style.textAlign="center",this.element.style.height="auto",this.element.style.display="none";var t=document.createElement("div");t.style.fontWeight="bold",t.style.textAlign="left",t.style.paddingBottom="5px",t.style.paddingRight="10px",t.style.whiteSpace="nowrap",t.style.textOverflow="ellipsis",t.style.overflow="hidden";var n="".concat(this.roomName[0].toUpperCase()).concat(this.roomName.substring(1));t.innerText="".concat(n,"'s Rules:"),this.element.appendChild(t),this.textPar=this.createTextContent(this.chatRules),this.scrollIndicator=this.createScrollIndicator();var i=document.createElement("div");i.style.position="relative",i.appendChild(this.textPar),i.appendChild(this.scrollIndicator),i.dataset.testid="chat-rules",this.element.appendChild(i),this.acceptBtn=this.createAcceptButton(),this.closeBtn=this.createCloseButton(),this.element.appendChild(this.acceptBtn),this.element.appendChild(this.closeBtn),this.repositionChildren()}},{key:"createTextContent",value:function(e){var t=this,n=document.createElement("div");return n.style.whiteSpace="pre-line",n.style.textAlign="left",n.style.lineHeight="1.4",n.style.height="auto",n.style.paddingBottom="15px",n.style.boxSizing="border-box",n.style.width="100%",n.style.overflowY="scroll",n.style.overflowWrap="break-word",n.style.wordBreak="break-word",n.style.wordWrap="break-word",n.style.cssText+="; -ms-overflow-style: -ms-autohiding-scrollbar",n.style.marginBottom="3px",n.style.paddingRight="15px",n.onscroll=function(){t.updateScrollIndicator()},n.appendChild(document.createTextNode(e)),(0,y.q)(n),n}},{key:"isTextScrolledToBottom",value:function(){return this.textPar.scrollHeight-this.textPar.scrollTop-this.textPar.clientHeight<=1}},{key:"updateScrollIndicator",value:function(){this.isTextScrolledToBottom()?this.scrollIndicator.style.display="none":this.scrollIndicator.style.display="block"}},{key:"createScrollIndicator",value:function(){var e=document.createElement("div");return(0,x.vP)(e,"scrollIndicator"),e.style.height="50px",e.style.position="absolute",e.style.bottom="0",e.style.fontWeight="bold",e.style.textAlign="center",e.style.boxSizing="border-box",e.style.width="100%",e}},{key:"repositionChildren",value:function(){var e=this.container.element.getBoundingClientRect().height;this.textPar.style.maxHeight="calc(".concat(e,"px - 120px)"),this.updateScrollIndicator()}},{key:"show",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isVisible||(this.isVisible=!0,this.element.style.display="block",this.customInput.disable(),this.inputContainer.style.pointerEvents="none",this.showOverlay(),this.repositionChildren(),(0,d.j9)("keydown",document,this.captureKeys,!0),e||this.visibilityChanged.fire(this.isVisible))}},{key:"hide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isVisible&&(this.isVisible=!1,this.element.style.display="none",this.customInput.enable(),this.inputContainer.style.pointerEvents="",this.hideOverlay(),this.container.repositionChildrenRecursive(),(0,d.SC)("keydown",document,this.captureKeys,!0),e||this.visibilityChanged.fire(this.isVisible))}},{key:"accept",value:function(){var e,t="rules_accepted_".concat(null===(e=k.J.current.loggedInUser)||void 0===e?void 0:e.username,"_").concat(this.roomName),n=I(this.chatRules);(0,u.IU)()?localStorage.setItem(t,n):(0,p.C)(t,n,1),T(),v.ZB.fire(void 0),this.customInput.focus()}},{key:"bindListeners",value:function(){var e=this;w.gO.listen((function(t){e.applyChatSettingsFontStyles(t)})).addTo(this.listenerGroup),this.listenerAdded||((0,d.j9)("focus",this.customInput.element,this.showFunction),this.listenerAdded=!0)}},{key:"removeInputListener",value:function(){this.listenerAdded&&((0,d.SC)("focus",this.customInput.element,this.showFunction),this.listenerAdded=!1)}},{key:"dispose",value:function(){this.hide(),this.removeInputListener(),this.listenerGroup.removeAll(),void 0!==this.parent&&(delete this.parent.rulesModal,this.parent.removeChild(this)),S.delete(this)}},{key:"createAcceptButton",value:function(){var e=this,t=document.createElement("button");return t.innerText=C.ag.acceptRules,t.style.fontFamily="'UbuntuRegular',sans-serif",t.style.display="inline-block",t.style.boxSizing="content-box",t.style.width="calc(100% - 16px)",t.style.padding="8px",t.style.borderRadius="4px",t.style.cursor="pointer",t.style.fontWeight="500",t.style.lineHeight="16px",t.style.whiteSpace="nowrap",t.style.overflow="hidden",t.style.textOverflow="ellipsis",t.style.fontSize="120%",t.style.zIndex="2",(0,d.j9)("click",t,(function(){e.accept()})),(0,x.vP)(t,"acceptRulesButton"),t}},{key:"createCloseButton",value:function(){var e=this,t=document.createElement("button"),n=document.createElement("img");return n.src="".concat(STATIC_URL,"close_icon.svg"),n.style.backgroundColor="inherit",t.appendChild(n),t.style.boxSizing="border-box",t.style.padding="5px 5px 4px 5px",t.style.position="absolute",t.style.top="2px",t.style.right="2px",t.style.cursor="pointer",(0,d.j9)("click",t,(function(){e.hide()})),(0,x.vP)(t,"closeRulesButton"),t}}]),f}(b.B)},7542:function(e,t,n){"use strict";n.d(t,{F:function(){return i}});var i=new(n(1794).xB)("openFeedbackForm")},2765:function(e,t,n){"use strict";n.d(t,{j:function(){return q},K:function(){return W}});var i=n(3243),o=n(2951),r=n(1976),s=n(7591),a=n(9492),l=n(7597),c=n(7693),u=n(3753),d=n(6767),h=n(9),f=n(8263),p=n(9874),m=n(5190),v=n(3543),g=n(1185),y=n(2800),b=n(1612),w=n(6265),C=n(7169),x=n(8759),k=n(1794),S=n(4880),T=function(){function e(t,n,i){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];(0,o.Z)(this,e),this.element=document.createElement("div"),this.label=document.createElement("label"),this.label.htmlFor=n,this.label.innerText=i,"textarea"===t?this.input=document.createElement("textarea"):(this.input=document.createElement("input"),this.input.type=t),this.input.name=n,r&&(this.input.required=r),this.error=document.createElement("p"),this.error.style.display="none",this.element.appendChild(this.label),this.element.appendChild(this.input),this.element.appendChild(this.error)}return(0,r.Z)(e,[{key:"setError",value:function(e){this.error.textContent=e,this.error.style.display=""}},{key:"clearError",value:function(){this.error.textContent="",this.error.style.display="none"}}]),e}(),I=n(2295);function P(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return R(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)?R(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==arguments[1]&&arguments[1],i=document.createElement("button");return i.type="button",(0,g.vP)(i,"sentimentOption"),(0,g.vP)(i,(0,m.AF)(e)),(0,f.Zs)(i,{height:"24px",width:"24px",padding:"4px",boxSizing:"content-box",backgroundPosition:"center center",backgroundRepeat:"no-repeat",display:"inline-block",backgroundColor:"transparent",border:"none",cursor:"pointer",marginRight:n?"0":"16px",verticalAlign:"middle"}),this.inputChange.listen((function(t){t===e?(0,g.vP)(i,"selected"):(0,g.FU)(i,"selected")})),i.onclick=function(){t.setValue(e)},i}},{key:"setValue",value:function(e){this.formInput.input.value=e,this.inputChange.fire(e)}},{key:"getValue",value:function(){return this.formInput.input.value}},{key:"setPrompt",value:function(e){this.formInput.label.textContent=""===e?this.defaultPrompt:e}},{key:"clearSelection",value:function(){this.setValue("")}}]),n}(h.w),Z=function(e){(0,s.Z)(n,e);var t=M(n);function n(e){var i;(0,o.Z)(this,n),(i=t.call(this)).props=e,i.commentItems=[],i.element=B();var r,s=P(e.prompts);try{for(s.s();!(r=s.n()).done;){var a=r.value,l=new T("textarea","comments",a,e.required);(0,g.vP)(l.input,"feedbackComment"),(0,f.Zs)(l.input,{width:"306px",resize:"none",minHeight:"".concat(e.textBoxHeight,"px"),boxSizing:"border-box",marginBottom:"8px"}),l.input.maxLength=5e3,(0,g.vP)(l.error,"error"),l.error.style.marginBottom="12px",(0,c.j9)("keyup",l.input,e.onChange),(0,c.j9)("touchend",l.input,e.onChange),(0,c.j9)("paste",l.input,e.onChange),(0,c.j9)("cut",l.input,e.onChange),i.element.appendChild(l.element),i.commentItems.push(l)}}catch(e){s.e(e)}finally{s.f()}for(var u=function(e){(0,c.j9)("keydown",i.commentItems[e].input,(0,f.hI)((function(){return e+10?i.commentItems[e-1].input:void 0})))},d=0;d=this.commentItems.length)&&error("Feedback comments error index out of range"),e.length>0&&this.commentItems[t].setError(e)}},{key:"clearErrors",value:function(){this.commentItems.forEach((function(e){return e.clearError()}))}},{key:"anyCommentsNonempty",value:function(){return this.commentItems.some((function(e){return""!==e.input.value.trim()}))}}]),n}(h.w),F=function(e){(0,s.Z)(n,e);var t=M(n);function n(e,i){var r;return(0,o.Z)(this,n),(r=t.call(this,"div",{control:e})).canvas=i,r}return(0,r.Z)(n,[{key:"initData",value:function(e){var t=this;this.element=document.createElement("div"),(0,g.vP)(this.element,"screenshot"),this.editToggle=document.createElement("button"),this.editToggle.type="button",(0,g.vP)(this.editToggle,"editToggle"),this.editImage=new Image,this.editImage.src="".concat(STATIC_URL_ROOT,"images/feedback/select.svg"),this.editToggle.appendChild(this.editImage),this.editText=document.createElement("div"),this.editText.textContent=v.ag.feedbackCanvasToggle,this.editToggle.appendChild(this.editText),(0,c.j9)("click",this.editToggle,(function(){t.canvas.show()})),(0,c.j9)("mouseenter",this.editToggle,(function(){t.editImage.src="".concat(STATIC_URL_ROOT,"images/feedback/select_active.svg")})),(0,c.j9)("mouseleave",this.editToggle,(function(){t.editImage.src="".concat(STATIC_URL_ROOT,"images/feedback/select.svg")})),this.element.appendChild(this.editToggle),this.closeButton=document.createElement("button"),this.closeButton.type="button",this.closeButton.onclick=function(){e.control.removeScreenshot()},this.element.appendChild(this.closeButton)}},{key:"initUI",value:function(){this.element.style.width="100%",this.element.style.minHeight="140px",this.element.style.maxHeight="340px",this.element.style.position="relative",this.element.style.backgroundSize="contain",this.element.style.backgroundRepeat="no-repeat",this.element.style.backgroundPosition="center",this.element.style.justifyContent="center",this.element.style.alignItems="center",this.element.style.display="none",this.editToggle.style.width="75%",this.editToggle.style.height="100px",this.editToggle.style.boxShadow="0px 4px 16px rgba(0, 0, 0, 0.3)",this.editToggle.style.borderRadius="4px",this.editToggle.style.textAlign="center",this.editToggle.style.cursor="pointer",this.editToggle.style.fontFamily="UbuntuMedium, Helvetica, Arial, sans-serif",this.editText.style.width="100%",(0,f.Zs)(this.closeButton,{position:"absolute",right:"10px",top:"10px",height:"24px",width:"24px",padding:"4px",background:"transparent url(".concat(STATIC_URL,"feedback/remove-screenshot.svg) no-repeat center center"),border:"none",cursor:"pointer"})}}]),n}(h.w),_=function(e){(0,s.Z)(n,e);var t=M(n);function n(e,i){var r;return(0,o.Z)(this,n),(r=t.call(this,"div",{canvas:i})).modal=e,r.canvas=i,r.isCapturing=!1,r}return(0,r.Z)(n,[{key:"initData",value:function(e){var t=this;this.element=B(),this.button=document.createElement("button"),this.button.type="button",this.button.textContent=v.ag.feedbackAddScreenshot,(0,c.j9)("click",this.button,(function(e){e.preventDefault(),t.addScreenshot()})),this.element.appendChild(this.button),this.screenshot=new F(this,e.canvas),this.addChild(this.screenshot,this.element),this.info=document.createElement("div"),this.info.style.display="none",this.element.appendChild(this.info),this.error=document.createElement("span"),this.element.appendChild(this.error)}},{key:"initUI",value:function(){this.element.style.width="306px",this.element.style.textAlign="center",this.element.style.marginBottom="8px",(0,g.vP)(this.element,"screenShotControl"),(0,g.vP)(this.button,"sscButton"),(0,f.Zs)(this.button,{fontFamily:"UbuntuRegular, Arial, Helvetica, sans-serif",border:"none",boxSizing:"border-box",display:"block",cursor:"pointer",textDecoration:"underline",padding:"0",marginBottom:"16px"}),(0,g.vP)(this.error,"error"),(0,g.vP)(this.info,"info"),this.info.style.margin="8px 0 10px"}},{key:"addScreenshot",value:function(){var e=this;if(this.canvas.canScreenshot()&&(this.removeScreenshot(),this.canvas.createScreenshot(),this.error.textContent="",void 0!==this.canvas.screenshot)){var t=this.canvas.screenshot.getContext("2d");if(null!==t){this.isCapturing=!0,this.modal.hide();var n=!1,i=document.createElement("video");i.style.display="none",this.canvas.element.appendChild(i),this.canvas.getDisplayMedia().then((function(o){i.srcObject=o,e.videoStream=o,i.play(),(0,c.j9)("canplay",i,(function(){n||(n=!0,window.setTimeout((function(){var n,o,r=window.innerWidth,s=window.innerHeight,a=i.videoWidth/i.videoHeight;s*a').concat(v.ag.dismissLower,")"),(0,c.j9)("click",this.infoTooltip,(function(){var t;null===(t=e.draw)||void 0===t||t.focus()})),this.infoTooltip.style.userSelect="none"}},{key:"initUI",value:function(){(0,g.vP)(this.element,"canvas"),(0,f.Zs)(this.element,{display:"none",position:"absolute",height:"100%",width:"100%"}),(0,g.vP)(this.infoTooltip,"infoToolTip"),(0,f.Zs)(this.infoTooltip,{position:"fixed",borderWidth:"1px",borderStyle:"solid",boxSizing:"border-box",zIndex:2020,top:"100px",left:"0",right:"0",margin:"0 auto",padding:"12px",fontWeight:"bold",width:"500px",textAlign:"center",fontFamily:"UbuntuMedium, Helvetica, Arial, sans-serif",fontSize:"1.3em"})}},{key:"canScreenshot",value:function(){return void 0!==this.mediaStreams&&!(0,x.s2)()}},{key:"getDisplayMedia",value:function(){if(!this.canScreenshot())throw new ReferenceError("Display media not supported by browser");return this.mediaStreams.getDisplayMedia({video:{displaySurface:"browser",cursor:!1},audio:!1})}},{key:"createScreenshot",value:function(){this.deleteScreenshot(),this.screenshot=document.createElement("canvas"),(0,f.Zs)(this.screenshot,{zIndex:2e3,top:"50%",left:"50%",transform:"translate(-50%, -50%)",margin:"0px auto",position:"fixed"}),this.hide(),this.element.appendChild(this.screenshot)}},{key:"deleteScreenshot",value:function(){this.deleteDraw(),void 0!==this.screenshot&&(this.element.removeChild(this.screenshot),this.screenshot=void 0)}},{key:"setScreenshotDims",value:function(e,t){void 0!==this.screenshot&&(this.screenshot.width=e,this.screenshot.height=t,this.screenshot.style.width="".concat(e,"px"),this.screenshot.style.height="".concat(t,"px"))}},{key:"createDraw",value:function(){void 0!==this.screenshot&&(void 0!==this.draw&&(this.element.removeChild(this.draw),this.draw=void 0),this.draw=this.screenshot.cloneNode(),this.draw.style.zIndex="2001",this.draw.tabIndex=0,this.element.appendChild(this.draw),this.refreshDraw())}},{key:"deleteDraw",value:function(){void 0!==this.draw&&(this.element.removeChild(this.draw),this.draw=void 0)}},{key:"hide",value:function(){this.element.style.display="none",this.clearBrush(),this.deleteDraw(),I.VY.showOnHomepage(),document.body.style.overflow="",E.fire(void 0)}},{key:"show",value:function(){this.element.style.display="block",this.controls.element.style.left="75px",this.controls.element.style.bottom="30px",this.infoTooltip.style.display="block",I.VY.hideOnHomepage(),document.body.style.overflow="hidden",this.createDraw(),this.highlightBrush(),void 0!==this.draw&&this.draw.focus(),A.fire(void 0)}},{key:"copyCanvas",value:function(e,t){if(void 0!==e&&void 0!==t){var n=t.getContext("2d");if(null!==n){var i=n.globalAlpha;n.globalAlpha=1,n.clearRect(0,0,t.width,t.height),n.drawImage(e,0,0),n.globalAlpha=i}}}},{key:"refreshDraw",value:function(){if(void 0!==this.draw){var e=this.draw.getContext("2d");if(null!==e){this.copyCanvas(this.screenshot,this.draw);var t=e.globalAlpha,n=e.strokeStyle;e.globalAlpha=.1,e.strokeStyle="rgb(0, 0, 0)",e.fillRect(0,0,this.draw.width,this.draw.height),e.globalAlpha=t,e.strokeStyle=n}}}},{key:"clearBrush",value:function(){this.controls.hide.style.backgroundColor="transparent",this.controls.hide.classList.toggle("active",!1),this.controls.highlight.style.backgroundColor="transparent",this.controls.highlight.classList.toggle("active",!1),void 0!==this.draw&&(void 0!==this.brushMouseListeners&&((0,c.SC)("mousedown",this.draw,this.brushMouseListeners.down),(0,c.SC)("mouseup",window,this.brushMouseListeners.up),(0,c.SC)("mousemove",window,this.brushMouseListeners.move),this.brushMouseListeners=void 0),this.draw.style.cursor="default")}},{key:"hideBrush",value:function(){if(this.clearBrush(),this.createDraw(),void 0!==this.draw){var e=this.draw.getContext("2d");null!==e&&((0,g.vP)(this.controls.hide,"active"),e.globalAlpha=1,e.strokeStyle="rgb(0, 0, 0)",e.lineWidth=5,this.fillRect=!0,this.canvasBrush())}}},{key:"highlightBrush",value:function(){if(this.clearBrush(),this.createDraw(),void 0!==this.draw){var e=this.draw.getContext("2d");null!==e&&((0,g.vP)(this.controls.highlight,"active"),e.globalAlpha=.8,e.strokeStyle="rgb(249, 185, 144)",e.lineWidth=5,this.fillRect=!1,this.canvasBrush())}}},{key:"canvasBrush",value:function(){var e=this;if(void 0!==this.draw){this.draw.style.cursor="crosshair";var t=this.draw.getContext("2d");if(null!==t){var n=0,i=0,o=0,r=0,s=0,a=0,l=!1,u=function(){n=0,i=0,s=0,a=0,l=!1};this.brushMouseListeners={down:function(o){l&&(e.drawBoxOnScreenshot(n,i,s,a,t),u());var r=e.draw.getBoundingClientRect();n=o.clientX-r.left,i=o.clientY-r.top,l=!0,t.canvas.style.cursor="crosshair"},up:function(o){l&&(e.drawBoxOnScreenshot(n,i,s,a,t),u())},move:function(c){if(l){var u=e.draw.getBoundingClientRect();o=c.clientX-u.left,r=c.clientY-u.top,e.refreshDraw(),s=o-n,a=r-i,e.drawBox(n,i,s,a,t)}}},(0,c.j9)("mousedown",this.draw,this.brushMouseListeners.down),(0,c.j9)("mouseup",window,this.brushMouseListeners.up),(0,c.j9)("mousemove",window,this.brushMouseListeners.move)}}}},{key:"drawBox",value:function(e,t,n,i,o){o.beginPath(),o.rect(e,t,n,i),this.fillRect?o.fill():o.stroke()}},{key:"drawBoxOnScreenshot",value:function(e,t,n,i,o){if(void 0!==this.screenshot){this.screenshot.style.cursor="crosshair";var r=this.screenshot.getContext("2d");null!==r&&(r.globalAlpha=o.globalAlpha,r.strokeStyle=o.strokeStyle,r.lineWidth=o.lineWidth,this.drawBox(e,t,n,i,r))}}}]),n}(h.w);function H(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,a.Z)(this,n)}}var z=function(e){(0,s.Z)(n,e);var t=H(n);function n(e){var i;return(0,o.Z)(this,n),(i=t.call(this,"div",e)).errors=[],i.canvas.canScreenshot()&&(i.updateInfoText(),i.errors.push(i.screenshot.error)),i.errors.push(i.globalError),(0,c.j9)("submit",i.form,(function(e){e.preventDefault(),i.submit()})),i}return(0,r.Z)(n,[{key:"initUI",value:function(e){this.element=B(),this.form=document.createElement("form"),this.form.action=(0,u.BN)("/feedback/submit/"),this.form.method="POST",this.element.appendChild(this.form),this.globalError=document.createElement("p"),this.globalError.style.color="red",this.globalError.style.marginBottom="8px",this.form.appendChild(this.globalError),this.sentiment=this.createSentimentSelection(),this.form.appendChild(this.sentiment.element),this.comments=this.createComments(),this.form.appendChild(this.comments.element),this.canvas=e.canvas,this.canvas.canScreenshot()&&(this.screenshot=new _(e.modal,this.canvas),this.addChild(this.screenshot,this.form)),this.notice=document.createElement("p"),(0,g.vP)(this.notice,"privacyNotice"),this.notice.style.fontSize="10.5px",this.notice.style.lineHeight="14px",this.notice.textContent=v.ag.feedbackNotice.replace("%SITE_NAME%",b.w.siteName),this.form.appendChild(this.notice),this.csrf=document.createElement("input"),this.csrf.type="hidden",this.csrf.name="csrfmiddlewaretoken",this.csrf.value=(0,d.ve)("csrftoken"),this.form.appendChild(this.csrf),this.url=document.createElement("input"),this.url.type="hidden",this.url.name="url",this.url.value=document.location.href.substr(0,255),this.form.appendChild(this.url),this.source=document.createElement("input"),this.source.type="hidden",this.source.name="source",this.source.value="",this.form.appendChild(this.source),this.submitRow=new D,this.addChild(this.submitRow,this.form)}},{key:"createSentimentSelection",value:function(){return new U}},{key:"createComments",value:function(){var e=this;return new Z({prompts:[v.ag.feedbackCommentsLabel],onChange:function(){window.setTimeout((function(){e.comments.anyCommentsNonempty()?e.submitRow.enable():e.submitRow.disable()}),200)},required:!0,textBoxHeight:72})}},{key:"canAddScreenshot",value:function(){return this.canvas.canScreenshot()&&"none"!==this.screenshot.button.style.display}},{key:"updateInfoText",value:function(){this.canAddScreenshot()&&(this.screenshot.info.textContent="footer"===this.source.value?v.ag.feedbackAddScreenshotInfoScrollUp:v.ag.feedbackAddScreenshotInfoScrollDown)}},{key:"updateCSRF",value:function(){this.csrf.value=(0,d.ve)("csrftoken")}},{key:"updateURL",value:function(){this.url.value=document.location.href.substr(0,255)}},{key:"updateSource",value:function(e){this.source.value=e,this.updateInfoText()}},{key:"updateSentiment",value:function(e){this.sentiment.setValue(e)}},{key:"clearErrors",value:function(){this.errors.forEach((function(e){e.textContent=""})),this.comments.clearErrors()}},{key:"resetForm",value:function(){this.forceForm(),this.clearErrors(),this.comments.clear(),this.sentiment.clearSelection(),this.submitRow.disable(),this.form.reset(),this.canvas.canScreenshot()&&this.screenshot.removeScreenshot()}},{key:"forceForm",value:function(){this.removeAllDOMChildren(),this.element.appendChild(this.form),this.comments.focus()}},{key:"submit",value:function(){var e=this;this.clearErrors();var t=new FormData;t.append("sentiment",this.sentiment.formInput.input.value),this.comments.prompts().forEach((function(e){t.append("prompts",e)})),this.comments.values().forEach((function(e){t.append("responses",e)})),t.append("url",document.location.href.substr(0,255)),t.append("source",this.source.value),t.append("csrfmiddlewaretoken",(0,d.ve)("csrftoken")),void 0!==this.canvas.screenshot?this.canvas.screenshot.toBlob((function(n){null!==n&&t.append("screenshot",n,"screenshot.png"),e.postFeedback(t)})):this.postFeedback(t)}},{key:"postFeedback",value:function(e){var t=this;this.submitRow.disable(),(0,u.I5)(this.form.action,e).then((function(e){var n=e.getResponseHeader("content-type");if(null!==n&&n.includes("text/html"))t.globalError.textContent=v.ag.feedbackBannedUser,t.submitRow.enable();else{t.resetForm(),t.element.removeChild(t.form);var i=document.createElement("p");i.textContent=v.ag.feedbackSubmitted,t.element.appendChild(i)}})).catch((function(e){if(429===e.xhr.status)t.globalError.textContent=v.ag.feedbackRateLimitError;else try{var n=JSON.parse(e.xhr.response).responses;void 0!==n&&n.forEach((function(e,n){return t.comments.setError(e,n)}))}catch(e){t.globalError.textContent=v.ag.feedbackUnknownError}t.submitRow.enable()}))}}]),n}(h.w),W=function(e){(0,s.Z)(n,e);var t=H(n);function n(){var e;return(0,o.Z)(this,n),(e=t.call(this,{onShow:function(){e.onShow()},onHide:function(){e.onHide()},easyExit:!0})).isVisible=!1,e.overlayClickStayOpen=!0,e.preventChatFocus=!0,e.element.classList.add("block_CB1_chat_focus"),e.element.dataset.testid="user-feedback-modal",(0,g.vP)(e.overlay,"overlayOpacity"),(0,g.vP)(e.element,"userFeedbackForm"),(0,g.vP)(e.element,g.ql.defaultColor),A.listen((function(){e.element.style.display="none"})),E.listen((function(){e.element.style.display="block"})),w.Co.listen((function(){e.hide()})),e.overlayClick.listen((function(){e.hide()})),e}return(0,r.Z)(n,[{key:"initData",value:function(){var e=this;this.canvas=new j,this.canvas.canScreenshot()&&document.body.appendChild(this.canvas.element),this.inner=B(this.element),this.close=new O,(0,c.j9)("click",this.close.control,(function(){e.hide()})),this.addChild(this.close,this.inner),this.header=new L,this.addChild(this.header,this.inner),this.form=this.createFormContent(),this.canvas.canScreenshot()&&this.canvas.controls.setScreenshot(this.form.screenshot.screenshot),this.addChild(this.form,this.inner);var t=function(){return e.form.submitRow.submit.disabled?e.close.control:e.form.submitRow.submit};this.element.querySelectorAll(".sentimentOption").forEach((function(t){(0,c.j9)("keydown",t,(0,f.hI)(e.form.comments.firstInput(),e.close.control))})),(0,c.j9)("keydown",this.form.comments.element,(0,f.hI)((function(){return e.form.canAddScreenshot()?e.form.screenshot.button:t()}),this.close.control)),this.form.canAddScreenshot()&&(0,c.j9)("keydown",this.form.screenshot.button,(0,f.hI)(t,this.form.comments.lastInput())),(0,c.j9)("keydown",this.form.submitRow.submit,(0,f.hI)(this.close.control,(function(){return e.form.canAddScreenshot()?e.form.screenshot.button:e.form.comments.lastInput()}))),(0,c.j9)("keydown",this.close.control,(0,f.hI)(this.form.comments.firstInput(),(function(){return e.form.submitRow.submit.disabled?e.form.canAddScreenshot()?e.form.screenshot.button:e.form.comments.lastInput():e.form.submitRow.submit})))}},{key:"initUI",value:function(){var e=this;(0,f.Zs)(this.element,{position:"fixed",top:"150px",fontSize:"12px",left:"50%",marginLeft:"-157px",width:"310px",height:"auto",border:"4px",borderRadius:"4px",padding:"15px",fontFamily:"UbuntuRegular, Helvetica, Arial, sans-serif"}),this.canvas.canScreenshot()&&(0,c.j9)("resize",window,(function(){e.form.screenshot.isCapturing||void 0===e.canvas.screenshot||(e.form.screenshot.removeScreenshot(),e.form.screenshot.error.textContent=v.ag.feedbackResize)}))}},{key:"createFormContent",value:function(){return new z({modal:this,canvas:this.canvas})}},{key:"showFromSource",value:function(e){this.form.updateSource(e.source),void 0!==e.sentiment&&this.form.updateSentiment(e.sentiment),this.show()}},{key:"onShow",value:function(){this.form.updateCSRF(),this.form.updateURL(),this.element.style.display="",this.repositionChildren(),this.isVisible=!0,(0,c.j9)("keydown",this.element,K),(0,c.j9)("keydown",document.body,J),this.form.forceForm()}},{key:"onHide",value:function(){var e=this.isVisible;this.element.style.display="none",this.isVisible=!1,e&&((0,c.SC)("keydown",this.element,K),(0,c.SC)("keydown",document.body,J));try{window.dispatchEvent(new Event("resize"))}catch(e){if(-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0){var t=document.createEvent("UIEvents");t.initUIEvent("resize",!0,!1,window,0),window.dispatchEvent(t)}else error("Could not fire resize event")}this.canvas.hide()}}],[{key:"show",value:function(e){void 0===n.instance&&(n.instance=new n),n.instance.showFromSource(e)}}]),n}(p.z),V=function(e){(0,s.Z)(n,e);var t=H(n);function n(e){var i;return(0,o.Z)(this,n),(i=t.call(this,e)).sentiment.inputChange.listen((function(){i.submitRow.enable()})),i}return(0,r.Z)(n,[{key:"createSentimentSelection",value:function(){var e=new U;return e.setPrompt(v.ag.feedbackBroadcasterLabel(b.w.siteName)),e}},{key:"createComments",value:function(){var e=this;return new Z({prompts:[v.ag.haveYouNoticedAnyBugs],onChange:function(){window.setTimeout((function(){""===e.sentiment.getValue()&&(e.comments.anyCommentsNonempty()?e.submitRow.enable():e.submitRow.disable())}),200)},required:!1,textBoxHeight:52})}},{key:"forceForm",value:function(){(0,i.Z)((0,l.Z)(n.prototype),"forceForm",this).call(this),this.comments.blur()}},{key:"submit",value:function(){var e,t;(0,i.Z)((0,l.Z)(n.prototype),"submit",this).call(this);var o=new FormData;o.append("rating",this.sentiment.formInput.input.value),o.append("url",document.location.href.substr(0,255)),o.append("room_user",null!==(e=null===(t=y.J.current.loggedInUser)||void 0===t?void 0:t.username)&&void 0!==e?e:""),(0,u.I5)(m.MP,o).catch((function(){}))}}]),n}(z),q=function(e){(0,s.Z)(n,e);var t=H(n);function n(){var e;return(0,o.Z)(this,n),(e=t.call(this)).form.updateSource("broadcaster_sentiment_survey"),e}return(0,r.Z)(n,[{key:"createFormContent",value:function(){return new V({modal:this,canvas:this.canvas})}}],[{key:"show",value:function(){void 0===n.instance&&(n.instance=new n),n.instance.show()}}]),n}(W),K=function(e){27!==e.keyCode&&e.stopImmediatePropagation()},J=function(e){32===e.keyCode&&e.target===document.body&&e.preventDefault()}},2800:function(e,t,n){"use strict";n.d(t,{J:function(){return v},q:function(){return g}});var i=n(4649),o=n(1976),r=n(2951),s=n(7591),a=n(9492),l=n(7597),c=n(1794),u=function(){function e(){(0,r.Z)(this,e),this.isSet=!1}return(0,o.Z)(e,[{key:"current",get:function(){return this.value},set:function(e){this.isSet||(this.value=e,this.isSet=!0)}}]),e}(),d=n(457);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function f(e){for(var t=1;t2&&void 0!==arguments[2])||arguments[2];(0,i.Z)(this,c),(n=l.call(this)).userCanAccess=o,n.leftContainer=document.createElement("div"),n.rightContainer=document.createElement("div"),n.leftContainer.style.display=n.rightContainer.style.display="inline-block",n.leftContainer.style.height=n.rightContainer.style.height="calc(100% - 20px)",n.leftContainer.style.width=n.rightContainer.style.width="50%",n.leftContainer.style.top=n.rightContainer.style.top="0px",n.leftContainer.style.position=n.rightContainer.style.position="absolute",n.leftContainer.style.left=n.rightContainer.style.right="0px",n.userCanAccess&&(n.leftContainer.style.cursor=n.rightContainer.style.cursor="pointer"),n.leftArrow=document.createElement("div"),n.rightArrow=document.createElement("div"),n.leftArrow.style.position=n.rightArrow.style.position="absolute",n.leftArrow.style.top=n.rightArrow.style.top="".concat((n.leftContainer.offsetHeight-50)/2,"px"),n.leftArrow.style.height=n.rightArrow.style.height="50px",n.leftArrow.style.width=n.rightArrow.style.width="30px",n.leftArrow.style.userSelect=n.rightArrow.style.userSelect="none",n.leftArrow.style.webkitUserSelect=n.rightArrow.style.webkitUserSelect="none",n.leftArrow.style.left=n.rightArrow.style.right="0";var r=function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","svg"),n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d","M5.7 0L0 5.55 18.6 24 0 42.45 5.7 48 30 24 5.7 0z"),n.setAttribute("fill","#E2E2E2"),"left"===e&&n.setAttribute("transform","translate(30, 0) scale(-1,1)"),t.appendChild(n),t.setAttribute("viewBox","0 0 30 50"),t},s=r("left"),a=r("right");n.leftArrow.appendChild(s),n.rightArrow.appendChild(a),n.leftContainer.appendChild(n.leftArrow),n.rightContainer.appendChild(n.rightArrow);var u=n.leftArrow.firstChild.firstChild,d=n.rightArrow.firstChild.firstChild,h=function(e){n.userCanAccess&&("left"===e?u.style.fill="#B8B8B8":d.style.fill="#B8B8B8")},f=function(e){"left"===e?u.style.fill="#E2E2E2":d.style.fill="#E2E2E2"};return n.leftContainer.onmouseenter=function(){h("left")},n.leftContainer.onmouseleave=function(){f("left")},n.rightContainer.onmouseenter=function(){h("right")},n.rightContainer.onmouseleave=function(){f("right")},n.leftContainer.onclick=e,n.rightContainer.onclick=t,n}return(0,o.Z)(c,[{key:"repositionArrows",value:function(e){this.leftArrow.style.top=this.rightArrow.style.top="".concat((e-50)/2,"px")}},{key:"shiftArrows",value:function(e){this.leftArrow.style.left=this.rightArrow.style.right="".concat(e,"px")}},{key:"showArrows",value:function(){this.leftContainer.style.visibility=this.rightContainer.style.visibility="normal",this.userCanAccess&&(this.leftContainer.style.cursor=this.rightContainer.style.cursor="pointer")}},{key:"hideArrows",value:function(){this.leftContainer.style.visibility=this.rightContainer.style.visibility="hidden"}}]),c}(n(9).w)},457:function(e,t,n){"use strict";n.d(t,{d:function(){return o}});var i=n(3940);function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(isNaN(e)&&isNaN(t)&&"number"==typeof e&&"number"==typeof t)return!0;if(e===t)return!0;if(e instanceof Function)return e===t;if("function"==typeof e&&"function"==typeof t||e instanceof Date&&t instanceof Date||e instanceof RegExp&&t instanceof RegExp||e instanceof String&&t instanceof String||e instanceof Number&&t instanceof Number)return e.toString()===t.toString();if(!(e instanceof Object&&t instanceof Object))return!1;if(e.isPrototypeOf(t)||t.isPrototypeOf(e))return!1;if(e.constructor!==t.constructor)return!1;if(e.prototype!==t.prototype)return!1;for(var r in t)if(!(n.indexOf(r)>=0)){if(t.hasOwnProperty(r)!==e.hasOwnProperty(r))return!1;if((0,i.Z)(t[r])!==(0,i.Z)(e[r]))return!1}for(var s in e)if(!(n.indexOf(s)>=0)){if(t.hasOwnProperty(s)!==e.hasOwnProperty(s))return!1;if((0,i.Z)(t[s])!==(0,i.Z)(e[s]))return!1;switch((0,i.Z)(e[s])){case"object":case"function":if(!o(e[s],t[s],n))return!1;break;default:if(e[s]!==t[s])return!1}}return!0}},7600:function(e,t,n){"use strict";n.d(t,{_:function(){return re}});var i=n(5809),o=n(2951),r=n(1976),s=n(391),a=n(8069),l=n(1794),c=n(3705),u=n(9545),d=n(2800),h=n(3243),f=n(7591),p=n(9492),m=n(7597),v=n(8759),g=n(7693),y=n(126),b=n(9570);function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};(0,c.NS)()&&(t.action=e,t.created=this.creationTime,t.client=this.clientName,(0,c.fg)("PushServiceClient",t))}},{key:"connect",value:function(){var e=this;return this.isConnected()?Promise.resolve():this.hasBusyConnection()&&void 0===this.connectPromise?Promise.reject("Connection is currently busy!"):(void 0===this.connectPromise&&(this.connectPromise=new Promise((function(t,n){e.connectionChange.listen((function i(o){"connected"===o.current?e.isConnected()&&(e.connectPromise=void 0,e.connectionChange.removeListener(i),t()):"connecting"===o.previous&&(e.connectPromise=void 0,e.connectionChange.removeListener(i),n(o.reason))})),e._connect()}))),this.connectPromise)}},{key:"isConnected",value:function(){return"connected"===this.getConnectionState()}},{key:"hasBusyConnection",value:function(){return new Set(["connecting","closing"]).has(this.getConnectionState())}},{key:"ensureConnected",value:function(){return this.isConnected()?Promise.resolve():this.connect()}},{key:"ensureConnectedAndAuthed",value:function(e){var t=this;return this.ensureConnected().then((function(){return t.auth.canAccessTopic(e)?Promise.resolve():Promise.reject("Auth context has no access: ".concat(t.auth.serialize()))}))}},{key:"getAuthPromise",value:function(e){var t=this,n=[],i=[];return e.forEach((function(e){-1===t.auth.getTopicKeys().indexOf(e)&&n.push(e),t.isSubscribedTo(e)&&!b.Z.hasPresence(e)||i.push(e)})),n.length<1?Promise.resolve():this.auth.updateAuthToken()}},{key:"isSubscribedTo",value:function(e){return this.auth.canAccessTopic(e)&&this.activeSubscriptions.has(e)}},{key:"subscribe",value:function(e){var t=this;return this.topicsToSubscribe.add(e),this.updateChannelSubscription(e).then((function(){return t.topicPromises.delete(e),Promise.resolve()})).catch((function(n){return t.handleTopicFailure(e),t.topicPromises.delete(e),["closed","closing","disconnected"].includes(t.getConnectionState())?Promise.resolve():Promise.reject(n)}))}},{key:"unsubscribe",value:function(e){var t=this;return this.topicsToSubscribe.delete(e),this.updateChannelSubscription(e).then((function(){t.handleUnsubscribed(e),t.topicPromises.delete(e)})).catch((function(n){return t.handleUnsubscribed(e),t.topicPromises.delete(e),Promise.reject(n)}))}},{key:"updateChannelSubscription",value:function(e){var t=this,n=this.topicPromises.get(e);if(void 0!==n)return n.then((function(){return t.updateChannelSubscription(e)}));var i=this.getChannelName(e);if(void 0===i)return Promise.reject({code:"topic_error",message:"Unknown topic key"});var o=this.getChannelState(i);return this.topicsToSubscribe.has(e)?"subscribed"===o||"subscribing"===o?Promise.resolve():this._subscribe(e):"unsubscribed"===o||"unsubscribing"===o?Promise.resolve():this._unsubscribe(e)}},{key:"checkForReauth",value:function(e){var t=this;if("reauth"===e.getStringOrUndefined("_control")){var n=e.getStringList("_channel_names"),i=[],o=b.Z.getPresenceKeys();n.forEach((function(e){var n=t.getTopicKeys(e);void 0!==n?n.forEach((function(e){i.push(t.unsubscribe(e))})):i.push(Promise.resolve())})),i.push.apply(i,(0,y.Z)(o.map((function(e){return t.unsubscribe(e)})))),Promise.all(i).then((function(){n.forEach((function(e){var n,i=t.getTopicKeys(e);null===(n=t.context)||void 0===n||n.deleteChannel(e),void 0!==i&&i.forEach((function(e){var n;null===(n=t.context)||void 0===n||n.deleteTopic(e)}))})),re.updateAuthorization()})).catch((function(e){e.topics=n,error("Error during re-auth detach",e,"PUSH_")}))}}},{key:"handleSubscribed",value:function(e){this.failedTopics.delete(e),this.activeSubscriptions.add(e),this.callbacks.onSubscribe(this.clientName,e,!0)}},{key:"handleUnsubscribed",value:function(e){this.failedTopics.delete(e),this.activeSubscriptions.delete(e),this.callbacks.onSubscribe(this.clientName,e,!1)}},{key:"handleTopicFailure",value:function(e){var t=this.failedTopics.get(e);this.failedTopics.set(e,void 0===t?1:t+1)}},{key:"shouldRetrySubscribe",value:function(){var e,t=this.auth.getTopicKeys(),n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return w(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)?w(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(this.failedTopics.entries());try{for(n.s();!(e=n.n()).done;){var o=(0,i.Z)(e.value,2),r=o[0],s=o[1];if(t.includes(r)&&se.criticalFailLimit}))}},{key:"getConnectionType",value:function(){return""}},{key:"getConnectionId",value:function(){return""}},{key:"getClientId",value:function(){return""}},{key:"getConnectionHost",value:function(){return""}},{key:"getConnectionServer",value:function(){return""}},{key:"getConnectionSerial",value:function(){return""}},{key:"getChannelName",value:function(e){var t;return null===(t=this.context)||void 0===t?void 0:t.getChannelName(e)}},{key:"getTopicKeys",value:function(e){var t;return null===(t=this.context)||void 0===t?void 0:t.getTopicKeys(e)}},{key:"getChannelTopicMap",value:function(e){var t;return null===(t=this.context)||void 0===t?void 0:t.getChannelTopicMap(e)}},{key:"addExternalMessage",value:function(e,t){var n="".concat(this.getChannelName(e),":").concat(t);return void 0!==this.messagesInChat.get(n)||(this.messagesInChat.set(n,[]),void 0!==this.seenMessages.get(n))}},{key:"handleMessageDuplicate",value:function(e,t,n){var i="".concat(e,":").concat(n),o=this.seenMessages.get(i);if(void 0===o){if(this.seenMessages.size>this.seenMessagesLimit){var r=Array.from(this.seenMessages.entries());this.seenMessages=new Map(r.splice(Math.floor(-.5*r.length)))}return this.seenMessages.set(i,[this.getDuplicateMessageMeta(t)]),!1}return o.push(this.getDuplicateMessageMeta(t)),0!==o.length&&this.reportDuplicateMessage(e,t,n,o),!0}},{key:"reportDuplicateMessage",value:function(e,t,n,i){var o=this.duplicateMessageAttributes(e,t,n,i);debug("[PushService] Duplicate Message: ",o),(0,c.NS)()&&(0,c.fg)("PushDuplicateMessage",o)}},{key:"duplicateMessageAttributes",value:function(e,t,n,i){var o,r=i[0],s=null!==(o=t.getParsedSubMap("providerData").getStringOrUndefined("id"))&&void 0!==o?o:"invalid_provider_id",a=this.hashMessage(t.stringMessage);return{tid:n,first_seen_time:r.timestamp,time_since_first_seen:(new Date).getTime()-r.timestamp,num_duplicates:i.length,client:this.clientName,connection_host:this.getConnectionHost(),connection_type:this.getConnectionType(),connection_state:this.getConnectionState(),num_reconnects:this.getReconnectCount(),same_content:a===r.hash,same_pid:s===r.providerId,same_server:r.server===this.hashMessage(this.getConnectionServer()),same_host:r.host===this.hashMessage(this.getConnectionHost()),orig_connection_serial:r.connectionSerial,channel_name:e,pid:s}}},{key:"hashMessage",value:function(e){return""===e?"":Array.from(e,(function(e){return e.charCodeAt(0)})).reduce((function(e,t){return e+t})).toString()+e.length.toString()}},{key:"getDuplicateMessageMeta",value:function(e){var t;return{timestamp:(new Date).getTime(),hash:this.hashMessage(e.stringMessage),providerId:null!==(t=e.getParsedSubMap("providerData").getStringOrUndefined("id"))&&void 0!==t?t:"invalid_provider_id",server:this.hashMessage(this.getConnectionServer()),host:this.hashMessage(this.getConnectionHost()),connectionSerial:this.getConnectionSerial()}}}]),e}();var I="a",P=function(e){(0,f.Z)(a,e);var t,n,i=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,m.Z)(t);if(n){var o=(0,m.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,p.Z)(this,e)});function a(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,o.Z)(this,a),(n=i.call(this,e)).clientName=I,n.shouldRewind=new Set,n.settings=t,n.connectionChange=new l.xB("AblyClientConnection"),n.shouldAutoDisconnect=!r;try{n.realtime=new Ably.Realtime.Promise(n.getClientOptions())}catch(e){throw Z("connect",e.toString())}n.auth=new U(n.realtime);var s=["disconnected","failed","suspended"];return n.realtime.connection.on((function(e){if(e.previous!==e.current){var t,i=C(e.previous),o=C(e.current),r=F("connect",e.reason);(s.includes(o)&&204!==(null===(t=e.reason)||void 0===t?void 0:t.statusCode)||"connected"===o)&&n.connectionChange.fire({previous:i,current:o,reason:r,client:"a"})}})),n.shouldAutoDisconnect||(0,g.j9)((0,v.BV)(),window,(function(){n.close()})),n}return(0,r.Z)(a,[{key:"getClientOptions",value:function(){var e=this,t={autoConnect:!1,closeOnUnload:this.shouldAutoDisconnect,log:{level:1},authCallback:function(t,n){e.auth.fetchTokenRequest().then((function(t){t.isValid()?(e.context=t,n(void 0,t.getTokenRequest())):n("Invalid token request")})).catch((function(e){n(e.message)}))},restHost:this.settings.restHost,realtimeHost:this.settings.realtimeHost,transportParams:{remainPresentFor:"0"}};return this.settings.fallbackHosts.length>0&&(t.fallbackHosts=this.settings.fallbackHosts),t}},{key:"_connect",value:function(){this.realtime.connect()}},{key:"close",value:function(){this.realtime.close()}},{key:"getConnectionState",value:function(){return C(this.realtime.connection.state)}},{key:"getChannelState",value:function(e){return x(this.realtime.channels.get(e).state)}},{key:"getConnectionType",value:function(){var e,t;return null!==(e=null===(t=this.realtime.connection)||void 0===t||null===(t=t.connectionManager)||void 0===t||null===(t=t.activeProtocol)||void 0===t||null===(t=t.transport)||void 0===t?void 0:t.shortName)&&void 0!==e?e:""}},{key:"getConnectionId",value:function(){return this.realtime.connection.id}},{key:"getClientId",value:function(){var e,t;return null!==(e=null===(t=this.realtime.connection)||void 0===t||null===(t=t.connectionManager)||void 0===t||null===(t=t.connectionDetails)||void 0===t?void 0:t.clientId)&&void 0!==e?e:""}},{key:"getConnectionHost",value:function(){var e,t;return null!==(e=null===(t=this.realtime.connection)||void 0===t||null===(t=t.connectionManager)||void 0===t?void 0:t.host)&&void 0!==e?e:""}},{key:"getConnectionServer",value:function(){var e,t;return null!==(e=null===(t=this.realtime.connection)||void 0===t||null===(t=t.connectionManager)||void 0===t||null===(t=t.connectionDetails)||void 0===t?void 0:t.serverId)&&void 0!==e?e:""}},{key:"getConnectionSerial",value:function(){var e,t;return null!==(e=null===(t=this.realtime.connection)||void 0===t||null===(t=t.connectionManager)||void 0===t?void 0:t.connectionSerial)&&void 0!==e?e:""}},{key:"getReconnectCount",value:function(){return-1}},{key:"duplicateMessageAttributes",value:function(e,t,n,i){var o,r,s,l,c,u,d=(0,h.Z)((0,m.Z)(a.prototype),"duplicateMessageAttributes",this).call(this,e,t,n,i);return d.connection_id=this.getConnectionId(),d.recovery_key=this.realtime.connection.recoveryKey,d.client_id=this.getClientId(),d.server_id=this.getConnectionServer(),d.connection_serial=this.getConnectionSerial(),d.connection_key=null!==(o=null===(r=this.realtime.connection)||void 0===r||null===(r=r.connectionManager)||void 0===r||null===(r=r.connectionDetails)||void 0===r?void 0:r.connectionKey)&&void 0!==o?o:"",d.msg_serial=null!==(s=null===(l=this.realtime.connection)||void 0===l||null===(l=l.connectionManager)||void 0===l?void 0:l.msgSerial)&&void 0!==s?s:"",d.recovery_key=null!==(c=null===(u=this.realtime.connection)||void 0===u?void 0:u.recoveryKey)&&void 0!==c?c:"",d}},{key:"_subscribe",value:function(e){var t=this,n=this.getChannelName(e);if(void 0===n)return Promise.reject(Z("topic_error","Invalid topic key reached subscribe"));var i=this.subscribedTopicKeysByChannel.get(n);if(void 0===i)this.subscribedTopicKeysByChannel.set(n,[e]);else if(!i.includes(e))return i.push(e),this.subscribedTopicKeysByChannel.set(n,i),Promise.resolve();var o=this.realtime.channels.get(n),r=new Promise((function(i,r){t.ensureConnectedAndAuthed(e).then((function(){var n=t.shouldRewind.delete(e);return o.setOptions({cipher:void 0,params:n?{rewind:"30s"}:{},modes:["SUBSCRIBE","PRESENCE"]})})).then((function(){return o.attach()})).then((function(){return o.unsubscribe(),o.subscribe((function(e){e.data.providerData={id:e.id,ts:e.timestamp};var i=new s.j(e.data);t.checkForReauth(i);var o,r=t.getChannelTopicMap(n);if(void 0!==r&&(o=r.get(i.getString("_topic"))),void 0!==o){if(t.handleMessageDuplicate(n,i,i.getString("tid")))return;t.callbacks.onMessage(t.clientName,o,i)}else warn("Received message for unknown topic",{topic:i.getString("_topic"),client:t.clientName})}))})).then((function(){var e=t.getTopicKeys(n);void 0!==e&&e.forEach((function(e){t.handleSubscribed(e)})),i()})).catch((function(e){"suspended"===o.state&&o.detach().then().catch((function(){})),r(Z("subscribe",e))}))}));return this.topicPromises.set(e,r),r}},{key:"_unsubscribe",value:function(e){var t=this.getChannelName(e);if(void 0===t)return Promise.reject(Z("topic_error","Invalid topic key reached unsubscribe"));var n=this.subscribedTopicKeysByChannel.get(t);if(void 0!==n&&n.includes(e)){var i=n.indexOf(e);if(n.splice(i,1),this.subscribedTopicKeysByChannel.set(t,n),0!==n.length)return Promise.resolve();this.subscribedTopicKeysByChannel.delete(t)}var o=this.realtime.channels.get(t),r=x(o.state);if(o.unsubscribe(),["unsubscribed","initialized","failed"].includes(r))return this.handleUnsubscribed(e),Promise.resolve();var s=new Promise((function(e,t){o.detach().then((function(){e()})).catch((function(e){t(Z("unsubscribe",e))}))}));return this.topicPromises.set(e,s),s}},{key:"enterPresence",value:function(e,t){var n=this,i=this.topicPromises.get(e);if(void 0!==i)return Promise.reject(Z("topic_error","Called subscribe while channel is busy"));var o=this.getChannelName(e);if(void 0===o)return Promise.reject(Z("topic_error","Unknown topic key"));var r=this.realtime.channels.get(o);return new Promise((function(i,s){n.ensureConnectedAndAuthed(e).then((function(){return r.setOptions({cipher:void 0,params:{},modes:["SUBSCRIBE","PRESENCE"]})})).then((function(){return r.attach()})).then((function(){var e=n.auth.getCapabilities()[o];return Array.isArray(e)&&e.includes("presence")?void 0!==t&&t.changed?r.presence.update(t.data):Promise.resolve():Promise.reject(Z("presence","Token does not have capability for presence"))})).then((function(){n.handleSubscribed(e),i()})).catch((function(t){n.topicPromises.delete(e),n.handleTopicFailure(e),s(Z("presence",t))}))}))}},{key:"leavePresence",value:function(e){var t=this,n=this.getChannelName(e);return void 0===n?Promise.reject(Z("topic_error","Unknown topic key")):this.realtime.channels.get(n).presence.leave().then((function(){t.handleUnsubscribed(e)})).catch((function(n){return t.handleUnsubscribed(e),Promise.reject(Z("presence",n))}))}},{key:"getSubscriptionState",value:function(e){var t=this.getChannelName(e);return void 0===t?"unknown":x(this.realtime.channels.get(t).state)}},{key:"isSubscribedTo",value:function(e){return"subscribed"===this.getSubscriptionState(e)}}]),a}(T);var R=function(e){(0,f.Z)(s,e);var t,n,i=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,m.Z)(t);if(n){var o=(0,m.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,p.Z)(this,e)});function s(e){var t;return(0,o.Z)(this,s),(t=i.call(this,e)).tokenRequest=e.getObject("token_request"),t.jwtToken=e.getString("token"),""!==t.jwtToken&&void 0!==t.tokenRequest.keyName||warn("invalid AblyContext",{contextKeys:e.keys().join(","),context:e.stringMessage}),e.ignore("token_request"),e.logUnusedDebugging("AblyContext"),t}return(0,r.Z)(s,[{key:"parseSettings",value:function(e){return s.parseSettings(e)}},{key:"isValid",value:function(){return void 0!==this.tokenRequest}},{key:"getTokenRequest",value:function(){if(void 0===this.jwtToken)throw new Error("Access to AblyContext.tokenRequest on an invalid context!");return this.jwtToken}},{key:"serialize",value:function(){return JSON.stringify(this.tokenRequest)}}],[{key:"parseSettings",value:function(e){var t={backend:I,restHost:e.getStringOrUndefined("rest_host"),realtimeHost:e.getStringOrUndefined("realtime_host"),fallbackHosts:e.getStringList("fallback_hosts"),flags:new Map};return k(t.flags,e.getObjectOrUndefined("flags")),t}}]),s}(S),M=n(3940),A=n(4649),E=n(3753);function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var O="push_service/auth/";function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=re.getClientName()===e,i=re.getTopicKeysToAuth();i.length>100&&(warn("PushService is attempting to request too many topics",{},"PUSH_"),i.length=100);var o={};i.forEach((function(e){var t=re.getTopicAuthData(e);void 0===t||t.subscribeOnlyOnPrimaryBackend&&!n||(o[t.key]=t.payload)}));var r=function(e){for(var t=1;t=3&&!1===o&&e.realtime.connection.close(),n(t)}))}))}},{key:"reportFailedTopics",value:function(e){var t=e.getObjectOrUndefined("failures");"object"===(0,M.Z)(t)&&0!==Object.keys(t).length&&(0,c.fg)("PushServiceClient",{action:"token_request_failed_topics",topics:t,client:I})}},{key:"canAccessTopic",value:function(e){var t,n=null===(t=this.ablyContext)||void 0===t?void 0:t.getChannelName(e);return void 0!==n&&void 0!==this.authToken&&this.authToken.getChannelNames().includes(n)}},{key:"getTopicKeys",value:function(){var e=this;if(void 0===this.authToken)return[];var t=this.authToken.getChannelNames(),n=[];return t.forEach((function(t){var i,o=null===(i=e.ablyContext)||void 0===i?void 0:i.getTopicKeys(t);void 0!==o&&n.push.apply(n,(0,y.Z)(o))})),n}},{key:"updateAuthToken",value:function(){var e=this;return new Promise((function(t,n){e.realtime.auth.authorize().then((function(n){var i=JSON.parse(atob(n.token.split(".")[1]));e.authToken=new D(new s.j(i)),t()})).catch((function(e){var t=Z("auth",e);n(t)}))}))}}]),e}();function Z(e,t){return void 0===t?{code:e,message:"Unknown",providerCode:""}:"string"==typeof t?{code:e,message:t,providerCode:""}:"statusCode"in t?F(e,t):t}function F(e,t){var n={code:e,message:"Unknown failure",providerCode:""};return void 0!==t&&(n.message=t.message,n.providerCode=t.code.toString(),void 0!==t.cause&&"code"in t.cause&&(n.cause=t.cause.code)),n}var _=n(7169);var N=function(e){(0,f.Z)(s,e);var t,n,i=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,m.Z)(t);if(n){var o=(0,m.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,p.Z)(this,e)});function s(e){var t;return(0,o.Z)(this,s),(t=i.call(this,e)).tokenRequest=e.getObject("token_request"),e.logUnusedDebugging("DevContext"),t}return(0,r.Z)(s,[{key:"parseSettings",value:function(e){return s.parseSettings(e)}},{key:"isValid",value:function(){return void 0!==this.tokenRequest}},{key:"getTokenRequest",value:function(){if(void 0===this.tokenRequest)throw new Error("Access to tokenRequest on an invalid context!");return this.tokenRequest}},{key:"serialize",value:function(){return JSON.stringify(this.tokenRequest)}}],[{key:"parseSettings",value:function(e){var t={backend:W,flags:new Map,url:e.getStringOrUndefined("url")};return k(t.flags,e.getObjectOrUndefined("flags")),t}}]),s}(S),j=function(){function e(t,n){(0,o.Z)(this,e),this.client=t,this.consecutiveAuthFails=0,this.context=n}return(0,r.Z)(e,[{key:"serialize",value:function(){var e;return!0!==(null===(e=this.context)||void 0===e?void 0:e.isValid())?"":this.context.serialize()}},{key:"fetchAccessToken",value:function(){var e=this;return this.getRequestToken().then((function(t){return e.getAccessToken(t)}))}},{key:"getRequestToken",value:function(){var e=this;return new Promise((function(t,n){return L(W).then((function(i){e.consecutiveAuthFails=0;var o=i.getObjectOrUndefined("failures");if("object"===(0,M.Z)(o)&&0!==Object.keys(o).length&&(0,c.fg)("PushServiceClient",{action:"token_request_failed_topics",topics:o,client:W}),e.context=new N(i),e.context.isValid()){e.client.context=e.context;var r=e.context.getTokenRequest();t(r)}else n("Invalid token request")})).catch((function(t){e.consecutiveAuthFails+=1,e.consecutiveAuthFails>=3&&debug("Should be closing connection and reverting to ably/wowza"),n(t)}))}))}},{key:"getAccessToken",value:function(e){var t=this;return new Promise((function(n,i){if(void 0!==t.context){var o=new XMLHttpRequest,r=void 0===t.context.settings.url?"":"http://".concat(t.context.settings.url);o.open("POST","".concat(r,"/auth/access_token"),!0),o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.onload=function(){if((0,E.nw)(o.status)){var e=new s.j(o.responseText);n(e.getString("access_token"))}else i(new E.GM(o))},o.send(JSON.stringify({request_token:e}))}else i("no context")}))}},{key:"canAccessTopic",value:function(e){var t;return void 0!==(null===(t=this.context)||void 0===t?void 0:t.getChannelName(e))}},{key:"getTopicKeys",value:function(){return[]}},{key:"getFailedTopics",value:function(){return[]}},{key:"updateAuthToken",value:function(){return this.client.updateAuth()}},{key:"reportFailedTopics",value:function(e){debug("Failed topics on dev service",e.stringMessage)}}]),e}();function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function z(e){for(var t=1;t=3&&e.realtime.close(),Promise.reject(t)}))}))}},{key:"reportFailedTopics",value:function(e){var t=e.getObjectOrUndefined("failures");"object"===(0,M.Z)(t)&&0!==Object.keys(t).length&&(0,c.fg)("PushServiceClient",{action:"token_request_failed_topics",topics:t,client:q})}}]),e}();var Y=function(e){(0,f.Z)(s,e);var t,n,i=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,m.Z)(t);if(n){var o=(0,m.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,p.Z)(this,e)});function s(e){var t;return(0,o.Z)(this,s),t=i.call(this,e),e.logUnusedDebugging("PusherContext"),t}return(0,r.Z)(s,[{key:"parseSettings",value:function(e){return s.parseSettings(e)}},{key:"isValid",value:function(){return!0}}],[{key:"parseSettings",value:function(e){var t={backend:q,flags:new Map,key:e.getString("key"),cluster:e.getString("cluster"),host:e.getStringOrUndefined("host")};return k(t.flags,e.getObjectOrUndefined("flags")),t}}]),s}(S);function $(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Q(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;this.totalFailures+=1;var i=Q(Q(Q(Q({},t),this.connectionHistory),this.messageCount),{},{topic:n.split(":")[0],topicKey:n,userid:n.split(":")[1],reason:e,start_time:this.startTime,total_failures:this.totalFailures,room_count:this.roomCount});debug("Push Service clients verifier failure",i),(0,c.NS)()&&(0,c.fg)("PushClientVerifier",i)}},{key:"handleItemMatch",value:function(e,t){if(!e.clients.includes(t.clientName)){e.clients.push(t.clientName);var n=(new Date).getTime()-e.timestamp;n>this.lateTime&&this.handleItemLate(e,t,n),e.messageHash!==t.messageHash&&this.handleItemDiffers(e,t),0===this.activeClients.filter((function(t){return!e.clients.includes(t)})).length&&debug("Push service clients verifier success",e)}}},{key:"handleItemNeverArrived",value:function(e,t,n){var i=this.activeClients.filter((function(e){return!t.clients.includes(e)}));i.length>0&&this.recordFailure("never_arrived",{tid:e,first_ts:t.timestamp,first_client:t.clients[0],failedClients:i,initialClients:t.initialClients,connectedClients:this.connectedClients,isConnected:!!this.connectedClients.includes(i[0])},n)}},{key:"handleItemDiffers",value:function(e,t){this.recordFailure("differs",{tid:t.tid,first_ts:e.timestamp,first_client:e.clients[0],failed_client:t.clientName,first_hash:e.messageHash,differ_hash:t.messageHash},t.topicKey)}},{key:"handleItemLate",value:function(e,t,n){this.recordFailure("late",{late:n,tid:t.tid,first_ts:e.timestamp,first_client:e.clients[0],failed_client:t.clientName},t.topicKey)}},{key:"trackTimeout",value:function(e){var t=this,n=window.setTimeout((function(){e(),t.timeouts.delete(n)}),this.expireTime);this.timeouts.add(n)}},{key:"hashMessage",value:function(e){var t=JSON.parse(e.stringMessage);return delete t.providerData,delete t.id,delete t.pub_ts,delete t.ts,delete t.method,delete t.channel,JSON.stringify(t)}},{key:"recordDisconnect",value:function(e){this.connectedClients=this.connectedClients.filter((function(t){return t!==e}))}},{key:"setLastMessage",value:function(e,t){var n;this.connectionHistory["".concat(e,"_time")]=t,this.messageCount["".concat(e,"_messages")]=(null!==(n=this.messageCount["".concat(e,"_messages")])&&void 0!==n?n:0)+1}},{key:"setRoomCount",value:function(e){this.roomCount=e}},{key:"validateClient",value:function(e){this.activeClients.includes(e)||this.activeClients.push(e)}}]),e}();function te(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ne(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)?ne(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);nt.maxListeners&&warn("Too many instances of topic created",{topic:t.getKey(),num_listeners:n.length},"PUSH_"),n.push(t)),e.topics.set(t.getKey(),n),s._.updateAuthorization()}},{key:"removeTopic",value:function(t){var n=e.topics.get(t.getKey());if(void 0!==n){var i=n.indexOf(t);if(n.splice(i,1),n.length<1){if(e.topics.delete(t.getKey()),e.pending.set(t.getKey(),t),e.unsubscribedTracker.size>e.unsubscribedLimit){var o=Array.from(e.unsubscribedTracker.entries());e.unsubscribedTracker=new Map(o.splice(0,e.unsubscribedLimit/2))}e.unsubscribedTracker.set(t.getKey(),new Date),s._.stopListeningFor(t.getKey()).then((function(){e.pending.delete(t.getKey())})).catch((function(){}))}else e.topics.set(t.getKey(),n)}}},{key:"getTopicKeys",value:function(){var t=Array.from(e.presence.keys()),n=function(e){return e.onMessage.listenerCount()>0||e.onSubscribeChange.listenerCount()>0};return e.topics.forEach((function(e,i){e.some(n)&&t.push(i)})),t}},{key:"getPresenceKeys",value:function(){return Array.from(e.presence.keys())}},{key:"getPendingTopics",value:function(){return Array.from(e.pending.keys())}},{key:"hasPresence",value:function(t){return e.presence.has(t)}},{key:"getPresence",value:function(t){return e.presence.get(t)}},{key:"getTopic",value:function(t){var n=e.presence.get(t);if(void 0!==n)return n.topic;var i=e.pending.get(t);if(void 0!==i)return i;var o=e.topics.get(t);return void 0!==o&&0!==o.length?o[0]:void 0}},{key:"getTopicAuthData",value:function(t){var n=e.getTopic(t);if(void 0!==n)return{key:n.getAuthKey(),payload:n.getAuthData(),subscribeOnlyOnPrimaryBackend:n.subscribeOnlyOnPrimaryBackend}}},{key:"enterPresence",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.presence.set(t.getKey(),{changed:!0,data:n,topic:t}),s._.updateAuthorization()}},{key:"leavePresence",value:function(t){var n=t.getKey();e.presence.has(n)&&(e.presence.delete(n),e.pending.set(n,t),s._.stopListeningFor(t.getKey()).then((function(){e.pending.delete(n)})).catch((function(){})))}}]),e}();(i=a).topics=new Map,i.presence=new Map,i.pending=new Map,i.missingTopics=new Set,i.unsubscribedTracker=new Map,i.unsubscribedLimit=100},8016:function(e,t,n){"use strict";n.d(t,{C$:function(){return M},HL:function(){return S},HS:function(){return B},IH:function(){return x},OC:function(){return Z},Ol:function(){return U},Pg:function(){return I},Tz:function(){return b},Wg:function(){return E},X_:function(){return w},Xv:function(){return O},Z4:function(){return y},Zv:function(){return D},_G:function(){return k},a6:function(){return C},aS:function(){return T},l7:function(){return _},qZ:function(){return A},tL:function(){return L},xp:function(){return P},yK:function(){return R},zw:function(){return F}});var i=n(4649),o=n(3243),r=n(2951),s=n(1976),a=n(7591),l=n(9492),c=n(7597),u=n(5011),d=n(1794),h=n(6547);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function p(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0,o=this.getImageStreamer(e);return void 0===o&&(o=new h.hE(e,t,{startStreaming:n,useWideImages:void 0===i?!f.J.current.isMobile:i,streamingFadeoutTimeoutMs:0}),this.streamers.set(e,o)),o}},{key:"safariReloadAllImages",value:function(){var e,t=v(this.streamers.values());try{for(t.s();!(e=t.n()).done;)e.value.safariReloadImage()}catch(e){t.e(e)}finally{t.f()}}}],[{key:"getInstance",value:function(){return void 0===e.instance&&(e.instance=new e),e.instance}},{key:"scheduleRefresh",value:function(t){e.clearRefresh(),t>0&&(e.refreshTimer=window.setTimeout((function(){e.getInstance().loadRooms(),e.scheduleRefresh(t)}),t*C))}},{key:"scheduleImageRefresh",value:function(t){e.clearImageRefresh(),t>0&&(e.refreshImageTimer=window.setTimeout((function(){e.getInstance().loadImages(),e.scheduleImageRefresh(t)}),t*C))}},{key:"clearRefresh",value:function(){clearTimeout(e.refreshTimer)}},{key:"clearImageRefresh",value:function(){clearTimeout(e.refreshImageTimer)}},{key:"exportToJS",value:function(){return{addOnLoadHandler:P,loadRooms:R,scheduleRefresh:M,chatRoomListOnClick:E,startStreaming:D,stopStreaming:U,clearRefresh:A,setRoomAnimation:O}}}]),e}();function P(e){I.getInstance().addOnLoadHandler(e)}function R(e){I.getInstance().loadRooms(e)}function M(e){I.scheduleRefresh(e)}function A(){I.clearRefresh()}function E(e,t,n,i,o,r){S(e,k(t),n,{sourceIndex:i,hashtag:o,roomListId:r})}var B=!1;function O(e){B=e}function L(){return B}function D(e,t,n,i){(void 0===i?L():i)&&null!==t&&I.getInstance().getOrCreateImageStreamer(e,t,!0,n).startStreaming()}function U(e,t){if(void 0===t?L():t){var n=I.getInstance().getImageStreamer(e);void 0!==n&&(n.stopStreaming(),I.getInstance().removeImageStreamer(e))}}var Z={buildTooltip:m.T};function F(e){var t=(0,u.ej)();if(t!==u.Y0.All){var n=f.J.current.isMobile?".subject > a":".subject > li > a";e.querySelectorAll(n).forEach((function(e){e.href=(0,a.BN)(e.href.concat("".concat(u.aI.get(t),"/")))}))}}},1006:function(e,t,n){"use strict";n.d(t,{_B:function(){return L},gH:function(){return A},rS:function(){return E}});var i=n(7791),o=n(2951),r=n(1976),s=n(824),a=n.n(s),l=n(5809),c=n(2800),u=n(1282);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(t);try{for(m.s();!(i=m.n()).done;){var v=i.value.split("|"),g=(0,l.Z)(v,4),y=g[0],b=g[1],w=g[2],C=g[3],x=b;if((0,u.L)("PushEnblRecEnter")&&void 0!==c.J.current.loggedInUser&&!r){var k,S,T=c.J.current.loggedInUser.username.localeCompare(y);if(0===T)r=!0;else if(x===a){if(T<0){var I,P=f(c.J.current.loggedInUser.username,a,null!==(I=c.J.current.loggedInUser.gender)&&void 0!==I?I:"",p);o.push(P),r=!0}}else if((null!==(k=h.get(x))&&void 0!==k?k:0)>(null!==(S=h.get(a))&&void 0!==S?S:0)){var R,M=f(c.J.current.loggedInUser.username,a,null!==(R=c.J.current.loggedInUser.gender)&&void 0!==R?R:"",p);o.push(M),r=!0}}var A=f(y,x,w,C);o.push(A)}}catch(e){m.e(e)}finally{m.f()}if((0,u.L)("PushEnblRecEnter")&&!r&&void 0!==c.J.current.loggedInUser){var E,B=f(c.J.current.loggedInUser.username,a,null!==(E=c.J.current.loggedInUser.gender)&&void 0!==E?E:"",p);o.push(B),r=!0}return{totalCount:n+o.length,anonCount:n,roomUsers:o}}(t.responseText)),window.setTimeout((function(){return x.delete(o)}),3e3)})).catch((function(e){t(e),x.delete(o)}))}));return x.set(o,s),s}var S=n(9972),T=n(8666),I=n(7212),P=function(e,t){return e+Math.floor(Math.random()*t)},R=30*P(1,10)*1e3,M=R+60*P(2,10)*1e3,A=function(){return c.J.current.realtimeUserlistEnabled},E=new v.xB("roomUsersUpdate",{maxHistorySize:1,listenersWarningThreshold:function(){return 50+3*v.q6}}),B=["o","m","f","l","p","tr","t","g"],O=function(e,t){var n=B.indexOf(p(e)),i=B.indexOf(p(t));return n!==i?n0&&void 0!==arguments[0]&&arguments[0]?this.publicUserList:this.activeUserList;return{totalCount:null!==(e=null==i?void 0:i.getTotalUsers())&&void 0!==e?e:0,anonCount:null!==(t=null==i?void 0:i.getAnonUsers())&&void 0!==t?t:0,roomUsers:null!==(n=null==i?void 0:i.getUsers())&&void 0!==n?n:[]}}},{key:"userInRoomState",value:function(e){var t,n;return!0===(null===(t=this.activeUserList)||void 0===t?void 0:t.hasUser(e))?0:!0===(null===(n=this.publicUserList)||void 0===n?void 0:n.hasUser(e))?1:2}},{key:"refetch",value:(t=(0,i.Z)(a().mark((function e(){var t,n,i,o,r,s,l,u=this,d=arguments;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=d.length>0&&void 0!==d[0]&&d[0],n=d.length>1&&void 0!==d[1]&&d[1],c.J.current.isBroadcast){e.next=4;break}return e.abrupt("return");case 4:if(t||void 0===this.refetchedRecentlyTimeout&&!this.refetchDisabled){e.next=6;break}return e.abrupt("return");case 6:return window.clearTimeout(this.refetchedRecentlyTimeout),this.refetchedRecentlyTimeout=window.setTimeout((function(){u.refetchedRecentlyTimeout=void 0}),2e3),e.next=10,this.fetchRoomUsers(!0);case 10:i=e.sent,(o=new D(i,this.sortUsersBy)).includeCurrentUser(),this.recentPublicEnterLeaves.forEach((function(e){var t=e.user;"enter"===e.action?o.addUser(t):o.deleteUser(t)})),r=void 0!==this.publicUserList&&!o.equals(this.publicUserList),(n||c.J.current.isBroadcast&&r)&&(void 0!==this.latestRefetchTime&&(l=((l=performance.now()-this.latestRefetchTime)-R)/6e4),(0,g.fg)("RoomUserListsMismatched",{current_size:null===(s=this.publicUserList)||void 0===s?void 0:s.getUsers().length,new_size:o.getUsers().length,time_elapsed_m:(performance.now()-this.roomLoadTime)/6e4,time_since_last_refetch_m:l,refetch_count:this.refetchCounter,lag_window_m:R/6e4})),this.latestRefetchTime=performance.now(),this.refetchCounter+=1,this.publicUserList=o,E.fire(this.getRoomUsersInfo());case 20:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"toggleRefetch",value:function(e){this.refetchDisabled=!e}},{key:"fetchRoomUsers",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(void 0===this.room)return error("roomUsers: calling fetchRoomUsers when not in a room"),Promise.reject("not in a room");var i=!n&&null!==(e=null===(t=this.chatConnection)||void 0===t?void 0:t.inPrivateRoom())&&void 0!==e&&e;return k(this.room,this.sortUsersBy,i)}},{key:"initializePublicUserList",value:function(){var e=this;this.listenForPublicEnterLeaves(),window.setTimeout((function(){e.refetch().catch(y.$x)}),3e3),window.setTimeout((function(){e.refetch().catch(y.$x)}),R),this.refetchInterval=window.setInterval((function(){e.refetch().catch(y.$x)}),M)}},{key:"cleanupPublicUserList",value:function(){this.publicListeners.removeAll(),this.recentPublicEnterLeaves.clear(),window.clearTimeout(this.refetchedRecentlyTimeout),window.clearInterval(this.refetchInterval),this.refetchedRecentlyTimeout=void 0,this.publicUserList=void 0}},{key:"listenForPublicEnterLeaves",value:function(){var e=this;void 0!==this.roomUid?(c.J.current.isBroadcast||c.q.getState().isModerator)&&(new I.rc(this.roomUid).onMessage.listen((function(t){e.onPublicEnterLeave(t.user,t.action)})).addTo(this.publicListeners),new I.ws(this.roomUid).onMessage.listen((function(t){0===t.connections&&e.onPublicEnterLeave(t.user,t.action)})).addTo(this.publicListeners),new S.JW(this.roomUid).onMessage.listen((function(){})).addTo(this.publicListeners)):error("roomUsers: listening for public enter/leaves without room uid")}},{key:"onPublicEnterLeave",value:function(e,t){var n,i;"enter"===t?null===(n=this.publicUserList)||void 0===n||n.addUser(e):null===(i=this.publicUserList)||void 0===i||i.deleteUser(e),this.recordRecentPublicEnterLeave(e,t),E.fire(this.getRoomUsersInfo())}},{key:"recordRecentPublicEnterLeave",value:function(e,t){var n=this,i=this.recentPublicEnterLeaves.get(e.username);void 0!==i&&window.clearTimeout(i.timeout);var o=window.setTimeout((function(){n.recentPublicEnterLeaves.delete(e.username)}),R);this.recentPublicEnterLeaves.set(e.username,{user:e,action:t,timeout:o})}},{key:"initializePrivateUserList",value:function(){if(this.privateUserList=new D(void 0,this.sortUsersBy),this.privateUserList.includeCurrentUser(),c.J.current.isBroadcast){var e,t=null===(e=this.chatConnection)||void 0===e?void 0:e.getPrivateShowUser();if(void 0===t)error("roomUsers: no private show user when initializing private user list");else{var n,i=null===(n=this.publicUserList)||void 0===n?void 0:n.getLatestUserInfo(t);void 0!==i&&this.privateUserList.addUser(i)}}E.fire(this.getRoomUsersInfo()),this.listenForPrivateEnterLeaves()}},{key:"cleanUpPrivateUserList",value:function(){this.privateListeners.removeAll(),this.privateUserList=void 0}},{key:"listenForPrivateEnterLeaves",value:function(){var e=this,t=function(t){void 0!==e.roomUid?new T.M4(e.roomUid,t).onMessage.listen((function(t){"leave"===t.action&&0!==t.connections||e.onPrivateEnterLeave(t.user,t.action)})).addTo(e.privateListeners):error("roomUsers: listening for private enter/leaves without room uid")},n=c.q.getState();if(""!==n.privateShowId)t(n.privateShowId);else{var i=-1,o=c.q.onUpdate.listen((function(e){var n=c.q.getState().privateShowId;""!==n&&(t(n),o.removeListener(),clearTimeout(i))}),!1);i=window.setTimeout((function(){error("roomUsers: no private show ID after 10 seconds"),o.removeListener()}),1e4)}}},{key:"onPrivateEnterLeave",value:function(e,t){var n,i;"enter"===t?null===(n=this.privateUserList)||void 0===n||n.addUser(e):null===(i=this.privateUserList)||void 0===i||i.deleteUser(e),E.fire(this.getRoomUsersInfo())}}],[{key:"getInstance",value:function(){return void 0===e.instance&&(e.instance=new e),e.instance}}]),e}(),D=function(){function e(t,n){var i,r,s=this;(0,o.Z)(this,e),this.currentUsersSet=new Set,this.historicalUsers=new Map,this.currentUsers=null!==(i=null==t?void 0:t.roomUsers)&&void 0!==i?i:[],this.anonUsers=null!==(r=null==t?void 0:t.anonCount)&&void 0!==r?r:0,this.sortUsersBy=n,this.currentUsers.forEach((function(e){s.currentUsersSet.add(e.username),s.historicalUsers.set(e.username,e)}))}return(0,r.Z)(e,[{key:"getUsers",value:function(){return this.currentUsers}},{key:"getTotalUsers",value:function(){return this.currentUsers.length+this.anonUsers}},{key:"getAnonUsers",value:function(){return this.anonUsers}},{key:"getLatestUserInfo",value:function(e){return this.historicalUsers.get(e)}},{key:"hasUser",value:function(e){return this.currentUsersSet.has(e)}},{key:"addUser",value:function(e){this.hasUser(e.username)||("a"===this.sortUsersBy?this.addUserAlphaSorted(e):this.addUserTokenSorted(e))}},{key:"deleteUser",value:function(e){if(this.hasUser(e.username)){var t=this.currentUsers.findIndex((function(t){return t.username===e.username}));this.currentUsers.splice(t,1),this.currentUsersSet.delete(e.username)}}},{key:"includeCurrentUser",value:function(){var e=function(){var e;if(void 0!==c.J.current.loggedInUser&&c.J.current.isBroadcast)return f(c.J.current.loggedInUser.username,"o",null!==(e=c.J.current.loggedInUser.gender)&&void 0!==e?e:"","f")}();void 0!==e&&this.addUser(e)}},{key:"equals",value:function(e){return e.getUsers().length===this.currentUsers.length&&this.currentUsers.every((function(t){return e.hasUser(t.username)}))}},{key:"addUserAlphaSorted",value:function(e){var t=function(e,t,n){for(var i=0,o=e.length;i=0?i=r+1:o=r}return i}(this.currentUsers,e,O);this.currentUsers.splice(t,0,e),this.currentUsersSet.add(e.username),this.historicalUsers.set(e.username,e)}},{key:"addUserTokenSorted",value:function(e){this.currentUsers.push(e),this.currentUsersSet.add(e.username),this.historicalUsers.set(e.username,e)}}]),e}()},1612:function(e,t,n){"use strict";n.d(t,{D:function(){return s},w:function(){return a}});var i=n(3753),o=n(3543),r=n(7386),s={CBAlias:"chaturbate.com",DBWLDomain:"",tagLine:o.ag.tagLine,tagLineColor:"#0b5d81",siteName:"Chaturbate",sanitizedSiteName:"Chaturbate",jpegStreamUrl:"https://cbjpeg.stream.highwebmedia.com/",jpegRoomImgUrl:"https://roomimg.stream.highwebmedia.com/",cbGamesUrl:"https://games.multimediallc.com/",bgColor:"#ffffff",navigationBgColor:"#0c6a93",navigationFontColor:"#ffffff",navigationAltBgColor:"#f47321",navigationAlt2BgColor:"#ffffff",navigationAlt2BgImage:"url(".concat(STATIC_URL_ROOT,"tsdefaultassets/gender_tab_bg.gif) repeat-x"),h1Color:"#004B5E",textColor:"#494949",defaultColor:"#494949",defaultTooltipColor:"#222222",userInfoAreaTextColor:"#222222",hrefColor:"#0A5B83",tabBorderColor:"#8bb3da",tabActiveColor:"#ffffff",tabInactiveColor:"#dde9f5",tabActiveFontColor:"#dc5500",tabInactiveFontColor:"#5e81a4",tagExhibColor:"#6D85B5",tagFontColor:"#FFF",tagOfflineColor:"#4F4F4F",tagPrivateColor:"#B60A42",contentBgColor:"#FFFFFF",camBgColor:"#F0F1F1",camBorderColor:"#ACACAC",camSubjectColor:"#000",camSubjectTagColor:"#0A5A83",camAltTextColor:"#575757",camHrefColor:"#0A5A83",tokenHrefColor:"#e45900",footerHrefColor:"#676767",footerTextColor:"#494949",copyrightTextColor:"#494949",logoImageName:(0,r.V)(),signupBgColor:"#f47321",logoWidth:void 0,footerHtml:"",headerGif:"#ffffff url(".concat(STATIC_URL_ROOT,"tsdefaultassets/header_bg.gif) repeat-x"),footerGif:"#ffffff url(".concat(STATIC_URL_ROOT,"tsdefaultassets/footer_bg.gif) repeat-x"),userInfoBgColor:"#e9e9e9",usernameColor:"#ffffff",nextCamBgColor:"#FCEADB",footerColNameColor:"#494949",footerRowColor:"#0A5A83",footerSiteNavColor:"#dc5500",chatAreaTabColor:"#4C4C4C",defaultCampaignSlug:"",isWhiteLabel:!1,shouldHideWaterMark:!1,shouldChangeFooterBorder:!1,shouldChangeFooterTextColor:!1,shouldAddWhiteLabelPoweredBy:!1,shouldShowHeaderAd:!0,showEarnFreeTokens:!0,shouldShowAltLanguages:!0,shouldShowFooterAddress:!0,roomSubjectToolTipColor:"#494949",loginOverlayColor:"#000000",dismissibleMessageColor:"#494949",userInfoDropdownBgColor:"#3C87BA",userInfoDropdownHighlightColor:"#F47321",userInfoDropdownTextColor:"#ffffff",userUpdatesFeedbackLink:"https://www.surveymonkey.com/r/DXYF5T8",hideEntranceTerms:!0===window.hide_entrance_terms,carouselActiveCircleColor:"#F47321",carouselArrowBgColor:"#FFFFFF",carouselArrowColor:"#000000",carouselBgColor:"#F8F9fA",carouselBorderColor:"#ACACAC",carouselCircleColor:"#6E6F70",carouselHrefColor:"#0A5B83",carouselTitleColor:"#494949"},a=s;void 0!==window.siteSettings?a=function(e){var t=e.navigation_font_color,n=e.text_color,i=e.tab_inactive_color,o=e.tab_inactive_font_color,r=e.content_bgcolor,a=e.footer_href_color,l=e.footer_text_color,c=e.tab_inactive_color,u=e.tab_active_color,d=e.tab_active_font_color,h=e.cam_href_color,f=e.site_name,p=document.createElement("span");p.innerText=f;var m=p.innerHTML;return{CBAlias:e.chaturbate_alias,DBWLDomain:e.dbwl_domain,tagLine:e.tagline,tagLineColor:e.tagline_color,siteName:f,sanitizedSiteName:m,jpegStreamUrl:e.jpeg_stream_url,jpegRoomImgUrl:e.jpeg_room_img_url,cbGamesUrl:e.cb_games_url,bgColor:e.bgcolor,navigationBgColor:e.navigation_bgcolor,navigationFontColor:t,navigationAltBgColor:e.navigation_alt_bgcolor,navigationAlt2BgColor:e.navigation_alt_2_bgcolor,navigationAlt2BgImage:"",h1Color:e.h1_color,textColor:n,defaultColor:s.defaultColor,defaultTooltipColor:s.defaultTooltipColor,userInfoAreaTextColor:n,hrefColor:e.href_color,tabBorderColor:e.tab_border_color,tabActiveColor:e.tab_active_color,tabInactiveColor:i,tabActiveFontColor:e.tab_active_font_color,tabInactiveFontColor:o,tagExhibColor:e.tag_exhibitionist_color,tagFontColor:e.tag_font_color,tagOfflineColor:e.tag_offline_color,tagPrivateColor:e.tag_private_group_color,contentBgColor:r,camBgColor:e.cam_background_color,camBorderColor:e.cam_border_color,camSubjectColor:e.cam_text_color,camSubjectTagColor:"#0C6A93",camAltTextColor:e.cam_text_alt_color,camHrefColor:h,tokenHrefColor:h,footerHrefColor:a,footerTextColor:l,copyrightTextColor:l,logoImageName:e.logo_image_name,signupBgColor:e.signup_bg_color,logoWidth:e._logo_width,footerHtml:e.footer_html,headerGif:"",footerGif:"",userInfoBgColor:r,usernameColor:t,nextCamBgColor:i,footerColNameColor:o,footerRowColor:a,footerSiteNavColor:a,chatAreaTabColor:"#0C6A93",defaultCampaignSlug:e.default_campaign_slug,isWhiteLabel:!0,shouldHideWaterMark:!0,shouldChangeFooterBorder:!0,shouldChangeFooterTextColor:!0,shouldAddWhiteLabelPoweredBy:!0,shouldShowHeaderAd:!1,showEarnFreeTokens:!1,shouldShowAltLanguages:!1,shouldShowFooterAddress:!1,roomSubjectToolTipColor:"#222222",loginOverlayColor:n,dismissibleMessageColor:n,recordHitURL:e.whitelabel_hit_count_referring_url,userInfoDropdownBgColor:c,userInfoDropdownHighlightColor:u,userInfoDropdownTextColor:d,userUpdatesFeedbackLink:s.userUpdatesFeedbackLink,hideEntranceTerms:s.hideEntranceTerms,carouselActiveCircleColor:e.carousel_active_circle_color,carouselArrowBgColor:e.carousel_arrow_bg_color,carouselArrowColor:e.carousel_arrow_color,carouselBgColor:e.carousel_bg_color,carouselBorderColor:e.carousel_border_color,carouselCircleColor:e.carousel_circle_color,carouselHrefColor:e.carousel_href_color,carouselTitleColor:e.carousel_title_color}}(window.siteSettings):void 0!==window.siteUrls&&(a.jpegStreamUrl=window.siteUrls.jpeg_stream_url,a.jpegRoomImgUrl=window.siteUrls.jpeg_room_img_url,a.cbGamesUrl=window.siteUrls.cb_games_url),void 0!==a.recordHitURL&&(0,i.I5)("whitelabels/record_hit/",{referer:a.recordHitURL}).catch((function(e){error("Error recording whitelabel hit",e)}))},1962:function(e,t,n){"use strict";n.d(t,{b:function(){return f}});var i=n(4649),o=n(2951),r=n(1976),s=n(7591),a=n(9492),l=n(7597),c=n(9),u=n(8263),d=n(47);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var f=function(e){(0,s.Z)(p,e);var t,n,f=(t=p,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function p(e){return(0,o.Z)(this,p),f.call(this,"div",e)}return(0,r.Z)(p,[{key:"initUI",value:function(e){var t=function(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};(0,l.Z)(this,d),(n=i.call(this,"form")).data=e,n.fields={},n.fieldsets={},n.loading=!1,n.initializeOptions(r),n.element.style.position="static";var s=document.createElement("table");return n.element.appendChild(s),n.tbody=document.createElement("tbody"),s.appendChild(n.tbody),n.submitButton=n.createSubmitButton(),n.element.appendChild(n.submitButton),n.generateFields(),n.element.onsubmit=function(e){if(e.preventDefault(),n.hideErrorMessages(),!n.loading){n.loading=!0;var i=new FormData(n.element);(0,u.I5)(t,i).then((function(){n.loading=!1,n.options.onSubmitSuccess(i)})).catch((function(e){n.loading=!1;var t=JSON.parse(e.xhr.responseText).errors;if(null!==t&&"object"===(0,o.Z)(t)){for(var i=0,r=Object.keys(n.fields);i0){var e,t=b(this.data.schema.field_order);try{for(t.s();!(e=t.n()).done;){var n=e.value,i=this.data.schema.fields[n];this.addField(this.createField(i))}}catch(e){t.e(e)}finally{t.f()}}else if(void 0!==this.data.schema.fieldsets){var o,r=b(this.data.schema.fieldsets);try{for(r.s();!(o=r.n()).done;){var s=o.value;this.addFieldset(s.label);var a,l=b(s.fields);try{for(l.s();!(a=l.n()).done;){var c=a.value,u=this.data.schema.fields[c];this.addFieldToFieldset(this.createField(u),s.label)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){r.e(e)}finally{r.f()}}else for(var d=0,h=Object.keys(this.data.schema.fields);d=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&void 0!==arguments[0])||arguments[0],t=this.dropDown.isShown();t&&this.restoreTabsFromDropDown(),this.separateOverflownSiblings(),this.showOrHideBasedOnOverflownSiblings(),e&&this.isShown()&&this.fixLeftPosition(),t&&(0===this.overflownSibling.length?this.dropDown.hideElement():(this.addTabsToDropDown(),this.dropDown.reposition()))}},{key:"showOrHideBasedOnOverflownSiblings",value:function(){0===this.overflownSibling.length?this.isShown()&&(this.hideElement(),this.spacer.element.style.paddingLeft="0px",this.collapseEvent.fire(!1)):1===this.overflownSibling.length&&this.isShown()&&this.lastOverflownElementHasEnoughSpace()?this.tryToHideThisAndShowLastOverflown():this.isShown()||(this.showElement(this.defaultDisplay),this.reposition(),this.collapseEvent.fire(!0),this.separateOverflownSiblings())}},{key:"tryToHideThisAndShowLastOverflown",value:function(){this.hideElement();var e=this.spacer.element.style.paddingLeft;this.spacer.element.style.paddingLeft="0px",this.separateOverflownSiblings(),this.overflownSibling.length>0?(this.showElement(this.defaultDisplay),this.spacer.element.style.paddingLeft=e):this.collapseEvent.fire(!1)}},{key:"lastOverflownElementHasEnoughSpace",value:function(){var e=this.overflownSibling[0],t=getComputedStyle(e.element);return e.element.offsetWidth+(0,d.gV)(t.marginLeft)+(0,d.gV)(t.marginRight)+5<=this.element.offsetWidth+this.spacer.element.offsetLeft-this.element.offsetLeft}},{key:"setSpacerWidth",value:function(e){this.spacer.element.style.width="".concat(e,"px")}},{key:"isTargetOverflownAnchor",value:function(e){return this.overflownSibling.some((function(t){return t.element.children[0]===e}))}},{key:"lastShownSibling",value:function(){return this.shownSibling[this.shownSibling.length-1]}},{key:"firstTab",value:function(){if(void 0!==this.parent){var e,t=g(this.parent.children());try{for(t.s();!(e=t.n()).done;){var n=e.value;if(x(n.element))return n}}catch(e){t.e(e)}finally{t.f()}}}},{key:"repositionChildren",value:function(){(0,s.Z)((0,c.Z)(n.prototype),"repositionChildren",this).call(this),this.collapseIfNeeded()}},{key:"onToggle",value:function(e){e.isShowing?(this.separateOverflownSiblings(),this.addTabsToDropDown()):this.restoreTabsFromDropDown()}},{key:"addTabsToDropDown",value:function(){var e=this;this.overflownSibling.forEach((function(t){e.collapsedTabs.unshift([t,t.nextSibling()]),e.dropDown.addChild(t),t.collapse(!0)}))}},{key:"restoreTabsFromDropDown",value:function(){var e=this.parent;this.collapsedTabs.forEach((function(t){var n=t[0];e.addChildBefore(n,t[1]),n.collapse(!1)})),this.collapsedTabs=[]}},{key:"collapsibleSiblings",value:function(){return void 0===this.parent?[]:this.parent.children().filter((function(e){return e instanceof k&&e.isShown()}))}},{key:"createDropDown",value:function(e){return new m.i(this.element,e)}},{key:"separateOverflownSiblings",value:function(){var e=this;if(null!==this.element.parentElement&&null!==this.element.parentElement.offsetParent){var t=this.collapsibleSiblings();this.overflownSibling=[],this.shownSibling=[],t.forEach((function(t){C(t)?e.overflownSibling.push(t):e.shownSibling.push(t)}))}}},{key:"reposition",value:function(){null!==this.element.parentElement&&((0,d.Zs)(this.element,{position:"absolute",boxSizing:"border-box",textAlign:"center"}),this.spacer.element.style.paddingLeft="".concat(this.element.offsetWidth,"px"),this.element.removeAttribute("data-floatingnav"),""===this.element.style.width&&(this.element.style.width="".concat(this.element.offsetWidth+1,"px")))}},{key:"attachSpacer",value:function(){if(void 0!==this.parent||null!==this.element.parentElement){var e=void 0===this.parent?this.element.parentElement:this.parent.element,t=this.firstTab();void 0!==t&&e.insertBefore(this.spacer.element,t.element.nextSibling)}}},{key:"styleElement",value:function(){return this.element.appendChild(document.createTextNode(n.DOTDOTDOT_TEXT)),(0,f.vP)(this.element,f.ql.chatAreaTabColor),(0,d.Zs)(this.element,{cursor:"pointer",width:"",height:"",padding:"0 10px",textAlign:"center"}),this.element}},{key:"fixLeftPosition",value:function(){var e=this;if(void 0!==this.parent){var t,n=0,i=g(this.parent.children());try{for(i.s();!(t=i.n()).done;){var o=t.value;!x(o.element)||o===this||o instanceof k&&-1===this.shownSibling.indexOf(o)||(n=Math.max(o.element.offsetLeft+o.element.offsetWidth+(0,d.gV)(getComputedStyle(o.element).marginRight),n))}}catch(e){i.e(e)}finally{i.f()}this.element.offsetLeft!==n&&(this.element.style.left="".concat(n,"px"),window.setTimeout((function(){e.element.style.left=""})))}}},{key:"dispose",value:function(){this.dropDown.dispose(),this.listeners.removeAll()}}]),n}(u.w);function C(e){if(null===e.element.parentElement)return!1;if(e.element.parentElement.offsetHeight<=e.element.offsetHeight)return.5*e.element.offsetHeight+e.element.offsetTop>=e.element.parentElement.offsetHeight;var t=e.element.parentElement.scrollHeight>e.element.parentElement.offsetHeight,n=e.element.parentElement.offsetHeight<=.5*e.element.offsetHeight+e.element.offsetTop;return t&&n}function x(e){return"none"!==e.style.display&&"right"!==e.style.cssFloat&&"absolute"!==e.style.position&&"fixed"!==e.style.position}w.DOTDOTDOT_TEXT=". . .";var k=function(e){(0,a.Z)(n,e);var t=b(n);function n(){var e,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div";return(0,i.Z)(this,n),(e=t.call(this,o)).onCollapseEvent=new h.xB("collapse",{reportIfNoListeners:!1}),e.collapsed=!1,window.setTimeout((function(){e.onCollapseEvent.fire(e.collapsed)})),e}return(0,o.Z)(n,[{key:"collapse",value:function(e){this.collapsed=e,e?this.element.classList.add("collapsed"):this.element.classList.remove("collapsed"),this.onCollapseEvent.fire(e)}}]),n}(u.w)},8785:function(e,t,n){"use strict";n.d(t,{V:function(){return b},WK:function(){return h},Wb:function(){return v},jW:function(){return g},jx:function(){return m},lL:function(){return f},rk:function(){return d},u_:function(){return p},wj:function(){return y}});var i=n(3243),o=n(7591),r=n(9492),s=n(7597),a=n(2951),l=n(1976),c=n(1185);function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,s.Z)(e);if(t){var o=(0,s.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,r.Z)(this,n)}}var d=function(){function e(){(0,a.Z)(this,e)}return(0,l.Z)(e,[{key:"styleRow",value:function(e){e.style.padding="3px 0"}},{key:"styleLabelContainer",value:function(e){e.style.minWidth="130px",e.style.width="auto",e.style.paddingTop="10px",e.style.paddingBottom="1px",e.style.verticalAlign="top",e.style.textAlign="right"}},{key:"styleLabel",value:function(e){(0,c.vP)(e,c.ql.defaultColor),e.style.textAlign="right",e.style.fontWeight="bold",e.style.font="1em/1.3em 'UbuntuMedium', Arial, Helvetica, sans-serif",e.style.padding="0",e.style.margin="0 4px 0 0"}},{key:"styleFieldContainer",value:function(e){(0,c.vP)(e,c.ql.defaultColor)}},{key:"styleField",value:function(e){(0,c.vP)(e,"field"),e.style.borderWidth="1px",e.style.borderStyle="solid",e.style.borderRadius="4px",e.style.padding="2px 4px",e.style.lineHeight="18px",e.style.marginTop="4px",e.style.width="225px"}},{key:"styleHelpText",value:function(e){(0,c.vP)(e,c.ql.defaultColor),e.style.fontFamily="UbuntuRegular, Arial, Helvetica, sans-serif",e.style.fontSize="11px",e.style.width="350px"}}]),e}(),h=function(e){(0,o.Z)(n,e);var t=u(n);function n(){return(0,a.Z)(this,n),t.apply(this,arguments)}return(0,l.Z)(n,[{key:"styleField",value:function(e){(0,i.Z)((0,s.Z)(n.prototype),"styleField",this).call(this,e),e.style.width="auto",e.style.marginTop="7px"}}]),n}(d),f=function(e){(0,o.Z)(n,e);var t=u(n);function n(){return(0,a.Z)(this,n),t.apply(this,arguments)}return(0,l.Z)(n,[{key:"styleField",value:function(e){(0,i.Z)((0,s.Z)(n.prototype),"styleField",this).call(this,e),e.style.height="",e.size=10}}]),n}(h),p=function(e){(0,o.Z)(n,e);var t=u(n);function n(){return(0,a.Z)(this,n),t.apply(this,arguments)}return(0,l.Z)(n)}(d),m=function(e){(0,o.Z)(n,e);var t=u(n);function n(){return(0,a.Z)(this,n),t.apply(this,arguments)}return(0,l.Z)(n,[{key:"styleField",value:function(e){(0,c.vP)(e,"fieldTextArea"),e.style.width="350px",e.style.lineHeight="18px",e.style.marginTop="4px",e.style.borderWidth="1px",e.style.borderStyle="solid",e.style.borderRadius="4px",e.style.padding="2px 4px",e.style.overflow="hidden",e.style.height="150px"}}]),n}(d),v=function(e){(0,o.Z)(n,e);var t=u(n);function n(){return(0,a.Z)(this,n),t.apply(this,arguments)}return(0,l.Z)(n,[{key:"styleLabel",value:function(e){(0,c.vP)(e,c.ql.defaultColor),e.style.width="100%",e.style.textAlign="left",e.style.fontWeight="bold",e.style.font="1em/1.3em 'UbuntuMedium', Arial, Helvetica, sans-serif",e.style.margin="0px 4px 6px"}},{key:"styleLabelContainer",value:function(e){e.style.minWidth="130px",e.style.width="auto",e.style.paddingLeft="10px",e.style.paddingBottom="1px",e.style.verticalAlign="top",e.style.textAlign="right"}}]),n}(m),g=function(e){(0,o.Z)(n,e);var t=u(n);function n(){return(0,a.Z)(this,n),t.apply(this,arguments)}return(0,l.Z)(n,[{key:"styleFieldContainer",value:function(e){(0,i.Z)((0,s.Z)(n.prototype),"styleFieldContainer",this).call(this,e),e.style.paddingTop="7px"}}]),n}(d),y=function(e){(0,o.Z)(n,e);var t=u(n);function n(){return(0,a.Z)(this,n),t.apply(this,arguments)}return(0,l.Z)(n,[{key:"styleFieldContainer",value:function(e){(0,i.Z)((0,s.Z)(n.prototype),"styleFieldContainer",this).call(this,e),e.style.paddingTop="7px"}},{key:"styleField",value:function(e){(0,i.Z)((0,s.Z)(n.prototype),"styleField",this).call(this,e),e.style.width="auto",e.style.marginTop="7px"}}]),n}(d),b=function(e){(0,o.Z)(n,e);var t=u(n);function n(){return(0,a.Z)(this,n),t.apply(this,arguments)}return(0,l.Z)(n,[{key:"styleField",value:function(e){(0,i.Z)((0,s.Z)(n.prototype),"styleField",this).call(this,e),e.style.position="",e.style.padding="",e.style.overflow="",e.style.background="",e.style.border=""}}]),n}(d)},2080:function(e,t,n){"use strict";n.d(t,{I0:function(){return O},Jf:function(){return D},jo:function(){return U},II:function(){return R},Zf:function(){return L},ij:function(){return E},q6:function(){return Z},Ph:function(){return A},M4:function(){return B},Kx:function(){return M}});var i,o=n(4649),r=n(126),s=n(3243),a=n(7591),l=n(9492),c=n(7597),u=n(2951),d=n(1976),h=n(7693),f=n(9),p=n(1794),m=n(3340);var v=new p.xB("recaptchaLoaded",{maxHistorySize:1});window.recaptchaLoadCallback=function(){i=window.grecaptcha,v.fire(void 0)};var g=function(e){(0,a.Z)(r,e);var t,n,o=(t=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function r(){var e;return(0,u.Z)(this,r),(e=o.call(this)).element.style.height="",e.element.style.width="",e}return(0,d.Z)(r,[{key:"render",value:function(e){var t=this;v.once((function(){void 0===e.theme&&(e.theme=document.body.classList.contains("darkmode")?"dark":"light"),void 0===t.listener&&(t.listener=m.rb.listen((function(e){void 0!==t.widgetData&&(t.widgetData.parameters.theme="darkmode"===e?"dark":"light",t.reset())})));var n=i.render(t.element,e);t.widgetData={widgetID:n,parameters:e}}))}},{key:"reset",value:function(){void 0!==this.widgetData&&(i.reset(this.widgetData.widgetID),this.updateTheme())}},{key:"getResponse",value:function(){return void 0!==this.widgetData?i.getResponse(this.widgetData.widgetID):""}},{key:"updateTheme",value:function(){if(void 0!==this.widgetData){var e=this.element.getElementsByTagName("iframe")[0];"dark"===this.widgetData.parameters.theme?e.src=e.src.replace("theme=light","theme=dark"):e.src=e.src.replace("theme=dark","theme=light")}}}]),r}(f.w),y=n(3543),b=n(1185),w=n(851),C=n(8785);function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function k(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1900;n-=1){var i=n.toString(10);e.push({label:i,value:i})}return e}},{key:"assembleField",value:function(){this.dayField=this.createDateField(this.getDayOptions(),this.defaultDay,"day"),this.monthField=this.createDateField(this.getMonthOptions(),this.defaultMonth,"month"),this.yearField=this.createDateField(this.getYearOptions(),this.defaultYear,"year"),this.widgetContainer.appendChild(this.monthField),this.widgetContainer.appendChild(this.dayField),this.widgetContainer.appendChild(this.yearField)}}]),n}(A),Z=function(e){(0,a.Z)(n,e);var t=I(n);function n(e){return(0,u.Z)(this,n),t.call(this,e)}return(0,d.Z)(n,[{key:"initializeData",value:function(e){(0,s.Z)((0,c.Z)(n.prototype),"initializeData",this).call(this,e),this.styles=void 0===e.styles?new C.V:e.styles,this.sitekey=e.siteKey}},{key:"getValue",value:function(){return this.recaptcha.getResponse()}},{key:"createField",value:function(){return this.recaptcha=new g,this.styles.styleField(this.recaptcha.element),this.recaptcha.element}},{key:"assembleField",value:function(){this.widget=this.createField(),this.recaptcha.render({sitekey:this.sitekey}),this.widgetContainer.appendChild(this.widget)}},{key:"onFormError",value:function(){(0,s.Z)((0,c.Z)(n.prototype),"onFormError",this).call(this),this.recaptcha.reset()}}]),n}(P)},2295:function(e,t,n){"use strict";n.d(t,{MO:function(){return B},VY:function(){return D},YO:function(){return O}});var i=n(4649),o=n(5809),r=n(2951),s=n(1976),a=n(3243),l=n(7591),c=n(9492),u=n(7597),d=n(8759),h=n(7693),f=n(3753),p=n(4793),m=n(9),v=n(8263),g=n(5392),y=n(1794),b=n(9598),w=n(1625),C=n(6893),x=n(2833),k=n(8978),S=n(1809),T=n(3543),I=n(1185),P=n(8945),R=n(7397),M=n(1994),A=n(7376);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var B=new y.xB("floatingPlayerShow"),O=new y.xB("floatingPlayerHide"),L="floatingPlayerSettings",D=function(e){(0,l.Z)(y,e);var t,n,m=(t=y,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,u.Z)(t);if(n){var o=(0,u.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,c.Z)(this,e)});function y(e,t,n){var i;(0,r.Z)(this,y),(i=m.call(this)).player=e,i.onexpand=t,i.onclose=n,i.videoSection=document.createElement("a"),i.roomName=document.createElement("a"),i.isDragging=!1,i.isShowing=!1,i.isWidescreen=!0,i.menuBubbleIsOpen=!1,i.width=280,i.right=15,i.bottom=15,i.cachedBottom=15;var s={right:"6px",top:"7px"},a={right:"6px",top:"6px"};(0,I.vP)(i.element,"floatingPlayer"),(0,v.Zs)(i.element,{zIndex:1004,right:"0px",bottom:"0px",position:"fixed",overflow:"visible",animationName:"fadein",WebkitAnimationName:"fadein",animationDuration:"0.2s",WebkitAnimationDuration:"0.2s",animationTimingFunction:"linear",WebkitAnimationTimingFunction:"linear",height:"auto",width:"auto",borderWidth:"1px",borderStyle:"solid",borderRadius:"4px"}),i.element.onclick=function(e){e.stopPropagation()},(0,h.j9)("touchstart",document.getElementsByTagName("body")[0],(function(){})),i.getSettingsLocalstorage(),p.kN.listen((function(e){i.isWidescreen=e.dossier.isWidescreen}));var l=document.createElement("div");(0,I.vP)(l,"header"),(0,v.Zs)(l,{height:"30px",lineHeight:"30px",width:"100%",position:"relative",top:"0px",left:"0px",borderTopLeftRadius:"4px",borderTopRightRadius:"4px"}),i.element.appendChild(l),(0,v.Zs)(i.roomName,{marginLeft:"15px",userSelect:"none",msUserSelect:"none",WebkitUserSelect:"none",fontFamily:"UbuntuMedium, Arial, Helvetica, sans-serif",overflow:"hidden",textOverflow:"ellipsis",height:"30px",maxWidth:"calc(100% - 60px)",whiteSpace:"nowrap",cursor:"pointer",position:"relative",display:"inline-block"}),(0,v.nH)(i.roomName).listen((function(e){i.roomName.style.textDecoration=!0===e?"underline":"none"})),l.appendChild(i.roomName),i.moveArea=i.createClickableOverlay(l,"move"),(0,v.Zs)(i.moveArea,{position:"absolute",top:"0px",left:"0px",height:"30px",width:"calc(100% - 60px)"});var c=document.createElement("div");(0,I.vP)(c,"optionsArea"),(0,v.Zs)(c,{position:"absolute",right:"30px",top:"3px",height:"25px",width:"25px",borderRadius:"4px",cursor:"pointer"}),c.ontouchstart=function(e){i.openCloseMenuBubble(),e.preventDefault()},c.onclick=function(e){i.openCloseMenuBubble(),e.preventDefault()},l.appendChild(c);var u=i.createIcon("".concat(STATIC_URL,"menu.svg"),c,a);(0,I.vP)(u,"lightOptionsIcon");var f=i.createIcon("".concat(STATIC_URL,"darkmode-menu.svg"),c,a);(0,I.vP)(f,"darkOptionsIcon"),c.style.display="None";var w=document.createElement("div");(0,I.vP)(w,"closeArea"),(0,v.Zs)(w,{position:"absolute",right:"5px",top:"3px",height:"25px",width:"25px",borderRadius:"4px",cursor:"pointer"}),w.ontouchstart=function(e){i.close(),e.preventDefault()},w.onclick=function(){i.close()},l.appendChild(w);var k=i.createIcon("".concat(STATIC_URL,"floating-player-close.svg"),w,s);(0,I.vP)(k,"lightCloseIcon");var S=i.createIcon("".concat(STATIC_URL,"floating-player-close-darkmode.svg"),w,s);(0,I.vP)(S,"darkCloseIcon"),(0,v.Zs)(i.videoSection,{position:"relative",cursor:"pointer",display:"block"});var T=i.createClickableOverlay(i.videoSection,"pointer");if((0,v.Zs)(T,{top:"0",left:"0",right:"0",bottom:"0",borderBottomRightRadius:"4px",borderBottomLeftRadius:"4px"}),i.createReturnIcon(T),i.videoSection.onclick=function(e){e.metaKey||e.ctrlKey||e.shiftKey||(e.preventDefault(),i.isDragging||i.expand())},i.element.appendChild(i.videoSection),(0,A.$)(i.element,(function(e){return function(t,n,r){var s=i.isWidescreen?x.fo:x.$V,a={initialBottom:i.bottom,initialRight:i.right,initialWidth:i.width,initialX:n,initialY:r,minWidth:150,ratio:s},l=i.right,c=i.bottom,u=i.width,d=i.availableWidth(),h=(0,o.Z)(d,2),f=h[0],p=h[1];return i.isDragging=!0,t.stopPropagation(),{enabled:!0,move:function(t,n){var o=(0,A.G)(a,t,n,e),r=[o.right,o.bottom,o.width];l=r[0],c=r[1];var d=(u=r[2])*s;i.setPosition(Math.min(Math.max(c,0),f-(d+30)),Math.min(Math.max(l,0),p-u)),i.videoSection.style.width="".concat(u,"px"),i.videoSection.style.height="".concat(d,"px"),i.element.style.height="".concat(d+30),i.element.style.width=i.videoSection.style.width},end:function(){i.bottom=c,i.cachedBottom=c,i.right=l,i.width=u,i.saveSettingsLocalstorage(),M()}}}})),(0,d.v8)()){var P=document.createElement("object");P.style.position="absolute",P.style.width="calc(100% + 10px)",P.style.height="calc(100% + 10px)",P.style.top="-5px",P.style.left="-5px",P.style.zIndex="-1",P.type="application/x-mpegURL",P.data="",P.setAttribute("wmode","transparent"),i.element.appendChild(P)}var M=function(){window.setTimeout((function(){i.isDragging=!1}),100)};return(0,g.T)(i.moveArea,(function(e,t,n){var r=i.element.offsetHeight,s=i.element.offsetWidth,a=i.right,l=i.bottom,c=i.bottom,u=i.right,d=t,h=n,f=i.availableWidth(),p=(0,o.Z)(f,2),m=p[0],v=p[1];return{enabled:!0,move:function(e,t){var n,o;n=e-d,o=t-h,c=Math.min(Math.max(l-o,0),m-r),u=Math.min(Math.max(a-n,0),v-s),i.setPosition(c,u)},end:function(){i.bottom=c,i.cachedBottom=c,i.right=u,i.saveSettingsLocalstorage()}}})),C.tb.listen((function(e){i.element.style.visibility=e.active?"hidden":"visible"})),b.wk.listen((function(e){e.roomName===i.room&&void 0!==i.followStar&&i.followStar.setFollowing(e.following)})),R._j.listen((function(){i.repositionChildren()})),i.repositionChildren(),i}return(0,s.Z)(y,[{key:"openCloseMenuBubble",value:function(){void 0===this.menuBubble?this.createMenuBubble():this.menuBubbleIsOpen?(this.menuBubble.style.display="none",this.menuBubbleIsOpen=!1):(this.menuBubble.style.display="block",this.menuBubbleIsOpen=!0)}},{key:"createMenuBubble",value:function(){var e=this;this.menuBubbleIsOpen=!0,this.menuBubble=document.createElement("div"),(0,I.vP)(this.menuBubble,"menuBubble"),this.menuBubble.innerHTML=T.ag.floatingPlayerMenuBubbleText();var t=this.menuBubble.querySelector("a");(0,I.vP)(t,"link"),t.onclick=function(n){(0,S.U_)(n)||(n.preventDefault(),(0,S.cr)(t.href),e.openCloseMenuBubble())};var n=document.createElement("div");(0,I.vP)(n,"caret"),n.style.position="absolute",n.style.height="0px",n.style.width="0px",n.style.right="5px",n.style.top="-5px",n.style.borderBottomWidth="5px",n.style.borderBottomStyle="solid",n.style.borderRight="5px solid transparent",n.style.borderLeft="5px solid transparent";var i={position:"relative",verticalAlign:"middle",marginLeft:"4px",height:"14px",width:"14px"},o=this.createIcon("".concat(STATIC_URL,"option_cog_light.svg"),t,i);(0,I.vP)(o,"lightAdvancedOptionsIcon");var r=this.createIcon("".concat(STATIC_URL,"option_cog_dark.svg"),t,i);(0,I.vP)(r,"darkAdvancedOptionsIcon"),this.menuBubble.appendChild(n),this.menuBubble.style.position="absolute",this.menuBubble.style.width="240px",this.menuBubble.style.right="32px",this.menuBubble.style.top="40px",this.menuBubble.style.opacity="0.8",this.menuBubble.style.borderWidth="1px",this.menuBubble.style.borderStyle="solid",this.menuBubble.style.boxSizing="border-box",this.menuBubble.style.borderRadius="4px",this.menuBubble.style.padding="4px",this.menuBubble.style.zIndex="1005",this.element.appendChild(this.menuBubble)}},{key:"getSettingsLocalstorage",value:function(){if((0,d.IU)()){var e=window.localStorage.getItem(L);if(null!==e){var t=JSON.parse(e);this.bottom=t.bottom,this.cachedBottom=t.bottom,this.right=t.right,this.width=t.width}}}},{key:"saveSettingsLocalstorage",value:function(){if((0,d.IU)()){var e={bottom:this.bottom<0?0:this.bottom,right:this.right,width:this.width};window.localStorage.setItem(L,JSON.stringify(e))}}},{key:"setPosition",value:function(e,t){(0,v.Zs)(this.element,{bottom:"".concat(e<0?0:e,"px"),right:"".concat(t,"px")})}},{key:"repositionChildren",value:function(e){(0,a.Z)((0,u.Z)(y.prototype),"repositionChildren",this).call(this);var t=this.availableWidth(),n=(0,o.Z)(t,2),i=n[0],r=n[1],s=this.isWidescreen?x.fo:x.$V,l=Math.min(this.width,.66*r);this.videoSection.style.height="".concat(l*s,"px"),this.videoSection.style.width="".concat(l,"px"),this.element.style.width=this.videoSection.style.width;var c=(0,M.p)(e);this.bottom=c>0?Math.max(this.cachedBottom,c+4):this.cachedBottom,this.setPosition(Math.min(this.bottom,Math.max(0,i-this.element.offsetHeight)),Math.min(this.right,Math.max(0,r-this.element.offsetWidth)))}},{key:"createIcon",value:function(e,t,n){var o=document.createElement("img");return o.src=e,o.height=13,o.width=13,(0,v.Zs)(o,function(e){for(var t=1;t40||window.innerWidthe.length)&&(t=e.length);for(var n=0,i=new Array(t);n1||((0,b.fg)("SsoSignupClick",{provider:e.provider,source:"loginOverlay"}),(0,k.Pv)(t,"_blank",k.rq)),window.setTimeout((function(){E=0}),1e3)}},(0,x.vz)("div",null,(0,x.vz)("img",{src:"".concat(STATIC_URL_ROOT,"images/sso-").concat(e.provider,".svg"),alt:e.provider}),(0,x.vz)("p",null,C.ag.signInWithSocialAuth(e.name))))}var O,L,D=function(e){(0,s.Z)(n,e);var t=I(n);function n(){var e;(0,i.Z)(this,n),(e=t.call(this,{onShow:function(){e.repositionChildren(),e.isVisible=!0,e.usernameInput.focus(),(0,u.j9)("keydown",e.element,M),e.fullscreenChangeListener=m.gH.listen((function(){return e.hideBodyElement()})),e.hideBodyElement()},onHide:function(){var t,n=e.isVisible;e.element.style.display="none",e.isVisible=!1,n&&((0,u.SC)("keydown",e.element,M),null===(t=e.fullscreenChangeListener)||void 0===t||t.removeListener(),e.fullscreenChangeListener=void 0),e.unhideBodyElement(),e.clearAutofillPollInterval()},easyExit:!0})).isVisible=!1,e.autofillPollInterval=0,e.tabListenerFactory=function(e,t){return function(n){"Tab"===n.key&&(n.preventDefault(),n.shiftKey?t.focus():e.focus())}},e.detectInputFilled=function(){""!==e.passwordInput.value.trim()&&""!==e.usernameInput.value.trim()?(e.loginButton.removeAttribute("disabled"),e.rememberMeCheckBox.onkeydown=e.tabListenerFactory(e.loginButton,e.forgotPasswordLink),e.loginButton.onkeydown=e.tabListenerFactory(e.signupLink,e.rememberMeCheckBox),e.signupLink.onkeydown=e.tabListenerFactory(e.closeButton,e.loginButton),e.clearAutofillPollInterval()):(e.loginButton.disabled=!0,e.rememberMeCheckBox.onkeydown=e.tabListenerFactory(e.signupLink,e.forgotPasswordLink),e.signupLink.onkeydown=e.tabListenerFactory(e.closeButton,e.rememberMeCheckBox),e.createAutofillPollInterval())},e.clearAutofillPollInterval=function(){e.autofillPollInterval&&(window.clearInterval(e.autofillPollInterval),e.autofillPollInterval=0)},e.createAutofillPollInterval=function(){e.autofillPollInterval||(e.autofillPollInterval=window.setInterval((function(){e.detectInputFilled()}),200))};var o=function(e){var t=document.createElement("div");return t.style.display="block",t.style.margin="10px 0 0 0",e.appendChild(t),t};e.element.style.display="none",e.element.style.position="fixed",e.element.style.fontSize="12px",e.element.style.width="364px",e.element.style.height="auto",e.element.style.color="currentSiteSettings.defaultColor",e.element.style.margin="auto",e.element.style.boxShadow="0px 0px 10px rgba(0, 0, 0, 0.4)",e.element.style.background="white",e.element.style.border="3px solid #0E6C92",e.element.style.borderRadius="10px",e.element.style.visibility="visible",e.element.id="LoginOverlay",e.element.dataset.testid="login-form",e.overlay.classList.add("blurred-login-overlay"),e.overlay.style.visibility="visible",e.overlay.style.background="",e.overlay.style["-webkit-overflow-scrolling"]="touch",e.loginContainer=document.createElement("form"),e.loginContainer.target="_top",e.loginContainer.style.padding="5px 30px 10px 30px",e.loginContainer.action=(0,d.BN)((0,w.yU)(w.PU,(0,w.GC)({ignoreExistingRoom:!0}))),e.loginContainer.method="POST",e.loginContainer.onclick=function(e){e.stopPropagation()},e.element.appendChild(e.loginContainer);var r=o(e.loginContainer),s=o(e.loginContainer),a=o(e.loginContainer),l=o(e.loginContainer),c=o(e.loginContainer),p=o(e.loginContainer),v=o(e.loginContainer),g=o(e.loginContainer),y=o(e.loginContainer);c.style.display="flex",c.style.alignItems="center",e.closeButton=document.createElement("input"),e.closeButton.type="button",e.closeButton.onclick=function(t){t.preventDefault(),e.hide()},e.closeButton.value="",e.closeButton.style.background="transparent url(".concat(STATIC_URL,"close_icon2.svg) no-repeat center center"),e.closeButton.style.backgroundSize="10px",e.closeButton.style.padding="10px 20px 8px 12px",e.closeButton.style.border="none",e.closeButton.style.cursor="pointer",e.closeButton.dataset.testid="login-modal-close-button",r.appendChild(e.closeButton),r.style.position="absolute",r.style.top="0px",r.style.right="0px",r.style.margin="0px",e.header=document.createElement("h1"),e.header.style.font="18px ubuntumedium,Arial,Helvetica,sans-serif",e.header.style.color="#f47422",s.appendChild(e.header),s.style.textAlign="center",e.usernameInput=e.createFormInput(a,"".concat(C.ag.usernameText,":"),"text","username"),e.usernameInput.required=!0,e.usernameInput.dataset.testid="username-input",e.forgotPasswordLink=document.createElement("a"),e.forgotPasswordLink.target="_top",e.forgotPasswordLink.href=(0,d.BN)("/auth/password_reset/"),e.forgotPasswordLink.tabIndex=0,e.forgotPasswordLink.textContent=C.ag.forgotPassword,e.forgotPasswordLink.style.cssFloat="right",e.forgotPasswordLink.dataset.testid="forgot-password-link",l.appendChild(e.forgotPasswordLink),e.passwordInput=e.createFormInput(l,"".concat(C.ag.passwordText,":"),"password","password"),e.passwordInput.required=!0,e.passwordInput.dataset.testid="password-input",e.rememberMeCheckBox=e.createFormInput(c,"".concat(C.ag.keepLoggedInText,":"),"checkbox","rememberme"),e.rememberMeCheckBox.style.marginLeft="10px",e.rememberMeCheckBox.dataset.testid="remember-me-check-box",e.loginButton=document.createElement("input"),e.loginButton.dataset.testid="login-button",e.loginButton.id="id_login_btn",e.loginButton.type="submit",e.loginButton.disabled=!0,e.loginButton.value=C.ag.loginVerbText,p.appendChild(e.loginButton);var b=S.J.current.socialAuths;if(void 0!==b&&b.length>0){var k=(0,x.vz)("div",{className:"or_separator"},(0,x.vz)("p",null," or "));v.appendChild(k);var I,P=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return T(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)?T(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(b);try{for(P.s();!(I=P.n()).done;){var A=I.value;v.appendChild(B(A))}}catch(e){P.e(e)}finally{P.f()}v.style.marginBottom="16px"}var E,O=document.createElement("p");return O.textContent="".concat(C.ag.dontHaveAccountYet," "),O.style.display="inline",e.signupLink=document.createElement("a"),e.signupLink.target="_top",e.signupLink.classList.add("signupLogin"),e.signupLink.href=R,e.signupLink.tabIndex=0,e.signupLink.textContent=C.ag.signUpText,g.appendChild(O),g.appendChild(e.signupLink),g.style.textAlign="center",e.nextField=document.createElement("input"),e.csrfField=document.createElement("input"),e.nextField.type=e.csrfField.type="hidden",e.nextField.name="next",e.nextField.value=(E=(0,w.GC)({ignoreExistingRoom:!0}),-1!==(0,w.N0)().indexOf("/al/")||void 0===E.nextParam?"/":E.nextParam),e.csrfField.name="csrfmiddlewaretoken",e.csrfField.value=(0,f.ve)("csrftoken"),y.appendChild(e.nextField),y.appendChild(e.csrfField),y.style.display="none",e.closeButton.onkeydown=e.tabListenerFactory(e.usernameInput,e.signupLink),e.usernameInput.onkeydown=e.tabListenerFactory(e.passwordInput,e.closeButton),e.passwordInput.onkeydown=e.tabListenerFactory(e.forgotPasswordLink,e.usernameInput),e.forgotPasswordLink.onkeydown=e.tabListenerFactory(e.rememberMeCheckBox,e.passwordInput),e.rememberMeCheckBox.onkeydown=e.tabListenerFactory(e.loginButton,e.forgotPasswordLink),e.loginButton.onkeydown=e.tabListenerFactory(e.signupLink,e.rememberMeCheckBox),e.signupLink.onkeydown=e.tabListenerFactory(e.closeButton,e.loginButton),e.usernameInput.oninput=e.detectInputFilled,e.passwordInput.oninput=e.detectInputFilled,h.kN.listen((function(){e.nextField.value=(0,w.N0)()})),e}return(0,o.Z)(n,[{key:"initAndShow",value:function(e){if((0,k.zd)()&&""!==A)(0,k.Pv)("/auth/login/?next=/".concat(A,"/"));else{if(P.fire(void 0),this.header.innerText=void 0!==e.fromFeature&&e.fromFeature?C.ag.loginToUseFeature:C.ag.loginToContinue,this.header.dataset.testid="login-modal-header-text",this.csrfField.value=(0,f.ve)("csrftoken"),this.element.style.display="block",(0,r.Z)((0,l.Z)(n.prototype),"show",this).call(this),void 0!==e.seeBackground&&e.seeBackground&&(this.unhideBodyElement(),this.overlay.style.backgroundColor="rgba(0, 0, 0, 0.5)"),this.signupLink.href=(0,d.BN)(!0===e.returnToPage?(0,w.yU)(R,(0,w.GC)({})):R),!0===e.refreshOpener){var t=(0,w.GC)({ignoreExistingRoom:!0});void 0!==t.nextParam&&(t.nextParam.endsWith("/")?t.nextParam+="?refresh_opener=1":t.nextParam+="/refresh_opener=1",this.nextField.value=t.nextParam),this.loginContainer.action=(0,d.BN)((0,w.yU)("".concat(w.PU),t)),this.signupLink.href="".concat(this.signupLink.href,"?refresh_opener=1")}this.createAutofillPollInterval(),this.usernameInput.focus()}}},{key:"createFormInput",value:function(e,t,n,i){var o=this,r=document.createElement("label"),s=document.createElement("input");return r.innerText=t,r.htmlFor=i,s.type=n,s.id=i,s.name=i,s.style.height="checkbox"===n?"18px":"26px",s.style.width="checkbox"===n?"18px":"100%",s.style.font="100% Arial,Helvetica,sans-serif",s.style.color="#000",s.style.boxSizing="border-box",s.style.border="1px solid #d5d5d5",s.style.padding="2px 4px",s.style.margin="1px 0",s.style.lineHeight="18px",s.style.borderRadius="4px",(0,u.j9)("keydown",s,(function(e){"Enter"===e.key&&(e.preventDefault(),o.loginButton.click())})),e.appendChild(r),e.appendChild(s),s}},{key:"unhideBodyElement",value:function(){void 0!==this.bodyElement&&(this.bodyElement.style.visibility="",this.bodyElement.style.backgroundColor="",this.bodyElement.style.overflow="",this.bodyElement.style.position="",this.bodyElement.classList.remove("blurred-login-overlay-shown","embed-blurred-login-overlay"))}},{key:"hideBodyElement",value:function(){this.unhideBodyElement(),null!==this.element.parentElement&&(this.bodyElement=this.element.parentElement,this.bodyElement.style.overflow="hidden",this.bodyElement.classList.add("blurred-login-overlay-shown"),(0,c.op)()&&(this.bodyElement.style.position="fixed",this.bodyElement.classList.add("embed-blurred-login-overlay")))}},{key:"repositionChildren",value:function(){var e=Math.max(document.documentElement.clientWidth,window.innerWidth),t=Math.max(document.documentElement.clientHeight,window.innerHeight);this.element.style.left="".concat((e-this.loginContainer.offsetWidth)/2,"px"),this.element.style.top="".concat((t-this.loginContainer.offsetHeight)/2,"px")}}]),n}(y.z),U=function(e){(0,s.Z)(n,e);var t=I(n);function n(){var e;return(0,i.Z)(this,n),(e=t.call(this)).element.style.width="calc(96% - 6px)",e.element.style.maxWidth="364px",e.element.style.margin="",e.element.style.fontSize="12px",e.element.style.position="fixed",e.element.style.overflow="scroll",(0,v.q)(e.element),e}return(0,o.Z)(n,[{key:"createFormInput",value:function(e,t,i,o){var s=(0,r.Z)((0,l.Z)(n.prototype),"createFormInput",this).call(this,e,t,i,o);return s.style.fontFamily="'UbuntuRegular', Arial, Helvetica, sans-serif",s.style.fontSize="16px",s}},{key:"repositionChildren",value:function(){var e=Math.max(document.documentElement.clientWidth,window.innerWidth),t=Math.max(document.documentElement.clientHeight,window.innerHeight),n=(e-this.loginContainer.offsetWidth)/2,i=Math.max(50,(t-this.loginContainer.offsetHeight)/2);(0,c.Dt)()&&(i=Math.max(50,(t-this.loginContainer.offsetHeight)/5));var o=(0,g.gr)(),r=!o&&t<576;this.element.style.left="".concat(n,"px"),this.element.style.top=r?"0px":"".concat(i,"px"),this.element.style.bottom=r?"0px":"",(document.activeElement===this.usernameInput||document.activeElement===this.passwordInput)&&!o&&window.setTimeout((function(){var e;null===(e=document.activeElement)||void 0===e||e.scrollIntoView()}),510)}}]),n}(D);function Z(e){!function(e){void 0===e.fromFeature&&(e.fromFeature=e.fromFeature),void 0===e.seeBackground&&(e.seeBackground=e.seeBackground),void 0===e.returnToPage&&(e.returnToPage=e.returnToPage),void 0===e.refreshOpener&&(e.refreshOpener=e.refreshOpener)}(e),S.J.current.isMobile?(void 0===L&&(L=new U,(0,b.fg)("LoginOverlayOpened")),L.initAndShow(e)):(void 0===O&&(O=new D,(0,b.fg)("LoginOverlayOpened")),O.initAndShow(e))}function F(){void 0!==O&&O.hide()}function _(){return void 0!==O&&O.isVisible}},7386:function(e,t,n){"use strict";n.d(t,{V:function(){return o}});var i=n(2800);function o(){var e,t;return null!==(e=null===(t=i.J.current)||void 0===t?void 0:t.current_logo)&&void 0!==e?e:"".concat(STATIC_URL_ROOT,"images/logo.svg")}},6132:function(e,t,n){"use strict";n.d(t,{fb:function(){return w},pw:function(){return b},s6:function(){return x},sP:function(){return g},x5:function(){return y}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(7693),u=n(1522),d=n(1794),h=n(3705),f=n(7108),p=n(3543),m=n(1185),v=n(2800);function g(){var e=document.createElement("div");return(0,m.vP)(e,"title"),e.innerText=p.ag.followerBrowserNotifications,e.style.fontFamily="UbuntuBold, Helvetica, Arial, sans-serif",e}function y(){var e=document.createElement("div");return e.innerText=p.ag.allowBrowserNotificationsMessage,e.style.margin="5px 0 10px",e.style.fontSize="11px",e}function b(e){var t=document.createElement("div");return(0,m.vP)(t,"confirmButton"),t.innerText=p.ag.yesText,t.style.display="inline-block",t.style.padding="5px 30px",t.style.marginLeft="10px",t.style.borderRadius="3px",t.style.cursor="pointer",(0,c.j9)("click",t,e),t}function w(e){var t=document.createElement("div");return(0,m.vP)(t,"denyButton"),t.innerText=p.ag.notNowText,t.style.display="inline-block",t.style.padding="5px 18px",t.style.cursor="pointer",(0,c.j9)("click",t,e),t}var C={numTimeoutsKey:"numPushNotificationTimeouts",timeoutDateKey:"pushNotificationTimeout"},x=function(e){(0,s.Z)(m,e);var t,n,f=(t=m,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function m(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:C,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,i.Z)(this,m),(e=f.call(this,t)).closed=new d.xB("closed"),n){e.skipOverlay=!0;var o=function(t){t.target!==e.element&&e.element.contains(t.target)||e.close()};return(0,c.j9)("click",document,o),e.closed.once((function(){try{(0,c.SC)("click",document,o)}catch(e){debug("NotificationsModal listener was already removed")}})),(0,a.Z)(e)}return e.overlayClick.listen((function(){e.close()})),e}return(0,o.Z)(m,[{key:"initData",value:function(e){(0,r.Z)((0,l.Z)(m.prototype),"initData",this).call(this),this.numTimeoutsLocalStorageKey=e.numTimeoutsKey,this.timeoutDateLocalStorageKey=e.timeoutDateKey;var t=window.localStorage.getItem(this.numTimeoutsLocalStorageKey),n=window.localStorage.getItem(this.timeoutDateLocalStorageKey);null!==t&&null!==n?(this.timeoutDate=new Date(n),this.numTimeouts=parseInt(t)+1):(this.timeoutDate=new Date,this.numTimeouts=1)}},{key:"afterDOMConstructedIncludingChildren",value:function(){(0,r.Z)((0,l.Z)(m.prototype),"afterDOMConstructedIncludingChildren",this).call(this),this.skipOverlay||this.showOverlay()}},{key:"canRequestPermission",value:function(){return new Date>=this.timeoutDate}},{key:"close",value:function(){this.element.style.display="none",this.skipOverlay||this.hideOverlay(),this.closed.fire(void 0)}},{key:"subscribeToBrowserPush",value:function(e,t){var n=window.subscribeUserToPush;void 0!==v.J.current.loggedInUser&&n(v.J.current.loggedInUser.signedUsername).then((function(){e(),(0,h.fg)("PushNotificationSettingsUpdated",{new_status:!0,old_status:!1,location:"notif-modal"})})).catch(t)}},{key:"onConfirmClick",value:function(){var e=this;this.subscribeToBrowserPush((function(){}),(function(t){void 0===t||400===t.status?(0,u.Cj)(p.ag.followSubscribeFailedMessage):(window.localStorage.removeItem(e.numTimeoutsLocalStorageKey),window.localStorage.removeItem(e.timeoutDateLocalStorageKey))}))}},{key:"onDenyClick",value:function(){var e=new Date,t=Math.min(Math.pow(2,this.numTimeouts),168);this.timeoutDate.setTime(e.getTime()+60*t*60*1e3),window.localStorage.setItem(this.numTimeoutsLocalStorageKey,this.numTimeouts.toString()),window.localStorage.setItem(this.timeoutDateLocalStorageKey,this.timeoutDate.toString())}}]),m}(f.B)},7376:function(e,t,n){"use strict";n.d(t,{$:function(){return o},G:function(){return r}});var i=n(5392);function o(e,t){var n=function(t){var n=document.createElement("div");return n.style.position="absolute",n.style.cursor=t,n.style.backgroundColor="rgba(0, 0, 0, 0.01)",e.appendChild(n),n},o=n("nwse-resize");o.style.height="10px",o.style.width="10px",o.style.top="-5px",o.style.left="-5px";var r=n("nesw-resize");r.style.height="10px",r.style.width="10px",r.style.top="-5px",r.style.right="-5px";var s=n("nwse-resize");s.style.height="10px",s.style.width="10px",s.style.bottom="-5px",s.style.right="-5px";var a=n("nesw-resize");a.style.height="10px",a.style.width="10px",a.style.bottom="-5px",a.style.left="-5px";var l=n("ew-resize");l.style.height="calc(100% - 10px)",l.style.width="10px",l.style.top="5px",l.style.left="-5px";var c=n("ew-resize");c.style.height="calc(100% - 10px)",c.style.width="10px",c.style.top="5px",c.style.right="-5px";var u=n("ns-resize");u.style.height="10px",u.style.width="calc(100% - 10px)",u.style.left="5px",u.style.bottom="-5px";var d=n("ns-resize");d.style.height="5px",d.style.width="calc(100% - 10px)",d.style.left="5px",d.style.top="-5px",(0,i.T)(s,t(2)),(0,i.T)(a,t(3)),(0,i.T)(r,t(1)),(0,i.T)(o,t(0)),(0,i.T)(l,t(4)),(0,i.T)(c,t(5)),(0,i.T)(u,t(6)),(0,i.T)(d,t(7))}function r(e,t,n,i){var o=function(e,t,n,i){switch(i){case 0:return e.ratio*(e.initialX-t+(e.initialY-n));case 1:return e.ratio*(-(e.initialX-t)+(e.initialY-n));case 2:return e.ratio*(-(e.initialX-t)-(e.initialY-n));case 3:return e.ratio*(e.initialX-t-(e.initialY-n));case 4:return e.initialX-t;case 5:return-(e.initialX-t);case 6:return-(e.initialY-n)/e.ratio;case 7:return(e.initialY-n)/e.ratio}}(e,t,n,i),r=Math.min(Math.max(e.minWidth,e.initialWidth+o),.66*window.innerWidth),s=e.initialWidth-r,a=e.initialBottom,l=e.initialRight;switch(i){case 1:l=e.initialRight+s;break;case 2:l=e.initialRight+s,a=e.initialBottom+s*e.ratio;break;case 3:a=e.initialBottom+s*e.ratio;break;case 4:a=e.initialBottom+s*e.ratio/2;break;case 5:l=e.initialRight+s,a=e.initialBottom+s*e.ratio/2;break;case 6:l=e.initialRight+s/2,a=e.initialBottom+s*e.ratio;break;case 7:l=e.initialRight+s/2}return{bottom:a,right:l,width:r}}},9760:function(e,t,n){"use strict";n.d(t,{FR:function(){return y},nR:function(){return v},os:function(){return b}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(8759),u=n(7693),d=n(8069),h=n(9),f=n(8263),p=n(1794),m=n(3607);var v=new(function(e){(0,s.Z)(u,e);var t,n,c=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,o.Z)(u,[{key:"listen",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=(0,r.Z)((0,l.Z)(u.prototype),"listen",this).call(this,e,t);return g.callFunc(),n}},{key:"addListener",value:function(e,t){(0,r.Z)((0,l.Z)(u.prototype),"addListener",this).call(this,e,t),g.callFunc()}}]),u}(p.xB))("resizeDebounceEvent"),g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:80,n=new d.d((function(){e(!0)}),{bounceLimitMS:t,debounceType:2}),i=new d.d((function(){e(!1)}),{bounceLimitMS:200,debounceType:1});return(0,u.j9)("resize",window,(function(){n.callFunc(),i.callFunc()})),(0,u.j9)("orientationchange",window,(function(){e(!1),window.setTimeout((function(){e(!1)}),80)})),i}((function(){v.fire(!1)}));function y(e,t,n,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:500,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1003,s=arguments.length>6?arguments[6]:void 0,a=function(){var a=n instanceof Function?n():n,l=a+((i instanceof Function?i():i)-a)*(Math.max(Math.min(document.body.clientWidth,r),o)-o)/(r-o),c=e instanceof h.w?e.element:e;t instanceof Array?t.forEach((function(e){c.style[e]="".concat(l,"px")})):c.style[t]="".concat(l,"px"),e instanceof h.w&&e.repositionChildrenRecursive(),void 0!==s&&s(l)};return v.addListener(a,e),window.setTimeout((function(){a()})),a}function b(e){var t=new p.xB("width-less-than".concat(e)),n=!1;return v.listen((function(){(0,m._U)()1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2?arguments[2]:void 0;return(0,i.Z)(this,u),(t=c.call(this,"scrollEndDebounceEvent",o)).listenerObj=e,t.scrollOrientation=n,t.lastScroll=t.getCurrentScroll(),t}return(0,o.Z)(u,[{key:"element",get:function(){return this.listenerObj instanceof Document?this.listenerObj.documentElement:this.listenerObj}},{key:"getCurrentScroll",value:function(){return 0===this.scrollOrientation?this.element.scrollTop:this.element.scrollLeft}},{key:"listen",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=(0,r.Z)((0,l.Z)(u.prototype),"listen",this).call(this,e,t);return this.registerDebouncer(),n}},{key:"addListener",value:function(e,t){(0,r.Z)((0,l.Z)(u.prototype),"addListener",this).call(this,e,t),this.registerDebouncer()}},{key:"registerDebouncer",value:function(){var e=this;d(this.listenerObj,(function(t){var n=e.getCurrentScroll();e.fire({isStart:t,scrollDirection:n>e.lastScroll?1:0}),e.lastScroll=n}))}}]),u}(n(1794).xB);function f(e,t,n){var i,o=e.scrollLeft,r=n;window.requestAnimationFrame((function n(s){var a=s-(i=void 0===i?s:i);e.scrollLeft=o2&&void 0!==arguments[2]?arguments[2]:100,i=new u.d(t,{bounceLimitMS:n,debounceType:2});return(0,c.j9)("scroll",e,(function(){i.callFunc()})),i}},4493:function(e,t,n){"use strict";n.d(t,{KI:function(){return $},Ze:function(){return G}});var i=n(7791),o=n(2951),r=n(1976),s=n(7591),a=n(9492),l=n(7597),c=n(824),u=n.n(c),d=n(8759),h=n(3753),f=n(391),p=n(695),m=n(9),v=n(8263),g=n(6921),y=n(9165),b=n(3705),w=n(1185),C=n(9076),x=n(7585),k=n(1794),S=n(47),T=n(2800),I=n(7642),P=n(9395);var R=new k.xB("SuggestionClicked"),M={fontSize:"9px",position:"relative",width:"105px"},A={display:"inline-block",position:"relative",top:"6px",height:"18px",padding:"5px 10px",width:"18px"},E={display:"inline-block",margin:"0px",position:"relative"},B={borderBottomStyle:"solid",borderBottomWidth:"1px",cursor:"pointer",height:"42px",position:"relative"},O={textDecoration:"none"},L={display:"inline-block",position:"absolute",top:"6px",height:"35px",width:(0,d.s2)()?"calc(100% - 38px)":"180px"},D={font:"12px UbuntuBold, Arial, Helvetica, sans-serif",marginRight:"0px"},U={font:"12px UbuntuRegular, Arial, Helvetica, sans-serif",marginRight:"0px"},Z=function(e){(0,s.Z)(c,e);var t,n,i=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function c(){return(0,o.Z)(this,c),i.apply(this,arguments)}return(0,r.Z)(c,[{key:"getIconClassName",value:function(){return""}},{key:"getStatusText",value:function(){return""}},{key:"getRowClassName",value:function(){return""}},{key:"createLabelElements",value:function(e){var t=e.input;t=e.labelText.startsWith("#")?t.replace(/%23/g,"#"):t.replace(/#/g,"");var n=e.labelText.toLowerCase().indexOf(t.toLowerCase()),i=n>=0?e.labelText.slice(n,n+t.length):e.labelText,o=n>0?e.labelText.slice(0,n):"",r=n+t.length=0?e.labelText.slice(n+t.length):"";return[(0,S.vz)("span",{style:D},o),(0,S.vz)("span",{style:U},i),(0,S.vz)("span",{style:D},r),(0,S.vz)("div",{className:"statusText",style:M},this.getStatusText())]}},{key:"createElement",value:function(e){var t=this;return(0,S.vz)("a",{style:O,href:e.href,tabIndex:-1,onKeyDown:function(n){(0,g.r$)(n)&&t.onClickHandler(e)},onContextMenu:function(e){return!(0,d.s2)()&&!T.J.current.isMobile||(e.preventDefault(),!1)},onBlur:function(e){P.K_.fire(e)},onClick:function(n){""===e.href&&n.preventDefault(),t.onClickHandler(e,n)}},(0,S.vz)("div",{className:this.getRowClassName(),style:B},(0,S.vz)("div",{className:this.getIconClassName(),style:A}),(0,S.vz)("div",{style:L},(0,S.vz)("p",{className:this.getRowClassName(),style:E},this.createLabelElements(e)))))}},{key:"onClickHandler",value:function(e,t){(0,I.BM)(e.labelText,"online");var n={resultType:"broadcaster",resultString:e.labelText};(0,b.fg)("SearchBarResultsClick",n)}}]),c}(x.I),F=n(8871);var _=function(e){(0,s.Z)(c,e);var t,n,i=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function c(){return(0,o.Z)(this,c),i.apply(this,arguments)}return(0,r.Z)(c,[{key:"getIconClassName",value:function(){return"icon-hashtag"}},{key:"getStatusText",value:function(){return""}},{key:"getRowClassName",value:function(){return"hashtag_suggestion"}},{key:"onClickHandler",value:function(e,t){var n="#".concat(e.labelText);(0,I.BM)(n,"hashtags");var i={resultType:"hashtag",resultString:n};(0,b.fg)("SearchBarResultsClick",i),void 0!==t&&F.k4.fire(t)}}]),c}(Z),N=n(3243),j=n(3543);var H=new k.xB("historyDeleteClicked"),z={width:"23px",height:"23px",display:"block",position:"absolute",top:"20%",left:"unset",right:"2px",backgroundPosition:"50% top",backgroundSize:"14px 14px"},W=function(e){(0,s.Z)(c,e);var t,n,i=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function c(){return(0,o.Z)(this,c),i.apply(this,arguments)}return(0,r.Z)(c,[{key:"getIconClassName",value:function(){return"icon-history"}},{key:"getStatusText",value:function(){return j.ag.previouslySearched}},{key:"getRowClassName",value:function(){return"history_suggestion"}},{key:"onClickHandler",value:function(e,t){var n={resultType:"history",resultString:e.labelText};(0,b.fg)("SearchBarResultsClick",n),e.href.includes("/tag/")?((0,I.BM)(e.labelText,"hashtags"),void 0!==t&&F.k4.fire(t)):""!==e.href?(0,I.BM)(e.labelText,"online"):R.fire(e.labelText)}},{key:"createElement",value:function(e){var t=(0,N.Z)((0,l.Z)(c.prototype),"createElement",this).call(this,e),n=(0,d.s2)()?z:{},i=(0,S.vz)("div",{style:n,className:"historyDelete",onClick:function(e){e.preventDefault(),e.stopPropagation()},onMouseDown:function(t){t.ctrlKey||t.metaKey||2===t.button||((0,I.Mi)(e.labelText),H.fire(e.labelText),t.preventDefault(),t.stopPropagation())}}),o=t.firstElementChild;if(null!==o){var r=o.lastElementChild;null!==r&&r.appendChild(i)}return this.isFloatingNavAllowed(e)&&t.setAttribute("data-floatingnav",""),t}},{key:"isFloatingNavAllowed",value:function(e){return!(""!==e.href&&!e.href.includes("/tag/"))}}]),c}(Z);var V=function(e){(0,s.Z)(c,e);var t,n,i=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function c(){return(0,o.Z)(this,c),i.apply(this,arguments)}return(0,r.Z)(c,[{key:"getIconClassName",value:function(){return"icon-offline"}},{key:"getStatusText",value:function(){return j.ag.recentlyOnline}},{key:"getRowClassName",value:function(){return"broadcaster_suggestion"}}]),c}(Z);var q=function(e){(0,s.Z)(c,e);var t,n,i=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function c(){return(0,o.Z)(this,c),i.apply(this,arguments)}return(0,r.Z)(c,[{key:"getIconClassName",value:function(){return"icon-online"}},{key:"getStatusText",value:function(){return j.ag.broadcastingNow}},{key:"getRowClassName",value:function(){return"broadcaster_suggestion"}}]),c}(Z);function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0){this.saveFirstText(),this.keyNavigated=!0;var t=this.currentIndex;t>-1&&this.styleInactiveSuggestion(this.suggestionsList[t].element),this.tabThroughSuggestions(e),(0,g.aZ)(e)?this.currentIndex=this.currentIndex+1<=this.highestIndex?this.currentIndex+1:0:(0,g.si)(e)&&(this.currentIndex=this.currentIndex-1>=0?this.currentIndex-1:this.highestIndex,e.preventDefault());var n=this.suggestionsList[this.currentIndex];void 0!==n&&(this.replaceInputValue(n),this.styleActiveSuggestion(n.element)),this.styleAllInactiveSuggestions()}}},{key:"replaceInputValue",value:function(e){var t,n=null!==(t=e.element.getAttribute("class"))&&void 0!==t?t:"";void 0!==n&&(this.input.element.value=n.includes("hashtag_suggestion")?"#".concat(e.label):e.label)}},{key:"tabThroughSuggestions",value:function(e){if(e.key===G)if(this.currentIndex>-1&&this.currentIndex<=this.highestIndex){if(e.shiftKey){if(0===this.currentIndex)return this.resetSuggestionsNavigation(),void(this.input.element.value=this.firstText);this.currentIndex=this.currentIndex-1}else{if(this.currentIndex===this.highestIndex)return this.resetSuggestionsNavigation(),void(this.input.element.value=this.firstText);this.currentIndex=this.currentIndex+1}e.preventDefault()}else-1!==this.currentIndex||e.shiftKey||(this.currentIndex=0,e.preventDefault())}},{key:"saveFirstText",value:function(){this.keyNavigated||(this.firstText=this.input.element.value)}},{key:"getSuggestionsAfterTime",value:function(e){var t=this;if(this.pauseSuggestions)""===this.input.element.value&&this.removeExistingSuggestions();else{0!==this.timeoutId&&window.clearTimeout(this.timeoutId);var n=this.input.element.value.trim().replace(/^#/,"%23"),i=n.split(" "),o=function(e){return e.some((function(e){return e.length>30}))||e.length>6||n.length>60},r=(0,y.ej)();n===this.lastSearch&&this.gender===r||o(i)?(o(i)&&this.showHistorySuggestions(n),e?this.showSuggestions():this.hideSuggestions()):this.timeoutId=window.setTimeout((function(){t.suggestionPromise=t.getSuggestions(e)}),250)}}},{key:"styleAllInactiveSuggestions",value:function(){var e,t=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return K(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)?K(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(this.suggestionsList);try{for(t.s();!(e=t.n()).done;){var n=e.value;n!==this.suggestionsList[this.currentIndex]&&this.styleInactiveSuggestion(n.element)}}catch(e){t.e(e)}finally{t.f()}}},{key:"getSuggestions",value:(t=(0,i.Z)(u().mark((function e(t){var n,i,o=this;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.input.element.value,i=n.trim().replace(/^#/,"%23"),this.timeoutId=0,""!==n){e.next=8;break}return this.lastSearch=void 0,this.showHistorySuggestions(n),this.showSuggestions(),e.abrupt("return");case 8:return e.next=10,(0,h.Ue)("ax/search/?keywords=".concat(i)).then((function(e){if(o.input.element.value===n){o.lastSearch=i,o.showHistorySuggestions(i);var r=o.suggestionsList.length,s=new f.j(e.responseText);J.forEach((function(e){var t=s.getAny(e);void 0!==t&&Object.keys(t).forEach((function(i){if(!(r>=10)){var s=t[i];o.createSuggestion(s,n,e,r),o.highestIndex=r,r+=1}}))})),o.preventShow?o.preventShow=!1:t?o.showSuggestions():o.hideSuggestions()}})).catch((function(e){o.pauseSuggestions=!0,window.setTimeout((function(){o.pauseSuggestions=!1}),6e4),(0,b.fg)("TooManySearchAutocompleteError"),warn("Too many autocomplete queries, wait before resuming",e)}));case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"showHistorySuggestions",value:function(e){this.removeExistingSuggestions(),this.createHistorySuggestions(e),this.highestIndex=this.suggestionsList.length-1}},{key:"createHistorySuggestions",value:function(e){var t=this;if((0,d.IU)()){(0,I.eK)();var n=0;if(!(0,p.TF)()){var i=window.localStorage.getItem((0,I.HQ)());null!==i&&JSON.parse(i).forEach((function(i){void 0!==i.content&&i.content.includes(e.replace(/%23/g,"#").toLowerCase())&&(n+=1,t.createSuggestion(i.content,e,"history",n,i.type))}))}}}},{key:"hideSuggestions",value:function(){var e=this;this.styleInactiveLastSug(),this.hideElement(),this.resetSuggestionsNavigation(),window.setTimeout((function(){document.activeElement instanceof HTMLElement&&e.element.contains(document.activeElement)&&document.activeElement.blur()}))}},{key:"getCurrentNavigatedSuggestion",value:function(){return this.suggestionsList[this.currentIndex]}},{key:"isSuggestionsNavigated",value:function(){return this.keyNavigated&&this.currentIndex>-1&&this.suggestionsList.length>this.currentIndex}},{key:"resetSuggestionsNavigation",value:function(){this.currentIndex=-1,this.keyNavigated=!1}},{key:"styleInactiveLastSug",value:function(){this.currentIndex>-1&&this.suggestionsList.length>this.currentIndex&&this.styleInactiveSuggestion(this.suggestionsList[this.currentIndex].element)}},{key:"preventShowOnGetSuggestions",value:function(e){this.preventShow=e}},{key:"showSuggestions",value:function(){this.suggestionsList.length&&document.activeElement===this.input.element?this.showElement():this.hideElement()}}]),x}(m.w)},7642:function(e,t,n){"use strict";n.d(t,{BM:function(){return u},HQ:function(){return c},Mi:function(){return d},eK:function(){return h}});var i=n(8759),o=n(2800);function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return s(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)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw r}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);nl&&h.pop(),u=JSON.stringify(h)}window.localStorage.setItem(c(),u)}}function d(e){if((0,i.IU)()){var t=window.localStorage.getItem(c());if(null!==t){var n=null!==t?JSON.parse(t):[];n.splice(n.findIndex((function(t){return t.content===e})),1);var o=JSON.stringify(n);window.localStorage.setItem(c(),o)}}}function h(){var e=window.localStorage.getItem(c());if(null!==e)try{var t,n=r(JSON.parse(e));try{for(n.s();!(t=n.n()).done;){var i=t.value;if(void 0===i.content||void 0===i.type)return void window.localStorage.removeItem(c())}}catch(e){n.e(e)}finally{n.f()}}catch(t){return warn("Failed to parse and iterate search history, clearing",{searchHistory:e}),void window.localStorage.removeItem(c())}}},9395:function(e,t,n){"use strict";n.d(t,{K_:function(){return I},Mj:function(){return P}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(8759),c=n(3753),u=n(9),d=n(8263),h=n(1794),f=n(6921),p=n(3543),m=n(1289),v=n(1185),g=n(3515),y=n(2800),b=n(6698),w=n(4493),C=n(7642);function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(i.join("").split(" ").filter((function(e){return e.length>0})));try{for(s.s();!(r=s.n()).done;){var a=r.value,l=a.startsWith("#")?"#":"",c=a.replace(/#/g,""),u=c.length>0?"".concat(l).concat(c):"";t.push(u),c.length>=2&&(o=!0)}}catch(e){s.e(e)}finally{s.f()}}return o?t.join(" ").trim():""}P.onSubmit=new h.xB("onSubmit")},6208:function(e,t,n){"use strict";n.d(t,{I:function(){return l},L:function(){return a}});var i=n(4649),o=n(47);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function s(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=0;t-=1){var n=e[t];n!==this.currentTab?n.hideElement():this.currentTab.active||n.showElement()}this.repositionChildrenRecursive(),this.afterDOMConstructedIncludingChildren()}},{key:"refreshTabs",value:function(){var e,t=!1,n=b(this.children());try{for(n.s();!(e=n.n()).done;)t=e.value.adjustTab()||t}catch(e){n.e(e)}finally{n.f()}t&&this.tabHandlesRow.repositionChildrenRecursive()}},{key:"getHandleStyle",value:function(e){return e.active?(0,p.vP)(e.handle,"active"):((0,p.FU)(e.handle,"active"),e instanceof S&&(e.collapsed?(0,p.vP)(e.handle,"collapsed"):(0,p.FU)(e.handle,"collapsed"))),y(y(y({},this.tabHandleStyle),e instanceof S&&e.collapsed?e.handleCollapseStyle:{}),e.active?this.tabHandleActiveStyle:{})}}]),n}(h.w),k=function(e){(0,a.Z)(n,e);var t=C(n);function n(){var e;return(0,o.Z)(this,n),(e=t.call(this)).active=!1,e.isHandleHovered=!1,e.element.style.position="relative",e}return(0,r.Z)(n,[{key:"tabHandleClicked",value:function(e){this.changeToThisTab()}},{key:"isTabHandleHidden",value:function(){return"none"===this.handle.element.style.display}},{key:"getTabHandleContent",value:function(){return[document.createTextNode(" ")]}},{key:"getTabId",value:function(){return""}},{key:"setAsCurrentTab",value:function(){}},{key:"adjustTab",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.handle.element.textContent;if(!e){var n=document.createElement("span");null!==this.handle.element.firstChild&&((n=this.handle.element.firstChild).innerHTML="");var i,o=b(this.getTabHandleContent());try{for(o.s();!(i=o.n()).done;){var r=i.value;n.appendChild(r)}}catch(e){o.e(e)}finally{o.f()}this.handle.element.appendChild(n)}this.adjustHandleStyle();var s="none"===this.handle.element.style.display;return this.isTabHandleHidden()?this.handle.element.style.display="none":this.handle.element.style.display="inline-block",t!==this.handle.element.textContent||s!==("none"===this.handle.element.style.display)}},{key:"constructTabHandle",value:function(){var e=this;for(this.handle=this.constructTabHandleComponent(),(0,d.Zf)(["click","touchstart"],this.handle.element,(function(t){e.tabHandleClicked(t),e instanceof S&&e.collapsed&&(e.isHandleHovered=!1)}));null!==this.handle.element.firstChild;)this.handle.element.removeChild(this.handle.element.firstChild);var t,n=document.createElement("span"),i=b(this.getTabHandleContent());try{for(i.s();!(t=i.n()).done;){var o=t.value;n.appendChild(o)}}catch(e){i.e(e)}finally{i.f()}return this.handle.element.appendChild(n),this.handle.element.id=this.getTabId(),this.handle.element.dataset.testid=this.getTabId(),this.adjustHandleStyle(),(0,f.nH)(this.handle).listen((function(t){e.isHandleHovered=t,e.adjustHandleStyle()})),this.handle}},{key:"constructTabHandleComponent",value:function(){return new h.w(document.createElement("div"))}},{key:"changeToThisTab",value:function(){void 0!==this.parent?this.parent.changeToTab(this):error("no parent")}},{key:"isCurrentTab",value:function(){return void 0===this.parent?(error("no parent"),!1):this.parent.getCurrentTab()===this}},{key:"refreshTabs",value:function(){void 0!==this.parent?this.parent.refreshTabs():error("no parent")}},{key:"getHandleStyle",value:function(){return void 0!==this.parent?this.parent.getHandleStyle(this):{}}},{key:"adjustHandleStyle",value:function(){(0,f.Zs)(this.handle,this.getHandleStyle())}},{key:"hideElement",value:function(){(0,c.Z)((0,u.Z)(n.prototype),"hideElement",this).call(this),this.active=!1,this.adjustHandleStyle()}},{key:"showElement",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"block";(0,c.Z)((0,u.Z)(n.prototype),"showElement",this).call(this,e),this.active=!0,this.adjustHandleStyle()}}]),n}(h.w),S=function(e){(0,a.Z)(n,e);var t=C(n);function n(){var e;return(0,o.Z)(this,n),(e=t.apply(this,arguments)).handleCollapseStyle={display:"block",cssFloat:"none",padding:"9px 12px",margin:0,borderRadius:"",border:"none",boxSizing:"border-box",width:"100%",height:"auto"},e}return(0,r.Z)(n,[{key:"constructTabHandleComponent",value:function(){var e=this,t=new m.tB(document.createElement("div"));return t.onCollapseEvent.listen((function(t){e.collapsed=t,void 0!==e.onCollapse&&e.onCollapse(t),e.adjustTab()})),t}}]),n}(k)},795:function(e,t,n){"use strict";n.d(t,{IK:function(){return V},oV:function(){return H},sh:function(){return te},_r:function(){return $},Hi:function(){return Q},dg:function(){return X},Ky:function(){return G},rv:function(){return q},f_:function(){return ee}});var i=n(3243),o=n(2951),r=n(1976),s=n(7591),a=n(9492),l=n(7597),c=n(8759),u=n(2800),d=n(7693),h=n(1522),f=n(3753),p=n(4793),m=n(7988),v=n(9),g=n(1794),y=n(4801),b=n(3705),w=n(7108),C=n(3543),x=n(2750),k=n(1185),S=n(4649),T=n(8263),I=n(3682),P=n(9874),R=n(2974),M=n(6272),A=n(1194);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function B(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1]?{}:{TokenSourceTipCallout:{top:"60%",right:"40%"}}),r=null!=e,s=r&&o.hasOwnProperty(e)&&o[e];r&&i.hasOwnProperty(e)&&((0,c._1)()||(0,c.Iq)())&&(0,I.gr)()&&(s=i[e]);var l=null!==(t=null===(n=document)||void 0===n||null===(n=n.body)||void 0===n||null===(n=n.getBoundingClientRect())||void 0===n?void 0:n.top)&&void 0!==t?t:0;!1!==s?(0,T.Zs)(a.element,B({transform:"none",top:"unset",right:"unset",left:"unset"},s)):(0,T.Zs)(a.element,{left:"unset",top:"calc(50% - ".concat(l,"px)"),right:"50%",transform:"translate(50%, -50%)"})},a.applyDarkModeStyles=function(){var e=document.body.classList.contains("darkmode");(0,T.Zs)(a.element,{backgroundColor:e?"#202c39":"#F8F9FA",boxShadow:e?"0 0 32px rgba(0,0,0,.32)":"0px 3px 10px 0px rgba(0, 0, 0, 0.10)",border:"1px solid ".concat(e?"#202c39":"#ACACAC")})},(0,T.Zs)(a.element,{width:"".concat(313,"px"),position:"absolute",minHeight:"218px",height:"unset",overflowY:"auto",zIndex:1006,borderRadius:"8px"}),a.content=document.createElement("div"),a.content.classList.add("desktop"),a.element.appendChild(a.content);var l=a.createCloseButton();return a.element.appendChild(l),a.show(e,i),M.A3.listen((function(e){var t,n;a.tokenBalance=null!==(t=null==e?void 0:e.tokens)&&void 0!==t?t:0,void 0!==a.oneClickFlowInstance&&(null===(n=a.oneClickFlowInstance)||void 0===n||n.update({tokenBalance:a.tokenBalance}))})),a}return(0,r.Z)(n,[{key:"show",value:function(e,t){var o=this;if(this.isOpen)this.hide();else{var r="fullscreen"===R.S.getVideoMode();this.isOpen=!0,this.applyDarkModeStyles(),this.overrideDefaultPositionStyles(e,r);var s=A.d.get("OneClickFlow");this.oneClickFlowInstance=new s({source:null!=e?e:"",roomType:null!=t?t:"public",closeModal:function(){return o.hide()},desktop:!0,tokenBalance:this.tokenBalance},this.content),(0,i.Z)((0,l.Z)(n.prototype),"show",this).call(this),(0,T.Zs)(this.overlay,{display:"none"}),window.setTimeout((function(){return(0,d.j9)("click",document,o.outSideHandlerClick)}),10)}}},{key:"hide",value:function(){var e;(0,i.Z)((0,l.Z)(n.prototype),"hide",this).call(this),null===(e=this.oneClickFlowInstance)||void 0===e||e.dispose(),this.oneClickFlowInstance=void 0,(0,d.SC)("click",document,this.outSideHandlerClick),this.isOpen=!1}}]),n}(P.z);var Z=function(e){(0,s.Z)(h,e);var t,n,c=(t=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function h(){var e;(0,o.Z)(this,h),(e=c.call(this,{easyExit:!1})).isClosed=!1,e.canClose=!0,e.width=430,e.contentOffset=135,e.url="/tipping/purchase_tokens/".concat(window.location.search,"&source=").concat(u.J.current.PurchaseEventSources.TOKEN_SOURCE_PURCHASE_PAGE_IFRAME),e.element.style.width="".concat(e.width+20,"px"),e.element.style.position="fixed",e.element.style.right="0",e.element.style.top="".concat(e.contentOffset,"px"),e.element.style.minHeight="200px",e.element.style.zIndex="1001",e.element.style.overflow="hidden",e.element.style.opacity="0",e.element.style.transition="opacity 1s",e.element.style.zIndex="1003",e.overlay.style.zIndex="1002",e.overlay.style.background="rgba(0, 0, 0, 0.5)",e.content=document.createElement("div"),e.content.style.position="absolute",e.content.style.right="-500px",e.content.style.minHeight="200px",e.content.style.maxHeight="735px",e.content.style.width="".concat(e.width,"px"),e.content.style.border="1px solid #ccc",e.content.style.borderRadius="5px",e.content.style.background="#FFF",e.content.style.transition="right 500ms",e.content.style.zIndex="1002",e.element.appendChild(e.content);var t=e.createIframe(),n=function(){clearInterval(e.resizeTimeout),e.element.style.opacity="0",e.content.style.right="-500px",window.setTimeout((function(){e.hide()}),500)},i=function(){e.canClose&&!e.isClosed&&(e.isClosed=!0,(0,d.SC)("message",window,v),(0,d.SC)("keydown",document,r),n())},r=function(e){"Esc"!==e.key&&"Escape"!==e.key||i()},s=document.createElement("div");e.content.appendChild(s);var a=e.createBackButton();s.appendChild(a);var l=document.createElement("div");l.onclick=n,l.style.display="inline-block",l.style.height="12.73px",l.style.width="12.73px",l.style.cursor="pointer",l.style.position="absolute",l.style.right="15px",l.style.top="10px";var p=function(e){var t=document.createElement("div");return t.style.position="absolute",t.style.width="3px",t.style.height="15px",t.style.left="5px",t.style.background="#C4C4C4",t.style.transform=e,t};l.appendChild(p("rotate(-135deg)")),l.appendChild(p("rotate(-45deg)")),s.appendChild(l),e.spinner=e.createLoadingSpinner(),e.content.appendChild(e.spinner),e.overlay.onclick=function(t){t.stopPropagation(),i(),e.overlayClick.fire(void 0)},a.onclick=function(){t.src=e.url},t.onload=function(){clearInterval(e.resizeTimeout);var i=document.createElement("a");i.href=(0,f.BN)(t.src),-1===e.url.indexOf("".concat(i.pathname).concat(i.search))&&(a.style.display="inline-block",l.onclick=n)},window.setTimeout((function(){e.content.appendChild(t)}),1);var m=function(t,n,o){window.open((0,f.BN)(t),"_blank","status=0,toolbar=0,menubar=0,directories=0,resizable=1,scrollbars=1,height=".concat(n,",width=").concat(o)),e.canClose=!0,i()},v=function(n){if("close"===n.data)e.canClose=!0,i();else if("hide-spinner"===n.data)e.spinner.style.display="none";else if("crypto-submit"===n.data)e.canClose=!1,e.overlay.onclick=function(e){e.preventDefault()},l.onclick=function(e){e.preventDefault()};else if("crypto-error"===n.data)e.canClose=!0,e.overlay.onclick=function(t){t.stopPropagation(),i(),e.overlayClick.fire(void 0)},l.onclick=i;else if(0===n.data.indexOf("crypto-redirect: ")){var o=n.data.substring(17);m(o,950,780)}else if(0===n.data.indexOf("billing-redirect: ")){var s=n.data.substring(18);m(s,715,430)}else n.origin.indexOf(window.location.hostname)>=0&&("/tipping/purchase_tokens/"===n.data&&(a.style.display="none"),l.onclick=i,null!==t.contentWindow&&(0,d.j9)("keydown",t.contentWindow,r))};return(0,d.j9)("message",window,v),(0,d.j9)("keydown",document,r),e.show(),window.setTimeout((function(){t.style.opacity="1"}),1e3),e.repositionChildren(),e}return(0,r.Z)(h,[{key:"createIframe",value:function(){var e=document.createElement("iframe");return e.className="purchaseFrame",e.src=this.url,e.style.border="none",e.style.padding="0",e.style.background="transparent",e.style.height="calc(100% - 5px)",e.style.width="100%",e.style.transition="height 200ms, opacity 1s",e.style.opacity="0",e}},{key:"createBackButton",value:function(){var e=document.createElement("div");e.innerHTML="< ",e.style.display="none",e.style.color="#999",e.style.cursor="pointer",e.style.fontSize="20px",e.style.fontWeight="bold",e.style.borderRadius="50px",e.style.padding="2px 0 5px 7px";var t=document.createElement("small");return t.innerText="Back",t.style.fontSize="12px",t.style.verticalAlign="middle",t.style.lineHeight="9px",e.appendChild(t),e}},{key:"createLoadingSpinner",value:function(){var e=document.createElement("div");return e.style.animationName="spin",e.style.position="absolute",e.style.top="50%",e.style.left="50%",e.style.width="30px",e.style.height="31px",e.style.margin="-15px 0 0 -15px",e.style.background='url("'.concat(STATIC_URL,'images/loading_spinner.svg")'),e.style.backgroundSize="cover",e.style.animationName="spin",e.style.animationDuration="2s",e.style.webkitAnimationDuration="2s",e.style.animationTimingFunction="linear",e.style.webkitAnimationTimingFunction="linear",e.style.animationIterationCount="infinite",e.style.webkitAnimationIterationCount="infinite",e.style.zIndex="-1",e}},{key:"show",value:function(){var e=this;(0,i.Z)((0,l.Z)(h.prototype),"show",this).call(this),window.setTimeout((function(){e.element.style.opacity="1"}),1),window.setTimeout((function(){e.content.style.right="10px"}),500)}},{key:"repositionChildren",value:function(){this.content.style.height="".concat(window.innerHeight-this.contentOffset-10,"px"),this.element.style.top="".concat(Math.min(this.contentOffset,window.innerHeight-this.content.offsetHeight-10),"px")}}]),h}(P.z),F=n(407);function _(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return N(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)?N(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&(i.dd=document.createElement("dd"),i.dd.style.margin="0",i.dd.style.padding="0 8px 0 28px",i.dd.innerText=r,i.element.appendChild(i.dd));var s=n.createItemId("ButtonMenuItem");return i.input=document.createElement("input"),i.input.id=s,i.input.name=s,i.input.type="radio",i.input.style.cursor="pointer",i.input.style.position="absolute",i.input.style.opacity="0",i.input.style.width="0",i.input.style.height="0",i.element.appendChild(i.input),void 0!==e.disabledMouseClick&&(i.disabledMouseClick=e.disabledMouseClick),(0,d.j9)("mouseenter",i.element,(function(){i.disabled&&void 0!==i.disabledTooltip&&i.showTooltip()})),(0,d.j9)("mouseleave",i.element,(function(){i.disabled&&void 0!==i.disabledTooltip&&i.hideTooltip()})),i.enabledMouseClick=e.enabledMouseClick,(0,d.j9)("click",i.element,(function(e){i.disabled?void 0!==i.disabledMouseClick&&i.disabledMouseClick(e):i.enabledMouseClick(e)})),(0,d.j9)("touchstart",i.element,i.onTouch),(0,d.j9)("focus",i.input,(function(){i.element.style.outline="2px solid Highlight"})),(0,d.j9)("blur",i.input,(function(){i.element.style.removeProperty("outline")})),i}return(0,r.Z)(n,[{key:"select",value:function(){(0,k.vP)(this.dt,"selected")}},{key:"deselect",value:function(){(0,k.FU)(this.dt,"selected")}},{key:"getValue",value:function(){return this.data.value}},{key:"getButtonLabel",value:function(){var e=this.data.buttonLabel;return void 0===e?this.data.label:e}},{key:"disable",value:function(){this.disabled||(this.disabled=!0,(0,k.vP)(this.element,"disabled"))}},{key:"enable",value:function(){this.disabled&&(this.disabled=!1,(0,k.FU)(this.element,"disabled"))}}],[{key:"createItemId",value:function(e){return n.lastId+=1,e+n.lastId.toString()}}]),n}(v.w);z.lastId=0;var W=function(e){(0,s.Z)(n,e);var t=j(n);function n(e,i){var r;(0,o.Z)(this,n),(r=t.call(this)).width=280,r.visible=!1,r.visibilityChange=new g.xB("visibilityChange"),r.selectionChange=new g.xB("selectionChange");var s=[],a=e.length;0===a&&error("ButtonMenu requires at least one option!"),(0,k.vP)(r.element,"menu"),r.element.style.padding="0",r.element.style.display="none",r.element.style.width="".concat(r.width,"px"),r.element.style.textAlign="left",r.element.style.fontSize="14px",r.element.style.lineHeight="14px",r.element.style.borderRadius="4px",r.overlay.style.zIndex="1002",r.element.style.zIndex="1003",r.element.style.overflow="visible",r.element.style.removeProperty("height");for(var l=-1,c=a-1,u=function(){var t=e[h];t.value===i&&(l=h),t.enabledMouseClick=function(e){e.stopPropagation(),r.onItemClick(n)};var n=r.createMenuItem(t),o=function(e){return e.preventDefault(),e.stopPropagation(),r.onItemClick(n),!1};(0,d.j9)("keyup",n.input,(function(e){return 32!==e.keyCode||o(e)})),(0,d.j9)("keydown",n.input,(function(e){return 13!==e.keyCode||o(e)})),0===h&&(n.element.style.borderTopWidth="1px",n.element.style.borderTopLeftRadius="2px",n.element.style.borderTopRightRadius="2px"),h===c&&(n.element.style.borderBottomLeftRadius="2px",n.element.style.borderBottomRightRadius="2px"),r.addChild(n),s.push(n.input)},h=0;h0&&void 0!==arguments[0]&&arguments[0];this.isVisible()&&(e||this.visibilityChange.fire(!1),this.visible=!1,this.element.style.display="none",this.hideOverlay())}},{key:"toggle",value:function(e){this.isVisible()?this.hide():this.show(e)}},{key:"disableItem",value:function(e){var t=this.children();e-1}},{key:"focusPrev",value:function(){var e=this.getCurrentFocusData(),t=e.elements.length;if(e.index-=1,-2===e.index)e.index=t-1;else if(-1===e.index)return!1;return this.focusElement(e),!0}},{key:"focusPrevMenuItem",value:function(){if(!this.menuEnabled||!this.dropDownMenu.isVisible())return!1;var e=this.getCurrentFocusData(),t=e.elements.length;return e.index-=1,e.index<=t-this.dropDownMenu.focusElements.length-1&&(e.index=t-1),this.focusElement(e),!0}},{key:"focusNext",value:function(){var e=this.getCurrentFocusData(),t=e.elements.length;return e.index+=1,!(e.index>=t||(this.focusElement(e),0))}},{key:"focusNextMenuItem",value:function(){if(!this.menuEnabled||!this.dropDownMenu.isVisible())return!1;var e=this.getCurrentFocusData(),t=e.elements.length;return e.index+=1,(e.index>=t||e.index<=t-this.dropDownMenu.focusElements.length-1)&&(e.index=t-this.dropDownMenu.focusElements.length),this.focusElement(e),!0}},{key:"focusElement",value:function(e){var t=e.index;e.elements[t].focus()}},{key:"getCurrentFocusData",value:function(){var e=this.focusElements;return this.menuEnabled&&this.dropDownMenu.isVisible()&&(e=this.focusElements.concat(this.dropDownMenu.focusElements)),{elements:e,index:e.indexOf(document.activeElement)}}},{key:"getMenuOffsets",value:function(){var e=this.element,t=(0,m.cQ)(this.submitButton),n=e.offsetLeft+e.offsetWidth+1-this.dropDownMenu.width;return{top:t.height+2*t.top,left:n}}},{key:"enableAnonymousTips",value:function(){var e=this.dropDownMenu.getValue();this.anonymousEnabled=!0,this.dropDownMenu.enableItem(1),this.changeTipType(e)}},{key:"disableAnonymousTips",value:function(){this.anonymousEnabled=!1,this.dropDownMenu.disableItem(1),this.changeTipType("public")}},{key:"enableMenu",value:function(){this.menuEnabled||(this.menuEnabled=!0,this.submitButton.style.borderRadius="4px 0 0 4px",this.dropDownButton.style.display="inline-block",this.focusElements=[this.submitButton,this.dropDownButton],this.repositionChildrenRecursive())}},{key:"disableMenu",value:function(){this.menuEnabled&&(this.hasFocus()&&this.submitButton.focus(),this.menuEnabled=!1,this.dropDownMenu.hide(),this.submitButton.style.borderRadius="4px",this.dropDownButton.style.display="none",this.focusElements=[this.submitButton])}},{key:"changeTipType",value:function(e){this.tipType=e,this.tipTypeChange.fire(e),this.resetText()}},{key:"styleButtonMenuItem",value:function(e){e.dt.style.fontFamily="'UbuntuMedium', Helvetica, Arial, sans-serif",void 0!==e.dd&&(e.dd.style.fontFamily="'UbuntuRegular', Helvetica, Arial, sans-serif")}},{key:"createCommonButton",value:function(){var e=document.createElement("button");return(0,k.vP)(e,"buttons"),e.style.position="relative",e.style.display="inline-block",e.style.cursor="pointer",e.style.fontSize="14px",e.style.borderWidth="1px",e.style.borderStyle="solid",e.style.height="32px",e.style.verticalAlign="top",e.style.margin="0",(0,d.j9)("focus",e,(function(){e.style.zIndex="100"})),(0,d.j9)("blur",e,(function(){e.style.zIndex="auto"})),e}},{key:"createSubmitButton",value:function(){var e=this.createCommonButton();return e.type="submit",e.title=C.ag.sendTipButtonText,e.style.padding="6px 18px",e.style.borderRadius="4px 0 0 4px",e.style.borderRight="0 none transparent",e.style.maxWidth="145px",e.style.overflow="hidden",e.style.textOverflow="ellipsis",e.style.whiteSpace="nowrap",e}},{key:"createDropDownMenu",value:function(){var e=this.createCommonButton();return e.style.padding="6px 0",e.style.borderRadius="0 4px 4px 0",e.style.width="24px",e}}]),n}(v.w);function q(e,t){window.setTimeout((function(){if(t.isAnonymousEnabled()){var n=t.getTipType();(0,b.fg)("SendTipViewed",{source:e,tipType:n,localStorage:(0,c.IU)()})}}),0)}V.menuItemsData=[{label:C.ag.publicTippingText,value:"public",description:C.ag.publicTippingDesc,buttonLabel:C.ag.sendTipButtonText,enabledMouseClick:function(){}},{label:C.ag.anonTippingText,value:"anonymous",description:C.ag.anonTippingDesc,buttonLabel:C.ag.anonButtonText,enabledMouseClick:function(){},disabledMouseClick:function(e){(0,b.fg)("SupporterPageOpened",{source:"anon_tip"}),null!==window.top&&(window.top.location.href=(0,f.BN)("/supporter/upgrade/?source=".concat(u.J.current.PurchaseEventSources.SUPPORTER_SOURCE_ANON_TIP_UPSELL)))},disabledTooltip:(0,F.T)({content:C.ag.mustBeSupporterFeature,hasHTML:!1,width:240,divotPosition:0,divotLeftOrTop:"40px"}),disabledModalText:"".concat(C.ag.mustBeSupporterFeature," ").concat(C.ag.anonTipDisabledModalCont)}];var K,J,G="/tipping/purchase_tokens/";function Y(e){var t,n=e.source,i=void 0===u.J.current.loggedInUser;return""===window.location.search?(t=G,null!=n&&""!==n?(t+="?source=".concat(n),i&&(t+="&refresh_opener=1")):i&&(t+="?refresh_opener=1")):(t="".concat(G).concat(window.location.search),null!=n&&""!==n&&(t+="&source=".concat(n)),i&&(t+="&refresh_opener=1")),t}function $(){var e=document.createElement("input");return(0,k.vP)(e,"tipAmountInput"),e.dataset.testid="tip-amount-input",(0,d.j9)("keypress",e,(function(t){t.metaKey||8===t.charCode||0===t.charCode||13===t.charCode||(e.value.length>H?t.preventDefault():t.charCode>=48&&t.charCode<=57||t.preventDefault())})),(0,d.j9)("paste",e,(function(){window.setTimeout((function(){/^[1-9]\d*$/.test(e.value)||(e.value=""),e.value=e.value.substring(0,H)}),0)})),e}function Q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.popupOnly,n=void 0!==t&&t,i=e.source,o=void 0===i?void 0:i,r=e.roomType,s=void 0===r?"public":r,a=Y({source:o}),l=new y.BJ(["PrchPgIfrmV4","PrchPgPopupV4"],"purchaseredesign"),c=u.J.current.loggedInUser&&u.J.current.loggedInUser.canWegOneClick;return l.eligible&&l.active?(l.record(),void function(e,t,n,i,o){var r=Y({source:o});if("PrchPgIfrmV4"===e){if(i)return void(0,x.Pv)(r,"_blank","height=715, width=430, scrollbars=1");void 0===K||K.isClosed?K=new Z:K.show()}else"PrchPgPopupV4"===e?(0,x.Pv)(r,"_blank","height=715, width=430, scrollbars=1"):(0,x.Pv)(r,"_blank","height=615, width=850, scrollbars=1")}(l.activeSide,0,0,n,o)):void 0!==c&&c&&u.J.current.isMobile?void(J?J.show(null!=o?o:"",s):J=new D(null!=o?o:"",s)):(0,y.NZ)("OnFlPrDktp")&&!u.J.current.isMobile?(new y.KS("OnFlPrDktp").record(),void(J?J.show(null!=o?o:"",s):J=new U(null!=o?o:"",s))):void(0,x.Pv)(a,"_blank","height=615, width=850, scrollbars=1")}function X(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;(0,h.oB)(e,(function(){Q({popupOnly:t,source:n,roomType:i})}),void 0,{acceptText:C.ag.purchaseTokensText})}function ee(e){var t,n=_(document.querySelectorAll(".tokencount[updatable-count]"));try{for(n.s();!(t=n.n()).done;)t.value.textContent="".concat(e)}catch(e){n.e(e)}finally{n.f()}}function te(e){e.onclick=function(t){if(e.classList.contains("welcome-page-purchase-tokens")&&(0,b.fg)("WelcomePagePurchaseTokensClicked"),!t.ctrlKey&&!t.metaKey){var n=function(e){var t=e.dataset.purchaseEventSource;if(null!=t&&""!==t)return Object.values(u.J.current.PurchaseEventSources).includes(t)?Object.values(u.J.current.PurchaseEventSources).find((function(e){return e===t})):void 0}(e);t.preventDefault(),Q({popupOnly:t.target.className.includes("popup_only"),source:n})}},""===e.href&&(e.href=(0,f.BN)(G))}},407:function(e,t,n){"use strict";n.d(t,{T:function(){return w}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(8759),c=n(7693),u=n(9),d=n(3149),h=n(8263),f=n(1794),p=n(9491),m=n(9429),v=n(2974),g=n(1185),y=n(9760);var b=function(e){(0,r.Z)(d,e);var t,n,u=(t=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function d(e,t,n){var o,r,s,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:document.body;return(0,i.Z)(this,d),(s=u.call(this)).target=e,s.storageKey=t,s.params=n,s.parentElm=a,s.listenerGroup=new f.mM,s.hOffsetFunc=function(e){return 0},s.vOffsetFunc=function(e){return 0},s.element=w(n),s.element.style.paddingRight="28px",!0!==n.noCloseButton&&s.addCloseButton(),s.divotPosition=n.divotPosition,s.divotLeftOrTop=n.divotLeftOrTop,s.hOffsetFunc=null!==(o=n.hOffsetFunc)&&void 0!==o?o:s.hOffsetFunc,s.vOffsetFunc=null!==(r=n.vOffsetFunc)&&void 0!==r?r:s.vOffsetFunc,y.nR.listen((function(){s.updateLocation()})).addTo(s.listenerGroup),d.dismissed.listen((function(e){s.storageKey===e&&s.dispose()})).addTo(s.listenerGroup),void 0!==n.showInModes&&(s.videoModes=n.showInModes,v.S.changeVideoMode.listen((function(e){s.updateLocation(),s.showIfCorrectMode()})).addTo(s.listenerGroup),m.Ox.splitModeDragResize.listen((function(){s.updateLocation()})).addTo(s.listenerGroup)),s.updateLocation(),s.showIfCorrectMode(),a.appendChild(s.element),s}return(0,o.Z)(d,[{key:"dismiss",value:function(){this.dispose(),void 0!==this.storageKey&&(d.dismissed.fire(this.storageKey),(0,l.IU)()&&localStorage.setItem(this.storageKey,"true")),void 0!==this.params.onAfterDismiss&&this.params.onAfterDismiss()}},{key:"dispose",value:function(){var e,t;this.hide(),null===(e=this.parent)||void 0===e||e.removeChild(this),null===(t=this.element.parentElement)||void 0===t||t.removeChild(this.element),this.listenerGroup.removeAll()}},{key:"addCloseButton",value:function(){var e=this,t=(0,p.bo)("12px");(0,h.Zs)(t,{position:"absolute",right:"8px",top:"8px"}),(0,g.vP)(t,"tooltipCloseButton"),(0,c.j9)("click",t,(function(){e.dismiss()})),this.element.appendChild(t)}},{key:"updateLocation",value:function(){if(!1!==this.params.autoUpdateLocation){var e=this.parentElm.getBoundingClientRect(),t=this.target.getBoundingClientRect(),n=t.top-e.top,i=t.left-e.left,o=(0,h.gV)(this.divotLeftOrTop);1===this.divotPosition?(this.element.style.top="".concat(n-this.element.clientHeight-this.target.clientHeight+this.vOffsetFunc(this.target),"px"),this.element.style.left="".concat(i-o+this.hOffsetFunc(this.target),"px")):0===this.divotPosition?(this.element.style.top="".concat(n+this.target.clientHeight+this.vOffsetFunc(this.target),"px"),this.element.style.left="".concat(i-o+this.hOffsetFunc(this.target),"px")):2===this.divotPosition?(this.element.style.top="".concat(n-o+this.vOffsetFunc(this.target),"px"),this.element.style.left="".concat(i+this.target.clientWidth+this.hOffsetFunc(this.target),"px")):3===this.divotPosition&&(this.element.style.top="".concat(n-o+this.vOffsetFunc(this.target),"px"),this.element.style.left="".concat(i-this.element.clientWidth+this.hOffsetFunc(this.target),"px"))}}},{key:"setDivotPosition",value:function(e,t){var n;this.divotLeftOrTop=null!=t?t:this.divotLeftOrTop,this.divotPosition=e;var i=this.element.querySelector(".divot");null==i||null===(n=i.parentElement)||void 0===n||n.removeChild(i);var o=C(this.divotPosition,this.divotLeftOrTop);void 0!==o&&this.element.appendChild(o),this.updateLocation()}},{key:"show",value:function(){this.showIfCorrectMode()}},{key:"showIfCorrectMode",value:function(){void 0===this.videoModes||this.videoModes.includes(v.S.getVideoMode())?this.element.style.display="block":this.hide()}},{key:"hide",value:function(){this.element.style.display="none"}}],[{key:"create",value:function(e,t,n,i){if(!0===n.skipStorageCheck||void 0===t||!(0,l.IU)()||"true"!==localStorage.getItem(t))return new d(e,t,n,i)}}]),d}(u.w);function w(e){var t;t=void 0===e.hasHTML?e:{content:e.content,hasHTML:"true"===e.hasHTML,width:parseInt(e.width),divotPosition:parseInt(e.divotPosition),divotLeftOrTop:e.divotLeftOrTop,borderWidth:void 0!==e.borderWidth?parseInt(e.borderWidth):void 0};var n=document.createElement("div");(0,g.vP)(n,"tooltip"),t.hasHTML?n.innerHTML=t.content:n.textContent=t.content,void 0!==t.width&&(n.style.width="".concat(t.width,"px")),n.style.borderWidth="1px",n.style.position="absolute",n.style.borderStyle="solid",n.style.borderRadius="4px",n.style.fontSize="14px",n.style.padding="8px",n.style.display="none",n.style.zIndex="5";var i=C(t.divotPosition,t.divotLeftOrTop,t.borderWidth);return void 0!==i&&n.appendChild(i),n}function C(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,o="";switch(e){case 0:n=d.fR,o="divotTop";break;case 1:n=d.G3,o="divotBottom";break;case 2:n=d.vV,o="divotLeft";break;case 3:n=d.sz,o="divotRight";break;default:n=void 0}if(void 0!==n){var r=n("","",t,i);return(0,g.vP)(r,o),(0,g.vP)(r,"divot"),r}}b.dismissed=new f.xB("key")},14:function(e,t,n){"use strict";n.d(t,{i:function(){return l}});var i=n(1976),o=n(2951),r=n(7591),s=n(9492),a=n(7597);var l=function(e){(0,r.Z)(c,e);var t,n,l=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function c(e){var t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(0,o.Z)(this,c),(t=l.call(this,{},e,n)).toggleElement=e,t.alignRight=n,t}return(0,i.Z)(c)}(n(761).M)},761:function(e,t,n){"use strict";n.d(t,{M:function(){return m},P:function(){return v}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(9),u=n(8263),d=n(7191),h=n(8978),f=n(9760);function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,a.Z)(this,n)}}var m=function(e){(0,s.Z)(n,e);var t=p(n);function n(e,o){var r,s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,i.Z)(this,n),(r=t.call(this,e,o,!1)).toggleElement=o,r.alignRight=s,r.topMargin=4,r.toggleStylesToKeep=["color","background-color","text-decoration"],r.initAddChildren(),r.resizeDebounceListener=f.nR.listen((function(){r.isShown()&&r.reposition()})),document.body.appendChild(r.element),r.hideElement(),r}return(0,o.Z)(n,[{key:"initAddChildren",value:function(){this.connectedOverlay=new v,this.addChild(this.connectedOverlay)}},{key:"showElement",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"block",t=arguments.length>1?arguments[1]:void 0;return!!(0,r.Z)((0,l.Z)(n.prototype),"showElement",this).call(this,e,t)&&(this.toggleElement.classList.add("active"),this.reposition(),!0)}},{key:"hideElement",value:function(e){return!!(0,r.Z)((0,l.Z)(n.prototype),"hideElement",this).call(this,e)&&(this.toggleElement.classList.remove("active"),!0)}},{key:"reposition",value:function(){var e=(0,u.r7)(this.toggleElement),t=this.alignRight||e.left+this.element.offsetWidth>document.documentElement.clientWidth&&e.right-this.element.offsetWidth>0;this.setDropDownStyleFromToggle(t);var n=(0,u.gV)(getComputedStyle(this.element).borderBottomWidth)-(0,u.gV)(getComputedStyle(this.toggleElement).borderLeftWidth);this.setDropDownPosition(e,n,t),this.connectedOverlay.positionAndStyle(this.toggleElement,this,n,t),this.element.style.zIndex=getComputedStyle(this.connectedOverlay.element).zIndex}},{key:"dispose",value:function(){(0,r.Z)((0,l.Z)(n.prototype),"dispose",this).call(this),this.element.remove(),this.resizeDebounceListener.removeListener()}},{key:"setBorderRadius",value:function(e,t){""!==t&&(this.element.style.borderRadius="".concat(e?"".concat(t," 0"):"0 ".concat(t)," ").concat(t," ").concat(t))}},{key:"setDropDownStyleFromToggle",value:function(e){this.element.style.position="absolute",this.element.style.backgroundColor=(0,u.dF)(this.toggleElement),"0px"!==this.getToggleStyle(e?"borderRightWidth":"borderLeftWidth")&&(this.element.style.borderWidth=this.getToggleStyle(e?"borderRightWidth":"borderLeftWidth"),this.element.style.borderStyle=this.getToggleStyle(e?"borderRightStyle":"borderLeftStyle"),this.element.style.borderColor=this.getToggleStyle(e?"borderRightColor":"borderLeftColor"));var t=this.getToggleStyle(e?"borderTopRightRadius":"borderTopLeftRadius");this.setBorderRadius(e,t)}},{key:"setDropDownPosition",value:function(e,t,n){if(this.element.style.top="".concat(e.bottom+this.topMargin,"px"),n){this.element.style.left="";var i=document.documentElement.clientWidth-e.right-t;this.element.style.right="".concat(i,"px"),this.element.style.right="".concat(i-y(this.toggleElement,this.element)-t,"px")}else{this.element.style.right="";var o=e.left-t;this.element.style.left="".concat(o,"px"),this.element.style.left="".concat(o+g(this.toggleElement,this.element)-t,"px")}}},{key:"getToggleStyle",value:function(e){var t=getComputedStyle(this.toggleElement);return(0,h.gB)(this.toggleElement.style[e],t[e])}}]),n}(d.Ku),v=function(e){(0,s.Z)(n,e);var t=p(n);function n(){var e;return(0,i.Z)(this,n),e=t.call(this),(0,u.Zs)(e.element,{position:"absolute",zIndex:4}),e}return(0,o.Z)(n,[{key:"positionAndStyle",value:function(e,t,n,i){var o=getComputedStyle(t.element);this.element.style.borderLeftWidth=o.borderLeftWidth,this.element.style.borderLeftStyle=o.borderLeftStyle,this.element.style.borderLeftColor=o.borderLeftColor,this.element.style.borderRightWidth=o.borderLeftWidth,this.element.style.borderRightStyle=o.borderLeftStyle,this.element.style.borderRightColor=o.borderLeftColor;var r=(0,u.gV)(getComputedStyle(e).width)+2*n;this.element.style.width="".concat(r,"px");var s=t.element.offsetTop-(0,u.r7)(e).bottom+1;this.element.style.height="".concat(s+2,"px"),this.element.style.top="-".concat(s+2,"px"),this.element.style.backgroundColor=o.backgroundColor;var a=(0,h.gB)(o.borderWidth,o.borderLeftWidth);this.element.style.right=i?"-".concat(a):"",this.element.style.left=i?"":"-".concat(a),this.element.style.zIndex=(0,h.gB)(o.zIndex,this.element.style.zIndex),this.element.style.width="".concat(i?r-g(e,this.element)+n:r+y(e,this.element)+n,"px")}}]),n}(c.w);function g(e,t){return e.getBoundingClientRect().left-t.getBoundingClientRect().left}function y(e,t){return e.getBoundingClientRect().right-t.getBoundingClientRect().right}},6640:function(e,t,n){"use strict";n.d(t,{i:function(){return c}});var i=n(1976),o=n(2951),r=n(7591),s=n(9492),a=n(7597),l=n(9);var c=function(e){(0,r.Z)(u,e);var t,n,c=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function u(e){var t;return(0,o.Z)(this,u),(t=c.call(this,"div")).element.style.height="",t.element.style.width="",t.element.style.position="relative",void 0!==e&&(e instanceof l.w?t.addChild(e):t.element.appendChild(e)),t}return(0,i.Z)(u)}(l.w)},8107:function(e,t,n){"use strict";n.d(t,{K:function(){return o},x:function(){return r}});var i=n(8069),o=new(n(1794).xB)("cssVhVarUpdate",{reportIfNoListeners:!1});function r(){var e;s();var t=new i.d(s,{bounceLimitMS:100,debounceType:1});null===(e=window.visualViewport)||void 0===e||e.addEventListener("resize",(function(){return t.callFunc()})),window.setInterval((function(){return t.callFunc()}),500)}function s(){var e,t,n=document.documentElement.style.getPropertyValue("--vh"),i=null!==(e=null===(t=window.visualViewport)||void 0===t?void 0:t.height)&&void 0!==e?e:window.innerHeight,r="".concat(.01*i,"px");r!==n&&(document.documentElement.style.setProperty("--vh",r),o.fire())}},9076:function(e,t,n){"use strict";n.d(t,{WX:function(){return r},p0:function(){return s},r5:function(){return a}});var i=n(3753),o=n(9165);function r(e,t){return t===o.Y0.All||""===e?(0,i.BN)("/tag/".concat(e,"/")):(0,i.BN)("/tag/".concat(e,"/").concat(o.aI.get(t),"/"))}function s(e){var t="/tags/".concat(e!==o.Y0.All?"".concat(o.aI.get(e),"/"):"");return(0,i.BN)(t)}function a(e){var t=(0,o.eN)(e),n=""===t?"/":"/".concat(t,"/");return(0,i.BN)(n)}},8263:function(e,t,n){"use strict";n.d(t,{PZ:function(){return S},WG:function(){return C},Zs:function(){return u},at:function(){return l},dF:function(){return h},eE:function(){return c},gV:function(){return p},hI:function(){return x},i6:function(){return k},mY:function(){return w},nH:function(){return v},np:function(){return g},pY:function(){return d},r7:function(){return f},sj:function(){return m}});var i,o=n(7693),r=n(9),s=n(1794),a=n(8978);function l(e,t){var n=e.getBoundingClientRect(),i=t.getBoundingClientRect();return!(n.righti.right||n.bottomi.bottom)}function c(e){var t=Array.from(document.querySelectorAll("*[style*=z-index]:not(.floatingPlayer)")),n=0;return t.forEach((function(t){if(t instanceof HTMLElement&&!e.contains(t)&&l(e,t))try{n=Math.max(n,parseInt((0,a.gB)(t.style.zIndex,"0")))}catch(e){}})),n}function u(e,t){var n;n=e instanceof r.w?e.element:e;var i=t;t instanceof Function&&(i=t(e));for(var o=0,s=Object.keys(i);o1&&void 0!==arguments[1]&&arguments[1],n=new s.xB("hover"),i=e instanceof r.w?e.element:e;return(0,o.j9)("mouseenter",i,(function(){n.fire(!0)})),(0,o.j9)("mouseleave",i,(function(){n.fire(!1)})),t&&((0,o.j9)("click",i,(function(){n.fire(!0)})),(0,o.j9)("touchstart",document,(function(){n.fire(!1)})),(0,o.j9)("touchmove",document,(function(){n.fire(!1)})),(0,o.j9)("touchend",document,(function(){n.fire(!1)}))),n}function g(){if(void 0!==i)return i;var e=document.createElement("div");e.style.visibility="hidden",e.style.width="100px",e.style.msOverflowStyle="scrollbar",document.body.appendChild(e);var t=e.offsetWidth;e.style.overflow="scroll";var n=document.createElement("div");n.style.width="100%",e.appendChild(n);var o=n.offsetWidth;return document.body.removeChild(e),i=t-o}var y,b=document.createElement("canvas");function w(e,t){var n=b.getContext("2d");return null!==n?(n.font=getComputedStyle(t).font,n.measureText(e).width):0}function C(e,t){var n=b.getContext("2d");return null!==n?(n.font=t,n.measureText(e).width):0}function x(e,t){return function(n){var i;"Tab"===n.key&&(n.preventDefault(),void 0!==(i=n.shiftKey?t instanceof HTMLElement?t:t():e instanceof HTMLElement?e:e())&&(i.focus(),n.stopPropagation()))}}function k(){void 0===y&&(u(y=document.createElement("div"),{position:"fixed",top:"0px",left:"0px"}),document.body.appendChild(y));var e=y.getBoundingClientRect();return{top:e.top,left:e.left}}function S(e){var t=e.getBoundingClientRect();return"none"!==e.style.display&&t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}},7693:function(e,t,n){"use strict";n.d(t,{ER:function(){return f},SC:function(){return d},Zf:function(){return u},j9:function(){return c},w$:function(){return h}});var i=n(8759);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n3&&void 0!==arguments[3]&&arguments[3],d=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(t===window)o=s[e]=l(s[e])+1;else if(t===document)o=a[e]=l(a[e])+1;else if(t instanceof HTMLElement){var h="data-listener-count-".concat(e);o=l(t.getAttribute(h))+1,t.setAttribute(h,"".concat(o))}else o=1,debug("EventListener attached to non-HTMLElement object (possibly frame document): ".concat(t));if(o>r&&(c=t===document?"document":t===window?"window":"".concat(t.outerHTML.split(">")[0],">"),warn("Too many event listeners on element",{event:e,element:c,listeners:o,maxListeners:r})),void 0!==window.addEventListener){var f=(0,i.CG)()?{capture:u,passive:d}:u;t.addEventListener(e,n,f)}else void 0!==window.attachEvent?t.attachEvent("on".concat(e),n):error("Could not resolve addEventListenerPoly( ".concat(e," ) to ").concat(t))}function u(e,t,n){var i,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return o(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)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw s}}}}(e);try{for(a.s();!(i=a.n()).done;)c(i.value,t,n,r,s)}catch(e){a.e(e)}finally{a.f()}}function d(e,t,n){var o,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(t===window)o=s[e]=l(s[e])-1;else if(t===document)o=a[e]=l(a[e])-1;else if(t instanceof HTMLElement){var u="data-listener-count-".concat(e);o=l(t.getAttribute(u))-1,t.setAttribute(u,"".concat(o))}else o=1,debug("EventListener removed from non-HTMLElement object (possibly frame document): ".concat(t));if(o<0&&warn('event listener "'.concat(e,'" removed without being added'),{listeners:o}),void 0!==window.removeEventListener){var d=(0,i.CG)()?{capture:r,passive:c}:r;t.removeEventListener(e,n,d)}else void 0!==window.detachEvent?t.detachEvent("on".concat(e),n):error("Could not resolve removeEventListenerPoly( ".concat(e," ) from ").concat(t))}function h(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];c(e,t,(function r(s){n(s),d(e,t,r,i,o)}),i,o)}function f(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];h(e,t,(function(){c(e,t,n,i,o)}),i,o)}},1522:function(e,t,n){"use strict";n.d(t,{Bp:function(){return b},Cj:function(){return g},F1:function(){return C},oB:function(){return y}});var i=n(3243),o=n(7591),r=n(9492),s=n(7597),a=n(2951),l=n(1976),c=n(1185),u=n(7693),d=n(8263),h=n(1625),f=n(534);var p={backgroundColor:"#F47321",color:"#FFFFFF",border:"1px solid #CD5D26"},m=function(){function e(){var t=this;(0,a.Z)(this,e),this.message=document.createElement("div"),this.container=document.createElement("div"),this.dialog=document.createElement("div"),this.title=document.createElement("div"),this.decline=document.createElement("div"),this.accept=document.createElement("div"),this.teardown=function(){},this.queue=[],this.rotateDismissTeardownHandler=function(){(0,u.SC)("orientationchange",window,t.rotateDismissTeardownHandler),t.teardown()},(0,c.vP)(this.container,"modalAlert"),this.container.style.display="none",this.container.style.position="fixed",this.container.style.overflow="auto",this.container.style.top="0",this.container.style.left="0",this.container.style.width="100%",this.container.style.height="100%",this.container.style.zIndex="2000",(0,c.vP)(this.dialog,"dialog"),this.dialog.style.width="440px",this.dialog.style.minWidth="240px",this.dialog.style.position="relative",this.dialog.style.display="inline-block",this.dialog.style.borderRadius="10px",this.dialog.style.textAlign="left",this.dialog.style.overflow="hidden",this.dialog.style.zIndex="2001",this.dialog.style.fontFamily="UbuntuRegular, Helvetica, Arial, sans-serif",this.title.style.display="block",this.title.style.fontSize="20px",this.title.style.paddingTop="20px",this.title.style.paddingLeft="20px",this.title.style.paddingRight="20px",this.title.style.whiteSpace="nowrap",this.title.style.fontWeight="bold",this.title.style.overflow="hidden",this.title.style.textOverflow="ellipsis",this.dialog.appendChild(this.title),this.message.style.display="inline-block",this.message.style.wordWrap="break-word",this.message.style.padding="20px",this.message.style.textAlign="left",this.dialog.appendChild(this.message);var n=document.createElement("div");(0,c.vP)(n,"dialogForm"),n.style.borderTopWidth="1px",n.style.borderTopStyle="solid",n.style.textAlign="center",n.style.height="40px",(0,c.vP)(this.accept,"accept"),this.accept.style.minWidth="70px",this.accept.style.padding="3px",this.accept.style.display="inline-block",this.accept.style.cssFloat="right",this.accept.style.position="relative",this.accept.style.top="7px",this.accept.style.right="10px",this.accept.style.boxSizing="border-box",this.accept.innerText="OK",this.accept.style.cursor="pointer",this.accept.style.borderWidth="1px",this.accept.style.borderStyle="solid",this.accept.onclick=function(e){e.stopPropagation(),void 0!==t.yesCallback&&t.yesCallback(),v.teardown()},n.appendChild(this.accept),(0,c.vP)(this.decline,"decline"),this.decline.style.minWidth="70px",this.decline.style.padding="3px",this.decline.style.display="inline-block",this.decline.style.cssFloat="right",this.decline.style.position="relative",this.decline.style.top="7px",this.decline.style.right="25px",this.decline.innerText="Cancel",this.decline.style.cursor="pointer",this.decline.onclick=function(e){e.stopPropagation(),void 0!==t.noCallback?t.noCallback():void 0!==t.yesCallback&&t.yesCallback(),v.teardown()},n.appendChild(this.decline),this.dialog.appendChild(n),this.container.appendChild(this.dialog)}return(0,l.Z)(e,[{key:"resize",value:function(){this.dialog.style.width="".concat(Math.min(440,document.documentElement.clientWidth-40),"px"),this.dialog.style.left="".concat(Math.max(0,(this.container.offsetWidth-this.dialog.offsetWidth)/2),"px"),this.dialog.style.top="".concat(Math.max(0,(this.container.offsetHeight-80-this.dialog.offsetHeight)/2),"px")}},{key:"display",value:function(e,t,n,i){var o=this;if(this.active)this.queue.push({msg:e,yesCallback:t,noCallback:n,config:i});else{this.message.innerText=e,this.handleConfig(i),this.container.style.display="block",this.yesCallback=t,void 0===n?v.decline.style.display="none":(this.noCallback=n,v.decline.style.display="");var r=new f.a,s=function(e){e.stopPropagation(),e.preventDefault(),r.execute(e)};r.addHandler({keyCode:13,requiresCtrlOrMeta:!1,handle:function(e){t(),o.teardown()}}),r.addHandler({keyCode:27,requiresCtrlOrMeta:!1,handle:function(e){void 0!==n?n():t(),o.teardown()}}),this.active=!0;var a=function(){o.resize()};(0,u.j9)("keydown",document,s,!0),(0,u.j9)("resize",window,a),(0,u.j9)("orientationchange",window,a),this.teardown=function(){try{(0,u.SC)("keydown",document,s,!0)}catch(e){debug("ModalAlert keydown listener was already removed")}try{(0,u.SC)("resize",window,a)}catch(e){debug("ModalAlert resize listener was already removed")}o.container.style.display="none",o.active=!1,o.container.parentElement===document.body&&document.body.removeChild(o.container),o.yesCallback=void 0,o.noCallback=void 0;var e=o.queue.shift();void 0!==e&&o.display(e.msg,e.yesCallback,e.noCallback)};var l=(0,h.Gd)();void 0!==l&&Boolean(l)?l.appendChild(this.container):document.body.appendChild(this.container),this.resize()}}},{key:"handleConfig",value:function(e){void 0!==(null==e?void 0:e.title)?(this.title.style.display="block",this.title.innerText=e.title):this.title.style.display="none",!1===(null==e?void 0:e.allowDecline)&&(0,d.Zs)(this.decline,{display:"none"}),void 0!==(null==e?void 0:e.acceptText)?this.accept.innerText=e.acceptText:this.accept.innerText="OK",void 0!==(null==e?void 0:e.declineText)?this.decline.innerText=e.declineText:this.decline.innerText="Cancel"}}]),e}(),v=new m;function g(e,t,n){void 0===t&&(t=function(){}),v.display(e,t,void 0,n)}function y(e,t,n,i){var o,r;t=null!==(o=t)&&void 0!==o?o:function(){},n=null!==(r=n)&&void 0!==r?r:function(){},v.display(e,t,n,i)}function b(e,t,n){v.display(e,(function(){void 0!==t&&t(),(0,u.SC)("orientationchange",window,v.rotateDismissTeardownHandler)}),void 0,n),(0,u.j9)("orientationchange",window,v.rotateDismissTeardownHandler)}var w=new(function(e){(0,o.Z)(u,e);var t,n,c=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,s.Z)(t);if(n){var o=(0,s.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,a.Z)(this,u),c.call(this)}return(0,l.Z)(u,[{key:"displayForm",value:function(e,t,n,o,r){var a,l=this;this.cancelActiveForm(),o=null!==(a=o)&&void 0!==a?a:"",(0,i.Z)((0,s.Z)(u.prototype),"display",this).call(this,o,t,n,r);var c=document.createElement("div");(0,d.Zs)(c,{minHeight:void 0!==r&&!0===r.separator?"15px":"0px"}),this.message.appendChild(c),this.form=e,this.message.appendChild(this.form),void 0===(null==r?void 0:r.acceptText)&&(this.accept.innerText="Apply"),!0===(null==r?void 0:r.orange)&&(0,d.Zs)(this.accept,p),this.accept.onclick=function(e){e.stopPropagation(),void 0!==l.yesCallback&&l.yesCallback(l.form),w.teardown()},this.decline.onclick=function(e){e.stopPropagation(),void 0!==l.noCallback&&l.noCallback(),w.teardown()}}},{key:"cancelActiveForm",value:function(){this.active&&(void 0!==this.noCallback&&this.noCallback(),w.teardown())}}]),u}(m));function C(e,t,n,i,o){var r;n=null!==(r=n)&&void 0!==r?r:function(){},w.displayForm(e,t,n,i,o)}},3753:function(e,t,n){"use strict";n.d(t,{BN:function(){return d},GM:function(){return h},I5:function(){return y},Ue:function(){return v},Z2:function(){return w},nw:function(){return f},q0:function(){return g},tt:function(){return b}});var i=n(1976),o=n(2951),r=n(7591),s=n(9492),a=n(7597),l=n(434),c=n(2800),u=n(6767);function d(e){if([".","?","#"].some((function(t){return e.startsWith(t)})))return e;var t="";return null===e.match(/^[a-zA-Z]+:\/\//)&&(t=e.startsWith("/")?"":"/"),"".concat(t).concat(e)}var h=function(e){(0,r.Z)(c,e);var t,n,l=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function c(e){var t;return(0,o.Z)(this,c),t=l.call(this,function(e){switch(e.readyState){case 0:return"request not sent";case 4:switch(e.status){case 0:return"network error";case 400:return"bad request";case 401:return"unauthorized";case 403:return"access denied";case 404:return"not found";case 429:return"request throttled";case 500:return"server error";default:return"unknown status ".concat(e.status)}default:return"unknown ready state ".concat(e.readyState)}}(e)),t.xhr=e,t.toString=function(){return"XhrError: ".concat(t.message)},t.xhrErrorAttributes={status:e.status,reason:e.statusText,readyState:e.readyState},t}return(0,i.Z)(c)}((0,l.Z)(Error));function f(e){return e>=200&&e<=299||1223===e}function p(e,t,n){e.withCredentials=!0,e.onerror=function(){n(new h(e))},e.onload=function(){f(e.status)?t(e):n(new h(e))},e.setRequestHeader("X-Requested-With","XMLHttpRequest")}function m(e,t){var n=Object.keys(t).map((function(e){return function(e,t){return"".concat(e,"=").concat(encodeURIComponent(t))}(e,t[e])})).join("&");return d(""===n?e:"".concat(e,"?").concat(n))}function v(e){return g(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e4)[1]}function g(e){return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6e4,i=new XMLHttpRequest;return[i,new Promise((function(o,r){i.open(t,d(e)),p(i,o,r),i.timeout=n,i.send()}))]}(e,"GET",arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e4)}function y(e,t){var n=function(e){if(e instanceof FormData)return e;for(var t=new FormData,n=0,i=Object.keys(e);n1&&void 0!==arguments[1]?arguments[1]:{},n=C();return new Promise((function(i,o){var r=new XMLHttpRequest;if(r.open("PUT",m(e,t),!0),p(r,i,o),void 0===n)return error("CSRF token is undefined"),void o(new h(r));r.setRequestHeader("X-CSRFToken",n),r.send()}))}function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=C();return new Promise((function(i,o){var r=new XMLHttpRequest;if(r.open("DELETE",m(e,t),!0),p(r,i,o),void 0===n)return error("CSRF token is undefined"),void o(new h(r));r.setRequestHeader("X-CSRFToken",n),r.send()}))}function C(e){var t,n=(0,u.sv)("csrftoken");return void 0!==n?n:void 0!==c.J.current.csrftoken?c.J.current.csrftoken:(void 0!==e&&e.has("csrfmiddlewaretoken")&&(t=e.get("csrfmiddlewaretoken")),t)}},2425:function(e,t,n){"use strict";n.d(t,{C5:function(){return _},Dh:function(){return Z},dD:function(){return L},Uh:function(){return O},vA:function(){return U}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(8759),c=n(2018),u=n(2800),d=n(7693),h=n(3753),f=n(391),p=n(4793),m=n(9),v=n(8263),g=n(1794),y=n(1282);function b(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return w(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)?w(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0){var i,o=this.getAppIndex(null===(i=this.currentApp)||void 0===i?void 0:i.id);-1===o&&(o=0),this.currentApp=this.panelList[o],void 0===n.error?this.appPanel=new F(e,t).element:(this.hasContent=!1,this.appPanel=(new F).element)}else this.currentApp=void 0,this.hasContent=!1,this.appPanel=(new F).element;this.appPanelWrapper.appendChild(this.appPanel),this.panelUpdated.fire(void 0)}},{key:"extendPanel",value:function(){this.appPanel.style.position="absolute",this.appPanel.style.zIndex="1000",this.appPanel.style.height="".concat(337,"px")}},{key:"shrinkPanel",value:function(){this.appPanel.style.position="static",this.appPanel.style.zIndex="auto",this.appPanel.style.height="".concat(L,"px")}},{key:"setupListeners",value:function(){var e=this;(0,v.nH)(this.appPanelWrapper,!0).listen((function(t){t&&void 0!==e.currentApp?e.extendPanel():e.shrinkPanel()})),(0,l.Tt)()&&window.setInterval((function(){e.element.contains(document.activeElement)&&void 0!==e.currentApp?e.extendPanel():e.shrinkPanel()}),300)}},{key:"previous",value:function(){var e,t=this.getAppIndex(null===(e=this.currentApp)||void 0===e?void 0:e.id);t<1||(this.currentApp=this.panelList[t-1],this.refreshPanel(this.currentApp.id,this.currentApp.panelType))}},{key:"next",value:function(){var e,t=this.getAppIndex(null===(e=this.currentApp)||void 0===e?void 0:e.id);t!==this.panelList.length-1&&(this.currentApp=this.panelList[t+1],this.refreshPanel(this.currentApp.id,this.currentApp.panelType))}},{key:"refreshPanel",value:function(e,t){var n=this;(0,c.Sd)(this.roomUid,this.bcpFallback,e,t).then((function(t){var i,o=(0,c.Bk)(t);n.panelList=o.appList,void 0===o.error||(null===(i=n.currentApp)||void 0===i?void 0:i.id)!==e?n.reset(t,!1):n.getInitialPanel(!1)})).catch((function(){}))}},{key:"removeDOMChildren",value:function(e){for(;null!==e.firstChild;)e.removeChild(e.firstChild)}},{key:"clearAppPanel",value:function(){this.removeDOMChildren(this.appPanelWrapper)}},{key:"clear",value:function(){this.clearAppPanel()}}]),n}(m.w),F=function(e){(0,r.Z)(n,e);var t=B(n);function n(e){var o,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(0,i.Z)(this,n),(o=t.call(this)).previewTime=5e3,o.element.style.position="relative",o.element.style.display="inline-block",o.element.style.width="".concat(O,"px"),o.element.style.overflow="hidden",o.element.style.textShadow="none",o.element.style.fontSize="11px",o.element.style.lineHeight="1.7em",o.update(e,r),o}return(0,o.Z)(n,[{key:"update",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.cleanupPanel(),void 0===e)return this.panel=(0,M.x)(),void this.element.appendChild(this.panel);var n=(0,c.Bk)(e);void 0!==n.url?(this.element.style.width="320px",this.prepareIframePanel(n.url,t)):this.panel=this.createHTMLPanel(n.template,e),this.element.appendChild(this.panel)}},{key:"prepareIframePanel",value:function(e,t){var n=this;u.J.current.isBroadcast&&t?(this.preview=document.createElement("div"),this.preview.style.width="320px",this.preview.style.height="69px",this.preview.style.textAlign="center",this.preview.style.lineHeight="5em",this.preview.style.fontSize="14px",this.preview.style.fontWeight="bold",this.preview.style.boxShadow="inset 0 0 100px 10px rgba(0, 0, 0, 0.32)",this.preview.innerText=A.ag.loadingPreview,this.element.appendChild(this.preview),this.panel=this.createIframePanel(""),this.panel.style.display="none",this.previewTimer=window.setTimeout((function(){n.element.removeChild(n.preview),n.panel.src=e,n.panel.style.display="block"}),this.previewTime)):this.panel=this.createIframePanel(e)}},{key:"createHTMLPanel",value:function(e,t){switch(e){case"image_template":return C(t);case"3_rows_11_21_31":case"3_rows_11_22_32":case"3_rows_12_21_31":case"3_rows_12_22_31":case"3_rows_of_labels":return(0,M.x)(t);default:return warn("template of type (".concat(e,"): is not supported")),(0,M.x)()}}},{key:"createIframePanel",value:function(e){var t=this,n=document.createElement("iframe");return n.id="appPanelFrame",n.src=e,n.style.border="none",n.style.padding="0",n.style.background="#FFFFFF",n.style.width="100%",n.style.height="100%",(0,v.nH)(n).listen((function(e){t.element.style.filter=e?"drop-shadow(0px 0px 16px rgba(0, 0, 0, 0.3))":""})),(0,l.Tt)()&&window.setInterval((function(){t.element.contains(document.activeElement)?t.element.style.filter="drop-shadow(0px 0px 16px rgba(0, 0, 0, 0.3))":t.element.style.filter=""}),300),n}},{key:"cleanupPanel",value:function(){clearTimeout(this.previewTimer),this.removeAllDOMChildren()}}]),n}(m.w),_=function(e){(0,r.Z)(n,e);var t=B(n);function n(){var e;return(0,i.Z)(this,n),(e=t.call(this)).panelUpdated=new g.xB("panelUpdated"),e.hasContent=!1,e.element.style.display="inline-block",e.element.style.paddingLeft="5px",e.element.style.paddingTop="3px",e.element.style.paddingRight="5px",e.element.style.paddingBottom="3px",e.element.style.position="",e.element.style.width="".concat(O,"px"),e.element.style.height="".concat(L,"px"),e.element.style.textShadow="none",e.element.style.fontSize="11px",e.element.style.lineHeight="1.7em",e.element.style.overflow="hidden",p.kN.listen((function(t){e.updateAppPanel(t.chatConnection.room()),t.chatConnection.event.refreshPanel.listen((function(){e.updateAppPanel(t.chatConnection.room())})),t.chatConnection.event.clearApp.listen((function(){e.updateAppPanel(t.chatConnection.room())}))})),e.appPanelTable=(0,M.x)(),e.element.appendChild(e.appPanelTable),e}return(0,o.Z)(n,[{key:"updateAppPanel",value:function(e){var t=this;(0,h.Ue)("api/panel_context/".concat(e,"/")).then((function(e){t.cleanupPanel();var n=new f.j(e.responseText);if("no-content"===n.getString("code",!1))return t.hasContent=!1,t.appPanelTable=(0,M.x)(),t.element.appendChild(t.appPanelTable),void t.panelUpdated.fire(void 0);t.hasContent=!0;var i=n.getString("template",!1);switch(i){case"image_template":t.appPanelTable=C(n);break;case"3_rows_11_21_31":case"3_rows_11_22_32":case"3_rows_12_21_31":case"3_rows_12_22_31":case"3_rows_of_labels":t.appPanelTable=(0,M.x)(n);break;default:t.hasContent=!1,t.appPanelTable=(0,M.x)(),warn("template of type (".concat(i,"): is not supported"))}n.logUnusedDebugging("updateAppPanel"),t.element.appendChild(t.appPanelTable),t.panelUpdated.fire(void 0)})).catch((function(e){error("Error fetching app panel",e)}))}},{key:"cleanupPanel",value:function(){this.element.children.length>0&&this.element.removeChild(this.appPanelTable)}}]),n}(m.w)},6297:function(e,t,n){"use strict";n.d(t,{V:function(){return a},h:function(){return l}});var i=n(2951),o=n(1976),r=n(2425),s=n(4793),a=2e3,l=function(){function e(t){var n=this;(0,i.Z)(this,e),this.config=t,this.appPanel=new r.C5,this.appPanel.element.style.width="".concat(r.Uh,"px"),this.appPanel.element.style.position="relative",this.hasContent=!1,this.canUpdatePanel=!1,s.kN.listen((function(e){n.hasContent=!1,n.canUpdatePanel=!1,n.appPanelLastId=void 0,n.lastClone=void 0,window.setTimeout((function(){n.canUpdatePanel=!0,n.hasContent&&n.updatePanel()}),a)})),this.appPanel.panelUpdated.listen((function(){n.hasContent=!0,n.canUpdatePanel&&n.updatePanel()}))}return(0,o.Z)(e,[{key:"updatePanel",value:function(){var e=this;if(this.appPanel.hasContent){if(void 0!==this.lastClone){for(var t=0;tthis.config.getMessagesOffsetHeight()-30)&&this.config.messagesSinceId(this.appPanelLastId)>20&&(this.config.removeMessageDiv(this.appPanel.element),this.config.appendMessageDiv(this.appPanel.element,(function(){return e.pureChatCloner()})),this.appPanelLastId=this.config.getLastMessageId())}}},{key:"cloneAppPanel",value:function(){var e=this.appPanel.element.cloneNode(!0);return e.style.width="".concat(r.Uh,"px"),e}},{key:"pureChatCloner",value:function(){return void 0!==this.lastClone&&null!==this.lastClone.parentNode&&this.lastClone.parentNode.removeChild(this.lastClone),this.lastClone=document.createElement("div"),this.lastClone.appendChild(this.cloneAppPanel()),this.lastClone}}]),e}()},391:function(e,t,n){"use strict";n.d(t,{j:function(){return u}});var i=n(4649),o=n(3940),r=n(2951),s=n(1976);function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return l(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)?l(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==arguments[1])||arguments[1],n=this.getAny(e);if("string"==typeof n)return n;t&&void 0!==n&&warn("getStringOrUndefined(".concat(e,"): ").concat(n," is wrong type"),{message:this.stringMessage})}},{key:"getString",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getAny(e);return"string"!=typeof n?(t&&warn("getString(".concat(e,"): ").concat(n," is wrong type"),{message:this.stringMessage}),""):n}},{key:"getStringWithNumbers",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getAny(e);return"string"!=typeof n&&"number"!=typeof n?(t&&warn("getStringWithNumbers(".concat(e,"): ").concat(n," is wrong type"),{message:this.stringMessage}),""):"".concat(n)}},{key:"getStringWithNumbersOrBoolean",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getAny(e);return"string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n?(t&&warn("getStringWithNumbersOrBoolean(".concat(e,"): ").concat(n," is wrong type"),{message:this.stringMessage}),""):"boolean"==typeof n?n:"".concat(n)}},{key:"getStrings",value:function(e){var t,n=new Map,i=a(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;void 0!==this.getStringOrUndefined(o,!1)&&n.set(o,this.getStringOrUndefined(o,!1))}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"getBoolean",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=this.getAny(e);return"boolean"!=typeof i?(n&&warn("getBoolean(".concat(e,"): ").concat(i," is wrong type"),{message:this.stringMessage}),t):i}},{key:"getBooleanOrUndefined",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getAny(e);if("boolean"==typeof n)return n;t&&void 0!==n&&warn("getBoolean(".concat(e,"): ").concat(n," is wrong type"),{message:this.stringMessage})}},{key:"getNumber",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getAny(e);return"number"!=typeof n?(t&&warn("getNumber(".concat(e,"): ").concat(n," is wrong type"),{message:this.stringMessage}),NaN):n}},{key:"getNumberOrUndefined",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getAny(e);if("number"==typeof n)return n;t&&void 0!==n&&warn("getNumberOrUndefined(".concat(e,"): ").concat(n," is wrong type"),{message:this.stringMessage})}},{key:"getParsedSubMap",value:function(t){return new e(this.getObject(t))}},{key:"getParsedSubMapOrUndefined",value:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.getObjectOrUndefined(t,n);if(void 0!==i)return new e(i)}},{key:"getMap",value:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.getObjectString(t,n);return new e(""===i?"{}":i)}},{key:"getObjectString",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getAny(e);return"object"!==(0,o.Z)(n)?(t&&warn("getObjectString(".concat(e,"): ").concat(n," is wrong type"),{message:this.stringMessage}),""):JSON.stringify(n)}},{key:"getObjectStringOrUndefined",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getAny(e);if("object"===(0,o.Z)(n))return JSON.stringify(n);t&&void 0!==n&&warn("getObjectStringOrUndefined(".concat(e,"): ").concat(n," is wrong type"),{message:this.stringMessage})}},{key:"getObject",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getAny(e);return"object"!==(0,o.Z)(n)?(t&&warn("getObject(".concat(e,"): ").concat(n," is wrong type"),{message:this.stringMessage}),{}):n}},{key:"getObjectOrUndefined",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getAny(e);if("object"===(0,o.Z)(n))return n;t&&void 0!==n&&warn("getObjectOrUndefined(".concat(e,"): ").concat(n," is wrong type"),{message:this.stringMessage})}},{key:"logUnusedDebugging",value:function(e){var t,n=a(this.unusedFields());try{for(n.s();!(t=n.n()).done;){var i=t.value,r="object"===(0,o.Z)(this.parsed[i])?JSON.stringify(this.parsed[i]):this.parsed[i];debug("Unhandled message argument: . Key:".concat(i," Value:").concat(r," in ").concat(e))}}catch(e){n.e(e)}finally{n.f()}}}],[{key:"fromParsedJson",value:function(t){return warn("ArgJSONMap.fromParsedJson is deprecated. Use `new ArgJSONMap(parsed)` instead."),new e(t)}}]),e}()},8138:function(e,t,n){"use strict";n.d(t,{n:function(){return l}});var i=n(2951),o=n(1976),r=n(8759),s=n(7693),a=n(2750),l=function(){function e(){var t=this;(0,i.Z)(this,e),this.soundMap=new Map,this.supported=!0,this.supported=(0,r.B3)()&&((0,r.BR)()||(0,r.Ii)()),this.init(),(0,s.j9)("beforeunload",window,(function(e){t.close()})),a.UG.listen((function(e){if(e&&(0,r.Tt)()){var n=(0,r.jB)();void 0!==n&&n<13?t.init():void 0!==t.context&&t.context.resume()}}))}return(0,o.Z)(e,[{key:"init",value:function(){var e=this;if(this.supported)if((0,r.BR)()){info("Using audio context"),this.close(),this.ensureContextCreated(!1);var t=function t(){e.playEmptySound(),(0,s.SC)("click",document,t),(0,s.SC)("touchstart",document,t),(0,s.SC)("touchend",document,t)};(0,s.j9)("click",document,t),(0,s.j9)("touchstart",document,t),(0,s.j9)("touchend",document,t)}else info("Using audio elements");else warn("Sounds are not supported.")}},{key:"close",value:function(){void 0!==this.context&&("close"in this.context&&this.context.close(),this.context=void 0)}},{key:"loadSound",value:function(e,t){var n=this;if(this.soundMap.set(e,{ready:!1}),void 0!==this.context){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="arraybuffer",i.onload=function(){i.status<200||i.status>=300?error("Error requesting sound",{soundName:e,status:i.status,statusText:i.statusText}):void 0!==n.context?n.context.decodeAudioData(i.response.slice(0),(function(t){debug("Loaded sound ".concat(e)),n.soundMap.set(e,{ready:!0,buffer:t})}),(function(t){error("Error decoding sound",{soundName:e,message:t})})):n.supported&&error("audioHolder loadSound missing context")},i.onerror=function(){error("Error requesting sound",{soundName:e,status:i.status,statusText:i.statusText})},i.send()}else(0,r.Ii)()&&this.soundMap.set(e,{ready:!0,audioElement:new Audio(t)})}},{key:"loadTipSounds",value:function(){this.loadSound("HugeTip","".concat(STATIC_URL,"sounds/classic/huge.mp3")),this.loadSound("LargeTip","".concat(STATIC_URL,"sounds/classic/large.mp3")),this.loadSound("MediumTip","".concat(STATIC_URL,"sounds/classic/medium.mp3")),this.loadSound("SmallTip","".concat(STATIC_URL,"sounds/classic/small.mp3")),this.loadSound("TinyTip","".concat(STATIC_URL,"sounds/classic/tiny.mp3"))}},{key:"loadPrivateShowSounds",value:function(){this.loadSound("PrivateShow","".concat(STATIC_URL,"sounds/show.mp3"))}},{key:"playSound",value:function(e,t){if(this.canPlaySound(e,t)){var n=this.soundMap.get(e);if(void 0!==n)if(n.ready)if(void 0!==n.buffer){if(this.ensureContextCreated(),void 0===this.context)return void(this.supported&&error("audioHolder playSound missing context"));var i=this.context.createBufferSource();i.buffer=n.buffer;var o=this.context.createGain();i.connect(o),o.connect(this.context.destination),o.gain.value=t/3.5/100,debug("play sound ".concat(e," volume ").concat(t/3.5," (video at ").concat(t,") gain ").concat(o.gain.value)),i.start(0)}else if(void 0!==n.audioElement){n.audioElement.volume=t/100;var r=n.audioElement.play();void 0!==r&&r.catch((function(t){error("Error playing sound ".concat(e," (").concat(t,")"))}))}else error("Missing sound buffer or element for ".concat(e));else warn("sound ".concat(e," not ready yet (and may never will be ready)"))}}},{key:"ensureContextCreated",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.supported&&void 0===this.context&&(e&&warn("audioHolder context unexpectedly missing"),"webkitAudioContext"in window?this.context=new webkitAudioContext:this.context=new AudioContext)}},{key:"canPlaySound",value:function(e,t){return this.supported?0===t?(debug("Not playing sound ".concat(e," at volume 0")),!1):t>100||t<0||isNaN(t)?(error("setSoundVolume: invalid volume ".concat(t)),!1):!!this.soundMap.has(e)||(error("Unknown sound: ".concat(e)),!1):(debug("Not playing sound ".concat(e," because sound is not supported")),!1)}},{key:"playEmptySound",value:function(){if(void 0!==this.context){var e=this.context.createBufferSource();e.buffer=this.context.createBuffer(1,1,22050),e.connect(this.context.destination),e.start(0)}}}]),e}()},695:function(e,t,n){"use strict";n.d(t,{Cg:function(){return l},M5:function(){return c},TF:function(){return a}});var i,o=n(2800),r=n(6265),s=n(1522);function a(){var e;return void 0===(null===(e=o.J.current)||void 0===e?void 0:e.loggedInUser)}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Login required",t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;return!!a()&&(void 0!==i&&t?i():(0,s.oB)(e,(function(){(0,r.iW)({fromFeature:o})}),n),!0)}function c(e){i=e}},3423:function(e,t,n){"use strict";n.d(t,{e:function(){return x}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(1185),u=n(2800),d=n(7693),h=n(3753),f=n(4793),p=n(8069),m=n(8263),v=n(1794),g=n(5108),y=n(7108),b=n(758);function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);ne.maxOptionLength&&e.config.inputElement.caretAtEndOfInput()&&e.handleKeyup(t)})),(0,d.j9)("keydown",this.config.inputElement.element,(function(t){e.handleKeydown(t)}))}},{key:"handleKeyup",value:function(e){this.handleInputChange(e)}},{key:"handleKeydown",value:function(e){this.visible&&(38===e.keyCode&&(e.preventDefault(),this.scrollList(!0)),40===e.keyCode&&(e.preventDefault(),this.scrollList(!1)),[9,39,32,13].includes(e.keyCode)&&(e.preventDefault(),e.stopPropagation(),this.hide(),u.J.current.isMobile&&13===e.keyCode||this.config.inputElement.appendText(" ")),27!==e.keyCode&&37!==e.keyCode||(e.preventDefault(),this.hide(),this.deleteHighlightedSuffix()))}},{key:"initData",value:function(){(0,r.Z)((0,l.Z)(x.prototype),"initData",this).call(this),this.list=document.createElement("div"),this.textBeforeItem="",this.visible=!1,this.listenerGroup=new v.mM,this.initDelay()}},{key:"initUI",value:function(){(0,r.Z)((0,l.Z)(x.prototype),"initUI",this).call(this),(0,c.vP)(this.element,"autocompleteModal"),this.element.style.visibility="hidden",this.element.style.width="auto",this.element.style.maxWidth="260px",this.element.style.height="auto",this.element.style.borderWidth="1px",this.element.style.borderStyle="solid",this.element.style.borderBottom="none",this.element.style.fontFamily="Helvetica, Arial, sans-serif",this.element.style.cursor="pointer",this.list.style.width="auto",this.list.style.maxHeight="180px",this.list.style.overflowY="scroll",this.element.appendChild(this.list)}},{key:"dispose",value:function(){this.listenerGroup.removeAll()}},{key:"initDelay",value:function(){var e=this;this.delay=parseInt(u.q.getState().userChatSettings.emoticonAutocompleteDelay),f.kN.listen((function(t){e.delay=parseInt(t.dossier.userChatSettings.emoticonAutocompleteDelay)})).addTo(this.listenerGroup),b.gO.listen((function(t){e.delay=parseInt(t.emoticonAutocompleteDelay)})).addTo(this.listenerGroup)}},{key:"repositionChildren",value:function(){var e=this.config.inputElement.caretXPos(!0)+this.config.leftOffset,t=this.config.inputElement.element.clientWidth-this.config.rightOffset;this.element.style.left="".concat(Math.max(4,Math.min(e,t)),"px")}},{key:"handleInputChange",value:function(e){if(this.delay>=0&&!this.isSpecialFunctionKey(e)){var t=this.inputMatch();if(null!==t){if(this.textBeforeItem=t[1],this.prefix=t[2],void 0!==this.maxPrefixLength&&this.prefix.length>this.maxPrefixLength)return void warn("Autocomplete prefix >".concat(this.maxPrefixLength," chars. Not updating."));var n=this.getCache().get(this.normalizedPrefix());void 0!==n?(this.items=n,this.updateList()):this.throttledGetData.callFunc()}else this.hide()}}},{key:"getCache",value:function(){return void 0===this.cache&&(this.cache=new g.S(this.filterAfterSize,this.cacheTTL)),this.cache}},{key:"normalizedPrefix",value:function(){return this.prefix}},{key:"inputMatch",value:function(){return this.config.inputElement.getCurrentNodeText().match(this.regex)}},{key:"isSpecialFunctionKey",value:function(e){return-1!==C.indexOf(e.keyCode)}},{key:"updateList",value:function(){this.clearList(),0===this.items.length?this.element.style.display="none":this.element.style.display="block";for(var e=0;e=this.items.length&&(t=0),this.pickItem(t,!0)}},{key:"highlightSelectedIndex",value:function(e){if(void 0!==this.selectedIndex&&this.items.length>0){if(this.clearSelection(),(0,c.vP)(this.items[this.selectedIndex].element,"selectedEmoticon"),e){var t=this.list.clientHeight,n=this.list.firstChild.clientHeight;this.list.scrollTop=this.selectedIndex*n-t/2}var i=this.config.inputElement.getCurrentNodeText().replace(new RegExp("".concat(this.previousSlug,"$")),this.items[this.selectedIndex].slug);this.config.inputElement.setCurrentNodeText(i),this.config.inputElement.selectCurrentNodeTail(this.textBeforeItem.length+1)}}},{key:"deleteHighlightedSuffix",value:function(){this.config.inputElement.deleteSelection()}},{key:"show",value:function(){var e=this;this.delay>=0&&window.setTimeout((function(){null!==e.inputMatch()&&(e.element.style.visibility="visible",0===(0,m.gV)(e.element.style.width)&&(e.element.style.width="auto",e.element.style.width="-moz-available",e.element.style.width="-webkit-fill-available",e.element.style.width="fill-available"),e.element.style.height="auto",e.showOverlay(),e.repositionChildrenRecursive(),e.visible=!0)}),this.delay)}},{key:"hide",value:function(){this.hideOverlay(),this.element.style.visibility="hidden",this.element.style.width="0",this.element.style.height="0",this.visible=!1,this.clearList()}},{key:"clearSelection",value:function(){var e,t=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return w(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)?w(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(this.items);try{for(t.s();!(e=t.n()).done;){var n=e.value;(0,c.FU)(n.element,"selectedEmoticon")}}catch(e){t.e(e)}finally{t.f()}}},{key:"getData",value:function(){var e=this,t=new XMLHttpRequest;return new Promise((function(n,i){t.onload=function(){(0,h.nw)(t.status)?n(t):i(new h.GM(t))},t.onerror=function(){i(new h.GM(t))},t.open("GET",e.getDataEndpoint()),t.withCredentials=!1,t.timeout=6e4,t.send()}))}},{key:"appendItem",value:function(e,t){var n=this,i=document.createElement("div");i.style.padding="2px 8px",this.shouldIgnoreItem(e)&&(i.style.display="none"),i.onclick=function(e){n.pickItem(t,!1),e.preventDefault()};var o=document.createElement("div");return o.textContent=e.slug,o.title=e.slug,o.style.overflow="hidden",o.style.textOverflow="ellipsis",i.appendChild(o),this.list.appendChild(i),e.element=i,i}},{key:"pickItem",value:function(e,t){this.previousSlug=void 0===this.selectedIndex?this.prefix:this.items[this.selectedIndex].slug,this.selectedIndex=e,this.highlightSelectedIndex(t),this.config.inputElement.focus()}},{key:"shouldIgnoreItem",value:function(e){return!1}},{key:"isVisible",value:function(){return this.visible}}]),x}(y.B)},8824:function(e,t,n){"use strict";n.d(t,{Z7:function(){return f},lr:function(){return h},nw:function(){return u},rv:function(){return d},uc:function(){return p}});var i=n(2800),o=n(3753),r=n(391),s=n(3705),a=n(8978);function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(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)?c(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=e.getElementsByTagName("*");t.style.position="relative";var r,s=l(o);try{var a=function(){var e=r.value;if(!(e instanceof HTMLElement))return 1;e.style.position.includes("fixed")&&(e.style.position="absolute");var t=parseInt(e.style.zIndex);if(!isNaN(t)&&t>=100&&(e.style.zIndex="99"),n&&function(e){null!==e.style.top&&parseInt(e.style.top,10)<0&&(e.style.top="0"),null!==e.style.marginTop&&parseInt(e.style.marginTop,10)<0&&(e.style.marginTop="0"),null!==e.style.left&&parseInt(e.style.left,10)<0&&(e.style.left="0"),null!==e.style.marginLeft&&parseInt(e.style.marginLeft,10)<0&&(e.style.marginLeft="0")}(e),i&&"img"===e.tagName.toLowerCase()){var o=e.cloneNode();o.style.visibility="hidden",document.body.appendChild(o),o.onload=function(){e.style.height="".concat(.5*o.offsetHeight,"px"),e.style.width="".concat(.5*o.offsetWidth,"px"),document.body.removeChild(o)},o.onerror=function(){document.body.removeChild(o)}}};for(s.s();!(r=s.n()).done;)a()}catch(e){s.e(e)}finally{s.f()}}},6181:function(e,t,n){"use strict";n.d(t,{q:function(){return I}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(8759),u=n(1185),d=n(9760),h=n(407),f=n(3753),p=n(8824),m=n(7393),v=n(4793),g=n(8263),y=n(8978),b=n(6422),w=n(758),C=n(3543),x=n(47),k=n(2750);function S(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return T(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)?T(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==arguments[1]&&arguments[1],n=e.photoSets.filter((function(e){return e.isVideo})),i=e.photoSets.filter((function(e){return!e.isVideo}));if(n.length>0||t){var o=this.generatePhotoVideoSection(n,e.infoSection.username,"video");this.bioRootElement.appendChild(o)}if(i.length>0||t){var r=this.generatePhotoVideoSection(i,e.infoSection.username);this.bioRootElement.appendChild(r)}}},{key:"createBioContents",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.bioRootWrapper=(0,x.vz)("div",{style:{paddingLeft:"14px",overflow:"hidden"}}),this.bioRootElement=(0,x.vz)("table",{style:{tableLayout:"fixed",width:"100%"},ref:function(e){t.tableRef=e}},(0,x.vz)("tr",{style:{height:"1px"}},(0,x.vz)("th",{style:{width:"150px",minWidth:"150px"},ref:function(e){t.labelRef=e}}),(0,x.vz)("th",null)),(0,x.vz)("tr",{style:{verticalAlign:"top"}},(0,x.vz)("th",{colSpan:2},(0,x.vz)("h1",{colorClass:[u.ql.defaultColor,"bioHeader"],style:{fontSize:"".concat(P,".4px"),fontFamily:"UbuntuMedium, Arial, Helvetica, sans-serif",fontWeight:"normal",margin:"10px 0 20px",lineHeight:"20px",textAlign:"left"},ref:function(e){t.header=e},"data-testid":"bio-header"})))),this.bioRootWrapper.appendChild(this.bioRootElement),this.element.appendChild(this.bioRootWrapper),this.createResizeListeners();var i=e.infoSection;if(this.room===i.username){if(this.header.innerText="".concat((0,y.Qs)(this.room),"'s ").concat(C.ag.bioAndFreeWebCamText),this.createSections(i),this.shouldShowSocialMediaSection(e.socialMedias.length)){var o=this.generateSocialMediaSection(e.socialMedias,e.infoSection.username);this.bioRootElement.appendChild(o)}if(this.shouldShowPicsSection(e.photoSets.length)&&this.createPhotoVideos(e,n),e.aboutMe.length>=1){var r=this.generateSectionWithUserHTML(e.aboutMe,C.ag.aboutMeText);(0,b.Wk)(r),this.bioRootElement.appendChild(r),this.afterCustomSectionCreated(r)}if(e.wishList.length>=1){var s=this.generateSectionWithUserHTML(e.wishList,C.ag.wishListText);(0,b.Wk)(s),this.bioRootElement.appendChild(s),this.afterCustomSectionCreated(s)}this.repositionChildren()}}},{key:"createSections",value:function(e){if(""!==e.realName&&this.bioRootElement.appendChild(this.createSection(C.ag.realNameText,e.realName,!1)),this.bioRootElement.appendChild(this.createFollowersSection(e.followersCount)),""!==e.displayBirthday&&this.bioRootElement.appendChild(this.createSection(C.ag.birthdateText,e.displayBirthday,!1)),isNaN(e.displayAge)||this.bioRootElement.appendChild(this.createSection(C.ag.ageText,e.displayAge.toString(),!1)),"A Couple"===e.sex?this.bioRootElement.appendChild(this.createSection(C.ag.sexTextCouple,e.sex,!1)):"Trans"===e.sex&&e.subgender?this.bioRootElement.appendChild(this.createSection(C.ag.sexText,"".concat(e.sex," (").concat(e.subgender,")"),!1)):this.bioRootElement.appendChild(this.createSection(C.ag.sexText,e.sex,!1)),""!==e.interestedIn){var t=e.interestedIn;if(""!==(t=t.slice(1,t.length-1))){for(;t.includes('"');)t=t.replace('"',"");t=t.split(",").join(", "),this.bioRootElement.appendChild(this.createSection(C.ag.interstedInText,t,!1))}}""!==e.location&&this.bioRootElement.appendChild(this.createSection(C.ag.locationText,e.location,!1)),void 0!==e.lastBroadcast&&""!==e.lastBroadcast&&this.bioRootElement.appendChild(this.createSection(C.ag.lastBroadcastText,e.lastBroadcast,!1)),""!==e.languages&&this.bioRootElement.appendChild(this.createSection(C.ag.languagesText,e.languages,!1)),""!==e.bodyType&&this.bioRootElement.appendChild(this.createSection(C.ag.bodyTypeText,e.bodyType,!1)),""!==e.smokeDrink&&this.bioRootElement.appendChild(this.createSection(C.ag.smokeOrDrinkText,e.smokeDrink,!1)),""!==e.bodyDecorations&&this.bioRootElement.appendChild(this.createSection(C.ag.bodyDecorationsText,e.bodyDecorations,!1))}},{key:"createFollowersSection",value:function(e){return this.createSection(C.ag.followersText,isNaN(e)?"0":e.toString(),!1)}},{key:"shouldShowSocialMediaSection",value:function(e){return e>=1}},{key:"shouldShowPicsSection",value:function(e){return e>=1}},{key:"generateSocialMediaSection",value:function(e,t){var n,i=function(e){var n=(new b.dM).anchor,i="/socials/social_media/".concat(t,"/").concat(e.id);n.href=(0,f.BN)(i),n.style.position="relative",n.style.display="inline-block",n.style.marginBottom="17px",n.style.marginRight="5px",n.style.cursor="pointer",n.className="userUpload socialMediaUpload",n.title=e.titleName,(0,g.pY)(n),n.onclick=function(){return(0,k.Pv)(i,void 0,"resizable,dependent,scrollbars,height=700,width=700,top=".concat(screen.height/2-600,",left=").concat(screen.width/2-800)),!1};var o=document.createElement("img");(0,u.vP)(o,"previewBorder"),o.src=e.imageUrl,o.width=R,o.height=M,o.style.borderWidth="1px",o.style.borderStyle="solid",o.style.display="block",o.style.borderRadius="3%",o.style.display="block",n.appendChild(o);var r=document.createElement("span");(0,u.vP)(r,"tokenText"),r.innerText=e.labelText,r.style.backgroundColor=e.labelColor,r.style.position="absolute",r.style.top="80px",r.style.right="8px",r.style.fontSize="9px",r.style.borderRadius="2px",r.style.padding="1px 3px",r.style.lineHeight="12px",n.appendChild(r);var s=document.createElement("div");return(0,u.vP)(s,"link"),s.innerText=e.titleName,s.style.fontSize="".concat(P,"px"),s.style.left="0px",s.style.maxWidth="145px",s.style.whiteSpace="nowrap",s.style.textOverflow="ellipsis",s.style.overflow="hidden",s.style.lineHeight="16px",s.style.textDecoration="none",n.appendChild(s),n},o=[],r=0,s=S(e);try{for(s.s();!(n=s.n()).done;){var a=n.value;if(8===r)break;o.push(i(a)),r+=1}}catch(e){s.e(e)}finally{s.f()}var l=e.length>8;o.push(this.generateSocialMediaLinks(t,l));var c=this.createSection(C.ag.socialMediaText,o);return(0,u.vP)(c,"smContainer"),c}},{key:"generateSocialMediaLinks",value:function(e,t){var n=document.createElement("div");if(n.style.marginBottom="20px",t){var i=(new b.dM).anchor,o="/socials/social_media/list_popup/".concat(e,"/");(0,u.vP)(i,"link"),i.href=(0,f.BN)(o),i.innerText=C.ag.showMoreText,i.style.fontSize="14px",i.style.cursor="pointer",(0,g.pY)(i),i.onclick=function(e){(0,k.Pv)(o,void 0,"resizable,dependent,scrollbars,height=600,width=800,top=".concat(screen.height/2,",left=").concat(screen.width/2)),e.preventDefault()},n.appendChild(i)}return n}},{key:"generatePhotoVideoSection",value:function(e,t){var n,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"photo",r=function(e){var n=(new b.dM).anchor;n.href=(0,f.BN)("/photo_videos/photoset/detail/".concat(t,"/").concat(e.id)),n.target="_blank",n.style.position="relative",n.style.display="inline-block",n.style.marginBottom="17px",n.style.marginRight="5px",n.style.cursor="pointer",(0,g.pY)(n),n.className="userUpload",(0,c.w1)()||(n.title=e.name),n.onclick=function(t){(0,p.Z7)(e,"BioTab"),i.handlePictureClick(t,e.id,n.href)};var o=document.createElement("img");if((0,u.vP)(o,"previewBorder"),o.src=e.coverUrl,o.width=R,o.height=M,o.style.borderWidth="1px",o.style.borderStyle="solid",o.style.display="block",o.style.borderRadius="3%",o.style.display="block",n.appendChild(o),e.userCanAccess){if(e.userCanAccess&&e.userHasPurchased){var r=document.createElement("span");(0,u.vP)(r,"purchasedBadge"),r.style.backgroundColor="#6d85b5",r.style.color="#fff",r.style.position="absolute",r.style.top="80px",r.style.right="8px",r.style.padding="1px 3px",r.style.lineHeight="12px",r.style.borderRadius="2px",r.style.fontSize="9px",r.textContent=C.ag.purchasedCAPS,n.appendChild(r)}}else{var s=document.createElement("div");s.style.width="".concat(R+1,"px"),s.style.height="".concat(M+1,"px"),s.style.borderRadius="3%",s.style.position="absolute",s.style.left="0px",s.style.top="0px",s.style.backgroundColor="rgba(0, 0, 0, .55)",n.appendChild(s);var a=document.createElement("img");if(a.src="".concat(STATIC_URL,"lock.svg"),a.width=18,a.height=18,a.style.marginLeft="".concat(-9,"px"),a.style.marginTop="".concat(-9,"px"),a.style.position="absolute",a.style.left="50%",a.style.top="40%",a.style.padding="4px",a.style.border="none",n.appendChild(a),""!==e.labelText){var l=document.createElement("span");(0,u.vP)(l,"tokenText"),l.innerText=e.labelText,l.style.backgroundColor=e.labelColor,l.style.position="absolute",l.style.top="80px",l.style.right="8px",l.style.fontSize="9px",l.style.padding="1px 3px",l.style.lineHeight="12px",l.style.borderRadius="2px",n.appendChild(l)}}if(e.isVideo){var d=document.createElement("img");d.src="".concat(STATIC_URL,"video.svg"),d.height=18,d.style.position="absolute",d.style.top="8px",d.style.right="8px",n.appendChild(d)}if(e.isVideo&&!e.videoHasSound&&!e.pendingApproval){var m=document.createElement("img");m.src="".concat(STATIC_URL,"no-audio.svg"),m.height=18,m.style.position="absolute",m.style.top="8px",m.style.right="32px";var v=(0,h.T)({content:"".concat(C.ag.audioRemovedText),hasHTML:!1,width:175,divotPosition:1,divotLeftOrTop:"90px"});v.style.textAlign="center";var y=document.createElement("span");v.appendChild(y),n.appendChild(v),m.onmouseenter=function(){v.style.display="block",v.style.left="12px",v.style.top="-32px"},m.onmouseleave=function(){v.style.display="none"},n.appendChild(m)}var w=document.createElement("div");return(0,u.vP)(w,"link"),w.innerText=e.name,w.style.fontSize="".concat(P,"px"),w.style.left="0px",w.style.maxWidth="145px",w.style.whiteSpace="nowrap",w.style.textOverflow="ellipsis",w.style.overflow="hidden",w.style.lineHeight="16px",w.style.textDecoration="none",n.appendChild(w),n},s=[],a=0,l=S(e);try{for(l.s();!(n=l.n()).done;){var d=n.value;if(8===a)break;s.push(r(d)),a+=1}}catch(e){l.e(e)}finally{l.f()}var m,v=e.length>8;v&&(m=e[0].id);var y=this.generatePicsLinks(t,v,o,m);y.style.marginBottom="20px",s.push(y);var w=this.createSection("video"===o?C.ag.vidsText:C.ag.picsText,s);return(0,u.vP)(w,"psContainer"),w}},{key:"handlePictureClick",value:function(e,t,n){w.jS.fire(t),e.preventDefault()}},{key:"generatePicsLinks",value:function(e,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,i=document.createElement("div");if(t){var o=(new b.dM).anchor;o.href=(0,f.BN)("/photo_videos/photoset/list_popup/".concat(e,"/")),(0,u.vP)(o,"link"),o.innerText=C.ag.showMoreText,o.style.fontSize="14px",o.style.cursor="pointer",(0,g.pY)(o),o.onclick=function(e){w.jS.fire(n),e.preventDefault()},i.appendChild(o)}return i}},{key:"createSection",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e.toLowerCase().replaceAll(/[ \/]/g,"-").replaceAll(/[()\/]/g,"").replaceAll("--","");return(0,x.vz)("tr",{style:{fontSize:"".concat(P,"px"),fontWeight:"normal",lineHeight:"15px",verticalAlign:"top",textAlign:"left"}},(0,x.vz)("td",{colorClass:"label",style:{paddingBottom:"9px",fontFamily:"UbuntuMedium, Arial, Helvetica, sans-serif",height:"16px"}},(0,x.vz)("span",{"data-testid":"bio-tab-".concat(i,"-label")},e,":")),(0,x.vz)("td",{colorClass:"contentText",style:{fontSize:"".concat(P,"px"),lineHeight:"16px",fontFamily:"UbuntuRegular, Arial, Helvetica, sans-serif"},ref:function(e){if("string"==typeof t)if(n){var o=(0,x.vz)("div",null);if(e.appendChild(o),o.innerHTML=t,0!==o.children.length){var r=o.children[0];r.style.display="unset",r.dataset.testid="bio-tab-".concat(i,"-value")}}else e.innerText=t;else t.forEach((function(t){e.appendChild(t)}));n||(e.dataset.testid="bio-tab-".concat(i,"-value"))}}))}},{key:"generateSectionWithUserHTML",value:function(e,t){return this.createSection((0,y.Qs)(t),e,!0)}},{key:"afterCustomSectionCreated",value:function(e){this.customSections.push(e),(0,p.uc)(e,this.bioRootWrapper)}}]),T}(m.d),P=14,R=150,M=100},7611:function(e,t,n){"use strict";n.d(t,{c:function(){return p}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(1185),c=n(6767),u=n(8263),d=n(9874),h=n(47);var f="broadcast_terms",p=function(e){(0,r.Z)(p,e);var t,n,d=(t=p,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function p(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};return(0,i.Z)(this,p),e=d.call(this,{easyExit:!1}),(0,u.Zs)(e.element,{position:"fixed",overflow:"hidden",height:"auto",maxWidth:"1000px",minWidth:"450px",width:"90%",top:"50%",transform:"translateY(-50%)",left:"0px",right:"0px",margin:"auto",padding:"20px",borderWidth:"2px",borderStyle:"solid",borderRadius:"20px",zIndex:1e4}),(0,l.vP)(e.element,"broadcastTermsModal"),e.overlay.style.background="",t?((0,l.vP)(e.overlay,"blackOverlay"),e.overlayClickStayOpen=!0):((0,l.vP)(e.overlay,"transparentOverlay"),e.overlayClick.listen(o)),e.element.appendChild(e.createHeader()),e.element.appendChild(e.createBody()),e.element.appendChild(e.createAcceptButton(n)),e}return(0,o.Z)(p,[{key:"createHeader",value:function(){return(0,h.vz)("div",{colorClass:"header"},(0,h.vz)("h3",{style:{textAlign:"center"}},"WARNING: THIS SITE HAS A ZERO TOLERANCE POLICY ON UNDERAGE BROADCASTING."))}},{key:"createBody",value:function(){var e={textDecoration:"underline",fontWeight:"bold"};return this.body=(0,h.vz)("div",{style:{height:"200px",overflow:"auto",padding:"0 15px 0 10px",borderWidth:"1px",borderStyle:"solid",margin:"0 auto",textAlign:"left"},colorClass:"body"},(0,h.vz)("p",null,"The Chaturbate service is for use by adults only. By clicking the link below, you are affirming your representation and warranty to us that:"),(0,h.vz)("ol",null,(0,h.vz)("li",null,'You are at least 18 years old or the age of majority in your jurisdiction, whichever is older (the "Age of Majority");'),(0,h.vz)("li",null,"Anyone appearing on camera with you has also reached the Age of Majority;"),(0,h.vz)("li",null,"At no time will anyone who has not reached the Age of Majority be present while you are using the Chaturbate service;"),(0,h.vz)("li",null,"You will not permit anyone who has not reached the Age of Majority to use the Chaturbate service; and"),(0,h.vz)("li",null,"You will immediately report by email to ",(0,h.vz)("a",{href:"mailto:support@chaturbate.com"},"support@chaturbate.com")," any and all instances you become aware of wherein an individual has used the Chaturbate service without first reaching the Age of Majority."),(0,h.vz)("li",null,"Obviously, you consent to and request your image being broadcast on the Chaturbate platform."),(0,h.vz)("li",null,"You agree that you will be governed by the Chaturbate Terms and by the Chaturbate Broadcaster Agreement."),(0,h.vz)("li",null,"You agree that only age verified broadcasters associated with this room may broadcast in this room.")),(0,h.vz)("p",null,"If we suspect, in our sole discretion, that you are using the Chaturbate service without having complied in every respect with the foregoing statements, your account ",(0,h.vz)("span",{style:e},"will")," be terminated immediately, and we ",(0,h.vz)("span",{style:e},"will")," report your conduct to law enforcement.")),this.body}},{key:"createAcceptButton",value:function(e){var t=this;return(0,h.vz)("div",{style:{textAlign:"center",color:"#222"}},(0,h.vz)("a",{style:{width:"200px",height:"30px",lineHeight:"30px",fontWeight:"bold",margin:"10px 5px 0px 5px",borderWidth:"1px",borderStyle:"solid",display:"inline-block",textAlign:"center",cursor:"pointer"},"data-testid":"agree-broadcast-terms-button",colorClass:"acceptLink",ref:function(e){t.acceptLink=e},onClick:function(n){n.stopPropagation(),t.hide(),(0,c.C)(f,"1",7),e()}},"I AGREE"))}}],[{key:"areTermsAccepted",value:function(){return"1"===(0,c.ve)(f)}}]),p}(d.z)},8498:function(e,t,n){"use strict";n.d(t,{Q:function(){return O},B:function(){return L}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(8759),c=n(7906),u=n(1185),d=n(1522),h=n(3753),f=n(9),p=n(1794),m=n(3544),v=n(2239),g=n(3543),y=n(1289);function b(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return w(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)?w(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&(this.lastRatio=this.lastWidth/this.lastHeight);var s=R(e.videoCodecString,R(S[R(e.videoCodec,"")],"Unknown")),a=R(e.audioCodecString,R(S[R(e.audioCodec,"")],"Unknown"));this.transcodeCount=R(e.transcodeCount,void 0),this.fpsData.push(t),this.bitrateData.push(n),this.fpsData.length>this.MAX_FPS_LENGTH&&this.fpsData.shift(),this.bitrateData.length>this.MAX_BITRATE_LENGTH&&this.bitrateData.shift(),this.fpsSeries.append((new Date).getTime(),t),this.bitrateSeries.append((new Date).getTime(),n),this.streamDataUpdate.fire({host:o,region:i,streamType:r,fps:Math.round(t),bitrate:Math.round(n),streamTime:(0,k.WQ)(this.streamTime),videoWidth:this.lastWidth,videoHeight:this.lastHeight,videoCodec:s,audioCodec:a}),this.lastUpdate=(new Date).getTime()}},{key:"statusMessage",value:function(){var e,t,n=[],i=[],o=[],r=0,s=!1,a=0,l=0;if(this.lastHeight>0){for(var c in I)I.hasOwnProperty(c)&&this.lastHeight>=Number(c)&&(e=I[c],t=P[c]);this.lastHeight<480&&this.streamTime<120&&this.streamTime>2?i.push("Your stream resolution is lower than the recommended minimum of 480 pixels, we suggest you increase your stream resolution"):this.lastHeight<720&&this.streamTime>2&&o.push("Note: Your stream is not HD, a minimum height of 720 pixels is required."),void 0!==this.lastRatio&&this.lastRatio<1.7&&this.streamTime<120&&this.streamTime>2&&(i.push("Your stream is not widescreen. We recommend all streams to be widescreen (16:9 ratio) with external encoders"),r+=1)}void 0!==this.transcodeCount&&this.streamTime>10&&this.transcodeCount<3&&n.push("Error handling your stream, please restart it and contact support if this persists.");var u=0,d=30,h=30;this.fpsData.length>0&&(u=x(this.fpsData.slice(-100)),d=C(this.fpsData.slice(-10)),h=C(this.fpsData.slice(-5)));var f=e;if(h>45&&d>45&&(s=!0,f=t),void 0!==f&&this.streamTime>5){var p=x(this.bitrateData.slice(-100)),m=C(this.bitrateData.slice(-10)),v=C(this.bitrateData.slice(-5));m>.01&&m<.95*f&&v<.95*f?m<.7*f&&v<.7*f?s?n.push("Your bitrate is much lower than the recommended minimum of ".concat(f,"kbps for this resolution at a high frame rate. You may need to switch to a standard frame rate.")):n.push("Your bitrate is much lower than the recommended minimum of ".concat(f,"kbps for this resolution.")):s?i.push("Your bitrate is lower than the recommended minimum of ".concat(f,"kbps for this resolution at a high frame rate. You may need to switch to a standard frame rate.")):i.push("Your bitrate is lower than the recommended minimum of ".concat(f,"bps for this resolution.")):p>m/8&&this.streamTime>50&&this.bitrateData.length>20?(r+=1,i.push("Your bitrate is unstable which can indicate a poor connection.")):m>1.5*f&&o.push("Your bitrate is very good!"),a=v<.7*f?1:v<.95*f?2:0}else a=0;h>.01&&d<21&&h<21&&this.streamTime>5?d<15&&h<15?n.push("Your frame rate is much lower than the recommended minimum of 24 fps"):i.push("Your frame rate is lower than the recommended minimum of 24 fps"):h>45&&d>45?this.streamTime<120&&this.streamTime>2&&o.push("You are broadcasting with a high frame rate. Please only use this if your camera is set to a high frame rate."):h>62&&d>62?n.push("Your frame rate is higher than the maximum of 60 fps. This will result in a poor stream output."):u>6&&this.streamTime>30&&this.fpsData.length>20?(r+=1,i.push("Your fps is very unstable. Your encoder may be overloaded.")):u>3&&this.streamTime>30&&this.fpsData.length>20&&(r+=1,i.push("Your fps is unstable. Your encoder may be overloaded.")),this.streamTime>5&&this.fpsData.length>20&&(l=h<15?1:h>63||h>33&&h<45||h<21?2:0),this.lastUpdate>0&&(new Date).getTime()-this.lastUpdate>1e4&&i.push("Unable to get quality information, please contact support if this persists. Your stream is not affected.");var g,y=0,b="",w=[];n.length>0?(b="Alert",w=n.slice(0,2),y=1):i.length>0?(b="Warning",w=i.slice(0,2),y=2):o.length>0||this.streamTime>10?(b="Your stream is good",w=o.length>0?o.slice(0,2):["No issues to report"],y=3):y=0;var k="",S="",T=i.length-r;this.lastHeight>=2160&&T<1&&0===n.length?(g=3,k="4K",S="4K"):this.lastHeight>=1080&&T<1&&0===n.length?(g=2,k="HD+",S="Full High Definition"):this.lastHeight>=720&&T<1&&0===n.length?(g=1,k="HD",S="High Definition"):(g=0,k="SD",S="Standard Definition"),this.pollingStatusUpdate.fire({feedbackHeader:b,feedbackMessages:w,feedbackType:y,resolutionTitle:S,resolutionType:g,resolutionText:k,bitrateFeedback:a,fpsFeedback:l})}},{key:"startPolling",value:function(){var e=this;if(this.startPollingEvent.fire(void 0),!this.started){this.started=!0;var t={millisPerPixel:90,maxValueScale:1.3,grid:{fillStyle:"rgba(209, 209, 209, 0.69)",strokeStyle:"rgba(141, 142, 126, 0.82)",sharpLines:!0,borderVisible:!0,millisPerLine:6e3,verticalSections:2},labels:{fillStyle:"rgba(35, 34, 34, 0.79)",fontSize:10,precision:0},minValue:0,responsive:!0};this.fpsChart=new M(t),this.fpsSeries=new A,this.fpsChart.addTimeSeries(this.fpsSeries,{lineWidth:1.2,strokeStyle:"#033E58"}),this.fpsChart.streamTo(document.getElementById("fps_chart"),2e3),this.bitrateChart=new M(t),this.bitrateSeries=new A,this.bitrateChart.addTimeSeries(this.bitrateSeries,{lineWidth:1.2,strokeStyle:"#033E58"}),this.bitrateChart.streamTo(document.getElementById("bitrate_chart"),2e3),this.infoInterval=window.setInterval((function(){e.statusMessage()}),1500)}}},{key:"isStarted",value:function(){return this.started}},{key:"start",value:function(){this.started||(this.closed=!1,this.startPolling())}},{key:"close",value:function(){!this.closed&&this.started&&(this.closed=!0,this.started=!1,this.closeEvent.fire(void 0),this.fpsChart.stop(),this.bitrateChart.stop(),clearInterval(this.infoInterval))}},{key:"reset",value:function(){this.isStarted()&&this.close(),this.started=!1,this.closed=!1,this.fpsData=[],this.bitrateData=[],this.lastUpdate=0,this.transcodeCount=0,this.lastWidth=0,this.lastHeight=0,this.lastRatio=void 0,this.streamTime=0,this.infoInterval=0,this.start()}}]),e}(),B=function(){function e(t){(0,i.Z)(this,e),this.originWSEndpoint=t,this.streamWatcher=new E,this.closed=!1,this.lastInfo=(new Date).getTime(),this.streamName="",this.roomStatusUpdate=new p.xB("originWatcherRoomStatusUpdate"),this.alternativeStreamEvent=new p.xB("originWatcherAlternativeStream")}return(0,o.Z)(e,[{key:"close",value:function(){this.closed||(this.closed=!0,void 0!==this.websocket&&this.websocket.readyState<2&&this.websocket.close(),this.streamWatcher.close())}},{key:"start",value:function(){var e=this;if(void 0!==this.origin&&void 0!==this.auth&&void 0!==this.username){if(void 0!==this.websocket){if(this.websocket.readyState<2)return;try{this.websocket.close()}catch(e){}}this.closed=!1,this.websocket=new WebSocket("wss://".concat(this.origin).concat(this.originWSEndpoint)),this.websocket.onopen=function(t){void 0!==e.websocket&&e.websocket.send(JSON.stringify({method:"connect",username:e.username,password:e.auth}))},this.websocket.onmessage=function(t){var n,i=t.data;try{n=JSON.parse(i)}catch(e){}if(void 0!==n)switch(n.method){case"auth_valid":break;case"stream_info":case"origin_info":e.lastInfo=(new Date).getTime(),e.handleInfo(n);break;default:console.warn("Unhandled",n)}},this.websocket.onerror=function(e){},this.websocket.onclose=function(t){e.closed||window.setTimeout((function(){e.start()}),100)}}}},{key:"isConnected",value:function(){return!this.closed&&void 0!==this.websocket&&(new Date).getTime()-this.lastInfo<5e3}},{key:"handleInfo",value:function(e){var t=R(e.status,"offline"),n=R(e.roomPassword,"");"public"===t&&n.length>0&&(t="password protected");var i=R(e.streamType,"obs"),o=Boolean((0,y.dD)(window.location.search).graph);if(this.roomStatusUpdate.fire(t),"obs"!==i&&!o){var r="Unknown";"webrtc"===i&&(r="WebRTC"),this.alternativeStreamEvent.fire(r)}void 0===e.streamName||"obs"!==i&&!o?(this.streamWatcher.close(),void 0!==e.remoteHost&&void 0!==e.remoteStatus&&e.remoteHost!==this.origin&&""!==e.remoteStatus&&"offline"!==e.remoteStatus&&this.update(e.remoteHost,e.username,e.originPassword)):e.streamName!==this.streamName?(this.streamWatcher.reset(),this.streamName=e.streamName):this.streamWatcher.processData(e)}},{key:"getStreamWatcher",value:function(){return this.streamWatcher}},{key:"update",value:function(e,t,n){var i=this;this.origin=e,this.username=t,this.auth=n,this.close(),window.setTimeout((function(){i.start()}),10)}},{key:"getOrigin",value:function(){return this.origin}}]),e}();var O=function(e){(0,r.Z)(y,e);var t,n,f=(t=y,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function y(e,t){var n;(0,i.Z)(this,y),(n=f.call(this)).originWSEndpoint=e,n.roomNameStaffView=t,n.roomStatus="offline",n.obsInfo=n.createLink("Show RTMP/OBS broadcast information"),n.backToWebRTC=n.createLink("Use In-Browser Broadcaster"),n.originWatcher=new B(n.originWSEndpoint),n.obsRoomStatusBlock=document.createElement("div"),n.obsRoomStatusContainer=document.createElement("div"),n.obsRoomStatus=document.createElement("span"),n.obsExitAway=document.createElement("div"),n.obsStreamStatsBlock=document.createElement("div"),n.obsStreamStatsOther=document.createElement("div"),n.obsAlternativeStreamType=document.createElement("p"),n.obsStreamRegion=document.createElement("div"),n.obsStreamGraphFPS=document.createElement("div"),n.obsStreamGraphBitrate=document.createElement("div"),n.obsStreamGraphFPSDisp=document.createElement("span"),n.obsStreamGraphBitrateDisp=document.createElement("span"),n.obsDetailsBoxTimeDisp=document.createElement("span"),n.obsDetailsBoxResDisp=document.createElement("span"),n.obsDetailsBoxCodecVideo=document.createElement("span"),n.obsDetailsBoxCodecAudio=document.createElement("span"),n.statsLoadingMessage=document.createElement("div"),n.resolutionFloatBox=document.createElement("div"),n.resolutionFloatBoxText=document.createElement("div"),n.obsStreamFeedbackBox=document.createElement("div"),n.obsFeedbackBoxHeader=document.createElement("h4"),n.obsFeedbackBoxMessages=document.createElement("div"),n.obsStreamRejected=document.createElement("div"),n.obsStreamRejectedReason=document.createElement("p"),n.obsControl=document.createElement("div"),n.obsStarted=new p.xB("obsStarted"),n.element.id="OBSOverlay";var o=void 0!==t;return n.createOBSVideo(),o||(n.hide(),n.createOtherStreamOptions()),n.originWatcher.alternativeStreamEvent.listen((function(e){n.obsStreamStatsOther.style.display="",n.updateAlternativeStreamType(e),n.obsStreamStatsBlock.style.display="none",n.statsLoadingMessage.style.display="none"})),n.originWatcher.getStreamWatcher().closeEvent.listen((function(){n.obsStreamStatsBlock.style.display="none",n.statsLoadingMessage.style.display="none",n.styleGraph(n.obsStreamGraphFPS,0),n.styleGraph(n.obsStreamGraphBitrate,0),n.styleFeedbackBox(0),n.obsStreamGraphFPSDisp.innerText="",n.obsStreamGraphBitrateDisp.innerText="",n.resolutionFloatBox.title="",n.obsDetailsBoxCodecVideo.innerText="",n.obsDetailsBoxCodecAudio.innerText="",n.obsDetailsBoxTimeDisp.innerText="",n.obsDetailsBoxResDisp.innerText=""})),n.originWatcher.getStreamWatcher().startPollingEvent.listen((function(){n.statsLoadingMessage.style.display="none",n.styleFeedbackBox(0),n.obsStreamStatsBlock.style.display=""})),n.originWatcher.getStreamWatcher().pollingStatusUpdate.listen((function(e){n.resolutionFloatBox.title=g.ag.obsStreamClass(e.resolutionTitle),n.resolutionFloatBoxText.innerText=e.resolutionText,n.styleResolutionFloatBox(e.resolutionType),n.styleFeedbackBox(e.feedbackType),n.styleGraph(n.obsStreamGraphFPS,e.fpsFeedback),n.styleGraph(n.obsStreamGraphBitrate,e.bitrateFeedback),n.obsFeedbackBoxHeader.innerText=e.feedbackHeader,n.obsFeedbackBoxMessages.innerHTML=e.feedbackMessages.join("
")})),n.originWatcher.getStreamWatcher().streamDataUpdate.listen((function(e){n.obsStreamStatsBlock.style.display="",n.obsStreamRegion.innerText=g.ag.obsConnectionDescription(e.host,e.region,e.streamType),n.obsStreamGraphFPSDisp.innerText=g.ag.obsFPS(Math.round(e.fps)),n.obsStreamGraphBitrateDisp.innerText=g.ag.obsBitrate(Math.round(e.bitrate)),n.obsDetailsBoxTimeDisp.innerText="".concat(e.streamTime),n.obsDetailsBoxResDisp.innerText="".concat(e.videoWidth,"x").concat(e.videoHeight),n.obsDetailsBoxCodecVideo.innerText="".concat(e.videoCodec),n.obsDetailsBoxCodecAudio.innerText="".concat(e.audioCodec)})),n.originWatcher.roomStatusUpdate.listen((function(e){n.updateRoomStatus(e)})),n}return(0,o.Z)(y,[{key:"monitorRoomStatus",value:function(){var e=this;void 0!==this.monitorTimeout&&clearTimeout(this.monitorTimeout);var t="api/get_my_broadcast_status/".concat(void 0!==this.roomNameStaffView?"".concat(this.roomNameStaffView,"/"):"").concat("offline"===this.roomStatus?"?auth=1":"");(0,h.I5)(t,{}).then((function(t){var n=JSON.parse(t.responseText);e.originWatcher.isConnected()||e.updateRoomStatus(n.status);var i=n.errors;if(null!=i&&"offline"===n.status){e.obsStreamRejected.style.display="";var o="Your stream was recently rejected for the following reasons:
";void 0!==i.reasons&&i.reasons.forEach((function(e){switch(e){case"ratio":o="".concat(o,"Having an incorrect ratio, please either broadcast at 4:3 or 16:9.
");break;case"height":o="".concat(o,"Having an invalid height of ").concat(R(i.height,"Unknown")," pixels, the stream height must be between 240 and 2160 pixels.
");break;case"codec_video":o="".concat(o,"Having an invalid video codec of ").concat(R(S[R(i.video_codec,"")],"Unknown"),", the stream must use the H.264 video codec baseline, main or high 4:2:0.
");break;case"codec_audio":o="".concat(o,"Having an invalid video codec of ").concat(R(T[R(i.audio_codec,"")],"Unknown")," the stream must use the AAC audio codec.
");break;case"high_res_fps":o="".concat(o,"Having a high frame rate and resolution. Resolutions above 1080p are limited to 30fps.
");break;case"video_fps":o="".concat(o,"Having an invalid video fps of ").concat(Math.round(R(i.video_fps,0))," the stream must be at least 24 fps.
");break;default:o="".concat(o,"An unknown reason.
")}})),e.obsStreamRejectedReason.innerHTML=o}var r=n.origin,s=n.username,a=n.originPassword,l=n.status;void 0!==r&&void 0!==s&&void 0!==a&&void 0!==l&&(!e.originWatcher.isConnected()||e.originWatcher.getOrigin()!==r&&"offline"!==l)&&e.originWatcher.update(r,s,a)})).catch((function(){})),this.monitorTimeout=window.setTimeout((function(){e.monitorRoomStatus()}),1e4)}},{key:"createOBSVideo",value:function(){var e=document.createElement("div"),t=document.createElement("span"),n=document.createElement("div"),i=document.createElement("div"),o=document.createElement("div"),r=document.createElement("div"),s=this.createDetailsBox(),a=this.createDetailsBox(),l=this.createDetailsBox(),c=document.createElement("div");e.appendChild(n),n.appendChild(this.obsRoomStatusBlock),this.obsRoomStatusContainer.appendChild(t),this.obsRoomStatusContainer.appendChild(this.obsRoomStatus),this.obsRoomStatusBlock.appendChild(this.obsRoomStatusContainer),this.obsRoomStatusBlock.appendChild(this.obsExitAway),n.appendChild(i),i.appendChild(this.obsStreamRejected),i.appendChild(this.statsLoadingMessage),i.appendChild(this.obsStreamStatsBlock),this.obsStreamStatsBlock.appendChild(o),o.appendChild(this.obsStreamFeedbackBox),this.obsStreamStatsBlock.appendChild(r),r.appendChild(s),this.resolutionFloatBox.appendChild(this.resolutionFloatBoxText),r.appendChild(a),r.appendChild(l),this.obsStreamStatsBlock.appendChild(c),c.appendChild(this.obsStreamGraphFPS),c.appendChild(this.obsStreamGraphBitrate),this.obsStreamStatsBlock.appendChild(this.obsStreamRegion),i.appendChild(this.obsStreamStatsOther),this.element.appendChild(e),r.style.lineHeight="18px",(0,u.vP)(t,"roomStatusLabel"),t.innerText=g.ag.yourStreamIsCurrently,this.obsRoomStatusContainer.style.textAlign="center",this.obsRoomStatusContainer.style.display="none",this.obsRoomStatusContainer.style.fontSize="1.1em",this.obsRoomStatusContainer.style.paddingTop="20px",(0,u.vP)(this.obsRoomStatus,"roomStatus"),this.obsRoomStatus.style.fontWeight="bolder",n.style.font="1.2em/1.4em 'UbuntuRegular', Arial, Helvetica, sans-serif",n.style.height="460px",this.obsStreamStatsBlock.style.display="none",this.obsRoomStatusBlock.style.height="145px",this.obsRoomStatusBlock.style.lineHeight="1em",this.obsRoomStatusBlock.style.textAlign="center",(0,u.vP)(this.obsStreamRegion,"streamRegion"),this.obsStreamRegion.style.textAlign="left",this.obsStreamRegion.style.fontSize="9px",this.obsStreamRegion.style.paddingLeft="5px",i.style.fontWeight="normal",r.style.width="100%",r.style.padding="8px",r.style.height="55px",r.style.boxSizing="border-box",r.style.textAlign="center",c.style.width="100%",c.style.height="110px",c.style.padding="3px",c.style.boxSizing="border-box",c.style.marginTop="5px",this.obsStreamGraphFPS.style.cssFloat="left",this.obsStreamGraphFPS.style.width="240px",this.obsStreamGraphFPS.style.textAlign="center",(0,v.pS)(this.obsStreamGraphFPS,"background 500ms ease-in-out"),this.obsStreamGraphBitrate.style.cssFloat="right",this.obsStreamGraphBitrate.style.width="240px",this.obsStreamGraphBitrate.style.textAlign="center",(0,v.pS)(this.obsStreamGraphBitrate,"background 500ms ease-in-out"),this.obsExitAway.style.fontSize="0.9em",this.obsExitAway.style.lineHeight="1.4em",this.obsExitAway.style.maxWidth="90%",this.obsExitAway.style.margin="10px auto 0",this.obsExitAway.style.display="none",o.style.width="100%",o.style.padding="5px",o.style.boxSizing="border-box",this.obsStreamFeedbackBox.style.width="85%",this.obsStreamFeedbackBox.style.padding="5px",this.obsStreamFeedbackBox.style.textAlign="center",this.obsStreamFeedbackBox.style.fontSize="12px",this.obsStreamFeedbackBox.style.margin="4px auto 0",(0,u.vP)(this.obsStreamRejected,"streamRejected"),this.obsStreamRejected.style.display="none",this.obsStreamRejected.style.width="85%",this.obsStreamRejected.style.padding="5px",this.obsStreamRejected.style.textAlign="center",this.obsStreamRejected.style.color="#ffffff",this.obsStreamRejected.style.fontSize="14px",this.obsStreamRejected.style.margin="15px auto 0",this.obsStreamRejected.style.borderWidth="1px",this.obsStreamRejected.style.borderStyle="solid",this.resolutionFloatBox.style.display="none",this.resolutionFloatBox.style.fontSize="16px",this.resolutionFloatBox.style.width="33px",this.resolutionFloatBox.style.height="23px",this.resolutionFloatBox.style.borderRadius="3px",this.resolutionFloatBox.style.position="absolute",this.resolutionFloatBox.style.right="2px",this.resolutionFloatBox.style.top="10px",this.resolutionFloatBox.style.fontWeight="bold",this.resolutionFloatBox.style.textAlign="center",this.resolutionFloatBoxText.style.padding="10% 0";var d=document.createElement("p");(0,u.vP)(d,"obsAwayMessage"),d.innerText=g.ag.obsAwayMessage,d.style.margin="3px";var h=this.createLink("Exit Away Mode");(0,u.vP)(h,"exitAwayLink"),h.style.fontSize="1.6em",h.onclick=function(e){e.preventDefault(),(0,m.ve)()},this.obsExitAway.appendChild(d),this.obsExitAway.appendChild(h);var f=document.createElement("h4");f.innerText=g.ag.streamRejected,this.obsStreamRejected.appendChild(f),this.obsStreamRejected.appendChild(this.obsStreamRejectedReason);var p=document.createElement("p");(0,u.vP)(p,"waitingMessage"),p.innerText=g.ag.waitingforStreamStats,p.style.textAlign="center";var y=document.createElement("img");y.src="".concat(STATIC_URL,"ellipsis.svg"),y.style.height="110px",y.style.width="auto",y.style.opacity="0.5",y.style.margin="0 auto",y.style.display="block",this.statsLoadingMessage.appendChild(p),this.statsLoadingMessage.appendChild(y),this.obsFeedbackBoxHeader.innerText=g.ag.streamStatusUnknown,this.obsFeedbackBoxHeader.style.color="inherit",this.obsFeedbackBoxHeader.style.fontWeight="bold",this.obsFeedbackBoxHeader.style.fontSize="15px",this.obsFeedbackBoxHeader.style.margin="3px",this.obsStreamFeedbackBox.appendChild(this.obsFeedbackBoxHeader),this.obsStreamFeedbackBox.appendChild(this.obsFeedbackBoxMessages),this.obsStreamFeedbackBox.style.display="none",(0,u.vP)(s,"resolutionText");var b=document.createElement("span");b.innerText=g.ag.resolutionLabel,s.appendChild(b),s.appendChild(document.createElement("br")),this.obsDetailsBoxResDisp=document.createElement("span"),this.obsDetailsBoxResDisp.style.fontSize="0.8em",s.appendChild(this.obsDetailsBoxResDisp),s.appendChild(this.resolutionFloatBox);var w=document.createElement("span");w.innerText=g.ag.streamTime,a.appendChild(w),a.appendChild(document.createElement("br")),this.obsDetailsBoxTimeDisp=document.createElement("span"),this.obsDetailsBoxTimeDisp.style.fontSize="0.8em",a.appendChild(this.obsDetailsBoxTimeDisp),(0,u.vP)(l,"codecText");var C=document.createElement("span");C.innerText=g.ag.codec,l.appendChild(C),l.appendChild(document.createElement("br")),this.obsDetailsBoxCodecVideo=document.createElement("span"),this.obsDetailsBoxCodecVideo.style.fontSize="10px",this.obsDetailsBoxCodecVideo.style.lineHeight="1",this.obsDetailsBoxCodecVideo.style.display="block",this.obsDetailsBoxCodecVideo.style.marginTop="2px",this.obsDetailsBoxCodecAudio=document.createElement("span"),this.obsDetailsBoxCodecAudio.style.fontSize="10px",this.obsDetailsBoxCodecAudio.style.lineHeight="1",this.obsDetailsBoxCodecAudio.style.display="block",this.obsDetailsBoxCodecAudio.style.marginTop="2px",l.appendChild(this.obsDetailsBoxCodecVideo),l.appendChild(this.obsDetailsBoxCodecAudio);var x=document.createElement("span");x.innerText=g.ag.frameRate,this.obsStreamGraphFPSDisp.style.fontWeight="bold";var k=document.createElement("canvas");k.style.width="235px",k.style.height="80px",k.id="fps_chart",this.obsStreamGraphFPS.appendChild(x),this.obsStreamGraphFPS.appendChild(this.obsStreamGraphFPSDisp),this.obsStreamGraphFPS.appendChild(k);var S=document.createElement("span");S.innerText=g.ag.bitrate,this.obsStreamGraphBitrateDisp.style.fontWeight="bold";var T=document.createElement("canvas");T.style.width="235px",T.style.height="80px",T.id="bitrate_chart",this.obsStreamGraphBitrate.appendChild(S),this.obsStreamGraphBitrate.appendChild(this.obsStreamGraphBitrateDisp),this.obsStreamGraphBitrate.appendChild(T),this.obsStreamStatsOther.appendChild(this.obsAlternativeStreamType),this.obsStreamStatsOther.style.display="none",this.obsAlternativeStreamType.style.textAlign="center",this.obsAlternativeStreamType.style.height="260px",this.obsAlternativeStreamType.style.marginTop="40px",this.updateAlternativeStreamType("Unknown")}},{key:"updateAlternativeStreamType",value:function(e){this.obsAlternativeStreamType.innerText=g.ag.obsAlternativeStreamType(e)}},{key:"createDetailsBox",value:function(){var e=document.createElement("div");return e.style.width="33%",e.style.cssFloat="left",e.style.height="30px",e.style.lineHeight="18px",e.style.position="relative",e}},{key:"styleResolutionFloatBox",value:function(e){switch(this.resolutionFloatBox.style.display="",e){case 0:this.resolutionFloatBox.style.backgroundColor="#e67e22",this.resolutionFloatBox.style.color="#fff";break;case 1:this.resolutionFloatBox.style.backgroundColor="#27ae60",this.resolutionFloatBox.style.color="#fff";break;case 2:this.resolutionFloatBox.style.backgroundColor="#16a085",this.resolutionFloatBox.style.color="#fff";break;case 3:this.resolutionFloatBox.style.backgroundColor="#2980b9",this.resolutionFloatBox.style.color="#f1c40f"}}},{key:"styleFeedbackBox",value:function(e){switch(this.obsStreamFeedbackBox.className="",this.obsStreamFeedbackBox.style.display="",this.obsStreamFeedbackBox.style.borderWidth="1px",this.obsStreamFeedbackBox.style.borderStyle="solid",e){case 0:this.obsStreamFeedbackBox.style.display="none";break;case 3:(0,u.vP)(this.obsStreamFeedbackBox,"goodFeedback");break;case 2:(0,u.vP)(this.obsStreamFeedbackBox,"warningFeedback");break;case 1:(0,u.vP)(this.obsStreamFeedbackBox,"badFeedback")}}},{key:"styleGraph",value:function(e,t){switch(t){case 0:e.style.backgroundColor="";break;case 3:e.style.backgroundColor="rgba(46, 204, 113, 0.49)";break;case 2:e.style.backgroundColor="rgba(230, 126, 34, 0.61)";break;case 1:e.style.backgroundColor="rgba(231, 76, 60, 0.58)"}}},{key:"updateRoomStatus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";-1!==["offline","public","private","group","away","hidden","password protected"].indexOf(t)?("offline"!==t?(this.obsControl.style.marginTop="0",this.obsStreamRejected.style.display="none",this.backToWebRTC.style.display="none","offline"===this.roomStatus&&(c.PE.fire(!0),this.obsStarted.fire(void 0))):(this.obsControl.style.marginTop="-12px",(0,l.AQ)()&&!(0,l.E$)()&&(this.backToWebRTC.style.display=""),"offline"!==this.roomStatus&&(c.PE.fire(!1),clearTimeout(this.monitorTimeout),this.monitorTimeout=window.setTimeout((function(){e.monitorRoomStatus()}),2e3))),this.roomStatus=t,this.obsRoomStatus.innerText=t,this.styleOBSRoomStatus(t)):this.roomStatus="unknown",this.obsExitAway.style.display="away"===t?"":"none"}},{key:"styleOBSRoomStatus",value:function(e){switch(this.obsRoomStatusContainer.style.display="",this.obsStreamStatsOther.style.display="none",this.obsRoomStatusBlock.className="",e){case"offline":(0,u.vP)(this.obsRoomStatusBlock,"offlineBlock");break;case"public":(0,u.vP)(this.obsRoomStatusBlock,"publicBlock");break;case"private":(0,u.vP)(this.obsRoomStatusBlock,"privateBlock");break;case"group":(0,u.vP)(this.obsRoomStatusBlock,"groupBlock");break;case"away":(0,u.vP)(this.obsRoomStatusBlock,"awayBlock");break;case"hidden":(0,u.vP)(this.obsRoomStatusBlock,"hiddenBlock");break;case"password protected":(0,u.vP)(this.obsRoomStatusBlock,"passwordProtectedBlock")}}},{key:"createOtherStreamOptions",value:function(){var e=this;this.element.appendChild(this.obsControl),this.obsControl.appendChild(this.backToWebRTC),this.obsControl.appendChild(this.obsInfo),this.obsControl.style.paddingTop="7px",this.obsControl.style.width="100%",this.obsControl.style.height="8%",this.obsControl.style.marginTop="-12px",this.obsControl.style.textAlign="center",this.backToWebRTC.style.paddingLeft="5px",this.obsInfo.style.display="block",this.backToWebRTC.onclick=function(){e.webBroadcaster()}}},{key:"webBroadcaster",value:function(){"private"===this.roomStatus||"group"===this.roomStatus?(0,d.oB)("Warning! This will end your ".concat(this.roomStatus," show. Are you sure?"),(function(){""===window.location.search?window.location.reload():window.location.search=""})):""===window.location.search?window.location.reload():window.location.search=""}},{key:"show",value:function(){this.element.style.display="block"}},{key:"hide",value:function(){this.element.style.display="none"}},{key:"createLink",value:function(e){var t=document.createElement("a");return(0,u.vP)(t,u.ql.hrefColor),t.innerText=e,t.style.padding="0 10px",t.style.fontWeight="bold",t.style.font="1.1em/1.2em 'UbuntuRegular', Arial, Helvetica, sans-serif",t.style.cursor="pointer",t}},{key:"getOBSInfoLink",value:function(){return this.obsInfo}},{key:"isOffline",value:function(){return"offline"===this.roomStatus}}]),y}(f.w),L=new p.xB("showOBSOverlay")},7968:function(e,t,n){"use strict";n.d(t,{E:function(){return x},q:function(){return C}});var i=n(126),o=n(2951),r=n(1976),s=n(7591),a=n(9492),l=n(7597),c=n(2018),u=n(1185),d=n(8542),h=n(1522),f=n(3753),p=n(391),m=n(4793),v=n(1794),g=n(9545),y=n(3543),b=n(2750),w=n(7393);var C=new v.xB("reloadAppTab",{maxHistorySize:1}),x=function(e){(0,s.Z)(w,e);var t,n,v=(t=w,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function w(e){var t;return(0,o.Z)(this,w),(t=v.call(this)).roomDossier=e,(0,u.vP)(t.element,"appsTab"),m.jr.listen((function(){t.showing&&t.load()})),m.kN.listen((function(e){e.chatConnection.event.appTabRefresh.listen((function(){t.showing&&t.load()}))})),C.listen((function(){t.showing&&t.load()})),t}return(0,r.Z)(w,[{key:"createContent",value:function(e){}},{key:"createCbappsTable",value:function(e){var t=this,n=document.createElement("table");(0,u.vP)(n,"table"),n.style.width="850px",n.style.borderWidth="1px",n.style.borderStyle="solid",n.style.borderRadius="5px 5px 0 0",n.style.borderSpacing="0",n.appendChild(this.createCbappsTableHeader()),n.appendChild(this.createCbappsTableFooter());var i=document.createElement("tbody");n.appendChild(i);for(var o=["".concat(y.ag.activeApp,":"),"".concat(y.ag.bot1,":"),"".concat(y.ag.bot2,":"),"".concat(y.ag.bot3,":"),"".concat(y.ag.bot4,":"),"".concat(y.ag.bot5,":")],r=function(n){var r=e["slot".concat(n)],s=e["previous_app_".concat(n)],a=0===n,l=document.createElement("tr");(0,u.vP)(l,"row");var c=document.createElement("td"),d=document.createElement("legend"),p=document.createElement("td"),m=document.createElement("td");(0,u.vP)(d,"label"),d.innerText=o[n],d.style.padding="4px 8px",void 0===r?((0,u.vP)(p,"noneSelected"),p.innerText=y.ag.noneSelected,p.style.fontStyle="italic"):p.innerText=r;var v=document.createElement("a");if((0,u.vP)(v,u.ql.hrefColor),m.appendChild(v),m.style.paddingRight="8px",void 0===r?(v.href=(0,f.BN)(a?"/apps/":"/apps/bot/".concat(n,"/")),v.onclick=function(e){e.preventDefault(),(0,b.Pv)(v.href,"_blank",b.uX)},v.innerText=a?y.ag.chooseAnApp:y.ag.chooseABot):((0,u.vP)(v,"deactivate"),v.name="/app/stop/".concat(n),v.innerText=y.ag.deactivateText,v.href="#",v.onclick=function(e){e.preventDefault(),(0,f.I5)("app/stop/".concat(n,"/"),{}).then((function(){t.load()})).catch((function(){(0,h.Cj)("Error deactivating app")}))}),void 0!==s){var g=document.createElement("span"),w=document.createElement("a");(0,u.vP)(g,"orText"),g.innerText=" ".concat(y.ag.orSimple," "),(0,u.vP)(w,u.ql.hrefColor),w.innerText="".concat(y.ag.restart,' "').concat(s.app_name,'"'),w.href=(0,f.BN)("/app/startup/".concat(s.app_slug,"/?version=").concat(s.app_version,"&slot=").concat(n)),w.onclick=function(e){e.preventDefault(),(0,b.Pv)(w.href,"_blank",b.uX)},m.appendChild(g),m.appendChild(w)}c.style.width="150px",m.style.textAlign="right",i.appendChild(l),c.appendChild(d),l.appendChild(c),l.appendChild(p),l.appendChild(m)},s=0;s1&&void 0!==arguments[1]?arguments[1]:{};this.pathname=e,this.params=t}},{key:"clearContent",value:function(){this.removeAllDOMChildren()}},{key:"load",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=arguments.length>1?arguments[1]:void 0;if(this.showingError=!1,""===this.pathname)return this.clearContent(),void this.createContent({});t&&(this.clearContent(),this.element.appendChild(this.loadingMsg));var i=(0,d.Ie)(this.params);this.fetchData("".concat(this.pathname,"?").concat(i)).then((function(i){var o;try{o=e.parseData(i.responseText)}catch(t){return e.showErrorMessage(),void error("Error parsing response from resource",{path:e.pathname,reason:t.toString()})}t&&e.loadingMsg.parentElement===e.element&&e.element.removeChild(e.loadingMsg),e.clearContent(),e.createContent(o),void 0!==n&&n()})).catch((function(t){error("Fetch data error",{pathname:e.pathname,reason:t.toString()}),e.showErrorMessage()}))}},{key:"fetchData",value:function(e){return(0,l.Ue)(e)}},{key:"showErrorMessage",value:function(){this.clearContent(),this.showingError=!0,this.element.appendChild(this.errorMsg)}},{key:"showLoadingMessage",value:function(){this.clearContent(),this.element.appendChild(this.loadingMsg)}},{key:"show",value:function(e,t){this.showing=!0,this.element.style.display="",this.load(!0,t)}},{key:"hide",value:function(){this.showing=!1,this.element.style.display="none"}}]),h}(c.w)},8959:function(e,t,n){"use strict";n.d(t,{u:function(){return O},Z:function(){return B}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(1185),u=n(6429),d=n(3753),h=n(8824),f=n(6181),p=n(8263),m=n(6422),v=n(3543),g=n(1289),y=n(2750),b=n(2890),w=n(4649),C=n(2080),x=n(8785),k=n(9165);function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(t);try{for(r.s();!(o=r.n()).done;){var s,a,l=o.value;l.children[0].dataset.testid="bio-tab-interested-in-".concat(null===(s=l.lastChild)||void 0===s||null===(s=s.nodeValue)||void 0===s?void 0:s.toLowerCase(),"-container"),l.children[0].children[0].dataset.testid="bio-tab-interested-in-".concat(null===(a=l.lastChild)||void 0===a||null===(a=a.nodeValue)||void 0===a?void 0:a.toLowerCase())}}catch(e){r.e(e)}finally{r.f()}}},{key:"placeSubgenderField",value:function(){var e=this.getField("gender"),t=this.getField("subgender");if(void 0!==e&&void 0!==t){var n=e.getField().querySelector("td"),i=t.getField().querySelector("td");null!==n&&null!==i&&i.childNodes.forEach((function(e){return n.appendChild(e)}))}}},{key:"createPicsAndVideos",value:function(){var e=document.createElement("div");e.style.paddingTop="9px";var t=document.createElement("a"),n=document.createElement("a"),i=document.createElement("a");if(t.innerText=v.ag.uploadNewPics,t.href=(0,d.BN)("/photo_videos/photoset/create/"),t.onclick=function(e){e.preventDefault(),(0,y.Pv)(t.href,"_blank",y.jZ)},n.innerText=v.ag.uploadNewVideos,n.href=(0,d.BN)("/photo_videos/photoset/create/video/"),n.target="_blank",n.onclick=function(e){e.preventDefault(),(0,y.Pv)(n.href,"_blank",y.jZ)},i.innerText=v.ag.managePhotoSet,i.href=(0,d.BN)("/photo_videos/photoset/list_popup/".concat(this.roomName,"/")),i.onclick=function(e){e.preventDefault(),(0,y.Pv)(i.href,"_blank",y.jZ)},this.canUpload)e.appendChild(t),e.appendChild(this.createSeparator()),e.appendChild(n);else{var o=document.createElement("span");o.style.fontSize="14px",o.style.color="black",o.innerHTML=v.ag.mustBeAgeVerifiedToUploadContent(),e.appendChild(o)}return e.appendChild(this.createSeparator()),e.appendChild(i),e}},{key:"createSeparator",value:function(){var e=document.createElement("span");return(0,c.vP)(e,"separator"),e.style.fontSize="12px",e.innerText=" | ",e}}]),n}(u.Q),M=function(e){(0,s.Z)(n,e);var t=P(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"styleField",value:function(e){(0,r.Z)((0,l.Z)(n.prototype),"styleField",this).call(this,e),(0,c.FU)(e,"field"),(0,c.vP)(e,"fieldInput")}}]),n}(x.rk),A=function(e){(0,s.Z)(n,e);var t=P(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"styleField",value:function(e){(0,r.Z)((0,l.Z)(n.prototype),"styleField",this).call(this,e),e.style.width=""}}]),n}(M),E=function(e){(0,s.Z)(n,e);var t=P(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"styleField",value:function(e){(0,c.vP)(e,"fieldInput")}}]),n}(M);var B="RefreshBroadcastBioTabSocialMedia",O=function(e){(0,s.Z)(w,e);var t,n,f=(t=w,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function w(e,t,n){var o;return(0,i.Z)(this,w),(o=f.call(this)).isAgeVerified=t,o.canUpload=n,o.state=0,o.editQueryChecked=!1,window[B]=function(){o.load(!1)},window.RefreshBroadcastBioTabPicsAndVideo=function(){o.load(!1)},o.element.id="tabs_content_container",o}return(0,o.Z)(w,[{key:"load",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=arguments.length>1?arguments[1]:void 0;(0,r.Z)((0,l.Z)(w.prototype),"load",this).call(this,t,(function(){void 0!==n&&n(),e.editQueryChecked||(e.editQueryChecked=!0,"bio"===(0,g.dD)(window.location.search).edit&&e.setState(1))}))}},{key:"show",value:function(){this.element.style.display="",this.element.style.margin="0 0 14px",this.showingError&&this.load(),this.repositionChildren()}},{key:"hide",value:function(){this.element.style.display="none"}},{key:"parseData",value:function(e){return 0===this.state?(0,h.rv)(e,this.room):u.R.parseData(e)}},{key:"createContent",value:function(e){0===this.state?this.createBioContents(e):1===this.state&&this.createEditBio(e)}},{key:"createEditBio",value:function(e){var t=this;this.createPreHeaderContent();var n=new R(e,"api/ts/accounts/editbio/",{onSubmitSuccess:function(e){b.xF.fire({gender:String(e.get("gender")),subgender:String(e.get("subgender"))}),t.setState(0)}},this.room,this.canUpload);this.element.appendChild(n.element),n.focusFirstField()}},{key:"createSeparator",value:function(){var e=document.createElement("span");return(0,c.vP)(e,"separator"),e.style.fontSize="14px",e.innerText=" | ",e}},{key:"generateSocialMediaSection",value:function(e,t){var n=(0,r.Z)((0,l.Z)(w.prototype),"generateSocialMediaSection",this).call(this,e,t);return this.isAgeVerified||n.querySelectorAll(".socialMediaUpload").forEach((function(e){e.style.opacity="0.6"})),n}},{key:"generateSocialMediaLinks",value:function(e,t){var n=(0,r.Z)((0,l.Z)(w.prototype),"generateSocialMediaLinks",this).call(this,e,t);if(t&&n.appendChild(this.createSeparator()),this.isAgeVerified){var i=document.createElement("a");(0,c.vP)(i,c.ql.hrefColor),i.href=(0,d.BN)("/socials/social_media/create/"),i.onclick=function(e){e.preventDefault(),(0,y.Pv)(i.href,"_blank",y.jZ)},i.innerText=v.ag.addNewSocialMedia,i.style.fontSize="14px",n.appendChild(i)}else{var o=document.createElement("span");o.style.fontSize="14px",o.innerHTML=v.ag.mustBeAgeVerifiedToAddSocialMedia(),n.appendChild(o)}return n}},{key:"generatePicsLinks",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"photo",i=document.createElement("div");if(t){var o=(new m.dM).anchor,r="/photo_videos/photoset/list_popup/".concat(e,"/");(0,c.vP)(o,c.ql.hrefColor),o.href=(0,d.BN)(r),o.innerText=v.ag.showMoreText,o.style.fontSize="14px",o.style.cursor="pointer",(0,p.pY)(o),o.onclick=function(e){e.preventDefault(),(0,y.Pv)(o.href,"_blank",y.jZ)},i.appendChild(o),i.appendChild(this.createSeparator())}var s=function(e,t){var n=document.createElement("a");return(0,c.vP)(n,c.ql.hrefColor),n.href=(0,d.BN)(t),n.onclick=function(e){e.preventDefault(),(0,y.Pv)(n.href,"_blank",y.jZ)},n.innerText=e,n.style.fontSize="14px",n};if(this.canUpload)"photo"===n?i.appendChild(s(v.ag.uploadNewPics,"/photo_videos/photoset/create/")):i.appendChild(s(v.ag.uploadNewVideos,"/photo_videos/photoset/create/video/"));else{var a=document.createElement("span");a.style.fontSize="14px",a.innerHTML=v.ag.mustBeAgeVerifiedToUploadContent(),i.appendChild(a)}return i}},{key:"handlePictureClick",value:function(e,t,n){e.preventDefault(),(0,y.Pv)(n,"_blank",y.jZ)}},{key:"createFollowersSection",value:function(e){var t='').concat(isNaN(e)?"0":e.toString(),"");return this.createSection(v.ag.followersText,t,!0)}},{key:"shouldShowSocialMediaSection",value:function(e){return!0}},{key:"shouldShowPicsSection",value:function(e){return!0}},{key:"createBioContents",value:function(e){this.createPreHeaderContent(),(0,r.Z)((0,l.Z)(w.prototype),"createBioContents",this).call(this,e,this.canUpload)}},{key:"createPreHeaderContent",value:function(){var e=this;if(0===this.state){var t=document.createElement("a");this.element.appendChild(t),t.style.cursor="pointer",t.style.display="inline-block",t.style.margin="14px 14px 0",t.innerText=v.ag.editYourBio,t.className="editbio",t.onclick=function(t){e.setState(1)}}else if(1===this.state){var n=document.createElement("a");this.element.appendChild(n),n.style.cursor="pointer",n.style.display="inline-block",n.style.margin="14px 14px 0",n.innerText=v.ag.cancelText,n.onclick=function(t){e.setState(0)}}}},{key:"setState",value:function(e){0===e?(this.state=0,this.setResourceUrl("api/biocontext/".concat(this.room,"/")),this.load(!1)):1===e&&(this.state=1,this.setResourceUrl("api/ts/accounts/editbio/"),this.load(!1))}},{key:"fetchData",value:function(e){return 0===this.state||1===this.state?(0,d.Ue)(e):(0,r.Z)((0,l.Z)(w.prototype),"fetchData",this).call(this,e)}}]),w}(f.q)},2394:function(e,t,n){"use strict";n.d(t,{N2:function(){return d},Ru:function(){return u},pn:function(){return a}});var i=n(8759),o=n(3705),r=n(3543),s=[[640,360],[960,540],[1280,720]];function a(e,t){return void 0===t&&(t=200),e.forEach((function(e){e.stop()})),new Promise((function(e){window.setTimeout((function(){e()}),t)}))}function l(e){return"Invalid constraint"===e.message||"OverconstrainedError"===e.name||"NotReadableError"===e.name}function c(e,t,n){if(!(0,i.Tt)()||!(0,i.G6)()||960!==t||540!==n){var o=t/n,r=o>1.4,s=n>=720;return{id:"".concat(t,"x").concat(n),camId:e,label:"".concat(t," x ").concat(n),width:t,height:n,ratio:o,isWidescreen:r,isHD:s}}}function u(e,t){return new Promise((function(n,i){var u="DevicePermsOnLoadGranted",d="DevicePermsOnLoadDenied",h="PermanentDevicePermsOnLoadDenied",f=Date.now();window.setTimeout((function(){u="DevicePermsRequestGranted",d="DevicePermsRequestDenied",h="PermanentDevicePermsRequestDenied"}),1e3),navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then((function(d){a(d.getTracks(),t).then((function(){navigator.mediaDevices.enumerateDevices().then((function(t){var d=Promise.all(t.map((function(t){if("videoinput"===t.kind){if(void 0!==e&&e)return(i=t.deviceId,new Promise((function(e,t){(function(e){return new Promise((function(t,n){navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:{exact:e}}}).then((function(e){var n;e.getTracks().forEach((function(e){void 0===n&&void 0!==e.getCapabilities&&(n=e.getCapabilities())})),a(e.getTracks()).then((function(){t(n)})).catch((function(){}))})).catch((function(e){l(e)?t(void 0):n(e)}))}))})(i).then((function(t){var n,o,r=!1;void 0!==t&&void 0!==t.width&&void 0!==t.height&&(n=[t.width.max,t.height.max],void 0!==t.resizeMode&&(r=t.resizeMode.some((function(e){return"crop-and-scale"===e})))),o=r&&void 0!==n?s.map((function(e){return new Promise((function(t){var i=e[0],o=e[1];void 0!==n&&i<=n[0]&&o<=n[1]?t([i,o]):t(void 0)}))})):s.map((function(e){var t=e[0],n=e[1],o={audio:!1,video:{deviceId:{exact:i},width:{exact:t},height:{exact:n}}};return new Promise((function(e,i){navigator.mediaDevices.getUserMedia(o).then((function(i){a(i.getTracks()).then((function(){e([t,n])})).catch((function(){}))})).catch((function(t){l(t)?e(void 0):i(t)}))}))}));var u=o.reduce((function(e,t){return e.then((function(e){return t.then((function(t){return void 0!==t&&e.push(t),Promise.resolve(e)})).catch((function(){return[]}))}))}),Promise.resolve([]));Promise.resolve(u).then((function(t){void 0!==n&&s.some((function(e){return void 0!==n&&e[0]===n[0]&&e[1]===n[1]}))&&t[t.length-1][0]!==n[0]&&t[t.length-1][1]!==n[1]&&t.push(n);var o=new Map;t.forEach((function(e){var t=c(i,e[0],e[1]);void 0!==t&&o.set(t.id,t)})),e(o)})).catch((function(){}))})).catch((function(e){t(e)}))}))).then((function(e){return Promise.resolve({device:t,resolutions:e})})).catch((function(e){return Promise.reject(e)}));var n=new Map;return s.forEach((function(e){var i=c(t.deviceId,e[0],e[1]);void 0!==i&&n.set(i.id,i)})),Promise.resolve({device:t,resolutions:n})}var i;return Promise.resolve({device:t})}))),p={mics:new Map,cams:new Map};d.then((function(e){var t=!0;if(e.forEach((function(e){var n=e.device;""!==n.label&&(t=!1),"audioinput"===n.kind?p.mics.set(n.deviceId,{id:n.deviceId,label:n.label}):"videoinput"===n.kind&&void 0!==e.resolutions&&e.resolutions.size>0&&p.cams.set(n.deviceId,{id:n.deviceId,label:n.label,resolutions:e.resolutions})})),t){var s=r.ag.permanentPermsMessage;return(0,o.fg)(h,{time_elapsed_ms:Date.now()-f}),void i(new Error(s))}(0,o.fg)(u,{time_elapsed_ms:Date.now()-f}),n(p)})).catch((function(e){i(e)}))})).catch((function(){}))})).catch((function(){}))})).catch((function(e){(0,o.fg)(d,{time_elapsed_ms:Date.now()-f}),i(e)}))}))}function d(){return navigator.mediaDevices.enumerateDevices().then((function(e){var t=!1,n=!1;return e.forEach((function(e){""!==e.label&&("audioinput"===e.kind&&(t=!0),"videoinput"===e.kind&&(n=!0))})),t&&n}))}},2400:function(e,t,n){"use strict";n.d(t,{m:function(){return o}});var i=n(3753),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};(0,i.Ue)("api/ts/accounts/broadcaster_suspension/").then((function(t){JSON.parse(t.responseText).is_suspended?window.location.reload():e()})).catch((function(e){error(e.message)}))}},1903:function(e,t,n){"use strict";n.d(t,{J7:function(){return d},WQ:function(){return o},cO:function(){return u}});var i=n(3543);function o(e){var t=function(e){return e>1?"s":""},n=Math.floor(e/3600),i=Math.floor((e%=3600)/60),o=e%60;return n>0?i>0?"".concat(n," hour").concat(t(n),", ").concat(i," minute").concat(t(i)):"".concat(n," hour").concat(t(n)):i>0?o>0?"".concat(i," minute").concat(t(i),", ").concat(o," second").concat(t(o)):"".concat(i," minute").concat(t(i)):o>0?"".concat(o," second").concat(t(o)):"less than a second"}var r=[{name:"year",seconds:31536e3,translation:i.ag.years,ago:i.ag.yearsAgo,fromNow:i.ag.yearsFromNow},{name:"month",seconds:2592e3,translation:i.ag.months,ago:i.ag.monthsAgo,fromNow:i.ag.monthsFromNow},{name:"week",seconds:604800,translation:i.ag.weeks,ago:i.ag.weeksAgo,fromNow:i.ag.weeksFromNow},{name:"day",seconds:86400,translation:i.ag.days,ago:i.ag.daysAgo,fromNow:i.ag.daysFromNow},{name:"hour",seconds:3600,translation:i.ag.hours,ago:i.ag.hoursAgo,fromNow:i.ag.hoursFromNow},{name:"minute",seconds:60,translation:i.ag.minutes,ago:i.ag.minutesAgo,fromNow:i.ag.minutesFromNow},{name:"second",seconds:1,translation:i.ag.seconds,ago:i.ag.secondsAgo,fromNow:i.ag.secondsFromNow}],s=r.findIndex((function(e){return"hour"===e.name})),a=r.findIndex((function(e){return"minute"===e.name})),l=function(e){return 1===e?"":arguments.length>1&&void 0!==arguments[1]?arguments[1]:"s"},c=function(e){return e?"from now":"ago"};function u(e,t){var n=t.getTime()-e.getTime();if(0===n)return"now";var i=Math.floor(Math.abs(n)/1e3),o=n>0;if(i<60)return"".concat(i," second").concat(l(i)," ").concat(c(o));var s,a=0,u=0,d="";for(s=0;s86400&&s+1=o.seconds)return o.ago(Math.floor(t/o.seconds))}return i.ag.now}(n):function(e){for(var t=((new Date).getTime()-e.getTime())/1e3,n=function(e){var n,i=t/r[e].seconds;i=e===s?(n=i,Math.floor(10*n)/10):Math.floor(i);var o=e===s||e===a;return r[e].translation(i,o)},i=0;i<=a;i+=1)if(t>=r[i].seconds)return n(i);return n(a)}(n)}},2890:function(e,t,n){"use strict";n.d(t,{ry:function(){return o},xF:function(){return s},xJ:function(){return r}});var i=n(1794),o=new i.xB("privateSettingsClicked"),r=new i.xB("broadcastSettingsSaved"),s=new i.xB("genderSettingsSaved")},1986:function(e,t,n){"use strict";n.d(t,{nC:function(){return N},OO:function(){return H},QU:function(){return j},uT:function(){return z}});for(var i=n(4649),o=n(1976),r=n(2951),s=n(7591),a=n(9492),l=n(7597),c=n(434),u=n(3940),d=n(8759),h=n(9784),f=n(3753),p=n(2394),m=n(3705),v=[],g=0;g<256;++g)v[g]=(g+256).toString(16).substr(1);var y=n(1522),b=n(1794),w=n(5078),C=n(3543),x=n(8498),k=n(1289),S={v:[{name:"version",reg:/^(\d*)$/,fmt:"%s"}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,fmt:"%s %s %d %s IP%d %s",names:["username","sessionId","sessionVersion","netType","ipVer","address"]}],s:[{name:"name",reg:/(.*)/,fmt:"%s"}],i:[{name:"description",reg:/(.*)/,fmt:"%s"}],u:[{name:"uri",reg:/(.*)/,fmt:"%s"}],e:[{name:"email",reg:/(.*)/,fmt:"%s"}],p:[{name:"phone",reg:/(.*)/,fmt:"%s"}],z:[{name:"timezones",reg:/(.*)/,fmt:"%s"}],r:[{name:"repeats",reg:/(.*)/,fmt:"%s"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,fmt:"%d %d",names:["start","stop"]}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,fmt:"IN IP%d %s",names:["version","ip"]}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,fmt:"%s:%s",names:["type","limit"]}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,fmt:"%s %d %s %s",names:["type","port","protocol","payloads"]}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],fmt:function(e){return void 0!==e.encoding?"rtpmap:%d %s/%s/%s":void 0!==e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],fmt:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,fmt:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],fmt:function(e){return void 0!==e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],fmt:"rtcp-fb:%d trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],fmt:function(e){return void 0!==e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],fmt:function(e){return"extmap:%d"+(void 0!==e.direction?"/%s":"%v")+(void 0!==e["encrypt-uri"]?" %s":"%v")+" %s"+(void 0!==e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/,fmt:"%s"},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],fmt:function(e){return void 0!==e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,fmt:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,fmt:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,fmt:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,fmt:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*)/,fmt:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*)/,fmt:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/,fmt:"%s"},{name:"icelite",reg:/^(ice-lite)/,fmt:"%s"},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,fmt:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,fmt:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],fmt:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],fmt:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=void 0!==e.raddr?" raddr %s rport %d":"%v%v",t+=void 0!==e.tcptype?" tcptype %s":"%v",void 0!==e.generation&&(t+=" generation %d"),(t+=void 0!==e["network-id"]?" network-id %d":"%v")+(void 0!==e["network-cost"]?" network-cost %d":"%v")}},{name:"endOfCandidates",reg:/^(end-of-candidates)/,fmt:"%s"},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,fmt:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,fmt:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],fmt:function(e){var t="ssrc:%d";return void 0!==e.attribute&&(t+=" %s",void 0!==e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],fmt:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],fmt:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],fmt:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/,fmt:"%s"},{name:"rtcpRsize",reg:/^(rtcp-rsize)/,fmt:"%s"},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],fmt:function(e){return void 0!==e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,fmt:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],fmt:function(e){return void 0!==e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],fmt:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~,]+))?$"),names:["dir1","list1","dir2","list2"],fmt:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],fmt:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,fmt:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],fmt:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/,fmt:"%s"},{name:"label",reg:/^label:(.+)/,fmt:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,fmt:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,fmt:"max-message-size:%s"},{name:"keywords",reg:/^keywds:(.+)$/,fmt:"keywds:%s"},{name:"content",reg:/^content:(.+)/,fmt:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,fmt:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,fmt:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,fmt:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],fmt:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"],reg:/(.*)/,fmt:"%s"}]},T=/(\r\n|\r|\n)/,I=/%[sdv%]/g,P=RegExp.prototype.test.bind(/^([a-z])=(.*)/),R=function(e){var t=1,n=arguments,i=n.length;return e.replace(I,(function(e){if(t>=i)return e;var o=n[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(o);case"%d":return String(Number(o));case"%v":return""}return""}))},M=function(e,t,n){var i=t.fmt;if("function"==typeof t.fmt){var o=n;void 0===t.push&&void 0!==t.name&&(o=n[t.name]),i=t.fmt(o)}var r=["".concat(e,"=").concat(i)];if(void 0!==t.names)for(var s=0;s0&&void 0!==l&&(s=l.split(",")),this.forceVideoCodecs(a,s),this.videoCodecsOverriden=!0}}return(0,o.Z)(e,[{key:"write",value:function(){return function(e,t){void 0===t&&(t={outerOrder:E,innerOrder:B}),void 0===e.version&&(e.version=0),void 0===e.name&&(e.name=" "),e.media.forEach((function(e){void 0===e.payloads&&(e.payloads="")}));var n=[];return t.outerOrder.forEach((function(t){S[t].forEach((function(i){void 0!==i.name&&i.name in e&&void 0!==e[i.name]?n.push(M(t,i,e)):void 0!==i.push&&i.push in e&&void 0!==e[i.push]&&e[i.push].forEach((function(e){n.push(M(t,i,e))}))}))})),e.media.forEach((function(e){n.push(M("m",S.m[0],e)),void 0!==t&&t.innerOrder.forEach((function(t){S[t].forEach((function(i){void 0!==i.name&&i.name in e&&void 0!==e[i.name]?n.push(M(t,i,e)):void 0!==i.push&&i.push in e&&void 0!==e[i.push]&&e[i.push].forEach((function(e){n.push(M(t,i,e))}))}))}))})),n.join("\r\n")+"\r\n"}(this.sdp)}},{key:"forceVideoBitrate",value:function(e){var t=this;if(!this.videoBitrateOverriden){var n=this.videoBitrate(e);return this.sdp.media.forEach((function(e){"video"===e.type&&t.addBitrates(n,e,O)})),n}}},{key:"forceVideoCodecs",value:function(e,t){var n=this;this.videoCodecsOverriden||this.sdp.media.forEach((function(i){"video"===i.type&&n.filterCodecs(e,i,O,t)}))}},{key:"videoBitrate",value:function(e){var t=1500;return void 0!==e&&(e<=360?t=800:e>540&&(t=3e3)),t}},{key:"addBitrates",value:function(e,t,n){var i=this.findCodecs(n,t),o=[];return i.forEach((function(t){o.push({payload:t,config:"x-google-min-bitrate=".concat(e)}),o.push({payload:t,config:"x-google-max-bitrate=".concat(e)})})),t.fmtp=t.fmtp.concat(o),e}},{key:"filterCodecs",value:function(e,t,n,i){var o=this,r=this.findCodecs(n,t),s=this.findCodecs(e,t,i);t.rtp.filter((function(e){return r.some((function(t){return t===e.payload}))&&!s.some((function(t){return t===e.payload}))})).map((function(e){return e.payload})).forEach((function(e){o.removeCodec(e,t)}))}},{key:"findCodecs",value:function(e,t,n){var i,o=t.rtp.filter((function(t){var n=e.some((function(e){return e.toUpperCase()===t.codec.toUpperCase()}));return n&&"VP8"===t.codec.toUpperCase()&&(i=t.payload),n})).map((function(e){return e.payload}));if(void 0!==n){var r=["profile-level-id=","profile-id="],s=t.fmtp.filter((function(e){if(o.some((function(t){return t===e.payload}))){var t=!1;return e.config.split(";").forEach((function(e){r.forEach((function(i){if(e.startsWith(i)){var o=e.split(i)[1].toUpperCase();n.some((function(e){return e.toUpperCase()===o}))&&(t=!0)}}))})),t}return!1})).map((function(e){return e.payload}));void 0!==i&&o.some((function(e){return e===i}))&&s.unshift(i),o=s}return o}},{key:"removeCodec",value:function(e,t){var n=this,i="apt=",o=t.payloads.split(" ");o=o.filter((function(t){return parseInt(t)!==e})),t.payloads=o.join(" "),t.rtp=t.rtp.filter((function(t){return t.payload!==e}));var r=t.rtcpFb;void 0!==r&&(t.rtcpFb=r.filter((function(t){return t.payload!==e}))),t.fmtp=t.fmtp.filter((function(t){return t.payload!==e})),t.fmtp.filter((function(t){var n=t.config;if(n.startsWith(i)){var o=n.split(i)[1];if(parseInt(o)===e)return!0}return!1})).map((function(e){return e.payload})).forEach((function(e){n.removeCodec(e,t)}))}}]),e}(),D=n(2400);function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&(this.stream.getAudioTracks()[0].enabled=!e):error("no stream")}},{key:"reset",value:function(){var e=this;return new Promise((function(t,n){var i=e.started;e.stop().then((function(){void 0!==e.constraints?e.setup(e.constraints).then((function(o){i?e.start().then((function(){t()})).catch((function(e){n(e)})):t()})).catch((function(e){n(e)})):t()})).catch((function(e){n(e)}))}))}},{key:"close",value:function(){this.closed=!0,void 0!==this.updateStatusInterval&&(clearInterval(this.updateStatusInterval),this.updateStatusInterval=void 0)}},{key:"updateStatus",value:function(){var e=this;if(!0!==this.closed){var t=Date.now();if(this.lastStreamInfoMessage0&&this.peerConnection.addTrack(this.stream.getAudioTracks()[0],this.stream),this.peerConnection.addTrack(this.stream.getVideoTracks()[0],this.stream),this.peerConnection.createOffer().then((function(t){e.updateSDP(t.sdp)})).catch((function(){}))):error("no stream")}},{key:"connectOrigin",value:function(e,t){var n=this;void 0!==this.websocket&&(error("WebSocket already open"),this.websocket.close(),this.websocket=void 0);var i=new WebSocket("wss://".concat(e.originHost).concat(e.originWSEndpoint));i.binaryType="arraybuffer",i.onopen=function(){n.websocket=i,i.send(JSON.stringify({method:"connect",username:e.room,password:e.originPassword}))},i.onerror=function(e){error("webrtc websocket error",{error:e}),t(new Error("WebSocket error: ".concat(JSON.stringify(e))))},i.onclose=function(){n.websocket=void 0},i.onmessage=function(e){var i;try{i=JSON.parse(e.data)}catch(e){return}switch(i.method){case"auth_valid":n.createOffer(t);break;case"stream_info":n.streamData=i,n.lastStreamInfoMessage=Date.now();break;case"already_publishing":n.lastMessage=Date.now(),(0,y.Cj)("You have started publishing from a new location, shutting down stream",(function(){w.u.fire(""),x.B.fire("")})),n.stop();break;case"shutdown":n.lastMessage=16?{width:n,height:t}:{width:t,height:n}}},{key:"createOffer",value:function(e){var t=this;void 0!==this.websocket?void 0!==this.stream?(this.websocket.send(JSON.stringify(function(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(i);try{for(r.s();!(o=r.n()).done;){var s=o.value;debug("iceCandidates: ",s),this.peerConnection.addIceCandidate(new RTCIceCandidate(s)).catch((function(e){t(e)}))}}catch(e){r.e(e)}finally{r.f()}}}else error("peerConnection not open")}},{key:"updateSDP",value:function(e){if(void 0===e)return error("sdpStr undefined"),"";debug("Original SDP",e);var t=new L(e);(0,d.Tt)()?t.forceVideoCodecs(["H264"],["42e01f"]):t.forceVideoCodecs(["H264","VP8"],["42e01f"]);var n=t.forceVideoBitrate(this.streamSettings.height);return void 0!==n&&(this.bitrateNRSent||((0,m.fg)("WebRTCHandlerSDPUpdate",{WebRTCHandlerVideoBitrate:n}),this.bitrateNRSent=!0)),e=t.write(),debug("Updated SDP",e),e}}],[{key:"isWebRTCNotYetSupported",value:function(){return(0,d.v8)()}},{key:"isWebRTCNeverSupported",value:function(){return(0,d.bf)()}},{key:"canUseWebRTC",value:function(){return!e.isWebRTCNotYetSupported()&&!e.isWebRTCNeverSupported()}}]),e}(),j=new b.xB("streamStatusUpdate"),H=new b.xB("streamStart"),z=new b.xB("streamStop")},4406:function(e,t,n){"use strict";n.d(t,{x:function(){return a}});var i=n(2951),o=n(1976),r=n(8263),s=["smcBadge","followerBadge","notesBadge"],a=function(){function e(){(0,i.Z)(this,e)}return(0,o.Z)(e,null,[{key:"registerGenerator",value:function(t,n){e.badgeGenerators.has(t)?error("Generator already registered for badge",t):e.badgeGenerators.set(t,n)}},{key:"createBadges",value:function(t){var n=document.createElement("span");return(0,r.Zs)(n,{display:"inline-block",verticalAlign:"middle",marginTop:"-.5em",marginBottom:"-.5em",marginRight:"1px",overflow:"visible"}),s.forEach((function(i){var o=e.badgeGenerators.get(i);if(void 0!==o){var r=o(t);r.classList.add("".concat(i,"_").concat(t)),n.appendChild(r)}})),n}},{key:"getBadgeElements",value:function(e,t){return Array.from(document.body.querySelectorAll(".".concat(e,"_").concat(t)))}}]),e}();a.badgeGenerators=new Map},6626:function(e,t,n){"use strict";n.d(t,{Ds:function(){return l},v:function(){return c}});var i=n(2800),o=n(8069),r=n(3705),s=!0,a=new o.d((function(){void 0===i.J.current.loggedInUser&&(0,r.fg)("AnonChatInputFocused")}),{bounceLimitMS:1500,debounceType:0}),l=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!0===s&&(a.callFunc(),!0!==e&&(s=!1))},c=function(){s=!0}},2008:function(e,t,n){"use strict";n.d(t,{P:function(){return k},T:function(){return S}});var i=n(2951),o=n(1976),r=n(7169),s=n(7591),a=n(9492),l=n(7597),c=n(5925),u=n(1185),d=n(2906),h=n(7693),f=n(1522),p=n(3753),m=n(391),v=n(695),g=n(9),y=n(1794),b=n(3543);function w(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return C(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)?C(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0?{inappropriate:b.ag.reportMessageInappropriate,rude:b.ag.reportMessageRudeToBcaster,spam:b.ag.reportMessageSpam,photo:b.ag.reportMessageOffensiveMedia,other:b.ag.reportMessageOther}:{inappropriate:b.ag.reportMessageInappropriate,rude:b.ag.reportMessageRudeToBcaster,spam:b.ag.reportMessageSpam,other:b.ag.reportMessageOther}}},{key:"additionalFinishReportLinks",value:function(){return[]}},{key:"showEndReportScreen",value:function(){var e=this.element.offsetWidth,t=this.element.offsetHeight;this.form.style.display="none",this.finishReportScreenDiv.style.display="block",this.finishReportScreenDiv.style.width="".concat(e,"px"),this.finishReportScreenDiv.style.height="".concat(t,"px");var n=this.finishReportContainer.offsetHeight;this.finishReportContainer.style.padding="".concat(t/2-n/2,"px 0 0"),this.isOnEndScreen=!0}},{key:"reportEndpoint",value:function(){return void 0===this.message?(error("ChatReport error: expected reportEndpoint override"),""):"chatmessages/report/".concat(this.message.messageID,"/")}},{key:"sendReport",value:function(){var e=this;return new Promise((function(t,i){var o=void 0===e.activeRadioInput?"":e.activeRadioInput.value,r=e.commentInput.value;return(0,p.I5)(e.reportEndpoint(),{spammer:e.username,category:o,additional_comments:r}).then((function(e){t(n.parseAbuseReportResult(e.responseText))})).catch((function(e){i(e)}))}))}},{key:"resetForm",value:function(){this.form.reset()}},{key:"createFinishReportScreen",value:function(){var e=this;this.finishReportScreenDiv=document.createElement("div"),this.finishReportContainer=document.createElement("div"),this.userReportedMessage=document.createElement("div"),this.ignoreUserLink=document.createElement("button");var t=this.additionalFinishReportLinks(),n=document.createElement("button");this.endScreenFocusableElements.push(this.ignoreUserLink);var i,o=w(t);try{for(o.s();!(i=o.n()).done;){var r=i.value;this.endScreenFocusableElements.push(r)}}catch(e){o.e(e)}finally{o.f()}this.endScreenFocusableElements.push(n),this.userReportedMessage.innerText=b.ag.sending,this.userReportedMessage.style.margin="0 0 8px 0",this.userReportedMessage.style.textAlign="center",(0,u.vP)(this.ignoreUserLink,"ignoreUserLink"),(0,u.vP)(n,"closeReportLink"),this.ignoreUserLink.style.textAlign="center",this.ignoreUserLink.style.fontSize="13px",this.ignoreUserLink.style.display="block",this.ignoreUserLink.style.margin="0 auto 8px",this.ignoreUserLink.style.background="none",this.ignoreUserLink.style.border="none",this.ignoreUserLink.style.cursor="pointer",this.updateIgnoreText((0,c.WU)(this.username));var s,a=w(t);try{for(a.s();!(s=a.n()).done;){var l=s.value;l.style.textAlign="center",l.style.fontSize="13px",l.style.display="block",l.style.margin="0 auto 8px",l.style.background="none",l.style.border="none",l.style.cursor="pointer"}}catch(e){a.e(e)}finally{a.f()}n.innerText=b.ag.close,n.style.textAlign="center",n.style.fontSize="13px",n.style.display="block",n.style.margin="0 auto 8px",n.style.background="none",n.style.border="none",n.style.cursor="pointer",this.underlineOnHover(n),this.finishReportScreenDiv.style.display="none",this.finishReportContainer.style.fontSize="13px",this.finishReportContainer.style.fontFamily="Arial, Helvetica, sans-serif",this.finishReportContainer.appendChild(this.userReportedMessage),this.shouldShowIgnore()&&this.finishReportContainer.appendChild(this.ignoreUserLink);var d,f=w(t);try{for(f.s();!(d=f.n()).done;){var p=d.value;this.finishReportContainer.appendChild(p)}}catch(e){f.e(e)}finally{f.f()}this.finishReportContainer.appendChild(n),this.finishReportScreenDiv.appendChild(this.finishReportContainer),(0,h.j9)("click",n,(function(t){t.preventDefault(),e.onChatReportClosed(!0)}))}},{key:"setEndScreenText",value:function(e){this.userReportedMessage.innerText=e}},{key:"disableIgnoreTextInteraction",value:function(){this.ignoreUserLink.disabled=!0,this.ignoreUserLink.style.cursor="default",this.ignoreUserLink.style.textDecoration="none",this.ignoreUserLink.onmouseenter=function(){},this.ignoreUserLink.onmouseleave=function(){},this.ignoreUserLink.onclick=function(){},(0,u.vP)(this.ignoreUserLink,"disabled");var e=this.endScreenFocusableElements.indexOf(this.ignoreUserLink);-1!==e&&this.endScreenFocusableElements.splice(e,1),this.ignoreUserLink.blur()}},{key:"focusNextElement",value:function(e,t){if(document.activeElement instanceof HTMLElement){var n,i=e.indexOf(document.activeElement);-1!==i?(t?(n=i-1)<0&&(n+=e.length):n=(i+1)%e.length,e[n].focus()):this.focusForm()}else this.focusForm()}},{key:"updateIgnoreText",value:function(e){var t=this;e?(this.ignoreUserLink.innerText=b.ag.userIsIgnored(this.username),this.disableIgnoreTextInteraction()):(this.ignoreUserLink.innerText=b.ag.ignoreUser(this.username),(0,u.FU)(this.ignoreUserLink,"disabled"),this.underlineOnHover(this.ignoreUserLink),this.ignoreUserLink.disabled=!1,this.ignoreUserLink.onclick=function(){(0,v.Cg)()?t.ignoreUserLink.innerText=b.ag.loginForIgnore:(t.onIgnoreUser(),t.ignoreUserLink.innerText=b.ag.userIsIgnored(t.username),t.ignoreReportedUser.fire(void 0)),t.disableIgnoreTextInteraction()})}},{key:"focusCommentBox",value:function(){this.commentInput.focus()}},{key:"focusForm",value:function(){this.isOnEndScreen?this.endScreenFocusableElements[0].focus():this.formFocusableElements[0].focus()}},{key:"tearDown",value:function(){}},{key:"underlineOnHover",value:function(e){e.onmouseenter=function(){e.style.textDecoration="underline"},e.onmouseleave=function(){e.style.textDecoration="none"}}},{key:"shouldShowIgnore",value:function(){return void 0!==this.chatConnection&&this.chatConnection.username()!==this.chatConnection.room()}},{key:"onIgnoreUser",value:function(){void 0!==this.chatConnection&&this.chatConnection.ignore(this.username)}},{key:"onSendReport",value:function(){this.reportSent.fire(void 0)}},{key:"onChatReportClosed",value:function(e){this.closeChatReportRequest.fire(e)}}],[{key:"parseAbuseReportResult",value:function(e){var t=new m.j(e);return{success:"success"===t.getStringOrUndefined("result"),html:t.getStringOrUndefined("html")}}}]),n}(g.w),S=function(e){(0,s.Z)(n,e);var t=x(n);function n(e,o,r){var s;return(0,i.Z)(this,n),(s=t.call(this,e,o)).ignoreFunc=r,s.element.style.minWidth="188px",s.element.style.maxWidth="268px",(0,h.j9)("pointerdown",s.commentInput,(function(e){return(0,d.o)(e)})),s}return(0,o.Z)(n,[{key:"categories",value:function(){return{inappropriate:b.ag.inappropriateMessage,rude:b.ag.rudeMessage,spam:b.ag.spamMessage,other:b.ag.reportMessageOther}}},{key:"shouldShowIgnore",value:function(){return!0}},{key:"onIgnoreUser",value:function(){this.ignoreFunc()}}]),n}(k)},1602:function(e,t,n){"use strict";n.d(t,{w:function(){return H},y:function(){return j}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(2800),c=n(6265),u=n(9760),d=n(1522),h=n(3753),f=n(391),p=n(8138),m=n(695),v=n(6464),g=n(4793),y=n(9),b=n(1794),w=n(1625),C=n(3340),x=n(3705),k=n(928),S=n(3243),T=n(8759),I=n(6272),P=n(1185),R=n(795),M=n(7693),A=n(3149),E=n(8263),B=n(3607),O=n(7108),L=n(3543),D=n(2974),U=n(9980);function Z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n100&&!o.isHighTipAmountWarningActive)return o.sendTipButton.promptUser(L.ag.tipConfirmationMessage(t)),o.isHighTipAmountWarningActive=!0,void o.repositionChildren();o.tipAmountInput.blur();var n=o.tipMessageTextarea.value;void 0!==o.tipOptionsSelect&&(n=""===o.tipMessageTextarea.value?o.tipOptionsSelect.value:"".concat(o.tipOptionsSelect.value," | ").concat(o.tipMessageTextarea.value)),(0,I.d1)({roomName:o.roomName,tipAmount:o.tipAmountInput.value,message:n,source:o.tipSource,tipRoomType:o.roomType,tipType:o.sendTipButton.getTipType(),videoMode:D.S.getVideoMode()}).then((function(e){e.success?(0,x.fg)("SendTipSuccess",{amount:t,location:"PMTab"}):void 0!==e.error?!0===e.showPurchaseLink?(0,R.dg)("".concat(e.error),!1,l.J.current.PurchaseEventSources.TOKEN_SOURCE_LOW_TOKEN_BALANCE,o.roomType):(0,d.Cj)(e.error):error("unknown send tip error"),o.removeHighTipAmountWarning(),o.tipMessageTextarea.value="",void 0!==e.tipsInPast24Hours&&I.H2.fire({tokens:e.tipsInPast24Hours,roomName:o.roomName}),o.tipSent.fire({amount:t,success:e.success})})).catch((function(e){error("Error sending tip. status: ".concat(e)),(0,d.Cj)(L.ag.errorSendingTip),o.tipSent.fire({amount:t,success:!1})})),o.hide()}})),o.overlayClick.listen((function(){o.hide()})),o.closed.listen((function(){o.sendTipButton.hideMenu()})),o}return(0,o.Z)(u,[{key:"showElement",value:function(){(0,S.Z)((0,a.Z)(u.prototype),"showElement",this).call(this),this.isVisible=!0}},{key:"repositionChildren",value:function(){this.tipMessageDiv.style.width="".concat(Math.max(0,this.element.clientWidth-2*I.Co),"px"),this.ctrlSNotice.style.maxWidth="".concat(Math.max(0,this.element.offsetWidth-this.sendTipButton.getOffsetWidth()-15),"px");var e=(0,E.r7)(this.sendTipButtonSpan);if(this.bottomDivot.style.display="none",this.topDivot.style.display="none",this.leftDivot.style.display="none","fixed"===this.topSectionWrapper.style.position)this.leftDivot.style.display="block",this.element.style.top="".concat(e.top-30,"px"),this.element.style.left="".concat(e.right+12,"px");else{var t=e.left-70,n=Math.max(0,t+this.element.offsetWidth-(0,B._U)()+4);t-n<0&&(n+=t-n),this.element.style.left="".concat(t-n,"px"),(0,T.s2)()||this.element.offsetHeight+e.bottom+20>(0,B.mP)()+document.documentElement.scrollTop?(this.bottomDivot.style.display="block",this.bottomDivot.style.left="".concat(this.divotOffsetLeft+n,"px"),this.element.style.top="".concat(e.top-this.element.offsetHeight-11,"px")):(this.topDivot.style.display="block",this.topDivot.style.left="".concat(this.divotOffsetLeft+n,"px"),this.element.style.top="".concat(e.bottom+14,"px"))}this.overlay.style.height="".concat(document.documentElement.offsetHeight,"px")}},{key:"tipAmountChange",value:function(){/^[1-9]\d*$/.test(this.tipAmountInput.value)?(this.sendTipButton.enable(),this.invalidTipAmountDiv.style.display="none",this.tokenBalance>0&&parseInt(this.tipAmountInput.value)>this.tokenBalance?this.isTokenAmountAlreadyTooHigh||((0,x.fg)("TokenAmountTooHigh"),this.isTokenAmountAlreadyTooHigh=!0):this.isTokenAmountAlreadyTooHigh=!1):(this.sendTipButton.disable(),this.invalidTipAmountDiv.style.display="inline-block"),this.isHighTipAmountWarningActive&&this.removeHighTipAmountWarning()}},{key:"removeHighTipAmountWarning",value:function(){this.sendTipButton.cancelPrompt(),this.isHighTipAmountWarningActive=!1}},{key:"tippingAllowed",value:function(){return this.isAgeVerified?!((0,m.Cg)('You must be logged in to tip. Click "OK" to login.')||l.J.current.isNoninteractiveUser&&((0,d.Cj)(L.ag.internalStaffTip),1)):((0,d.Cj)("This broadcaster doesn't accept tips."),!1)}},{key:"show",value:function(e){var t=this;this.tippingAllowed()&&(void 0!==e.amount&&(this.tipAmountInput.value=e.amount.toString(),this.tipAmountChange()),void 0!==e.message?this.tipMessageTextarea.value=e.message:this.tipMessageTextarea.value="",this.hasLowSatisfactionScore?this.lowScoreWarning.style.display="block":this.lowScoreWarning.style.display="none",void 0!==e.usedCtrlS&&e.usedCtrlS?this.ctrlSNotice.style.display="none":this.ctrlSNotice.style.display="block",(0,R.rv)(this.tipSource,this.sendTipButton),this.showElement(),this.showOverlay(),this.repositionChildren(),this.focusTipAmount(),this.tokenBalanceSpan.innerText="".concat(L.ag.loadingTextLower,"..."),(0,I.yX)(this.roomName).then((function(e){if(t.tipAmountInput.max=e.tokenBalance.toString(),void 0!==e.tipOptions){t.tipMessageLabel.innerText=e.tipOptions.label,void 0!==t.tipOptionsSelect&&t.tipMessageDiv.removeChild(t.tipOptionsSelect),t.tipOptionsSelect=document.createElement("select"),(0,P.vP)(t.tipOptionsSelect,"tipOptionsSelect"),t.tipOptionsSelect.style.width="100%",t.tipOptionsSelect.style.fontSize=".8125em",t.tipOptionsSelect.style.margin="".concat(I.Co,"px"),t.tipOptionsSelect.style.borderWidth="1px",t.tipOptionsSelect.style.borderStyle="solid",t.tipOptionsSelect.style.boxSizing="border-box",t.tipMessageDiv.insertBefore(t.tipOptionsSelect,t.tipMessageTextarea);var n=document.createElement("option");n.innerText="-- ".concat(L.ag.selectOneLabel," --"),t.tipOptionsSelect.appendChild(n);var i,o=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Z(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)?Z(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(e.tipOptions.options);try{for(o.s();!(i=o.n()).done;){var r=i.value;(n=document.createElement("option")).innerText=r.label,n.value=r.label,t.tipOptionsSelect.appendChild(n)}}catch(e){o.e(e)}finally{o.f()}}else void 0!==t.tipOptionsSelect&&(t.tipMessageLabel.innerText=L.ag.defaultTipMessageLabel,t.tipMessageTextarea.value="",t.tipMessageDiv.removeChild(t.tipOptionsSelect),t.tipOptionsSelect=void 0)})).catch((function(e){error("Error getting token balance. status: ".concat(e)),t.tokenBalanceSpan.innerText=L.ag.unknownText})))}},{key:"hide",value:function(){this.element.style.display="none",this.tipAmountInput.blur(),this.hideOverlay(),this.isVisible=!1,this.closed.fire(void 0)}},{key:"setTipButtonSpan",value:function(e){this.sendTipButtonSpan=e}},{key:"focusTipAmount",value:function(){document.activeElement!==this.tipAmountInput&&(this.tipAmountInput.focus(),this.tipAmountInput.setSelectionRange(0,9999))}},{key:"updateTokenBalance",value:function(e){this.tokenBalance=e,this.tokenBalanceSpan.innerText="".concat(e," ").concat(L.ag.tokenOrTokensText(e,!1))}}]),u}(O.B),_=n(758),N=n(2750);var j=new b.xB("dossierLoaded",{listenersWarningThreshold:function(){return 10+b.q6}}),H=function(e){(0,r.Z)(S,e);var t,n,y=(t=S,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function S(e,t){var n;return(0,i.Z)(this,S),(n=y.call(this)).audioHolder=new p.n,n.lastLoadRoomId=0,n.listenerGroup=new b.mM,n.loadedRoom={room:"",roomTitle:""},n}return(0,o.Z)(S,[{key:"handleHistory",value:function(e){}},{key:"handleRoomStatusOffline",value:function(e){}},{key:"handleSetWidescreen",value:function(e){}},{key:"handlePlaySound",value:function(e){}},{key:"handleRoomInitiallyOffline",value:function(){}},{key:"handleRoomInitiallyOnline",value:function(){}},{key:"handleRoomStatusPasswordProtected",value:function(e){this.player.playerComponent.stop()}},{key:"handleUpdateChatSettings",value:function(e,t){e.updateEnterLeaveSettings(t.roomEntryFor,t.roomLeaveFor)}},{key:"handleRoomAccessDenied",value:function(e,t){(0,d.Cj)("Access Denied for room: ".concat(e,"\n\n").concat(t.getString("detail")))}},{key:"handleRoomUnauthorized",value:function(e){null!==window.top&&(window.top.location.href=(0,h.BN)("/auth/login/?next=".concat(window.location.pathname).concat(window.location.search)))}},{key:"handleRoomPasswordRequired",value:function(e){}},{key:"handleRoomLoaded",value:function(e){}},{key:"handleRoomStatusChangeNotification",value:function(e){}},{key:"handleResize",value:function(){}},{key:"setupAudio",value:function(){var e=this;_.gO.listen((function(t){e.viewerTipVolume=t.viewerTipVolume}))}},{key:"setupTipCallout",value:function(e,t,n){var i=this;this.tipCallout=this.addChild(new F(e,t,n)),_.jE.listen((function(e){i.tipCallout.isVisible?i.tipCallout.hide():i.tipCallout.show(e)})),this.tipCallout.tipSent.listen((function(){i.tipCallout.hide()}))}},{key:"setupLoginOverlay",value:function(){_.FJ.listen((function(e){(0,c.iW)({fromFeature:e,returnToPage:!0})})),(0,m.M5)((function(){_.FJ.fire(!0)}))}},{key:"setupResizeHandlers",value:function(){var e=this;u.nR.listen((function(){e.repositionChildrenRecursive(),e.handleResize()})),window.onorientationchange=function(){(0,w.Qg)(),e.repositionChildrenRecursive()}}},{key:"setupLoadRoom",value:function(e){var t=this;this.loadRoom(e,!0),C.WP.listen((function(e){(0,N.me)()>172800?window.location.pathname="/".concat(e,"/"):t.loadRoom(e,!0)})),g.kN.listen((function(e){t.handleRoomLoaded(e)}))}},{key:"createChatConnection",value:function(e){this.chatConnection=new v.E(e,!0)}},{key:"setDocumentTitle",value:function(e,t){document.title="".concat(e," at Chaturbate: ").concat(t)}},{key:"loadRoom",value:function(e,t){var n=this;if(!this.isRoomLoaded(e)){this.loadedRoom={room:e,roomTitle:""},this.lastLoadRoomId+=1;var i=this.lastLoadRoomId;this.getRoomDossierPromise(e).then((function(e){i===n.lastLoadRoomId&&n.onRoomDossierLoad(e,t)})).catch((function(t){n.onRoomDossierError(t,e)}))}}},{key:"getRoomDossierPromise",value:function(e){return(0,k.ss)(e)}},{key:"onRoomDossierLoad",value:function(e,t){var n=this;void 0!==this.cleanupLastRoomCallback&&this.cleanupLastRoomCallback(),(0,x.N$)(e.room),void 0!==this.additionalRoomCleanup&&this.additionalRoomCleanup(),this.setDocumentTitle(e.room,e.roomTitle),this.loadedRoom.roomTitle=e.roomTitle,l.q.setState(e),j.fire(e),this.createChatConnection(e),this.chatConnection.event.titleChange.listen((function(t){n.setDocumentTitle(e.room,t)})),this.viewerTipVolume=e.userChatSettings.viewerTipVolume,this.audioHolder.loadTipSounds(),this.chatConnection.event.playSound.listen((function(e){n.handlePlaySound(e)})),this.handleSetWidescreen(e.isWidescreen);var i,o,r={dossier:e,chatConnection:this.chatConnection};this.player.playerComponent.handleRoomLoaded(r),this.cleanupLastRoomCallback=function(){clearInterval(i),window.clearTimeout(o),n.chatConnection.disconnect(),n.player.playerComponent.stop(),n.listenerGroup.removeAll(),g.QN.fire(void 0)},t&&this.handleHistory(e),this.isRoomInitiallyOffline(r.dossier)?this.handleRoomInitiallyOffline():this.handleRoomInitiallyOnline(),g.kN.fire(r),this.listenerGroup.add(this.chatConnection.event.statusChange.listen((function(e){var t=["privatewatching","privatespying"],r=t.includes(e.currentStatus),s=t.includes(e.previousStatus);switch(("notconnected"===e.previousStatus||r||s)&&(clearInterval(i),i=window.setInterval((function(){n.chatConnection.updateRoomCount(r)}),1e3*(r?5:90)),o=window.setTimeout((function(){n.chatConnection.updateRoomCount(r||s)}),2e3)),e.currentStatus){case"passwordprotected":n.handleRoomStatusPasswordProtected(n.chatConnection);break;case"offline":n.handleRoomStatusOffline(n.chatConnection)}n.handleRoomStatusChangeNotification(e)}))),this.listenerGroup.add(_.gO.listen((function(e){n.handleUpdateChatSettings(n.chatConnection,e)}))),this.repositionChildrenRecursive()}},{key:"isRoomInitiallyOffline",value:function(e){return"offline"===e.roomStatus}},{key:"onRoomDossierError",value:function(e,t){if(e instanceof h.GM&&""!==e.xhr.responseText){if("application/json"!==e.xhr.getResponseHeader("Content-Type"))return void error("Error reading room dossier error",{room:t,error:e.xhr.responseText});var n=new f.j(e.xhr.responseText);switch(n.getStringOrUndefined("code",!1)){case"access-denied":this.handleRoomAccessDenied(t,n);break;case"unauthorized":this.handleRoomUnauthorized(t);break;case"password-required":this.handleRoomPasswordRequired(t);break;default:error("Error parsing room dossier error",{room:t,error:e.xhr.responseText})}}else error("Error occurred while processing room dossier",{room:t,error:e})}},{key:"isRoomLoaded",value:function(e){var t=e===this.loadedRoom.room,n=!this.chatConnection||this.chatConnection.room()===e;return t&&n}}]),S}(y.w)},1234:function(e,t,n){"use strict";n.d(t,{l:function(){return H},C:function(){return j}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(8759),c=n(1185),u=n(851),d=n(1612),h=n(407),f=n(7693),p=n(1522),m=n(3753),v=n(695),g=n(8958),y=n(4793),b=n(6767),w=n(9),C=n(8263),x=n(1794),k=n(3705),S=n(928),T=n(2717),I=n(7184),P=n(126),R=n(3243),M=n(5925),A=n(9874),E=n(3543);function B(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return O(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)?O(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(i);try{for(l.s();!(a=l.n()).done;){var c=a.value,u=document.createElement("option");u.innerText=c.label.toString(),u.value=c.value.toString(),n.appendChild(u)}}catch(e){l.e(e)}finally{l.f()}}return this.getStyles().styleLabel(e,t),this.getStyles().styleInput(n),s.onclick=function(e){(0,v.Cg)('You must be logged in to change chat settings. Click "OK" to login.')?e.preventDefault():e.target!==n&&n.focus()},n.onmousedown=function(e){(0,v.Cg)('You must be logged in to change chat settings. Click "OK" to login.')&&e.preventDefault()},n instanceof HTMLSelectElement&&this.updateSelectWidth(n),(0,f.j9)("change",n,(function(e){n instanceof HTMLSelectElement&&r.updateSelectWidth(n),r.saveSettings()})),s}},{key:"createColorPicker",value:function(){var e=document.createElement("label"),t=this.createRow(e,E.ag.chatColor,this.chatColorSwatch);return t.dataset.testid="chat-settings-color-picker",t.appendChild(this.chatColorInput),this.styleWrapperCustom(t),this.styleLabelCustom(e),this.styleColorSwatch(this.chatColorSwatch),this.chatColorSwatch.onmousedown=this.openColorSwatch.bind(this),t.onclick=this.openColorSwatch.bind(this),this.chatColorInput.type="hidden",t}},{key:"createFontFamilyPicker",value:function(){var e=this,t=document.createElement("label"),n=this.createRow(t,E.ag.fontFamily,this.fontFamilySelect,this.getFontOptions());n.dataset.testid="chat-settings-font-family-picker";var i=function(t){if(!e.isBroadcaster()){if((0,v.Cg)('You must be logged in to change font family. Click "OK" to login.'))return void t.preventDefault();if(!e.isSupporter)return t.preventDefault(),e.fontFamilySelect.blur(),void(0,p.Cj)("You must be a supporter to change font family")}};return this.fontFamilySelect.onmousedown=i.bind(this),n.onclick=i.bind(this),n}},{key:"createFontSizePicker",value:function(){for(var e=[],t=9;t<=20;t+=1)e.push({label:"".concat(t,"pt"),value:"".concat(t,"pt")});var n=document.createElement("label");return this.createRow(n,E.ag.fontSize,this.fontSizeSelect,e)}},{key:"createShowEmoticonsPicker",value:function(){var e=document.createElement("label"),t=this.createRow(e,E.ag.showEmoticons,this.showEmoticonsCheckbox.element);return this.styleWrapperCustom(t),this.styleLabelCustom(e),this.styleEmoticonsCheckbox(this.showEmoticonsCheckbox.element),t}},{key:"createEmoticonAutocompleteDelayPicker",value:function(){var e=document.createElement("label");return this.createRow(e,E.ag.emoticonAutoCompleteDelay,this.emoticonAutocompleteDelaySelect,this.getEmoticonAutocompleteDelayOptions())}},{key:"createHighestTokenColorPicker",value:function(){var e=document.createElement("label");return this.createRow(e,E.ag.highestTokenColor,this.highestTokenColorSelect,this.getHighestTokenColorOptions(),E.ag.highestTokenColorTooltip)}},{key:"createNotifyEntryPicker",value:function(){var e=document.createElement("label");return this.createRow(e,E.ag.notifyEntryFor,this.notifyEntryForSelect,this.getNotifyEntryLeaveOptions())}},{key:"createNotifyLeavePicker",value:function(){var e=document.createElement("label");return this.createRow(e,E.ag.notifyLeaveFor,this.notifyLeaveForSelect,this.getNotifyEntryLeaveOptions())}},{key:"createTipVolumePicker",value:function(){var e=this,t="";j.listen((function(e){t=e}));var n=this.createRow(this.tipVolumeValueLabel,E.ag.tipVolume,this.tipVolumeSlider.element);return this.styleSlider(this.tipVolumeSlider),this.handleSliderMove(this.tipVolumeSlider.getValue()),this.tipVolumeSlider.valueChangeStart.listen((function(t){e.handleSliderMove(t)})),this.tipVolumeSlider.valueChanged.listen(this.handleSliderMove.bind(this)),this.tipVolumeSlider.valueChangeEnd.listen((function(n){e.handleSliderMove(n),(0,k.fg)("TipVolumeChanged",{tipvol:n,chatmode:t}),e.saveSettingsOrCookie()})),n.onclick=function(){},this.tipVolumeSlider.element.onmousedown=function(){},n}},{key:"handleSliderMove",value:function(e){this.tipVolumeValueLabel.innerText="".concat(E.ag.tipVolume," (").concat(Math.round(e),"%)")}},{key:"createManageIgnoredUsersPicker",value:function(){var e=this,t=this.createSettingsLink(this.manageIgnoredUsersLink,E.ag.viewEditIgnoredUsers);return t.appendChild(this.manageIgnoredUsersLink),this.manageIgnoredUsersLink.onclick=function(){(0,v.Cg)('You must be logged in to edit ignored users. Click "OK" to login.')||(void 0===e.removeIgnoredUserUI&&e.createManageIgnoredUsersUI(),void 0!==e.removeIgnoredUserUI&&e.removeIgnoredUserUI.initAndShow())},t}},{key:"createSettingsLink",value:function(e,t){var n=document.createElement("div");return this.getStyles().styleRowWrapper(n),(0,c.vP)(e,"link"),e.innerText=t,e.style.marginTop="16px",e.style.cursor="pointer",e.onmouseenter=function(){e.style.textDecoration="underline"},e.onmouseleave=function(){e.style.textDecoration="none"},n}},{key:"createManageIgnoredUsersUI",value:function(){void 0===this.removeIgnoredUserUI&&(this.removeIgnoredUserUI=(0,l.s2)()?new Z:new U)}},{key:"createHeader",value:function(e){var t=document.createElement("div");return this.getStyles().styleHeader(t,e),t}},{key:"saveSettingsOrCookie",value:function(){var e=Math.round(this.tipVolumeSlider.getValue());this.isAnon?((0,b.C)("tipvol","".concat(e),60),this.userChatSettings.viewerTipVolume=e,F.gO.fire(this.userChatSettings)):this.saveSettings()}},{key:"saveSettings",value:function(){var e=this;(0,v.Cg)('You must be logged in to change chat settings. Click "OK" to login.')?F.gO.fire(this.userChatSettings):((0,m.I5)(this.getSaveColorEndpoint(),{color:this.chatColorInput.value}).catch((function(t){e.chatColorInput.value=e.userChatSettings.fontColor,error("Error saving user chat color",t)})),(0,m.I5)(this.getSaveEndpoint(),this.getFormData()).then((function(t){e.chatSettingsSavedRequest.fire(void 0),e.setUserChatSettings(),F.gO.fire(e.userChatSettings)})).catch((function(e){error("Error saving user chat settings",e)})))}},{key:"setUserChatSettings",value:function(){this.hasModeratorPrivileges()&&(this.userChatSettings.roomEntryFor=(0,S.iY)(this.notifyEntryForSelect.value),this.userChatSettings.roomLeaveFor=(0,S.iY)(this.notifyLeaveForSelect.value)),this.userChatSettings.fontColor=this.chatColorInput.value,this.userChatSettings.fontFamily=decodeURIComponent(this.fontFamilySelect.value),this.userChatSettings.fontSize=this.fontSizeSelect.value,this.userChatSettings.showEmoticons=this.showEmoticonsCheckbox.isChecked(),this.userChatSettings.emoticonAutocompleteDelay=this.emoticonAutocompleteDelaySelect.value,this.userChatSettings.highestTokenColor=this.highestTokenColorSelect.value,this.userChatSettings.viewerTipVolume=Math.round(this.tipVolumeSlider.getValue())}},{key:"getFormData",value:function(){var e={color:this.chatColorInput.value};return e.font_family=decodeURIComponent(this.fontFamilySelect.value),e.font_size=this.fontSizeSelect.value,e.show_emoticons="".concat(this.showEmoticonsCheckbox.isChecked()),e.emoticon_autocomplete_delay=this.emoticonAutocompleteDelaySelect.value,e.highest_token_color=this.highestTokenColorSelect.value,e.viewer_tip_volume="".concat(Math.round(this.tipVolumeSlider.getValue())),this.hasModeratorPrivileges()&&(e.enter_notify=this.notifyEntryForSelect.value,e.leave_notify=this.notifyLeaveForSelect.value),e}},{key:"getSaveColorEndpoint",value:function(){return"choose_viewer_chat_color/"}},{key:"getSaveEndpoint",value:function(){return"api/viewerchatsettings/".concat(this.roomName,"/")}},{key:"hasModeratorPrivileges",value:function(){return this.isModerator}},{key:"updateSelectWidth",value:function(e){}},{key:"styleWrapperCustom",value:function(e){}},{key:"styleLabelCustom",value:function(e){}},{key:"styleColorSwatch",value:function(e){(0,c.vP)(this.chatColorSwatch,"colorSwatch"),this.chatColorSwatch.style.width="20px",this.chatColorSwatch.style.height="20px",this.chatColorSwatch.style.border="1px solid ".concat(d.w.defaultColor),this.chatColorSwatch.style.cursor="pointer",this.chatColorSwatch.style.verticalAlign="middle"}},{key:"styleEmoticonsCheckbox",value:function(e){e.style.display="block"}},{key:"styleSlider",value:function(e){this.tipVolumeSlider.element.style.display="inline-block",this.tipVolumeSlider.element.style.border="none",this.tipVolumeSlider.element.style.verticalAlign="top",this.tipVolumeSlider.element.style.height="16px",this.tipVolumeSlider.element.style.width="100%"}},{key:"repositionChildren",value:function(){this.tipVolumeSlider.handleResize()}},{key:"getTipVolumeSlider",value:function(){return this.tipVolumeSlider}},{key:"getStyles",value:function(){return void 0===this.chatSettingsStyles&&(this.chatSettingsStyles=new g.h),this.chatSettingsStyles}},{key:"createUserSettings",value:function(){this.usersSettings.appendChild(this.createHighestTokenColorPicker())}},{key:"createNotificationSettings",value:function(){this.notificationsSettings.appendChild(this.createHeader(E.ag.notificationsSettings)),this.notificationsSettings.appendChild(this.createNotifyEntryPicker()),this.notificationsSettings.appendChild(this.createNotifyLeavePicker())}},{key:"createOtherSettings",value:function(){this.otherSettings.appendChild(this.createTipVolumePicker()),this.otherSettings.appendChild(this.createManageIgnoredUsersPicker())}},{key:"updateChatSettings",value:function(e){this.userChatSettings=e,this.updateChatColor(this.userChatSettings.fontColor),this.fontFamilySelect.value=this.userChatSettings.fontFamily,this.fontSizeSelect.value=this.userChatSettings.fontSize,this.showEmoticonsCheckbox.setCheckedDirectly(this.userChatSettings.showEmoticons),this.emoticonAutocompleteDelaySelect.value=this.userChatSettings.emoticonAutocompleteDelay,this.highestTokenColorSelect.value=this.userChatSettings.highestTokenColor,this.updateSelectWidth(this.fontFamilySelect),this.updateSelectWidth(this.fontSizeSelect),this.updateSelectWidth(this.emoticonAutocompleteDelaySelect),this.updateSelectWidth(this.highestTokenColorSelect),this.tipVolumeSlider.setValue(this.userChatSettings.viewerTipVolume),this.handleSliderMove(this.userChatSettings.viewerTipVolume),(0,k.XI)(this.userChatSettings.viewerTipVolume)}},{key:"isBroadcaster",value:function(){return!1}},{key:"handleRoomLoaded",value:function(e){this.updateChatSettings(e.dossier.userChatSettings),this.roomName=e.dossier.room,this.isModerator=e.dossier.isModerator,this.isSupporter=e.dossier.isSupporter,this.isAnon=e.chatConnection.viewerIsAnonymous(),this.updateNotificationsSettingsVisibility()}},{key:"updateNotificationsSettingsVisibility",value:function(){this.hasModeratorPrivileges()?(this.notificationsSettings.style.display="block",this.notifyEntryForSelect.value=z(this.userChatSettings.roomEntryFor),this.notifyLeaveForSelect.value=z(this.userChatSettings.roomLeaveFor)):this.notificationsSettings.style.display="none"}},{key:"getFontOptions",value:function(){return[{label:"Default",value:"default"},{label:"Arial",value:"Arial, Helvetica"},{label:"Bookman Old Style",value:"Bookman Old Style"},{label:"Comic Sans",value:'"Comic Sans MS", cursive'},{label:"Courier",value:'"Courier New"'},{label:"Lucida",value:"Lucida"},{label:"Palantino",value:"Palantino"},{label:"Tahoma",value:"Tahoma, Geneva"},{label:"Times New Roman",value:'"Times New Roman"'}]}},{key:"getEmoticonAutocompleteDelayOptions",value:function(){return[{label:"Turn Off Autocomplete",value:"-1"},{label:"No Delay - 0s",value:"0"},{label:"Short - 0.5s",value:"500"},{label:"Medium - 1s",value:"1000"},{label:"Long - 1.5s",value:"1500"}]}},{key:"getHighestTokenColorOptions",value:function(){return[{label:"Dark Purple (Tipped 1000 recently)",value:"darkpurple"},{label:"Light Purple (Tipped 250 recently)",value:"lightpurple"},{label:"Dark Blue (Tipped 50 recently)",value:"darkblue"},{label:"Light Blue (Owns or purchased tokens)",value:"lightblue"}]}},{key:"getNotifyEntryLeaveOptions",value:function(){return[{label:"All Registered Users",value:"orga"},{label:"Mods, Fans, and Users With Tokens",value:"orgb"},{label:"Mods and Fans",value:"org"},{label:"No Users",value:"none"}]}}]),P}(w.w);function z(e){switch(e){case 0:return"orga";case 1:return"orgb";case 2:return"org";case 3:return"none";default:return error("Invalid enter/leave setting: ".concat(e)),"orgb"}}},8958:function(e,t,n){"use strict";n.d(t,{h:function(){return s}});var i=n(2951),o=n(1976),r=n(1185),s=function(){function e(){(0,i.Z)(this,e)}return(0,o.Z)(e,[{key:"styleContainer",value:function(e){}},{key:"styleHeader",value:function(e,t){e.innerText=t,e.style.fontWeight="bold",e.style.fontSize="12px",e.style.margin="14px 0 8px",e.style.backgroundColor=""}},{key:"styleRowWrapper",value:function(e){e.style.margin="4px 0 7px 4px"}},{key:"styleLabel",value:function(e,t){e.innerText=t,e.style.fontSize="12px",e.style.display="inline-block",e.style.marginBottom="5px"}},{key:"styleInput",value:function(e){(0,r.vP)(e,"chat-settings-input"),e.style.display="block",e.style.fontSize="12px",e.style.marginTop="0",e.style.borderWidth="1px",e.style.borderStyle="solid",e instanceof HTMLSelectElement&&((0,r.vP)(e,"chat-settings-select"),e.style.height="24px",e.style.width="100%")}}]),e}()},4372:function(e,t,n){"use strict";n.d(t,{l:function(){return a}});var i=n(9888),o=n(1522),r=n(3543),s=n(47);function a(e,t,n,a,l){var c=(0,s.vz)("div",{className:"undo-ban-options-".concat(t.silenced),style:{boxSizing:"border-box",padding:"2px 5px 3px 25px",fontWeight:"bold"}}),u=(0,s.vz)("a",{href:"#",className:"msg-link",onClick:function(e){null==e||e.preventDefault(),h(),(0,i.F)(n,t.isBan?"remove_ban":"remove_silence",a.dossier.room,(function(){l(t.isBan?r.ag.banRemovedMessage:r.ag.silenceRemovedMessage)}),(function(){l(t.isBan?r.ag.banRemoveErrorMessage:r.ag.silenceRemoveErrorMessage)}))}},r.ag.inlineUndoText),d=(0,s.vz)("a",{href:"#",style:{color:"inherit"},onClick:h},"(",r.ag.dismissLower,")");function h(n){var i;null==n||n.preventDefault(),null===(i=c.parentElement)||void 0===i||i.removeChild(c);var o=e.element.getElementsByClassName("undo-ban-options-".concat(t.silenced));Array.from(o).forEach((function(e){var t;null===(t=e.parentElement)||void 0===t||t.removeChild(e)}))}if(c.appendChild(u),u.dataset.testid="undo-button",d.dataset.testid="dismiss-button",!t.isBan&&a.dossier.userName===a.dossier.room){var f=(0,s.vz)("a",{href:"#",style:{color:"red"},onClick:function(e){null==e||e.preventDefault(),(0,o.oB)(r.ag.banUserConfirm(t.silenced),(function(){h(),(0,i.F)(n,"convert_to_ban",a.dossier.room,(function(){}),(function(){l(r.ag.banConvertErrorMessage)}))}))}},r.ag.inlineBanText);f.dataset.testid="ban-button",c.appendChild(document.createTextNode(" ".repeat(5))),c.appendChild(f)}return c.appendChild(document.createTextNode(" ".repeat(5))),c.appendChild(d),h(),c}},8157:function(e,t,n){"use strict";n.d(t,{Av:function(){return q},Ow:function(){return J},dV:function(){return z}});var i=n(2951),o=n(1976),r=n(126),s=n(5809);function a(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function l(e){return Math.min(1,Math.max(0,e))}function c(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function u(e){return e<=1?"".concat(100*e,"%"):e}function d(e){return 1===e.length?"0".concat(e):String(e)}function h(e,t,n){e=a(e,255),t=a(t,255),n=a(n,255);var i=Math.max(e,t,n),o=Math.min(e,t,n),r=0,s=0,l=(i+o)/2;if(i===o)s=0,r=0;else{var c=i-o;switch(s=l>.5?c/(2-i-o):c/(i+o),i){case e:r=(t-n)/c+(t1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function p(e,t,n){e=a(e,255),t=a(t,255),n=a(n,255);var i=Math.max(e,t,n),o=Math.min(e,t,n),r=0,s=i,l=i-o,c=0===i?0:l/i;if(i===o)r=0;else{switch(i){case e:r=(t-n)/l+(t0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,i.Z)(this,e),this.lighten=function(e){return n.colorSpace.lighten(e)},this.darken=function(e){return n.colorSpace.darken(e)},this.setLightness=function(e){return n.colorSpace.setLightness(e)},this.matchLightness=function(e){return n.colorSpace.matchLightness(e)},o instanceof e)return o.clone();"number"==typeof o&&(o=function(e){return{r:e>>16,g:(65280&e)>>8,b:255&e}}(o)),this.originalInput=o;var s=function(e){var t,n,i,o,r,s,l,d={r:0,g:0,b:0},h=1,p=null,m=null,w=null,C=!1,x=!1;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var t=!1;if(y[e])e=y[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=k.rgb.exec(e);return null!==n?{r:n[1],g:n[2],b:n[3]}:null!==(n=k.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:null!==(n=k.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:null!==(n=k.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:null!==(n=k.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:null!==(n=k.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:null!==(n=k.hex8.exec(e))?{r:g(n[1]),g:g(n[2]),b:g(n[3]),a:v(n[4]),format:t?"name":"hex8"}:null!==(n=k.hex6.exec(e))?{r:g(n[1]),g:g(n[2]),b:g(n[3]),format:t?"name":"hex"}:null!==(n=k.hex4.exec(e))?{r:g(n[1]+n[1]),g:g(n[2]+n[2]),b:g(n[3]+n[3]),a:v(n[4]+n[4]),format:t?"name":"hex8"}:null!==(n=k.hex3.exec(e))&&{r:g(n[1]+n[1]),g:g(n[2]+n[2]),b:g(n[3]+n[3]),format:t?"name":"hex"}}(e)),"object"===(0,b.Z)(e)&&(S(e.r)&&S(e.g)&&S(e.b)?(r=e.r,s=e.g,l=e.b,d={r:255*a(r,255),g:255*a(s,255),b:255*a(l,255)},C=!0,x="%"===String(e.r).substr(-1)?"prgb":"rgb"):T(e.y)&&T(e.pb)&&T(e.pr)?(n=e.y,i=e.pb,o=e.pr,d={r:Math.round(n+1.402*o),g:Math.round(n-.344*i-.714*o),b:Math.round(n+1.772*i)},C=!0,x="ypbpr"):S(e.h)&&S(e.s)&&S(e.v)?(p=u(e.s),m=u(e.v),d=function(e,t,n){e=6*a(e,360),t=a(t,100),n=a(n,100);var i=Math.floor(e),o=e-i,r=n*(1-t),s=n*(1-o*t),l=n*(1-(1-o)*t),c=i%6;return{r:255*[n,s,r,r,l,n][c],g:255*[l,n,n,s,r,r][c],b:255*[r,r,l,n,n,s][c]}}(e.h,p,m),C=!0,x="hsv"):S(e.h)&&S(e.s)&&S(e.l)?(p=u(e.s),w=u(e.l),d=function(e,t,n){var i,o,r;if(e=a(e,360),t=a(t,100),n=a(n,100),0===t)o=n,r=n,i=n;else{var s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=f(l,s,e+1/3),o=f(l,s,e),r=f(l,s,e-1/3)}return{r:255*i,g:255*o,b:255*r}}(e.h,p,w),C=!0,x="hsl"):T(e.l)&&T(e.a)&&T(e.b)&&(d=function(e,t,n){var i,o,r,s=(e+16)/116,a=t/500+s,l=s-n/200;return o=-.9689*(a=.95047*(a*a*a>.008856?a*a*a:(a-16/116)/7.787))+1.8758*(s=1*(s*s*s>.008856?s*s*s:(s-16/116)/7.787))+.0415*(l=1.08883*(l*l*l>.008856?l*l*l:(l-16/116)/7.787)),r=.0557*a+-.204*s+1.057*l,i=(i=3.2406*a+-1.5372*s+-.4986*l)>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:12.92*o,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,{r:255*Math.max(0,Math.min(1,i)),g:255*Math.max(0,Math.min(1,o)),b:255*Math.max(0,Math.min(1,r))}}(e.l,e.a,e.b),C=!0,x="lab"),Object.prototype.hasOwnProperty.call(e,"a")&&(h=e.a)),h=c(h),{ok:C,format:null!==(t=e.format)&&void 0!==t?t:x,r:Math.min(255,Math.max(d.r,0)),g:Math.min(255,Math.max(d.g,0)),b:Math.min(255,Math.max(d.b,0)),a:h}}(o);this.originalInput=o,this.r=s.r,this.g=s.g,this.b=s.b,this.a=s.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(t=r.format)&&void 0!==t?t:s.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=s.ok,this.initHSL(),this.initCIELAB(),this.initYPbPr()}return(0,o.Z)(e,[{key:"colorSpace",get:function(){return 1===e.globalSpace?this.HSL:0===e.globalSpace?this.CIELAB:this.YPbPr}},{key:"lightness",get:function(){return this.colorSpace.lightness}},{key:"matchHue",value:function(t){var n=e.get(t).toHsl().h,i=this.toHsl();return i.h=n,e.get(i)}},{key:"initHSL",value:function(){var t=this;this.HSL={lighten:function(n){var i=t.toHsl();return i.l+=n/100,i.l=l(i.l),e.get(i)},darken:function(e){return t.HSL.lighten(-e)},setLightness:function(n){var i=t.toHsl();return i.l=n,e.get(i)},matchLightness:function(n){var i=e.get(n).HSL.lightness,o=t.toHsl();return o.l=i,e.get(o)},get lightness(){return t.toHsl().l}}}},{key:"initCIELAB",value:function(){var t=this;this.CIELAB={lighten:function(n){var i=t.toCieLab();return i.l+=n/100,i.l=l(i.l),e.get(i)},darken:function(e){return t.CIELAB.lighten(-e)},setLightness:function(n){var i=t.toCieLab();return i.l=n,e.get(i)},matchLightness:function(n){var i=e.get(n).CIELAB.lightness,o=t.toCieLab();return o.l=i,e.get(o)},get lightness(){return t.toCieLab().l}}}},{key:"initYPbPr",value:function(){var t=this;this.YPbPr={lighten:function(n){var i=t.toYPbPr();return i.y+=n/100*255,i.y=l(i.y),e.get(i)},darken:function(e){return t.YPbPr.lighten(-e)},setLightness:function(n){var i=t.toYPbPr();return i.y=n,e.get(i)},matchLightness:function(n){var i=e.get(n).YPbPr.lightness,o=t.toYPbPr();return o.y=i,e.get(o)},get lightness(){return t.toYPbPr().y}}}},{key:"isDark",value:function(){return this.getBrightness()<128}},{key:"isLight",value:function(){return!this.isDark()}},{key:"getBrightness",value:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3}},{key:"getLuminance",value:function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,i=e.b/255;return.2126*P(t)+.7152*P(n)+.0722*P(i)}},{key:"getAlpha",value:function(){return this.a}},{key:"setAlpha",value:function(e){return this.a=c(e),this.roundA=Math.round(100*this.a)/100,this}},{key:"toHsv",value:function(){var e=p(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}}},{key:"toCieLab",value:function(){var e,t,n,i,o,r,s=(e=this.r,t=this.g,n=this.b,t/=255,n/=255,o=(.2126*(e=(e/=255)>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.7152*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.0722*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92))/1,r=(.0193*e+.1192*t+.9505*n)/1.08883,i=(i=(.4124*e+.3576*t+.1805*n)/.95047)>.008856?Math.pow(i,1/3):7.787*i+16/116,{l:116*(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116)-16,a:500*(i-o),b:200*(o-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))});return{l:s.l,a:s.a,b:s.b}}},{key:"toHsvString",value:function(){var e=p(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),i=Math.round(100*e.v);return 1===this.a?"hsv(".concat(t,", ").concat(n,"%, ").concat(i,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")}},{key:"toHsl",value:function(){var e=h(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}}},{key:"toHslString",value:function(){var e=h(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),i=Math.round(100*e.l);return 1===this.a?"hsl(".concat(t,", ").concat(n,"%, ").concat(i,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")}},{key:"toHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return m(this.r,this.g,this.b,e)}},{key:"toHexString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return"#".concat(this.toHex(e))}},{key:"toHex8",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(e,t,n,i,o){var r,s=[d(Math.round(e).toString(16)),d(Math.round(t).toString(16)),d(Math.round(n).toString(16)),d((r=i,Math.round(255*parseFloat(r)).toString(16)))];return o&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}(this.r,this.g,this.b,this.a,e)}},{key:"toHex8String",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return"#".concat(this.toHex8(e))}},{key:"toRgb",value:function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}},{key:"toYPbPr",value:function(){return{y:.299*(e=this.r)+.587*(t=this.g)+.114*(n=this.b),pb:-.169*e-.331*t+.5*n,pr:.5*e-.419*t-.081*n};var e,t,n}},{key:"toRgbString",value:function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")}},{key:"toPercentageRgb",value:function(){var e=function(e){return"".concat(Math.round(100*a(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}}},{key:"toPercentageRgbString",value:function(){var e=function(e){return Math.round(100*a(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")}},{key:"toName",value:function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#".concat(m(this.r,this.g,this.b,!1)),t=0,n=Object.entries(y);t=0;return i||!r||!e.startsWith("hex")&&"name"!==e?("rgb"===e&&(o=this.toRgbString()),"prgb"===e&&(o=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(o=this.toHexString()),"hex3"===e&&(o=this.toHexString(!0)),"hex4"===e&&(o=this.toHex8String(!0)),"hex8"===e&&(o=this.toHex8String()),"name"===e&&(o=this.toName()),"hsl"===e&&(o=this.toHslString()),"hsv"===e&&(o=this.toHsvString()),null!==(n=o)&&void 0!==n?n:this.toHexString()):"name"===e&&0===this.a?this.toName():this.toRgbString()}},{key:"toNumber",value:function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}},{key:"clone",value:function(){return e.get(this.toString())}},{key:"brighten",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),e.get(n)}},{key:"tint",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.mix("#FFFFFF",e)}},{key:"shade",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.mix("#000000",e)}},{key:"desaturate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=this.toHsl();return n.s-=t/100,n.s=l(n.s),e.get(n)}},{key:"saturate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=this.toHsl();return n.s+=t/100,n.s=l(n.s),e.get(n)}},{key:"greyscale",value:function(){return this.desaturate(100)}},{key:"spin",value:function(t){var n=this.toHsl(),i=(n.h+t)%360;return n.h=i<0?360+i:i,e.get(n)}},{key:"mix",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,i=this.toRgb(),o=e.get(t).toRgb(),r=n/100,s={r:(o.r-i.r)*r+i.r,g:(o.g-i.g)*r+i.g,b:(o.b-i.b)*r+i.b,a:(o.a-i.a)*r+i.a};return e.get(s)}},{key:"analogous",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,i=this.toHsl(),o=360/n,r=[this];for(i.h=(i.h-(o*t>>1)+720)%360;--t;)i.h=(i.h+o)%360,r.push(e.get(i));return r}},{key:"complement",value:function(){var t=this.toHsl();return t.h=(t.h+180)%360,e.get(t)}},{key:"monochromatic",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6,n=this.toHsv(),i=n.h,o=n.s,r=n.v,s=[],a=1/t;t-->0;)s.push(e.get({h:i,s:o,v:r})),r=(r+a)%1;return s}},{key:"splitcomplement",value:function(){var t=this.toHsl(),n=t.h;return[this,e.get({h:(n+72)%360,s:t.s,l:t.l}),e.get({h:(n+216)%360,s:t.s,l:t.l})]}},{key:"onBackground",value:function(t){var n=this.toRgb(),i=e.get(t).toRgb();return e.get({r:i.r+(n.r-i.r)*n.a,g:i.g+(n.g-i.g)*n.a,b:i.b+(n.b-i.b)*n.a})}},{key:"triad",value:function(){return this.polyad(3)}},{key:"tetrad",value:function(){return this.polyad(4)}},{key:"polyad",value:function(t){for(var n=this.toHsl(),i=n.h,o=[this],r=360/t,s=1;s0&&void 0!==arguments[0]&&arguments[0];return this.a<1||e?[this.r,this.g,this.b,this.a]:[this.r,this.g,this.b]}},{key:"isBlack",get:function(){return this.equals("#000000")}},{key:"isWhite",get:function(){return this.equals("#FFFFFF")}},{key:"isTransparent",get:function(){return 0===this.getAlpha()}},{key:"isLessLuminousThan",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLuminance()-R(e);return t?n<=0:n<0}},{key:"isMoreLuminousThan",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLuminance()-R(e);return t?n>=0:n>0}},{key:"rgbRange",get:function(){var e=this.toRgbArray();return Math.max.apply(Math,(0,r.Z)(e))-Math.min.apply(Math,(0,r.Z)(e))}}],[{key:"setColorSpace",value:function(t){e.globalSpace=t}},{key:"get",value:function(){return new e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}},{key:"currentModeBg",get:function(){return document.body.classList.contains("darkmode")?e.darkModeBg:e.lightModeBg}},{key:"currentModeFg",get:function(){return document.body.classList.contains("darkmode")?e.darkModeFg:e.lightModeFg}},{key:"lightModeBg",get:function(){return e.get("#FFFFFF")}},{key:"lightModeFg",get:function(){return e.get("#494949")}},{key:"darkModeBg",get:function(){return e.get("#202C39")}},{key:"darkModeFg",get:function(){return e.get("#FFFFFF")}},{key:"black",get:function(){return e.get("#000000")}},{key:"white",get:function(){return e.get("#FFFFFF")}},{key:"transparent",get:function(){return e.get("transparent")}}]),e}();function P(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function R(e){return"number"==typeof e?e:I.get(e).getLuminance()}I.globalSpace=1;var M=n(3340);function A(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=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&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"white",n=I.get(t),i=I.get("white"),o=i.getLuminance(),r=A(this.stops);try{for(r.s();!(e=r.n()).done;){var s=e.value.color.onBackground(n),a=s.getLuminance();a0&&void 0!==arguments[0]?arguments[0]:"white",n=I.get(t),i=I.get("white"),o=i.getLuminance(),r=A(this.stops);try{for(r.s();!(e=r.n()).done;){var s=e.value.color.onBackground(n),a=s.getLuminance();a>o&&(o=a,i=s)}}catch(e){r.e(e)}finally{r.f()}return i}}],[{key:"parse",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(0!==t.trim().length&&t.trim().toLowerCase().startsWith("linear-gradient")){var n=N(Z,"gi"),i=n.exec(t);if(null!==i)return new e(t,n,i)}}}]),e}();function N(e,t){return new RegExp(e.reduce((function(e,t){return e+("string"==typeof t?t:t.source)}),""),t)}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(document.querySelectorAll(".dm-adjust"));try{for(i.s();!(t=i.n()).done;)z(t.value,n)}catch(e){i.e(e)}finally{i.f()}}));var H="#202C39";function z(e,t){if("photo"!==e.getAttribute("type")){var n=e.firstElementChild;if(null!==n){var i,o,r=n.classList.contains("roomNotice");if(r&&!n.innerText.startsWith("Notice:"))return;var s=t?null!==(i=n.getAttribute("dm-adjust-bg"))&&void 0!==i?i:H:null!==(o=n.getAttribute("dm-init-bg"))&&void 0!==o?o:"white";s.startsWith("linear-gradent")?n.style.backgroundImage=s:n.style.background=s;var a=t?n.getAttribute("dm-adjust-fg"):n.getAttribute("dm-init-fg"),l=r?n:n.querySelector("span.msg-text");null!==a&&null!==l&&(l.style.color=a)}}}I.setColorSpace(2);var W=I.darkModeBg.lightness,V=I.darkModeFg.lightness,q=function(){function e(t){(0,i.Z)(this,e),this.background=t.bg,this.foreground=t.fg,this.calc()}return(0,o.Z)(e,[{key:"calc",value:function(){var e,t=_.parse(this.background),n=I.get(null!==(e=this.foreground)&&void 0!==e?e:I.darkModeFg).setAlpha(1);if(this.fgDark=n.setLightness(V).setAlpha(1).toRgbString(),void 0!==t)t.stops.forEach((function(e){e.color=e.color.onBackground(I.darkModeBg).setLightness(W)})),this.bgDark=t.toString();else{var i=I.get(this.background);if(!i.isValid||i.isWhite||i.isTransparent||i.isBlack)return void(this.bgDark=H);this.bgDark=i.setLightness(W).toRgbString()}}}],[{key:"parseNotice",value:function(t){return new e({fg:t.foreground,bg:t.background})}},{key:"parseMessage",value:function(t){return new e({fg:t.textColor,bg:t.backgroundColor})}}]),e}();function K(e){e.style.textShadow="1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000"}function J(e,t,n){var i,o;t=(null!==(i=t)&&void 0!==i?i:"").trim(),n=(null!==(o=n)&&void 0!==o?o:"").trim();var r=e.firstElementChild,s=r,a=e;if(r.classList.contains("roomNotice")){if(a=r,!function(e){return!!e.innerText&&e.innerText.startsWith("Notice:")}(s))return}else s=e.querySelector(".msg-text");var l=I.get(t);if(l.rgbRange<10?s.style.color="#D3D3D3":s.style.color=l.setLightness(V).setAlpha(1).toRgbString(),n.length>0){var c=_.parse(n);if(void 0!==c)c.stops.forEach((function(e){var t=e.color.getAlpha();e.color.rgbRange<10?e.color=I.transparent:e.color=e.color.setLightness(W).setAlpha(t)})),a.style.background=c.toString();else{var u=I.get(n);if(u.rgbRange<10)a.style.removeProperty("background"),K(s);else{var d=u.getAlpha();u=u.setLightness(W).setAlpha(d),a.style.background=u.toRgbString(),d<1&&K(s)}}}else K(s)}},6464:function(e,t,n){"use strict";n.d(t,{E:function(){return we}});var i=n(2951),o=n(1976),r=n(5925),s=n(6272),a=n(9784),l=n(2800),c=n(8626),u=n(7600),d=n(8016),h=n(1522),f=n(3753),p=n(391),m=n(695),v=n(4793),g=n(6767),y=n(8069),b=n(1794),w=n(8821),C=n(5726),x=n(3705),k=n(3544),S=n(9545),T=n(3543),I=n(1289),P=n(9420),R=n(4649),M=n(8808),A=n(5809),E=n(9034),B=n(8015),O=n(457),L=n(728),D=n(3243),U=n(7591),Z=n(9492),F=n(7597);function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function N(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);nthis.historyLimit&&this.historyCallback.pop(),this.historyCallback.push(e)}},{key:"fireBuffer",value:function(){this.historyCallback.forEach((function(e){u._.isEnabledForUI()&&e()})),this.historyCallback=[]}},{key:"fetchHistory",value:function(){var e=this,t={};return Array.from(this.topics.entries()).forEach((function(e){var n=(0,A.Z)(e,2),i=n[0],o=n[1];t[i]=o.authData})),(0,f.I5)("push_service/room_history/",{topics:JSON.stringify(t)}).then((function(t){var n=JSON.parse(t.responseText),i=0;n.forEach((function(t){for(var n=0,o=Object.entries(t);n=e.historyLimit)return;(0,L.h)(a);var c=new p.j(a),d=e.addHistoryMessage(l.topicKey,c.getString("tid"));if(u._.addExternalMessage(l.topicKey,c.getString("tid"))||d)return;i+=1,l.callback(c)}}))})).catch(S.$x)}},{key:"tipHistory",value:function(){var e=this,t=l.q.getState(),n=t.roomUid,i=t.viewerUid,o=t.privateShowId,r=[];i===n?r.push(new d._G(i)):r.push(new V.jj(n)),""!==o&&r.push(new W.Vx(n,o)),r.forEach((function(t){var n;e.topics.set(t.getAuthKey(),{callback:(n=t,function(t){var i=n.parseData(t);i.toUsername===e.chatConn.room()&&(0,K._A)(e.chatConn,i,!0)}),authData:t.getAuthData(),topicKey:t.getKey()});var i=t.onSubscribeChange.listen((function(n){n.subscribed?e.fetchHistoryIfReady():e.informHistoryFailure("".concat(t.getId()," topic failed"))}));e.listeners.add(i)}))}},{key:"purchaseHistory",value:function(){var e=this,t=l.q.getState().roomUid;[new V.uH(t),new V.AE(t)].forEach((function(t){e.topics.set(t.getAuthKey(),{callback:function(n){var i=t.parseData(n);(0,K.FO)(e.chatConn,i)},authData:t.getAuthData(),topicKey:t.getKey()});var n=t.onSubscribeChange.listen((function(n){n.subscribed?e.fetchHistoryIfReady():e.informHistoryFailure("".concat(t.getId()," topic failed"))}));e.listeners.add(n)}))}},{key:"messageHistory",value:function(){var e=this,t=l.q.getState(),n=t.roomUid,i=t.privateShowId,o=[];""!==n&&(o.push(new V.j4(n)),""!==i&&o.push(new W.k1(n,i))),o.forEach((function(t){e.topics.set(t.getAuthKey(),{callback:function(n){var i=t.parseData(n);(0,K.AO)(e.chatConn,i)},authData:t.getAuthData(),topicKey:t.getKey()});var n=t.onSubscribeChange.listen((function(n){n.subscribed?e.fetchHistoryIfReady():e.informHistoryFailure("".concat(t.getId()," topic failed"))}));e.listeners.add(n)}))}},{key:"shortcodeHistory",value:function(){var e=this,t=l.q.getState(),n=t.roomUid,i=t.privateShowId,o=[];""!==n&&(o.push(new V.bj(n)),""!==i&&o.push(new W.O6(n,i))),o.forEach((function(t){e.topics.set(t.getAuthKey(),{callback:function(n){var i=t.parseData(n);e.chatConn.event.roomShortcode.fire(i)},authData:t.getAuthData(),topicKey:t.getKey()});var n=t.onSubscribeChange.listen((function(n){n.subscribed?e.fetchHistoryIfReady():e.informHistoryFailure("".concat(t.getId()," topic failed"))}));e.listeners.add(n)}))}},{key:"fetchHistoryIfReady",value:function(){var e=this;if(!this.finished&&u._.isEnabledForUI()){var t,n=Q(this.topics.values());try{for(n.s();!(t=n.n()).done;){var i=t.value;if(!u._.isListeningFor(i.topicKey))return}}catch(e){n.e(e)}finally{n.f()}this.finished=!0,this.fetchHistory().then((function(){(0,K.RR)(e.chatConn,l.q.getState().roomTitle),e.initial&&(e.chatConn.changeStatus(e.chatConn.statusAfterConnected),e.initial=!1)})).catch((function(){}))}}},{key:"addHistoryMessage",value:function(e,t){var n="".concat(e,":").concat(t);return!!this.handledMessages.includes(n)||(this.handledMessages.push(n),!1)}},{key:"reset",value:function(){this.finished=!1}},{key:"informHistoryFailure",value:function(e){if(!this.finished){var t,n=[],i=Q(this.topics.values());try{for(i.s();!(t=i.n()).done;){var o=t.value;u._.isListeningFor(o.topicKey)||n.push(o.topicKey)}}catch(e){i.e(e)}finally{i.f()}n.length>0&&(this.finished=!0,(0,x.fg)("PushServiceHistoryFailure",{reason:e,unconnectedTopics:n,unconnectedTopicsCount:n.length}),this.fetchHistory().then((function(){})).catch((function(){})))}}}]),e}(),te=function(){function e(t,n){var o,r,s=this;(0,i.Z)(this,e),this.dossier=t,this.chatConn=n,this.listeners={global:new b.mM,room:new b.mM,user:new b.mM,color:new b.mM,fanclub:new b.mM,privileged:new b.mM,private:new b.mM,enterLeave:new b.mM},this.isInHiddenShow=!1,this.history=new ee(this.chatConn),this.connectionFailedCount=0,this.lastOnlineStatus="notconnected",this.hiddenMessage="",this.receivedMessageBuffer=[],this.messageTimeouts=new Map;var a=!0,c=(new Date).getTime(),d=0;u._.connectionChange.listen((function(e){if(!["connecting","closing","initialized"].includes(e.current)){"connected"===e.current&&(d+=1);var t={state:e.current,previousState:e.previous,push_connection_type:u._.getConnectionType(),wowza_state:s.chatConn.wowzaHandler.readyState(),connection_id:u._.presenceId,first_connection:a,time_since_start:(new Date).getTime()-c,client:e.client,connectionCount:d,connectionFailedCount:s.connectionFailedCount,reason:e.reason,failedCount:e.failedCount};if((0,x.fg)("PushServiceConnection",t),a=!1,!0===e.primary&&u._.isEnabledForUI())switch(e.current){case"closed":case"failed":s.chatConn.event.roomNotice.fire({messages:[[(0,J.vK)("Chat disconnected")]],showInPrivateMessage:!0});break;case"suspended":case"disconnected":if(s.connectionFailedCount>6&&!u._.isWowzaDisabled()){u._.close();break}s.connectionFailedCount+=1,s.chatConn.event.roomNotice.fire({messages:[[(0,J.vK)("Trying to reconnect")]],showInPrivateMessage:!0});break;default:s.connectionFailedCount=0}}}),!1).addTo(this.listeners.global);var h=null!==(o=this.dossier.viewerUid)&&void 0!==o?o:"",f=null!==(r=this.dossier.roomUid)&&void 0!==r?r:"";this.isBroadcaster=""!==f&&h===f;var p=l.q.getState(),m=p.privateShowId,v=p.isModerator,g=p.isInFanClub,y=p.userColors;this.setupBackendSwapListener(),this.joinRoomPresence(f,h),this.setupVideoQualityTopic(f),this.setupUserListeners(h),this.setupRoomListeners(f),this.setupRoomEnterLeaveListener(f,v||this.isBroadcaster),this.setupRoomUserListeners(f,h),this.setupPrivilegedListeners(f,v||this.isBroadcaster),this.setupFanClubListeners(f,g),this.setupColorGroupListeners(f,y),this.setupGameListener(f),""!==m&&this.setupPrivateRoomListeners(f,m),window.setTimeout((function(){s.history.setupHistory()}),500),l.q.onUpdate.listen((function(e){var t=l.q.getState();t.privateShowId!==e.privateShowId&&s.setupPrivateRoomListeners(f,t.privateShowId),t.isModerator!==e.isModerator&&(s.setupPrivilegedListeners(f,t.isModerator||s.isBroadcaster),s.setupRoomEnterLeaveListener(f,t.isModerator||s.isBroadcaster)),t.isInFanClub!==e.isInFanClub&&s.setupFanClubListeners(f,t.isInFanClub),s.setupColorGroupListeners(f,t.userColors,e.userColors)}),!1).addTo(this.listeners.global)}return(0,o.Z)(e,[{key:"sendMessage",value:function(e,t){var n=this,i=l.q.getState(),o=i.roomUid,r=i.privateShowId,s=i.userName;if(e!==this.chatConn.room()||""===o)return Promise.reject({error:"room error",sendMessageRoom:e,handlerRoom:this.chatConn.room(),roomUid:o});if(l.J.current.isNoninteractiveUser)return Promise.reject({error:"internal staff",sendMessageRoom:e,handlerRoom:this.chatConn.room(),roomUid:o});var a={room:e,message:JSON.stringify({m:t})};return this.chatConn.inPrivateRoom()&&""!==r&&(a.private_show_id=r),""!==s&&(a.username=s),u._.isEnabledForUI()&&this.chatConn.wowzaHandler.ensureConnected(),(0,f.I5)("push_service/publish_chat_message_live/",a).then((function(e){var i,r=null!==(i=e.getResponseHeader("x-banned"))&&void 0!==i?i:e.getResponseHeader("x-denied"),s=new p.j(e.responseText);if(null!==r)r=decodeURIComponent(r),n.shouldHandleMessage()&&n.chatConn.event.roomNotice.fire({messages:[[(0,J.vK)(r)]],showInPrivateMessage:!0});else{var l=s.getObject("message");(0,L.h)(l);var c=void 0===a.private_show_id?new V.j4(o):new W.k1(o,a.private_show_id),d=c.parseData(new p.j(l));if(d.isSpam="True"===e.getResponseHeader("x-spam"),u._.isEnabledForUI()&&void 0!==d.tid&&!u._.addExternalMessage(c.getKey(),d.tid))n.history.addHistoryMessage(c.getKey(),d.tid),(0,K.AO)(n.chatConn,d),n.messageTimeouts.set(d.tid,window.setTimeout((function(){var e;n.checkReceivedBuffer(null!==(e=d.tid)&&void 0!==e?e:"")||(0,x.fg)("PushServiceMessageTimeout",{topic_key:c.getKey(),topic_id:c.getId(),tid:d.tid,isSpam:d.isSpam,message:d.message})}),1e4));else if(u._.isEnabledForUI()){var h;n.checkReceivedBuffer(null!==(h=d.tid)&&void 0!==h?h:"")}}return{m:t,f:"",c:"",tid:s.getString("tid"),sig:s.getString("sig")}}))}},{key:"checkReceivedBuffer",value:function(e){var t=this.receivedMessageBuffer.indexOf(null!=e?e:"");return-1!==t&&(this.receivedMessageBuffer.splice(t,1),!0)}},{key:"setupUserListeners",value:function(e){var t=this;this.chatConn.viewerIsAnonymous()||""===e||(new d.Tz(e).onMessage.listen((function(e){var n=!0===e.isPrivateShowPmsOn||(0,w.$_)();t.shouldHandleMessage()&&n&&t.chatConn.inPrivateRoom()&&(e.otherUsername!==t.chatConn.getPrivateShowUser()&&e.otherUsername!==l.q.getState().room||((0,K.AO)(t.chatConn,e),B.Zn.fire({username:e.otherUsername}),B.vz.fire(e.otherUsername)))})).addTo(this.listeners.user),new d.a6(e).onMessage.listen((function(e){l.q.setState({userColors:e})})).addTo(this.listeners.user),new d.tL(e).onMessage.listen((function(e){t.shouldHandleMessage()&&(0,K.Eq)(e.message)})).addTo(this.listeners.user))}},{key:"setupVideoQualityTopic",value:function(e){""!==e&&new V.qm(e).onMessage.listen((function(e){var t,n,i=l.q.getState(),o=(e.tid,(0,M.Z)(e,G));(0,O.d)(i.quality,o)||(l.q.setState($($({},i),{},{quality:o})),null!==(t=null===(n=l.q.getState().quality)||void 0===n?void 0:n.stopped)&&void 0!==t&&t&&(0,q.ZV)({eventName:"streamEnd"}))})).addTo(this.listeners.room)}},{key:"setupRoomListeners",value:function(e){var t=this;""!==e&&u._.isEnabledForVerify()&&(this.setupRoomPublicListeners(e),new V.GN(e).onMessage.listen((function(){})).addTo(this.listeners.room),new V.xn(e).onMessage.listen((function(e){t.chatConn.username()===e.username&&l.q.setState({isModerator:!0}),t.shouldHandleMessage()&&(0,K.nF)(t.chatConn,e)})).addTo(this.listeners.room),new V.Nm(this.dossier.roomUid).onMessage.listen((function(e){t.chatConn.username()===e.username&&l.q.setState({isModerator:!1}),t.shouldHandleMessage()&&(0,K.O0)(t.chatConn,e)})).addTo(this.listeners.room),new V.ez(e).onMessage.listen((function(e){var n=l.q.getState().roomStatus,i=e.status;if(void 0!==e.password&&""!==e.password&&!t.isBroadcaster&&l.q.getState().roomPassword!==e.password)return t.cleanup(),void(t.shouldHandleMessage()&&(window.location.reload(),(0,K.x5)(t.chatConn)));if("offline"!==n&&(t.lastOnlineStatus=n),"hidden"===e.status){if(t.isBroadcaster)return;t.isInHiddenShow||(t.hiddenShowStarted=new Date),t.shouldHandleMessage()&&(""!==e.message&&(t.hiddenMessage=e.message),"hiddenwatching"===t.lastOnlineStatus?((0,K.xH)(t.chatConn,t.lastOnlineStatus,t.hiddenMessage),i=t.lastOnlineStatus):(0,K.xH)(t.chatConn,e.status,t.hiddenMessage))}else if("privatenotwatching"===e.status){if(t.isBroadcaster&&"offline"!==n||["privaterequesting","privatewatching","privatenotwatching"].includes(n))return;t.shouldHandleMessage()&&("offline"===n?t.isBroadcaster?t.chatConn.changeStatus("privatewatching"):"privatespying"===t.lastOnlineStatus?(t.chatConn.changeStatus(t.lastOnlineStatus),i=t.lastOnlineStatus):(""!==l.q.getState().privateShowId?t.chatConn.changeStatus("privaterequesting"):t.chatConn.changeStatus("public"),(0,K.kl)(t.chatConn)):(0,K.kl)(t.chatConn))}else if("away"===e.status&&t.shouldHandleMessage())"privatewatching"===n?(l.q.setState({privateShowId:"",roomStatus:"away"}),(0,K.yo)(t.chatConn)):"privatenotwatching"===n||"privatespying"===n?(0,K.yo)(t.chatConn):t.chatConn.changeStatus(e.status);else if("public"===e.status&&t.shouldHandleMessage())"away"===n?(0,K.Bp)(t.chatConn):"hidden"===n||"hiddenwatching"===n?(0,K.xH)(t.chatConn,e.status,e.message):t.chatConn.changeStatus(e.status);else{if("passwordprotected"===e.status)return;"offline"===e.status&&t.shouldHandleMessage()?("privaterequesting"===n&&((0,K.yo)(t.chatConn),t.chatConn.leavePrivateOrSpyShow().catch(S.$x)),t.chatConn.changeStatus(e.status)):t.shouldHandleMessage()&&t.chatConn.changeStatus(e.status)}l.q.setState({roomStatus:i})})).addTo(this.listeners.room),new V.x7(e).onMessage.listen((function(e){t.shouldHandleMessage()&&(0,K.RR)(t.chatConn,e.title)})).addTo(this.listeners.room),new V.Dn(e).onMessage.listen((function(e){t.shouldHandleMessage()&&(0,K.A)(t.chatConn,e)})).addTo(this.listeners.room),new V.nf(e).onMessage.listen((function(e){t.shouldHandleMessage()&&(e.fromUser=t.chatConn.room(),t.chatConn.username()===e.username?(0,K.K9)(t.chatConn,T.ag.kickedFromRoomMessage):(0,K.gs)(t.chatConn,e))})).addTo(this.listeners.room),new V.ll(e).onMessage.listen((function(e){if(t.shouldHandleMessage()&&"refresh_panel"===e.target){var n=function(){t.chatConn.event.refreshPanel.fire({appId:e.appId,appSystem:e.appSystem})};l.J.current.throttleTopicPublish?window.setTimeout((function(){n()}),1e3):n()}})).addTo(this.listeners.room),new V.M2(e).onMessage.listen((function(e){l.q.setState({allowPrivateShow:e.allowPrivateShow,privatePrice:e.privatePrice,spyPrice:e.spyPrice,privateMinMinutes:e.privateMinMinutes,allowShowRecordings:e.allowShowRecordings}),!t.chatConn.inPrivateRoom()||t.isBroadcaster?t.shouldHandleMessage()&&(0,K.Iq)(t.chatConn,e):t.chatConn.event.settingsUpdate.fire(e)})).addTo(this.listeners.room))}},{key:"setupRoomPublicListeners",value:function(e){var t=this;new V.j4(e).onMessage.listen((function(e){if(e.fromUser.username===t.chatConn.username()&&void 0!==e.tid){if(t.messageTimeouts.has(e.tid))return window.clearTimeout(t.messageTimeouts.get(e.tid)),void t.messageTimeouts.delete(e.tid);t.receivedMessageBuffer.push(e.tid)}if(t.chatConn.inPrivateRoom())return e.ts=void 0,void t.history.push((function(){return(0,K.AO)(t.chatConn,e)}));var n="RoomMessageTopic:".concat(l.q.getState().roomUid);void 0!==e.tid&&t.history.addHistoryMessage(n,e.tid),t.shouldHandleMessage()&&(0,K.AO)(t.chatConn,e)})).addTo(this.listeners.room),new V.AE(e).onMessage.listen((function(e){var n=l.q.getState();if(e.fromUser.username===n.userName&&l.q.setState({isInFanClub:!0}),t.chatConn.inPrivateRoom())return e.ts=void 0,void t.history.push((function(){return(0,K.FO)(t.chatConn,e)}));t.shouldHandleMessage()&&(0,K.FO)(t.chatConn,e)})).addTo(this.listeners.room),new V.uH(e).onMessage.listen((function(e){if(t.chatConn.inPrivateRoom())return e.ts=void 0,void t.history.push((function(){return(0,K.FO)(t.chatConn,e)}));t.shouldHandleMessage()&&(0,K.FO)(t.chatConn,e)})).addTo(this.listeners.room),new V.pp(e).onMessage.listen((function(e){t.chatConn.inPrivateRoom()?e.ts=void 0:t.shouldHandleMessage()&&t.chatConn.event.roomNotice.fire(e)})).addTo(this.listeners.room),new V.jj(e).onMessage.listen((function(e){if(!t.isBroadcaster){if(t.chatConn.inPrivateRoom())return e.ts=void 0,void t.history.push((function(){return(0,K._A)(t.chatConn,e,!0)}));t.shouldHandleMessage()&&(0,K._A)(t.chatConn,e)}})).addTo(this.listeners.room),(0,c.vj)()&&new V.bj(e).onMessage.listen((function(e){if(t.chatConn.inPrivateRoom())return e.ts=void 0,void t.history.push((function(){return t.chatConn.event.roomShortcode.fire(e)}));t.chatConn.event.roomShortcode.fire(e)})).addTo(this.listeners.room)}},{key:"setupRoomUserListeners",value:function(e,t){var n=this;if(!this.chatConn.viewerIsAnonymous()&&""!==e&&""!==t){new V.gt(e,t).onMessage.listen((function(e){n.chatConn.inPrivateRoom()||n.shouldHandleMessage()&&n.chatConn.event.roomNotice.fire(e)})).addTo(this.listeners.room);var i=[];this.isBroadcaster&&i.push({topic:new d.Pg(e),disabled:!1}),i.push({topic:new V.tS(e,t),disabled:this.isBroadcaster});for(var o=function(){var e=s[r];e.topic.onMessage.listen((function(t){if(!e.disabled){var i;switch(t.status){case"started":if("privatenotwatching".includes(n.chatConn.status))break;["privatewatching","privaterequesting"].includes(n.chatConn.status)?l.q.setState({privateShowId:t.privateShowId,roomStatus:"privatewatching"}):l.q.setState({roomStatus:"privatenotwatching"}),i=K.kl;break;case"declined":l.q.setState({roomStatus:"public"}),i=K.yo;break;case"stopped":l.q.setState({roomStatus:"away",privateShowId:""}),i=K.yo;break;case"error":l.q.setState({roomStatus:"public",privateShowId:""}),i=K.yo;break;case"spy_leave":l.q.setState({roomStatus:"public",privateShowId:""}),i=function(e){e.changeStatus("privatenotwatching")};break;default:n.isBroadcaster||warn("Invalid private show status on viewer",t,"PUSH_")}n.shouldHandleMessage()&&void 0!==i&&i(n.chatConn)}})).addTo(n.listeners.room)},r=0,s=i;r=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&(e="http"===this.roomDossier.host.substring(0,4)?new SockJS(this.roomDossier.host):new WebSocket(this.roomDossier.host),this._websocket=e,e.onclose=function(e){debug("Connection closed:".concat(JSON.stringify(e))),void 0===t?(u._.isEnabledForUI()||(n.event.roomNotice.fire({messages:[[(0,J.vK)("Chat disconnected")]],showInPrivateMessage:!0}),n.event.connectionLost.fire(void 0)),n.shouldReconnect&&(t=window.setTimeout((function(){n.showReconnectNotice(),n.remakeWebsocket()}),n.reconnectLimiter.millisecondsForRetry()))):n.showReconnectNotice()},e.onerror=function(e){debug("Connection error:".concat(JSON.stringify(e))),void 0===t&&n.shouldReconnect&&(t=window.setTimeout((function(){n.remakeWebsocket()}),n.reconnectLimiter.millisecondsForRetry()))},e.onmessage=function(e){n.messageHandler.receive(e.data)},e.onopen=function(){n.handleOpen()})}},{key:"readyState",value:function(){if(void 0===this._websocket)return"websocket undefined";switch(this._websocket.readyState){case WebSocket.CLOSED:return"closed";case WebSocket.OPEN:return"open";case WebSocket.CLOSING:return"closing";case WebSocket.CONNECTING:return"connecting";default:return"unknown"}}},{key:"ensureConnected",value:function(){var e;void 0!==this._websocket&&this.websocket().readyState===WebSocket.CONNECTING||this.isWebsocketReady()||(debug("restoring websocket"),null===(e=this._websocket)||void 0===e||e.close(),this.remakeWebsocket())}},{key:"websocket",value:function(){return this._websocket}},{key:"isWebsocketReady",value:function(){return void 0!==this._websocket&&this._websocket.readyState===WebSocket.OPEN}},{key:"setConnectedAndAuthed",value:function(){this.reconnectLimiter.reset(),pe({method:"onTitleChange",callback:0,args:[]})&&(0,K.RR)(this.chatConn,this.roomDossier.roomTitle)}},{key:"disconnect",value:function(){this.shouldReconnect=!1,void 0!==this._websocket&&(this._websocket.onclose=function(){},this._websocket.onerror=function(){},this._websocket.close(),this._websocket=void 0),void 0!==this.handlePagehide&&(0,ie.SC)("pagehide",window,this.handlePagehide)}},{key:"handleOpen",value:function(){this.sendMessage("connect",{user:this.roomDossier.chatUserName,password:this.roomDossier.viewerPassword,room:this.roomDossier.room,room_password:this.roomDossier.roomPassword})}},{key:"showReconnectNotice",value:function(){u._.isEnabledForUI()||this.event.roomNotice.fire({messages:[[(0,J.vK)("Trying to reconnect")]],showInPrivateMessage:!0})}},{key:"sendRawMessage",value:function(e){debug(["sending ",e]),this.websocket().send(e)}},{key:"sendMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!u._.isWowzaDisabled())return this.isWebsocketReady()?void this.sendRawMessage(JSON.stringify({method:e,data:t})):(this.ensureConnected(),void this.retryMessage(e,t,0))}},{key:"retryMessage",value:function(e,t,n){var i=this;this.isWebsocketReady()?this.sendRawMessage(JSON.stringify({method:e,data:t})):n<5?window.setTimeout((function(){i.retryMessage(e,t,n+1)}),1e3):(0,x.fg)("WowzaMsgRetryFailed",{method:e,push_active:u._.isEnabledForUI()})}}]),e}(),fe=function(){function e(t){(0,i.Z)(this,e),this.conn=t}return(0,o.Z)(e,[{key:"receive",value:function(e){me&&debug(e);var t=function(e){var t=JSON.parse(e);return{method:t.method,callback:t.callback,args:t.args}}(e);Object.keys(ge).indexOf(t.method)>=0?pe(t)?ge[t.method](this.conn,t):u._.isEnabledForUI()&&"onPersonallyKicked"===t.method&&"rejoined"===t.args[0]&&this.conn.wowzaHandler.disconnect():error("Unknown message method: ".concat(t.method," args: ").concat(e))}}]),e}();function pe(e){return-1!==["onAuthResponse","onPrivateMsg"].indexOf(e.method)||("onNotify"===e.method&&"push_backends"===new p.j(e.args[0]).getString("type")||!u._.isEnabledForUI())}var me=!1;window.debugAllMessages=function(){me=!me,debug("debugAllMessages set to: ".concat(me))};var ve,ge={onAuthResponse:function(e,t){if(1<=t.args.length&&"1"===t.args[0]){var n;switch(n=e.statusAfterConnected,"notconnected"!==e.status&&(n=e.status),n){case"offline":case"away":case"privaterequesting":case"privatenotwatching":case"privatespying":case"hidden":case"hiddenwatching":case"public":e.joinRoom(),e.changeStatus(n);break;case"privatewatching":"notconnected"===e.status?(e.joinPrivateRoom(),e.changeStatus(n)):(0,se.ss)(e.room()).then((function(t){"privatenotwatching"===t.roomStatus&&e.isBroadcasting&&(t.roomStatus="privatewatching"),"privatewatching"===t.roomStatus?e.joinPrivateRoom():e.joinRoom(),e.changeStatus(t.roomStatus)})).catch((function(t){error("Error getting room dossier on reconnect: ".concat(t),{room:e.room()})}));break;default:warn("unexpected status: ".concat(n))}e.wowzaHandler.setConnectedAndAuthed()}else{if(t.args.length>0&&"0"===t.args[0])return;error("Error connecting!",{message:t})}},onRoomCountUpdate:function(e,t){t.args.length<1?error("Invalid onRoomCountUpdate args: ".concat(t.args)):""===t.args[0]||u._.isEnabledForUserList()||e.event.roomCountUpdate.fire(parseInt(t.args[0]))},onRoomMsg:function(e,t){if(""!==t.args[0]){var n=new p.j(t.args[1]);!0!==n.getAny("X-Successful")&&error("X-Successful not true?");var i=de(de({},(0,ae.TU)(t.args[0],n)),{},{isSpam:!0===n.getAny("X-Spam")});(0,K.AO)(e,i)}else t.args.length>1?"Chat disconnected. The broadcaster has set a new password on this room."===t.args[1]?(0,K.x5)(e):e.event.roomNotice.fire({messages:[[(0,J.vK)(t.args[1])]],showInPrivateMessage:!0}):error("roomMessage invalid args: ".concat(t.args))},onNotify:function(e,t){var n=new p.j(t.args[0]),i=n.getString("type");n.ignore("send_to"),n.ignore("to_user"),"function"==typeof ye[i]?(0,ye[i])({conn:e,p:n,fromHistory:t.args.length>1&&"true"===t.args[1]}):error("Unhandled onNotify type ".concat(i),{message:t})},onTitleChange:function(e,t,n){t.args.length<1?error("Invalid onTitleChange args: ".concat(t.args)):t.args.length>1&&"0"===t.args[1]||(0,K.RR)(e,t.args[0],n)},onPrivateMsg:function(e,t){if(!e.pmPushEnabled())if(""!==t.args[0]){var n=(0,ae.VR)(t.args);(0,K.SZ)(n,e.room())}else t.args.length>1?e.event.roomNotice.fire({messages:[[(0,J.vK)(t.args[1])]],showInPrivateMessage:!0}):error("handlePrivateMessage args: ".concat(t.args))},onPromotion:function(e,t){if(2!==t.args.length)error("Invalid onPromotion args: ".concat(t.args));else{var n={username:t.args[0],fromUser:t.args[1]};(0,K.nF)(e,n)}},onRevoke:function(e,t){if(2!==t.args.length)error("Invalid onRevoke args: ".concat(t.args));else{var n={username:t.args[0],fromUser:t.args[1]};(0,K.O0)(e,n)}},onPersonallyKicked:function(e,t){if(1!==t.args.length)error("Invalid onPersonallyKicked args: ".concat(t.args));else{var n,i=t.args[0];"rejoined"===i?(n=T.ag.rejoinedRoomKickedMessage,l.q.setState({privateShowId:""})):"kicked"===i?n=T.ag.kickedFromRoomMessage:(warn("createPersonallyKickedMessage called with unknown argument ".concat(i)),n=T.ag.kickedMessage),(0,K.K9)(e,n)}},onSilence:function(e,t){if(2!==t.args.length)error("Invalid onSilence args: ".concat(t.args));else{var n={username:t.args[0],fromUser:t.args[1]};(0,K.A)(e,n)}},onKick:function(e,t){if(1!==t.args.length)error("Invalid onKick args: ".concat(t.args));else{var n={username:t.args[0],fromUser:e.room()};(0,K.gs)(e,n)}},onNotifyPrivateShowRequest:function(e,t){if(t.args.length<2)error("PrivateShowRequest invalid args: ".concat(t.args));else{var n={userRequesting:t.args[0],tokensPerMinute:parseInt(t.args[1])};(0,K.$l)(e,n)}},onNotifyPrivateShowApprove:function(e,t){1===t.args.length?(0,K.kl)(e):error("Invalid privateShowApprove args: ".concat(t.args))},onNotifyPrivateShowCancel:function(e,t){0!==t.args.length&&error("Invalid privateShowCancel args: ".concat(t.args)),(0,K.yo)(e)},onNotifyLeavePrivateRoom:function(e,t){},onNotifyTokenBalanceUpdate:function(e,t){2!==t.args.length?error("Invalid tokenBalanceUpdate args: ".concat(t.args)):e.event.tokenBalanceUpdate.fire({tokens:Number(t.args[1])})},onNotifyAwayModeCancel:function(e,t){0!==t.args.length&&warn("Invalid awayModeCancel args: ".concat(t.args)),(0,K.Bp)(e)}},ye={tip_alert:function(e){var t=(0,ae.FE)(e.p);(0,K._A)(e.conn,t,e.fromHistory),e.conn.isBroadcasting&&(0,f.Ue)("tipping/get_token_balance/").then((function(t){var n=new p.j(t.responseText);n.getBoolean("success")&&e.conn.event.tokenBalanceUpdate.fire({tokens:n.getNumber("token_balance")})})).catch((function(){}))},log:function(e){if(e.conn.isBroadcasting){var t=e.p.getStringOrUndefined("msg");if(void 0!==t){var n={debugMessage:t,type:e.p.getString("type"),tid:e.p.getString("tid")};(0,K.AS)(e.conn,n)}else error("handleLog with an empty msg")}},refresh_panel:function(e){e.conn.event.refreshPanel.fire(void 0)},app_tab_refresh:function(e){e.conn.event.appTabRefresh.fire(void 0)},appnotice:function(e){var t,n=e.p.getAny("msg"),i=[];if("string"==typeof n)i.push([(0,J.vK)("Notice: ".concat(n))]);else{if(!(n instanceof Array))return void error("handleAppNotice error: Invalid message type ".concat(void 0===n?"undefined":n.toString()));var o,r=le(n);try{for(r.s();!(o=r.n()).done;){var s=o.value;i.push([(0,J.vK)("Notice: ".concat(s))])}}catch(e){r.e(e)}finally{r.f()}}var a=function(){var t=document.body.classList.contains("darkmode"),n=(0,oe.L)("SendNoticeDarkModeOpts")&&t,i=e.p.getStringOrUndefined("foreground"),o=e.p.getStringOrUndefined("background");if(n){var r=e.p.getStringOrUndefined("darkmode_foreground"),s=e.p.getStringOrUndefined("darkmode_background");void 0!==r&&""!==r&&(i=r),void 0!==s&&""!==s&&(o=s)}return{foreground:i,background:o}}(),l=a.foreground,c=a.background,u=null!==(t=e.p.getList("shortcodes"))&&void 0!==t?t:[],d={messages:i,toGroup:e.p.getStringOrUndefined("to_group"),toUser:e.p.getStringOrUndefined("to_user"),background:c,foreground:l,weight:e.p.getStringOrUndefined("weight",!1),showInPrivateMessage:!1,shortcodes:(0,ae.mF)(u),tid:e.p.getString("tid")};e.conn.event.roomNotice.fire(d)},apperrorlog:function(e){if(e.conn.isBroadcasting){var t=e.p.getAny("msg"),n=[];if(n.push([(0,J.vK)("App Error: ")]),"string"==typeof t)n.push([(0,J.vK)(t)]);else{if(!(t instanceof Array))return void error("handleAppErrorLog error: Invalid message type ".concat(void 0===t?"undefined":t.toString()));var i,o=le(t);try{for(o.s();!(i=o.n()).done;){var r=i.value;n.push([(0,J.vK)(r)])}}catch(e){o.e(e)}finally{o.f()}}var s={errorMessages:n,type:e.p.getString("type"),tid:e.p.getString("tid")};(0,K.AS)(e.conn,s)}},clear_app:function(e){e.conn.event.refreshPanel.fire(void 0)},room_entry:function(e){e.conn.roomEntry((0,ae.PU)(e.p))},room_leave:function(e){e.conn.roomLeave((0,ae.PU)(e.p))},spy_room_leave:function(e){"privatespying"===e.conn.status&&e.conn.changeStatus("privatenotwatching")},purchase_notification:function(e){var t=(0,ae.PU)(e.p);!0!==e.p.getBoolean("history")&&warn("purchase history is not true?");var n={fromUser:t,message:e.p.getString("message"),tid:e.p.getString("tid")};(0,K.FO)(e.conn,n),n.fromUser.username===e.conn.username()&&(0,f.Ue)("tipping/get_token_balance/").then((function(t){var n=new p.j(t.responseText);n.getBoolean("success")&&e.conn.event.tokenBalanceUpdate.fire({tokens:n.getNumber("token_balance")})})).catch((function(){}))},settingsupdate:function(e){var t=(0,ae.RE)(e.p);(0,K.Iq)(e.conn,t)},hidden_show_status_change:function(e){if(!e.conn.isBroadcasting){var t=e.p.getBoolean("is_starting")?"hidden":"public",n=e.p.getString("hidden_message");e.p.logUnusedDebugging("handleHiddenShowStatusChange"),(0,K.xH)(e.conn,t,n)}},hidden_show_approve:function(e){(0,K.fd)(e.conn,e.p.getBoolean("initial_hide_cam"))},hidden_show_deny:function(e){"public"!==e.conn.status&&"hiddenwatching"!==e.conn.status||e.conn.changeStatus("hidden")},is_restricted_hls_allowed:function(e){},compliance_image_required:function(e){var t="Compliance Image Required!\nPlease visit ".concat(window.location.host,"/verify on your mobile\n device to verify your identity.\n\nThis is required for broadcasters not showing their face."),n=e.p.getNumberOrUndefined("time");t+=void 0!==n&&n>0?"\n\nYou have ".concat(n," minute").concat(1===n?"":"s"," to complete."):"\n\nYou must complete this to continue broadcasting, failure to do so may result in broadcasting restrictions.",(0,K.Eq)(t)},game_selection:function(e){E.A.selectionChange.fire(E.A.parseSelection(e.p.getObjectStringOrUndefined("game")))},push_backends:function(e){var t=e.p.getStringList("backends");void 0!==t?(u._.changeChatHandler(t),e.conn.wowzaHandler.ensureConnected()):warn("backend change sent with invalid args",{keys:e.p.keys()},"PUSH_")}};function be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==arguments[1]&&arguments[1];(0,i.Z)(this,e),this.d=t,this.previousStatus="offline",this.status="offline",this.isModerator=!1,this.appDebuggingEnabled=!1,this.privateShowRequestingUser="",this.isBroadcasting=!1,this.isNewConnection=!1,this.exploringHashTag="",this.sourceName="un",this.roomCountPresenceThrottle=new y.d((function(){return n.roomCountPresence()}),{debounceType:2,bounceLimitMS:9e4}),this.event={messageSent:new b.xB("messageSent"),roomMessage:new b.xB("roomMessage"),roomNotice:new b.xB("roomNotice"),roomShortcode:new b.xB("roomShortcode"),statusChange:new b.xB("statusChange",{listenersWarningThreshold:15}),hiddenMessageChange:new b.xB("hiddenMessageChange"),refreshPanel:new b.xB("refreshPanel"),titleChange:new b.xB("titleChange"),clearApp:new b.xB("clearApp"),removeMessages:new b.xB("removeMessages"),settingsUpdate:new b.xB("settingsUpdate"),roomCountUpdate:new b.xB("roomCountUpdate"),modStatusChange:new b.xB("modStatusChange"),tokenBalanceUpdate:s.A3,privateShowRequest:new b.xB("privateShowRequest"),playSound:new b.xB("playSound"),appTabRefresh:new b.xB("appTabRefresh"),appDebugLog:new b.xB("appDebugLog"),tipAlert:new b.xB("tipAlert"),leftRoom:new b.xB("leftRoom"),connectionLost:new b.xB("connectionLost"),onBanSilence:new b.xB("onBanSilence")},this.isNewConnection=!1,this.isBroadcasting=this.username()===this.room(),this.viewerIsAnonymous()||(0,r.Rp)(),this.isModerator=t.isModerator,this.roomEntryFor=t.userChatSettings.roomEntryFor,this.roomLeaveFor=t.userChatSettings.roomLeaveFor,this.isBroadcasting?this.statusAfterConnected="public":this.statusAfterConnected=t.roomStatus,this.privatePrice=t.privatePrice,this.spyPrice=t.spyPrice,this.exploringHashTag=this.d.exploringHashTag,this.sourceName=this.d.sourceName,this.wowzaHandler=new he(this.d,this.event,this),o&&(this.pushServiceHandler=new te(this.d,this)),this.changeStatus("notconnected"),this.listenForIgnores()}return(0,o.Z)(e,[{key:"appsRunning",value:function(){return this.d.appsRunning}},{key:"pmPushEnabled",value:function(){return u._.isEnabledForPM()}},{key:"disconnect",value:function(){var e;this.wowzaHandler.disconnect(),null===(e=this.pushServiceHandler)||void 0===e||e.cleanup()}},{key:"changeStatus",value:function(e){e!==this.status&&(debug("Status changing from ".concat(this.status," to ").concat(e)),this.previousStatus=this.status,this.status=e,this.isBroadcasting&&"notconnected"===this.previousStatus&&"public"===this.status&&(0,k.RZ)(),this.event.statusChange.fire({previousStatus:this.previousStatus,currentStatus:this.status}))}},{key:"updateEnterLeaveSettings",value:function(e,t){this.roomEntryFor=e,this.roomLeaveFor=t}},{key:"viewerIsAnonymous",value:function(){return"AnonymousUser"===this.username()}},{key:"isAppDebuggingEnabled",value:function(){return this.appDebuggingEnabled}},{key:"toggleAppDebugging",value:function(){this.appDebuggingEnabled=!this.appDebuggingEnabled,P.GZ.fire(this.appDebuggingEnabled)}},{key:"viewerInPrivateChat",value:function(){switch(this.status){case"privatewatching":return!0;case"privaterequesting":case"privatenotwatching":case"passwordprotected":case"public":case"away":case"hidden":case"hiddenwatching":case"offline":case"privatespying":case"notconnected":return!1;default:return warn("unexpected status: ".concat(this.status)),!1}}},{key:"sendShortcode",value:function(e){var t=this;if(e.shortcodes.map((function(e){return e.code.toLowerCase()})).includes("help"))this.event.roomNotice.fire({messages:[[(0,J.vK)((0,c.gi)(this.room(),this.isBroadcasting))]],showInPrivateMessage:!0});else if(l.J.current.isNoninteractiveUser)(0,h.Cj)(T.ag.internalStaffMessage);else{var n=e.shortcodes.map((function(e){var t={code:e.code};return void 0!==e.msg&&(t.msg=e.msg),void 0!==e.amt&&(t.amt=e.amt),t})),i={room:this.room(),shortcodes:JSON.stringify(n),message:JSON.stringify({m:e.message})},o=l.q.getState().privateShowId;""!==o&&this.inPrivateRoom()&&(i.private_show_id=o),(0,f.I5)("push_service/publish_chat_message_live/",i).then((function(e){var n,i=null!==(n=e.getResponseHeader("x-banned"))&&void 0!==n?n:e.getResponseHeader("x-denied");null!==i&&(i=decodeURIComponent(i),u._.isEnabledForUI()&&t.event.roomNotice.fire({messages:[[(0,J.vK)(i)]],showInPrivateMessage:!0}))})).catch((function(e){t.event.roomNotice.fire({messages:[[(0,J.vK)(T.ag.shortcodeGeneralError)]],showInPrivateMessage:!0})}))}}},{key:"sendRoomMessage",value:function(e){var t=this;if(l.J.current.isNoninteractiveUser)(0,h.Cj)(T.ag.internalStaffMessage);else{this.event.messageSent.fire(void 0),(0,x.fg)("SendRoomMessage");var n=function(e){t.wowzaHandler.sendMessage(t.viewerInPrivateChat()?"messagePrivateRoom":"messageRoom",{room:t.d.room,msg:JSON.stringify({m:e,f:"",c:"",tid:""})})};if(void 0===this.pushServiceHandler)return warn("push service send handler not active",{},"PUSH_"),void n(e);var i=this.viewerInPrivateChat();this.pushServiceHandler.sendMessage(this.d.room,e).then((function(e){t.wowzaHandler.sendMessage(i?"messagePrivateRoom":"messageRoom",{room:t.d.room,msg:JSON.stringify(e)})})).catch((function(t){error("Publishing live message",t,"PUSH_"),n(e)}))}}},{key:"updateRoomCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];u._.isEnabledForUserList()||this.wowzaHandler.sendMessage("updateRoomCount",{room_uid:this.d.roomUid,model_name:this.room(),private_room:this.inPrivateRoom()}),e?this.roomCountPresence():this.roomCountPresenceThrottle.callFunc()}},{key:"roomCountPresence",value:function(){var e=this;if(l.J.current.isNoninteractiveUser)return Promise.resolve();var t=l.q.getState().privateShowId,n={presence_id:u._.presenceId};""!==t&&this.inPrivateRoom()&&(n.private_show_id=t);var i="push_service/room_user_count/".concat(this.room(),"/?").concat((0,I.Ie)(n));return(0,f.Ue)(i).then((function(t){if(u._.isEnabledForUserList()){var n=new p.j(t.responseText).getNumber("count");e.event.roomCountUpdate.fire(n),u._.setVerifierRoomCount(n)}})).catch(S.$x)}},{key:"kickUser",value:function(e){this.wowzaHandler.sendMessage("kickUser",{user:e,room:this.room()})}},{key:"requestPrivateShow",value:function(e,t,n){var i=this;return new Promise((function(o,r){"public"===i.status?(i.wowzaHandler.ensureConnected(),(0,f.I5)("tipping/private_show_request/".concat(i.room(),"/"),{chat_username:i.username(),price:"".concat(e),private_show_minimum_minutes:"".concat(t),recordings_allowed:"".concat(n)}).then((function(e){var t=new p.j(e.responseText),n=t.getBoolean("success"),s=t.getString("message",!1);if(!n)return""===s&&(error("unknown cannot start private show reason"),s="Cannot start private show."),void r(s);t.logUnusedDebugging("privateShowRequest"),i.changeStatus("privaterequesting"),l.q.setState({roomStatus:"privaterequesting"}),i.event.roomNotice.fire({messages:[[(0,J.vK)(T.ag.privateShowRequestMessage)]],foreground:"#222",background:"#ff8b45",weight:"bold",showInPrivateMessage:!0}),o()})).catch((function(e){r(e)}))):r("unexpected status: ".concat(i.status))}))}},{key:"requestSpyShow",value:function(){var e=this;return new Promise((function(t,n){"privatenotwatching"===e.status?(e.wowzaHandler.ensureConnected(),(0,f.I5)("tipping/spy_on_private_show_request/".concat(e.room(),"/"),{chat_username:e.username()}).then((function(i){var o=new p.j(i.responseText),r=o.getBoolean("success"),s=o.getString("message",!1);if(o.logUnusedDebugging("parseRequestResult"),!r)return""===s&&(s="Error joining spy show"),void n(s);e.changeStatus("privatespying"),l.q.setState({roomStatus:"privatespying"}),e.event.roomNotice.fire({messages:[[(0,J.vK)("You are spying on the private show")]],foreground:"#222",background:"#ff8b45",weight:"bold",showInPrivateMessage:!0}),t()})).catch((function(e){n(e)}))):n("unexpected status: ".concat(e.status))}))}},{key:"leavePrivateOrSpyShow",value:function(){var e=this;return new Promise((function(t,n){var i="tipping/private_show_cancel/".concat(e.room(),"/"),o=e.status;(0,f.I5)(i,{}).then((function(i){var r=new p.j(i.responseText),s=r.getBoolean("success"),a=r.getNumber("remaining_seconds"),c=r.getStringWithNumbers("private_show_minimum_minutes");switch(r.logUnusedDebugging("parseCancelResult"),o){case"privatewatching":if(!s){if(0===a)n(T.ag.privateShowRequestCancelErrorMessage);else{var u=Math.floor(a/60),d=a%60;n(T.ag.cannotCancelPrivate(c,u,d))}return}break;case"privatespying":if(!s)return void n(T.ag.unableToCancelSpyShow);e.changeStatus("privatenotwatching"),l.q.setState({roomStatus:"privatenotwatching"});break;case"privaterequesting":if(!s)return void n(T.ag.unableToCancelPrivateRequest);break;default:if(warn("unable to leave private show from status: ".concat(o)),!s)return void n(T.ag.unableToLeavePrivateShow(o))}t()})).catch(n)}))}},{key:"joinRoom",value:function(){this.wowzaHandler.sendMessage("joinRoom",{room:this.room(),exploringHashTag:this.exploringHashTag,source_name:this.sourceName}),this.exploringHashTag="",this.sourceName="df"}},{key:"leaveRoom",value:function(){this.wowzaHandler.sendMessage("leaveRoom",{room:this.room()})}},{key:"joinPrivateRoom",value:function(){var e=this;window.setTimeout((function(){e.wowzaHandler.sendMessage("joinPrivateRoom",{room:e.room()})}),500)}},{key:"leavePrivateRoom",value:function(){this.wowzaHandler.sendMessage("leavePrivateRoom",{room:this.room()})}},{key:"inPrivateRoom",value:function(){return"privatewatching"===this.status}},{key:"setPrivateShowRequestingUser",value:function(e){this.privateShowRequestingUser=e}},{key:"getPrivateShowUser",value:function(){return this.inPrivateRoom()?this.privateShowRequestingUser:""}},{key:"room",value:function(){return this.d.room}},{key:"age",value:function(){return this.d.age}},{key:"username",value:function(){return this.d.userName}},{key:"ignore",value:function(e){var t=this;if((0,m.TF)())return this.event.roomNotice.fire({messages:[[(0,J.vK)(T.ag.loginToUseFeature)]],showInPrivateMessage:!0}),new Promise((function(){return!1}));if(this.d.room===this.username())return error("Error: cannot ignore users in this room"),new Promise((function(){return!1}));var n="".concat(this.username(),"-hitMaxIgnore"),i=(0,r.ey)().size>=r.nS;return new Promise((function(o){var s=function(){i&&(0,g.C)(n,"1",30);var s=(0,r.ey)();(0,r.qn)(e).then((function(n){if(n){var i,a=(0,r.ey)(),l=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return be(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)?be(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(s);try{for(l.s();!(i=l.n()).done;){var c=i.value;a.has(c)||t.event.roomNotice.fire({messages:[[(0,J.vK)(T.ag.removedOldestIgnore(c))]],showInPrivateMessage:!0})}}catch(e){l.e(e)}finally{l.f()}}else t.event.roomNotice.fire({messages:[[(0,J.vK)(T.ag.errorIgnoringUser(e))]],showInPrivateMessage:!0});o(n)})).catch(void 0)};void 0===(0,g.sv)(n)&&i?(0,h.oB)(T.ag.reachedMaxIgnore,s):s()}))}},{key:"unignore",value:function(e){var t=this;return(0,r.jr)(e).then((function(n){return n||t.event.roomNotice.fire({messages:[[(0,J.vK)(T.ag.errorUnignoringUser(e))]],showInPrivateMessage:!0}),n}))}},{key:"isIgnored",value:function(e){return(0,r.WU)(e)}},{key:"listenForIgnores",value:function(){var e,t=this,n=null===(e=l.J.current.loggedInUser)||void 0===e?void 0:e.userUid;if(void 0!==n){var i=new d.zw(n).onMessage.listen((function(e){if(e.isIgnored){var n=T.ag.ignoringUser(e.username);t.event.roomNotice.fire({messages:[[(0,J.vK)(n)]],showInPrivateMessage:!0})}else{var i=T.ag.noLongerIgnoring(e.username);t.event.roomNotice.fire({messages:[[(0,J.vK)(i)]],showInPrivateMessage:!0})}}));v.QN.once((function(){return i.removeListener()}),!1)}}},{key:"roomEntry",value:function(t){if(e.updateUserInfoFromHashtag(t),this.shouldShowJoinLeaveMessage(this.roomEntryFor,t)){var n=this.isBroadcasting?t.exploringHashTag:"",i=[(0,J.vK)((0,C.Ng)(this.room(),t)),(0,J.iL)(t),(0,J.vK)(" ".concat(T.ag.roomJoinedMessage))];""!==n?(i.push((0,J.vK)(" (from ")),i.push((0,J.aB)(n,[n])),i.push((0,J.vK)(")"))):this.isBroadcasting&&"pr"===t.sourceName?i.push((0,J.vK)(" via promotion")):this.isBroadcasting&&"fn"===t.sourceName&&i.push((0,J.vK)(" via online announcement")),i.push((0,J.vK)(".")),this.event.roomNotice.fire({messages:[i],showInPrivateMessage:t.username===this.username(),dataNick:t.username})}}},{key:"roomLeave",value:function(t){if(this.shouldShowJoinLeaveMessage(this.roomLeaveFor,t)){var n=" ".concat(T.ag.roomLeftMessage);t.isBroadcaster&&!e.noFollowMessageInStatus.has(this.status)&&(n+=" ".concat(T.ag.roomFollowToGetNotified)),this.event.roomNotice.fire({messages:[[(0,J.vK)((0,C.Ng)(this.room(),t)),(0,J.iL)(t),(0,J.vK)(n)]],showInPrivateMessage:t.username===this.username(),dataNick:t.username})}}},{key:"shouldShowJoinLeaveMessage",value:function(e,t){if(t.username===this.username())return!1;if(t.username===(0,a.RH)())return!0;if((0,w.$_)()&&this.inPrivateRoom())return!1;if((0,r.WU)(t.username))return!1;switch(e){case 3:return!1;case 2:if(t.username===this.room()||t.isMod||t.inFanclub)return!0;break;case 1:if(t.username===this.room()||t.isMod||t.inFanclub||t.hasTokens&&(this.isBroadcasting||this.isModerator))return!0;break;case 0:if(t.username===this.room()||t.isMod||t.inFanclub||this.isBroadcasting||this.isModerator)return!0;break;default:return error("Invalid EnterLeaveSetting"),!1}return!1}}],[{key:"updateUserInfoFromHashtag",value:function(e){switch(e.exploringHashTag){case"promotion":e.exploringHashTag="",e.sourceName="pr";break;case"onlineannouncement":e.exploringHashTag="",e.sourceName="fn"}}}]),e}();(ve=we).privateViewStatuses=["privatewatching","privatenotwatching","privatespying"],ve.noFollowMessageInStatus=new Set(ve.privateViewStatuses)},5011:function(e,t,n){"use strict";n.d(t,{FE:function(){return w},PU:function(){return p},QY:function(){return v},RE:function(){return C},TU:function(){return m},VR:function(){return b},Vi:function(){return y},Vu:function(){return x},fE:function(){return S},lt:function(){return k},mF:function(){return T},p0:function(){return g},yp:function(){return f}});var i=n(4649),o=n(2800),r=n(6698),s=n(391),a=n(1282),l=n(1090);function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(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)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(n);try{for(o.s();!(i=o.n()).done;){var s=i.value;this.hashtagParts.push(s.substr(1))}}catch(e){o.e(e)}finally{o.f()}}this.stringParts=t.split(/#[a-z0-9\-_]{2,50}/g)})),f=n(9545),p=n(3543),m=n(9420),v=n(1090);function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:p.ag.kickedFromRoomMessage;e.event.roomNotice.fire({messages:[[(0,v.vK)(t)]],showInPrivateMessage:!0}),e.changeStatus("notconnected")}function R(e){e.changeStatus("passwordprotected"),e.event.roomNotice.fire({messages:[[(0,v.vK)(p.ag.chatDisconnectedMessage)]],showInPrivateMessage:!0})}function M(e,t){e.event.removeMessages.fire({username:t.username}),(e.username()===t.fromUser||e.username()===t.username||e.username()===e.room()||e.isModerator)&&e.event.roomNotice.fire({messages:[[(0,v.vK)(p.ag.silenceMessage(t.username,t.fromUser))]],showInPrivateMessage:[t.fromUser,t.username].includes(e.username())}),e.event.onBanSilence.fire({silenced:t.username,silencer:t.fromUser,isBan:!1})}function A(e,t){e.event.removeMessages.fire({username:t.username}),"privatenotwatching"===e.status||"privatespying"===e.status||e.username()!==t.fromUser&&!e.isModerator||e.event.roomNotice.fire({messages:[[(0,v.vK)(p.ag.userKickedAndMessagesRemovedMessage(t.username))]],showInPrivateMessage:t.username===e.username()}),e.event.onBanSilence.fire({silenced:t.username,silencer:t.fromUser,isBan:!0})}function E(e,t){if(e.setPrivateShowRequestingUser(t.userRequesting),e.event.privateShowRequest.fire(t),e.isBroadcasting){switch(e.status){case"public":case"away":break;default:warn("unexpected status: ".concat(e.status))}e.changeStatus("privaterequesting"),e.isBroadcasting&&e.event.playSound.fire("PrivateShow")}}function B(e){switch(e.status){case"public":e.changeStatus("privatenotwatching");break;case"privaterequesting":e.leaveRoom(),e.joinPrivateRoom(),e.changeStatus("privatewatching");break;default:warn("private show approve unexpected status: ".concat(e.status))}var t=(0,v.vK)(p.ag.privateShowStartedMessage);"privatewatching"===e.status?(e.event.roomNotice.fire({messages:[[t]],foreground:"#222",background:"#ff8b45",weight:"bold",showInPrivateMessage:!0}),e.isBroadcasting&&!c.J.current.isMobile&&e.event.roomNotice.fire({messages:[[(0,v.vK)(p.ag.privateShowC2cTip)]],showInPrivateMessage:!0})):e.event.roomNotice.fire({messages:[[t,(0,v.vK)(" ("),{partType:3},(0,v.vK)(")")]],foreground:"#222",background:"#ff8b45",weight:"bold",showInPrivateMessage:!0})}function O(e){var t=function(){e.changeStatus("away"),e.event.roomNotice.fire({messages:[[(0,v.vK)(p.ag.privateShowFinishedMessage)]],foreground:"#222",background:"#ff8b45",weight:"bold",showInPrivateMessage:!0})};switch(e.status){case"privaterequesting":e.changeStatus("public"),e.event.roomNotice.fire({messages:[[(0,v.vK)(p.ag.privateShowDeclinedMessage)]],foreground:"#222",background:"#ff8b45",weight:"bold",showInPrivateMessage:!0});break;case"away":case"hidden":case"public":case"offline":case"hiddenwatching":break;case"privatewatching":e.leavePrivateRoom(),e.joinRoom(),t();break;case"privatespying":case"privatenotwatching":t();break;default:warn("privateShowCancel wrong room status: ".concat(e.status))}}function L(e){switch(e.status){case"away":case"public":case"privaterequesting":e.event.roomNotice.fire({messages:[[(0,v.vK)(p.ag.returnFromAwayModeMessage)]],foreground:"#222",background:"#ff8b45",weight:"bold",showInPrivateMessage:!0}),e.changeStatus("public");break;default:error("unexpected state: ".concat(e.status))}}function D(e,t){var n;arguments.length>2&&void 0!==arguments[2]&&arguments[2]||e.event.playSound.fire((n=t.amount)>=1e3?"HugeTip":n>=500?"LargeTip":n>=100?"MediumTip":n>=15?"SmallTip":"TinyTip"),e.event.tipAlert.fire(t);var i=[w(t),(0,v.vK)(" tipped ".concat(t.amount," ").concat(t.amount>1?"tokens":"token"))];t.isAnonymousTip&&i.push((0,v.vK)(" anonymously")),e.isBroadcasting&&""!==t.message&&i.push((0,v.vK)(" -- ".concat(t.message))),e.event.roomNotice.fire({messages:[i],background:"#ff3",foreground:"#000",weight:"bold",showInPrivateMessage:t.fromUser.username===e.username()||e.isBroadcasting,dataNick:t.fromUser.username,ts:t.ts})}function U(e,t){if("log"===t.type&&void 0!==t.debugMessage)e.event.appDebugLog.fire(t.debugMessage);else if("apperrorlog"===t.type&&void 0!==t.errorMessages){var n={messages:t.errorMessages,showInPrivateMessage:!1};e.event.roomNotice.fire(n)}else error("handleAppDebugError invalid type",t)}function Z(e,t){var n,i=[],o=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return g(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)?g(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(t.message.split(new RegExp("\\b".concat(t.fromUser.username,"\\b"),"gi")));try{for(o.s();!(n=o.n()).done;){var r=n.value;""===r||i.push((0,v.vK)(r)),i.push((0,v.iL)(t.fromUser))}}catch(e){o.e(e)}finally{o.f()}i.pop(),e.event.roomNotice.fire({messages:[i],background:"#33ff33",foreground:"#000",weight:"bold",showInPrivateMessage:t.fromUser.username===e.username(),ts:t.ts})}function F(e,t){if(e.event.settingsUpdate.fire(t),t.allowPrivateShow){if(e.privatePrice!==t.privatePrice){e.privatePrice=t.privatePrice;var n=(0,v.vK)(p.ag.privateShowPriceChangeMessage(e.room(),t.privatePrice));e.event.roomNotice.fire({messages:[[n]],showInPrivateMessage:!0})}if(e.spyPrice!==t.spyPrice&&0!==t.spyPrice){e.spyPrice=t.spyPrice;var i=(0,v.vK)(p.ag.spyShowPriceChangeMessage(e.room(),t.spyPrice));e.event.roomNotice.fire({messages:[[i]],showInPrivateMessage:!0})}}}function _(e,t,n){if(!e.isBroadcasting){switch(e.event.hiddenMessageChange.fire(n),e.status){case"privaterequesting":e.leavePrivateOrSpyShow().catch(f.$x);break;case"public":case"hidden":case"hiddenwatching":case"offline":break;default:error("handleHiddenShowStatusChange unexpected status: ".concat(e.status))}"public"===t?window.setTimeout((function(){e.changeStatus("public")}),3e3):e.changeStatus(t)}}function N(e,t){t?window.setTimeout((function(){e.changeStatus("hiddenwatching")}),2e3):e.changeStatus("hiddenwatching")}var j=!1;function H(e){j||(j=!0,(0,u.Cj)(e,(function(){j=!1})))}},1090:function(e,t,n){"use strict";function i(e){return{partType:1,message:e}}function o(e){return{partType:0,user:e}}function r(e,t){return-1!==t.indexOf(e)?{partType:2,message:e}:i("#".concat(e))}n.d(t,{aB:function(){return r},iL:function(){return o},vK:function(){return i}})},5042:function(e,t,n){"use strict";n.d(t,{Bi:function(){return s},_c:function(){return o},qm:function(){return a},rr:function(){return l},vq:function(){return r}});var i={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",orange:"#ffa500",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"};function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{red:200,green:200,blue:200},n=e.toLowerCase();if(n=function(e){if(/^[a-z]+$/.test(e)){var t=i[e];if(void 0!==t)return t}return e}(n),r(n))return function(e){4===e.length&&(e="#".concat(e[1]).concat(e[1]).concat(e[2]).concat(e[2]).concat(e[3]).concat(e[3]));var t=Number("0x".concat(e.substring(1)));return{red:t>>16&255,green:t>>8&255,blue:255&t}}(n);if(0===n.indexOf("rgb")){var o=e.match(/\d+(\.\d+)?%?/g);if(null===o||o.length<3||o.length>4)return t;o=[o[0],o[1],o[2]];for(var s=[],a=0;a<3;a+=1)-1!==o[a].indexOf("%")?s[a]=Math.round(2.55*parseFloat(o[a])):s[a]=Number(o[a]),s[a]<0?s[a]=0:s[a]>255&&(s[a]=255);return{red:s[0],green:s[1],blue:s[2]}}return debug('Cannot parse color: "'.concat(e,'"')),t}function r(e){return/^#([a-fA-F0-9]{3}){1,2}$/.test(e)}function s(e,t,n){var i=n*t,o=i*(1-Math.abs(e/60%2-1)),r=n-i,s=Math.round(255*(i+r)),a=Math.round(255*(o+r)),l=Math.round(255*r);return e<=60?{red:s,green:a,blue:l}:e<=120?{red:a,green:s,blue:l}:e<=180?{red:l,green:s,blue:a}:e<240?{red:l,green:a,blue:s}:e<=300?{red:a,green:l,blue:s}:{red:s,green:l,blue:a}}function a(e){var t,n,i=o(e),r=i.red/255,s=i.green/255,a=i.blue/255,l=Math.max(r,s,a),c=l-Math.min(r,s,a);return(t=0===c?0:l===r?(s-a)/c*60:l===s?60*((a-r)/c+2):60*((r-s)/c+4))<0&&(t+=360),n=0===l?0:c/l,{hue:Math.round(t),saturation:Number(n.toFixed(3)),value:Number(l.toFixed(3))}}function l(e){return(e.red>255||e.green>255||e.blue>255||e.red<0||e.green<0||e.blue<0)&&error("Invalid rgb color value: r: ".concat(e.red,", g: ").concat(e.green,", b: ").concat(e.blue)),"000000".concat((e.red<<16|e.green<<8|e.blue).toString(16)).slice(-6)}},4793:function(e,t,n){"use strict";n.d(t,{OT:function(){return u},QN:function(){return r},Sb:function(){return l},Z2:function(){return s},jr:function(){return c},kN:function(){return o},q:function(){return a}});var i=n(1794),o=new i.xB("roomLoaded",{listenersWarningThreshold:function(){return 100+3*i.q6},maxHistorySize:1}),r=new i.xB("roomCleanup",{listenersWarningThreshold:25}),s=new i.xB("userViewedPm"),a=new i.xB("tipSent"),l=new i.xB("externalChatMessage"),c=new i.xB("context"),u=new i.xB("context")},1163:function(e,t,n){"use strict";n.d(t,{W:function(){return w}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(7397),u=n(2800),d=n(8821),h=n(2359),f=n(5726),p=n(4043),m=n(2648),v=n(10),g=n(3543),y=n(47),b=n(9420);var w=function(e){(0,s.Z)(w,e);var t,n,m=(t=w,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function w(e){var t;return(0,i.Z)(this,w),(t=m.call(this)).chatConn=e,t}return(0,o.Z)(w,[{key:"initListeners",value:function(){var e=this;(0,r.Z)((0,l.Z)(w.prototype),"initListeners",this).call(this),c.Ql.listen((function(t){t.isOpen&&e.dontNotify.add(t.username)}))}},{key:"shouldNotify",value:function(e){var t=(0,d.$_)()&&this.chatConn.inPrivateRoom()&&(e===this.chatConn.getPrivateShowUser()||e===this.chatConn.room());return(0,r.Z)((0,l.Z)(w.prototype),"shouldNotify",this).call(this,e)&&!t}},{key:"createChatLinkMessage",value:function(e){var t={marginLeft:".5em"},n=this.createDmChatLink(e),i=this.createPmChatLink(e),o=u.J.current.isMobile&&(0,d.$_)()&&e!==this.chatConn.room(),r=(0,y.vz)("span",null,(0,y.vz)("span",{style:t},"(",n,")"),!o&&(0,y.vz)("span",{style:t},"(",i,")"));return h.p.setMessageColorData(r,(0,f.Q0)("#aaaaaa")),(0,v.PJ)(g.ag.newConversationMessageNotice(e),r)}},{key:"createDmChatLink",value:function(e){return this.createChatLink(g.ag.newConversationDmClick,(function(){c.nh.fire(e),u.J.current.isMobile&&p.ah.fire(!0)}))}},{key:"createPmChatLink",value:function(e){return u.J.current.isMobile?this.createChatLink(g.ag.newConversationPmClickMobile,(function(){(0,d.$_)()?p.qF.fire("private"):b.sC.fire({username:e,focus:!0,showSupporterAlert:!1})})):(0,y.vz)("span",{onClick:function(t){t.target instanceof HTMLAnchorElement&&b.sC.fire({username:e,focus:!0,showSupporterAlert:!1})},dangerouslySetInnerHTML:{__html:g.ag.newConversationPmClickHTML}})}},{key:"createChatLink",value:function(e,t){return(0,y.vz)("a",{style:{cursor:"pointer"},colorClass:["msg-link","underline-link"],onClick:t},e)}}]),w}(m.f)},6767:function(e,t,n){"use strict";function i(e){var t=e.length+1;return document.cookie.split(";").map((function(e){return e.trim()})).filter((function(n){return n.substring(0,t)==="".concat(e,"=")})).map((function(e){return decodeURIComponent(e.substring(t))}))[0]}function o(e){var t;return null!==(t=i(e))&&void 0!==t?t:""}function r(e,t,n){s(e,t,86400*n)}function s(e,t,n){var i=new Date;i.setTime(i.getTime()+1e3*n),document.cookie="".concat(e,"=").concat(t,"; expires=").concat(i.toUTCString(),"; path=/")}function a(e,t){document.cookie="".concat(e,"=").concat(t,"; path=/")}function l(e){var t=i(e);if(void 0===t)return t;var n=parseInt(t);return isNaN(n)?void 0:n}function c(e){var t=i(e);return"true"===t||"false"!==t&&void 0}function u(e){s(e,"",-1)}n.d(t,{C:function(){return r},RD:function(){return l},Uj:function(){return a},YM:function(){return s},kT:function(){return u},ld:function(){return c},sv:function(){return i},ve:function(){return o}})},7988:function(e,t,n){"use strict";n.d(t,{F3:function(){return c},Fi:function(){return u},Sn:function(){return s},cQ:function(){return a},jV:function(){return d},xg:function(){return l}});var i=n(4649);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function r(e){for(var t=1;ti?o.height=i-o.top:o.heighti?o.width=i-o.left:o.width=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==arguments[1]&&arguments[1]&&this.setCaretToEnd(),this.focus(!0),this.forceRequestedRecordUndo(),this.areAnyContentsSelected()){var t=window.getSelection();null!==t&&t.rangeCount>0&&t.getRangeAt(0).deleteContents()}if(e=(e=e.replace(/\r?\n|\r/g," ")).replace(/ /g," "),""!==(e=n.truncateString(e,this.getAvailableLength()))){var o=this.createDivForText(e),r=window.getSelection();if(null!==r&&r.rangeCount>0){var s,a=r.getRangeAt(0),l=(0,i.Z)(o.childNodes).reverse(),c=l[0],u=w(l);try{for(u.s();!(s=u.n()).done;){var d=s.value;a.insertNode(d)}}catch(e){u.e(e)}finally{u.f()}a.setStartAfter(c),a.collapse(!0),r.removeAllRanges(),r.addRange(a)}this.onInputChanged(),this.updatePlaceholderVisibility(),this.scrollToSavedCaret()}}}},{key:"createDivForText",value:function(e){var t=document.createElement("div");if(t.textContent=e,!(0,c.IF)()){var n={unselectable:"on"};twemoji.parse(t,{attributes:function(e){return n}})}return t}},{key:"appendText",value:function(e){this.insertText(e,!0)}},{key:"clearText",value:function(){if(""!==this.getText()){this.forceRequestedRecordUndo();var e=window.getSelection();if(null!==e){var t=document.createRange();t.selectNodeContents(this.element),e.removeAllRanges(),e.addRange(t),t.deleteContents(),t.collapse(!0)}this.onInputChanged()}}},{key:"getText",value:function(){var e,t="",n=!1,i=w(this.element.childNodes);try{for(i.s();!(e=i.n()).done;){var o=e.value;if(o instanceof HTMLImageElement)t+=o.alt,n=!0;else{if(o===this.placeholder)continue;null!==o.textContent&&(!n||":"!==o.textContent[0]&&"@"!==o.textContent[0]||(t+=" "),t+=o.textContent,n=!1)}}}catch(e){i.e(e)}finally{i.f()}return t.replace(/\s/g," ")}},{key:"getAvailableLength",value:function(){return this.maxLength-this.getText().length}},{key:"setCaretToEnd",value:function(){var e=window.getSelection();if(null!==e){var t=document.createRange();t.selectNodeContents(this.element),t.collapse(!1),e.removeAllRanges(),e.addRange(t),this.saveCaretPos()}}},{key:"setCaretToEndOfSelection",value:function(){var e=window.getSelection();if(null!==e){var t=e.getRangeAt(e.rangeCount-1);t.selectNodeContents(this.element),t.collapse(!1),e.removeAllRanges(),e.addRange(t)}}},{key:"setCurrentNodeText",value:function(e){document.activeElement!==this.element&&this.restoreCaretPos();var t=this.getNodeAtCaret(),n=window.getSelection();if(null!==n){t.textContent=e;var i=document.createRange();i.selectNodeContents(t),i.collapse(!1),n.removeAllRanges(),n.addRange(i)}}},{key:"getCurrentNodeText",value:function(){var e=this.getNodeAtCaret();return null!==e.textContent?e.textContent.replace(/\s/g," "):""}},{key:"selectCurrentNodeTail",value:function(e){var t=this.getNodeAtCaret(),n=window.getSelection();if(null!==n&&n.rangeCount>0){var i=document.createRange();i.selectNodeContents(t),i.setStart(t,e),this.scrollToSavedCaret(),n.removeAllRanges(),n.addRange(i)}}},{key:"deleteSelection",value:function(){var e=window.getSelection();if(null!==e&&e.rangeCount>0){var t=e.getRangeAt(0);t.startContainer!==this.element&&this.element.contains(t.startContainer)&&(this.requestRecordUndo(!1),t.deleteContents(),this.onInputChanged())}}},{key:"focus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];document.activeElement!==this.element&&document.body.contains(this.element)&&(t&&!(0,p.PZ)(this.element)&&(this.element.scrollIntoView(!1),window.scrollBy(0,12)),this.element.focus(),e?this.restoreCaretPos():this.setCaretToEnd(),this.scrollToSavedCaret())}},{key:"blur",value:function(){this.element.blur()}},{key:"disable",value:function(){this.blur(),this.element.contentEditable="false"}},{key:"enable",value:function(){this.element.contentEditable="true"}},{key:"setPlaceholder",value:function(e,t){void 0===this.placeholder?(this.placeholder=document.createElement("span"),this.placeholder.textContent=e,this.placeholder.style.pointerEvents="none",this.placeholder.contentEditable="false",void 0!==t&&(0,u.vP)(this.placeholder,t),this.element.appendChild(this.placeholder)):this.placeholder.textContent=e}},{key:"submit",value:function(){if(this.submitInput()){if(!(0,c.IF)())for(var e=this.element.innerHTML,t=/]+alt="?([^"\s]+)"?\s*/g,n=t.exec(e);null!==n;)(0,y.fg)("emojiSent",{value:n[1]}),n=t.exec(e);this.clearText(),this.blur()}}},{key:"onPossibleEmoji",value:function(){var e=window.getSelection();if(null!==e&&e.rangeCount>0){var t=this.getNodeAtCaret();if(null!==t.textContent&&twemoji.test(t.textContent)){var n=t.textContent,i=document.createRange();i.selectNodeContents(t),e.removeAllRanges(),e.addRange(i),i.deleteContents(),this.insertText(n);var o=this.getNodeAtCaret();""!==o.textContent&&(i.setStartBefore(o),i.collapse(!0),e.removeAllRanges(),e.addRange(i),this.saveCaretPos())}}}},{key:"areAnyContentsSelected",value:function(){var e=window.getSelection();if(null!==e&&e.rangeCount>0&&document.activeElement===this.element){var t=e.getRangeAt(0);if(t.startContainer!==t.endContainer||t.startOffset!==t.endOffset)return!0}return!1}},{key:"willKeyEventViolateMaxLength",value:function(e){return!(this.getAvailableLength()>0)&&!e.ctrlKey&&!e.metaKey&&(0,g.r)(e.which)&&-1===["Backspace","Delete"].indexOf(e.key)&&!this.areAnyContentsSelected()}},{key:"onInputChanged",value:function(){this.saveCaretPos(),this.requestRecordUndo(!0)}},{key:"requestRecordUndo",value:function(e){var t=this;window.clearTimeout(this.recordUndoTimeout),this.recordUndoTimeout=-1,this.disableRequestUndo||(e?this.recordUndoTimeout=window.setTimeout((function(){t.recordUndo(),t.recordUndoTimeout=-1}),300):this.recordUndo())}},{key:"forceRequestedRecordUndo",value:function(){-1!==this.recordUndoTimeout&&(window.clearTimeout(this.recordUndoTimeout),this.recordUndoTimeout=-1,this.recordUndo())}},{key:"recordUndo",value:function(){this.saveCaretPos();var e=this.getText();this.undoStack.splice(this.undoPointer+1,this.undoStack.length),this.undoStack[this.undoStack.length-1].inputContent===e&&this.undoStack.pop();var t=(0,i.Z)(this.element.childNodes).map((function(e){return e.cloneNode(!0)}));this.undoStack.push({inputContent:e,inputNodes:t,savedCaret:this.savedCaret}),this.undoStack.length>20&&this.undoStack.shift(),this.undoPointer=this.undoStack.length-1,this.keepBrowserUndoAvailable(!1)}},{key:"doUndo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,y.fg)(e?"BrowserTriggeredUndo":"HotkeyTriggeredUndo"),this.undoPointer!==this.undoStack.length-1||e||this.requestRecordUndo(!1),this.undoPointer>0&&(this.undoPointer-=1,this.applyUndoData(this.undoStack[this.undoPointer]),this.keepBrowserUndoAvailable(!0))}},{key:"doRedo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,y.fg)(e?"BrowserTriggeredRedo":"HotkeyTriggeredRedo"),this.undoPointer0){var i=n.getRangeAt(0);n.removeAllRanges(),t(),n.addRange(i)}else t();this.restoringBrowserUndo=!1}}},{key:"getNodeAtCaret",value:function(){return this.saveCaretPos(),0===this.element.childNodes.length?this.element:-1===this.savedCaret.nodeIdx?this.element.childNodes[0]:this.element.childNodes[this.savedCaret.nodeIdx]}},{key:"caretLeftOffset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.getCaretRange(e).getBoundingClientRect().left}},{key:"caretXPos",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.caretLeftOffset(e)-this.element.getBoundingClientRect().left}},{key:"caretAtEndOfInput",value:function(){var e=this.getCurrentNodeText().length;return!(e>0&&this.savedCaret.nodeOffset!==e)&&!(0,i.Z)(this.element.childNodes).slice(this.savedCaret.nodeIdx+1).some((function(e){var t,n;return"IMG"===e.nodeName||(null!==(t=null===(n=e.textContent)||void 0===n?void 0:n.length)&&void 0!==t?t:0)>0}))}},{key:"getCaretWordStartRange",value:function(e){var t,n,i=e.startContainer;if(0===(null!==(t=null==i||null===(n=i.textContent)||void 0===n?void 0:n.length)&&void 0!==t?t:0))return e;if(null!==window.getSelection()){for(;e.startOffset>0;){var o=e.toString();if(/^\s/.test(o)){e.setStart(i,e.startOffset+1);break}e.setStart(i,e.startOffset-1)}return e}return document.createRange()}},{key:"getCaretRange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=document.createRange();if(0===this.element.childNodes.length)return t.setStart(this.element,0),t;var n=this.element.childNodes[this.savedCaret.nodeIdx];return-1===this.savedCaret.nodeIdx?t.setStartBefore(this.element.childNodes[0]):""===n.textContent?t.setStartAfter(n):t.setStart(n,this.savedCaret.nodeOffset),e?this.getCaretWordStartRange(t):t}},{key:"saveCaretPos",value:function(){var e=window.getSelection();if(null!==e&&e.rangeCount>0&&document.activeElement===this.element){var t,n=e.getRangeAt(0).cloneRange();if(n.collapse(!1),-1===(t=n.startContainer===this.element?n.startOffset-1:Array.from(this.element.childNodes).indexOf(n.startContainer)))this.savedCaret={nodeIdx:-1,nodeOffset:-1};else if(""===this.element.childNodes[t].textContent)this.savedCaret={nodeIdx:t,nodeOffset:-1};else{var i=this.element.childNodes[t].textContent,o=n.startContainer===this.element?i.length:n.startOffset;this.savedCaret={nodeIdx:t,nodeOffset:o}}}}},{key:"restoreCaretPos",value:function(){if(!(0===this.element.childNodes.length||this.savedCaret.nodeIdx>=this.element.childNodes.length)){var e=window.getSelection();if(null!==e){var t=this.getCaretRange();t.collapse(!0),e.removeAllRanges(),e.addRange(t)}}}},{key:"scrollToSavedCaret",value:function(){var e=0;if(-1!==this.savedCaret.nodeIdx){var t=this.element.childNodes[this.savedCaret.nodeIdx],n=document.createRange();n.setStart(this.element,0),n.setEndAfter(t),e=n.getBoundingClientRect().width}e+=3,this.element.scrollLeft=Math.max(this.element.scrollLeft,e-this.element.offsetWidth)}},{key:"updatePlaceholderVisibility",value:function(){""!==this.getText()?this.element.classList.remove("inputFieldChatPlaceholder"):this.element.classList.add("inputFieldChatPlaceholder")}},{key:"dispose",value:function(){this.listeners.removeAll()}}],[{key:"truncateString",value:function(e,t){if(e.length<=t)return e;var n,i=-1,o=0,r=w(e);try{for(r.s();!(n=r.n()).done;){var s=n.value;if(o+s.length>t)break;twemoji.test(s)&&(i=o),o+=s.length}}catch(e){r.e(e)}finally{r.f()}if(-1!==i){var a=(0,m.xJ)(e.substr(i,e.length));if(void 0!==a&&i+a.emojiChars.length>t)return e.substr(0,i)}return e.substr(0,o)}}]),n}(f.w),T=function(e){(0,s.Z)(n,e);var t=x(n);function n(e){var i;return(0,o.Z)(this,n),(i=t.call(this)).inputElement=e,i.element=e,i}return(0,r.Z)(n,[{key:"caretLeftOffset",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.inputElement.value.substring(0,null!==(e=this.inputElement.selectionStart)&&void 0!==e?e:0);if(t){for(;n.length>0&&!/^\s/.test(n);)n=n.slice(0,-1);n=this.inputElement.value.substring(0,n.length+1)}return(0,p.mY)(n,this.inputElement)}},{key:"caretXPos",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.caretLeftOffset(e)+this.element.getBoundingClientRect().left}},{key:"caretAtEndOfInput",value:function(){return this.inputElement.selectionStart===this.inputElement.value.length}},{key:"getAvailableLength",value:function(){return this.inputElement.maxLength-this.inputElement.value.length}},{key:"setCurrentNodeText",value:function(e){this.inputElement.value=e}},{key:"appendText",value:function(e){this.inputElement.value="".concat(this.inputElement.value).concat(e)}},{key:"setCaretToEnd",value:function(){var e=window.getSelection();if(null!==e){var t=document.createRange();t.selectNodeContents(this.element),t.collapse(!1),e.removeAllRanges(),e.addRange(t)}}},{key:"setCaretToEndOfSelection",value:function(){var e=window.getSelection();if(null!==e){var t=e.getRangeAt(e.rangeCount-1);t.selectNodeContents(this.element),t.collapse(!1),e.removeAllRanges(),e.addRange(t)}}},{key:"getCurrentNodeText",value:function(){return this.inputElement.value.replace(/\s/g," ")}},{key:"selectCurrentNodeTail",value:function(e){this.inputElement.setSelectionRange(e,this.inputElement.value.length)}},{key:"deleteSelection",value:function(){if(null!==this.inputElement.selectionStart){var e=this.inputElement.value.substring(0,this.inputElement.selectionStart);this.inputElement.value=e}}},{key:"focus",value:function(){this.inputElement.focus()}},{key:"blur",value:function(){this.inputElement.blur()}}]),n}(f.w)},9493:function(e,t,n){"use strict";n.d(t,{b1:function(){return s},ek:function(){return r},wk:function(){return o}});var i=n(3543);function o(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e<=0)return"";var n=Math.floor(e/3600);e%=3600;var i=Math.floor(e/60);e%=60;var o="",r="";(n>1||1===n)&&(o="".concat(n,"h")),i>1||1===i?r="".concat(i,"m"):0===n&&(r=t?"":"<1m");var s="";return t&&(s=" ".concat(e,"s")),"".concat(o).concat(r).concat(s)}function r(e){var t=(Date.now()-e.getTime())/1e3;return t<60?i.ag.now:t<=120?i.ag.oneMinuteAgo:t<3600?i.ag.minutesAgo(Math.floor(t/60)):t<=7200?i.ag.anHourAgo:t<86400?i.ag.hoursAgo(Math.floor(t/3600)):t<=172800?i.ag.aDayAgo:t<604800?i.ag.daysAgo(Math.floor(t/86400)):e.toLocaleDateString()}function s(e,t){return(e.getTime()-t.getTime())/1e3}},8069:function(e,t,n){"use strict";n.d(t,{d:function(){return c},l:function(){return u}});var i=n(3243),o=n(7591),r=n(9492),s=n(7597),a=n(2951),l=n(1976);var c=function(){function e(t,n){(0,a.Z)(this,e),this.func=t,this.config=n,this.recentlyLetPassthrough=!1,this.callImmediate=!1}return(0,l.Z)(e,[{key:"callFunc",value:function(){var e=this;if(1===this.config.debounceType)return clearTimeout(this.debounceTimeout),void(this.debounceTimeout=window.setTimeout(this.func,this.config.bounceLimitMS));this.recentlyLetPassthrough?this.callImmediate=!0:(this.recentlyLetPassthrough=!0,this.func(),window.setTimeout((function t(){e.callImmediate&&2===e.config.debounceType?(e.callImmediate=!1,e.func(),window.setTimeout(t,e.config.bounceLimitMS)):e.recentlyLetPassthrough=!1}),this.config.bounceLimitMS))}}]),e}(),u=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,s.Z)(t);if(n){var o=(0,s.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,a.Z)(this,u),(t=c.call(this,(function(){t.isStart=!0,e(!1)}),{bounceLimitMS:300,debounceType:1})).fn=e,t.isStart=!0,t}return(0,l.Z)(u,[{key:"callFunc",value:function(){this.isStart&&(this.isStart=!1,this.fn(!0)),(0,i.Z)((0,s.Z)(u.prototype),"callFunc",this).call(this)}}]),u}(c)},3593:function(e,t,n){"use strict";n.r(t),n.d(t,{debug:function(){return a},error:function(){return o},info:function(){return s},warn:function(){return r}});var i=n(1896),o=i.vU,r=i.ZK,s=i.um,a=i.fF;window.onerror=function(e,t,n,i,r){var s;try{s=JSON.stringify(r)}catch(e){s="".concat(r)}var a=['"Message: " '.concat(e),'"URL: " '.concat(t),'"Line: " '.concat(n),'"Column: " '.concat(i),'"Error object: " '.concat(s)].join("\n");return o(a,{},"UNCAUGHT_"),!1}},5343:function(e,t,n){"use strict";n.d(t,{O:function(){return s}});var i=n(2951),o=n(1976),r=n(4695),s=function(){function e(){(0,i.Z)(this,e),this.drawPile=new r.h,this.discardPile=new r.h}return(0,o.Z)(e,[{key:"addToTop",value:function(e){this.currentElem!==e&&(this.discardPile.remove(e),this.drawPile.addToTop(e))}},{key:"nextElem",value:function(){var e=this.drawPile.popFromTop();return void 0!==this.currentElem&&this.discardPile.addToTop(this.currentElem),this.currentElem=e,e}},{key:"prevElem",value:function(){var e=this.discardPile.popFromTop();return void 0!==this.currentElem&&this.drawPile.addToTop(this.currentElem),this.currentElem=e,e}},{key:"refillFromDiscard",value:function(){for(;;){var e=this.discardPile.popFromBottom();if(void 0===e)break;this.drawPile.addToBottom(e)}void 0!==this.currentElem&&(this.drawPile.addToBottom(this.currentElem),this.currentElem=void 0)}},{key:"emptyDrawIntoDiscard",value:function(){for(;;){var e=this.drawPile.popFromBottom();if(void 0===e)break;this.discardPile.addToBottom(e)}void 0!==this.currentElem&&(this.discardPile.addToBottom(this.currentElem),this.currentElem=void 0)}},{key:"remove",value:function(e){this.discardPile.remove(e),this.drawPile.remove(e),this.currentElem===e&&(this.currentElem=void 0)}},{key:"makeCurrent",value:function(e){this.currentElem!==e&&(this.addToTop(e),this.nextElem())}}]),e}()},9:function(e,t,n){"use strict";n.d(t,{w:function(){return l}});var i=n(2951),o=n(1976),r=n(1794);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return a(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)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw r}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"div",n=arguments.length>1?arguments[1]:void 0;(0,i.Z)(this,e),this._children=[],this.hasInitUI=!1,this.didRepositionEvent=new r.xB("didReposition",{reportIfNoListeners:!1}),this.element="string"==typeof t?this.createBaseElement(t,n):t,this.initData(n),this.initUI(n),this.element.setAttribute("ts","".concat(this.constructor.name))}return(0,o.Z)(e,[{key:"createBaseElement",value:function(e,t){var n=document.createElement(e);return n.style.height="100%",n.style.width="100%",n.style.position="absolute",n.style.overflow="hidden",n.style["-webkit-tap-highlight-color"]="transparent",n}},{key:"initData",value:function(e){}},{key:"initUI",value:function(e){}},{key:"lazyInitUI",value:function(){this.hasInitUI=!0}},{key:"repositionChildren",value:function(){}},{key:"repositionChildrenRecursive",value:function(){this.repositionChildren();var e,t=s(this.children());try{for(t.s();!(e=t.n()).done;)e.value.repositionChildrenRecursive()}catch(e){t.e(e)}finally{t.f()}this.didRepositionEvent.fire(void 0)}},{key:"afterDOMConstructed",value:function(){}},{key:"afterDOMConstructedIncludingChildren",value:function(){this.afterDOMConstructed();var e,t=s(this.children());try{for(t.s();!(e=t.n()).done;)e.value.afterDOMConstructedIncludingChildren()}catch(e){t.e(e)}finally{t.f()}}},{key:"addChild",value:function(e,t){return this.attachChild(e),void 0===t&&(t=this.element),e.hasInitUI||e.lazyInitUI(),t.appendChild(e.element),e}},{key:"prependChild",value:function(e,t){return this.attachChild(e,0),void 0===t&&(t=this.element),t.insertBefore(e.element,this.element.firstChild),e}},{key:"addChildBeforeIndex",value:function(e,t,n){if(t>this._children.length||t<0)return error("tried to add item before an index that does not exist"),e;if(void 0===n&&(n=this.element),e.hasInitUI||e.lazyInitUI(),t===this._children.length)this.attachChild(e),n.appendChild(e.element);else{var i=this._children[t].element;this.attachChild(e,t),n.insertBefore(e.element,i)}return e}},{key:"attachChild",value:function(e,t){void 0!==e.parent&&e.parent!==this&&e.parent.removeChild(e),void 0===t?this._children.push(e):this._children.splice(t,0,e),e.parent=this}},{key:"addChildBefore",value:function(e,t){void 0!==e.parent&&e.parent!==this&&e.parent.removeChild(e);var n=void 0===t?-1:this._children.indexOf(t);return n<0?this.element.appendChild(e.element):this.element.insertBefore(e.element,this._children[n].element),this._children.splice(n,0,e),e.parent=this,e}},{key:"removeChild",value:function(e){var t=this._children.indexOf(e);if(-1!==t){this._children.splice(t,1),e.parent===this&&(e.parent=void 0),this.cleanupChildDOM(e);var n,i=s(e.children());try{for(i.s();!(n=i.n()).done;)n.value.afterRemovedFromParent()}catch(e){i.e(e)}finally{i.f()}e.afterRemovedFromParent()}else error("tried removing component that doesn't exist")}},{key:"cleanupChildDOM",value:function(e){var t=e.element.parentNode;null!==t?t.removeChild(e.element):error("couldn't find parent element to use for node removal")}},{key:"removeAllChildren",value:function(){var e,t=s(this.children());try{for(t.s();!(e=t.n()).done;){var n=e.value;n.parent===this&&(n.parent=void 0),this.cleanupChildDOM(n),n.afterRemovedFromParent()}}catch(e){t.e(e)}finally{t.f()}this._children=[]}},{key:"removeAllDOMChildren",value:function(){for(;null!==this.element.firstChild;)this.element.removeChild(this.element.firstChild)}},{key:"children",value:function(){return this._children}},{key:"siblings",value:function(){var e=this;return void 0===this.parent?[]:this.parent._children.filter((function(t){return t!==e}))}},{key:"afterRemovedFromParent",value:function(){}},{key:"showElement",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"block";this.element.style.display=void 0===this.originalDisplayStyle?e:this.originalDisplayStyle}},{key:"hideElement",value:function(){"none"!==this.element.style.display&&(""!==this.element.style.display&&(this.originalDisplayStyle=this.element.style.display),this.element.style.display="none")}},{key:"isShown",value:function(){return"none"!==this.element.style.display}},{key:"toggleShowHide",value:function(){this.isShown()?this.hideElement():this.showElement()}},{key:"previousSibling",value:function(){if(void 0!==this.parent)return this.findPreviousSibling(this.parent.children())}},{key:"nextSibling",value:function(){if(void 0!==this.parent)return this.findPreviousSibling(this.parent.children().slice().reverse())}},{key:"lastChild",value:function(){return this.children().length>0?this.children()[this.children().length-1]:void 0}},{key:"findPreviousSibling",value:function(e){var t,n,i=s(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o===this)break;t=o}}catch(e){i.e(e)}finally{i.f()}return t}}]),e}()},7585:function(e,t,n){"use strict";n.d(t,{I:function(){return u}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(47);var u=function(e){(0,s.Z)(d,e);var t,n,u=(t=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function d(e){return(0,i.Z)(this,d),u.call(this,void 0,e)}return(0,o.Z)(d,[{key:"initData",value:function(e){(0,r.Z)((0,l.Z)(d.prototype),"initData",this).call(this,e)}},{key:"createBaseElement",value:function(e,t){return this.state=this.initState(t),this.createElement(t)}},{key:"createElement",value:function(e){return(0,r.Z)((0,l.Z)(d.prototype),"createBaseElement",this).call(this,"div",e)}},{key:"render",value:function(){return this.element}},{key:"setState",value:function(e){for(var t in e)e.hasOwnProperty(t)&&(this.state[t]=e[t]);this.updateState()}},{key:"updateState",value:function(){var e=this;(0,c.rP)(this.element).forEach((function(t){t instanceof Function?t():t!==e&&t.updateState()}))}},{key:"initState",value:function(e){return{}}}]),d}(n(9).w)},3149:function(e,t,n){"use strict";n.d(t,{G3:function(){return r},fR:function(){return o},sz:function(){return a},vV:function(){return s}});var i=n(1185);function o(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3,r=document.createElement("div");r.style.position="absolute",r.style.height="0",r.style.width="0",r.style.top="-8px",r.style.left=n;var s=document.createElement("div");(0,i.vP)(s,"divotBorder"),s.style.borderLeft="8px solid transparent",s.style.borderRight="8px solid transparent",s.style.borderBottomWidth="8px",s.style.borderBottomStyle="solid",""!==e&&(s.style.borderBottomColor="".concat(e)),r.appendChild(s);var a=8-o,l=document.createElement("div");return(0,i.vP)(l,"divotBackground"),l.style.position="absolute",l.style.top="".concat(o,"px"),l.style.left="".concat(o,"px"),l.style.borderLeft="".concat(a,"px solid transparent"),l.style.borderRight="".concat(a,"px solid transparent"),l.style.borderBottomWidth="".concat(a,"px"),l.style.borderBottomStyle="solid",""!==t&&(l.style.borderBottomColor="".concat(t)),s.appendChild(l),r}function r(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3,r=document.createElement("div");r.style.position="absolute",r.style.height="0",r.style.width="0",r.style.bottom="0",r.style.left=n;var s=document.createElement("div");(0,i.vP)(s,"divotBorder"),s.style.borderLeft="8px solid transparent",s.style.borderRight="8px solid transparent",s.style.borderTopWidth="8px",s.style.borderTopStyle="solid",""!==e&&(s.style.borderTopColor="".concat(e)),r.appendChild(s);var a=8-o,l=document.createElement("div");return(0,i.vP)(l,"divotBackground"),l.style.position="absolute",l.style.top="0",l.style.left="".concat(o,"px"),l.style.borderLeft="".concat(a,"px solid transparent"),l.style.borderRight="".concat(a,"px solid transparent"),l.style.borderTopWidth="".concat(a,"px"),l.style.borderTopStyle="solid",""!==t&&(l.style.borderTopColor="".concat(t)),s.appendChild(l),r}function s(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3,r=document.createElement("div");r.style.position="absolute",r.style.height="0",r.style.width="0",r.style.left="-8px",r.style.top=n;var s=document.createElement("div");(0,i.vP)(s,"divotBorder"),s.style.borderTop="8px solid transparent",s.style.borderBottom="8px solid transparent",s.style.borderRightWidth="8px",s.style.borderRightStyle="solid",""!==e&&(s.style.borderRightColor="".concat(e)),r.appendChild(s);var a=8-o,l=document.createElement("div");return(0,i.vP)(l,"divotBackground"),l.style.position="absolute",l.style.top="".concat(o,"px"),l.style.left="".concat(o,"px"),l.style.borderTop="".concat(a,"px solid transparent"),l.style.borderBottom="".concat(a,"px solid transparent"),l.style.borderRightWidth="".concat(a,"px"),l.style.borderRightStyle="solid",""!==t&&(l.style.borderRightColor="".concat(t)),s.appendChild(l),r}function a(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3,r=document.createElement("div");r.style.position="absolute",r.style.height="0",r.style.width="0",r.style.right="0",r.style.top=n;var s=document.createElement("div");(0,i.vP)(s,"divotBorder"),s.style.borderTop="8px solid transparent",s.style.borderBottom="8px solid transparent",s.style.borderLeftWidth="8px",s.style.borderLeftStyle="solid",""!==e&&(s.style.borderLeftColor="".concat(e)),r.appendChild(s);var a=8-o,l=document.createElement("div");return(0,i.vP)(l,"divotBackground"),l.style.position="absolute",l.style.top="".concat(o,"px"),l.style.right="-".concat(a,"px"),l.style.borderTop="".concat(a,"px solid transparent"),l.style.borderBottom="".concat(a,"px solid transparent"),l.style.borderLeftWidth="".concat(a,"px"),l.style.borderLeftStyle="solid",""!==t&&(l.style.borderLeftColor="".concat(t)),s.appendChild(l),r}},191:function(e,t,n){"use strict";n.d(t,{T:function(){return u}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(7397),c=n(4793);var u=function(e){(0,r.Z)(d,e);var t,n,u=(t=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function d(){return(0,i.Z)(this,d),u.call(this)}return(0,o.Z)(d,[{key:"initListeners",value:function(){var e=this;l.Ql.listen((function(t){t.isOpen&&e.dontNotify.add(t.username)})),c.QN.listen((function(){e.dontNotify.clear()}))}}]),d}(n(2648).f)},5392:function(e,t,n){"use strict";n.d(t,{T:function(){return s},w:function(){return r}});var i=n(8759),o=n(7693),r={enabled:!1,move:function(e,t){},end:function(){}};function s(e,t){a(e,t,(function(e){var t=e;return{valid:!0,x:t.clientX,y:t.clientY}}),"mousedown","mousemove","mouseup"),a(e,t,(function(e){var t=e;if(1===t.touches.length){var n=t.touches.item(0);if(null!==n)return{valid:!0,x:n.clientX,y:n.clientY}}return{valid:!1,x:0,y:0}}),"touchstart","touchmove","touchend")}function a(e,t,n,r,s,a){(0,o.j9)(r,e,(function(e){var r=n(e);if(r.valid){var l=t(e,r.x,r.y);if(l.enabled){l.move(r.x,r.y),e.preventDefault();var c=function(e){var t=n(e);t.valid&&l.move(t.x,t.y)},u=function(e){e.preventDefault(),void 0!==e.buttons&&function(e){return(0,i.NP)()?0===e.buttons:1===e.buttons}(e)||void 0!==e.touches&&1===e.touches.length?c(e):d(e,!1)};(0,o.j9)(s,document,u,!0);var d=function e(t){(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&c(t),(0,o.SC)(s,document,u,!0),(0,o.SC)(a,document,e,!0),l.end()};(0,o.j9)(a,document,d,!0)}}}))}},7191:function(e,t,n){"use strict";n.d(t,{Ku:function(){return p},cJ:function(){return g}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(8759),u=n(7693),d=n(7585),h=n(1794);var f,p=function(e){(0,s.Z)(d,e);var t,n,c=(t=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function d(e,t){var n,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,i.Z)(this,d),(n=c.call(this,e)).toggleElement=t,n.toggleEvent=new h.xB("dropDownToggled",{reportIfNoListeners:!1}),void 0!==t&&((0,u.j9)("click",t,(function(e){e.metaKey||e.ctrlKey||n.toggleOverlay(e)}),!1),(0,u.j9)("keydown",t,(function(e){32!==e.keyCode&&"Space"!==e.code||(e.preventDefault(),n.toggleOverlay(e))})),t.classList.add("dropdown-anchor")),n.autoHide(o),n}return(0,o.Z)(d,[{key:"initUI",value:function(e){(0,r.Z)((0,l.Z)(d.prototype),"initUI",this).call(this,e),this.element.style.overflow="visible",this.element.style.position="absolute",this.element.style.top="0",this.element.style.left="0",this.element.style.right="auto",this.element.style.bottom="auto",this.element.style.width="",this.element.style.height="",this.element.style.display="none",this.element.style.zIndex="4",this.element.classList.add("dropdown")}},{key:"showElement",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"block",t=arguments.length>1?arguments[1]:void 0;return!this.isShown()&&(this.element.style.display=e,this.toggleEvent.fire(new g(!0,t)),this.isShown())}},{key:"hideElement",value:function(e){var t=this;return!(void 0!==e&&e.composedPath().some((function(e){return e instanceof Element&&t.element.contains(e)&&e.matches(".dropdown-anchor")}))||!this.isShown()||(this.element.style.display="none",this.toggleEvent.fire(new g(!1,e)),this.isShown()))}},{key:"toggleOverlay",value:function(e){return this.isShown()?!this.hideElement(e):this.showElement(void 0,e)}},{key:"autoHide",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.documentClickListener=m.listen((function(n){!(e.isShown()&&n.target instanceof Element)||t&&e.element.contains(n.target)||void 0!==e.toggleElement&&e.toggleElement.contains(n.target)||e.hideElement(n)}))}},{key:"dispose",value:function(){this.documentClickListener.removeListener()}}]),d}(d.I),m=new h.xB("documentClick"),v=!1;(0,u.j9)("touchmove",document,(function(){v=!0})),(0,u.j9)("touchstart",document,(function(){v=!1})),(0,u.j9)("click",document,(function(e){m.fire(e),void 0!==f&&(clearTimeout(f),f=void 0)})),((0,c._1)()||(0,c.sg)())&&(0,u.j9)("touchend",document,(function(e){v||(f=window.setTimeout((function(){f=void 0,m.fire(e)}),200))}),!1);var g=(0,o.Z)((function e(t,n){(0,i.Z)(this,e),this.isShowing=t,this.event=n}))},2600:function(e,t,n){"use strict";n.d(t,{Ar:function(){return m},H4:function(){return p},IA:function(){return y},L0:function(){return h},wT:function(){return g},wl:function(){return v},xJ:function(){return f}});var i,o=n(5809),r=n(3753),s=n(391);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw r}}}}(h(e));try{for(s.s();!(t=s.n()).done;){var l=t.value;-1===n&&twemoji.test(l)?(n=r,i=l,o=l):-1!==n&&(o="".concat(o).concat(l),twemoji.test(l)&&p(twemoji.parse(o))&&(i=o)),r+=l.length}}catch(e){s.e(e)}finally{s.f()}return-1!==n?{emojiStart:n,emojiChars:i}:void 0}}function p(e){var t=e.match(/e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}((i.getString("slug"),i.getObject("emoticons")));try{for(r.s();!(t=r.n()).done;){var s=t.value;o.push({slug:s.slug,url:s.url,element:I,score:s.score})}}catch(e){r.e(e)}finally{r.f()}return o=(o=o.map((function(e){var t=void 0===e.score?0:e.score;return e.slug===n.prefix?e.score=t+1e5:0===e.slug.indexOf(n.prefix)&&(e.score=t+9e3),e}))).sort((function(e,t){return(void 0===e.score?0:e.score)-(void 0===t.score?0:t.score)})),i.logUnusedDebugging("parseEmoticonAutocompleteResponse"),o}},{key:"shouldIgnoreItem",value:function(e){return i.indexOf(e.slug)>=0}},{key:"showPreview",value:function(e){v.gi.fire(e)}}]),n}(p.e),T=function(e){(0,a.Z)(n,e);var t=x(n);function n(e){var i;return(0,o.Z)(this,n),(i=t.call(this,{inputElement:e,leftOffset:0,rightOffset:0})).scrolling=!1,i.savedValue="",(0,h.j9)("touchstart",i.element,(function(){i.scrolling=!1,i.config.inputElement.setCurrentNodeText(i.config.inputElement.getCurrentNodeText())})),(0,u.Tt)()||((0,h.j9)("keydown",i.config.inputElement.element,(function(e){i.visible&&(i.savedValue=i.config.inputElement.getCurrentNodeText())})),(0,h.j9)("keyup",i.config.inputElement.element,(function(e){var t=i.config.inputElement.getCurrentNodeText();""!==i.savedValue&&" "===t[t.length-1]&&(i.config.inputElement.setCurrentNodeText("".concat(i.savedValue," ")),i.hide()),i.savedValue=""}),!0)),i.overlayClick.listen((function(){i.config.inputElement.focus(),i.config.inputElement.setCaretToEnd()})),y.w.listen((function(e){i.hide(),v.Gm.fire(void 0)})).addTo(i.listenerGroup),i}return(0,r.Z)(n,[{key:"initUI",value:function(){var e=this;(0,s.Z)((0,c.Z)(n.prototype),"initUI",this).call(this),this.element.style.border="",this.element.style.fontSize="14px",this.element.style.lineHeight="26px",this.element.style.boxShadow="0px 0px 8px rgba(0, 0, 0, 0.32)",this.element.style.marginLeft="7px",this.element.style.boxSizing="content-box",this.previewWrapper.style.width="",this.list.style.width="",(0,b.q)(this.list,!0),this.list.onscroll=function(){e.scrolling=!0}}},{key:"repositionChildren",value:function(){}},{key:"showPreview",value:function(e){var t=this;(0,s.Z)((0,c.Z)(n.prototype),"showPreview",this).call(this,e),this.config.inputElement.blur(),v.$N.once((function(){t.isVisible()&&(t.config.inputElement.focus(),t.previewImage.src=t.previewImage.src)}),!1)}},{key:"appendItem",value:function(e,t){var i=this,o=(0,s.Z)((0,c.Z)(n.prototype),"appendItem",this).call(this,e,t);return o.ontouchend=function(e){i.scrolling||(i.pickItem(t,!1),e.preventDefault())},o}},{key:"isSpecialFunctionKey",value:function(e){var t=this.config.inputElement.getCurrentNodeText();return(0,s.Z)((0,c.Z)(n.prototype),"isSpecialFunctionKey",this).call(this,e)||this.visible&&" "===t[t.length-1]}},{key:"show",value:function(){this.element.style.width="".concat(this.config.inputElement.element.offsetWidth,"px"),(0,s.Z)((0,c.Z)(n.prototype),"show",this).call(this)}}]),n}(S),I=document.createElement("div")},9447:function(e,t,n){"use strict";n.d(t,{$N:function(){return w},Gm:function(){return b},cv:function(){return C},gi:function(){return y},nz:function(){return x}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(1185),u=n(7693),d=n(3753),h=n(4793),f=n(1794),p=n(9874);function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(k);try{for(l.s();!(a=l.n()).done;){var h=a.value,f=document.createElement("option");f.innerText=h.label,f.value=h.value,s.appendChild(f)}}catch(e){l.e(e)}finally{l.f()}e.reportWrapper.appendChild(s);var p=document.createElement("span");p.style.display="inline-block";var v=document.createElement("span");(0,c.vP)(v,"cancelButton"),v.innerText="CANCEL",v.style.fontFamily="UbuntuMedium, Helvetica, Arial, sans-serif",v.style.fontSize="12px",v.style.padding="2px 6px",v.style.borderRadius="4px",v.style.boxSizing="border-box",v.style.cursor="pointer",v.style.display="inline-block",v.style.marginLeft="6px",v.onclick=function(){e.reportLink.style.display="block",e.reportWrapper.style.display="none",e.repositionChildren()},p.appendChild(v);var y=document.createElement("span");(0,c.vP)(y,"reportButton"),y.innerText="REPORT",y.style.fontFamily="UbuntuMedium, Helvetica, Arial, sans-serif",y.style.fontSize="12px",y.style.padding="2px 6px",y.style.borderRadius="4px",y.style.boxSizing="border-box",y.style.cursor="pointer",y.style.display="inline-block",y.style.marginLeft="6px",y.onclick=function(){var t="emoticon_report_abuse/".concat(e.emoticon.slug,"/");(0,d.I5)(t,{category:s.value}).then((function(t){g.push(e.emoticon.slug),e.reportWrapper.style.display="none",e.undoWrapper.style.display="block",e.repositionChildren()})).catch((function(e){error("Error reporting emoticon",e)}))},p.appendChild(y),e.reportWrapper.appendChild(p),e.undoWrapper=document.createElement("div"),e.undoWrapper.style.display="none",e.element.appendChild(e.undoWrapper);var w=document.createElement("span");w.innerText="EMOTICON REPORTED - ",e.undoWrapper.appendChild(w);var C=document.createElement("span");return(0,c.vP)(C,c.ql.hrefColor),C.innerText="UNDO",C.style.cursor="pointer",C.onclick=function(){var t="emoticon_report_abuse/".concat(e.emoticon.slug,"/");(0,d.I5)(t,{category:s.value}).then((function(t){var n=g.indexOf(e.emoticon.slug,0);n>=0&&g.splice(n,1),e.undoWrapper.style.display="none",e.reportLink.style.display="block",e.repositionChildren()})).catch((function(e){error("Error reporting emoticon",e)}))},C.onmouseenter=function(){C.style.textDecoration="underline"},C.onmouseleave=function(){C.style.textDecoration="none"},e.undoWrapper.appendChild(C),e.overlayClick.listen((function(){e.hide()})),b.listen((function(){e.hide()})),e}return(0,o.Z)(n,[{key:"initAndShow",value:function(e){this.emoticon=e,this.previewImage.style.visibility="hidden",this.previewImage.src=this.emoticon.url,this.reportLink.style.display="none",this.reportWrapper.style.display="none",this.undoWrapper.style.display="none",g.indexOf(e.slug)>=0?this.undoWrapper.style.display="block":this.reportLink.style.display="block",(0,r.Z)((0,l.Z)(n.prototype),"show",this).call(this),this.removeDocumentFocus(),this.repositionChildren()}},{key:"hide",value:function(){(0,r.Z)((0,l.Z)(n.prototype),"hide",this).call(this),w.fire(void 0)}},{key:"show",value:function(){(0,r.Z)((0,l.Z)(n.prototype),"show",this).call(this),this.element.style.visibility="",this.repositionChildren()}},{key:"removeDocumentFocus",value:function(){null!==document.activeElement&&document.activeElement.blur()}}]),n}(p.z),x=function(e){(0,s.Z)(n,e);var t=v(n);function n(){var e;return(0,i.Z)(this,n),(e=t.call(this)).previewImage.style.maxWidth="calc(100vw - 64px)",e.reportWrapper.style.width="300px",e.reportWrapper.style.margin="auto",e}return(0,o.Z)(n)}(C),k=[{label:"Just ignore this emoticon",value:"ignore"},{label:"Offensive",value:"offensive"},{label:"Disgusting",value:"disgusting"},{label:"Fake Tip",value:"fake_tip"},{label:"Advertising",value:"advertising"}]},1794:function(e,t,n){"use strict";n.d(t,{G7:function(){return h},de:function(){return d},mM:function(){return m},q6:function(){return u},xB:function(){return p}});var i=n(126),o=n(1976),r=n(2951),s=n(9);function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return l(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)?l(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.listeners.push(e),t){var i,o=a(this.history);try{for(o.s();!(i=o.n()).done;)e(i.value)}catch(e){o.e(e)}finally{o.f()}}else n&&this.history.length>0&&e(this.history[this.history.length-1]);return this.warnTooManyListeners(),void 0!==this.options.onListenerAdded&&this.options.onListenerAdded(this.listeners.length),new f(this,e)}},{key:"warnTooManyListeners",value:function(){var e=this.getListenersWarningThreshold();-1!==e&&this.size()>e&&warn("EventRouter has too many listeners",{event:this.eventName,listeners:this.size(),"max-listeners":e})}},{key:"addListener",value:function(t,n){var i=this;if(!n.hasOwnProperty(this.idFieldName)){this.counter+=1;var o=this.counter;Object.defineProperty(n,this.idFieldName,{get:function(){return o}})}var r=n[this.idFieldName];this.listenersMap.set(r,[n,t]),window.setTimeout((function(){if(!e.isElementConnected(n)){var t=(n instanceof s.w?n.element:n).outerHTML;warn('addListener for EventRouter "'.concat(i.eventName,'" is called on a listeningSource which is not attached to the DOM.\n This can result in the listener not being registered. Make sure the element is attached in the same thread as calling addListener.'),{listeningSource:t})}})),void 0!==this.listenersCleanUpTimeout&&window.clearTimeout(this.listenersCleanUpTimeout),this.listenersCleanUpTimeout=window.setTimeout((function(){i.cleanUpRemovedElements(),i.warnTooManyListeners()}),100)}},{key:"cleanUpRemovedElements",value:function(){var t=Math.max(1,Math.floor(this.getListenersWarningThreshold()/2));if(this.listenersMap.size>t){var n,i=a(this.listenersMap.values());try{for(i.s();!(n=i.n()).done;){var o=n.value;e.isElementConnected(o[0])||this.listenersMap.delete(o[0][this.idFieldName])}}catch(e){i.e(e)}finally{i.f()}}}},{key:"once",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.listen((function n(i){e(i),t.removeListener(n)}),!1,n)}},{key:"fire",value:function(t){var n=this;this.history.push(t)>this.options.maxHistorySize&&this.history.shift(),0===this.listeners.length&&0===this.listenersMap.size&&this.options.reportIfNoListeners&&debug("No listeners for event: ".concat(this.eventName));for(var o=0,r=(0,i.Z)(this.listeners);o=0&&this.listeners.splice(t,1),void 0!==this.options.onListenerRemoved&&this.options.onListenerRemoved(this.listeners.length)}},{key:"listenerCount",value:function(){return this.listeners.length}},{key:"getListenersWarningThreshold",value:function(){return"number"==typeof this.options.listenersWarningThreshold?this.options.listenersWarningThreshold:this.options.listenersWarningThreshold()}}],[{key:"isElementConnected",value:function(e){return e instanceof HTMLElement&&e.isConnected||e instanceof s.w&&e.element.isConnected}}]),e}(),m=function(){function e(){(0,r.Z)(this,e),this.boundListeners=[]}return(0,o.Z)(e,[{key:"add",value:function(e){this.boundListeners.push(e)}},{key:"removeAll",value:function(){var e,t=a(this.boundListeners);try{for(t.s();!(e=t.n()).done;)e.value.removeListener()}catch(e){t.e(e)}finally{t.f()}this.boundListeners=[]}}]),e}()},6921:function(e,t,n){"use strict";n.d(t,{HK:function(){return c},aZ:function(){return r},hc:function(){return a},r$:function(){return s},si:function(){return o}});var i=n(7693);function o(e){return"ArrowUp"===e.key||38===e.keyCode}function r(e){return"ArrowDown"===e.key||40===e.keyCode}function s(e){return"Enter"===e.key||13===e.keyCode}function a(e){return void 0===e.which||"number"==typeof e.which&&e.which>0&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function l(e){null==e||e.preventDefault(),null==e||e.stopImmediatePropagation()}function c(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,o=!1,r=function r(){o||((0,i.SC)("click",e,l,!0),(0,i.SC)("pageshow",window,r),c(e,t,n),o=!0)};return(0,i.w$)("click",e,(function(o){t&&(o.ctrlKey||o.metaKey||o.shiftKey)?c(e,t,n):((0,i.j9)("click",e,l,!0),n>0&&window.setTimeout(r,n),(0,i.j9)("pageshow",window,r))})),e}},4801:function(e,t,n){"use strict";n.d(t,{BJ:function(){return d},KS:function(){return c},NZ:function(){return f}});var i=n(2951),o=n(1976),r=n(3705);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return a(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)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw r}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:void 0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;(0,s.Z)(this,e),this.filterAfterSize=t,this.cacheTTL=n,this.cache=new Map}return(0,a.Z)(e,[{key:"getShortenedPrefix",value:function(e){return void 0===this.filterAfterSize||e.length>this.filterAfterSize?e.substring(0,this.filterAfterSize):e}},{key:"get",value:function(e){var t=this.getShortenedPrefix(e),n=this.cache.get(t);return t===e?n:null==n?void 0:n.filter((function(t){return t.slug.startsWith(e)}))}},{key:"set",value:function(e,t){var n=this;(void 0===this.filterAfterSize||e.length<=this.filterAfterSize)&&(this.cache.set(e,t),-1!==this.cacheTTL&&window.setTimeout((function(){return n.cache.delete(e)}),this.cacheTTL))}}]),e}(),c=function(e){(0,i.Z)(c,e);var t,n,l=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,r.Z)(t);if(n){var s=(0,r.Z)(this).constructor;e=Reflect.construct(i,arguments,s)}else e=i.apply(this,arguments);return(0,o.Z)(this,e)});function c(){return(0,s.Z)(this,c),l.apply(this,arguments)}return(0,a.Z)(c,[{key:"get",value:function(e){var t=this.getShortenedPrefix(e),n=this.cache.get(t);return t===e?n:null==n?void 0:n.filter((function(t){return t.slug.toLowerCase().startsWith(e)}))}}]),c}(l)},9598:function(e,t,n){"use strict";n.d(t,{IT:function(){return d},Wl:function(){return u},c5:function(){return g},kr:function(){return v},og:function(){return m},tU:function(){return h},w5:function(){return y},wk:function(){return c}});var i=n(3753),o=n(391),r=n(695),s=n(1794),a=n(928),l=n(3543),c=new s.xB("followingEvent"),u=["follow_new","follow_text","follow_photo"];function d(e,t,n){return(0,i.I5)("api/ts/follow/notifications/".concat(e),{notification_frequency:t}).then((function(){return n.fire({roomName:e,following:!0,followNotificationFrequency:t}),!0})).catch((function(t){return error("Unable to update follow notification settings",{room:e,reason:t.toString()}),!1}))}function h(){return(0,i.Ue)("api/ts/follow/email_notifications/").then((function(e){var t=new o.j(e.responseText);return{activated:t.getBoolean("activated"),email:void 0!==t.getStringOrUndefined("email")?t.getStringOrUndefined("email"):"",validated:t.getBoolean("validated")}})).catch((function(e){return error("Error checking if follow email notifications are turned on",e),!1}))}var f="email_field";function p(e,t,n){var r=void 0!==n?n.email:void 0,s=void 0!==n?n.validated:void 0;return new Promise((function(n,a){var c={activate:"".concat(e)};return void 0!==t&&""!==t&&(c[f]=t),(0,i.I5)("api/ts/follow/email_notifications/",c).then((function(){n("".concat(!(void 0!==t&&""!==t&&r===t&&void 0!==s&&s)&&void 0!==t))})).catch((function(e){a(function(e){var t=new o.j(e.xhr.responseText).getString("error");if(t.indexOf(f)>-1){var n=new o.j(t).getList(f);if(void 0!==n&&n.length>0)return n[0].getString("message")}return l.ag.emailSubmitErrorMessage}(e))}))}))}function m(e,t){return void 0!==t&&""!==t?h().then((function(n){return t===n.email&&e===n.activated?new Promise((function(e,o){if(!n.validated)return(0,i.I5)("emailvalidation/resend/",{}).then((function(){e("true")})).catch((function(){o("Error resending verification email to ".concat(t))}));e("false")})):p(e,t,n)})).catch((function(){return p(e,t)})):p(e)}function v(e,t,n){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"FollowStar";if(void 0!==n&&!n||!(0,r.Cg)(l.ag.loginToFollow,void 0,void 0,!0))return(0,i.I5)("follow/follow/".concat(e,"/"),{location:s}).then((function(n){var i=new o.j(n.responseText);return t.fire({roomName:e,following:!0,followNotificationFrequency:(0,a.cT)(i.getString("notification_frequency")),onlineCount:i.getNumberOrUndefined("online_count"),totalCount:i.getNumberOrUndefined("total_count")}),void 0!==window._followedTabUpdate&&window._followedTabUpdate(e),!0})).catch((function(t){return error("Unable to follow",{roomName:e,reason:t.toString()}),!1}))}function g(e,t,n){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"FollowStar";if(void 0!==n&&!n||!(0,r.Cg)(l.ag.loginToFollow,void 0,void 0,!0))return(0,i.I5)("follow/unfollow/".concat(e,"/"),{location:s}).then((function(n){var i=new o.j(n.responseText);return t.fire({roomName:e,following:!1,followNotificationFrequency:"none",onlineCount:i.getNumberOrUndefined("online_count"),totalCount:i.getNumberOrUndefined("total_count")}),void 0!==window._followedTabUpdate&&window._followedTabUpdate(e),!0})).catch((function(t){return error("Unable to unfollow",{roomName:e,reason:t.toString()}),!1}))}function y(e){return(0,i.Ue)("follow/follow_allowed/".concat(e,"/")).then((function(e){return new o.j(e.responseText).getBoolean("can_follow")})).catch((function(e){return error("Error checking if user following is allowed",e),!1}))}},4842:function(e,t,n){"use strict";n.d(t,{R:function(){return m}});var i=n(2951),o=n(1976),r=n(2800),s=n(7212),a=n(8016),l=n(1006),c=n(6402),u=n(407),d=n(4406),h=n(4793),f=n(8263),p=n(3543),m=function(){function e(){var t=this;if((0,i.Z)(this,e),this.followers=new Set,r.J.current.isBroadcast){var n,o,c=null!==(n=null===(o=r.J.current.loggedInUser)||void 0===o?void 0:o.userUid)&&void 0!==n?n:"";new a.OC(c).onMessage.listen((function(e){var n;e.followerUsername!==(null===(n=r.J.current.loggedInUser)||void 0===n?void 0:n.username)&&(e.isFollowing?t.addFollower(e.followerUsername):t.removeFollower(e.followerUsername))})),h.kN.listen((function(e){window.setTimeout((function(){l._B.getInstance().fetchRoomUsers().then((function(e){e.roomUsers.forEach((function(e){!0===e.isFollowing&&t.addFollower(e.username)}))})).catch(void 0)}),5e3),e.chatConnection.event.roomMessage.listen((function(e){!0===e.fromUser.isFollowing&&t.addFollower(e.fromUser.username)})),e.chatConnection.event.tipAlert.listen((function(e){!0===e.fromUser.isFollowing&&t.addFollower(e.fromUser.username)})),new s.rc(e.dossier.roomUid).onMessage.listen((function(e){!0===e.user.isFollowing&&t.addFollower(e.user.username)}))})),d.x.registerGenerator("followerBadge",(function(e){return t.createChatBadge(e)}))}}return(0,o.Z)(e,[{key:"hasFollower",value:function(e){return this.followers.has(e)}},{key:"addFollower",value:function(e){this.followers.has(e)||(this.followers.add(e),this.updateChatBadges(e))}},{key:"removeFollower",value:function(e){this.followers.delete(e),this.updateChatBadges(e)}},{key:"shouldShowBadge",value:function(e){return this.followers.has(e)&&e!==r.q.getState().room}},{key:"createChatBadge",value:function(e){var t=document.createElement("span");(0,f.Zs)(t,{position:"relative",display:this.shouldShowBadge(e)?"":"none",marginRight:".1em"});var n=(0,c.R)(),i=(0,u.T)({content:p.ag.followsYou,hasHTML:!1,divotPosition:1,divotLeftOrTop:"8px"});return i.style.padding="6px",i.style.fontFamily="UbuntuLight, Helvetica, Arial, sans-serif",i.style.lineHeight="normal",i.style.position="fixed",i.style.display="block",(0,f.nH)(n).listen((function(e){var t;e?document.body.appendChild(i):null===(t=i.parentElement)||void 0===t||t.removeChild(i);var o=n.getBoundingClientRect(),r=(0,f.i6)();i.style.top="".concat(-r.top+o.top-i.offsetHeight-o.height/5-5,"px"),i.style.left="".concat(-r.left+o.left+o.width/2-18,"px")})),t.appendChild(n),t}},{key:"updateChatBadges",value:function(e){var t=this.shouldShowBadge(e);d.x.getBadgeElements("followerBadge",e).forEach((function(e){e.style.display=t?"":"none"}))}}],[{key:"getOrCreateInstance",value:function(){return void 0===e.singletonInstance&&(e.singletonInstance=new e),e.singletonInstance}}]),e}()},2673:function(e,t,n){"use strict";n.d(t,{T:function(){return p}});var i=n(2951),o=n(1976),r=n(6853),s=n(2800),a=n(6698),l=n(6265),c=n(9598),u=n(1522),d=n(3543);function h(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return f(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)?f(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n-1){t.pop();var r=t.join("_");o=!0;var s,a=h(i);try{for(a.s();!(s=a.n()).done;){var l=s.value,c="".concat(r,"_").concat(l);null===document.querySelector("#".concat(c))&&(o=!1)}}catch(e){a.e(e)}finally{a.f()}}return o}(e)&&(t.isDateWidget=!0,t.errorName=function(e){var t=String(e.getAttribute("id")).split("_");return t.shift(),t.pop(),t.join("_")}(e));var i=String(e.getAttribute("type"));"checkbox"===i?t.isCheckbox=!0:"hidden"===i?t.isHidden=!0:"select"===t.elementType&&"select-multiple"===e.type&&(t.isMultiSelect=!0),t.isDisabled=null!==e.getAttribute("disabled"),t.hasError()&&(t.grace=!1)},getName:function(){return"captcha"===e.getAttribute("data-type")?function(e){var t=String(e.getAttribute("id")).split("_");return t.shift(),t.join("_")}(e):e.getAttribute("name")},showSpinner:function(){if(!t.isHidden&&!t.isRecaptcha){var e=document.querySelector("#".concat(t.errorName,"_spinner"));null!==e&&e.classList.remove("formvalidate_hidden")}},hideSpinner:function(){var e=document.querySelector("#".concat(t.errorName,"_spinner"));null!==e&&e.classList.add("formvalidate_hidden")},getId:function(){return String(e.getAttribute("id"))},getSubmitValue:function(){var n=e;return t.isCheckbox?n.checked?null!==n.getAttribute("value")?n.getAttribute("value"):"on":"":n.value},change:function(){t.grace=!1},hasError:function(){if(t.isHidden)return!1;var e=document.querySelector(".".concat(t.errorName,"_error"));return null!==e&&"none"!==e.style.display},showError:function(e,n){if(!t.isHidden&&(n&&(t.grace=!1),!t.grace)){document.querySelector(".".concat(t.errorName,"_error .error_msg")).appendChild(document.createTextNode(e));var i=document.querySelector(".".concat(t.errorName,"_error"));"tr"===String(i.tagName.toLowerCase())?i.style.display="table-row":i.style.display="block"}},clearError:function(){if(!t.isHidden){for(var e=document.querySelector(".".concat(t.errorName,"_error .error_msg"));null!==e.firstChild;)e.removeChild(e.firstChild);document.querySelector(".".concat(t.errorName,"_error")).style.display="none";var n=document.querySelector(".".concat(t.errorName,"_label"));null!==n&&n.classList.remove("formvalidate_error")}}};return t.init(),t}function v(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="1"===e.getAttribute("data-formvalidate-disable-on-submit")?(0,i.Z)(e.querySelectorAll("button:not([type=button]),input[type=submit]")):[],o={fields:[],formElement:e,usernameAssist:{fields:void 0},isValid:!0,isSubmitting:!1,isValidating:!1,validateUrl:"",usernameAssistUrl:"",fieldsIndex:{},lastAllData:{},queueValidation:!1,isPreSubmitValidationComplete:!1,preSubmitValidationHandlers:[],template:"",errored_inputs:[],init:function(){var i;if(o.validateUrl=String(e.getAttribute("data-formvalidate")).substring(1),o.usernameAssistUrl=String(e.getAttribute("data-usernameAssist")).substring(1),o.template=null!==(i=e.getAttribute("data-template"))&&void 0!==i?i:"",t){(0,s.j9)("submit",e,(function(e){o.isSubmitting?e.preventDefault():(o.isSubmitting=!0,o.isValid&&!o.isValidating?o.preSubmitValidation(e):(o.isPreSubmitValidationComplete=!1,n.map((function(e){return e.disabled=!0})),o.validate(!0).then((function(){o.isValid?o.preSubmitValidation(e):(o.isSubmitting=!1,n.map((function(e){return e.disabled=!1})))})).catch((function(){o.isSubmitting=!1,n.map((function(e){return e.disabled=!1}))})),e.preventDefault()))}));var r,a=Boolean(e.getAttribute("data-formvalidate-eagerness"))?Number(e.getAttribute("data-formvalidate-eagerness")):2;"1"===e.getAttribute("data-formvalidate-debounce")&&(r=new l.d((function(){o.validate()}),{bounceLimitMS:1e3,debounceType:2}));var c,u=h(e.querySelectorAll("input[type=text], input[type=checkbox], input[type=password], input[type=email], select"));try{for(u.s();!(c=u.n()).done;){var f=c.value,p=Boolean(f.getAttribute("data-formvalidate-eagerness"))?Number(f.getAttribute("data-formvalidate-eagerness")):a;p>=1&&(0,s.j9)("change",f,(function(e){var t=e.target;o.fields[o.fieldsIndex[String(t.getAttribute("id"))]].change(),o.validate()})),p>=2&&(0,s.j9)("input",f,(function(e){var t=e.target;o.fields[o.fieldsIndex[String(t.getAttribute("id"))]].change(),void 0!==r?r.callFunc():o.validate()}))}}catch(e){u.e(e)}finally{u.f()}!function(){if(o.template.indexOf("register")>-1){var t,n=h(e.querySelectorAll("input[type=submit], button[type=submit]"));try{for(n.s();!(t=n.n()).done;){var i=t.value;(0,s.j9)("click",i,(function(e){!o.isValid&&o.errored_inputs.length>0&&o.template.indexOf("register")>-1&&(0,d.fg)("SignupFailed",{template:o.template,inputs:o.errored_inputs.toString()})}))}}catch(e){n.e(e)}finally{n.f()}}}()}var v,g=0,y=h(e.querySelectorAll("input[type=text], input[type=checkbox], input[type=hidden], input[type=password], input[type=email], select, .g-recaptcha"));try{for(y.s();!(v=y.n()).done;){var b=m(v.value);o.fields.push(b),o.fieldsIndex[b.getId()]=g,g+=1,o.lastAllData[b.name]=b.getSubmitValue()}}catch(e){y.e(e)}finally{y.f()}!function(e){if(void 0!==e.usernameAssistUrl){var t,n=e.fields.find((function(e){return"username"===e.name})),i=document.getElementById("username_assist_row"),o=document.getElementById("username_assist_available");n&&i&&o&&(e.usernameAssist.fields={usernameField:n,row:i,available:o,availableButton:document.createElement("button")},(t=e.usernameAssist.fields.availableButton).style.display="none",t.style.cursor="pointer",t.style.background="transparent",t.style.border="none",t.style.padding="2px",t.style.color="#0a5a83",e.usernameAssist.fields.availableButton.type="button",e.usernameAssist.fields.availableButton.addEventListener("click",(function(t){var n;t.preventDefault(),void 0!==e.usernameAssist.fields&&(n=e.usernameAssist.fields.availableButton,void 0!==e.usernameAssist.fields&&(e.usernameAssist.fields.usernameField.htmlElement.value=n.innerText,e.validate(!1)))})))}}(o)},serialize:function(){return o.fields.map((function(e){if(""!==e.name&&!e.isDisabled){if(e.isMultiSelect)return Array.from(e.htmlElement.options).filter((function(e){return e.selected})).map((function(t){return"".concat(encodeURIComponent(e.name),"=").concat(encodeURIComponent(t.value))})).join("&");if(!e.isCheckbox&&"radio"!==e.elementType||e.htmlElement.checked){var t=e.getSubmitValue();return"".concat(encodeURIComponent(e.name),"=").concat(encodeURIComponent(t))}}})).filter((function(e){return void 0!==e})).join("&").replace(/%20/g,"+")},validate:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(o.isValidating&&!e)return o.queueValidation=!0,Promise.resolve();o.isValidating=!0;var t,n={},i={},r=!1,s=!1,l=h(o.fields);try{for(l.s();!(t=l.n()).done;){var c=t.value;i[c.name]=c.getSubmitValue(),c.isCheckbox&&""===c.getSubmitValue()||(n[c.name]=c.getSubmitValue()),(i[c.name]!==o.lastAllData[c.name]||e)&&("username"===c.name&&(s=!0),c.showSpinner(),r=!0)}}catch(e){l.e(e)}finally{l.f()}return r?(o.lastAllData=Object.assign({},i),(0,a.I5)(o.validateUrl,n).then((function(t){var n=JSON.parse(t.responseText);o.isValid=n.valid,o.errored_inputs=[];var r,a=h(o.fields);try{for(a.s();!(r=a.n()).done;){var l=r.value;l.isRecaptcha&&!l.isRecaptchaSet?(l.clearError(),l.showError("Captcha has to be completed",e)):void 0!==n.errors[l.errorName]?(l.clearError(),l.showError(n.errors[l.errorName],e),o.errored_inputs.includes(l.errorName)||o.errored_inputs.push(l.errorName),"username"===l.name&&(""===i[l.name].trim()?u(o.usernameAssist.fields,!1,o.usernameAssistUrl,i[l.name]):s&&!1===l.grace&&u(o.usernameAssist.fields,!0,o.usernameAssistUrl,i[l.name]))):(l.clearError(),"username"===l.name&&u(o.usernameAssist.fields,!1,o.usernameAssistUrl,i[l.name])),l.hideSpinner()}}catch(e){a.e(e)}finally{a.f()}if(o.clearGlobalErrors(),void 0!==n.errors.__all__){var c,d=h(n.errors.__all__);try{for(d.s();!(c=d.n()).done;){var f=c.value;o.addGlobalError(f)}}catch(e){d.e(e)}finally{d.f()}o.showGlobalErrors()}o.isValidating=!1,o.queueValidation&&(o.queueValidation=!1,o.validate())})).catch((function(e){if(info("error: ".concat(e)),o.isValidating=!1,!o.queueValidation)throw e;o.queueValidation=!1,o.validate()}))):(o.isValidating=!1,o.queueValidation&&(o.queueValidation=!1,o.validate()),Promise.resolve())},preSubmitValidation:function(t){return n.map((function(e){return e.disabled=!0})),o.isPreSubmitValidationComplete||0===o.preSubmitValidationHandlers.length?(window.setTimeout((function(){n.map((function(e){return e.disabled=!1}))}),700),Promise.resolve()):(t.preventDefault(),Promise.all(o.preSubmitValidationHandlers.map((function(e){return e()}))).then((function(t){var i;o.isSubmitting=!1,window.setTimeout((function(){n.map((function(e){return e.disabled=!1}))}),10),t.reduce((function(e,t){return e&&t}),!0)&&(o.isPreSubmitValidationComplete=!0,(i=document.createElement("button")).style.display="none",e.appendChild(i),window.setTimeout((function(){i.click(),e.removeChild(i)}),0))})).catch((function(t){throw error("Can't complete preSubmitValidation in form ".concat(e.action),t),o.isSubmitting=!1,n.map((function(e){return e.disabled=!1})),t})))},addGlobalError:function(e){var t=document.querySelector("#error_notice > .errorlist"),n=document.createElement("li");n.appendChild(document.createTextNode(e)),t.appendChild(n)},clearGlobalErrors:function(){var e=document.querySelector("#error_notice");if(null!==e){e.classList.add("formvalidate_hidden");var t=document.querySelector("#error_notice > .errorlist");if(null!==t)for(;null!==t.firstChild;)t.removeChild(t.firstChild)}},showGlobalErrors:function(){var e=document.querySelector("#error_notice");null!==e&&e.classList.remove("formvalidate_hidden")},hasValidationErrors:function(){var t,n=!1,i=h(o.fields);try{for(i.s();!(t=i.n()).done;){var r=t.value;n=n||r.hasError()}}catch(e){i.e(e)}finally{i.f()}var s=0!==Array.from(e.getElementsByClassName("errorlist")).filter((function(e){return""!==e.innerHTML.trim()})).length;return n||s},addPreSubmitValidator:function(e){o.preSubmitValidationHandlers.push(e);var t=!1;return function(){t||(o.preSubmitValidationHandlers.splice(o.preSubmitValidationHandlers.indexOf(e),1),t=!0)}}};return o.init(),o}},5896:function(e,t,n){"use strict";n.d(t,{j:function(){return x}});var i=n(1371),o=n(3940),r=n(1976),s=n(2951),a=n(7591),l=n(9492),c=n(7597),u=n(434),d=n(3753),h=n(3705),f=n(1289);function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,c.Z)(e);if(t){var o=(0,c.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,l.Z)(this,n)}}var m=void 0!==window.performance&&void 0!==performance.now,v=function(e){(0,a.Z)(n,e);var t=p(n);function n(){var e;return(0,s.Z)(this,n),(e=t.apply(this,arguments)).isValidationError=!0,e}return(0,r.Z)(n)}((0,u.Z)(Error)),g=function(e){(0,a.Z)(n,e);var t=p(n);function n(){var e;return(0,s.Z)(this,n),(e=t.apply(this,arguments)).isFormInvalidError=!0,e}return(0,r.Z)(n)}((0,u.Z)(Error)),y=function(e,t){var n=t.formElement,i=t.addPreSubmitValidator((function(){if("function"!=typeof window.injectReCaptchaV3Token)return error("window.injectReCaptchaV3Token is not a function: ",(0,o.Z)(window.injectReCaptchaV3Token)),Promise.resolve(!0);var r=m?performance.now():0;return window.injectReCaptchaV3Token(e).then((function(e){if(t.isValid)return w(e,n);throw new g})).then((function(e){if(""===e){var t=document.createElement("input");t.type="hidden",t.name="sign_recaptcha_failed",t.value="1",n.appendChild(t)}else{var i=document.createElement("input");i.type="hidden",i.name="signed_recaptcha",i.value=e,n.appendChild(i)}return(0,h.fg)("ReCAPTCHA3_frontend",{result:"success",timing_milliseconds:m?performance.now()-r:void 0}),!0})).catch((function(t){return!t.isFormInvalidError&&((0,h.fg)("ReCAPTCHA3_frontend",{result:t,timing_milliseconds:m?performance.now()-r:void 0}),b(e,n).then((function(e){return!e||(i(),!1)})))}))}))},b=function(e,t){return"function"!=typeof window.bindNoReCaptchaField?(error("window.bindNoReCaptchaField is not a function: ",(0,o.Z)(window.bindNoReCaptchaField)),Promise.resolve(!1)):null===e.parentNode?(error("replaceWithNoReCaptcha: captcha element hasn't a parent"),Promise.resolve(!1)):(0,d.Ue)("accounts/ajax_norecaptcha_html/").then((function(n){var i=document.createElement("div");if(null===e.parentNode||"function"!=typeof window.bindNoReCaptchaField)return!1;e.parentNode.insertBefore(i,e),i.outerHTML=n.responseText;var o=t.querySelector(".g-recaptcha");if(null===o)return error("replaceWithNoReCaptcha: html doesn't contain norecaptcha"),!1;window.bindNoReCaptchaField(o);var r=document.createElement("a");r.href=(0,d.BN)(t.action);var s=(0,f.dD)(r.search);s["force-nocaptcha"]="1";var a="/"===r.pathname[0]?"":"/";return t.action=(0,d.BN)("".concat(a).concat(r.pathname,"?").concat((0,f.Ie)(s))),!0}))},w=function(e,t){var n=t.querySelector("[data-formvalidate-sign-url]");if(null===n)return Promise.resolve("");var i=n.getAttribute("data-formvalidate-sign-url"),o=t.querySelector("[name=csrfmiddlewaretoken]");return"string"!=typeof i||null===o?Promise.resolve(""):(0,d.I5)(i,{recaptcha3:e,field_to_sign:n.value,csrfmiddlewaretoken:o.value}).then((function(e){var t=JSON.parse(e.responseText);if(!0!==t.valid)throw new v(t.errors);return t.signed_value})).catch((function(e){if(e.isValidationError)throw e;return error("Can't sign recaptcha: ",e),""}))};function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(document.querySelectorAll("form[data-formvalidate]"));try{for(t.s();!(e=t.n()).done;){var n=e.value,o=(0,i.R)(n),r=n.querySelector("[name='prove_you_are_human']");null!==r&&y(r,o)}}catch(e){t.e(e)}finally{t.f()}}},1625:function(e,t,n){"use strict";n.d(t,{Gd:function(){return p},KE:function(){return f},Qg:function(){return h},Vc:function(){return u},Yu:function(){return b},Zx:function(){return d},dY:function(){return v},gH:function(){return y},rm:function(){return g}});var i,o=n(7693),r=n(1794),s={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5},a=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror"],l=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror"],c=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError"];"fullscreenEnabled"in document?i=Object.keys(s):a[0]in document?i=a:l[0]in document?i=l:c[0]in document&&(i=c);var u=500;function d(e){void 0!==i?e[i[s.requestFullscreen]]():"webkitEnterFullScreen"in e&&e.webkitEnterFullScreen()}function h(){void 0!==i&&document[i[s.exitFullscreen]].bind(document)()}function f(){return void 0!==i&&Boolean(document[i[s.fullscreenEnabled]])}function p(){if(void 0!==i)return document[i[s.fullscreenElement]]}function m(){return void 0===i?"":i[s.fullscreenchange]}function v(){return void 0===i?"":"on".concat(i[s.fullscreenerror]).toLowerCase()}function g(){return Boolean(p())}var y=new r.xB("fullscreenChange",{listenersWarningThreshold:function(){return 50+r.q6},maxHistorySize:0});function b(){""!==m()&&(0,o.j9)(m(),document,(function(){return y.fire()}))}},4880:function(e,t,n){"use strict";n.d(t,{Ko:function(){return L},$q:function(){return D},XT:function(){return O}});var i=n(2951),o=n(1976),r=n(7169),s=n(7591),a=n(9492),l=n(7597),c=n(1185),u=n(7693),d=n(9),h=n(7988),f=n(8069),p=n(5392);function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,a.Z)(this,n)}}var v=function(e){(0,s.Z)(n,e);var t=m(n);function n(e){var o;return(0,i.Z)(this,n),(o=t.call(this)).element.style.height="0",o.element.style.width="0",o.element.style.overflow="visible",o.element.style.position="fixed",o.element.style.top="0",o.element.style.left="0",o.componentToOverlay=e.componentToOverlay,o.listener=function(){o.repositionChildrenRecursive()},o.componentToOverlay.didRepositionEvent.listen(o.listener),o.addChild(new y((0,r.Z)(o),e)),o.addChild(new b((0,r.Z)(o),e)),o.addChild(new w((0,r.Z)(o),e)),o.addChild(new C((0,r.Z)(o),e)),o.addChild(new x((0,r.Z)(o),e)),o.addChild(new k((0,r.Z)(o),e)),o.addChild(new S((0,r.Z)(o),e)),o.addChild(new T((0,r.Z)(o),e)),o}return(0,o.Z)(n,[{key:"repositionChildren",value:function(){}},{key:"prepareToRemove",value:function(){this.componentToOverlay.didRepositionEvent.removeListener(this.listener)}}]),n}(d.w),g=function(e){(0,s.Z)(n,e);var t=m(n);function n(e,o,r){var s;return(0,i.Z)(this,n),(s=t.call(this)).holder=e,s.options=o,s.cursor=r,s.thickness=8,s.element.style.height="".concat(s.thickness,"px"),s.element.style.width="".concat(s.thickness,"px"),s.element.style.cursor=s.cursor,(0,p.T)(s.element,(function(e,t,n){e.stopPropagation(),void 0!==o.onStart&&o.onStart();var i=t,r=n,a=Object.freeze((0,h.cQ)(o.componentToOverlay.element)),l=new f.d((function(){o.componentToOverlay.repositionChildrenRecursive()}),{bounceLimitMS:10});return{enabled:!0,move:function(e,t){(0,h.Sn)(s.moveEdges(a,{x:e-i,y:t-r}),o.componentToOverlay.element),l.callFunc()},end:function(){void 0!==o.onStop&&o.onStop()}}})),s}return(0,o.Z)(n)}(d.w),y=function(e){(0,s.Z)(n,e);var t=m(n);function n(e,o){return(0,i.Z)(this,n),t.call(this,e,o,"ns-resize")}return(0,o.Z)(n,[{key:"repositionChildren",value:function(){var e=this.options.componentToOverlay.element.getBoundingClientRect();this.element.style.top="".concat(e.top-this.thickness/2,"px"),this.element.style.left="".concat(e.left,"px"),this.element.style.width="".concat(e.right-e.left,"px")}},{key:"moveEdges",value:function(e,t){return(0,h.xg)(e,t.y,this.options.minHeight)}}]),n}(g),b=function(e){(0,s.Z)(n,e);var t=m(n);function n(e,o){return(0,i.Z)(this,n),t.call(this,e,o,"ns-resize")}return(0,o.Z)(n,[{key:"repositionChildren",value:function(){var e=this.options.componentToOverlay.element.getBoundingClientRect();this.element.style.top="".concat(e.top+e.height-this.thickness/2,"px"),this.element.style.left="".concat(e.left,"px"),this.element.style.width="".concat(e.width,"px")}},{key:"moveEdges",value:function(e,t){return(0,h.F3)(e,t.y,this.options.minHeight,this.options.maxHeight())}}]),n}(g),w=function(e){(0,s.Z)(n,e);var t=m(n);function n(e,o){return(0,i.Z)(this,n),t.call(this,e,o,"ew-resize")}return(0,o.Z)(n,[{key:"repositionChildren",value:function(){var e=this.options.componentToOverlay.element.getBoundingClientRect();this.element.style.top="".concat(e.top,"px"),this.element.style.left="".concat(e.left-this.thickness/2,"px"),this.element.style.height="".concat(e.bottom-e.top,"px")}},{key:"moveEdges",value:function(e,t){return(0,h.Fi)(e,t.x,this.options.minWidth)}}]),n}(g),C=function(e){(0,s.Z)(n,e);var t=m(n);function n(e,o){return(0,i.Z)(this,n),t.call(this,e,o,"ew-resize")}return(0,o.Z)(n,[{key:"repositionChildren",value:function(){var e=this.options.componentToOverlay.element.getBoundingClientRect();this.element.style.top="".concat(e.top,"px"),this.element.style.left="".concat(e.right-this.thickness/2,"px"),this.element.style.height="".concat(e.bottom-e.top,"px")}},{key:"moveEdges",value:function(e,t){return(0,h.jV)(e,t.x,this.options.minWidth,this.options.maxWidth())}}]),n}(g),x=function(e){(0,s.Z)(n,e);var t=m(n);function n(e,o){return(0,i.Z)(this,n),t.call(this,e,o,"nwse-resize")}return(0,o.Z)(n,[{key:"repositionChildren",value:function(){var e=this.options.componentToOverlay.element.getBoundingClientRect();this.element.style.top="".concat(e.top-this.thickness+this.thickness/2,"px"),this.element.style.left="".concat(e.left-this.thickness+this.thickness/2,"px")}},{key:"moveEdges",value:function(e,t){var n=(0,h.xg)(e,t.y,this.options.minHeight),i=(0,h.Fi)(e,t.x,this.options.minWidth);return{top:n.top,height:n.height,left:i.left,width:i.width}}}]),n}(g),k=function(e){(0,s.Z)(n,e);var t=m(n);function n(e,o){return(0,i.Z)(this,n),t.call(this,e,o,"nesw-resize")}return(0,o.Z)(n,[{key:"repositionChildren",value:function(){var e=this.options.componentToOverlay.element.getBoundingClientRect();this.element.style.top="".concat(e.top-this.thickness+this.thickness/2,"px"),this.element.style.left="".concat(e.right-this.thickness/2,"px")}},{key:"moveEdges",value:function(e,t){var n=(0,h.xg)(e,t.y,this.options.minHeight),i=(0,h.jV)(e,t.x,this.options.minWidth,this.options.maxWidth());return{top:n.top,height:n.height,left:i.left,width:i.width}}}]),n}(g),S=function(e){(0,s.Z)(n,e);var t=m(n);function n(e,o){return(0,i.Z)(this,n),t.call(this,e,o,"nesw-resize")}return(0,o.Z)(n,[{key:"repositionChildren",value:function(){var e=this.options.componentToOverlay.element.getBoundingClientRect();this.element.style.top="".concat(e.bottom-this.thickness/2,"px"),this.element.style.left="".concat(e.left-this.thickness+this.thickness/2,"px")}},{key:"moveEdges",value:function(e,t){var n=(0,h.F3)(e,t.y,this.options.minHeight,this.options.maxHeight()),i=(0,h.Fi)(e,t.x,this.options.minWidth);return{top:n.top,height:n.height,left:i.left,width:i.width}}}]),n}(g),T=function(e){(0,s.Z)(n,e);var t=m(n);function n(e,o){return(0,i.Z)(this,n),t.call(this,e,o,"nwse-resize")}return(0,o.Z)(n,[{key:"repositionChildren",value:function(){var e=this.options.componentToOverlay.element.getBoundingClientRect();this.element.style.top="".concat(e.bottom-this.thickness/2,"px"),this.element.style.left="".concat(e.right-this.thickness/2,"px")}},{key:"moveEdges",value:function(e,t){var n=(0,h.F3)(e,t.y,this.options.minHeight,this.options.maxHeight()),i=(0,h.jV)(e,t.x,this.options.minWidth,this.options.maxWidth());return{top:n.top,height:n.height,left:i.left,width:i.width}}}]),n}(g),I=n(1794),P=n(3705),R=n(8759),M=n(8263),A=n(3607),E=function(){function e(t,n,o){(0,i.Z)(this,e),this.draggableCanvasWindow=t,this.config=o,this.bounds={leftBound:NaN,topBound:NaN,bottomBound:NaN,rightBound:NaN,width:NaN,height:NaN},this.localStorageKey="window__".concat(n),this.bounds=this.getBoundsFromStorage(),isNaN(this.bounds.width)&&(this.bounds.width=this.config.defaultWidth),isNaN(this.bounds.height)&&(this.bounds.height=this.config.defaultHeight),this.setDefaultHorizontalBounds(),this.setDefaultVerticalBounds()}return(0,o.Z)(e,[{key:"setDefaultVerticalBounds",value:function(){isNaN(this.bounds.topBound)&&isNaN(this.bounds.bottomBound)&&(this.config.defaultAnchors.indexOf(3)>=0?this.bounds.bottomBound=(0,M.np)():this.config.defaultAnchors.indexOf(4)>=0?this.bounds.topBound=Math.max(0,window.innerHeight/2-this.config.defaultHeight/2):this.bounds.topBound=0)}},{key:"setDefaultHorizontalBounds",value:function(){isNaN(this.bounds.leftBound)&&isNaN(this.bounds.rightBound)&&(this.config.defaultAnchors.indexOf(1)>=0?this.bounds.rightBound=(0,M.np)():this.config.defaultAnchors.indexOf(4)>=0?this.bounds.leftBound=Math.max(0,(0,A._U)()/2-this.config.defaultWidth/2):this.bounds.leftBound=0)}},{key:"getBoundsFromStorage",value:function(){var e={leftBound:NaN,topBound:NaN,bottomBound:NaN,rightBound:NaN,width:NaN,height:NaN};if((0,R.IU)()){var t=window.localStorage.getItem(this.localStorageKey);if(null!==t){for(var n in e=JSON.parse(t))null===e[n]&&(e[n]=NaN);isNaN(e.width)&&(e.width=this.config.defaultWidth),isNaN(e.height)&&(e.height=this.config.defaultHeight)}}return e}},{key:"save",value:function(){this.detect(),(0,R.IU)()&&window.localStorage.setItem(this.localStorageKey,JSON.stringify(this.bounds))}},{key:"detect",value:function(){var e=this.draggableCanvasWindow.element.parentElement;if(null!==e){var t=this.draggableCanvasWindow.element.offsetLeft,n=this.draggableCanvasWindow.element.offsetTop,i=e.clientHeight-(this.draggableCanvasWindow.element.offsetHeight+n),o=e.clientWidth-(this.draggableCanvasWindow.element.offsetWidth+t);this.bounds.height=this.draggableCanvasWindow.element.offsetHeight,this.bounds.width=this.draggableCanvasWindow.element.offsetWidth,t<=o?(this.bounds.leftBound=t,this.bounds.rightBound=NaN):(this.bounds.leftBound=NaN,this.bounds.rightBound=o),n<=i?(this.bounds.topBound=n,this.bounds.bottomBound=NaN):(this.bounds.topBound=NaN,this.bounds.bottomBound=i)}else error("no parent element")}},{key:"apply",value:function(){var e=this,t=this.draggableCanvasWindow.element.parentElement;null!==t?0!==t.clientHeight&&(void 0!==this.config.autoSize&&this.config.autoSize?(this.draggableCanvasWindow.innerDiv.style.position="relative",this.draggableCanvasWindow.element.style.width="auto",this.draggableCanvasWindow.element.style.height="auto",this.bounds.height=this.draggableCanvasWindow.element.offsetHeight,this.bounds.width=this.draggableCanvasWindow.element.offsetWidth):this.config.resizeable?(e.bounds.width=Math.min(e.bounds.width,t.clientWidth),e.bounds.height=Math.min(e.bounds.height,t.clientHeight),e.bounds.width=Math.max(e.bounds.width,e.config.minWidth),e.bounds.height=Math.max(e.bounds.height,e.config.minHeight),this.draggableCanvasWindow.element.style.width="".concat(this.bounds.width,"px"),this.draggableCanvasWindow.element.style.height="".concat(this.bounds.height,"px")):(this.bounds.width=this.config.defaultWidth,this.bounds.height=this.config.defaultHeight+this.draggableCanvasWindow.getTitleBarHeight(),this.draggableCanvasWindow.element.style.width="".concat(this.bounds.width,"px"),this.draggableCanvasWindow.element.style.height="".concat(this.bounds.height,"px")),this.sanityCheckBounds()?info("unexpected bounds: top:".concat(this.bounds.topBound," bottom:").concat(this.bounds.bottomBound," left:").concat(this.bounds.leftBound," right: ").concat(this.bounds.rightBound)):(this.setVerticalPosition(t.clientHeight),this.setHorizontalPosition(t.clientWidth))):error("no parent element")}},{key:"sanityCheckBounds",value:function(){var e=!isNaN(this.bounds.topBound)&&!isNaN(this.bounds.bottomBound)||isNaN(this.bounds.topBound)&&isNaN(this.bounds.bottomBound),t=!isNaN(this.bounds.leftBound)&&!isNaN(this.bounds.rightBound)||isNaN(this.bounds.leftBound)&&isNaN(this.bounds.rightBound);return e||t}},{key:"setVerticalPosition",value:function(e){isNaN(this.bounds.topBound)?isNaN(this.bounds.bottomBound)||((this.bounds.bottomBound+this.bounds.height>e||this.bounds.bottomBound<0)&&(info("set bottomBound to container height - bounds height to make fit"),this.bounds.bottomBound=Math.max(0,e-this.bounds.height)),this.draggableCanvasWindow.element.style.top="".concat(e-this.bounds.height-this.bounds.bottomBound,"px")):((this.bounds.topBound+this.bounds.height>e||this.bounds.topBound<0)&&(info("set topBound to container height - bounds height to make fit"),this.bounds.topBound=Math.max(0,e-this.bounds.height)),this.draggableCanvasWindow.element.style.top="".concat(this.bounds.topBound,"px"))}},{key:"setHorizontalPosition",value:function(e){isNaN(this.bounds.leftBound)?isNaN(this.bounds.rightBound)||((this.bounds.rightBound+this.bounds.width>e||this.bounds.rightBound<0)&&(info("set rightBound to 0 to make fit"),this.bounds.rightBound=0),this.draggableCanvasWindow.element.style.left="".concat(e-this.bounds.width-this.bounds.rightBound,"px")):((this.bounds.leftBound+this.bounds.width>e||this.bounds.leftBound<0)&&(info("set leftBound to 0 to make fit"),this.bounds.leftBound=0),this.draggableCanvasWindow.element.style.left="".concat(this.bounds.leftBound,"px"))}}]),e}();function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(n);try{for(o.s();!(i=o.n()).done;){var r=i.value;r.style.cursor="move",(0,p.T)(r,(function(n,i,o){if(void 0!==t.canStart&&!1===t.canStart())return p.w;var r=e.offsetLeft,s=e.offsetTop,a=e.offsetHeight,l=e.offsetWidth;if(null===e.parentElement)return error("draggable without parent element"),p.w;var c=e.parentElement.clientHeight,u=e.parentElement.clientWidth,d=i,h=o;return void 0!==t.dragStart&&t.dragStart(),{enabled:!0,move:function(t,n){var i,o;(i=s+(n-h))<0?i=0:i+a>c&&(i=c-a),(o=r+(t-d))<0?o=0:o+l>u&&(o=u-l),e.style.top="".concat(i,"px"),e.style.left="".concat(o,"px")},end:function(){void 0!==t.dragStop&&t.dragStop()}}}))}}catch(e){o.e(e)}finally{o.f()}}},9179:function(e,t,n){"use strict";n.d(t,{Ht:function(){return E},J6:function(){return A},KS:function(){return L},Kx:function(){return M},PJ:function(){return _},d$:function(){return R},mp:function(){return D},rL:function(){return F}});var i,o,r=n(8759),s=n(1185),a=n(5712),l=n(2800),c=n(8626),u=n(3753),d=n(8157),h=n(5042),f=n(4793),p=n(9320),m=n(5726),v=n(3705),g=n(3544),y=n(7201),b=n(1392),w=n(3543),C=n(3328),x=n(2359),k=n(3340);function S(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return T(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)?T(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("div");return t.dataset.testid="chat-message",t.style.fontFamily="Tahoma,Arial,Helvetica,sans-serif",t.style.boxSizing="border-box",t.style.paddingTop="3px",t.style.paddingBottom="3px",t.style.paddingLeft="5px",t.style.paddingRight="5px",t.style.overflowWrap="break-word",t.style.wordWrap="break-word",e.length>0&&t.setAttribute("data-nick",e),t}function Z(e,t){var n=document.createElement("span");return(0,c.vj)()&&void 0!==e.message&&t&&b.uF.isShortcodeSyntax(e.message)?n=(0,y.rP)(e,t,B,k.Fx):!1!==e.parseEmoticon?n=(0,y.F$)(e.message):n.innerText=e.message,n.style.color=void 0!==e.foreground?e.foreground:"",n.style.background=void 0!==e.background?e.background:"",n.style.fontWeight=void 0!==e.weight?e.weight:"",n}function F(e){var t=U();return e.renderTo(t)}function _(e,t){var n=U(e);return n.innerText=e,n.appendChild(t),x.p.setMessageColorData(n,I("#aaaaaa")),n.classList.add("roomNotice"),n}f.kN.listen((function(e){i=e.dossier.roomGender,o=e.chatConnection}))},2359:function(e,t,n){"use strict";n.d(t,{p:function(){return p}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(1185),c=n(4793),u=n(9),d=n(758);function h(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return f(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)?f(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=0&&n.pendingTimeouts.splice(t,1),e()}),t);this.pendingTimeouts.push(i)}},{key:"afterDOMConstructed",value:function(){var e=this;this.chatComponentToMirror.didRepositionEvent.listen((function(){e.repositionChildrenRecursive()}))}},{key:"repositionChildren",value:function(){var e=this.chatComponentToMirror.messageList,t=this.chatComponentToMirror.messageListWrapper,n=e.getBoundingClientRect();this.element.style.left="".concat(n.left,"px"),this.element.style.width="".concat(e.clientWidth,"px"),this.innerDiv.style.width="".concat(e.clientWidth,"px"),this.element.style.top="".concat(t.getBoundingClientRect().top,"px"),this.element.style.height="".concat(t.clientHeight,"px"),this.innerDiv.style.height="".concat(t.clientHeight,"px")}}],[{key:"setMessageColorData",value:function(e,t){e.setAttribute("data-pureChatColor",t),e.classList.add("pureChatColor")}},{key:"setMessageColor",value:function(e){var t=function(e){var t=e.getAttribute("data-pureChatColor");null!==t&&(e.style.color=t)};if(e.classList.contains("pureChatColor"))t(e);else{var n,i=h(e.getElementsByClassName("pureChatColor"));try{for(i.s();!(n=i.n()).done;){var o=n.value;o instanceof HTMLElement&&t(o)}}catch(e){i.e(e)}finally{i.f()}}}}]),f}(u.w)},3340:function(e,t,n){"use strict";n.d(t,{FJ:function(){return o},F_:function(){return h},Fx:function(){return s},PC:function(){return u},WP:function(){return a},Yw:function(){return c},Zx:function(){return l},jf:function(){return r},rb:function(){return d}});var i=n(1794),o=new i.xB("bioClicked"),r=new i.xB("userListRequest"),s=new i.xB("openTipCalloutRequest"),a=new i.xB("loadRoomRequest"),l=new i.xB("reportAbuseRequest"),c=new i.xB("privateWindowRequest"),u=new i.xB("chatWindowRequest"),d=new i.xB("colorModeChangeRequest"),h=new i.xB("roomChangeColorModeUpdateRequest")},9165:function(e,t,n){"use strict";n.d(t,{$p:function(){return i.$p},BK:function(){return i.BK},Y0:function(){return i.Y0},aI:function(){return i.aI},dW:function(){return i.dW},eN:function(){return r},ej:function(){return i.ej},hP:function(){return o}});var i=n(4918);function o(e){var t=i.BK.get(e);return void 0!==t?t:"followed"===e?"o":(error("Unknown user category ".concat(e)),"")}function r(e){switch(e){case i.Y0.Female:return"female-cams";case i.Y0.Male:return"male-cams";case i.Y0.Couple:return"couple-cams";case i.Y0.Trans:case i.Y0.OldTrans:return"trans-cams";default:return""}}},9846:function(e,t,n){"use strict";n.d(t,{r:function(){return o}});var i={enter:13,esc:27,modifierKeys:{ctrl:17,shift:16,alt:18,leftMeta:91,rightMeta:93,caps:20,tab:9},arrowKeys:{left:37,up:38,right:39,down:40}};function o(e){if(void 0===e||e===i.enter||e===i.esc)return!1;for(var t in i.arrowKeys)if(e===i.arrowKeys[t])return!1;for(var n in i.modifierKeys)if(e===i.modifierKeys[n])return!1;return!0}},534:function(e,t,n){"use strict";n.d(t,{a:function(){return s}});var i=n(2951),o=n(1976);function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw s}}}}(this.handlers);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(e.which===i.keyCode&&(!i.requiresCtrlOrMeta||e.ctrlKey||e.metaKey))return i.handle(e),!0}}catch(e){n.e(e)}finally{n.f()}return!1}}]),e}()},9905:function(e,t,n){"use strict";n.d(t,{Y:function(){return a},x:function(){return s}});var i=n(1185),o=n(2425);function r(e,t){var n=document.createElement("div");n.innerText=t,n.style.overflow="hidden",n.style.maxHeight="21px",e.appendChild(n)}function s(e){return void 0===e?a():a({name:e.getString("name",!1),template:e.getString("template",!1),firstRowLabel:e.getStringWithNumbers("row1_label",!1),secondRowLabel:e.getStringWithNumbers("row2_label",!1),thirdRowLabel:e.getStringWithNumbers("row3_label",!1),firstRowValue:e.getStringWithNumbers("row1_value",!1),secondRowValue:e.getStringWithNumbers("row2_value",!1),thirdRowValue:e.getStringWithNumbers("row3_value",!1)})}function a(e){var t=document.createElement("tr"),n=document.createElement("tr"),s=document.createElement("tr");if(void 0!==e){var a=e.template,l=[],c=[];if(""!==e.firstRowLabel){var u=document.createElement("th");u.style.padding="2px",r(u,e.firstRowLabel),l.push(u),t.appendChild(u);var d=document.createElement("td");r(d,e.firstRowValue),t.appendChild(d),c.push(d),d.style.width="50%",d.style.paddingLeft="10px"}else{var h=document.createElement("td");r(h,e.firstRowValue),h.colSpan=2,c.push(h),t.appendChild(h),h.style.textAlign="center"}if(""!==e.secondRowLabel){var f=document.createElement("th");f.style.padding="2px",f.style.fontWeight="bold",r(f,e.secondRowLabel),l.push(f),n.appendChild(f);var p=document.createElement("td");r(p,e.secondRowValue),c.push(p),n.appendChild(p),p.style.width="50%",p.style.paddingLeft="10px"}else{var m=document.createElement("td");r(m,e.secondRowValue),m.colSpan=2,c.push(m),n.appendChild(m),m.style.textAlign="center"}if(""!==e.thirdRowLabel){var v=document.createElement("th");v.style.padding="2px",r(v,e.thirdRowLabel),l.push(v),s.appendChild(v);var g=document.createElement("td");r(g,e.thirdRowValue),c.push(g),s.appendChild(g),g.style.width="50%",g.style.paddingLeft="10px"}else{var y=document.createElement("td");r(y,e.thirdRowValue),y.colSpan=2,c.push(y),s.appendChild(y),y.style.textAlign="center"}for(var b=0,w=l;b1&&void 0!==arguments[1]&&arguments[1],n=.05;for(e=Math.min(255,e);e>this.brightness()&&(!t||255!==this.red&&255!==this.green&&255!==this.blue);)this.red=Math.min(this.red+Math.max(1,n*this.red),255),this.green=Math.min(this.green+Math.max(1,n*this.green),255),this.blue=Math.min(this.blue+Math.max(1,n*this.blue),255);this.red=Math.round(this.red),this.green=Math.round(this.green),this.blue=Math.round(this.blue)}},{key:"totalWeights",value:function(){return this.redWeight+this.greenWeight+this.blueWeight}},{key:"redMultiplier",value:function(){return this.redWeight/this.totalWeights()}},{key:"greenMultiplier",value:function(){return this.greenWeight/this.totalWeights()}},{key:"blueMultiplier",value:function(){return this.blueWeight/this.totalWeights()}},{key:"brightness",value:function(){return Math.round(this.redMultiplier()*this.red+this.greenMultiplier()*this.green+this.blueMultiplier()*this.blue)}}]),e}()},5726:function(e,t,n){"use strict";n.d(t,{Ng:function(){return y},Q0:function(){return b},Yl:function(){return x},ZA:function(){return T},aP:function(){return g},t:function(){return v},yY:function(){return S}});var i=n(7791),o=n(824),r=n.n(o),s=n(2018),a=n(1185),l=n(8542),c=n(3753),u=n(5042),d=n(2359),h=n(9320),f=n(6522),p=n(3543);function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("div");return t.dataset.testid="chat-message",t.style.fontFamily="Tahoma,Arial,Helvetica,sans-serif",t.style.boxSizing="border-box",t.style.width="100%",t.style.paddingTop="3px",t.style.paddingBottom="3px",t.style.paddingLeft="5px",t.style.paddingRight="5px",t.style.overflowX="hidden",e.length>0&&t.setAttribute("data-nick",e),t}function y(e,t){return t.username===e?"".concat(p.ag.broadcaster," "):t.isMod?"".concat(p.ag.moderator," "):t.inFanclub?"".concat(p.ag.fanclubMember," "):"".concat(p.ag.user," ")}function b(e){var t=(0,u._c)(e),n=new h.I(t.red,t.green,t.blue),i=n.brightness();return n.raiseToMin(255-i/3),"rgb(".concat(n.red,", ").concat(n.green,", ").concat(n.blue,")")}function w(){var e=document.createElement("span");return e.innerText=", ",e}function C(e,t){return new Promise((function(n,i){(0,s.HV)(e).then((function(e){var i=document.createElement("span");if(0!==e.items.length){var o=document.createElement("span");i.appendChild(o);var r,s=0,u=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return m(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)?m(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(e.items);try{var d=function(){var n,o=r.value;s+=1,"mobile"===t?((n=document.createElement("div")).style.display="inline",n.style.position="relative",n.innerText=o.name):((n=document.createElement("a")).href=(0,c.BN)("/apps2/".concat(o.slot,"/").concat((0,l.bY)(o),"/")),n.target="_blank",n.innerText=o.name,(0,a.vP)(n,"msg-link"),n.onmouseenter=function(){n.style.textDecoration="underline"},n.onmouseleave=function(){n.style.textDecoration="none"}),i.appendChild(n),s0&&s.appendChild(w()),s.appendChild(f),e.next=27;break;case 24:e.prev=24,e.t1=e.catch(12),0===i.length&&(s=document.createElement("div"));case 27:return e.abrupt("return",Promise.resolve(s));case 28:case"end":return e.stop()}}),e,null,[[12,24]])})))).apply(this,arguments)}function S(e,t){var n=e;void 0!==e.ts?t.dataset.ts=e.ts.toString():void 0!==n.createdAt&&(t.dataset.ts=n.createdAt.getTime().toString())}function T(e,t){var n=e.dataset.ts;if(void 0!==n&&""!==n){for(var i=t.children,o=t.children.length,r=i.length=r;s-=1){var a=i[s].getAttribute("data-ts");if(null!==a&&""!==a){if(Number.parseInt(a)<=Number.parseInt(n))break;o=s}}o>=t.children.length?t.appendChild(e):t.insertBefore(e,i[o])}else t.appendChild(e)}},5078:function(e,t,n){"use strict";n.d(t,{i:function(){return v},u:function(){return g}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(8759),c=n(7693),u=n(9),d=n(1794),h=n(3682),f=n(3543),p=n(1289);var m=window.Accelerometer,v=function(e){(0,r.Z)(d,e);var t,n,u=(t=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function d(){var e;(0,i.Z)(this,d),(e=u.call(this)).element.style.textAlign="center",e.element.style.paddingTop="40px",e.element.style.backgroundColor="rgba(255, 255, 255, 0.5)",e.element.style.width="100%",e.element.style.height="100%";var t=e.element.appendChild(document.createElement("img"));if(t.src="".concat(STATIC_URL_MOBILE,"rotate.svg"),t.style.width="500px",t.style.objectFit="contain",t.style.maxWidth="40%",t.style.maxHeight="40%",t.style.padding="15px",t.style.animationName="spin-default",t.style.animationDuration="2s",t.style.animationIterationCount="infinite",document.head.appendChild(document.createElement("style")).innerText="@keyframes spin-default { 0% { transform: rotate(0deg); } 100% { transform: rotate(180deg); } }",e.text=e.element.appendChild(document.createElement("div")),e.text.style.fontWeight="bold",e.text.style.fontSize="1.5em",e.text.style.padding="15px",(0,c.j9)("fullscreenchange",document,(function(t){e.onFullScreen()})),(0,l.Tt)()||void 0===window.Accelerometer)e.update(),h.bs.listen((function(){e.update()}));else{e.image=t;var n=screen.orientation.type,o=new m({frequency:2});(0,c.j9)("reading",o,(function(){e.updateAndroid(o.x,o.y,o.z,n)})),o.start()}return g.listen((function(){if((0,h.qn)()&&null===document.fullscreenElement)try{void 0!==document.documentElement.requestFullscreen&&document.documentElement.requestFullscreen()}catch(e){warn(e)}})),e}return(0,o.Z)(d,[{key:"onFullScreen",value:function(){if(debug("On Full Screen"),(0,h.qn)()&&void 0!==screen.orientation){debug("Trying to lock landscape");try{screen.orientation.lock("landscape")}catch(e){warn(e)}}this.update()}},{key:"update",value:function(){(0,h.qn)()&&(0,h.P0)()||"true"===(0,p.dD)(window.location.search).ignorerotation||!(0,h.qn)()?this.element.style.display="none":(this.element.style.display="",(0,h.gr)()?this.text.innerText=f.ag.incorrectPortrait:this.text.innerText=f.ag.incorrectLandscape)}},{key:"updateAndroid",value:function(e,t,n,i){null===document.fullscreenElement?(this.image.style.display="none",this.element.style.display="",this.text.innerText=f.ag.missingFullscreen+f.ag.androidBroadcast):("portrait-primary"===i||"portrait-secondary"===i)&&e<4.5&&(t>2||t<-2)||Math.abs(t)>6.5&&n<8.5?(this.image.style.display="",this.element.style.display="",this.text.innerText=f.ag.incorrectPortrait):this.element.style.display="none"}}]),d}(u.w),g=new d.xB("tryFullScreen")},5537:function(e,t,n){"use strict";n.d(t,{Qs:function(){return F},Ug:function(){return N},ZF:function(){return U},lC:function(){return Z},lr:function(){return j},u5:function(){return _}});var i=n(7169),o=n(2951),r=n(1976),s=n(3243),a=n(7591),l=n(9492),c=n(7597),u=n(4649),d=n(1185),h=n(2800),f=n(3753),p=n(695),m=n(4793),v=n(9),g=n(8263),y=n(1794),b=n(3705),w=n(3544),C=n(9545),x=n(928),k=n(3543),S=n(47),T=n(4043);function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,c.Z)(e);if(t){var o=(0,c.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,l.Z)(this,n)}}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function R(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:-1;this.element.scrollLeft=e}}]),n}(k.w),W=function(e){(0,l.Z)(n,e);var t=H(n);function n(e){return(0,r.Z)(this,n),t.call(this,e)}return(0,s.Z)(n,[{key:"initUI",value:function(e){var t=this;(0,i.Z)((0,u.Z)(n.prototype),"initUI",this).call(this,e),this.hideElement();var o=new _.lr({onClick:e.onSendMessageClick});this.privateShowButton.didRepositionEvent.listen((function(){t.setScrollLeft()}));var r={direction:"initial",height:"",margin:"0 ".concat(D.xt/2,"px")};(0,S.Zs)(this.element,{padding:"8px",height:"56px",direction:"rtl",borderBottom:""}),(0,S.Zs)(o.element,r),(0,S.Zs)(this.sendTipButton.element,r),(0,S.Zs)(this.privateShowButton.element,r),(0,S.Zs)(this.fanclubButton.element,r),this.element.ontouchstart=function(e){e.stopPropagation()},this.element.prepend(o.element)}}]),n}(z),V=n(202),q=n(4364),K=n(2923),J=n(4043),G=n(3607),Y=n(3682);function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==arguments[1]&&arguments[1];(0,r.Z)(this,n),(i=t.call(this)).outgoingHandlers=e,i.isPmChatContents=l,i.addMessageHTMLEvent=new I.xB("addMessageHtml",{reportIfNoListeners:!1}),i.removeMessagesForUserEvent=new I.xB("removeMessageHtml",{reportIfNoListeners:!1}),i.scrolledToBottom=new I.xB("scrolledToBottom"),i.messageList=(o=document.createElement("div"),(0,h.vP)(o,"msgList"),(0,E.ql)(o,"text"),o.style.width="100%",o.style.cursor="text",o.style.paddingBottom="4px",o),i.noticeList=function(){var e=document.createElement("div");return(0,h.vP)(e,"noticeList"),(0,E.ql)(e,"text"),e.style.width="100%",e.style.cursor="text",e.style.paddingBottom="4px",e}(),i.messageListWrapper=((s=document.createElement("div")).style.width="100%",s.className="mobile-msg-list-wrapper",s.style.boxSizing="border-box",s.style.overflowX="hidden",(0,K.q)(s,!0),s),i.isWatchingPrivate=!1,i.inputFieldHasFocus=!1,i.messageCounter=0,i.pmMessageCounter=0,i.listenerGroup=new I.mM,i.autocompleteModalCollection=[],i.toBottom=function(){i.scrollToBottom()},(0,h.vP)(i.element,"ChatContents"),(0,S.Zs)(i.element,{position:"relative",wordWrap:"break-word"}),i.messageListWrapper.appendChild(i.noticeList),i.messageListWrapper.appendChild(i.messageList),i.element.appendChild(i.messageListWrapper),i.initInputUI(),i.initPrivateOverlay(),i.initEmoticonModal(),i.initUserMentionModal(),i.initCssClasses(),i.toggleInputActionBarDisplay(),(0,v.j9)("submit",i.inputForm,(function(e){e.preventDefault(),i.customInputField.submit()})),(0,v.j9)("focus",i.customInputField.element,(function(e){i.inputFieldHasFocus=!0,J.U9.fire(void 0),(0,q.m7)()&&(i.inputDiv.style.bottom="50px",void 0!==i.userMentionModal&&(i.userMentionModal.element.style.bottom="".concat(te()+50-3,"px")))})),(0,v.j9)("blur",i.customInputField.element,(function(e){(0,d.i7)()&&(0,d.Tt)()&&i.customInputField.element.blur(),i.autocompleteModalCollection.some((function(e){return e.isVisible()}))&&e.cancelable?e.preventDefault():(i.inputFieldHasFocus=!1,J.Ey.fire(void 0),i.toggleInputActionBarDisplay(),(0,q.m7)()&&(i.inputDiv.style.bottom="0",void 0!==i.userMentionModal&&(i.userMentionModal.element.style.bottom="".concat(te()-3,"px"))))}));var c=!1,u=!1,f=new x.d((function(){c=!1}),{bounceLimitMS:50,debounceType:1});(0,v.j9)("scroll",i.messageListWrapper,(function(e){c||(c=!0,u=i.isScrolledUp()),f.callFunc(),!i.isScrolledUp()&&u&&(i.scrolledToBottom.fire(),u=!1)})),(0,v.j9)("keyup",i.element,(function(e){"Enter"===e.key&&i.customInputField.blur()})),b.y.listen((function(e){i.rulesModal=(0,m.vo)((0,a.Z)(i),e),void 0!==i.rulesModal&&i.addChild(i.rulesModal)})).addTo(i.listenerGroup),w.kN.once((function(e){i.currentRoomContext=e,i.messageListWrapper.style.fontSize=e.dossier.userChatSettings.fontSize,i.setLineHeight(),i.listenerGroup.add(p.it.listen((function(){(0,V.y0)(i.messageList,e.dossier.userName)})))}));var g=function(e){i.messageListWrapper.style.fontSize=e.fontSize,i.setLineHeight()};return U.gO.listen(g).addTo(i.listenerGroup),w.QN.listen((function(){U.gO.removeListener(g),i.autocompleteModalCollection.forEach((function(e){return e.dispose()}))})).addTo(i.listenerGroup),J.YL.listen((function(e){i.inputDiv.style.position=e?"absolute":"fixed",i.inputDiv.style.bottom="0"})).addTo(i.listenerGroup),i}return(0,s.Z)(n,[{key:"initInputUI",value:function(){var e,t,n=this;this.inputForm=(e=document.createElement("form"),(0,S.Zs)(e,{height:"100%",display:"flex",alignItems:"center",boxSizing:"border-box",flex:1,overflow:"hidden",position:"relative"}),e),this.inputDiv=(t=document.createElement("div"),(0,h.vP)(t,"inputDiv"),(0,S.Zs)(t,{height:"".concat(te(),"px"),boxSizing:"border-box",position:"absolute",bottom:"0",cursor:"text",borderTopWidth:"".concat(ne,"px"),borderTopStyle:"solid",zIndex:1,display:"flex",alignItems:"center",padding:"8px"}),t);var i,o=this.isPmChatContents?D.jH:D.eq;this.customInputField=function(e,t){var i=new C.t7((function(){return n.sendMessageFromInput()}),t);return i.element.dataset.testid="chat-input",(0,S.Zs)(i,{boxSizing:"border-box",lineHeight:"".concat(24,"px"),minHeight:"".concat(24,"px"),fontSize:"16px",fontFamily:"Tahoma, Arial, Helvetica, sans-serif",WebkitUserSelect:"text",height:""}),i}(0,o),this.inputPlaceholder=(i=document.createElement("span"),(0,h.vP)(i,"placeholder"),i.innerText=Z.ag.sendAMessage,(0,S.Zs)(i,{position:"absolute",top:"50%",transform:"translateY(-50%)",pointerEvents:"none",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),i),this.sendButtonRoot=document.createElement("span");var r=f.d.get("SendButton");this.sendButton=new r({onClick:function(){(0,A.fg)("MobileSendButtonClicked",{input:n.customInputField.getText()}),n.customInputField.submit(),n.customInputField.blur()},isPm:this.isPmChatContents,variant:"MobileSplitMode",hidden:!0,highlight:!1},this.sendButtonRoot),R.gH.listen((function(){n.inputForm.style.display="none",window.setTimeout((function(){return n.showInputForm()}),0)})).addTo(this.listenerGroup),(0,L.ZY)()?this.constructActionBarInputUI():(0,P.$_)()?this.constructEmphasizedInputUI():this.constructInputUI()}},{key:"constructInputUI",value:function(){this.inputControlsWrapper=ie(),this.inputControlsWrapper.appendChild(this.sendButtonRoot);var e={padding:"0px 6px",fontSize:"13px",minHeight:"40px"};this.actionButtonsContainer=document.createElement("div"),(0,S.Zs)(this.actionButtonsContainer,{display:"flex"}),this.inputControlsWrapper.appendChild(this.actionButtonsContainer);var t=new _.Ug({tipButtonText:Z.ag.sendTipButtonText});(0,S.Zs)(t,X(X({},e),{},{marginRight:"5px"})),this.actionButtonsContainer.appendChild(t.element);var n=new _.ZF;(0,S.Zs)(n,X(X({},e),{},{marginBottom:""})),this.actionButtonsContainer.appendChild(n.element);var i=new _.lC({useConciseText:!0});(0,S.Zs)(i,X(X({},e),{},{marginBottom:""})),this.actionButtonsContainer.appendChild(i.element),i.displayToggled.listen((function(e){e?n.hideElement():n.getHasFanclub()&&n.showElement()})),this.inputForm.appendChild(this.inputPlaceholder),this.inputForm.appendChild(this.customInputField.element),this.inputDiv.appendChild(this.inputForm),this.inputDiv.appendChild(this.inputControlsWrapper),this.element.appendChild(this.inputDiv),this.bindInputObserver(),this.sendButton.update({hidden:!0}),this.initToggleActionButtons()}},{key:"constructEmphasizedInputUI",value:function(){(0,h.vP)(this.inputForm,"inputForm"),(0,S.Zs)(this.inputForm,{display:"flex",borderWidth:"1px",borderStyle:"solid",borderRadius:"4px",paddingLeft:"8px"}),this.inputControlsWrapper=ie(),(0,S.Zs)(this.inputControlsWrapper,{margin:0,height:"100%"}),this.actionButtonsContainer=document.createElement("div"),(0,S.Zs)(this.actionButtonsContainer,{height:"100%"}),this.inputControlsWrapper.appendChild(this.actionButtonsContainer);var e=new _.Ug({style:{padding:"0px 6px",fontSize:"14px",minHeight:"",height:"100%",marginRight:0,marginLeft:"8px"},tipButtonText:Z.ag.sendTipButtonText});this.actionButtonsContainer.appendChild(e.element),this.inputForm.appendChild(this.inputPlaceholder),this.inputForm.appendChild(this.customInputField.element),this.inputForm.appendChild(this.sendButtonRoot),this.inputDiv.appendChild(this.inputForm),this.inputDiv.appendChild(this.inputControlsWrapper),this.element.appendChild(this.inputDiv),this.bindInputObserver(),this.sendButton.update({hidden:!1}),this.initToggleActionButtons()}},{key:"constructActionBarInputUI",value:function(){var e=this;this.inputControlsWrapper=ie(),this.inputControlsWrapper.appendChild(this.sendButtonRoot),this.inputForm.appendChild(this.inputPlaceholder),this.actionBar=new W({onSendMessageClick:function(){e.toggleInputActionBarDisplay(),e.customInputField.focus()}}),this.inputForm.appendChild(this.customInputField.element),this.inputDiv.appendChild(this.inputForm),this.inputDiv.appendChild(this.inputControlsWrapper),this.inputDiv.appendChild(this.actionBar.element),this.element.appendChild(this.inputDiv),this.bindInputObserver(),(0,v.j9)("scroll",this.actionBar.element,(function(){void 0!==e.actionBar&&(n.currScrollLeft=e.actionBar.element.scrollLeft)})),oe.listen((function(){e.toggleInputActionBarDisplay()}))}},{key:"initEmoticonModal",value:function(){this.emoticonAutocompleteModal=new T.i(this.customInputField),this.inputDiv.appendChild(this.emoticonAutocompleteModal.element),this.emoticonAutocompleteModal.afterDOMConstructedIncludingChildren(),this.autocompleteModalCollection.push(this.emoticonAutocompleteModal)}},{key:"initUserMentionModal",value:function(){this.isPmChatContents||(this.userMentionModal=this.addChild(new p.AL({inputElement:this.customInputField,leftOffset:10,rightOffset:167,inputDivHeight:te()})))}},{key:"initCssClasses",value:function(){this.isPmChatContents?(this.element.classList.add("MobileChatDivPm"),this.element.dataset.testid="pm-chat-base",this.customInputField.element.classList.add("mobileInputFieldPm"),this.emoticonAutocompleteModal.element.classList.add("mobileEmoticonAutocompleteModalPm")):(this.element.classList.add("MobileChatDivChat"),this.element.dataset.testid="chat-base",this.customInputField.element.classList.add("mobileInputFieldChat"),this.emoticonAutocompleteModal.element.classList.add("mobileEmoticonAutocompleteModalChat"))}},{key:"toggleActionButtons",value:function(){this.inputFieldHasFocus?((0,P.$_)()||this.sendButton.update({hidden:!1}),void 0!==this.actionButtonsContainer&&(this.actionButtonsContainer.style.display="none")):((0,P.$_)()||this.sendButton.update({hidden:!0}),void 0!==this.actionButtonsContainer&&(this.actionButtonsContainer.style.display="flex"))}},{key:"initToggleActionButtons",value:function(){var e=this;J.U9.listen((function(){e.toggleActionButtons()})).addTo(this.listenerGroup),J.Ey.listen((function(){window.setTimeout((function(){e.toggleActionButtons()}),200)})).addTo(this.listenerGroup)}},{key:"toggleInputActionBarDisplay",value:function(){var e;if(void 0!==this.inputControlsWrapper&&void 0!==this.actionBar&&(0,L.ZY)()){var t=(this.autocompleteModalCollection.some((function(e){return e.isVisible()}))||!0===(null===(e=this.userMentionModal)||void 0===e?void 0:e.isVisible()))&&""!==this.customInputField.getText(),i=this.actionBar.isShown()||t;this.actionBar.setScrollLeft(),n.currScrollLeft=this.actionBar.element.scrollLeft,i?(this.actionBar.hideElement(),this.showInputForm("block"),this.inputControlsWrapper.style.display="flex"):(this.actionBar.showElement(),this.inputForm.style.display="none",this.inputControlsWrapper.style.display="none")}}},{key:"bindInputObserver",value:function(){var e=this;new MutationObserver((function(t){t.forEach((function(){var t=e.customInputField.getText();t.length>0?e.inputPlaceholder.style.display="none":e.inputPlaceholder.style.display="block",t.trim().length<=0?e.sendButton.update({highlight:!1}):e.sendButton.update({highlight:!0})}))})).observe(this.customInputField.element,{characterData:!0,subtree:!0,childList:!0})}},{key:"showInputForm",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"inline-block";this.inputForm.style.display=(0,P.$_)()?"flex":e}},{key:"setLineHeight",value:function(){var e=Number(this.messageListWrapper.style.fontSize.slice(0,-2));this.messageListWrapper.style.lineHeight="".concat(e+7,"pt")}},{key:"shouldSendMessageFromInput",value:function(){return!((0,y.Cg)('You must be logged in to send a message. Click "OK" to login.')||this.isWatchingPrivate&&!this.isPmChatContents&&((0,g.Cj)("".concat(Z.ag.privateShowChatActive," ").concat(Z.ag.goToPrivateTabToChat)),1))}},{key:"sendMessageFromInput",value:function(){if(!this.shouldSendMessageFromInput())return!1;this.scrollToBottom();var e=this.customInputField.getText();return""!==e.trim()&&this.processMessage(e),!0}},{key:"initPrivateOverlay",value:function(){(0,P.$_)()&&!this.isPmChatContents&&(this.privateOverlay=document.createElement("div"),(0,h.vP)(this.privateOverlay,"privateOverlay"),(0,S.Zs)(this.privateOverlay,{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:2,display:"none",justifyContent:"center",alignItems:"center",textAlign:"center",padding:"15px",boxSizing:"border-box"}),this.privateOverlay.innerText="".concat(Z.ag.privateShowChatActive," ").concat(Z.ag.clickToChatBroadcaster),this.privateOverlay.onclick=function(){J.qF.fire("private")},this.element.appendChild(this.privateOverlay))}},{key:"showPrivateOverlay",value:function(){(0,P.$_)()&&!this.isPmChatContents&&void 0!==this.privateOverlay&&(this.isWatchingPrivate=!0,this.privateOverlay.style.display="flex")}},{key:"hidePrivateOverlay",value:function(){(0,P.$_)()&&!this.isPmChatContents&&void 0!==this.privateOverlay&&(this.isWatchingPrivate=!1,this.privateOverlay.style.display="none")}},{key:"processMessage",value:function(e){var t=(0,O.DO)(e);switch(t.messageType){case 2:this.outgoingHandlers.onToggleDebugMode();break;case 1:this.customInputField.clearText();var n=t;this.outgoingHandlers.onTipRequest(n.messageData);break;default:this.outgoingHandlers.onChatMessage(e)}}},{key:"repositionChildren",value:function(){this.inputFieldHasFocus&&!(0,Y.gr)()&&this.customInputField.blur(),this.inputDiv.style.width="".concat((0,G._U)(),"px"),this.emoticonAutocompleteModal.element.style.bottom="".concat(this.inputDiv.offsetHeight-8,"px"),this.isScrolledUp()||this.scrollToBottom()}},{key:"isScrolledUp",value:function(){return this.messageListWrapper.scrollTop<=this.messageListWrapper.scrollHeight-(this.messageListWrapper.offsetHeight+20)}},{key:"scrollToBottom",value:function(){this.isScrolledUp()&&this.scrolledToBottom.fire(),this.messageListWrapper.scrollTop=this.messageListWrapper.scrollHeight-this.messageListWrapper.offsetHeight-1}},{key:"cloneClickListeners",value:function(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=this.isScrolledUp();o||e.querySelectorAll("img").forEach((function(e){var n=e.src;e.src="",e.onload=t.toBottom,e.src=n})),e.style.fontSize="",e.style.lineHeight="",n?this.messageList.prepend(e):(0,M.ZA)(e,this.messageList);for(var r=this.messageList.childElementCount-1e3;r>0;r-=1){var s=this.messageList.firstElementChild;null!==s&&this.messageList.removeChild(s)}return o||this.scrollToBottom(),this.addMessageHTMLEvent.fire({makeByCloning:function(){var n=e.cloneNode(!0);return t.cloneClickListeners(e,n),n}}),i&&(this.pmMessageCounter+=1),this.messageCounter+=1,e}},{key:"removeMessageDiv",value:function(e){this.messageList.removeChild(e)}},{key:"getLastMessageId",value:function(){return this.messageCounter}},{key:"getPmMessageCount",value:function(){return this.pmMessageCounter}},{key:"getEarliestMessageId",value:function(){return this.earliestMessageId}},{key:"getActionBar",value:function(){return this.actionBar}},{key:"setEarliestMessageId",value:function(e){this.earliestMessageId=e}},{key:"messagesSinceId",value:function(e){return this.messageCounter-e}},{key:"handleRemoveMessages",value:function(e){var t,n=[],i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return $(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,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(this.messageList.childNodes);try{for(i.s();!(t=i.n()).done;){var o=t.value;o.getAttribute("data-nick")===e&&n.push(o)}}catch(e){i.e(e)}finally{i.f()}for(var r=0,s=n;r1&&void 0!==arguments[1]&&arguments[1];return(0,r.Z)(this,n),(i=t.call(this,e,o)).outgoingHandlers=e,i.isPmChatContents=o,i.initShortcodeModal(),i}return(0,s.Z)(n,[{key:"initShortcodeModal",value:function(){this.shortcodeAutocompleteModal=new B.B(this.customInputField,this.isPmChatContents),this.inputDiv.appendChild(this.shortcodeAutocompleteModal.element),this.shortcodeAutocompleteModal.afterDOMConstructedIncludingChildren(),this.autocompleteModalCollection.push(this.shortcodeAutocompleteModal)}},{key:"repositionChildren",value:function(){(0,i.Z)((0,u.Z)(n.prototype),"repositionChildren",this).call(this),this.shortcodeAutocompleteModal.element.style.bottom="".concat(this.inputDiv.offsetHeight-8,"px")}},{key:"processMessage",value:function(e){var t=(0,O.DO)(e);switch(t.messageType){case 3:var o=t;if(this.isPmChatContents){this.appendMessageDiv((0,V.KS)(Z.ag.shortcodeNotSupportedInPMs));break}if(0===o.shortcodes.length){var r=O.uF.errorBehindShortcode(e);this.appendMessageDiv((0,V.KS)(r,"shortcodeInvalidError"));break}void 0!==this.outgoingHandlers.onShortcode&&this.outgoingHandlers.onShortcode(o);break;default:return(0,i.Z)((0,u.Z)(n.prototype),"processMessage",this).call(this,e)}}},{key:"dispose",value:function(){(0,i.Z)((0,u.Z)(n.prototype),"dispose",this).call(this),this.shortcodeAutocompleteModal.dispose()}}]),n}(re)},8071:function(e,t,n){"use strict";n.d(t,{e:function(){return k}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(8759),c=n(2800),u=n(1522),d=n(9),h=n(1794),f=n(9598),p=n(9271),m=n(3543),v=n(47),g=n(3243),y=n(1185),b=n(1612),w=n(6132),C=n(7693);var x=function(e){(0,r.Z)(c,e);var t,n,l=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function c(){return(0,i.Z)(this,c),l.apply(this,arguments)}return(0,o.Z)(c,[{key:"lazyInitUI",value:function(){var e=this;(0,y.vP)(this.element,"notificationsModal"),this.element.style.width="",this.element.style.height="",this.overlay.style.opacity="0.5",this.overlay.style.background="#000000";var t=function(){var e=document.createElement("div");return e.style.position="relative",e.style.height="",e.style.width="264px",e.style.backgroundColor="#e0e0e0",e.style.padding="6px 12px",e.style.borderRadius="3px",e.style.marginLeft="0px",e.style.marginTop="11px",e.style.fontSize="12.012px",e.style.color=b.w.defaultColor,e.style.overflow="",e.style.lineHeight="16.8px",e}(),n=(0,w.sP)(),i=(0,w.x5)(),o=(0,w.pw)((function(){e.onConfirmClick(),e.close()})),r=(0,w.fb)((function(){e.onDenyClick(),e.close()}));t.appendChild(n),t.appendChild(i),t.appendChild(o),t.appendChild(r),this.element.appendChild(t);var s=function(){e.resize()};(0,C.j9)("resize",window,s),this.closed.once((function(){try{(0,C.SC)("resize",window,s)}catch(e){debug("NotificationsModal resize listener was already removed")}})),(0,g.Z)((0,a.Z)(c.prototype),"lazyInitUI",this).call(this)}},{key:"afterDOMConstructedIncludingChildren",value:function(){(0,g.Z)((0,a.Z)(c.prototype),"afterDOMConstructedIncludingChildren",this).call(this),this.resize()}},{key:"resize",value:function(){this.element.style.left="".concat(Math.max(0,(window.innerWidth-this.element.offsetWidth)/2),"px"),this.element.style.top="".concat(Math.max(0,(window.innerHeight-this.element.offsetHeight)/2),"px")}}]),c}(w.s6);var k=function(e){(0,r.Z)(g,e);var t,n,d=(t=g,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function g(){return(0,i.Z)(this,g),d.call(this)}return(0,o.Z)(g,[{key:"initData",value:function(){var e=this;this.followStateChanged=new h.xB("followStateChanged"),this.isFollowingUpdate=new p.I(!1,this.setIsFollowing.bind(this),(function(){var t=e.isFollowing?m.ag.errorUnfollowingUser(e.roomName):m.ag.errorFollowingUser(e.roomName);(0,u.Cj)(t)}))}},{key:"initUI",value:function(){var e=this;this.followButton=(0,v.vz)(S,{onClick:function(){e.handleFollowAndUnfollow()}}),this.unfollowButton=(0,v.vz)(T,{onClick:function(){e.onUnfollowClick()}}),this.element=(0,v.vz)("div",{colorClass:"FollowButton",style:{cssFloat:"left"}},this.followButton,this.unfollowButton),f.wk.listen((function(t){t.roomName===e.roomName&&e.updateContext(e.roomName,t.following)}))}},{key:"onUnfollowClick",value:function(){var e=this;(0,u.oB)(m.ag.unfollowInfo,(function(){e.handleFollowAndUnfollow()}),void 0,{title:"".concat(m.ag.unfollowText," ").concat(this.roomName,"?"),acceptText:"".concat(m.ag.yes,", ").concat(m.ag.unfollowLower),declineText:"".concat(m.ag.no,", ").concat(m.ag.cancelLower)})}},{key:"updateFollowButtonDisplay",value:function(e){this.followButton.style.display=this.isFollowing?"none":"flex",this.unfollowButton.style.display=this.isFollowing?"flex":"none",this.followStateChanged.fire({isFollowing:this.isFollowing,isPending:e})}},{key:"updateContext",value:function(e,t){this.roomName=e,this.isFollowing=t,this.updateFollowButtonDisplay()}},{key:"showBrowserNotification",value:function(){var e=this;if(void 0!==c.J.current.loggedInUser){var t=window.isBrowserNotificationSupported,n=window.isSubscribedToBrowserNotifications;if(void 0!==t&&!0===t()&&void 0!==n&&(0,l.IU)()){var i=new x;i.canRequestPermission()&&n(!1,(function(){e.addChild(i,document.body),i.closed.once((function(){e.removeChild(i)}))}))}}}},{key:"handleFollowAndUnfollow",value:function(){var e=void 0===c.J.current.loggedInUser;this.isFollowing||this.showBrowserNotification();var t=(this.isFollowing?f.c5:f.kr)(this.roomName,f.wk,e,"FollowButton");void 0!==t&&this.isFollowingUpdate.dispatch(!this.isFollowing,t)}},{key:"setIsFollowing",value:function(e,t){this.isFollowing=e,this.updateFollowButtonDisplay(t)}}]),g}(d.w),S=function(e){return(0,v.vz)("div",{colorClass:"follow",style:{display:"none",borderWidth:"1px",borderStyle:"solid",boxSizing:"border-box",borderRadius:"4px",marginRight:"4px",padding:"0 8px",justifyContent:"center",alignItems:"center"},onClick:e.onClick},(0,v.vz)("span",{className:"icon_not_following no_hover",style:{position:"relative",padding:"2px 3px 1px 0px",marginLeft:"-6px",height:"29px",width:"29px",backgroundSize:"28px 28px",display:"inline-block",verticalAlign:"middle"}}),(0,v.vz)("span",{style:{display:"inline-block",verticalAlign:"middle"}},m.ag.followText))},T=function(e){return(0,v.vz)("div",{colorClass:"unfollow",style:{display:"none",borderWidth:"1px",borderStyle:"solid",boxSizing:"border-box",borderRadius:"4px",marginRight:"4px",justifyContent:"center",alignItems:"center"},onClick:e.onClick},(0,v.vz)("span",{className:"icon_following no_hover",style:{position:"relative",padding:"2px 4px 1px 4px",height:"29px",width:"29px",backgroundSize:"28px 28px"}}))}},5253:function(e,t,n){"use strict";n.d(t,{N:function(){return d},P:function(){return u}});var i=n(4649),o=n(2951),r=n(1976);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return a(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)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw r}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=0&&(this.listeners.splice(t,1),this.constraintsMap.delete(e.ID),e.detach(),this.notifyListeners())}},{key:"updateConstraints",value:function(e){this.constraintsMap.set(e.ID,e),this.notifyListeners()}},{key:"calculateTotalConstraints",value:function(){var e,t={top:0,bottom:0,left:0,right:0,transitionTime:0},n=s(this.constraintsMap.values());try{for(n.s();!(e=n.n()).done;)for(var i=e.value,o=0,r=Object.keys(t);o=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:"",n=(0,f.aP)();return t&&(n.dataset.testid=t),n.innerText=e,n.style.color="#000000",h.p.setMessageColorData(n,(0,f.Q0)("#aaaaaa")),n}function B(e,t){function n(e){var t=document.createElement("span");return t.innerText=e,t}var i=(0,f.aP)(),o=t?b.ag.pmSupporterNoticeAgeVerified:b.ag.pmSupporterNotice;i.appendChild(n(o)),i.appendChild(document.createElement("br")),i.appendChild(n("".concat(b.ag.pmSupporterSignUp," ")));var r=A(b.ag.pmSupporterMembership,(function(){}));return r.href=(0,u.BN)("/supporter/upgrade/?source=".concat(l.J.current.PurchaseEventSources.SUPPORTER_SOURCE_PM_UPSELL)),r.target="_blank",r.onclick=function(){(0,p.fg)("SupporterPageOpened",{source:"chat"})},i.appendChild(r),i.appendChild(n(" ".concat(b.ag.pmSupporterSendPm(e),"."))),i}function O(e,t){var n=(0,f.aP)(e);return n.innerText=e,n.appendChild(t),n.style.color="#000000",h.p.setMessageColorData(n,(0,f.Q0)("#aaaaaa")),n}function L(e){var t=(0,f.aP)();return e.renderTo(t)}d.kN.listen((function(e){i=e.dossier.roomGender,o=e.chatConnection}))},3112:function(e,t,n){"use strict";n.d(t,{Ap:function(){return a},H4:function(){return r},ct:function(){return s},h4:function(){return o},pF:function(){return l},uh:function(){return d},vz:function(){return c},zy:function(){return u}});var i=n(1794),o=new i.xB("MobileVideoControls:tap"),r=new i.xB("MobilePureChat:tap"),s=new i.xB("MobilePureChat:drag"),a=new i.xB("MobilePureChat:dragEnd"),l=new i.xB("MobileFullscreenSendChat"),c=new i.xB("MobilePlayer:Resize"),u=new i.xB("MobilePlayer:changeSize"),d=new i.xB("mobilePMChatLinkFullscreenToggle")},7122:function(e,t,n){"use strict";n.d(t,{i:function(){return E}});var i=n(4649),o=n(2951),r=n(1976),s=n(3243),a=n(7591),l=n(9492),c=n(7597),u=n(6474),d=n(6832),h=n(2800),f=n(1612),p=n(7693),m=n(695),v=n(4793),g=n(9493),y=n(9),b=n(8263),w=n(3705),C=n(6479),x=n(9482),k=n(3543),S=n(47),T=n(9420),I=n(2923);function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function R(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==arguments[1])||arguments[1];void 0!==this.emptyListMessage&&this.element.contains(this.emptyListMessage)&&this.element.removeChild(this.emptyListMessage);var i=this.findItem(e.otherUser.username);void 0!==i?(i.updateItem(e),d.wV.isHiding(e.otherUser.username)&&this.addChild(i)):(i=new B({conversationListItem:e,onClick:function(){t.openConversationEvent.fire(e.otherUser.username)},onCloseButtonClick:function(){t.removeItem(e.otherUser.username)},isDropdown:this.isDropdown}),this.addChild(i),(0,w.fg)("PmListItemAdded",{rendered_pm_count:this.getAllItems().length,other_user:e.otherUser.username})),d.wV.remove(e.otherUser.username),n&&this.moveToTop(i)}},{key:"updateUserColors",value:function(){var e,t=this;this.isDropdown&&(null===(e=this.conversationListData)||void 0===e||e.getDms().forEach((function(e){var n=t.findItem(e.otherUser.username);void 0!==n&&n.updateColors(e.otherUser)})))}},{key:"moveToTop",value:function(e){this.isDropdown?null!==this.element.firstChild?this.element.insertBefore(e.element,this.element.firstChild):this.element.appendChild(e.element):null!==this.element.firstChild&&null!==this.element.firstChild.nextSibling?this.element.insertBefore(e.element,this.element.firstChild.nextSibling):this.element.appendChild(e.element)}},{key:"findItem",value:function(e){return this.getAllItems().find((function(t){return t.getItemInfo().otherUser.username===e}))}},{key:"markItemRead",value:function(e){var t=this.findItem(e);void 0!==t&&t.setReadStyle()}},{key:"addBroadcasterToTop",value:function(){var e,t,n=this,i=null!==(e=null===(t=this.conversationListData)||void 0===t?void 0:t.getConversation(this.room))&&void 0!==e?e:(0,u.rw)(this.room),o=this.findItem(this.room);void 0===o&&(o=new B({conversationListItem:i,onClick:function(){n.openConversationEvent.fire(n.room)},onCloseButtonClick:function(){n.removeItem(i.otherUser.username)},isDropdown:this.isDropdown})),this.getAllItems().length>0?this.addChildBefore(o,this.getAllItems()[0]):this.addChild(o)}},{key:"getAllItems",value:function(){return(0,s.Z)((0,c.Z)(n.prototype),"children",this).call(this)}},{key:"getNumUnread",value:function(){return this.getAllItems().filter((function(e){return e.getItemInfo().numUnread>0})).length}},{key:"removeItem",value:function(e){var t=this.findItem(e);void 0!==t&&this.element.contains(t.element)&&(this.removeChild(t),d.wV.hide(e),this.onItemRemoved(t.getItemInfo().otherUser.username),(0,w.fg)("PmListItemRemoved",{rendered_pm_count:this.getAllItems().length,other_user:e}))}},{key:"clearItems",value:function(){this.removeAllChildren()}},{key:"startTimeContainerUpdates",value:function(){var e=this;this.startedTimeUpdates||(this.startedTimeUpdates=!0,window.setInterval((function(){var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return M(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)?M(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(e.getAllItems());try{for(n.s();!(t=n.n()).done;)t.value.setTimestamp()}catch(e){n.e(e)}finally{n.f()}}),1e4))}}]),n}(y.w),B=function(e){(0,a.Z)(n,e);var t=A(n);function n(e){return(0,o.Z)(this,n),t.call(this,"div",e)}return(0,r.Z)(n,[{key:"initData",value:function(e){this.conversationListItem=e.conversationListItem}},{key:"initUI",value:function(e){var t=this;this.replyIcon=(0,S.vz)(O,null),this.closeButton=(0,S.vz)("img",{src:"".concat(STATIC_URL_MOBILE,"close.svg"),style:{width:"18px",height:"18px",display:"inline-block"},onClick:e.onCloseButtonClick}),this.avatarBubble=(0,S.vz)(L,{name:e.conversationListItem.otherUser.username,userColorClass:(0,x.c9)(e.conversationListItem.otherUser)}),this.element=(0,S.vz)("div",{style:{width:"100%",height:"90px",boxSizing:"border-box",borderBottom:"1px solid #EFEFEF",padding:"20px",fontSize:"12px",display:"flex",alignItems:"center",fontFamily:"Tahoma, Arial, Helvetica, sans-serif"},ref:function(e){return t.containerElement=e}},(0,S.vz)("div",{style:{display:"flex",flex:1,alignItems:"center"},onClick:e.onClick},this.avatarBubble,(0,S.vz)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%",height:"100%"}},(0,S.vz)("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},(0,S.vz)("span",{style:{display:"block",fontWeight:"bold",marginBottom:"5px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,width:0,marginRight:"10px"},colorClass:(0,x.c9)(e.conversationListItem.otherUser),ref:function(e){t.usernameLabel=e}},e.conversationListItem.otherUser.username),(0,S.vz)("span",{style:{color:"#6C6C78"},ref:function(e){t.timestampElement=e}})),(0,S.vz)("span",{style:{display:"flex"}},this.replyIcon,(0,S.vz)("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:"1",width:"0px"},ref:function(e){t.msgElement=e}})))),!e.isDropdown&&(0,S.vz)("div",{style:{width:"18px",height:"18px",marginLeft:"20px"}},!e.conversationListItem.otherUser.isBroadcaster&&this.closeButton)),this.updateItem(e.conversationListItem)}},{key:"updateItem",value:function(e){this.conversationListItem=e,this.setReplyIcon(),this.setMessage(),this.setTimestamp(),this.conversationListItem.numUnread>0?this.setUnreadStyle():this.setReadStyle()}},{key:"updateColors",value:function(e){var t=(0,x.c9)(e);this.usernameLabel.className=t,this.avatarBubble.firstChild instanceof HTMLElement&&(this.avatarBubble.firstChild.className=t)}},{key:"getItemInfo",value:function(){return this.conversationListItem}},{key:"setReplyIcon",value:function(){var e=this.isReply()&&!this.isEmptyMessage();this.replyIcon.style.display=e?"block":"none"}},{key:"setMessage",value:function(){null!==this.msgElement.firstChild&&this.msgElement.removeChild(this.msgElement.firstChild),""!==this.conversationListItem.message?this.msgElement.appendChild(this.renderConversationEmoticons(this.conversationListItem.message)):this.conversationListItem.hasMedia&&this.msgElement.appendChild((0,S.vz)("span",null,k.ag.imageAttached))}},{key:"setTimestamp",value:function(){if(!this.isEmptyMessage()){var e=this.conversationListItem.time,t=void 0===e?"":(0,g.ek)(new Date(e));this.timestampElement.innerText="".concat(t)}}},{key:"renderConversationEmoticons",value:function(e){var t=new C.w(e),n=(0,S.vz)("span",null),i=t.stringParts()[0];n.innerText=i.split("\n")[0];for(var o=1;o=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n2)){var i=e.touches[0].clientX,r=e.touches[0].clientY;(0,w.gr)()?t.setPortraitHeight(t.portraitHeight+(o-r)):t.setLandscapeWidth(t.landscapeWidth+(n-i)),n=i,o=r,s.callFunc(),t.showResizeIndicator(),g.ct.fire(void 0)}},t.resizeDragDiv.ontouchend=function(e){e.touches.length>0||(r||t.hideResizeIndicator(160),g.Ap.fire(void 0))},t.resizeDragDiv.onclick=function(){t.toggleResizeIndicatorVisibility(),g.H4.fire(t.isIndicatorVisible)},g.h4.listen((function(){t.isIndicatorVisible&&t.toggleResizeIndicatorVisibility()})),g.pF.listen((function(){t.isChatHidden()&&t.unhideChat(),t.scrollToBottom()})),t.layoutConstraints.setOnUpdate((function(){t.repositionChildren()})),w.bs.listen((function(){t.backgroundDelay=0,t.heightDuration=0,t.widthDuration=0,t.updateTransitions()})),t.element.style.display="none",t.repositionChildren(),t}return(0,o.Z)(x,[{key:"showBackground",value:function(){this.backgroundDelay=0,this.updateTransitions(),this.element.style.background="rgba(255, 255, 255, 0.25)"}},{key:"hideBackground",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.backgroundDelay=e,this.updateTransitions(),this.element.style.background="transparent"}},{key:"addMessage",value:function(e){var t=this;f.p.setMessageColor(e);var n=e.querySelector("a");null!==n&&"pmChatLink"===n.className&&(0,c.j9)("click",n,(function(){g.uh.fire(void 0)})),e.style.fontSize="",e.style.lineHeight="",e.style.display="inline-block",e.style.verticalAlign="bottom",e.style.overflowWrap="break-word";var i=!this.isScrolledUp();(0,p.ZA)(e,this.innerDiv),this.addTimeout((function(){t.hideMessage(e)}),15e3),i&&this.scrollToBottom()}},{key:"isScrolledUp",value:function(){return this.innerDiv.scrollTop<=this.innerDiv.scrollHeight-(this.innerDiv.offsetHeight+20)}},{key:"scrollToBottom",value:function(){this.innerDiv.scrollTop=this.innerDiv.scrollHeight-this.innerDiv.offsetHeight-1}},{key:"showMessages",value:function(){var e,t=this,n=C(this.pendingTimeouts);try{for(n.s();!(e=n.n()).done;){var i=e.value;clearTimeout(i)}}catch(e){n.e(e)}finally{n.f()}var o,r=C(this.innerDiv.children);try{var s=function(){var e=o.value;(0,m.pS)(e,"opacity ".concat(400,"ms")),e.style.opacity="1",t.addTimeout((function(){t.hideMessage(e)}),15e3)};for(r.s();!(o=r.n()).done;)s()}catch(e){r.e(e)}finally{r.f()}}},{key:"hideMessage",value:function(e){var t=this;this.isScrolledUp()?this.addTimeout((function(){t.hideMessage(e)}),15e3):((0,m.pS)(e,"opacity ".concat(1e3,"ms")),e.style.opacity="0")}},{key:"setVisible",value:function(e){var t=this;if(this.isVisible!==e){this.isVisible=e,this.heightDuration=0,this.widthDuration=0,this.updateTransitions(),window.setTimeout((function(){t.scrollToBottom()}),Math.max(this.heightDuration,this.widthDuration)+100);var n={top:0,bottom:0,left:0,right:0,transitionTime:0};this.isVisible&&(this.showResizeIndicator(),this.showBackground(),this.showMessages(),n.bottom=this.calculateTotalChatHeight(),n.right=this.calculateTotalChatWidth()),this.layoutConstraints.setConstraints(n),S.fire(e)}}},{key:"calculateTotalChatHeight",value:function(){return Math.round(this.portraitHeight+56+30+4)}},{key:"calculateTotalChatWidth",value:function(){return Math.round(this.landscapeWidth+20)}},{key:"deviceLength",value:function(){return(0,w.gr)()?(0,b.mP)():(0,b._U)()}},{key:"setPortraitHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.desiredPortraitHeight=e;var n=!this.isScrolledUp(),i=this.portraitHeight,o=this.deviceLength()-56-30-4-Math.max(30,this.layoutConstraints.top());e=Math.min(e,o),e=Math.max(e,0),e=Math.round(e),this.portraitHeight=e,(0,h.rm)()?this.element.style.height="min(calc(var(--vh, 1vh) * 100 - ".concat(136,"px), ").concat(this.portraitHeight,"px)"):this.element.style.height="".concat(this.portraitHeight,"px"),0===e?this.hideCloseChatDiv():this.showCloseChatDiv(),e!==i&&(n||0===i?this.scrollToBottom():this.innerDiv.scrollTop+=i-e,this.layoutConstraints.setConstraints({top:0,bottom:this.isVisible?this.calculateTotalChatHeight():0,left:0,right:this.isVisible?this.calculateTotalChatWidth():0,transitionTime:t}))}},{key:"setLandscapeWidth",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.desiredLandscapeWidth=e;var n=!this.isScrolledUp(),i=this.landscapeWidth,o=this.deviceLength()-30-20-Math.max(50,this.layoutConstraints.left());e=Math.min(e,o),e=Math.max(e,0),e=Math.round(e),this.landscapeWidth=e,this.element.style.width="".concat(this.landscapeWidth,"px"),0===e?this.hideCloseChatDiv():window.innerHeight<150?(this.hideCloseChatDiv(),window.innerHeight<75&&this.hideResizeIndicator()):this.showCloseChatDiv(),e!==i&&((n||0===i)&&this.scrollToBottom(),this.layoutConstraints.setConstraints({top:0,bottom:this.isVisible?this.calculateTotalChatHeight():0,left:0,right:this.isVisible?this.calculateTotalChatWidth():0,transitionTime:t}))}},{key:"hideCloseChatDiv",value:function(){this.closeChatContainer.style.display="none",(0,w.gr)()?(this.resizeIndicatorDiv.style.height="".concat(k,"px"),this.resizeIndicatorDiv.style.width="".concat((0,b._U)()-2,"px")):(this.resizeIndicatorDiv.style.height="100%",this.resizeIndicatorDiv.style.width="".concat(k,"px"))}},{key:"showCloseChatDiv",value:function(){if((0,w.gr)())this.resizeIndicatorDiv.style.height="".concat(k,"px"),this.resizeIndicatorDiv.style.width="".concat((0,b._U)()-k-4,"px");else{var e=this.resizeDragDiv.getBoundingClientRect();this.resizeIndicatorDiv.style.height="".concat(e.height-k-2,"px"),this.resizeIndicatorDiv.style.width="".concat(k,"px")}this.closeChatContainer.style.display="inline-block"}},{key:"createResizeDragDiv",value:function(){var e=this;if(this.resizeDragDiv=document.createElement("div"),this.controlsContainerDiv=document.createElement("div"),this.resizeIndicatorDiv=document.createElement("div"),this.resizeIndicatorImg=document.createElement("img"),this.closeChatContainer=document.createElement("div"),this.closeChatDiv=document.createElement("div"),this.closeChatImg=document.createElement("img"),this.resizeDragDiv.appendChild(this.controlsContainerDiv),this.controlsContainerDiv.appendChild(this.resizeIndicatorDiv),this.controlsContainerDiv.appendChild(this.closeChatContainer),this.closeChatContainer.appendChild(this.closeChatDiv),this.resizeIndicatorDiv.appendChild(this.resizeIndicatorImg),this.closeChatDiv.appendChild(this.closeChatImg),this.resizeDragDiv.style.position="absolute",this.resizeDragDiv.style.bottom="0",this.controlsContainerDiv.style.verticalAlign="middle",this.controlsContainerDiv.style.width="100%",this.controlsContainerDiv.style.position="absolute",this.resizeIndicatorDiv.style.display="inline-block",this.resizeIndicatorDiv.style.position="absolute",this.resizeIndicatorDiv.style.left="0",this.resizeIndicatorDiv.style.padding="".concat(4,"px"),this.resizeIndicatorDiv.style.borderRadius="4px",this.resizeIndicatorDiv.style.opacity="1",this.resizeIndicatorDiv.style.boxSizing="border-box",this.resizeIndicatorDiv.style.background="rgba(0, 0, 0, 0.3)",this.resizeIndicatorDiv.classList.add("resizeIndicatorDiv"),this.closeChatContainer.style.padding="".concat(30,"px"),this.closeChatContainer.style.display="inline-block",this.closeChatContainer.style.position="absolute",this.closeChatContainer.style.margin="0",this.closeChatContainer.style.boxSizing="border-box",this.closeChatContainer.style.fontSize="9pt",this.closeChatContainer.style.lineHeight="14px",this.closeChatContainer.style.top="".concat(-19.5,"px"),this.closeChatContainer.style.right="".concat(-18.5,"px"),this.closeChatDiv.style.display="inline-block",this.closeChatDiv.style.position="absolute",this.closeChatDiv.style.margin="0",this.closeChatDiv.style.height="".concat(k,"px"),this.closeChatDiv.style.width="".concat(k,"px"),this.closeChatDiv.style.padding="".concat(4,"px"),this.closeChatDiv.style.borderRadius="4px",this.closeChatDiv.style.boxSizing="border-box",this.closeChatDiv.style.textAlign="center",this.closeChatDiv.style.top="".concat(19.5,"px"),this.closeChatDiv.style.left="".concat(19.5,"px"),this.closeChatDiv.style.background="rgba(0, 0, 0, 0.3)",this.resizeIndicatorImg.src="".concat(STATIC_URL_MOBILE,"3-bar.svg"),this.resizeIndicatorImg.style.position="absolute",this.resizeIndicatorImg.style.height="".concat(13,"px"),this.resizeIndicatorImg.style.width="".concat(7,"px"),this.closeChatImg.src="".concat(STATIC_URL_MOBILE,"close-button.svg"),this.closeChatImg.style.height="9px",this.closeChatImg.style.width="9px",this.closeChatImg.style.padding="0",this.closeChatImg.style.margin="0",this.closeChatImg.classList.add("closeChatFullscreen"),(0,w.gr)())this.resizeIndicatorDiv.style.width="".concat((0,b._U)()-k-4,"px"),this.resizeIndicatorDiv.style.height="".concat(k,"px"),this.stylePortrait();else{this.resizeIndicatorDiv.style.width="".concat(k,"px");var t=this.resizeDragDiv.getBoundingClientRect();this.resizeIndicatorDiv.style.height="".concat(t.height-k,"px"),this.styleLandscape()}this.closeChatContainer.onclick=function(t){if(e.isIndicatorVisible){if(t.stopPropagation(),(0,w.gr)()){var n=Math.max(180,1.15*e.portraitHeight);n=Math.min(380,n),e.heightDuration=n,e.updateTransitions(),e.setPortraitHeight(0,n)}else{var i=Math.max(200,1.5*e.landscapeWidth);i=Math.min(450,i),e.widthDuration=i,e.updateTransitions(),e.setLandscapeWidth(0,i)}e.showResizeIndicator(),g.ct.fire(void 0)}},this.resizeIndicatorDiv.onclick=function(t){e.isIndicatorVisible&&e.isChatHidden()&&(t.stopPropagation(),e.unhideChat())}}},{key:"unhideChat",value:function(){var e=180;(0,w.gr)()?(this.heightDuration=e,this.updateTransitions(),this.setPortraitHeight(150,e)):(this.widthDuration=e,this.updateTransitions(),this.setLandscapeWidth(150,e))}},{key:"isChatHidden",value:function(){return(0,w.gr)()&&this.portraitHeight<5||!(0,w.gr)()&&this.landscapeWidth<5}},{key:"stylePortrait",value:function(){this.element.style.width="100%",this.element.style.top="",this.element.style.bottom="".concat(56+this.layoutConstraints.bottom()+this.inputFocusOffset,"px"),this.element.style.right="",this.resizeDragDiv.style.height="".concat(50,"px"),this.resizeDragDiv.style.width="100%",this.resizeDragDiv.style.left="0",this.resizeDragDiv.style.top="".concat(-30,"px"),this.controlsContainerDiv.style.height="".concat(k,"px"),this.controlsContainerDiv.style.width="100%",this.controlsContainerDiv.style.top="4px",this.controlsContainerDiv.style.left="0",this.resizeIndicatorDiv.style.marginLeft="".concat(1,"px"),this.resizeIndicatorImg.style.left="".concat(((0,b._U)()-7-2)/2,"px"),this.resizeIndicatorImg.style.bottom="".concat(4,"px"),this.resizeIndicatorImg.style.transform="rotate(90deg)",this.closeChatDiv.style.right="0",this.closeChatDiv.style.marginRight="".concat(1,"px"),this.closeChatContainer.style.right="".concat(-18.5,"px")}},{key:"styleLandscape",value:function(){var e;this.element.style.height="",this.element.style.top="".concat(30,"px"),this.element.style.bottom="".concat(56+this.layoutConstraints.bottom(),"px"),this.element.style.right="10px",this.resizeDragDiv.style.width="".concat(50,"px"),this.resizeDragDiv.style.height="",this.resizeDragDiv.style.left="".concat(-30,"px"),this.resizeDragDiv.style.top="0",this.controlsContainerDiv.style.height="100%",this.controlsContainerDiv.style.width="".concat(k,"px"),this.controlsContainerDiv.style.top="0",this.controlsContainerDiv.style.left="4px",e=window.innerHeight>200?this.element.getBoundingClientRect().height:this.resizeIndicatorDiv.getBoundingClientRect().height,this.resizeIndicatorDiv.style.bottom="0",this.resizeIndicatorDiv.style.marginLeft="0",this.resizeIndicatorImg.style.left="".concat(7,"px"),this.resizeIndicatorImg.style.bottom="".concat((e-13)/2,"px"),this.resizeIndicatorImg.style.transform="rotate(0deg)",this.closeChatDiv.style.right="",this.closeChatDiv.style.marginRight="0",this.closeChatContainer.style.right="".concat(-19.5,"px")}},{key:"handleRemoveMessages",value:function(e){var t,n=[],i=C(this.innerDiv.childNodes);try{for(i.s();!(t=i.n()).done;){var o=t.value;o.getAttribute("data-nick")===e&&n.push(o)}}catch(e){i.e(e)}finally{i.f()}for(var r=0,s=n;r0&&void 0!==arguments[0]?arguments[0]:0;(0,m.pS)(this.resizeDragDiv,"opacity ".concat(175,"ms ").concat(e,"ms")),this.isIndicatorVisible=!1,this.resizeDragDiv.style.opacity="0",this.hideBackground(e),clearTimeout(this.opacityTimer)}},{key:"updateTransitions",value:function(){var e="background-color ".concat(175,"ms ").concat(this.backgroundDelay,"ms"),t="height ".concat(this.heightDuration,"ms"),n="width ".concat(this.widthDuration,"ms");(0,m.pS)(this.element,[e,t,n].join(","))}},{key:"repositionChildren",value:function(){this.element.style.display=this.isVisible?"block":"none",(0,w.gr)()?(this.setPortraitHeight(this.desiredPortraitHeight),this.stylePortrait()):(this.setLandscapeWidth(this.desiredLandscapeWidth),this.styleLandscape())}},{key:"afterDOMConstructed",value:function(){}}]),x}(f.p)},4364:function(e,t,n){"use strict";n.d(t,{Yq:function(){return ai},GD:function(){return ri},m7:function(){return oi}});var i=n(2951),o=n(1976),r=n(7169),s=n(3243),a=n(7591),l=n(9492),c=n(7597),u=n(8759),d=n(6272),h=n(6079),f=n(2800),p=n(8626),m=n(7693),v=n(1522),g=n(3753),y=n(391),b=n(8138),w=n(695),C=n(6464),x=n(1602),k=n(1234),S=n(4793),T=n(8069),I=n(9),P=n(1794),R=n(3705),M=n(6893),A=n(928),E=n(2239),B=n(8978),O=n(758),L=n(3543),D=n(1289),U=n(2750),Z=n(444),F=n(4649),_=n(47),N=n(9598);var j=function(e){(0,a.Z)(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function s(){return(0,i.Z)(this,s),r.call(this)}return(0,o.Z)(s,[{key:"initUI",value:function(){var e=this;this.followButton=(0,_.vz)(H,{onClick:function(){e.handleFollowAndUnfollow()}}),this.unfollowButton=(0,_.vz)(z,{onClick:function(){e.onUnfollowClick()}}),this.element=(0,_.vz)("div",{style:{display:"flex",alignItems:"center"}},this.followButton,this.unfollowButton),this.updateFollowButtonDisplay(),N.wk.listen((function(t){t.roomName===e.roomName&&e.updateContext(e.roomName,t.following)}))}}]),s}(n(8071).e),H=function(e){return(0,_.vz)("div",{style:{display:"none",backgroundColor:"#E0E0E0",color:"#ffffff",boxSizing:"border-box",borderRadius:"4px",padding:0,height:"32px",justifyContent:"center",alignItems:"center"},onClick:e.onClick},(0,_.vz)("span",{className:"icon_not_following no_hover",style:{position:"static",padding:"0 3px 0",height:"29px",width:"29px",backgroundSize:"28px 28px",display:"inline-block"}}),(0,_.vz)("span",{style:{display:"inline-block",fontSize:"14px",color:"#222222",paddingRight:"8px"}},L.ag.followText))},z=function(e){return(0,_.vz)("div",{style:{display:"none",backgroundColor:"#17202A",color:"#ffffff",boxSizing:"border-box",borderRadius:"4px",justifyContent:"center",alignItems:"center"},onClick:e.onClick},(0,_.vz)("span",{className:"icon_following_new no_hover",style:{position:"relative",height:"20px",width:"20px",backgroundSize:"20px 20px"}}))},W=n(3764);function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function q(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n(0,pe._U)()||this.usingAirPlay||this.usingChromecast?(this.element.style.width="100%",this.element.style.left="0"):(this.element.style.width="".concat(n,"px"),this.element.style.left="".concat(.5*(0,pe._U)()-.5*n,"px")),this.usingAirPlay||this.usingChromecast?(this.element.style.height="100px",this.playerComponent.element.style.height="100px",this.playerComponent.element.style.width="100%"):this.playerComponent.element.style.width="".concat(n,"px"),this.toggleMenuBar(!1)}},{key:"repositionChildren",value:function(){(0,me.gr)()&&this.isFullscreen?this.stylePortraitFullscreen():(0,me.gr)()&&!this.isFullscreen?(void 0!==this.desiredPortraitHeight&&this.setPortraitHeight(this.desiredPortraitHeight),this.stylePortraitNonFullscreen()):this.styleLandscape(),(0,me.gr)()&&!this.isFullscreen||(this.isVideoHidden&&this.centerPlayer(),this.element.style.left="0")}},{key:"applyPlayerHeight",value:function(e){this.element.style.height="".concat(e,"px"),de.vz.fire(e)}},{key:"centerPlayer",value:function(){var e=(this.isFullscreen||void 0===this.portraitHeight?void 0===this.fullscreenHeight?(0,pe.mP)():this.fullscreenHeight:this.portraitHeight)/(this.isWidescreen?ce.fo:ce.$V);this.element.scrollLeft=e/2-(0,pe._U)()/2}},{key:"getNoneFullscreenSize",value:function(){var e,t,n=(0,pe._U)(),i=(0,pe.mP)();if(this.sendMessageInputFieldHasFocus&&(0,pe.F7)()>0){var o=this.getDimensionsWithinBounds(n,i-(0,Z.hf)()),r=(0,ie.Z)(o,2);e=r[0],t=r[1]}else if((0,me.gr)())void 0!==this.portraitHeight?e=(t=Math.min(i-this.minPortraitLeft,this.portraitHeight))/(this.isWidescreen?ce.fo:ce.$V):t=(e=Math.min(n,(i-120)/(this.isWidescreen?ce.fo:ce.$V)))*(this.isWidescreen?ce.fo:ce.$V);else{var s=this.getDimensionsWithinBounds(n,i),a=(0,ie.Z)(s,2);e=a[0],t=a[1]}return[Math.round(e),Math.round(t)]}},{key:"getDimensionsWithinBounds",value:function(e,t){var n=t/(this.isWidescreen?ce.fo:ce.$V),i=t;return n>e&&(i=(n=e)*(this.isWidescreen?ce.fo:ce.$V)),[n,i]}},{key:"setupAirPlayControls",value:function(){var e=this;void 0!==window.WebKitPlaybackTargetAvailabilityEvent?(this.videoControls.showAirPlay(),(0,m.j9)("click",this.videoControls.airPlayImg,(function(){var t=e.playerComponent.getVideoElement();void 0===t?e.videoControls.forceHLS():t.webkitShowPlaybackTargetPicker()})),(0,m.j9)("webkitplaybacktargetavailabilitychanged",this.playerComponent.element,(function(t){if(e.videoControls.forceHLS(),void 0!==t.availability)switch(t.availability){case"available":e.videoControls.showAirPlay();break;case"not-available":e.videoControls.hideAirPlay()}}))):this.videoControls.hideAirPlay()}},{key:"setupChromecastControls",value:function(){var e=this;if(this.playerComponent instanceof ue.n){var t=this.playerComponent.getVideoJs();if(void 0!==t&&void 0!==t.chromecastSessionManager){var n=t.chromecastSessionManager.getCastContext();(0,m.j9)("click",this.videoControls.chromecastImg,(function(){void 0===e.playerComponent.getVideoElement()?e.videoControls.forceHLS():t.chromecastSessionManager.openCastMenu()})),n.addEventListener("caststatechanged",(function(t){if(void 0!==t.castState)switch(t.castState){case"NOT_CONNECTED":e.videoControls.showChromecast();break;case"NO_DEVICES_AVAILABLE":e.videoControls.hideChromecast()}})),"CONNECTED"===n.getCastState()||"CONNECTING"===n.getCastState()?(this.videoControls.showChromecast(),n.getCurrentSession().endSession(!0)):"NOT_CONNECTED"===n.getCastState()?this.videoControls.showChromecast():"NO_DEVICES_AVAILABLE"===n.getCastState()&&this.videoControls.hideChromecast()}else this.videoControls.hideChromecast()}}},{key:"setupChromecast",value:function(){var e=this,t=0,n=window.setInterval((function(){if(t>=10&&clearInterval(n),e.playerComponent instanceof ue.n){var i=e.playerComponent.getVideoJs();if(void 0!==i&&void 0!==i.chromecastSessionManager){e.setupChromecastControls();var o=e.playerComponent.getVideoElement();void 0!==o&&e.bindChromecastEventsToVideo(o),clearInterval(n)}}t+=1}),1e3)}},{key:"createVideoJsPlayer",value:function(){return new ye(this.roomStatusNotifier)}},{key:"afterPlayerCreated",value:function(){(0,s.Z)((0,c.Z)(h.prototype),"afterPlayerCreated",this).call(this);var e=this.playerComponent.getVideoElement();void 0!==e&&this.bindAirPlayEventsToVideo(e),this.videoControls.notifyPlayerIsJPEG(this.playerComponent instanceof le.z)}},{key:"setUsingAirPlay",value:function(e){this.usingAirPlay=e,this.videoControls.notifyUsingAirPlayChange(e)}},{key:"bindAirPlayEventsToVideo",value:function(e){var t=this;void 0!==window.WebKitPlaybackTargetAvailabilityEvent&&(0,m.j9)("webkitcurrentplaybacktargetiswirelesschanged",e,(function(){e.webkitCurrentPlaybackTargetIsWireless?((0,R.fg)("Video_CastStart",{CastType:"airplay"}),t.setUsingAirPlay(!0)):((0,R.fg)("Video_CastStop",{CastType:"airplay"}),t.setUsingAirPlay(!1)),ae.y.fire(t.usingAirPlay),t.videoControls.updateCastingStyling(t.usingAirPlay?"AirPlay":""),t.repositionChildrenRecursive(),t.centerPlayer()}))}},{key:"setUsingChromecast",value:function(e){this.usingChromecast=e,this.videoControls.notifyUsingChromecastChange(e)}},{key:"bindChromecastEventsToVideo",value:function(e){var t=this;if(this.playerComponent instanceof ue.n){var n=this.playerComponent.getVideoJs();void 0!==n&&void 0!==n.chromecastSessionManager&&n.chromecastSessionManager.getCastContext().addEventListener("sessionstatechanged",(function(e){if(void 0!==e.sessionState)switch(e.sessionState){case"SESSION_STARTED":case"SESSION_RESUMED":(0,R.fg)("Video_CastStart",{CastType:"chromecast"}),t.setUsingChromecast(!0);break;case"SESSION_ENDED":(0,R.fg)("Video_CastStop",{CastType:"chromecast"}),t.setUsingChromecast(!1)}t.videoControls.updateCastingStyling(t.usingChromecast?"Chromecast":""),t.repositionChildrenRecursive(),t.centerPlayer()}))}}},{key:"bindControlsEvents",value:function(){var e=this;this.videoControls.setPlayerVisibilityEvent.listen((function(t){e.setHidden(t)})),this.videoControls.centerPlayerEvent.listen((function(){e.centerPlayer()})),this.videoControls.requestFullscreenEvent.listen((function(){(0,re.Zx)(e.element)})),this.videoControls.setPlayerComponentVolumeMutedEvents.listen((function(t){e.playerComponent.setVolumeMuted(t.volume,t.isMuted)})),this.videoControls.forceHlsPlayerEvent.listen((function(t){var n=t.roomContext,i=t.unmute;e.forceHlsPlayer(n,null==i||i)})),this.videoControls.touchControls.scalePlayerEvent.listen((function(t){var n=t.factor,i=t.pointX;e.canUpdateMobilePlayer()&&(0,me.gr)()&&e.isFullscreen&&e.scalePlayer(n,i)})),this.videoControls.touchControls.changeVideoHeightEvent.listen((function(t){if(e.canUpdateMobilePlayer()&&(0,me.gr)())if(e.isFullscreen){var n=1+t.distance.y/(0,pe.mP)()*be.J,i=(0,pe._U)()/2;e.scalePlayer(n,i)}else e.setDesiredPortraitHeight(t.distance.y)})),this.videoControls.touchControls.scrollPlayerEvent.listen((function(t){e.canUpdateMobilePlayer()&&!e.isVideoHidden&&(void 0!==e.element.scrollBy?e.element.scrollBy(t,0):e.element.scrollLeft+=t)})),this.videoControls.touchControls.swipePlayerEvent.listen((function(t){var n=t.totalDistance>0;switch(t.state){case 4:debug("Swipe Reset");break;case 2:debug("Handle Completed Swipe",{direction:n?"Left":"Right",totalDistance:t.totalDistance});break;default:n?e.handleLeftSwipe(t):e.handleRightSwipe(t)}})),this.videoControls.playerComponentReadjustForceHlsOverlayOrderEvent.listen((function(t){e.playerComponent.element.insertBefore(t,e.playerComponent.element.firstChild),e.playerComponent.element.insertBefore(t,e.playerComponent.element.firstChild)})),this.videoControls.showJpegPlayerComponentImage.listen((function(){e.playerComponent instanceof le.z&&e.playerComponent.showPlayerImage()})),this.videoControls.toggleFullscreen.listen((function(t){e.isFullscreen=t,e.toggleFullscreen.fire(t)})),this.videoControls.requestHlsPlayerPlayIfPaused.listen((function(){e.playerComponent instanceof M._O&&e.playerComponent.videoElement.paused&&e.playerComponent.play()}))}},{key:"bindVideoEvents",value:function(){var e,t,n=this;(0,s.Z)((0,c.Z)(h.prototype),"bindVideoEvents",this).call(this),this.playerComponent.requestControlVisibility.listen((function(e){e?n.videoControls.show():n.videoControls.hide()})),null===(e=this.playerComponent.setControlVolume)||void 0===e||e.listen((function(e){var t=e.volume;e.save?n.videoControls.updateAndSaveVolume(t):n.videoControls.updateVolume(t)})),null===(t=this.playerComponent.setControlIsMuted)||void 0===t||t.listen((function(e){var t=e.isMuted;e.save?n.videoControls.updateAndSaveIsMuted(t):n.videoControls.updateIsMuted(t)}))}},{key:"toggleMenuBar",value:function(e){this.headerMenu.style.display=e?"none":""}},{key:"setIsWidescreen",value:function(e){this.isWidescreen=e}},{key:"setPortraitHeight",value:function(e){var t=this.portraitHeight,n=Math.min((0,pe.mP)()-this.getOtherComponentsCombinedHeights(),Math.max(100,e));n=Math.round(n),this.portraitHeight=n,(t=void 0!==t?t:this.portraitHeight)!==n&&(this.repositionChildrenRecursive(),this.element.scrollLeft+=n-t)}},{key:"getOtherComponentsCombinedHeights",value:function(){var e,t,n,i,o=null!==(e=null===(t=document.getElementById("static-header"))||void 0===t?void 0:t.offsetHeight)&&void 0!==e?e:40,r=null!==(n=null===(i=document.getElementById("tab-room-header"))||void 0===i?void 0:i.offsetHeight)&&void 0!==n?n:42,s=this.mobileDismissibleMessages.element.offsetHeight;return o+r+(0,Z.hf)()+s}},{key:"setDesiredPortraitHeight",value:function(e){var t=this.element.offsetHeight+e;this.desiredPortraitHeight!==t&&(this.desiredPortraitHeight=t,this.repositionChildren())}},{key:"scalePlayer",value:function(e,t){var n=this.playerComponent.element.offsetWidth,i=e*n,o=(0,pe.mP)()/(this.isWidescreen?ce.fo:ce.$V),r=(0,pe._U)();i=Math.max(i,r),i=Math.min(i,o),i=Math.round(i);var s=this.element.scrollLeft,a=Math.round(i*(this.isWidescreen?ce.fo:ce.$V));this.element.style.width="".concat(i,"px"),this.fullscreenHeight=a,this.applyPlayerHeight(a),this.playerComponent.element.style.width="".concat(i,"px"),this.playerScaled={width:i,height:a},this.repositionChildrenRecursive();var l=i/n-1,c=(t+this.element.scrollLeft)*l;this.element.scrollLeft=s+c}},{key:"limitPortraitHeight",value:function(e){this.minPortraitLeft=e,this.repositionChildrenRecursive()}},{key:"setMessageInputFieldHasFocus",value:function(e){this.sendMessageInputFieldHasFocus=e,e&&this.videoControls.hideControls()}},{key:"setHidden",value:function(e){this.isVideoHidden=e,this.repositionChildren()}},{key:"canUpdateMobilePlayer",value:function(){return!this.usingAirPlay&&!this.usingChromecast&&!this.videoControls.isAnyInputFocused()}},{key:"handleLeftSwipe",value:function(e){debug("Handle Left Swipe In Progress")}},{key:"handleRightSwipe",value:function(e){debug("Handle Right Swipe In Progress")}}]),h}(se.r),Ce=n(5406),xe=n(8821),ke=n(9420),Se=n(2923),Te=n(6847),Ie=n(4043);var Pe=function(e){(0,a.Z)(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function s(e){return(0,i.Z)(this,s),r.call(this,"div",e)}return(0,o.Z)(s,[{key:"initData",value:function(e){this.tabList=e.tabList,this.isTouching=!1,this.isSwipingTabs=!1,this.isScrollingVertically=!1,this.isPinching=!1,this.prevTranslate=0,this.currTranslate=0,this.startX=0,this.startY=0,this.tabWidth=(0,pe.RK)().width,this.currIndex=0,s.currentTab="chat"}},{key:"initUI",value:function(){var e=this;this.element=(0,_.vz)("div",{style:{width:"100%",height:"100%",backgroundColor:"#FFFFFF",display:"flex",position:"absolute"}}),this.tabList.getList().forEach((function(t){e.addChild(t)})),this.initSwipeListeners(),Ie.qF.listen((function(t){e.setActiveTab(t)})),ke.wy.listen((function(){Ie.qF.fire("moreRooms")}))}},{key:"initSwipeListeners",value:function(){var e=this;this.tabList.getList().forEach((function(t){(0,m.j9)("touchstart",t.element,(function(t){e.handleTouchStart(t)})),(0,m.j9)("touchmove",t.element,(function(t){e.handleTouchMove(t)})),(0,m.j9)("touchend",t.element,(function(t){e.handleTouchEnd(t)}))}))}},{key:"handleTouchStart",value:function(e){var t=e.touches[0].pageX<20||e.touches[0].pageX>this.tabWidth-20;this.isPinching=e.touches.length>=2,t||(0,Se.V)()||this.isPinching||((0,E.pS)(this.element,"left 0.1s ease-out"),this.isTouching=!0,this.startX=e.touches[0].pageX,this.startY=e.touches[0].pageY)}},{key:"handleTouchMove",value:function(e){var t=e.touches[0].pageX-this.startX,n=t<0,i=0===this.currIndex,o=this.currIndex===this.tabList.length()-1,r=i&&!n||o&&n;if(this.isTouching&&!r&&!this.isPinching){var s=e.touches[0].pageX,a=e.touches[0].pageY;(0,Te.fQ)(this.startX,this.startY,s,a)&&!this.isSwipingTabs&&(this.isScrollingVertically=!0),this.isScrollingVertically||(e.preventDefault(),this.isSwipingTabs=!0,this.currTranslate=this.prevTranslate+t,this.element.style.left="".concat(this.currTranslate,"px"))}}},{key:"handleTouchEnd",value:function(e){var t=this;if(this.isTouching){window.setTimeout((function(){(0,E.QU)(t.element)}),100),this.isTouching=!1,this.isSwipingTabs=!1,this.isScrollingVertically=!1,this.isPinching=!1;var n=this.currTranslate-this.prevTranslate,i=this.tabWidth/4,o=n<=-i,r=n>=i,a=this.currIndex+10;if(o&&a){var c,u=null===(c=this.tabList.getTabByIndex(this.currIndex+1))||void 0===c?void 0:c.getTabName();Ie.qF.fire(null!=u?u:s.currentTab)}else if(r&&l){var d,h=null===(d=this.tabList.getTabByIndex(this.currIndex-1))||void 0===d?void 0:d.getTabName();Ie.qF.fire(null!=h?h:s.currentTab)}else this.currTranslate-=n,this.element.style.left="".concat(this.currTranslate,"px"),this.prevTranslate=this.currTranslate}}},{key:"setActiveTab",value:function(e){var t=this.tabList.getIndexByTabName(e);if(void 0!==t){var n;s.currentTab=e,this.currIndex=t;var i=null===(n=this.tabList.getTabByIndex(t))||void 0===n?void 0:n.getPageActionName();void 0!==i&&(0,R.fg)(i)}this.repositionTabs()}},{key:"repositionTabs",value:function(){this.tabWidth=(0,pe._U)(),this.currTranslate=this.currIndex*-this.tabWidth,this.element.style.left="".concat(this.currTranslate,"px"),this.prevTranslate=this.currTranslate}},{key:"repositionChildren",value:function(){this.repositionTabs()}}]),s}(I.w);var Re=function(e){(0,a.Z)(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function s(e){return(0,i.Z)(this,s),r.call(this,"ul",e)}return(0,o.Z)(s,[{key:"initData",value:function(e){this.activeTab="chat"}},{key:"initUI",value:function(e){var t,n,i=this,o={fontSize:"10px",fontFamily:"UbuntuBold, Arial, Helvetica, sans-serif"};this.numChatUnreadContainer=(0,_.vz)("span",{colorClass:"numUnread",style:o}),this.numPmsUnreadContainer=(0,_.vz)("span",{colorClass:"numUnread",style:o}),this.chatUnreadBubble=(0,_.vz)(Ae,{unreadContainer:this.numChatUnreadContainer}),this.pmUnreadBubble=(0,_.vz)(Ae,{unreadContainer:this.numPmsUnreadContainer}),this.headerTabs=e.tabList.getList().map((function(e){return{tabName:e.getTabName(),element:(0,_.vz)(Me,{tab:e,onClick:function(){Ie.qF.fire(e.getTabName())},chatUnreadBubble:i.chatUnreadBubble,pmUnreadBubble:i.pmUnreadBubble})}})),this.element=(0,_.vz)("ul",{id:"tab-room-header",style:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box",width:"100%",height:"43px",margin:0,padding:0,overflowX:"scroll",overflowY:"hidden",whiteSpace:"nowrap",display:"flex"},colorClass:"Header",className:"noScrollbar"},this.headerTabs.map((function(e){return e.element}))),e.tabList.getChatTab().getChatWindow().numUnreadChanged.listen((function(e){i.setChatUnreadBubble(e)})),(0,xe.$_)()?null===(t=e.tabList.getPrivateTab())||void 0===t||t.numUnreadChanged.listen((function(e){i.setPmsUnreadBubble(e)})):null===(n=e.tabList.getPmTab())||void 0===n||n.getPmWindow().numUnreadChanged.listen((function(e){i.setPmsUnreadBubble(e)})),this.setActiveTabStyles(this.activeTab),Ie.qF.listen((function(e){var t=i.headerTabs.find((function(t){return t.tabName===e}));if(void 0!==t){var n=t.element.offsetLeft0?(this.chatUnreadBubble.style.display="flex",e>=99?(this.numChatUnreadContainer.style.fontSize="9px",this.numChatUnreadContainer.innerText="99+"):(this.numChatUnreadContainer.style.fontSize="10px",this.numChatUnreadContainer.innerText="".concat(e))):this.chatUnreadBubble.style.display="none"}},{key:"setPmsUnreadBubble",value:function(e){e>0?(this.pmUnreadBubble.style.display="flex",e>=99?(this.numPmsUnreadContainer.style.fontSize="9px",this.numPmsUnreadContainer.innerText="99+"):(this.numPmsUnreadContainer.style.fontSize="10px",this.numPmsUnreadContainer.innerText="".concat(e))):this.pmUnreadBubble.style.display="none"}},{key:"setActiveTab",value:function(e){this.setInactiveTabStyles(this.activeTab),this.activeTab=e,this.setActiveTabStyles(this.activeTab)}},{key:"setActiveTabStyles",value:function(e){var t=this.headerTabs.find((function(t){return t.tabName===e}));void 0!==t&&((0,J.FU)(t.element,"inactiveTab"),(0,J.vP)(t.element,"activeTab"),(0,G.Zs)(t.element,{borderBottomStyle:"solid",borderBottomWidth:"3px"}))}},{key:"setInactiveTabStyles",value:function(e){var t=this.headerTabs.find((function(t){return t.tabName===e}));if(void 0!==t){var n="roomMenu"===e;(0,J.FU)(t.element,"activeTab"),(0,J.vP)(t.element,"inactiveTab"),n&&(0,J.vP)(t.element,"roomMenu"),(0,G.Zs)(t.element,{borderBottom:"none"})}}}]),s}(I.w),Me=function(e){var t,n="chat"===e.tab.getTabName(),i="tokens"===e.tab.getTabName(),o="roomMenu"===e.tab.getTabName(),r="pm"===e.tab.getTabName(),s="private"===e.tab.getTabName(),a={listStyleType:"none",display:"inline-block",height:"100%",lineHeight:"42px",fontFamily:"'UbuntuBold', Arial, Helvetica, sans-serif",fontSize:"14px",boxSizing:"border-box",textAlign:"center",padding:"0 10px",position:"relative",flex:1,letterSpacing:o?"1px":""},l={position:"relative",display:"flex",alignItems:"center",justifyContent:"center"};return t=n?(0,_.vz)("span",{style:l,"data-testid":"chat-tab-default"},e.tab.getTabLabel(),e.chatUnreadBubble):i?(0,_.vz)("span",null,(0,_.vz)("span",{style:{display:"inline-block",width:"16px",height:"16px",marginRight:"4px",position:"relative",top:"4px"},colorClass:"tipIcon"}),e.tab.getTabLabel()):o?(0,_.vz)("span",{style:{transform:"rotate(90deg)",display:"inline-block"}},e.tab.getTabLabel()):r||s?(0,_.vz)("span",{style:l,"data-testid":"".concat(r?"pm-tab-default":"")},e.tab.getTabLabel(),e.pmUnreadBubble):(0,_.vz)("span",null,e.tab.getTabLabel()),(0,_.vz)("li",{style:a,colorClass:["inactiveTab"].concat([o?"roomMenu":""]),onClick:e.onClick},t)},Ae=function(e){return(0,_.vz)("span",{style:{width:"8px",height:"8px",borderRadius:"50%",display:"none",justifyContent:"center",alignItems:"center",padding:"6px",marginLeft:"4px"},colorClass:"bubble"},e.unreadContainer)},Ee=n(126);var Be=function(e){(0,a.Z)(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function s(e){return(0,i.Z)(this,s),r.call(this,"div",e)}return(0,o.Z)(s,[{key:"initData",value:function(e){this.tabName=e.tabName,this.tabLabel=e.tabLabel,this.pageActionName=e.pageActionName}},{key:"initUI",value:function(e){this.element=(0,_.vz)("div",{style:{width:"100%",height:"100%",flex:"none",backgroundColor:"#FFF",boxSizing:"border-box"}})}},{key:"getTabName",value:function(){return this.tabName}},{key:"getTabLabel",value:function(){return this.tabLabel}},{key:"getPageActionName",value:function(){return this.pageActionName}}]),s}(I.w),Oe=n(7397),Le=n(6265),De=n(8824);function Ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var Ze=function(e){(0,a.Z)(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function s(){var e;return(0,i.Z)(this,s),(e=r.call(this)).offline=!1,S.kN.listen((function(t){e.username=t.dossier.room,"bio"===Pe.currentTab&&e.load(),e.offline="offline"===t.dossier.roomStatus})),Ie.qF.listen((function(t){"bio"===t&&e.load()})),S.QN.listen((function(){e.removeAllDOMChildren(),e.loadingState=0})),e}return(0,o.Z)(s,[{key:"initUI",value:function(){(0,G.Zs)(this.element,{padding:"19px",boxSizing:"border-box"}),(0,Se.q)(this.element)}},{key:"load",value:function(){var e=this;if(!this.isLoadingOrLoaded()){this.removeAllDOMChildren();var t=(0,_.vz)(Fe,null);this.element.appendChild(t),this.loadingState=1,(0,De.lr)(this.username).then((function(t){e.element.appendChild((0,_.vz)(je,{content:t,offline:e.offline})),e.loadingState=2})).catch((function(t){error("Bio Content error",t),e.element.appendChild((0,_.vz)(_e,null)),e.loadingState=0})).finally((function(){e.element.removeChild(t)}))}}},{key:"isLoadingOrLoaded",value:function(){return 1===this.loadingState||2===this.loadingState}}]),s}(I.w),Fe=function(){return(0,_.vz)("div",null,"".concat(L.ag.loadingText,"..."))},_e=function(){return(0,_.vz)("div",null,L.ag.bioUnavailableText)},Ne=function(e){var t=function(e){for(var t=1;t0&&(0,_.vz)(qe,{socialMedias:r,username:c}),s.length>0&&(0,_.vz)(Je,{photosets:s,username:c}),""!==a&&(0,_.vz)(Ye,{htmlString:a,sectionTitle:L.ag.aboutMeText}),""!==l&&(0,_.vz)(Ye,{htmlString:l,sectionTitle:L.ag.wishListText}))},He=function(e){return(0,_.vz)("button",{style:{width:"100%",fontFamily:"UbuntuMedium, Arial, Helvetica, sans-serif",fontSize:"16px",padding:"12px",color:"#FFF",border:"1px solid #CD5D26",backgroundColor:"#F47321",textAlign:"center",borderRadius:"4px",boxSizing:"border-box",margin:"0px 0 16px 0",display:"inline-block"},onClick:function(){(0,w.Cg)(L.ag.loggedInToDm)||(Ie.ah.fire(!0),Oe.nh.fire(e.username))}},L.ag.dmMenuTitle)},ze=function(e){var t;return(0,_.vz)("div",{style:{border:"1px solid #eee",borderRadius:"3px",boxShadow:"0 3px 6px 0 rgba(90, 90, 90, 0.2), 0 6px 20px 0 rgba(90, 90, 90, 0.19)",margin:"4px 0 12px 0",padding:"4px",position:"relative"}},(0,_.vz)("div",{style:{display:"inline-block",paddingRight:"4px"}},(0,_.vz)("img",{style:{width:"42px",height:"42px",borderRadius:"5px",objectFit:"cover",overflow:"hidden"},src:e.gameSelection.image})),(0,_.vz)("div",{style:{borderLeft:"2px solid #eee",bottom:0,display:"inline-block",height:"100%",overflow:"ellipsis",paddingLeft:"4px",position:"absolute",top:0}},(0,_.vz)("div",{style:{display:"inline-block",marginTop:"-0.5em",position:"relative",top:"50%",transform:"translateY(-50%)",verticalAlign:"middle"}},"".concat(null!==(t=e.username)&&void 0!==t?t:"User"," is playing "),(0,_.vz)("a",{href:e.gameSelection.gameUrl,target:"_blank",rel:"noopener"},e.gameSelection.name))))},We=function(e){var t=e.info,n=t.realName,i=t.followersCount,o=t.displayBirthday,r=t.displayAge,s=t.bodyType,a=t.bodyDecorations,l=t.sex,c=t.subgender,u=t.interestedIn,d=t.location,h=t.lastBroadcast,p=t.languages,m=t.smokeDrink,v=t.hasFanClub,g=t.isInFanClub,y=t.fanClubJoinUrl,b=""!==u?JSON.parse(u).join(", "):"",w={width:"100%",fontFamily:"UbuntuMedium, Arial, Helvetica, sans-serif",fontSize:"16px",padding:"12px",color:"#FFF",border:"1px solid #006800",backgroundColor:"#009900",textAlign:"center",borderRadius:"4px",boxSizing:"border-box",margin:"12px 0 16px 0",display:"inline-block"},C=f.J.current.isNoninteractiveUser;return(0,_.vz)("ul",{style:{listStyleType:"none",padding:0,margin:0}},(0,_.vz)(Ve,{title:L.ag.realNameText,info:n}),!isNaN(i)&&(0,_.vz)(Ve,{title:L.ag.followersText,info:i}),(0,_.vz)((function(){return""===l?l:"A Couple"===l?(0,_.vz)(Ve,{title:L.ag.sexTextCouple,info:l}):"Trans"===l&&""!==c?(0,_.vz)(Ve,{title:L.ag.sexText,info:"".concat(l," (").concat(c,")")}):(0,_.vz)(Ve,{title:L.ag.sexText,info:l})}),null),(0,_.vz)(Ve,{title:L.ag.birthdayText,info:o}),!isNaN(r)&&(0,_.vz)(Ve,{title:L.ag.ageText,info:r}),(0,_.vz)(Ve,{title:L.ag.bodyTypeText,info:s}),(0,_.vz)(Ve,{title:L.ag.bodyDecorationsText,info:a}),(0,_.vz)(Ve,{title:L.ag.interstedInText,info:b}),(0,_.vz)(Ve,{title:L.ag.locationText,info:d}),(0,_.vz)(Ve,{title:L.ag.lastBroadcastText,info:h}),(0,_.vz)(Ve,{title:L.ag.languagesText,info:p}),(0,_.vz)(Ve,{title:L.ag.smokeDrinkText,info:m}),!C&&v&&!g&&(0,_.vz)("a",{style:w,href:y,rel:"noopener"},L.ag.joinFanClub),v&&g&&(0,_.vz)("a",{style:w,href:y,rel:"noopener"},L.ag.inFanClub))},Ve=function(e){return""===e.info||void 0===e.info?"":(0,_.vz)("li",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px"}},(0,_.vz)(Ne,{text:"".concat(e.title,":"),style:{width:"50%"}}),(0,_.vz)("span",{style:{textAlign:"right",width:"50%",overflowWrap:"break-word",wordWrap:"break-word",hyphens:"auto"}},e.info))},qe=function(e){return(0,_.vz)("div",{style:{position:"relative",paddingTop:"5px",paddingBottom:"25px"}},(0,_.vz)(Ne,{text:"".concat(L.ag.socialMediaText,":")}),(0,_.vz)("div",{style:{textAlign:"center"}},e.socialMedias.slice(0,8).map((function(t){return(0,_.vz)(Ke,{socialMedia:t,username:e.username})})),e.socialMedias.length>8&&(0,_.vz)("a",{style:{display:"block",paddingTop:"10px",color:"#156b95",textDecoration:"none"},href:"/socials/social_media/list_popup/".concat(e.username,"/"),target:"".concat(e.username," social media")},L.ag.showMoreText)))},Ke=function(e){var t=(0,pe._U)()/2-40,n={textDecoration:"none",marginLeft:"5px",marginRight:"5px",marginTop:"10px",position:"relative",display:"inline-block",height:"100px",border:"1px solid #ACACAC",borderRadius:"3%",maxWidth:"150px",width:"".concat(t,"px")},i={backgroundColor:e.socialMedia.labelColor,color:"#ffffff",position:"absolute",top:"80px",right:"8px",fontSize:"9px",borderRadius:"2px",padding:"1px 3px",lineHeight:"12px"},o=(0,_.vz)("div",{style:{color:"#156b95",maxWidth:"145px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}},e.socialMedia.titleName);return(0,_.vz)("a",{style:n,href:(0,g.BN)("/socials/social_media/".concat(e.username,"/").concat(e.socialMedia.id)),target:"_self",className:"userUpload",title:e.socialMedia.titleName,onMouseEnter:function(){return o.style.textDecoration="underline"},onMouseLeave:function(){return o.style.textDecoration="none"}},(0,_.vz)("img",{style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"3%"},src:e.socialMedia.imageUrl}),(0,_.vz)("span",{style:i},e.socialMedia.labelText),o)},Je=function(e){return(0,_.vz)("div",{style:{position:"relative",paddingTop:"5px",paddingBottom:"25px"}},(0,_.vz)(Ne,{text:"".concat(L.ag.photosAndVideosText,":"),style:{padding:"5px 10px 5px 0"}}),(0,_.vz)("div",{style:{textAlign:"center"}},e.photosets.slice(0,8).map((function(t){return(0,_.vz)(Ge,{photoset:t,username:e.username})})),e.photosets.length>8&&(0,_.vz)("a",{style:{display:"block",paddingTop:"10px",color:"#156b95",textDecoration:"none"},href:"/photo_videos/photoset/list_popup/".concat(e.username,"/"),target:"".concat(e.username,"_photosets")},L.ag.showMoreText)))},Ge=function(e){var t=void 0===f.J.current.loggedInUser,n=(0,pe._U)()/2-40,i={textDecoration:"none",margin:"10px 5px 10px 5px",position:"relative",display:"inline-block",height:"100px",maxWidth:"150px",width:"".concat(n,"px")},o={width:"".concat(n,"px"),maxWidth:"150px",height:"100px",padding:"1px",borderRadius:"3%",position:"absolute",left:"0px",top:"0px",backgroundColor:"rgba(0, 0, 0, .55)"},r={marginLeft:"".concat(-9,"px"),marginTop:"".concat(-9,"px"),position:"absolute",left:"50%",top:"40%",padding:"4px",border:"none"},s={backgroundColor:e.photoset.labelColor,color:"#fff",position:"absolute",top:"80px",right:"8px",fontSize:"9px",padding:"1px 3px",lineHeight:"12px",borderRadius:"2px"},a=(0,_.vz)("div",{style:{color:"#156b95",maxWidth:"145px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}},e.photoset.name),l=(0,_.vz)(_.HY,null,(0,_.vz)("div",{style:o}),(0,_.vz)("img",{style:r,src:"".concat(STATIC_URL,"lock.svg")}),""!==e.photoset.labelText&&(0,_.vz)("span",{style:s,colorClass:"tokenText"},e.photoset.labelText)),c=(0,_.vz)("span",{style:{backgroundColor:"#6d85b5",color:"#fff",position:"absolute",top:"80px",right:"8px",padding:"1px 3px",lineHeight:"12px",borderRadius:"2px",fontSize:"9px"},colorClass:"purchasedBadge"},L.ag.purchasedCAPS),u=(0,_.vz)("img",{style:{height:"18px",position:"absolute",top:"8px",right:"32px"},src:"".concat(STATIC_URL,"no-audio.svg")}),d=(0,_.vz)("img",{style:{height:"18px",position:"absolute",top:"8px",right:"8px"},src:"".concat(STATIC_URL,"video.svg")});return(0,_.vz)("a",{style:i,href:(0,g.BN)("/photo_videos/photoset/detail/".concat(e.username,"/").concat(e.photoset.id)),target:"".concat(e.username,"_photoset"),className:"userUpload",title:e.photoset.name,onMouseEnter:function(){return a.style.textDecoration="underline"},onMouseLeave:function(){return a.style.textDecoration="none"},onClick:function(n){(0,De.Z7)(e.photoset,"BioTab"),t&&(n.preventDefault(),(0,Le.iW)({fromFeature:!0}))}},(0,_.vz)("img",{style:{width:"100%",height:"100%",objectFit:"cover",borderWidth:"1px",borderStyle:"solid",borderRadius:"3%",borderColor:"#ACACAC",display:"block"},src:e.photoset.coverUrl}),!e.photoset.userCanAccess&&l,e.photoset.userCanAccess&&e.photoset.userHasPurchased&&c,e.photoset.isVideo&&!e.photoset.videoHasSound&&!e.photoset.pendingApproval&&u,e.photoset.isVideo&&d,a)},Ye=function(e){var t=(0,_.vz)("div",null);return t.innerHTML=e.htmlString,(0,De.uc)(t,t,!0,!0),(0,_.vz)("div",null,(0,_.vz)(Ne,{text:"".concat(e.sectionTitle,":")}),(0,_.vz)("div",{style:{width:"100%",overflow:"scroll"},onTouchStart:function(e){var t=function(t){var n=t;n.scrollWidth>n.clientWidth&&e.stopPropagation()};null!==e.target&&t(e.target),null!==e.currentTarget&&t(e.currentTarget)}},(0,_.vz)("div",{style:{maxWidth:"800px",display:"inline-block"}},t)))};var $e=function(e){(0,a.Z)(u,e);var t,n,r=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,i.Z)(this,u),r.call(this,{tabName:"bio",tabLabel:L.ag.bioText,pageActionName:"BioOpened"})}return(0,o.Z)(u,[{key:"initUI",value:function(){(0,s.Z)((0,c.Z)(u.prototype),"initUI",this).call(this),this.bioContent=new Ze,this.addChild(this.bioContent)}}]),u}(Be),Qe=n(7791),Xe=n(824),et=n.n(Xe),tt=n(9888),nt=n(6474),it=n(8015),ot=n(5712),rt=n(6297),st=n(4372),at=n(1163),lt=n(191),ct=n(5726),ut=n(2648),dt=n(202),ht=n(6832),ft=n(4463),pt=n(8642),mt=n(1612),vt=n(5343),gt=n(10);function yt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n2&&void 0!==arguments[2]&&arguments[2],o=(null===(n=f.J.current.loggedInUser)||void 0===n?void 0:n.username)===t.fromUser.username,r=e.user===t.fromUser.username;e.isActive()&&!i&&!o&&r&&(0,R.fg)("PMReceivedOpen",{message_id:t.messageID})}},{key:"loadHistoryMessages",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.isAllHistoryLoaded&&!e.isLoadingHistory){var i=e.chatContents.messageList.clientHeight,o=n?"0":e.chatContents.getEarliestMessageId();this.setIsLoadingHistory(e,!0),(0,nt.yW)(e.user,this.chatConnection.room(),o).then((function(n){var o=n.messages;o.length0&&e.chatContents.setEarliestMessageId(o[0].messageID);var r=e.chatContents.messageList.clientHeight;e.chatContents.messageListWrapper.scrollTop=r-i,t.setIsLoadingHistory(e,!1)})).catch((function(n){error(n),t.setIsLoadingHistory(e,!1)}))}}},{key:"setIsLoadingHistory",value:function(e,t){e.isLoadingHistory=t,t?e.loadHistoryMessagesDOM.showLoading():e.loadHistoryMessagesDOM.hideLoading()}},{key:"repositionChildren",value:function(){(0,s.Z)((0,c.Z)(u.prototype),"repositionChildren",this).call(this);var e=this.currentlyDisplayedPmSession();if(void 0!==e){var t=this.element.offsetHeight-(0,Z.hf)()-this.backButtonContainer.offsetHeight;e.chatContents.messageListWrapper.style.height="".concat(t,"px")}}},{key:"initializePmSession",value:function(e,t,n){var i=this,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=this.pmSessions.get(e);if(void 0===r){(0,P.de)();var s=new Z.Dl({onTipRequest:function(e){Ie.Fx.fire(e)},onToggleDebugMode:function(){i.chatConnection.toggleAppDebugging()},onChatMessage:function(t){i.orderedPMSessionKeys.addToTop(e),(0,nt.pc)({message:t,username:e,source:"mobilePM",roomName:i.chatConnection.room()}).catch((function(e){i.sendPrivateMessageFailCallback(e)})),it.vz.fire(e)}},!0);if(r={chatContents:s,numUnread:0,user:e,loadHistoryMessagesDOM:new pt.OF,isInitialHistoryLoaded:!1,isNewSessionNotified:!1,isAllHistoryLoaded:!1,isLoadingHistory:!1,isActive:function(){return"none"!==s.element.style.display}},s.scrolledToBottom.listen((function(){i.currentlyDisplayedPmSession()===r&&it.vz.fire(e)})),this.newPMSessionEvent.fire(r),this.pmSessions.set(e,r),r.chatContents.appendNoticeDiv((0,dt.KS)(L.ag.privateConversationWithText(e))),r.chatContents.appendNoticeDiv((0,dt.KS)(L.ag.conversationCautionMessage(mt.w.siteName))),!t&&n){var a,l,c=null!==(a=null===(l=f.J.current.loggedInUser)||void 0===l?void 0:l.isAgeVerified)&&void 0!==a&&a;r.chatContents.appendMessageDiv((0,dt.mp)(e,c))}else r.chatContents.appendNoticeDiv(r.loadHistoryMessagesDOM.getElement());r.chatContents.element.style.display="none",this.addChild(r.chatContents)}return o||!0!==t||r.isNewSessionNotified||(r.isNewSessionNotified=!0,bt.fire({username:e,PMChatLink:new ft.E({onClick:function(){ke.sC.fire({username:e,focus:!0,showSupporterAlert:!1})}})})),this.repositionChildren(),r}},{key:"definePMLinkOnClick",value:function(e){this.hideCurrentPMSession(),this.orderedPMSessionKeys.makeCurrent(e),this.showCurrentPMSession()}},{key:"newPrivateMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.appendMessageDiv((0,dt.d$)(e),e.fromUser.username,e.otherUsername,t);var n=(0,gt.hk)(e);void 0!==n&&this.appendMessageDiv(n,e.fromUser.username,e.otherUsername,t),this.maybeIncrementUnreadForPm(e,t)}},{key:"maybeIncrementUnreadForPm",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.fromUser.username!==(null===(t=f.J.current.loggedInUser)||void 0===t?void 0:t.username)&&!n){var i=this.pmSessions.get(e.otherUsername);!i||this.orderedPMSessionKeys.currentElem===e.otherUsername&&i.isActive()||(i.numUnread+=1,this.incrementUnread())}}},{key:"incrementUnread",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;e<=0||(this.numUnread+=e,this.numUnreadChanged.fire(this.numUnread))}},{key:"decrementUnread",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;e<=0||(this.numUnread-=e,this.numUnreadChanged.fire(this.numUnread))}},{key:"resetNumUnread",value:function(){this.numUnread=0,this.numUnreadChanged.fire(this.numUnread)}},{key:"markSessionRead",value:function(e){e.numUnread>0&&(this.decrementUnread(e.numUnread),e.numUnread=0),S.Z2.fire(e.user),it.vz.fire(e.user)}},{key:"afterListItemRemoved",value:function(e){var t=this.pmSessions.get(e);void 0!==t&&(this.decrementUnread(t.numUnread),t.numUnread=0)}},{key:"appendMessageDiv",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.orderedPMSessionKeys.addToTop(n);var o=this.initializePmSession(n,t!==this.chatConnection.username(),!1,i);i&&!1===o.isInitialHistoryLoaded&&(o.isInitialHistoryLoaded=!0),o.isInitialHistoryLoaded&&o.chatContents.appendMessageDiv(e,void 0,!0)}},{key:"possiblyAppendMessageDiv",value:function(e){var t=this.currentlyDisplayedPmSession();void 0!==t&&t.isActive()&&t.chatContents.appendMessageDiv(e)}},{key:"getNumSessions",value:function(){return this.pmSessions.size}},{key:"currentlyDisplayedPmSession",value:function(){if(void 0!==this.orderedPMSessionKeys.currentElem)return this.pmSessions.get(this.orderedPMSessionKeys.currentElem)}},{key:"showNextPMSession",value:function(){return this.hideCurrentPMSession(),void 0!==this.orderedPMSessionKeys.nextElem()&&(this.showCurrentPMSession(),!0)}},{key:"closePMSession",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.pmSessions.get(e);if(void 0!==n){this.closePMSessionEvent.fire(n);var i=this.orderedPMSessionKeys.currentElem===e;this.orderedPMSessionKeys.remove(e),this.removeChild(n.chatContents),n.chatContents.dispose(),this.pmSessions.delete(e),i&&t&&(this.showNextPMSession()||this.leavePmWindow()),this.decrementUnread(n.numUnread),(0,P.G7)()}}},{key:"showCurrentPMSession",value:function(){if(void 0!==this.orderedPMSessionKeys.currentElem){var e=this.orderedPMSessionKeys.currentElem,t=this.pmSessions.get(e);if(void 0!==t){t.isInitialHistoryLoaded||(this.loadHistoryMessages(t,!0),t.isInitialHistoryLoaded=!0),t.chatContents.showElement();var n=t.chatContents.getActionBar();void 0!==n&&n.setScrollLeft(Z.Dl.currScrollLeft),this.sendDmButton.textContent=L.ag.sendDmToUser(t.user),this.repositionChildrenRecursive(),t.chatContents.scrollToBottom(),this.markSessionRead(t)}else error("PmWindow.showCurrentPMSession - no pm session")}else error("no currentpmsession")}},{key:"hideCurrentPMSession",value:function(){var e=this.currentlyDisplayedPmSession();void 0!==e&&(e.chatContents.element.style.display="none")}},{key:"clear",value:function(){var e,t=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return yt(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)?yt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(this.pmSessions.keys());try{for(t.s();!(e=t.n()).done;){var n=e.value;this.closePMSession(n)}}catch(e){t.e(e)}finally{t.f()}}},{key:"adjustBackButtonSize",value:function(e){this.backButtonContainer.style.fontSize=e}},{key:"createBackButton",value:function(e){var t=document.createElement("div");(0,G.Zs)(t,{borderBottom:"1px solid #EFEFEF",padding:"12px",fontSize:"9pt",fontFamily:"Tahoma, Arial, Helvetica, sans-serif",boxSizing:"border-box",display:"flex",gap:"16px"});var n=document.createElement("span");return(0,G.Zs)(n,{display:"inline-block",color:"#0471a1",flex:1}),n.onclick=e.onBackClick,n.innerText=L.ag.back,t.appendChild(n),this.sendDmButton=document.createElement("span"),(0,G.Zs)(this.sendDmButton,{display:"inline-block",color:"#DC5500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),this.sendDmButton.onclick=e.onSendDmClick,t.appendChild(this.sendDmButton),t}}]),u}(I.w);function Ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function xt(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function Ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0?(this.finishInsertLoadedRooms(e),this.isLoadingRooms=!1,this.repositionChildrenRecursive(),this.loadMoreRoomsIfNearBottom(),this.latestEmptyFetch=void 0):(this.isLoadingRooms=!1,this.handleLoadingDivRemoval(),this.latestEmptyFetch=performance.now())}},{key:"finishInsertLoadedRooms",value:function(e){this.removeRoomsScrolledPastTop(),this.appendRoomsToDiv(e)}},{key:"removeRoomsScrolledPastTop",value:function(){if(void 0!==this.getScrolledElement()&&!this.disableRemovalOnScroll){var e=[];if(this.getScrolledElement().scrollTop>this.calculateScrollRemovalThreshold(15)){var t,n=Bt(this.moreRoomsList.rooms);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(!(i.element.offsetTop0){var s=this.moreRoomsList.element.scrollTop;this.moreRoomsList.spliceRooms(0,r),this.moreRoomsList.element.scrollTop=s-this.calculateScrollRemovalThreshold(r,!1),this.visible&&this.loadMoreRoomsIfNearBottom()}}}},{key:"loadMoreRoomsIfNearBottom",value:function(){if(void 0!==this.latestEmptyFetch){if(performance.now()-this.latestEmptyFetch<3e3)return;this.latestEmptyFetch=void 0}this.getScrolledElement().scrollTop+this.getScrolledElement().offsetHeight+this.calculateScrollRemovalThreshold(5)>=this.getScrolledElement().scrollHeight&&this.loadFromCurrentIterator()}}]),d}(Rt.I);function Dt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ut(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)?Ut(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function Ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function Yt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=.6&&n.startStreaming()}}catch(e){t.e(e)}finally{t.f()}}}},{key:"buildGenderCheckbox",value:function(e){var t=this,n=function(){i.blur()},i=(0,_.vz)("input",{type:"checkbox",style:{height:"34px",verticalAlign:"middle"},name:e.toLowerCase(),onMouseUp:n,onTouchEnd:n,onChange:function(){t.handleGenderChange()}});i.checked=this.selectedGenders.indexOf((0,Ft.hP)(e.toLowerCase()))>-1;var o=(0,_.vz)("span",{style:{display:"inline-block",width:"44px",height:"37px",margin:"0 16px 0 8px",textAlign:"center"}},i,(0,_.vz)("img",{src:(0,_t.Fg)(e),style:{verticalAlign:"middle",cursor:"pointer",width:"16px",height:"16px"},onClick:function(){i.checked=!i.checked,t.handleGenderChange()}}));return this.genderCheckboxes.push(i),o}},{key:"calculateScrollRemovalThreshold",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e*(this.roomHeight()+4+2)+(t?2:0)}}]),n}(Lt),en=function(){var e={background:'url("'.concat(STATIC_URL_ROOT,'images/loading_spinner.svg")'),backgroundSize:"cover",width:"30px",height:"31px",animationName:"spin",animationDuration:"2s",animationTimingFunction:"linear",animationIterationCount:"infinite",animationDelay:"0.01s"};return(0,_.vz)("div",{style:{display:"flex",flex:1,width:"100%",justifyContent:"center",alignItems:"center"}},(0,_.vz)("div",{style:e}))},tn=n(1177);var nn=function(e){(0,a.Z)(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function s(e){var t;(0,i.Z)(this,s),(t=r.call(this,270,void 0)).player=e,t.scrollTopReference=0,t.roomList=new Xt({disableRemovalOnScroll:!0}),t.genderSelection=document.createElement("div"),t.genderSelection.className="genderSelectionDiv",t.roomList.getScrolledElement().appendChild(t.genderSelection);for(var n=0,o=["Female","Male","Couple","Trans"];nthis.player.element.offsetHeight&&(this.roomList.getScrolledElement().scrollTop-=this.lastPlayerHeight-this.player.element.offsetHeight),this.lastPlayerHeight=this.player.element.offsetHeight,this.lastTopPanelHeight=this.roomList.getScrolledElement().offsetTop;var e=0,t=document.getElementById("tab-room-header");null!==t&&(e=t.offsetHeight);var n=document.getElementById("static-header"),i=null!==n?n.offsetHeight:0;this.roomList.element.style.height="".concat((0,pe.mP)()-this.player.element.offsetHeight-e-i,"px")}},{key:"showHideGenderSelection",value:function(){this.lastScrollTop<=120?this.showGenderSelection():this.lastScrollTop-this.scrollTopReference>=120?(this.scrollTopReference=this.lastScrollTop,this.hideGenderSelection()):this.scrollTopReference-this.lastScrollTop>=120&&(this.scrollTopReference=this.lastScrollTop,this.showGenderSelection())}},{key:"showGenderSelection",value:function(){this.genderSelection.classList.remove("collapsed")}},{key:"hideGenderSelection",value:function(){this.genderSelection.classList.add("collapsed")}}]),s}(tn.M);var on=function(e){(0,a.Z)(u,e);var t,n,r=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function u(e){(0,i.Z)(this,u);var t={tabName:"moreRooms",tabLabel:L.ag.moreRoomsText,pageActionName:"MoreRoomsOpened",player:e};return r.call(this,t)}return(0,o.Z)(u,[{key:"initData",value:function(e){(0,s.Z)((0,c.Z)(u.prototype),"initData",this).call(this,e),this.player=e.player}},{key:"initUI",value:function(){var e=this;(0,s.Z)((0,c.Z)(u.prototype),"initUI",this).call(this),this.moreRooms=new nn(this.player),this.addChild(this.moreRooms),Ie.qF.listen((function(t){t===e.getTabName()?e.moreRooms.show():e.moreRooms.hide()}))}}]),u}(Be),rn=n(7122);var sn=function(e){(0,a.Z)(u,e);var t,n,r=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,i.Z)(this,u),r.call(this,{tabName:"pm",tabLabel:"PM",pageActionName:"PMOpened"})}return(0,o.Z)(u,[{key:"initData",value:function(e){var t=this;(0,s.Z)((0,c.Z)(u.prototype),"initData",this).call(this,e),S.kN.listen((function(e){t.roomName=e.chatConnection.room(),t.showPmList()}))}},{key:"initUI",value:function(){var e=this;(0,s.Z)((0,c.Z)(u.prototype),"initUI",this).call(this),this.element.classList.add("data-hj-suppress"),this.pmWindow=new wt({leavePmWindow:function(){e.showPmList()}}),this.pmList=new rn.i({onItemRemoved:function(t){e.pmWindow.afterListItemRemoved(t)},isDropdown:!1,openConversationEvent:it.gd}),this.addChild(this.pmList),this.addChild(this.pmWindow),it.gd.listen((function(t){e.showPmWindow(),e.pmWindow.definePMLinkOnClick(t)})),this.showPmList(),ke.sC.listen((function(t){t.focus&&e.showPmWindow()})),Ie.qF.listen((function(t){var n,i=!((null===(n=f.J.current.loggedInUser)||void 0===n?void 0:n.username)===e.roomName)&&1===e.pmList.getAllItems().length;t===e.getTabName()&&i?(e.showPmWindow(),e.pmWindow.definePMLinkOnClick(e.roomName)):e.showPmList()}))}},{key:"showPmList",value:function(){this.pmList.showElement(),this.pmWindow.hideCurrentPMSession(),this.pmWindow.element.style.visibility="hidden"}},{key:"showPmWindow",value:function(){this.pmList.hideElement(),this.pmWindow.element.style.visibility="visible"}},{key:"getPmWindow",value:function(){return this.pmWindow}}]),u}(Be),an=n(5537);function ln(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var cn=function(e){(0,a.Z)(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function s(){var e;(0,i.Z)(this,s),e=r.call(this);var t=new P.mM;return S.kN.listen((function(n){var i=n.dossier,o=i.allowPrivateShow,r=i.privatePrice,s=i.spyPrice,a=i.privateMinMinutes,l=i.allowShowRecordings,c=i.roomStatus,u=i.isAgeVerified;e.updateData({allowPrivateShow:o,privatePrice:r,spyPrice:s,privateMinMinutes:a,allowShowRecordings:l},c,u),n.chatConnection.event.settingsUpdate.listen((function(t){e.updateData(t,e.currentStatus,e.isAgeVerified)})).addTo(t),n.chatConnection.event.statusChange.listen((function(t){e.updateData(e.roomSettings,t.currentStatus,e.isAgeVerified)})).addTo(t)})),S.QN.listen((function(){t.removeAll()})),e}return(0,o.Z)(s,[{key:"initData",value:function(){this.roomSettings={allowPrivateShow:!1,privateMinMinutes:0,privatePrice:0,spyPrice:0,allowShowRecordings:!1},this.currentStatus="offline",this.isAgeVerified=!1}},{key:"initUI",value:function(){this.element=(0,_.vz)("div",{colorClass:"PrivateShowInfo",style:{fontSize:"12px",lineHeight:"16px"}}),this.render()}},{key:"updateData",value:function(e,t,n){this.roomSettings=e,this.currentStatus=t,this.isAgeVerified=n,this.render()}},{key:"render",value:function(){return this.removeAllDOMChildren(),this.roomSettings.allowPrivateShow&&this.isAgeVerified?(["privatenotwatching","privatespying"].includes(this.currentStatus)?this.element.appendChild((0,_.vz)(mn,{spyPrice:this.roomSettings.spyPrice,roomStatus:this.currentStatus})):this.element.appendChild((0,_.vz)(fn,{privatePrice:this.roomSettings.privatePrice,privateMinMinutes:this.roomSettings.privateMinMinutes,allowShowRecordings:this.roomSettings.allowShowRecordings,roomStatus:this.currentStatus})),this.element):(this.element.appendChild((0,_.vz)(pn,null)),this.element)}}]),s}(I.w),un=function(e){var t=function(e){for(var t=1;t0&&(0,_.vz)("span",null,"".concat(L.ag.spyShowCost,": ").concat(L.ag.priceTokensPerMinuteMessage(e.spyPrice,!0))),e.spyPrice<=0&&(0,_.vz)("span",null,L.ag.privateShowSpyDisabled))};var vn=function(e){(0,a.Z)(u,e);var t,n,r=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function u(){var e,t,n;(0,i.Z)(this,u),n=r.call(this,{tabName:"private",tabLabel:L.ag.privateText,pageActionName:"PrivateOpened"});var o=new P.mM,s=null!==(e=null===(t=f.J.current.loggedInUser)||void 0===t?void 0:t.isAgeVerified)&&void 0!==e&&e;return S.kN.listen((function(e){n.chatConnection=e.chatConnection,n.chatHeading.innerText=L.ag.privateConversationWithText(n.chatConnection.room()),n.chatContents.appendNoticeDiv(n.loadHistoryMessagesDOM.getElement()),e.dossier.needsSupporterToPm&&n.chatContents.appendMessageDiv((0,dt.mp)(n.room,s)),e.chatConnection.event.roomMessage.listen((function(t){n.chatConnection.inPrivateRoom()&&n.chatContents.appendMessageDiv((0,dt.d$)(t,e.dossier.userName))})).addTo(o),e.chatConnection.event.roomNotice.listen((function(t){t.showInPrivateMessage&&n.chatContents.appendMessageDiv((0,dt.J6)(t,e.dossier.userName))})).addTo(o)})),it.Cb.listen((function(e){n.onConversationMessage(e)})),it.Kd.listen((function(e){n.onConversationMessage(e)})),ht.zS.conversationDataChanged.listen((function(){n.updateUnreadCount()})),ht.zS.unreadConversationsCountUpdate.listen((function(){return n.updateUnreadCount()})),Ie.qF.listen((function(e){e===n.getTabName()&&(n.isInitialHistoryLoaded?n.maybeMarkRead(e):n.loadHistoryMessages(!0))})),n.chatContents.scrolledToBottom.listen((function(){n.maybeMarkRead()})),S.QN.listen((function(){n.chatContents.clear(),n.resetHistoryData(),o.removeAll()})),n}return(0,o.Z)(u,[{key:"initData",value:function(e){var t=this;(0,s.Z)((0,c.Z)(u.prototype),"initData",this).call(this,e),this.resetHistoryData(),this.loadHistoryMessagesDOM=new pt.OF,this.numUnreadChanged=new P.xB("numUnreadChanged"),this.chatContents=new Z.Dl({onTipRequest:function(e){Ie.Fx.fire(e)},onToggleDebugMode:function(){t.chatConnection.toggleAppDebugging()},onChatMessage:function(e){if(t.chatConnection.inPrivateRoom())t.chatConnection.sendRoomMessage(e);else{var n=t.chatConnection.room();(0,nt.pc)({message:e,username:n,source:"mobilePM",roomName:n}).catch((function(e){t.chatContents.appendMessageDiv((0,dt.KS)(e.errorMessage))}))}}})}},{key:"initUI",value:function(){var e=this;(0,s.Z)((0,c.Z)(u.prototype),"initUI",this).call(this),(0,J.vP)(this.element,"PrivateTab"),(0,G.Zs)(this.element,{display:"flex",flexDirection:"column"}),(0,G.Zs)(this.chatContents.element,{flex:1});var t=new an.Qs({style:{width:"120px",height:"40px",marginBottom:"",minHeight:""}});(0,J.vP)(t,"darkText"),this.element.appendChild((0,_.vz)("div",{ref:function(t){e.infoContainer=t}},(0,_.vz)("div",{colorClass:"privateContainer",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px"}},(new cn).element,t.element),(0,_.vz)("span",{colorClass:"chatHeading",style:{fontSize:"14px",padding:"10px 10px 6px 10px",display:"block",fontFamily:"UbuntuMedium, Helvetica, Arial, sans-serif"},ref:function(t){e.chatHeading=t}}))),this.addChild(this.chatContents)}},{key:"onConversationMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.appendBroadcasterMessageDiv(e,t),this.firePMChatLink(t),this.maybeMarkRead()}},{key:"appendBroadcasterMessageDiv",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.fromUser.username;if((e.otherUsername===this.room||n===this.room)&&(t&&!this.isInitialHistoryLoaded&&(this.isInitialHistoryLoaded=!0),this.isInitialHistoryLoaded)){this.chatContents.appendMessageDiv((0,dt.d$)(e,n));var i=(0,gt.hk)(e);void 0!==i&&this.chatContents.appendMessageDiv(i)}}},{key:"firePMChatLink",value:function(e){e||this.isInitialHistoryLoaded||bt.fire({username:this.room,PMChatLink:new ft.E({onClick:function(){Ie.qF.fire("private")}})})}},{key:"updateUnreadCount",value:function(){var e,t,n=null!==(e=null===(t=ht.zS.getInstance().getConversation(this.room))||void 0===t?void 0:t.numUnread)&&void 0!==e?e:0;this.numUnreadChanged.fire(n)}},{key:"maybeMarkRead",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pe.currentTab)!==this.getTabName()||this.chatContents.isScrolledUp()||(S.Z2.fire(this.room),it.vz.fire(this.room))}},{key:"loadHistoryMessages",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.isAllHistoryLoaded&&!this.isLoadingHistory){var n=this.chatContents.messageList.clientHeight,i=t?"0":this.chatContents.getEarliestMessageId();this.setIsLoadingHistory(!0),(0,nt.yW)(this.room,this.room,i).then((function(t){var i=t.messages;i.length0&&e.chatContents.setEarliestMessageId(i[0].messageID);var o=e.chatContents.messageList.clientHeight;e.chatContents.messageListWrapper.scrollTop=o-n})).catch((function(e){error(e)})).finally((function(){e.setIsLoadingHistory(!1)}))}}},{key:"setIsLoadingHistory",value:function(e){this.isLoadingHistory=e,e?this.loadHistoryMessagesDOM.showLoading():this.loadHistoryMessagesDOM.hideLoading()}},{key:"resetHistoryData",value:function(){this.isLoadingHistory=!1,this.isInitialHistoryLoaded=!1,this.isAllHistoryLoaded=!1}},{key:"room",get:function(){return this.chatConnection.room()}},{key:"repositionChildren",value:function(){var e=this.element.offsetHeight-(0,Z.hf)()-this.infoContainer.offsetHeight;this.chatContents.messageListWrapper.style.height="".concat(e,"px")}}]),u}(Be),gn=n(1194),yn=n(8958);var bn=16,wn="rgb(239, 239, 239)",Cn="rgb(255, 255, 255)",xn=function(e){(0,a.Z)(u,e);var t,n,r=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,i.Z)(this,u),r.apply(this,arguments)}return(0,o.Z)(u,[{key:"styleContainer",value:function(e){e.style.fontSize="".concat(bn,"px")}},{key:"styleHeader",value:function(e,t){(0,s.Z)((0,c.Z)(u.prototype),"styleHeader",this).call(this,e,t),e.style.fontSize="".concat(bn,"px"),e.style.padding="".concat(12,"px"),e.style.margin="0",e.style.borderBottom="".concat(1,"px solid ").concat(wn),e.style.backgroundColor="".concat("rgb(250, 250, 250)"),e.style.boxSizing="border-box"}},{key:"styleRowWrapper",value:function(e){(0,s.Z)((0,c.Z)(u.prototype),"styleRowWrapper",this).call(this,e),e.style.fontSize="".concat(bn,"px"),e.style.backgroundColor="".concat(Cn),e.style.padding="".concat(12,"px ").concat(18,"px"),e.style.margin="0",e.style.borderBottom="".concat(1,"px solid ").concat(wn),e.style.overflow="hidden",e.style.boxSizing="border-box"}},{key:"styleLabel",value:function(e,t){(0,s.Z)((0,c.Z)(u.prototype),"styleLabel",this).call(this,e,t),e.style.color="rgb(51, 51, 51)",e.style.fontSize="".concat(bn,"px"),e.style.padding="".concat(12,"px ").concat(18,"px"),e.style.padding="0",e.style.margin="0"}},{key:"styleInput",value:function(e){(0,s.Z)((0,c.Z)(u.prototype),"styleInput",this).call(this,e),e.style.color="rgb(115, 115, 115)",e.style.fontSize="".concat(bn,"px"),e.style.display="in-block",e.style.cssFloat="right",e.style.webkitAppearance="none",e.style.border="none",e.style.maxWidth="45%",e.style.padding="0",e.style.margin="0",e instanceof HTMLSelectElement&&(e.style.fontSize="".concat(bn,"px"),e.style.height="",e.style.backgroundColor="".concat(Cn),e.style.backgroundImage="url(".concat(STATIC_URL_MOBILE,"chevron_right_light.svg)"),e.style.backgroundRepeat="no-repeat",e.style.backgroundPosition="right bottom",e.style.backgroundSize="".concat(18,"px ").concat(18,"px"),e.style.padding="0 ".concat(20,"px 0 0"),e.style.textAlign="right",e.style.textAlignLast="right")}}]),u}(yn.h),kn=n(5042);var Sn=function(e){(0,a.Z)(u,e);var t,n,r=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function u(e,t,n){var o;return(0,i.Z)(this,u),(o=r.call(this,e,t,n)).hue=180,o.saturation=1,o.value=1,o.parentHasTouchScrolling=!1,o.element.style.position="fixed",o.element.style.top="15%",o.element.style.boxShadow="0 20px 30px -3px rgba(0, 0, 0, 0.4), 0 8px 12px -2px rgba(0, 0, 0, 0.2)",o.element.style.backgroundColor="white",o.element.style.padding="12px",o.element.style.borderRadius="8px",o.element.style.left="10%",o.element.style.right="10%",o.hexInput.style.fontSize="16px",o.hexInput.style.backgroundColor="#f1f3f4",o.hexInput.style.color="rgb(88, 91, 94)",o.hexInput.style.padding="6px 4px",o.hexInput.style.border="none",o.hexInput.style.width="calc(100% - 33px)",o.hexInput.style.boxSizing="border-box",(0,m.j9)("input",o.hexInput,(function(){var e=o.hexInput.value;(0,kn.vq)(e)&&o.updateColorSelectors(e,!1)})),o.createSaveAndCancel(),o}return(0,o.Z)(u,[{key:"createColorCanvas",value:function(){var e=this;this.palette=document.createElement("div"),this.paletteSelector=document.createElement("div");var t=document.createElement("div");this.bar=document.createElement("div"),this.barSelector=document.createElement("div"),this.preview=document.createElement("div"),this.element.appendChild(this.palette),this.palette.appendChild(this.paletteSelector),this.element.appendChild(t),t.appendChild(this.bar),this.element.appendChild(this.preview),this.bar.appendChild(this.barSelector),this.preview.style.height="25px",this.preview.style.width="25px",this.preview.style.borderRadius="100%",this.preview.style.border="1px solid black",this.preview.style.cssFloat="left",this.preview.style.marginRight="6px",this.palette.style.width="100%",this.palette.style.height="200px",this.palette.style.position="relative",this.bar.style.background="linear-gradient(90deg,red,#ff0,#0f0,#0ff,#00f,#f0f,red)",t.style.padding="2px 0",this.bar.style.position="relative",this.bar.style.width="100%",this.bar.style.height="".concat(16,"px"),this.bar.style.borderRadius="6px",this.bar.style.margin="24px 0",this.bar.style.padding="0 4px",this.bar.style.boxSizing="border-box",this.styleSelector(this.paletteSelector),this.styleSelector(this.barSelector),this.barSelector.style.boxShadow="0 0 4px rgba(0, 0, 0, 0.8)";var n=function(t){t.stopPropagation(),t.preventDefault();var n=t.touches[0].clientX-e.bar.getBoundingClientRect().left;e.setBarSelectorPosition(n)};t.ontouchstart=function(e){n(e)},t.ontouchmove=function(e){n(e)};var i=function(t){t.stopPropagation(),t.preventDefault();var n=t.touches[0].clientX-e.palette.getBoundingClientRect().left,i=t.touches[0].clientY-e.palette.getBoundingClientRect().top;e.setPaletteSelectorPosition(n,i)};this.palette.ontouchstart=function(e){i(e)},this.palette.ontouchmove=function(e){i(e)}}},{key:"styleSelector",value:function(e){e.style.position="absolute",e.style.height="".concat(16,"px"),e.style.width="".concat(16,"px"),e.style.border="".concat(2,"px solid #fff"),e.style.borderRadius="100%",e.style["-webkit-user-select"]="none",e.style.top="".concat(-2,"px")}},{key:"setBarSelectorPosition",value:function(e){var t=Math.min(e,this.bar.offsetWidth);t=Math.max(0,t),this.hue=t/this.bar.offsetWidth*360,this.barSelector.style.left="".concat(t-this.barSelector.offsetWidth/2,"px"),this.updateColors(!0)}},{key:"setBarSelectorPercentage",value:function(e){var t=Math.min(1,e);t=Math.max(0,t),this.barSelector.style.left="".concat(t*this.bar.offsetWidth-this.barSelector.offsetWidth/2,"px")}},{key:"setPaletteSelectorPosition",value:function(e,t){var n=Math.min(e,this.palette.offsetWidth);n=Math.max(0,n),this.saturation=n/this.palette.offsetWidth;var i=Math.min(t,this.palette.offsetHeight);i=Math.max(0,i),this.value=1-i/this.palette.offsetHeight,this.paletteSelector.style.left="".concat(n-this.paletteSelector.offsetWidth/2,"px"),this.paletteSelector.style.top="".concat(i-this.paletteSelector.offsetWidth/2,"px"),this.updateColors(!0)}},{key:"setPaletteSelectorPercentage",value:function(e,t){this.paletteSelector.style.left="".concat(e*this.palette.offsetWidth-this.paletteSelector.offsetWidth/2,"px"),this.paletteSelector.style.top="".concat(t*this.palette.offsetHeight-this.paletteSelector.offsetHeight/2,"px")}},{key:"repositionChildren",value:function(){this.palette.style.height="".concat((0,pe.mP)()/3,"px"),this.setPaletteSelectorPercentage(this.saturation,1-this.value),(0,me.gr)()||this.hide()}},{key:"colorPicked",value:function(e){(0,s.Z)((0,c.Z)(u.prototype),"colorPicked",this).call(this,e),this.preview.style.backgroundColor="".concat(e)}},{key:"createSaveAndCancel",value:function(){var e=this,t=this.createButton(L.ag.saveCAPS),n=this.createButton(L.ag.cancelCAPS);t.style.backgroundColor="rgb(255, 112, 2)",n.style.backgroundColor="transparent",n.style.color="#1C6B92",n.style.marginRight="4px",t.onclick=function(){e.colorPicked(e.hexInput.value),e.hide()},n.onclick=function(){e.hide()},this.element.appendChild(t),this.element.appendChild(n)}},{key:"updateColors",value:function(e){var t=(0,kn.Bi)(this.hue,1,1);this.palette.style.background="linear-gradient(to top, rgb(0, 0, 0), transparent), linear-gradient(to left, rgb(".concat(t.red,", ").concat(t.green,", ").concat(t.blue,"), rgb(255, 255, 255))"),this.barSelector.style.backgroundColor="rgb(".concat(t.red,", ").concat(t.green,", ").concat(t.blue,")");var n=(0,kn.Bi)(this.hue,this.saturation,this.value);this.preview.style.backgroundColor="rgb(".concat(n.red,", ").concat(n.green,", ").concat(n.blue,")"),this.paletteSelector.style.backgroundColor="rgb(".concat(n.red,", ").concat(n.green,", ").concat(n.blue,")"),e&&(this.hexInput.value="#".concat((0,kn.rr)(n).toLocaleUpperCase()))}},{key:"createButton",value:function(e){var t=document.createElement("button");return t.textContent=e,t.style.borderRadius="4px",t.style.fontSize="16px",t.style.color="white",t.style.textAlign="center",t.style.cursor="pointer",t.style.border="none",t.style.padding="6px 16px",t.style.margin="12px 0 4px 0",t.style.display="inline-block",t.style.cssFloat="right",t}},{key:"updateColorSelectors",value:function(e,t){var n=(0,kn.qm)(e);this.hue=n.hue,this.saturation=n.saturation,this.value=n.value,this.setBarSelectorPercentage(this.hue/360),this.setPaletteSelectorPercentage(this.saturation,1-this.value),this.updateColors(t)}},{key:"show",value:function(e){this.initialColor=e,this.styleForShow(),this.updateColorSelectors(e,!0),void 0!==this.parent&&"touch"===this.parent.element.style["-webkit-overflow-scrolling"]&&(this.parent.element.style["-webkit-overflow-scrolling"]="",this.parentHasTouchScrolling=!0)}},{key:"hide",value:function(){(0,s.Z)((0,c.Z)(u.prototype),"hide",this).call(this),void 0!==this.parent&&this.parentHasTouchScrolling&&(this.parent.element.style["-webkit-overflow-scrolling"]="touch",this.parentHasTouchScrolling=!1)}}]),u}(n(7184).l);var Tn=function(e){(0,a.Z)(u,e);var t,n,r=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,i.Z)(this,u),r.apply(this,arguments)}return(0,o.Z)(u,[{key:"initData",value:function(){(0,s.Z)((0,c.Z)(u.prototype),"initData",this).call(this),this.showManageIgnoredUsers=new P.xB("ShowManageIgnoredUsers"),this.isAgeVerified=!1}},{key:"initUI",value:function(){var e,t=this;(0,s.Z)((0,c.Z)(u.prototype),"initUI",this).call(this),this.element.style.padding="0px",this.element.style.margin="0px",this.element.style.fontSize="".concat(16,"px"),null===(e=this.chatSettingsStyles)||void 0===e||e.styleLabel(this.manageIgnoredUsersLink,L.ag.viewEditIgnoredUsers),(0,G.Zs)(this.form,{maxWidth:"100%"}),this.manageIgnoredUsersLink.onclick=function(){(0,w.Cg)('You must be logged in to edit ignored users. Click "OK" to login.')||t.showManageIgnoredUsers.fire(void 0)}}},{key:"handleRoomLoaded",value:function(e){(0,s.Z)((0,c.Z)(u.prototype),"handleRoomLoaded",this).call(this,e),this.isAgeVerified=e.dossier.isAgeVerified}},{key:"getStyles",value:function(){return void 0===this.chatSettingsStyles&&(this.chatSettingsStyles=new xn),this.chatSettingsStyles}},{key:"getEmoticonAutocompleteDelayOptions",value:function(){return[{label:"Turn Off",value:"-1"},{label:"0s",value:"0"},{label:"0.5s",value:"500"},{label:"1s",value:"1000"},{label:"1.5s",value:"1500"}]}},{key:"getHighestTokenColorOptions",value:function(){return[{label:"Dark Purple",value:"darkpurple"},{label:"Light Purple",value:"lightpurple"},{label:"Dark Blue",value:"darkblue"},{label:"Light Blue",value:"lightblue"}]}},{key:"getSaveEndpoint",value:function(){return this.isBroadcaster()?"api/broadcasterchatsettings/":(0,s.Z)((0,c.Z)(u.prototype),"getSaveEndpoint",this).call(this)}},{key:"getSaveColorEndpoint",value:function(){return this.isBroadcaster()?"choose_broadcaster_chat_color/":(0,s.Z)((0,c.Z)(u.prototype),"getSaveColorEndpoint",this).call(this)}},{key:"getFormData",value:function(){var e=(0,s.Z)((0,c.Z)(u.prototype),"getFormData",this).call(this);return this.isBroadcaster()?(e.broadcaster_tip_volume=e.viewer_tip_volume,e):e}},{key:"isBroadcaster",value:function(){var e;return(null===(e=f.J.current.loggedInUser)||void 0===e?void 0:e.username)===this.roomName&&this.isAgeVerified}},{key:"styleWrapperCustom",value:function(e){(0,s.Z)((0,c.Z)(u.prototype),"styleWrapperCustom",this).call(this,e),e.style.padding="0"}},{key:"styleLabelCustom",value:function(e){(0,s.Z)((0,c.Z)(u.prototype),"styleLabelCustom",this).call(this,e),e.style.padding="".concat(12,"px ").concat(18,"px")}},{key:"styleEmoticonsCheckbox",value:function(e){(0,s.Z)((0,c.Z)(u.prototype),"styleEmoticonsCheckbox",this).call(this,e),e.style.margin="6px ".concat(18,"px 6px 0"),e.style.cssFloat="right"}},{key:"styleSlider",value:function(e){(0,s.Z)((0,c.Z)(u.prototype),"styleSlider",this).call(this,e),e.element.style.marginTop="2px"}},{key:"styleColorSwatch",value:function(e){(0,s.Z)((0,c.Z)(u.prototype),"styleColorSwatch",this).call(this,e),e.style.margin="11px ".concat(21,"px 11px 0px")}},{key:"createColorPickerModal",value:function(){return new Sn(this.chatColorSwatch,this.onColorPicked.bind(this),this.onColorHovered.bind(this))}},{key:"updateSelectWidth",value:function(e){var t=document.createElement("span");t.style.fontSize="".concat(16),t.style.padding="0",t.style.margin="0",t.style.cssFloat="left",t.style.whiteSpace="nowrap",t.style.fontFamily=getComputedStyle(e).getPropertyValue("font-family"),t.innerText=e.options[e.selectedIndex].text,document.body.appendChild(t);var n=t.getBoundingClientRect().width;document.body.removeChild(t),e.style.width="".concat(n+18+2,"px")}}]),u}(k.l);var In=function(e){(0,a.Z)(u,e);var t,n,r=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function u(){var e;(0,i.Z)(this,u),(e=r.call(this,Math.min((0,pe._U)()-50,400),void 0,!0)).chatSettings=new Tn,(0,G.Zs)(e.chatSettings.element,{height:"calc(100% - 45px)"}),(0,Se.q)(e.chatSettings.element),e.addChild(e.chatSettings),e.element.style.backgroundColor="rgb(250, 250, 250)";var t,n=document.createElement("div");return n.innerText=L.ag.chatSettingsSavedText,n.style.position="absolute",n.style.top="2px",n.style.right="2px",n.style.fontFamily="UbuntuRegular, Helvetica, Arial, sans-serif",n.style.color="#000000",n.style.backgroundColor="#d8deea",n.style.border="1px solid #acacac",n.style.borderRadius="4px",n.style.padding="4px 6px",n.style.visibility="hidden",e.element.appendChild(n),e.chatSettings.chatSettingsSavedRequest.listen((function(){clearTimeout(t),(0,E.pS)(n,"250ms"),n.style.visibility="visible",t=window.setTimeout((function(){(0,E.pS)(n,"1000ms"),n.style.visibility="hidden"}),2500)})),e}return(0,o.Z)(u,[{key:"show",value:function(){(0,s.Z)((0,c.Z)(u.prototype),"show",this).call(this),this.chatSettings.getTipVolumeSlider().handleResize()}},{key:"repositionChildren",value:function(){this.width=Math.min((0,pe._U)()-50,400)}}]),u}(tn.M),Pn=n(5925),Rn=n(9271);function Mn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.createIgnoredUserRow(i)}}catch(e){n.e(e)}finally{n.f()}}}}},{key:"createSpecialMessage",value:function(e){var t=document.createElement("div");return this.styles.styleRowWrapper(t),t.innerText=e,t.style.borderBottom="none",t}},{key:"clearIgnoredUsersList",value:function(){for(;null!==this.ignoredUsersList.firstChild;)this.ignoredUsersList.removeChild(this.ignoredUsersList.firstChild)}},{key:"createIgnoredUserRow",value:function(e){var t=this,n=document.createElement("div"),i=document.createElement("label"),o=document.createElement("img");this.ignoredUsersList.appendChild(n),n.appendChild(i),n.appendChild(o),this.styles.styleRowWrapper(n),this.styles.styleLabel(i,e),this.styles.styleInput(o),o.src="".concat(STATIC_URL_MOBILE,"remove.svg"),o.style.height="".concat(18,"px");var r=!1,s=new Rn.I(!1,(function(e,i){i?n.style.opacity="0.4":e&&((0,E.pS)(n,"opacity ".concat(100,"ms")),n.style.opacity="0",window.setTimeout((function(){t.ignoredUsersList.removeChild(n)}),100))}),(function(){n.style.opacity="1.0",r=!1}));o.onclick=function(){void 0!==t.chatConnection&&(r||(r=!0,s.dispatch(!0,t.chatConnection.unignore(e))))}}}]),u}(tn.M);var En={underage:L.ag.reportAbuseCatUnderage,advertising:L.ag.reportAbuseCatAdvertising,abusive:L.ag.reportAbuseCatAbusive,intoxicated:L.ag.reportAbuseCatIntoxicated,"large toy":L.ag.reportAbuseCatLarge,"offline payments":L.ag.reportAbuseCatOffline,"public broadcast":L.ag.reportAbuseCatPublic,"service uniform":L.ag.reportAbuseCatUniform,sleeping:L.ag.reportAbuseCatSleeping,gender:L.ag.reportAbuseCatGender,other:L.ag.reportAbuseCatOther},Bn=function(e){(0,a.Z)(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function s(){var e;(0,i.Z)(this,s),(e=r.call(this)).closeEvent=new P.xB("reset"),e.formContainer=document.createElement("div"),e.blankOption=document.createElement("option"),e.submittedMsg=document.createElement("div"),e.categoryRequiredMsg=document.createElement("div"),e.commentsRequiredMsg=document.createElement("div"),e.categorySelect=document.createElement("select"),e.textBox=document.createElement("textarea"),e.reportAbuseForm=document.createElement("form"),e.hideTimeout=0,(0,G.Zs)(e.element,{display:"block",color:"#6C6C78",fontSize:"14px",height:"calc(100% - 45px)",boxSizing:"border-box",position:"absolute",padding:"19px"}),(0,Se.q)(e.element,!0),e.element.appendChild(e.formContainer),e.reportAbuseForm.method="post",e.formContainer.appendChild(e.reportAbuseForm);var t=document.createElement("div");for(var n in t.style.paddingBottom="10px",t.style.width="100%",t.style.display="inline-block",t.style.maxWidth="100%",e.reportAbuseForm.appendChild(t),e.categorySelect.style.border="1px solid #A4A4A4",e.categorySelect.style.fontSize="16px",e.categorySelect.style.width="99%",e.categorySelect.style.fontFamily="UbuntuRegular, Arial, Helvetica, sans-serif",t.appendChild(e.categorySelect),e.blankOption.value="",e.blankOption.disabled=!0,e.blankOption.selected=!0,e.blankOption.textContent=L.ag.chooseCategoryText,e.categorySelect.appendChild(e.blankOption),En){var o=document.createElement("option");o.value=n,o.innerText=En[n],e.categorySelect.appendChild(o)}e.categoryRequiredMsg.style.display="none",e.categoryRequiredMsg.style.color="#EA3323";var a=document.createElement("span");a.textContent=L.ag.reportAbuseCategoryRequired,a.style.fontSize="14px",e.categoryRequiredMsg.appendChild(a),t.appendChild(e.categoryRequiredMsg);var l=document.createElement("p");l.style.fontWeight="bold",l.style.margin="0.5em 0px 0.2em",l.innerText=L.ag.reportAbuseAdditionalComments,t.appendChild(l),e.textBox.draggable=!1,e.textBox.maxLength=2048,e.textBox.style.boxSizing="border-box",e.textBox.style.width="100%",e.textBox.style.fontSize="16px",e.textBox.style.padding="3px",e.textBox.style.border="1px solid #A4A4A4",e.textBox.style.height="55px",e.textBox.style.fontFamily="UbuntuRegular, Arial, Helvetica, sans-serif",(0,Se.q)(e.textBox,!0),t.appendChild(e.textBox),e.commentsRequiredMsg.style.color="#EA3323",e.commentsRequiredMsg.style.display="none";var c=document.createElement("span");c.textContent=L.ag.reportAbuseDescriptionRequired,c.style.fontSize="14px",e.commentsRequiredMsg.appendChild(c),t.appendChild(e.commentsRequiredMsg);var u=document.createElement("div");u.style.paddingTop="10px";var d=document.createElement("a");d.textContent=L.ag.reportCAPS,d.style.cssFloat="right",d.style.display="block",d.style.width="auto",d.style.padding="6px 16px",d.style.fontSize="16px",d.style.color="#FFF",d.style.backgroundColor="#EA3323",u.appendChild(d),d.onclick=function(t){e.sendReport()};var h=document.createElement("a");h.textContent=L.ag.cancelText,h.style.cssFloat="right",h.style.display="block",h.style.width="auto",h.style.padding="6px 16px",h.style.fontSize="16px",h.style.color="#1C6B92",h.style.marginRight="8px",u.appendChild(h),h.onclick=function(t){e.closeEvent.fire(!0)},t.appendChild(u);var f=document.createElement("div");f.style.clear="both",t.appendChild(f);var p=document.createElement("div");p.style.fontSize="12px",p.style.marginTop="20px",p.innerText="".concat(L.ag.reportAbuseTextTerms," ");var m=document.createElement("a");return m.href=(0,g.BN)("/terms/#room-reports"),m.innerText="Terms",p.appendChild(m),t.appendChild(p),e.submittedMsg.style.display="none",e.submittedMsg.style.height="80px",e.submittedMsg.style.lineHeight="80px",e.submittedMsg.style.textAlign="center",e.submittedMsg.style.fontWeight="bold",e.submittedMsg.innerText=L.ag.commentSubmittedMessage,e.element.appendChild(e.submittedMsg),S.kN.listen((function(t){e.room=t.dossier.room})),e.categorySelect.onchange=function(){e.categoryRequiredMsg.style.display="none",e.commentsRequiredMsg.style.display="none"},e.textBox.onchange=function(){""!==e.textBox.value&&(e.commentsRequiredMsg.style.display="none")},e.element.onclick=function(e){e.stopPropagation()},e}return(0,o.Z)(s,[{key:"sendReport",value:function(){var e=this;""!==this.categorySelect.value?"other"!==this.categorySelect.value||!1!==/[a-z]{2}/i.test(this.textBox.value)?(0,g.I5)("abuse/report/".concat(this.room,"/"),{category:this.categorySelect.value,additional_comments:this.textBox.value}).then((function(t){e.formContainer.style.display="none",e.commentsRequiredMsg.style.display="none",e.showSubmitted(L.ag.commentSubmittedMessage),e.reportAbuseForm.reset(),e.delayClose(1e4)})).catch((function(t){e.formContainer.style.display="none",e.showSubmitted(t.xhr.responseText),e.delayClose(1e4)})):this.commentsRequiredMsg.style.display="block":this.categoryRequiredMsg.style.display="block"}},{key:"reset",value:function(){this.formContainer.style.display="block",this.commentsRequiredMsg.style.display="none",this.submittedMsg.style.display="none",this.categorySelect.value="",this.blankOption.setAttribute("selected","selected"),this.reportAbuseForm.reset()}},{key:"showSubmitted",value:function(e){this.submittedMsg.innerText=e,this.submittedMsg.style.display="block"}},{key:"delayClose",value:function(e){var t=this;clearTimeout(this.hideTimeout),this.hideTimeout=window.setTimeout((function(){clearTimeout(t.hideTimeout),t.closeEvent.fire(!0)}),e)}}]),s}(I.w),On=n(9760),Ln=n(6608);function Dn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,c.Z)(e);if(t){var o=(0,c.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,l.Z)(this,n)}}var Un=function(e){(0,a.Z)(n,e);var t=Dn(n);function n(){var e;return(0,i.Z)(this,n),(e=t.call(this)).enabled=!1,e.commentTriggerEvent=new P.xB("satisfactionCommentShow"),e.hideCommentEvent=new P.xB("satisfactionCommentHide"),e.label=document.createElement("span"),e.satisfiedText=L.ag.satisfiedText,e.hideSatisfiedText=!1,e.element.style.height="",e.element.style.width="",e.element.style.position="static",e.element.style.display="block",e.element.style.cursor="pointer",e.innerDiv.style.backgroundColor="",e.innerDiv.style.textShadow="",e.innerDiv.style.color="#6C6C78",e.innerDiv.style.textDecoration="none",e.element.onclick=function(){e.divClicked()},e.percent.style.fontWeight="bold",(0,J.vP)(e.label,"satisfactionLabel"),e.label.textContent=e.satisfiedText,e.label.style.margin="0",e.label.style.verticalAlign="top",e.label.style.display="none",e.innerDiv.prepend(e.label),(0,On.os)(620).listen((function(t){e.hideSatisfiedText=t,e.label.textContent=e.getSatisfiedLabelText()})),e.thumbsUp.style.marginRight="20px",e.thumbsUpActive.style.marginRight="20px",e.thumbsDown.style.marginLeft="20px",e.thumbsDownActive.style.marginLeft="20px",e.disableVoting(),e}return(0,o.Z)(n,[{key:"onVoteError",value:function(){(0,s.Z)((0,c.Z)(n.prototype),"onVoteError",this).call(this),this.hideCommentEvent.fire(void 0),(0,v.Cj)(L.ag.errorVotingForUser(this.roomName))}},{key:"styleThumb",value:function(e,t){(0,s.Z)((0,c.Z)(n.prototype),"styleThumb",this).call(this,e,t),e.height=18,e.width=18,e.style.height="18px",e.style.width="18px"}},{key:"enableVoteMsg",value:function(){return L.ag.afterTipVoteSatMobileText(this.roomName,Ln.Y)}},{key:"triggerComment",value:function(e){this.commentTriggerEvent.fire(e)}},{key:"stopProp",value:function(e){this.enabled&&e.stopPropagation()}},{key:"enableVoting",value:function(){this.element.style.color="#333333",this.label.style.color="#0471A1",this.enabled=!0,(0,s.Z)((0,c.Z)(n.prototype),"enableVoting",this).call(this)}},{key:"disableVoting",value:function(){this.element.style.color="#6C6C78",this.label.style.color="",this.enabled=!1,(0,s.Z)((0,c.Z)(n.prototype),"disableVoting",this).call(this)}},{key:"divClicked",value:function(){this.enabled||(0,v.Cj)(L.ag.allowToVoteMessage(this.roomName,Ln.Y))}},{key:"setVoteState",value:function(e,t){(0,s.Z)((0,c.Z)(n.prototype),"setVoteState",this).call(this,e,t),t?(this.element.style.pointerEvents="none",this.element.style.opacity="0.7"):(this.element.style.pointerEvents="",this.element.style.opacity="1")}},{key:"getSatisfiedLabelText",value:function(e){return void 0!==e&&e.dossier.hideSatisfactionScore&&void 0!==e.dossier.staffInfo?this.hideSatisfiedText?"":L.ag.hiddenStaffOnlyTextCAPS:this.hideSatisfiedText?"":L.ag.satisfiedText}}]),n}(Ln.v),Zn=function(e){(0,a.Z)(n,e);var t=Dn(n);function n(){var e;(0,i.Z)(this,n),(e=t.call(this)).hideEvent=new P.xB("satisfactionCommentHide"),e.message=document.createElement("div"),e.commentSection=document.createElement("div"),e.label=document.createElement("p"),e.textBox=document.createElement("textarea"),e.textLimit=document.createElement("span"),e.buttonBar=document.createElement("div"),e.submittedMsg=document.createElement("p"),e.roomName="",e.submitted=!1,(0,G.Zs)(e.element,{display:"none",position:"static",color:"#6C6C78",fontSize:"14px",height:"calc(100% - 45px)",padding:"19px",boxSizing:"border-box"}),e.element.onclick=function(e){e.stopPropagation()},(0,Se.q)(e.element),e.message.style.fontSize="14px",e.element.appendChild(e.message),e.label.style.fontWeight="bold",e.label.style.margin="0.5em 0px 0.2em",e.label.style.display="none",e.label.innerText=L.ag.optionalCommentNote,e.textBox.maxLength=155,e.textBox.style.boxSizing="border-box",e.textBox.style.width="100%",e.textBox.style.fontSize="16px",e.textBox.style.padding="3px",e.textBox.style.border="1px solid #A4A4A4",e.textBox.style.height="55px",e.textBox.style.display="none",e.textBox.style.fontFamily="UbuntuRegular, Arial, Helvetica, sans-serif",e.textBox.value="",e.textLimit.style.display="none",e.textLimit.style.float="right",e.updateTextLimit(),e.textBox.oninput=function(){e.updateTextLimit()},e.buttonBar.style.paddingTop="25px",e.buttonBar.style.display="none";var o=document.createElement("a");o.textContent=L.ag.submitCAPS,o.style.cssFloat="right",o.style.display="block",o.style.width="auto",o.style.padding="6px 16px",o.style.fontSize="16px",o.style.color="#FFF",o.style.backgroundColor="#FF7002",o.onclick=function(){e.submitComment(e.textBox.value)},e.buttonBar.appendChild(o);var r=document.createElement("a");return r.textContent=L.ag.cancelText,r.style.cssFloat="right",r.style.display="block",r.style.width="auto",r.style.padding="6px 12px",r.style.fontSize="16px",r.style.color="#1C6B92",r.style.marginRight="8px",r.onclick=function(){e.reset(),e.hide()},e.buttonBar.appendChild(r),e.submittedMsg.textContent=L.ag.commentSubmittedMessage,e.submittedMsg.style.display="none",e.submittedMsg.style.height="80px",e.submittedMsg.style.lineHeight="80px",e.submittedMsg.style.textAlign="center",e.submittedMsg.style.fontWeight="bold",e.commentSection.appendChild(e.label),e.commentSection.appendChild(e.textBox),e.commentSection.appendChild(e.textLimit),e.commentSection.appendChild(e.buttonBar),e.commentSection.appendChild(e.submittedMsg),e.element.appendChild(e.commentSection),S.kN.listen((function(t){e.setRoom(t.dossier.room)})),e}return(0,o.Z)(n,[{key:"setRoom",value:function(e){this.roomName=e,this.message.innerText=L.ag.confidentalVoteMessage(e)}},{key:"show",value:function(){this.element.style.display="block",null!==this.textBox.parentNode&&this.textBox.focus(),this.submitted&&this.delayHide(5e3)}},{key:"reset",value:function(){this.submitted=!1,this.textBox.value="",this.updateTextLimit(),this.submittedMsg.style.display="none",this.label.style.display="block",this.textBox.style.display="block",this.textLimit.style.display="block",this.buttonBar.style.display="block"}},{key:"updateTextLimit",value:function(){this.textLimit.innerText="".concat(this.textBox.value.length,"/").concat(this.textBox.maxLength)}},{key:"submitComment",value:function(e){var t=this;this.label.style.display="none",this.textBox.style.display="none",this.textLimit.style.display="none",this.buttonBar.style.display="none",this.submittedMsg.textContent=L.ag.submittingText,this.submittedMsg.style.display="block",this.submitted=!0,(0,g.I5)("tipping/add_comment/".concat(this.roomName,"/"),{comment:e}).then((function(){t.submittedMsg.textContent=L.ag.commentSubmittedMessage,t.delayHide(5e3)})).catch((function(e){error("Error rating model",e),t.submittedMsg.textContent=L.ag.errorSubmitting,t.delayHide(5e3)}))}},{key:"delayHide",value:function(e){var t=this;clearTimeout(this.hideTimeout),this.hideTimeout=window.setTimeout((function(){t.hide()}),e)}},{key:"hide",value:function(){clearTimeout(this.hideTimeout),this.element.style.display="none",this.hideEvent.fire(void 0),this.reset()}}]),n}(I.w);function Fn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,c.Z)(e);if(t){var o=(0,c.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,l.Z)(this,n)}}var _n=function(e){(0,a.Z)(n,e);var t=Fn(n);function n(e){(0,i.Z)(this,n);var o={tabName:"roomMenu",tabLabel:"•••",pageActionName:"RoomTabOpened",player:e};return t.call(this,o)}return(0,o.Z)(n,[{key:"initUI",value:function(e){(0,s.Z)((0,c.Z)(n.prototype),"initUI",this).call(this,e),(0,G.Zs)(this.element,{position:"relative"}),this.roomMenu=this.addChild(new Nn({player:e.player}))}},{key:"getRoomMenu",value:function(){return this.roomMenu}}]),n}(Be),Nn=function(e){(0,a.Z)(n,e);var t=Fn(n);function n(e){return(0,i.Z)(this,n),t.call(this,"div",e)}return(0,o.Z)(n,[{key:"initData",value:function(e){this.room="",this.userList=new W.Z,this.satisfactionComment=new Zn,this.satisfactionCommentMenuComponent=new tn.M((0,pe._U)(),this.satisfactionComment,!0),this.reportAbuse=new Bn,this.reportAbuseMenuComponent=new tn.M((0,pe._U)(),this.reportAbuse,!0),this.chatSettingsComponent=new In,this.manageIgnoredUsers=new An}},{key:"initUI",value:function(){var e=this;this.element=(0,_.vz)("div",{style:{width:"100%",height:"100%"}},this.createSendDmMenuItem(),this.createUserListMenuItem(),this.createSatisfactionScoreMenuItem(),this.createReportAbuseMenuItem(),this.createChatSettingsMenuItem(),this.createManageIgnoredUsersMenuItem()),(0,Se.q)(this.element),this.element.style["-webkit-overflow-scrolling"]="",this.chatSettingsComponent.chatSettings.showManageIgnoredUsers.listen((function(){e.manageIgnoredUsers.show()})),S.kN.listen((function(t){e.room=t.dossier.room,e.sendDmLabel.update({text:L.ag.sendDmToUser(e.room)})})),S.QN.listen((function(){var t;null===(t=e.activeMenuComponent)||void 0===t||t.hide(),e.satisfactionComment.hideElement(),e.satisfactionComment.reset(),e.reportAbuse.reset()})),Ie.qF.listen((function(t){"roomMenu"!==t&&e.closeActiveComponent()}))}},{key:"getUserList",value:function(){return this.userList}},{key:"getReportAbuseForm",value:function(){return this.reportAbuse}},{key:"getReportAbuse",value:function(){return this.reportAbuseMenuComponent}},{key:"getChatSettings",value:function(){return this.chatSettingsComponent}},{key:"openMenuComponent",value:function(e){this.closeActiveComponent(),this.activeMenuComponent=e,e.show()}},{key:"openMenuComponentByName",value:function(e){0===e?this.openMenuComponent(this.userList):3===e?this.openMenuComponent(this.chatSettingsComponent):2===e?this.openMenuComponent(this.reportAbuseMenuComponent):1===e&&this.openMenuComponent(this.satisfactionCommentMenuComponent)}},{key:"closeMenuComponent",value:function(e){e===this.chatSettingsComponent&&this.manageIgnoredUsers.hide(),this.activeMenuComponent=void 0,e.hide()}},{key:"closeActiveComponent",value:function(){void 0!==this.activeMenuComponent&&this.closeMenuComponent(this.activeMenuComponent)}},{key:"createSendDmMenuItem",value:function(){var e=this,t=document.createElement("div"),n=gn.d.get("MenuLabel");return this.sendDmLabel=new n({text:L.ag.sendDmToUser(this.room),style:{whiteSpace:"nowrap"},onClick:function(){(0,w.Cg)(L.ag.loggedInToDm)||(Ie.ah.fire(!0),Oe.nh.fire(e.room))}},t),t}},{key:"createUserListMenuItem",value:function(){var e=this,t=document.createElement("div"),n=new(gn.d.get("MenuLabel"))({text:L.ag.usersText,onClick:function(){(0,R.fg)("UserlistOpened"),e.openMenuComponent(e.userList)},showChevron:!0},t);return W.A.listen((function(e){n.update({text:"".concat(L.ag.usersText," (").concat(e,")")})})),(0,_.vz)("div",null,t,this.userList.element)}},{key:"createSatisfactionScoreMenuItem",value:function(){var e=this,t=document.createElement("div");(0,J.vP)(t,"MenuLabel-container");var n=document.createElement("div");new(gn.d.get("MenuLabel"))({text:L.ag.satisfiedText,style:{borderBottom:"none",paddingLeft:"0"}},n);var i=new Un;return i.commentTriggerEvent.listen((function(t){t&&e.satisfactionComment.reset(),e.satisfactionComment.showElement(),e.openMenuComponent(e.satisfactionCommentMenuComponent)})),i.hideCommentEvent.listen((function(){e.closeMenuComponent(e.satisfactionCommentMenuComponent)})),this.satisfactionComment.hideEvent.listen((function(){e.closeMenuComponent(e.satisfactionCommentMenuComponent)})),t.appendChild(n),t.appendChild(i.element),(0,_.vz)("div",null,t,this.satisfactionCommentMenuComponent.element)}},{key:"createReportAbuseMenuItem",value:function(){var e=this,t=document.createElement("div");return new(gn.d.get("MenuLabel"))({text:L.ag.reportAbuseText,style:{color:"#C41721"},onClick:function(){e.openMenuComponent(e.reportAbuseMenuComponent)},showChevron:!0},t),this.reportAbuse.closeEvent.listen((function(t){t&&e.reportAbuse.reset(),e.closeMenuComponent(e.reportAbuseMenuComponent)})),(0,_.vz)("div",null,t,this.reportAbuseMenuComponent.element)}},{key:"createChatSettingsMenuItem",value:function(){var e=this,t=document.createElement("div");return new(gn.d.get("MenuLabel"))({text:L.ag.chatSettings,onClick:function(){(0,R.fg)("SettingsOpened"),e.openMenuComponent(e.chatSettingsComponent)},showChevron:!0},t),(0,_.vz)("div",null,t,this.chatSettingsComponent.element)}},{key:"createManageIgnoredUsersMenuItem",value:function(){return(0,_.vz)("div",null,this.manageIgnoredUsers.element)}}]),n}(I.w),jn=n(795),Hn=n(2425),zn=n(5937);var Wn=function(e){(0,a.Z)(u,e);var t,n,r=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,i.Z)(this,u),r.call(this,{tabName:"tokens",tabLabel:(0,zn.bA)()?L.ag.tippingLabel:L.ag.tokensCC,pageActionName:"TipTabOpened"})}return(0,o.Z)(u,[{key:"initUI",value:function(){var e=this;(0,s.Z)((0,c.Z)(u.prototype),"initUI",this).call(this),(0,J.vP)(this.element,"TokensTab"),(0,G.Zs)(this.element,{position:"relative",display:"flex",flexDirection:"column"}),this.appPanel=new Hn.C5,this.privateShowButton=new an.lC,this.fanclubButton=new an.ZF,this.supporterButton=new an.u5,this.tokenBalanceText=(0,_.vz)("span",{colorClass:"tokenBalance"}),this.tipButtonText=(0,_.vz)("span",null,L.ag.tipUser("")),this.element.appendChild((0,_.vz)(_.HY,null,(0,_.vz)(Vn,{appPanel:this.appPanel,privateShowButton:this.privateShowButton,fanclubButton:this.fanclubButton,supporterButton:this.supporterButton}),(0,_.vz)(Kn,{tokenBalanceText:this.tokenBalanceText,tipButtonText:this.tipButtonText}))),S.kN.listen((function(t){e.updateTokenBalance(t.dossier.tokenBalance),e.tipButtonText.innerText=L.ag.tipUser(t.dossier.room),t.chatConnection.event.statusChange.listen((function(t){var n=f.J.current.PurchaseEventSources.TOKEN_SOURCE_MOBILE_TOKENS_TAB_TOKEN_BAR,i=e.element.querySelector("#tokenPurchaseLink");"privatewatching"===t.currentStatus?i.onclick=function(){return(0,jn.Hi)({source:n,roomType:"private"})}:i.onclick=function(){return(0,jn.Hi)({source:n,roomType:"public"})}})),e.repositionChildren()})),this.appPanel.panelUpdated.listen((function(){e.appPanel.hasContent?e.appPanel.showElement():e.appPanel.hideElement()})),d.A3.listen((function(t){e.updateTokenBalance(t.tokens)}))}},{key:"updateTokenBalance",value:function(e){this.tokenBalanceText.innerText="".concat(e.toLocaleString()," ").concat(L.ag.tokenOrTokensText(e,!1))}},{key:"repositionChildren",value:function(){(0,G.Zs)(this.fanclubButton.element,{marginRight:this.supporterButton.isShown()?"10px":""})}}]),u}(Be),Vn=function(e){(0,G.Zs)(e.appPanel.element,{padding:"16px 0 0"});var t=(0,_.vz)("div",{style:{flex:1,overflowY:"scroll"}},(0,_.vz)("div",{style:{width:"100%",display:"flex",justifyContent:"center",position:"relative"}},e.appPanel.element),(0,_.vz)(qn,{privateShowButton:e.privateShowButton,fanclubButton:e.fanclubButton,supporterButton:e.supporterButton}));return(0,Se.q)(t),t},qn=function(e){return(0,_.vz)("div",{style:{padding:"16px",fontSize:"14px",width:"100%",boxSizing:"border-box"}},e.privateShowButton.element,(0,_.vz)("div",{style:{display:"flex"}},e.fanclubButton.element,e.supporterButton.element))},Kn=function(e){var t=f.J.current.PurchaseEventSources.TOKEN_SOURCE_MOBILE_TOKENS_TAB_TOKEN_BAR;return(0,_.vz)("div",{style:{width:"100%",borderTop:"1px solid #EFEFEF",padding:"16px 18px 12px 18px",display:"flex",flexDirection:"column",boxSizing:"border-box",fontSize:"14px"}},(0,_.vz)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"12px"}},(0,_.vz)("div",{style:{fontFamily:"UbuntuBold, Helvetica, Arial, sans-serif"}},(0,_.vz)("span",{colorClass:"youHave"},"".concat(L.ag.tokensLabel," ")),e.tokenBalanceText),(0,_.vz)("a",{id:"tokenPurchaseLink",onClick:function(){return function(){return(0,jn.Hi)({source:t,roomType:"public"})}}},L.ag.buyMoreTokens)),new an.Ug({tipButtonText:e.tipButtonText}).element)},Jn=function(){function e(t){(0,i.Z)(this,e),this.player=t,this.chatTab=new Pt,(0,xe.$_)()?this.privateTab=new vn:this.pmTab=new sn,this.tokensTab=new Wn,this.bioTab=new $e,this.moreRoomsTab=new on(this.player),this.roomMenuTab=new _n(this.player),this.tabList=[this.chatTab].concat((0,Ee.Z)(void 0!==this.privateTab?[this.privateTab]:[]),(0,Ee.Z)(void 0!==this.pmTab?[this.pmTab]:[]),[this.tokensTab,this.bioTab,this.moreRoomsTab,this.roomMenuTab])}return(0,o.Z)(e,[{key:"getList",value:function(){return this.tabList}},{key:"length",value:function(){return this.tabList.length}},{key:"getTabByIndex",value:function(e){if(!(e<0||e>=this.length()))return this.tabList[e]}},{key:"getIndexByTabName",value:function(e){var t=this.tabList.findIndex((function(t){return t.getTabName()===e}));return t>-1?t:void 0}},{key:"getChatTab",value:function(){return this.chatTab}},{key:"getPrivateTab",value:function(){return this.privateTab}},{key:"getPmTab",value:function(){return this.pmTab}},{key:"getTokensTab",value:function(){return this.tokensTab}},{key:"getBioTab",value:function(){return this.bioTab}},{key:"getMoreRoomsTab",value:function(){return this.moreRoomsTab}},{key:"getRoomMenuTab",value:function(){return this.roomMenuTab}}]),e}(),Gn=n(5004);var Yn=function(e){(0,a.Z)(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function s(e){return(0,i.Z)(this,s),r.call(this,"div",e)}return(0,o.Z)(s,[{key:"initData",value:function(e){this.player=e.player,this.mobileDismissibleMessages=e.mobileDismissibleMessages,this.tabList=new Jn(this.player),this.userPanel=new Gn.i}},{key:"initUI",value:function(){var e=this,t={width:"100%",height:"100%",top:"".concat((0,pe._U)()*ce.$V,"px"),position:"absolute",boxSizing:"border-box"};this.element=(0,_.vz)("div",{style:t}),this.header=new Re({tabList:this.tabList}),this.addChild(this.header),this.roomTabs=new Pe({tabList:this.tabList}),this.addChild(this.roomTabs),this.player.didRepositionEvent.listen((function(){e.repositionChildrenRecursive()})),this.initListenersForUserPanel()}},{key:"initListenersForUserPanel",value:function(){var e=this;Ie.tB.listen((function(t){e.closeUserPanel(),e.openUserPanel(t)})),this.userPanel.overlayClick.listen((function(){e.closeUserPanel()})),Ie.U9.listen((function(){e.closeUserPanel()})),Ie.qF.listen((function(){e.closeUserPanel()}))}},{key:"openUserPanel",value:function(e){this.userPanel.updateContents(e.username,e.message);var t=e.attachTo;null!==t.parentElement?(t.parentElement.insertBefore(this.userPanel.overlay,t.nextSibling),t.parentElement.insertBefore(this.userPanel.element,t.nextSibling)):error("Error inserting userPanel.overlay or userPanel.div: panelRequest.attachTo.parentElement is null"),this.scrollMessageList(e),this.userPanel.showOverlay()}},{key:"closeUserPanel",value:function(){this.userPanel.hideOverlay(),null!==this.userPanel.element.parentElement&&this.userPanel.element.parentElement.removeChild(this.userPanel.element)}},{key:"scrollMessageList",value:function(e){var t,n=this.tabList.getChatTab().getChatWindow().chatContents.messageListWrapper,i=null===(t=this.tabList.getPmTab())||void 0===t||null===(t=t.getPmWindow().currentlyDisplayedPmSession())||void 0===t?void 0:t.chatContents.messageListWrapper,o="chat"===Pe.currentTab?n:i,r=e.attachTo.parentElement;if(null!==r&&void 0!==o){var s=r.offsetTop+r.offsetHeight-(o.offsetHeight+o.scrollTop);s>0&&(o.scrollTop+=s)}}},{key:"getChatContents",value:function(){return this.tabList.getChatTab().getChatContents()}},{key:"repositionChildren",value:function(){var e;!(0,me.gr)()||this.player.isFullscreen?this.hideElement():(this.player.isFullscreen||(this.showElement(),null===(e=this.player.videoControls.mobilePureChat)||void 0===e||e.setVisible(!1)),this.repositionContainer(),this.repositionRoomTabs())}},{key:"repositionContainer",value:function(){var e,t,n=null!==(e=null===(t=document.getElementById("static-header"))||void 0===t?void 0:t.offsetHeight)&&void 0!==e?e:40,i=this.player.element.offsetHeight,o=this.mobileDismissibleMessages.element.offsetHeight,r=(0,pe.RK)().height-n-i-o;this.element.style.height="".concat(r,"px"),this.element.style.top="".concat(i,"px")}},{key:"repositionRoomTabs",value:function(){var e=this.header.element.offsetHeight;this.roomTabs.element.style.height="calc(100% - ".concat(e,"px)")}}]),s}(I.w);function $n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Qn(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=new Array(t);n-1,a.element.style.display="none",a.element.style.overflow="visible",a.element.style.zIndex="1003",a.element.style.backgroundColor="rgba(0, 0, 0, 0.7)",a.element.style.height=a.isSamsungBrowser?"100%":"calc(100% - ".concat(a.player.element.offsetHeight,"px)"),a.element.style.bottom="0",a.element.style.alignItems="center",a.element.style.justifyContent="center",a.element.dataset.testid="send-tip-callout",a.overlay=document.createElement("div"),a.overlay.style.position="fixed",a.overlay.style.top="0",a.overlay.style.left="0",a.overlay.style.right="0",a.overlay.style.bottom="0",a.overlay.onclick=function(){a.tipSent.fire({})},a.element.appendChild(a.overlay);var l=document.createElement("div");a.element.appendChild(l),a.closeWindowDiv=document.createElement("div"),a.closeWindowDiv.innerText="".concat(L.ag.closeWindow," (").concat(L.ag.cancelLower,")"),a.closeWindowDiv.style.color="#ffffff",a.closeWindowDiv.style.fontSize="14px",a.closeWindowDiv.style.fontWeight="bold",a.closeWindowDiv.style.textDecoration="underline",a.closeWindowDiv.style.position="relative",a.closeWindowDiv.style.paddingBottom="6px",a.closeWindowDiv.style.cursor="pointer",a.closeWindowDiv.style.width="100%",a.closeWindowDiv.style.textAlign="right",a.closeWindowDiv.style.cursor="pointer",a.closeWindowDiv.dataset.testid="close-tip",a.closeWindowDiv.onclick=function(){a.tipSent.fire({})},l.appendChild(a.closeWindowDiv),a.content=document.createElement("div"),a.content.style.position="relative",a.content.style.overflow="visible",a.content.style.backgroundColor="#ffffff",a.content.style.height="auto",a.content.style.borderRadius="6px",a.content.style.border="1px solid #000000",(0,m.j9)("click",a.content,(function(e){e.stopPropagation()}));var c=document.createElement("div"),u=document.createElement("span");u.innerText=L.ag.currentBalanceText,u.style.display="inline-block",u.style.fontSize="13px",u.style.padding="6px",c.appendChild(u),a.tokenBalanceSpan=document.createElement("span"),a.tokenBalanceSpan.style.display="inline-block",a.tokenBalanceSpan.style.color="#53843a",a.tokenBalanceSpan.style.fontSize="13px",a.tokenBalanceSpan.style.padding="6px 6px 6px 0",a.tokenBalanceSpan.dataset.testid="token-balance",c.appendChild(a.tokenBalanceSpan);var p=document.createElement("a");p.innerText=L.ag.purchaseTokensText,p.style.display="inline-block",p.style.color="#f47321",p.style.fontSize="13px",p.style.marginLeft="12px",p.style.padding="6px",p.dataset.testid="purchase-tokens",p.onclick=function(){var e=f.J.current.PurchaseEventSources.TOKEN_SOURCE_TIP_CALLOUT;(0,jn.Hi)({source:e,roomType:a.roomType}),a.tipSent.fire({})},c.appendChild(p),a.content.appendChild(c),a.lowScoreWarning=document.createElement("div"),a.lowScoreWarning.style.display="none",a.lowScoreWarning.style.color="#ff0000",a.lowScoreWarning.style.fontSize="13px",a.lowScoreWarning.style.fontWeight="bold",a.lowScoreWarning.style.padding="6px",a.lowScoreWarning.style.textAlign="center";var v=document.createElement("div");v.innerText=L.ag.satisfactionWarningText,a.lowScoreWarning.appendChild(v);var g=document.createElement("div");g.innerText=L.ag.tipWarningText,a.lowScoreWarning.appendChild(g),a.content.appendChild(a.lowScoreWarning),a.sendTipForm=document.createElement("form");var y=document.createElement("div");(0,G.Zs)(y,{display:"flex",alignItems:"center",marginTop:"12px",marginBottom:"6px"});var b=document.createElement("span");b.innerText=L.ag.tipAmountText,b.style.display="inline-block",b.style.fontSize="13px",b.style.padding="6px",y.appendChild(b),a.tipAmountInput=document.createElement("input"),a.tipAmountInput.type=a.useDifferentKeyboard?"number":"tel",a.tipAmountInput.autocomplete="off",a.tipAmountInput.value="25",a.useDifferentKeyboard||(a.tipAmountInput.min="1"),a.tipAmountInput.style.width="0",a.tipAmountInput.style.flex="1",a.tipAmountInput.style.maxWidth="6em",a.tipAmountInput.style.minWidth="2em",a.tipAmountInput.style.display="inline-block",a.tipAmountInput.style.fontSize="16px",a.tipAmountInput.style.padding="4px",a.tipAmountInput.style.border="1px solid #4b4c4b",a.tipAmountInput.style.borderRadius="4px",a.tipAmountInput.style.fontFamily="UbuntuRegular, Helvetica, Arial, sans-serif",a.tipAmountInput.classList.add("tipAmountInput"),a.tipAmountInput.dataset.testid="tip-amount-input",a.tipAmountInput.onclick=function(){a.tipAmountInput.setSelectionRange(0,a.tipAmountInput.value.length)},a.tipAmountInput.onmouseup=function(e){e.preventDefault()},a.tipAmountInput.onfocus=function(){a.useDifferentKeyboard?a.tipAmountInput.select():a.tipAmountInput.setSelectionRange(0,a.tipAmountInput.value.length)},a.tipAmountInput.onblur=function(){""===a.tipAmountInput.value&&(a.tipAmountInput.value="0")},a.tipAmountInput.oninput=function(){a.cleanTipAmountValue(),a.tipAmountChange()},a.tipAmountInput.onkeydown=function(e){e.metaKey||"Unidentified"===e.key||"Backspace"===e.key||"Enter"===e.key||"0123456789".includes(e.key)||e.preventDefault()},a.tipAmountInput.onpaste=function(){window.setTimeout((function(){a.cleanTipAmountValue()}),0)},y.appendChild(a.tipAmountInput),a.invalidTipAmountSpan=document.createElement("span"),a.invalidTipAmountSpan.innerText=L.ag.tipAmountInvalid,a.invalidTipAmountSpan.style.fontSize="12px",a.invalidTipAmountSpan.style.color="#ff0000",a.invalidTipAmountSpan.style.display="none",a.invalidTipAmountSpan.style.marginLeft="5px",a.invalidTipAmountSpan.style.marginRight="5px",a.invalidTipAmountSpan.dataset.testid="invalid-tip",y.appendChild(a.invalidTipAmountSpan),a.sendTipForm.appendChild(y),a.tipMessageLabel=document.createElement("div"),a.tipMessageLabel.innerText=L.ag.defaultTipMessageLabel,a.tipMessageLabel.style.fontSize="13px",a.tipMessageLabel.style.padding="6px 6px 0 6px",a.sendTipForm.appendChild(a.tipMessageLabel),a.tipMessageDiv=document.createElement("div"),a.tipMessageTextarea=document.createElement("textarea"),a.tipMessageTextarea.maxLength=255,a.tipMessageTextarea.style.width="100%",a.tipMessageTextarea.style.resize="none",a.tipMessageTextarea.style.fontSize="1em",a.tipMessageTextarea.style.fontFamily="UbuntuRegular, Helvetica, Arial, sans-serif",a.tipMessageTextarea.style.margin="".concat(d.Co,"px"),a.tipMessageTextarea.style.padding="4px",a.tipMessageTextarea.style.border="1px solid #4b4c4b",a.tipMessageTextarea.style.borderRadius="4px",a.tipMessageTextarea.style.boxSizing="border-box",a.tipMessageTextarea.classList.add("tipMessageTextarea"),a.tipMessageTextarea.dataset.testid="tip-message-textarea",a.tipMessageDiv.appendChild(a.tipMessageTextarea),a.sendTipForm.appendChild(a.tipMessageDiv);var w=document.createElement("div");return w.style.textAlign="right",w.style.position="relative",a.sendTipButton=new ei,a.sendTipButton.element.style.cssFloat="",a.addChild(a.sendTipButton,w),a.sendTipForm.appendChild(w),a.content.appendChild(a.sendTipForm),l.appendChild(a.content),a.closed.listen((function(){a.sendTipButton.hideMenu()})),null===(s=window.visualViewport)||void 0===s||s.addEventListener("resize",(function(){var e,t;a.visibleViewportHeight=null!==(e=null===(t=window.visualViewport)||void 0===t?void 0:t.height)&&void 0!==e?e:window.innerHeight,a.repositionChildren()})),S.kN.listen((function(e){a.hasLowSatisfactionScore=e.dossier.hasLowSatisfactionScore,a.roomName=e.chatConnection.room(),e.chatConnection.event.statusChange.listen((function(e){"privatewatching"===e.currentStatus?(a.roomType="private",p.onclick=function(){var e=f.J.current.PurchaseEventSources.TOKEN_SOURCE_TIP_CALLOUT;(0,jn.Hi)({source:e,roomType:"private"}),a.tipSent.fire({})}):(a.roomType="public",p.onclick=function(){var e=f.J.current.PurchaseEventSources.TOKEN_SOURCE_TIP_CALLOUT;(0,jn.Hi)({source:e,roomType:"public"}),a.tipSent.fire({})})}))})),a.repositionChildren(),(0,m.j9)("submit",a.sendTipForm,(function(e){e.preventDefault();var t=parseInt(a.tipAmountInput.value);if(!isNaN(t)&&a.sendTipButton.isEnabled()){if(a.useDifferentKeyboard&&a.tipAmountInput.blur(),(0,R.fg)("SendTipClicked",{amount:t}),t>100&&!a.isHighTipAmountWarningActive)return a.sendTipButton.promptUser(L.ag.tipConfirmationMessage(t)),a.isHighTipAmountWarningActive=!0,void a.repositionChildren();var n=a.tipMessageTextarea.value;void 0!==a.tipOptionsSelect&&(n=""===a.tipMessageTextarea.value?a.tipOptionsSelect.value:"".concat(a.tipOptionsSelect.value," | ").concat(a.tipMessageTextarea.value)),(0,d.d1)({roomName:a.roomName,tipAmount:a.tipAmountInput.value,message:n,source:a.tipSource,tipRoomType:a.roomType,tipType:a.sendTipButton.getTipType(),videoMode:"mobile"}).then((function(e){e.success?(0,R.fg)("SendTipSuccess",{amount:t}):void 0!==e.error?(0,jn.dg)("".concat(e.error),!1,f.J.current.PurchaseEventSources.TOKEN_SOURCE_LOW_TOKEN_BALANCE,a.roomType):error("unknown send tip error"),a.removeHighTipAmountWarning(),a.tipMessageTextarea.value="",void 0!==e.tipsInPast24Hours&&d.H2.fire({tokens:e.tipsInPast24Hours,roomName:a.roomName}),a.tipSent.fire({amount:t,success:e.success})})).catch((function(e){a.tipSent.fire({amount:t,success:!1}),error("Error sending tip (".concat(e,")"))})),a.hide()}})),a}return(0,o.Z)(h,[{key:"cleanTipAmountValue",value:function(){var e=this.tipAmountInput.value.replace(/[^0-9]+/g,"");this.tipAmountInput.value="",this.tipAmountInput.value=e}},{key:"repositionChildren",value:function(){(0,me.gr)()?((0,u.Tt)()?this.element.style.height="calc(100% - ".concat(this.player.element.offsetHeight,"px)"):this.isSamsungBrowser?this.element.style.height="100%":(this.element.style.height="".concat(this.visibleViewportHeight-40,"px"),this.element.style.top="0",this.element.style.bottom=""),this.content.style.width="".concat(Math.min(.9*(0,pe._U)(),500),"px"),this.tipMessageDiv.style.width="".concat(this.content.clientWidth-2*d.Co,"px")):this.hide()}},{key:"removeHighTipAmountWarning",value:function(){this.sendTipButton.cancelPrompt(),this.isHighTipAmountWarningActive=!1}},{key:"tipAmountChange",value:function(){/^[1-9]\d*$/.test(this.tipAmountInput.value)?(this.sendTipButton.enable(),this.invalidTipAmountSpan.style.display="none"):(this.sendTipButton.disable(),this.invalidTipAmountSpan.style.display="inline-block"),this.isHighTipAmountWarningActive&&this.removeHighTipAmountWarning()}},{key:"show",value:function(e){var t=this;void 0!==e.amount&&(this.tipAmountInput.value=e.amount.toString(),this.tipAmountChange()),void 0!==e.message?this.tipMessageTextarea.value=e.message:this.tipMessageTextarea.value="",this.hasLowSatisfactionScore?this.lowScoreWarning.style.display="block":this.lowScoreWarning.style.display="none",this.tokenBalanceSpan.innerText="".concat(L.ag.loadingTextLower,"..."),this.showElement(),this.tipAmountInput.focus(),(0,jn.rv)(this.tipSource,this.sendTipButton),(0,d.yX)(this.roomName).then((function(e){if(t.updateTokenBalance(e.tokenBalance),t.useDifferentKeyboard||(t.tipAmountInput.max=e.tokenBalance.toString()),void 0!==e.tipOptions){t.tipMessageLabel.innerText=e.tipOptions.label,void 0!==t.tipOptionsSelect&&t.tipMessageDiv.removeChild(t.tipOptionsSelect),t.tipOptionsSelect=document.createElement("select"),t.tipOptionsSelect.style.width="100%",t.tipOptionsSelect.style.fontSize="1em",t.tipOptionsSelect.style.margin="".concat(d.Co,"px"),t.tipOptionsSelect.style.border="1px solid #4b4c4b",t.tipOptionsSelect.style.boxSizing="border-box",t.tipMessageDiv.insertBefore(t.tipOptionsSelect,t.tipMessageTextarea);var n=document.createElement("option");n.innerText="-- ".concat(L.ag.selectOneLabel," --"),t.tipOptionsSelect.appendChild(n);var i,o=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ti(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)?ti(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(e.tipOptions.options);try{for(o.s();!(i=o.n()).done;){var r=i.value;(n=document.createElement("option")).innerText=r.label,n.value=r.label,t.tipOptionsSelect.appendChild(n)}}catch(e){o.e(e)}finally{o.f()}}else void 0!==t.tipOptionsSelect&&(t.tipMessageLabel.innerText=L.ag.defaultTipMessageLabel,t.tipMessageTextarea.value="",t.tipMessageDiv.removeChild(t.tipOptionsSelect),t.tipOptionsSelect=void 0);t.repositionChildren()})).catch((function(e){error("Error getting token balance (".concat(e,")")),t.tokenBalanceSpan.innerText=L.ag.unknownText}))}},{key:"showElement",value:function(){(0,s.Z)((0,c.Z)(h.prototype),"showElement",this).call(this,"flex")}},{key:"hide",value:function(){this.element.style.display="none",this.closed.fire(void 0)}},{key:"updateTokenBalance",value:function(e){this.tokenBalanceSpan.innerText="".concat(e," ").concat(L.ag.tokenOrTokensText(e,!1))}}]),h}(I.w);function ii(e,t){document.title="".concat(e," at Chaturbate: ").concat(t)}function oi(){var e=(0,u.sQ)();return 15===(null==e?void 0:e.major)&&0===e.minor&&(0,u.G6)()}function ri(){var e=document.querySelector(".push-overlay");return null!==e&&"none"!==e.style.display&&""!==e.style.display}var si=!1,ai=function(e){(0,a.Z)(F,e);var t,n,I=(t=F,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function F(e,t){var n;(0,i.Z)(this,F),(n=I.call(this)).audioHolder=new b.n,n.sessionMetrics=new Xn,n.listenerGroup=new P.mM,n.siteHeaderHeight=0,n.isFullscreen=!1,n.loading=Date.now(),n.currentRoom=e,document.body.style.overflow="hidden",n.mainContainer=document.getElementById("main"),n.initDismissibleMessages(),n.mainContainer.appendChild(n.element),(0,u.Tt)()&&(n.hideAddressBarInLandscape(1),document.body.style.overflow="auto"),(0,R.zB)(n.sessionMetrics.getCurrentMode()),n.siteHeader=document.querySelector("#static-header");var o=document.querySelector("#static-header .right-nav");n.pushMenuOverlay=document.querySelector(".push-overlay"),n.pushMenu=document.querySelector(".pushmenu"),n.siteHeaderHeight=n.siteHeader.offsetHeight,n.headerRoomInfo=new K,o.appendChild(n.headerRoomInfo.element),n.pushMenuContainer=document.querySelector("#pushmenu-container"),Ie.YL.listen((function(e){e&&(0,R.fg)("SiteMenuOpened")})),d.A3.listen((function(e){var t=document.getElementById("token-balance");null!=t&&(t.innerText="".concat(e.tokens," Tokens"))})),n.element.style.height="100%",n.element.style.width="100%",n.element.style.minHeight="100%",n.element.style.minWidth="100%",n.element.style.position="fixed",(0,E.ql)(n.element,"none"),(0,R.N$)(e),n.player=new we(t,(0,r.Z)(n),n.mobileDismissibleMessages),n.player.playerComponent instanceof M._O&&n.player.playerComponent.setPageLoaded(n.loading),n.prependChild(n.player),n.sessionMetrics.bindPlayer(n.player),n.portraitContents=n.addChild(new Yn({player:n.player,mobileDismissibleMessages:n.mobileDismissibleMessages})),n.player.videoControls.executeInitialFullscreenState(),n.player.videoControls.setPureChat(new Ce.H(n.portraitContents.getChatContents())),n.player.toggleFullscreen.listen((function(e){n.isFullscreen=e,n.repositionChildrenRecursive(),n.sessionMetrics.recordResize()}));var s=n.addChild(new ni("mobile",n.player));Ie.Fx.listen((function(e){f.J.current.isNoninteractiveUser?(0,v.Cj)(L.ag.internalStaffTip):(0,p.vj)()&&(n.player.isFullscreen||(0,me.P0)())?n.player.videoControls.showTipForm(e):(n.player.limitPortraitHeight(280),n.repositionChildrenRecursive(),s.show(e))})),s.tipSent.listen((function(e){s.hide(),!0===e.success&&"tokens"===Pe.currentTab&&Ie.qF.fire("chat")})),s.closed.listen((function(){n.player.limitPortraitHeight(0)})),n.sessionMetrics.bindTipCallout(s),n.loadRoom(e,!0),n.repositionChildrenRecursive(),n.afterDOMConstructedIncludingChildren();var a=new T.d((function(){n.repositionChildrenRecursive()}),{bounceLimitMS:20,debounceType:2});me.bs.listen((function(){(0,u.Tt)()&&((0,me.gr)()&&n.hideAddressBarInLandscape(1.1),window.scrollTo(0,n.mainContainer.scrollHeight)),a.callFunc(),n.player.centerPlayer(),window.setTimeout((function(){a.callFunc()}),500)}));var l=window.innerWidth;window.onresize=function(){document.documentElement.scrollTop<0&&(document.documentElement.scrollTop=0),a.callFunc();var e=window.innerWidth!==l;!e&&(0,u.Tt)()&&!e||(l=window.innerWidth,n.player.centerPlayer())};var c=function(){if(n.player.sendMessageInputFieldHasFocus&&(0,pe.F7)()>0){var e=(0,Z.hf)()-Z.Bw,t=oi(),i=t?e+50:e,o=t?-50:0;n.player.element.style.position="fixed",n.player.element.style.top="",n.player.element.style.bottom="".concat(i,"px"),n.player.element.style.zIndex="1",n.player.videoControls.hideElement(),n.portraitContents.element.style.top="".concat(o,"px"),n.portraitContents.element.style.height="".concat(n.element.offsetHeight,"px")}};if(window.onscroll=c,Ie.U9.listen((function(){n.player.setMessageInputFieldHasFocus(!0),c()})),Ie.Ey.listen((function(){n.player.setMessageInputFieldHasFocus(!1),n.player.element.style.position="absolute",n.player.element.style.top="0",n.player.element.style.bottom="",n.player.element.style.zIndex="",n.portraitContents.element.style.top="",n.player.videoControls.showElement(),n.portraitContents.repositionChildrenRecursive()})),document.documentElement.clientHeight>=window.outerHeight){var h=function e(){var t=document.createElement("input");t.style.fontSize="16px",document.body.appendChild(t),t.focus(),t.blur(),document.body.removeChild(t),(0,m.SC)("mousedown",n.element,e),(0,m.SC)("touchmove",n.element,e)};(0,m.j9)("mousedown",n.element,h),(0,m.j9)("touchmove",n.element,h)}return n.preventCertainTouchActions(),(0,m.j9)("popstate",window,(function(e){void 0!==e.state&&null!==e.state?n.loadRoom(e.state,!1):si&&!(0,u.v8)()&&history.back()})),(0,m.j9)("pageshow",window,(function(e){e.persisted&&n.currentChatConnection.room()!==n.currentRoom&&n.loadRoom(n.currentRoom,!1)})),Ie.WP.listen((function(e){n.loadRoom(e,!0)})),S.kN.listen((function(e){ii(e.dossier.room,e.dossier.roomTitle),n.repositionChildrenRecursive(),si||(si=!0),n.headerRoomInfo.updateContext(e.dossier.room,e.dossier.following,e.dossier.roomStatus),n.headerRoomInfo.updateViewerCount(e.dossier.numViewers),"offline"===e.dossier.roomStatus?Ie.qF.fire("bio"):Ie.qF.fire("chat"),n.sessionMetrics.playerDimensions()})),n.player.playerComponent.showControls(),k.C.fire("mobile"),n}return(0,o.Z)(F,[{key:"initDismissibleMessages",value:function(){var e=this;this.mobileDismissibleMessages=new X,this.mainContainer.appendChild(this.mobileDismissibleMessages.element),this.mobileDismissibleMessages.rerendered.listen((function(){e.repositionChildrenRecursive()}))}},{key:"hideAddressBarInLandscape",value:function(e){var t,n,i=e*(null!==(t=null===(n=window.visualViewport)||void 0===n?void 0:n.height)&&void 0!==t?t:window.innerHeight);this.mainContainer.style.height="".concat(i,"px")}},{key:"passwordPrompt",value:function(e){var t=this;if(!(0,w.Cg)(L.ag.loginForPasswordPrompt((0,B.t)(e)),!1,(function(){window.location.href=(0,g.BN)("/")}))){var n=prompt(L.ag.passwordRequiredForRoom(e));null!==n?(0,g.I5)("roomlogin/".concat(e,"/"),{password:n}).then((function(n){"success"===new y.j(n.responseText).getStringOrUndefined("result")?t.loadRoom(e,!1):(0,v.Cj)(L.ag.incorrectPassword,(function(){t.passwordPrompt(e)}))})).catch((function(t){error("Unable to login to room",{room:e,error:t}),window.location.reload()})):window.location.reload()}}},{key:"loadRoom",value:function(e,t){var n=this;(si||!0===f.J.current.isLoadedFromCache?(0,A.ss)(e):(0,A.vZ)(e,window.initialRoomDossier)).then((function(i){var o,r;x.y.fire(i),void 0!==n.cleanupLastRoomCallback&&n.cleanupLastRoomCallback(),(0,R.N$)(e),f.q.setState(i),n.currentChatConnection=new C.E(i,!0),n.sessionMetrics.bindChatConnection(n.currentChatConnection),ii(i.room,i.roomTitle),n.listenerGroup.add(n.currentChatConnection.event.titleChange.listen((function(e){ii(i.room,e)}))),n.listenerGroup.add(O.gO.listen((function(e){n.currentChatConnection.updateEnterLeaveSettings(e.roomEntryFor,e.roomLeaveFor)}))),n.audioHolder.loadTipSounds(),n.listenerGroup.add(n.currentChatConnection.event.playSound.listen((function(e){if((0,U.oc)()){var t=n.player.playerComponent.getVolume();n.player.playerComponent instanceof M._O&&(t=n.player.playerComponent.getMuted()?0:n.player.playerComponent.getVolume()),isNaN(t)?error("playerComponent.getVolume() is NaN.",{},"VIDEO_"):n.audioHolder.playSound(e,i.userChatSettings.viewerTipVolume*t/100)}}))),n.player.setIsWidescreen(i.isWidescreen),n.cleanupLastRoomCallback=function(){clearInterval(o),window.clearTimeout(r),n.currentChatConnection.disconnect(),n.player.playerComponent.stop(),n.listenerGroup.removeAll(),S.QN.fire(void 0)};var s={dossier:i,chatConnection:n.currentChatConnection};n.player.playerComponent.handleRoomLoaded(s),n.listenerGroup.add(n.player.playerComponent.playbackStart.listen((function(){(0,h.D)(i,n.player.playerComponent)}))),t&&function(e){if((0,u.nv)())if("mobile"===window.location.pathname.replace(/\//g,"")){var t=(0,D.dD)(window.location.search);t.b=e.room;var n=(0,D.Ie)(t);window.history.pushState(e.room,e.roomTitle,(0,g.BN)("./?".concat(n)))}else{var i=(0,D.dD)(window.location.search),o=(0,D.Ie)(i),r="";""!==o&&(r="?".concat(o)),window.history.pushState(e.room,e.roomTitle,(0,g.BN)("/".concat(e.room,"/").concat(r)))}}(i),S.kN.fire(s),n.currentChatConnection.event.statusChange.listen((function(e){var t="offline"===e.currentStatus,i=["privatewatching","privatespying"],s=i.includes(e.currentStatus),a=i.includes(e.previousStatus);switch(t||"notconnected"!==e.previousStatus&&!s&&!a||(clearInterval(o),o=window.setInterval((function(){n.currentChatConnection.updateRoomCount(s)}),1e3*(s?5:90)),r=window.setTimeout((function(){n.currentChatConnection.updateRoomCount(s||a)}),2e3)),e.currentStatus){case"passwordprotected":n.passwordPrompt(n.currentChatConnection.room()),n.player.playerComponent.stop();break;case"offline":n.player.playerComponent.stop()}}))})).catch((function(t){var i="",o="",r="";if("string"==typeof t){var s=t.match(/(?:[^\s,":{}]+|"[^"]*")+/g);if(null!==s){var a=s.map((function(e){return e.replace(/"/g,"")})),l=a.indexOf("code");-1!==l&&(i=a[l+1]),-1!==(l=a.indexOf("detail"))&&(o=a[l+1])}r=t}else if(void 0!==t.xhr&&void 0!==t.xhr.responseText&&""!==t.xhr.responseText){if("application/json"!==t.xhr.getResponseHeader("Content-Type"))return void error("Error reading room dossier error",{room:e,error:t.xhr.responseText});var c=new y.j(t.xhr.responseText);i=c.getStringOrUndefined("code",!1),o=c.getString("detail",!1),r=t.xhr.responseText}else t instanceof TypeError&&(i="access-denied");switch(i){case"access-denied":(0,v.Cj)("Access Denied for room: ".concat(e,"\n\n").concat(o),(function(){si||(window.location.href=(0,g.BN)("/"))}));break;case"unauthorized":window.location.href=(0,g.BN)("/auth/login/?next=".concat(window.location.pathname).concat(window.location.search));break;case"password-required":n.passwordPrompt(e);break;default:error("Error parsing room dossier error",{room:e,error:r})}}))}},{key:"preventCertainTouchActions",value:function(){var e,t=function(){var e=document.getElementById("entrance_terms");return null!==e&&"none"!==e.style.display},n=!1;(0,m.j9)("touchstart",window,(function(i){if(!t()){var o=i.touches.length>1;o&&!n&&((0,R.fg)("PinchZoomStarted"),n=!0),o&&(0,Se.V)()&&i.cancelable&&i.preventDefault(),e=i}})),(0,m.j9)("touchmove",window,(function(n){var i,o;if(!t()&&!ri()){var r=n.touches[0].pageY;r!==(null!==(i=null===(o=e)||void 0===o?void 0:o.touches[0].pageY)&&void 0!==i?i:r)&&(0,Se.V)()&&n.cancelable&&n.preventDefault()}})),(0,m.j9)("touchend",window,(function(i){t()||(e=void 0,n=!1)}))}},{key:"adjustDimensions",value:function(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||!(0,me.gr)())this.element.style.top="0px",this.element.style.height="100%",this.element.style.minHeight="100%",this.hidePushMenu(),this.mobileDismissibleMessages.hideElement();else{this.mobileDismissibleMessages.showElement();var e=this.mobileDismissibleMessages.element.offsetHeight,t=this.siteHeaderHeight+e;this.element.style.top="".concat(t,"px"),this.element.style.height="calc(100% - ".concat(t,"px)"),this.element.style.minHeight="calc(100% - ".concat(t,"px)")}}},{key:"repositionChildren",value:function(){(0,s.Z)((0,c.Z)(F.prototype),"repositionChildren",this).call(this),this.adjustDimensions(this.isFullscreen)}},{key:"hidePushMenu",value:function(){Ie.YL.fire(!1),this.pushMenuOverlay.style.display="none",this.pushMenu.classList.remove("pushmenu-animate"),this.siteHeader.classList.remove("push-page-content"),this.pushMenuContainer.style.display="none"}}]),F}(I.w)},6959:function(e,t,n){"use strict";n.d(t,{Q:function(){return ee}});var i=n(4649),o=n(2951),r=n(1976),s=n(7169),a=n(3243),l=n(7591),c=n(9492),u=n(7597),d=n(8759),h=n(6272),f=n(1185),p=n(8210),m=n(2800),v=n(8626),g=n(795),y=n(7693),b=n(1522),w=n(695),C=n(1602),x=n(4793),k=n(2694),S=n(9),T=n(8263),I=n(1794),P=n(1625),R=n(3705),M=n(1250),A=n(2833),E=n(3544),B=n(9992),O=n(2239),L=n(1392),D=n(5937),U=n(6522),Z=n(3543),F=n(1289),_=n(9420),N=n(5253),j=n(3112),H=n(4364);function z(){if((0,d.Tt)())return!1;if(/UCBrowser|Firefox|SamsungBrowser/.test(navigator.userAgent))return!1;if(/Chrome\//.test(navigator.userAgent)){var e=navigator.userAgent.split("Chrome/")[1].split(".")[0];if(parseInt(e)<72)return!1}return!0}var W=n(4043),V=n(6958),q=n(3607),K=n(3682);function J(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var G=42,Y=Z.ag.mobileTipMessageLabelLandscape,$=Z.ag.mobileTipMessageLabelPortrait,Q=250,X="videoControls",ee=function(e){(0,l.Z)(ee,e);var t,n,S=(t=ee,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,u.Z)(t);if(n){var o=(0,u.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,c.Z)(this,e)});function ee(e,t,n){var i;(0,o.Z)(this,ee),(i=S.call(this)).mobileDismissibleMessages=n,i.setPlayerVisibilityEvent=new I.xB("setPlayerVisibilityEvent"),i.centerPlayerEvent=new I.xB("centerPlayerEvent"),i.requestFullscreenEvent=new I.xB("requestFullscreenEvent"),i.setPlayerComponentVolumeMutedEvents=new I.xB("setPlayerComponentVolumeMutedEvents"),i.forceHlsPlayerEvent=new I.xB("forceHlsPlayerEvent"),i.playerComponentReadjustForceHlsOverlayOrderEvent=new I.xB("playerComponentReadjustForceHlsOverlayOrderEvent"),i.showJpegPlayerComponentImage=new I.xB("showJpegPlayerComponentImage"),i.toggleFullscreen=new I.xB("toggleFullscreen"),i.requestHlsPlayerPlayIfPaused=new I.xB("requestHlsPlayerPlayIfPaused"),i.state={volume:100,isMuted:!0},i.showingRules=!1,i.isVisible=!0,i.isTipFormActive=!1,i.isClickingAButton=!1,i.roomType="public",i.layoutHandler=new N.N,i.layoutConstraints=new N.P(i.constructor.name),i.airPlayIconConstraint=0,i.autofillAccessoryConstraint=0,i.forceHlsTriggered=!1,i.forceHlsPlayButtonCreated=!1,i.hlsWaitingForInteraction=!1,i.userUnmuted=!1,i.wasInPortrait=(0,K.gr)(),i.headerHeight=0,i.initialFullscreen=!1,i.useDifferentKeyboard=(0,D.JR)(),i.mobileRoot=t,i.playerIsFullscreen=e.isFullscreen,i.playerUsingAirPlay=e.usingAirPlay,i.playerUsingChromecast=e.usingChromecast,e.playerComponent instanceof M.z?(i.playerIsJPEG=!0,i.playerIsHlsPlaceholder=e.playerComponent.getIsHlsPlaceholder()):(i.playerIsJPEG=!1,i.playerIsHlsPlaceholder=!1),i.playerElement=e.element;var r=(0,F.dD)(window.location.search).disable_sound;(void 0!==r&&"true"===r.toLowerCase()||"1"===r)&&(i.state.isMuted=!0);var a=document.querySelector("#static-header");null!==a&&(i.headerHeight=a.offsetHeight),(0,f.vP)(i.element,"MobileVideoControls"),i.element.style.position="fixed",i.element.style.width="inherit",i.element.style.top="0px",i.element.style.display="flex",i.element.style.flexDirection="column",i.element.style.alignItems="center",i.element.style.justifyContent="space-between",i.playerOverlay=document.createElement("div"),i.playerOverlay.style.position="absolute",i.playerOverlay.style.width="100%",i.playerOverlay.style.height="100%",i.element.appendChild(i.playerOverlay),i.initControls(),i.constructUI(),i.touchControls=new V.I(i.playerOverlay,i.playerElement),i.bindTouchControlsEvent(),C.y.listen((function(e){i.rulesModal=(0,p.vo)((0,s.Z)(i),e),void 0!==i.rulesModal&&(i.addChild(i.rulesModal),i.rulesModal.visibilityChanged.listen((function(e){i.showingRules=e})))})),x.kN.listen((function(e){i.currentRoomContext=e,i.chatConnection=e.chatConnection,i.roomName=e.chatConnection.room(),e.chatConnection.event.statusChange.listen((function(e){i.updatePlayerHiddenStatus(e.currentStatus),i.showHideHlsPlayButton(e.currentStatus),"privatewatching"===e.currentStatus?(i.roomType="private",i.tokenBalanceLink.onclick=function(){var e=m.J.current.PurchaseEventSources.TOKEN_SOURCE_TIP_CALLOUT;(0,g.Hi)({source:e,roomType:"private"})}):(i.roomType="public",i.tokenBalanceLink.onclick=function(){var e=m.J.current.PurchaseEventSources.TOKEN_SOURCE_TIP_CALLOUT;(0,g.Hi)({source:e,roomType:"public"})})})),i.playerIsJPEG&&i.playerIsHlsPlaceholder&&!i.forceHlsPlayButtonCreated&&(i.forceHlsPlayButtonCreated=!0,i.createForceHlsPlayButton(),i.showHideHlsPlayButton(e.dossier.roomStatus)),i.updatePlayerHiddenStatus(e.dossier.roomStatus),i.userUnmuted||i.state.isMuted||(i.userUnmuted=!0),i.updateVolumeImage(),i.playerIsJPEG||i.updatePlayerVolume(),i.updateTokenBalance(isNaN(e.dossier.tokenBalance)?0:e.dossier.tokenBalance)})),_.wy.listen((function(){i.setFullscreen(!1)})),_.SB.listen((function(){i.mute()})),h.A3.listen((function(e){isNaN(e.tokens)||i.updateTokenBalance(e.tokens)})),j.H4.listen((function(e){if(i.isAnyInputFocused())i.closeActiveInput(),i.showControls(),i.isTipFormActive&&i.hideTipForm();else{if(e===i.isVisible)return void i.showControls();i.isVisible?i.isTipFormActive?i.hideTipForm():i.hideControls():i.showControls()}})),j.ct.listen((function(){i.isVisible&&i.showControls()})),j.uh.listen((function(){i.setFullscreen(!1),(0,K.gr)()||(0,b.Bp)("Rotate device to view PMs")})),E.Sv.listen((function(){i.forceHlsOverlayFunc()}),!1),W.YL.listen((function(e){e?i.hideControls():i.repositionChildren()})),(0,y.j9)("scroll",window,(function(){i.updateTokenBalancePosition()})),K.bs.listen((function(){i.wasInPortrait===(0,K.gr)()?window.setTimeout((function(){i.onOrientationChange()}),0):i.onOrientationChange()})),(0,y.j9)("resize",window,(function(){void 0!==i.mobilePureChat&&i.mobilePureChat.scrollToBottom()})),P.gH.listen((function(){(0,P.rm)()!==i.playerIsFullscreen&&(i.setFullscreen(i.playerIsFullscreen,!0),(i.playerUsingAirPlay||i.playerUsingChromecast)&&i.canResizePlayerInFullscreen()&&void 0!==i.mobilePureChat&&i.mobilePureChat.setPortraitHeight((0,q.mP)()-100))})),i.showControls(),i.repositionChildren();var l=document.createElement("style");if(l.innerHTML="\n .mobileFullscreenInput::-webkit-input-placeholder {\n color: black;\n opacity: 0.65;\n }\n .mobileFullscreenInput:-ms-input-placeholder {\n color: black;\n opacity: 0.65;\n }\n .mobileFullscreenInput:-moz-placeholder {\n color: black;\n opacity: 0.65;\n }\n .mobileFullscreenInput::-moz-placeholder {\n color: black;\n opacity: 0.65;\n }\n ",document.head.appendChild(l),i.layoutHandler.addListener(e.roomStatusNotifier.layoutConstraints),i.layoutHandler.addListener(i.layoutConstraints),(0,d.IU)()){var c=window.localStorage.getItem(X);if(null!==c){var u=JSON.parse(c);i.state.isMuted=!e.playerComponent.supportsAutoplayWithAudio||u.isMuted,i.initialFullscreen=u.isFullscreen}else i.state.isMuted=!e.playerComponent.supportsAutoplayWithAudio}return i}return(0,r.Z)(ee,[{key:"initControls",value:function(){this.createVolumeImg(),this.createCenterControlsDiv(),this.createChatForm(),this.createTipForm(),this.createSendButton(),this.createTokenBalance(),this.createFullscreenImg(),this.createResizeDragLabel(),this.airPlayImg=this.createCastingImage("airplay.svg"),this.chromecastImg=this.createCastingImage("chromecast.svg"),this.createTopBar(),this.createBottomBar()}},{key:"constructUI",value:function(){this.element.appendChild(this.topBar),this.element.appendChild(this.bottomBar),this.centerControlsDiv.appendChild(this.chatForm),this.centerControlsDiv.appendChild(this.tipForm),this.centerControlsDiv.appendChild(this.sendButton)}},{key:"createTopBar",value:function(){this.topBar=document.createElement("div"),this.topBar.style.width="100%",this.topBar.style.display="flex",this.topBar.style.alignItems="center",this.topBar.style.padding="6px",this.topBar.style.boxSizing="border-box",this.topBar.appendChild(this.airPlayImg),this.topBar.appendChild(this.chromecastImg),this.topBar.appendChild(this.tokenBalanceWrapper)}},{key:"createBottomBar",value:function(){this.bottomBar=document.createElement("div"),this.bottomBar.classList.add("bottomBar"),this.bottomBar.style.width="100%",this.bottomBar.style.display="flex",this.bottomBar.style.alignItems="center",this.bottomBar.style.justifyContent="center",this.bottomBar.style.boxSizing="border-box",this.bottomBar.appendChild(this.volumeImg),this.bottomBar.appendChild(this.resizeDragLabel),this.bottomBar.appendChild(this.centerControlsDiv),this.bottomBar.appendChild(this.fullscreenImg)}},{key:"onOrientationChange",value:function(){this.show(),(0,K.gr)()?this.setPlaceholder(this.tipMessageInput,$):this.setPlaceholder(this.tipMessageInput,Y),!this.playerIsFullscreen&&this.isTipFormActive&&this.hideTipForm(),void 0!==this.rulesModal&&this.showingRules&&((0,K.gr)()?this.playerIsFullscreen||this.rulesModal.hide(!0):this.rulesModal.show(!0)),this.closeActiveInput(),void 0!==this.mobilePureChat&&(this.mobilePureChat.setVisible(this.playerIsFullscreen||!(0,K.gr)()),this.mobilePureChat.scrollToBottom()),this.wasInPortrait=(0,K.gr)()}},{key:"updatePlayerHiddenStatus",value:function(e){switch(e){case"offline":case"notconnected":case"away":case"privatenotwatching":case"hidden":case"passwordprotected":this.setPlayerVisibilityEvent.fire(!0);break;default:this.setPlayerVisibilityEvent.fire(!1)}}},{key:"createVolumeImg",value:function(){var e=this;this.volumeImg=document.createElement("img"),this.volumeImg.classList.add("volumeImg"),this.volumeImg.style.height="".concat(G,"px"),this.volumeImg.style.width="".concat(G,"px"),this.volumeImg.style.boxSizing="border-box",this.volumeImg.style.padding="0",this.volumeImg.style.cursor="pointer",this.volumeImg.style.border="none",this.volumeImg.style.background="none",this.volumeImg.style.zIndex="1",this.volumeImg.style.marginRight="".concat(10,"px"),this.volumeImg.onclick=function(){e.isVisible?(e.showControls(),e.playerIsJPEG?e.hlsWaitingForInteraction?e.forceHlsOverlayFunc(!0):e.forceHLS():((0,R.fg)("ToggleMute",{newState:!e.state.isMuted}),e.state.isMuted?e.unmute():e.mute())):e.showControls()}}},{key:"createCenterControlsDiv",value:function(){this.centerControlsDiv=document.createElement("div"),this.centerControlsDiv.style.opacity="0",this.centerControlsDiv.style.display="none",this.centerControlsDiv.style.zIndex="1",this.centerControlsDiv.style.height="".concat(G,"px"),this.centerControlsDiv.style.gridTemplateColumns="1fr auto",this.centerControlsDiv.style.columnGap="10px",this.centerControlsDiv.style.flex="1",(0,O.pS)(this.centerControlsDiv,"opacity ".concat(Q,"ms"))}},{key:"createChatForm",value:function(){var e=this;this.chatForm=document.createElement("form"),this.chatInput=new k.t7((function(){return e.safeSubmit()}),U.eq),this.chatExitButton=document.createElement("button"),this.chatExitImg=document.createElement("img"),this.chatExitButton.appendChild(this.chatExitImg),this.styleForm(this.chatForm),this.chatInput.element.classList.add("mobileFullscreenInput"),this.chatInput.element.style.textOverflow="",this.chatInput.element.style.verticalAlign="bottom",this.chatInput.element.style.webkitUserSelect="text",this.chatInput.setPlaceholder(Z.ag.mobileChatLabel,"placeholder"),this.chatInput.element.dataset.testid="chat-input",this.styleInput(this.chatForm),this.chatForm.style.overflow="hidden",this.chatForm.style.display="flex",this.chatForm.style.alignItems="center",this.chatInput.element.style.flex="1",this.chatInput.element.style.height="",this.chatInput.element.style.textOverflow="ellipsis",this.chatInput.element.style.overflow="hidden",this.chatInput.element.style.lineHeight="".concat(26,"px"),this.chatInput.element.style.fontSize="".concat(16,"px"),this.chatInput.element.style.fontWeight="bold",this.chatInput.element.style.fontFamily="UbuntuRegular, Arial, Helvetica, sans-serif",this.chatForm.appendChild(this.chatInput.element),this.chatForm.appendChild(this.chatExitButton),this.chatExitButton.type="button",this.chatExitButton.style.width="".concat(36,"px"),this.chatExitButton.style.height="".concat(36,"px"),this.chatExitButton.style.padding="0",this.chatExitButton.style.margin="0",this.chatExitButton.style.border="none",this.chatExitButton.style.borderRadius="".concat(18,"px"),this.chatExitButton.style.outline="none",this.chatExitButton.style.backgroundColor="transparent",this.chatExitButton.style.opacity="1",this.chatExitButton.style.display="none",this.chatExitImg.src="".concat(STATIC_URL_MOBILE,"exit-chat.svg"),this.chatExitImg.style.width="50%",this.chatExitImg.style.height="".concat(200/7,"%"),this.chatExitImg.style.opacity="1",this.chatExitImg.style.display="none",this.chatExitButton.onmousedown=function(t){t.preventDefault(),e.isClickingAButton=!0},this.chatExitButton.onmouseup=function(t){t.preventDefault(),e.isClickingAButton=!1},this.chatExitButton.onclick=function(t){t.preventDefault(),e.chatInput.blur(),e.hlsWaitingForInteraction&&e.forceHlsOverlayFunc(!1)},(0,y.j9)("mousedown",this.chatInput.element,(function(){e.isVisible&&((0,O.pS)(e.centerControlsDiv,"none"),e.centerControlsDiv.style.opacity="1")})),(0,y.j9)("focus",this.chatInput.element,(function(){e.showControls(),e.repositionChildren(),e.inputScrollIntoViewFix(),e.inputFix(!0)})),(0,y.j9)("blur",this.chatInput.element,(function(){(0,O.pS)(e.centerControlsDiv,"opacity ".concat(Q,"ms")),e.isClickingAButton||(e.showControls(),e.repositionChildren(),e.closeKeyboardFix(),e.inputFix(!1))})),this.chatForm.onsubmit=function(t){t.preventDefault(),e.chatInput.submit()}}},{key:"inputFix",value:function(e){(0,H.m7)()&&(0,K.gr)()&&(e?((0,T.Zs)(this.centerControlsDiv,{bottom:"50px"}),void 0!==this.mobilePureChat&&(this.mobilePureChat.inputFocusOffset=50,(0,T.Zs)(this.mobilePureChat.element,{bottom:"".concat(65+this.centerControlsDiv.offsetHeight,"px")}))):((0,T.Zs)(this.centerControlsDiv,{bottom:"0"}),void 0!==this.mobilePureChat&&(this.mobilePureChat.inputFocusOffset=0),this.repositionChildrenRecursive()))}},{key:"inputScrollIntoViewFix",value:function(){(0,d.Tt)()&&!(0,K.gr)()&&(document.documentElement.scrollTop=(0,q.mP)()),te()&&(this.autofillAccessoryConstraint=50,this.updateConstraints())}},{key:"closeKeyboardFix",value:function(){te()&&(this.autofillAccessoryConstraint=0,this.updateConstraints())}},{key:"safeSubmit",value:function(){return!(0,w.Cg)('You must be logged in to send a message. Click "OK" to login.')&&this.cleanAndSendMessage(this.chatInput.getText())}},{key:"cleanAndSendMessage",value:function(e){if(""===e.trim())return!1;var t=(0,L.DO)(e);switch(t.messageType){case 1:this.chatInput.clearText();var n=t;this.showTipForm(n.messageData);break;case 2:if(void 0===this.chatConnection)return(0,b.Cj)("Unable to enable debug mode"),!1;this.chatConnection.toggleAppDebugging();break;case 3:if(void 0===this.chatConnection)return(0,b.Cj)("Unable to send shortcode"),!1;if(!(0,v.vj)())break;var i=t;this.chatConnection.sendShortcode(i);break;default:if(void 0===this.chatConnection)return(0,b.Cj)("Unable to send message"),!1;this.chatConnection.sendRoomMessage(e),j.pF.fire(void 0)}return!0}},{key:"createSendButton",value:function(){var e=this;this.sendButton=document.createElement("button"),this.sendButton.classList.add("sendButton"),this.sendButton.innerText=Z.ag.sendTipButtonCAPS,this.sendButton.style.outline="none",this.sendButton.style.border="none",this.sendButton.style.height="".concat(G,"px"),this.sendButton.style.fontSize="".concat(16,"px"),this.sendButton.style.fontFamily="UbuntuBold, Arial, Helvetica, sans-serif",this.sendButton.style.color="rgb(240,240,240)",this.sendButton.style.background="rgba(21, 107, 149, 0.75)",this.sendButton.style.padding="5px 8px",this.sendButton.style.borderRadius="6px",this.sendButton.style.boxSizing="border-box",this.sendButton.style.cursor="pointer",this.sendButton.style.display="inline-block",this.sendButton.style.textAlign="center",this.sendButton.onmousedown=function(t){t.preventDefault(),e.isClickingAButton=!0},this.sendButton.onmouseup=function(t){t.preventDefault(),e.isClickingAButton=!1},this.sendButton.onclick=function(){var t=e.isChatInputFocused()?"message":"tip";(0,w.Cg)("You must be logged in to send a ".concat(t,'. Click "OK" to login.'))?e.closeActiveInput():(e.isTipFormActive?e.submitTipForm():e.isChatInputFocused()?e.chatInput.submit():e.showTipForm(),e.hlsWaitingForInteraction&&e.forceHlsOverlayFunc(!1))}}},{key:"createTipForm",value:function(){var e=this;this.tipForm=document.createElement("form"),this.tipMessageInput=document.createElement("input"),this.tipAmountContainer=document.createElement("div");var t=document.createElement("label"),n=document.createElement("div");this.tipAmountInput=document.createElement("input");var i=document.createElement("button");this.tipForm.appendChild(this.tipMessageInput),this.tipForm.appendChild(this.tipAmountContainer),this.tipForm.appendChild(i),this.tipAmountContainer.appendChild(t),this.tipAmountContainer.appendChild(n),n.appendChild(this.tipAmountInput),this.styleForm(this.tipForm),this.styleInput(this.tipMessageInput),this.styleInput(this.tipAmountContainer),this.styleInput(this.tipAmountInput),(0,K.gr)()?this.setPlaceholder(this.tipMessageInput,$):this.setPlaceholder(this.tipMessageInput,Y),this.tipForm.classList.add("tipForm"),this.tipForm.style.columnGap="10px",this.tipForm.style.display="none",this.tipMessageInput.classList.add("mobileFullscreenInput"),this.tipAmountContainer.style.display="flex",this.tipAmountContainer.style.padding="".concat(4,"px ").concat(5,"px"),t.innerText="".concat(Z.ag.amountText," "),t.style.opacity="0.7",t.style.lineHeight="".concat(34,"px"),n.style.overflow="hidden",n.style.padding="0",n.style.flex="1",this.tipAmountInput.type=(0,d.Tt)()&&!this.useDifferentKeyboard?"tel":"number",this.tipAmountInput.value="25",this.tipAmountInput.style.background="white",this.tipAmountInput.style.height="".concat(34,"px"),this.tipAmountInput.style.lineHeight="".concat(34,"px"),this.tipAmountInput.style.textAlign="center",this.tipAmountInput.style.margin="0",this.tipAmountInput.style.padding="0 6px",this.tipAmountInput.style.opacity="0.9",this.tipAmountInput.style.width="100%",this.tipAmountInput.style.color="black",(0,y.j9)("input",this.tipAmountInput,(function(){e.cleanTipAmountValue(),e.hlsWaitingForInteraction&&e.forceHlsOverlayFunc(!1)})),i.style.visibility="hidden",i.style.width="0",i.style.height="0",i.style.position="absolute",i.type="submit",this.tipMessageInput.onfocus=function(){e.inputScrollIntoViewFix(),e.inputFix(!0)},this.tipAmountInput.onfocus=function(){e.inputScrollIntoViewFix(),e.inputFix(!0),(0,d.Tt)()&&!e.useDifferentKeyboard?(0,H.m7)()?window.setTimeout((function(){e.tipAmountInput.setSelectionRange(0,e.tipAmountInput.value.length)}),0):e.tipAmountInput.setSelectionRange(0,e.tipAmountInput.value.length):e.tipAmountInput.select()},this.tipAmountInput.onblur=function(){""===e.tipAmountInput.value&&(e.tipAmountInput.value="0"),e.closeKeyboardFix(),e.inputFix(!1)},this.tipAmountInput.onkeydown=function(e){e.metaKey||"Unidentified"===e.key||"Backspace"===e.key||"Enter"===e.key||"0123456789".includes(e.key)||e.preventDefault()},this.tipMessageInput.onblur=function(){e.closeKeyboardFix(),e.inputFix(!1)},this.tipForm.onsubmit=function(t){t.preventDefault(),e.submitTipForm()}}},{key:"cleanTipAmountValue",value:function(){var e=this.tipAmountInput.value.replace(/[^0-9]+/g,"");this.tipAmountInput.value="",this.tipAmountInput.value=e}},{key:"notifyPlayerChangeSize",value:function(){var e=Math.abs(this.playerScroll-this.playerElement.scrollLeft),t=Math.abs(this.playerHeight-this.playerElement.offsetHeight);if(!(e<10&&t<10)){var n=A.$V;void 0!==this.currentRoomContext&&!0===this.currentRoomContext.dossier.isWidescreen&&(n=A.fo),e*n>t?j.zy.fire({changeType:1}):j.zy.fire({changeType:0})}}},{key:"submitTipForm",value:function(){this.closeActiveInput();var e=parseInt(this.tipAmountInput.value);isNaN(e)?(0,b.Cj)(Z.ag.tipAmountInvalid):((0,R.fg)("SendTipClicked",{amount:e,source:"mobile_fullscreen"}),e>100?(0,b.oB)(Z.ag.tipConfirmationMessage(e),this.mySendTip.bind(this,e),(function(){})):this.mySendTip(e))}},{key:"mySendTip",value:function(e){var t=this;this.sendButton.disabled=!0,(0,h.d1)({roomName:this.roomName,tipAmount:this.tipAmountInput.value,message:"".concat(this.tipMessageInput.value),source:"mobile",tipRoomType:this.roomType,tipType:"public",videoMode:"mobile"}).then((function(n){t.sendButton.disabled=!1,n.success?(0,R.fg)("SendTipSuccess",{amount:e,source:"mobile_fullscreen"}):void 0!==n.error?(0,b.Cj)(n.error):error("unknown send tip error"),t.tipMessageInput.value="",t.hideTipForm(),x.q.fire({amount:e,success:n.success}),void 0!==n.tipsInPast24Hours&&h.H2.fire({tokens:n.tipsInPast24Hours,roomName:t.roomName})})).catch((function(n){x.q.fire({amount:e,success:!1}),t.sendButton.disabled=!1,(0,b.Cj)("Unable to send tip"),error("Error sending tip (".concat(n,")"))}))}},{key:"styleForm",value:function(e){e.style.height="100%",e.style.boxSizing="border-box"}},{key:"styleInput",value:function(e){e.style.textOverflow="ellipsis",e.style.whiteSpace="nowrap",e.style.overflow="hidden",e.style.height="".concat(G,"px"),e.style.lineHeight="".concat(26,"px"),e.style.fontSize="".concat(16,"px"),e.style.fontWeight="bold",e.style.fontFamily="UbuntuRegular, Arial, Helvetica, sans-serif",e.style.border="none",e.style.outline="none",e instanceof HTMLInputElement&&(e.autocomplete="off"),e.style.color="rgb(15,15,15)",e.style.background="rgba(255, 255, 255, 0.5)",e.style.padding="".concat(8,"px ").concat(10,"px"),e.style.borderRadius="6px",e.style.boxSizing="border-box",e.style.cursor="pointer",e.style.display="inline-block",e.style.textAlign="left"}},{key:"createTokenBalance",value:function(){var e=this;this.tokenBalanceWrapper=document.createElement("div"),this.tokenBalanceLink=document.createElement("a");var t=document.createElement("span");this.tokenBalanceAmount=document.createElement("span"),this.tokenBalanceWrapper.appendChild(this.tokenBalanceLink),this.tokenBalanceLink.appendChild(t),this.tokenBalanceLink.appendChild(this.tokenBalanceAmount),this.tokenBalanceWrapper.style.zIndex="2",this.tokenBalanceLink.target="_blank",this.tokenBalanceLink.style.display="none",this.tokenBalanceLink.style.textDecoration="none",this.tokenBalanceLink.style.fontWeight="bold",this.tokenBalanceLink.style.borderRadius="8px",this.tokenBalanceLink.style.padding="6px 12px",this.tokenBalanceLink.style.background="rgba(255, 255, 255, 0.6)",this.tokenBalanceLink.onclick=function(){var t=m.J.current.PurchaseEventSources.TOKEN_SOURCE_MOBILE_VIDEO_CONTROLS;(0,g.Hi)({source:t,roomType:e.roomType})},t.textContent="".concat(Z.ag.balanceText," "),t.style.color="rgb(50, 50, 50)",this.tokenBalanceAmount.textContent="0 Tokens",this.tokenBalanceAmount.style.color="rgb(15, 15, 15)"}},{key:"createFullscreenImg",value:function(){var e=this;this.fullscreenImg=document.createElement("img"),this.fullscreenImg.src="".concat(STATIC_URL_MOBILE,"expand-1.svg"),this.fullscreenImg.style.height="".concat(G,"px"),this.fullscreenImg.style.width="".concat(G,"px"),this.fullscreenImg.style.boxSizing="border-box",this.fullscreenImg.style.padding="0",this.fullscreenImg.style.cursor="pointer",this.fullscreenImg.style.border="none",this.fullscreenImg.style.background="none",this.fullscreenImg.style.zIndex="1",this.fullscreenImg.style.borderRadius="".concat(21,"px"),this.fullscreenImg.style.marginLeft="".concat(10,"px"),this.fullscreenImg.onclick=function(){e.hlsWaitingForInteraction&&e.forceHlsOverlayFunc(!1),e.isVisible?(e.showControls(),e.setFullscreen(!e.playerIsFullscreen)):e.showControls()}}},{key:"createResizeDragLabel",value:function(){this.resizeDragLabel=document.createElement("div"),this.resizeDragLabel.innerText=Z.ag.dragToResize,this.resizeDragLabel.style.backgroundColor="rgba(0,0,0,0.3)",this.resizeDragLabel.style.color="rgba(255,255,255,0.6)",this.resizeDragLabel.style.borderRadius="6px",this.resizeDragLabel.style.padding="5px",this.resizeDragLabel.style.textAlign="center",this.resizeDragLabel.style.pointerEvents="none",this.resizeDragLabel.style.textOverflow="ellipsis",this.resizeDragLabel.style.whiteSpace="nowrap",this.resizeDragLabel.style.overflow="hidden",this.resizeDragLabel.style.flex="1"}},{key:"repositionChildren",value:function(){!(0,K.gr)()||this.playerIsFullscreen||this.playerUsingAirPlay||this.playerUsingChromecast?this.resizeDragLabel.style.display="none":this.resizeDragLabel.style.display="",this.updateIcons(),this.updateCenterControls(),this.updateSendButton(),this.updateChatExitButton(),this.updateChatInput(),this.updateTokenBalancePosition(),this.adjustDimensions()}},{key:"adjustDimensions",value:function(){var e=this.playerElement.getBoundingClientRect();if(this.isFullVideo())(0,P.rm)()?this.element.style.height="calc(var(--vh, 1vh) * 100)":this.element.style.height="100%",this.element.style.top="0";else{this.element.style.height="".concat(e.height,"px");var t=this.mobileDismissibleMessages.element.offsetHeight;this.element.style.top="".concat(this.headerHeight+t,"px")}}},{key:"updateIcons",value:function(){this.shouldHideIcons()?(this.fullscreenImg.style.display="none",this.volumeImg.style.display="none"):(this.fullscreenImg.style.display="inline",this.volumeImg.style.display="inline"),z()||(0,K.gr)()||(this.fullscreenImg.style.display="none")}},{key:"updateCenterControls",value:function(){this.isFullVideo()?this.showCenterControls():this.hideCenterControls()}},{key:"showCenterControls",value:function(){this.isVisible&&(this.centerControlsDiv.style.opacity="1",this.centerControlsDiv.style.pointerEvents="auto",this.centerControlsDiv.style.display="grid")}},{key:"hideCenterControls",value:function(){this.centerControlsDiv.style.opacity="0",this.centerControlsDiv.style.pointerEvents="none",this.isFullVideo()||(this.centerControlsDiv.style.display="none")}},{key:"updateChatExitButton",value:function(){this.isChatInputFocused()?(this.chatExitImg.style.display="inline-block",this.chatExitButton.style.display="block"):(this.chatExitImg.style.display="none",this.chatExitButton.style.display="none")}},{key:"updateChatInput",value:function(){var e=this;this.isChatInputFocused()?(this.chatInput.element.style.textOverflow="",window.setTimeout((function(){e.chatInput.element.scrollLeft=e.chatInput.element.scrollWidth,e.chatInput.setCaretToEnd()}),0)):(this.chatInput.element.style.textOverflow="ellipsis",this.chatInput.element.scrollLeft=0)}},{key:"isAnyInputFocused",value:function(){return this.isChatInputFocused()||this.isTipInputFocused()}},{key:"closeActiveInput",value:function(){this.chatInput.element===document.activeElement?this.chatInput.blur():this.tipAmountInput===document.activeElement?this.tipAmountInput.blur():this.tipMessageInput===document.activeElement&&this.tipMessageInput.blur()}},{key:"isChatInputFocused",value:function(){return this.chatInput.element===document.activeElement}},{key:"isTipInputFocused",value:function(){return this.tipAmountInput===document.activeElement||this.tipMessageInput===document.activeElement}},{key:"shouldHideIcons",value:function(){return this.isChatInputFocused()||this.isTipFormActive}},{key:"showTipForm",value:function(e){(0,v.vj)()&&!this.isVisible&&((0,O.pS)(this.centerControlsDiv,"none"),this.showControls()),this.isTipFormActive=!0,this.tokenBalanceLink.style.display="block",this.chatForm.style.display="none",this.tipForm.style.display="grid",void 0!==e&&(void 0!==e.amount&&(this.tipAmountInput.value=e.amount.toString(),this.cleanTipAmountValue()),void 0!==e.message&&(this.tipMessageInput.value=e.message)),this.tipAmountInput.focus(),this.repositionChildren()}},{key:"hideTipForm",value:function(){this.isTipFormActive=!1,this.tokenBalanceLink.style.display="none",this.chatForm.style.display="inline-block",this.tipForm.style.display="none",this.repositionChildren()}},{key:"setFullscreen",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.playerIsFullscreen!==e&&(this.playerIsFullscreen=e,this.toggleFullscreen.fire(e),e?this.fullscreenImg.src="".concat(STATIC_URL_MOBILE,"contract-1.svg"):(this.fullscreenImg.src="".concat(STATIC_URL_MOBILE,"expand-1.svg"),this.isTipFormActive&&this.hideTipForm()),void 0!==this.rulesModal&&this.showingRules&&(e?this.rulesModal.show(!0):this.rulesModal.hide(!0)),void 0!==this.mobilePureChat&&((0,K.gr)()?this.mobilePureChat.setVisible(e):this.mobilePureChat.setVisible(!0)),this.centerPlayerEvent.fire(void 0),this.updateCenterControls(),this.repositionChildren(),this.saveSettings(),t||this.maybeUseFullscreenAPI(e))}},{key:"maybeUseFullscreenAPI",value:function(e){z()&&(e?this.requestFullscreenEvent.fire(void 0):(0,P.Qg)())}},{key:"updateSendButton",value:function(){this.isChatInputFocused()?this.sendButton.innerText=Z.ag.sendCAPS:this.sendButton.innerText=Z.ag.sendTipButtonCAPS}},{key:"updateVolumeImage",value:function(){this.state.isMuted||0===this.state.volume?this.volumeImg.src="".concat(STATIC_URL_MOBILE,"muted.svg"):this.volumeImg.src="".concat(STATIC_URL_MOBILE,"unmuted.svg"),(0,R.iL)(100,this.state.isMuted)}},{key:"updatePlayerVolume",value:function(){this.userUnmuted||this.state.isMuted||(this.userUnmuted=!0,(0,R.fg)("UserUnmuted",{chatMode:"mobile"})),this.setPlayerComponentVolumeMutedEvents.fire(function(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0];this.hlsWaitingForInteraction&&void 0!==this.currentRoomContext&&!this.forceHlsTriggered&&(void 0!==this.forceHlsOverlay&&null!==this.forceHlsOverlay.parentElement&&(this.forceHlsOverlay.parentElement.removeChild(this.forceHlsOverlay),this.forceHlsOverlay=void 0),void 0!==this.playButtonContainer&&null!==this.playButtonContainer.parentElement&&(this.playButtonContainer.parentElement.removeChild(this.playButtonContainer),this.playButtonContainer=void 0),this.forceHlsTriggered=!0,this.hlsWaitingForInteraction=!1,(0,R.fg)("ForceHLS"),this.forceHlsPlayerEvent.fire({roomContext:this.currentRoomContext,unmute:e}),this.element.style.zIndex="")}},{key:"createHlsPlayOverlay",value:function(){var e=this;this.forceHlsOverlay=document.createElement("div"),this.element.style.zIndex="100",this.forceHlsOverlay.style.width="100%",this.forceHlsOverlay.style.height="100%",this.forceHlsOverlay.style.position="absolute",this.forceHlsOverlay.style.top="0",this.forceHlsOverlay.style.left="0",this.forceHlsOverlay.style.zIndex="99",(0,y.j9)("click",this.forceHlsOverlay,(function(){e.forceHlsOverlayFunc()})),(0,y.j9)("click",this.element,(function(){e.forceHlsOverlayFunc()})),this.playerComponentReadjustForceHlsOverlayOrderEvent.fire(this.forceHlsOverlay)}},{key:"createForceHlsPlayButton",value:function(){if(this.playerIsJPEG){this.hlsWaitingForInteraction=!0,this.playButtonContainer=document.createElement("div");var e=document.createElement("img");e.src="".concat(STATIC_URL,"play-inactive.svg"),e.style.width="30px",e.style.height="30px",e.style.cursor="pointer",this.playButtonContainer.style.cursor="pointer",this.playButtonContainer.style.width="70px",this.playButtonContainer.style.height="70px",this.playButtonContainer.style.borderRadius="50%",this.playButtonContainer.style.backgroundColor="rgba(0,0,0,0.25)",this.playButtonContainer.style.display="flex",this.playButtonContainer.style.alignItems="center",this.playButtonContainer.style.justifyContent="center",this.playButtonContainer.appendChild(e),this.element.insertBefore(this.playButtonContainer,this.bottomBar),this.showJpegPlayerComponentImage.fire(void 0),this.createHlsPlayOverlay(),this.repositionChildren()}}},{key:"notifyPlayerIsJPEG",value:function(e){this.playerIsJPEG=e}},{key:"notifyPlayerIsHlsPlaceholder",value:function(e){this.playerIsHlsPlaceholder=e}},{key:"notifyUsingAirPlayChange",value:function(e){this.playerUsingAirPlay=e}},{key:"notifyUsingChromecastChange",value:function(e){this.playerUsingChromecast=e}},{key:"canResizePlayerInFullscreen",value:function(){return!this.isAnyInputFocused()&&(0,K.gr)()&&this.isFullVideo()}},{key:"bindTouchControlsEvent",value:function(){var e=this;this.touchControls.touchMoveEvent.listen((function(t){switch(t.state){case 0:e.playerScroll=e.playerElement.scrollLeft,e.playerHeight=e.playerElement.offsetHeight;break;case 1:e.showControls();break;case 3:var n=e.isVisible;n||t.event.preventDefault(),n?e.isTipFormActive?e.hideTipForm():e.hideControls():e.showControls(),j.h4.fire(void 0),e.closeActiveInput(),e.requestHlsPlayerPlayIfPaused.fire(void 0);break;case 2:e.notifyPlayerChangeSize()}}))}},{key:"executeInitialFullscreenState",value:function(){this.initialFullscreen&&this.setFullscreen(!0,!0)}},{key:"getMobileRoot",value:function(){return this.mobileRoot}}]),ee}(S.w),te=function(){if((0,d._1)()&&/CriOS\//.test(navigator.userAgent)){var e=navigator.userAgent.split("CriOS/")[1].split(".")[0];if(parseInt(e)>=75)return!0}return!1}},2923:function(e,t,n){"use strict";n.d(t,{V:function(){return o},q:function(){return r}});var i=n(7693);function o(){return document.activeElement instanceof HTMLInputElement||document.activeElement instanceof HTMLTextAreaElement||document.activeElement instanceof HTMLElement&&"true"===document.activeElement.contentEditable}var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.style.overflowY="scroll",t&&((0,i.j9)("touchstart",e,(function(t){0===e.scrollTop&&(e.scrollTop=1)})),(0,i.j9)("touchmove",e,(function(t){o()&&(t.stopPropagation(),!(e.scrollHeight>e.clientHeight)&&t.cancelable&&t.preventDefault())})),(0,i.j9)("scroll",e,(function(){if(0===e.scrollTop)e.scrollTop=1;else if(e.scrollTop===e.scrollHeight-e.offsetHeight){var t=e.scrollHeight-e.offsetHeight-1;e.scrollTop=Math.max(t,1)}})))}},6847:function(e,t,n){"use strict";n.d(t,{$z:function(){return f},GJ:function(){return p},fQ:function(){return h}});var i=n(1976),o=n(2951),r=n(7591),s=n(9492),a=n(7597),l=n(7693),c=n(1794),u=n(3607);function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,a.Z)(e);if(t){var o=(0,a.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,s.Z)(this,n)}}var h=function(e,t,n,i){var o=Math.abs(e-n);return Math.abs(t-i)>o},f=function(e){(0,r.Z)(n,e);var t=d(n);function n(e,i){var r;(0,o.Z)(this,n),(r=t.call(this,"TouchEvent",i)).element=e;var s,a,c,u,d,h,f={x:0,y:0},p={x:0,y:0},m={x:0,y:0};return(0,l.j9)("touchstart",r.element,(function(e){f.x=e.touches[0].clientX,f.y=e.touches[0].clientY,m.x=e.touches[0].clientX,m.y=e.touches[0].clientY,s=Date.now(),c=0,u=1!==e.touches.length,d=!0,h=!1})),(0,l.j9)("touchmove",r.element,(function(e){if(1===e.touches.length&&!u){p.x=e.touches[0].clientX,p.y=e.touches[0].clientY;var t=f.x-p.x,n=p.y-f.y,i=1;o=c+=Math.abs(t)+Math.abs(n),l=Math.abs(p.y-m.y),a=l>=.7*o||l>110?1:0,(d=c<=10)||(h||(h=!0,i=0),r.fire({direction:a,distance:{x:t,y:n},state:i,elapsedTime:Date.now()-s,totalDistance:{x:m.x-p.x,y:p.y-m.y},startingPoint:m,event:e})),f.x=p.x,f.y=p.y}var o,l})),(0,l.j9)("touchend",r.element,(function(e){if(1===e.changedTouches.length&&!u){p.x=e.changedTouches[0].clientX,p.y=e.changedTouches[0].clientY;var t=d?3:2;r.fire({direction:a,distance:{x:f.x-p.x,y:p.y-f.y},state:t,elapsedTime:Date.now()-s,totalDistance:{x:m.x-p.x,y:p.y-m.y},startingPoint:m,event:e})}})),r}return(0,i.Z)(n)}(c.xB),p=function(e){(0,r.Z)(n,e);var t=d(n);function n(e,i){var r,s;(0,o.Z)(this,n),(r=t.call(this,"PinchEvent",i)).element=e;var a,c=0,d={x:0,y:0},h=function(e,t,n,i){var o=Math.sqrt((e-n)*(e-n)+(t-i)*(t-i));a=d,d.x=(e+n)/2,d.y=(t+i)/2;var r=0;return 0!==s&&(r=(o-s)/(0,u._U)()),s=o,r};return(0,l.j9)("touchstart",r.element,(function(e){s=0,c=0,2===e.touches.length&&(d.x=(e.touches[0].clientX+e.touches[1].clientX)/2,d.y=(e.touches[0].clientY+e.touches[1].clientY)/2,r.fire({state:0,previousCenterPoint:d,centerPoint:d,zoomPercentage:c}))})),(0,l.j9)("touchmove",r.element,(function(e){if(2===e.touches.length){var t=e.touches[0].clientX,n=e.touches[0].clientY,i=e.touches[1].clientX,o=e.touches[1].clientY;c=h(t,n,i,o),r.fire({state:1,previousCenterPoint:a,centerPoint:d,zoomPercentage:c})}})),(0,l.j9)("touchend",r.element,(function(e){if(2===e.changedTouches.length){var t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY,i=e.changedTouches[1].clientX,o=e.changedTouches[1].clientY;c=h(t,n,i,o),r.fire({state:2,previousCenterPoint:a,centerPoint:d,zoomPercentage:c})}})),r}return(0,i.Z)(n)}(c.xB)},4043:function(e,t,n){"use strict";n.d(t,{Ey:function(){return c},Fx:function(){return r},Gf:function(){return o},U9:function(){return l},WP:function(){return s},YL:function(){return u},ah:function(){return h},qF:function(){return d},tB:function(){return a}});var i=n(1794),o=new i.xB("switchedToHLS"),r=new i.xB("openTipCalloutRequest"),s=new i.xB("loadRoomRequest"),a=new i.xB("userPanelRequest"),l=new i.xB("sendMessageInputFocus"),c=new i.xB("sendMessageInputBlur"),u=new i.xB("siteHeaderMenuOpened"),d=new i.xB("userSwitchedTab"),h=new i.xB("toggleDms")},3764:function(e,t,n){"use strict";n.d(t,{A:function(){return b},Z:function(){return w}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(1006),u=n(4793),d=n(8263),h=n(1794),f=n(3543),p=n(1177),m=n(2923),v=n(3797),g=n(3607);function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(e.userList);try{for(i.s();!(n=i.n()).done;){var o=n.value,r=document.createElement("div");r.style.margin="0 0 10px",r.style.cursor="pointer",r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.maxWidth="100%",r.style.textOverflow="ellipsis",r.appendChild((0,v.W)(o,void 0,!0)),e.wrapper.appendChild(r)}}catch(e){i.e(e)}finally{i.f()}var s=document.createElement("div");s.innerText="+".concat(t.anonCount," anonymous user").concat(1===t.anonCount?"":"s"),(0,d.Zs)(s,{width:"100%",whiteSpace:"nowrap",color:"#A7A7A7",margin:"0 0 10px"}),e.wrapper.appendChild(s),e.repositionChildren()})).catch((function(e){error("Error retrieving mobile user list",e)}))}},{key:"getUserCount",value:function(){return this.userCount}},{key:"isOpen",value:function(){return this.isUserListOpen}},{key:"show",value:function(){(0,r.Z)((0,l.Z)(p.prototype),"show",this).call(this),this.isUserListOpen=!0,this.refreshUsers()}},{key:"hide",value:function(){(0,r.Z)((0,l.Z)(p.prototype),"hide",this).call(this),this.isUserListOpen=!1}},{key:"repositionChildren",value:function(){this.width=(0,g._U)()-50}}]),p}(p.M)},5004:function(e,t,n){"use strict";n.d(t,{w:function(){return _},i:function(){return F}});var i=n(3243),o=n(2951),r=n(1976),s=n(7169),a=n(7591),l=n(9492),c=n(7597),u=n(5925),d=n(6474),h=n(1185),f=n(7397),p=n(2800),m=n(1522),v=n(3753),g=n(695),y=n(4793),b=n(8821),w=n(27),C=n(9874),x=n(3705),k=n(9271),S=n(7108),T=n(9482),I=n(3543),P=n(9420),R=n(2008),M=n(3607),A=n(3682);var E,B,O,L=function(e){(0,a.Z)(u,e);var t,n,s=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,c.Z)(t);if(n){var o=(0,c.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function u(e,t,n){var i;return(0,o.Z)(this,u),(i=s.call(this,e,t,n)).element.style.height="auto",i.element.style.width="auto",i.element.style.maxWidth="90%",i.element.style.background="white",i.element.style.borderRadius="4px",i.element.style.margin="auto",i.element.style.position="absolute",i.element.style.boxShadow="0 10px 20px rgba(0, 0, 0, 0.2), 0 6px 6px rgba(0, 0, 0, 0.25)",i.commentInput.style.fontSize="16px",i}return(0,r.Z)(u,[{key:"repositionChildren",value:function(){if((0,i.Z)((0,c.Z)(u.prototype),"repositionChildren",this).call(this),(0,A.gr)()&&(0,M._U)()<768)this.element.style.width="90%";else{var e=Math.min(screen.width,screen.height);this.element.style.width="".concat(.9*e,"px")}this.element.style.top="".concat(((0,M.mP)()-this.element.offsetHeight)/2,"px"),this.element.style.left="".concat(((0,M._U)()-this.element.offsetWidth)/2,"px")}},{key:"onIgnoreUser",value:function(){}}]),u}(R.P),D=n(4043);function U(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,c.Z)(e);if(t){var o=(0,c.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,l.Z)(this,n)}}y.kN.listen((function(e){E=e.dossier.room,B=e.dossier.userName,O=e.chatConnection}));var Z="#156b95",F=function(e){(0,a.Z)(n,e);var t=U(n);function n(){var e,i,r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return(0,o.Z)(this,n),(i=t.call(this)).isChatReportShowing=!1,i.reportModal=new C.z({onShow:function(){i.onReportModalShown()},onHide:function(){i.onReportModalHidden()},easyExit:!0}),i.isIgnored=!1,B=null===(e=p.J.current.loggedInUser)||void 0===e?void 0:e.username,i.userPanelContent=document.createElement("div"),i.element.appendChild(i.userPanelContent),i.element.style.position="relative",i.element.style.width="auto",i.element.style.height="auto",i.element.style.minHeight="40px",i.element.style.padding="4px",i.element.style.border="1px solid #cccccc",i.element.style.borderRadius="6px",i.element.style.marginBottom="16px",i.element.style.fontWeight="normal",(0,h.vP)(i.element,"userPanel"),(0,h.vP)(i.element,h.ql.bgColor),i.roomImage=document.createElement("img"),i.roomImage.style.width="47px",i.roomImage.style.height="40px",i.roomImage.style.marginRight="16px",i.roomImage.style.verticalAlign="middle",i.roomImage.style.borderRadius="4px",i.roomImage.style.display="none",i.userPanelContent.appendChild(i.roomImage),i.genderIcon=document.createElement("img"),i.genderIcon.style.position="relative",i.genderIcon.style.top="3px",i.genderIcon.style.height="16px",i.genderIcon.style.padding="6px 16px 0 0",i.genderIcon.style.display="none",i.userPanelContent.appendChild(i.genderIcon),i.displayAge=document.createElement("span"),i.displayAge.innerText="--",i.displayAge.style.verticalAlign="middle",i.displayAge.style.marginRight="16px",i.displayAge.style.display="none",i.userPanelContent.appendChild(i.displayAge),i.profileLink=N("View Profile"),i.profileLink.onclick=function(){D.WP.fire(i.username)},r&&i.userPanelContent.appendChild(i.profileLink),(0,b.$_)()||(i.sendPMLink=N("Send PM"),i.sendPMLink.onclick=function(){(0,g.Cg)('You must be logged in to send a PM. Click "OK" to login.')||P.sC.fire({username:i.username,focus:!0,showSupporterAlert:i.needsSupporterToPm})},i.userPanelContent.appendChild(i.sendPMLink)),(0,d.Fh)()&&(i.sendDMLink=N(I.ag.dmMenuTitle),i.sendDMLink.onclick=function(){(0,g.Cg)(I.ag.loggedInToDm)||(D.ah.fire(!0),f.nh.fire(i.username))},i.userPanelContent.appendChild(i.sendDMLink)),i.mentionLink=N("Mention"),i.mentionLink.style.display="inline-block",i.mentionLink.onclick=function(){P.qS.fire(i.username)},i.userPanelContent.appendChild(i.mentionLink),i.ignoreLink=N("Ignore"),i.ignoreUpdate=new k.I(!1,i.setIsIgnored.bind((0,s.Z)(i)),(function(){var e=i.isIgnored?I.ag.errorUnignoringUser(i.username):I.ag.errorIgnoringUser(i.username);(0,m.Cj)(e)})),i.ignoreLink.onclick=function(){i.onIgnoreUnignoreClick()},i.userPanelContent.appendChild(i.ignoreLink),i.reportModal.element.style.backgroundColor="rgba(0, 0, 0, 0.3)",i.reportModal.element.style.position="fixed",i.reportLink=N("Report"),i.reportLink.onclick=function(){i.isChatReportShowing?i.reportModal.hide():((0,x.fg)("ReportChatUser",{username:i.username}),i.reportModal.show())},i.reportModal.overlayClick.listen((function(){i.reportModal.hide()})),i.userPanelContent.appendChild(i.reportLink),i}return(0,r.Z)(n,[{key:"onIgnoreUnignoreClick",value:function(){var e;(0,g.Cg)("".concat(I.ag.loginForIgnore," ").concat(I.ag.clickOkToLogin))||this.ignoreUpdate.dispatch(!this.isIgnored,(e=this.username,this.isIgnored?O.unignore(e):O.ignore(e)))}},{key:"setIsIgnored",value:function(e,t){this.isIgnored=e,this.ignoreLink.innerText=e?"Unignore":"Ignore",t?(this.ignoreLink.style.pointerEvents="none",this.ignoreLink.style.color="#6c757d"):(this.ignoreLink.style.pointerEvents="",this.ignoreLink.style.color=Z),void 0!==this.chatReport&&this.chatReport.updateIgnoreText(this.isIgnored)}},{key:"updateContents",value:function(e,t){var n=this;this.username=e,this.profileLink.style.display=e===E?"none":"inline-block",O.username()===E?this.ignoreLink.style.display="none":this.ignoreLink.style.display="inline-block",B===this.username?(this.ignoreLink.style.display="none",this.reportLink.style.display="none",this.mentionLink.style.display="none",void 0!==this.sendPMLink&&(this.sendPMLink.style.display="none"),void 0!==this.sendDMLink&&(this.sendDMLink.style.display="none")):(void 0===t?this.reportLink.style.display="none":(this.reportLink.style.display="inline-block",this.createChatReport(t)),this.mentionLink.style.display="inline-block",void 0!==this.sendPMLink&&(this.sendPMLink.style.display="inline-block"),void 0!==this.sendDMLink&&(this.sendDMLink.style.display="inline-block")),this.roomImage.style.display="none",this.genderIcon.style.display="none",this.displayAge.style.display="none",void 0!==this.silenceLink&&(this.userPanelContent.removeChild(this.silenceLink),this.silenceLink=void 0),(0,w.a)(this.username).then((function(e){n.needsSupporterToPm=e.needsSupporterToPm,e.canAccess&&(n.genderIcon.src=(0,T.Fg)(e.gender),n.displayAge.innerText=isNaN(e.displayAge)?"":"".concat(e.displayAge),n.roomImage.src=e.imageUrl,e.online&&(n.roomImage.style.display="inline"),n.genderIcon.style.display="inline",n.displayAge.style.display="inline"),n.ignoreUpdate.dispatch(O.isIgnored(n.username),Promise.resolve(!0)),n.setSilenceLink(e)})).catch((function(e){error("Could not process user menu request",e)}))}},{key:"createChatReport",value:function(e){var t=this;void 0!==this.chatReport&&this.reportModal.removeChild(this.chatReport),this.chatReport=new L(this.username,e,O),this.reportModal.addChild(this.chatReport),this.chatReport.element.style.display="none",this.chatReport.closeChatReportRequest.listen((function(e){t.reportModal.hide(),e&&(t.overlayClick.fire(void 0),void 0!==t.chatReport&&t.chatReport.tearDown())})),this.chatReport.ignoreReportedUser.listen((function(){t.ignoreUpdate.dispatch(!0,O.ignore(t.username))}))}},{key:"setSilenceLink",value:function(e){var t=this;e.canSilence&&(void 0!==e.silenceId?(this.silenceLink=N(I.ag.removeSilenceMessage),this.silenceLink.onclick=function(){(0,v.I5)("edit_room_ban/",{banid:String(e.silenceId),action:"remove_silence",room_username:E}).catch((function(t){error(t),(0,m.Cj)("Error removing silence from user ".concat(e.username))})),t.closeUserPanel()}):(this.silenceLink=N(I.ag.silenceText),this.silenceLink.onclick=function(){(0,m.oB)("Silence ".concat(e.username,"?"),(function(){(0,x.fg)("SilenceUser",{username:e.username}),(0,v.I5)("roomsilence/".concat(e.username,"/").concat(E,"/"),{}).then((function(){})).catch((function(t){error("Unable to silence user (".concat(t,")"),{room:E,username:e.username}),(0,m.Cj)("Error silencing user ".concat(e.username))}))})),t.closeUserPanel()}),this.silenceLink.style.display="inline-block",this.userPanelContent.appendChild(this.silenceLink))}},{key:"onReportModalShown",value:function(){this.reportLink.style.textDecoration="underline",void 0!==this.chatReport&&(this.chatReport.element.style.display="",this.chatReport.repositionChildren()),this.isChatReportShowing=!0}},{key:"onReportModalHidden",value:function(){this.isChatReportShowing=!1,this.reportLink.style.textDecoration="none",void 0!==this.chatReport&&(this.chatReport.element.style.display="none",this.chatReport.resetForm())}},{key:"closeUserPanel",value:function(){this.hideOverlay(),null!==this.element.parentElement&&this.element.parentElement.removeChild(this.element)}}]),n}(S.B),_=function(e){(0,a.Z)(n,e);var t=U(n);function n(){var e;return(0,o.Z)(this,n),(e=t.call(this,!0)).profileLink.onclick=function(){void 0!==O?D.WP.fire(e.username):window.location.pathname="/".concat(e.username,"/"),D.ah.fire(!1)},e}return(0,r.Z)(n,[{key:"onIgnoreUnignoreClick",value:function(){var e=this;(0,g.Cg)("".concat(I.ag.loginForIgnore," ").concat(I.ag.clickOkToLogin))||this.ignoreUpdate.dispatch(!this.isIgnored,e.isIgnored?(0,u.jr)(e.username).then((function(){return!0})):(0,u.qn)(e.username).then((function(){return!0})))}},{key:"updateContents",value:function(e,t){var n=this;this.username=e,this.element.style.top="",this.profileLink.style.display="inline-block",this.mentionLink.style.display="none",void 0!==this.sendPMLink&&(this.sendPMLink.style.display="none"),void 0!==this.sendDMLink&&(this.sendDMLink.style.display="none"),B===this.username?(this.ignoreLink.style.display="none",this.reportLink.style.display="none"):(this.ignoreLink.style.display="inline-block",void 0===t?this.reportLink.style.display="none":(this.reportLink.style.display="inline-block",this.createChatReport(t))),this.roomImage.style.display="none",this.genderIcon.style.display="none",this.displayAge.style.display="none",(0,w.a)(this.username).then((function(e){n.needsSupporterToPm=e.needsSupporterToPm,e.canAccess&&(n.genderIcon.src=(0,T.Fg)(e.gender),n.displayAge.innerText=isNaN(e.displayAge)?"":"".concat(e.displayAge),n.roomImage.src=e.imageUrl,e.online&&(n.roomImage.style.display="inline"),n.genderIcon.style.display="inline",n.displayAge.style.display="inline"),n.ignoreUpdate.dispatch((0,u.WU)(n.username),Promise.resolve(!0))})).catch((function(e){error("Could not process user menu request",e)}))}},{key:"createChatReport",value:function(e){var t=this;void 0!==this.chatReport&&this.reportModal.removeChild(this.chatReport),this.chatReport=new L(this.username,e,void 0),this.reportModal.addChild(this.chatReport),this.chatReport.element.style.display="none",this.chatReport.closeChatReportRequest.listen((function(e){t.reportModal.hide(),e&&(t.overlayClick.fire(void 0),void 0!==t.chatReport&&t.chatReport.tearDown())}))}},{key:"onReportModalShown",value:function(){(0,i.Z)((0,c.Z)(n.prototype),"onReportModalShown",this).call(this),this.reportModal.element.style.top="0"}},{key:"onReportModalHidden",value:function(){(0,i.Z)((0,c.Z)(n.prototype),"onReportModalHidden",this).call(this),this.reportModal.element.style.top=""}}]),n}(F);function N(e){var t=document.createElement("span");return t.innerText=e,t.style.verticalAlign="middle",t.style.textDecoration="none",t.style.cursor="pointer",t.style.color=Z,t.style.padding="0 16px 6px 0",t}},3797:function(e,t,n){"use strict";n.d(t,{W:function(){return c}});var i=n(1185),o=n(7693),r=n(8263),s=n(3705),a=n(9482),l=n(4043);function c(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=document.createElement("span");if((0,i.vP)(u,(0,a.c9)(e)),u.style.fontWeight="bold",u.classList.add("username"),u.innerText=c?"@".concat(e.username):e.username,u.style.maxWidth="100%",u.style.whiteSpace="nowrap",u.style.overflowX="hidden",u.style.textOverflow="ellipsis",n){var d=document.createElement("img");d.src=(0,a.Fg)(e.gender),(0,r.Zs)(d,{height:"16px",verticalAlign:"middle",margin:"0 10px 0 0"}),(0,r.Zs)(u,{fontWeight:"normal"}),u.insertBefore(d,u.firstChild)}return u.onmouseenter=function(){u.style.textDecoration="underline",u.style.cursor="pointer"},u.onmouseleave=function(){u.style.textDecoration="none",u.style.cursor="default"},(0,o.j9)("click",u,(function(n){for(var i=u.parentElement;null!==i&&"DIV"!==i.tagName;)i=i.parentElement;null===i?error("Username span has no parent"):((0,s.fg)("OpenUserPanel",{username:e.username}),l.tB.fire({username:e.username,message:t,attachTo:i}))})),u}},6958:function(e,t,n){"use strict";n.d(t,{I:function(){return c},J:function(){return l}});var i=n(2951),o=n(1976),r=n(1794),s=n(6847),a=n(3607),l=1.6,c=function(){function e(t,n){var o=this;(0,i.Z)(this,e),this.overlayElement=t,this.playerElement=n,this.touchMoveEvent=new s.$z(this.overlayElement),this.pinchEvent=new s.GJ(this.overlayElement),this.scalePlayerEvent=new r.xB("scalePlayerEvent"),this.scrollPlayerEvent=new r.xB("scrollPlayerEvent"),this.swipePlayerEvent=new r.xB("swipePlayerEvent"),this.changeVideoHeightEvent=new r.xB("changeVideoHeightEvent"),this.horizontalSwipeInProgress=!0,this.isSwipingEnabled=!1,this.pinchEvent.listen((function(e){var t=e.previousCenterPoint.x-e.centerPoint.x;o.scalePlayerEvent.fire({factor:1+1.25*e.zoomPercentage,pointX:e.centerPoint.x}),o.scrollPlayerEvent.fire(t)})),this.touchMoveEvent.listen((function(e){if(0===e.state&&(o.initialSwipeCheckDone=!1,o.horizontalSwipeInProgress=!1,o.swipeCheck(e)),o.horizontalSwipeInProgress){var t=2!==e.state||o.isCompletedSwipe(e.totalDistance.x,e.elapsedTime)?e.state:4;o.swipePlayerEvent.fire({state:t,totalDistance:e.totalDistance.x,elapsedTime:e.elapsedTime})}else{var n=e.distance.x;o.handlePlayerResize(e),o.scrollPlayerEvent.fire(n)}}))}return(0,o.Z)(e,[{key:"isSwipeAllowed",value:function(e){var t=this.playerElement.scrollLeft<=0,n=e<=0,i=Math.ceil(this.playerElement.scrollLeft)+this.playerElement.offsetWidth>=this.playerElement.scrollWidth,o=e>=0;return this.isSwipingEnabled&&(t&&n||i&&o)}},{key:"isCompletedSwipe",value:function(e,t){return Math.abs(e)>=.3333333333333333*(0,a._U)()||function(t){return t<=200&&Math.abs(e)>=.2*(0,a._U)()}(t)}},{key:"handlePlayerResize",value:function(e){this.changeVideoHeightEvent.fire({startingPoint:e.startingPoint,distance:e.distance})}},{key:"swipeCheck",value:function(e){this.initialSwipeCheckDone||(this.horizontalSwipeInProgress=this.isSwipeAllowed(e.totalDistance.x)&&0===e.direction,this.initialSwipeCheckDone=!0)}}]),e}()},3607:function(e,t,n){"use strict";n.d(t,{F7:function(){return c},Fd:function(){return d},RK:function(){return l},_U:function(){return a},mP:function(){return s}});var i,o=n(8759),r=n(3682),s=function(){return document.documentElement.clientHeight!==window.outerHeight||(0,o.Tt)()?Math.max(window.innerHeight,document.documentElement.clientHeight):window.innerHeight},a=function(){return document.documentElement.clientWidth},l=function(){return e=(0,r.gr)(),t=a(),n=s(),e?{width:t,height:n}:{width:n,height:t};var e,t,n},c=function(){return window.pageYOffset},u=null===(i=window.visualViewport)||void 0===i?void 0:i.scale,d=function(){return!(0,o.Tt)()&&null!=u&&window.visualViewport?Math.round(10*u)!==Math.round(10*window.visualViewport.scale):document.documentElement.clientWidth!==window.innerWidth}},3682:function(e,t,n){"use strict";n.d(t,{P0:function(){return a},a1:function(){return u},bs:function(){return h},gr:function(){return s},qn:function(){return c},s2:function(){return d}});var i=n(8759),o=n(1794);function r(){var e=void 0!==screen.orientation?screen.orientation.type:void 0;if(void 0!==e){if(e.startsWith("portrait"))return!0;if(e.startsWith("landscape"))return!1}}function s(){if(!c())return!0;var e=r();if(void 0!==e)return e;switch(window.orientation){case 0:case 180:case-180:return!0;case 90:case-90:case 270:return!1}return window.innerWidth===Math.min(screen.width,screen.height)||window.innerWidth<=window.innerHeight}function a(e){if(!c())return!0;if(!(0,i.Tt)()){var t=r();if(void 0!==t)return!t}switch(window.orientation){case 0:case 180:case 270:case-180:return!1;case 90:return void 0!==e&&"user"!==e||!(0,i.Tt)();case-90:return"environment"!==e||!(0,i.Tt)()}return!0}var l=Object.prototype.hasOwnProperty.call(window,"onorientationchange");function c(){return l}function u(){return"orientation"in screen&&"onchange"in screen.orientation}function d(){return c()||u()}var h=new o.xB("screenOrientationChanged")},9874:function(e,t,n){"use strict";n.d(t,{t:function(){return v},z:function(){return g}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(7693),c=n(9),u=n(1794),d=n(1625),h=n(1809);var f=new u.xB("modalReposition");(0,l.j9)("resize",window,(function(){f.fire(void 0)})),(0,l.j9)("orientationchange",window,(function(){f.fire(void 0)}));var p=new u.xB("modalEscape");(0,l.j9)("keydown",document,(function(e){27===e.keyCode&&p.fire(e)}));var m=new u.xB("modalExit");(0,l.j9)("popstate",window,(function(e){m.fire(void 0)})),h.vV.listen((function(){m.fire(void 0)}));var v=new u.xB("modalOpened"),g=function(e){(0,r.Z)(c,e);var t,n,l=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function c(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{easyExit:!0};return(0,i.Z)(this,c),(e=l.call(this)).options=t,e.overlayClick=new u.xB("overlayClick"),e.listenerGroup=new u.mM,e.isListeningForChange=!1,e.hideOverlay=!1,e.overlayClickStayOpen=!1,e.preventChatFocus=!1,e.addHidePageAction=function(){},e.overlay=document.createElement("div"),e.overlay.style.position="fixed",e.overlay.style.display="none",e.overlay.style.left="0",e.overlay.style.top="0",e.overlay.style.right="0",e.overlay.style.bottom="0",e.overlay.style.zIndex="1100",e.overlay.style.background="rgb(0,0,0,0)",e.overlay.onclick=function(t){t.stopPropagation(),e.overlayClick.fire(void 0),e.overlayClickStayOpen||e.hide()},e.element.style.zIndex="1101",e.element.onclick=function(e){e.stopPropagation()},e.repositionCallback=function(){e.isListeningForChange&&e.repositionChildrenRecursive()},e.fullscreenChangeCallback=function(){e.isListeningForChange&&e.show()},e}return(0,o.Z)(c,[{key:"show",value:function(){var e=this,t=(0,d.Gd)();(0,d.rm)()&&void 0!==t?(t.appendChild(this.overlay),t.appendChild(this.element)):(document.body.appendChild(this.overlay),document.body.appendChild(this.element)),this.isListeningForChange||(f.listen(this.repositionCallback,!1).addTo(this.listenerGroup),d.gH.listen(this.fullscreenChangeCallback,!1).addTo(this.listenerGroup),m.listen((function(){e.hide()}),!1).addTo(this.listenerGroup),this.options.easyExit&&p.listen((function(t){t.preventDefault(),e.hide()}),!1).addTo(this.listenerGroup),this.preventChatFocus&&v.fire(!0),void 0!==this.options.onShow&&this.options.onShow(),this.isListeningForChange=!0),this.hideOverlay||(this.overlay.style.display="block")}},{key:"hide",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.overlay.style.display="none",null!==this.element.parentElement&&this.element.parentElement.removeChild(this.element),null!==this.overlay.parentElement&&this.overlay.parentElement.removeChild(this.overlay),this.isListeningForChange&&(this.listenerGroup.removeAll(),this.preventChatFocus&&v.fire(!1),void 0!==this.options.onHide&&this.options.onHide(),this.isListeningForChange=!1,this.addHidePageAction(e))}}]),c}(c.w)},6227:function(e,t,n){"use strict";n.d(t,{Y:function(){return p}});var i=n(7791),o=n(2951),r=n(1976),s=n(824),a=n.n(s),l=n(4189),c=n(3753),u=n(391),d=n(4793),h=n(9165),f=n(9545),p=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;(0,o.Z)(this,e),this.limit=n,this.seenItems=new Set,this.offset=0,this.next=(0,f.mg)((0,i.Z)(a().mark((function e(){var n,i,o,r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getMoreRooms();case 2:return n=e.sent,i=new u.j(n.responseText),o=JSON.parse(i.getObjectString("rooms")),r=o.map((function(e){return(0,l.vx)(new u.j(e))})),t.offset+=r.length,e.abrupt("return",r.filter((function(e){return!t.seenItems.has(e.room)})).filter((function(e){return t.seenItems.add(e.room),!0})));case 8:case"end":return e.stop()}}),e)}))),[]),this.offset=0,this.listener=d.kN.listen((function(e){t.currentRoomGender=(0,h.hP)(e.dossier.roomGender),t.currentRoomName=e.chatConnection.room(),t.seenItems.add(t.currentRoomName)}),!1,!0)}return(0,r.Z)(e,[{key:"setGenders",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.genders=e,this.offset=0,this.seenItems=new Set}},{key:"getMoreRooms",value:function(){var e=new URLSearchParams(window.location.search);return e.set("genders",this.gendersParam().join(",")),e.set("room",this.currentRoomName),e.set("limit","".concat(this.limit)),e.set("offset","".concat(this.offset)),(0,c.Ue)("api/ts/roomlist/more-rooms/?".concat(e.toString()))}},{key:"gendersParam",value:function(){return this.genders.length>0?this.genders:void 0===this.currentRoomGender?window.default_gender.split(""):[this.currentRoomGender]}},{key:"dispose",value:function(){this.listener.removeListener()}}]),e}()},3705:function(e,t,n){"use strict";n.d(t,{AF:function(){return x},N$:function(){return g},NS:function(){return f},Vn:function(){return y},XI:function(){return k},Zs:function(){return h},fg:function(){return m},iL:function(){return S},qV:function(){return v},rh:function(){return p},zB:function(){return T}});var i=n(8759),o=n(7693),r=n(3753),s=n(1289);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};-1!==x()&&(e.PlayerVol=x()),-1!==C()&&(e.TipVol=C())}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;try{p(t);var i=h(t,n);if((0,s.dD)(window.location.search).metrics_debug,void 0===d)return void debug("New Relic is disabled, not sending metric: ".concat(e));0===Object.keys(i).length?d.addPageAction(e):d.addPageAction(e,i)}catch(e){error("New Relic Error in addPageAction: ".concat(e))}}function v(e,t){try{if(void 0===d)return;d.setCustomAttribute(e,t)}catch(e){error("New Relic Error in setCustomAttribute: ".concat(e))}}function g(e){l=e}function y(e){c=e}var b=-1,w=-1;function C(){return 0===w?0:b}function x(){return w}function k(e){b=e}function S(e,t){w=t?0:e}function T(e){"videoonly"!==e&&(u=e)}(0,o.j9)("load",window,(function e(){(0,o.SC)("load",window,e);var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return a(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)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw r}}}}(document.getElementsByTagName("script"));try{for(n.s();!(t=n.n()).done;){var i=t.value;null!==i.src.match(/https:\/\/js-agent\.newrelic\.com\/.*/)&&(0,o.j9)("error",i,(function(){error("Ad blocker stopped analytics collection"),(0,r.I5)("api/adblocker/",{})}))}}catch(e){n.e(e)}finally{n.f()}}))},2896:function(e,t,n){"use strict";n.d(t,{$:function(){return f}});var i=n(2951),o=n(1976),r=n(2800),s=n(7693),a=n(3753),l=n(391),c=n(695),u=n(4406),d=n(9491),h=n(3543),f=function(){function e(){var t=this;(0,i.Z)(this,e),this.usersWithNotes=new Set,(0,c.TF)()||r.J.current.isMobile||(this.getUsernames(!1),(0,s.j9)("focus",window,(function(){t.getUsernames()})),u.x.registerGenerator("notesBadge",(function(e){return t.createChatBadge(e)})))}return(0,o.Z)(e,[{key:"getUsernames",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];(0,a.Ue)("api/notes/usernames/").then((function(n){var i=new l.j(n.responseText),o=JSON.parse(i.getObjectString("usernames"));t?(e.usersWithNotes.forEach((function(t){return o.includes(t)||e.removeUser(t)})),o.forEach((function(t){return e.usersWithNotes.has(t)||e.addUser(t)}))):(e.usersWithNotes.clear(),o.forEach((function(t){e.usersWithNotes.add(t)})))})).catch((function(e){error("Could not retrieve list of users for which currentUser has notes on")}))}},{key:"addUser",value:function(e){this.usersWithNotes.add(e),this.updateChatBadges(e)}},{key:"removeUser",value:function(e){this.usersWithNotes.has(e)&&(this.usersWithNotes.delete(e),this.updateChatBadges(e))}},{key:"createChatBadge",value:function(e){var t=document.createElement("span");t.style.display=this.usersWithNotes.has(e)?"":"none",t.style.marginRight=".1em",t.title=h.ag.notes;var n=(0,d.z2)();return t.appendChild(n),t}},{key:"updateChatBadges",value:function(e){var t=this.usersWithNotes.has(e);u.x.getBadgeElements("notesBadge",e).forEach((function(e){e.style.display=t?"inline-block":"none"}))}}],[{key:"getOrCreateInstance",value:function(){return void 0===e.singletonInstance&&(e.singletonInstance=new e),e.singletonInstance}}]),e}()},9271:function(e,t,n){"use strict";n.d(t,{I:function(){return r}});var i=n(2951),o=n(1976),r=function(){function e(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};(0,i.Z)(this,e),this.ID=0,this.lastValidID=0,this.initialState=t,this.currentState=t,this.lastValidState=t,this.onUpdate=n,this.onRevert=o}return(0,o.Z)(e,[{key:"setInitialState",value:function(e){this.initialState=e,0===this.ID&&(this.currentState=e,this.onUpdate(this.currentState,!1))}},{key:"dispatch",value:function(e,t){var n=this;this.ID+=1,this.currentState=e,this.onUpdate(this.currentState,!0),t.then((function(e){e?n.commit(n.ID):n.revert(n.ID)})).catch((function(){n.revert(n.ID)}))}},{key:"commit",value:function(e){e>this.lastValidID&&(this.lastValidID=e,this.lastValidState=this.currentState,this.onUpdate(this.currentState,ethis.lastValidID&&(this.currentState=this.lastValidState,this.onUpdate(this.currentState,e1&&void 0!==arguments[1])||arguments[1];this.removePlayer(),t="hlsnative"===this.chooseHLSPlayer()?new w.W(this.roomStatusNotifier):this.createVideoJsPlayer(),(0,h.j9)("loadeddata",t.videoElement,(function e(i){t.setMuted(!n),(0,h.SC)("loadeddata",t.videoElement,e)})),t.handleRoomLoaded(e),t.refreshStream(e),n?(t.setVolume(100),t.setMuted(!1)):t.setMuted(!0),this.playerComponent=this.prependChild(t),this.afterPlayerCreated(),this.repositionChildren()}},{key:"forceJPEGPushPlayer",value:function(e){this.removePlayer(),this.createPlayer("jpeg"),this.playerComponent.handleRoomLoaded(e)}}]),x}(p.w);function I(e,t,n){var i=t/(n?x.fo:x.$V),o=t;return i>e&&(o=(i=e)*(n?x.fo:x.$V)),[i,o]}},9169:function(e,t,n){"use strict";n.d(t,{W:function(){return w},y:function(){return b}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(8759),u=n(7693),d=n(1234),h=n(1794),f=n(1625),p=n(3705),m=n(3543),v=n(2974),g=n(2750),y=n(6893);var b=new h.xB("HlsNativePlayer:AirPlayChange"),w=function(e){(0,s.Z)(w,e);var t,n,h=(t=w,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function w(e){var t;(0,i.Z)(this,w),(t=h.call(this,e,"HlsNativePlayer")).lastTimeUpdate=0,t.userUnmuted=!1,t.prevIsMuted=!0,t.usingAirPlay=!1,t.showingNativeControls=!1,t.playableHlsPlayer=t.videoElement,t.element.appendChild(t.videoElement),t.videoMetrics.bindAllHTMLMedia(t.videoElement),b.listen((function(e){t.usingAirPlay=e})),(0,c.s2)()&&g.UG.listen((function(e){t.usingAirPlay||(e?t.refreshStream(t.context):t.videoElement.pause())}),!1),d.C.listen((function(e){t.chatMode=e})),t.videoElement.onclick=function(e){t.play(),debug(["click",e])},t.videoElement.onpause=function(e){debug(["pause",e])},t.videoElement.onplay=function(e){(0,p.fg)("VideoOnloadMuteStatus",{muted:t.videoElement.muted,chatMode:t.chatMode}),t.videoElement.muted?t.prevIsMuted=!0:t.userUnmuted=!0,debug(["play",e])},t.videoElement.oncanplay=function(e){debug(["canplay",e]),t.isStreamReconnecting&&t.removeReconnecting()},t.videoElement.oncanplaythrough=function(e){debug(["canplaythrough",e]);var n=(0,c.jB)();(void 0===n||n<15)&&t.play()},t.videoElement.onseeking=function(e){debug(["seeking",e])},t.videoElement.onerror=function(e){error(e,{},"VIDEO_")},t.videoElement.onvolumechange=function(e){var n=t.videoElement.volume,i=t.videoElement.muted;0===n&&(i=!0),i||t.userUnmuted||0!==(0,p.AF)()||(t.userUnmuted=!0,(0,p.fg)("UserUnmuted",{chatMode:t.chatMode})),t.prevIsMuted!==i&&t.showingNativeControls&&(0,p.fg)("ToggleMute",{newState:i}),t.setControlIsMuted.fire({isMuted:i,save:!0}),t.setControlVolume.fire({volume:100*n,save:!0}),void 0===t.unmuteContainer||i||(t.element.removeChild(t.unmuteContainer),t.unmuteContainer=void 0),t.prevIsMuted=i},t.videoElement.onstalled=function(e){(0,g.oc)()&&!t.isInPictureInPicture&&(t.videoElement.pause(),window.setTimeout((function(){t.play()}),10))},(0,u.j9)("enterpictureinpicture",t.videoElement,(function(){debug("enterpictureinpicture"),y.tb.fire({active:!0})})),(0,u.j9)("leavepictureinpicture",t.videoElement,(function(){debug("leavepictureinpicture"),y.tb.fire({active:!1,videoPaused:t.videoElement.paused})}));var n=t.videoElement.webkitPresentationMode;return(0,u.j9)("webkitpresentationmodechanged",t.videoElement,(function(){var e=t.videoElement.webkitPresentationMode;-1!==["inline","fullscreen"].indexOf(n)&&"picture-in-picture"===e?(debug("enterpictureinpicture"),y.tb.fire({active:!0})):"picture-in-picture"===n&&-1!==["inline","fullscreen"].indexOf(e)&&(debug("leavepictureinpicture"),y.tb.fire({active:!1,videoPaused:t.videoElement.paused})),"fullscreen"===e&&v.S.setFireVideoMode("noninteractive-fullscreen"),"fullscreen"===n&&v.S.setFireVideoMode(v.S.getPreviousNonFullscreenVideoMode()),n=e})),10===(0,c.jB)()&&t.createiOSUnmute(),t}return(0,o.Z)(w,[{key:"loadHlsStream",value:function(e,t){var n=this;this.setTooMuchWaitingTimeout(e),null===this.videoElement.onplaying&&(this.videoElement.onplaying=function(t){n.setTooMuchWaitingTimeout(e)}),null===this.videoElement.ontimeupdate&&(this.videoElement.ontimeupdate=function(t){var i=n.videoElement.currentTime;i-n.lastTimeUpdate>5&&(n.lastTimeUpdate=i,n.setTooMuchWaitingTimeout(e,(function(){n.lastTimeUpdate=0})),n.tryingTimeoutRefresh=!1)}),""!==t?(this.videoElement.src=t,this.roomStatusNotifier.hide()):this.videoElement.removeAttribute("src"),this.videoElement.load(),this.videoElement.style.display="inline";var i=(0,c.jB)();(!("oncanplaythrough"in window)||void 0!==i&&i>=15)&&this.play(),""===t&&(this.stop(),this.stopTooMuchWaitingTimeout())}},{key:"setVolume",value:function(e){this.videoElement.volume=e/100}},{key:"getVolume",value:function(){return this.videoElement.muted||!this.isStreamReconnecting&&this.videoElement.paused?0:100*this.videoElement.volume}},{key:"setMuted",value:function(e){this.videoElement.muted=e,this.setControlIsMuted.fire({isMuted:e,save:!0}),e?this.videoElement.setAttribute("muted",""):this.videoElement.removeAttribute("muted")}},{key:"stop",value:function(){this.lastTimeUpdate=0,this.videoElement.style.display="none",this.videoElement.pause(),this.videoElement.removeAttribute("src"),this.videoElement.load(),(0,r.Z)((0,l.Z)(w.prototype),"stop",this).call(this)}},{key:"showNativeControls",value:function(){(0,r.Z)((0,l.Z)(w.prototype),"showNativeControls",this).call(this),this.showingNativeControls||(this.showingNativeControls=!0,this.videoElement.setAttribute("controls",""),void 0!==this.unmuteContainer&&(this.unmuteContainer.style.display="block"))}},{key:"hideNativeControls",value:function(){this.showingNativeControls&&(this.showingNativeControls=!1,this.videoElement.removeAttribute("controls"),void 0!==this.unmuteContainer&&(this.unmuteContainer.style.display="none"))}},{key:"showCustomControls",value:function(){(0,r.Z)((0,l.Z)(w.prototype),"showCustomControls",this).call(this),this.hideNativeControls()}},{key:"setQualityLevel",value:function(e){}},{key:"setVolumeMuted",value:function(e,t){this.videoElement.volume=e/100,0===e||t?(this.videoElement.muted=!0,this.videoElement.setAttribute("muted","")):(this.videoElement.muted=!1,this.videoElement.removeAttribute("muted"))}},{key:"getControlBarHeight",value:function(){return 0}},{key:"enterFullScreenMode",value:function(){(0,f.Zx)(this.videoElement),this.showNativeControls()}},{key:"toggleFullscreen",value:function(){this.enterFullScreenMode()}},{key:"getVideoElement",value:function(){return this.videoElement}},{key:"createiOSUnmute",value:function(){var e=this;this.unmuteContainer=document.createElement("span"),this.unmuteContainer.style.position="absolute",this.unmuteContainer.style.top="6px",this.unmuteContainer.style.right="6px",this.unmuteContainer.style.opacity="0.8",this.unmuteContainer.style.float="right",this.unmuteContainer.style.backgroundColor="rgba(255, 255, 255, 0.8)",this.unmuteContainer.style.borderRadius="6px",this.unmuteContainer.style.height="36px",this.unmuteContainer.style.padding="3px",this.unmuteContainer.style.cursor="pointer";var t=document.createElement("span");t.textContent=m.ag.tapToUnmute,t.style.color="#0c6a93",t.style.fontSize="14px",t.style.padding="6px",t.style.position="relative",t.style.top="2px",t.style.textShadow="0 0 1px #0c6a93";var n=document.createElement("img");n.src="".concat(STATIC_URL_ROOT,"images/volume-mute.svg"),n.style.width="36px",n.style.height="36px",n.style.display="inline",n.style.verticalAlign="middle",this.unmuteContainer.appendChild(t),this.unmuteContainer.appendChild(n),this.element.appendChild(this.unmuteContainer),this.unmuteContainer.onclick=function(){e.setMuted(!1),void 0!==e.unmuteContainer&&(e.element.removeChild(e.unmuteContainer),e.unmuteContainer=void 0)},window.setTimeout((function(){t.style.display="none"}),5e3)}}]),w}(y._O)},6893:function(e,t,n){"use strict";n.d(t,{_O:function(){return A},g1:function(){return R},tb:function(){return M}});var i=n(7791),o=n(2951),r=n(1976),s=n(7591),a=n(9492),l=n(7597),c=n(824),u=n.n(c),d=n(8759),h=n(2800),f=n(7600),p=n(1612),m=n(2295),v=n(7693),g=n(3753),y=n(9),b=n(1794),w=n(3705),C=n(9992),x=n(1289),k=n(9420),S=n(2750),T=n(5932),I=n(4352);function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==s[1]&&s[1],t.dossier.hlsSource===this.lastSeenHlsUrl||""===t.dossier.hlsSource){e.next=8;break}return this.lastSeenHlsUrl=t.dossier.hlsSource,i=t.chatConnection.status,this.videoOffline&&(i="offline"),e.abrupt("return",{url:this.parseHlsUrl(t.dossier.hlsSource),status:i});case 8:return e.next=10,(0,g.I5)("get_edge_hls_url_ajax/",{room_slug:t.dossier.room,bandwidth:"high",current_edge:"",exclude_edge:n?new URL(this.lastSeenHlsUrl).hostname:""});case 10:if(o=e.sent,!(r=JSON.parse(o.responseText)).success){e.next=17;break}return this.lastSeenHlsUrl=r.url,e.abrupt("return",{url:this.parseHlsUrl(r.url),status:(0,C.gN)(r.room_status)});case 17:throw o.responseText;case 18:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"parseHlsUrl",value:function(e){var t=(0,x.dD)(window.location.search);return void 0!==t.edgemm?e.replace(/(^https:\/\/)(.+?)(\/.+)/,"https://".concat(t.edgemm,".live.mmcdn.com$3")):void 0!==t.edge?e.replace(/(^https:\/\/)(.+?)(\/.+)/,"https://edge".concat(t.edge,".stream.highwebmedia.com$3")):e}},{key:"refreshStream",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.stop(),(0,i.Z)(u().mark((function i(){var o,r,s;return u().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(t.stopQuality(),t.pageLoaded=Date.now(),e.dossier.room===t.room){i.next=5;break}return debug("Trying to refresh old room context"),i.abrupt("return");case 5:return t.lastFrames=0,t.lastDropped=0,t.leaveFrames=void 0,t.hiddenTotal=0,t.hiddenDropped=0,i.prev=10,i.next=13,t.getHlsUrlAndRoomStatus(e,n);case 13:s=i.sent,o=s.url,r=s.status,i.next=22;break;case 18:return i.prev=18,i.t0=i.catch(10),error("Unable to refresh HLS stream",{error:i.t0}),i.abrupt("return");case 22:if("offline"===t.roomStatus&&r!==t.roomStatus&&(t.isStreamReconnecting=!0),t.videoOffline="offline"===r,t.videoOfflineChange.fire(t.videoOffline),"notconnected"===t.roomStatus||"offline"!==r){i.next=28;break}return t.setOfflinePollingTimeout(e),i.abrupt("return");case 28:if("privatenotwatching"!==t.roomStatus||t.roomStatus!==r||!f._.isEnabledForUI()){i.next=30;break}return i.abrupt("return");case 30:t.roomStatus=r,t.loading=Date.now(),t.minutesSincePlay=0,t.startTimesSent=!1,t.loadHlsStream(e,o);case 35:case"end":return i.stop()}}),i,null,[[10,18]])})))().catch((function(){}))}},{key:"refreshStreamOnNewEdge",value:function(e){this.refreshStream(e,!0)}},{key:"tryVideoStart",value:(n=(0,i.Z)(u().mark((function e(){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==(t=this.playableHlsPlayer.play())){e.next=5;break}return e.abrupt("return",{api:"old",success:!this.videoElement.paused});case 5:return e.prev=5,e.next=8,t;case 8:return e.abrupt("return",{api:"new",success:!0});case 11:return e.prev=11,e.t0=e.catch(5),e.abrupt("return",{api:"new",success:!1,error:e.t0});case 14:case"end":return e.stop()}}),e,this,[[5,11]])}))),function(){return n.apply(this,arguments)})},{key:"playInternal",value:(t=(0,i.Z)(u().mark((function e(){var t,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.tryVideoStart();case 2:if(!(t=e.sent).success){e.next=6;break}return this.playbackStart.fire(void 0),e.abrupt("return");case 6:return"old"===t.api&&(0,w.fg)("NoPromiseAutoplayPolicy"),k.SB.fire(void 0),this.setMuted(!0),e.next=11,this.tryVideoStart();case 11:if(!(n=e.sent).success){e.next=15;break}return this.playbackStart.fire(void 0),e.abrupt("return");case 15:"new"===n.api&&(this.isStreamReconnecting||(warn("Unable to play twice in a row",{err:n.error},"VIDEO_"),(0,d.op)()&&(error("Attempting to fallback to JPEG player."),this.stopQuality(),this.requestJPEG.fire(this.context))),this.handleNeverPlayed());case 16:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"play",value:function(){this.playInternal()}},{key:"stop",value:function(){this.roomStatusNotifier.displaysForStatus(this.roomStatus)&&(this.removeReconnecting(),this.clearPlayerTimeouts()),this.isStreamReconnecting&&this.clearPlayerTimeouts(),this.stopTooMuchWaitingTimeout()}},{key:"clearPlayerTimeouts",value:function(){var e,t=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return P(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)?P(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(this.connectingTimeouts);try{for(t.s();!(e=t.n()).done;){var n=e.value;clearTimeout(n)}}catch(e){t.e(e)}finally{t.f()}clearTimeout(this.offlinePollingTimeout),this.offlinePollingTimeout=void 0,clearTimeout(this.onlinePollingTimeout),this.onlinePollingTimeout=void 0}},{key:"setVolume",value:function(e){this.videoElement.volume=e/100}},{key:"getVolume",value:function(){return this.videoElement.muted||!this.isStreamReconnecting&&this.videoElement.paused?0:100*this.videoElement.volume}},{key:"getMuted",value:function(){return this.videoElement.muted}},{key:"showNativeControls",value:function(){this.requestControlVisibility.fire(!1)}},{key:"showCustomControls",value:function(){this.requestControlVisibility.fire(!0)}},{key:"showControls",value:function(){(0,T.A)()?this.showCustomControls():this.showNativeControls()}},{key:"hideControls",value:function(){this.requestControlVisibility.fire(!1),this.hideNativeControls()}},{key:"setVolumeMuted",value:function(e,t){}},{key:"enterFullScreenMode",value:function(){}},{key:"getControlBarHeight",value:function(){return 0}},{key:"handleNeverPlayed",value:function(){this.stopTooMuchWaitingTimeout()}},{key:"handleRoomLoaded",value:function(e){var t=this;this.videoOffline=!1,this.showJpeg=!h.J.current.isTestbed,this.videoElement.poster=this.showJpeg?"".concat(p.w.jpegStreamUrl,"stream?room=").concat(e.dossier.room,"&f=").concat(Math.random()):"",this.context=e,this.room=e.dossier.room,e.chatConnection.event.statusChange.listen((function(n){if(t.roomStatus=n.currentStatus,t.videoMetrics.setStatus(t.roomStatus),t.roomStatusNotifier.displaysForStatus(n.currentStatus)||t.videoOffline)t.stop(),t.stopTooMuchWaitingTimeout(),t.videoOffline?t.setOfflinePollingTimeout(e):t.setOnlinePollingTimeout(e);else switch(clearTimeout(t.onlinePollingTimeout),t.onlinePollingTimeout=void 0,n.previousStatus){case"notconnected":case"privaterequesting":break;default:"notconnected"===n.currentStatus?(t.setReconnecting(e.dossier.room),window.setTimeout((function(){t.refreshStreamOnNewEdge(e)}),0)):(t.connectingTimeouts.push(window.setTimeout((function(){t.setReconnecting(e.dossier.room)}),0)),t.connectingTimeouts.push(window.setTimeout((function(){t.refreshStream(e)}),3e3)))}}))}},{key:"setReconnecting",value:function(e){var t=this.showJpeg?"".concat(p.w.jpegStreamUrl,"stream?room=").concat(e,"&f=").concat(Math.random()):"";this.element.style.background="#333333 url(".concat(t,") center center / cover"),this.roomStatusNotifier.showConnectingStatus(),this.element.insertBefore(this.connectingOverlay,this.element.firstChild),this.isStreamReconnecting=!0}},{key:"removeReconnecting",value:function(){this.isStreamReconnecting=!1,this.roomStatusNotifier.hideConnectingStatus(),this.connectingOverlay.parentElement===this.element&&this.element.removeChild(this.connectingOverlay),this.element.style.background="#333333 url(".concat(STATIC_URL,"cam_notice_background.jpg) center center / cover")}},{key:"setOnlinePollingTimeout",value:function(e){var t=this;void 0===this.onlinePollingTimeout&&(this.onlinePollingTimeout=window.setTimeout((0,i.Z)(u().mark((function n(){return u().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.getHlsUrlAndRoomStatus(e);case 2:"offline"===n.sent.status?(t.videoOffline=!0,t.onlinePollingTimeout=void 0,t.setOfflinePollingTimeout(e),t.videoOfflineChange.fire(t.videoOffline)):(t.onlinePollingTimeout=void 0,t.setOnlinePollingTimeout(e));case 4:case"end":return n.stop()}}),n)}))),1e4))}},{key:"setOfflinePollingTimeout",value:function(e){var t=this;void 0===this.offlinePollingTimeout&&(this.offlinePollingTimeout=window.setTimeout((function(){t.offlinePollingTimeout=void 0,t.refreshStream(e)}),1e4))}},{key:"setTooMuchWaitingTimeout",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};this.stopTooMuchWaitingTimeout(),this.tooMuchWaitingTimeout=window.setTimeout((function(){t.tryingTimeoutRefresh?(t.removeReconnecting(),error("Attempting to fallback to JPEG player."),t.stopQuality(),t.requestJPEG.fire(t.context)):!(0,S.oc)()||t.isInPictureInPicture?t.setTooMuchWaitingTimeout(e,n):(info("Video seems to be stuck, refreshing"),t.tryingTimeoutRefresh=!0,t.refreshStreamOnNewEdge(e),n())}),1e3*R/2)}},{key:"stopTooMuchWaitingTimeout",value:function(){void 0!==this.tooMuchWaitingTimeout&&(clearTimeout(this.tooMuchWaitingTimeout),this.tooMuchWaitingTimeout=void 0)}},{key:"getVideoElement",value:function(){return this.videoElement}},{key:"onForceRemoved",value:function(){this.videoMetrics.playerForceRemoved()}},{key:"setPageLoaded",value:function(e){this.pageLoaded=e}},{key:"stopQuality",value:function(){clearInterval(this.updateQuality)}},{key:"startQualityTracking",value:function(){var e=this;this.stopQuality(),window.setTimeout((function(){e.sendQuality(),e.updateQuality=window.setInterval((function(){e.sendQuality()}),6e4)}),5e3)}},{key:"sendQuality",value:function(){if(!document.hidden){var e=0,t=0,n=0,i=0,o=0,r=0;if(!(0,d.Tt)()){var s=this.videoElement.getVideoPlaybackQuality();t=s.droppedVideoFrames-this.hiddenDropped,n=-1,(e=s.totalVideoFrames-this.hiddenTotal)>0&&(n=t/e*100),o=t-this.lastDropped,i=-1,(r=e-this.lastFrames)>0&&(i=o/r*100),this.lastFrames=e,this.lastDropped=t}var a=this.videoElement.videoHeight*this.videoElement.videoWidth;this.videoMetrics.sendQuality(n,i,e,r,a,this.videoElement.videoHeight,this.minutesSincePlay,this.roomStatus)}this.minutesSincePlay+=1}}]),B}(y.w)},1250:function(e,t,n){"use strict";n.d(t,{z:function(){return y}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(8759),c=n(2800),u=n(1612),d=n(3753),h=n(391),f=n(9),p=n(1794),m=n(1625),v=n(9992),g=n(4352);var y=function(e){(0,r.Z)(y,e);var t,n,f=(t=y,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function y(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,i.Z)(this,y),(t=f.call(this)).roomStatusNotifier=e,t.isHlsPlaceholder=n,t.requestControlVisibility=new p.xB("requestControlVisibility"),t.supportsAutoplayWithAudio=!1,t.possibleQualityLevelsChanged=new p.xB("possibleQualityLevelsChanged"),t.videoOfflineChange=new p.xB("videoOfflineChange"),t.playbackStart=new p.xB("playbackStart"),t.lastFrameTime=0,t.loading=!1,t.muted=!0,t.stopped=!0,t.url="",t.lastTime=0,t.listenerGroup=new p.mM,t.videoMetrics=new g.Mf(t.isHlsPlaceholder?"JpegToHlsPlayer":"JpegPushPlayer"),t.videoMetrics.bindAll(),t.element.style.background="#333333 url(".concat(STATIC_URL,"cam_notice_background.jpg) center center / cover"),t.element.className="videoPlayerDiv",t.element.style.position="static",t.element.dataset.testid="video-container",t.playerImage=document.createElement("img"),t.playerImage.style.width="100%",t.playerImage.style.height="100%",t.playerImage.style.objectFit="contain",t.playerImage.style.backgroundColor="black",t.playerImage.dataset.testid="video",t.playerImage.onload=function(){t.playerImage.style.display="inline",t.loading=!1},t.playerImage.onerror=function(){t.playerImage.style.display="none",t.lastTime-=100,t.loading=!1},t.element.appendChild(t.playerImage),(0,l.v8)()||(t.requestAnimationFrame=(0,l.I3)(),t.requestAnimationCallback(0)),t}return(0,o.Z)(y,[{key:"updateAjaxUrl",value:function(){var e=this;this.lastTime=Date.now(),void 0!==this.roomName&&(0,d.I5)("get_edge_hls_url_ajax/",{room_slug:this.roomName,jpeg:"1"}).then((function(t){var n=new h.j(t.responseText),i=n.getBoolean("success");if("offline"===(0,v.wg)(n))return e.videoOfflineChange.fire(!0),void e.stop();e.videoOfflineChange.fire(!1),n.ignore("url"),n.ignore("hidden_message"),i?(e.url=n.getString("cbjpeg_url",!1),n.logUnusedDebugging("parseJpegStream")):error("Unable to refresh JPEG stream",{error:t.responseText},"VIDEO_")})).catch((function(e){error("Unable to refresh JPEG stream",{error:e},"VIDEO_")}))}},{key:"requestAnimationCallback",value:function(e){var t=this;this.isHlsPlaceholder||(Date.now()-this.lastTime>5e3&&this.updateAjaxUrl(),this.stopped||""===this.url||(0,l.v8)()?this.playerImage.style.visibility="hidden":(0===this.lastFrameTime||e-this.lastFrameTime>140)&&!this.loading&&(this.loading=!0,this.lastFrameTime=e,this.playerImage.src="".concat(this.url,"&f=").concat(Math.random()),"visible"!==this.playerImage.style.visibility&&(this.playbackStart.fire(void 0),this.playerImage.style.visibility="visible")),this.requestAnimationFrame.call(window,(function(e){t.requestAnimationCallback(e)})))}},{key:"handleRoomLoaded",value:function(e){var t=this;this.stopped=!1,this.listenerGroup.removeAll(),e.chatConnection.event.statusChange.listen((function(e){t.roomStatusNotifier.displaysForStatus(e.currentStatus)||t.videoOffline?t.stop():(e.currentStatus,t.stopped=!1)})).addTo(this.listenerGroup),this.roomName=e.dossier.room,this.url=c.J.current.isTestbed?"":"".concat(u.w.jpegStreamUrl,"stream?room=").concat(this.roomName),this.requestControlVisibility.fire(!0),this.isHlsPlaceholder&&(this.playerImage.src="".concat(this.url,"&f=").concat(Math.random()),this.showPlayerImage())}},{key:"setVolume",value:function(e){this.volume=e}},{key:"getVolume",value:function(){return this.muted?0:this.volume}},{key:"setMuted",value:function(e){this.muted=e}},{key:"stop",value:function(){this.playerImage.style.visibility="hidden",this.stopped=!0}},{key:"showPlayerImage",value:function(){this.playerImage.style.visibility="visible"}},{key:"setQualityLevel",value:function(){}},{key:"showControls",value:function(){this.requestControlVisibility.fire(!0)}},{key:"hideControls",value:function(){this.requestControlVisibility.fire(!1)}},{key:"getControlBarHeight",value:function(){return 0}},{key:"enterFullScreenMode",value:function(){(0,m.Zx)(this.element)}},{key:"setVolumeMuted",value:function(e,t){}},{key:"afterRemovedFromParent",value:function(){this.stop(),this.listenerGroup.removeAll()}},{key:"getVideoElement",value:function(){}},{key:"getIsHlsPlaceholder",value:function(){return this.isHlsPlaceholder}},{key:"onForceRemoved",value:function(){this.videoMetrics.playerForceRemoved()}}]),y}(f.w)},2833:function(e,t,n){"use strict";n.d(t,{$V:function(){return r},TB:function(){return l},cm:function(){return c},fo:function(){return s}});var i=n(8759);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw s}}}}(e);try{for(r.s();!(n=r.n()).done;){var s=n.value;s.value===t&&window.localStorage.setItem(a,s.label)}}catch(e){r.e(e)}finally{r.f()}}}function c(){var e="auto";if((0,i.IU)()){var t=window.localStorage.getItem(a);null!==t&&(e=t)}return e}},5932:function(e,t,n){"use strict";n.d(t,{A:function(){return r}});var i=n(2800),o=n(2974);function r(){if(!0===i.J.current.isMobile)return!0;var e=o.S.getVideoMode();return"split"!==e&&"videoonly"!==e&&"noninteractive-fullscreen"!==e}},1432:function(e,t,n){"use strict";n.d(t,{n:function(){return w}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(2800),u=n(1522),d=n(1234),h=n(3705),f=n(6893),p=n(2833),m=n(5932);function v(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return g(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)?g(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=10&&clearInterval(n),void 0!==e.videoJs&&void 0!==e.videoJs.chromecastSessionManager&&(e.videoJs.chromecastSessionManager.getCastContext().addEventListener("sessionstatechanged",(function(t){if(void 0!==t.sessionState)switch(t.sessionState){case"SESSION_STARTED":case"SESSION_RESUMED":e.removeTech(),e.removeEventListeners(),e.stop(),window.setTimeout((function(){e.isCasting=!0,e.refreshStream(e.context),e.setVolume(e.getVolume(!1)),e.addChromecastMsgListener(),void 0!==e.videoJs&&(e.videoJs.tech_._ui._findTitleEl().style.visibility="hidden")}),1e3),e.roomStatusNotifier.hide(),e.addChromecastOverlay();break;case"SESSION_ENDED":window.setTimeout((function(){if(void 0!==e.videoJs){e.isCasting=!1;var t=e.getVolume(!1);e.videoJs.muted(e.isMuted),e.videoJs.volume(t),e.refreshStream(e.context),e.addTech(),e.addEventListeners()}else debug("Error: videoJs undefined!")}),2500),e.removeChromecastOverlay(),e.roomStatusNotifier.show()}})),clearInterval(n)),t+=1}),1e3)}},{key:"loadHlsStream",value:function(e,t){var n=this;""!==t?(this.roomStatusNotifier.hide(),this.isCasting?(this.addChromecastOverlay(),this.roomStatusNotifier.hide(),this.stopTooMuchWaitingTimeout()):this.setTooMuchWaitingTimeout(e),void 0!==this.videoJs?(this.isCasting?this.videoJs.tech_.setSource({src:t,type:"application/x-mpegURL"}):this.isCasting||(this.videoJs.on("playing",(function(){n.setTooMuchWaitingTimeout(e)})),this.videoJs.on("waiting",(function(){n.setTooMuchWaitingTimeout(e)})),this.videoJs.on("timeupdate",(function(t){if(void 0!==n.videoJs){var i=n.videoJs.currentTime();i-n.lastTimeUpdate>5&&(n.lastTimeUpdate=i,n.setTooMuchWaitingTimeout(e,(function(){n.lastTimeUpdate=0})),n.tryingTimeoutRefresh=!1)}})),this.videoJs.off("error"),this.videoJs.on("error",(function(t){if(void 0!==n.videoJs){var i=n.videoJs.error();null===i||2!==i.code&&4!==i.code||(n.isStreamReconnecting||n.refreshStreamOnNewEdge(e),error(i.message,t,"VIDEO_"))}else error("Videojs error type undefined",t,"VIDEO_")})),this.videoJs.src({src:t,type:"application/x-mpegURL"}),this.videoJs.qualityPickerPlugin(),this.videoJs.show(),this.videoJs.muted(this.isMuted),this.videoElement.style.display="inline"),this.playableHlsPlayer=this.videoJs,this.addTech()):(0,u.Cj)("something went wrong")):this.stop()}},{key:"addChromecastMsgListener",value:function(){var e=this;if(this.isCasting&&void 0!==this.videoJs&&void 0!==this.videoJs.chromecastSessionManager){var t=this.videoJs.chromecastSessionManager.getCastContext().getCurrentSession();if(void 0!==t){var n=0;t.addMessageListener("urn:x-cast:com.highwebmedia.cast.media",(function(t,i){e.isCasting&&i.includes("PAUSED")?(clearTimeout(n),n=window.setTimeout((function(){e.refreshStream(e.context)}),2500)):e.isCasting&&i.includes("BUFFERING")?(clearTimeout(n),n=window.setTimeout((function(){e.refreshStream(e.context)}),7500)):!e.isCasting||i.includes("PLAYING")?clearTimeout(n):e.isCasting&&i.includes("MEDIA_ERROR")&&e.refreshStreamOnNewEdge(e.context)}))}}}},{key:"setVolume",value:function(e){if(void 0!==this.videoJs){var t=this.isMuted;this.isMuted=0===e||this.videoJs.muted(),!t||this.isMuted||this.userUnmuted||(this.userUnmuted=!0,(0,h.fg)("UserUnmuted",{chatMode:this.chatMode})),t!==this.isMuted&&(0,h.fg)("ToggleMute",{newState:this.isMuted}),this.setControlVolume.fire({volume:e,save:!0}),this.setControlIsMuted.fire({isMuted:this.isMuted,save:!0})}}},{key:"setMuted",value:function(e){!this.isMuted||e||this.userUnmuted||(this.userUnmuted=!0,(0,h.fg)("UserUnmuted",{chatMode:this.chatMode})),e!==this.isMuted&&(0,h.fg)("ToggleMute",{newState:e}),this.isMuted=e,this.setControlIsMuted.fire({isMuted:e,save:!0}),void 0!==this.videoJs&&this.videoJs.muted(e)}},{key:"setVolumeMuted",value:function(e,t){this.isMuted=t,void 0!==this.videoJs&&(this.videoJs.volume(e/100),this.videoJs.muted(t))}},{key:"getVolume",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return void 0!==this.videoJs?e&&this.videoJs.muted()?0:100*this.videoJs.volume():0}},{key:"getMuted",value:function(){return void 0===this.videoJs||this.videoJs.muted()}},{key:"stop",value:function(){if(this.lastTimeUpdate=0,this.isCasting||void 0===this.videoJs){if(this.isCasting&&void 0!==this.videoJs)return this.videoJs.pause(),this.videoJs.src(),void this.videoJs.hide()}else this.videoJs.off("timeupdate"),this.videoJs.off("waiting"),this.videoJs.off("playing"),this.videoJs.pause(),this.removeTech(),this.videoJs.src(),this.videoJs.hide(),this.videoJs.muted(this.isMuted);(0,r.Z)((0,l.Z)(w.prototype),"stop",this).call(this)}},{key:"addChromecastOverlay",value:function(){this.chromecastOverlay!==this.element.firstChild&&this.element.insertBefore(this.chromecastOverlay,this.element.firstChild)}},{key:"removeChromecastOverlay",value:function(){this.chromecastOverlay.parentElement===this.element&&this.element.removeChild(this.chromecastOverlay)}},{key:"addTech",value:function(){var e=this;this.isCasting||void 0!==this.tech||void 0===this.videoJs||(this.tech=this.videoJs.tech(),this.tech.on("loadedqualitydataTS",(function(t,n){(0,h.fg)("VideoOnloadMuteStatus",{muted:e.isMuted,chatMode:e.chatMode}),e.isMuted||(e.userUnmuted=!0);var i,o=[],r="auto",s=v(n.qualityData.video);try{for(s.s();!(i=s.n()).done;){var a=i.value;o.push({label:a.label,toggled:a.selected,value:a.id}),!0===a.selected&&(r=a.label)}}catch(e){s.e(e)}finally{s.f()}var l,c=v(document.getElementsByClassName("vjs-menu-item vjs-selected"));try{for(c.s();!(l=c.n()).done;){var u=l.value;u.getElementsByClassName("vjs-menu-item-text")[0].innerHTML!==r&&(u.classList.remove("vjs-selected"),u.ariaChecked="false",u.getElementsByClassName("vjs-control-text")[0].innerHTML="")}}catch(e){c.e(e)}finally{c.f()}e.setLevels=o,e.possibleQualityLevelsChanged.fire(o),e.extractLevelSelectionForMetrics(o),void 0===n.qualitySwitchCallback&&(0,h.fg)("clickMenuLink:QualitySelect-".concat(o.filter((function(e){return e.toggled}))[0].label))})))}},{key:"removeEventListeners",value:function(){this.isCasting||void 0===this.videoJs||(this.videoJs.off("canplay"),this.videoJs.off("canplaythrough"))}},{key:"addEventListeners",value:function(){var e=this;this.isCasting||void 0===this.videoJs||(this.videoJs.on("canplay",(function(){e.play(),e.isStreamReconnecting&&e.removeReconnecting()})),this.videoJs.on("canplaythrough",(function(){e.play()})))}},{key:"removeTech",value:function(){this.isCasting||void 0===this.tech||(this.tech.off("loadedqualitydataTS"),void 0!==this.tech.hlsProvider&&this.tech.hlsProvider.dispose(),this.tech.reset(),this.tech=void 0)}},{key:"setQualityLevel",value:function(e){void 0!==this.videoJs&&this.videoJs.selectQualityButton(e)}},{key:"handleNeverPlayed",value:function(){(0,r.Z)((0,l.Z)(w.prototype),"handleNeverPlayed",this).call(this),this.requestControlVisibility.fire(!0),this.neverPlayed=!0}},{key:"showNativeControls",value:function(){(0,r.Z)((0,l.Z)(w.prototype),"showNativeControls",this).call(this),void 0!==this.videoJs&&this.videoJs.controls(!0)}},{key:"lockShowingControls",value:function(){void 0!==this.videoJs&&(this.showNativeControls(),this.videoJs.controlBar.lockShowing())}},{key:"unlockShowingControls",value:function(){void 0!==this.videoJs&&this.videoJs.controlBar.unlockShowing()}},{key:"showCustomControls",value:function(){(0,r.Z)((0,l.Z)(w.prototype),"showCustomControls",this).call(this),this.hideNativeControls()}},{key:"hideNativeControls",value:function(){void 0!==this.videoJs&&this.videoJs.controls(!1)}},{key:"enterFullScreenMode",value:function(){void 0!==this.videoJs&&(this.videoJs.requestFullscreen(),this.showNativeControls())}},{key:"getControlBarHeight",value:function(){return 0}},{key:"getVideoElement",value:function(){return this.videoElement}},{key:"getVideoJs",value:function(){return this.videoJs}},{key:"extractLevelSelectionForMetrics",value:function(e){var t,n=v(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;i.toggled&&this.videoMetrics.setQualityLevel(i.label)}}catch(e){n.e(e)}finally{n.f()}}}]),w}(f._O)},4352:function(e,t,n){"use strict";n.d(t,{ub:function(){return E},uj:function(){return O},Mf:function(){return B},ZV:function(){return T}});var i=n(3243),o=n(7591),r=n(9492),s=n(7597),a=n(4649),l=n(2951),c=n(1976),u=n(8759),d=n(2800),h=n(7693),f=n(3753),p=n(391),m=n(4793),v=n(1282),g=n(3705),y=n(928),b=n(1289),w=function(){function e(){(0,l.Z)(this,e),this.pendingMessages=[],this.qualityUpdatesKey="qualityUpdates",this.saveTimeSecondsKey="saveTimeSeconds",this.messagesKey="messages","undefined"!=typeof sessionStorage&&this.loadFromSessionStorage(),this.intervalId=window.setInterval(this.sendMessages.bind(this),5e3)}return(0,c.Z)(e,[{key:"addMessage",value:function(e){this.pendingMessages.push(e)}},{key:"stop",value:function(){clearInterval(this.intervalId),"undefined"==typeof sessionStorage?this.sendMessages():this.saveToSessionStorage()}},{key:"sendMessages",value:function(){if(this.pendingMessages.length>0){var e=(0,a.Z)({},this.qualityUpdatesKey,JSON.stringify(this.pendingMessages));this.pendingMessages=[],(0,f.I5)("api/ts/chat/send-player-quality/",e)}}},{key:"saveToSessionStorage",value:function(){var e;this.pendingMessages.length>0&&(sessionStorage.setItem(this.qualityUpdatesKey,JSON.stringify((e={},(0,a.Z)(e,this.saveTimeSecondsKey,(new Date).getTime()/1e3),(0,a.Z)(e,this.messagesKey,this.pendingMessages),e))),this.pendingMessages=[])}},{key:"loadFromSessionStorage",value:function(){var e=sessionStorage.getItem(this.qualityUpdatesKey);if(sessionStorage.removeItem(this.qualityUpdatesKey),null==e)this.pendingMessages=[];else{var t=JSON.parse(e);(new Date).getTime()/1e3-t[this.saveTimeSecondsKey]<=60&&(this.pendingMessages=t[this.messagesKey])}}}]),e}();function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{})}function I(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=A.getInstance().browserId;if(void 0!==t){if("a"!==t.charAt(t.length-1)&&!1===d.J.current.sample_metrics_off)return;if(M(e),("playerError"===e.eventName||"playerQuality"===e.eventName)&&!0===e.stopped)return;if(!0===e.badFrames){var n={};for(var i in e)n["attributes.".concat(i)]=e[i];(0,f.I5)("api/ts/chat/send-quality/",n)}else(0,g.fg)("VideoMetric",e,!0)}}function P(){return(new Date).getTime()}function R(){return(0,u.vA)()?window.performance.now():P()}function M(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=d.q.getState().quality;void 0!==t&&(e.fpsquality=t.quality,e.rate=t.rate,e.stopped=t.stopped,e.tabHidden=document.hidden,e.videoSessionID=A.getInstance().value),e.region=d.q.getState().edgeRegion,e.isiPad=(0,u._1)(),delete e.tid}var A=function(){function e(){(0,l.Z)(this,e);var t=window.browserId;if(void 0===t){var n=d.q.getState();""===n.room&&window.initialRoomDossier&&(n=(0,y.As)(new p.j(window.initialRoomDossier))),this.browserId=n.browserId,(0,g.N$)(n.room)}else this.browserId=t}return(0,c.Z)(e,[{key:"value",get:function(){return void 0===this.__value&&(this.__value=this.generate()),this.__value}},{key:"clear",value:function(){this.__value=void 0}},{key:"generate",value:function(){return"".concat(this.browserId,":").concat(P())}}],[{key:"getInstance",value:function(){return void 0===e.instance&&(e.instance=new e),e.instance}}]),e}(),E=function(){function e(){(0,l.Z)(this,e),(0,u.vA)()&&(this.start=R())}return(0,c.Z)(e,[{key:"send",value:function(e,t,n){if((0,u.vA)()&&void 0!==this.start){var i=R()-this.start-t,o=this.start=R(),r={eventName:"autoPlayDuration",autoPlayDuration:o/1e3,autoPlayDurationMS:o,autoPlayDurationNoDelay:i/1e3,autoPlayDurationNoDelayMS:i,autoPlayable:e};0!==t&&(r.autoPlayHiddenDelay=t/1e3,r.autoPlayHiddenDelayMS=t),null!=n&&(r.autoPlayError=n),I(r)}}}]),e}(),B=function(){function e(t){var n=this;(0,l.Z)(this,e),this.windowUnloadSent=!1,this.roomListening=!1,this.roomDuration=0,this.roomsVisited=0,this.sendMetric=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};I(k({playerType:n.playerName,roomDuration:n.roomDuration,roomsVisited:n.roomsVisited,roomStatus:n.roomStatus},e))},this.sendPlayerCreatedMetric=function(){var e={eventName:"playerCreated"},t=(0,b.dD)(window.location.search).player;void 0!==t&&(e.playerOverride=t),n.sendMetric(e),n.createdTime=R()},this.onRoomLoaded=function(e){n.roomLoadedTime=R(),A.getInstance().browserId=e.dossier.browserId,n.roomName=e.dossier.room},this.onRoomUnloaded=function(){n.windowUnloadSent||(n.sendUnloadMetrics(),A.getInstance().clear())},this.onWindowUnloaded=function(){n.windowUnloadSent||(n.sendUnloadMetrics(),void 0!==n.qualityNotifier&&n.qualityNotifier.stop(),n.windowUnloadSent=!0,n.removeListeners())},(0,v.L)("VDPEnblBEQualNR")&&(this.qualityNotifier=new w),this.playerName=t,this.sendPlayerCreatedMetric()}return(0,c.Z)(e,[{key:"bindAll",value:function(){this.removeListeners(),m.kN.listen(this.onRoomLoaded),m.QN.listen(this.onRoomUnloaded),(0,h.j9)("pagehide",window,this.onWindowUnloaded),(0,h.j9)("beforeunload",window,this.onWindowUnloaded),(0,h.j9)("unload",window,this.onWindowUnloaded),this.roomListening=!0}},{key:"addBatchedMetric",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,g.rh)(e),M(e);var t=(0,g.Zs)(e,!0);void 0!==this.qualityNotifier&&this.qualityNotifier.addMessage(t)}},{key:"sendUnloadMetrics",value:function(){if(void 0!==this.roomLoadedTime&&(0,u.vA)()){this.roomUnloadedTime=R();var e=this.roomUnloadedTime-this.roomLoadedTime;return this.sendMetric({room_user:this.roomName,eventName:"viewerDuration",viewerDuration:e/1e3,viewerDurationMS:e}),e}}},{key:"removeListeners",value:function(){this.roomListening&&((0,h.SC)("pagehide",window,this.onWindowUnloaded),(0,h.SC)("beforeunload",window,this.onWindowUnloaded),(0,h.SC)("unload",window,this.onWindowUnloaded),m.kN.removeListener(this.onRoomLoaded),m.QN.removeListener(this.onRoomUnloaded),this.roomListening=!1)}},{key:"playerForceRemoved",value:function(){this.onWindowUnloaded()}}],[{key:"jpegFallback",value:function(){I({eventName:"jpegFallback",hlsNativeSupported:(0,u.iC)(),hlsJsSupported:S.isSupported()})}}]),e}(),O=function(e){(0,o.Z)(d,e);var t,n,a=(t=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,s.Z)(t);if(n){var o=(0,s.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,r.Z)(this,e)});function d(e){var t;return(0,l.Z)(this,d),(t=a.call(this,e)).htmlMediaListening=!1,t.htmlMediaPlayingSent=!1,t.htmlMediaPlayingIsAjax=!1,t.hlsJsListening=!1,t.lastError={},t.sendHTMLMediaPlayingMetric=function(){if(!t.htmlMediaPlayingSent){var e={eventName:"videoPlaying",isAjax:!1,bitrate:t.hlsCurrentBitrate},n=t.currentProgramDateTime();void 0!==n&&t.sendHLSMetric({eventName:"broadcastDelay",broadcastDelayMS:n,broadcastDelay:n/1e3});var i=R();if(void 0===t.htmlMediaLoadStartTime)warn("Playing metric has triggered but htmlMediaLoadStartTime is undefined...skipping");else{var o=i-t.htmlMediaLoadStartTime;e.timeSinceMediaLoadStart=o/1e3,e.timeSinceMediaLoadStartMS=o}if(void 0!==t.hlsMediaAttachingTime){var r=i-t.hlsMediaAttachingTime;e.timeSinceMediaAttaching=r/1e3,e.timeSinceMediaAttachingMS=r}if(t.htmlMediaPlayingIsAjax){if(void 0===t.roomLoadedTime)return void warn("Playing metric is for AJAX reload but roomLoadedTime is undefined...skipping");var s=i-t.roomLoadedTime;e.timeSinceLoadAjax=s/1e3,e.timeSinceLoadAjaxMS=s,e.isAjax=!0,void 0===t.roomUnloadedTime?warn("Playing metric is for AJAX reload but roomUnloadedTime is undefined"):(s=i-t.roomUnloadedTime,e.timeSinceUnloadAjax=s/1e3,e.timeSinceUnloadAjaxMS=s)}else{var a=i-t.createdTime;e.timeSincePlayerCreated=a/1e3,e.timeSincePlayerCreatedMS=a}t.sendHLSMetric(e),t.htmlMediaPlayingSent=!0,t.htmlMediaPlayingIsAjax=!0}},t.sendHTMLMediaErrorMetric=function(){var e;null!=(e=t.playerElement instanceof HTMLMediaElement?t.playerElement.error:t.playerElement.error_)&&t.sendHLSMetric({eventName:"playerError",errorCode:e.code,errorMessage:e.message,errorSource:"HTMLMediaElement",errorReadyState:t.playerElement.readyState,errorNetworkState:t.playerElement.networkState,bitrate:t.hlsCurrentBitrate})},t.onHTMLMediaEvent=function(e){if(t.htmlMediaListening)if("playing"!==e.type)if("loadstart"!==e.type)if("error"!==e.type)if("stalled"!==e.type)warn("Received unknown HTMLMediaElement event: ",e);else{var n=e.target;if(null!=n){var i={eventName:"playerStalled",stalledReadyState:n.readyState,stalledNetworkState:n.networkState,bitrate:t.hlsCurrentBitrate};(0,v.L)("VDPEnblBEQualNR")&&t.addBatchedMetric(i),(0,v.L)("VDPDisblFEQualNR")||t.sendHLSMetric(i)}}else t.sendHTMLMediaErrorMetric();else t.htmlMediaLoadStartTime=R();else t.sendHTMLMediaPlayingMetric()},t.bindAllHlsJs=function(e){t.removeHLSListeners(),t.hls=e,t.hls.on(S.Events.ERROR,t.onHlsJsEvent),t.hls.on(S.Events.FRAG_CHANGED,t.onHlsJsEvent),(0,u.vA)()&&(t.hls.on(S.Events.LEVEL_SWITCHING,t.onHlsJsEvent),t.hls.on(S.Events.LEVEL_SWITCHED,t.onHlsJsEvent),t.hls.on(S.Events.MEDIA_ATTACHING,t.onHlsJsEvent)),t.hlsJsListening=!0},t.addHlsJsLevel=function(e){var n=e.level;if(void 0!==n){for(var i=0,o=["bitrate","height","width"];i=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(t.hlsJsSwitchingTimes);try{for(s.s();!(o=s.n()).done;){var a=o.value;if(a.level===n){var l=(r=a.ts,R()-r);t.hlsJsSwitchedTimes.push(l);break}}}catch(e){s.e(e)}finally{s.f()}(void 0===t.hlsJsMaxLevel||i.bitrate>t.hlsJsMaxLevel.bitrate)&&(t.hlsJsMaxLevel=i),t.hlsCurrentBitrate=i.bitrate}else warn("Received unknown Hls.Events.LEVEL_SWITCHED level: ",e)}else warn("Received Hls.Events.LEVEL_SWITCHED without a level: ",e)},t.currentProgramDateTime=function(){var e;if(void 0!==t.hlsLastFrag&&void 0!==(e=t.playerElement instanceof HTMLMediaElement?t.playerElement.currentTime:t.playerElement.currentTime())){var n=e-t.hlsLastFrag.start;if(!(n<0)){n*=1e3;var i=P()-t.hlsLastFrag.programDateTime+n;if(!(i<0||i>3e5))return i}}},t.onHlsJsEvent=function(e,n){if(t.hlsJsListening)if(e!==S.Events.LEVEL_SWITCHING)if(e!==S.Events.LEVEL_SWITCHED)if(e!==S.Events.FRAG_CHANGED)if(e!==S.Events.MEDIA_ATTACHING)if(e!==S.Events.ERROR)warn("Received unknown Hls.Event: ",e);else{var i=t.playerElement.tech().el(),o={eventName:"playerError",errorCode:n.type,errorMessage:n.details,errorSource:"hls.js",errorReadyState:i.readyState,errorNetworkState:i.networkState,bitrate:t.hlsCurrentBitrate,quality:t.hlsCurrentQualityLevel};(t.lastError!==o||void 0!==t.lastTime&&Date.now()-t.lastTime>1e3)&&(t.sendHLSMetric(o),t.lastError=o,t.lastTime=Date.now())}else t.hlsMediaAttachingTime=R();else t.hlsLastFrag=n.frag;else t.setMaxHlsLevel(n);else t.addHlsJsLevel(n)},t.removeHLSListeners=function(){t.hlsJsListening&&void 0!==t.hls&&(t.hls.off(S.Events.ERROR,t.onHlsJsEvent),t.hls.off(S.Events.FRAG_CHANGED,t.onHlsJsEvent),(0,u.vA)()&&(t.hls.off(S.Events.LEVEL_SWITCHING,t.onHlsJsEvent),t.hls.off(S.Events.LEVEL_SWITCHED,t.onHlsJsEvent)),t.hlsJsListening=!1)},t.removeHTMLMediaListeners=function(){t.htmlMediaListening&&(t.playerElement instanceof HTMLMediaElement?((0,u.vA)()&&((0,h.SC)("playing",t.playerElement,t.onHTMLMediaEvent),(0,h.SC)("loadstart",t.playerElement,t.onHTMLMediaEvent)),(0,h.SC)("error",t.playerElement,t.onHTMLMediaEvent),(0,h.SC)("stalled",t.playerElement,t.onHTMLMediaEvent)):((0,u.vA)()&&(t.playerElement.off("playing",t.onHTMLMediaEvent),t.playerElement.off("loadstart",t.onHTMLMediaEvent)),t.playerElement.off("error",t.onHTMLMediaEvent),t.playerElement.off("stalled",t.onHTMLMediaEvent)),t.htmlMediaListening=!1)},t.reset=function(){t.htmlMediaPlayingSent=!1,t.hlsJsLevels=new Map,t.hlsCurrentBitrate=void 0,t.hlsJsSwitchingTimes=[],t.hlsJsSwitchedTimes=[],t.hlsJsMaxLevel=void 0,t.hlsLastFrag=void 0,t.htmlMediaLoadStartTime=void 0,t.hlsMediaAttachingTime=void 0,t.roomDuration=0,t.roomsVisited=0},t.sendHLSMetric=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==t.hls&&(e=t.hls.latency),t.sendMetric(k({acuteLatency:t.currentProgramDateTime(),averageLatency:t.averageLatency,minLatency:t.minLatency,maxLatency:t.maxLatency,hlsLatency:e},n))},t.reset(),t.listenForChunklist(),t}return(0,c.Z)(d,[{key:"bindAllHTMLMedia",value:function(e){var t;this.removeHTMLMediaListeners(),this.playerElement=e,this.lastTime=Date.now(),t=this.playerElement instanceof HTMLMediaElement?this.playerElement:this.playerElement.tech().el(),(0,u.vA)()&&((0,h.j9)("playing",t,this.onHTMLMediaEvent),(0,h.j9)("loadstart",t,this.onHTMLMediaEvent)),(0,h.j9)("error",t,this.onHTMLMediaEvent),(0,h.j9)("stalled",t,this.onHTMLMediaEvent),this.htmlMediaListening=!0}},{key:"setQualityLevel",value:function(e){this.hlsCurrentQualityLevel=e}},{key:"sendUnloadMetrics",value:function(){var e=(0,i.Z)((0,s.Z)(d.prototype),"sendUnloadMetrics",this).call(this);if(void 0!==e&&e>5e3){void 0!==this.hlsJsMaxLevel&&this.sendHLSMetric({room_user:this.roomName,eventName:"levelMax",levelMaxName:this.hlsJsMaxLevel.name,levelMaxBitrate:this.hlsJsMaxLevel.bitrate,levelMaxAudioCodec:this.hlsJsMaxLevel.audioCodec,levelMaxVideoCodec:this.hlsJsMaxLevel.videoCodec,levelMaxHeight:this.hlsJsMaxLevel.height,levelMaxWidth:this.hlsJsMaxLevel.width,bitrate:this.hlsCurrentBitrate});var t=this.hlsJsSwitchedTimes.reduce((function(e,t){return e+t}),0)/this.hlsJsSwitchedTimes.length;isNaN(t)||this.sendHLSMetric({room_user:this.roomName,eventName:"levelSwitchAvg",levelSwitchAvg:t/1e3,levelSwitchAvgMS:t,levelSwitchCount:this.hlsJsSwitchedTimes.length})}return this.reset(),e}},{key:"removeListeners",value:function(){(0,i.Z)((0,s.Z)(d.prototype),"removeListeners",this).call(this),this.removeHLSListeners(),this.removeHTMLMediaListeners()}},{key:"sendStartTimes",value:function(e,t,n,i,o,r,s){this.roomStatus=r,this.roomsVisited=s,this.roomDuration=0;var a={eventName:"playerTimes",room_user:this.roomName,startTime:e/1e3,pageStartTime:t/1e3,dataLoadTime:n/1e3,metaLoadTime:i/1e3,startLoadTime:o/1e3};(0,v.L)("VDPEnblBEQualNR")&&this.addBatchedMetric(a),(0,v.L)("VDPDisblFEQualNR")||this.sendHLSMetric(a)}},{key:"sendQuality",value:function(e,t,n,i,o,r,s,a){if(this.roomDuration=s,"privatenotwatching"!==a&&"hidden"!==a&&"away"!==a){var l={};l={eventName:"playerQuality",room_user:this.roomName,resolution:o,videoHeight:r},(0,u.Tt)()||(l=k(k({},l),{},{droppedFrames:e,totalFrames:n,segmentDropped:t,segmentFrames:i})),t>30&&(l.badFrames=!0),this.sendHLSMetric(l)}}},{key:"setStatus",value:function(e){this.roomStatus=e}},{key:"listenForChunklist",value:function(){var e=this,t=0,n=0,i=function(i){var o=i.target;if(o.responseURL.includes("chunklist")){var r=o.responseText,s=r.indexOf("#EXT-X-PROGRAM-DATE-TIME:");if(-1!==s){var a=r.substring(s),l=a.indexOf("\n");if(-1!==l){var c=a.substring(0,l).split(":")[3].split("+")[0],u=new Date,d=1e3*u.getSeconds()+u.getMilliseconds()-1e3*parseInt(c);if(d<0&&(d=6e4+d),(void 0===e.minLatency||de.maxLatency)&&(e.maxLatency=d),t<5)n+=d,t+=1;else{var h=n/t;e.averageLatency=h,t=0,n=0}}}}},o=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){this.addEventListener("load",i);for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1])||arguments[1],p=arguments.length>2?arguments[2]:void 0;i.J.current.isNoninteractiveUser?(0,r.Cj)(d.ag.internalStaffPrivate):(h.fire(void 0),(0,l.Cg)(d.ag.loginForPrivateShow)||((0,u.fg)("RequestPrivateShow"),(t=e.room(),n="tipping/private_show_tokens_per_minute/".concat(t,"/"),new Promise((function(e,t){(0,s.Ue)(n).then((function(t){var n=new a.j(t.responseText);e({minimumMinutes:n.getStringWithNumbers("private_show_minimum_minutes"),price:n.getNumber("price"),recordingsAllowed:n.getBoolean("recordings_allowed"),allowed:n.getBoolean("allowed",!0,!1)}),n.logUnusedDebugging("parseTokensPerMinute")})).catch((function(e){t(e)}))}))).then((function(t){if(!f){if(f=!0,!t.allowed)return(0,r.Cj)(d.ag.featureNotEnabled),void(f=!1);var n=function(){e.requestPrivateShow(t.price,t.minimumMinutes,t.recordingsAllowed).then(null==p?void 0:p.onResolve).catch((function(t){void 0!==(null==p?void 0:p.onError)&&p.onError(),"string"==typeof t?(0,o.dg)(t,!1,i.J.current.PurchaseEventSources.TOKEN_SOURCE_LOW_TOKEN_BALANCE):"privatewatching"!==e.status&&((0,r.Cj)(d.ag.errorRequestingPrivateShow),error("Error entering private show",t))})).finally((function(){void 0!==(null==p?void 0:p.onFinally)&&(null==p||p.onFinally()),f=!1})),(0,u.fg)("StartPrivateShow")};if(c){var s=d.ag.privateShowConfirmMessage(e.room(),t.price,t.minimumMinutes,t.recordingsAllowed);(0,r.oB)(s,n,(function(){f=!1}))}else n()}})).catch((function(){}))))}function m(e){var t,n,a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],c=arguments.length>2?arguments[2]:void 0;i.J.current.isNoninteractiveUser?(0,r.Cj)(d.ag.internalStaffPrivate):(h.fire(void 0),(0,l.Cg)(d.ag.loginForPrivateShowSpy)||((0,u.fg)("RequestSpyShow"),(t=e.room(),n="tipping/spy_on_private_show_tokens_per_minute/".concat(t,"/"),new Promise((function(e,t){(0,s.Ue)(n).then((function(n){var i=Number(n.responseText);isNaN(i)?t("isNaN on ".concat(i)):e({price:i})})).catch((function(e){t(e)}))}))).then((function(t){var n=t.price;if(0!==n){var s=function(){(0,u.fg)("StartSpyShow"),e.requestSpyShow().then(null==c?void 0:c.onResolve).catch((function(t){void 0!==(null==c?void 0:c.onError)&&c.onError(),"string"==typeof t?(0,o.dg)(t,!1,i.J.current.PurchaseEventSources.TOKEN_SOURCE_LOW_TOKEN_BALANCE):"privatespying"!==e.status&&((0,r.Cj)(d.ag.errorRequestingSpyShow),error("Error entering spy show",t))})).finally(null==c?void 0:c.onFinally)};a?(0,r.oB)(d.ag.privateShowSpyConfirmMessage(n),s):s()}else(0,r.Cj)(d.ag.privateShowSpyDisabled)})).catch((function(e){"string"==typeof e&&error(e)}))))}function v(e){var t=arguments.length>2?arguments[2]:void 0,n=function(){(0,u.fg)("LeavePrivateOrSpyShow"),e.leavePrivateOrSpyShow().then(null==t?void 0:t.onResolve).catch((function(e){void 0!==(null==t?void 0:t.onError)&&t.onError(),"string"==typeof e&&(0,r.Cj)(e)})).finally(null==t?void 0:t.onFinally)};arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?n():(0,r.oB)(d.ag.privateShowLeaveWarning,n)}function g(){(0,s.I5)("tipping/private_show_approve/",{foo:"bar"}).then((function(){debug("Approved private show")})).catch((function(){}))}function y(){(0,s.I5)("tipping/private_show_decline/",{foo:"bar"}).then((function(){debug("Declined private show")})).catch((function(){}))}function b(){(0,s.I5)("tipping/return_from_away/",{foo:"bar"}).then((function(){debug("Return from away")})).catch((function(){}))}},9545:function(e,t,n){"use strict";function i(e){return e.map((function(e){return Promise.resolve(e).then((function(e){return{status:"fulfilled",value:e}})).catch((function(e){return{status:"rejected",reason:e}}))}))}n.d(t,{$x:function(){return o},Gr:function(){return r},mg:function(){return s},uK:function(){return i}});var o=function(){},r=function(e){error(e)};function s(e,t){var n=!1;return function(){return new Promise((function(i,o){if(!n)return n=!0,e().finally((function(){n=!1})).then((function(e){i(e)})).catch((function(e){o(e)}));i(t)}))}}},2578:function(e,t,n){"use strict";n.d(t,{GC:function(){return h},N0:function(){return f},Ng:function(){return c},PU:function(){return u},QZ:function(){return m},nM:function(){return g},rk:function(){return v},yU:function(){return p}});var i=n(7693),o=n(3753),r=n(4793),s=n(1809),a="room",l="next",c="/accounts/register/",u="/auth/login/",d="account-redirect";function h(e){var t=new URLSearchParams(window.location.search),n=t.get(l);if(null!==n)return{nextParam:n};var i=void 0!==e.room?e.room:!0===e.ignoreExistingRoom?void 0:t.get(a);return null!=i?{roomParam:i}:[c,u].includes(window.location.pathname)||CHATURBATE_URL_PREFIX===window.location.pathname&&""===window.location.search?{}:{nextParam:f()}}function f(){return"".concat(window.location.pathname).concat(window.location.search)}function p(e,t){var n=new URL(e,window.location.origin);return n.searchParams.delete(a),n.searchParams.delete(l),void 0!==t.nextParam?n.searchParams.set(l,t.nextParam):void 0!==t.roomParam&&n.searchParams.set(a,t.roomParam),"".concat(n.pathname).concat(n.search)}function m(){var e;r.kN.listen((function(t){e=t.dossier.room})),(0,i.Zf)(["mousedown","touchstart"],window.document,(function(t){var n=(0,s.zw)(t.target);if(void 0!==n&&n.hasAttribute(d)){var i={};new URL(n.href,window.location.origin).pathname===(0,o.BN)(c)&&(i={room:e});var r=h(i);n.href=(0,o.BN)(p(n.href,r))}}))}function v(e){e.setAttribute(d,"")}function g(e,t){void 0===t&&(t="".concat(window.location.pathname).concat(window.location.search));var n=e.querySelector("input[name=".concat(l,"]"));null!==n&&(n.value=t)}},7201:function(e,t,n){"use strict";n.d(t,{F$:function(){return T},Mg:function(){return P},c8:function(){return C},rP:function(){return O}});var i,o=n(1185),r=n(2800),s=n(8626),a=n(1522),l=n(3753),c=n(391),u=n(695),d=n(4793),h=n(9447),f=n(9598),p=n(8071),m=n(3705),v=n(9545),g=n(1392),y=n(758),b=n(3543),w={partType:1,height:0,name:"",imgUrl:"",width:0,abuseUrl:""};function C(){d.kN.listen((function(e){i={showEmoticons:e.dossier.userChatSettings.showEmoticons,ignoredEmoticons:e.dossier.ignoredEmoticons}})),(void 0===r.J.current.loggedInUser?(i={showEmoticons:!0,ignoredEmoticons:[]},Promise.resolve()):new Promise((function(e,t){(0,l.Ue)("api/ts/chat/message-render-options/").then((function(t){var n,o;n=t.responseText,o=new c.j(n),i={showEmoticons:o.getBoolean("show_emoticons"),ignoredEmoticons:o.getStringList("ignored_emoticons")},e()})).catch((function(e){error(e),t(e)}))}))).finally((function(){y.gO.listen((function(e){void 0!==i&&(i.showEmoticons=e.showEmoticons)}))}))}var x="%%%[",k="]%%%",S=/((^|\s)@\w+)/;function T(e){var t=document.createElement("span");return t.className="emoticonImage",R(e).forEach((function(e){switch(e.partType){case 2:case 0:var n=e.s;""!==n&&t.appendChild(E(n));break;case 1:""!==e.name?t.appendChild(A(e)):t.appendChild(E(""))}})),t}function I(e,t,n){var i=document.createElement("span");return i.className="emoticonImage",R(e.message,e.shortcodes).forEach((function(o){switch(o.partType){case 0:var s=o.s;""!==s&&i.appendChild(E(s));break;case 1:""!==o.name?i.appendChild(A(o)):i.appendChild(E(""));break;case 2:var c=o;void 0!==c.code?i.appendChild(function(e,t,n,i){var o,s,c,d=r.q.getState(),h=d.userName,y=d.room,w=d.hasFanClub;switch(e.code){case"fanclub":o=w?function(){}:function(){(0,a.Cj)(b.ag.noFanClub)},s=b.ag.shortcodeFanclubMessage(y),c=e.signupLink;break;case"supporter":o=function(){},s=b.ag.becomeSupporter,c="/supporter/upgrade/";break;case"follow":o=function(){(0,f.kr)(y,f.wk),void 0!==r.J.current.loggedInUser&&(0,l.Ue)("follow/is_following/".concat(y,"/")).then((function(e){var t=JSON.parse(e.responseText).following,n=new p.e;!t&&r.J.current.isMobile&&n.showBrowserNotification()})).catch(v.$x)},s=b.ag.shortcodeFollowMessage(y),c=void 0;break;case"signup":o=function(){},s=b.ag.joinCB,c=e.signupLink;break;case"tip":o=function(){(0,u.Cg)(b.ag.loginToTip)||i.fire({message:e.msg,amount:e.amt})},s=void 0!==e.msg&&null!==e.msg?e.msg:"",c=void 0;break;default:return error("Unknown shortcode: ".concat(e.code)),document.createElement("div")}var C=n(s,c,o);C.title=g.uF.getShortcodeTitle(e);var x="fromUser"in t&&void 0!==t.fromUser,k={shortcode:e.code,from_user:x?t.fromUser.username:"",room:y,user_clicked:h,tip:void 0!==e.amt&&"tip"===e.code?e.amt:0,message:t.message,from_notice:!x};return C.addEventListener("click",(function(){(0,m.fg)("ShortcodeLinkClicked",k)})),C}(c,e,t,n)):i.appendChild(E(""))}})),i}function P(e,t,n){var i=I(e,t,n);return i.dataset.testid="shortcodeMessage",i}function R(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=[],o=[];if(e.indexOf(x)<0&&!g.uF.hasShortcodes(e))return[B(e)];for(var r=0;r0&&t.appendChild(document.createTextNode(e))})):t.innerText=e,t}function B(e){return{partType:0,s:e}}function O(e,t,n,i){return function(e,t,n){var i=I(e,t,n);return i.dataset.testid="shortcodeNotice",i}({message:e.message||"",shortcodes:t},n,i)}function L(e){return null!==e.match(/(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/g)||(error("Invalid emoticon URL"),!1)}function D(e){return!isNaN(parseInt(e,10))||(error("Invalid dimension argument"),!1)}},928:function(e,t,n){"use strict";n.d(t,{As:function(){return g},OV:function(){return w},P0:function(){return C},cT:function(){return u},iY:function(){return d},sF:function(){return h},ss:function(){return b},vZ:function(){return y}});var i,o=n(6698),r=n(1522),s=n(3753),a=n(391),l=n(9992);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;n.push({idOrName:o.id,messageHtml:o.message_html})}}catch(e){i.e(e)}finally{i.f()}return n}function v(e){if(void 0!==e)return{quality:e.getString("quality"),rate:e.getNumber("rate"),stopped:e.getBoolean("stopped")}}function g(e){var t=e.getMap("chat_settings"),n=e.getMap("satisfaction_score"),i={host:e.getString("wschat_host"),room:e.getString("broadcaster_username"),roomUid:e.getString("room_uid"),viewerUid:e.getStringOrUndefined("viewer_uid"),roomPassword:e.getString("room_pass"),chatRules:e.getString("chat_rules"),roomTitle:e.getString("room_title"),roomStatus:(0,l.wg)(e),isSupporter:e.getBoolean("is_supporter"),needsSupporterToPm:e.getBoolean("needs_supporter_to_pm"),roomGender:e.getString("broadcaster_gender"),userName:e.getString("viewer_username"),chatUserName:e.getString("chat_username"),edgeAuth:encodeURI(e.getString("edge_auth")),viewerPassword:e.getString("chat_password"),viewerGender:e.getString("viewer_gender"),exploringHashTag:e.getString("exploring_hashtag"),sourceName:(0,o.AY)(e.getString("source_name",!1)),hlsSource:e.getString("hls_source"),isWidescreen:e.getBoolean("is_widescreen"),appsRunning:f(e.getString("apps_running")),allowPrivateShow:e.getBoolean("allow_private_shows"),privatePrice:e.getNumber("private_show_price"),privateMinMinutes:e.getNumber("private_min_minutes"),allowShowRecordings:e.getBoolean("allow_show_recordings"),allowAnonymousTipping:e.getBoolean("allow_anonymous_tipping"),spyPrice:e.getNumber("spy_private_show_price"),privateShowId:e.getStringWithNumbers("private_show_id"),hasLowSatisfactionScore:e.getBoolean("low_satisfaction_score"),isAgeVerified:e.getBoolean("is_age_verified"),age:e.getNumberOrUndefined("age"),hiddenMessage:e.getString("hidden_message"),following:e.getBoolean("following"),followNotificationFrequency:e.getString("follow_notification_frequency",!1),isModerator:e.getBoolean("is_moderator"),broadcasterIsOnNewChat:e.getBoolean("broadcaster_on_new_chat"),tokenBalance:e.getNumber("token_balance"),serverName:e.getString("server_name"),numFollowed:e.getNumber("num_followed"),numFollowedOnline:e.getNumber("num_followed_online"),hasStudio:e.getBoolean("has_studio"),isMobile:e.getBoolean("is_mobile"),ignoredEmoticons:e.getObject("ignored_emoticons"),hideSatisfactionScore:e.getBoolean("hide_satisfaction_score"),tipsInPast24Hours:e.getNumber("tips_in_past_24_hours"),lastVoteInPast24Hours:e.getNumberOrUndefined("last_vote_in_past_24_hours"),lastVoteInPast90DaysDown:e.getBoolean("last_vote_in_past_90_days_down"),dismissibleMessages:m(e.getObject("dismissible_messages")),showMobileSiteBannerLink:e.getBoolean("show_mobile_site_banner_link"),numViewers:e.getNumber("num_viewers"),isInFanClub:e.getBoolean("fan_club_is_member"),hasFanClub:e.getBoolean("performer_has_fanclub"),paidTokensFanClub:e.getBoolean("fan_club_paid_with_tokens"),showMyCamWatchingList:[],satisfactionScore:{upVotes:n.getNumber("up_votes",!1),downVotes:n.getNumber("down_votes",!1),percent:n.getNumber("percent",!1)},tfaEnabled:e.getBoolean("tfa_enabled"),userChatSettings:{fontColor:t.getString("font_color"),fontFamily:t.getString("font_family"),fontSize:t.getString("font_size"),showEmoticons:t.getBoolean("show_emoticons"),emoticonAutocompleteDelay:t.getString("emoticon_autocomplete_delay"),highestTokenColor:t.getString("highest_token_color"),sortUsersKey:t.getString("sort_users_key"),modExpiration:t.getNumber("mod_expire"),roomEntryFor:d(t.getString("room_entry_for")),roomLeaveFor:d(t.getString("room_leave_for")),c2cNotificationLimit:h(t.getString("c2c_notify_limit")),silenceBroadcasters:t.getString("silence_broadcasters"),ignoredUsers:t.getString("ignored_users"),allowedChat:t.getString("allowed_chat"),viewerTipVolume:parseInt(t.getString("v_tip_vol")),broadcasterTipVolume:parseInt(t.getString("b_tip_vol"))},aspAuthUrl:e.getString("asp_auth_url"),browserId:e.getString("browser_id"),quality:v(e.getParsedSubMapOrUndefined("quality",!0)),edgeRegion:e.getString("edge_region"),userlistColor:e.getString("userlist_color")},r=e.getStringOrUndefined("staff_links");void 0!==r&&(i.staffInfo={staffLinks:p(r),autoLoadAdminInfo:e.getBoolean("auto_load_admin_info"),previousUsernames:e.getStringOrUndefined("previous_usernames"),deletionAdminNotice:e.getStringOrUndefined("deletion_admin_notice")});var s=e.getParsedSubMapOrUndefined("user_colors",!0);return void 0!==s&&(i.userColors=function(e){if(void 0!==e)return{hasTokens:e.getBoolean("has_tokens"),tippedRecently:e.getBoolean("tipped_recently"),tippedAlotRecently:e.getBoolean("tipped_alot_recently"),tippedTonsRecently:e.getBoolean("tipped_tons_recently")}}(s)),e.logUnusedDebugging("getRoomDossier"),i}function y(e,t){var n=new a.j(t);return new Promise((function(e,i){n.getNumber("status",!1)>=400?i("Bad response from server: ".concat(t)):e(g(n))}))}function b(e){return void 0!==i&&(i.abort(),i=void 0),new Promise((function(t,n){var o=(0,s.q0)("api/chatvideocontext/".concat(e,"/"));i=o[0],o[1].then((function(e){t(y(0,e.responseText))})).catch((function(e){if(404===e.xhr.status)return(0,r.Cj)("HTTP 404 - Page Not Found\n\nIt's probably just a broken link, or perhaps a cancelled broadcaster."),void e.xhr.abort();n(e)}))}))}function w(e,t){var n=!0;return"public"!==t.previousStatus&&"privaterequesting"===e.chatConnection.status&&"privaterequesting"===t.currentStatus&&(n=!1),n}function C(e,t){return b(e.chatConnection.room()).then((function(n){e.dossier=n,e.chatConnection.status=n.roomStatus,t.currentStatus=n.roomStatus}))}},4266:function(e,t,n){"use strict";n.d(t,{CU:function(){return f},hE:function(){return m}});var i=n(4649),o=n(2951),r=n(1976),s=n(8759),a=n(1612),l=n(7693),c=n(1794);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function d(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};(0,o.Z)(this,e),this.roomName=t,this.img=n,this._streaming=!1,this._imgLoaded=!1,this.lastFrameTime=0,this.fadeOutStopTime=0,this.options=d(d({},{startStreaming:!1,loadInitialImage:!0,fadeOutTimeoutMs:2e3,streamingFadeoutTimeoutMs:0,useWideImages:!0}),r),this.STATIC_BASE_URL="".concat(a.w.jpegStreamUrl).concat(this.options.useWideImages?"riw":"ri","/").concat(this.roomName,".jpg"),this.ANIMATING_BASE_URL="".concat(a.w.jpegStreamUrl).concat(this.options.useWideImages?"minifwap":"minifap","/").concat(this.roomName,".jpg"),this.setStreamRate(),this.options.startStreaming?this.startStreaming():this.options.loadInitialImage&&this.loadImage(0).catch((function(e){warn("Error loading image",{imageSrc:e})})),void 0!==h&&h.addListener((function(){i.safariReloadImage()}),this.img)}return(0,r.Z)(e,[{key:"safariReloadImage",value:function(){this._imgLoaded||(this._stopAnimating(),this.loadImage(0).catch((function(e){warn("Error loading image",{imageSrc:e})})))}},{key:"_stopAnimating",value:function(){this.stopStreaming(),this.fadeOutStopTime=0}},{key:"getStreaming",value:function(){return this._streaming}},{key:"getFadingOut",value:function(){return!this._streaming&&(new Date).getTime()<=this.fadeOutStopTime}},{key:"getAnimating",value:function(){return this.getStreaming()||this.getFadingOut()}},{key:"setStreaming",value:function(e){var t=0===this.options.streamingFadeoutTimeoutMs;e?this.fadeOutStopTime=t?0:(new Date).getTime()+this.options.streamingFadeoutTimeoutMs:0===this.fadeOutStopTime&&(this.fadeOutStopTime=(new Date).getTime()+this.options.fadeOutTimeoutMs),this._streaming=t&&e}},{key:"setStreamRate",value:function(){var e=navigator.userAgent.match(/Puffin\/(\d)/);null!==e&&parseInt(e[1])<8?this.streamRate=1500:this.streamRate=140}},{key:"loadImage",value:function(e){var t,n=this;return 0===this.lastFrameTime&&(this.lastFrameTime=e),0===e||e-this.lastFrameTime>this.streamRate?(this.lastFrameTime=e,t=this.getAnimating()?"".concat(this.ANIMATING_BASE_URL,"?f=").concat(Math.random()):"".concat(this.STATIC_BASE_URL,"?").concat(Math.floor((new Date).getTime()/3e4)),new Promise((function(e,i){var o=new Image;o.onload=function(){n.img.onload=function(){n._imgLoaded=!0},n._imgLoaded=!1,n.img.src=o.src,e()},o.onerror=function(){i(t)},o.src=t}))):Promise.resolve()}},{key:"startStreaming",value:function(){var e=this;if(!(0,s.v8)()){p.fire(this.roomName);var t=this.getAnimating();this.setStreaming(!0),t||function t(n){e.getAnimating()&&e.loadImage(n).then((function(){requestAnimationFrame((function(e){t(e)}))})).catch((function(){t(0)}))}(0)}}},{key:"stopStreaming",value:function(){this.setStreaming(!1)}},{key:"stopAnimating",value:function(){this.setStreaming(!1),this.fadeOutStopTime=0}}]),e}()},9992:function(e,t,n){"use strict";function i(e){return o(e.getString("room_status"))}function o(e){switch(e){case"away":return"away";case"private":return"privatenotwatching";case"private_watching":return"privatewatching";case"private_spying":return"privatespying";case"private_requesting":return"privaterequesting";case"public":return"public";case"hidden":return"hidden";case"hidden_watching":return"hiddenwatching";case"offline":return"offline";case"password protected":return"passwordprotected";default:return error("unknown room status -- ".concat(e)),"unknown"}}function r(e){return["public","privaterequesting","privatewatching","privatespying","hiddenwatching"].includes(e)}n.d(t,{Zd:function(){return r},gN:function(){return o},wg:function(){return i}})},9584:function(e,t,n){"use strict";n.d(t,{w:function(){return g}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(4793),c=n(9),u=n(1794),d=n(1625),h=n(4043),f=n(3544),p=n(3543),m=n(9420);function v(e,t){var n=document.createElement("div");return n.innerText=e,n.style.color="#72C0FF",n.style.cursor="pointer",n.style.paddingTop="5px",n.onmouseenter=function(){n.style.textDecoration="underline"},n.onmouseleave=function(){n.style.textDecoration="none"},n.style.pointerEvents="auto",n.onclick=function(e){t(e)},n}var g=function(e){(0,r.Z)(g,e);var t,n,c=(t=g,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function g(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];(0,i.Z)(this,g),(e=c.call(this)).positionFixed=t,e.moreRoomsLink=v(p.ag.moreRoomsText,(function(e){m.wy.fire(void 0),e.stopPropagation()})),e.showTextHandlers=new Map,e.joinShowLink=v("",(function(){})),e.shouldShowMoreRoomsLink=!0,e.hiddenMessage="",e.connectingStatusText=p.ag.connecting,e.isConnecting=!1,e.displayChanged=new u.xB("displayChanged"),e.element.style.display="none",e.element.style.position=e.positionFixed?"fixed":"absolute",e.element.style.height="auto",e.element.style.width="auto",e.element.style.boxSizing="border-box",e.element.style.padding="0 50px",e.element.style.left="0",e.element.style.textAlign="center",e.element.style.pointerEvents="none",e.element.style.zIndex="1",e.header=document.createElement("div"),e.header.style.fontSize="32px",e.header.style.lineHeight="32px",e.header.style.color="#72c0ff",e.header.style.marginBottom="20px",e.element.appendChild(e.header),e.body=document.createElement("div"),e.body.style.fontSize="16px",e.body.style.color="#ffffff",e.text=document.createElement("span"),e.body.appendChild(e.text),e.moreRoomsLink.style.display="none",e.body.appendChild(e.moreRoomsLink),e.joinShowLink.style.display="none",e.body.appendChild(e.joinShowLink),e.spyDisabledText=document.createElement("span"),e.spyDisabledText.innerText=p.ag.privateShowSpyDisabled,e.spyDisabledText.style.display="none",e.spyDisabledText.style.paddingTop="5px",e.body.appendChild(e.spyDisabledText),e.element.appendChild(e.body),e.showTextHandlers.set("away",(function(t){e.header.innerText=p.ag.performerIsAway,e.text.innerText=p.ag.roomAwayMessage,e.joinShowLink.style.display="none",e.spyDisabledText.style.display="none",e.updateMoreRoomsLinkDisplay(!0)})),e.showTextHandlers.set("privatenotwatching",(function(t){e.header.innerText=p.ag.privateShowInProgressText,e.text.innerText=p.ag.roomPrivateNotWatchingMessage,e.joinShowLink.innerText=p.ag.spyOnThisPrivateShowCAPS,e.joinShowLink.style.display=e.isSpyEnabled?"block":"none",e.spyDisabledText.style.display=e.isSpyEnabled?"none":"block",e.joinShowLink.onclick=function(){(0,f.Cd)(t)},e.updateMoreRoomsLinkDisplay(!0)})),e.showTextHandlers.set("hidden",(function(t){e.header.innerText=p.ag.camIsHidden,e.text.innerText=e.hiddenMessage,e.joinShowLink.style.display="none",e.spyDisabledText.style.display="none",e.updateMoreRoomsLinkDisplay(!1)})),e.showTextHandlers.set("offline",(function(t){e.header.innerText=p.ag.offline,e.text.innerText=p.ag.roomOfflineSubheader,e.joinShowLink.style.display="none",e.spyDisabledText.style.display="none",e.updateMoreRoomsLinkDisplay(!0)})),e.showTextHandlers.set("passwordprotected",(function(t){e.header.innerText=p.ag.passwordRequired,e.text.innerText=p.ag.roomPasswordProtectedMessage,e.joinShowLink.style.display="none",e.spyDisabledText.style.display="none",e.updateMoreRoomsLinkDisplay(!0),(0,d.rm)()&&(0,d.Qg)()}));var n=new u.mM;return l.kN.listen((function(t){e.currentChatConnection=t.chatConnection,e.isSpyEnabled=t.dossier.spyPrice>0,t.chatConnection.event.statusChange.listen((function(n){e.handleStatusChange(t.chatConnection,n.currentStatus)})).addTo(n),t.chatConnection.event.hiddenMessageChange.listen((function(t){e.hiddenMessage=t})).addTo(n),t.chatConnection.event.settingsUpdate.listen((function(t){e.isSpyEnabled=t.spyPrice>0&&t.allowPrivateShow,e.joinShowLink.style.display=e.isSpyEnabled?"block":"none",e.spyDisabledText.style.display=e.isSpyEnabled?"none":"block"})).addTo(n),h.Gf.listen((function(){e.handleStatusChange(t.chatConnection,t.dossier.roomStatus)})).addTo(n),e.hiddenMessage=t.dossier.hiddenMessage,e.handleStatusChange(t.chatConnection,t.dossier.roomStatus)})),l.QN.listen((function(){n.removeAll(),e.hiddenMessage="",e.videoOffline=!1})),e}return(0,o.Z)(g,[{key:"hide",value:function(){this.element.style.display="none",this.displayChanged.fire()}},{key:"show",value:function(){this.element.style.display="block",this.displayChanged.fire()}},{key:"setVideoOffline",value:function(e){this.videoOffline=e,void 0!==this.currentChatConnection&&this.handleStatusChange(this.currentChatConnection,this.currentChatConnection.status)}},{key:"displaysForStatus",value:function(e){return void 0!==this.showTextHandlers.get(e)}},{key:"repositionChildren",value:function(){if(void 0!==this.parent){var e=this.parent.element.getBoundingClientRect(),t=document.documentElement.clientWidth,n=document.documentElement.clientHeight;e.width<=t?(this.element.style.width="".concat(e.width,"px"),this.positionFixed&&(this.element.style.left="".concat(e.left,"px"))):(this.element.style.width="".concat(t,"px"),this.element.style.left="0"),e.height<=n?"fixed"===this.parent.element.style.position?this.element.style.top="".concat(e.top+.5*e.height-.5*this.element.offsetHeight,"px"):this.element.style.top="".concat(.5*e.height-.5*this.element.offsetHeight,"px"):this.element.style.top="".concat(.5*n-.5*this.element.offsetHeight,"px"),this.element.style.maxHeight="".concat(e.height,"px")}}},{key:"handleStatusChange",value:function(e,t){this.videoOffline&&(t="offline");var n=this.showTextHandlers.get(t);if(void 0!==n)return n(e),this.show(),void this.repositionChildrenRecursive();switch(this.isConnecting||(this.moreRoomsLink.style.display="none",this.hide()),t){case"public":case"privaterequesting":case"privatewatching":case"privatespying":case"notconnected":case"hiddenwatching":break;default:warn("unexpected status: ".concat(t))}}},{key:"updateMoreRoomsLinkDisplay",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.isConnecting&&!this.videoOffline;e&&!t&&this.shouldShowMoreRoomsLink?this.moreRoomsLink.style.display="block":this.moreRoomsLink.style.display="none"}},{key:"setShowMoreRoomsLink",value:function(e){this.shouldShowMoreRoomsLink=e,this.updateMoreRoomsLinkDisplay()}},{key:"showConnectingStatus",value:function(){this.header.innerText=this.connectingStatusText,this.text.innerText=p.ag.connectingToBroadcastMessage,this.show(),this.joinShowLink.style.display="none",this.spyDisabledText.style.display="none",this.moreRoomsLink.style.display="none",this.isConnecting=!0}},{key:"isConnectingStatusShowing",value:function(){return this.header.innerText===this.connectingStatusText}},{key:"hideConnectingStatus",value:function(){this.isConnecting&&(this.isConnectingStatusShowing()&&(this.header.innerText="",this.text.innerText="",this.hide()),this.isConnecting=!1)}}]),g}(c.w)},9482:function(e,t,n){"use strict";n.d(t,{Fg:function(){return c},Lj:function(){return a},Ow:function(){return l},c9:function(){return r},hY:function(){return u},kD:function(){return s}});var i=n(2800),o=n(3543);function r(e){return e.isBroadcaster?"broadcaster":e.isMod?"mod":e.inFanclub?"inFanclub":e.tippedTonsRecently?"tippedTonsRecently":e.tippedALotRecently?"tippedALotRecently":e.tippedRecently?"tippedRecently":e.hasTokens?"hasTokens":"defaultUser"}function s(e){return e.isBroadcaster?"#ff6200":e.isMod?"#DC0000":e.inFanclub?"#00ff00":e.tippedTonsRecently?"#ad62e1":e.tippedALotRecently?"#d4a0ff":e.tippedRecently?"#8a98ff":e.hasTokens?"#84c6dc":"#b3b3b3"}function a(e){return e.isBroadcaster?o.ag.isBroadcaster:e.isMod?o.ag.isMod:e.inFanclub?o.ag.inFanClub:e.tippedTonsRecently?o.ag.tippedTonsRecently:e.tippedALotRecently?o.ag.tippedALotRecently:e.tippedRecently?o.ag.tippedRecently:e.hasTokens?o.ag.hasTokens:void 0}function l(e){if(!e.isMod&&!e.isBroadcaster&&!e.inFanclub)return e.tippedTonsRecently?o.ag.tippedTonsRecentlyDef:e.tippedALotRecently?o.ag.tippedALotRecentlyDef:e.tippedRecently?o.ag.tippedRecentlyDef:e.hasTokens?o.ag.hasTokensDef:void 0}function c(e){e=e.toLowerCase();var t="".concat(STATIC_URL,"gendericons/");return["m","male"].indexOf(e)>-1?"".concat(t,"male.svg"):["f","female"].indexOf(e)>-1?"".concat(t,"female.svg"):["t","s","trans"].indexOf(e)>-1?"".concat(t,"trans.svg"):["c","couple"].indexOf(e)>-1?"".concat(t,"couple.svg"):(error("Could not set menu gender icon. Defaulting to male."),"".concat(t,"male.svg"))}function u(){var e;return(null===(e=i.J.current.loggedInUser)||void 0===e?void 0:e.username)===i.q.getState().room}},2239:function(e,t,n){"use strict";function i(e,t){e.style.webkitTransition=t,e.style.transition=t,void 0!==e.style.setProperty&&e.style.setProperty("moz-transition",t)}function o(e){e.style.webkitTransition="",e.style.transition="",void 0!==e.style.removeProperty&&e.style.removeProperty("moz-transition")}function r(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t,e.style.msUserSelect=t,void 0!==e.style.setProperty&&e.style.setProperty("moz-user-select",t)}n.d(t,{QU:function(){return o},pS:function(){return i},ql:function(){return r}})},6608:function(e,t,n){"use strict";n.d(t,{Y:function(){return w},v:function(){return C}});var i=n(2951),o=n(1976),r=n(7169),s=n(7591),a=n(9492),l=n(7597),c=n(6272),u=n(1185),d=n(1522),h=n(3753),f=n(391),p=n(1090),m=n(4793),v=n(9),g=n(3705),y=n(9271),b=n(3543);var w=25,C=function(e){(0,s.Z)(C,e);var t,n,v=(t=C,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function C(){var e;return(0,i.Z)(this,C),(e=v.call(this)).innerDiv=document.createElement("div"),e.votesSection=document.createElement("div"),e.upContainer=document.createElement("div"),e.downContainer=document.createElement("div"),e.upVotes=document.createElement("span"),e.downVotes=document.createElement("span"),e.thumbsUp=document.createElement("img"),e.thumbsDown=document.createElement("img"),e.thumbsUpActive=document.createElement("img"),e.thumbsDownActive=document.createElement("img"),e.percent=document.createElement("span"),e.roomName="",e.tipsInPast24Hours=0,e.voteInLast90DaysDown=!1,e.voteUpdate=new y.I({hasVoted:!1,voteDirection:void 0},e.setVoteState.bind((0,r.Z)(e)),e.onVoteError.bind((0,r.Z)(e))),e.listeningForTipUpdates=!1,e.votesSection.style.display="inline-block",e.votesSection.style.verticalAlign="top",e.upContainer.style.display="inline-block",e.upContainer.style.cursor="pointer",e.upContainer.style.verticalAlign="top",e.upVotes.style.margin="0 3px",e.upVotes.style.verticalAlign="top",e.upContainer.appendChild(e.upVotes),e.createThumbsUp(),e.upContainer.appendChild(e.thumbsUp),e.upContainer.appendChild(e.thumbsUpActive),e.votesSection.appendChild(e.upContainer),e.percent.style.margin="0 3px",e.percent.style.verticalAlign="top",e.percent.onclick=function(){return(0,g.fg)("SatisfiedClicked")},e.votesSection.appendChild(e.percent),e.downContainer.style.display="inline-block",e.downContainer.style.cursor="pointer",e.downContainer.style.verticalAlign="top",e.createThumbsDown(),e.downContainer.appendChild(e.thumbsDown),e.downContainer.appendChild(e.thumbsDownActive),e.downVotes.style.margin="0 3px",e.downVotes.style.verticalAlign="top",e.downContainer.appendChild(e.downVotes),e.votesSection.appendChild(e.downContainer),e.innerDiv.appendChild(e.votesSection),e.element.appendChild(e.innerDiv),e.voteUpdate.setInitialState({hasVoted:!1,voteDirection:void 0}),m.kN.listen((function(t){e.chatConn=t.chatConnection,e.roomName=t.dossier.room,e.tipsInPast24Hours=t.dossier.tipsInPast24Hours,t.dossier.hideSatisfactionScore&&void 0===t.dossier.staffInfo?(e.upVotes.style.display="none",e.percent.style.display="none",e.downVotes.style.display="none"):(e.upVotes.innerText="".concat(t.dossier.satisfactionScore.upVotes),e.percent.innerText="".concat(t.dossier.satisfactionScore.percent,"%"),e.downVotes.innerText="".concat(t.dossier.satisfactionScore.downVotes),e.upVotes.style.display="inline",e.percent.style.display="inline",e.downVotes.style.display="inline",t.dossier.satisfactionScore.percent>85?(0,u.vP)(e.percent,"highPercent"):t.dossier.satisfactionScore.percent>65?(0,u.vP)(e.percent,"mediumPercent"):(0,u.vP)(e.percent,"lowPercent")),0===t.dossier.lastVoteInPast24Hours?e.voteUpdate.dispatch({hasVoted:!0,voteDirection:"down"},Promise.resolve(!0)):10===t.dossier.lastVoteInPast24Hours?e.voteUpdate.dispatch({hasVoted:!0,voteDirection:"up"},Promise.resolve(!0)):e.voteUpdate.dispatch({hasVoted:!1,voteDirection:void 0},Promise.resolve(!0)),e.voteInLast90DaysDown=t.dossier.lastVoteInPast90DaysDown,e.tipsInPast24Hours>=w?e.enableVoting():e.disableVoting(),e.listeningForTipUpdates||e.listenForTipUpdates()})),e}return(0,o.Z)(C,[{key:"onVoteError",value:function(){}},{key:"enableVoteMsg",value:function(){return b.ag.afterTipVoteSatisfactionText(this.roomName,w)}},{key:"styleThumb",value:function(e,t){e.src=t,e.height=15,e.width=15,e.style.height="15px",e.style.width="15px",e.style.verticalAlign="top",e.style.margin="0 3px",e.style.opacity="0.8"}},{key:"createThumbsUp",value:function(){var e=this;this.styleThumb(this.thumbsUp,"".concat(STATIC_URL,"thumbs-up-inactive.svg")),this.styleThumb(this.thumbsUpActive,"".concat(STATIC_URL,"thumbs-up-active.svg")),this.upContainer.onclick=function(t){if((0,g.fg)("SatisfiedClicked"),e.stopProp(t),e.tipsInPast24Hours>=w&&(!1===e.hasVoted||"down"===e.voteDirection)){e.triggerComment(!0);var n=(0,h.I5)("tipping/rate_model/".concat(e.roomName,"/"),{rating:"10"}).then((function(){return e.chatConn.event.roomNotice.fire({messages:[[(0,p.vK)(b.ag.votedUpText(e.roomName))]],showInPrivateMessage:!0}),!0})).catch((function(e){return error("Error rating model",e),!1}));e.voteUpdate.dispatch({hasVoted:!0,voteDirection:"up"},n)}else"up"===e.voteDirection&&e.triggerComment(!1)}}},{key:"createThumbsDown",value:function(){var e=this;this.styleThumb(this.thumbsDown,"".concat(STATIC_URL,"thumbs-down-inactive.svg")),this.styleThumb(this.thumbsDownActive,"".concat(STATIC_URL,"thumbs-down-active.svg")),this.downContainer.onclick=function(t){(0,g.fg)("SatisfiedClicked"),e.stopProp(t),e.tipsInPast24Hours>=w&&(!1===e.hasVoted||"up"===e.voteDirection)?(0,d.oB)(b.ag.sureVoteDownText(e.roomName),(function(){e.triggerComment(!0);var t=(0,h.I5)("tipping/rate_model/".concat(e.roomName,"/"),{rating:"0"}).then((function(){var t=b.ag.votedDownText(e.roomName);return e.voteInLast90DaysDown&&(t=b.ag.votedDownTextRepeat(e.roomName)),e.chatConn.event.roomNotice.fire({messages:[[(0,p.vK)(t)]],showInPrivateMessage:!0}),!0})).catch((function(e){return error("Error rating model",e),!1}));e.voteUpdate.dispatch({hasVoted:!0,voteDirection:"down"},t)})):"down"===e.voteDirection&&e.triggerComment(!1)}}},{key:"stopProp",value:function(e){e.stopPropagation()}},{key:"enableVoting",value:function(){this.thumbsUp.style.opacity="1",this.thumbsDown.style.opacity="1",this.thumbsUp.style.cursor="pointer",this.thumbsDown.style.cursor="pointer"}},{key:"disableVoting",value:function(){this.thumbsUp.style.opacity="0.65",this.thumbsDown.style.opacity="0.65",this.thumbsUp.style.cursor="",this.thumbsDown.style.cursor=""}},{key:"setUpvoted",value:function(){this.hasVoted=!0,this.voteDirection="up",this.thumbsDownActive.style.display="none",this.thumbsDown.style.display="",this.thumbsUpActive.style.display="",this.thumbsUp.style.display="none"}},{key:"setDownvoted",value:function(){this.hasVoted=!0,this.voteDirection="down",this.thumbsDownActive.style.display="",this.thumbsDown.style.display="none",this.thumbsUpActive.style.display="none",this.thumbsUp.style.display=""}},{key:"setNotvoted",value:function(){this.hasVoted=!1,this.voteDirection=void 0,this.thumbsDownActive.style.display="none",this.thumbsDown.style.display="",this.thumbsUpActive.style.display="none",this.thumbsUp.style.display=""}},{key:"setVoteState",value:function(e,t){void 0===e.voteDirection||!1===e.hasVoted?this.setNotvoted():"up"===e.voteDirection?this.setUpvoted():"down"===e.voteDirection&&this.setDownvoted()}},{key:"listenForTipUpdates",value:function(){var e=this;this.listeningForTipUpdates=!0,c.H2.listen((function(t){e.chatConn.room()===t.roomName&&(t.tokens>=w&&(e.enableVoting(),e.tipsInPast24Hours=R&&O(!1,2)}))}var D=function(e){(0,r.Z)(n,e);var t=S(n);function n(e,o){var r;return(0,i.Z)(this,n),(r=t.call(this)).room=e,r.isSMC=o,r.element=r.createWrapperElement({position:"fixed",width:"288px",bottom:"8px",right:"20px",borderRadius:"4px",overflow:"hidden",zIndex:1004},{borderRadius:"4px",borderStyle:"solid",borderWidth:"4px 1px 1px 1px",paddingLeft:"16px"},{position:"absolute",width:"14px",height:"14px",top:"14px",right:"14px",padding:"2px",cursor:"pointer",zIndex:1},{margin:"-4px -17px"},{position:"relative",width:"288px",height:"4px"}),r.survey=r.createSurvey(),w.vV.once((function(){r.close()})),!0===r.isSMC?(r.closedAction="FeedbackSMCSentimentClosed",r.popupAction="FeedbackSMCSentimentPopup",r.describedAction="FeedbackSMCSentimentDescribed",r.source="smc_sentiment_survey",r.submitEndpoint=I,r.cancelEndpoint="feedback/sentiment/smc/cancel/",r.initialDuration=25,r.confirmationDuration=15):(r.closedAction="FeedbackSentimentClosed",r.popupAction="FeedbackSentimentPopup",r.describedAction="FeedbackSentimentDescribed",r.source="sentiment_survey",r.submitEndpoint=T,r.cancelEndpoint="feedback/sentiment/cancel/",r.initialDuration=15,r.confirmationDuration=7),r}return(0,o.Z)(n,[{key:"createWrapperElement",value:function(e,t,n,i,o){var r=this;return(0,x.vz)("div",{style:e,colorClass:"cornerSurveyWrapper"},(0,x.vz)("div",{style:t,colorClass:"cornerSurveyContainer",ref:function(e){r.contentContainer=e}},(0,x.vz)("img",{style:n,src:"".concat(STATIC_URL,"popup_survey/close.svg"),onClick:function(){r.close(),(0,b.fg)(r.closedAction)}}),(0,x.vz)("div",{style:i,colorClass:"timerContainer",ref:function(e){r.timerParent=e}},(0,x.vz)("div",{style:o,colorClass:"timer",ref:function(e){r.timer=e}}))))}},{key:"show",value:function(){this.contentContainer.appendChild(this.survey),this.setTimer(this.initialDuration,!0),(0,b.fg)(this.popupAction)}},{key:"close",value:function(){this.contentContainer.contains(this.survey)&&(0,p.I5)(this.cancelEndpoint,{}).catch((function(e){})),null!==this.element.parentElement&&this.element.parentElement.removeChild(this.element)}},{key:"submit",value:function(e){this.selectedSentiment=e;var t={rating:e,room_user:this.room,url:window.location.href};(0,p.I5)(this.submitEndpoint,t).catch((function(){})),this.contentContainer.removeChild(this.survey),this.contentContainer.appendChild(this.createConfirmation()),this.setTimer(this.confirmationDuration,!1)}},{key:"createSurvey",value:function(){return this.createSurveyElement({position:"relative",paddingTop:"16px",fontSize:"14px",width:"245px"},{position:"relative",padding:"16px 0px 11px 0px"})}},{key:"createSurveyElement",value:function(e,t){return(0,x.vz)("div",{colorClass:"survey"},!0===this.isSMC?(0,x.vz)("div",{style:e,colorClass:"title"},C.ag.howIsSmcDoingToday):(0,x.vz)("div",{style:e,colorClass:"title"},C.ag.howIsChaturbateDoingToday),(0,x.vz)("div",{style:t},this.createEmoteDiv("0"),this.createEmoteDiv("1"),this.createEmoteDiv("2"),this.createEmoteDiv("3"),this.createEmoteDiv("4")))}},{key:"createEmoteDiv",value:function(e){return this.createEmoteDivElement({position:"relative",display:"inline-block",width:"40px",height:"40px",boxSizing:"border-box",marginRight:"8px",borderRadius:"4px",borderStyle:"solid",borderWidth:"1px",cursor:"pointer"},{position:"relative",width:"24px",height:"24px",top:"7px",left:"7px"},e)}},{key:"createEmoteDivElement",value:function(e,t,n){var i=this;return(0,x.vz)("div",{style:e,colorClass:"emoteContainer",onClick:function(){i.submit(n)}},(0,x.vz)("div",{style:t,colorClass:M(n)}))}},{key:"createConfirmation",value:function(){return this.createConfirmationElement({position:"relative",paddingTop:"16px",fontSize:"12px"},{display:"block",paddingBottom:"12px",fontSize:"12px"})}},{key:"createConfirmationElement",value:function(e,t){var n=this;return(0,x.vz)("div",{colorClass:"confirmation"},(0,x.vz)("div",{style:e,colorClass:"title"},C.ag.yourFeedbackHasBeenSent),(0,x.vz)("a",{href:"#",style:t,colorClass:"feedbackLink",onClick:function(){n.close(),d.F.fire({source:n.source,sentiment:n.selectedSentiment}),(0,b.fg)(n.describedAction)}},C.ag.describeYourIssues))}},{key:"setTimer",value:function(e,t){var n=this;this.timer.classList.remove("timerBar".concat(25,"s")),this.timer.classList.remove("timerBar".concat(15,"s")),this.timer.classList.remove("timerBar".concat(7,"s")),this.timer.classList.add("timerBar".concat(e,"s")),t?this.element.classList.add("pauseOnHover"):this.element.classList.remove("pauseOnHover"),this.timerParent.removeChild(this.timer),this.timer=this.timer.cloneNode(),this.timerParent.appendChild(this.timer),(0,l.w1)()||(0,l.bf)()?window.setTimeout((function(){n.close()}),1e3*e+200):(0,f.j9)("animationend",this.timer,(function(){window.setTimeout((function(){n.close()}),200)}))}}]),n}(g.w),U=function(e){(0,r.Z)(n,e);var t=S(n);function n(e){var o;(0,i.Z)(this,n),o=t.call(this,e);var r={position:"fixed",width:"100%",bottom:"0px",left:"0px",borderRadius:"8px 8px 0 0",overflow:"hidden",zIndex:1004,display:(0,y.gr)()?"block":"none"};return y.bs.listen((function(){(0,y.gr)()?o.showElement():o.hideElement()})),o.element=o.createWrapperElement(r,{borderRadius:"8px 8px 0 0",paddingLeft:"16px"},{position:"absolute",width:"14px",height:"14px",top:"14px",right:"14px",padding:"2px",cursor:"pointer",zIndex:1},{margin:"0 -17px"},{width:"100%",height:"4px"}),(0,u.vP)(o.element,"mobile"),o}return(0,o.Z)(n,[{key:"createSurvey",value:function(){return this.createSurveyElement({position:"relative",paddingTop:"16px",fontSize:"14px",width:"245px"},{position:"relative",padding:"16px 0px 11px 0px",display:"flex"})}},{key:"createEmoteDiv",value:function(e){var t=(Math.min(window.screen.width,window.screen.height)-32-16)/5,n={display:"flex",justifyContent:"center",alignItems:"center",width:"".concat(t,"px"),height:"".concat(t,"px"),boxSizing:"border-box",marginRight:"4px",borderRadius:"4px",borderStyle:"solid",borderWidth:"1px",cursor:"pointer"};return this.createEmoteDivElement(n,{width:"24px",height:"24px"},e)}},{key:"createConfirmation",value:function(){return this.contentContainer.removeChild(this.timerParent),this.createConfirmationElement({paddingTop:"16px",paddingBottom:"14px",fontSize:"12px"})}},{key:"createConfirmationElement",value:function(e){var t=this;return window.setTimeout((function(){t.close()}),7200),(0,x.vz)("div",{colorClass:"confirmation"},(0,x.vz)("div",{style:e,colorClass:"title"},C.ag.yourFeedbackHasBeenSent))}}]),n}(D)},8117:function(e,t,n){"use strict";n.d(t,{B:function(){return x},t:function(){return C}});var i=n(2951),o=n(1976),r=n(3243),s=n(7591),a=n(9492),l=n(7597),c=n(8759),u=n(2800),d=n(7693),h=n(3753),f=n(391),p=n(3423),m=n(4793),v=n(5108),g=n(5406),y=n(2923);function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==arguments[1]&&arguments[1];return(0,i.Z)(this,n),(o=t.call(this,e)).config=e,o.isPM=r,o.cacheTTL=3e5,o.maxPrefixLength=100,o.filterAfterSize=1,o.maxOptionLength=50,o.element.dataset.testid="shortcodeAutocompleteModal",o.list.dataset.testid="shortcodeAutocompleteList",o.listenerGroup.add(m.kN.listen((function(e){o.room=e.dossier.room}))),o}return(0,o.Z)(n,[{key:"handleKeydown",value:function(e){var t=this;if(this.isPM)e.preventDefault(),e.stopPropagation();else if(this.visible){var n,i;38===e.keyCode&&(e.preventDefault(),this.scrollList(!0)),40===e.keyCode&&(e.preventDefault(),this.scrollList(!1));var o=null!==(n=null===(i=window.getSelection())||void 0===i?void 0:i.toString())&&void 0!==n?n:"",r=32===e.keyCode&&this.items.some((function(e){return e.slug.includes("".concat(t.prefix," "))}));(""===o||r?[39,13,9]:[39,13,32,9]).includes(e.keyCode)&&(e.preventDefault(),e.stopPropagation(),this.hide(),u.J.current.isMobile&&13===e.keyCode||this.config.inputElement.appendText(" ")),27!==e.keyCode&&37!==e.keyCode||(e.preventDefault(),this.hide(),this.deleteHighlightedSuffix()),32===e.keyCode&&o.includes(" ")&&(e.preventDefault(),e.stopPropagation(),this.hide(),this.config.inputElement.appendText(" "))}}},{key:"initData",value:function(){(0,r.Z)((0,l.Z)(n.prototype),"initData",this).call(this),this.regex=new RegExp(/(^|.*\s*)\[cb([:][\w\s\d="!]*)$/i)}},{key:"initUI",value:function(){(0,r.Z)((0,l.Z)(n.prototype),"initUI",this).call(this),this.list.style.width=""}},{key:"getData",value:function(){return(0,h.Ue)(this.getDataEndpoint())}},{key:"getDataEndpoint",value:function(){return"chatmessages/shortcode_autocomplete/?slug=".concat(this.prefix)}},{key:"show",value:function(){(0,r.Z)((0,l.Z)(n.prototype),"show",this).call(this)}},{key:"getCache",value:function(){return void 0===this.cache&&(this.cache=new v.$(this.filterAfterSize,this.cacheTTL)),this.cache}},{key:"normalizedPrefix",value:function(){return this.prefix.toLowerCase()}},{key:"parseResponse",value:function(e){var t,n,i=new f.j(e),o=[],r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return b(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)?b(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(null!==(t=i.getList("shortcodes"))&&void 0!==t?t:[]);try{for(r.s();!(n=r.n()).done;){var s,a=n.value.getString("slug");if(""!==a){var l=(null===(s=u.J.current.loggedInUser)||void 0===s?void 0:s.username)===this.room;a.startsWith(":tip ")&&!l||o.push({slug:a,element:k})}}}catch(e){r.e(e)}finally{r.f()}return i.logUnusedDebugging("parseShortcodegAutocompleteResponse"),o}},{key:"updateList",value:function(){(0,r.Z)((0,l.Z)(n.prototype),"updateList",this).call(this),this.repositionChildren()}},{key:"isSpecialFunctionKey",value:function(e){return[40,37,39,38,13,27,9].includes(e.keyCode)}}]),n}(p.e),x=function(e){(0,s.Z)(n,e);var t=w(n);function n(e){var o,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,i.Z)(this,n),(o=t.call(this,{inputElement:e,leftOffset:0,rightOffset:0},r)).scrolling=!1,(0,d.j9)("touchstart",o.element,(function(){o.scrolling=!1,o.config.inputElement.setCurrentNodeText(o.config.inputElement.getCurrentNodeText())})),(0,c.Tt)()||(0,d.j9)("keydown",o.config.inputElement.element,(function(e){o.visible&&o.config.inputElement.setCaretToEndOfSelection()})),o.overlayClick.listen((function(){o.config.inputElement.focus(),o.config.inputElement.setCaretToEnd()})),o.listenerGroup.add(g.w.listen((function(e){o.hide()}))),o}return(0,o.Z)(n,[{key:"initUI",value:function(){var e=this;(0,r.Z)((0,l.Z)(n.prototype),"initUI",this).call(this),this.element.style.border="",this.element.style.fontSize="14px",this.element.style.lineHeight="26px",this.element.style.boxShadow="0px 0px 8px rgba(0, 0, 0, 0.32)",this.element.style.marginLeft="7px",this.element.style.boxSizing="content-box",this.list.style.width="",(0,y.q)(this.list,!0),this.list.onscroll=function(){e.scrolling=!0}}},{key:"repositionChildren",value:function(){}},{key:"appendItem",value:function(e,t){var i=this,o=(0,r.Z)((0,l.Z)(n.prototype),"appendItem",this).call(this,e,t);return o.ontouchend=function(e){i.scrolling||(i.pickItem(t,!1),e.preventDefault())},o}},{key:"show",value:function(){this.element.style.width="".concat(this.config.inputElement.element.offsetWidth,"px"),(0,r.Z)((0,l.Z)(n.prototype),"show",this).call(this)}}]),n}(C),k=document.createElement("div")},2717:function(e,t,n){"use strict";n.d(t,{i:function(){return f}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(1185),c=n(7693),u=n(8069),d=n(9),h=n(1794);var f=function(e){(0,r.Z)(f,e);var t,n,d=(t=f,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function f(e){var t;return(0,i.Z)(this,f),(t=d.call(this)).config=e,t.value=0,t.valueChanged=new h.xB("valueChanged"),t.valueChangeStart=new h.xB("valueChangeStart"),t.valueChangeEnd=new h.xB("valueChangeEnd"),(0,l.vP)(t.element,"slider"),t.element.style.position="relative",t.element.style.overflow="visible",t.element.style.cursor="pointer",void 0!==e.barWidth?t.element.style.width="".concat(e.barWidth+e.handleDiameter,"px"):t.element.style.width="90%",t.element.style.height="".concat(e.handleDiameter,"px"),t.barHeight=void 0!==e.barHeight?e.barHeight:2*Math.round(.25*e.handleDiameter/2),void 0!==e.barImage?(t.emptyBar=document.createElement("img"),t.emptyBar.src=e.barImage,t.emptyBar.style.width="100%",t.emptyBar.style.height="100%",t.element.appendChild(t.emptyBar)):(t.emptyBar=document.createElement("div"),t.emptyBar.style.position="absolute",t.emptyBar.style.boxSizing="border-box",void 0!==e.emptyBarColor?t.emptyBar.style.backgroundColor=e.emptyBarColor:(t.emptyBar.style.backgroundColor="#333333",t.emptyBar.style.backgroundColor="rgba(255, 255, 255, 0.2)"),t.emptyBar.style.top="".concat(.5*(e.handleDiameter-t.barHeight),"px"),t.emptyBar.style.height="".concat(t.barHeight,"px"),t.emptyBar.style.width="100%",t.element.appendChild(t.emptyBar)),void 0!==e.barImage?(t.filledBar=document.createElement("div"),t.filledBar.style.visibility="none"):(t.filledBar=document.createElement("div"),t.filledBar.style.position="absolute",t.filledBar.style.boxSizing="border-box",t.filledBar.style.backgroundColor=void 0!==e.filledBarColor?e.filledBarColor:"#ffffff",t.filledBar.style.top="".concat(.5*(e.handleDiameter-t.barHeight),"px"),t.filledBar.style.height="".concat(t.barHeight,"px"),t.element.appendChild(t.filledBar)),void 0!==e.handleImage?(t.handle=document.createElement("img"),t.handle.style.position="absolute",t.handle.style.top="0",t.handle.src=e.handleImage,t.handle.style.height="".concat(e.handleDiameter,"px"),t.handle.style.width="".concat(e.handleDiameter,"px"),t.handle.style.cursor="grab",t.handle.style.left="0px",t.element.appendChild(t.handle)):(t.handle=document.createElement("div"),t.handle.style.position="absolute",t.handle.style.top="0",t.handle.style.backgroundColor=void 0!==e.handleColor?e.handleColor:"#ffffff",t.handle.style.borderRadius="50%",t.handle.style.height="".concat(e.handleDiameter,"px"),t.handle.style.height="".concat(e.handleDiameter,"px"),t.handle.style.width="".concat(e.handleDiameter,"px"),t.handle.style.cursor="grab",t.element.appendChild(t.handle)),t.valueUpdater=new u.d((function(){t.valueChanged.fire(t.value)}),{bounceLimitMS:100,debounceType:2}),t.setupListeners((function(e){t.handleMoveEvent(e,e.clientX)}),"mousedown","mousemove","mouseup"),t.setupListeners((function(e){if(1===e.touches.length){var n=e.touches.item(0);null!==n&&t.handleMoveEvent(e,n.clientX)}}),"touchstart","touchmove","touchend"),(0,c.j9)("mousedown",t.element,(function(e){t.handleMoveEvent(e,e.clientX),t.handle.dispatchEvent(function(e,t){try{return new MouseEvent(e,t)}catch(i){var n=document.createEvent("MouseEvent");return n.initMouseEvent(e,void 0!==t.bubbles&&t.bubbles,void 0!==t.cancelable&&t.cancelable,window,0,void 0!==t.screenX?t.screenX:0,void 0!==t.screenY?t.screenY:0,void 0!==t.clientX?t.clientX:0,void 0!==t.clientY?t.clientY:0,void 0!==t.ctrlKey&&t.ctrlKey,void 0!==t.altKey&&t.altKey,void 0!==t.shiftKey&&t.shiftKey,void 0!==t.metaKey&&t.metaKey,void 0!==t.button?t.button:0,void 0!==t.relatedTarget?t.relatedTarget:null),n}}(e.type,e))})),t}return(0,o.Z)(f,[{key:"setupListeners",value:function(e,t,n,i){var o=this;(0,c.j9)(t,this.handle,(function(t){o.valueChangeStart.fire(o.value),o.handle.style.cursor="",document.body.style.cursor="grabbing",t.preventDefault(),t.stopPropagation(),(0,c.j9)(n,document,e,!0),(0,c.j9)(i,document,(function t(r){o.valueChangeEnd.fire(o.value),o.handle.style.cursor="grab",document.body.style.cursor="",r.preventDefault(),(0,c.SC)(n,document,e,!0),(0,c.SC)(i,document,t,!0)}),!0)}))}},{key:"handleMoveEvent",value:function(e,t){var n=this.element.getBoundingClientRect().left;if(void 0!==this.config.barWidth){var i=Math.max(.5*this.config.handleDiameter,Math.min(this.config.barWidth+.5*this.config.handleDiameter,t-n));this.setValue((i-.5*this.config.handleDiameter)*(100/this.config.barWidth))}else{var o=Math.max(.5*this.config.handleDiameter,Math.min(this.element.offsetWidth+.5*this.config.handleDiameter,t-n));this.setValue((o-.5*this.config.handleDiameter)*(100/this.element.offsetWidth))}this.valueUpdater.callFunc(),e.stopPropagation()}},{key:"getValue",value:function(){return this.value}},{key:"setValue",value:function(e){void 0!==this.config.barWidth?(this.handle.style.left="".concat(e*this.config.barWidth/100,"px"),this.filledBar.style.width="".concat(e*this.config.barWidth/100,"px")):(this.handle.style.left="calc(".concat(e,"% - ").concat(this.config.handleDiameter*e/100,"px)"),this.filledBar.style.width="".concat(e,"%")),this.value=e}},{key:"hideHandle",value:function(){this.handle.style.display="none"}},{key:"showHandle",value:function(){this.handle.style.display="block"}},{key:"handleResize",value:function(){void 0===this.config.barWidth&&(this.handle.style.left="calc(".concat(this.value,"% - ").concat(this.config.handleDiameter*this.value/100,"px)"),this.filledBar.style.width="".concat(this.value,"%"))}}]),f}(d.w)},1392:function(e,t,n){"use strict";n.d(t,{DO:function(){return g},uF:function(){return b}});var i,o=n(3940),r=n(7591),s=n(6983),a=n(2951),l=n(1976),c=n(6474),u=n(2800),d=n(8626),h=n(3543);function f(){f=function(e,t){return new n(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function n(e,i,o){var r=new RegExp(e,i);return t.set(r,o||t.get(e)),(0,s.Z)(r,n.prototype)}function i(e,n){var i=t.get(n);return Object.keys(i).reduce((function(t,n){var o=i[n];if("number"==typeof o)t[n]=e[o];else{for(var r=0;void 0===e[o[r]]&&r+1]+)>/g,(function(e,t){var n=s[t];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof r){var a=this;return e[Symbol.replace].call(this,n,(function(){var e=arguments;return"object"!=(0,o.Z)(e[e.length-1])&&(e=[].slice.call(e)).push(i(e,a)),r.apply(this,e)}))}return e[Symbol.replace].call(this,n,r)},f.apply(this,arguments)}function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return m(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)?m(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0){var n=Number(e[0]);isNaN(n)?t.message=e.join(" "):(e.shift(),t.amount=n,e.length>0&&(t.message=e.join(" ")))}return{messageData:t,messageType:1}},"/debug":function(){return{messageType:2}}};function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("/"===e.trim().charAt(0)){var n=function(e){var t=e.match(/(\S+)/g);if(null!==t){var n=t.shift();if(Boolean(Object.prototype.hasOwnProperty.call(v,n)))return v[n](t)}return{messageType:0}}(e);if(0!==n.messageType)return n}else if((0,d.vj)()&&b.isShortcodeSyntax(e,t))return b.parseShortcodeMessage(e);return{messageType:0,messageData:e}}function y(e){var t=new RegExp(/^(\d{1,4})$/),n=new RegExp(/^(\d{1}[\.,]\d{3})$/),i=new RegExp(/^[\.,]\d{1,2}$/),o=t.test(e)||n.test(e);return!i.test(e)&&o}var b=function(){function e(){(0,a.Z)(this,e)}return(0,l.Z)(e,null,[{key:"getCode",value:function(t){var n=t.match(e.codeRegex);if(null!==n)switch(n[1].toLowerCase()){case"signup":return"signup";case"follow":return"follow";case"fanclub":return"fanclub";case"supporter":return"supporter";case"tip":return"tip";case"help":return"help";default:return}}},{key:"getShortcodeTitle",value:function(e){var t,n,i=e.code,o=null===(t=e.msg)||void 0===t?void 0:t.trim(),r=null===(n=e.amt)||void 0===n?void 0:n.toString();return"tip"===i&&void 0!==r&&void 0!==o?"[cb:".concat(i," amount=").concat(r,' message="').concat(o,'"]'):"[cb:".concat(i,"]")}},{key:"isShortcodePrefix",value:function(t){return t.toLowerCase()===e.shortcodePrefix}},{key:"hasShortcodes",value:function(t){return null!==t.match(e.shortcodeRegex)}},{key:"isShortcodeSyntax",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return!c.Ug.includes(t)&&null!==e.match(this.shortcodeRegex)}},{key:"isValidTipShortcodeSyntax",value:function(e){var t=new RegExp(/\[cb:tip amount=([\d,.]*) message=(("[^\]"“”]+")|(""|“”)|(“[^\]"“”]+”))\]/i),n=new RegExp(/\[cb:tip message=(("[^\]"“”]+")|(""|“”)|(“[^\]"“”]+”)) amount=([\d,.]*)\]/i);return t.test(e)||n.test(e)}},{key:"pullRoomMetadata",value:function(){var e=u.q.getState(),t=e.hasFanClub,n=e.room;return{hasFanClub:t,isBroadcaster:e.userName===n}}},{key:"isValidShortcode",value:function(t){return null!==t.match(e.shortcodeStrictRegexA)||null!==t.match(e.shortcodeStrictRegexB)}},{key:"isValidTipShortcode",value:function(t){if(!e.isValidTipShortcodeSyntax(t))return!1;var n=t.match(e.amountRegex);if(null!==n&&!y(n[0].split("=")[1]))return!1;var i=t.match(e.messageStrictRegex);return null===i||!i[0].split("=")[1].match(e.urlRegex)}},{key:"isValidShortcodeForRoom",value:function(t){var n=e.pullRoomMetadata(),i=n.hasFanClub,o=n.isBroadcaster;if(!e.isValidShortcode(t))return!1;var r=e.getCode(t);switch(r){case"tip":return e.isValidTipShortcode(t)&&o;case"fanclub":return/(\[cb:fanclub\])/i.test(t)&&i;case"follow":case"supporter":case"signup":case"help":return new RegExp("\\[cb:".concat(r,"\\]"),"i").test(t);default:return!1}}},{key:"isValidShortcodeMessage",value:function(t){var n,i=t.match(e.shortcodeRegex);return null!==(n=null==i?void 0:i.every((function(t){return e.isValidShortcodeForRoom(t)})))&&void 0!==n&&n}},{key:"getShortcodeForPart",value:function(t,n){var i=e.getCode(t);if(void 0!==i)switch(i){case"tip":if(!e.isValidTipShortcodeSyntax(t))break;return n.find((function(n){if("tip"!==n.code)return!1;var i=n.amt===e.getAmountWithoutSeparators(t),o=n.msg===e.getMessageContents(t);return i&&o}));default:return n.find((function(e){return e.code===i}))}}},{key:"getAmountWithoutSeparators",value:function(t){var n=t.match(e.amountRegex);if(null!==n){var i=n[0].split("=")[1];if(y(i))return Number(i.replace(/\./gi,"").replace(/,/gi,""))}return 0}},{key:"getMessageContents",value:function(t){var n,i=t.match(e.messageStrictRegex);return null!==i&&void 0!==(null===(n=i.groups)||void 0===n?void 0:n.message)?i.groups.message.trim():""}},{key:"parseShortcodeMessage",value:function(t){var n=[];if(!e.isValidShortcodeMessage(t))return{messageType:3,shortcodes:[],message:t};var i=t.match(e.shortcodeRegex);if(null!==i){var o,r=p(i);try{for(r.s();!(o=r.n()).done;){var s=o.value,a=e.getCode(s);if(void 0!==a)if("tip"===a){var l=s.match(e.amountRegex),c=s.match(e.messageStrictRegex),u="";if(c&&c.groups&&(u=c.groups.message),null!==l&&null!==c){var d=l[0].split("=")[1].replace(/\./gi,"").replace(/,/gi,"");n.push({code:"tip",amt:Number(d),msg:u})}}else n.push({code:a})}}catch(e){r.e(e)}finally{r.f()}}return n.length>5?{messageType:3,shortcodes:[],message:t}:(t=t.replace(this.shortcodeNormalizeRegex,(function(e){return e.toLowerCase()})),{messageType:3,shortcodes:n,message:t.trim()})}},{key:"errorBehindShortcode",value:function(t){var n=e.pullRoomMetadata(),i=n.hasFanClub,o=n.isBroadcaster,r=t.match(e.shortcodeRegex);if(null!==r){if(r.length>5)return h.ag.tooManyShortcodes;var s,a=p(r);try{for(a.s();!(s=a.n()).done;){var l=s.value;if(!i&&new RegExp(/\[cb:fanclub\]/i).test(t))return h.ag.noFanclub;if("tip"===e.getCode(l)){var c=e.errorBehindTipShortcode(l,o);if(void 0!==c)return c}}}catch(e){a.e(e)}finally{a.f()}}return h.ag.shortcodeEnteredError(t)}},{key:"hasTipArguments",value:function(e){var t,n="",i=!1,o=p(e);try{for(o.s();!(t=o.n()).done;){var r=t.value;"'"!==r&&"‘"!==r&&"’"!==r&&'"'!==r&&"“"!==r&&"”"!==r?i||(n+=r):i=!i}}catch(e){o.e(e)}finally{o.f()}return new RegExp(/amount=/).test(n)&&new RegExp(/message=/).test(n)}},{key:"hasErrorInMessageArg",value:function(t){return!e.messageStrictRegex.test(t)||e.messageRegexSingleQuote.test(t)||e.messageInvalidQuotesRegex.test(t)}},{key:"errorBehindTipShortcode",value:function(t,n){if(!n)return h.ag.tipNotBroadcaster;if(!e.hasTipArguments(t)||!e.amountAnyRegex.test(t)||!e.messageAnyRegex.test(t))return h.ag.tipShortcodeArgsMissing;var i=t.match(e.amountAnyRegex);return null===i||y(i[0].split("=")[1])?e.hasErrorInMessageArg(t)?h.ag.tipShortcodeMessageInDoubleQuotes:null!==t.match(e.urlRegex)?h.ag.shortcodeURLNotAllowedInTip:void 0:h.ag.inValidTipAmount}}]),e}();(i=b).shortcodePrefix="[cb:",i.shortcodeSuffix="]",i.shortcodeRegex=/(\[cb:(?:[^\]]){0,100}\])/gi,i.nonGlobalShortcodeRegex=/(\[cb:(?:[^\]]){0,100}\])/i,i.shortcodeStrictRegexA=/\[cb:([a-z]+)((\s[a-z]+?=[\d,\.]*){0,1})((\s[a-z]+?=("|“)([^\]"“”]*?)("|”))){0,1}\]/gi,i.shortcodeStrictRegexB=/\[cb:([a-z]+)((\s[a-z]+?=("|“)([^\]"“”]*?)("|”))){0,1}((\s[a-z]+?=[\d,\.]*){0,1})\]/gi,i.shortcodeNormalizeRegex=/\[cb:(follow|signup|fanclub|supporter|help)\]/gi,i.amountAnyRegex=/amount=[^\s\]]+/i,i.messageAnyRegex=/message=[^\s\]]+/i,i.urlRegex=/\b(?:https?:\/\/)?(?:www\.)?[^\/\s]+\.[a-zA-Z]{2,}\b/gi,i.messageRegexSingleQuote=/(message=)(?:['|‘|’](?:[^\]"“”]+)['|‘|’]|['|‘|’](?:[^\]"“”]+)["|“|”]|["|“|”](?:[^\]"“”]+)['|‘|’])/i,i.messageInvalidQuotesRegex=/(message=)(?:"[^\]"“”]*[“”])|(?:“[^\]"“”]*["“])/i,i.amountRegex=/amount=([,.\d]*)/i,i.messageStrictRegex=f(/(message=)("|\u201C)([^\]"“”]*)("|\u201D)/i,{message:3}),i.codeRegex=/\[cb:([^\s\]]+)(?:[^\]]*)\]/i},5937:function(e,t,n){"use strict";n.d(t,{JR:function(){return s},ZY:function(){return r},bA:function(){return o},zp:function(){return a}});var i=n(4801),o=function(){return(0,i.NZ)("TpgTb2")},r=function(){return(0,i.NZ)("AcnBrInpt2")},s=function(){return(0,i.NZ)("DfTpKbrd")},a="AflThtrMd5"},8978:function(e,t,n){"use strict";function i(e){for(var t=e.toLowerCase().split(" "),n=0;n0&&void 0!==arguments[0]?arguments[0]:"16px";return(0,i.vz)("a",{className:"closeBtnContainer",style:{height:e,borderRadius:"5px",color:"inherit",display:"inline-block",cursor:"pointer"}},(0,i.vz)("svg",{style:{width:e,height:e},width:"12",height:"12",viewBox:"0 0 12 12"},(0,i.vz)("path",{d:"M7.15006 6.08867C7.13842 6.07705 7.12919 6.06326 7.12288 6.04807C7.11658 6.03289 7.11334 6.01661 7.11334 6.00017C7.11334 5.98372 7.11658 5.96744 7.12288 5.95226C7.12919 5.93707 7.13842 5.92328 7.15006 5.91167L11.7816 1.28067C11.9222 1.13984 12.0011 0.94891 12.001 0.749887C12.0008 0.550864 11.9216 0.360048 11.7808 0.219417C11.64 0.0787862 11.4491 -0.000140462 11.25 1.87661e-07C11.051 0.000140838 10.8602 0.0793373 10.7196 0.220167L6.08856 4.84917C6.07695 4.86081 6.06316 4.87004 6.04797 4.87634C6.03278 4.88265 6.0165 4.88589 6.00006 4.88589C5.98362 4.88589 5.96734 4.88265 5.95215 4.87634C5.93697 4.87004 5.92317 4.86081 5.91156 4.84917L1.28056 0.220167C1.21093 0.150501 1.12826 0.0952322 1.03726 0.0575166C0.946271 0.0198009 0.84874 0.000376944 0.75024 0.00035373C0.551311 0.000306846 0.360511 0.0792862 0.219814 0.219917C0.0791162 0.360548 4.6905e-05 0.551311 2.08617e-08 0.75024C-4.68632e-05 0.94917 0.0789325 1.13997 0.219564 1.28067L4.85006 5.91167C4.8617 5.92328 4.87094 5.93707 4.87724 5.95226C4.88354 5.96744 4.88679 5.98372 4.88679 6.00017C4.88679 6.01661 4.88354 6.03289 4.87724 6.04807C4.87094 6.06326 4.8617 6.07705 4.85006 6.08867L0.219564 10.7202C0.14993 10.7898 0.0947003 10.8725 0.0570276 10.9635C0.0193548 11.0546 -2.31938e-05 11.1521 2.08617e-08 11.2506C4.6905e-05 11.4495 0.0791162 11.6403 0.219814 11.7809C0.28948 11.8505 0.372179 11.9058 0.46319 11.9435C0.554201 11.9811 0.651741 12.0005 0.75024 12.0005C0.94917 12.0004 1.13993 11.9214 1.28056 11.7807L5.91156 7.14917C5.92317 7.13753 5.93697 7.12829 5.95215 7.12199C5.96734 7.11569 5.98362 7.11244 6.00006 7.11244C6.0165 7.11244 6.03278 7.11569 6.04797 7.12199C6.06316 7.12829 6.07695 7.13753 6.08856 7.14917L10.7196 11.7807C10.8602 11.9214 11.051 12.0004 11.2499 12.0005C11.4488 12.0005 11.6396 11.9215 11.7803 11.7809C11.921 11.6403 12.0001 11.4495 12.0001 11.2506C12.0002 11.0517 11.9212 10.8609 11.7806 10.7202L7.15006 6.08867Z"})))}function s(){return(0,i.vz)("div",{style:{display:"inline-block"}},(0,i.vz)("svg",{style:{height:"1em"},width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},(0,i.vz)("path",{d:"M3.482 7.91071C3.45013 7.89982 3.4223 7.87953 3.40219 7.85252C3.38208 7.8255 3.37062 7.79303 3.36933 7.75937C3.36827 7.72563 3.37736 7.69233 3.39542 7.66381C3.41349 7.63528 3.4397 7.61284 3.47067 7.59937C3.92472 7.40632 4.29812 7.06231 4.52765 6.62556C4.75718 6.18882 4.82875 5.68617 4.73025 5.20272C4.63174 4.71927 4.3692 4.2847 3.98708 3.97259C3.60495 3.66048 3.12672 3.48999 2.63333 3.48999C2.13995 3.48999 1.66171 3.66048 1.27959 3.97259C0.897467 4.2847 0.63493 4.71927 0.536421 5.20272C0.437912 5.68617 0.509482 6.18882 0.739017 6.62556C0.968551 7.06231 1.34195 7.40632 1.796 7.59937C1.82712 7.61253 1.85351 7.63484 1.87166 7.66334C1.88982 7.69184 1.89888 7.72518 1.89765 7.75895C1.89642 7.79271 1.88496 7.82531 1.86478 7.85241C1.8446 7.87952 1.81666 7.89985 1.78467 7.91071C1.26465 8.08858 0.813146 8.4244 0.4932 8.87127C0.173253 9.31815 0.000829249 9.85377 0 10.4034L0 12.3787C0 12.4661 0.0346975 12.5498 0.0964595 12.6116C0.158221 12.6733 0.241989 12.708 0.329333 12.708H0.916667C0.95808 12.7081 0.997978 12.7236 1.02847 12.7516C1.05896 12.7797 1.07783 12.8181 1.08133 12.8594L1.318 15.6987C1.32486 15.7809 1.36241 15.8576 1.42317 15.9134C1.48394 15.9692 1.56348 16.0002 1.646 16H3.62133C3.70374 16 3.78311 15.969 3.84374 15.9132C3.90436 15.8574 3.94181 15.7808 3.94867 15.6987L4.186 12.8594C4.18935 12.8182 4.20807 12.7797 4.23846 12.7517C4.26884 12.7237 4.30866 12.7081 4.35 12.708H4.938C4.98122 12.708 5.02401 12.6995 5.06393 12.683C5.10385 12.6664 5.14011 12.6421 5.17064 12.6115C5.20117 12.5809 5.22536 12.5446 5.24184 12.5047C5.25832 12.4647 5.26675 12.4219 5.26667 12.3787V10.4034C5.26604 9.85372 5.09369 9.31801 4.77372 8.8711C4.45374 8.42418 4.00213 8.08841 3.482 7.91071Z"}),(0,i.vz)("path",{d:"M14.2154 7.91071C14.1834 7.89985 14.1555 7.87952 14.1353 7.85241C14.1151 7.82531 14.1036 7.79271 14.1024 7.75895C14.1012 7.72518 14.1102 7.69184 14.1284 7.66334C14.1466 7.63484 14.1729 7.61253 14.2041 7.59937C14.6581 7.40632 15.0315 7.06231 15.261 6.62556C15.4906 6.18882 15.5622 5.68617 15.4636 5.20272C15.3651 4.71927 15.1026 4.2847 14.7205 3.97259C14.3384 3.66048 13.8601 3.48999 13.3667 3.48999C12.8733 3.48999 12.3951 3.66048 12.013 3.97259C11.6309 4.2847 11.3683 4.71927 11.2698 5.20272C11.1713 5.68617 11.2429 6.18882 11.4724 6.62556C11.7019 7.06231 12.0753 7.40632 12.5294 7.59937C12.5605 7.61259 12.5868 7.63496 12.6049 7.6635C12.623 7.69204 12.632 7.72541 12.6307 7.75918C12.6294 7.79295 12.6179 7.82553 12.5977 7.85259C12.5774 7.87965 12.5494 7.89992 12.5174 7.91071C11.9974 8.08861 11.546 8.42445 11.2262 8.87134C10.9064 9.31822 10.7341 9.85383 10.7334 10.4034V12.3787C10.7333 12.4219 10.7417 12.4647 10.7582 12.5047C10.7747 12.5446 10.7989 12.5809 10.8294 12.6115C10.86 12.6421 10.8962 12.6664 10.9361 12.683C10.9761 12.6995 11.0188 12.708 11.0621 12.708H11.6501C11.6914 12.7081 11.7312 12.7237 11.7616 12.7517C11.792 12.7797 11.8107 12.8182 11.8141 12.8594L12.0514 15.6987C12.0583 15.7808 12.0957 15.8574 12.1563 15.9132C12.217 15.969 12.2963 16 12.3787 16H14.3541C14.4366 16.0002 14.5161 15.9692 14.5769 15.9134C14.6377 15.8576 14.6752 15.7809 14.6821 15.6987L14.9187 12.8594C14.9222 12.8181 14.9411 12.7797 14.9716 12.7516C15.0021 12.7236 15.042 12.7081 15.0834 12.708H15.6707C15.7581 12.708 15.8418 12.6733 15.9036 12.6116C15.9654 12.5498 16.0001 12.4661 16.0001 12.3787V10.4034C15.9992 9.85377 15.8268 9.31815 15.5069 8.87127C15.1869 8.4244 14.7354 8.08858 14.2154 7.91071Z"}),(0,i.vz)("path",{d:"M8.78198 3.75737C8.75083 3.74636 8.72367 3.7263 8.70399 3.69976C8.68431 3.67323 8.67299 3.64142 8.67148 3.60842C8.66998 3.57541 8.67836 3.54271 8.69555 3.51449C8.71274 3.48628 8.73796 3.46384 8.76798 3.45004C9.14122 3.27559 9.4438 2.97908 9.62578 2.60945C9.80775 2.23983 9.85823 1.8192 9.76889 1.41701C9.67954 1.01482 9.4557 0.655134 9.13434 0.39733C8.81298 0.139525 8.4133 -0.000976562 8.00131 -0.000976562C7.58932 -0.000976562 7.18965 0.139525 6.86828 0.39733C6.54692 0.655134 6.32309 1.01482 6.23374 1.41701C6.14439 1.8192 6.19487 2.23983 6.37685 2.60945C6.55882 2.97908 6.86141 3.27559 7.23465 3.45004C7.26467 3.46384 7.28988 3.48628 7.30707 3.51449C7.32426 3.54271 7.33264 3.57541 7.33114 3.60842C7.32964 3.64142 7.31832 3.67323 7.29863 3.69976C7.27895 3.7263 7.2518 3.74636 7.22065 3.75737C6.7746 3.91826 6.38891 4.21259 6.116 4.60036C5.8431 4.98813 5.69621 5.45053 5.69531 5.9247V6.91337C5.69635 7.00039 5.73138 7.08356 5.79292 7.1451C5.85446 7.20663 5.93762 7.24166 6.02465 7.2427H6.57065C6.61112 7.24247 6.65024 7.25728 6.68042 7.28426C6.7106 7.31123 6.72968 7.34845 6.73398 7.3887L7.01398 9.91337C7.023 9.99387 7.06137 10.0682 7.12176 10.1222C7.18214 10.1762 7.26031 10.206 7.34131 10.206H8.65865C8.73958 10.206 8.81766 10.1762 8.87794 10.1222C8.93821 10.0682 8.97645 9.99381 8.98531 9.91337L9.26598 7.3887C9.27057 7.34846 9.28984 7.31131 9.32009 7.28438C9.35035 7.25744 9.38947 7.24261 9.42998 7.2427H9.97531C10.0627 7.2427 10.1464 7.208 10.2082 7.14624C10.2699 7.08448 10.3046 7.00071 10.3046 6.91337V5.92404C10.304 5.45025 10.1575 4.98815 9.8851 4.60051C9.61268 4.21287 9.22753 3.91849 8.78198 3.75737Z"})))}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return(0,i.vz)("div",{style:{display:"inline-block",paddingTop:"".concat(e,"px"),fill:"currentColor"}},(0,i.vz)("svg",{style:{height:"1.2em"},width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},(0,i.vz)("path",{d:"M14.9474 6.50932L14.1034 6.20998C13.9826 6.16702 13.8721 6.09916 13.7791 6.01078C13.6862 5.92241 13.6128 5.8155 13.5638 5.69697C13.5148 5.57845 13.4912 5.45094 13.4946 5.32272C13.498 5.19451 13.5282 5.06843 13.5834 4.95265L13.9674 4.14398C14.1075 3.84868 14.1528 3.51727 14.0971 3.19521C14.0414 2.87315 13.8874 2.57621 13.6563 2.3451C13.4252 2.11398 13.1283 1.96002 12.8062 1.90432C12.4842 1.84862 12.1528 1.89391 11.8574 2.03398L11.0488 2.41865C10.9329 2.47361 10.8069 2.50365 10.6787 2.50683C10.5505 2.51002 10.4231 2.48628 10.3046 2.43715C10.1862 2.38802 10.0794 2.31458 9.99111 2.2216C9.90283 2.12861 9.83504 2.01814 9.79211 1.89732L9.49211 1.05398C9.38235 0.746123 9.18003 0.479756 8.91292 0.291408C8.6458 0.103059 8.32696 0.00195313 8.00011 0.00195312C7.67327 0.00195312 7.35443 0.103059 7.08731 0.291408C6.82019 0.479756 6.61788 0.746123 6.50811 1.05398L6.20811 1.89798C6.16512 2.01875 6.09728 2.12915 6.00897 2.22206C5.92066 2.31498 5.81384 2.38834 5.69541 2.4374C5.57699 2.48647 5.44959 2.51015 5.32144 2.50692C5.19329 2.50369 5.06725 2.47362 4.95145 2.41865L4.14278 2.03398C3.84747 1.89391 3.51607 1.84862 3.19401 1.90432C2.87195 1.96002 2.575 2.11398 2.34389 2.3451C2.11278 2.57621 1.95882 2.87315 1.90312 3.19521C1.84742 3.51727 1.89271 3.84868 2.03278 4.14398L2.41678 4.95265C2.47188 5.06844 2.50207 5.19451 2.5054 5.3227C2.50873 5.45089 2.48513 5.57835 2.43613 5.69685C2.38712 5.81535 2.31379 5.92224 2.22089 6.01063C2.12799 6.09902 2.01757 6.16693 1.89678 6.20998L1.05278 6.50998C0.744848 6.61958 0.478381 6.8218 0.289952 7.08887C0.101523 7.35595 0.000366211 7.6748 0.000366211 8.00165C0.000366211 8.32851 0.101523 8.64735 0.289952 8.91443C0.478381 9.1815 0.744848 9.38372 1.05278 9.49332L1.89678 9.79332C2.01755 9.83629 2.12795 9.90414 2.22085 9.99246C2.31375 10.0808 2.38708 10.1876 2.43609 10.3061C2.4851 10.4245 2.50871 10.5519 2.50538 10.6801C2.50206 10.8082 2.47187 10.9342 2.41678 11.05L2.03278 11.8587C1.89271 12.154 1.84742 12.4854 1.90312 12.8074C1.95882 13.1295 2.11278 13.4264 2.34389 13.6575C2.575 13.8887 2.87195 14.0426 3.19401 14.0983C3.51607 14.154 3.84747 14.1087 4.14278 13.9687L4.95145 13.5847C5.06722 13.5295 5.19329 13.4992 5.3215 13.4959C5.44971 13.4926 5.57718 13.5162 5.69566 13.5653C5.81415 13.6144 5.92099 13.6878 6.00927 13.7809C6.09755 13.8739 6.1653 13.9844 6.20811 14.1053L6.50811 14.9487C6.61788 15.2565 6.82019 15.5229 7.08731 15.7112C7.35443 15.8996 7.67327 16.0007 8.00011 16.0007C8.32696 16.0007 8.6458 15.8996 8.91292 15.7112C9.18003 15.5229 9.38235 15.2565 9.49211 14.9487L9.79211 14.1047C9.83509 13.9839 9.90293 13.8735 9.99126 13.7806C10.0796 13.6877 10.1864 13.6144 10.3049 13.5653C10.4233 13.5163 10.5507 13.4927 10.6789 13.496C10.807 13.4994 10.933 13.5296 11.0488 13.5847L11.8574 13.9687C12.1528 14.1087 12.4842 14.154 12.8062 14.0983C13.1283 14.0426 13.4252 13.8887 13.6563 13.6575C13.8874 13.4264 14.0414 13.1295 14.0971 12.8074C14.1528 12.4854 14.1075 12.154 13.9674 11.8587L13.5834 11.05C13.5284 10.9342 13.4982 10.8082 13.4948 10.6801C13.4915 10.5519 13.5151 10.4245 13.5641 10.3061C13.6131 10.1876 13.6865 10.0808 13.7794 9.99246C13.8723 9.90414 13.9827 9.83629 14.1034 9.79332L14.9474 9.49265C15.2554 9.38305 15.5218 9.18084 15.7103 8.91376C15.8987 8.64669 15.9999 8.32784 15.9999 8.00098C15.9999 7.67413 15.8987 7.35528 15.7103 7.08821C15.5218 6.82113 15.2554 6.61892 14.9474 6.50932ZM8.00011 11.1907C7.37045 11.1815 6.75667 10.9917 6.2318 10.6437C5.70693 10.2958 5.29306 9.80438 5.03945 9.22798C4.71516 8.44275 4.71553 7.56095 5.04046 6.77598C5.3654 5.99102 5.98838 5.36695 6.77278 5.04065C7.55892 4.72626 8.43681 4.73154 9.21911 5.05537C10.0014 5.3792 10.6262 5.99594 10.9601 6.77398C11.2844 7.55922 11.284 8.44102 10.9591 9.22598C10.6342 10.011 10.0112 10.635 9.22678 10.9613C8.83799 11.1212 8.42042 11.1993 8.00011 11.1907Z"})))}function l(e,t){var n=(0,i.vz)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":"reply-icon"},(0,i.vz)("path",{d:"M9.41624 6.5001C8.36101 5.49058 6.91921 5.42139 6.31151 5.44408C6.2877 5.44511 6.26454 5.43559 6.2474 5.41774C6.23026 5.39989 6.22063 5.37525 6.22074 5.34955V4.37708C6.22037 4.2304 6.1414 4.09718 6.01813 4.0353C5.89485 3.97341 5.74953 3.99404 5.64528 4.08821L3.01893 6.49519C2.93812 6.56704 2.89133 6.67411 2.89136 6.78708C2.89077 6.89782 2.93585 7.00312 3.01437 7.07444L5.64739 9.58388C5.75212 9.677 5.89728 9.69652 6.02 9.63396C6.14272 9.57141 6.22092 9.43803 6.22074 9.29161V8.14408C6.22076 8.09924 6.25009 8.06064 6.29083 8.05182C6.95951 7.90058 9.14183 7.61398 10.2721 9.90072C10.3101 9.97676 10.3911 10.0153 10.4688 9.99434C10.5465 9.97338 10.6011 9.89827 10.6015 9.81187C10.6015 8.36716 10.2027 7.25328 9.41624 6.5001Z"}));return(0,i.vz)("div",{colorClass:e,style:t},n)}},6522:function(e,t,n){"use strict";n.d(t,{P_:function(){return $},ZZ:function(){return G},b9:function(){return z},co:function(){return J},eq:function(){return V},hf:function(){return H},jH:function(){return q},lt:function(){return K},nK:function(){return Y},xt:function(){return W}});var i=n(2951),o=n(1976),r=n(7169),s=n(3243),a=n(7591),l=n(9492),c=n(7597),u=n(8759),d=n(1185),h=n(8642),f=n(1194),p=n(5712),m=n(822),v=n(8210),g=n(1962),y=n(7693),b=n(695),w=n(6626),C=n(1602),x=n(4793),k=n(2694),S=n(8069),T=n(9),I=n(8263),P=n(1910),R=n(1794),M=n(9179),A=n(5726),E=n(3705),B=n(2239),O=n(8117),L=n(1392),D=n(3543),U=n(9420),Z=n(10),F=n(758);function _(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return N(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)?N(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=this.isScrolledUp();o||e.querySelectorAll("img").forEach((function(e){var n=e.src;e.src="",e.onload=t.toBottom,e.src=n}));var r=this.messageList.childElementCount-z;for(n?this.messageList.prepend(e):(0,A.ZA)(e,this.messageList);r>0;r-=1){var s=this.messageList.firstElementChild;null!==s&&this.messageList.removeChild(s)}return o||this.scrollToBottom(),this.addMessageHTMLEvent.fire({makeByCloning:function(){return e.cloneNode(!0)}}),i&&(this.messageCounter+=1),e}},{key:"showElement",value:function(){(0,s.Z)((0,c.Z)(n.prototype),"showElement",this).call(this,"flex")}},{key:"removeMessageDiv",value:function(e){this.messageList.removeChild(e)}},{key:"getLastMessageId",value:function(){return this.messageCounter}},{key:"messagesSinceId",value:function(e){return this.messageCounter-e}},{key:"getEarliestMessageId",value:function(){return this.earliestMessageId}},{key:"setEarliestMessageId",value:function(e){this.earliestMessageId=e}},{key:"handleRemoveMessages",value:function(e){var t,n=[],i=_(this.messageList.childNodes);try{for(i.s();!(t=i.n()).done;){var o=t.value;o.getAttribute("data-nick")===e&&n.push(o)}}catch(e){i.e(e)}finally{i.f()}for(var r=0,s=n;r0&&n.offsetY>0&&n.offsetXe.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(e.querySelectorAll("a:not(.nooverlay):not([href='#'])"));try{for(n.s();!(t=n.n()).done;){var i=t.value;null!==i.getAttribute("data-room-nav")&&void 0!==(0,c.dD)(window.location.search).join_overlay&&i.setAttribute(h,""),new u.dM(i)}}catch(e){n.e(e)}finally{n.f()}}var m=new l.xB("removeDiscoverJoinOverlayAnchors")},9187:function(e,t,n){"use strict";n.d(t,{h:function(){return v}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(1185),c=n(7693),u=n(4793),d=n(6767),h=n(9),f=n(3543);function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return m(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)?m(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:document.createElement("a");if((0,o.Z)(this,e),this.anchor=n,void 0!==(0,y.dD)(window.location.search).join_overlay){var i=function(){P=!0,t.commandeer()};P?window.setTimeout((function(){t.commandeer()}),0):T.addListener(i,this.anchor),I.addListener((function e(){P=!1,t.restore(),T.removeListener(i),window.setTimeout((function(){I.removeListener(e)}),0)}),this.anchor)}}return(0,r.Z)(e,[{key:"commandeer",value:function(){var e=this;this.initialOnClick=this.anchor.onclick,this.initialHref=(0,h.BN)(this.anchor.href),this.anchor.href=(0,h.BN)(v.Ng),this.anchor.onclick=function(t){t.preventDefault(),x.fire(e),I.fire(void 0)}}},{key:"restore",value:function(){this.anchor.onclick=this.initialOnClick,this.anchor.href=(0,h.BN)(this.initialHref),this.initialOnClick=null}}]),e}();function M(e){var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return w(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)?w(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(e.querySelectorAll("a:not(.nooverlay):not([href='#'])"));try{for(n.s();!(t=n.n()).done;){var i=t.value;new R(i)}}catch(e){n.e(e)}finally{n.f()}}function A(){var e=document.getElementById("header");null!==e&&M(e);var t=document.getElementById("footer-holder");null!==t&&M(t);var n=document.getElementById("room_list");null!==n&&M(n);var i=document.getElementById("hashtag_ticker");null!==i&&M(i);var o=document.getElementsByClassName("sub-nav");0!==o.length&&M(o[0])}},10:function(e,t,n){"use strict";n.d(t,{Ht:function(){return E},J6:function(){return M},KS:function(){return L},PJ:function(){return _},d$:function(){return P},hk:function(){return R},mp:function(){return D},rL:function(){return F},x9:function(){return N}});var i,o=n(8759),r=n(1185),s=n(7397),a=n(3871),l=n(2800),c=n(8626),u=n(3753),d=n(8157),h=n(4793),f=n(9179),p=n(2359),m=n(5726),v=n(4043),g=n(3705),y=n(3544),b=n(7201),w=n(1392),C=n(3543),x=n(3328),k=n(758);function S(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return T(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)?T(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("div");return t.dataset.testid="chat-message",t.classList.add("msg-text"),t.style.fontFamily="Tahoma,Arial,Helvetica,sans-serif",t.style.boxSizing="border-box",t.style.paddingTop="2px",t.style.paddingBottom="3px",t.style.paddingLeft="5px",t.style.paddingRight="5px",t.style.overflowWrap="break-word",t.style.wordWrap="break-word",t.style.wordBreak="break-word",e.length>0&&t.setAttribute("data-nick",e),t}function Z(e,t){return(0,c.vj)()&&void 0!==e.message&&t&&w.uF.isShortcodeSyntax(e.message)?(0,b.rP)(e,t,B,k.jE):function(e){var t=document.createElement("span");return!1!==e.parseEmoticon?t=(0,b.F$)(e.message):t.innerText=e.message,t.style.color=void 0!==e.foreground?e.foreground:"",t.style.backgroundColor=void 0!==e.background?e.background:"",t.style.fontWeight=void 0!==e.weight?e.weight:"",t}(e)}function F(e){var t=U();return e.renderTo(t)}function _(e,t){var n=U();return n.innerText=e,n.appendChild(t),p.p.setMessageColorData(n,(0,m.Q0)("#aaaaaa")),n.classList.add("roomNotice"),n}function N(e,t){var n=U(t);n.textContent="".concat(e," ");var i=document.createElement("span");return(0,r.vP)(i,r.ql.hrefColor),i.textContent=C.ag.sendDirectMessageNew,i.style.cursor="pointer",i.onclick=function(){v.ah.fire(!0),s.nh.fire(t)},n.appendChild(i),n}h.kN.listen((function(e){i=e.chatConnection}))},1809:function(e,t,n){"use strict";n.d(t,{U_:function(){return f},cr:function(){return d},hp:function(){return m},nv:function(){return u},pU:function(){return h},vV:function(){return a},zw:function(){return p}});var i=n(8759),o=n(7693),r=n(1794),s=n(3340),a=new r.xB("navigationRequest"),l=[],c=!0;function u(e){c=e}function d(e){Promise.all(l.map((function(e){return e()}))).then((function(){a.fire(e)})).catch((function(){}))}function h(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,o.j9)("click",e,(function(e){if(!f(e)){var n=p(e.target);if(void 0!==n){if(n.hasAttribute("data-floatingnav")&&c)return e.preventDefault(),void d(n.href);if(n.hasAttribute("data-room"))return e.preventDefault(),void Promise.all(l.map((function(e){return e()}))).then((function(){s.WP.fire(n.getAttribute("data-room"))})).catch((function(){}));t&&(n.target="_top")}}}))}function f(e){return e.metaKey||e.ctrlKey||e.shiftKey||e.defaultPrevented||(0,i.w1)()||(0,i.bf)()}function p(e){for(var t=e;null!==t&&"a"!==t.tagName.toLowerCase();)t=t.parentElement;if(null!==t){var n=t,i=n.getAttribute("href");if("#"!==i&&""!==i)return n}}function m(e){l.push(e)}},9429:function(e,t,n){"use strict";n.d(t,{FP:function(){return C},Ox:function(){return k},ur:function(){return x}});var i=n(5809),o=n(2951),r=n(1976),s=n(7591),a=n(9492),l=n(7597),c=n(8759),u=n(1185),d=n(7693),h=n(2425),f=n(9),p=n(1794),m=n(1282),v=n(3607),g=n(3705),y=n(2833),b=n(2974);var w="defaultVideoWidth",C=h.vA?548:502,x=300,k=function(e){(0,s.Z)(p,e);var t,n,f=(t=p,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,l.Z)(t);if(n){var o=(0,l.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,a.Z)(this,e)});function p(e){var t;return(0,o.Z)(this,p),(t=f.call(this)).roomContents=e,t.state={videoWidth:C,videoHeight:x},t.isDragging=!1,t.resizeHistory=[],t.lastChosenVideoWidth=C,t.lastChosenChatWidth=332,t.nonChatVideoWidth=2*t.roomContents.roomContentsPadding-8,t.element.style.position="",t.element.style.display="inline-block",t.element.style.width="".concat(8,"px"),t.element.style.boxSizing="border-box",(0,d.j9)("mousedown",t.element,(function(n){n.preventDefault(),t.roomContents.element.onmousemove=function(n){var i=n.pageX-e.videoPanel.element.getBoundingClientRect().left-t.element.offsetWidth/2;t.handleResize(i),t.lastChosenVideoWidth=i,t.lastChosenChatWidth=t.getChatWidthFromVideoWidth(t.lastChosenVideoWidth),t.roomContents.repositionChildrenRecursive()},t.roomContents.element.onmouseup=function(){t.handleResizeFinished()},t.roomContents.element.onmouseleave=function(){t.handleResizeFinished()},t.isDragging=!0})),(0,d.j9)("touchmove",t.element,(function(n){n.preventDefault(),1===n.targetTouches.length&&(t.roomContents.element.ontouchmove=function(){var i=n.targetTouches.item(0);if(null!==i){var o=i.pageX-e.videoPanel.element.getBoundingClientRect().left-t.element.offsetWidth/2;t.handleResize(o),t.lastChosenVideoWidth=o,t.lastChosenChatWidth=t.getChatWidthFromVideoWidth(t.lastChosenVideoWidth),t.roomContents.repositionChildrenRecursive()}},t.roomContents.element.ontouchend=function(){t.handleResizeFinished()},t.isDragging=!0)})),window.setTimeout((function(){t.element.style.cursor=t.getCursor(),(0,u.vP)(t.element,"resizeHandle"),t.loadSettings(),t.handleResize(),t.handleResizeFinished()}),0),b.S.changeVideoMode.listen((function(){"split"===b.S.getVideoMode()&&(t.loadSettings(),t.handleResize())})),t}return(0,r.Z)(p,[{key:"getChatWidthFromVideoWidth",value:function(e){return this.roomContents.element.clientWidth-e-this.nonChatVideoWidth}},{key:"getVideoWidthFromChatWidth",value:function(e){return this.roomContents.element.clientWidth-e-this.nonChatVideoWidth}},{key:"handleResizeSplitModeBasedOnChat",value:function(e){var t=Math.min(e,this.getChatWidthFromVideoWidth(C));t=Math.max(t,this.minChatWidth()),this.roomContents.videoPanel.element.style.width="".concat(this.getVideoWidthFromChatWidth(t),"px"),t>this.minChatWidth()&&(this.roomContents.videoPanel.element.style.minWidth="".concat(C,"px")),t=this.getMaxVideoWidth()?"w-resize":"ew-resize"}},{key:"loadSettings",value:function(){if((0,c.IU)()){var e=window.localStorage.getItem(w);if(null!==e){var t,n,i=JSON.parse(e);return this.state={videoWidth:i.videoWidth,videoHeight:i.videoHeight},this.lastChosenVideoWidth=null!==(t=i.lastChosenVideoWidth)&&void 0!==t?t:this.state.videoWidth,void(this.lastChosenChatWidth=null!==(n=i.lastChosenChatWidth)&&void 0!==n?n:332)}}"split"===b.S.getVideoMode()&&(this.setResolutionToMax({maximizeWidth:!0}),this.lastChosenVideoWidth=this.state.videoWidth)}},{key:"saveSettings",value:function(){(0,c.IU)()&&window.localStorage.setItem(w,JSON.stringify({videoWidth:this.state.videoWidth,videoHeight:this.state.videoHeight,lastChosenVideoWidth:this.lastChosenVideoWidth,lastChosenChatWidth:this.lastChosenChatWidth}))}},{key:"repositionChildren",value:function(){this.handleResize(),this.isDragging||this.handleResizeFinished()}},{key:"setResolutionToMax",value:function(){var e,t,n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{maximizeWidth:!1}).maximizeWidth,i=(0,v._U)();if(this.getMaxVideoWidth()-95>i/2){if(n){var o=(0,v.mP)();if(o/i>this.getVideoAspectRatio())t=this.getMaxVideoWidth()-95;else{var r=o-200;t=this.getWidthFromHeight(r)}}else t=i/2;e=this.getHeightFromWidth(t)}else e=this.getMaxVideoHeight(),t=this.getWidthFromHeight(e);n||e>this.getMaxVideoHeight()&&(e=this.getMaxVideoHeight(),t=this.getWidthFromHeight(e)),t0&&(t.tipFailTotal+=e.amount)))},this.onMessageSent=function(){t.messageCount+=1},this.onMessageReceived=function(e){void 0!==t.chatConnection&&e.fromUser.username===t.chatConnection.username()&&t.messageSuccessCount0))return window.performance.navigation.type;switch(e[0].type){case"navigate":return 0;case"reload":return 1;case"back_forward":return 2;case"prerender":return 3;default:return 255}}}},{key:"getRefreshMeta",value:function(){try{var e,t=null===(e=window.sessionStorage)||void 0===e?void 0:e.getItem("refreshMeta");return null!==t?JSON.parse(t):void 0}catch(e){return}}},{key:"wasRefresh",value:function(){var e=this.getNavigationType();if(1===e)return!0;if(0===e||void 0===e){var t=this.getRefreshMeta();if(void 0===t)return;return t.href===window.location.href&&t.unloadTimestamp>this.loadTimestamp-1e4}return!1}}]),e}()},758:function(e,t,n){"use strict";n.d(t,{FJ:function(){return s},Gf:function(){return o},gO:function(){return a},jE:function(){return r},jS:function(){return l}});var i=n(1794),o=new i.xB("switchedToHLS"),r=new i.xB("openDefaultTipCalloutRequest"),s=new i.xB("loginOverlayRequest"),a=new i.xB("userChatSettingsUpdate",{listenersWarningThreshold:function(){return 50+2*i.q6}}),l=new i.xB("openPhotoVideoTabRequest")},3543:function(e,t,n){"use strict";n.d(t,{ag:function(){return c},ih:function(){return s}});var i=n(3753),o=n(9165),r=n(8978),s=window.gettext;void 0===s&&(warn("gettext is undefined."),s=function(e){return e});var a=window.ngettext;void 0===a&&(warn("ngettext is undefined."),a=function(e,t,n){return n>1?t:e});var l=window.interpolate;void 0===l&&(warn("interpolate is undefined."),l=function(e,t,n){return n?e.replace(/%\(\w+\)s/g,(function(e){return String(t[e.slice(2,-2)])})):e.replace(/%s/g,(function(e){return String(t.shift())}))});var c={numberOfRoomsMatchesYourFilters:function(e,t){return l(a("%(matched)s of the %(total)s live room matched your filters","%(matched)s of the %(total)s live rooms matched your filters",e,t),{total:e,matched:t},!0)},noRoomsMatchesYourFilters:function(e){return l(a("None of the %(total)s live rooms matched your filters","None of the %(total)s live rooms matched your filters",e),{total:e},!0)},documentTitle:function(e){return l(s("Chat with %(username)s in a Live Adult Video Chat Room Now"),{username:(0,r.t)(e)},!0)},tokenOrTokensText:function(e,t){return t?a("Token","Tokens",e):a("token","tokens",e)},tokenOrTokensTextCAPS:function(e){return a("TOKEN","TOKENS",e)},tipConfirmationMessage:function(e){return l(s("Confirm tip of %(tokens)s tokens"),{tokens:e.toLocaleString()},!0)},subjectChangeMessage:function(e){return l(s('room subject changed to "%(subject)s"'),{subject:e},!0)},roomTitleMessage:function(e){return l(s("%(username_title)s's Cam"),{username_title:(0,r.t)(e)},!0)},moderatorPromoteMessage:function(e,t){return l(s("%(from)s has granted moderator privileges to %(to)s."),{from:e,to:t},!0)},moderatorRevokeMessage:function(e,t){return l(s("%(from)s has revoked moderator privileges from %(to)s."),{from:e,to:t},!0)},joinFanClubText:function(e){return l(s("Join %(modelname)s's Fan Club"),{modelname:(0,r.Qs)(e)},!0)},joinFanClubWithTokensText:function(e,t,n){var i=c.joinFanClubText(e),o=l(s("with %(tokens)s tokens for %(months)s months"),{tokens:t,months:n},!0);return i.concat(" ").concat(o)},joinFanClubTextCAPS:function(e){return l(s("JOIN %(modelname)s's FAN CLUB"),{modelname:e},!0)},joinFanClubPage:function(e){return l(s('You will be taken to Join Fan Club Page for %(modelname)s. Click "OK" to proceed.'),{modelname:(0,r.Qs)(e)},!0)},loggedInToJoinFanClubText:function(e){return l(s('You must be logged in to join %(modelname)s\'s fan club. Click "OK" to login.'),{modelname:(0,r.Qs)(e)},!0)},roomPicsVideoText:function(e){return l(s("%(modelname)s's Pics & Videos"),{modelname:(0,r.Qs)(e)},!0)},roomPicsText:function(e){return l(s("%(modelname)s's Pics"),{modelname:(0,r.Qs)(e)},!0)},roomVidsText:function(e){return l(s("%(modelname)s's Videos"),{modelname:(0,r.Qs)(e)},!0)},purchaseVideoText:function(e){return l(a("You are about to purchase this video for %(tokens)s token","You are about to purchase this video for %(tokens)s tokens",e),{tokens:e},!0)},purchasePhotosText:function(e,t){return l(s("You are about to purchase this photo set (%(numphotos)s %(imagestext)s) for %(tokens)s %(tokenstext)s"),{numphotos:e,imagestext:a("image","images",e),tokens:t,tokenstext:a("token","tokens",t)},!0)},unlockPhotosText:function(e){return l(a("Unlock this photo set (%(numphotos)s image)","Unlock this photo set (%(numphotos)s images)",e),{numphotos:e},!0)},unlockVideoText:function(e){return l(s("Unlock this video (%(duration)s)"),{duration:e},!0)},fanClubDisabledText:function(e){return l(s("%(modelname)s has disabled their fan club."),{modelname:(0,r.Qs)(e)},!0)},silenceMessage:function(e,t){return l(s("User %(username)s was silenced by %(silencer)s and their messages have been removed"),{username:e,silencer:t},!0)},userKickedAndMessagesRemovedMessage:function(e){return l(s("User %(username)s was kicked out of the room and their messages have been removed"),{username:e},!0)},privateShowPriceChangeMessage:function(e,t){return l(s("%(username)s changed Private Show price to %(price)s tokens per minute"),{username:e,price:t},!0)},spyShowPriceChangeMessage:function(e,t){return l(s("%(username)s changed Spy on Private Show price to %(price)s tokens per minute"),{username:e,price:t},!0)},priceTokensPerMinuteMessage:function(e){return l(s(arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"%(price)s tokens/min":"%(price)s tokens per minute"),{price:e},!0)},privateShowMinimumMinuteMessage:function(e){return l(s(arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"minimum %(minMinutes)s mins":"minimum %(minMinutes)s minutes"),{minMinutes:e},!0)},privateShowConfirmMessage:function(e,t,n,i){return l(s("Enter private chat with %(username)s?\n%(price)s tokens per minute, minimum %(minMinutes)s minute(s)\n\n"),{username:e,price:t,minMinutes:n},!0)+s(i?"This broadcaster allows private show recordings, so you will receive a recorded video of this show in your collection.":"This broadcaster does not allow private show recordings, so you will not receive a recorded video of this show in your collection.")},privateShowSpyConfirmMessage:function(e){return l(s("Spy on private show for (%(price)s tokens per minute)"),{price:e},!0)},appsRunningMessage:function(e){return l(s("Broadcaster %(username)s is running these apps: "),{username:e},!0)},usersRunningAppMessage:function(e){return l(s("Showing users running %(appName)s"),{appName:e},!0)},devportalMessage:function(e){return l(s('Create or update v2 Apps in the new Developer Portal.'),{link:(0,i.BN)(e)},!0)},integerMinError:function(e){return l(s("This field is less than the minimum of %(minimum)s"),{minimum:e},!0)},integerMaxError:function(e){return l(s("This field is greater than the maximum of %(maximum)s"),{maximum:e},!0)},allowToVoteMessage:function(e,t){return l(s("After tipping %(min_tokens_to_vote)s tokens in a day, you'll be able to vote regarding your satisfaction with %(room)s."),{min_tokens_to_vote:t,room:(0,r.Qs)(e)},!0)},confidentalVoteMessage:function(e){return l(s("Your confidential vote regarding %(room)s has been recorded. You may change your vote at any time today. Thank you for your feedback."),{room:(0,r.Qs)(e)},!0)},shareCamText:function(e){return l(s("Share %(username)s's Cam"),{username:e},!0)},embedCamText:function(e){return l(s("Embed %(username)s's Cam on Your Webpage"),{username:e},!0)},conversationCautionMessage:function(e){return l(s("Caution: The %(siteName)s Team will NEVER contact you via chat or ask for your password."),{siteName:e},!0)},afterTipVoteSatisfactionText:function(e,t){return l(s("Note: For tipping at least %(tokens)s tokens today, you can now vote what you think about %(room)s. Your vote is confidential. See below for the satisfaction feedback controls."),{tokens:t,room:(0,r.Qs)(e)},!0)},afterTipVoteSatMobileText:function(e,t){return l(s("Note: For tipping at least %(tokens)s tokens today, you can now vote what you think about %(room)s. Your vote is confidential. Open the menu for the satisfaction feedback controls."),{tokens:t,room:(0,r.Qs)(e)},!0)},votedUpText:function(e){return l(s("Note: Your confidential vote of thumbs up for %(room)s has been recorded. You may change your vote at any time today. Thank you for your feedback."),{room:(0,r.Qs)(e)},!0)},votedDownText:function(e){return l(s("Note: Your confidential vote of thumbs down for %(room)s has been recorded. You may vote once every 90 days, and you may change your vote at any time today. Thank you for your feedback."),{room:(0,r.Qs)(e)},!0)},votedDownTextRepeat:function(e){return l(s("Note: Your confidential vote of thumbs down for %(room)s has been refreshed and will expire in 90 days. You may change your vote at any time today. Thank you for your feedback."),{room:(0,r.Qs)(e)},!0)},sureVoteDownText:function(e){return l(s("Are you sure you want to rate %(room)s thumbs down?"),{room:(0,r.Qs)(e)},!0)},noSimilarRooms:function(e){return l(s("Sorry, we don't have any rooms similar to %(room)s yet."),{room:e},!0)},pmSupporterSendPm:function(e){return l(s("to send a pm to %(pmUser)s"),{pmUser:e},!0)},userPromotionCurrentPriceText:function(e){var t=c.userPromotionCurrentPriceLabel,n=c.tokenOrTokensText(e,!1);return"".concat(t).concat(": ").concat(String(e)).concat(" ").concat(n)},userIsIgnored:function(e){return l(s("%(username)s is ignored"),{username:e},!0)},ignoreUser:function(e){return l(s("Ignore %(username)s"),{username:e},!0)},ignoringUser:function(e){return l(s("Ignoring %(username)s"),{username:e},!0)},noLongerIgnoring:function(e){return l(s("No longer ignoring %(username)s"),{username:e},!0)},removedOldestIgnore:function(e){return l(s("Ignore limit reached. Removed oldest user from list: %(username)s"),{username:e},!0)},userHasBeenReported:function(e){return l(s("%(username)s has been reported"),{username:e},!0)},errorIgnoringUser:function(e){return l(s("Error ignoring user %(username)s. Please try again in a few seconds."),{username:e},!0)},errorUnignoringUser:function(e){return l(s("Error unignoring user %(username)s. Please try again in a few seconds."),{username:e},!0)},errorFollowingUser:function(e){return l(s("Error following user %(username)s. Please try again."),{username:e},!0)},errorUnfollowingUser:function(e){return l(s("Error unfollowing user %(username)s. Please try again."),{username:e},!0)},errorVotingForUser:function(e){return l(s("Error voting for user %(username)s. Please try again."),{username:e},!0)},transferTokensToCashWithValue:function(e){return l(s("Transfer tokens to %(cashAmount)s cash."),{cashAmount:e},!0)},transferTokensToAdvertisingWithValue:function(e){return l(s("Transfer tokens to %(cashAmount)s advertising credit."),{cashAmount:e},!0)},overSpendingLimit:function(e){return l(s("Attempted to purchase %(tokens)s tokens but spending limit exceeded."),{tokens:e},!0)},emailToResolve:function(e){return l(s("Email %(emailAddress)s ASAP to resolve."),{emailAddress:e},!0)},purchasePhotoSet:function(e,t){return l(s("Purchase Photo/Video (%(setName)s) from %(username)s"),{setName:e,username:t},!0)},sellPhotoSet:function(e,t){return l(s("Sell Photo/Video (%(setName)s) to %(username)s"),{setName:e,username:t},!0)},purchaseSocialMediaFrom:function(e,t){return l(s("Purchase social media (%(name)s) from %(username)s"),{name:e,username:t},!0)},sellSocialMediaTo:function(e,t){return l(s("Sell Social media (%(name)s) to %(username)s"),{name:e,username:t},!0)},broadcasterWelcomeMessage:function(e){return l(s("Your cam is visible to %(listVisibleTo)s. Edit this in settings & privacy."),{listVisibleTo:e},!0)},privateShowRequestAppPanel:function(e){return l(s('%(username)s wants to start a "Private" show.'),{username:e},!0)},privateShowRequestChatMessage:function(e){return l(s("%(username)s wants to start a private show."),{username:e},!0)},privateShowEarningsMessage:function(e){return l(s("This private show will earn you %(tokens)s tokens per minute, based on your settings."),{tokens:e},!0)},tokensPerMinute:function(e){return l(s("%(tokens)s Per Minute"),{tokens:e},!0)},banUserConfirm:function(e){return l(s("Ban %(username)s?"),{username:e},!0)},banUserError:function(e){return l(s("Error banning user %(username)s"),{username:e},!0)},banUserSuccess:function(e){return l(s("User %(username)s banned from your room"),{username:e},!0)},userHasTippedMe:function(e){return l(s("%(username)s has tipped me"),{username:e},!0)},tokensInPastHour:function(e){return l(s("%(tokens)s in the past hour"),{tokens:e},!0)},tokensInPastDay:function(e){return l(s("%(tokens)s in the past day"),{tokens:e},!0)},tokensInPastTwoWeeks:function(e){return l(s("%(tokens)s in the past 2 weeks"),{tokens:e},!0)},activeMembershipsMessage:function(e){return l(a("You have %(numMemberships)s Active Membership","You have %(numMemberships)s Active Memberships",e),{numMemberships:e},!0)},monthlyCost:function(e){return l(s("$%(cost)s monthly"),{cost:e},!0)},automaticallySilencedUsersMessage:function(e){return l(a("We have automatically silenced %(numSilenced)s user possibly linked to a user you have previously silenced;","We have automatically silenced %(numSilenced)s users possibly linked to a user you have previously silenced;",e),{numSilenced:e},!0)},automaticallyBannedUsersMessage:function(e){return l(a("We have automatically banned %(numSilenced)s user possibly linked to a user you have previously banned;","We have automatically banned %(numSilenced)s users possibly linked to a user you have previously banned;",e),{numSilenced:e},!0)},currentFanClubMembersTitle:function(e){return l(a("%(numMembers)s Current Fan Club Member","%(numMembers)s Current Fan Club Members",e),{numMembers:e},!0)},broadcastNotificationTopBarFollowerTextPluralOld:function(e){return l(s("You have %(numFollowers)s followers"),{numFollowers:e},!0)},userPromotionToolbarInProgressText:function(e){return l(s("Promoted for %(relativeTime)s"),{relativeTime:e},!0)},idAboutToExpire:function(e){return l(s("An ID on your account is set to expire on %(expire)s. Please submit new ID for verification in order to continue earning tokens on uploaded content or while broadcasting with minimal disruption."),{expire:e},!0)},guestIdAboutToExpire:function(e){return l(s("Your Guest %(username)s has an ID expiring soon on their account. Please let your Guest know they'll need to submit an updated ID on their personal account to keep the ability to be a Guest on your account."),{username:e},!0)},paxumTempNotice:function(){return l(s('Due to new requirements necessary for Paxum payouts, we need some additional information for you to continue to receive payments. Please visit this page to update your info.'),{link:(0,i.BN)("/affiliates/payoutinfo_paxum_temp/")},!0)},userPromotionReportText:function(e){return l(s("Your promotion is complete - %(viewCount)s people saw your room on the homepage and Discover page."),{viewCount:e},!0)},showMyCamStart:function(e){return l(s("Start Cam To Cam with %(username)s"),{username:e},!0)},showMyCamPreviewInfo1:function(e){return l(s("Your cam will only be visible to %(username)s."),{username:e},!0)},showMyCamCurrentlySharing:function(e){return l(s("You are currently showing your cam to %(room)s. If your cam has ended, please wait up to 1 minute to be able to broadcast again."),{room:e},!0)},showMyCamCooldownAlert:function(e){return l(s("Please allow up to %(sec)s seconds before sharing your cam again."),{sec:e},!0)},privateConversationWithText:function(e){return l(s("Private conversation with %(username)s"),{username:e},!0)},fanclubCancelConfirmMessage:function(e){return l(s("Are you sure you wish to leave %(username)s's Fan Club? You will remain a member until your currently paid month expires."),{username:e},!0)},loginForPasswordPrompt:function(e){return l(s("%(room)s's room now requires a password. Please log in for a password prompt."),{room:e},!0)},passwordRequiredForRoom:function(e){return l(s("Password required for room %(room)s"),{room:e},!0)},authSectionInfo:function(e){return l(s("Use the Events API JSON feed to see your room's chat messages and events. For more information, see the documentation."),{eventsUrl:(0,i.BN)(e),documentationUrl:(0,i.BN)("/apps/api/docs/index.html")},!0)},gamesText:function(e,t){return l(s("Approved games can now be live streamed on %(siteName)s. Let us know which approved game you are playing below. If a game you would like to broadcast on %(siteName)s is not on the approved list, encourage the game developer to submit their game to the Multimedia Games site."),{siteName:e,gamesUrl:(0,i.BN)(t)},!0)},usedByText:function(e){return l(s("Currently used by: %(app)s"),{app:e},!0)},replaceAppConfirm:function(e){return l(s("This slot is currently used by %(app)s.\nDo you want to replace it?"),{app:e},!0)},noSearchResults:function(e){return l(s("No search results for '%(text)s'"),{text:e},!0)},noSearchResultsMatch:function(e){return l(s("No search results for '%(keyword)s' match your preferences, please update your search/filter options."),{keyword:e},!0)},searchResultsFor:function(e){return l(s('Search results for "%(keyword)s"'),{keyword:e},!0)},feedbackSentimentLabel:function(e){return l(s("Overall, how was your %(siteName)s experience today?"),{siteName:e},!0)},feedbackSmcLabel:function(e){return l(s("How was your %(siteName)s Cam To Cam experience today?"),{siteName:e},!0)},feedbackBroadcasterLabel:function(e){return l(s("How was your %(siteName)s broadcast experience today?"),{siteName:e},!0)},howSmootherExperience:function(e){return l(s("Can we do anything to make your %(siteName)s experience smoother?"),{siteName:e},!0)},upgradeToSupporter:function(e){return l(s('Upgrade to supporter for no ads, private messaging, and more!'),{link:(0,i.BN)(e)},!0)},supporterToUseFeature:function(e){return l(s('Upgrade to supporter to use this feature.'),{link:(0,i.BN)("/supporter/upgrade/?source=".concat(e))},!0)},sorryToSeeYouGo:function(e){return l(s("We're sorry to see you go. Your subscription has been canceled successfully. You will keep all of your supporter features until %(expireAt)s, after which your membership will expire. You will not be charged after this date."),{expireAt:e},!0)},startDateNotice:function(e){return l(s("Your new subscription will begin %(startAt)s."),{startAt:e},!0)},obsBroadcastWarning:function(e){return l(s("WARNING: Your broadcast is live on %(siteName)s when you are streaming from RTMP/OBS, regardless of if you are in your room."),{siteName:e},!0)},selectGameSectionText:function(e,t){return l(s('If a game you would like to broadcast on %(siteName)s is not on the approved list, encourage the game developer to submit their game to the Multimedia Games Site .'),{siteName:e,gamesUrl:(0,i.BN)(t)},!0)},downloadOBSSectionText:function(e){return l(s('You can use Open Broadcaster Software (OBS) to stream games and overlay with it your webcam feed. You\'ll need your %(siteName)s stream key to connect OBS to your stream. See a quick tutorial if you need help.'),{siteName:e,obsLink:(0,i.BN)("https://obsproject.com/"),supportLink:(0,i.BN)("https://support.chaturbate.com/hc/en-us/articles/360037971952-How-do-I-set-up-OBS-/")},!0)},authorizeGameSectionText:function(e){return l(s('After you go live, click here to add the gaming tag to your stream. This step is required to stream licensed games on %(siteName)s.'),{siteName:e},!0)},mobileNewPrivateMessageNotice:function(e){return l(s("New private message from %(username)s"),{username:e},!0)},newPrivateMessageNotice:function(e){return l(s("New private message from %(username)s"),{username:e},!0)},newDirectMessageNotice:function(e){return l(s("New direct message from %(username)s"),{username:e},!0)},newConversationMessageNotice:function(e){return l(s("New message from %(username)s"),{username:e},!0)},sendDmToUser:function(e){return l(s("Send DM to %(username)s"),{username:e},!0)},tipUser:function(e){return l(s("Tip %(user)s"),{user:e},!0)},sendTipToUser:function(e){return l(s("Send Tip to %(user)s"),{user:(0,r.t)(e)},!0)},numViewerOrViewers:function(e){return l(a("%(viewerCount)s viewer","%(viewerCount)s viewers",e),{viewerCount:e},!0)},shortenedNumViewerOrViewers:function(e,t){return l(a("%(shortenedViewCount)s viewer","%(shortenedViewCount)s viewers",e),{shortenedViewCount:t},!0)},obsStreamClass:function(e){return l(s("Your stream is classed as %(resolutionTitle)s"),{resolutionTitle:e},!0)},obsConnectionDescription:function(e,t,n){return l(s("Connected to %(host)s in region %(region)s - Using %(streamType)s"),{host:e,region:t,streamType:n},!0)},obsFPS:function(e){return l(s("%(fps)s fps"),{fps:e},!0)},obsBitrate:function(e){return l(s("%(bitrate)s bitrate"),{bitrate:e},!0)},obsAlternativeStreamType:function(e){return l(s("Currently broadcasting with %(streamType)s from another browser."),{streamType:e},!0)},obsSupport:function(e){return l(s("Visit our support page to get started with OBS on %(siteName)s"),{siteName:e},!0)},signInWithSocialAuth:function(e){return l(s("Sign In with %(name)s"),{name:e},!0)},createdAt:function(e){return l(s("Created at %(date)s"),{date:e},!0)},expiresOn:function(e){return l(s("Expires on %(date)s"),{date:e},!0)},followingUser:function(e){return l(s("Following %(username)s"),{username:e},!0)},followCountLong:function(e,t){return l(s("%(online)s Online / %(total)s Following"),{online:e,total:t},!0)},cannotCancelPrivate:function(e,t,n){var i;return i=s(t>0?"You have started a private show with a %(minimumMinutes)s minute minimum. You cannot cancel your private show yet. It still has %(minutesRemaining)s minutes and %(secondsRemaining)s seconds remaining.":"You have started a private show with a %(minimumMinutes)s minute minimum. You cannot cancel your private show yet. It still has %(secondsRemaining)s seconds remaining."),l(i,{minimumMinutes:e,minutesRemaining:t,secondsRemaining:n},!0)},unableToLeavePrivateShow:function(e){return l(s("Unable to leave private show from status: %(prevStatus)s"),{prevStatus:e},!0)},pmFloatingWindowOverflowMenuToolTipMessage:function(e){return l(a("There is %(num)s more open conversation","There are %(num)s more open conversations",e),{num:e},!0)},sentTipDmNotice:function(e){return l(a("You tipped %(num)s token.","You tipped %(num)s tokens.",e),{num:e},!0)},receivedTipDmNotice:function(e,t){return l(a("%(otherUser)s tipped you %(num)s token.","%(otherUser)s tipped you %(num)s tokens.",t),{otherUser:e,num:t},!0)},receivedTipDmNoticeWithMessage:function(e,t,n){return l(a("%(otherUser)s tipped you %(num)s token. -- %(message)s","%(otherUser)s tipped you %(num)s tokens. -- %(message)s",t),{otherUser:e,num:t,message:n},!0)},privacyLabel_InCntntSUp:function(e){return l(s('I have read and agree to the privacy policy.'),{link:(0,i.BN)(e)},!0)},anonUsersCount:function(e){return l(a("+%(anonCount)s anonymous user","+%(anonCount)s anonymous users",e),{anonCount:e},!0)},directMessagesPageTitle:function(e,t){return l(s("Direct Messages (%(currentUsername)s) - %(otherUsername)s"),{currentUsername:e,otherUsername:t},!0)},todayAtTime:function(e){return l(s("Today at %(time)s"),{time:e},!0)},yesterdayAtTime:function(e){return l(s("Yesterday at %(time)s"),{time:e},!0)},shortcodeEnteredError:function(e){return l(s("Invalid shortcode message entered: %(message)s"),{message:e},!0)},shortcodeFollowMessage:function(e){return l(s("Follow %(username)s"),{username:e},!0)},shortcodeFanclubMessage:function(e){return l(s("Join %(username)s's Fan Club"),{username:e},!0)},shortcodeHelpSignup:function(){return l(s("Generates a clickable link with the text \"%(signupMsg)s\". Upon clicking the link, it opens the signup page using the broadcaster user's affiliate tracking tags. The shortcode is designed to always return the signup link with the broadcaster's campaign/affiliate code, regardless of who in the broadcaster's room types in that shortcode."),{signupMsg:c.joinCB},!0)},shortcodeHelpSupporter:function(){return l(s('Generates a clickable link with the text "%(supporterMsg)s". Upon clicking this link, the user is directed to the supporter page to upgrade their membership.'),{supporterMsg:c.becomeSupporter},!0)},shortcodeHelpFanclub:function(e){return l(s("Generates a clickable link with the text \"%(fanclubMsg)s\". When the link is clicked, it opens the broadcaster's Fan Club page. If the user doesn't have a Fan Club set up, an error dialog will be displayed to explain this."),{fanclubMsg:c.shortcodeFanclubMessage(e)},!0)},shortcodeHelpFollow:function(e){return l(s('Generates a clickable link with the text "%(followMsg)s". When a user clicks on this link, it triggers the user to follow the room. If the user is already following the room, the shortcode is designed to do nothing.'),{followMsg:c.shortcodeFollowMessage(e)},!0)},shortcodeHelpTip:function(){return l(s('Generates a clickable link with the text representing the specified amount, such as "50 tokens." Upon clicking the link, it opens a tipping dialog with the given amount and message (in this case, "%(tipExample)s") prepopulated in the dialog. This shortcode is allowed only for broadcasters and apps.'),{tipExample:c.shortcodeHelpTipExample},!0)},roomlistPageTitleHashtag:function(e,t){return l(s("%(tagName)s Cams @ %(siteName)s - Free Adult Webcams & Live Sex"),{tagName:e,siteName:t},!0)},roomlistPageTitleFemale:function(e){return l(s("Free Chat with Girls - Live Cam Girls, Free Webcam Girls at %(siteName)s"),{siteName:e},!0)},roomlistPageTitleMale:function(e){return l(s("Free Chat with Men - Live Gay Cams, Free Gay Webcams at %(siteName)s"),{siteName:e},!0)},roomlistPageTitleCouple:function(e){return l(s("Free Chat with Couples - Live Cam Couples, Free Webcam Couples at %(siteName)s"),{siteName:e},!0)},roomlistPageTitleTrans:function(e){return l(s("Free Chat with Trans - Live Cam Trans, Free Webcam Trans at %(siteName)s"),{siteName:e},!0)},roomlistPageTitleDefault:function(e){return l(s("%(siteName)s - Free Adult Webcams, Live Sex, Free Sex Chat, Exhibitionist & Pornstar Free Cams"),{siteName:e},!0)},roomlistPageTitlePremium:function(e){return l(s("%(siteName)s - Private Cams, Spy Cams"),{siteName:e},!0)},metaTitlePremium:function(e){return l(s("Premium Private Cam Shows at %(siteName)s"),{siteName:e},!0)},metaTitleFemale:function(e){return l(s("Free Chat with Cam Girls at %(siteName)s!"),{siteName:e},!0)},metaTitleMale:function(e){return l(s("Free Chat with Cam Guys at %(siteName)s!"),{siteName:e},!0)},metaTitleCouples:function(e){return l(s("Free Chat with Cam Couples at %(siteName)s!"),{siteName:e},!0)},metaTitleTrans:function(e){return l(s("Free Trans Cams and Chat at %(siteName)s!"),{siteName:e},!0)},metaTitleHashtag:function(e,t){return l(s("%(siteName)s - %(hashtag)s Live Webcams"),{siteName:e,hashtag:t},!0)},metaTitleDefault:function(e){return l(s("%(siteName)s - Free Adult Live Webcams!"),{siteName:e},!0)},metaContentCardDescriptionHashtag:function(e){return l(s("Enjoy free %(hashtag)s webcams and live chat broadcasts from amateurs. No registration required!"),{hashtag:e},!0)},metaDescriptionFemale:function(e){return l(s("Chat with live cams girls on %(domain)s! NSFW - Uncensored chat & adult webcams"),{domain:e},!0)},metaDescriptionMale:function(e){return l(s("Talk with gay guys and men instantly on %(domain)s! NSFW - Uncensored chat & gay webcams"),{domain:e},!0)},metaDescriptionCouples:function(e){return l(s("Watch live couples chatting on %(domain)s! NSFW - Uncensored chat & adult webcams"),{domain:e},!0)},metaDescriptionTrans:function(e){return l(s("Enjoy wild live trans webcams on %(domain)s! NSFW - Uncensored chat & trans webcams"),{domain:e},!0)},metaKeywordsHashtag:function(e){return l(s("%(hashtag)s cams, %(hashtag)s sex, %(hashtag)s xxx, %(hashtag)s porn, %(hashtag)s webcams"),{hashtag:e},!0)},rssLinkTitle:function(e,t){return l(s("%(camCategory)s Cams RSS Feed for %(siteName)s"),{camCategory:e,siteName:t},!0)},genderSymbolToIconTitle:function(e){var t,n=new Map([[o.Y0.All,""],[o.Y0.Male,c.maleText],[o.Y0.Female,c.femaleText],[o.Y0.Couple,c.coupleText],[o.Y0.Trans,c.transText],[o.Y0.OldTrans,c.transText]]),i=(0,o.$p)(e);return null!==(t=n.get(i))&&void 0!==t?t:""},errorLoadingDms:function(e){return l(s("Error loading DM conversation with %(username)s"),{username:e},!0)},v1AppsAndBotsFooterText:function(){return l(s("Create or update v1 Apps & Bots on the v1 Apps & Bots page."),{link:(0,i.BN)("/apps/")},!0)},ieSupportNotification:function(){return l(s('We noticed you\'re using a web browser that we don\'t support. Upgrade to a recent version of
Chrome, Firefox, or Safari'),{chromeLink:(0,i.BN)("https://www.google.com/chrome/"),firefoxLink:(0,i.BN)("https://www.mozilla.org/firefox/"),safariLink:(0,i.BN)("https://support.apple.com/downloads/safari/")},!0)},addTFANotification:function(){return l(s('Add an extra layer of protection to your account by setting up 2-Step Verification at the Security Center'),{link:(0,i.BN)("/security/")},!0)},camAndMicPermissionSupportInfo:function(){return l(s("Visit our support page for help enabling your devices."),{link:(0,i.BN)("https://support.chaturbate.com/hc/en-us/articles/360040862791/")},!0)},floatingPlayerMenuBubbleText:function(){return l(s('

To disable, go to

Options

on the homepage and uncheck "Enable floating player".

'),{link:(0,i.BN)("/?advanced_options=1")},!0)},signUpToUseFeature:function(){return l(s('Sign up to use this feature.'),{link:(0,i.BN)("/accounts/register/")},!0)},enableAgeVerificationToReceiveTokens:function(){return l(s('You must submit age verification to enable the ability to receive tokens while broadcasting.'),{link:(0,i.BN)("/accounts/age_verification/")},!0)},mustBeAgeVerifiedToAddSocialMedia:function(){return l(s('You must be age verified to add new social media'),{link:(0,i.BN)("/accounts/age_verification/")},!0)},mustBeAgeVerifiedToUploadContent:function(){return l(s('You must purchase tokens or be age verified to add new photos and videos'),{link:(0,i.BN)("/accounts/age_verification/")},!0)},inactiveGuestNotice:function(){return l(s('One of your linked Guests has become inactive. Review your Guests now.'),{link:(0,i.BN)("/accounts/age_verification/")},!0)},visitMobileSiteOrFeedback:function(){return l(s('Visit the mobile site again, or give us some feedback on why you left'),{link:(0,i.BN)("https://m.chaturbate.com/mobile/")},!0)},ageVerifiedBody2:function(){return l(s('To age verify another person on your account, submit their ID at the Independent Broadcaster Verification page'),{link:(0,i.BN)("/identity/")},!0)},roomFilteredByHashtag:function(e){return l(s("Rooms filtered by #%(hashtag)s "),{hashtag:e},!0)},categoryDescriptionPrivate:function(e){return l(s("Spy on private shows to experience the most exclusive shows on %(siteName)s. You won't get to interact, but it's much cheaper than buying a private show yourself."),{siteName:e},!0)},seconds:function(e){return l(arguments.length>1&&void 0!==arguments[1]&&arguments[1]?s("%(seconds)s sec"):a("%(seconds)s second","%(seconds)s seconds",e),{seconds:e},!0)},secondsAgo:function(e){return l(a("%(seconds)s second ago","%(seconds)s seconds ago",e),{seconds:e},!0)},secondsFromNow:function(e){return l(a("%(seconds)s second from now","%(seconds)s seconds from now",e),{seconds:e},!0)},minutes:function(e){return l(arguments.length>1&&void 0!==arguments[1]&&arguments[1]?a("%(minutes)s min","%(minutes)s mins",e):a("%(minutes)s minute","%(minutes)s minutes",e),{minutes:e},!0)},minutesAgo:function(e){return l(a("%(minutes)s minute ago","%(minutes)s minutes ago",e),{minutes:e},!0)},minutesFromNow:function(e){return l(a("%(minutes)s minute from now","%(minutes)s minutes from now",e),{minutes:e},!0)},hours:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var t=e.toFixed(1);return l(a("%(hours)s hr","%(hours)s hrs",t),{hours:t},!0)}return l(a("%(hours)s hour ago","%(hours)s hours ago",e),{hours:e},!0)},hoursAgo:function(e){return l(a("%(hours)s hour ago","%(hours)s hours ago",e),{hours:e},!0)},hoursFromNow:function(e){return l(a("%(hours)s hour from now","%(hours)s hours from now",e),{hours:e},!0)},days:function(e){return l(arguments.length>1&&void 0!==arguments[1]&&arguments[1]?a("%(days)s d","%(days)s d",e):a("%(days)s day","%(days)s days",e),{days:e},!0)},daysAgo:function(e){return l(a("%(days)s day ago","%(days)s days ago",e),{days:e},!0)},daysFromNow:function(e){return l(a("%(days)s day from now","%(days)s days from now",e),{days:e},!0)},weeks:function(e){return l(arguments.length>1&&void 0!==arguments[1]&&arguments[1]?a("%(weeks)s wk","%(weeks)s wks",e):a("%(weeks)s week","%(weeks)s weeks",e),{weeks:e},!0)},weeksAgo:function(e){return l(a("%(weeks)s week ago","%(weeks)s weeks ago",e),{weeks:e},!0)},weeksFromNow:function(e){return l(a("%(weeks)s week from now","%(weeks)s weeks from now",e),{weeks:e},!0)},months:function(e){return l(arguments.length>1&&void 0!==arguments[1]&&arguments[1]?a("%(months)s mo","%(months)s mos",e):a("%(months)s month","%(months)s months",e),{months:e},!0)},monthsAgo:function(e){return l(a("%(months)s month ago","%(months)s months ago",e),{months:e},!0)},monthsFromNow:function(e){return l(a("%(months)s month from now","%(months)s months from now",e),{months:e},!0)},years:function(e){return l(arguments.length>1&&void 0!==arguments[1]&&arguments[1]?a("%(years)s yr","%(years)s yrs",e):a("%(years)s year","%(years)s years",e),{years:e},!0)},yearsAgo:function(e){return l(a("%(years)s year ago","%(years)s years ago",e),{years:e},!0)},yearsFromNow:function(e){return l(a("%(years)s year from now","%(years)s years from now",e),{years:e},!0)},ageRangeTo:function(e,t){var n=String(null!=e?e:""),i=String(null!=t?t:"");return l(s("%(fromAge)s to %(toAge)s"),{fromAge:n,toAge:i},!0)},spyShowsPerMinute:function(e){var t=String(e);return l(s("Spy Shows for %(strToken)s Tokens per Minute"),{strToken:t},!0)},spyShowSubtext:function(e){var t=String(e);return l(s("Discover exclusive content by spying on private shows for only %(strToken)s tokens/min."),{strToken:t},!0)},sendPmCAPS:s("SEND PM"),sendDmCAPS:s("SEND DM"),pmMenuTitle:s("Send PM"),dmMenuTitle:s("Send DM"),pmSupporterNotice:s("You must be a supporter, fan club member, or moderator to send this private message."),pmSupporterNoticeAgeVerified:s("You must be a supporter, fan club member, moderator, or have received a tip today from this user to send this private message."),dmSupporterNotice:s("You must be a supporter, fan club member, or moderator to send this direct message."),dmSupporterNoticeAgeVerified:s("You must be a supporter, fan club member, moderator, or have received a tip in the past week from this user to send this direct message."),pmSupporterSignUp:s("Sign up for a"),pmSupporterMembership:s("Supporter Membership"),newPrivateMessageClickPrompt:s(" (open conversation or press TAB to cycle through)"),newConversationPmClickHTML:s("open in PMs or press TAB to cycle through"),newConversationPmClickMobile:s("open in PMs"),newConversationDmClick:s("open in DMs"),openConversationLower:s("open conversation"),joinChaturbateCommunity:s("Join Chaturbate's community."),roomSignupPopupText:s("Chat live, follow broadcasters, access private shows, or earn money!"),roomSignupPopupSignupText:s("Sign Up Free"),chatColor:s("Chat Color"),fontFamily:s("Font Family"),fontSize:s("Font Size"),showEmoticons:s("Show Emoticons"),emoticonAutoCompleteDelay:s("Autocomplete Delay"),sortUsers:s("Sort Users"),highestTokenColor:s("Highest Token Color"),chatAllowedBy:s("Chat Allowed By"),moderatorsExpireAfter:s("Moderators Expire After"),silenceOtherBroadcasters:s("Silence Other Age-Verified Broadcasters"),yesAlways:s("Yes, Always"),preventC2CRedisplay:s("Cam to Cam Notification Rate Limit"),noLimit:s("No Limit"),fiveMinutes:s("Once per User Every 5 Minutes"),forever:s("Once per User Until You View Their Cam"),tipVolume:s("Tip Volume"),viewEditIgnoredUsers:s("View/Edit Ignored Users"),tagLine:s("THE ACT OF MASTURBATING WHILE CHATTING ONLINE"),chatRoomsCAPS:s("CHAT ROOMS"),broadcastYourselfCAPS:"BROADCAST YOURSELF",betaCAPS:s("BETA"),tagsCAPS:s("TAGS"),myCollectionCAPS:s("MY COLLECTION"),myCollectionText:s("My Collection"),loginVerbText:s("Log in"),loginVerbCapitalized:s("Log In"),signUpText:s("Sign Up"),signUpLower:s("Sign up"),defaultTipMessageLabel:s("Include an optional message:"),TipOptionalMessageLabel:s("Optional message:"),sendTipButtonText:s("Send Tip"),sendTipButtonCAPS:s("SEND TIP"),sendTipText:s("Send a tip"),sendTipToBroadcasterText:s("Send tip to broadcaster"),publicTippingText:s("Public Tipping"),publicTippingDesc:s("Username is visible to all users."),anonTippingText:s("Anonymous Tipping"),anonTippingDesc:s("Username only visible to broadcaster."),anonButtonText:s("Send Anonymous Tip"),sending:s("Sending..."),anonTipDisabledModalCont:s("Click OK to continue to supporter signup."),mobileTipMessageLabelLandscape:s("Include optional message"),mobileTipMessageLabelPortrait:s("Tip note..."),mobileChatLabel:s("Tap to chat..."),broadcasterDoesNotAcceptTips:s("This broadcaster doesn't accept tips."),purchaseTokensText:s("Purchase Tokens"),myProfileTextLc:s("My Profile"),liveChatSupportTextLc:s("Live Chat Support"),logOutTextLc:s("Log Out"),logoutModalText:s("Are you sure you want to log out?"),sendFeedbackTextLc:s("Send Feedback"),statusText:s("Status"),tokensLabel:s("You have:"),getMoreTokensLabel:s("Get more tokens"),getMoreTokensTitled:s("Get More Tokens"),chatDisconnectedMessage:s("Chat disconnected. The broadcaster has set a new password on this room."),privateText:s("Private"),privateShowStartLabel:s("Start Private Show"),privateShowSpyLabel:s("Spy on Private Show"),privateShowStartedMessage:s("Private show has started."),privateShowFinishedMessage:s("Private show has finished."),privateShowDeclinedMessage:s("Private show has been declined."),privateShowRequestLabel:s("Request Private Show"),privateShowCancelRequestLabel:s("Cancel Private Show Request"),privateShowRequestCancelMessage:s("Cancel Private Request"),privateShowRequestCancelErrorMessage:s("Cannot cancel private show. Please try again in a few seconds."),privateShowLeaveLabel:s("Leave Private Show"),privateShowLeaveWarning:s("Are you sure you want to leave the private show?"),privateShowRequestMessage:s("Private show request has been sent. Waiting on broadcaster to approve."),requestPrivate:s("Request Private"),cancelRequest:s("Cancel Request"),leavePrivate:s("Leave Private"),spyOnPrivate:s("Spy on Private"),returnFromAwayModeMessage:s("Broadcaster has returned from away mode."),rejoinedRoomKickedMessage:s("You were disconnected because you have joined this room again."),kickedFromRoomMessage:s("The broadcaster has kicked you from the room."),kickedMessage:s("You were kicked from the room."),signUpToChatText:s("signup to chat"),aboutMeText:s("About Me"),wishListText:s("Wish List"),purchasedCAPS:s("PURCHASED"),orCAPS:s("OR"),photosAndVideosText:s("Photos and Videos"),realNameText:s("Real Name"),followersText:s("Followers"),sexText:s("I am"),sexTextCouple:s("We are"),birthdayText:s("Birthday"),birthdateText:s("Birth Date"),ageText:s("Age"),dateText:s("Date"),actionText:s("Action"),bodyTypeText:s("Body Type"),bodyDecorationsText:s("Body Decorations"),interstedInText:s("Interested In"),locationText:s("Location"),languagesText:s("Language(s)"),lastBroadcastText:s("Last Broadcast"),langaugesSpokenText:s("Languages"),smokeDrinkText:s("Smoke Drink"),smokeOrDrinkText:s("Smoke / Drink"),bioUnavailableText:s("User has no available BIO"),bioAndFreeWebCamText:s("Bio and Free Webcam"),errorSubmitting:s("Unable to submit"),submittingText:s("Submitting..."),loadingText:s("Loading"),loadingTextLower:s("loading"),chatSettings:s("Chat Settings"),chatSettingsTabHandleText:s("SETTINGS"),chatSettingsTabHandleTextCapitalized:s("Settings"),chatSettingsSavedText:s("Chat settings saved"),chatCAPS:s("CHAT"),sendCAPS:s("SEND"),sendText:s("Send"),tipCAPS:s("TIP"),tipText:s("Tip"),usersText:s("Users"),usersCAPS:s("USERS"),aUser:s("a user"),reportAbuseText:s("Report Room"),reportAbuseCAPS:s("REPORT ROOM"),reportAbuseTextTerms:s("Your room report will be reviewed as soon as practicable."),roomText:s("Room"),moreRoomsText:s("More Rooms"),spyPrivateShowLower:s("spy private show"),unfollowText:s("Unfollow"),unfollowLower:s("unfollow"),followText:s("Follow"),notifyMe:s("Notify me"),notifyOptionAlways:s("Always"),notifyOptionAuto:s("Auto"),never:s("Never"),refreshRoomsText:s("Refresh Rooms"),womenText:s("Women"),womenCAPS:s("WOMEN"),womenLower:s("women"),femaleText:s("Female"),menText:s("Men"),menCAPS:s("MEN"),menLower:s("men"),maleText:s("Male"),transText:s("Trans"),transCAPS:s("TRANS"),couplesText:s("Couples"),couplesCAPS:s("COUPLES"),couplesLower:s("couples"),coupleText:s("Couple"),saveCAPS:s("SAVE"),saveText:s("Save"),recentlyUsedEmojis:s("Recently used"),smileysPeopleEmojis:s("Smileys & People"),animalsNatureEmojis:s("Animals & Nature"),foodDrinkEmojis:s("Food & Drink"),activitiesEmojis:s("Activities"),travelPlacesEmojis:s("Travel & Places"),objectsEmojis:s("Objects"),symbolsEmojis:s("Symbols"),flagsEmojis:s("Flags"),uploadEmoticonsText:s("Upload"),tone:s("Tone"),currentBalanceText:s("Your current balance:"),balanceText:s("Balance:"),tokenBalanceText:s("Token Balance"),currentHaveText:s("You currently have: "),satisfactionWarningText:s("WARNING: This room has a low satisfaction rating."),tipWarningText:s("TIP AT YOUR OWN RISK!"),tipAmountText:s("Enter tip amount:"),tipAmountInvalid:s("Invalid tip amount!"),amountText:s("Amount:"),toggleWindowMessage:s("Toggle this window with Ctrl+S"),leaveOpenCheckBoxLabel:s("Leave open after tipping"),selectOneLabel:s("Select One"),selectReason:s("Please select a reason"),loadingUserListText:s("Loading user list"),refreshUserListText:s("refresh userlist"),refreshUserListSentenceCase:s("Refresh userlist"),errorRefreshingUserList:s("Error refreshing user list. Please try again later."),sendAMessage:s("Send a message"),sendAMessageDesktop:s("Send a message..."),sendPrivateMessageText:s("Send private message"),sendDirectMessageText:s("Send direct message"),loggedInToPm:s('You must be logged in to send a private message. Click "OK" to login.'),loggedInToDm:s('You must be logged in to send a direct message. Click "OK" to login.'),mentionUserText:s("Mention this user"),hideAdsText:s("HIDE ALL ADS NOW"),exoticAdsText:s("Powered by ExoticAds
Buy/Sell Traffic"),showMoreText:s("Show More"),picsAndVideosText:s("Pics & Videos"),picsText:s("Pictures"),vidsText:s("Videos"),socialMediaText:s("Social Media"),appsAndBots:s("Apps & Bots"),appsTabDescription:s("Add features like Tip Menus, Ticket Shows, and Top Tippers to your room with apps!"),v2AppsDescription:s("v2 Apps can keep track of your top visitors and tippers across multiple broadcasts."),aspText:s("New in v2 Apps: support for permanent storage, high traffic rooms and more to come soon."),newCapitalized:s("New"),apps:s("Apps"),games:s("Games"),dismissMessage:s("dismiss this message"),hashtagWarning:s("Only 5 #hashtags will be applied"),dismissLower:s("dismiss"),registerLaterText:s("Register later"),alreadyRegisteredText:s("Already have an account?"),loginHereText:s("Login here"),signInText:s("Please sign in using the form below"),usernameText:s("Username"),passwordText:s("Password"),captchaText:s("Prove you are human"),keepLoggedInText:s("Keep me logged in"),forgotPassword:s("Forgot password?"),incorrectPassword:s("Incorrect password"),incorrectCaptcha:s("Incorrect captcha"),createFreeAccount:s("Create Free Account"),improvedMobileSite:s("We've improved Chaturbate's mobile site by adding these feature(s):"),satisfactionVoting:s("Satisfaction Voting"),orText:s("Or "),orLower:s("or"),theMobileSiteText:s("the mobile site"),followerBrowserNotifications:s("Follower browser notifications"),allowBrowserNotificationsMessage:s("Would you like to receive browser notifications when a broadcaster you follow comes online?"),followSubscribeFailedMessage:s("Subscription failure. Please try again from the Settings & Privacy page on your profile."),yesText:s("Yes"),notNowText:s("Not now"),roomRequiresPasswordText:s("This room requires a password."),loginToRoom:s("Login to room"),moderators:s("Moderators"),removeModerators:s("Remove Moderators"),nonModerators:s("Non-Moderators"),removeIgnoredUsers:s("Remove Ignored Users"),unignoreThisUserText:s("Unignore this user"),unignoredUsers:s("Unignored Users"),ignore:s("Ignore"),ignoreThisUserText:s("Ignore this user"),reportThisMessageText:s("Report this message"),ignoredUsers:s("Ignored Users"),clickToUnignoreText:s("Click on a user to unignore them."),clickToUnignoreMobileText:s("Select a user from the list to unignore them."),clickToUnmodText:s("Click on a user to revoke their moderator status."),clickOkToLogin:s('Click "OK" to login.'),loginForIgnore:s("You must be logged in to ignore a user"),reachedMaxIgnore:s("You have reached the maximum number of ignored users. Ignoring a new user when at the limit will remove your oldest ignore. Click OK to continue"),roomOfflineMessage:s("Room is currently offline"),instantNotificationMessage:s("Follow broadcasters to receive instant notifications when they come online."),unfollow:s("UNFOLLOW"),follow:s("FOLLOW"),followed:s("FOLLOWED"),shareText:s("Share"),bioText:s("Bio"),contestStatsText:s("Contest Stats"),settingsAndPrivacy:s("Settings & Privacy"),settingsSaved:s("Settings saved"),tokenStats:s("Token Stats"),broadcasterStats:s("Broadcaster Stats"),memberships:s("Memberships"),submitYourFeedbackText:s("Submit feedback to broadcaster"),optionalCommentNote:s("Optional comment for broadcaster:"),commentSubmittedMessage:s("Submitted"),satisfiedTextCAPS:s("SATISFIED?"),satisfiedText:s("Satisfied?"),scanCamsText:s("SCAN CAMS"),nextCamText:s("NEXT CAM"),scanNextText:s("SCAN / NEXT"),scanText:s("SCAN"),skipCamText:s("SKIP CAM"),exitScanningText:s("EXIT SCANNING"),tokenLinkCodesText:s("Token Linkcodes"),earnTokensForRegisteredUsers:s("Earn up to 10 tokens for every registered user and 500 tokens for users who broadcast (broadcasters must earn $20.00 before they qualify)."),linkCodeMessage:s("Please send to chaturbate using one of the link codes below."),embedCBTopCamText:s("Embed Chaturbate's Top Cam on Your Webpage"),affiliateProgramStatsText:s("the affiliate program stats"),affiliateStatsDetails:s("See details about tokens earned in "),silenceText:s("Silence"),silenceDurationMessage:s("Silence for 6 hours"),removeSilenceMessage:s("Remove Silence"),theaterModeLabel:s("Theater Mode"),fullScreenLabel:s("Full Screen"),exitFullScreenLabel:s("Exit Full Screen"),splitModeLabel:s("Split Mode"),unknownText:s("unknown"),showAllText:s("Show All"),anonFollowMore:s(" to follow your favorite broadcasters and see when they are live."),userFollowMore:s("Follow your favorite broadcasters to see when they are live."),userPromotionToolbarOpenBodyButton:s("Promote your room"),userPromotionNotEnoughTokensText:s("Not enough tokens."),userPromotionPurchaseTokensText:s("Purchase more tokens"),userPromotionIneligibleText:s("You are no longer eligible to promote your room."),userPromotionBadSettingsText:s("User promotion currently unavailable - please check your settings."),userPromotionMustBeLoggedInAlert:s("You must be logged in to promote your room."),userPromotionMustBeOnlineAlert:s("You must be broadcasting to promote your room."),userPromotionBodyHeadline:s("Get More Viewers"),userPromotionBodyDescription:s("Add your room to a rotating promoted spot on the homepage for 5 minutes."),userPromotionDetails:s("details"),userPromotionSubmit:s("Promote now"),userPromotionSubmitInProgress:s("In Progress"),userPromotionTokensLink:s("Get more tokens"),userPromotionCurrentPriceLabel:s("Current price"),userPromotionSettingUp:s("Setting up user promotion..."),userPromotionEnding:s("Promotion ending..."),userPromotionPriceUnknownException:s("Unknown error occurred while retrieving promotion purchase price. Please try again."),userPromotionSubmitUnknownException:s("Unknown error occurred while purchasing user promotion. Please try again."),userPromotionLoadingNewPriceText:s("Loading new pricing..."),broadcastNotificationTopBarOpenBodyButton:s("Announce you're online"),broadcastNotificationTopBarCooldownText:s("Announce again in "),broadcastNotificationTopBarFollowerTextSingularOld:s("You have 1 follower"),broadcastNotificationImageContainerHeadline:s("Send email and browser notifications to your followers."),broadcastNotificationUploadLink:s("Add a photo"),broadcastNotificationUploadLinkReplace:s("Update photo"),broadcastNotificationImageHint1:s("Must be non-nude"),broadcastNotificationImageHint2:s("Recommended size: 1280 x 720 px"),broadcastNotificationImageHint3:s("Shown in notification and featured emails"),broadcastNotificationButtonSendNotification:s("Send notifications"),broadcastNotificationButtonSendNotificationInProgress:s("In Progress"),broadcastNotificationTooltip:s("New photos must be approved. If not approved in 15 minutes, email notifications will be sent without a photo."),broadcastNotificationTopBarOpenBodyLinkTooltip:s("You have no followers to notify."),broadcastNotificationConfirmSendWithoutImage:s("Are you sure you want to notify your followers without an image?"),broadcastNotificationUseApprovedFormat:s("Please use a jpeg, gif, or png image."),broadcastNotificationImageTooLarge:s("Image must not be larger than 10 megabytes."),broadcastNotificationAlreadySent:s("A notification has already been sent."),broadcastNotificationErrorProcessing:s("Something went wrong processing your image. Please try again."),broadcastNotificationErrorAfterSubmit:s("Something went wrong after submit. Please try again."),broadcastNotificationErrorDuringSubmit:s("Something went wrong during submit. Please try again."),broadcastNotificationTooSmallDimensions:s("Image must be at least 200px wide and 200px tall."),broadcastNotificationTooWide:s("Image is too wide."),broadcastNotificationTooTall:s("Image is too tall."),broadcastNotificationRemoveWhileInProgress:s("Please wait until all pending notifications have been sent."),broadcastNotificationRemoveApprovedPhoto:s("Remove approved photo?"),broadcastNotificationBadBrowserNotice:s("Sorry, this feature is not supported in your browser. Please upgrade to a modern browser like Chrome or Firefox."),close:s("Close"),closeWindow:s("Close Window"),cancelText:s("Cancel"),cancelLower:s("cancel"),cancelCAPS:s("CANCEL"),submitCAPS:s("SUBMIT"),submitText:s("Submit"),leave:s("Leave"),request:s("Request"),ending:s("Ending"),started:s("Started"),warnOnClosingDirty:s("You have unsaved changes, are you sure you want to leave this page?"),chooseCategoryText:s("Choose a category"),reportAbuse:s("Report Room"),reportAbuseCatUnderage:s("Broadcaster is underage"),reportAbuseCatAdvertising:s("Broadcaster is advertising"),reportAbuseCatAbusive:s("Broadcaster is abusive"),reportAbuseCatIntoxicated:s("Broadcaster is intoxicated"),reportAbuseCatLarge:s("Using a toy that is too large"),reportAbuseCatOffline:s("Asking for offline payments"),reportAbuseCatPublic:s("Broadcasting in public"),reportAbuseCatUniform:s("Broadcasting in service uniform"),reportAbuseCatSleeping:s("Broadcaster is sleeping"),reportAbuseCatGender:s("Broadcaster is wrong gender"),reportAbuseCatOther:s("Other"),reportAbuseCategoryRequired:s("Please choose a category"),reportAbuseAdditionalComments:s("Additional comments:"),reportAbuseDescriptionRequired:s("Please add a description"),reportMessageInappropriate:s("Message is inappropriate"),reportMessageRudeToBcaster:s("Message is rude towards the broadcaster"),reportMessageRude:s("Message is rude"),reportMessageSpam:s("Message is spam"),reportMessageOffensiveMedia:s("Media is offensive"),reportMessageOther:s("Other (please describe):"),report:s("Report"),reportCAPS:s("REPORT"),unableToReport:s("Unable to send report."),tooManyReports:s("Too many reports sent. Try slowing down."),errorRequestingPrivateShow:s("There was an error requesting your private show. Please try again."),errorRequestingSpyShow:s("There was an error requesting your spy show. Please try again."),unableToCancelSpyShow:s("Unable to cancel spy show"),unableToCancelPrivateRequest:s("Unable to cancel private request"),privateShows:s("Private Shows"),areYouSure:s("Are you sure?"),broadcasterAllowsRecordingsText:s("This broadcaster allows private show recordings, so you will receive a recorded video of this show in your collection."),broadcasterAwayDescription:s("You may continue chatting while you wait for the broadcaster to return."),performerIsAwayText:s("Performer Is Away"),groupShowText:s("Group Show"),privateShowLeaveLabelCAPS:s("LEAVE PRIVATE SHOW"),privateShowRequestCancelMessageCAPS:s("CANCEL PRIVATE REQUEST"),privateShowStartLabelCAPS:s("START PRIVATE SHOW"),privateShowSpyLabelCAPS:s("SPY PRIVATE SHOW"),privateShowSpyLeaveLabelCaps:s("LEAVE SPY SHOW"),privateShowText:s("Private Show"),privateShowsCAPS:s("PRIVATE SHOWS"),privateShowInProgressText:s("Private Show in Progress"),featureNotEnabled:s("This feature is not currently enabled on your device."),loginForPrivateShow:s('You must be logged in to enter a private show. Click "OK" to login.'),loginForPrivateShowSpy:s('You must be logged in to spy on a private show. Click "OK" to login.'),privateShowSpyDisabled:s("Spy has been disabled by the broadcaster."),recordingsInCollection:s("Recordings can be found in your collection."),privatesNotAvailable:s("Private shows are not available for this broadcaster."),privateShowChatActive:s("Private Show chat is active."),clickToChatBroadcaster:s("Click here to chat with the broadcaster."),goToPrivateTabToChat:s("Go to the Private Tab to chat with the broadcaster."),moreRoomsLikeThisText:s("More Rooms Like This"),trendingRoomsInstead:s("Here are some trending rooms instead:"),promotedCAPS:s("PROMOTED"),recommendedCAPS:s("RECOMMENDED"),recommendedPopularCAPS:s("RECOMMENDED POPULAR"),offlineCAPS:s("OFFLINE"),exhibitionistCAPS:s("EXHIBITIONIST"),newCAPS:s("NEW"),hdCAPS:s("HD"),hdPlusCAPS:s("HD+"),inPrivateCAPS:s("IN PRIVATE"),gamingCAPS:s("GAMING"),chaturbatingCAPS:s("CHATURBATING"),broadcastingCAPS:s("BROADCASTING"),hiddenStaffOnlyTextCAPS:s("HIDDEN - STAFF ONLY"),viewOnTwitterText:s("View on Twitter"),showTipsAndMessages:s("Show tips and messages"),viewPhotosVideos:s("View Pics and Videos"),seeMore:s("See more"),howCanWeImproveText:s("How Can We Improve?"),updatesText:s("Updates"),photoVideoUpdatesText:s("Pics & Vids"),noPicsVideos:s("This user has not added any photos or videos yet."),noPics:s("This user has not added any photos yet."),noVideos:s("This user has not added any videos yet."),morePics:s("More Pics"),moreVideos:s("More Videos"),morePicsVideos:s("More Pics & Videos"),fanTextCAPS:s("FAN"),clubTextCAPS:s("CLUB"),tokensCC:s("Tokens"),uploadedText:s("Uploaded"),purchasedPhotoSet:s("If you already purchased this photo set, try reloading the page to view it."),purchasedVideo:s("If you already purchased this video, try reloading the page to view it."),orSimple:s("or"),hiResImage:s("View Hi-Res Image"),loggedInToPurchasePhoto:s('You must be logged in to purchase this photo set. Click "OK" to login.'),loggedInToViewHiRes:s('You must be logged in to view hi-res images. Click "OK" to login.'),loggedInToPurchaseVideo:s('You must be logged in to purchase this video. Click "OK" to login.'),okToGetTokens:s('Click "OK" to get more tokens.'),pressPurchaseTokens:s('Press "Purchase Tokens" to get more.'),uploadMorePhotosText:s("Upload more Photos"),reOrderItemsText:s("Re-Order Items"),changeVideoThumbnailText:s("Change video thumbnail image"),editDetailsText:s("Edit Details"),complianceText:s("Compliance"),deactivateText:s("Deactivate"),staffCAPS:s("STAFF"),audioDisabledText:s("Audio is disabled."),audioRemovedText:s("Audio muted to remove music"),failedCAPS:s("FAILED"),pendingCAPS:s("PENDING"),approvalCAPS:s("APPROVAL"),videoCAPS:s("VIDEO"),processingCAPS:s("PROCESSING"),errorCAPS:s("ERROR"),failedApprovalText:s("Failed Approval"),removeOffendingItemsText:s("Please delete or edit offending items."),openInNewWindowText:s("Open in new window"),ipadFailedToSetup:s("iPad has failed to setup the broadcast. Please try again."),poorBroadcast:s("Please check your internet connection or close other applications"),noCameraFound:s("No camera found."),camAndMicPermissionPrompt:s('We need permission to use your camera and microphone in order to proceed. When prompted by the browser, please click "Allow."'),camAndMicPermissionPromptFF:s('We need permission to use your camera and microphone in order to proceed. When prompted by the browser, please check "Remember this decision" and click "Allow."'),camAndMicPermissionDenied:s("Permissions to use your camera and microphone are currently denied."),needCamAndMicPermission:s("We need permission to use your camera and microphone in order to proceed."),permanentPermsMessage:s('We need permanent permission to use your camera and microphone. Remember to check "Remember this decision" when granting permission.'),requestDevicePermissions:s("Request Device Permissions"),resolutionNotSupported:s("The resolution is not supported by your device."),minResolutionNotSupported:s("Your device does not support the minimum resolution."),unknownDeviceError:s("Your device does not support the minimum resolution."),supportPage:s("support page"),noOtherTabsOpen:s("Make sure there are no other broadcast tabs open."),lowFPS:s("Low FPS"),wantToLeaveConfirmation:s("Are you sure you want to leave?"),wentToAway:s('This private show has ended. To give you\ntime to prepare, you are now shown as "Away" to\nthose in your room. To return and be visible on\ncam, click "Exit Away Mode" below.'),exitAwayMode:s("Exit Away Mode"),couldNotGetDevices:s("Could not get devices"),turnDevice180:s("Turn your device 180 degrees."),turnDeviceLandscape:s("Turn your device into landscape mode."),cameraLabel:s("Camera"),resolutionLabel:s("Resolution"),microphoneLabel:s("Microphone"),inputLevelLabel:s("Input Level"),muteLabel:s("Mute"),noMicrophone:s("None (Silent)"),startBroadcasting:s("Start Broadcasting"),stopBroadcasting:s("Stop Broadcasting"),youAreAway:s("You Are Away"),highQualityStream:s("For high quality streams we strongly recommend"),useOBS:s("Use external software (OBS)"),pleaseWaitConnecting:s("Please wait. Connecting in"),couldNotStartBroadcast:s("Could not start broadcast"),welcomeBack:s("Welcome back"),couldNotSetupPreview:s("Could not setup preview. Please make any possible adjustments and reload the page"),couldNotSetupBroadcast:s("Could not setup broadcast"),showMyCamPreviewTitle:s("My Cam Preview"),showMyCamShow:s("Cam To Cam"),showMyCamStop:s("Stop Cam To Cam"),showMyCamAlreadyBroadcasting:s("Unable to share cam: You are already broadcasting from another window or tab"),showMyCamPreviewInfo2:s("The cam icon will turn orange when the broadcaster is viewing you."),showMyCamBroadcastError:s("Error sharing cam"),showMyCamBroadcastTimeoutError:s("Error sharing cam: Timed out trying to connect"),showMyCamCouldNotView:s("Error viewing cam"),showMyCamMustBeConnected:s("Unable to share cam: Make sure you are connected to chat and the broadcast is playing"),showMyCamMayNotShareIsPrivate:s("Unable to share cam: Broadcaster is in a private show"),showMyCamMayNotShare:s("You are not allowed to share your cam with this user"),showMyCamMayNotShareUpsell:s("Sharing your cam is only available to users who have purchased tokens. Click OK to purchase tokens now."),showMyCamWillRemovePassword:s("Sharing your cam will remove your room password"),showMyCamSharingPrefix:s("Viewer "),showMyCamStartedSharing:s(" started sharing their cam"),showMyCamStoppedSharing:s(" stopped sharing their cam"),showMyCamStartedViewing:s(" started viewing your cam"),showMyCamStoppedViewing:s(" stopped viewing your cam"),showMyCamIsViewing:s("is currently viewing your cam"),showMyCamNotViewing:s("is not currently viewing your cam"),showMyCamMuted:s("Muted"),showMyCamCloseCam:s("Close Cam"),showMyCamBlockCam:s("Block Cam"),showMyCamPopoutCam:s("Pop Out Cam"),showMyCamReportCam:s("Report Cam"),showMyCamReportPublic:s("User is broadcasting in public"),showMyCamReportRude:s("User is rude/abusive"),showMyCamReportIntoxicated:s("User is intoxicated"),showMyCamReportSleeping:s("User is sleeping"),showMyCamReportSpamming:s("User is spamming"),showMyCamReportUnderage:s("User is underage"),showMyCamMyCam:s("My Cam"),showMyCamView:s("View Cam"),showMyCamStopView:s("Stop Viewing Cam"),showMyCamTooManyCams:s("Unable to view cam: A maximum of five cams can be viewed at once"),showMyCamCamOffline:s("Unable to view cam: This viewer is no longer sharing their cam"),showMyCamNavigationPrompt:s("Leaving this page will end your cam. Click OK to proceed."),showMyCamConnectionClosed:s("(connection closed)"),broadcaster:s("Broadcaster"),moderator:s("Moderator"),fanclubMember:s("Fan club member"),user:s("User"),roomJoinedMessage:s("has joined the room"),roomLeftMessage:s("has left the room."),roomFollowToGetNotified:s("Follow to be notified when online."),feedbackCommentsLabel:s("Describe your issue or share your ideas:"),feedbackNotice:s("Some account and system information may be sent to %SITE_NAME%. We will use the information you give us to help address technical issues to improve our services, subject to our Privacy Policy and Terms of Service."),feedbackSubmit:s("Send feedback"),feedbackAddScreenshot:s("Add screenshot"),feedbackAddScreenshotInfoScrollDown:s("Scroll down to capture lower on the page"),feedbackAddScreenshotInfoScrollUp:s("Scroll up to capture higher on the page"),feedbackCanvasToggle:s("Click to highlight or hide info"),feedbackHighlightInfo:s("Highlight issues with orange or hide sensitive info with black. Hit the ESC key to finish."),feedbackHighlightControl:s("Highlight issue"),feedbackHideControl:s("Hide sensitive info"),feedbackPermissionDenied:s("Permission to capture screen not granted"),feedbackUnknownCaptureError:s("Could not capture screen"),feedbackResize:s("Please take screenshot again after resizing"),feedbackSubmitted:s("Your feedback has been sent! Thank you for your feedback."),feedbackUnknownError:s("Something went wrong. Please try again later."),feedbackRateLimitError:s("Please wait before submitting more feedback."),feedbackBannedUser:s("Unable to submit feedback. Please contact support."),doneText:s("Done"),watchingText:s("Watching"),denyPrivate:s("Deny Private"),acceptPrivate:s("Accept Private"),returnToChat:s("Return to Chat"),returnToPublicChat:s("Return to Public Chat"),privateShowEnded:s("Your private show has ended."),cameraRemainHidden:s("Your camera will remain hidden until you re-enter public chat."),aboutToStopGroupShow:s("You're about to stop the group show. Do you want to continue?"),aboutToStopPrivateShow:s("You're about to stop the private show. Do you want to continue?"),errorBroadcasting:s("Error broadcasting"),fontSettings:s("Font Settings"),emoticonsSettings:s("Emoticons Settings"),usersSettings:s("Users Settings"),notificationsSettings:s("Notifications Settings"),otherSettings:s("Other Settings"),noOneIgnored:s("You have no users ignored."),backToSettings:s("Back to Settings"),backToChatSettings:s("Back to Chat Settings"),notifyEntryFor:s("Notify on Entry For"),notifyLeaveFor:s("Notify on Leave For"),noNewUpdates:s("No new updates"),videoBeingProcessed:s("The video is currently being processed. It may take several minutes depending on the size of the video."),videoProcessingError:s("The video is damaged or its format is not supported."),videoReupload:s("Please delete this video and reupload again."),mustBeSupporterFeature:s("You must be a supporter to use this feature."),loginToFollow:s('You must be logged in to Follow. Click "OK" to login.'),loginToUseFeature:s("Log in or sign up to use this feature"),loginToTip:s('You must be logged in to send a tip. Click "OK" to login.'),loginToContinue:s("Log in to continue"),dontHaveAccount:s("Don't have an account?"),dontHaveAccountYet:s("Don't have an account yet?"),tippedTonsRecently:s("Tipped Tons"),tippedTonsRecentlyDef:s("1000+ tokens in the past 2 weeks"),tippedALotRecently:s("Tipped Lots"),tippedALotRecentlyDef:s("250+ tokens in the past 2 weeks"),tippedRecently:s("Tipped Recently"),tippedRecentlyDef:s("50+ tokens in the past 2 weeks"),tippingLabel:s("Tipping"),hasTokens:s("Purchased Tokens"),hasTokensDef:s("Has bought tokens"),inFanClub:s("Fan Club Member"),isMod:s("Moderator"),isBroadcaster:s("Broadcaster"),upgradeToSupporterLabel:s("Upgrade to Supporter"),outboundTip:s("Outbound Tip"),tipFrom:s("Tip From"),transferTokensToCash:s("Transfer tokens to cash"),transferTokensToAdvertising:s("Transfer tokens to advertising credit"),referredMember:s("Referred Member"),adminAdjustment:s("Admin Adjustment"),hasBeenResolved:s("This has been resolved by an administrator"),email:s("email"),emailLabel:s("Email"),spyShow:s("Spy Show"),spyNow:s("Spy Now"),spyShowCost:s("Spy Show cost"),spyingNow:s("Spying now"),fanClubMembership:s("Fan Club Membership"),broadcasterWelcomeWarning:s("Broadcaster Rules: Tokens are the only form of payment allowed. You may promote your personal website as long as it does not offer video chat. Do not ask users to chat with you elsewhere."),viewerWelcomeWarning:s("Rules: No spamming. Do not insist the cam hosts to do as you please. Do not announce other rooms or websites that would conflict with this room. Avoid any argumentative and/or rude posts related to the cam viewing. Do not attempt to post your e-mail address in the public chat."),useExternalEncoder:s("Use External Encoder to Broadcast"),broadcastWithOBS:s("Broadcast yourself using Open Broadcaster Software (OBS)"),accept:s("Accept"),decline:s("Decline"),userTokenRate:s("User(s) Token Rate"),privateShowStats:s("Private Show Stats"),exitPrivateShow:s("Exit Private Show"),useAppsAndBots:s("Enhance your room with Apps & Bots in the tab below."),disabled:s("Disabled"),allowed:s("Allowed"),privates:s("Privates"),broadcastGuideTitle:s("Broadcaster's Guide"),myBroadcast:s("My Broadcast"),passwordProtectedWarning:s("Your room is password protected. Users may not enter your room unless they know your password. To remove your password, edit your settings & privacy."),kickBan:s("Kick/Ban"),removeModeratorStatus:s("Remove Moderator Status"),promoteToModerator:s("Promote to Moderator"),obsShareWarning:s("WARNING: Never show or share your broadcast token with anyone!"),yourBroadcastToken:s("Your broadcast token"),broadcastingInformation:s("RTMP/OBS Broadcasting Information"),clickToViewOBSSetupGuide:s("Click here to view our OBS Setup Guide"),importantInformation:s("Important Information"),doNotUpscale:s("Do not upscale your source input (e.g. using a 1080p camera to a 1440p stream)."),ensureMinimumBitrate:s("Ensure you use the minimum video bitrate specified in this table for a given resolution"),copyrightContentWarning:s("You may only have copyrighted content -- including music, movies, and video games -- in your stream if you are the rights holder or have the permission of all rights holders."),recommendedSettingsTable:s("Recommended Settings Table"),generateNewOBSTokenConfirm:s("Generate a new broadcast token? \n(This will invalidate your prior RTMP / OBS token and disconnect your current broadcast)"),thisIsSatisfactionScore:s('This is your satisfaction score. You can hide this by setting "Show my satisfaction score" to "No" in the Settings & Privacy tab.'),dataUpdatedOncePerDay:s("This data is updated once per day and is based on votes in the past 90 days."),clickScoreToSeeHistory:s("Click on your score (%) to view your rating history."),fetchingHistory:s("Fetching rating history"),noHistoryToShow:s("No history to show"),activeApp:s("Active App"),activeGame:s("Active Game"),bot1:s("Bot #1"),bot2:s("Bot #2"),bot3:s("Bot #3"),bot4:s("Bot #4"),bot5:s("Bot #5"),noneSelected:s("None Selected"),chooseAnApp:s("Choose an App"),chooseABot:s("Choose a Bot"),chooseAGame:s("Choose a Game"),endGame:s("End Game"),stopStreamingGame:s("Stop streaming game"),areYouAPublisher:s("Are you a publisher?"),addYourGameLink:s("Add your game."),restart:s("Restart"),addNewSocialMedia:s("Add new social media"),uploadNewPics:s("Upload new pics"),uploadNewVideos:s("Upload new videos"),editYourBio:s("Edit Your Bio"),currentContestStatistics:s("Current Contest Statistics for"),payoutInformation:s("Payout Information"),refreshStats:s("Refresh Stats"),seeContestDetails:s("See contest details"),managePhotoSet:s("Manage photo sets"),updateBio:s("Update Bio"),january:s("January"),february:s("February"),march:s("March"),april:s("April"),may:s("May"),june:s("June"),july:s("July"),august:s("August"),september:s("September"),october:s("October"),november:s("November"),december:s("December"),expiredFanClubMemberships:s("Expired Fan Club Memberships"),expiredSocialMediaSubscriptions:s("Expired Social Media Subscriptions"),noActiveMemberships:s("You Have No Active Memberships"),expires:s("Expires"),expired:s("Expired"),extendThreeMonths:s("Extend by 3 months"),renews:s("Renews"),renew:s("renew"),cantRenew:s("can't renew"),cantExtend:s("can't extend"),noEmailOnFile:s("No email address on file"),blockedCountries:s("Blocked countries"),ableToView:s("Able to view"),blockedRegions:s("Blocked regions"),security:s("Security"),statistics:s("Statistics"),updateSettings:s("Update Settings"),updateYourPassword:s("Update your password"),viewSecurityCenter:s("View the security center and adjust Two-Step Verification settings"),authorizeThirdPartyStats:s("Authorize your 3rd party stats"),addEmailAddress:s("Add an email address"),changeEmailAddress:s("Change email address"),emailVerified:s("E-mail Verified"),resendVerificationEmail:s("Resend verification email"),verificationEmailSent:s("Verification Email Sent"),emailIsUnverifiedForNotificationsAndNewsletter:s("Email is Unverified. Verify to receive follower notifications and newsletters."),detailedIncomeStats:s("Detailed Income Stats"),paymentInformationForm:s("Payment Information Form"),requiredForPayments:s("required for payments"),broadcasterVerificationForm:s("Broadcaster Verification Form"),downloadTransactionHistory:s("Download Transaction History"),pleaseWaitForFileToGenerate:s("Please wait for the file to be generated"),download30Days:s("Download your last 30 days of transactions?\nProcessing may take up to 20 seconds."),yourAccountsActivity:s("Your Account's Activity"),latestCashOuts:s("Latest cashouts"),tokensAutoCashedAtMidnight:s("tokens are automatically cashed out at midnight"),verifyToEnableTokens:s("Please verify your identity to enable tokens on your account"),transferTokens:s("Transfer Tokens"),transferTokensDateInfo:s("Tokens transferred on the 1st-15th of the month will be sent by the 22nd. Tokens transferred on the 16th-31st will be sent by the 7th."),silencedTableTitle:s("Silenced Users"),silencedUsersInfo:s("Listed are users currently silenced from your room. Silences expire after 6 hours by default. You can convert a silence to a ban."),bannedTableTitle:s("Banned Users"),bannedUsersInfo:s("Listed are users currently banned from your room. Bans expire after 1 month by default. You can convert a ban to a permanent ban."),banned:s("Banned"),silenced:s("Silenced"),actions:s("Actions"),remove:s("Remove"),makePermanent:s("Make Permanent"),convertToBan:s("Convert to Ban"),clickToClearHiddenBansAndSilences:s("Click here to clear hidden silences and bans"),addBan:s("Add ban"),enterUsernameToBan:s("Enter user to ban"),viewEditBansAndSilences:s("View/Edit Bans and Silences"),viewEditModerators:s("View/Edit Moderators"),viewFanClubMembers:s("View Fan Club Members"),viewEditRegionBlockExemptions:s("View/Edit Region Block Exemptions"),viewEditBannedTerms:s("View/Edit Banned Terms"),alphabetically:s("Alphabetically"),allUsers:s("All Users"),usersWhoTippedToday:s("Users who tipped me today"),usersWhoHaveTipped:s("Users who have tipped me"),usersWhoHaveTokens:s("Users who have tokens"),oneDay:s("1 Day"),twoDays:s("2 Days"),oneWeek:s("1 Week"),twoWeeks:s("2 Weeks"),oneMonth:s("1 Month"),twoMonths:s("2 Months"),sixMonths:s("6 Months"),no:s("No"),yes:s("Yes"),yesIfBroadcasting:s("Yes, only if they're broadcasting now"),ageVerificationRequired:s("Age Verification Required"),onlyAgeVerifiedCanChangeSetting:s("Only age verified broadcasters can change this setting"),currentFanClubMembersInfo:s("Listed are your current fan club members, the date they last joined, and the total number of months they've been your fan (Expiring memberships have a short grace period to renew before removed from your fanclub.)"),allFanClubMembersInfo:s("Listed are all of your fan club members past and present and how long they were a member for. Current members are highlighted."),addUsername:s("Add user"),add:s("Add"),regionBlockExemptions:s("Region Block Exemptions"),regionBlockExemptionsInfo:s("Users on this list will be exempt from region blocks"),uniqueRegisteredViewers:s("Unique Registered Viewers"),yourPoints:s("Your Points"),yourRank:s("Your Rank"),aboutMeHelpText:s("You may use some HTML tags (a p i strong b u ul ol li h1 h2 h3 img font br span)."),wishListHelpText:s("You may post links to external wish lists (amazon wish list, for example) and use some HTML tags (a p i strong b u ul ol li h1 h2 h3 img font br)."),displayName:s("Display Name"),displayBirthday:s("Display Birthday"),interestedIn:s("Interested in"),spokenLanguages:s("Spoken languages"),wishLists:s("Wish Lists"),joinFanClub:s("Join Fan Club"),member:s("Member"),fanClubMember:s("Fan Club Member"),lastJoined:s("Last Joined"),totalMonthsAMember:s("Total Months a Member"),improveVideoQuality:s("Improve Video Quality"),darkMode:s("Dark Mode"),searchBarPlaceholder:s("Search #tags or broadcasters"),broadcastingNow:s("Broadcasting right now"),recentlyOnline:s("Recently online"),previouslySearched:s("Previously searched"),tapToUnmute:s("TAP TO UNMUTE"),yesCancelSupporter:s("Yes, cancel the membership"),noKeepSupporter:s("No, keep the features"),cancellationSuccessful:s("Cancellation Successful"),sendAndClose:s("Send and close"),supporterPlan:s("Supporter Plan"),renewSubscription:s("Renew subscription"),whyDidYouCancel:s("Why did you decide to cancel your membership plan? (Optional)"),wouldYouCancel:s("Would you like to cancel your supporter membership and lose all your supporter features?"),renewNotice:s("You are about to renew your subscription."),cancelFailed:s("Cancellation Failed"),confirmOK:s("OK"),pleaseRefreshRetry:s("Error, please try and refresh your window."),homepageInBioViolation:s("Please note that the 'Room subject' of your broadcast and the 'Location' field of your bio may not be used for promotion of social media or other websites. Thank you for your understanding."),noteText:s("Note"),loadingPlaceholderText:s("Loading..."),writeNotePlaceholderText:s("Enter notes about this user (only seen by you)"),unsavedText:s("(unsaved)"),back:s("Back"),loadingMoreMessages:s("Loading More Messages"),sendPrivateMessage:s("Send a private message"),sendDirectMessage:s("Send a direct message"),sendDirectMessageNew:s("Send a direct message"),searchUsers:s("Search users"),unopenedCAPS:s("UNOPENED"),now:s("now"),oneMinuteAgo:s("1 minute ago"),anHourAgo:s("an hour ago"),aDayAgo:s("a day ago"),leavePrivateShowWarningText:s("To avoid ending the private show, a new tab will open. Click OK to continue."),acceptRules:s("Accept Rules"),chatCapitalized:s("Chat"),unmuteCapitalized:s("Unmute"),directMessageLabel:s("Direct Messages"),fanclubCancelErrorMessage:s("There was an error cancelling your Fan Club."),supporterCancelConfirmMessage:s("Are you sure you wish to remove your supporter status? You will remain a supporter until your currently paid month expires."),supporterCancelErrorMessage:s("There was an error cancelling your supporter membership."),eventsApiSettingsHeader:s("Events API"),banRemovedMessage:s("Ban removed"),silenceRemovedMessage:s("Silence removed"),banRemoveErrorMessage:s("Error removing ban, please try again"),banConvertErrorMessage:s("Error converting to ban, please try again"),silenceRemoveErrorMessage:s("Error removing silence –– it may have already been removed"),inlineUndoText:s("Undo"),inlineBanText:s("Ban"),showMyCamTip:s("Cam To Cam is the best way to share your cam with broadcasters you are watching."),transViewers:s("trans viewers"),and:s("and"),howIsChaturbateDoingToday:s("How is Chaturbate doing today?"),howIsSmcDoingToday:s("How is Cam To Cam doing today?"),yourFeedbackHasBeenSent:s("Your feedback has been sent!"),describeYourIssues:s("Describe your issues or share your ideas."),unfollowInfo:s("You will no longer receive notifications or see them in your followed tab."),runningApps:s("Running Apps"),allApps:s("All Apps"),aspDescription:s("Customize your chat room experience with Apps"),createAppsText:s("Create your own app"),legacyAppsText:s("Switch back to legacy apps"),confirmRemoveApp:s("Do you want to remove this app?"),orderBy:s("Order By:"),searchForApps:s("Search for Apps"),search:s("Search"),appsLoadingError:s("Failed to load Apps"),appsLoadingErrorV2:s("Failed to load v2 Apps"),topEarning:s("Top Earning"),featuredApps:s("Featured Apps"),recentlyUpdated:s("Recently Updated"),recentlyUsed:s("Recently Used"),version:s("version"),installed:s("Installed"),videoPanelLabel:s("Broadcast panel"),updateAvailable:s("Update available"),uninstall:s("Uninstall"),transformMessagesLabel:s("Transform messages"),restartApp:s("Restart app"),tipOptionsLabel:s("Tip options"),exclusiveAppPermissionText:s("Only one app can have this permission."),addApp:s("Add app"),upgradeAndApply:s("Upgrade & Apply"),upgradeAndRestart:s("Upgrade & Restart"),apply:s("Apply"),running:s("Running"),stopped:s("Stopped"),crashed:s("Crashed"),stop:s("Stop"),upgrade:s("Upgrade"),settings:s("Settings"),sourceCode:s("Source code"),noDescription:s("No Description"),noAppSettingsText:s("This app does not have any settings."),fieldRequiredText:s("This field is required"),stringMinError:s("This field is too short"),stringMaxError:s("This field is too long"),invalidInputText:s("Invalid input"),selectAnOption:s("Select an option"),permissions:s("Permissions"),allPermissionsText:s("All permissions granted"),noPermissionsText:s("No permissions granted"),somePermissionsText:s("Some permissions granted"),permissionModalText:s("The app you are adding is requesting the following permissions."),activeAppOverrideText:s('⚠️ App running in "Active App" is overriding this permission.'),aspPermissionOverrideText:s('⚠️ Apps running in "Active App" slot can override this permission.'),appLimitError:s("You have reached the maximum number of apps."),appNotAgeVerified:s("Only age verified broadcasters may install apps."),becomeAgeVerified:s("Verify Age"),appNotAvailable:s("App is not available."),refresh:s("Refresh"),userAddedToExemptList:s("User has been added to your exemption list."),userRemovedFromExemptList:s("User has been removed from your exemption list."),anErrorOccurred:s("An error occurred."),confirmPhotoDelete:s("Do you really want to delete this image? This cannot be undone."),errorDeletingMedia:s("There was an error deleting your media."),errorUploadingMedia:s("There was an error uploading your media."),invalidFileErrorUploadingMedia:s("This file type is not supported or the file is corrupted."),fileSizeErrorUploadingMedia:s("This file is too large. Images must be at most 50MB"),errorLoadingMedia:s("Could not load media. It may have been deleted."),switchToOBS:s("Switch to OBS to stream games"),selectGameHeaderText:s("Select your game from the list of approved games below."),installGameHeaderText:s("Install and start the game"),installGameSectionText:s("Download and and run the game."),downloadOBSHeaderText:s("Download OBS and set it up"),authorizeGameHeaderText:s("Authorize this game"),privateShowC2cTip:s("Pro tip: Viewers who use Cam To Cam tip 50% more on average than viewers who don’t. Encouraging your viewers to share their cam can build a more intimate connection and potentially earn you more tokens!"),notifyWhenBroadcastersOnlineMessage:s("Notify me when broadcasters I follow come online with"),popularCAPS:s("POPULAR"),browserNotificationLabel:s("Browser notification"),browserNotificationEnabled:s("Browser notification enabled"),saveNotificationSettings:s("Save notification settings"),emailAddressText:s("Email address"),preferencesSavedText:s("Your preferences have been saved."),checkYourEmailToVerifyText:s("Check your email inbox to verify your email!"),emailSavedAndVerifyText:s('Your email address has been updated on your account. Check your email inbox to verify your email!'),emailSendErrorMessage:s("Error sending verification email, please try again."),emailSubmitErrorMessage:s("Error submitting email, please try again."),browserSubmitErrorMessage:s("Error saving browser notification."),browserSubmitErrorMessagePt2:s("Please try again from the Settings & Privacy page on your profile."),errorSendingMessage:s("Unable to send message"),buyMoreTokens:s("Buy more tokens"),removedForViolation:s("Image removed for violating site rules"),imageAttached:s("Image attached"),emailInputTooltipMsg:s("Get email notifications when broadcasters come online"),enableEmailNotification:s("Enable email notification"),howPerfectScore:s("If you didn’t give a perfect rating, what can we do to earn one?"),subgenderSelectionConfirm:s("Submit and Start Broadcasting"),subgenderSelectionHeader:s("We launched new gender categories in order to allow the Chaturbate community to better identify their gender identity."),subgenderSelectionPrompt:s("Please choose an option below, selecting which one expresses you best:"),broadcastSubgenderViolation:s("A subgender is required before streaming. Please specify a subgender in your bio or profile."),biographyMale:s("A Man"),biographyFemale:s("A Woman"),biographyCouple:s("A Couple"),subgenderFemme:s("Trans Femme"),subgenderMasc:s("Trans Masc"),subgenderNonbinary:s("Non-Binary"),whatImprovementsNext:s("What improvements would you be most excited to see implemented next?"),haveYouNoticedAnyBugs:s("Did you notice any bugs today? Please describe them in as much detail as possible."),whatPainPoints:s("What were the biggest pain points you experienced today?"),offline:s("Offline"),live:s("Live"),yourStreamIsCurrently:s("Your stream is currently "),obsAwayMessage:s('This private or group show has ended. To give you time to prepare, you are now shown as "Away" to those in your room. To return and be visible on cam, click "Exit Away Mode" below.'),streamRejected:s("Stream Rejected"),waitingforStreamStats:s("Waiting for stream stats"),streamStatusUnknown:s("Stream Status Unknown"),streamTime:s("Stream time"),codec:s("Codec"),frameRate:s("Frame Rate: "),bitrate:s("Bitrate: "),alsoSupportOtherEncoders:s("We also support other encoders such as XSplit, Wirecast, etc."),obsDescription:s(" (OBS) is an open source streaming software which provides broadcasters control to configure stream settings and customizable plugins so they can enhance their stream."),tryAddingHashtags:s("Try adding #hashtags to your room subject to attract more viewers."),viewRTMPInfo:s("View RTMP/OBS broadcast information and stream key"),waitingForStream:s("Waiting for stream to start"),startInBrowserBroadcaster:s("Start the in-Browser Broadcaster"),outdatedBrowser:s("Your browser is outdated and cannot use in browser broadcast. Please update to use the latest Chaturbate features. We recommend Chrome, Firefox, or Edge."),ctrlLToClose:s("(Ctrl+L to close)"),welcomeMessage:s("To go to next room, press Ctrl+/. To send a tip, press Ctrl+S or type \"/tip 25\". To disable emoticons or adjust autocomplete settings, click the 'Gear' tab above."),mobileWelcomeMessage:s('To send a tip, click SEND TIP or type "/tip 25".'),backToRoomMenu:s("Back to Room Menu"),bannedTerms:s("Banned Terms"),bannedTermsInfo:s("Viewers will not be able to send messages containing these terms. All characters are allowed, including spaces."),addTerm:s("Add term"),term:s("Term"),banAsSubstring:s("Ban as Substring"),banAsSubstringExplanation:s('Ban the term if it appears anywhere in a message, even as part of other words. For example, if the term is "hello" then this will also ban "xhellox". Otherwise, if disabled, only messages like "x hello x" will be banned.'),enterTermToBan:s("Enter term to ban"),pleaseEnterTermToBan:s("Please enter a term to ban"),errorBanningTerm:s("There was an error banning this term. Please try again later"),errorUpdatingTerm:s("There was an error updating this term. Please try again later"),errorRemovingTerm:s("There was an error removing this term. Please try again later"),followsYou:s("Follows you"),sharingCam:s("Sharing their cam"),notes:s("Notes"),broadcastDate:s("Broadcast Date"),broadcastWeekday:s("Broadcast Weekday"),broadcastLength:s("Broadcast Length"),maxViewers:s("Max Viewers"),tokensTotal:s("Tokens Total"),avgTokensPerMin:s("Average Tokens Per Minute"),avgTokensPerUser:s("Average Tokens Per User"),chatMessagesTotal:s("Chat Messages Total"),avgMessagesPerUser:s("Average Messages Per User"),featuredCAPS:s("FEATURED"),allGendersCAPS:s("ALL GENDERS"),notShowingFromRegions:s("Not showing broadcasters from"),noRoomsAvailableFiltered:s("No rooms match your preferences, please update your search/filter options."),dragToResize:s("Drag to resize"),userInRoom:s("User is in the room"),userNotInRoom:s("User has left the room"),userNotInPrivate:s("User is not in the private show"),dmCloseTab:s("Close tab"),dmCloseTabShortcut:s("Ctrl+L to close window"),reportThisUserText:s("Report this user"),inappropriateMessage:s("Inappropriate message"),rudeMessage:s("Rude message"),spamMessage:s("Spam message"),getMoreLabel:s("Get More"),invalidAmount:s("Invalid amount"),hashtag:s("Hashtag"),viewers:s("Viewers"),rooms:s("Rooms"),broadcastYourselfCapitalized:s("Broadcast Yourself"),supporterCAPS:s("SUPPORTER"),incorrectOrientation:s("Your stream may appear upside down or sideways to viewers. Turn your device."),incorrectPortrait:s("Your broadcast may appear upside down or sideways to viewers. Turn your device into landscape mode."),incorrectLandscape:s("Your broadcast may appear upside down to viewers. Turn your device 180 degrees."),missingFullscreen:s("Fullscreen is required for broadcasting. "),fullscreenStop:s("Screen is no longer fullscreen so stream has been stopped."),androidBroadcast:s("Starting a broadcast will enter fullscreen."),mobileBroadcastError:s("Must be in proper landscape to broadcast, rotate 90 or 180 degrees and try again"),allTagsCAPS:s("ALL TAGS"),dismissCapitalized:s("Dismiss"),noFanClub:s("Broadcaster doesn't have fanclub"),becomeSupporter:s("Become a supporter"),joinCB:s("Join Chaturbate"),popoutInNewWindow:s("Popout in new window"),connecting:s("Connecting"),waitingToConnect:s("Waiting to connect"),connectingToBroadcastMessage:s("Please wait while we connect you to this webcam broadcast."),performerIsAway:s("Performer Is Away"),roomAwayMessage:s("You may continue chatting while you wait for the broadcaster to return."),roomPrivateNotWatchingMessage:s("You may continue chatting while you wait for the broadcaster to return from the private show."),spyOnThisPrivateShowCAPS:s("SPY ON THIS PRIVATE SHOW"),camIsHidden:s("Cam is Hidden"),roomOfflineSubheader:s("The member you are trying to view is currently offline. Please wait or choose another member to view."),passwordRequired:s("Password Required"),roomPasswordProtectedMessage:s("The broadcaster has set a password which is required for viewing. If you know the password, refresh this page to enter it."),errorLoadingConversationHistory:s("Error loading conversation history. Close and reopen this DM to reload"),ageVerifiedHeader:s("Age Verified Broadcasters"),ageVerifiedBodyHeader:s("Your account is age verified!"),ageVerifiedGuests:s("Additionally the following guests are approved to appear on your account:"),ageVerifiedBody:s("Only the age verified persons below can appear through your account. If you would like to broadcast with someone that is not displayed below, they must upload their government-issued identification prior to appearing on your account."),camCategoryNorthAmerica:s("North American Cams"),camCategorySouthAmerica:s("South American Cams"),camCategoryAsia:s("Asian Cams"),camCategoryEuroRussia:s("Euro Russian Cams"),camCategoryOtherRegion:s("Other Region Cams"),camCategoryTeen:s("Teen Cams (18+)"),camCategory18to20:s("18 to 20 Cams"),camCategory18to21:s("18 to 21 Cams"),camCategory20to30:s("20 to 30 Cams"),camCategory30to50:s("30 to 50 Cams"),camCategory21to35:s("21 to 35 Cams"),camCategoryMature:s("Mature Cams (50+)"),camCategoryExhib:s("Exhibitionist Cams"),camCategoryPrivate:s("Private Shows"),camCategoryHidden:s("Community Controlled Shows"),camCategoryNewCams:s("New Cams"),camCategoryGaming:s("Gaming Cams"),camCategory6TkPerMin:s("6 Tokens per Minute"),camCategory12TkPerMin:s("12 Tokens per Minute"),camCategory18TkPerMin:s("18 Tokens per Minute"),camCategory30TkPerMin:s("30+ Tokens per Minute"),camCategory60TkPerMin:s("60+ Tokens per Minute"),camCategory90TkPerMin:s("90+ Tokens per Minute"),categoryDescriptionHidden:s("Community controlled cams are using an app which has the ability to hide and show the cam based on viewers feedback."),firefoxWarning:s("Firefox is not recommended for browser broadcasting. For a better experience, please use Chrome or an external encoder."),noFanclub:s("Broadcaster does not currently have a fan club."),inValidTipAmount:s("Please input a tip amount between 1 and 9999"),shortcodeNotSupportedInDMs:s("Shortcodes are not supported in DMs."),shortcodeNotSupportedInPMs:s("Shortcodes are not supported in PMs."),shortcodeGeneralError:s("Error sending shortcode. Please try again."),tipNotBroadcaster:s("Only broadcasters & apps can publish tip shortcodes"),tooManyShortcodes:s("Max shortcodes allowed per message is 5"),shortcode:s("Shortcode"),shortcodeHelp:s("Shortcodes are specific codes that can be typed into a chat room to automatically create clickable links with predefined actions. These shortcodes can act as a shortcut for users to perform various functions like joining a specific page, becoming a supporter, or tipping an amount."),shortcodeURLNotAllowedInTip:s("URLs are not allowed in tip shortcodes"),shortcodeHelpTipExample:s("Tip if you enjoyed!"),loggedInForFeature:s("You must be logged in to use this feature"),errorSendingTip:s("Error sending tip"),visibleRegionsTag:s("Visible Regions"),northAmericaTitle:s("North America"),southAmericaTitle:s("South America"),asiaTitle:s("Asia"),europeRussiaTitle:s("Europe/Russia"),otherTitle:s("Other"),refresh30Seconds:s("30 Seconds"),refresh45Seconds:s("45 Seconds"),refresh60Seconds:s("60 Seconds"),refresh90Seconds:s("90 Seconds"),refreshDisable:s("Disable"),refreshThumbnailsEvery:s("Refresh thumbnails every"),showLocations:s("Show locations"),showRecommendedCams:s("Show recommended cams"),previewRooms:s("Preview rooms"),enableFloatingPlayer:s("Enable floating player"),moreTags:s("(more tags)"),removeFilter:s("(remove filter)"),filters:s("Filters"),privateBrowsingMessage:s("Broadcasting while private browsing is not supported for Firefox. Please disable private browsing and try again."),unableToReloadErrorMessage:s("Something went wrong while loading the rooms. Please refresh the page to try again."),onlineRooms:s("Online Rooms"),offlineRooms:s("Offline Rooms"),metaContentCardDescriptionPremium:s("Join a private or spy show for greater intimacy and voyeurism. No registration required!"),metaContentCardDescriptionFemale:s("Enjoy uncensored adult chat & live webcams with amateur girls. No registration required!"),metaContentCardDescriptionMale:s("Enjoy uncensored adult chat & live webcams with amateur guys. No registration required!"),metaContentCardDescriptionCouples:s("Enjoy uncensored adult chat & live webcams with amateur couples. No registration required!"),metaContentCardDescriptionTrans:s("Enjoy uncensored adult chat & live trans webcams with amateurs. No registration required!"),metaContentCardDescriptionDefault:s("Enjoy free chat and live webcam broadcasts from amateurs around the world. No registration required!"),metaDescriptionDefault:s("Watch Live Cams Now! No Registration Required - 100% Free Uncensored Adult Chat. Start chatting with amateurs, exhibitionists, pornstars w/ HD Video & Audio."),metaDescriptionPremium:s("You can join a private show and for only a few tokens per minute. Chat in private shows and direct all the action!"),metaKeywordsFemale:s("free chat with girls, live cam girls, free webcam girls"),metaKeywordsMale:s("free chat with men, live gay cams, free gay webcams"),metaKeywordsCouple:s("free chat with couple, live cam couple, free webcam couple"),metaKeywordsTrans:s("free chat with trans, live cam trans, free webcam trans"),metaKeywordsDefault:s("free cams, free adult video chat, free sex webcams, live adult cams, adult webcams, free live porn"),metaKeywordsPremium:s("private cams and spy cams"),premiumShowsCaps:s("PREMIUM SHOWS"),featuredText:s("Featured"),highestTokenColorTooltip:s('If your "tipped recently" amount is higher than the selected value, your username will be displayed in the selected color.'),tipShortcodeMessageInDoubleQuotes:s("The message content for tip shortcode must be enclosed in double quotes"),tipShortcodeArgsMissing:s("Tip shortcode requires an amount and message"),loadingPreview:s("Loading Preview"),obsGuideCodec:s("Codec:"),obsGuideCodecBody:s("H.264 Video, AAC Audio."),obsGuideAspect:s("Aspect ratio:"),obsGuideAspectBody:s("4:3 or 16:9 only."),obsGuideResolution:s("Resolution:"),obsGuideResolutionBody:s("From a height of 240 pixels up to 4k (2160 pixels)."),obsGuideFPS:s("Frame Rate:"),obsGuideFPSBody:s("24-30fps, or 48-60fps for high frame rate."),obsGuideBitrate:s("Bitrate:"),obsGuideBitrateBody:s("Up to 50 Mbps (50 000 Kbps) Video, 192 Kbps Audio - CBR Preferred."),obsGuideKeyFrame:s("Key Frame Interval:"),obsGuideKeyFrameBody:s("2 seconds."),obsGuideKeyProfile:s("H.264 Profile:"),obsGuideKeyProfileBody:s("Main or High preferred; baseline is acceptable."),obsGuideGenerate:s("Generate New Token"),obsGuideGenerateFail:s("Failed to reset token. Please try again."),internalStaffPrivate:s("Cannot start or spy on private shows as staff while on internal site."),internalStaffMessage:s("Cannot chat as staff while on internal site."),internalStaffFanClub:s("Cannot join fanclubs as staff while on internal site."),internalStaffPurchase:s("Cannot purchase as staff while on internal site."),internalStaffTip:s("Cannot tip as staff while on internal site."),internalStaffC2C:s("Cannot Cam to Cam as staff while on internal site."),clear:s("clear"),reset:s("reset"),agesCAPS:s("AGES"),hmpgFilterOpt6TksAbbrev:s("6 tks"),hmpgFilterOpt12TksAbbrev:s("12 tks"),hmpgFilterOpt18TksAbbrev:s("18 tks"),hmpgFilterOpt30TksAbbrev:s("30 - 42 tks"),hmpgFilterOpt60TksAbbrev:s("60 - 72 tks"),hmpgFilterOpt90TksAbbrev:s("90+ tks"),regionsCAPS:s("REGIONS"),privateTksPerMinCAPS:s("PRIVATE SHOW TOKENS PER MINUTE"),otherEncoderSupport:s("See our support page for technical info."),hiddenCams:s("Hidden Cams"),hiddenCamsDescription:s("Hidden cams are using an app which has the ability to hide and show the cam based on viewers feedback."),tagSearchPlaceholder:s("Search #tags")}},47:function(e,t,n){"use strict";n.d(t,{HY:function(){return a},rP:function(){return v},vz:function(){return h}});var i=n(4150),o=n(126),r=n(7693);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n-1&&(o=!0,i=i.slice(-7)),null===t[i]?(0,r.j9)(i.slice(2),t,n,o):warn("Event declared for JSX element that does not exist on type ".concat(t.tagName,": ").concat(e))}(e,t,n):t.setAttribute(e,n)}function u(e,t){"function"==typeof e.ref&&e.ref(t,e)}function d(e){var t=document.createDocumentFragment();return e.forEach((function e(n){if(n instanceof HTMLElement||n instanceof SVGElement||n instanceof Comment||n instanceof DocumentFragment)t.appendChild(n),m(t,n);else if("string"==typeof n||"number"==typeof n){var i=document.createTextNode("".concat(n));t.appendChild(i)}else n instanceof Array?n.forEach(e):!1===n||null==n?debug("Logic expression in Tsx fragment: ".concat(n)):warn("Unexpected child in Tsx fragment: ".concat(n))})),t}function h(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s=0&&n.push(n.splice(i,1)[0]),n.forEach((function(n){c(n,e,t[n])}))}}(i,t),i}(e,t,r)}var f="__mm_bindings__";function p(e,t){f in e||(e[f]=[]),e[f].push(t)}function m(e,t){if(f in t){var n,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return s(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)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw r}}}}(t[f]);try{for(i.s();!(n=i.n()).done;)p(e,n.value)}catch(e){i.e(e)}finally{i.f()}}}function v(e){var t;return null!==(t=e[f])&&void 0!==t?t:[]}},1289:function(e,t,n){"use strict";n.d(t,{Ie:function(){return c},Lm:function(){return a},Vf:function(){return s},dD:function(){return u}});var i=n(3753),o=n(8978);function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&"?"===e[0]&&(e=e.slice(1));var t,n={},i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(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)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw s}}}}(e.split("&"));try{for(i.s();!(t=i.n()).done;){var o=t.value;if(o.includes("=")){var s=o.split("=");s[0].length>0&&(n[decodeURIComponent(s[0])]=s[1].length>0?decodeURIComponent(s[1]):void 0)}else o.length>0&&(n[decodeURIComponent(o)]=void 0)}}catch(e){i.e(e)}finally{i.f()}return n}},9420:function(e,t,n){"use strict";n.d(t,{CD:function(){return h},GZ:function(){return c},He:function(){return s},M:function(){return d},SB:function(){return r},ae:function(){return u},qS:function(){return l},sC:function(){return a},wy:function(){return o}});var i=n(1794),o=new i.xB("roomListRequest"),r=new i.xB("playerForceMuted"),s=new i.xB("standardEmoticonRequest"),a=new i.xB("userInitiatedPm"),l=new i.xB("mentionUser"),c=new i.xB("appDebuggingToggled"),u=new i.xB("getMoreHistoryMessages"),d=new i.xB("repositionChatTabContent"),h=new i.xB("userModeratorStatusChanged")},858:function(e,t,n){"use strict";n.d(t,{J_:function(){return N},Wu:function(){return j},v9:function(){return _}});var i=n(5809),o=n(2951),r=n(1976),s=n(7169),a=n(7591),l=n(9492),c=n(3243),u=n(7597),d=n(6474),h=n(1185),f=n(7397),p=n(1194),m=n(2800),v=n(9760),g=n(6402),y=n(407),b=n(7693),w=n(1522),C=n(3753),x=n(695),k=n(2008),S=n(4793),T=n(8263),I=n(1794),P=n(27),R=n(4842),M=n(1625),A=n(3340),E=n(3705),B=n(2896),O=n(7108),L=n(9482),D=n(1809),U=n(758),Z=n(3543),F=n(9420);function _(){var e=j.state;return 0===e||1===e}function N(){j.setUserContextMenuState(3)}var j=function(e){(0,a.Z)(_,e);var t,n,O=(t=_,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,u.Z)(t);if(n){var o=(0,u.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,l.Z)(this,e)});function _(e,t,n){var i,r,a;(0,o.Z)(this,_),(a=O.call(this)).user=e,a.message=n,a.ucmListenerGroup=new I.mM,a.tearDownListener=function(e){var t=e.ctrlKey||e.metaKey,n=9===e.keyCode,i=t&&83===e.keyCode,o=t&&191===e.keyCode,r=191===e.keyCode,s=t&&76===e.keyCode,l=27===e.keyCode;(n||i||o||s||l||r)&&a.hideOverlay()},a.hideOverlayListener=function(){a.hideOverlay()},a.clickTargetEl=t,a.parentEl=null!==(i=_.ucmContainer)&&void 0!==i?i:t.offsetParent,a.createPlaceholder(),(0,b.j9)("keydown",document,a.tearDownListener),a.fullscreenChangeListener=M.gH.listen(a.hideOverlayListener),(0,b.j9)("popstate",window,a.hideOverlayListener),U.FJ.listen(a.hideOverlayListener,!1).addTo(a.ucmListenerGroup),A.WP.listen(a.hideOverlayListener,!1).addTo(a.ucmListenerGroup),D.vV.listen(a.hideOverlayListener,!1).addTo(a.ucmListenerGroup);var l=window.innerWidth;return v.nR.listen((function(){window.innerWidth=18&&(this.age.innerText=this.data.displayAge.toString()),this.removeLoadingStyle(this.age),this.genderIcon.src=(0,L.Fg)(this.data.gender),this.genderIcon.style.display="inline-block")}},{key:"addUserLabels",value:function(){var e=(0,L.Lj)(this.user),t=(0,L.Ow)(this.user);if(void 0!==e){var n=document.createElement("div");(0,h.vP)(n,"ucmUserLabel"),n.style.padding="9px 10px",n.style.borderTopWidth="1px",n.style.borderTopStyle="solid",this.menuContents.appendChild(n);var i=document.createElement("div");if(i.dataset.testid="user-label",i.style.width="74px",i.style.height="12px",i.style.width="100%",i.innerText=e,(0,h.vP)(i,(0,L.c9)(this.user)),i.style.fontWeight="bold",n.appendChild(i),void 0!==t){var o=document.createElement("div");(0,h.vP)(o,"ucmSublabel"),o.style.height="10px",o.style.fontSize="10px",o.style.marginTop="4px",o.style["-webkit-text-size-adjust"]="none",o.innerText=t,n.appendChild(o)}}}},{key:"addRestMenu",value:function(){this.addLinks(this.user),this.addModSection(),this.addNotes(this.user.username)}},{key:"addNotes",value:function(e){var t=this;if(void 0!==this.currentUsername&&this.currentUsername!==e){var n=document.createElement("div"),i=p.d.get("UserNote");this.reactUserNote=new i({username:e,badgeManager:B.$.getOrCreateInstance(),isNotLoggedIn:x.Cg,removeMenu:function(){t.hideOverlay()}},n),this.menuContents.appendChild(n)}}},{key:"addLinks",value:function(e){this.menuLinks=document.createElement("div"),(0,h.vP)(this.menuLinks,"ucmLinks"),this.menuLinks.style.padding="5px 0",this.menuLinks.style.fontSize="12px",this.menuLinks.style.borderTopWidth="1px",this.menuLinks.style.borderTopStyle="solid",this.menuContents.appendChild(this.menuLinks)}},{key:"addModSection",value:function(){this.menuContents.appendChild(this.modSection),(0,h.vP)(this.modSection,"ucmModSection"),this.modSection.style.borderTopWidth="1px",this.modSection.style.borderTopStyle="solid",this.modSection.style.padding="5px 0",this.modSection.style.display="none"}},{key:"addLinksData",value:function(){if(this.currentUsername!==this.user.username){if(void 0===this.chatConn)return void error("ignoreText: Chatconnection should be defined");var e=this.createSendLink(this.user.username,!0);if(this.menuLinks.appendChild(e),(0,d.Fh)()){var t=this.createSendLink(this.user.username,!1);this.menuLinks.appendChild(t)}var n=this.createMentionLink(this.user.username);if(this.menuLinks.appendChild(n),this.roomName!==this.currentUsername){var i=this.createIgnoreLink(this.user.username,this.chatConn);this.menuLinks.appendChild(i)}if(void 0!==this.message){var o=this.createReportLink(this.user.username,this.message);this.menuLinks.appendChild(o)}}else this.menuLinks.style.display="none"}},{key:"addSilenceIfAllowed",value:function(){var e=this;if(void 0!==this.data&&this.data.canSilence){var t=document.createElement("div"),n=this.createLink(),i=this.createLinkSpan(),o=this.data.username;i.style.paddingLeft="20px",n.appendChild(i),n.dataset.testid="silence-toggle",t.appendChild(n),void 0!==this.data.silenceId?i.innerText=Z.ag.removeSilenceMessage:i.innerText=Z.ag.silenceDurationMessage,n.onclick=function(){void 0!==e.data&&void 0!==e.data.silenceId&&void 0!==e.roomName?(0,C.I5)("edit_room_ban/",{banid:String(e.data.silenceId),action:"remove_silence",room_username:e.roomName}).catch((function(e){error(e),(0,w.Cj)("Error removing silence from user ".concat(o))})):(0,w.oB)("Silence ".concat(e.user.username,"?"),(function(){(0,E.fg)("SilenceUser",{username:e.user.username,to_user:e.user.username}),(0,C.I5)("roomsilence/".concat(e.user.username,"/").concat(e.roomName,"/"),{}).catch((function(t){error(t),(0,w.Cj)("Error silencing user ".concat(e.user.username))}))})),e.hideOverlay()},this.modSection.appendChild(t),this.modSection.style.display=""}}},{key:"findBoundary",value:function(){if((0,M.rm)())return{boundV:(0,M.Gd)(),boundH:(0,M.Gd)()};for(var e,t,n=function(e,t,n){var i=window.getComputedStyle(e);return void 0===t&&"hidden"===i.overflowY&&(t=e),void 0===n&&"hidden"===i.overflowX&&(n=e),[t,n]},o=this.parentEl;void 0!==o&&"body"!==o.tagName.toLowerCase();o=null===o.parentElement?void 0:o.parentElement){var r=n(o,e,t),s=(0,i.Z)(r,2);if(e=s[0],t=s[1],void 0!==e&&void 0!==t)break}return{boundV:e,boundH:t}}},{key:"trapInBoundary",value:function(e,t){var n=void 0===e?document.documentElement:e,i=void 0===t?document.documentElement:t,o=n.getBoundingClientRect(),r=i.getBoundingClientRect(),s=this.element.getBoundingClientRect(),a=o.bottom-s.height-38,l=r.right-s.width,c=o.top,u=r.left,d=s.top,h=s.left;if(c>d){var f=c-d;this.element.style.top="".concat(this.element.offsetTop+f+4,"px")}if(u>h){var p=u-h;this.element.style.left="".concat(this.element.offsetLeft+p+4,"px")}if(a0&&void 0!==arguments[0]&&arguments[0]&&this.repositionToMatch(this.clickTargetEl.getBoundingClientRect());var e=this.findBoundary();this.trapInBoundary(e.boundV,e.boundH)}},{key:"hideOverlay",value:function(){var e,t;2!==_.state&&((0,c.Z)((0,u.Z)(_.prototype),"hideOverlay",this).call(this),void 0!==this.chatReport&&this.chatReport.tearDown(),(0,b.SC)("keydown",document,this.tearDownListener),null===(e=this.fullscreenChangeListener)||void 0===e||e.removeListener(),this.fullscreenChangeListener=void 0,(0,b.SC)("popstate",window,this.hideOverlayListener),this.ucmListenerGroup.removeAll(),this.parentEl.removeChild(this.element),this.afterRemovedFromParent(),_.setUserContextMenuState(2),null===(t=this.reactUserNote)||void 0===t||t.dispose())}},{key:"createSendLink",value:function(e,t){var n=this,i=this.createLink(),o=document.createElement("div"),r=this.createLinkSpan();return(0,h.vP)(i,"ucmPMLink"),i.dataset.testid=t?"send-pm":"send-dm",i.appendChild(o),i.appendChild(r),r.innerText=t?Z.ag.sendPrivateMessageText:Z.ag.sendDirectMessageText,(0,h.vP)(o,t?"ucmSendPmIcon":"ucmSendDmIcon"),o.style.padding="0px 4px 0 0",o.style.verticalAlign="bottom",o.style.width="14px",o.style.height="14px",o.style.display="inline-block",o.style.marginRight="4px",(0,b.j9)("click",i,(function(i){n.hideOverlay(),(0,x.Cg)(t?Z.ag.loggedInToPm:Z.ag.loggedInToDm)||(t?((0,E.fg)("StartPrivateMessage",{username:e,to_user:e,location:"PMTab"}),F.sC.fire({username:e,focus:!0,showSupporterAlert:n.showSupporterAlert})):((0,E.fg)("StartDirectMessage",{username:e,to_user:e}),f.nh.fire(e)),i.stopPropagation())})),i}},{key:"createMentionLink",value:function(e){var t=this,n=this.createLink(),i=document.createElement("div"),o=this.createLinkSpan();return o.innerText=Z.ag.mentionUserText,(0,h.vP)(i,"ucmMentionIcon"),i.style.width="14px",i.style.height="14px",i.style.padding="0px 4px 0 0px",i.style.verticalAlign="bottom",i.style.display="inline-block",i.style.marginRight="4px",n.id="ucm-mentionuser",n.dataset.testid="mention-user",n.appendChild(i),n.appendChild(o),(0,b.j9)("click",n,(function(){F.qS.fire(e),t.hideOverlay()})),n}},{key:"createIgnoreLink",value:function(e,t){var n=this,i=this.createLink();i.dataset.testid="ignore-toggle";var o=document.createElement("div"),r=this.createLinkSpan();return t.isIgnored(e)?(r.style.paddingLeft="20px",r.innerText=Z.ag.unignoreThisUserText):((0,h.vP)(i,"notIgnored"),r.style.paddingLeft="0",r.innerText=Z.ag.ignoreThisUserText,i.appendChild(o)),(0,h.vP)(i,"ucmIgnoreLink"),i.appendChild(r),(0,h.vP)(o,"ucmIgnoreIcon"),o.style.padding="0px 4px 0 0px",o.style.verticalAlign="bottom",o.style.width="14px",o.style.height="14px",o.style.display="inline-block",o.style.marginRight="4px",(0,b.j9)("click",i,(function(){t.isIgnored(e)?t.unignore(e):t.ignore(e),n.hideOverlay()})),i}},{key:"createReportLink",value:function(e,t){var n=this,i=this.createLink(),o=document.createElement("div"),r=this.createLinkSpan();return(0,h.vP)(i,"ucmReportLink"),i.appendChild(o),i.appendChild(r),i.dataset.testid="report-room",(0,h.vP)(o,"ucmReportIcon"),o.style.padding="0 4px 0 0",o.style.verticalAlign="middle",o.style.width="14px",o.style.height="14px",o.style.display="inline-block",o.style.marginRight="4px",r.innerText=Z.ag.reportThisMessageText,(0,b.j9)("click",i,(function(){(0,E.fg)("ReportChatUser",{username:e,to_user:e}),n.element.removeChild(n.menuContents),n.chatReport=new k.P(e,t,n.chatConn),n.element.appendChild(n.chatReport.element),n.position(),n.chatReport.focusForm(),n.chatReport.closeChatReportRequest.listen((function(){n.hideOverlay()}))})),i}},{key:"createLink",value:function(){var e=document.createElement("div");return e.style.padding="3px 10px",e.style.whiteSpace="nowrap",e.style.fontWeight="normal",e.style.fontFamily="Tahoma, Arial, Helvetica, sans-serif",e.style.fontSize="12px",e.style["-webkit-text-size-adjust"]="none",(0,h.vP)(e,"ucmLinkColor"),this.addLinkMouseover(e),e}},{key:"createLinkSpan",value:function(){var e=document.createElement("span");return e.style.fontWeight="normal",e.style.fontFamily="Tahoma, Arial, Helvetica, sans-serif",e.style.fontSize="12px",e.style["-webkit-text-size-adjust"]="none",(0,h.vP)(e,"ucmLinkColor"),e}},{key:"addLinkMouseover",value:function(e){(0,h.vP)(e,"ucmLinkHover"),e.onmouseenter=function(){e.style.cursor="pointer"},e.onmouseleave=function(){e.style.cursor="default"}}}],[{key:"setUCMContainer",value:function(e){_.ucmContainer=e}},{key:"setUserContextMenuState",value:function(e){_.state=e}}]),_}(O.B);j.state=2},3328:function(e,t,n){"use strict";n.d(t,{_:function(){return T}});var i=n(2951),o=n(1976),r=n(7591),s=n(9492),a=n(7597),l=n(1185),c=n(7693),u=n(3243),d=n(6079),h=n(1522),f=n(3753),p=n(695),m=n(4793),v=n(8263),g=n(3705),y=n(3543),b=n(9420),w=n(858);var C=function(e){(0,r.Z)(C,e);var t,n,w=(t=C,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function C(e,t,n){return(0,i.Z)(this,C),w.call(this,e,t,n)}return(0,o.Z)(C,[{key:"addRestMenu",value:function(){var e=this;if((0,u.Z)((0,a.Z)(C.prototype),"addRestMenu",this).call(this),this.currentUsername!==this.user.username){this.modSection.style.display="",this.promoteModSection=document.createElement("div"),(0,l.vP)(this.promoteModSection,"ucmPromoteModSection"),(0,v.Zs)(this.promoteModSection,{borderTopWidth:"1px",borderTopStyle:"solid",padding:"5px 0"}),this.hasTippedSection=document.createElement("div"),(0,l.vP)(this.hasTippedSection,"ucmHasTippedSection"),(0,v.Zs)(this.hasTippedSection,{padding:"9px 10px",borderTopWidth:"1px",borderTopStyle:"solid"}),this.menuContents.insertBefore(this.promoteModSection,this.modSection.nextSibling),this.menuContents.appendChild(this.hasTippedSection);var t=this.createLink();t.dataset.testid="kick-ban-toggle";var n=this.createLinkSpan();n.style.paddingLeft="20px",this.modSection.appendChild(t),t.appendChild(n),n.innerText=y.ag.kickBan,(0,c.j9)("click",t,(function(){e.hideOverlay(),(0,p.Cg)('You must be logged in to ban a user. Click "OK" to login.')||(0,h.oB)(y.ag.banUserConfirm(e.user.username),(function(){(0,g.fg)("BanUser",{username:e.user.username}),(0,f.I5)("roomban/".concat(e.user.username,"/").concat(e.roomName,"/"),{}).catch((function(t){error(t),(0,h.Cj)(y.ag.banUserError(e.user.username))}))}))}));var i=document.createElement("div"),o=document.createElement("img"),r=document.createElement("span");o.src="".concat(STATIC_URL,"ico-tip.gif"),(0,v.Zs)(o,{width:"13px",height:"13px",padding:"2px 4px 0 1px"}),i.appendChild(o),i.appendChild(r),r.innerText="".concat(y.ag.userHasTippedMe(this.user.username),":"),(0,v.Zs)(r,{display:"inline-block",width:"100%",overflow:"hidden",textOverflow:"ellipsis"}),this.hasTippedSection.appendChild(i);var s=document.createElement("div"),d=document.createElement("div"),m=document.createElement("div");s.style.paddingLeft="20px",d.style.paddingLeft="20px",m.style.paddingLeft="20px";var b=document.createElement("span"),w=document.createElement("span"),x=document.createElement("span");s.appendChild(b),d.appendChild(w),m.appendChild(x),b.innerText=y.ag.tokensInPastHour(0),b.dataset.testid="tipped-hour",w.innerText=y.ag.tokensInPastDay(0),w.dataset.testid="tipped-day",x.innerText=y.ag.tokensInPastTwoWeeks(0),x.dataset.testid="tipped-two-weeks",i.appendChild(s),i.appendChild(d),i.appendChild(m),void 0!==this.roomName&&void 0!==this.currentUsername&&(0,f.I5)("api/getchatusermenu/",{roomname:this.roomName,fromuser:this.currentUsername,touser:this.user.username}).then((function(t){e.promoteModSection.appendChild(e.createChangeModStatusLink(Boolean(t.getResponseHeader("X-Target_Is_Mod")),e.user)),b.innerText=y.ag.tokensInPastHour(e.getTipHeaderValue(t.getResponseHeader("X-Tipped_Performer_Last_Hour"))),w.innerText=y.ag.tokensInPastDay(e.getTipHeaderValue(t.getResponseHeader("X-Tipped_Performer_Last_24_Hours"))),x.innerText=y.ag.tokensInPastTwoWeeks(e.getTipHeaderValue(t.getResponseHeader("X-Tipped_Performer_Last_Two_Weeks")))})).catch((function(e){error(e),(0,h.Cj)("Error fetching user menu")}))}}},{key:"addLinksData",value:function(){var e=this;(0,u.Z)((0,a.Z)(C.prototype),"addLinksData",this).call(this);var t=this.createLink();t.style.display="none";var n=document.createElement("img");(0,v.Zs)(n,{padding:"0px 5px 0 2px",verticalAlign:"bottom"}),t.appendChild(n);var i=this.createLinkSpan();t.appendChild(i),m.kN.once((function(o){var r=d.M.getInstance();if(void 0!==r){var s=r.getContextMenuLinkInfo(e.user.username);""!==s.linkText&&(n.src=s.icon,i.textContent=s.linkText,(0,c.j9)("click",t,(function(){s.action(),e.hideOverlay()})),t.style.display="")}})),this.menuLinks.prepend(t)}},{key:"createChangeModStatusLink",value:function(e,t){var n,i,o,r=this,s=this.createLink(),a=this.createLinkSpan();return a.style.paddingLeft="20px",s.dataset.testid="moderator-toggle",e?(a.innerText=y.ag.removeModeratorStatus,n='You must be logged in to remove a moderator. Click "OK" to login.',i="removemoderator/".concat(t.username,"/").concat(this.roomName,"/"),o="Error promoting user ".concat(t.username)):(a.innerText=y.ag.promoteToModerator,n='You must be logged in to promote a user to moderator. Click "OK" to login.',i="addmoderator/".concat(t.username,"/").concat(this.roomName,"/"),o="Error promoting user ".concat(t.username)),(0,c.j9)("click",s,(function(){r.hideOverlay(),(0,p.Cg)(n)||(0,f.I5)(i,{}).then((function(){b.CD.fire({isMod:!e,username:t.username})})).catch((function(e){error(e),(0,h.Cj)(o)}))})),s.appendChild(a),s}},{key:"getTipHeaderValue",value:function(e){if(null===e)return 0;var t=Number(e);return t<0?0:t}}]),C}(w.Wu),x=n(4406),k=n(9),S=n(9482);var T=function(e){(0,r.Z)(d,e);var t,n,u=(t=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,a.Z)(t);if(n){var o=(0,a.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,s.Z)(this,e)});function d(e,t){var n,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if((0,i.Z)(this,d),(n=u.call(this)).user=e,(0,l.vP)(n.element,(0,S.c9)(e)),n.element.style.height="auto",n.element.style.width="auto",n.element.style.position="",n.element.style.display="inline-block",n.element.style.maxWidth="100%",n.element.style.textOverflow="ellipsis",n.element.style.whiteSpace="nowrap",n.element.style.fontWeight="bold",n.element.style.cursor="pointer",n.element.style.overflow="visible",n.badgeSpan=x.x.createBadges(e.username),n.element.appendChild(n.badgeSpan),n.usernameText=document.createElement("span"),n.usernameText.dataset.testid="username",n.usernameText.textContent=e.username,n.usernameText.title=y.ag.usernameText,n.element.appendChild(n.usernameText),o){var r=document.createElement("img");r.style.display="inline-block",r.style.height="16px",r.style.margin="0 5px",r.style.verticalAlign="middle",r.src=(0,S.Fg)(e.gender),r.title=y.ag.genderSymbolToIconTitle(e.gender),n.element.insertBefore(r,n.element.firstChild),n.element.style.whiteSpace="nowrap"}n.element.onmouseenter=function(){n.element.style.textDecoration="underline"},n.element.onmouseleave=function(){n.element.style.textDecoration="none"};var s=function(i){i.preventDefault(),null!==n.element.parentElement?((0,g.fg)("OpenUserContextMenu",{username:e.username}),d.createUserContextMenu(e,n.usernameText,t)):error("Username span has no parent")};return(0,c.j9)("click",n.element,s),(0,c.j9)("contextmenu",n.element,s),n}return(0,o.Z)(d,[{key:"createMentionLabel",value:function(e,t){return this.usernameText.textContent="@".concat(this.user.username),this.badgeSpan.style.display="none",t&&((0,l.vP)(this.element,"mentionHl"),this.element.style.padding="2px"),this.element}}],[{key:"createUserContextMenu",value:function(e,t,n){2===w.Wu.state&&((0,S.hY)()?new C(e,t,n):new w.Wu(e,t,n))}}]),d}(k.w)},2974:function(e,t,n){"use strict";n.d(t,{S:function(){return v}});var i=n(2951),o=n(1976),r=n(8759),s=n(695),a=n(1234),l=n(6767),c=n(1794),u=n(4801),d=n(1625),h=n(3705),f=n(5937),p=new u.KS(f.zp),m=function(){function e(){var t=this;(0,i.Z)(this,e),this.storageKey="isTheaterMode",this.changeVideoMode=new c.xB("changeVideoMode",{listenersWarningThreshold:function(){return 20+c.q6}}),this.hasFiredAflThtrMdEvents=!1;var n=this.getInitialVideoMode(),o="split"===n?"theater":"split";this.videoMode=n,this.lastVideoMode=o,this.lastNonFullscreenVideoMode=o,this.saveVideoModeStorage(),this.listenForFullscreen(),(0,h.zB)(this.videoMode),a.C.listen((function(e){t.isMobile="mobile"===e,t.isMobile&&((0,d.rm)()?(0,h.zB)("landscapeFullscreen"):(0,h.zB)("portraitClassic"))}))}return(0,o.Z)(e,[{key:"listenForFullscreen",value:function(){var e=this;d.gH.listen((function(){(0,d.rm)()?window.setTimeout((function(){"fullscreen"!==e.videoMode&&v.setFireVideoMode("noninteractive-fullscreen")}),0):v.setFireVideoMode(e.lastNonFullscreenVideoMode)}))}},{key:"setVideoModeInternal",value:function(e){return!!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]||e!==this.videoMode)&&(-1===["noninteractive-fullscreen","fullscreen","fullvideo"].indexOf(this.videoMode)&&(this.lastNonFullscreenVideoMode=this.videoMode),this.lastVideoMode=this.videoMode,this.videoMode=e,"noninteractive-fullscreen"===this.videoMode&&this.isMobile?(0,h.zB)("landscapeFullscreen"):(0,h.zB)(this.videoMode),this.saveVideoModeStorage(),!0)}},{key:"setVideoMode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.setVideoModeInternal(e,t)}},{key:"setFireVideoMode",value:function(e,t){var n,i;(this.setVideoModeInternal(e,null!==(n=null==t?void 0:t.update)&&void 0!==n&&n)||null!==(i=null==t?void 0:t.fire)&&void 0!==i&&i)&&this.changeVideoMode.fire({currentMode:this.videoMode,previousMode:this.lastVideoMode})}},{key:"saveVideoModeStorage",value:function(){["split","theater"].includes(this.videoMode)&&(0,r.IU)()&&window.localStorage.setItem(this.storageKey,JSON.stringify({isTheaterMode:"theater"===this.videoMode}))}},{key:"getInitialVideoMode",value:function(){var e=p.active?"theater":"split";if((0,r.IU)()){var t=window.localStorage.getItem(this.storageKey);if(null!==t){var n=JSON.parse(t).isTheaterMode;e=Boolean(n)?"theater":"split"}}return e}},{key:"getVideoMode",value:function(){return this.videoMode}},{key:"getPreviousNonFullscreenVideoMode",value:function(){return this.lastNonFullscreenVideoMode}},{key:"fireAfflThtrMdEvents",value:function(){if(this.hasFiredAflThtrMdEvents)error("refiring AfflThtrMd events");else{this.hasFiredAflThtrMdEvents=!0;var e=window.location.toString().includes("fullvideo")?"fullvideo":"non-fullvideo",t="".concat(f.zp,"_in"),n=void 0!==(0,l.sv)(t);if(p.eligible)if(n){(0,l.kT)(t),(0,h.fg)("AfflThtrMd",{group:p.active?"active":"inactive",page:e});var i=!p.active&&"fullvideo"===this.videoMode,o=p.active&&"theater"===this.videoMode;(i||o)&&p.record()}else(0,h.fg)("AfflThtrMd_mystery",{group:p.active?"active":"inactive",page:e});else window.location.search.includes("gLDS")&&window.location.search.includes("gQZJO")&&(0,h.fg)("AfflThtrMd_missing",{page:e,is_anon:(0,s.TF)(),came_from_in:n}),n&&(0,h.fg)("AfflThtrMd_odd_cookie",{page:e,is_anon:(0,s.TF)()})}}}]),e}(),v=new m},2750:function(e,t,n){"use strict";n.d(t,{MY:function(){return l},Pv:function(){return a},UG:function(){return p},jZ:function(){return u},me:function(){return C},oc:function(){return y},rq:function(){return d},uX:function(){return c},zd:function(){return b}});var i=n(7693),o=n(3753),r=n(1794),s=n(1625);function a(e,t,n,i){l(e,t,n)}function l(e,t,n,i){return new Promise((function(i){var r;(0,s.rm)()?((0,s.Qg)(),window.setTimeout((function(){var r=window.open((0,o.BN)(e),t,n);null!==r&&window.setTimeout((function(){r.focus()}),200),i(null!=r?r:void 0)}),s.Vc)):i(null!==(r=window.open((0,o.BN)(e),t,n))&&void 0!==r?r:void 0)}))}var c="status=0,toolbar=1,menubar=0,directories=0,resizable=1,scrollbars=1,height=768,width=850,top=50,left=50",u="status=0,toolbar=0,menubar=0,directories=0,resizable=1,scrollbars=1,height=768,width=850",d="status=0,toolbar=0,menubar=0,directories=0,resizable=1,scrollbars=1,height=700,width=715",h="",f="";"hidden"in document?(h="hidden",f="visibilitychange"):"msHidden"in document?(h="msHidden",f="msvisibilitychange"):"webkitHidden"in document&&(h="webkitHidden",f="webkitvisibilitychange");var p=new r.xB("documentVisibilityChange",{maxHistorySize:1}),m=!document[h],v=function(e){m!==e&&(m=e,p.fire(m))};if(""!==h&&""!==f){var g=function(){v(!document[h])};(0,i.j9)(f,document,g),(0,i.j9)("pagehide",window,(function e(){(0,i.SC)(f,document,g),(0,i.SC)("pagehide",window,e),v(!1),(0,i.j9)("pagehide",window,(function(){v(!1)})),(0,i.j9)("pageshow",window,(function(){v(!0)}))}))}else(0,i.j9)("blur",window,(function(){v(!1)})),(0,i.j9)("focus",window,(function(){v(!0)}));function y(){return m}function b(){try{return window.self!==window.top}catch(e){return!0}}var w=(new Date).getTime();function C(){return((new Date).getTime()-w)/1e3}},5543:function(e,t,n){"use strict";n.d(t,{r:function(){return At},c:function(){return Mt}});var i=n(2951),o=n(1976),r=n(949),s=n(6474),a=n(6272),l=n(7591),c=n(9492),u=n(7597),d=n(7693),h=n(9),f=n(9165),p=n(2578),m=n(9760),v=n(3243),g=n(3753);var y=function(e){(0,l.Z)(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,u.Z)(t);if(n){var o=(0,u.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,c.Z)(this,e)});function s(e){var t;return(0,i.Z)(this,s),t=r.call(this,e),e.gender!==f.Y0.All?t.url=new URL("../",t.element.href):t.url=new URL(t.element.href),t}return(0,o.Z)(s,[{key:"createElement",value:function(e){return e.anchorElement}},{key:"updateState",value:function(){(0,v.Z)((0,u.Z)(s.prototype),"updateState",this).call(this);var e=this.url.searchParams.toString();e=""===e?"":"?".concat(e);var t=this.url.pathname===(0,g.BN)("/")?(0,f.eN)(this.state.gender):f.aI.get(this.state.gender),n=""===t?"":"".concat(t,"/");this.element.href=(0,g.BN)("".concat(this.url.pathname).concat(n).concat(e))}}]),s}(n(7585).I),b=n(5755),w=n(8871);var C=function(e){(0,l.Z)(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,u.Z)(t);if(n){var o=(0,u.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,c.Z)(this,e)});function s(e){var t;(0,i.Z)(this,s),(t=r.call(this,e)).genderedLinks=[];var n=e.querySelector(".nav");null!==n&&n instanceof HTMLElement&&(0,m.FR)(n,["padding-left","padding-right"],10,65,500,800);var o=document.querySelector(".footer-holder .footer-cb-address");return null!==o&&o instanceof HTMLElement&&(0,m.FR)(o,"margin-left",-55,0,500,589,(function(e){0===e&&(o.style.marginLeft="")})),e.querySelectorAll(".footercon a").forEach((function(e){(0,d.j9)("click",e,(function(e){w.k4.fire(e)}))})),e.querySelectorAll("div[gendered-category] a").forEach((function(e){t.genderedLinks.push(new y({anchorElement:e,gender:(0,f.ej)()}))})),w.Me.addListener((function(e){t.genderedLinks.forEach((function(t){t.setState({gender:e})})),x()}),t.element),b.t.pageNumberChanged.listen(x),t}return(0,o.Z)(s)}(h.w);function x(){document.querySelectorAll("#footer-holder form").forEach((function(e){(0,p.nM)(e)}))}var k=n(8263),S=n(3607),T=n(3705),I=n(2800),P=n(1612),R=n(5696);function M(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return A(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)?A(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this._headerCollapseDropDownTab.lastShownSibling();void 0!==n&&(n.element.getElementsByTagName("a")[0].tabIndex=t?0:e);var i,o=M(this._headerCollapseDropDownTab.dropDown.element.getElementsByTagName("a"));try{for(o.s();!(i=o.n()).done;)i.value.tabIndex=t?0:e+1}catch(e){o.e(e)}finally{o.f()}null!==this.firstTopSectionAnchor&&void 0!==this.firstTopSectionAnchor&&(this.firstTopSectionAnchor.tabIndex=t?0:e+2)}},{key:"initFirstTopSectionAnchor",value:function(){var e=document.querySelector(".top-section");null!==e&&(this.firstTopSectionAnchor=e.getElementsByTagName("a")[0],void 0===this.firstTopSectionAnchor&&(this.firstTopSectionAnchor=e.getElementsByTagName("li")[0]))}},{key:"setCollapsibleDropdownSpacerWidth",value:function(){if(void 0!==this.nav&&null!==this.nav.element.parentElement){var e,t=0,n=M(this.nav.element.parentElement.children);try{for(n.s();!(e=n.n()).done;){var i=e.value;i!==this.nav.element&&i instanceof HTMLElement&&(t+=i.offsetWidth)}}catch(e){n.e(e)}finally{n.f()}this._headerCollapseDropDownTab.setSpacerWidth(t)}}},{key:"makeHeaderAdResponsive",value:function(){var e=document.querySelector("#header .ad");if(null!==e&&e instanceof HTMLElement){var t=document.querySelector(".right_section"),n=(0,k.r7)(null!==e.firstElementChild&&e.firstElementChild instanceof HTMLElement?e.firstElementChild:e),i=n.width?n.right:(0,k.r7)(e).right;m.nR.listen((function(){var n=null===t?document.body.offsetWidth:t.offsetLeft;e.style.display=n-25500-(0,k.np)()&&m.nR.listen((function(){o+i.offsetLeft>(0,S._U)()?i.style.maxWidth="".concat((0,S._U)()-i.offsetLeft-1,"px"):i.style.maxWidth=""}))}}}},{key:"makeUserInfoResponsive",value:function(){var e=document.querySelector("#user_information");null!==e&&e instanceof HTMLElement&&(0,m.FR)(e,"margin-right",4,15,500,600)}},{key:"bindLinkUpdateHandling",value:function(){var e=this;w.Me.addListener((function(t){e.genderedLinks.forEach((function(e){e.setState({gender:t})}))}),this.element)}}]),s}(h.w),B=n(7397),O=n(7542),L=n(2765),D=n(8759),U=n(1522),Z=n(695),F=n(6767),_=n(7191);function N(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,u.Z)(e);if(t){var o=(0,u.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,c.Z)(this,n)}}var j=function(e){(0,l.Z)(n,e);var t=N(n);function n(e){var o,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,i.Z)(this,n),(o=t.call(this,null!=s?s:{},e,r)).toggleElement=e,o}return(0,o.Z)(n)}(_.Ku),H=function(e){(0,l.Z)(n,e);var t=N(n);function n(e){return(0,i.Z)(this,n),t.call(this,e)}return(0,o.Z)(n,[{key:"initUI",value:function(){(0,v.Z)((0,u.Z)(n.prototype),"initUI",this).call(this),this.element.style.display="block"}},{key:"showElement",value:function(){var e=this.element.parentElement;return null!==e&&(e.classList.toggle("pushmenu-animate",!0),this.toggleEvent.fire(new _.cJ(!0)),!0)}},{key:"hideElement",value:function(){var e=this.element.parentElement;return null!==e&&(e.classList.toggle("pushmenu-animate",!1),this.toggleEvent.fire(new _.cJ(!1)),!0)}},{key:"isShown",value:function(){var e=this.element.parentElement;return null!==e&&e.classList.contains("pushmenu-animate")}}]),n}(j),z=n(3340),W=n(4649),V=n(6832),q=n(8525),K=n(6265),J=n(2239),G=n(3543),Y=n(47),$=n(7122),Q=n(5925),X=n(932),ee=n(1994),te=n(8015),ne=n(8107),ie=n(8069),oe=n(5343),re=n(4043);var se=function(e){(0,l.Z)(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,u.Z)(t);if(n){var o=(0,u.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,c.Z)(this,e)});function s(e){var t;return(0,i.Z)(this,s),t=r.call(this,"div",e),(0,Q.Rp)(),t}return(0,o.Z)(s,[{key:"initData",value:function(e){this.myUsername=e.myUsername,this.allDmWindowsMap=new Map,this.orderedDmSessionKeys=new oe.O,this.isTouchingScreen=!1,this.onShow=e.onShow,this.onHide=e.onHide}},{key:"initUI",value:function(e){var t=this;this.element=(0,Y.vz)("div",{style:{width:"320px",height:"calc(var(--vh, 1vh) * 100)",position:"absolute",top:0,bottom:0,left:0,backgroundColor:"#FFF",color:"#000",boxSizing:"border-box",display:"flex",flexDirection:"column"}},(0,Y.vz)(ue,{onClick:function(){t.handleBackButtonClick()}})),(0,J.pS)(this.element,"transform 150ms ease"),this.bindMenuChangeEvents(),this.bindListeners(),this.bindWindowListeners(),this.initVirtualKeyboardHandling(),this.hideElement()}},{key:"showElement",value:function(){(0,k.Zs)(this.element,{transform:"translateX(0)"}),this.onShow()}},{key:"hideElement",value:function(){(0,k.Zs)(this.element,{transform:"translateX(-100%)"}),this.onHide();var e=this.orderedDmSessionKeys.currentElem;void 0!==e&&this.hideWindow(e)}},{key:"bindListeners",value:function(){var e=this;B.nh.listen((function(t){e.showElement(),void 0===e.allDmWindowsMap.get(t)&&e.createWindow(t),e.showWindow(t)})),B.Lj.listen((function(t){var n=t.username,i=t.deleteWindow,o=e.getCurrentOpenWindow();(null==o?void 0:o.username)===n&&e.removeShownWindow(),!0===i&&e.allDmWindowsMap.delete(n)})),te.Kd.listen((function(t){var n=e.allDmWindowsMap.get(t.otherUsername);void 0!==n&&n.handleNewMessage(t)})),(0,ee.I)((function(t){return e.allDmWindowsMap.get(t)}))}},{key:"createWindow",value:function(e){if(!this.allDmWindowsMap.has(e)){var t=new X.Dv({username:e,myUsername:this.myUsername,open:!0,markAsRead:!0,raiseWindowZIndexToTop:function(){}});this.allDmWindowsMap.set(e,t),this.orderedDmSessionKeys.addToTop(e),this.addChild(t)}}},{key:"removeShownWindow",value:function(){var e=this.getCurrentOpenWindow();void 0!==e&&(e.removeFromDOM(),this.orderedDmSessionKeys.remove(e.username),this.handleBackButtonClick())}},{key:"showWindow",value:function(e){var t=this.orderedDmSessionKeys.currentElem;void 0!==t&&this.hideWindow(t);var n=this.allDmWindowsMap.get(e);void 0!==n&&(this.orderedDmSessionKeys.makeCurrent(e),n.openOrCollapseWindow(!0))}},{key:"getCurrentOpenWindow",value:function(){var e,t=this.allDmWindowsMap.get(null!==(e=this.orderedDmSessionKeys.currentElem)&&void 0!==e?e:"");return!0===(null==t?void 0:t.isWindowOpen())?t:void 0}},{key:"hideWindow",value:function(e){var t=this.allDmWindowsMap.get(e);void 0!==t&&t.openOrCollapseWindow(!1)}},{key:"handleBackButtonClick",value:function(){this.hideElement()}},{key:"bindMenuChangeEvents",value:function(){var e=this;re.YL.listen((function(t){t||e.hideElement()}))}},{key:"blurInputIfFocused",value:function(){var e=this.getCurrentOpenWindow();!0===(null==e?void 0:e.isInputFocused())&&document.activeElement instanceof HTMLElement&&document.activeElement.blur()}},{key:"bindWindowListeners",value:function(){var e,t=this,n=window.innerWidth,i=function(){var e=t.getCurrentOpenWindow();window.innerWidth!==n&&(null==e||e.scrollToBottom(),n=window.innerWidth,window.setTimeout((function(){null==e||e.scrollToBottom()}),300),t.blurInputIfFocused())};(0,d.j9)("resize",window,(function(){if((0,D.Tt)())(0,D.G6)()?i():window.setTimeout(i,125);else{var e=t.getCurrentOpenWindow();null==e||e.resizeTipCallout()}})),(0,d.j9)("touchstart",window,(function(){t.isTouchingScreen=!0})),(0,d.j9)("touchend",window,(function(){t.isTouchingScreen=!1})),null===(e=window.visualViewport)||void 0===e||e.addEventListener("scroll",(function(){t.isTouchingScreen&&t.blurInputIfFocused()}))}},{key:"initVirtualKeyboardHandling",value:function(){var e=this,t=new ie.d((function(){var t;e.element.style.top="".concat(null===(t=window.visualViewport)||void 0===t?void 0:t.offsetTop,"px");var n=window.setInterval((function(){var t;e.element.style.top="".concat(null===(t=window.visualViewport)||void 0===t?void 0:t.offsetTop,"px")}),100);window.setTimeout((function(){window.clearInterval(n)}),1e3)}),{bounceLimitMS:1e3,debounceType:2});ne.K.listen((function(){t.callFunc()})),(0,d.j9)("scroll",document,(function(){t.callFunc()}))}}]),s}(h.w);function ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function le(e){for(var t=1;t0?(e.dmListIconRoot.classList.add("has_unread"),null===(n=e.hamburgerIcon)||void 0===n||n.classList.add("has_unseen")):(e.dmListIconRoot.classList.remove("has_unread"),null!==(i=null===(o=e.userUpdatesBellRoot)||void 0===o?void 0:o.classList.contains("has_unseen"))&&void 0!==i&&i||null===(r=e.hamburgerIcon)||void 0===r||r.classList.remove("has_unseen")))}))}},{key:"bindResizeEvents",value:function(){var e=this;(0,D.Tt)()||(0,d.j9)("resize",window,(function(){var t=(0,S.mP)();e.element.style.top=t<250?"":"0"}))}}]),s}(h.w),ue=function(e){return(0,Y.vz)("span",{style:{height:"45px",display:"flex",alignItems:"center",paddingLeft:"10px",color:"#306A91",borderBottom:"1px solid #EFEFEF"},onClick:e.onClick},G.ag.back)},de=n(4364),he=n(2750),fe=n(1185),pe=n(9846),me=n(7510),ve=n(2952);var ge,ye=function(e){(0,l.Z)(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,u.Z)(t);if(n){var o=(0,u.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,c.Z)(this,e)});function s(e){var t;return(0,i.Z)(this,s),(t=r.call(this,e.toggleElement,!0,e)).convosOpenedWithoutClosingDropdown=0,(0,d.j9)("keydown",document,(function(e){var n;if(t.isShown()){var i,o=t.dmList.element.contains(document.activeElement),r=!0===(null===(n=B.qd.getInstance())||void 0===n?void 0:n.element.contains(document.activeElement));if("Tab"===e.key)o||!t.element.contains(document.activeElement)?null===(i=t.popoutLink)||void 0===i||i.focus():t.dmList.focusSearchBar(),e.stopPropagation(),e.preventDefault();else"Escape"===e.key?t.hideElement():o||r||!["ArrowUp","ArrowDown"].includes(e.key)&&!(0,pe.r)(e.keyCode)||t.dmList.focusSearchBar()}})),ve.y.showingEvent.listen((function(){return t.hideElement()})),B.nh.listen((function(){t.isShown()&&(t.convosOpenedWithoutClosingDropdown+=1,(0,T.fg)("OpenedDmFromDropdown",{seq_convos_opened:t.convosOpenedWithoutClosingDropdown}))})),V.zS.unreadConversationsCountUpdate.listen((function(e){var n=e.dmsCount;t.updateNumUnread(n)})),t}return(0,o.Z)(s,[{key:"initUI",value:function(e){var t=this,n=(0,Z.TF)(),i={fontFamily:"UbuntuRegular, Tahoma, Arial, Helvetica, sans-serif",fontSize:"14px",borderWidth:"1px",borderStyle:"solid",borderRadius:"4px 0 4px 4px",boxShadow:"0px 0px 16px rgba(0, 0, 0, 0.32)",height:n?"":"383px",maxHeight:"calc(var(--vh, 1vh) * 100 - ".concat(X.Tx.expandedHeight," - 44px)"),minHeight:"280px",padding:"1px",position:"absolute",right:"0",width:"304px",display:"none",flexDirection:"column"};this.dmList=new me.p({isDms:!0,clearSearchOnSelect:(0,D.s2)(),isFullVideoMode:!1,openConversationEvent:B.nh}),this.element=(0,Y.vz)("div",{style:i,colorClass:"dmListDropdownRoot","data-testid":"dm-list-dropdown"},(0,Y.vz)("div",{style:{padding:"10px 8px",borderBottomWidth:"1px",borderBottomStyle:"solid"},colorClass:"header"},(0,Y.vz)("span",null,G.ag.directMessageLabel),(0,Y.vz)("span",{style:{marginLeft:"4px"},ref:function(e){return t.numUnreadContainer=e}}),!n&&(0,Y.vz)("button",{style:{display:"inline-block",position:"absolute",right:"8px",top:"12px",height:"13px",width:"13px",border:"none",cursor:"pointer"},title:G.ag.popoutInNewWindow,colorClass:"popoutIcon","data-testid":"popout-dm-icon",ref:function(e){return t.popoutLink=e},onClick:function(){t.hideElement(),ve.y.show()}})),n?(0,Y.vz)(be,null):this.dmList.element)}},{key:"showElement",value:function(){return(0,fe.vP)(this.toggleElement,"active"),this.convosOpenedWithoutClosingDropdown=0,(0,v.Z)((0,u.Z)(s.prototype),"showElement",this).call(this,"flex")}},{key:"hideElement",value:function(e){var t;if(!(0,D.s2)()&&(null==e?void 0:e.target)instanceof HTMLElement&&(!0===(null===(t=B.qd.getInstance())||void 0===t?void 0:t.element.contains(e.target))||!document.body.contains(e.target)))return!1;var n=(0,v.Z)((0,u.Z)(s.prototype),"hideElement",this).call(this,e);return n&&(0,fe.FU)(this.toggleElement,"active"),n}},{key:"updateNumUnread",value:function(e){var t=e>0;this.numUnreadContainer.innerText=t?"(".concat(e,")"):"",t?this.toggleElement.classList.add("has_unread"):this.toggleElement.classList.remove("has_unread")}}]),s}(j),be=function(){var e={cursor:"pointer",fontSize:"12px"},t="".concat(STATIC_URL,"pms/empty-chat-state.svg");return(0,Y.vz)("div",{style:{fontSize:"12px",marginTop:"0",padding:"44px 0 16px",position:"static",textAlign:"center",top:"50%",width:"100%"}},(0,Y.vz)("img",{src:t,alt:"empty-chat-state"}),(0,Y.vz)("div",{style:{fontSize:"14px",lineHeight:"18px",margin:"8px 0"},colorClass:"sendDmPrompt"},G.ag.sendDirectMessage),(0,Y.vz)("div",{style:{margin:"16px 0 44px"}},(0,Y.vz)("a",{style:e,colorClass:"link",onClick:function(e){e.preventDefault(),(0,K.iW)({fromFeature:!0})},"account-redirect":!0},G.ag.loginVerbText)),(0,Y.vz)("div",{colorClass:"signupPrompt"},G.ag.dontHaveAccount," ",(0,Y.vz)("a",{href:p.Ng,style:e,colorClass:"link",onClick:function(){(0,T.fg)("PMSignupClicked")},"account-redirect":!0},G.ag.signUpLower)))},we=n(4484),Ce=n(1794),xe=(0,o.Z)((function e(){(0,i.Z)(this,e)}));(ge=xe).dropDownToggle=new Ce.xB("dropDownToggle"),ge.updatesAreRead=new Ce.xB("updatesAreRead"),ge.updatesAreUnread=new Ce.xB("updatesAreUnread"),ge.tabItemsLoaded=new Ce.xB("tabItemsLoaded");var ke=n(5809),Se=n(126),Te=n(7169),Ie=n(8016),Pe=n(391),Re=function(){function e(){(0,i.Z)(this,e)}return(0,o.Z)(e,null,[{key:"getUserUpdates",value:function(e,t){if("/security/tfa/auth/"!==window.location.pathname&&"/security/tfa/auth/choose_device/"!==window.location.pathname){var n=e.map((function(e){return"notification_type=".concat(e)})).join("&");(0,g.Ue)("notifications/updates/?".concat(n)).then((function(e){var n=new Pe.j(e.responseText).getList("items");if(void 0!==n){var i=n.map((function(e){return{text:e.getString("text"),url:e.getString("url"),timestamp:e.getNumber("timestamp"),timeSince:e.getString("time_since"),seen:e.getBoolean("seen"),notificationType:e.getString("notification_type")}}));t(i)}})).catch((function(){}))}}},{key:"recordLastSeen",value:function(e,t,n){(0,g.I5)(e,{timestamp:t.toString()}).then((function(){n()})).catch((function(){}))}},{key:"hasUnseen",value:function(e){(0,g.Ue)("notifications/has_unseen/").then((function(t){var n=JSON.parse(t.responseText);e(n.has_unseen)})).catch((function(){}))}}]),e}(),Me=n(2923);var Ae=function(e){(0,l.Z)(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,u.Z)(t);if(n){var o=(0,u.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,c.Z)(this,e)});function s(){var e;return(0,i.Z)(this,s),(e=r.call(this)).element.style.overflow="",e.element.style.position="static",e.element.style.overflowX="hidden",e.element.style.overflowY="auto",e.enableMomentumScrollingForIPad(),e}return(0,o.Z)(s,[{key:"enableMomentumScrollingForIPad",value:function(){var e=this;/iPad|iPhone|iPod/.test(navigator.platform)&&(this.element.style["-webkit-overflow-scrolling"]="touch",(0,d.j9)("scroll",this.element,(function t(){e.element.style.overflowY="scroll",(0,d.SC)("scroll",e.element,t)})))}}]),s}(h.w);var Ee=function(e){(0,l.Z)(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,u.Z)(t);if(n){var o=(0,u.Z)(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return(0,c.Z)(this,e)});function s(e){var t;(0,i.Z)(this,s),t=r.call(this),(0,fe.vP)(t.element,"twitterUpdateRow"),t.element.style.fontFamily="UbuntuRegular, Helvetica, Arial, sans-serif",t.element.style.fontStyle="normal",t.element.style.fontWeight="normal",t.element.style.position="relative",t.element.style.height="",t.element.style.width="",t.element.style.margin="7px",t.element.style.padding="6px",t.setSeenColors(e.seen),t.element.style.borderWidth="1px",t.element.style.borderStyle="solid",t.element.style.borderRadius="4px",t.element.appendChild(t.createContentElement(e.text));var n,o,a="offline_tip"===e.notificationType&&I.J.current.isMobile;if(""!==e.timeSince){var l=(n=e.timeSince,o=document.createElement("div"),(0,fe.vP)(o,"timeSince"),o.appendChild(document.createTextNode(n)),o.style.fontSize="9px",o.style.lineHeight="13px",o.style.cssFloat="left",o);t.element.appendChild(l)}if(""!==e.url&&!a){var c="twitter_feed";void 0!==e.notificationType&&(c=e.notificationType);var u=function(e,t){var n=document.createElement("a");n.href=(0,g.BN)(e),n.target="_blank";var i="twitter_feed"===t,o="offline_tip"===t,r=function(e){switch(e){case"twitter_feed":return G.ag.viewOnTwitterText;case"offline_tip":return G.ag.showTipsAndMessages}return G.ag.seeMore}(t);return n.appendChild(document.createTextNode(r)),(0,fe.vP)(n,"twitterLink"),n.style.fontSize="9px",n.style.lineHeight="13px",n.style.textAlign="right",n.style.cssFloat="right",i?n.onclick=function(){(0,T.fg)("NewsfeedItemViewOnTwitter")}:o&&(n.onclick=function(){(0,T.fg)("OfflineTipItemLinkClick")}),n}(e.url,c);t.element.appendChild(u)}return t}return(0,o.Z)(s,[{key:"setSeenColors",value:function(e){e?(0,fe.vP)(this.element,"seen"):(0,fe.FU)(this.element,"seen")}},{key:"createContentElement",value:function(e){var t=this.buildContentFromText(e);return(0,fe.vP)(t,"contentSection"),t.style.fontSize="12px",t.style.lineHeight="14px",t.style.whiteSpace="pre-wrap",t.style.marginBottom="6px",t.style.wordWrap=t.style.wordBreak="break-word",t.style.overflow="hidden",t}},{key:"buildContentFromText",value:function(e){var t=document.createElement("div");return t.innerHTML=e,this.makeLinksShorterAndAddStyle(t),t}},{key:"makeLinksShorterAndAddStyle",value:function(e){Array.from(e.querySelectorAll("a")).forEach((function(e){(0,fe.vP)(e,"tweetLink"),e.target="_blank",e.style.outline="none",e.style.fontSize="12px",e.style.lineHeight="14px",null!==e.firstChild&&e.firstChild instanceof Text&&null!==e.firstChild.textContent&&(e.firstChild.textContent=e.firstChild.textContent.replace(/^http(s)?:\/\//,"").replace(/^www\./,"")),e.onclick=function(){(0,T.fg)("NewsfeedItemLinkClick")}}))}}]),s}(h.w);function Be(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=(0,u.Z)(e);if(t){var o=(0,u.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,c.Z)(this,n)}}var Oe=function(e){(0,l.Z)(n,e);var t=Be(n);function n(){var e;return(0,i.Z)(this,n),(e=t.call(this)).addChild(new Ee({text:"".concat(G.ag.loadingTextLower,"..."),seen:!0,timestamp:0,timeSince:"",url:""})),e}return(0,o.Z)(n,[{key:"setUpdateItems",value:function(e){var t=this;this.removeAllChildren(),0===e.length&&this.addChild(new Ee({text:"".concat(G.ag.noNewUpdates),seen:!0,timestamp:0,timeSince:"",url:""})),e.forEach((function(e){t.addChild(new Ee(e))}))}},{key:"initUI",value:function(){this.element.style.maxHeight="307px",this.element.style["-webkit-transform"]="translateZ(0)"}}]),n}(Ae),Le=function(e){(0,l.Z)(n,e);var t=Be(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"initUI",value:function(){(0,v.Z)((0,u.Z)(n.prototype),"initUI",this).call(this),this.element.style.maxHeight="",(0,Me.q)(this.element)}}]),n}(Oe);function De(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0}},{key:"recordLastSeenNotification",value:function(e,t){this.isAnonymous||Re.recordLastSeen(this.recordLastSeenUrl,e,(function(){void 0!==t&&t()}))}},{key:"sendUpdatesClosedEvent",value:function(){if(0!==this.updateTabOpenTime){var e={duration_seconds:((new Date).getTime()-this.updateTabOpenTime)/1e3};this.updateTabOpenTime=0;try{(0,T.fg)(this.closePageActionName,e)}catch(e){}}}},{key:"getTabHandleContent",value:function(){var e;return e=this.numUnread>99?"".concat(this.tabTitle," (99+)"):this.numUnread>0?"".concat(this.tabTitle," (").concat(this.numUnread,")"):this.tabTitle,[document.createTextNode(e)]}},{key:"getTabId",value:function(){return"updates-tab"}},{key:"showElement",value:function(){(0,v.Z)((0,u.Z)(s.prototype),"showElement",this).call(this),this.repositionChildren()}},{key:"setAsCurrentTab",value:function(){(0,v.Z)((0,u.Z)(s.prototype),"setAsCurrentTab",this).call(this);try{(0,T.fg)(this.openPageActionName,{is_orange:this.hasUnread()})}catch(e){}this.updateTabOpenTime=(new Date).getTime(),this.loadFeed()}},{key:"hideElement",value:function(){(0,v.Z)((0,u.Z)(s.prototype),"hideElement",this).call(this),this.sendUpdatesClosedEvent()}},{key:"isShowing",value:function(){return this.isDropDownVisible&&this.isCurrentTab()}},{key:"unreadItems",get:function(){return this.items.filter((function(e){return!e.seen}))}},{key:"loadFeed",value:function(){var e=this;this.isLoaded?(this.contents.setUpdateItems(this.items),this.scheduleMarkAllAsSeen(),xe.tabItemsLoaded.fire()):Re.getUserUpdates(this.notificationTypes,(function(t){var n,i,o,r;e.items=t,e.contents.setUpdateItems(t);var s=e.unreadItems;e.numUnread=s.length,e.highestUnreadTs=0,s.length>0&&(e.highestUnreadTs=Math.max.apply(Math,(0,Se.Z)(s.map((function(e){return e.timestamp}))))),e.refreshTabs(),e.isLoaded=!0,xe.tabItemsLoaded.fire();var a=null===(n=I.J.current.loggedInUser)||void 0===n?void 0:n.userUid;void 0!==a&&e.getNewsSeenTopic(a).onMessage.listen((function(t){debug("news seen update",t),e.markAsSeen(t.timestamp),e.numUnread=e.unreadItems.length,xe.updatesAreRead.fire(),e.refreshTabs()})),null===(i=e.getNewsTopic(a))||void 0===i||i.onMessage.listen((function(t){debug("news item",t);var n=0;e.items.length>0&&(n=Math.max.apply(Math,(0,Se.Z)(e.items.map((function(e){return e.timestamp}))))),n0&&(n=Math.max.apply(Math,(0,Se.Z)(e.items.map((function(e){return e.timestamp}))))),n0&&(i=Math.max.apply(Math,(0,Se.Z)(e.items.map((function(e){return e.timestamp}))))),i=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(r.entries());try{for(s.s();!(o=s.n()).done;){var a=(0,ke.Z)(o.value,2),l=a[0];if(a[1].text.includes(n)){r.splice(l,1),r.splice(0,0,t);break}}}catch(e){s.e(e)}finally{s.f()}e.contents.setUpdateItems(e.items),e.refreshTabs(),e.scheduleMarkAllAsSeen()}}))}))}},{key:"markAsSeen",value:function(e){this.items.forEach((function(t){t.timestamp<=e&&(t.seen=!0)}))}},{key:"scheduleMarkAllAsSeen",value:function(){var e=this;this.numUnread>0?(void 0!==this.markAllAsSeenTimeout&&clearTimeout(this.markAllAsSeenTimeout),this.isShowing()&&(this.markAsSeen(this.items[0].timestamp),this.markAllAsSeenTimeout=window.setTimeout((function(){e.numUnread=0,e.highestUnreadTs=0,e.recordLastSeenNotification(e.items[0].timestamp,(function(){xe.updatesAreRead.fire()}))}),500))):xe.updatesAreRead.fire()}}]),s}(we.NQ);function Ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Fe(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];return(0,i.Z)(this,n),(o=t.call(this)).isDropDownVisible=!1,o.tabsLoaded=0,o.element.id="UserUpdatesPanel",o.element.dataset.testid="user-updates-panel",(0,fe.vP)(o.element,"userUpdatesPanel"),o.tabHandlesRow.element.style.borderBottom="none",o.tabHandlesRow.element.style.padding="4px 0 0 6px",o.tabHandlesRow.element.style.marginBottom="4px",o.tabHandlesRow.element.style.boxSizing="border-box",o.window.style.position="static",o.tabHandleStyle=Fe(Fe({},o.tabHandleStyle),{},{fontSize:"12px",padding:"5px 10px"}),o.updatesTabs=[new Ue(r)],o.updatesTabs.forEach((function(e){o.addTab(e)})),xe.dropDownToggle.listen((function(e){e?(o.tabsLoaded=0,o.updatesTabs.forEach((function(e){return e.loadFeed()})),o.tabsLoaded===o.updatesTabs.length&&o.switchToMostRecentUnreadTab()):o.currentTab=void 0})),xe.tabItemsLoaded.listen((function(){o.tabsLoaded+=1})),o.addFeedbackLink(),o.dropDownComponent=o.createDropDownComponent(e),o}return(0,o.Z)(n,[{key:"createDropDownComponent",value:function(e){return new We(this,e)}},{key:"initAdditionalToggleElement",value:function(e){var t=this;xe.updatesAreUnread.listen((function(){t.anyUpdatesTabUnread()&&(null==e||e.classList.add("has_unseen"))})),xe.updatesAreRead.listen((function(){var n,i;t.anyUpdatesTabUnread()||null!==(n=null===(i=document.querySelector("#dmListIconRoot"))||void 0===i?void 0:i.classList.contains("has_unread"))&&void 0!==n&&n||(e.className=e.className.replace("has_unseen",""))}))}},{key:"switchToMostRecentUnreadTab",value:function(){this.changeToTab(this.updatesTabs.reduce((function(e,t){return t.highestUnreadTs>e.highestUnreadTs?t:e})))}},{key:"anyUpdatesTabUnread",value:function(){return this.updatesTabs.some((function(e){return e.hasUnread()}))}},{key:"addFeedbackLink",value:function(){this.addFooter(He(!1))}},{key:"repositionChildren",value:function(){}},{key:"initUI",value:function(){this.element.style.overflow="",this.element.style.position="static",this.element.style.borderWidth="1px",this.element.style.borderStyle="solid",this.element.style.borderTop="none",this.element.style.borderRadius="0 0 4px 4px"}}]),n}(we.Le),je=function(e){(0,l.Z)(n,e);var t=_e(n);function n(e){var o;(0,i.Z)(this,n),o=t.call(this,e,!0);for(var r=1;r=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0)))}),this.element)}},{key:"initUI",value:function(e){(0,v.Z)((0,u.Z)(s.prototype),"initUI",this).call(this,e),(0,k.Zs)(this.element,tt)}},{key:"updateFollowedCount",value:function(){if(void 0!==this.followedCount){var e=this.followedData.getOnlineFollowed();this.followedCount.textContent=G.ag.followCountLong(e.online,e.total)}}},{key:"navigateToFollowedPage",value:function(e){(0,T.fg)("FollowedDropdownSeeAll"),w.k4.fire(e)}},{key:"replaceRooms",value:function(){var e=this;if(!this.isShown()){for(;null!==this.followedContainer.firstChild;)this.followedContainer.removeChild(this.followedContainer.firstChild);if(!this.isAnonymous){var t=this.followedData.getOnlineFollowed(),n=this.followedData.getCurrentShownRooms().length>1;this.followedContainer.appendChild((0,Y.vz)("div",{style:{margin:"5px 3px"}},(0,Y.vz)("a",{href:st(this.gender,t.online>0),style:{height:"auto",width:"auto",border:"none",borderRadius:"0px",textDecoration:"none",cursor:"pointer",cssFloat:"none",padding:"0px"},"data-testid":"following-show-all","data-floatingnav":"",colorClass:[fe.ql.tabActiveBgColor,fe.ql.hrefColor],ref:function(t){e.moreAnchor=t},onMouseEnter:function(){e.moreAnchor.style.textDecoration="underline",(0,fe.vP)(e.moreAnchor,fe.ql.tabActiveColor),(0,fe.FU)(e.moreAnchor,fe.ql.hrefColor)},onMouseLeave:function(){e.moreAnchor.style.textDecoration="none",(0,fe.vP)(e.moreAnchor,fe.ql.hrefColor),(0,fe.FU)(e.moreAnchor,fe.ql.tabActiveColor)},onClick:this.navigateToFollowedPage},G.ag.showAllText),this.showFollowedCount&&(0,Y.vz)("div",{style:n?it:ot,className:"followedCount",ref:function(t){e.followedCount=t}},G.ag.followCountLong(t.online,t.total))))}this.followedContainer.style.width="auto";var i=(0,Y.vz)("div",{style:{display:"table"}}),o=(0,Y.vz)("div",null),r=0;if(this.followedData.getCurrentShownRooms().forEach((function(e){r%2==0&&(o=(0,Y.vz)("div",{style:{display:"table-row"}}),i.appendChild(o));var t=(0,Y.vz)("div",{style:{display:"table-cell"}});t.appendChild(e.card),o.appendChild(t),r+=1})),this.followedContainer.appendChild(i),0===this.followedData.getCurrentShownRooms().length){var s=(0,Y.vz)("div",{colorClass:fe.ql.textColor,style:{margin:"5px 3px 5px 3px",fontSize:"12px",fontFamily:"UbuntuRegular"}});if(this.isAnonymous){var a=function(e){var t=(0,Y.vz)("a",{href:e.href,style:{height:"auto",width:"auto",border:"none",borderRadius:"0px",textDecoration:"none",cursor:"pointer",cssFloat:"none",padding:"0px"},colorClass:[fe.ql.tabActiveBgColor,fe.ql.hrefColor],onMouseEnter:function(){t.style.textDecoration="underline"},onMouseLeave:function(){t.style.textDecoration="none"},onClick:void 0!==e.onClick?e.onClick:void 0,"account-redirect":!0},e.children);return t};s.appendChild((0,Y.vz)(Y.HY,null,(0,Y.vz)(a,{href:(0,g.BN)("".concat(p.Ng,"?src=followed_tab"))},G.ag.signUpText),(0,Y.vz)("span",null," ".concat(G.ag.orLower," ")),(0,Y.vz)(a,{href:(0,g.BN)(p.PU),onClick:function(t){t.metaKey||t.ctrlKey||(t.preventDefault(),e.hideElement(),(0,K.iW)({}))}},G.ag.loginVerbText))),s.appendChild((0,Y.vz)("span",null,G.ag.anonFollowMore))}else s.appendChild((0,Y.vz)("span",null,G.ag.userFollowMore));this.followedContainer.appendChild(s),this.followedContainer.style.width="265px"}}}},{key:"updateThumbnails",value:function(){var e,t=Xe(this.followedData.getCurrentShownRooms());try{for(t.s();!(e=t.n()).done;)e.value.updateThumbnail()}catch(e){t.e(e)}finally{t.f()}}},{key:"showElement",value:function(){if(!(0,v.Z)((0,u.Z)(s.prototype),"showElement",this).call(this))return!1;this.updateThumbnails(),this.followedContainer.scrollTop=0,this.followedData.resetLastUnseen();var e=(0,k.r7)(this.element),t=Math.max((0,S._U)(),(0,k.gV)(document.body.style.minWidth));return e.right>t&&(this.element.style.width="".concat(this.element.offsetWidth-(e.right-t)-4,"px"),this.followedContainer.style.overflowX="auto"),!0}},{key:"hideElement",value:function(e){if(void 0!==e&&(e.metaKey||e.ctrlKey))return!1;if(!(0,v.Z)((0,u.Z)(s.prototype),"hideElement",this).call(this))return!1;var t,n=Xe(this.followedData.getCurrentShownRooms());try{for(n.s();!(t=n.n()).done;)t.value.unhighlight()}catch(e){n.e(e)}finally{n.f()}return this.element.style.width="auto",this.followedContainer.style.overflowX="hidden",this.replaceRooms(),!0}},{key:"reposition",value:function(){(0,v.Z)((0,u.Z)(s.prototype),"reposition",this).call(this),this.connectedOverlay.element.style.display="none"}}]),s}(Qe.i);function st(e,t){return t?"".concat("/followed-cams/online/").concat(e!==f.Y0.All?"".concat(f.aI.get(e),"/"):""):"/followed-cams/offline/"}var at,lt=function(){function e(t,n,o){var r=this;(0,i.Z)(this,e),this.room=t,this.highlighted=n,this.username="",this.username=t.room;var s=""!==this.room.image?this.room.image:"".concat(STATIC_URL_ROOT,"images/no_thumbnail_1_wide.jpg");this.a=(0,Y.vz)("a",{className:"roomElementAnchor",colorClass:[fe.ql.tabInactiveColor,this.highlighted?"isHighlighted":"notHighlighted"],style:{width:"180px",height:"126px",borderRadius:"4px",border:"none",padding:"0px",margin:"0px",display:"block",cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",textDecoration:"none"},"data-room":this.room.room,href:(0,g.BN)("/".concat(this.room.room,"/")),onClick:function(){(0,T.fg)("FollowedDropdownVisit")}},(0,Y.vz)("img",{alt:"",src:s,width:180,height:101,style:{borderRadius:"3px 3px 0px 0px"},className:"room_thumbnail",ref:function(e){r.img=e}}),(0,Y.vz)("span",{style:{padding:"5px"}},this.room.room)),this.card=(0,Y.vz)("div",{className:"roomElement",style:{display:"inline-block",width:"180px",height:"126px",borderRadius:"4px",margin:"3px",cursor:"pointer"}},this.a),(0,d.Zf)(["click","mousedown","touchstart"],this.a,(function(){(0,$e.bc)(r.username,"ft",o)}))}return(0,o.Z)(e,[{key:"unhighlight",value:function(){this.highlighted=!1,(0,fe.vP)(this.a,"notHighlighted"),(0,fe.FU)(this.a,"isHighlighted")}},{key:"updateThumbnail",value:function(){var e;this.setImageStreamer(),""!==this.room.image&&(null===(e=this.imageStreamer)||void 0===e||e.loadImage(0).catch((function(e){warn("Error loading image",{imageSrc:e})})))}},{key:"setImageStreamer",value:function(){var e=this;""!==this.room.image&&void 0===this.imageStreamer&&(this.imageStreamer=new Ye.hE(this.username,this.img),(0,d.j9)("mouseenter",this.card,(function(){var t;(0,$e.fr)()&&(null===(t=e.imageStreamer)||void 0===t||t.startStreaming())})),(0,d.j9)("mouseleave",this.card,(function(){var t;(0,$e.fr)()&&(null===(t=e.imageStreamer)||void 0===t||t.stopStreaming())})))}}]),e}();function ct(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ut(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)?ut(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;e.timestamp<=this.lastUpdate||e.username!==n||(this.onlineFollowed=e.onlineFollowedList.onlineFollowed,this.seenRooms=e.seenRooms,this.lastUnseen=e.unseenRooms,this.update(e.onlineFollowedList,!0),void 0!==i&&i(e,t),this.lastUpdate=e.timestamp)}},{key:"update",value:function(e){var t,n=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o={},r=[],s=[],a=ct(e.roomList);try{for(a.s();!(t=a.n()).done;){var l=t.value;void 0!==this.seenRooms[l.room]||this.first?s.push(l):r.push(l),this.seenRooms[l.room]=!0,o[l.room]=l}}catch(e){a.e(e)}finally{a.f()}var c=r.length>0;this.lastUnseen=this.lastUnseen.reduce((function(e,t){return void 0===o[t.room]||n.forceSeen[t.room]||e.push(o[t.room]),e}),[]);for(var u=0,d=r;u1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&Date.now()-this.lastUpdate<1e4||(0,Je.GB)().then((function(i){e.lastUpdate=Date.now(),e.onlineFollowed=i.onlineFollowed;var o=e.update(i);n(o),(0,Je.iq)(t,i,e.seenRooms,o.flash,o.rooms)})).catch((function(){}))}},{key:"disableResizeDebounceEvent",value:function(){var e=this;this.disableResizeDebounce=!0,window.setTimeout((function(){e.disableResizeDebounce=!1}),300)}}],[{key:"getInstance",value:function(){return e._instance}}]),e}();(at=dt)._instance=new at;var ht=function(){function e(t,n,o){var r,s,a,l=this;(0,i.Z)(this,e),this.toggleEl=t,this.orange=!1,this.followedData=dt.getInstance(),this.moveFollowCountTest=new Ke.BJ(["MvFlw2","MvFlw2Ntf","MvFlw2Onl"],"mv_flw_ct"),this.ratioText=null!==(r=this.toggleEl.querySelector(".followed_counts"))&&void 0!==r?r:void 0,["MvFlw2","MvFlw2Ntf"].includes(null!==(s=this.moveFollowCountTest.activeSide)&&void 0!==s?s:"")&&void 0!==this.ratioText&&(this.ratioText.remove(),this.ratioText=void 0),this.followingLink=null!==(a=document.getElementById("followed_anchor"))&&void 0!==a?a:void 0;var c={username:o,isAnonymous:n,updateFromCBCallback:function(e){l.updateRatioText(!0),0===e.rooms.length&&(l.orange=!1,l.updateTabHighlight())},updateViaStorageCallback:function(e,t){l.updateRatioText(!1),l.orange=e.unseenRooms.length>0,l.updateTabHighlight(),e.flash&&!t&&l.flash()},followedDropdownClickedCallback:function(){l.updateRatioText(!1),clearInterval(l.flashInterval),l.flashInterval=void 0,l.orange=!1,l.updateTabHighlight()},dropdown:new rt(this.toggleEl,n,this.moveFollowCountTest.active),followedTab:this};this.dropdown=c.dropdown,this.dropdown.toggleEvent.listen((function(e){if(e.isShowing){clearInterval(l.getFlashingInterval()),l.setFlashingInterval(void 0),l.setOrange(!1),l.updateTabHighlight();var t=l.followedData.getOnlineFollowed().online;(0,T.fg)("FollowedDropdownOpened",{onlineBroadcasters:t}),l.followedData.setDropdownViewed()}})),w.Me.listen((function(e){l.updateFollowingLink(e,l.followedData.getOnlineFollowed().online>0)})),this.followedData.init(c),this.moveFollowCountTest.active||(this.followedData.setOnlineFollowed((0,Je.RH)(this.toggleEl.innerText)),this.updateRatioText(!0))}return(0,o.Z)(e,[{key:"setOrangeStyle",value:function(e){if(e){(0,fe.vP)(this.toggleEl,"orange");var t,n=this.followedData.getlastUnseen().length;n>0&&"MvFlw2Ntf"===this.moveFollowCountTest.activeSide&&((0,fe.vP)(this.toggleEl,"text"),null===(t=document.getElementById("followed_anchor"))||void 0===t||null===(t=t.style)||void 0===t||t.setProperty("--unseen-follow-count",'"'.concat(n,'"')))}else(0,fe.FU)(this.toggleEl,"orange"),(0,fe.FU)(this.toggleEl,"text")}},{key:"setOrange",value:function(e){this.orange=e}},{key:"setFlashingInterval",value:function(e){this.flashInterval=e}},{key:"getFlashingInterval",value:function(){return this.flashInterval}},{key:"flash",value:function(){var e=this;if(void 0===this.flashInterval){var t=3,n=!0;this.flashInterval=window.setInterval((function(){if(n){if(e.setOrangeStyle(!0),0==(t-=1))return clearInterval(e.flashInterval),void(e.flashInterval=void 0)}else e.setOrangeStyle(!1);n=!n}),500)}}},{key:"updateRatioText",value:function(e){var t=this;if(this.moveFollowCountTest.active&&this.dropdown.updateFollowedCount(),void 0!==this.ratioText){var n=this.followedData.getOnlineFollowed();this.toggleEl.style.width="auto";var i=void 0===I.J.current.loggedInUser?"":"(".concat(n.online,")");this.ratioText.textContent="MvFlw2Onl"===this.moveFollowCountTest.activeSide?i:"(".concat(n.online,"/").concat(n.total,")"),null!==this.toggleEl.offsetParent&&window.setTimeout((function(){e||(t.toggleEl.style.width="".concat(t.toggleEl.offsetWidth+1,"px")),t.dropdown.isShown()&&t.dropdown.reposition()})),this.updateFollowingLink((0,f.ej)(),n.online>0)}}},{key:"updateTabHighlight",value:function(){this.orange&&!this.dropdown.isShown()?this.setOrangeStyle(!0):this.setOrangeStyle(!1)}},{key:"updateFollowingLink",value:function(e,t){void 0!==this.followingLink&&(this.followingLink.href=st(e,t))}}]),e}();function ft(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(JSON.parse(e));try{for(i.s();!(t=i.n()).done;){var o=t.value;n.push({provider:o[0],name:o[1]})}}catch(e){i.e(e)}finally{i.f()}return n}}function mt(e){var t;if(null!==e&&"/security/tfa/auth/"!==window.location.pathname&&"/security/tfa/auth/choose_device/"!==window.location.pathname)return{username:e.username,gender:e.gender,subgender:null!==(t=e.subgender)&&void 0!==t?t:void 0,isSupporter:e.is_supporter,isStaff:e.is_staff,tokenBalance:e.token_balance,userUid:e.user_uid,signedUsername:e.signed_username,isAgeVerified:e.is_age_verified,isBroadcasting:e.is_broadcasting,totalFollowed:e.total_followed,onlineFollowed:e.online_followed,canWegOneClick:e.can_weg_oneclick,canEpochOneClick:e.can_epoch_oneclick}}var vt=n(7600),gt=n(795),yt=n(9447),bt=n(2673),wt=n(2896),Ct=n(6422),xt=n(1289),kt=n(3682),St=n(7201),Tt=n(1625),It=n(1282);function Pt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Rt(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)?Rt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function Rt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&void 0!==arguments[0]&&arguments[0];return function(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3?arguments[3]:void 0;return P.w.isWhiteLabel||null===e||null===t||(i?(n=new je(e),null!=o&&n.initAdditionalToggleElement(o)):n=new Ne(e),t.appendChild(n.dropDownComponent.element),n.element.dataset.testid="user-updates-panel"),n}(document.querySelector("#userUpdatesBellRoot"),document.querySelector("#userUpdatesMenuDropdownRoot"),e,document.querySelector("#mmnav"))}},{key:"bindDmListDropdown",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=document.querySelector("#userUpdatesBellRoot"),n=document.querySelector("#dmListDropdownRoot"),i=document.querySelector("#dmListIconRoot"),o=document.querySelector("#mmnav");if(!e)return function(e,t){var n;return null!==e&&null!==t&&((n=new ye({toggleElement:e})).element.dataset.testid="dm-convo-list",t.appendChild(n.element)),n}(i,n);!function(e,t,n,i){null!==e&&null!==i&&i.appendChild(new ce({dmListIconRoot:e,userUpdatesBellRoot:t,hamburgerIcon:n}).element)}(i,t,o,n)}},{key:"bindPurchaseTokenLinks",value:function(){var e,t=Pt(document.querySelectorAll(".purchase_tokens a, a.purchase_tokens, a#purchase_tokens"));try{for(t.s();!(e=t.n()).done;){var n=e.value;void 0!==this.context.loggedInUser?(0,gt.sh)(n):n.onclick=function(e){(0,K.iW)({}),e.preventDefault()}}}catch(e){t.e(e)}finally{t.f()}}},{key:"watchForAdIntervention",value:function(){if(window.hasOwnProperty("ReportingObserver")){var e=function(e){var t,n=Pt(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;"intervention"===i.type&&(0,T.fg)("AdIntervention",{report:JSON.stringify(i.body)})}}catch(e){n.e(e)}finally{n.f()}},t=new window.ReportingObserver((function(t,n){e(t)}),{buffered:!0});t.observe(),(0,d.j9)("beforeunload",window,(function(n){var i=t.takeRecords();e(i)}))}}},{key:"bindFollowedTab",value:function(){var e=document.getElementById("followed_anchor");null!==e&&e instanceof HTMLAnchorElement&&(e.onclick=function(e){e.ctrlKey||e.metaKey||e.preventDefault()},new ht(e,void 0===this.context.loggedInUser,void 0!==this.context.loggedInUser?this.context.loggedInUser.username:""))}},{key:"bindHeader",value:function(){var e=document.querySelector("#header");if(null!==e&&e instanceof HTMLElement)return new E(e)}},{key:"bindFooter",value:function(){var e=document.querySelector(".footer-holder");if(null!==e&&e instanceof HTMLElement)return new C(e)}},{key:"handlePmChatWindows",value:function(){var e,t=window.location.pathname.startsWith("/staff_tools"),n=document.getElementById("header");null===n||null===n.offsetParent||t||(!0===(null===(e=this.context.loggedInUser)||void 0===e?void 0:e.isStaff)||void 0!==this.context.loggedInUser&&(0,s.Fh)())&&(0,B.FP)(this.context.loggedInUser.username)}},{key:"setupEmoticonPreviewModal",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];yt.gi.listen((function(n){void 0===e&&(e=t?new yt.nz:new yt.cv),e.initAndShow(n)}))}},{key:"bindFollowingIcons",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=e?"broadcasters":"room_list",n=document.querySelector("#".concat(t)),i=document.querySelector("div.icon_not_following"),o=document.querySelector("div.icon_following");null===n||null===i&&null===o||new bt.T(void 0===this.context.loggedInUser,t,e)}},{key:"bindAdvancedSearchOptions",value:function(e){return new r.Ld(e)}},{key:"bindTokenCountUpdater",value:function(){var e,t=null===(e=I.J.current.loggedInUser)||void 0===e?void 0:e.userUid;void 0!==t&&new Ie.IH(t).onMessage.listen((function(e){a.A3.fire(e)})),a.A3.listen((function(e){(0,gt.f_)(e.tokens)}))}},{key:"updateFlashMessageDisplay",value:function(){var e=document.querySelector(".flash-message-container");null!==e&&0===e.querySelectorAll(".message p").length&&(e.style.display="none")}},{key:"setUserInteractive",value:function(){var e;(0,It.L)("PushStaffNrmlUser")&&this.context.isInternal&&!0===(null===(e=this.context.loggedInUser)||void 0===e?void 0:e.isStaff)&&(this.context.isNoninteractiveUser=!0)}}]),e}();Mt(At)},4487:function(e,t,n){"use strict";(0,n(5896).j)()},569:function(){"use strict";window.PRODUCTION=!0,window.CHATURBATE_URL_PREFIX="/",window.STATIC_URL_ROOT="https://static-assets.highwebmedia.com/",window.STATIC_URL_MOBILE="https://static-assets.highwebmedia.com/mobileassets/",window.STATIC_URL="https://static-assets.highwebmedia.com/tsdefaultassets/"},4585:function(e,t,n){var i=n(3593);window.debug=i.debug,window.info=i.info,window.warn=i.warn,window.error=i.error}}]);