(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[410801,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.io=r.Socket=r.Manager=r.protocol=void 0;let s=e.r(1514),n=e.r(262423),o=e.r(504407)("socket.io-client");t.exports=r=a;let i=r.managers={};function a(e,t){let r;"object"==typeof e&&(t=e,e=void 0),t=t||{};let a=(0,s.url)(e,t.path||"/socket.io"),c=a.source,l=a.id,h=a.path,u=i[l]&&h in i[l].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||u?(o("ignoring socket cache for %s",c),r=new n.Manager(c,t)):(i[l]||(o("new io instance for %s",c),i[l]=new n.Manager(c,t)),r=i[l]),a.query&&!t.query&&(t.query=a.queryKey),r.socket(a.path,t)}r.io=a;var c=e.r(396717);Object.defineProperty(r,"protocol",{enumerable:!0,get:function(){return c.protocol}}),r.connect=a;var l=e.r(262423);Object.defineProperty(r,"Manager",{enumerable:!0,get:function(){return l.Manager}});var h=e.r(974119);Object.defineProperty(r,"Socket",{enumerable:!0,get:function(){return h.Socket}}),r.default=a},262423,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Manager=void 0;let s=e.r(816951),n=e.r(453020),o=e.r(974119),i=e.r(396717),a=e.r(588657),c=e.r(218876),l=e.r(23872),h=e.r(504407)("socket.io-client:manager");class u extends l.StrictEventEmitter{constructor(e,t){var r;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,(0,n.installTimerFunctions)(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(r=t.randomizationFactor)?r:.5),this.backoff=new c({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;let s=t.parser||i;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null==(t=this.backoff)||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null==(t=this.backoff)||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null==(t=this.backoff)||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(h("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;h("opening %s",this.uri),this.engine=s(this.uri,this.opts);let t=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;let n=(0,a.on)(t,"open",function(){r.onopen(),e&&e()}),o=(0,a.on)(t,"error",t=>{h("error"),r.cleanup(),r._readyState="closed",this.emitReserved("error",t),e?e(t):r.maybeReconnectOnOpen()});if(!1!==this._timeout){let e=this._timeout;h("connect attempt will timeout after %d",e),0===e&&n();let r=this.setTimeoutFn(()=>{h("connect attempt timed out after %d",e),n(),t.close(),t.emit("error",Error("timeout"))},e);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}return this.subs.push(n),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){h("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push((0,a.on)(e,"ping",this.onping.bind(this)),(0,a.on)(e,"data",this.ondata.bind(this)),(0,a.on)(e,"error",this.onerror.bind(this)),(0,a.on)(e,"close",this.onclose.bind(this)),(0,a.on)(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){this.decoder.add(e)}ondecoded(e){this.emitReserved("packet",e)}onerror(e){h("error",e),this.emitReserved("error",e)}socket(e,t){let r=this.nsps[e];return r||(r=new o.Socket(this,e,t),this.nsps[e]=r),r}_destroy(e){for(let e of Object.keys(this.nsps))if(this.nsps[e].active)return void h("socket %s is still active, skipping close",e);this._close()}_packet(e){h("writing packet %j",e);let t=this.encoder.encode(e);for(let r=0;re()),this.subs.length=0,this.decoder.destroy()}_close(){h("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,"opening"===this._readyState&&this.cleanup(),this.backoff.reset(),this._readyState="closed",this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e){h("onclose"),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)h("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();h("will wait %dms before reconnect attempt",t),this._reconnecting=!0;let r=this.setTimeoutFn(()=>{e.skipReconnect||(h("attempting reconnect"),this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(t=>{t?(h("reconnect attempt error"),e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):(h("reconnect success"),e.onreconnect())}))},t);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}r.Manager=u},588657,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.on=void 0,r.on=function(e,t,r){return e.on(t,r),function(){e.off(t,r)}}},974119,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Socket=void 0;let s=e.r(396717),n=e.r(588657),o=e.r(23872),i=e.r(504407)("socket.io-client:socket"),a=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class c extends o.StrictEventEmitter{constructor(e,t,r){super(),this.connected=!1,this.disconnected=!0,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}subEvents(){if(this.subs)return;let e=this.io;this.subs=[(0,n.on)(e,"open",this.onopen.bind(this)),(0,n.on)(e,"packet",this.onpacket.bind(this)),(0,n.on)(e,"error",this.onerror.bind(this)),(0,n.on)(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(a.hasOwnProperty(e))throw Error('"'+e+'" is a reserved event name');t.unshift(e);let r={type:s.PacketType.EVENT,data:t};r.options={},r.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(i("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),r.id=this.ids++);let n=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return!this.flags.volatile||n&&this.connected?this.connected?this.packet(r):this.sendBuffer.push(r):i("discard packet as the transport is not currently writable"),this.flags={},this}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){i("transport is open - connecting"),"function"==typeof this.auth?this.auth(e=>{this.packet({type:s.PacketType.CONNECT,data:e})}):this.packet({type:s.PacketType.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e){i("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emitReserved("disconnect",e)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case s.PacketType.CONNECT:if(e.data&&e.data.sid){let t=e.data.sid;this.onconnect(t)}else this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case s.PacketType.EVENT:case s.PacketType.BINARY_EVENT:this.onevent(e);break;case s.PacketType.ACK:case s.PacketType.BINARY_ACK:this.onack(e);break;case s.PacketType.DISCONNECT:this.ondisconnect();break;case s.PacketType.CONNECT_ERROR:let t=Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){let t=e.data||[];i("emitting event %j",t),null!=e.id&&(i("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length)for(let t of this._anyListeners.slice())t.apply(this,e);super.emit.apply(this,e)}ack(e){let t=this,r=!1;return function(...n){r||(r=!0,i("sending ack %j",n),t.packet({type:s.PacketType.ACK,id:e,data:n}))}}onack(e){let t=this.acks[e.id];"function"==typeof t?(i("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):i("bad ack %s",e.id)}onconnect(e){i("socket connected with id %s",e),this.id=e,this.connected=!0,this.disconnected=!1,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>this.packet(e)),this.sendBuffer=[]}ondisconnect(){i("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(i("performing disconnect (%s)",this.nsp),this.packet({type:s.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let r=0;r{Object.defineProperty(r,"__esModule",{value:!0}),r.StrictEventEmitter=void 0;let s=e.r(314205);r.StrictEventEmitter=class extends s{on(e,t){return super.on(e,t),this}once(e,t){return super.once(e,t),this}emit(e,...t){return super.emit(e,...t),this}emitReserved(e,...t){return super.emit(e,...t),this}listeners(e){return super.listeners(e)}}},1514,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.url=void 0;let s=e.r(673954),n=e.r(504407)("socket.io-client:url");r.url=function(e,t="",r){let o=e;r=r||"u">typeof location&&location,null==e&&(e=r.protocol+"//"+r.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?r.protocol+e:r.host+e),/^(https?|wss?):\/\//.test(e)||(n("protocol-less url %s",e),e=void 0!==r?r.protocol+"//"+e:"https://"+e),n("parse %s",e),o=s(e)),!o.port&&(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";let i=-1!==o.host.indexOf(":")?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+i+":"+o.port+t,o.href=o.protocol+"://"+i+(r&&r.port===o.port?"":":"+o.port),o}},370433,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.reconstructPacket=r.deconstructPacket=void 0;let s=e.r(631497);r.deconstructPacket=function(e){let t=[],r=e.data;return e.data=function e(t,r){if(!t)return t;if(s.isBinary(t)){let e={_placeholder:!0,num:r.length};return r.push(t),e}if(Array.isArray(t)){let s=Array(t.length);for(let n=0;n{var s,n;Object.defineProperty(r,"__esModule",{value:!0}),r.Decoder=r.Encoder=r.PacketType=r.protocol=void 0;let o=e.r(314205),i=e.r(370433),a=e.r(631497),c=e.r(11955)("socket.io-parser");r.protocol=5,(n=s=r.PacketType||(r.PacketType={}))[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK",r.Encoder=class{encode(e){return(c("encoding packet %j",e),(e.type===s.EVENT||e.type===s.ACK)&&a.hasBinary(e))?(e.type=e.type===s.EVENT?s.BINARY_EVENT:s.BINARY_ACK,this.encodeAsBinary(e)):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===s.BINARY_EVENT||e.type===s.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data)),c("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=i.deconstructPacket(e),r=this.encodeAsString(t.packet),s=t.buffers;return s.unshift(r),s}},r.Decoder=class e extends o{constructor(){super()}add(e){let t;if("string"==typeof e)(t=this.decodeString(e)).type===s.BINARY_EVENT||t.type===s.BINARY_ACK?(this.reconstructor=new l(t),0===t.attachments&&super.emit("decoded",t)):super.emit("decoded",t);else if(a.isBinary(e)||e.base64)if(this.reconstructor)(t=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,super.emit("decoded",t));else throw Error("got binary data when not reconstructing a packet");else throw Error("Unknown type: "+e)}decodeString(t){let r=0,n={type:Number(t.charAt(0))};if(void 0===s[n.type])throw Error("unknown packet type "+n.type);if(n.type===s.BINARY_EVENT||n.type===s.BINARY_ACK){let e=r+1;for(;"-"!==t.charAt(++r)&&r!=t.length;);let s=t.substring(e,r);if(s!=Number(s)||"-"!==t.charAt(r))throw Error("Illegal attachments");n.attachments=Number(s)}if("/"===t.charAt(r+1)){let e=r+1;for(;++r&&","!==t.charAt(r)&&r!==t.length;);n.nsp=t.substring(e,r)}else n.nsp="/";let o=t.charAt(r+1);if(""!==o&&Number(o)==o){let e=r+1;for(;++r;){let e=t.charAt(r);if(null==e||Number(e)!=e){--r;break}if(r===t.length)break}n.id=Number(t.substring(e,r+1))}if(t.charAt(++r)){let s=function(e){try{return JSON.parse(e)}catch(e){return!1}}(t.substr(r));if(e.isPayloadValid(n.type,s))n.data=s;else throw Error("invalid payload")}return c("decoded %s as %j",t,n),n}static isPayloadValid(e,t){switch(e){case s.CONNECT:return"object"==typeof t;case s.DISCONNECT:return void 0===t;case s.CONNECT_ERROR:return"string"==typeof t||"object"==typeof t;case s.EVENT:case s.BINARY_EVENT:return Array.isArray(t)&&t.length>0;case s.ACK:case s.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}};class l{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let e=i.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}},631497,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.hasBinary=r.isBinary=void 0;let s="function"==typeof ArrayBuffer,n=Object.prototype.toString,o="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===n.call(Blob),i="function"==typeof File||"u">typeof File&&"[object FileConstructor]"===n.call(File);function a(e){return s&&(e instanceof ArrayBuffer||("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer))||o&&e instanceof Blob||i&&e instanceof File}r.isBinary=a,r.hasBinary=function e(t,r){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let r=0,s=t.length;r{var s,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),o={},i=0,a=0;function c(e){var t="";do t=n[e%64]+t,e=Math.floor(e/64);while(e>0)return t}function l(){var e=c(+new Date);return e!==s?(i=0,s=e):e+"."+c(i++)}for(;a<64;a++)o[n[a]]=a;l.encode=c,l.decode=function(e){var t=0;for(a=0;a{var t=e.i(758568),r=e.i(90031);let s=Math.floor(new Date/1e3),n={event_title:"Không tìm thấy",event_description:"",event_status:"",event_start_date:s,event_end_date:s,attend_start_date:s,attend_end_date:s,links:{attend:"",permalink:""},location:{address:""},extra_data:{}};e.s(["f",0,(e,s)=>{let o=(0,r.default)(e,n);return{id:o.event_id||-1*s,title:o.event_title,description:o.event_description.replace(/\[.*?\]/g,""),link:(e=>{let{thread:r}=e.extra_data;return(0,t.default)(r,"links.permalink",e.links.permalink)})(o),status:o.event_status,time:{start:o.event_start_date,end:o.event_end_date},attend:{start:o.attend_start_date,end:o.attend_end_date,link:o.links.attend},location:o.location.address}}],911055);var o=e.i(391398),i=e.i(145246),a=e.i(191788);e.i(966278);var c=e.i(318398);let l=new String(".main.jsx-7cd7640dfca53a62{border:2px solid #e650b8;border-radius:8px;margin-top:12px;padding:1rem}.intro.jsx-7cd7640dfca53a62{margin-bottom:12px;font-size:1.2rem}@media (width<=700px){.imgDesktop.jsx-7cd7640dfca53a62{display:none}.imgMobile.jsx-7cd7640dfca53a62{max-width:100%;height:auto}}@media (width>=701px){.imgDesktop.jsx-7cd7640dfca53a62{max-width:100%;height:auto}.imgMobile.jsx-7cd7640dfca53a62{display:none}}");l.__hash="7cd7640dfca53a62";let h=c.f.ApiConsumer(({threadViewPromotion:e})=>(0,o.jsxs)("a",{href:e.url,className:`jsx-${l.__hash}`,children:[(0,o.jsxs)("div",{className:`jsx-${l.__hash} main`,children:[(0,o.jsx)("p",{className:`jsx-${l.__hash} intro`,children:e.title}),(0,o.jsx)("img",{src:e.desktopImgUrl,alt:"xxx",className:`jsx-${l.__hash} imgDesktop`}),(0,o.jsx)("img",{src:e.mobileImgUrl,alt:"xxx",className:`jsx-${l.__hash} imgMobile`})]}),(0,o.jsx)(i.default,{id:l.__hash,children:l})]}));e.s(["f",0,h],664346);var u=a,p=e.i(33989);let d={rating_comment:"",rating_score:0,content_id:0,content_type:"thread",user_id:0,created_at:0,updated_at:0,username:"",links:{avatar:""}},f=e=>{let t=(0,p.default)(e,d);return{comment:t.rating_comment,score:t.rating_score,contentId:e.content_id,contentType:e.content_type,user:{name:e.username,id:e.user_id,avatar:e.links.avatar},since:e.created_at}};var m=e.i(230184),g=e.i(418752);let b=new String(".ratingCommentContainer.jsx-2373ae143798037{display:flex}.rating.jsx-2373ae143798037{background-color:var(--color-post);border-radius:13px;width:100%;margin-bottom:18px;padding:1rem;position:relative}.avatar.jsx-2373ae143798037{border:1px solid var(--color-light-1);background-color:#1b6da8;background-position:50%;background-repeat:no-repeat;background-size:cover;border-radius:50%;width:40px;height:40px;margin-right:15px;position:relative}.info.jsx-2373ae143798037{align-items:center;display:flex}@media (width<=700px){.info.jsx-2373ae143798037{margin-bottom:8px}}@media (width>=701px){.info.jsx-2373ae143798037{margin-bottom:12px}}.username.jsx-2373ae143798037{color:var(--color-accent-dark);margin-right:12px;font-size:14px;font-weight:700}.since.jsx-2373ae143798037{color:var(--color-light-2);font-size:10px}@media (width<=700px){.since.mobile.jsx-2373ae143798037{margin-bottom:12px}.since.desktop.jsx-2373ae143798037{display:none}}@media (width>=701px){.since.mobile.jsx-2373ae143798037{display:none}.since.desktop.jsx-2373ae143798037{margin-left:6px}}.star.jsx-2373ae143798037{width:18px;margin-right:6px}");b.__hash="2373ae143798037";let y=c.f.ApiConsumer(({rating:e})=>(0,o.jsxs)("div",{className:`jsx-${b.__hash} ratingCommentContainer`,children:[(0,o.jsx)("div",{className:`jsx-${b.__hash}`,children:(0,o.jsx)("img",{src:e.user.avatar,alt:e.user.name,className:`jsx-${b.__hash} avatar`})}),(0,o.jsxs)("div",{className:`jsx-${b.__hash} rating`,children:[(0,o.jsxs)("div",{className:`jsx-${b.__hash} info`,children:[(0,o.jsx)("span",{className:`jsx-${b.__hash} username`,children:e.user.name}),(0,o.jsx)("span",{className:`jsx-${b.__hash}`,children:Array.from(Array(e.score).keys()).map(t=>(0,o.jsx)("img",{alt:e.user.name,src:g.default,className:`jsx-${b.__hash} star`},t))}),(0,o.jsx)("span",{className:`jsx-${b.__hash} since desktop`,children:(0,o.jsx)(m.f,{value:e.since})})]}),(0,o.jsx)("p",{className:`jsx-${b.__hash}`,children:e.comment}),(0,o.jsx)("span",{className:`jsx-${b.__hash} since mobile`,children:(0,o.jsx)(m.f,{value:e.since})})]}),(0,o.jsx)(i.default,{id:b.__hash,children:b})]}));var x=e.i(52697);let C=new String(".ratingTotal.jsx-310ad3e353e6d97a{font-weight:700}.ratingComments.jsx-310ad3e353e6d97a{margin:14px 0}.pagination.jsx-310ad3e353e6d97a{text-align:right;flex-flow:wrap;justify-content:space-between;align-items:center;display:flex}");C.__hash="310ad3e353e6d97a";class v extends u.default.Component{constructor(e){super(e),this.state={ratings:[],ratingTotal:0,pagesTotal:1,page:1,limit:20}}componentDidMount(){this.getThreadComments()}getThreadComments(){let{threadId:e,api:t}=this.props,{page:r,limit:s}=this.state;t.get({uri:"tinhte-rating",params:{content_id:e,content_type:"thread",page:r,limit:s,order:"created_at",direction:"desc"}}).then(e=>{console.log("rating",e);let t=e.ratings.map(f);this.setState({ratings:t,ratingTotal:e.total,pagesTotal:e.links?e.links.pages:1})}).catch(e=>console.error(e))}goToPage(e){this.setState({page:e},this.getThreadComments)}followTag(){let{api:e}=this.props,{tag:t}=this.state,r=`tags/${t.id}/followers`;t.isFollowed?e.del({uri:r}).then(e=>{"ok"===e.status&&(t.isFollowed=!1,this.setState({tag:t}))}).catch(e=>console.error(e)):e.post({uri:r,params:{alert:0}}).then(e=>{"ok"===e.status&&(t.isFollowed=!0,this.setState({tag:t}))}).catch(e=>console.error(e))}render(){let{ratings:e,ratingTotal:t,pagesTotal:r,page:s}=this.state;return t?(0,o.jsxs)("div",{className:`jsx-${C.__hash}`,children:[r>1&&(0,o.jsx)("div",{className:`jsx-${C.__hash} pagination`,children:(0,o.jsx)(x.f,{currentPage:s,pages:r,onSelected:e=>this.goToPage(e)})}),(0,o.jsx)("div",{className:`jsx-${C.__hash} ratingComments`,children:e.map(e=>(0,o.jsx)("div",{className:`jsx-${C.__hash} ratingContainer`,children:(0,o.jsx)(y,{rating:e})},e.user.id))}),r>1&&(0,o.jsx)("div",{className:`jsx-${C.__hash} pagination`,children:(0,o.jsx)(x.f,{currentPage:s,pages:r,onSelected:e=>this.goToPage(e)})}),(0,o.jsx)(i.default,{id:C.__hash,children:C})]}):(0,o.jsx)("div",{children:(0,o.jsx)("h3",{children:"Chưa có đánh giá nào..."})})}}let _=c.f.ApiConsumer(v);e.s(["f",0,_],888858);var w=e.i(501584);let k=new String(".select-container.jsx-e972f3f5031fb0d2{margin-bottom:12px}@media (width>=768px){.select-container.jsx-e972f3f5031fb0d2{margin-top:12px;margin-bottom:24px}}.header.jsx-e972f3f5031fb0d2{color:var(--primary-text);margin-bottom:12px;font-size:16px;font-weight:600}.header.not-set.jsx-e972f3f5031fb0d2{color:var(--active-indicator-red)}.save-success.jsx-e972f3f5031fb0d2{color:var(--active-indicator);font-size:12px}.options.jsx-e972f3f5031fb0d2{flex-flow:wrap;justify-content:flex-start;align-items:center;display:flex}.option.jsx-e972f3f5031fb0d2{width:25%;color:var(--primary-text);flex-direction:row;justify-content:flex-start;align-items:center;margin-bottom:10px;display:flex}.option.jsx-e972f3f5031fb0d2 .icon.jsx-e972f3f5031fb0d2{margin-right:5px}.option.jsx-e972f3f5031fb0d2 .icon.selected.jsx-e972f3f5031fb0d2{color:var(--color-accent-dark)}");k.__hash="e972f3f5031fb0d2";let j=(0,w.f)(c.f.ApiConsumer(({forumId:e,threadId:t,thread:r,api:s,onSelected:n})=>{let[c,l]=(0,a.useState)([]),[h,u]=(0,a.useState)(null),[p,d]=(0,a.useState)(!1),f=()=>{r&&r.prefixes&&r.prefixes.length>0&&u({value:r.prefixes[0].prefix_id,label:r.prefixes[0].prefix_title})},m=e=>e&&h&&e.value===h.value;return(0,a.useEffect)(()=>{s.get(`forums/${e}`).then(e=>{let t=e.forum.forum_prefixes,r=null;t.forEach(e=>{"Phân loại"===e.group_title&&(r=e.group_prefixes)}),l(r.map(e=>({value:e.prefix_id,label:e.prefix_title})))}).catch(e=>{console.error("Fetching prefixes error: ",e)}),f()},[]),(0,a.useEffect)(()=>{f()},[r]),(0,o.jsxs)("div",{className:`jsx-${k.__hash} select-container`,children:[(0,o.jsx)("div",{className:`jsx-${k.__hash} options`,children:c.map(e=>(0,o.jsxs)("button",{onClick:()=>(e=>{if(!e)return;u(e);let r=e.value;s.put({uri:`threads/${t}`,params:{thread_prefix_id:r}}).then(()=>{d(!0),n&&n(e)}).catch(e=>{console.error("Setting prefix error: ",e)})})(e),className:`jsx-${k.__hash} option ${m(e)?"selected":""}`,children:[(0,o.jsx)("i",{className:`jsx-${k.__hash} icon ${m(e)?"selected fas fa-dot-circle":"far fa-circle"}`}),e.label]}))}),p&&(0,o.jsx)("div",{className:`jsx-${k.__hash}`,children:(0,o.jsx)("span",{className:`jsx-${k.__hash} save-success`,children:"Lưu thành công!"})}),(0,o.jsx)(i.default,{id:k.__hash,children:k})]})}),{errorMsg:"Lỗi: Không lấy được prefix"});e.s(["f",0,j],19012);var F=a,T=e.i(565715),N=e.i(45381),E=e.i(842719);let S=new String(`.rating-container.jsx-b926432e959eb0ea{display:flex}.ratingControls.jsx-b926432e959eb0ea{justify-content:center;align-items:center;width:100%;display:flex}.vote-thread.jsx-b926432e959eb0ea{color:var(--text-light-2);margin-right:10px;font-size:16px}.voted-thread.jsx-b926432e959eb0ea{font-size:16px;font-weight:600}.threadRatingTopIcon.jsx-b926432e959eb0ea{border-top-left-radius:12.5px;border-bottom-left-radius:12.5px;display:block}@media (width<=767px){.threadRatingTopIcon.jsx-b926432e959eb0ea{width:140px;height:110px}}@media (width>=768px){.threadRatingTopIcon.jsx-b926432e959eb0ea{width:180px;height:130px}}@media (width<=767px){.threadRatingTopIconContainer.selected.jsx-b926432e959eb0ea{display:none}}.user.jsx-b926432e959eb0ea{justify-content:flex-start;padding:12px;display:flex}.avatar.jsx-b926432e959eb0ea{background-color:var(--color-dark-2);border-radius:50%;margin-right:12px}@media (width<=767px){.avatar.jsx-b926432e959eb0ea{width:32px;height:32px}}@media (width>=768px){.avatar.jsx-b926432e959eb0ea{width:48px;height:48px}}.introHello.jsx-b926432e959eb0ea{color:var(--color-mod-badge-main);font-size:.95rem;font-weight:700}.introText.jsx-b926432e959eb0ea{color:var(--color-mod-badge-main);font-size:.9rem}.stars.jsx-b926432e959eb0ea{justify-content:flex-start;align-items:flex-start;padding:0}.stars.selected.jsx-b926432e959eb0ea{padding-top:12px}@media (width<=767px){.stars.jsx-b926432e959eb0ea{display:flex}}@media (width>=768px){.stars.jsx-b926432e959eb0ea{display:flex}}.starsContainer.jsx-b926432e959eb0ea{display:flex}.rate.jsx-b926432e959eb0ea i.jsx-b926432e959eb0ea,.rate.jsx-b926432e959eb0ea i.jsx-b926432e959eb0ea:hover~i.jsx-b926432e959eb0ea{background-image:url(${E.default});background-position:top;background-repeat:no-repeat;background-size:36px;width:40px;height:40px;padding:0 4px}.rate.jsx-b926432e959eb0ea:hover i.jsx-b926432e959eb0ea{background-image:url(${N.default})}.rate.jsx-b926432e959eb0ea:hover i.jsx-b926432e959eb0ea svg,.rate.jsx-b926432e959eb0ea i.jsx-b926432e959eb0ea:hover svg{visibility:hidden}.rate.jsx-b926432e959eb0ea i.jsx-b926432e959eb0ea{cursor:pointer;font-style:normal}.selectedStarText.jsx-b926432e959eb0ea{color:var(--color-mod-badge-main);margin-right:6px;font-weight:700}.ratingCommentContainer.jsx-b926432e959eb0ea{background-color:var(--color-light-0);border-radius:6px;margin:0 12px 12px;padding:4px}.rating-comment{width:100%;height:73px;padding:6px 12px}.rating-comment::-webkit-resizer{background-color:#0000}.rating-comment:focus{outline:none}.submitRatingButtonContainer.jsx-b926432e959eb0ea{justify-content:flex-end;align-items:center;width:100%;display:flex}.submitRatingButton.jsx-b926432e959eb0ea{background-color:var(--color-light-2);color:var(--color-light-0);border-radius:4px;padding:4px 16px;font-weight:700}.submitRatingButton.canSubmit.jsx-b926432e959eb0ea{background-color:var(--color-accent-dark)}.error.jsx-b926432e959eb0ea{color:var(--color-warning-soft);margin-left:12px;margin-right:12px;font-size:12px;font-weight:700}.tooltip.jsx-b926432e959eb0ea{display:inline-block;position:relative}.tooltip.jsx-b926432e959eb0ea .tooltiptext.jsx-b926432e959eb0ea{visibility:hidden;background-color:var(--color-rating-tooltip-background);width:100px;color:var(--color-dark-1);text-align:center;z-index:1;border-radius:24px;padding:4px 0;font-size:.8rem;font-weight:700;position:absolute;box-shadow:0 1px 4px #66626266}.tooltip.jsx-b926432e959eb0ea:hover .tooltiptext.jsx-b926432e959eb0ea{visibility:visible;margin-left:-60px;top:100%;left:50%}`);S.__hash="b926432e959eb0ea";let A=[{level:1,text:"Rất dở"},{level:2,text:"Dở"},{level:3,text:"Bình thường"},{level:4,text:"Hay"},{level:5,text:"Cực hay"}];class B extends F.default.Component{constructor(e){super(e),this.state={user:null,selectedStar:0,submitRatingSuccess:!1}}componentDidMount(){this.getUserProfile()}getUserProfile(){let{api:e}=this.props;e&&e.onAuthenticated(()=>{e.get("users/me").then(e=>{let t=(0,T.U)(e.user||{});this.setState({user:t})},()=>{})})}submitRating(e){let{api:t,threadId:r}=this.props;t.post({uri:"tinhte-rating",params:{content_id:r,content_type:"thread",rating_score:e,rating_comment:""}}).then(e=>{"ok"===e.status&&this.setState({submitRatingSuccess:!0})})}render(){let{user:e,selectedStar:t,submitRatingSuccess:r}=this.state;return(0,o.jsxs)("div",{className:`jsx-${S.__hash} rating-container`,children:[(0,o.jsx)("div",{className:`jsx-${S.__hash} ratingControls`,children:e&&(0,o.jsx)(F.Fragment,{children:r?(0,o.jsx)(F.Fragment,{children:(0,o.jsx)("p",{className:`jsx-${S.__hash} voted-thread`,children:"Cảm ơn phản hồi của bạn!"})}):(0,o.jsxs)(F.Fragment,{children:[(0,o.jsx)("p",{className:`jsx-${S.__hash} vote-thread`,children:"Xếp hạng bài viết:"}),(0,o.jsx)("div",{className:`jsx-${S.__hash} stars ${t?"selected":""}`,children:(0,o.jsx)("div",{className:`jsx-${S.__hash} starsContainer rate`,children:A.map(e=>(0,o.jsx)("i",{role:"presentation",onClick:()=>this.submitRating(e.level),onKeyDown:()=>this.submitRating(e.level),className:`jsx-${S.__hash}`},`${e.level}-star`))})})]})})}),(0,o.jsx)(i.default,{id:S.__hash,children:S})]})}}let M=c.f.ApiConsumer(B);e.s(["f",0,M],305646);let O=new String(".follow-button.jsx-b548ba3f2c986c4c{color:var(--text-light-1);background-color:var(--button-high-contrast);border-radius:12px;margin-left:12px;padding:3px 12px;font-size:12px}.follow-button.following.jsx-b548ba3f2c986c4c{color:var(--text-light-2);background-color:var(--color-light-1)}");O.__hash="b548ba3f2c986c4c";let P=c.f.ApiConsumer(({api:e,userToFollow:t})=>{let[r,s]=(0,a.useState)(0),[n,c]=(0,a.useState)(t.isFollowed||!1);return((0,a.useEffect)(()=>{c(t.isFollowed),e&&e.onAuthenticated(()=>{s(e.getUserId())})},[t.isFollowed]),r&&r===t.id)?null:(0,o.jsxs)("div",{className:`jsx-${O.__hash} follow-button-container`,children:[(0,o.jsx)("button",{onClick:()=>{if(e){let r=`/users/${t.id}/followers`,s="post";n&&(s="del"),e[s]({uri:r}).then(e=>{console.log(e),"post"===s?c(!0):c(!1)})}},className:`jsx-${O.__hash} follow-button ${n&&"following"}`,children:n?"Theo dõi":"+ Theo dõi"}),(0,o.jsx)(i.default,{id:O.__hash,children:O})]})});e.s(["f",0,P],488335),e.s(["f",0,t=>{if(t){let r=e.g.$(t)&&e.g.$(t).offset()&&e.g.$(t).offset().top?e.g.$(t).offset().top:0;e.g.$("html, body").animate({scrollTop:r-50},800)}return!1}],799338);var $=a;let R=new String(".rating-header.jsx-203e719946ac1fec{flex-flow:column wrap;justify-content:center;align-items:center;display:flex}.title.jsx-203e719946ac1fec{font-size:1.4rem}.subtitle.jsx-203e719946ac1fec{margin:12px;font-size:1.4rem}.current-question.jsx-203e719946ac1fec{color:var(--color-accent-dark)}.answer-container.jsx-203e719946ac1fec{flex-wrap:wrap;justify-content:center;align-items:center;display:flex}.answer.jsx-203e719946ac1fec{background-color:var(--color-dark-1);width:43%;color:var(--color-light-0);border-radius:6px;margin:12px;padding:24px 32px;font-size:1.4rem;font-weight:700}.answer.jsx-203e719946ac1fec:hover{background-color:var(--color-accent-dark)}");R.__hash="203e719946ac1fec";class L extends $.default.Component{constructor(e){super(e),this.state={currentQuestion:1}}submitAnswer(e){let{api:t,threadId:r}=this.props,{currentQuestion:s}=this.state,n=`${s}: ${e}`;t.post({uri:"posts",params:{thread_id:r,post_body:n}}).then(e=>{e.post&&this.setState({currentQuestion:s+1})})}render(){let{currentQuestion:e}=this.state,{numberOfQuestion:t}=this.props;return t?(0,o.jsxs)("div",{className:`jsx-${R.__hash} rating-container`,children:[(0,o.jsxs)("div",{className:`jsx-${R.__hash}`,children:[(0,o.jsxs)("div",{className:`jsx-${R.__hash} rating-header`,children:[(0,o.jsx)("h4",{className:`jsx-${R.__hash} title`,children:"Chọn câu trả lời đúng"}),(0,o.jsx)("p",{className:`jsx-${R.__hash}`,children:"Bạn đừng refresh trang sẽ mất câu trả lời đấy nhé :D"}),e<=t&&(0,o.jsxs)("p",{className:`jsx-${R.__hash} subtitle`,children:["Câu số ",(0,o.jsx)("b",{className:`jsx-${R.__hash} current-question`,children:e})," / ",(0,o.jsx)("b",{className:`jsx-${R.__hash}`,children:t})]})]}),e<=t?(0,o.jsx)("div",{className:`jsx-${R.__hash} answer-container`,children:["A","B","C","D"].map(e=>(0,o.jsx)("button",{onClick:()=>this.submitAnswer(e),className:`jsx-${R.__hash} answer`,children:e},e))}):(0,o.jsx)("div",{className:`jsx-${R.__hash} rating-header`,children:(0,o.jsx)("div",{className:`jsx-${R.__hash} subtitle`,children:"Game đã kết thúc"})})]}),(0,o.jsx)(i.default,{id:R.__hash,children:R})]}):(0,o.jsx)("p",{children:"Chưa set số lượng câu hỏi"})}}let D=c.f.ApiConsumer(L);e.s(["f",0,D],802653);let I=new String(".error-illustration.jsx-c40d89f378f3fa73{text-align:center;padding:50px 20px}.message.jsx-c40d89f378f3fa73{text-transform:uppercase;margin:30px 0 0}");I.__hash="c40d89f378f3fa73",e.s(["f",0,({message:e})=>{let t=null;return t="Không thể tìm thấy chủ đề này."===e.trim()?(0,o.jsx)("img",{src:"/static/images/Error404.png",alt:"404-error",width:"600"}):null,(0,o.jsxs)("div",{className:`jsx-${I.__hash} error-illustration`,children:[t&&t,e&&(0,o.jsx)("p",{className:`jsx-${I.__hash} message`,children:e}),(0,o.jsx)(i.default,{id:I.__hash,children:I})]})}],376422);var z=a;class q extends z.default.Component{componentDidMount(){let{adsId:e}=this.props;(window.arfAsync=window.arfAsync||[]).push(e)}render(){let{adsId:e,mobileOnly:t,desktopOnly:r,minHeight:s,minWidth:n,width:i,height:a}=this.props;return(0,o.jsxs)("div",{className:`micro ${t?"visible-xs":""} ${r?"hidden-xs":""}`,style:{minHeight:s,minWidth:n,width:i,height:a},children:[(0,o.jsx)("div",{children:(0,o.jsx)("ins",{"data-rfp-adspot-id":e,style:{display:"none"}})}),(0,o.jsx)("script",{src:"https://js.rfp.fout.jp/rfp-infeed.js"}),(0,o.jsx)("script",{dangerouslySetInnerHTML:{__html:` RFP.InFeed.Default.lazyLoading() `}})]})}}let Y=(0,w.f)(q,{errorMsg:"Lỗi freakout"});e.s(["f",0,Y],733191);var U=e.i(587388);let H=new String(".message-button.jsx-611e44b48ac3382b>.label.jsx-611e44b48ac3382b{margin-left:3px;font-weight:500}.message-button.jsx-611e44b48ac3382b>*{vertical-align:middle;display:inline-block}.youtube-wrapper.jsx-611e44b48ac3382b{height:0;padding-bottom:56.25%;position:relative}.youtube-wrapper.jsx-611e44b48ac3382b iframe.jsx-611e44b48ac3382b{width:100%;height:100%;position:absolute;top:0;left:0}");H.__hash="611e44b48ac3382b",e.s(["f",0,({livestream:e})=>{let t=Math.floor(Date.now()/1e3),r="";return e.youtube&&(r=e.youtube.split("?v=")[1]),(0,o.jsxs)("div",{className:`jsx-${H.__hash}`,children:[t>e.end&&e.youtube?(0,o.jsx)("div",{className:`jsx-${H.__hash} youtube-wrapper`,children:(0,o.jsx)("iframe",{width:"560",height:"315",src:`https://www.youtube.com/embed/${r}`,title:"YouTube video player",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:`jsx-${H.__hash}`})}):(0,o.jsx)(U.f,{controls:!0,sources:[{src:e.manifestUrl}],poster:e.thumbnail}),(0,o.jsx)(i.default,{id:H.__hash,children:H})]})}],937712);var K=e.i(410801);K.default.Manager,K.default.Socket,K.default,e.s([],974968),e.s(["io",()=>K.default],798591);let V=e=>({id:parseInt((0,t.default)(e,"post_id",null),10),body:(0,t.default)(e,"post_body",null),createDate:(0,t.default)(e,"post_create_date",null),author:{id:(0,t.default)(e,"post_user_id",null)||(0,t.default)(e,"poster_user_id",null),name:(0,t.default)(e,"poster_username",null),avatar:(0,t.default)(e,"links.poster_avatar","https://tinhte.vn/styles/uiflex/xenforo/avatars/avatar_l.png")},thread:{id:(0,t.default)(e,"thread_id",null)}});e.s(["o",0,V,"Q",0,e=>({posts:(0,t.default)(e,"posts",[]).map(V),postTotal:(0,t.default)(e,"posts_total",null),pagination:{next:(0,t.default)(e,"links.next"),page:(0,t.default)(e,"links.page"),pages:(0,t.default)(e,"links.pages")}})],328515)}],218876,(e,t,r)=>{function s(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}t.exports=s,s.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=(1&Math.floor(10*t))==0?e-r:e+r}return 0|Math.min(e,this.max)},s.prototype.reset=function(){this.attempts=0},s.prototype.setMin=function(e){this.ms=e},s.prototype.setMax=function(e){this.max=e},s.prototype.setJitter=function(e){this.jitter=e}},149790,(e,t,r)=>{!function(e){"use strict";r.encode=function(t){var r,s=new Uint8Array(t),n=s.length,o="";for(r=0;r>2],o+=e[(3&s[r])<<4|s[r+1]>>4],o+=e[(15&s[r+1])<<2|s[r+2]>>6],o+=e[63&s[r+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o},r.decode=function(t){var r,s,n,o,i,a=.75*t.length,c=t.length,l=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var h=new ArrayBuffer(a),u=new Uint8Array(h);for(r=0;r>4,u[l++]=(15&n)<<4|o>>2,u[l++]=(3&o)<<6|63&i;return h}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},314205,(e,t,r)=>{function s(e){if(e){var t=e;for(var r in s.prototype)t[r]=s.prototype[r];return t}}t.exports=s,s.prototype.on=s.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},s.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},s.prototype.off=s.prototype.removeListener=s.prototype.removeAllListeners=s.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,s=this._callbacks["$"+e];if(!s)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var n=0;n{t.exports="u">typeof self?self:"u">typeof window?window:Function("return this")()},816951,(e,t,r)=>{let s=e.r(520741);t.exports=(e,t)=>new s(e,t),t.exports.Socket=s,t.exports.protocol=s.protocol,t.exports.Transport=e.r(292699),t.exports.transports=e.r(507508),t.exports.parser=e.r(950034)},520741,(e,t,r)=>{let s=e.r(507508),n=e.r(314205),o=e.r(509710)("engine.io-client:socket"),i=e.r(950034),a=e.r(673954),c=e.r(266687),{installTimerFunctions:l}=e.r(453020);class h extends n{constructor(e,t={}){super(),e&&"object"==typeof e&&(t=e,e=null),e?(e=a(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=a(t.host).host),l(this,t),this.secure=null!=t.secure?t.secure:"u">typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("u">typeof location?location.hostname:"localhost"),this.port=t.port||("u">typeof location&&location.port?location.port:this.secure?443:80),this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,jsonp:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"==typeof this.opts.query&&(this.opts.query=c.decode(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!1),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close")},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){o('creating transport "%s"',e);let t=function(e){let t={};for(let r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}(this.opts.query);t.EIO=i.protocol,t.transport=e,this.id&&(t.sid=this.id);let r=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return o("options: %j",r),new s[e](r)}open(){let e;if(this.opts.rememberUpgrade&&h.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emit("error","No transports available")},0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){o("error while creating transport: %s",e),this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){o("setting transport %s",e.name),this.transport&&(o("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",()=>{this.onClose("transport close")})}probe(e){o('probing transport "%s"',e);let t=this.createTransport(e,{probe:1}),r=!1;h.priorWebsocketSuccess=!1;let s=()=>{r||(o('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",s=>{if(!r)if("pong"===s.type&&"probe"===s.data){if(o('probe transport "%s" pong',e),this.upgrading=!0,this.emit("upgrading",t),!t)return;h.priorWebsocketSuccess="websocket"===t.name,o('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{r||"closed"!==this.readyState&&(o("changing transport and sending upgrade packet"),u(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emit("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{o('probe transport "%s" failed',e);let r=Error("probe error");r.transport=t.name,this.emit("upgradeError",r)}}))};function n(){r||(r=!0,u(),t.close(),t=null)}let i=r=>{let s=Error("probe error: "+r);s.transport=t.name,n(),o('probe transport "%s" failed because of error: %s',e,r),this.emit("upgradeError",s)};function a(){i("transport closed")}function c(){i("socket closed")}function l(e){t&&e.name!==t.name&&(o('"%s" works - aborting "%s"',e.name,t.name),n())}let u=()=>{t.removeListener("open",s),t.removeListener("error",i),t.removeListener("close",a),this.removeListener("close",c),this.removeListener("upgrading",l)};t.once("open",s),t.once("error",i),t.once("close",a),this.once("close",c),this.once("upgrading",l),t.open()}onOpen(){if(o("socket open"),this.readyState="open",h.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){o("starting upgrade probes");let e=0,t=this.upgrades.length;for(;e{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()}flush(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(o("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))}write(e,t,r){return this.sendPacket("message",e,t,r),this}send(e,t,r){return this.sendPacket("message",e,t,r),this}sendPacket(e,t,r,s){if("function"==typeof t&&(s=t,t=void 0),"function"==typeof r&&(s=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;let n={type:e,data:t,options:r};this.emit("packetCreate",n),this.writeBuffer.push(n),s&&this.once("flush",s),this.flush()}close(){let e=()=>{this.onClose("forced close"),o("socket closing - telling transport to close"),this.transport.close()},t=()=>{this.removeListener("upgrade",t),this.removeListener("upgradeError",t),e()},r=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}onError(e){o("socket error %j",e),h.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)}onClose(e,t){("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)&&(o('socket close with reason: "%s"',e),this.clearTimeoutFn(this.pingIntervalTimer),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){let t=[],r=0,s=e.length;for(;r{let s=e.r(950034),n=e.r(314205),{installTimerFunctions:o}=e.r(453020),i=e.r(509710)("engine.io-client:transport");t.exports=class extends n{constructor(e){super(),o(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,t){let r=Error(e);return r.type="TransportError",r.description=t,this.emit("error",r),this}open(){return("closed"===this.readyState||""===this.readyState)&&(this.readyState="opening",this.doOpen()),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState?this.write(e):i("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,this.emit("open")}onData(e){let t=s.decodePacket(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){this.emit("packet",e)}onClose(){this.readyState="closed",this.emit("close")}}},507508,(e,t,r)=>{let s=e.r(894506),n=e.r(202491),o=e.r(928289),i=e.r(65024);r.polling=function(e){let t=!1,r=!1,i=!1!==e.jsonp;if("u">typeof location){let s="https:"===location.protocol,n=location.port;n||(n=s?443:80),t=e.hostname!==location.hostname||n!==e.port,r=e.secure!==s}if(e.xdomain=t,e.xscheme=r,"open"in new s(e)&&!e.forceJSONP)return new n(e);if(!i)throw Error("JSONP disabled");return new o(e)},r.websocket=i},928289,(e,t,r)=>{let s,n=e.r(832121),o=e.r(748228),i=/\n/g,a=/\\n/g;t.exports=class extends n{constructor(e){super(e),this.query=this.query||{},s||(s=o.___eio=o.___eio||[]),this.index=s.length,s.push(this.onData.bind(this)),this.query.j=this.index}get supportsBinary(){return!1}doClose(){this.script&&(this.script.onerror=()=>{},this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),super.doClose()}doPoll(){let e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=e=>{this.onError("jsonp poll error",e)};let t=document.getElementsByTagName("script")[0];t?t.parentNode.insertBefore(e,t):(document.head||document.body).appendChild(e),this.script=e,"u">typeof navigator&&/gecko/i.test(navigator.userAgent)&&this.setTimeoutFn(function(){let e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)},100)}doWrite(e,t){let r;if(!this.form){let e=document.createElement("form"),t=document.createElement("textarea"),r=this.iframeId="eio_iframe_"+this.index;e.className="socketio",e.style.position="absolute",e.style.top="-1000px",e.style.left="-1000px",e.target=r,e.method="POST",e.setAttribute("accept-charset","utf-8"),t.name="d",e.appendChild(t),document.body.appendChild(e),this.form=e,this.area=t}function s(){n(),t()}this.form.action=this.uri();let n=()=>{if(this.iframe)try{this.form.removeChild(this.iframe)}catch(e){this.onError("jsonp polling iframe removal error",e)}try{let e='