This repository has been archived on 2026-02-28. You can view files and clone it, but cannot push or open issues or pull requests.
ServerSpacebarOld/assets/public/client/ab1ce7821b551424c922.js
2025-12-08 18:44:58 +02:00

2282 lines
2.1 MiB
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(this.webpackChunkdiscord_app=this.webpackChunkdiscord_app||[]).push([[59859,28562,86502,77357,64045],{145911:(e,t,n)=>{e.exports=n.p+"e92599c3548209f77ec833c649f8939a.svg"},697694:(e,t,n)=>{e.exports=n.p+"87f8416faec0691b96525d0bb3027809.svg"},108881:(e,t,n)=>{e.exports=n.p+"750fe6bb60bf9451ab9ad9a0b6eabbbc.svg"},761869:(e,t,n)=>{e.exports=n.p+"481f8332b80859990fb464dbe288295e.svg"},884217:(e,t,n)=>{e.exports=n.p+"c19657ec8ccb7b12e610ab71d457bfd6.png"},921912:(e,t,n)=>{e.exports=n.p+"350e1c6739823620f031d023a48ac9d4.svg"},964766:(e,t,n)=>{e.exports=n.p+"3123277eb2e7083fde983985dcd209a6.svg"},3874:(e,t,n)=>{e.exports=n.p+"c115d59ca13c0f942965a82a0f05bf01.svg"},302255:(e,t,n)=>{e.exports=n.p+"ad530d02033b87bb89752f915c2fbe3c.svg"},117399:(e,t,n)=>{e.exports=n.p+"f1e026332f1d6e902bcbbc07892bc849.svg"},408056:(e,t,n)=>{e.exports=n.p+"fd65da49c3073002049383baeb24e658.svg"},498913:(e,t,n)=>{e.exports=n.p+"beec347635d7597215747fcaf461e569.svg"},598150:(e,t,n)=>{
e.exports=n.p+"9581653a5a4d0b7b56187044a9db301a.svg"},656470:(e,t,n)=>{e.exports=n.p+"12d9bda733d6432d605e8011c22c3e56.svg"},789885:(e,t,n)=>{e.exports=n.p+"8de4b17bb44ad5ef9f21f2f6f16aa8d1.svg"},492623:(e,t,n)=>{e.exports=n.p+"8c998f8fb62016fcfb4901e424ff378b.svg"},399898:(e,t,n)=>{e.exports=n.p+"645df33d735507f39c78ce0cac7437f0.svg"},74700:(e,t,n)=>{e.exports=n.p+"b5eb2f7d6b3f8cc9b60be4a5dcf28015.svg"},607603:(e,t,n)=>{e.exports=n.p+"02625ee29f851ec588c2020a88d82665.svg"},376354:(e,t,n)=>{e.exports=n.p+"b36de980b174d7b798c89f35c116e5c6.svg"},688224:(e,t,n)=>{e.exports=n.p+"fd879a28807b66b38d54e7db6ea18a69.svg"},96972:(e,t,n)=>{e.exports=n.p+"b36c705f790dad253981f1893085015a.svg"},540579:(e,t,n)=>{e.exports=n.p+"36c9a2fb7d0593a581a92373121c2848.svg"},572274:(e,t,n)=>{e.exports=n.p+"c8aeec4a5ee16aa9214b994f7355fea0.svg"},709804:(e,t,n)=>{e.exports=n.p+"37cf72199c4e106407223a1edaf34460.svg"},348833:(e,t,n)=>{e.exports=n.p+"23f41c9a000ffa229ef0b60ef127ccba.svg"},392544:(e,t,n)=>{
e.exports=n.p+"55b367aaef0b83c837ac6c3bfe01da4c.svg"},350672:(e,t,n)=>{e.exports=n.p+"6e97f6643e7df29b26571d96430e92f4.svg"},24264:(e,t,n)=>{e.exports=n.p+"55b941d7bba0d84f06c05db34b7c9aab.svg"},874638:(e,t,n)=>{e.exports=n.p+"187bc0709ea0cecffe622a50993d012c.svg"},956863:(e,t,n)=>{e.exports=n.p+"c096c74c5685ce049b779f7ce3591bab.svg"},947079:(e,t,n)=>{e.exports=n.p+"3fba9b3d08682f3ce0344e289fe668cb.svg"},903049:(e,t,n)=>{e.exports=n.p+"d5d75eacea4086ed5f38048b74851f43.svg"},188374:(e,t,n)=>{e.exports=n.p+"42b60052f80abd9c2bdd8fc24cf97988.svg"},789621:(e,t,n)=>{e.exports=n.p+"9167182d6b74446a1c818615c135c289.svg"},273361:(e,t,n)=>{e.exports=n.p+"67430d140a79af95585a19d304731dc5.svg"},129428:(e,t,n)=>{e.exports=n.p+"d6779172ed9209b5ad49df923ea7820c.svg"},566300:(e,t,n)=>{e.exports=n.p+"c11b69c74029b5deaca9ca7ce1e987b1.svg"},235920:(e,t,n)=>{e.exports=n.p+"23e073eb0ee21f94de11e5d0a7eec50e.svg"},200824:(e,t,n)=>{e.exports=n.p+"f69210154879227d0ede0308465cf388.svg"},389515:(e,t,n)=>{
e.exports=n.p+"816e71b3225c71bc105db7209fb4b796.svg"},785538:(e,t,n)=>{e.exports=n.p+"7866fb01d8b75b6fe9e6591373a0ddf2.svg"},761434:(e,t,n)=>{e.exports=n.p+"f88737ca3655b964bfdbbff8585f1d41.png"},88094:(e,t,n)=>{e.exports=n.p+"7dfe055a88781818b8368d1f9f2049da.png"},534413:(e,t,n)=>{e.exports=n.p+"e73889dfe6cc46c9161dd9c1d19cc5ca.svg"},182105:(e,t,n)=>{e.exports=n.p+"109dff8689b0dcedc5485a0b26c647f2.svg"},23943:(e,t,n)=>{e.exports=n.p+"0a14344c0e0bfe3a52aa245ecaaebca7.svg"},163471:(e,t,n)=>{e.exports=n.p+"f214135302d61205531f7b699beda3ae.svg"},770631:(e,t,n)=>{e.exports=n.p+"2af0d312aff32c40bf90e37cd91d2a52.svg"},961088:(e,t,n)=>{e.exports=n.p+"af1ba3a7e6cc150d54fe3f36ca83e5af.svg"},630234:(e,t,n)=>{e.exports=n.p+"1fd45d0febcfaabc6b535f3329b3b834.svg"},456202:(e,t,n)=>{e.exports=n.p+"5ec8d5e37b8734c04bde29eb7e2af36f.svg"},791643:(e,t,n)=>{e.exports=n.p+"ada35c4cc5073d182d563e6f39d6a7cf.svg"},565411:(e,t,n)=>{e.exports=n.p+"76f387b22097af941856a30be1aafa3f.svg"},727869:(e,t,n)=>{
e.exports=n.p+"5e690f4c63a19a36bff7f6364eaa6ea2.svg"},10439:(e,t,n)=>{e.exports=n.p+"fda43f574092d89177a4412046f51c44.svg"},680664:(e,t,n)=>{e.exports=n.p+"41a1814ec63404eb722ce88d1c28b4f4.png"},396448:(e,t,n)=>{e.exports=n.p+"8e5a6ee1fce31ef5c5800b7646a94d98.png"},50682:(e,t,n)=>{e.exports=n.p+"7786c98742fafc1347e5fedaa1c67ea9.svg"},509142:(e,t,n)=>{e.exports=n.p+"9c804cfda21f296f522fbadfb818c76f.svg"},226867:(e,t,n)=>{e.exports=n.p+"84b8a1a47627caf0b6d6dae9fc28f1c5.png"},794649:(e,t,n)=>{e.exports=n.p+"d759f3acc6286c964cc8118d7f68b374.svg"},80210:(e,t,n)=>{e.exports=n.p+"3ed9c7cdbea131bc485afa998a5ec93e.svg"},236481:(e,t,n)=>{e.exports=n.p+"1a23068e966efce6fb32ca9fecc65eed.svg"},694111:(e,t,n)=>{e.exports=n.p+"4aebeb85413bf3414671b2c138463909.svg"},484771:(e,t,n)=>{e.exports=n.p+"7de1e682a4fbf1483ad81f3872e5a9b2.png"},635232:(e,t,n)=>{e.exports=n.p+"34d96b0900c3f9fc0e57f7eeddf1e161.svg"},312154:(e,t,n)=>{e.exports=n.p+"7ee0d57b993e25a61a9f42a0808e721f.svg"},22513:(e,t,n)=>{
e.exports=n.p+"95f1d07727cd8303bb200217b50f98fa.svg"},515861:(e,t,n)=>{e.exports=n.p+"c0a2b25d7b3e46c1c969c809ee173e3a.svg"},568909:(e,t,n)=>{e.exports=n.p+"e50463c92d8fb550ee4a6018361098bb.svg"},531239:(e,t,n)=>{e.exports=n.p+"26f653c4a0bd723faa41d92b4f957cb9.svg"},302048:(e,t,n)=>{e.exports=n.p+"045d1e57ef93a0f9b55e9fa593116c96.svg"},180263:(e,t,n)=>{e.exports=n.p+"6a04c917a9b9b2706058f8f48bf83981.svg"},677291:(e,t,n)=>{e.exports=n.p+"2487bb81772c6dab62684cd570ac8dd4.svg"},864678:(e,t,n)=>{e.exports=n.p+"8895917b1fd65584171fb5794e5411be.svg"},367627:(e,t,n)=>{e.exports=n.p+"35c4885828d7808a119efea349c638a0.svg"},874744:(e,t,n)=>{e.exports=n.p+"4766a4c81adfcca7ce1c53c6a7590c23.svg"},101872:(e,t,n)=>{e.exports=n.p+"449b5e5b0765b27c68ef2bf735af539d.svg"},46802:(e,t,n)=>{e.exports=n.p+"5b6f3fce0c8b9fa0bcad7bbb51e13848.svg"},726954:(e,t,n)=>{e.exports=n.p+"2da390aaddef4384aa0520dd8a6fc156.svg"},897295:(e,t,n)=>{e.exports=n.p+"94ea936b0074481a45e1a0c50aed7e48.svg"},435696:(e,t,n)=>{
e.exports=n.p+"a6cde8ee51f202f776ef71ee9cf280d1.svg"},454675:(e,t,n)=>{e.exports=n.p+"e844e2dcc722ad0666556ca41351610f.svg"},404024:(e,t,n)=>{e.exports=n.p+"ed28635ce7d107f1a8b04379d009dd41.svg"},764728:(e,t,n)=>{e.exports=n.p+"cc6c3c95c28acf328b6173383ddb3b61.svg"},404940:(e,t,n)=>{e.exports=n.p+"c8234fe5675a618e7891b634d32d1c0f.svg"},185802:(e,t,n)=>{e.exports=n.p+"9b8d70b5b62f4983a80b2b136259b763.svg"},934104:(e,t,n)=>{e.exports=n.p+"5113924998ee17c4f43a65b8cf2d0153.svg"},652951:(e,t,n)=>{e.exports=n.p+"fd49d24049e28b740a0a1e08d15158b3.png"},207357:(e,t,n)=>{e.exports=n.p+"e06697bc1bf89b08d1e767aa21334ae0.png"},970298:(e,t,n)=>{e.exports=n.p+"07de3733e48397a3e9086e37a9cb0dac.svg"},946137:(e,t,n)=>{e.exports=n.p+"a8007d2ecb3aec65119698bff7052451.svg"},692760:(e,t,n)=>{e.exports=n.p+"a50c50c963aab21b5c3d58e7fd06664e.svg"},597055:(e,t,n)=>{e.exports=n.p+"ece95f914bae5931e7a48fadca4a146c.svg"},302147:(e,t,n)=>{e.exports=n.p+"da49b3a1b7e3f163d69aff38bf33609d.svg"},204186:(e,t,n)=>{
e.exports=n.p+"f18a19cd9fbf76b15b4d968274b0635a.svg"},337285:(e,t,n)=>{e.exports=n.p+"5e38a1b0dc183dd320c517e58ccfb074.svg"},691634:(e,t,n)=>{e.exports=n.p+"2ebbb7dbd17b154a625b58b33738fc85.svg"},998240:(e,t,n)=>{e.exports=n.p+"3224278ae6dc432b7fbc0fc90b54686e.svg"},810540:(e,t,n)=>{e.exports=n.p+"93e31ba1ad50859a7cbcd6b1f0035d6c.svg"},705206:(e,t,n)=>{e.exports=n.p+"984b386302bacf7fb81985ab31c5beec.png"},567012:(e,t,n)=>{e.exports=n.p+"a9efd5e06b5616d39a6ee4232211f9b0.svg"},862470:(e,t,n)=>{e.exports=n.p+"dd1ac77c281d77cfa4061925981469e2.svg"},148167:(e,t,n)=>{e.exports=n.p+"4d8c26b9b004da398fb8940d194e3aaa.svg"},237018:(e,t,n)=>{e.exports=n.p+"c173765c2ab447a8ec7ba0e3e8aa3c09.svg"},976518:(e,t,n)=>{e.exports=n.p+"48c9711c9fabbd43182bcaf602201b48.svg"},522627:(e,t,n)=>{e.exports=n.p+"6e0a487645bb93dc13fdb0b499352b46.svg"},583334:(e,t,n)=>{e.exports=n.p+"b8baf33f158fb831f7f243e36368ab72.svg"},630228:(e,t,n)=>{e.exports=n.p+"207efa8c7409188d94bfcdbeb66e33b1.svg"},20278:(e,t,n)=>{
e.exports=n.p+"eb47171e918604c7f7e861e94708f19f.svg"},955426:(e,t,n)=>{e.exports=n.p+"d63afdc8dee0d21c3c25f78f4f81a8a9.mov"},861197:(e,t,n)=>{e.exports=n.p+"686449dfc2b401327999d72f79b7c037.webm"},621491:(e,t,n)=>{e.exports=n.p+"2d197cc648cea186073da09b5d7639d1.mov"},109177:(e,t,n)=>{e.exports=n.p+"1442d764c3d6ee37ad6ba74a470bca14.webm"},470752:(e,t,n)=>{e.exports=n.p+"d8b61fb29328e17e879a14a5cc765e06.mov"},919098:(e,t,n)=>{e.exports=n.p+"6db35a89f93f27cec438f980be59635f.webm"},734207:(e,t,n)=>{e.exports=n.p+"9e8f64d43e65d86219eefaa871f25d0a.mov"},900615:(e,t,n)=>{e.exports=n.p+"c66604b9276c4dd8865a519b90394e9d.webm"},524268:(e,t,n)=>{e.exports=n.p+"2e16625f6f55b96572f79cc35682266f.png"},950737:(e,t,n)=>{e.exports=n.p+"3be860e37bf5f2df40ad15d2de5cee0e.png"},276727:(e,t,n)=>{e.exports=n.p+"97ac61a0b98fd6f01b4de370c9ccdb56.png"},49349:(e,t,n)=>{e.exports=n.p+"7cb25b8ad51d09af28fa31124e067f9b.png"},31890:(e,t,n)=>{e.exports=n.p+"c23a59030cd2583c8b8ae0e85bc99737.svg"},660588:(e,t,n)=>{
e.exports=n.p+"d4f4a5d2eb643d073f413e517ed0cc40.svg"},61541:(e,t,n)=>{"use strict";n.d(t,{W:()=>d});var r=n(707961),o=n(296602),i=n(959207),a=n(951442);function s(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){s(i,r,o,a,c,"next",e)}function c(e){s(i,r,o,a,c,"throw",e)}a(void 0)}))}}function l(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var u=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,
r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function f(e,t){var a=i.Z.getGame(e);null!=a?(0,r.ZDy)(c((function(){var e,r;return u(this,(function(o){switch(o.label){case 0:return[4,n.e(74067).then(n.bind(n,874067))];case 1:e=o.sent(),r=e.default;return[2,function(e){return r(function(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){l(e,t,n[t])}))}return e}({game:a,onConfirmUninstall:t},e))}]}}))}))):new o.Z("DispatchUninstallActionCreators").log("Application not found for game ".concat(e))}function d(e,t,n){f(e,(function(){return(0,a.pC)(e,t,n)}))}},908594:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r,o=n(281110),i=n(744564),a=n(347365),s=n(2590);function c(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var l=(c(r={},s.gkr.HOUSE_1,1),c(r,s.gkr.HOUSE_2,2),c(r,s.gkr.HOUSE_3,3),r);const u={joinHypeSquadOnline:function(e){return o.Z.post({url:s.ANM.HYPESQUAD_ONLINE,body:{house_id:l[e.houseID]},oldFormErrors:!0}).then((function(){return i.Z.dispatch({type:"HYPESQUAD_ONLINE_MEMBERSHIP_JOIN_SUCCESS",
houseID:e.houseID})})).catch((function(e){throw new a.yZ(e)}))},leaveHypeSquadOnline:function(){return o.Z.delete({url:s.ANM.HYPESQUAD_ONLINE,oldFormErrors:!0}).then((function(){return i.Z.dispatch({type:"HYPESQUAD_ONLINE_MEMBERSHIP_LEAVE_SUCCESS"})})).catch((function(e){throw new a.yZ(e)}))}}},980151:(e,t,n)=>{"use strict";n.d(t,{RY:()=>i,iD:()=>a,Tb:()=>s,ec:()=>c});var r=n(744564),o=n(457493);function i(e){o.Z.queryDirectory(e,(function(t,n){null==t&&null!=n&&r.Z.dispatch({type:"INSTALLATION_LOCATION_ADD",path:e,metadata:n})}))}function a(e){r.Z.dispatch({type:"INSTALLATION_LOCATION_REMOVE",path:e})}function s(e,t){var n=t.label,o=t.isDefault;r.Z.dispatch({type:"INSTALLATION_LOCATION_UPDATE",path:e,label:n,isDefault:o})}function c(e){var t={},n=0,i=!0,a=!1,s=void 0;try{for(var c,l=function(){var i=c.value;if(null==i||"string"!=typeof i)return"continue";o.Z.queryDirectory(i,(function(o,a){++n;null==o&&null!=a&&(t[i]=a);n===e.length&&r.Z.dispatch({
type:"INSTALLATION_LOCATION_FETCH_METADATA",metadataPayload:t})}))},u=e[Symbol.iterator]();!(i=(c=u.next()).done);i=!0)l()}catch(e){a=!0;s=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw s}}}},577357:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(744564),o=n(703790),i=n(945514),a=n(823530);function s(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){s(i,r,o,a,c,"next",e)}function c(e){s(i,r,o,a,c,"throw",e)}a(void 0)}))}}var l=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,
r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};const u={init:function(){r.Z.dispatch({type:"INTEGRATION_SETTINGS_INIT"})},setSection:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;r.Z.dispatch({type:"INTEGRATION_SETTINGS_SET_SECTION",section:e,sectionId:t})},startEditingCommandPermissions:function(e){
r.Z.dispatch({type:"INTEGRATION_SETTINGS_START_EDITING_COMMAND",commandId:e})},stopEditingCommandPermissions:function(e){r.Z.dispatch({type:"INTEGRATION_SETTINGS_STOP_EDITING_COMMAND",commandId:e})},startEditingIntegration:function(e){r.Z.dispatch({type:"INTEGRATION_SETTINGS_START_EDITING_INTEGRATION",integrationId:e})},stopEditingIntegration:function(){r.Z.dispatch({type:"INTEGRATION_SETTINGS_STOP_EDITING_INTEGRATION"})},updateIntegration:function(e){r.Z.dispatch({type:"INTEGRATION_SETTINGS_UPDATE_INTEGRATION",settings:e})},startEditingWebhook:function(e){r.Z.dispatch({type:"INTEGRATION_SETTINGS_START_EDITING_WEBHOOK",webhookId:e})},stopEditingWebhook:function(){r.Z.dispatch({type:"INTEGRATION_SETTINGS_STOP_EDITING_WEBHOOK"})},updateWebhook:function(e){r.Z.dispatch({type:"INTEGRATION_SETTINGS_UPDATE_WEBHOOK",settings:e})},saveApplicationPermissions:function(e,t,n){return c((function(){var o;return l(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);r.Z.dispatch({
type:"INTEGRATION_SETTINGS_SUBMITTING"});return[4,i.U3({applicationId:e,commandId:e,defaultEveryoneValue:!0,defaultEverywhereValue:!0,guildId:t,permissions:n})];case 1:a.sent();r.Z.dispatch({type:"INTEGRATION_SETTINGS_SAVE_SUCCESS"});return[3,3];case 2:o=a.sent();r.Z.dispatch({type:"INTEGRATION_SETTINGS_SAVE_FAILURE",errors:o.body});return[3,3];case 3:return[2]}}))}))()},saveIntegration:function(e,t){return c((function(){var n;return l(this,(function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);r.Z.dispatch({type:"INTEGRATION_SETTINGS_SUBMITTING"});return[4,o.Z.updateIntegration(e,t.id,t.expire_behavior,t.expire_grace_period,t.enable_emoticons)];case 1:i.sent();r.Z.dispatch({type:"INTEGRATION_SETTINGS_SAVE_SUCCESS"});return[3,3];case 2:n=i.sent();r.Z.dispatch({type:"INTEGRATION_SETTINGS_SAVE_FAILURE",errors:n.body});return[3,3];case 3:return[2]}}))}))()},saveWebhook:function(e,t){return c((function(){var n;return l(this,(function(o){switch(o.label){case 0:o.trys.push([0,2,,3])
;r.Z.dispatch({type:"INTEGRATION_SETTINGS_SUBMITTING"});return[4,a.Z.update(e,t.id,t)];case 1:o.sent();r.Z.dispatch({type:"INTEGRATION_SETTINGS_SAVE_SUCCESS"});return[3,3];case 2:n=o.sent();r.Z.dispatch({type:"INTEGRATION_SETTINGS_SAVE_FAILURE",errors:n.body});return[3,3];case 3:return[2]}}))}))()}}},731503:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(744564);const o={addKeybind:function(e){r.Z.dispatch({type:"KEYBINDS_ADD_KEYBIND",keybind:e})},setKeybind:function(e){r.Z.dispatch({type:"KEYBINDS_SET_KEYBIND",keybind:e})},deleteKeybind:function(e){r.Z.dispatch({type:"KEYBINDS_DELETE_KEYBIND",id:e})},enableAll:function(e){r.Z.dispatch({type:"KEYBINDS_ENABLE_ALL_KEYBINDS",enable:e})}}},314620:(e,t,n)=>{"use strict";n.d(t,{b8:()=>f,GR:()=>p,ul:()=>E});var r=n(281110),o=n(744564),i=n(200892),a=n(534681),s=n(2590);function c(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function l(e){return function(){var t=this,n=arguments
;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){c(i,r,o,a,s,"next",e)}function s(e){c(i,r,o,a,s,"throw",e)}a(void 0)}))}}var u=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}
if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function f(){return d.apply(this,arguments)}function d(){return(d=l((function(){var e,t;return u(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,(0,a.Kb)({url:s.ANM.LIBRARY,oldFormErrors:!0},!1)];case 1:e=n.sent();o.Z.dispatch({type:"LIBRARY_FETCH_SUCCESS",libraryApplications:e.body});return[3,3];case 2:t=n.sent();o.Z.dispatch({type:"LIBRARY_FETCH_FAIL",error:t});return[3,3];case 3:return[2]}}))}))).apply(this,arguments)}function p(e){return h.apply(this,arguments)}function h(){return(h=l((function(e){var t,n,a;return u(this,(function(c){switch(c.label){case 0:return null==(t=e.primarySkuId)?[2]:[4,r.Z.get({url:s.ANM.APPLICATION_BRANCH_LIST(e.id),oldFormErrors:!0}).then((function(e){return e.body}))];case 1:n=c.sent();a=n.map((function(n){
return i.Z.createForTestMode({id:e.id,skuId:t,branch:n})}));o.Z.dispatch({type:"LIBRARY_APPLICATIONS_TEST_MODE_ENABLED",libraryApplications:a});return[2]}}))}))).apply(this,arguments)}function E(e,t,n){o.Z.dispatch({type:"LIBRARY_APPLICATION_ACTIVE_LAUNCH_OPTION_UPDATE",applicationId:e,branchId:t,launchOptionId:n})}},458922:(e,t,n)=>{"use strict";n.d(t,{N:()=>f});var r=n(281110),o=n(744564),i=n(575136),a=n(2590);function s(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){s(i,r,o,a,c,"next",e)}function c(e){s(i,r,o,a,c,"throw",e)}a(void 0)}))}}var l=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){
return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},u=216e5;function f(){return d.apply(this,arguments)}function d(){return(d=c((function(){var e,t;return l(this,(function(n){switch(n.label){case 0:
if(null!=(e=i.Z.lastFetched)&&Date.now()-e<u)return[2];n.label=1;case 1:n.trys.push([1,3,,4]);return[4,r.Z.get({url:a.ANM.USER_ACTIVITY_STATISTICS,oldFormErrors:!0})];case 2:t=n.sent();o.Z.dispatch({type:"USER_ACTIVITY_STATISTICS_FETCH_SUCCESS",statistics:t.body});return[3,4];case 3:return[2,n.sent()];case 4:return[2]}}))}))).apply(this,arguments)}},130671:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(281110),o=n(744564),i=n(694444),a=n(196810),s=n(2590),c=n(473708);function l(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}var u=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,
r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function f(e,t){o.Z.dispatch({type:"MFA_SMS_TOGGLE"});return r.Z.post({url:e,body:{password:t},oldFormErrors:!0}).then((function(e){o.Z.dispatch({type:"MFA_SMS_TOGGLE_COMPLETE"});return e}),(function(e){o.Z.dispatch({type:"MFA_SMS_TOGGLE_COMPLETE"});throw e}))}const d={
enableMFAStart:function(e){return(t=function(){return u(this,(function(t){switch(t.label){case 0:return[4,r.Z.post({url:s.ANM.MFA_TOTP_ENABLE,body:{password:e},oldFormErrors:!0})];case 1:return[2,t.sent().body]}}))},function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(e){l(i,r,o,a,s,"next",e)}function s(e){l(i,r,o,a,s,"throw",e)}a(void 0)}))})();var t},enable:function(e){var t=e.password,n=e.code,i=e.secret;return r.Z.post({url:s.ANM.MFA_TOTP_ENABLE,body:{code:n,secret:i,password:t},oldFormErrors:!0}).then((function(e){return o.Z.dispatch({type:"MFA_ENABLE_SUCCESS",token:e.body.token,codes:e.body.backup_codes})}))},disable:function(){(0,a.Z)((function(e){return r.Z.post({url:s.ANM.MFA_TOTP_DISABLE,body:e,oldFormErrors:!0})}),{checkEnabled:!0,modalProps:{title:c.Z.Messages.TWO_FA_DISABLE,actionText:c.Z.Messages.TWO_FA_REMOVE}}).then((function(e){var t=e.body.token;return o.Z.dispatch({type:"MFA_DISABLE_SUCCESS",token:t})}))},
enableSMS:function(e){return f(s.ANM.MFA_SMS_ENABLE,e)},disableSMS:function(e){return f(s.ANM.MFA_SMS_DISABLE,e)},sendMFABackupCodesVerificationKeyEmail:function(e){return r.Z.post({url:s.ANM.MFA_SEND_VERIFICATION_KEY,body:{password:e},oldFormErrors:!0}).then((function(e){return o.Z.dispatch({type:"MFA_SEND_VERIFICATION_KEY",nonces:{viewNonce:e.body.nonce,regenerateNonce:e.body.regenerate_nonce}})}),(function(e){throw e}))},confirmViewBackupCodes:function(e,t){var n=i.Z.getNonces(),a=n.viewNonce,c=n.regenerateNonce,l=t?c:a;return r.Z.post({url:s.ANM.MFA_CODES_VERIFICATION,body:{key:e,nonce:l,regenerate:t},oldFormErrors:!0}).then((function(t){return o.Z.dispatch({type:"MFA_VIEW_BACKUP_CODES",codes:t.body.backup_codes,key:e})}),(function(e){throw e}))},clearBackupCodes:function(){o.Z.dispatch({type:"MFA_CLEAR_BACKUP_CODES"})}}},929370:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(744564);const o={setEnabled:function(e){this.update({enabled:e})},update:function(e){var t=!0,n=!1,o=void 0
;try{for(var i,a=Object.keys(e)[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var s=i.value;r.Z.dispatch({type:"STREAMER_MODE_UPDATE",key:s,value:e[s]})}}catch(e){n=!0;o=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw o}}}}},517716:(e,t,n)=>{"use strict";n.d(t,{Wt:()=>E,mc:()=>m,q$:()=>b});var r=n(744564),o=n(582762),i=n(451936),a=n(959207),s=n(661123),c=n(585622),l=n(875700),u=n(314620),f=n(2590);function d(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function p(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){d(i,r,o,a,s,"next",e)}function s(e){d(i,r,o,a,s,"throw",e)}a(void 0)}))}}var h=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){
return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function E(e,t){return y.apply(this,arguments)}function y(){return(y=p((function(e,t){var n,d,p,E;return h(this,(function(h){switch(h.label){case 0:r.Z.dispatch({applicationId:e,
type:"DEVELOPER_TEST_MODE_AUTHORIZATION_START"});h.label=1;case 1:h.trys.push([1,5,,6]);return[4,(0,o.W5)(e)];case 2:if(!h.sent())throw new Error("Do not have access!");if(null!=(n=a.Z.getGame(e)))return[3,4];d=i.Z.createFromServer;return[4,l.Z.fetchApplication(e)];case 3:n=d.apply(i.Z,[h.sent()]);h.label=4;case 4:if((p=(0,s.yE)(n.flags,f.udG.EMBEDDED))&&(null==t||!c.Z.URL_REGEX.test(t)))throw new Error("Invalid Origin URL for embedded application");p||u.GR(n);r.Z.dispatch({type:"DEVELOPER_TEST_MODE_AUTHORIZATION_SUCCESS",applicationId:e,originURL:p?t:null});return[2,n];case 5:E=h.sent();r.Z.dispatch({type:"DEVELOPER_TEST_MODE_AUTHORIZATION_FAIL",applicationId:e,error:E.message});return[2,null];case 6:return[2]}}))}))).apply(this,arguments)}function m(){r.Z.dispatch({type:"DEVELOPER_TEST_MODE_RESET"})}function b(){r.Z.dispatch({type:"DEVELOPER_TEST_MODE_RESET_ERROR"})}},758635:(e,t,n)=>{"use strict";n.d(t,{W:()=>s});var r=n(281110),o=n(744564),i=n(239734),a=n(2590);function s(){
var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(i.Z.needsRefresh()){o.Z.dispatch({type:"LOAD_USER_AFFINITIES"});return r.Z.get({url:a.ANM.USER_AFFINITIES,retries:e?3:0,oldFormErrors:!0}).then((function(e){var t=e.body;o.Z.dispatch({type:"LOAD_USER_AFFINITIES_SUCCESS",affinities:t})}),(function(){o.Z.dispatch({type:"LOAD_USER_AFFINITIES_FAILURE"})}))}return Promise.resolve()}},823530:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(496486),o=n.n(r),i=n(281110),a=n(744564),s=n(2590),c=["Spidey Bot","Captain Hook"];const l={fetchForGuild:function(e){a.Z.dispatch({type:"WEBHOOKS_FETCHING",guildId:e});i.Z.get({url:s.ANM.GUILD_WEBHOOKS(e),oldFormErrors:!0}).then((function(t){var n=t.body;return a.Z.dispatch({type:"WEBHOOKS_UPDATE",guildId:e,webhooks:n})})).catch((function(t){var n=t.body;a.Z.dispatch({type:"WEBHOOKS_UPDATE",guildId:e,error:n.message})}))},fetchForChannel:function(e,t){a.Z.dispatch({type:"WEBHOOKS_FETCHING",guildId:e,channelId:t});i.Z.get({
url:s.ANM.CHANNEL_WEBHOOKS(t),oldFormErrors:!0}).then((function(n){var r=n.body;return a.Z.dispatch({type:"WEBHOOKS_UPDATE",guildId:e,channelId:t,webhooks:r})}))},create:function(e,t,n){null==n&&(n=c[o().random(0,c.length-1)]);return i.Z.post({url:s.ANM.CHANNEL_WEBHOOKS(t),body:{name:n},oldFormErrors:!0}).then((function(t){var n=t.body;a.Z.dispatch({type:"WEBHOOK_CREATE",guildId:e,webhook:n});return n}))},delete:function(e,t){return i.Z.delete({url:s.ANM.WEBHOOK(t),oldFormErrors:!0}).then((function(){a.Z.dispatch({type:"WEBHOOK_DELETE",guildId:e,webhookId:t})}))},update:function(e,t,n){return i.Z.patch({url:s.ANM.WEBHOOK(t),body:n,oldFormErrors:!0}).then((function(t){var n=t.body;a.Z.dispatch({type:"WEBHOOK_UPDATE",guildId:e,webhook:n});return n}))}}},946767:(e,t,n)=>{"use strict";n.d(t,{_:()=>x,Z:()=>K})
;var r=n(785893),o=n(667294),i=n(496486),a=n.n(i),s=n(202351),c=n(539519),l=n(513328),u=n(707961),f=n(656645),d=n(736097),p=n(563367),h=n(294184),E=n.n(h),y=n(336194),m=n(421281),b=n(633878);function g(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function O(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function v(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){
var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function _(e){var t=e.width,n=void 0===t?80:t,o=e.height,i=void 0===o?20:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=v(e,["width","height","color","foreground"]);return(0,r.jsxs)("svg",O(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){g(e,t,n[t])}))}return e}({},(0,b.Z)(l)),{width:n,height:i,viewBox:"0 0 ".concat(n," ").concat(i),children:[(0,r.jsx)("pattern",{id:"pill-frame-pattern",width:8/n,height:"1",children:(0,r.jsx)("path",{d:"m0 0h8v20h-8zm4 2c-1.1045695 0-2 .8954305-2 2v12c0 1.1045695.8954305 2 2 2s2-.8954305 2-2v-12c0-1.1045695-.8954305-2-2-2z",
fillRule:"evenodd",fill:s,className:c})}),(0,r.jsx)("rect",{fill:"url(#pill-frame-pattern)",height:"100%",width:"100%"})]}))}var I=n(863611),S=n.n(I);function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N(e){N=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return N(e)}function A(e,t){return!t||"object"!==P(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function C(e,t){C=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return C(e,t)}var P=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function j(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))
;return!0}catch(e){return!1}}();return function(){var n,r=N(e);if(t){var o=N(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return A(this,n)}}var R=(0,m.Mg)(S().notchWidth),x=Object.freeze({BLACK:S().black,GRAY:S().gray}),M=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&C(e,t)}(n,e);var t=j(n);function n(){T(this,n);var e;(e=t.apply(this,arguments)).state={barWidth:0};e.sizerRef=o.createRef();e.computeBars=function(){var t=e.sizerRef.current;e.setState({barWidth:null!=t?e.roundToNearestStep(t.clientWidth):0})};return e}var i=n.prototype;i.componentDidMount=function(){this.computeBars();window.addEventListener("resize",this.computeBars)};i.componentWillUnmount=function(){window.removeEventListener("resize",this.computeBars)};i.roundToNearestStep=function(e){
return Math.round(e/R)*R};i.getProgressStyles=function(){var e=this.props.progress,t=100-Math.max(0,Math.min(100,e)),n=this.state.barWidth,r=n*t/100,o=this.roundToNearestStep(r),i=Math.abs(o-n);return{transform:"translateX(".concat(i,"px)")}};i.getGradientStyles=function(){var e=this.props,t=e.gradientEnd,n=e.gradientStart,r=e.progress,o=this.state.barWidth;return{width:"".concat(o,"px"),background:r<=0?"none":"linear-gradient(to right, ".concat(n,", ").concat(t,")")}};i.render=function(){var e=this.props,t=e.className,n=e.notchBackground,o=this.state.barWidth;return(0,r.jsx)("div",{className:S().wrapper,ref:this.sizerRef,children:(0,r.jsxs)("div",{className:E()(S().container,t),style:this.getGradientStyles(),children:[(0,r.jsx)("div",{className:S().progress,style:this.getProgressStyles()}),0!==o&&(0,r.jsx)(_,{width:o,className:E()(S().notches,n)})]})})};return n}(o.Component);M.defaultProps={gradientStart:y.Z.unsafe_rawColors.YELLOW_260.css,
gradientEnd:y.Z.unsafe_rawColors.GREEN_360.css};const w=M;var D=n(652591),Z=n(2590),L=n(473708),U=n(284150),k=n.n(U);function G(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function B(e){B=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return B(e)}function H(e,t){return!t||"object"!==F(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function V(e,t){V=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return V(e,t)}var F=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Y(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}()
;return function(){var n,r=B(e);if(t){var o=B(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return H(this,n)}}var z=-100,W=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&V(e,t)}(n,e);var t=Y(n);function n(){G(this,n);var e;(e=t.apply(this,arguments))._initTimeout=new l.V7;e._silenceTimeout=new l.V7;e._messageTimeout=new l.V7;e.state={volume:z,isMicTesting:!1,isDetectingInput:!0,didDeafenUser:!1};e.setupVoiceActivity=function(){d.Z.getMediaEngine().on(c.aB.VoiceActivity,e.handleVoiceActivity)};e.handleVoiceActivity=function(t){if(e.state.isMicTesting&&t<=z){e._silenceTimeout.isStarted()||e._silenceTimeout.start(2e3,(function(){e.setState({isDetectingInput:!1})}));e.setState({volume:z})}else{e._silenceTimeout.stop();e.setState({volume:t,isDetectingInput:!0})}}
;e.handleToggleMicTest=function(){e.state.isMicTesting?e._micTestStop():e._micTestStart()};return e}var o=n.prototype;o.componentDidMount=function(){this._initTimeout.start(1e3,this.setupVoiceActivity)};o.componentWillUnmount=function(){this._initTimeout.stop();this._silenceTimeout.stop();this._micTestStop();d.Z.getMediaEngine().removeListener(c.aB.VoiceActivity,this.handleVoiceActivity)};o._micTestStart=function(){var e=this.props,t=e.isVoiceConnected,n=e.inputDeviceName,r=e.inputVolume,o=e.outputDeviceName,i=e.outputVolume,a=e.inputMode,s=e.vadAutoThreshold,c=e.vadThreshold,l=e.location,u=e.isDeafened,d=!1;if(t&&!u){f.Z.toggleSelfDeaf();d=!0}f.Z.setLoopback(!0);this._micTestStartTime=Date.now();this.setState({isMicTesting:!0,isDetectingInput:!0,didDeafenUser:d});D.default.track(Z.rMx.MIC_TESTING_STARTED,{input_device_name:n,input_device_volume:r,output_device_name:o,output_device_volume:i,input_mode:a,input_sensitivity_is_automatic:s,input_sensitivity_threshold:Math.round(c),
location:l})};o._micTestStop=function(){var e=this.state,t=e.didDeafenUser,n=e.isMicTesting,r=this.props,o=r.isVoiceConnected,i=r.isDeafened;if(n){o&&i&&t&&f.Z.toggleSelfDeaf();f.Z.setLoopback(!1);this.setState({isMicTesting:!1,didDeafenUser:!1});null!=this._micTestStartTime&&D.default.track(Z.rMx.MIC_TESTING_STOPPED,{testing_duration:Math.round((Date.now()-this._micTestStartTime)/1e3)})}};o.renderCaption=function(){var e=this.props,t=e.captionVoice,n=e.captionNoVoice,o=this.state,i=o.isMicTesting,a=o.isDetectingInput;return(0,r.jsx)(u.R94,{className:k().micTestCaption,type:u.R94.Types.DESCRIPTION,children:i?a?t:n:null})};o.render=function(){var e=this,t=this.props,n=t.isVoiceConnected,o=t.title,i=t.description,a=t.notchBackground,s=t.buttonTest,c=t.buttonStop,l=t.buttonClassName,f=t.buttonColor,d=t.isDeafened,p=this.state,h=p.isMicTesting,E=p.volume,y=n&&!h?L.Z.Messages.MIC_TEST_VOICE_CHANNEL_WARNING:null;h&&n&&!d&&this._micTestStop();return(0,r.jsxs)("div",{className:k().container,
children:[(0,r.jsx)(u.vwX,{tag:u.RB0.H5,className:k().title,children:o}),null!=i&&(0,r.jsx)(u.R94,{type:u.R94.Types.DESCRIPTION,className:k().description,children:i}),(0,r.jsxs)("div",{className:k().micTest,children:[(0,r.jsx)(u.ua7,{text:y,children:function(t){var n=t.onMouseEnter,o=t.onMouseLeave;return(0,r.jsx)(u.zxk,{grow:!1,onClick:e.handleToggleMicTest,onMouseEnter:n,onMouseLeave:o,size:u.zxk.Sizes.SMALL,className:l,color:f,children:h?c:s})}}),(0,r.jsx)(w,{progress:h?E+100:0,notchBackground:a}),this.renderCaption()]})]})};return n}(o.PureComponent);const K=s.ZP.connectStores([p.Z,d.Z],(function(){var e=d.Z.getInputDeviceId(),t=d.Z.getInputDevices(),n=a().find(t,(function(t){return t.id===e})),r=d.Z.getOutputDeviceId(),o=d.Z.getOutputDevices(),i=a().find(o,(function(e){return e.id===r})),s=d.Z.getModeOptions();return{isVoiceConnected:p.Z.isConnected(),inputVolume:d.Z.getInputVolume(),outputVolume:d.Z.getOutputVolume(),inputMode:d.Z.getMode(),vadThreshold:s.threshold,
isDeafened:d.Z.isSelfDeaf(),vadAutoThreshold:s.autoThreshold,inputDeviceName:null!=n?n.name:"",outputDeviceName:null!=i?i.name:""}}))(W)},573535:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>Sfe});var r=n(785893),o=n(667294),i=n(517563),a=n(751615),s=n(202351),c=n(707961),l=n(84441),u=n(61541),f=n(327499),d=n(842629),p=n(517716),h=n(734691),E=n(316878),y=n(945235),m=n(173242),b=n(93191),g=n(391186),O=n(744564),v=n(961337),_=n(301928),I=n(979197),S=n(61209),T=n(50433),N=n(992625),A=n(563367),C=n(715107),P=n(464187),j=n(407561),R=n(258104),x=n(283133),M=n(2590);function w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D(e){D=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return D(e)}function Z(e,t){return!t||"object"!==k(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function L(e,t){
L=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return L(e,t)}var U,k=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function G(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=D(e);if(t){var o=D(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Z(this,n)}}function B(){var e=A.Z.getChannelId(),t=R.ZP.getSelfEmbeddedActivityForChannel(null!=e?e:""),n=S.Z.getChannel(e);return null==e||null==n||null==t?function(){var e=U;if(null!=e&&N.Z.isOpen(e)){O.Z.wait((function(){return v.xv(e)}));U=null}}():function(e,t){if(N.Z.isOpen(t))return!1;O.Z.wait((function(){return v.bA(t,M.NYg.EMBED_IFRAME,{channel:e})}));U=t}(n,(0,x.Z)(n.id,t.application_id))}
function H(){var e,t=T.Z.hasLayers(),n=I.Z.getWindowOpen(M.KJ3.CHANNEL_CALL_POPOUT);return t&&!n?void(null!=(e=U)&&N.Z.isOpen(e)&&O.Z.wait((function(){return v.Cp(e)}))):function(){var e=U;null!=e&&N.Z.isOpen(e)&&O.Z.wait((function(){return v.$Z(e)}))}()}var V=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&L(e,t)}(n,e);var t=G(n);function n(){w(this,n);return t.apply(this,arguments)}var r=n.prototype;r._initialize=function(){C.Z.addChangeListener(B);P.Z.addChangeListener(B);A.Z.addChangeListener(B);j.Z.addChangeListener(B);I.Z.addChangeListener(B);R.ZP.addChangeListener(B);T.Z.addChangeListener(H)};r._terminate=function(){C.Z.removeChangeListener(B);P.Z.removeChangeListener(B);A.Z.removeChangeListener(B);j.Z.removeChangeListener(B);I.Z.removeChangeListener(B);R.ZP.removeChangeListener(B)
;T.Z.removeChangeListener(H)};r.__getLocalVars=function(){return{openEmbedId:U}};return n}(_.Z);const F=new V;var Y=n(473903),z=n(189041),W=n(999357),K=n(784426),q=n(443812),X=n(348592),Q=n(473708),$=n(982629),J=n.n($);function ee(){(0,z.qV)();(0,K.uL)(M.Z5c.LOGIN)}function te(e){var t=e.underageMessage,o=e.transitionState,i=(0,q.Dt)();return(0,r.jsxs)(c.Y0X,{transitionState:o,size:c.CgR.SMALL,"aria-labelledby":i,impressionName:W.zs.USER_AGE_GATE_UNDERAGE,impressionProperties:{existing_user:!0},children:[(0,r.jsx)(c.hzk,{children:(0,r.jsxs)("div",{className:J().container,children:[(0,r.jsx)("img",{alt:"",src:n(697694),className:J().img}),(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:J().title,id:i,children:Q.Z.Messages.AGE_GATE_UNDERAGE_EXISTING_HEADER}),(0,r.jsx)(c.xvT,{color:"header-secondary",className:J().subtitle,variant:"text-sm/normal",children:Q.Z.Messages.AGE_GATE_UNDERAGE_BODY.format({
underageMessage:null!=t?t:Q.Z.Messages.AGE_GATE_UNDERAGE_BODY_DEFAULT_REG_MESSAGE,helpURL:X.Z.getArticleURL(M.BhN.AGE_GATE)})}),(0,r.jsx)(c.xvT,{color:"header-secondary",className:J().subtitle,variant:"text-sm/normal",children:Q.Z.Messages.AGE_GATE_UNDERAGE_EXISTING_BODY_DELETION_WITH_DAYS.format({days:30})})]})}),(0,r.jsx)(c.mzw,{children:(0,r.jsx)(c.zxk,{size:c.PhG.SMALL,fullWidth:!0,onClick:ee,children:Q.Z.Messages.AGE_GATE_UNDERAGE_BACK_TO_LOGIN})})]})}var ne=n(938385),re=n.n(ne);function oe(e){var t=e.transitionState,o=(0,q.Dt)();return(0,r.jsxs)(c.Y0X,{transitionState:t,size:c.CgR.SMALL,"aria-labelledby":o,impressionName:W.zs.USER_AGE_GATE,impressionProperties:{existing_user:!0},children:[(0,r.jsx)(c.hzk,{children:(0,r.jsxs)("div",{className:re().container,children:[(0,r.jsx)("img",{alt:"",src:n(145911),className:re().img}),(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:re().title,id:o,children:Q.Z.Messages.AGE_GATE_AGE_VERIFIED}),(0,r.jsx)(c.xvT,{
color:"header-secondary",className:re().subtitle,variant:"text-sm/normal",children:Q.Z.Messages.AGE_GATE_AGE_VERIFIED_BODY})]})}),(0,r.jsx)(c.mzw,{children:(0,r.jsx)(c.zxk,{size:c.PhG.SMALL,fullWidth:!0,onClick:function(){(0,z.qV)()},autoFocus:!0,children:Q.Z.Messages.CLOSE})})]})}var ie=n(561210);function ae(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function se(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ae(i,r,o,a,s,"next",e)}function s(e){ae(i,r,o,a,s,"throw",e)}a(void 0)}))}}function ce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function le(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function ue(e){ue=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return ue(e)}function fe(e){
for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){le(e,t,n[t])}))}return e}function de(e,t){return!t||"object"!==he(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function pe(e,t){pe=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return pe(e,t)}var he=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Ee(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){
var n,r=ue(e);if(t){var o=ue(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return de(this,n)}}var ye=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}
if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function me(e,t){var n;if(null!=e){var r=Y.default.getCurrentUser();(null===(n=S.Z.getChannel(t))||void 0===n?void 0:n.isNSFW())&&null!=r&&null==r.nsfwAllowed&&(0,z.mN)(ie.L0.NSFW_CHANNEL)}}var be=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&pe(e,t)}(o,e);var t=Ee(o);function o(){ce(this,o);return t.apply(this,arguments)}var i=o.prototype;i._initialize=function(){O.Z.subscribe("CONNECTION_OPEN",this.handleConnectionOpen);O.Z.subscribe("CHANNEL_SELECT",this.handleChannelSelect);O.Z.subscribe("AGE_GATE_MODAL_OPEN",this.handleAgeGateModalOpen)
;O.Z.subscribe("AGE_GATE_MODAL_CLOSE",this.handleAgeGateModalClose);O.Z.subscribe("AGE_GATE_SUCCESS_MODAL_OPEN",this.handleAgeGateSuccess);O.Z.subscribe("AGE_GATE_FAILURE_MODAL_OPEN",this.handleAgeGateFailure)};i._terminate=function(){O.Z.unsubscribe("CONNECTION_OPEN",this.handleConnectionOpen);O.Z.unsubscribe("CHANNEL_SELECT",this.handleChannelSelect);O.Z.unsubscribe("AGE_GATE_MODAL_OPEN",this.handleAgeGateModalOpen);O.Z.unsubscribe("AGE_GATE_MODAL_CLOSE",this.handleAgeGateModalClose);O.Z.unsubscribe("AGE_GATE_SUCCESS_MODAL_OPEN",this.handleAgeGateSuccess);O.Z.unsubscribe("AGE_GATE_FAILURE_MODAL_OPEN",this.handleAgeGateFailure)};i.handleChannelSelect=function(e){me(e.guildId,e.channelId)};i.handleConnectionOpen=function(){me(P.Z.getGuildId(),C.Z.getChannelId())};i.handleAgeGateModalOpen=function(){(0,c.ZDy)(se((function(){var e,t;return ye(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(24209)]).then(n.bind(n,824209))];case 1:e=o.sent(),t=e.default
;return[2,function(e){return(0,r.jsx)(t,fe({},e))}]}}))})),{modalKey:ie.dG,onCloseRequest:M.dG4})};i.handleAgeGateSuccess=function(){(0,c.oav)(ie.dG,(function(e){return(0,r.jsx)(oe,fe({},e))}))};i.handleAgeGateFailure=function(e){var t=e.underageMessage;(0,c.oav)(ie.dG,(function(e){return(0,r.jsx)(te,fe({underageMessage:t},e))}))};i.handleAgeGateModalClose=function(){(0,c.Mr3)(ie.dG)};i.__getLocalVars=function(){return{}};return o}(_.Z);const ge=new be;var Oe=n(495414),ve=n(458648),_e=n(630631),Ie=n(652591);function Se(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Te(e){Te=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Te(e)}function Ne(e,t){return!t||"object"!==Ce(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ae(e,t){Ae=Object.setPrototypeOf||function(e,t){
e.__proto__=t;return e};return Ae(e,t)}var Ce=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Pe(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Te(e);if(t){var o=Te(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ne(this,n)}}var je="LATEST_HEARTBEAST_EVENT_TIMESTAMP",Re=null,xe=null,Me=null,we=new Oe.Z("Heartbeast");function De(){(0,ve.R_)();var e=function(){var e=Me;null==e&&(e=_e.Z.get(je));null==e&&(e=0);return e}();if(null==e)Ue(!1);else{var t=9e5+e-Date.now();t>0?null==xe&&(xe=setTimeout((function(){Ue(!0)}),t)):Ue(!1)}}function Ze(){(0,ve.lj)();if(null!=Re){clearInterval(Re);Re=null}if(null!=xe){clearTimeout(xe);xe=null}}function Le(){Ge(0);De()}
function Ue(e){if(null==Re){ke(e);Re=setInterval((function(){ke(!1)}),9e5)}}function ke(e){var t=(0,ve.R_)(e);Ie.default.track(M.rMx.CLIENT_HEARTBEAT,{client_heartbeat_initialization_timestamp:t.initialized,client_heartbeat_version:5});Ge(Date.now())}function Ge(e){Me=e;_e.Z.set(je,e)}var Be=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Ae(e,t)}(n,e);var t=Pe(n);function n(){Se(this,n);var e;(e=t.apply(this,arguments)).connectionState=null;e.focusedOrForegrounded=!0;e.shouldTrackHeartbeat=function(){return e.focusedOrForegrounded||null!=e.connectionState&&e.connectionState!==M.hes.DISCONNECTED&&e.connectionState!==M.hes.RTC_DISCONNECTED};e.scheduleHeartbeatTracking=function(){e.shouldTrackHeartbeat()?De():Ze()};e.handleLogin=function(){Le()};e.handleRTCStateChange=function(){var t=A.Z.getState()
;if(e.connectionState!==t){e.connectionState=t;we.log("RTC Connection Changed",t);e.scheduleHeartbeatTracking()}};e.handleWindowFocus=function(t){var n=t.focused;e.focusedOrForegrounded=n;e.scheduleHeartbeatTracking()};e.handleAppStateUpdate=function(t){var n=t.state;e.focusedOrForegrounded=n===M.$7l.ACTIVE;e.scheduleHeartbeatTracking()};return e}var r=n.prototype;r._initialize=function(){A.Z.addChangeListener(this.handleRTCStateChange);O.Z.subscribe("WINDOW_FOCUS",this.handleWindowFocus);O.Z.subscribe("APP_STATE_UPDATE",this.handleAppStateUpdate);O.Z.subscribe("LOGIN_SUCCESS",this.handleLogin);De()};r._terminate=function(){A.Z.removeChangeListener(this.handleRTCStateChange);O.Z.unsubscribe("WINDOW_FOCUS",this.handleWindowFocus);O.Z.unsubscribe("APP_STATE_UPDATE",this.handleAppStateUpdate);O.Z.unsubscribe("LOGIN_SUCCESS",this.handleLogin);Ze()};r.__getLocalVars=function(){return{HEARTBEAT_VERSION:5,HEARTBEAT_FREQUENCY_MINS:15,LATEST_HEARTBEAT_EVENT_TIMESTAMP:je,heartbeatIntervalId:Re,
heartbeatTimeoutId:xe,lastHeartbeatEventTimestamp:Me,logger:we}};return n}(_.Z);const He=new Be;var Ve=n(61200),Fe=n(656645),Ye=n(736097),ze=n(671723),We=n(901654),Ke=n(36256);function qe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xe(e){Xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Xe(e)}function Qe(e,t){return!t||"object"!==Je(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function $e(e,t){$e=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return $e(e,t)}var Je=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function et(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{
Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Xe(e);if(t){var o=Xe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Qe(this,n)}}var tt=new Set,nt=new Set,rt=null;function ot(){var e=!0,t=!1,n=void 0;try{for(var r,o=tt[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var i=r.value;Fe.Z.setDisableLocalVideo(i,!1,Ke.Yn.DEFAULT,!1)}}catch(e){t=!0;n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}nt.clear();tt.clear()}var it=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&$e(e,t)}(n,e);var t=et(n);function n(){qe(this,n);var e;(e=t.apply(this,arguments)).handleWindowFocus=function(e){e.focused&&ot()};e.handleVoiceChannelSelect=function(e){var t=e.channelId
;if(t!==rt){ot();rt=t}};e.handlePopoutChange=function(){I.Z.getWindowFocused(M.KJ3.CHANNEL_CALL_POPOUT)&&ot()};return e}var r=n.prototype;r._initialize=function(){O.Z.subscribe("RTC_CONNECTION_VIDEO",this.handleIncomingVideo);O.Z.subscribe("AUDIO_SET_LOCAL_VIDEO_DISABLED",this.handleManualLocalVideoToggle);O.Z.subscribe("WINDOW_FOCUS",this.handleWindowFocus);O.Z.subscribe("VOICE_CHANNEL_SELECT",this.handleVoiceChannelSelect);I.Z.addChangeListener(this.handlePopoutChange)};r._terminate=function(){O.Z.unsubscribe("RTC_CONNECTION_VIDEO",this.handleIncomingVideo);O.Z.unsubscribe("AUDIO_SET_LOCAL_VIDEO_DISABLED",this.handleManualLocalVideoToggle);O.Z.unsubscribe("WINDOW_FOCUS",this.handleWindowFocus);O.Z.unsubscribe("VOICE_CHANNEL_SELECT",this.handleVoiceChannelSelect);I.Z.removeChangeListener(this.handlePopoutChange);ot();rt=null};r.handleIncomingVideo=function(e){var t=e.userId,n=e.context,r=e.streamId;if(n===Ke.Yn.DEFAULT&&null!=r){
var o=null!=ze.ZP.getCurrentGame(),i=We.Z.isFocused(),a=I.Z.getWindowFocused(M.KJ3.CHANNEL_CALL_POPOUT),s=Ye.Z.isLocalVideoDisabled(t,n),c=nt.has(t);if(o&&!i&&!a&&!s&&!c){tt.add(t);Fe.Z.setDisableLocalVideo(t,!0,n,!1)}}};r.handleManualLocalVideoToggle=function(e){var t=e.userId;if(e.persist){nt.add(t);tt.delete(t)}};r.__getLocalVars=function(){return{tempVideoMutes:tt,manualOverrides:nt,currentVoiceChannelId:rt}};return n}(_.Z);const at=new it;var st=n(64234),ct=n(769321),lt=n(473419),ut=n(72725),ft=n(846531),dt=n(413804);function pt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ht(e){ht=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return ht(e)}function Et(e,t){return!t||"object"!==mt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function yt(e,t){
yt=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return yt(e,t)}var mt=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function bt(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=ht(e);if(t){var o=ht(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Et(this,n)}}var gt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&yt(e,t)}(n,e);var t=bt(n);function n(){pt(this,n);var e;(e=t.apply(this,arguments))._updateBackgroundGradientPresetId=function(t){
if(e._currentBackgroundGradientPresetId!==t)if(null!=t){(0,ut.zO)(t);e._currentBackgroundGradientPresetId=t}else{(0,ut.xs)();e._currentBackgroundGradientPresetId=void 0}};e._updateBackgroundGradientAngle=function(t){if(e._currentBackgroundGradientAngle!==t)if(null!=t){(0,ut.X9)(t);e._currentBackgroundGradientPresetId=t}else{(0,ut.Bf)();e._currentBackgroundGradientAngle=void 0}};e._updateClientTheme=function(){if(ft.W.getCurrentConfig({}).hasClientThemes){var t=ct.L1.getSetting(),n=t.backgroundGradientPresetId,r=t.backgroundGradientAngle;if(null==n||dt.qt[n].theme===st.Z.theme){e._updateBackgroundGradientPresetId(n);e._updateBackgroundGradientAngle(r)}else e._resetClientTheme()}else e._resetClientTheme()};return e}var r=n.prototype;r._initialize=function(){lt.Z.addChangeListener(this._updateClientTheme);st.Z.addChangeListener(this._updateClientTheme);ft.W.subscribe({},this._updateClientTheme)};r._terminate=function(){lt.Z.removeChangeListener(this._updateClientTheme)
;st.Z.removeChangeListener(this._updateClientTheme)};r._resetClientTheme=function(){(0,ut.xs)();(0,ut.Bf)();this._currentBackgroundGradientPresetId=void 0;this._currentBackgroundGradientAngle=void 0};r.__getLocalVars=function(){return{}};return n}(_.Z);const Ot=new gt;function vt(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function _t(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){vt(i,r,o,a,s,"next",e)}function s(e){vt(i,r,o,a,s,"throw",e)}a(void 0)}))}}function It(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function St(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Tt(e){Tt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Tt(e)}function Nt(e,t){
return!t||"object"!==Ct(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function At(e,t){At=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return At(e,t)}var Ct=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Pt(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Tt(e);if(t){var o=Tt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Nt(this,n)}}var jt=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},
"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Rt="CONNECTIONS_GRID_MODAL_KEY",xt=function(e){!function(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&At(e,t)}(o,e);var t=Pt(o);function o(){It(this,o);return t.apply(this,arguments)}var i=o.prototype;i._initialize=function(){O.Z.subscribe("CONNECTIONS_GRID_MODAL_SHOW",this.handleShow);O.Z.subscribe("CONNECTIONS_GRID_MODAL_HIDE",this.handleHide)};i._terminate=function(){O.Z.unsubscribe("CONNECTIONS_GRID_MODAL_SHOW",this.handleShow);O.Z.unsubscribe("CONNECTIONS_GRID_MODAL_HIDE",this.handleHide)};i.handleShow=function(e){var t=e.onComplete,o=e.excludedPlatformTypes,i=e.includedDisabledPlatformTypes,a=e.integrations,s=e.onCompleteApplication;(0,c.nfh)(Rt)||(0,c.ZDy)(_t((function(){var e,c;return jt(this,(function(l){switch(l.label){case 0:return[4,Promise.all([n.e(40532),n.e(53172)]).then(n.bind(n,53172))];case 1:e=l.sent(),c=e.default;return[2,function(e){return(0,r.jsx)(c,function(e){
for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){St(e,t,n[t])}))}return e}({onComplete:t,excludedPlatformTypes:o,includedDisabledPlatformTypes:i,integrations:a,onCompleteApplication:s},e))}]}}))})))};i.handleHide=function(){(0,c.Mr3)(Rt)};i.__getLocalVars=function(){return{CONNECTIONS_GRID_MODAL_KEY:Rt}};return o}(_.Z);const Mt=new xt;var wt=n(454011),Dt=n(401598),Zt=n(567403),Lt=n(120415),Ut=n(43564);function kt(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Gt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){kt(i,r,o,a,s,"next",e)}function s(e){kt(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Bt(e,t){
if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ht(e){Ht=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Ht(e)}function Vt(e,t){return!t||"object"!==Yt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ft(e,t){Ft=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Ft(e,t)}var Yt=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function zt(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Ht(e);if(t){var o=Ht(this).constructor;n=Reflect.construct(r,arguments,o)
}else n=r.apply(this,arguments);return Vt(this,n)}}var Wt=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}
i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Kt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Ft(e,t)}(n,e);var t=zt(n);function n(){Bt(this,n);var e;(e=t.apply(this,arguments)).maybeFetchEligiblity=Gt((function(){var e;return Wt(this,(function(t){switch(t.label){case 0:if(!(0,Lt.nI)()&&!(0,Lt.$L)())return[3,2];e=Object.values(Zt.Z.getGuilds());return e.some((function(e){return(0,Dt.H2)(e)&&!e.hasFeature(M.oNc.ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE)&&!e.hasFeature(M.oNc.CREATOR_MONETIZABLE_RESTRICTED)&&!e.hasFeature(M.oNc.CREATOR_MONETIZABLE_DISABLED)}))?[4,(0,Ut.av)()]:[3,2];case 1:t.sent();t.label=2;case 2:return[2]}}))}));return e}var r=n.prototype;r._initialize=function(){
O.Z.subscribe("CONNECTION_OPEN",this.maybeFetchEligiblity)};r._terminate=function(){O.Z.unsubscribe("CONNECTION_OPEN",this.maybeFetchEligiblity)};r.__getLocalVars=function(){return{}};return n}(_.Z);const qt=new Kt;var Xt=n(188344);const Qt=function(){O.Z.subscribe("CONNECTION_OPEN",(function(){(0,Xt.mc)()}));O.Z.subscribe("LOGOUT",(function(){(0,Xt.mc)()}))};var $t=n(963985);function Jt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function en(e){en=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return en(e)}function tn(e,t){return!t||"object"!==rn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function nn(e,t){nn=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return nn(e,t)}var rn=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}
;function on(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=en(e);if(t){var o=en(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return tn(this,n)}}function an(e){var t=e.channel.id;(0,$t.oC)(t)}var sn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&nn(e,t)}(n,e);var t=on(n);function n(){Jt(this,n);return t.apply(this,arguments)}var r=n.prototype;r._initialize=function(){O.Z.subscribe("CHANNEL_DELETE",an)};r._terminate=function(){O.Z.unsubscribe("CHANNEL_DELETE",an)};r.__getLocalVars=function(){return{}};return n}(_.Z)
;const cn=new sn;var ln=n(418705),un=n(896490),fn=n(27851),dn=n(682776),pn=n(854602),hn=n(458947);function En(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function yn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){En(i,r,o,a,s,"next",e)}function s(e){En(i,r,o,a,s,"throw",e)}a(void 0)}))}}function mn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bn(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function gn(e){gn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return gn(e)}function On(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e)
;t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function vn(e,t){return!t||"object"!==In(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _n(e,t){_n=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return _n(e,t)}var In=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Sn(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=gn(e);if(t){var o=gn(this).constructor;n=Reflect.construct(r,arguments,o)
}else n=r.apply(this,arguments);return vn(this,n)}}var Tn=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}
i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Nn=function(e){var t,n=Zt.Z.getGuild(e),r=Boolean(null==n?void 0:n.hasFeature(M.oNc.COMMUNITY)),o=dn.Z.can(M.Plq.MANAGE_CHANNELS,n),i=(0,un.un)(ln.z$.FORUM_CHANNEL_UPSELL_MODAL),a=null!==(t=fn.Z.getMemberCount(e))&&void 0!==t?t:0;return r&&o&&!i&&a>=200},An=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&_n(e,t)}(o,e);var t=Sn(o);function o(){mn(this,o);return t.apply(this,arguments)}var i=o.prototype;i._initialize=function(){O.Z.subscribe("CHANNEL_SELECT",this.handleChannelSelect)};i._terminate=function(){O.Z.unsubscribe("CHANNEL_SELECT",this.handleChannelSelect)};i.handleChannelSelect=function(e){var t=e.guildId;if(null!=t){if(Nn(t)){(0,pn.qz)();(0,
un.kk)(ln.z$.FORUM_CHANNEL_UPSELL_MODAL);(0,c.ZDy)(yn((function(){var e,o;return Tn(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(74562)]).then(n.bind(n,274562))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,On(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){bn(e,t,n[t])}))}return e}({},e),{onClose:function(t){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hn.L.DISMISS;(0,un.EW)(ln.z$.FORUM_CHANNEL_UPSELL_MODAL,{dismissAction:e})}(t);e.onClose()},guildId:t,shouldUpsellCreation:!0}))}]}}))})),{onCloseCallback:function(){return(0,un.EW)(ln.z$.FORUM_CHANNEL_UPSELL_MODAL,{dismissAction:hn.L.DISMISS})},onCloseRequest:M.VqG})}}};i.__getLocalVars=function(){
return{MINIMUM_MEMBER_COUNT_FOR_UPSELL:200,isEligibleForForumChannelUpsell:Nn}};return o}(_.Z);const Cn=new An;var Pn=n(875700),jn=n(296602),Rn=n(959207),xn={};function Mn(e){var t=e.name,n=e.hash,r=e.missingData;Rn.Z.markGameReported(t);var o=!0,i=!1,a=void 0;try{for(var s,c=r[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){var l=s.value;if("icon"===l){var u=xn[t];null!=u&&Pn.Z.uploadIcon(t,n,u);return}new jn.Z("GameStoreIconManager").log("Could not find missing data key: ".concat(l))}}catch(e){i=!0;a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}}function wn(e){var t=e.gameName,n=e.icon;xn[t]=n}const Dn=function(){O.Z.subscribe("UNVERIFIED_GAME_UPDATE",Mn);O.Z.subscribe("GAME_ICON_UPDATE",wn)};var Zn=n(314620),Ln=n(761814);function Un(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kn(e){kn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return kn(e)}function Gn(e,t){
return!t||"object"!==Hn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Bn(e,t){Bn=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Bn(e,t)}var Hn=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Vn(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=kn(e);if(t){var o=kn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Gn(this,n)}}var Fn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{
value:e,writable:!0,configurable:!0}});t&&Bn(e,t)}(n,e);var t=Vn(n);function n(){Un(this,n);var e;(e=t.apply(this,arguments)).handleConnectionOpen=function(){Ln.Z.fetched||(0,Zn.b8)();Pn.Z.getDetectableGames()};return e}var r=n.prototype;r._initialize=function(){O.Z.subscribe("CONNECTION_OPEN",this.handleConnectionOpen)};r._terminate=function(){O.Z.unsubscribe("CONNECTION_OPEN",this.handleConnectionOpen)};r.__getLocalVars=function(){return{}};return n}(_.Z);const Yn=new Fn;var zn=n(964283),Wn=n(944751);function Kn(e){!function(e){var t=Wn.Z.launchableGames[e],n=Rn.Z.getGame(e);(null!=n?zn.Z.isLaunchable(n):zn.Z.isGameLaunchable(e)).then((function(n){n!==t&&O.Z.dispatch({type:"GAME_LAUNCHABLE_UPDATE",gameId:e,isLaunchable:n})}))}(e.gameId)}const qn=function(){O.Z.subscribe("CHECK_LAUNCHABLE_GAME",Kn)};var Xn=n(325213);const Qn=function(){Ln.Z.whenInitialized((function(){null!=Xn.Z.testModeApplicationId&&(0,p.Wt)(Xn.Z.testModeApplicationId,Xn.Z.testModeOriginURL)}))}
;var $n=n(951442),Jn=n(736818),er=n(499542);function tr(){if((0,er.Q)()){var e=Jn.default.getToken(),t=Jn.default.getId();if(null==e)throw new Error("missing user token");$n.S1(e,t)}}function nr(){$n.ob()}const rr=function(){O.Z.subscribe("CONNECTION_OPEN",tr);O.Z.subscribe("LOGOUT",nr)};var or=n(44700),ir=n(224813),ar=n(426307);function sr(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function cr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){sr(i,r,o,a,s,"next",e)}function s(e){sr(i,r,o,a,s,"throw",e)}a(void 0)}))}}var lr=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{
if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function ur(){ur=cr((function(e){var t,r,o,i;return lr(this,(function(a){switch(a.label){case 0:t=e.code;return[4,(0,ar.Z)(t)];case 1:r=a.sent();return null==(o=r.invite)||null==o.guild?[2]:[4,fr()];case 2:a.sent()
;return null==Zt.Z.getGuild(o.guild.id)?[2]:[4,Promise.resolve().then(n.bind(n,788533))];case 3:i=a.sent();return[4,(0,i.default)({guildId:o.guild.id})];case 4:a.sent();ir.Z.transitionToInvite(o);return[2]}}))}));return ur.apply(this,arguments)}function fr(){return new Promise((function(e){Zt.Z.addConditionalChangeListener((function(){if(Zt.Z.isLoaded()){e();return!1}return!0}))}))}var dr=n(382840),pr=n(703790);function hr(e,t){var n,r=null===(n=null==t?void 0:t.replace(/-/g,"_"))||void 0===n?void 0:n.toUpperCase();if(null!=r&&r in e)return e[r]}function Er(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function yr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Er(i,r,o,a,s,"next",e)}function s(e){Er(i,r,o,a,s,"throw",e)}a(void 0)}))}}function mr(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}
var br=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}
if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function gr(e){(0,c.ZDy)(yr((function(){var t,o;return br(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(17827)]).then(n.bind(n,617827))];case 1:t=i.sent(),o=t.default;return[2,function(t){return(0,r.jsx)(o,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){mr(e,t,n[t])}))}return e}({},t,e))}]}}))})),{modalKey:"Guild Settings Picker Modal"})}var Or=n(115617),vr=n(630670);const _r=function(){O.Z.subscribe("VOICE_CHANNEL_SELECT",(function(e){null==e.channelId&&Or.Kw(vr.v.VOICE_PANEL_INTRODUCTION)}))}
;var Ir=n(356639),Sr=n(993754),Tr=n(481008),Nr=n(929370),Ar=n(468235),Cr=n(306263),Pr=n(177570),jr=n(375759),Rr=n(924066),xr=n(866926),Mr=n(944514);var wr=n(182306),Dr=n(229400),Zr=n(607313),Lr=n(793461),Ur=n(304275),kr=n(674482),Gr=n(962392);function Br(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hr(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Vr(e){Vr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Vr(e)}function Fr(e,t){return!t||"object"!==Wr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Yr(e,t){Yr=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Yr(e,t)}var zr,Wr=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Kr(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Vr(e);if(t){var o=Vr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Fr(this,n)}}function qr(){var e=C.Z.getVoiceChannelId(),t=S.Z.getChannel(e);return(0,Dr.O)()&&(0,wr.Z)(t)}var Xr=(Hr(zr={},M.kg4.TOGGLE_PRIORITY_SPEAKER,{onTrigger:function(){},keyEvents:{}}),Hr(zr,M.kg4.UNASSIGNED,{onTrigger:function(){},keyEvents:{}}),Hr(zr,M.kg4.PUSH_TO_TALK,{onTrigger:function(e,t){if(Ye.Z.getMode(t)===M.pM4.PUSH_TO_TALK){Xr[M.kg4.PUSH_TO_TALK].isPressed=e;Ye.Z.getMediaEngine().eachConnection((function(t){return t.setForceAudioInput(e,!1)}),t)}},keyEvents:{keyup:!0,keydown:!0},isPressed:!1}),Hr(zr,M.kg4.PUSH_TO_TALK_PRIORITY,{onTrigger:function(e){
if(Ye.Z.getMode()===M.pM4.PUSH_TO_TALK){Xr[M.kg4.PUSH_TO_TALK_PRIORITY].isPressed=e;Ye.Z.getMediaEngine().eachConnection((function(t){return t.setForceAudioInput(e,!0)}),Ke.Yn.DEFAULT)}},keyEvents:{keyup:!0,keydown:!0},isPressed:!1}),Hr(zr,M.kg4.PUSH_TO_MUTE,{onTrigger:function(e){if(Ye.Z.getMode()===M.pM4.VOICE_ACTIVITY&&!Ye.Z.isSelfDeaf()){Xr[M.kg4.PUSH_TO_MUTE].isPressed=e;Fe.Z.setTemporarySelfMute(e)}},keyEvents:{keyup:!0,keydown:!0},isPressed:!1}),Hr(zr,M.kg4.TOGGLE_MUTE,{onTrigger:function(){return Fe.Z.toggleSelfMute()},keyEvents:{keyup:!0,keydown:!1}}),Hr(zr,M.kg4.TOGGLE_DEAFEN,{onTrigger:function(){Fe.Z.toggleSelfDeaf()},keyEvents:{keyup:!0,keydown:!1}}),Hr(zr,M.kg4.TOGGLE_VOICE_MODE,{onTrigger:function(){var e=Ye.Z.getMode()===M.pM4.PUSH_TO_TALK?M.pM4.VOICE_ACTIVITY:M.pM4.PUSH_TO_TALK;Fe.Z.setMode(e)},keyEvents:{keyup:!0,keydown:!1}}),Hr(zr,M.kg4.TOGGLE_OVERLAY,{onTrigger:function(){var e=Ur.Z.enabled;Sr.Z.setEnabled(!e)},keyEvents:{keyup:!0,keydown:!1}}),
Hr(zr,M.kg4.TOGGLE_OVERLAY_INPUT_LOCK,{onTrigger:function(e){var t=(0,Gr.Z)();null!=t&&(e?Sr.Z.setUILocked(!kr.Z.isUILocked(t),t):Sr.Z.setInputLocked(!Ur.Z.isInputLocked(t),t))},keyEvents:{keyup:!0,keydown:!0}}),Hr(zr,M.kg4.OVERLAY_ACTIVATE_REGION_TEXT_WIDGET,{onTrigger:function(){var e=Ur.Z.getFocusedPID();null!=e&&(null!=e||!1)&&kr.Z.isPinned(M.Odu.TEXT)&&Ur.Z.isReady(e)&&Ur.Z.isInputLocked(e)&&Sr.Z.activateRegion(M.O0n.TEXT_WIDGET)},keyEvents:{keyup:!0,keydown:!1}}),Hr(zr,M.kg4.TOGGLE_GO_LIVE_STREAMING,{onTrigger:function(){var e=Pr.Z.getCurrentUserActiveStream();if(null!=e)return(0,Tr.g)((0,Cr.V9)(e));!function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!(0,xr.Z)(Ye.Z))return!1;if(null!=Pr.Z.getCurrentUserActiveStream())return!1;var t=(0,Mr.Z)(ze.ZP,jr.Z);if(null==t)return!1;if(t.isLauncher&&!e)return!1;var n=C.Z.getVoiceChannelId(),r=S.Z.getChannel(n);if(null==r)return!1;var o=r.getGuildId();if(!(0,Rr.JL)(r,Zt.Z,dn.Z,!1))return!1;(0,Tr.WH)(o,r.id,{
pid:t.pid})}()},keyEvents:{keyup:!0,keydown:!1}}),Hr(zr,M.kg4.TOGGLE_STREAMER_MODE,{onTrigger:function(){Nr.Z.setEnabled(!Lr.Z.enabled)},keyEvents:{keyup:!0,keydown:!1}}),Hr(zr,M.kg4.NAVIGATE_BACK,{onTrigger:function(){return(0,K.op)()},keyEvents:{keyup:!0,keydown:!1,focused:!0,blurred:!1}}),Hr(zr,M.kg4.NAVIGATE_FORWARD,{onTrigger:function(){return(0,K.eH)()},keyEvents:{keyup:!0,keydown:!1,focused:!0,blurred:!1}}),Hr(zr,M.kg4.SOUNDBOARD,{onTrigger:function(){if(qr()){var e=(0,Gr.Z)();null!=e&&(kr.Z.isUILocked(e)?(0,Zr.IN)(!0,e):(0,Zr.oZ)(e))}},keyEvents:{keyup:!0,keydown:!1}}),Hr(zr,M.kg4.SOUNDBOARD_HOLD,{onTrigger:function(e){if(qr()){var t=(0,Gr.Z)();null==t||(e?(0,Zr.IN)(!1,t):(0,Zr.oZ)(t))}},keyEvents:{keyup:!0,keydown:!0}}),Hr(zr,M.kg4.SAVE_CLIP,{onTrigger:function(){(0,Ar.C1)()},keyEvents:{keyup:!1,keydown:!0}}),zr),Qr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
;e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Yr(e,t)}(n,e);var t=Kr(n);function n(){Br(this,n);return t.apply(this,arguments)}var r=n.prototype;r._initialize=function(){O.Z.wait((function(){return O.Z.dispatch({type:"KEYBINDS_REGISTER_GLOBAL_KEYBIND_ACTIONS",keybinds:Xr})}))};r._terminate=function(){};r.__getLocalVars=function(){return{KEYBINDS:Xr}};return n}(_.Z);const $r=new Qr;var Jr=n(668403);const eo=function(){O.Z.dispatch({type:"MOBILE_WEB_SIDEBAR_CLOSE"})},to=function(){O.Z.dispatch({type:"MOBILE_WEB_SIDEBAR_OPEN"})};var no=n(289283);function ro(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oo(e){oo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return oo(e)}function io(e,t){return!t||"object"!==so(t)&&"function"!=typeof t?function(e){
if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ao(e,t){ao=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return ao(e,t)}var so=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function co(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=oo(e);if(t){var o=oo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return io(this,n)}}var lo=!1;var uo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&ao(e,t)}(n,e)
;var t=co(n);function n(){ro(this,n);return t.apply(this,arguments)}var r=n.prototype;r.getIsOpen=function(){return!no.tq||lo};r.__getLocalVars=function(){return{isSidebarOpen:lo}};return n}(s.ZP.Store);uo.displayName="MobileWebSidebarStore";const fo=new uo(O.Z,{MOBILE_WEB_SIDEBAR_OPEN:function(){lo=!0},MOBILE_WEB_SIDEBAR_CLOSE:function(){lo=!1}});var po=n(226613),ho=n(102921),Eo=new Date("06/16/2020");var yo=n(852626),mo=n(276985),bo=n(415879),go=n(135750),Oo=n(102909),vo=n(837067),_o=n(72580),Io=n(88415),So=n(239527),To=n(936323),No=n(199790),Ao=n(571680);function Co(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Po(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function jo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Po(i,r,o,a,s,"next",e)}function s(e){Po(i,r,o,a,s,"throw",e)}a(void 0)}))}}
function Ro(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xo(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Mo(e){Mo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Mo(e)}function wo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){xo(e,t,n[t])}))}return e}function Do(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))
;n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Zo(e,t){return!t||"object"!==ko(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Lo(e,t){Lo=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Lo(e,t)}function Uo(e){return function(e){if(Array.isArray(e))return Co(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Co(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Co(e,t)}(e)||function(){
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ko=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Go(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Mo(e);if(t){var o=Mo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Zo(this,n)}}var Bo,Ho=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){
if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Vo(){null!=Bo&&(0,c.Mr3)(Bo)}var Fo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
;e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Lo(e,t)}(o,e);var t=Go(o);function o(){Ro(this,o);return t.apply(this,arguments)}var i=o.prototype;i._initialize=function(){O.Z.subscribe("CONNECTION_OPEN",this.handleConnectionOpen);O.Z.subscribe("LOGOUT",Vo)};i._terminate=function(){O.Z.unsubscribe("CONNECTION_OPEN",this.handleConnectionOpen);O.Z.unsubscribe("LOGOUT",Vo)};i.handleConnectionOpen=function(){var e=Io.Z.getType();if(null!=e){switch(e){case So.M5.INVITE_UNCLAIMED:bo.Z.flowStart(Ao.MK.INVITE,Ao.EW.NUF_STARTED);break;case So.M5.ORGANIC_REGISTERED:bo.Z.flowStart(Ao.MK.ORGANIC,Ao.EW.NUF_STARTED);break;case So.M5.MARKETING_UNCLAIMED:bo.Z.flowStart(Ao.MK.ORGANIC_MARKETING,Ao.EW.NUF_STARTED)}var t=!1,o=P.Z.getGuildId();if(e===So.M5.INVITE_UNCLAIMED){var i=Zt.Z.getGuild(o);if(null==i?void 0:i.hasVerificationGate()){t=!0;(0,go.RM)(i.id)}}var a,s=function(){return 0===vo.Z.totalGuilds&&!Lt.FB
},l=null!=(a=Y.default.getCurrentUser())&&ho.Z.extractTimestamp(a.id)>Eo.getTime()&&!a.isClaimed()&&null==a.nsfwAllowed;!function(e){var t=function(){po.H();bo.Z.flowStep(Ao.MK.ANY,Ao.EW.NUF_COMPLETE,!0)};Uo(e).reverse().forEach((function(e){var n=t;t=function(){e.predicate()?e.open(n):n()}}));t()}([{key:"Unified NUF Modal",open:function(e){return u.apply(this,arguments)},predicate:function(){return s()&&!No.a}},{key:"New User Age Gate",open:yo.i,predicate:function(){return l&&!s()&&!No.a}},{key:"Claim Account Modal",open:function(e){return yo.j(Lt.FB,e)},predicate:function(){var e;return!t&&null!=Y.default.getCurrentUser()&&!(null===(e=Y.default.getCurrentUser())||void 0===e?void 0:e.isClaimed())&&!No.a}},{key:"Verification Gate with Claim Account",open:function(e){return(0,mo.hk)(o,null!=e?e:void 0)},predicate:function(){var e;return t&&!(null===(e=Y.default.getCurrentUser())||void 0===e?void 0:e.isClaimed())&&!No.a}},{key:"Guild Welcome Modal",open:function(e){return(0,
c.ZDy)(jo((function(){var e,t;return Ho(this,(function(i){switch(i.label){case 0:return[4,n.e(5496).then(n.bind(n,705496))];case 1:e=i.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Do(wo({},e),{guildId:o}))}]}}))})),{onCloseCallback:e})},predicate:function(){return null!=o&&null!=Oo.Z.get(o)&&Oo.Z.get(o)!==Oo.a}}])}function u(){u=jo((function(e){var t;return Ho(this,(function(o){switch(o.label){case 0:t=function(e){switch(e){case To.F.AGE_GATE:bo.Z.flowStep(Ao.MK.ANY,Ao.EW.AGE_GATE);break;case To.F.CHOOSE_TEMPLATE:bo.Z.flowStep(Ao.MK.ANY,Ao.X2.GUILD_TEMPLATES);break;case To.F.CUSTOMIZE_GUILD:bo.Z.flowStep(Ao.MK.ANY,Ao.X2.GUILD_CREATE);break;case To.F.CHANNEL_PROMPT:bo.Z.flowStep(Ao.MK.ANY,Ao.X2.CHANNEL_PROMPT);break;case To.F.JOIN_GUILD:bo.Z.flowStep(Ao.MK.ANY,Ao.X2.JOIN_GUILD);break;case To.F.CREATION_INTENT:bo.Z.flowStep(Ao.MK.ANY,Ao.X2.CREATION_INTENT);break;case To.F.COMPLETE:bo.Z.flowStep(Ao.MK.ANY,Ao.X2.SUCCESS);break;case null:break;default:_o.vE(e)}};return[4,(0,
c.ZDy)(jo((function(){var e,o;return Ho(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(95599),n.e(20995),n.e(12671)]).then(n.bind(n,412671))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,Do(wo({},e),{onSlideChange:t}))}]}}))})),{onCloseRequest:M.dG4,onCloseCallback:e,modalKey:Bo})];case 1:Bo=o.sent();return[2]}}))}));return u.apply(this,arguments)}};i.__getLocalVars=function(){return{nufModalKey:Bo}};return o}(_.Z);const Yo=new Fo;var zo=n(998330),Wo=n(896971),Ko=n(494425),qo=n(785085),Xo=n(44616);function Qo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $o(e){$o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return $o(e)}function Jo(e,t){return!t||"object"!==ti(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ei(e,t){
ei=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return ei(e,t)}var ti=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function ni(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=$o(e);if(t){var o=$o(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Jo(this,n)}}var ri=new Set,oi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&ei(e,t)}(n,e);var t=ni(n);function n(){Qo(this,n);var e;(e=t.apply(this,arguments)).handleSettingsUpdate=function(e){var t=e.settings
;t.enabled?(0,zo.T)(Ko.hn.ENABLE_POGGERMODE):!1===t.enabled&&(0,zo.T)(Ko.hn.DISABLE_POGGERMODE);Object.keys(t).some((function(e){return e.startsWith("confetti")}))&&(0,zo.T)(Ko.hn.CUSTOMIZE_CONFETTI)};e.handleMessageCreate=function(e){var t=e.channelId,n=e.message,r=n.author,o=n.nonce,i=n.mentions;if(!qo.Z.isEnabled())return!1;var a=Jn.default.getId();null!=(null==i?void 0:i.find((function(e){return e.id===a})))?(0,zo.T)(Ko.hn.PING_ME):i.length>0&&(null==r?void 0:r.id)===a&&(0,zo.T)(Ko.hn.PING_SOMEONE);if(!(0,Xo.wU)(r.id,a,o,ri))return!1;var s=Xo.ZP.getMostRecentMessageCombo(t),c=(null!=s?s:{}).combo;if(null==c)return!1;Object.values(Ko.hn).forEach((function(e){var t=e;if(null==Wo.Z.getUnlocked(t)){var n=(0,Ko.oX)(t),r=null==n?void 0:n.checkUnlock;null!=r&&!1!==r(c)&&(0,zo.T)(t)}}))};return e}var r=n.prototype;r._initialize=function(){O.Z.subscribe("MESSAGE_CREATE",this.handleMessageCreate);O.Z.subscribe("POGGERMODE_SETTINGS_UPDATE",this.handleSettingsUpdate)};r._terminate=function(){
O.Z.unsubscribe("MESSAGE_CREATE",this.handleMessageCreate);O.Z.unsubscribe("POGGERMODE_SETTINGS_UPDATE",this.handleSettingsUpdate)};r.__getLocalVars=function(){return{trackedMessageNonces:ri}};return n}(_.Z);const ii=new oi;var ai=n(530991);function si(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ci(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function li(e){li=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return li(e)}function ui(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function fi(e,t){return!t||"object"!==pi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function di(e,t){di=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return di(e,t)}var pi=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function hi(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=li(e);if(t){var o=li(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return fi(this,n)}}var Ei=function(e){!function(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&di(e,t)}(n,e);var t=hi(n);function n(){si(this,n);return t.apply(this,arguments)}var o=n.prototype;o._initialize=function(){O.Z.subscribe("POGGERMODE_TEMPORARILY_DISABLED",this.handlePoggermodeTemporarilyDisabled)};o._terminate=function(){O.Z.unsubscribe("POGGERMODE_TEMPORARILY_DISABLED",this.handlePoggermodeTemporarilyDisabled)};o.handlePoggermodeTemporarilyDisabled=function(){(0,c.h7j)((function(e){return(0,r.jsx)(c.sm4,ui(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){ci(e,t,n[t])}))}return e}({},e),{
header:Q.Z.Messages.POGGERMODE_TEMPORARILY_DISABLED_TOAST_TITLE,confirmText:Q.Z.Messages.CONFIRM,confirmButtonColor:c.zxk.Colors.GREEN,children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:Q.Z.Messages.POGGERMODE_TEMPORARILY_DISABLED_TOAST_BODY})}))}))};o.__getLocalVars=function(){return{}};return n}(_.Z);const yi=new Ei;var mi=n(91174),bi=n(15338);n(201126);function gi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oi(e){Oi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Oi(e)}function vi(e,t){return!t||"object"!==Ii(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _i(e,t){_i=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return _i(e,t)}var Ii=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Si(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Oi(e);if(t){var o=Oi(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return vi(this,n)}}var Ti=(0,mi.Un)({createPromise:function(){return n.e(41446).then(n.bind(n,884626))},webpackId:884626,name:"PopoutWindowChannelCall"}),Ni=(0,mi.Un)({createPromise:function(){return n.e(38634).then(n.bind(n,37093))},webpackId:37093,name:"PopoutWindowStageChannelCall"}),Ai=(0,mi.Un)({createPromise:function(){return n.e(41446).then(n.bind(n,344533))},webpackId:344533,name:"PopoutWindowRTCDebug"}),Ci=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{
constructor:{value:e,writable:!0,configurable:!0}});t&&_i(e,t)}(n,e);var t=Si(n);function n(){gi(this,n);return t.apply(this,arguments)}var o=n.prototype;o._initialize=function(){O.Z.subscribe("CHANNEL_CALL_POPOUT_WINDOW_OPEN",this.handleOpenChannelCallPopout);O.Z.subscribe("RTC_DEBUG_POPOUT_WINDOW_OPEN",this.handleOpenRTCDebugPopout)};o._terminate=function(){O.Z.unsubscribe("CHANNEL_CALL_POPOUT_WINDOW_OPEN",this.handleOpenChannelCallPopout);O.Z.unsubscribe("RTC_DEBUG_POPOUT_WINDOW_OPEN",this.handleOpenRTCDebugPopout)};o.handleOpenChannelCallPopout=function(e){var t=e.channel;bi.bA(M.KJ3.CHANNEL_CALL_POPOUT,(function(e){return t.isGuildStageVoice()?(0,r.jsx)(Ni,{windowKey:e,channel:t}):(0,r.jsx)(Ti,{windowKey:e,channel:t})}),{defaultWidth:854,defaultHeight:480})};o.handleOpenRTCDebugPopout=function(){bi.bA(M.KJ3.RTC_DEBUG_POPOUT,(function(e){return(0,r.jsx)(Ai,{windowKey:e})}),{defaultWidth:854,defaultHeight:480})};o.__getLocalVars=function(){return{DEFAULT_POPOUT_WIDTH:854,
DEFAULT_POPOUT_HEIGHT:480,PopoutWindowChannelCall:Ti,PopoutWindowStageChannelCall:Ni,PopoutWindowRTCDebug:Ai}};return n}(_.Z);const Pi=new Ci;var ji=n(853158),Ri=n(397713);function xi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mi(e){Mi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Mi(e)}function wi(e,t){return!t||"object"!==Zi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Di(e,t){Di=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Di(e,t)}var Zi=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Li(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{
Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Mi(e);if(t){var o=Mi(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return wi(this,n)}}var Ui=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Di(e,t)}(n,e);var t=Li(n);function n(){xi(this,n);var e;(e=t.apply(this,arguments)).handleMainWindowFocus=function(t){t.focused&&e.injectWindowAnimationFrame(window)};e.handlePopoutWindowChange=function(){var t=I.Z.getWindowKeys().find((function(e){return I.Z.getWindowFocused(e)}));if(null==t)return e.injectWindowAnimationFrame(window);var n=I.Z.getWindow(t);if(null==n||n.closed)return e.injectWindowAnimationFrame(window);e.injectWindowAnimationFrame(n)};return e}var r=n.prototype
;r._initialize=function(){I.Z.addChangeListener(this.handlePopoutWindowChange);O.Z.subscribe("WINDOW_FOCUS",this.handleMainWindowFocus)};r._terminate=function(){I.Z.removeChangeListener(this.handlePopoutWindowChange);O.Z.unsubscribe("WINDOW_FOCUS",this.handleMainWindowFocus);this.injectWindowAnimationFrame(window)};r.injectWindowAnimationFrame=function(e){var t=function(t){return e.requestAnimationFrame(t)},n=function(t){return e.cancelAnimationFrame(t)};ji.Z.inject.RequestAnimationFrame(t);ji.Z.inject.CancelAnimationFrame(n);Ri.f.setRAF(t,n)};r.__getLocalVars=function(){return{}};return n}(_.Z);const ki=new Ui;var Gi=n(432065),Bi=n(113469),Hi=n(636786),Vi=n(266997);function Fi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yi(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function zi(e){return function(){var t=this,n=arguments
;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Yi(i,r,o,a,s,"next",e)}function s(e){Yi(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Wi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ki(e){Ki=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Ki(e)}function qi(e,t){return!t||"object"!==Qi(t)&&"function"!=typeof t?Fi(e):t}function Xi(e,t){Xi=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Xi(e,t)}var Qi=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Ki(e);if(t){var o=Ki(this).constructor
;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return qi(this,n)}}var Ji=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}
o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ea=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Xi(e,t)}(o,e);var t=$i(o);function o(){Wi(this,o);var e,i=Fi(e=t.apply(this,arguments));e.mayShowAnnouncementModal=zi((function(){var e;return Ji(this,(function(t){switch(t.label){case 0:return Bi.s.isDisallowPopupsSet()?[2]:(0,Vi.Ss)()?[4,i._hasTrialOffer()]:[3,2];case 1:e=t.sent();(0,c.ZDy)(zi((function(){var t,o;return Ji(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(78951)]).then(n.bind(n,178951))];case 1:t=i.sent(),o=t.default;return[2,function(t){return(0,r.jsx)(o,{hasTrialOffer:e,renderModalProps:t})}]}}))})));t.label=2;case 2:return[2]}}))}))
;e._hasTrialOffer=zi((function(){return Ji(this,(function(e){switch(e.label){case 0:e.trys.push([0,3,,4]);return Gi.Z.shouldFetchOffer()?[4,Hi.Z.fetchUserTrialOffer()]:[3,2];case 1:e.sent();e.label=2;case 2:return Gi.Z.hasFetchedOffer()&&Gi.Z.hasAnyUnexpiredOffer()?[2,!0]:[2,!1];case 3:e.sent();return[2,!1];case 4:return[2]}}))}));return e}var i=o.prototype;i._initialize=function(){O.Z.subscribe("CONNECTION_OPEN",this.mayShowAnnouncementModal)};i._terminate=function(){O.Z.unsubscribe("CONNECTION_OPEN",this.mayShowAnnouncementModal)};i.__getLocalVars=function(){return{}};return o}(_.Z);const ta=new ea;var na=n(567834),ra=n(810978),oa="october_upsell_queue_last_shown",ia=new Set([ln.z$.PROFILE_THEMES_FEATURE_EDUCATION_TOOLTIP,ln.z$.ACTIVITIES_NITRO_TUTORIAL_COACH_MARK_V2,ln.z$.PREMIUM_TIER_0_DESKTOP_ANNOUNCEMENT_MODAL,ln.z$.HALLOWEEN_2022_ACTIVITIES_COACH_MARK,ln.z$.APP_DIRECTORY_UPSELL_MODAL,ln.z$.BASH_OUT_COACH_MARK]);function aa(e,t){if(!t)return!1;if((0,un.un)(e))return!1
;if(!ia.has(e))throw new Error("Unexpected upsell type, add new type or use standard DismissibleContent instead");var n=_e.Z.get(oa);if(null!=n&&n.type!==e&&Date.now()-n.timestamp<18e5)return!1;null!=n&&n.type===e||_e.Z.set(oa,{type:e,timestamp:Date.now()});return!0}var sa=n(551778),ca=n(317387),la=n(911018);function ua(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function fa(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ua(i,r,o,a,s,"next",e)}function s(e){ua(i,r,o,a,s,"throw",e)}a(void 0)}))}}function da(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pa(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function ha(e){ha=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return ha(e)}function Ea(e){
for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){pa(e,t,n[t])}))}return e}function ya(e,t){return!t||"object"!==ba(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ma(e,t){ma=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return ma(e,t)}var ba=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function ga(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){
var n,r=ha(e);if(t){var o=ha(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ya(this,n)}}var Oa=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}
if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},va=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&ma(e,t)}(o,e);var t=ga(o);function o(){da(this,o);var e;(e=t.apply(this,arguments)).handleConnectionOpen=function(){if((0,Lt.nI)()||(0,Lt.$L)()){var t=!!e.isEligibleForAnnouncementModal(),n=ca.L.getCurrentConfig({},{autoTrackExposure:t}).enableTier0,r=t&&n;((0,la.SI)()||r)&&(sa.Z.isLoadedForPremiumSKUs()&&sa.Z.isFetchingForPremiumSKUs()||(0,ra.Y2)());r&&e.showAnnouncementModal()}};e.hasDismissedAnnouncement=function(){var e,t=null===(e=lt.Z.settings.userContent)||void 0===e?void 0:e.premiumTier0ModalDismissedAt;return(0,
un.un)(ln.z$.PREMIUM_TIER_0_DESKTOP_MARKETING_PAGE_BADGE)||(0,un.un)(ln.z$.PREMIUM_TIER_0_DESKTOP_MARKETING_PAGE_SETTINGS_BADGE)||null!=t};e.isEligibleForAnnouncementModal=function(){var t=Y.default.getCurrentUser(),n=!!(0,la.C)(t)&&!e.hasDismissedAnnouncement();return aa(ln.z$.PREMIUM_TIER_0_DESKTOP_ANNOUNCEMENT_MODAL,n)};e.showAnnouncementModal=function(){(0,c.ZDy)(fa((function(){var e,t;return Oa(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(1200)]).then(n.bind(n,301200))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Ea({},e))}]}}))})))};return e}var i=o.prototype;i._initialize=function(){O.Z.subscribe("CONNECTION_OPEN",this.handleConnectionOpen)};i._terminate=function(){O.Z.unsubscribe("CONNECTION_OPEN",this.handleConnectionOpen)};i.__getLocalVars=function(){return{}};return o}(_.Z);const _a=new va;var Ia=n(579194),Sa=n(482139),Ta=n(408379),Na=n(850841),Aa=n(921431);function Ca(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value
}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Pa(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ca(i,r,o,a,s,"next",e)}function s(e){Ca(i,r,o,a,s,"throw",e)}a(void 0)}))}}function ja(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ra(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function xa(e){xa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return xa(e)}function Ma(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Ra(e,t,n[t])}))}return e}function wa(e,t){
return!t||"object"!==Za(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Da(e,t){Da=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Da(e,t)}var Za=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function La(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=xa(e);if(t){var o=xa(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return wa(this,n)}}var Ua=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},
"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ka=function(e){!function(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Da(e,t)}(o,e);var t=La(o);function o(){ja(this,o);return t.apply(this,arguments)}var i=o.prototype;i._initialize=function(){O.Z.subscribe("PROFILE_CUSTOMIZATION_OPEN_PREVIEW_MODAL",this.maybeOpenProfilePreviewModal)};i._terminate=function(){O.Z.unsubscribe("PROFILE_CUSTOMIZATION_OPEN_PREVIEW_MODAL",this.maybeOpenProfilePreviewModal)};i.maybeOpenProfilePreviewModal=function(e){var t=e.imageSrc,o=e.file,i=e.uploadType,a=e.guildId,s=e.isTryItOutFlow,l=null!=a?Sa.I5:Ia.I5,u=null!=a?Sa.g_:Ta.g_,f=Y.default.getCurrentUser();if(i===Aa.pC.AVATAR){if(s){(0,Ta.c_)(t);return}if(Na.ZP.canUseAnimatedAvatar(f)||"image/gif"!==o.type){l(t);return}(0,c.ZDy)(Pa((function(){var e,o;return Ua(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(95081)]).then(n.bind(n,195081))]
;case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,Ma({avatarSrc:t,onSubscribe:function(){return l(t)}},e))}]}}))})))}else if(i===Aa.pC.BANNER||i===Aa.pC.BANNER_V2){if(s){(0,Ta.f4)(t);return}if(Na.ZP.canUsePremiumProfileCustomization(f)){u(t);return}(0,c.ZDy)(Pa((function(){var e,o;return Ua(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(95081)]).then(n.bind(n,195081))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,Ma({bannerSrc:t,onSubscribe:function(){return u(t)}},e))}]}}))})))}};i.__getLocalVars=function(){return{}};return o}(_.Z);const Ga=new ka;var Ba,Ha,Va=n(894772),Fa=n(159578),Ya=n(530537),za=n(496486),Wa=n.n(za);!function(e){e[e.UNHANDLED=-1]="UNHANDLED";e[e.NOMINAL=0]="NOMINAL";e[e.FAIR=1]="FAIR";e[e.SERIOUS=2]="SERIOUS";e[e.CRITICAL=3]="CRITICAL"}(Ba||(Ba={}));!function(e){e[e.NONE=0]="NONE";e[e.LIGHT=1]="LIGHT";e[e.MODERATE=2]="MODERATE";e[e.SEVERE=3]="SEVERE";e[e.CRITICAL=4]="CRITICAL"
;e[e.EMERGENCY=5]="EMERGENCY";e[e.SHUTDOWN=6]="SHUTDOWN"}(Ha||(Ha={}));function Ka(e){if((0,Lt.gn)())return e;if(!(0,Lt.Dt)())return Ba.UNHANDLED;switch(e){case Ha.NONE:return Ba.NOMINAL;case Ha.LIGHT:case Ha.MODERATE:return Ba.FAIR;case Ha.SEVERE:return Ba.SERIOUS;case Ha.CRITICAL:case Ha.EMERGENCY:case Ha.SHUTDOWN:return Ba.CRITICAL;default:return Ba.UNHANDLED}}var qa=n(21372),Xa=n(870614),Qa=n(3862),$a=n(491260),Ja=n(840922),es=n(239734),ts=n(282196),ns=n(425636),rs=n(88067);function os(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function is(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){
if(!e)return;if("string"==typeof e)return os(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return os(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var as=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);this.rpcServer=t.server;this.transports=t.transports;this.rpcCommandHandlers=t.commands;this.rpcEventHandlers=t.events;this.stores=t.stores;this.registerTransportsForEmbeddedPlatform=t.registerTransportsForEmbeddedPlatform}var t=e.prototype;t.loadServer=function(){Lt.FB&&this.registerTransportsForEmbeddedPlatform();var e=!0,t=!1,n=void 0;try{
for(var r,o=this.transports[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var i=r.value;this.rpcServer.registerTransport(i)}}catch(e){t=!0;n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}var a=this.rpcCommandHandlers,s=!0,c=!1,l=void 0;try{for(var u,f=Object.entries(a)[Symbol.iterator]();!(s=(u=f.next()).done);s=!0){var d=is(u.value,2),p=d[0],h=d[1];this.rpcServer.setCommandHandler(p,h)}}catch(e){c=!0;l=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw l}}var E=this.rpcEventHandlers,y=!0,m=!1,b=void 0;try{for(var g,O=Object.entries(E)[Symbol.iterator]();!(y=(g=O.next()).done);y=!0){var v=is(g.value,2),_=v[0],I=v[1];this.rpcServer.setEventHandler(_,I)}}catch(e){m=!0;b=e}finally{try{y||null==O.return||O.return()}finally{if(m)throw b}}};t.init=function(){var e=this;this.rpcServer.getCurrentUser=function(){return Y.default.getCurrentUser()};this.rpcServer.onConnect=function(e){O.Z.dispatch({type:"RPC_APP_CONNECTED",socketId:e.id,application:e.application
});Ie.default.track(M.rMx.AUTHORIZED_APP_CONNECTED,{app_id:e.application.id,transport:e.transport})};this.rpcServer.onDisconnect=function(e,t){O.Z.dispatch({type:"RPC_APP_DISCONNECTED",socketId:e.id,application:e.application,reason:t})};var t=[S.Z,qa.ZP,$a.Z,j.Z,Ye.Z,A.Z];new s.Fh(t.concat(this.stores),(function(){return e.rpcServer.updateSubscriptions()})).attach("RPCServerManager");O.Z.subscribe("MESSAGE_CREATE",(function(t){return e.handleMessage(t)}));O.Z.subscribe("MESSAGE_UPDATE",(function(t){return e.handleMessage(t)}));O.Z.subscribe("MESSAGE_DELETE",(function(t){return e.handleMessage(t)}));O.Z.subscribe("SPEAKING",(function(t){return e.handleSpeaking(t)}));O.Z.subscribe("OAUTH2_TOKEN_REVOKE",(function(t){return e.handleOAuth2TokenRevoke(t)}));O.Z.subscribe("GUILD_CREATE",(function(t){return e.handleGuildCreate(t)}));O.Z.subscribe("CHANNEL_CREATE",(function(t){return e.handleChannelCreate(t)}));O.Z.subscribe("LOGOUT",(function(){return e.handleLogout()}))
;O.Z.subscribe("VOICE_CHANNEL_SELECT",(function(t){return e.handleVoiceChannelSelect(t)}));O.Z.subscribe("RPC_NOTIFICATION_CREATE",(function(t){return e.handleNotificationCreate(t)}));O.Z.subscribe("ACTIVITY_JOIN",(function(t){return e.handleActivityJoin(t)}));O.Z.subscribe("ACTIVITY_PIP_MODE_UPDATE",(function(t){return e.handleActivityPIPModeUpdate(t)}));O.Z.subscribe("THERMAL_STATE_CHANGE",(function(t){return e.handleThermalStateChange(t)}));O.Z.subscribe("ACTIVITY_SCREEN_ORIENTATION_UPDATE",(function(t){return e.handleScreenOrientationUpdate(t)}));O.Z.subscribe("RELATIONSHIP_ADD",(function(t){return e.handleRelationshipAdd(t)}));O.Z.subscribe("RELATIONSHIP_REMOVE",(function(t){return e.handleRelationshipRemove(t)}));O.Z.subscribe("PRESENCE_UPDATES",(function(t){return e.handlePresenceUpdate(t)}));O.Z.subscribe("PRESENCES_REPLACE",(function(){return e.handlePresencesReplace()}));O.Z.subscribe("LOBBY_UPDATE",(function(t){return e.handleLobbyUpdate(t)}))
;O.Z.subscribe("LOBBY_DELETE",(function(t){return e.handleLobbyDelete(t)}));O.Z.subscribe("LOBBY_MEMBER_CONNECT",(function(t){return e.handleLobbyMemberConnect(t)}));O.Z.subscribe("LOBBY_MEMBER_UPDATE",(function(t){return e.handleLobbyMemberUpdate(t)}));O.Z.subscribe("LOBBY_MEMBER_DISCONNECT",(function(t){return e.handleLobbyMemberDisconnect(t)}));O.Z.subscribe("LOBBY_MESSAGE",(function(t){return e.handleLobbyMessage(t)}));O.Z.subscribe("ENTITLEMENT_CREATE",(function(t){return e.handleEntitlementCreate(t)}));O.Z.subscribe("ENTITLEMENT_DELETE",(function(t){return e.handleEntitlementDelete(t)}));O.Z.subscribe("USER_ACHIEVEMENT_UPDATE",(function(t){return e.handleUserAchievementUpdate(t)}))};t.handleMessage=function(e){if(0!==this.rpcServer.subscriptions.length){"MESSAGE_CREATE"===e.type&&this.handleActivityMessage(e);var t,n,r,o=null;switch(e.type){case"MESSAGE_CREATE":if("SENDING"===e.message.state)return;t=M.zMe.MESSAGE_CREATE;n=e.channelId;r=e.message
;o="".concat(t).concat(e.message.id);break;case"MESSAGE_UPDATE":t=M.zMe.MESSAGE_UPDATE;n=e.message.channel_id;r=e.message;break;case"MESSAGE_DELETE":t=M.zMe.MESSAGE_DELETE;n=e.channelId;r={id:e.id};o="".concat(t).concat(e.id);break;default:return(0,_o.vE)(e)}null!=n&&this.rpcServer.dispatchToSubscriptions(t,{channel_id:n},{channel_id:n,message:(0,ts.Xb)(r)},o)}};t.handleSpeaking=function(e){var t=this;if(0!==this.rpcServer.subscriptions.length){var n=0!==e.speakingFlags?M.zMe.SPEAKING_START:M.zMe.SPEAKING_STOP;if(e.context===Ke.Yn.DEFAULT){var r=C.Z.getVoiceChannelId();if(null!=r){var o=S.Z.getChannel(r);if(null==o)return;var i=j.Z.getVoiceState(o.getGuildId(),e.userId);if(null==i)return;this.rpcServer.dispatchToSubscriptions(n,{channel_id:i.channelId},{channel_id:i.channelId,user_id:e.userId})}}else Qa.Z.getLobbyIdsForUser(e.userId).forEach((function(r){var o=Xa.Z.getLobby(r);null!=o&&o.application_id===e.context&&t.rpcServer.dispatchToSubscriptions(n,{},{lobby_id:r,user_id:e.userId})
}))}};t.handleVoiceChannelSelect=function(e){var t=e.guildId,n=e.channelId;0!==this.rpcServer.subscriptions.length&&this.rpcServer.dispatchToSubscriptions(M.zMe.VOICE_CHANNEL_SELECT,{},{channel_id:n,guild_id:t})};t.handleNotificationCreate=function(e){var t=e.channelId,n=e.message,r=e.icon,o=e.title,i=e.body;0!==this.rpcServer.subscriptions.length&&this.rpcServer.dispatchToSubscriptions(M.zMe.NOTIFICATION_CREATE,{},{channel_id:t,message:(0,ts.Xb)(n),icon_url:null!=r?(0,ts.RE)(r):null,title:o,body:i})};t.handleActivityJoin=function(e){var t=e.applicationId,n=e.secret,r=e.intent,o=e.embedded;if(0!==this.rpcServer.subscriptions.length){var i={secret:n};o&&(i.intent=r);this.rpcServer.dispatchToSubscriptions(M.zMe.ACTIVITY_JOIN,(function(e){return e.socket.application.id===t}),i);this.rpcServer.dispatchToSubscriptions(M.zMe.GAME_JOIN,(function(e){return e.socket.application.id===t}),i)}};t.handleActivityPIPModeUpdate=function(e){var t=e.applicationId,n=e.isPIPMode
;if(0!==this.rpcServer.subscriptions.length){var r={is_pip_mode:n};this.rpcServer.dispatchToSubscriptions(M.zMe.ACTIVITY_PIP_MODE_UPDATE,(function(e){return e.socket.application.id===t}),r)}};t.handleThermalStateChange=function(e){var t=e.applicationId,n=e.rawThermalState;if(0!==this.rpcServer.subscriptions.length&&null!=t){var r={thermal_state:Ka(n)};this.rpcServer.dispatchToSubscriptions(M.zMe.THERMAL_STATE_UPDATE,(function(e){return e.socket.application.id===t}),r)}};t.handleScreenOrientationUpdate=function(e){var t=e.screenOrientation;if(0!==this.rpcServer.subscriptions.length){var n={screen_orientation:t,orientation:t===rs.W0.PORTRAIT?"portrait":"landscape"};this.rpcServer.dispatchToSubscriptions(M.zMe.ORIENTATION_UPDATE,{},n)}};t.handleActivityMessage=function(e){var t=e.channelId,n=e.message;if(0!==this.rpcServer.subscriptions.length){var r=n.application,o=n.activity;if(null!=r&&null!=o&&null!=o.party_id){var i=Y.default.getUser(n.author.id);if(null!=i){
var a=Y.default.getCurrentUser();if(null!=a&&i.id!==a.id){var s=o.type===M.mFx.JOIN_REQUEST?$a.Z.getApplicationActivity(a.id,r.id):$a.Z.getApplicationActivity(i.id,r.id);if(null!=s&&null!=s.party&&s.party.id===o.party_id){var c=s.application_id;switch(o.type){case M.mFx.JOIN:this.rpcServer.dispatchToSubscriptions(M.zMe.ACTIVITY_INVITE,(function(e){return e.socket.application.id===c}),{user:(0,ns.Z)(i),activity:s,type:o.type,channel_id:t,message_id:n.id});break;case M.mFx.JOIN_REQUEST:this.rpcServer.dispatchToSubscriptions(M.zMe.ACTIVITY_JOIN_REQUEST,(function(e){return e.socket.application.id===c}),{user:(0,ns.Z)(i)})}}}}}}};t.handleOAuth2TokenRevoke=function(e){var t=e.accessToken;this.rpcServer.sockets.forEach((function(e){e.authorization.accessToken===t&&e.close(M.$VG.TOKEN_REVOKED,"Token revoked")}))};t.handleGuildCreate=function(e){var t=e.guild.id,n=Zt.Z.getGuild(t);0!==this.rpcServer.subscriptions.length&&null!=n&&this.rpcServer.dispatchToSubscriptions(M.zMe.GUILD_CREATE,{},{
id:t,name:n.name})};t.handleChannelCreate=function(e){var t=e.channel,n=t.id,r=t.name,o=t.type;0!==this.rpcServer.subscriptions.length&&this.rpcServer.dispatchToSubscriptions(M.zMe.CHANNEL_CREATE,{},{id:n,name:r,type:o})};t.handleLogout=function(){this.rpcServer.sockets.forEach((function(e){return e.close(M.$VG.CLOSE_NORMAL,"User logout")}))};t.handleRelationshipAdd=function(e){var t=e.relationship,n=t.id,r=t.type;0!==this.rpcServer.subscriptions.length&&this.rpcServer.dispatchToSubscriptions(M.zMe.RELATIONSHIP_UPDATE,{},(0,ts.cD)(r,n))};t.handleRelationshipRemove=function(e){var t=e.relationship.id;0!==this.rpcServer.subscriptions.length&&this.rpcServer.dispatchToSubscriptions(M.zMe.RELATIONSHIP_UPDATE,{},(0,ts.cD)(M.OGo.NONE,t))};t.handlePresenceUpdate=function(e){var t=e.updates,n=this;0!==this.rpcServer.subscriptions.length&&t.forEach((function(e){var t=e.guildId,r=e.user.id;if(null==t){var o=Ja.Z.getRelationshipType(r)
;o===M.OGo.NONE&&es.Z.getUserAffinitiesUserIds().has(r)&&(o=M.OGo.IMPLICIT);o!==M.OGo.NONE&&n.rpcServer.dispatchToSubscriptions(M.zMe.RELATIONSHIP_UPDATE,{},(0,ts.cD)(o,r))}}))};t.handlePresencesReplace=function(){var e=this;0!==this.rpcServer.subscriptions.length&&Wa().forEach(Ja.Z.getRelationships(),(function(t,n){e.rpcServer.dispatchToSubscriptions(M.zMe.RELATIONSHIP_UPDATE,{},(0,ts.cD)(t,n))}))};t.handleLobbyUpdate=function(e){var t=e.lobby;0!==this.rpcServer.subscriptions.length&&this.rpcServer.dispatchToSubscriptions(M.zMe.LOBBY_UPDATE,{},t)};t.handleLobbyDelete=function(e){var t=e.lobbyId;0!==this.rpcServer.subscriptions.length&&this.rpcServer.dispatchToSubscriptions(M.zMe.LOBBY_DELETE,{},{id:t})};t.handleLobbyMemberConnect=function(e){var t=e.lobbyId,n=e.member;0!==this.rpcServer.subscriptions.length&&this.rpcServer.dispatchToSubscriptions(M.zMe.LOBBY_MEMBER_CONNECT,{},{lobby_id:t,member:n})};t.handleLobbyMemberUpdate=function(e){var t=e.lobbyId,n=e.member
;0!==this.rpcServer.subscriptions.length&&this.rpcServer.dispatchToSubscriptions(M.zMe.LOBBY_MEMBER_UPDATE,{},{lobby_id:t,member:n})};t.handleLobbyMemberDisconnect=function(e){var t=e.lobbyId,n=e.member;0!==this.rpcServer.subscriptions.length&&this.rpcServer.dispatchToSubscriptions(M.zMe.LOBBY_MEMBER_DISCONNECT,{},{lobby_id:t,member:n})};t.handleLobbyMessage=function(e){var t=e.lobbyId,n=e.senderId,r=e.data;0!==this.rpcServer.subscriptions.length&&this.rpcServer.dispatchToSubscriptions(M.zMe.LOBBY_MESSAGE,{},{lobby_id:t,sender_id:n,data:r})};t.handleEntitlementCreate=function(e){var t=e.entitlement;0!==this.rpcServer.subscriptions.length&&this.rpcServer.dispatchToSubscriptions(M.zMe.ENTITLEMENT_CREATE,(function(e){return e.socket.application.id===t.application_id}),{entitlement:t})};t.handleEntitlementDelete=function(e){var t=e.entitlement;0!==this.rpcServer.subscriptions.length&&this.rpcServer.dispatchToSubscriptions(M.zMe.ENTITLEMENT_DELETE,(function(e){
return e.socket.application.id===t.application_id}),{entitlement:t})};t.handleUserAchievementUpdate=function(e){var t=e.userAchievement;if(0!==this.rpcServer.subscriptions.length){var n=t.application_id;this.rpcServer.dispatchToSubscriptions(M.zMe.USER_ACHIEVEMENT_UPDATE,(function(e){return e.socket.application.id===n}),{user_achievement:t})}};return e}(),ss=n(310126),cs=n(281110);const ls=function(e,t,n){var r=Jn.default.getId();return cs.Z.put({url:M.ANM.USER_ACHIEVEMENTS_FOR_USER(r,e,t),body:{percent_complete:n},oldFormErrors:!0})},us=function(e){return cs.Z.get({url:M.ANM.USER_ACHIEVEMENTS(e),retries:1,oldFormErrors:!0}).then((function(e){return e.body}))};var fs,ds=n(860872);function ps(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}const hs=(ps(fs={},M.Etm.SET_USER_ACHIEVEMENT,{scope:ps({},M.Gp_.ANY,[M.xVR.RPC,M.lHf]),validation:function(e){return e.object().required().keys({achievement_id:e.string().min(2).max(128),
percent_complete:e.number().min(0).max(100).required()})},handler:function(e){var t=e.socket,n=e.args,r=n.achievement_id,o=n.percent_complete,i=t.application.id;if(null==i)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");return ls(i,r,o).catch((function(e){var t=e.status,n=e.body;switch(t){case 429:throw new ds.Z(M.lTL.RATE_LIMITED,"You are being rate limited.");case 403:throw null!=n&&n.code===M.evJ.USER_NOT_AUTHORIZED_FOR_APPLICATION?new ds.Z(M.lTL.UNAUTHORIZED_FOR_ACHIEVEMENT,"Not authorized to update this achievement."):new ds.Z(M.lTL.UNKNOWN_ERROR,"Unknown error from API. status=".concat(t,"."));default:throw new ds.Z(M.lTL.UNKNOWN_ERROR,"Unknown error from API. status=".concat(t,"."))}})).then((function(){return null}))}}),ps(fs,M.Etm.GET_USER_ACHIEVEMENTS,{scope:ps({},M.Gp_.ANY,[M.xVR.RPC,M.lHf]),handler:function(e){var t=e.socket.application.id;if(null==t)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");return us(t).then((function(e){return e||[]}))}}),fs)
;var Es,ys=n(560213),ms=n(661123);function bs(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function gs(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}const Os=(bs(Es={},M.Etm.SEND_ANALYTICS_EVENT,{validation:function(e){return e.object().required().keys({event_name:e.string().required(),event_properties:e.object().required()})},handler:function(e){var t=e.socket,n=e.args,r=n.event_name,o=n.event_properties;(0,ts.bu)(t.transport);(0,ts._f)(t.application)
;var i=t.application.id,a=S.Z.getChannel(C.Z.getVoiceChannelId()),s=null==a?void 0:a.getGuildId();if(null==a||null==s)throw new ds.Z(M.lTL.INVALID_COMMAND,"Invalid channel");var c,l=Rn.Z.getGame(i);if(!(0,ms.yE)(null!==(c=null==l?void 0:l.flags)&&void 0!==c?c:0,M.udG.EMBEDDED_FIRST_PARTY))throw new ds.Z(M.lTL.INVALID_COMMAND,"This application cannot access this API");Ie.default.track(r,gs(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){bs(e,t,n[t])}))}return e}({},o),{activity_application_id:i,activity_guild_id:s}))}}),bs(Es,M.Etm.GET_APPLICATION_TICKET,{scope:M.lHf,handler:function(e){var t=e.socket.application.id;if(null==t)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");return cs.Z.post({url:M.ANM.APPLICATION_TICKET(t),body:{
test_mode:Xn.Z.inTestModeForApplication(t)||ys.Z.inDevModeForApplication(t)},retries:3,oldFormErrors:!0}).then((function(e){return e.body}))}}),Es);function vs(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}const _s=vs({},M.Etm.SET_CERTIFIED_DEVICES,{scope:vs({},M.Gp_.ANY,[M.xVR.RPC,M.lHf]),validation:function(e){return e.object().required().keys({devices:e.array().items(e.object().keys({type:e.string().required().valid([Ke.h7.AUDIO_INPUT,Ke.h7.AUDIO_OUTPUT,Ke.h7.VIDEO_INPUT]),id:e.string().required().min(1),vendor:e.object().required().keys({name:e.string().min(1),url:e.string().min(1)}),model:e.object().required().keys({name:e.string().min(1),url:e.string().min(1)}),related:e.array().items(e.string().min(1)),echo_cancellation:e.boolean(),noise_suppression:e.boolean(),automatic_gain_control:e.boolean(),hardware_mute:e.boolean()}))})},handler:function(e){var t=e.socket,n=e.args.devices
;if(null==t.application.id)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");!function(e,t){O.Z.dispatch({type:"CERTIFIED_DEVICES_SET",applicationId:e,devices:t})}(t.application.id,n.map((function(e){return{type:e.type,id:e.id,vendor:e.vendor,model:e.model,related:e.related.filter((function(e){return n.some((function(t){return t.id===e}))})),echoCancellation:e.echo_cancellation,noiseSuppression:e.noise_suppression,automaticGainControl:e.automatic_gain_control,hardwareMute:e.hardware_mute}})))}});var Is,Ss=n(382060),Ts=n(176758);function Ns(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function As(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Cs(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){
var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function Ps(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ns(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ns(e,t)}(e,t)||function(){
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const js=(As(Is={},M.Etm.GET_CHANNEL,{scope:M.xVR.RPC,handler:function(e){var t=e.args.channel_id,n=e.socket,r=S.Z.getChannel(t);if(null==r)throw new ds.Z(M.lTL.INVALID_CHANNEL,"Invalid channel id: ".concat(t));return(0,ts.T5)(r,(0,ts.zM)(r,n.application.id,n.authorization.scopes))}}),As(Is,M.Etm.GET_CHANNELS,{scope:M.xVR.RPC,handler:function(e){var t=e.args.guild_id,n=Wa().values(S.Z.loadAllGuildAndPrivateChannelsFromDisk());if(t){var r=Zt.Z.getGuild(t);if(null==r)throw new ds.Z(M.lTL.INVALID_GUILD,"Invalid guild id: ".concat(t));n=n.filter((function(e){return e.guild_id===r.id}))}return{channels:n.filter((function(e){return dn.Z.can(M.Plq.VIEW_CHANNEL,e)})).map((function(e){return{id:e.id,name:e.name,type:e.type}}))}}}),As(Is,M.Etm.SELECT_VOICE_CHANNEL,{scope:M.xVR.RPC,validation:function(e){
return e.object().required().keys({channel_id:e.string().allow(null),timeout:e.number().min(0).max(60),force:e.boolean()})},handler:function(e){var t=e.server,n=e.socket,r=e.args,o=r.channel_id,i=r.timeout,a=void 0===i?0:i,s=r.force,c=void 0!==s&&s;if(!o){d.default.selectVoiceChannel(null);return null}var l=C.Z.getVoiceChannelId();if(null!=l&&l!==o&&!1===c)throw new ds.Z(M.lTL.SELECT_VOICE_FORCE_REQUIRED,"User is already joined to a voice channel.");return t.storeWait(n,(function(){return S.Z.getChannel(o)}),a).catch((function(){throw new ds.Z(M.lTL.SELECT_CHANNEL_TIMED_OUT,"Request to select voice channel timed out.")})).then((function(e){if(null==e)throw new ds.Z(M.lTL.INVALID_CHANNEL,"Invalid channel id: ".concat(o));if(!(0,Ss.vd)(e.type))throw new ds.Z(M.lTL.INVALID_CHANNEL,"Channel is not a voice channel");return Promise.all([Promise.resolve(e),(0,ts.T5)(e,(0,ts.zM)(e,n.application.id,n.authorization.scopes))])})).then((function(e){var t=Ps(e,2),n=t[0],r=t[1];if(r.guild_id){if((0,
Ts.rY)(n,j.Z,Zt.Z))throw new ds.Z(M.lTL.INVALID_CHANNEL,"Channel is full");if(!dn.Z.can(M.Plq.CONNECT,n))throw new ds.Z(M.lTL.INVALID_PERMISSIONS,"Connect permission required to join channel")}d.default.selectVoiceChannel(n.id);return r}))}}),As(Is,M.Etm.GET_SELECTED_VOICE_CHANNEL,{scope:As({},M.Gp_.ANY,[M.xVR.RPC,M.xVR.RPC_VOICE_READ]),handler:function(e){var t=e.socket,n=C.Z.getVoiceChannelId(),r=null!=n?S.Z.getChannel(n):null;return null!=r?(0,ts.T5)(r,(0,ts.zM)(r,t.application.id,t.authorization.scopes)):null}}),As(Is,M.Etm.SELECT_TEXT_CHANNEL,{scope:M.xVR.RPC,validation:function(e){return e.object().required().keys({channel_id:e.string().allow(null),timeout:e.number().min(0).max(60)})},handler:function(e){var t=e.server,n=e.socket,r=e.args,o=r.channel_id,i=r.timeout,a=void 0===i?0:i;if(!o){(0,K.uL)(M.Z5c.ME);return null}return t.storeWait(n,(function(){return S.Z.getChannel(o)}),a).catch((function(){
throw new ds.Z(M.lTL.SELECT_CHANNEL_TIMED_OUT,"Request to select text channel timed out.")})).then((function(e){if(null==e)throw new ds.Z(M.lTL.INVALID_CHANNEL,"Invalid channel id: ".concat(o));if(!(0,Ss.Qm)(e.type))throw new ds.Z(M.lTL.INVALID_CHANNEL,"Channel is not a text channel");return Promise.all([Promise.resolve(e),(0,ts.T5)(e,(0,ts.zM)(e,n.application.id,n.authorization.scopes))])})).then((function(e){var t=Ps(e,2),n=t[0],r=t[1];if(r.guild_id&&!dn.Z.can(M.Plq.VIEW_CHANNEL,n))throw new ds.Z(M.lTL.INVALID_CHANNEL,"No permission to see channel");r.guild_id?(0,K.dL)(M.Z5c.CHANNEL(r.guild_id,n.id)):d.default.selectPrivateChannel(n.id);return r}))}}),As(Is,M.Etm.CREATE_CHANNEL_INVITE,{scope:M.xVR.RPC,handler:function(e){var t=e.args.channel_id,n=Cs(e.args,["channel_id"]);return ir.Z.createInvite(t,n,"RPC").catch((function(){throw new ds.Z(M.lTL.INVALID_PERMISSIONS,"Unable to generate an invite for ".concat(t,". Does this user have permissions?"))}))}}),Is);const Rs=function(e,t,n){
t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},M.Etm.SET_CONFIG,{scope:M.wEG,validation:function(e){return e.object().required().keys({use_interactive_pip:e.boolean()})},handler:function(e){var t=e.socket,n=e.args.use_interactive_pip;if(t.transport!==M.Hej.POST_MESSAGE)throw new ds.Z(M.lTL.INVALID_COMMAND,'command not available from "'.concat(t.transport," transport"));if(null==t.application.id)throw new ds.Z(M.lTL.INVALID_COMMAND,"invalid application");O.Z.dispatch({type:"EMBEDDED_ACTIVITY_SET_CONFIG",applicationId:t.application.id,config:{useInteractivePIP:n}});return Promise.resolve({use_interactive_pip:n})}});function xs(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var Ms;const ws=(xs(Ms={},M.Etm.GET_GUILD,{scope:M.xVR.RPC,validation:function(e){return e.object().required().keys({guild_id:e.string(),timeout:e.number().min(0).max(60)})},handler:function(e){
var t=e.socket,n=e.server,r=e.args,o=r.guild_id,i=r.timeout,a=void 0===i?0:i;return n.storeWait(t,(function(){return Zt.Z.getGuild(o)}),a).catch((function(){throw new ds.Z(M.lTL.GET_GUILD_TIMED_OUT,"Request to get guild timed out.")})).then((function(e){if(null==e)throw new ds.Z(M.lTL.INVALID_GUILD,"Invalid guild id: ".concat(o));var t;return{id:e.id,name:e.name,icon_url:null!==(t=e.getIconURL(128))&&void 0!==t?t:null,members:[],vanity_url_code:e.vanityURLCode}}))}}),xs(Ms,M.Etm.GET_GUILDS,{scope:M.xVR.RPC,handler:function(){var e=Zt.Z.getGuilds();return{guilds:Wa().map(e,(function(e){return{id:e.id,name:e.name,icon_url:e.getIconURL(128)}}))}}}),Ms);var Ds=n(775173),Zs=n(347117);const Ls=function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},M.Etm.GET_IMAGE,{scope:M.lHf,validation:function(e){return e.object().required().keys({type:e.string().required().valid(["user"]),id:e.string().required(),
format:e.string().required().valid(["png","webp","jpg"]),size:e.number().required().valid([16,32,64,128,256,512,1024])})},handler:function(e){var t,n=e.args,r=n.type,o=n.id,i=n.format,a=void 0===i?"png":i,s=n.size,c=void 0===s?128:s;if("user"===r){var l=Y.default.getUser(o);if(null==l)throw new ds.Z(M.lTL.INVALID_USER,"Invalid user id: ".concat(o));t=Ds.ZP.getUserAvatarURL(l,!1,c,a);var u=window.GLOBAL_ENV.CDN_HOST;null!=u&&-1!==t.indexOf(u)&&(t+="&_=")}if(null==t)throw new ds.Z(M.lTL.INVALID_COMMAND,"No valid type.");return fetch(t).then((function(e){return e.blob()})).then((function(e){return(0,Zs.fD)(e)})).then((function(e){return{data_url:e}}))}});var Us=n(247162),ks=n(688271);const Gs=function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},M.Etm.OPEN_EXTERNAL_LINK,{validation:function(e){return e.object().required().keys({url:e.string().required()})},handler:function(e){var t=e.socket,n=e.args.url;(0,
ts.bu)(t.transport);try{var r=new URL(n);Lt.FB&&Us.Z.focus(null,!0);(0,ks.q)({href:r.toString()})}catch(e){throw new ds.Z(M.lTL.INVALID_COMMAND,"Invalid URL: ".concat(n))}}});function Bs(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Hs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Bs(e,t,n[t])}))}return e}function Vs(e,t,n){return new Promise((function(r,o){O.Z.dispatch({type:"LOBBY_CONNECT",socketId:e,lobbyId:t,lobbySecret:n,resolve:r,reject:o})}))}var Fs;n(517205);function Ys(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function zs(e){if(e instanceof Xa.t)switch(e.code){case M.ogU.FULL:
throw new ds.Z(M.lTL.LOBBY_FULL,"Lobby is full.");case M.ogU.INVALID_SECRET:throw new ds.Z(M.lTL.INVALID_LOBBY_SECRET,"Lobby secret is invalid.");case M.ogU.NOT_FOUND:throw new ds.Z(M.lTL.INVALID_LOBBY,"Lobby does not exist.");case M.ogU.SERVICE_UNAVAILABLE:throw new ds.Z(M.lTL.SERVICE_UNAVAILABLE,"Lobby service is unavailable.");case M.ogU.ALREADY_CONNECTING:throw new ds.Z(M.lTL.INVALID_COMMAND,"Already connecting to lobby.");default:throw new ds.Z(M.lTL.UNKNOWN_ERROR,"Unknown error has occured.")}throw e}const Ws=(Ys(Fs={},M.Etm.CREATE_LOBBY,{scope:Ys({},M.Gp_.ANY,[M.lHf]),validation:function(e){return e.object().required().keys({type:e.number().valid(Object.values(M.ny$)),capacity:e.number(),locked:e.boolean(),metadata:e.object()})},handler:function(e){var t,n,r,o=e.socket,i=e.args,a=i.type,s=i.capacity,c=i.locked,l=i.metadata;if(null==o.application.id)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");return(t=o.id,n=o.application.id,r={type:a,capacity:s,locked:c,metadata:l},
cs.Z.post({url:M.ANM.LOBBIES,body:Hs({application_id:n},r),retries:1,oldFormErrors:!0}).then((function(e){var n=e.body;return Vs(t,n.id,n.secret)}))).catch(zs)}}),Ys(Fs,M.Etm.UPDATE_LOBBY,{scope:Ys({},M.Gp_.ANY,[M.lHf]),validation:function(e){return e.object().required().keys({id:e.string().required(),type:e.number().valid(Object.values(M.ny$)),owner_id:e.string(),capacity:e.number(),locked:e.boolean(),metadata:e.object()})},handler:function(e){var t,n,r=e.args,o=r.id,i=r.type,a=r.owner_id,s=r.capacity,c=r.locked,l=r.metadata;return(t=o,n={type:i,owner_id:a,capacity:s,locked:c,metadata:l},cs.Z.patch({url:M.ANM.LOBBY(t),body:Hs({},n),retries:1,oldFormErrors:!0}).then(M.dG4)).catch(zs)}}),Ys(Fs,M.Etm.DELETE_LOBBY,{scope:Ys({},M.Gp_.ANY,[M.lHf]),validation:function(e){return e.object().required().keys({id:e.string().required()})},handler:function(e){var t,n=e.args.id;return(t=n,cs.Z.delete({url:M.ANM.LOBBY(t),body:{},retries:1,oldFormErrors:!0}).then(M.dG4)).catch(zs)}}),
Ys(Fs,M.Etm.UPDATE_LOBBY_MEMBER,{scope:Ys({},M.Gp_.ANY,[M.lHf]),validation:function(e){return e.object().required().keys({lobby_id:e.string().required(),user_id:e.string().required(),metadata:e.object()})},handler:function(e){var t,n,r,o=e.args,i=o.lobby_id,a=o.user_id,s=o.metadata;return(t=i,n=a,r={metadata:s},cs.Z.patch({url:M.ANM.LOBBY_MEMBER(t,n),body:Hs({},r),retries:1,oldFormErrors:!0}).then(M.dG4)).catch(zs)}}),Ys(Fs,M.Etm.CONNECT_TO_LOBBY,{scope:Ys({},M.Gp_.ANY,[M.lHf]),validation:function(e){return e.object().required().keys({id:e.string().required(),secret:e.string().required()})},handler:function(e){var t=e.socket,n=e.args,r=n.id,o=n.secret;return Vs(t.id,r,o).catch(zs)}}),Ys(Fs,M.Etm.DISCONNECT_FROM_LOBBY,{scope:Ys({},M.Gp_.ANY,[M.lHf]),validation:function(e){return e.object().required().keys({id:e.string().required()})},handler:function(e){var t,n=e.args.id;t=n,O.Z.dispatch({type:"LOBBY_DISCONNECT",lobbyId:t})}}),Ys(Fs,M.Etm.SEND_TO_LOBBY,{scope:Ys({},M.Gp_.ANY,[M.lHf]),
validation:function(e){return e.object().required().keys({lobby_id:e.string().required(),data:e.string().required()})},handler:function(e){var t=e.args;return function(e,t){return cs.Z.post({url:M.ANM.LOBBY_SEND(e),body:{data:t},oldFormErrors:!0}).then(M.dG4)}(t.lobby_id,t.data).catch(zs)}}),Ys(Fs,M.Etm.SEARCH_LOBBIES,{scope:M.lHf,validation:function(e){return e.object().required().keys({filter:e.array().items(e.object().keys({key:e.string().required(),comparison:e.number().required(),cast:e.number().required(),value:e.string().required()})),sort:e.array().items(e.object().keys({key:e.string().required(),cast:e.number().required(),near_value:e.string()})),limit:e.number(),distance:e.number()})},handler:function(e){var t,n=e.socket,r=e.args,o=r.filter,i=r.sort,a=r.limit,s=r.distance;return(t={application_id:n.application.id,filter:o,sort:i,limit:a,distance:s},cs.Z.post({url:M.ANM.LOBBY_SEARCH,body:t,oldFormErrors:!0}).then((function(e){return e.body}))).catch(zs)}}),
Ys(Fs,M.Etm.CONNECT_TO_LOBBY_VOICE,{scope:M.lHf,validation:function(e){return e.object().required().keys({id:e.string().required()})},handler:function(e){var t,n=e.args.id;t=n,O.Z.dispatch({type:"LOBBY_VOICE_CONNECT",lobbyId:t})}}),Ys(Fs,M.Etm.DISCONNECT_FROM_LOBBY_VOICE,{scope:M.lHf,validation:function(e){return e.object().required().keys({id:e.string().required()})},handler:function(e){var t,n=e.args.id;t=n,O.Z.dispatch({type:"LOBBY_VOICE_DISCONNECT",lobbyId:t})}}),Fs);var Ks=new jn.Z(M.BZL);const qs=function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},M.Etm.CAPTURE_LOG,{validation:function(e){return e.object().required().keys({level:e.string().required(),message:e.string().required()})},handler:function(e){var t=e.socket,n=e.args,r=n.level,o=n.message;(0,ts.bu)(t.transport);var i=t.application.id,a="".concat(i," - ").concat(o);switch(r){case"log":Ks.log(a);break;case"warn":Ks.warn(a);break;case"debug":Ks.verbose(a)
;break;case"info":Ks.info(a);break;case"error":Ks.error(a)}}});function Xs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Qs(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function $s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xs(e,t)}(e,t)||function(){
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Js;const ec=(Qs(Js={},M.Etm.GET_NETWORKING_CONFIG,{scope:M.lHf,handler:function(){return Promise.all([cs.Z.get({url:location.protocol+window.GLOBAL_ENV.NETWORKING_ENDPOINT,retries:3}).then((function(e){return e.body.address})),cs.Z.post({url:M.ANM.NETWORKING_TOKEN,retries:3,oldFormErrors:!0}).then((function(e){return e.body.token}))]).then((function(e){var t=$s(e,2);return{address:t[0],token:t[1]}}))}}),Qs(Js,M.Etm.NETWORKING_SYSTEM_METRICS,{scope:M.lHf,handler:function(e){var t=e.socket,n=e.args;n.application_id=t.application.id;Ie.default.track(M.rMx.NETWORKING_SYSTEM_METRICS,n)}}),Qs(Js,M.Etm.NETWORKING_PEER_METRICS,{scope:M.lHf,handler:function(e){var t=e.socket,n=e.args;n.application_id=t.application.id;Ie.default.track(M.rMx.NETWORKING_PEER_METRICS,n)}}),Qs(Js,M.Etm.NETWORKING_CREATE_TOKEN,{scope:M.lHf,
handler:function(){return cs.Z.post({url:M.ANM.NETWORKING_TOKEN,retries:1,oldFormErrors:!0}).then((function(e){return e.body}))}}),Js);var tc=n(260561),nc=(0,tc.B)({kind:"user",id:"2023-03_ios_keyboard_resizes_view",label:"iOS Keyboard Resizes View",defaultConfig:{enabled:!1},treatments:[{id:1,label:"Enable iOS Keyboard Resizes View",config:{enabled:!0}}]});function rc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oc(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function ic(e){ic=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return ic(e)}function ac(e,t){return!t||"object"!==cc(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function sc(e,t){sc=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return sc(e,t)}
var cc=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function lc(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=ic(e);if(t){var o=ic(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ac(this,n)}}var uc={isIosResizesViewEnabled:!0},fc=uc;var dc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&sc(e,t)}(n,e);var t=lc(n);function n(){rc(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(e){fc=function(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){oc(e,t,n[t])}))}return e}({},uc,null!=e?e:{})};r.getUserAgnosticState=function(){return fc};r.getIsIosResizesViewEnabled=function(){return fc.isIosResizesViewEnabled};r.__getLocalVars=function(){return{initialState:uc,state:fc}};return n}(s.ZP.DeviceSettingsStore);dc.displayName="PlatformBehaviorsStore";dc.persistKey="PlatformBehaviorsStore";const pc=new dc(O.Z,{LOGOUT:function(){fc=uc},PLATFORM_BEHAVIORS_TOGGLE_IOS_RESIZES_VIEW_ENABLED:function(){fc.isIosResizesViewEnabled=!fc.isIosResizesViewEnabled}});var hc=n(488462);const Ec=function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},hc.Et.GET_PLATFORM_BEHAVIORS,{handler:function(){return{
iosKeyboardResizesView:nc.getCurrentConfig({}).enabled&&pc.getIsIosResizesViewEnabled()}}});function yc(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}const mc=yc({},M.Etm.GET_RELATIONSHIPS,{scope:M.lHf,handler:function(){var e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){yc(e,t,n[t])}))}return e}({},Ja.Z.getRelationships());es.Z.getUserAffinitiesUserIds().forEach((function(t){null==e[t]&&null!=Y.default.getUser(t)&&(e[t]=M.OGo.IMPLICIT)}));return{relationships:Wa().map(e,(function(e,t){return(0,ts.cD)(e,t)}))}}});var bc=n(3564);function gc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Oc(e,t,n){
t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function vc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return gc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gc(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}
var _c=["349134787773988865"];const Ic=Oc({},M.Etm.SET_ACTIVITY,{scope:Oc({},M.Gp_.ANY,[M.xVR.RPC,M.xVR.RPC_ACTIVITIES_WRITE,M.lHf]),validation:function(e){return e.object().required().keys({pid:e.number().min(0),activity:e.object().keys({state:e.string().min(2).max(128),details:e.string().min(2).max(128),timestamps:e.object().keys({start:e.number().min(1),end:e.number().min(1)}),assets:e.object().keys({large_image:e.string().min(1).max(256),large_text:e.string().min(2).max(128),small_image:e.string().min(1).max(256),small_text:e.string().min(2).max(128)}),party:e.object().keys({id:e.string().min(2).max(128),size:e.array().items(e.number().min(1)).length(2),privacy:e.number().default(M.RYY.PRIVATE).valid([M.RYY.PRIVATE,M.RYY.PUBLIC])}),secrets:e.object().keys({match:e.string().min(2).max(128),join:e.string().min(2).max(128),spectate:e.string().min(2).max(128)}),buttons:e.array().items(e.object().keys({label:e.string().min(1).max(32).required(),
url:e.string().uri().min(1).max(512).required()})).min(1).max(2),instance:e.boolean(),supported_platforms:e.array().items(e.string().min(1).max(32)).min(1).max(3),type:e.number().default(M.IIU.PLAYING).valid(M.IIU.PLAYING,M.IIU.LISTENING,M.IIU.WATCHING)}).allow(null)})},handler:function(e){var t,n=e.socket,r=e.args,o=r.pid,i=r.activity,a=e.isSocketConnected;if(![M.Hej.IPC,M.Hej.WEBSOCKET,M.Hej.POST_MESSAGE].includes(n.transport))throw new ds.Z(M.lTL.INVALID_COMMAND,'command not available from "'.concat(n.transport,'" transport'));if(null==o&&M.Hej.IPC===n.transport)throw new ds.Z(M.lTL.INVALID_COMMAND,"nonzero pid required");if(null==i){O.Z.dispatch({type:"LOCAL_ACTIVITY_UPDATE",socketId:n.id,pid:o,activity:i});return Promise.resolve(i)}i.name=n.application.name;i.application_id=n.application.id;var s=n.transport===M.Hej.POST_MESSAGE,c=(0,ts.S5)(i,s);c>0&&(i.flags=c);delete i.instance;null===(t=i.party)||void 0===t||delete t.privacy
;var l,u=i.assets,f=i.party,d=i.secrets,p=i.timestamps,h=i.buttons,E=i.type;(null==E||E!==M.IIU.PLAYING&&!s)&&(i.type=M.IIU.PLAYING);if(null!=d){var y=Wa().values(d).filter((function(e){return!!e}));if(null!=f&&Wa().intersection(y,[f.id]).length>0&&!_c.includes(n.application.id))throw new ds.Z(M.lTL.INVALID_ACTIVITY_SECRET,"secrets cannot match the party id");if(Wa().uniq(y).length<y.length)throw new ds.Z(M.lTL.INVALID_ACTIVITY_SECRET,"secrets must be unique");if(null!=h)throw new ds.Z(M.lTL.INVALID_ACTIVITY_SECRET,"secrets cannot currently be sent with buttons")}if(null!=h){i.metadata={button_urls:h.map((function(e){return e.url}))};i.buttons=h.map((function(e){return e.label}))}if(null!=p){var m=!0,b=!1,g=void 0;try{for(var v,_=Object.keys(p)[Symbol.iterator]();!(m=(v=_.next()).done);m=!0){var I=v.value;Date.now().toString().length-p[I].toString().length>2&&(p[I]=Math.floor(1e3*p[I]))}}catch(e){b=!0;g=e}finally{try{m||null==_.return||_.return()}finally{if(b)throw g}}}
if(null==u)l=Promise.resolve([]);else{if(null==n.application||null==n.application.id)throw new Error;l=(0,bc.GR)(n.application.id,[u.large_image,u.small_image])}return l.then((function(e){var t=vc(e,2),r=t[0],s=t[1];if(null!=u){null!=r?u.large_image=r:delete u.large_image;null!=s?u.small_image=s:delete u.small_image}if(a()){O.Z.dispatch({type:"LOCAL_ACTIVITY_UPDATE",socketId:n.id,pid:o,activity:i});var c=i.secrets,l=i.party,f={application_id:n.application.id,type:i.type};if(null!=c){f.has_match_secret=!!c.match;f.has_join_secret=!!c.join}null!=u&&(f.has_images=!(!u.large_image&&!u.small_image));if(null!=l){f.party_max=null!=l.size?l.size[1]:void 0;f.party_id=l.id}Ie.default.track(M.rMx.ACTIVITY_UPDATED,f);return i}}))}});const Sc=function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},hc.Et.SET_ORIENTATION_LOCK_STATE,{validation:function(e){return e.object().required().keys({
lock_state:e.number().valid(rs.xK.UNLOCKED,rs.xK.PORTRAIT,rs.xK.LANDSCAPE).required(),picture_in_picture_lock_state:e.number().valid(rs.xK.UNLOCKED,rs.xK.PORTRAIT,rs.xK.LANDSCAPE).allow(null).optional()})},handler:function(e){var t=e.socket,n=e.args,r=n.lock_state,o=n.picture_in_picture_lock_state,i=t.application.id;if(null==i)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");O.Z.dispatch({type:"EMBEDDED_ACTIVITY_SET_ORIENTATION_LOCK_STATE",applicationId:i,lockState:r,pictureInPictureLockState:o})}});var Tc=n(595138),Nc=n(315804),Ac=n(810274),Cc=n(151017);function Pc(e){if(M.Hej.IPC!==e&&M.Hej.POST_MESSAGE!==e)throw new ds.Z(M.lTL.INVALID_COMMAND,"Invalid transport.")}function jc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Rc(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function xc(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){
var i=e.apply(t,n);function a(e){Rc(i,r,o,a,s,"next",e)}function s(e){Rc(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Mc(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function wc(e){return function(e){if(Array.isArray(e))return jc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return jc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jc(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Dc,Zc,Lc,Uc=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},
trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function kc(e,t){
return Gc.apply(this,arguments)}function Gc(){Gc=xc((function(e,t){var n,r,o;return Uc(this,(function(i){switch(i.label){case 0:n=t.filter((function(e){return e.type===M.epS.SUBSCRIPTION_GROUP}));return[4,Promise.all(n.map((a=xc((function(t){return Uc(this,(function(n){switch(n.label){case 0:return[4,(0,Cc.rx)(e,t.id)];case 1:return[2,n.sent()]}}))})),function(e){return a.apply(this,arguments)})))];case 1:r=i.sent();o=[];r.forEach((function(e){if(null==e)return null;var n=e.subscription_listings;if(null==n)return null;var r=[];n.forEach((function(e){e.subscription_plans.forEach((function(n){var o=null==n?void 0:n.price,i=t.find((function(e){return e.id===n.sku_id}));if(null!=i){var a,s={id:n.sku_id,name:i.name,type:i.type,price:{amount:o,currency:"usd"},application_id:e.application_id,flags:e.sku_flags,release_date:null!==(a=i.release_date)&&void 0!==a?a:null};r.push(s)}}))}));r.filter((function(e){return null!=(null==e?void 0:e.price)})).forEach((function(e){return o.push(e)}))}))
;return[2,o]}var a}))}));return Gc.apply(this,arguments)}const Bc=(Mc(Lc={},M.Etm.GET_SKUS,(Mc(Dc={},M.Gp_.ANY,[M.wEG,M.lHf]),Mc(Dc,"handler",(function(e){var t=e.socket;return xc((function(){var e,n,r,o,i,a;return Uc(this,(function(s){switch(s.label){case 0:Pc(t.transport);if(null==(e=t.application.id))throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");return Xn.Z.inTestModeForApplication(e)||ys.Z.inDevModeForApplication(e)?[4,Nc.Kr(e,!1)]:[3,3];case 1:n=s.sent();return[4,kc(e,n)];case 2:r=s.sent();return[2,wc(n.filter((function(e){return null!=e.price}))).concat(wc(r))];case 3:return[4,Ac.oJ(e)];case 4:o=s.sent();i=o.filter((function(e){return e.sku.type!==M.epS.SUBSCRIPTION_GROUP})).map((function(e){return e.sku})).filter((function(e){return null!=e.price}));return[4,kc(e,o.map((function(e){return e.sku})))];case 5:a=s.sent();return[2,wc(i).concat(wc(a))]}}))}))()})),Dc)),Mc(Lc,M.Etm.GET_ENTITLEMENTS,(Mc(Zc={},M.Gp_.ANY,[M.wEG,M.lHf]),Mc(Zc,"handler",(function(e){var t=e.socket
;Pc(t.transport);var n=t.application.id;if(null==n)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");return Tc.yD(n).then((function(e){return null!=e?e:[]}))})),Zc)),Lc);var Hc=n(363690),Vc=n(705711);const Fc=function(){return null};function Yc(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function zc(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Yc(i,r,o,a,s,"next",e)}function s(e){Yc(i,r,o,a,s,"throw",e)}a(void 0)}))}}var Wc=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),
0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Kc(e,t,n){return qc.apply(this,arguments)}function qc(){qc=zc((function(e,t,n){var r,o,i,a,s,c,l,u;return Wc(this,(function(n){switch(n.label){case 0:switch(t){case M.zMe.ACTIVITY_PIP_MODE_UPDATE:return[3,1];case M.zMe.THERMAL_STATE_UPDATE:return[3,2];case M.zMe.ORIENTATION_UPDATE:return[3,4]}return[3,5];case 1:
o=null===(r=e.application)||void 0===r?void 0:r.id;i=null!=o?R.ZP.getPipModeForApp(o):null;return[2,Promise.resolve(null!=i?{is_pip_mode:i}:null)];case 2:return[4,(0,Vc.Z)()];case 3:if(null==(a=n.sent()))return[2,Promise.resolve(null)];s=Ka(a);return[2,Promise.resolve({thermal_state:s})];case 4:if(null!=(c=Fc())){l=c?rs.W0.LANDSCAPE:rs.W0.PORTRAIT;u=l===rs.W0.PORTRAIT?"portrait":"landscape";return[2,Promise.resolve({screen_orientation:l,orientation:u})]}return[2,Promise.resolve(null)];case 5:return[2,null];case 6:return[2]}}))}));return qc.apply(this,arguments)}function Xc(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Qc(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var $c,Jc=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},
"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};const el=(Qc($c={},M.Etm.SUBSCRIBE,{handler:function(e){
var t,n=e.server,r=e.socket,o=e.evt,i=e.args;return(t=function(){var e,t,a;return Jc(this,(function(s){switch(s.label){case 0:if(null==(e=n.events[o]))throw new ds.Z(M.lTL.INVALID_EVENT,"Invalid event: ".concat(o));if(!(0,Hc.Z)(r.authorization.scopes,e.scope))throw new ds.Z(M.lTL.INVALID_PERMISSIONS,"Not authenticated or invalid scope");t=e.handler({args:i,socket:r});return[4,Kc(r,o,i)];case 1:a=s.sent();return[2,new Promise((function(e){setImmediate((function(){n.addSubscription(r,o,i,t);null!=a&&n.dispatchToSubscriptions(o,(function(e){return e.socket.id===r.id}),a)}));e({evt:o})}))]}}))},function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(e){Xc(i,r,o,a,s,"next",e)}function s(e){Xc(i,r,o,a,s,"throw",e)}a(void 0)}))})()}}),Qc($c,M.Etm.UNSUBSCRIBE,{handler:function(e){var t=e.server,n=e.socket,r=e.evt,o=e.args;if(null==t.events[r])throw new ds.Z(M.lTL.INVALID_EVENT,"Invalid event: ".concat(r));t.removeSubscription(n,r,o);return{evt:r}}}),
$c);var tl=n(384411);const nl=function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},M.Etm.USER_SETTINGS_GET_LOCALE,{scope:M.xVR.IDENTIFY,handler:function(){return{locale:tl.default.locale}}});var rl=n(285991);const ol=function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},M.Etm.GET_USER,{scope:M.lHf,validation:function(e){return e.object().required().keys({id:e.string().required()})},handler:function(e){var t=e.args.id;return(0,rl.PR)(t).then(ns.Z).catch((function(){throw new ds.Z(M.lTL.INVALID_USER,"Invalid user id: ".concat(t))}))}});function il(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var al,sl,cl,ll=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){il(e,t,n[t])}))}return e}({},hs,Os,_s,js,Rs,ws,Ls,Gs,Ws,qs,ec,mc,Ic,Sc,Bc,el,ol,nl,Ec),ul=n(199731);function fl(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function dl(e){var t,n=e.args.channel_id,r=e.socket,o=S.Z.getChannel(n);if(null==o||!(0,ts.zM)(o,r.application.id,r.authorization.scopes))throw new ds.Z(M.lTL.INVALID_CHANNEL,"Invalid channel id: ".concat(n));if(o.isNSFW()&&!0!==(null===(t=Y.default.getCurrentUser())||void 0===t?void 0:t.nsfwAllowed))throw new ds.Z(M.lTL.INVALID_CHANNEL,"Invalid nsfw channel id: ".concat(o.id))}function pl(e){var t=e.args,n=t.lobby_id,r=t.channel_id;if(null!=r){if(null==S.Z.getChannel(r))throw new ds.Z(M.lTL.INVALID_CHANNEL,"Invalid channel id: ".concat(r))}if(null!=n){
if(null==Xa.Z.getLobby(n))throw new ds.Z(M.lTL.INVALID_LOBBY,"Invalid lobby id: ".concat(n))}}var hl=(fl(cl={},M.zMe.GUILD_STATUS,{scope:M.xVR.RPC,handler:function(e){var t=e.args.guild_id;if(null==Zt.Z.getGuild(t))throw new ds.Z(M.lTL.INVALID_GUILD,"Invalid guild id: ".concat(t));return function(e){var n=e.prevState,r=e.dispatch,o=Zt.Z.getGuild(t);if(null!=o){var i,a={guild:{id:o.id,name:o.name,icon_url:null!==(i=o.getIconURL(128))&&void 0!==i?i:null},online:0};Wa().isEqual(n,a)||r(a);return a}}}}),fl(cl,M.zMe.VOICE_STATE_CREATE,{scope:fl({},M.Gp_.ANY,[M.xVR.RPC,M.xVR.RPC_VOICE_READ]),handler:function(e){var t=e.args.channel_id;if(null==S.Z.getChannel(t))throw new ds.Z(M.lTL.INVALID_CHANNEL,"Invalid channel id: ".concat(t));return function(e){var n=e.prevState,r=e.dispatch,o=S.Z.getChannel(t);if(null!=o){var i=o.getGuildId(),a=Object.values(j.Z.getVoiceStatesForChannel(o.id));if(n){var s=Wa().differenceBy(a,n,(function(e){return e.userId}));s.forEach((function(e){return r((0,
ts.aE)(i,o.id,e))}))}return a}}}}),fl(cl,M.zMe.VOICE_STATE_DELETE,{scope:fl({},M.Gp_.ANY,[M.xVR.RPC,M.xVR.RPC_VOICE_READ]),handler:function(e){var t=e.args.channel_id;if(null==S.Z.getChannel(t))throw new ds.Z(M.lTL.INVALID_CHANNEL,"Invalid channel id: ".concat(t));return function(e){var n=e.prevState,r=e.dispatch,o=S.Z.getChannel(t);if(null!=o){var i=o.getGuildId(),a=Object.values(j.Z.getVoiceStatesForChannel(o.id)),s=Wa().differenceBy(n,a,(function(e){return e.userId}));s.forEach((function(e){return r((0,ts.aE)(i,o.id,e))}));return a}}}}),fl(cl,M.zMe.VOICE_STATE_UPDATE,{scope:fl({},M.Gp_.ANY,[M.xVR.RPC,M.xVR.RPC_VOICE_READ]),handler:function(e){var t=e.args.channel_id;if(null==S.Z.getChannel(t))throw new ds.Z(M.lTL.INVALID_CHANNEL,"Invalid channel id: ".concat(t));return function(e){var n=e.prevState,r=e.dispatch,o=S.Z.getChannel(t);if(null!=o){var i=o.getGuildId(),a=Object.values(j.Z.getVoiceStatesForChannel(o.id)).map((function(e){return(0,ts.aE)(i,o.id,e)}))
;Wa().differenceWith(a,n,Wa().isEqual).forEach((function(e){return r(e)}));return a}}}}),fl(cl,M.zMe.VOICE_CONNECTION_STATUS,{scope:fl({},M.Gp_.ANY,[M.xVR.RPC,M.xVR.RPC_VOICE_READ]),handler:function(){return function(e){var t=e.prevState,n=e.dispatch,r={state:(0,ts.zy)(A.Z.getState()),hostname:A.Z.getHostname(),pings:A.Z.getPings(),average_ping:A.Z.getAveragePing(),last_ping:A.Z.getLastPing()};Wa().isEqual(r,t)||n(r);return r}}}),fl(cl,M.zMe.MESSAGE_CREATE,{scope:M.xVR.RPC,handler:dl}),fl(cl,M.zMe.MESSAGE_UPDATE,{scope:M.xVR.RPC,handler:dl}),fl(cl,M.zMe.MESSAGE_DELETE,{scope:M.xVR.RPC,handler:dl}),fl(cl,M.zMe.SPEAKING_START,(fl(al={},M.Gp_.ANY,[M.xVR.RPC,M.xVR.RPC_VOICE_READ,M.lHf]),fl(al,"handler",pl),al)),fl(cl,M.zMe.SPEAKING_STOP,(fl(sl={},M.Gp_.ANY,[M.xVR.RPC,M.xVR.RPC_VOICE_READ,M.lHf]),fl(sl,"handler",pl),sl)),fl(cl,M.zMe.GUILD_CREATE,{scope:M.xVR.RPC,handler:function(){}}),fl(cl,M.zMe.CHANNEL_CREATE,{scope:M.xVR.RPC,handler:function(){}}),fl(cl,M.zMe.GAME_JOIN,{
scope:fl({},M.Gp_.ANY,[M.xVR.RPC,M.lHf]),handler:function(){}}),fl(cl,M.zMe.GAME_SPECTATE,{scope:fl({},M.Gp_.ANY,[M.xVR.RPC,M.lHf]),handler:function(){}}),fl(cl,M.zMe.ACTIVITY_JOIN,{scope:fl({},M.Gp_.ANY,[M.xVR.RPC,M.wEG,M.lHf]),handler:function(){}}),fl(cl,M.zMe.ACTIVITY_JOIN_REQUEST,{scope:fl({},M.Gp_.ANY,[M.xVR.RPC,M.lHf]),handler:function(){}}),fl(cl,M.zMe.ACTIVITY_SPECTATE,{scope:fl({},M.Gp_.ANY,[M.xVR.RPC,M.wEG,M.lHf]),handler:function(){}}),fl(cl,M.zMe.ACTIVITY_INVITE,{scope:fl({},M.Gp_.ANY,[M.xVR.RPC,M.lHf]),handler:function(){}}),fl(cl,M.zMe.ACTIVITY_PIP_MODE_UPDATE,{scope:fl({},M.Gp_.ANY,[M.xVR.RPC,M.wEG,M.lHf]),handler:function(){}}),fl(cl,M.zMe.THERMAL_STATE_UPDATE,{scope:fl({},M.Gp_.ANY,[M.wEG]),handler:function(){}}),fl(cl,M.zMe.ORIENTATION_UPDATE,{scope:fl({},M.Gp_.ANY,[M.wEG]),handler:function(){}}),fl(cl,M.zMe.VOICE_CHANNEL_SELECT,{scope:M.xVR.RPC,handler:function(){}}),fl(cl,M.zMe.NOTIFICATION_CREATE,{scope:fl({},M.Gp_.ALL,[M.xVR.RPC,M.xVR.RPC_NOTIFICATIONS_READ]),
handler:function(){}}),fl(cl,M.zMe.RELATIONSHIP_UPDATE,{scope:M.lHf,handler:function(){}}),fl(cl,M.zMe.CURRENT_USER_UPDATE,{scope:fl({},M.Gp_.ANY,[M.lHf,M.xVR.IDENTIFY]),handler:function(){return function(e){var t=e.prevState,n=e.dispatch,r={currentUser:Y.default.getCurrentUser()};null==r.currentUser||null!=t&&(0,ul.Z)(r,t)||n((0,ns.Z)(r.currentUser));return r}}}),fl(cl,M.zMe.LOBBY_UPDATE,{scope:fl({},M.Gp_.ANY,[M.wEG,M.lHf]),handler:function(){}}),fl(cl,M.zMe.LOBBY_DELETE,{scope:fl({},M.Gp_.ANY,[M.wEG,M.lHf]),handler:function(){}}),fl(cl,M.zMe.LOBBY_MEMBER_CONNECT,{scope:fl({},M.Gp_.ANY,[M.wEG,M.lHf]),handler:function(){}}),fl(cl,M.zMe.LOBBY_MEMBER_UPDATE,{scope:fl({},M.Gp_.ANY,[M.wEG,M.lHf]),handler:function(){}}),fl(cl,M.zMe.LOBBY_MEMBER_DISCONNECT,{scope:fl({},M.Gp_.ANY,[M.wEG,M.lHf]),handler:function(){}}),fl(cl,M.zMe.LOBBY_MESSAGE,{scope:fl({},M.Gp_.ANY,[M.wEG,M.lHf]),handler:function(){}}),fl(cl,M.zMe.ENTITLEMENT_CREATE,{scope:fl({},M.Gp_.ANY,[M.lHf,M.wEG]),handler:function(){}
}),fl(cl,M.zMe.ENTITLEMENT_DELETE,{scope:fl({},M.Gp_.ANY,[M.lHf,M.wEG]),handler:function(){}}),fl(cl,M.zMe.USER_ACHIEVEMENT_UPDATE,{scope:M.lHf,handler:function(){}}),cl);const El=hl;function yl(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var ml=n(232949),bl=function(e,t){var n;return yl(n={},M.zMe.VOICE_SETTINGS_UPDATE,{scope:yl({},M.Gp_.ANY,[M.xVR.RPC,M.xVR.RPC_VOICE_READ]),handler:function(){return function(t){var n=t.prevState,r=t.dispatch,o=e();Wa().isEqual(o,n)||r(o);return o}}}),yl(n,M.zMe.VOICE_SETTINGS_UPDATE_2,{scope:M.lHf,handler:function(e){var n=e.socket;return function(e){var r=e.prevState,o=e.dispatch;if(null==n.application.id)return r;var i=t(n.application.id);Wa().isEqual(i,r)||o(i);return i}}}),n}(ml._X,ml.GC);function gl(e){var t,n=(0,ms.yE)(null!==(t=e.flags)&&void 0!==t?t:0,M.udG.EMBEDDED),r=I.Z.getWindowOpen(M.KJ3.CHANNEL_CALL_POPOUT);return n&&r}
var Ol=n(393666),vl=n(817673),_l=n(940060),Il=n(12212),Sl=n(534368),Tl=n(563135);function Nl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Al(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Cl(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Al(i,r,o,a,s,"next",e)}function s(e){Al(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Pl(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function jl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Pl(e,t,n[t])}))}return e}function Rl(e,t){t=null!=t?t:{}
;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function xl(e){return function(e){if(Array.isArray(e))return Nl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Nl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nl(e,t)}(e)||function(){
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ml=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){
a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},wl="CachedTokens";function Dl(e,t,n){return Zl.apply(this,arguments)}function Zl(){Zl=Cl((function(e,t,n){var r,o,i,a,s,c,l,u,f,d,p,h,E,y,m,b,g,O,v,_;return Ml(this,(function(I){switch(I.label){case 0:r=e.client_id,o=e.response_type,i=void 0===o?"code":o,a=e.redirect_uri,s=e.code_challenge,c=e.code_challenge_method,l=e.state,u=e.scope,f=e.permissions,d=e.guild_id,p=e.channel_id,h=e.prompt,E=e.disable_guild_select;if(null==r)throw new ds.Z(M.lTL.OAUTH2_ERROR,"No Client ID provided");if(null!=a)throw new ds.Z(M.lTL.OAUTH2_ERROR,"Redirect URI cannot be used in the RPC OAuth2 Authorization flow");y=[];"string"==typeof u?y=u.split(" ").filter((function(e){return e.length>0})):Array.isArray(u)&&(y=u)
;if(null==Y.default.getCurrentUser())throw new ds.Z(M.lTL.OAUTH2_ERROR,"Client is not logged in");I.label=1;case 1:I.trys.push([1,3,,4]);return[4,(0,Il.Ww)({clientId:r,scopes:y,responseType:i,redirectUri:a,codeChallenge:s,codeChallengeMethod:c,state:l})];case 2:m=I.sent();return[3,4];case 3:b=I.sent();g=b.body;throw new ds.Z(M.lTL.OAUTH2_ERROR,"OAuth2 Authorization Error: ".concat(g.message||"Unknown Error"));case 4:if(h!==Sl.s.NONE||null==m||!m.authorized)return[3,8];I.label=5;case 5:I.trys.push([5,7,,8]);return[4,(0,Il.Iq)({authorize:!0,clientId:r,scopes:y,responseType:i,redirectUri:a,codeChallenge:s,codeChallengeMethod:c,state:l})];case 6:return[2,I.sent().location];case 7:O=I.sent();v=O.body;throw new ds.Z(M.lTL.OAUTH2_ERROR,"OAuth2 Authorize Error: ".concat(v.message||"Unknown Error"));case 8:null==n||n(m.application);_=Tl.ZP.NONE;try{_=_l.Z.deserialize(null!=f?f:0)}catch(e){}return[2,t(r,m,y,_,i,a,s,c,l,d,p,h,E)]}}))}));return Zl.apply(this,arguments)}function Ll(e,t){
if(e.authorization.accessToken)throw new ds.Z(M.lTL.INVALID_COMMAND,"Already authenticated");if(e.authorization.authing)throw new ds.Z(M.lTL.INVALID_COMMAND,"Already authenticating");e.authorization.authing=!0;return cs.Z.get({url:M.ANM.OAUTH2_CURRENT_AUTH,headers:{Authorization:"Bearer ".concat(t)},oldFormErrors:!0}).then((function(n){e.authorization.authing=!1;var r=n.body,o=r.application,i=r.user,a=r.scopes,s=r.expires;if(e.application.id!==o.id)throw new ds.Z(M.lTL.INVALID_CLIENTID,"Application does not match the connection's");var c=Y.default.getCurrentUser();if(null==c||!i||c.id!==i.id)throw new ds.Z(M.lTL.INVALID_TOKEN,"Token does not match current user");e.authorization.scopes=xl(e.authorization.scopes).concat(xl(a),[M.wEG]);e.authorization.accessToken=t;e.authorization.expires=new Date(s);O.Z.dispatch({type:"RPC_APP_AUTHENTICATED",socketId:e.id,application:e.application});return Rl(jl({},n.body),{access_token:t})}),(function(){
throw new ds.Z(M.lTL.INVALID_TOKEN,"Invalid access token: ".concat(t))})).catch((function(t){e.authorization.authing=!1;throw t}))}function Ul(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function kl(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}const Gl=function(e,t){var n;return Pl(n={},M.Etm.AUTHENTICATE,{handler:function(n){var r=n.socket,o=n.args.access_token;if(null==o&&r.transport===M.Hej.IPC){var i=r.application.id;if(null==i)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");var a=M.xVR.IDENTIFY,s=function(){
return Dl({client_id:i,scope:a,response_type:"token"},e,t).then((function(e){if(null==e)throw new ds.Z(M.lTL.UNKNOWN_ERROR,"Unknown error occurred");var t=e.split(/#|\?/),n=vl.parse(t[t.length-1]);if(null!=n.error){var o;throw new ds.Z(M.lTL.OAUTH2_ERROR,"OAuth2 Error: ".concat(n.error,": ").concat(null!==(o=n.error_description)&&void 0!==o?o:"unknown error"))}!function(e,t,n,r){var o,i=null!==(o=_e.Z.get(wl))&&void 0!==o?o:{};i[e]={accessToken:t,scope:n,expires:Date.now()+r};_e.Z.set(wl,i)}(i,n.access_token,n.scope,n.expires_in);return Ll(r,n.access_token)}))};o=function(e,t){var n=_e.Z.get(wl);if(null!=n&&null!=n[e]){var r=n[e];if(!(r.scope!==t||r.expires<=Date.now()))return r.accessToken;delete n[e];_e.Z.set(wl,n)}}(i,a);return null!=o?Ll(r,o).catch((function(){!function(e){var t,n=null!==(t=_e.Z.get(wl))&&void 0!==t?t:{};delete n[e];_e.Z.set(wl,n)}(i);return s()})):s()}if(null==o)throw new ds.Z(M.lTL.INVALID_TOKEN,"No access token provided");return Ll(r,o)}}),Pl(n,M.Etm.AUTHORIZE,{
handler:function(n){var r=n.socket,o=n.args,i=o.client_id;if(!i)throw new ds.Z(M.lTL.INVALID_CLIENTID,"No client id provided");if(null!=r.authorization.accessToken)throw new ds.Z(M.lTL.INVALID_COMMAND,"Already authenticated");if(r.authorization.authing)throw new ds.Z(M.lTL.INVALID_COMMAND,"Already authing");r.authorization.authing=!0;return cs.Z.get({url:M.ANM.APPLICATION_RPC(i),oldFormErrors:!0}).then((function(n){var i=n.body;if(r.application.id!==i.id)throw new ds.Z(M.lTL.INVALID_CLIENTID,"Application does not match the connection's");var a=o.scopes||o.scope;delete o.scopes;return Dl(Rl(jl({},o),{scope:a}),e,t)}),(function(){throw new ds.Z(M.lTL.INVALID_CLIENTID,"Invalid client id: ".concat(i))})).then((function(e){r.authorization.authing=!1;if(null==e)throw new ds.Z(M.lTL.UNKNOWN_ERROR,"Unknown error occurred");var t=vl.parse(e.split("?")[1].split("#")[0]);if(null!=t.error){var n
;throw new ds.Z(M.lTL.OAUTH2_ERROR,"OAuth2 Error: ".concat(t.error,": ").concat(null!==(n=t.error_description)&&void 0!==n?n:"unknown error"))}return{code:t.code}})).catch((function(e){r.authorization.authing=!1;throw e}))}}),n}((function(e,t,n,o,i,a,s,l,u,f,d,p,h){var E="OAuth2Authorize_".concat(e,"_").concat(f,"_").concat(d);return new Promise((function(y){var m=function(e){y(e)};(0,c.h7j)((function(c){return(0,r.jsx)(Ol.OAuth2AuthorizeModal,kl(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Ul(e,t,n[t])}))}return e}({},c),{authorization:t,clientId:e,scopes:null!=n?n:[],callback:m,responseType:i,redirectUri:a,codeChallenge:s,codeChallengeMethod:l,state:u,permissions:o,guildId:f,channelId:d,prompt:p,
disableGuildSelect:"boolean"==typeof h?h:"true"===h}))}),{modalKey:E,onCloseRequest:function(){(0,c.Mr3)(E);y(void 0)}},gl(t.application)?c.u1M:c.z1l)}))}),(function(e){if(Lt.FB){var t=gl(e)?M.KJ3.CHANNEL_CALL_POPOUT:null;(0,Lt.ED)()?ss.default.minimize(t):ss.default.restore(t);ss.default.focus(t)}}));var Bl=n(118044),Hl=n(196389),Vl=n(717187),Fl=n.n(Vl),Yl=n(930948),zl=n(90924);function Wl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Kl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ql(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Xl(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ql(i,r,o,a,s,"next",e)}function s(e){ql(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Ql(e){
Ql=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Ql(e)}function $l(e,t){return!t||"object"!==tu(t)&&"function"!=typeof t?Kl(e):t}function Jl(e,t){Jl=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Jl(e,t)}function eu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Wl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wl(e,t)}(e,t)||function(){
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var tu=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function nu(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Ql(e);if(t){var o=Ql(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return $l(this,n)}}var ru=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){
if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ou=new Map,iu=new Set,au=function(e,t,n){n([zl.Z.CLOSE,t],e)},su=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
;e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Jl(e,t)}(r,e);var t=nu(r);function r(e,o,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var s;(s=t.call(this)).disconnectSocket=function(e,t){var n,r,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];s.emit("disconnect",e,o?void 0:t);e.close(t.code,null!==(n=t.message)&&void 0!==n?n:"Unknown");var i=eu(null!==(r=Array.from(ou.entries()).find((function(t){var n=eu(t,2);n[0];return n[1]===e})))&&void 0!==r?r:[null,null],1),a=i[0];null!=a&&ou.delete(a)};s.handleIFrameMount=function(e){var t=e.id;iu.add(t);s.handshakeFailureTimeoutId=setTimeout((function(){Array.from(R.ZP.getSelfEmbeddedActivities().entries()).forEach((function(e){var t=eu(e,2),n=t[0],r=t[1];Ie.default.track(M.rMx.ACTIVITY_HANDSHAKE_TIMED_OUT,{application_id:n,channel_id:r.channelId,guild_id:r.guildId,timeout_ms:1e4})}))}),1e4)}
;s.handleIFrameUnmount=function(e){var t,n=e.id;iu.delete(n);var r=eu(null!==(t=Array.from(ou.entries()).find((function(e){var t=eu(e,2);t[0];return t[1].frameId===n})))&&void 0!==t?t:[null,null],2),o=r[0],i=r[1];if(null!=i&&null!=o){s.disconnectSocket(i,{code:M.$VG.CLOSE_NORMAL,message:"iFrame gone"},!0);ou.delete(o)}};s.handleMessage=function(e,t,n){var r=ou.get(t);try{s.routeEvent(r,t,e,n)}catch(e){null!=r?s.disconnectSocket(r,{code:e.code,message:e.message},!0):au(t,{code:e.code,message:e.message},n)}};s.handleFrame=function(e,t,n){var r,o,i;if(e!==t.origin)throw new ds.Z(M.$VG.INVALID_ORIGIN,"Origin has changed");try{i="string"==typeof n?JSON.parse(n):n}catch(e){throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,"Payload not recognized encoding")}null===(o=(r=s).onFrameHandled)||void 0===o||o.call(r,i,s.logger,t);s.emit("request",t,i)};var c,l=Kl(s);s.handleHandshake=(c=Xl((function(e,t,r){var o,i,a,s,c,u;return ru(this,(function(f){switch(f.label){case 0:
null!=l.handshakeFailureTimeoutId&&clearTimeout(l.handshakeFailureTimeoutId);return[4,n.e(54533).then(n.t.bind(n,197683,23))];case 1:o=f.sent().default;try{o.assert(t,o.object().required().keys({v:o.number().min(1).max(1).required(),encoding:o.string().equal("json").optional(),client_id:o.string().required(),frame_id:o.string().required()}))}catch(e){throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,e.message)}a=(i=t).frame_id;if(!iu.has(a)){l.logger.error("Unrecognized frame ID ".concat(a));throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,"Unrecognized frame ID ".concat(a))}try{s=l.createPostMessageProxySocket({origin:e,postMessageToRPCClient:r,frameId:a,version:Number(i.v),logger:l.logger,postClose:au,encoding:null!==(c=i.encoding)&&void 0!==c?c:"json"})}catch(e){l.logger.error("Error opening window socket ".concat(e));throw e}l.logger.info("Socket Opened: ".concat(s.id));f.label=2;case 2:f.trys.push([2,4,,5]);return[4,l.validateSocketClient(s,e,i.client_id)];case 3:f.sent();if(!iu.has(a)){
l.logger.error("Frame ID ".concat(a," no longer exists"));throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,"Unrecognized frame ID ".concat(a))}ou.set(e,s);iu.delete(a);l.emit("connect",s);l.logger.info("Socket Validated: ".concat(s.id));return[3,5];case 4:u=f.sent();l.logger.info("Socket Closed: ".concat(s.id,", ").concat(u.message));throw u;case 5:return[2]}}))})),function(e,t,n){return c.apply(this,arguments)});var u=Kl(s);s.handleClose=function(){var e=Xl((function(e,t){var r,o;return ru(this,(function(i){switch(i.label){case 0:return[4,n.e(54533).then(n.t.bind(n,197683,23))];case 1:r=i.sent().default;try{r.assert(t,r.object().required().unknown(!0).keys({code:r.number().valid(Object.values(M.$VG)).required(),message:r.string().optional()}))}catch(e){throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,e.message)}o=t;u.disconnectSocket(e,o);return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}();Yl.S.subscribe(M.CkL.IFRAME_MOUNT,s.handleIFrameMount)
;Yl.S.subscribe(M.CkL.IFRAME_UNMOUNT,s.handleIFrameUnmount);s.validateSocketClient=e;s.logger=o;s.createPostMessageProxySocket=i;s.onFrameHandled=a;return s}r.prototype.routeEvent=function(e,t,n,r){if(!Array.isArray(n))throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,"Protocol error");var o=eu(n,2),i=o[0],a=o[1];switch(i){case zl.Z.HANDSHAKE:if(null!=e)throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,"Already connected");return this.handleHandshake(t,a,r);case zl.Z.FRAME:if(null==e)throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,"Not connected");return this.handleFrame(t,e,a);case zl.Z.CLOSE:if(null==e)throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,"Not connected");return this.handleClose(e,a);default:throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,"Invalid opcode")}};return r}(Fl()),cu=n(731458);function lu(e){lu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return lu(e)}function uu(e,t){return!t||"object"!==du(t)&&"function"!=typeof t?function(e){
if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function fu(e,t){fu=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return fu(e,t)}var du=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function pu(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=lu(e);if(t){var o=lu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return uu(this,n)}}var hu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&fu(e,t)}(n,e);var t=pu(n)
;function n(e){var r,o=e.origin,i=e.postMessageToRPCClient,a=e.frameId,s=e.version,c=e.encoding,l=e.logger,u=e.postClose,f=e.onSendingToRPCClient;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);r=t.call(this,M.Hej.POST_MESSAGE,s,c);if(-1===["etf","json"].indexOf(c))throw new ds.Z(M.$VG.INVALID_ENCODING,"Invalid Encoding: ".concat(c));if("etf"===c)throw new ds.Z(M.$VG.INVALID_ENCODING,"Erlpack cannot be used on this client");r.origin=o;r.postMessageToRPCClient=i;r.frameId=a;r.logger=l;r.postClose=u;r.onSendingToRPCClient=f;r.closed=!1;return r}var r=n.prototype;r.send=function(e){var t;null===(t=this.onSendingToRPCClient)||void 0===t||t.call(this,e,this.id);this.postMessageToRPCClient([zl.Z.FRAME,e],this.origin)};r.close=function(e,t){this.closed||this.postClose(this.origin,{code:e,message:t},this.postMessageToRPCClient);this.closed=!0};return n}(cu.Z);const Eu=function(e){
var t=e.origin,n=e.postMessageToRPCClient,r=e.frameId,o=e.version,i=e.encoding,a=e.logger,s=e.postClose;return new hu({origin:t,postMessageToRPCClient:n,frameId:r,version:o,encoding:i,logger:a,postClose:s,onSendingToRPCClient:function(e,t){(Bl.default.isLoggingOverlayEvents||e.cmd!==M.Etm.OVERLAY&&e.evt!==M.zMe.OVERLAY)&&a.info("Socket Emit: ".concat(t),(0,Hl.Z)(e))}})};var yu=new jn.Z("RPCServer:PostMessage"),mu=function(e,t,n){(Bl.default.isLoggingOverlayEvents||e.cmd!==M.Etm.OVERLAY)&&t.info("Socket Message: ".concat(n.id),(0,Hl.Z)(e))};const bu={authCommands:Gl,voiceSettingsEvents:bl,postMessageTransport:function(){var e=new su(ml.em,yu,Eu,mu);window.addEventListener("message",(function(t){if(window!==t.source)if(null!=t.source&&null!=t.source.postMessage){var n=t.source,r=t.data,o=t.origin;e.handleMessage(r,o,(function(e,t){n.postMessage(e,t)}))}else yu.error("Unknown event source")}));return e}()};var gu=n(148834);var Ou=function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,
enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},M.zMe.OVERLAY_UPDATE,{scope:M.lHf,handler:function(e){var t=e.args.pid,n=e.socket;if("number"!=typeof t||t<10)throw new ds.Z(M.lTL.INVALID_EVENT,"Invalid pid");return function(e){var r=e.prevState,o=e.dispatch,i=Ur.Z.enabled,a=!0,s=n.application.id;if(null!=s){var c=Ln.Z.getActiveLibraryApplication(s);null!=c&&(i=i&&c.isOverlayEnabled());a=Ur.Z.isInputLocked(t)}var l={enabled:i,locked:a};Wa().isEqual(l,r)||o(l);return l}}}),vu=n(57141),_u=n(846334),Iu=n(496916);function Su(e,t){return null!=e.application_id&&null==t.getApplicationActivity(e.application_id,!1)}var Tu=n(15970),Nu=n(997582),Au=n(436154),Cu=n(202181);function Pu(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function ju(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Pu(i,r,o,a,s,"next",e)}function s(e){Pu(i,r,o,a,s,"throw",e)}a(void 0)}))}}
function Ru(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function xu(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var Mu,wu=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,
r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Du(e,t,n,r){return Zu.apply(this,arguments)}function Zu(){Zu=ju((function(e,t,n,r){var o,i,a,s,c=arguments;return wu(this,(function(l){switch(l.label){case 0:o=c.length>4&&void 0!==c[4]?c[4]:"";if(null==(i=Nu.Z.getApplicationActivity(t))||null==i.secrets||!(0,
ts.t9)(r,i.party,i.secrets))throw new ds.Z(M.lTL.NO_ELIGIBLE_ACTIVITY,"No eligible activity for application. Ensure an activity includes a party and appropriate secret.");if(a=Su(i,Au.Z)){s=(0,ml.s0)(e).lock;return[2,(0,_u.h7)(i,a).then((function(){s();throw new ds.Z(M.lTL.NO_ELIGIBLE_ACTIVITY,"No eligible activity for application. Ensure user does have have privacy enabled.")}))]}return[4,vu.Z.sendActivityInviteUser({userId:n,type:r,activity:i,content:o,location:"In-Game Invite"})];case 1:l.sent();return[2]}}))}));return Zu.apply(this,arguments)}const Lu=(Ru(Mu={},M.Etm.SEND_ACTIVITY_JOIN_INVITE,{scope:Ru({},M.Gp_.ANY,[M.xVR.RPC,M.lHf]),handler:function(e){var t=e.socket,n=e.args,r=n.user_id,o=n.pid,i=t.application.id;if(null==i)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");return Du(o,i,r,M.mFx.JOIN)}}),Ru(Mu,M.Etm.CLOSE_ACTIVITY_JOIN_REQUEST,{scope:Ru({},M.Gp_.ANY,[M.xVR.RPC,M.lHf]),handler:function(e){var t=e.args.user_id,n=S.Z.getDMFromUserId(t);null!=n&&(0,
Iu.In)(n,!0,!0)}}),Ru(Mu,M.Etm.ACTIVITY_INVITE_USER,{scope:Ru({},M.Gp_.ANY,[M.xVR.RPC,M.lHf]),validation:function(e){return e.object().required().keys({user_id:e.string().required(),type:e.number().required().valid([M.mFx.JOIN]),content:e.string().min(0).max(1024),pid:e.number().min(0).required()})},handler:function(e){var t=e.socket,n=e.args,r=n.type,o=n.user_id,i=n.content,a=n.pid,s=t.application.id;if(null==s)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");return Du(a,s,o,r,i)}}),Ru(Mu,M.Etm.ACCEPT_ACTIVITY_INVITE,{scope:Ru({},M.Gp_.ANY,[M.xVR.RPC,M.lHf]),validation:function(e){return e.object().required().keys({type:e.number().required().valid([M.mFx.JOIN]),user_id:e.string().required(),session_id:e.string().required(),channel_id:e.string().required(),message_id:e.string().required()})},handler:function(e){var t=e.socket,n=e.args,r=n.type,o=n.user_id,i=n.session_id,a=n.channel_id,s=n.message_id,c=t.application.id
;if(null==c)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");var l=Promise.resolve(!1);if(r===M.mFx.JOIN)l=Pn.Z.join({userId:o,sessionId:i,applicationId:c,channelId:a,messageId:s});return l.then((function(e){if(!e)throw new ds.Z(M.lTL.INVALID_INVITE,"Invite is expired or invalid.")}))}}),Ru(Mu,M.Etm.OPEN_INVITE_DIALOG,{scope:Ru({},M.Gp_.ANY,[M.xVR.RPC,M.lHf,M.wEG]),handler:function(e){var t=e.socket,o=C.Z.getVoiceChannelId(),i=S.Z.getChannel(o);if(null==i)throw new ds.Z(M.lTL.INVALID_CHANNEL,"Invalid channel ".concat(o));var a=Zt.Z.getGuild(i.getGuildId());if(null==a)throw new ds.Z(M.lTL.INVALID_CHANNEL,"Invalid guild ".concat(i.getGuildId()));if(!(0,Tu.b)(dn.Z,a,i))throw new ds.Z(M.lTL.INVALID_PERMISSIONS,"No invite permissions for ".concat(o));var s=I.Z.getWindow(M.KJ3.CHANNEL_CALL_POPOUT);(null==s?void 0:s.closed)&&(s=null);var l=null!=s?M.IlC.POPOUT:M.IlC.APP;(0,Cu.Pr)({},null==s?void 0:s.document);(0,c.ZDy)(ju((function(){var e,o;return wu(this,(function(s){switch(s.label){
case 0:return[4,Promise.all([n.e(40532),n.e(45446)]).then(n.bind(n,945446))];case 1:e=s.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,xu(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Ru(e,t,n[t])}))}return e}({},e),{guild:a,channel:i,applicationId:t.application.id,analyticsLocation:M.Sbl.ACTIVITY_RPC,source:M.t4x.ACTIVITY_INVITE}))}]}}))})),{contextKey:l===M.IlC.POPOUT?c.u1M:c.z1l})}}),Mu);var Uu=n(513328),ku=n(151367);function Gu(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Bu(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Gu(i,r,o,a,s,"next",e)}function s(e){Gu(i,r,o,a,s,"throw",e)}
a(void 0)}))}}function Hu(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Vu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Hu(e,t,n[t])}))}return e}function Fu(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var Yu,zu=function(e,t){var n,r,o,i,a={label:0,sent:function(){
if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}
}([i,s])}}};function Wu(e,t){var n=ku.Z.isEntitledToSku(Y.default.getCurrentUser(),e,t);return null!=n?Promise.resolve(n):(0,Tc.yD)(t).then((function(){return!0===ku.Z.isEntitledToSku(Y.default.getCurrentUser(),e,t)}))}const Ku=(Hu(Yu={},M.Etm.VALIDATE_APPLICATION,{scope:M.lHf,handler:function(e){var t=e.socket.application.id;try{if(null==t)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");var o=Rn.Z.getGame(t);if(null==o)throw new ds.Z(M.lTL.INVALID_ENTITLEMENT,"SKU does not exist.");var i=o.primarySkuId;if(null==i)throw new ds.Z(M.lTL.INVALID_ENTITLEMENT,"SKU does not exist.");return Promise.race([Wu(i,o.id).then((function(e){if(!e)throw new ds.Z(M.lTL.INVALID_ENTITLEMENT,"User does not have entitlement.")})),(0,Uu.GR)(1e4).then((function(){throw new ds.Z(M.lTL.INVALID_ENTITLEMENT,"Timed out fetching entitlement.")}))])}catch(e){if(e.code===M.lTL.INVALID_ENTITLEMENT){ss.default.focus(null,!0);(0,c.ZDy)(Bu((function(){var e,o;return zu(this,(function(i){switch(i.label){case 0:
return[4,Promise.all([n.e(40532),n.e(7811)]).then(n.bind(n,707811))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,Fu(Vu({},e),{applicationId:t}))}]}}))})))}throw e}}}),Hu(Yu,M.Etm.GET_ENTITLEMENT_TICKET,{scope:M.lHf,handler:function(e){var t=e.socket.application.id;if(null==t)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");return cs.Z.post({url:M.ANM.ENTITLEMENT_TICKET(t),body:{test_mode:Xn.Z.inTestModeForApplication(t)||ys.Z.inDevModeForApplication(t)},retries:3,oldFormErrors:!0}).then((function(e){return e.body})).catch((function(e){ss.default.focus(null,!0);(0,c.ZDy)(Bu((function(){var e,o;return zu(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(7811)]).then(n.bind(n,707811))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,Fu(Vu({},e),{applicationId:t}))}]}}))})));throw e}))}}),Yu);var qu=n(379991),Xu=n(649222);function Qu(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}
s.done?t(c):Promise.resolve(c).then(r,o)}function $u(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Qu(i,r,o,a,s,"next",e)}function s(e){Qu(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Ju(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var ef=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop()
;a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},tf="activity-hardware-acceleration-modal";function nf(e){!qu.ZP.disableActivityHardwareAccelerationPrompt&&Lt.FB&&!ss.default.getEnableHardwareAcceleration()&&(0,c.ZDy)($u((function(){var t,o;return ef(this,(function(i){switch(i.label){case 0:return[4,Promise.resolve().then(n.bind(n,649222))];case 1:t=i.sent(),o=t.default;return[2,function(t){return(0,r.jsx)(o,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Ju(e,t,n[t])}))}return e}({applicationId:e},t))}]}}))})),{modalKey:tf,onCloseRequest:function(){Ie.default.track(M.rMx.MODAL_DISMISSED,{type:Xu.ACTIVITY_ENCOURAGES_HW_ACCELERATION});(0,c.Mr3)(tf)}})}const rf=function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},M.Etm.ENCOURAGE_HW_ACCELERATION,{validation:function(e){return e.object()},handler:function(e){var t=e.socket;(0,ts.bu)(t.transport);var n=t.application.id;if(null!=n){nf(n);return{enabled:ss.default.getEnableHardwareAcceleration()}}}});function of(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function af(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n)
;function a(e){of(i,r,o,a,s,"next",e)}function s(e){of(i,r,o,a,s,"throw",e)}a(void 0)}))}}function sf(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function cf(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var lf,uf=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){
if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};const ff=(sf(lf={},M.Etm.SET_OVERLAY_LOCKED,{scope:M.lHf,validation:function(e){return e.object().required().keys({locked:e.boolean().required(),pid:e.number().min(0).required()})},handler:function(e){
var t=e.args,n=t.locked,r=t.pid;if(null==e.socket.application.id)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");Sr.Z.setLocked(n,r)}}),sf(lf,M.Etm.OPEN_OVERLAY_ACTIVITY_INVITE,{scope:M.lHf,validation:function(e){return e.object().required().keys({type:e.number().required().valid([M.mFx.JOIN]),pid:e.number().min(0).required()})},handler:function(e){var t=e.socket,n=e.args,r=n.type,o=n.pid,i=t.application.id;if(null==i)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");var a=Nu.Z.getApplicationActivity(i);if(null==a||null==a.secrets||!(0,ts.t9)(r,a.party,a.secrets))throw new ds.Z(M.lTL.NO_ELIGIBLE_ACTIVITY,"No eligible activity for application. Ensure an activity includes a party and appropriate secret.");var s=(0,ml.s0)(o).lock,c=Su(a,Au.Z);return(0,_u.h7)(a,c).then((function(){s();if(c)throw new ds.Z(M.lTL.NO_ELIGIBLE_ACTIVITY,"No eligible activity for application. Ensure user does have have privacy enabled.")}))}}),sf(lf,M.Etm.OPEN_OVERLAY_GUILD_INVITE,{scope:M.lHf,
validation:function(e){return e.object().required().keys({code:e.string().required(),pid:e.number().min(0).required()})},handler:function(e){var t=e.args,n=t.code,r=t.pid;if(null==e.socket.application.id)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");return ir.Z.resolveInvite(n,"Game SDK").then((function(e){var t=e.invite,n=e.code;if(null==t)throw new ds.Z(M.lTL.INVALID_INVITE,"Invalid invite id: ".concat(n));var o=(0,ml.s0)(r),i=o.context,a=o.lock;return new Promise((function(e){O.Z.dispatch({type:"INVITE_MODAL_OPEN",invite:t,code:n,context:i,resolve:e})})).then(a)}))}}),sf(lf,M.Etm.OPEN_OVERLAY_VOICE_SETTINGS,{scope:M.lHf,validation:function(e){return e.object().required().keys({pid:e.number().min(0).required()})},handler:function(e){var t=e.args.pid,o=e.socket,i=o.application.id;if(null==i)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");var a=(0,ml.s0)(t).lock;return new Promise((function(e){(0,c.ZDy)(af((function(){var t,s;return uf(this,(function(c){
switch(c.label){case 0:return[4,Promise.all([n.e(40532),n.e(21723)]).then(n.bind(n,621723))];case 1:t=c.sent(),s=t.default;return[2,function(t){return(0,r.jsx)(s,cf(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){sf(e,t,n[t])}))}return e}({},t),{mediaEngineContext:i,title:o.application.name,onClose:function(){t.onClose();a();e()}}))}]}}))})))}))}}),lf);var df=n(97245),pf=n(673679),hf=n(561177),Ef=n(579344),yf=n(563726),mf=n(145739),bf=n(585622);function gf(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Of(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){gf(i,r,o,a,s,"next",e)}function s(e){
gf(i,r,o,a,s,"throw",e)}a(void 0)}))}}function vf(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function _f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){vf(e,t,n[t])}))}return e}function If(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var Sf,Tf=function(e,t){var n,r,o,i,a={label:0,
sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{
value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Nf(e,t){null!=e&&Ie.default.track(M.rMx.EXTERNAL_DYNAMIC_LINK_RECEIVED,{invite_code:null,has_auth_token:null,is_backgrounded:null,fingerprint:(0,df.s)(e),link_type:t})}const Af=(vf(Sf={},M.Etm.INVITE_BROWSER,{scope:M.cEn,handler:function(e){var t=e.args.code;return Of((function(){var e;return Tf(this,(function(n){switch(n.label){case 0:return[4,ir.Z.resolveInvite(t,"Desktop Modal")];case 1:if(null==(e=n.sent().invite))throw new ds.Z(M.lTL.INVALID_INVITE,"Invalid invite id: ".concat(t));Jn.default.isAuthenticated()?O.Z.dispatch({type:"INVITE_MODAL_OPEN",invite:e,code:t,context:M.IlC.APP}):(0,K.dL)(M.Z5c.INVITE(t));return[2,{invite:e,code:t}]}}))}))()}}),vf(Sf,M.Etm.GUILD_TEMPLATE_BROWSER,{scope:M.cEn,handler:function(e){var t=e.args.code;return Of((function(){var e;return Tf(this,(function(o){switch(o.label){case 0:return null==Y.default.getCurrentUser()?[2]:[4,mf.Z.resolveGuildTemplate(t)];case 1:
if(null==(e=o.sent().guildTemplate))throw new ds.Z(M.lTL.INVALID_GUILD_TEMPLATE,"Invalid guild template id: ".concat(t));ss.default.focus();(0,c.ZDy)(Of((function(){var t,o;return Tf(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(75336)]).then(n.bind(n,175336))];case 1:t=i.sent(),o=t.default;return[2,function(t){return(0,r.jsx)(o,If(_f({},t),{guildTemplate:e}))}]}}))})));return[2,{guildTemplate:e,code:t}]}}))}))()}}),vf(Sf,M.Etm.GIFT_CODE_BROWSER,{scope:M.cEn,handler:function(e){var t=e.args.code;return new Promise((function(e,o){O.Z.wait((function(){yf.Z.resolveGiftCode(t,!0,!0).then((function(o){var i=o.giftCode;ss.default.focus();Ie.default.track(M.rMx.OPEN_MODAL,{type:"gift_accept",location:M.SaU});(0,c.ZDy)(Of((function(){var e,o;return Tf(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(33600)]).then(n.bind(n,133600))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,_f({code:t},e))}]}}))})));e({
giftCode:i})})).catch((function(){return o(new ds.Z(M.lTL.INVALID_GIFT_CODE,"Invalid gift code: ".concat(t)))}))}))}))}}),vf(Sf,M.Etm.DEEP_LINK,{scope:M.cEn,handler:function(e){var t=e.args,n=t.type,r=t.params;ss.default.focus();switch(n){case M.jEp.USER_SETTINGS:if(null!=r){(0,K.dL)(M.Z5c.SETTINGS(r.section,r.subsection));Nf(r.fingerprint,M.Ua3.SETTINGS)}break;case M.jEp.CHANGELOG:if(null!=r){(0,K.dL)(bf.Z.formatPathWithQuery(M.Z5c.CHANGELOGS(r.date),r.query));Nf(r.fingerprint,M.Ua3.CHANGELOG)}break;case M.jEp.LIBRARY:(0,K.dL)(M.Z5c.APPLICATION_LIBRARY);null!=r&&Nf(r.fingerprint,M.Ua3.LIBRARY);break;case M.jEp.STORE_HOME:(0,K.dL)(M.Z5c.APPLICATION_STORE);null!=r&&Nf(r.fingerprint,M.Ua3.STORE);break;case M.jEp.STORE_LISTING:if(null!=r){(0,K.dL)(M.Z5c.APPLICATION_STORE_LISTING_SKU(r.skuId,r.slug));Nf(r.fingerprint,M.Ua3.STORE)}break;case M.jEp.PICK_GUILD_SETTINGS:if(null!=r){(0,K.dL)({pathname:M.Z5c.PICK_GUILD_SETTINGS(r.section,r.subsection),search:r.search})
;Nf(r.fingerprint,M.Ua3.GUILD_SETTINGS)}break;case M.jEp.CHANNEL:if(null!=r){(0,K.dL)({pathname:M.Z5c.CHANNEL(r.guildId,r.channelId,r.messageId),search:r.search});Nf(r.fingerprint,M.Ua3.CHANNEL)}}}}),vf(Sf,M.Etm.BROWSER_HANDOFF,{scope:M.CND,handler:function(e){var t=e.args,n=t.handoffToken,r=t.fingerprint;ss.default.focus(null,!0);(0,hf.lx)(n,r)}}),vf(Sf,M.Etm.CONNECTIONS_CALLBACK,{scope:M.cEn,handler:function(e){var t=e.args,n=t.providerType,r=t.code,o=t.openid_params,i=t.state;return Ef.Z.callback(n,{code:r,openid_params:o,state:i})}}),vf(Sf,M.Etm.BRAINTREE_POPUP_BRIDGE_CALLBACK,{scope:M.cEn,handler:function(e){var t=e.args,n=t.state,r=t.path,o=t.query;return(0,pf.rt)({paymentSourceType:M.HeQ.PAYPAL,state:n,path:r,query:o})}}),vf(Sf,M.Etm.BILLING_POPUP_BRIDGE_CALLBACK,{scope:M.cEn,handler:function(e){var t=e.args,n=t.state,r=t.path,o=t.query,i=t.payment_source_type;return(0,pf.rt)({paymentSourceType:i,state:n,path:r,query:o})}}),Sf);var Cf=n(691287),Pf=n(153686),jf=n(203600)
;function Rf(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var xf,Mf,wf,Df=[Pf.Z.RPC];function Zf(e){if(null==e)return{lock:M.VqG,context:M.IlC.APP};var t=(0,ml.s0)(e);return{lock:t.lock,context:t.context}}function Lf(e,t){var n={subscriptionTier:jf.Si.TIER_2,analyticsLocations:Df,analyticsObject:t};switch(e){case M.IlC.APP:return na.Z.openPremiumPaymentModalInApp(n);case M.IlC.OVERLAY:return na.Z.openPremiumPaymentModalInOverlay(n);default:throw new Error("Unexpected app context: ".concat(e))}}const Uf=(Rf(wf={},M.Etm.START_PURCHASE,(Rf(xf={},M.Gp_.ANY,[M.wEG,M.lHf]),Rf(xf,"validation",(function(e){return e.object().required().keys({sku_id:e.string().required(),pid:e.number().min(0)})})),Rf(xf,"handler",(function(e){var t=e.socket,n=e.args,r=n.sku_id,o=n.pid;Pc(t.transport);var i=t.application.id;if(null==i)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.")
;var a=Zf(t.transport!==M.Hej.POST_MESSAGE?o:null),s=a.lock,c=a.context,l={page:M.ZY5.IN_APP};return(0,Cf.S)({applicationId:i,skuId:r,openPremiumPaymentModal:function(){return Lf(c,l)},analyticsLocations:Df,analyticsLocation:l,context:c}).then((function(e){s();return e}),(function(e){s();if(null!=e)throw new ds.Z(M.lTL.PURCHASE_ERROR,e);throw new ds.Z(M.lTL.PURCHASE_CANCELED,"Purchase was canceled by the user.")}))})),xf)),Rf(wf,M.Etm.START_PREMIUM_PURCHASE,(Rf(Mf={},M.Gp_.ANY,[M.wEG,M.lHf]),Rf(Mf,"validation",(function(e){return e.object().keys({pid:e.number().min(0)})})),Rf(Mf,"handler",(function(e){var t=e.socket,n=e.args.pid;Pc(t.transport);if(null==t.application.id)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");var r=Zf(t.transport!==M.Hej.POST_MESSAGE?n:null),o=r.lock;return Lf(r.context,{page:M.ZY5.IN_APP}).then((function(){o()}),(function(e){o();if(null!=e)throw new ds.Z(M.lTL.PURCHASE_ERROR,e)
;throw new ds.Z(M.lTL.PURCHASE_CANCELED,"Purchase was canceled by the user.")}))})),Mf)),wf);var kf,Gf=n(79251);function Bf(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Hf(e){var t=e.application.id;if(null==t)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");return t}const Vf=(Bf(kf={},M.Etm.SET_VOICE_SETTINGS_2,{scope:M.lHf,validation:function(e){return e.object().required().keys({input_mode:e.object().keys({type:e.string().valid(Object.keys(M.pM4)),shortcut:e.string().required()}),self_mute:e.boolean(),self_deaf:e.boolean()})},handler:function(e){var t=e.socket,n=e.args,r=n.input_mode,o=n.self_mute,i=n.self_deaf,a=Hf(t);null!=r&&Fe.Z.setMode(r.type,{shortcut:(0,Gf.Kd)(r.shortcut)},a);null!=o&&o!==Ye.Z.isSelfMute(a)&&Fe.Z.toggleSelfMute({context:a});null!=i&&i!==Ye.Z.isSelfDeaf(a)&&Fe.Z.toggleSelfDeaf({context:a})}}),Bf(kf,M.Etm.SET_USER_VOICE_SETTINGS_2,{scope:M.lHf,validation:function(e){
return e.object().required().keys({user_id:e.string().required(),volume:e.number().min(0).max(200),mute:e.boolean()})},handler:function(e){var t=e.socket,n=e.args,r=n.user_id,o=n.mute,i=n.volume,a=Hf(t);null!=o&&o!==Ye.Z.isLocalMute(r,a)&&Fe.Z.toggleLocalMute(r,a);null!=i&&Fe.Z.setLocalVolume(r,i,a)}}),kf);function Ff(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var Yf;function zf(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Wf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){zf(e,t,n[t])}))}return e}var Kf=Wf({},ll,Lu,Ku,rf,ff,Af,Uf,(Ff(Yf={},M.Etm.SET_USER_VOICE_SETTINGS,{
scope:Ff({},M.Gp_.ANY,[M.xVR.RPC,M.xVR.RPC_VOICE_WRITE]),validation:function(e){return e.object().required().keys({user_id:e.string().required(),pan:e.object().keys({left:e.number().min(0).max(1).required(),right:e.number().min(0).max(1).required()}),volume:e.number().min(0).max(200),mute:e.boolean()})},handler:function(e){var t=e.args,n=t.user_id,r=t.pan,o=t.volume,i=t.mute,a=Y.default.getCurrentUser();if(null==Y.default.getUser(n)||(null==a?void 0:a.id)===n)throw new ds.Z(M.lTL.INVALID_USER,"Invalid user id: ".concat(n));null!=r&&Fe.Z.setLocalPan(n,r.left,r.right);null!=o&&Fe.Z.setLocalVolume(n,o);if(null!=i){var s=Ye.Z.isLocalMute(n);(s&&!i||!s&&i)&&Fe.Z.toggleLocalMute(n)}return{user_id:n,pan:Ye.Z.getLocalPan(n),volume:Ye.Z.getLocalVolume(n),mute:Ye.Z.isLocalMute(n)}}}),Ff(Yf,M.Etm.GET_VOICE_SETTINGS,{scope:Ff({},M.Gp_.ANY,[M.xVR.RPC,M.xVR.RPC_VOICE_READ]),handler:function(){return(0,ml._X)()}}),Ff(Yf,M.Etm.SET_VOICE_SETTINGS,{
scope:Ff({},M.Gp_.ANY,[M.xVR.RPC,M.xVR.RPC_VOICE_WRITE]),validation:function(e){return e.object().required().keys({input:e.object().keys({device_id:e.string().valid(Object.keys(Ye.Z.getInputDevices())),volume:e.number().min(0).max(100)}),output:e.object().keys({device_id:e.string().valid(Object.keys(Ye.Z.getOutputDevices())),volume:e.number().min(0).max(200)}),mode:e.object().keys({type:e.string().valid(Object.keys(M.pM4)),auto_threshold:e.boolean(),threshold:e.number().min(-100).max(0),shortcut:e.array().items(e.object().keys({type:e.number().min(0).max(3).required(),code:e.number().required(),name:e.string()})),delay:e.number().min(0).max(2e3)}),automatic_gain_control:e.boolean(),echo_cancellation:e.boolean(),noise_suppression:e.boolean(),qos:e.boolean(),silence_warning:e.boolean(),deaf:e.boolean(),mute:e.boolean()})},handler:function(e){
var t=e.args,n=t.input,r=t.output,o=t.mode,i=t.automatic_gain_control,a=t.echo_cancellation,s=t.noise_suppression,c=t.qos,l=t.silence_warning,u=t.deaf,f=t.mute;if(n){null!=n.device_id&&Fe.Z.setInputDevice(n.device_id);null!=n.volume&&Fe.Z.setInputVolume(n.volume)}if(r){null!=r.device_id&&Fe.Z.setOutputDevice(r.device_id);null!=r.volume&&Fe.Z.setOutputVolume(r.volume)}if(o){var d=Ye.Z.getMode(),p=Ye.Z.getModeOptions();null!=o.type&&(d=o.type);null!=o.auto_threshold&&(p.autoThreshold=o.auto_threshold);null!=o.threshold&&(p.threshold=o.threshold);null!=o.shortcut&&(p.shortcut=o.shortcut.map((function(e){return[e.type,e.code]})));null!=o.delay&&(p.delay=o.delay);Fe.Z.setMode(d,p)}null!=i&&Fe.Z.setAutomaticGainControl(i);null!=a&&Fe.Z.setEchoCancellation(a);null!=s&&Fe.Z.setNoiseSuppression(s);null!=c&&Fe.Z.setQoS(c);null!=l&&Fe.Z.setSilenceWarning(l);if(null!=u){var h=Ye.Z.isSelfDeaf();(h&&!u||!h&&u)&&Fe.Z.toggleSelfDeaf()}if(null!=f){var E=Ye.Z.isSelfMute()
;(E&&!f||!E&&f)&&Fe.Z.toggleSelfMute()}return(0,ml._X)()}}),Yf),Vf,bu.authCommands),qf=Wf({},El,Ou,bu.voiceSettingsEvents);const Xf=new as({server:gu.Z,commands:Kf,events:qf,stores:[kr.Z],transports:[bu.postMessageTransport],registerTransportsForEmbeddedPlatform:function(){ss.default.ensureModule("discord_rpc").then((function(){var e=[n(907709).Z,n(199830).Z],t=!0,r=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var s=i.value;gu.Z.registerTransport(s)}}catch(e){r=!0;o=e}finally{try{t||null==a.return||a.return()}finally{if(r)throw o}}}))}});var Qf=n(109206),$f=n(468874),Jf=n(35723);function ed(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function td(e){td=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return td(e)}function nd(e,t){return!t||"object"!==od(t)&&"function"!=typeof t?function(e){
if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function rd(e,t){rd=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return rd(e,t)}var od=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function id(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=td(e);if(t){var o=td(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return nd(this,n)}}var ad=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&rd(e,t)}(n,e);var t=id(n)
;function n(){ed(this,n);var e;(e=t.apply(this,arguments)).linesToUpdate={};e.lineBatchTimer=new Uu.Xp;e._handleDrawLinePoint=function(t){var n=t.channelId,r=t.lineId,o=t.streamerId,i=t.point;null==e.linesToUpdate[r]?e.linesToUpdate[r]={channelId:n,streamerId:o,points:[i]}:e.linesToUpdate[r].points.push(i);null==e.lineBatchTimer._ref&&e.lineBatchTimer.start(Jf.Fq,e.sendLineBatch)};e.sendLineBatch=function(){for(var t in e.linesToUpdate){var n=e.linesToUpdate[t],r=n.channelId,o=n.points,i=n.streamerId;(0,$f.AX)(r,t,i,o)}e.linesToUpdate={};e.lineBatchTimer.stop()};return e}var r=n.prototype;r._initialize=function(){if(!__OVERLAY__){O.Z.subscribe("SHARED_CANVAS_DRAW_LINE_POINT",this._handleDrawLinePoint);O.Z.subscribe("VOICE_CHANNEL_EFFECT_SEND",this._handleVoiceChannelEffectReceived)}};r._terminate=function(){if(!__OVERLAY__){O.Z.unsubscribe("SHARED_CANVAS_DRAW_LINE_POINT",this._handleDrawLinePoint);O.Z.unsubscribe("VOICE_CHANNEL_EFFECT_SEND",this._handleVoiceChannelEffectReceived)
;this.lineBatchTimer.stop()}};r._handleVoiceChannelEffectReceived=function(e){var t,n=e.lineId,r=e.points,o=e.userId,i=e.streamerId,a=e.emojiHose;if(null!=i&&o!==(null===(t=Y.default.getCurrentUser())||void 0===t?void 0:t.id))if(null!=r&&null!=n){var s=Y.default.getUser(o);null!=s&&(0,Qf.vM)(s.getAvatarURL(null,Jf.Ks));(0,$f.cV)(n,o,i,r)}else if(null!=a){a.lastUpdatedAt=Date.now();(0,$f.gr)(a,o,i)}};r.__getLocalVars=function(){return{}};return n}(_.Z);const sd=new ad;var cd=n(190624),ld=n(422513),ud=n(550254),fd=n(138049),dd=n(336177),pd=n(656907),hd=n(815378),Ed=n(897699);function yd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function md(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function bd(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){md(i,r,o,a,s,"next",e)}function s(e){
md(i,r,o,a,s,"throw",e)}a(void 0)}))}}function gd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Od(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function vd(e){vd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return vd(e)}function _d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Od(e,t,n[t])}))}return e}function Id(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){
return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Sd(e,t){return!t||"object"!==Nd(t)&&"function"!=typeof t?yd(e):t}function Td(e,t){Td=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Td(e,t)}var Nd=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Ad(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=vd(e);if(t){var o=vd(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Sd(this,n)}}var Cd=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]}
;return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Pd=function(e){!function(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Td(e,t)}(o,e);var t=Ad(o);function o(){gd(this,o);var e;(e=t.apply(this,arguments)).playingSounds=new Map;e._stopAndClearSounds=function(){e.playingSounds.forEach((function(e){e.pause();e.src=""}));e.playingSounds=new Map};e._handleToggleSelfDeafened=function(){Ye.Z.isDeaf()&&e._stopAndClearSounds()};var i,a=yd(e);e._handleSoundboardSoundRecieved=(i=bd((function(e){var t,n,r,o,i,s,c,l,u;return Cd(this,(function(f){switch(f.label){case 0:t=e.soundId,n=e.soundOverridePath,r=e.soundVolume,o=void 0===r?1:r,i=e.userId,s=e.channelId;if(null==t||C.Z.getVoiceChannelId()!==s||Ye.Z.isDeaf()||pd.Z.isLocalSoundboardMuted(i))return[3,4];f.label=1;case 1:f.trys.push([1,,3,4]);c="".concat(i,"-").concat(t);if(null!=(l=a.playingSounds.get(c))){l.currentTime=0;return[2]}u=a.playingSounds
;return[4,new Promise((function(e){var r=new Audio((0,Ed.Z)(t,n));r.volume=(0,hd.Rp)(o);r.addEventListener("canplaythrough",(function(){(0,dd.xR)(t,i);u.set(c,r);r.play()}));r.addEventListener("ended",(function(){u.delete(c);r.src="";e()}))}))];case 2:f.sent();return[3,4];case 3:(0,dd.R)(t,i);return[7];case 4:return[2]}}))})),function(e){return i.apply(this,arguments)});e._handleVoiceChannelSelect=function(){e._stopAndClearSounds()};e._handleOpenEducationModal=function(e,t){if(null!=e){var o=S.Z.getChannel(t),i=fd.Z.getKeybindForAction(M.kg4.SOUNDBOARD_HOLD);(0,wr.Z)(o)&&null!=i&&ud.Z.hasHotspot(ld.v6.SOUNDBOARD_WHEEL_EDUCATION_MODAL)&&(0,c.ZDy)(bd((function(){var t,o;return Cd(this,(function(a){switch(a.label){case 0:return[4,Promise.all([n.e(40532),n.e(38813)]).then(n.bind(n,938813))];case 1:t=a.sent(),o=t.default;return[2,function(t){return(0,r.jsx)(o,Id(_d({},t),{guildId:e,keybind:i}))}]}}))})))}};return e}var i=o.prototype;i._initialize=function(){if(!__OVERLAY__){
O.Z.subscribe("VOICE_CHANNEL_EFFECT_SEND",this._handleSoundboardSoundRecieved);O.Z.subscribe("VOICE_CHANNEL_SELECT",this._handleVoiceChannelSelect);O.Z.subscribe("AUDIO_TOGGLE_SELF_DEAF",this._handleToggleSelfDeafened)}};i._terminate=function(){if(!__OVERLAY__){O.Z.unsubscribe("VOICE_CHANNEL_EFFECT_SEND",this._handleSoundboardSoundRecieved);O.Z.unsubscribe("VOICE_CHANNEL_SELECT",this._handleVoiceChannelSelect);O.Z.unsubscribe("AUDIO_TOGGLE_SELF_DEAF",this._handleToggleSelfDeafened)}};i.__getLocalVars=function(){return{}};return o}(_.Z);const jd=new Pd;var Rd=n(525261);function xd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Md(e){Md=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Md(e)}function wd(e,t){return!t||"object"!==Zd(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}
function Dd(e,t){Dd=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Dd(e,t)}var Zd=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Ld(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Md(e);if(t){var o=Md(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return wd(this,n)}}var Ud=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Dd(e,t)}(n,e);var t=Ld(n);function n(){xd(this,n);var e;(e=t.apply(this,arguments)).handleVoiceStateUpdates=function(t){
var n=t.voiceStates,r=Jn.default.getId();n.forEach((function(t){var n;if(t.userId===r){if(null===(n=S.Z.getChannel(t.channelId))||void 0===n?void 0:n.isGuildStageVoice()){if(!((0,Rd.gf)(t)===Rd.xO.ON_STAGE)){e.handleStopStream(t);e.handleStopUserVideo()}}}}))};e.handleStopStream=function(e){var t=Pr.Z.getActiveStreamForUser(e.userId,e.guildId);null!=t&&(0,Tr.g)((0,Cr.V9)(t),!1)};e.handleStopUserVideo=function(){Ye.Z.isVideoEnabled()&&Fe.Z.setVideoEnabled(!1)};return e}var r=n.prototype;r._initialize=function(){O.Z.subscribe("VOICE_STATE_UPDATES",this.handleVoiceStateUpdates)};r._terminate=function(){O.Z.unsubscribe("VOICE_STATE_UPDATES",this.handleVoiceStateUpdates)};r.__getLocalVars=function(){return{}};return n}(_.Z);const kd=new Ud;var Gd=n(679450);function Bd(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Hd(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n)
;function a(e){Bd(i,r,o,a,s,"next",e)}function s(e){Bd(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Vd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fd(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Yd(e){Yd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Yd(e)}function zd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Fd(e,t,n[t])}))}return e}function Wd(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){
var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Kd(e,t){return!t||"object"!==Xd(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function qd(e,t){qd=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return qd(e,t)}var Xd=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Qd(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Yd(e);if(t){var o=Yd(this).constructor
;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Kd(this,n)}}var $d=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}
o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Jd="STAGE_INVITED_TO_SPEAK_MODAL",ep=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&qd(e,t)}(o,e);var t=Qd(o);function o(){Vd(this,o);var e;(e=t.apply(this,arguments)).handleVoiceStateUpdates=function(e){var t,o=e.voiceStates,i=Jn.default.getId(),a=null===(t=Gd.Z.getSession())||void 0===t?void 0:t.sessionId,s=o.find((function(e){return e.userId===i&&e.sessionId===a}));if(null!=s){var l=s.channelId;if(null!=l){var u=S.Z.getChannel(l);if(null==u?void 0:u.isGuildStageVoice()){var f=(0,Rd.gf)(s)===Rd.xO.REQUESTED_TO_SPEAK_AND_AWAITING_USER_ACK;if(null!=u&&f){if((0,c.nfh)(Jd))return;(0,c.ZDy)(Hd((function(){var e,t;return $d(this,(function(o){
switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(29253)]).then(n.bind(n,829253))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Wd(zd({},e),{channel:u}))}]}}))})),{modalKey:Jd,onCloseRequest:M.VqG})}}}else(0,c.nfh)(Jd)&&(0,c.Mr3)(Jd)}};return e}var i=o.prototype;i._initialize=function(){O.Z.subscribe("VOICE_STATE_UPDATES",this.handleVoiceStateUpdates)};i._terminate=function(){O.Z.unsubscribe("VOICE_STATE_UPDATES",this.handleVoiceStateUpdates)};i.__getLocalVars=function(){return{MODAL_KEY:Jd}};return o}(_.Z);const tp=new ep;var np=n(708489),rp=n(145800),op=n(773011),ip=n(490355),ap=n(804185),sp=n(288263),cp=n(9430),lp=n(749565),up=n(307648),fp=n(813216),dp=n(938058);function pp(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function hp(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){pp(i,r,o,a,s,"next",e)}function s(e){
pp(i,r,o,a,s,"throw",e)}a(void 0)}))}}var Ep=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)
}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},yp=[],mp=null,bp=null,gp=null;function Op(e,t,n,r){var o=Zt.Z.getGuild(n),i=e.replace(M.Cup,Q.Z.Messages.SPOILER).replace(/<@!?(\d+)>/g,(function(e,t){var r,o=Y.default.getUser(t);return null==o?e:null!==(r=qa.ZP.getNick(n,o.id))&&void 0!==r?r:lp.ZP.getName(o)})).replace(/<@&?(\d+)>/g,(function(e,t){var n=null!=o?o.roles[t]:null;return null!=n&&null!=n.name?n.name:Q.Z.Messages.MESSAGE_TTS_DELETED_ROLE})).replace(/<#(\d+)>/g,(function(e,t){var n=S.Z.getChannel(t);return null==n?e:(0,op.F6)(n,Y.default,Ja.Z)})).replace(/<a?:(\w+):(\d+)>/g,(function(e,t){return"".concat(Q.Z.Messages.EMOJI," ").concat(t)})).replace(/<\/([^\s]+?):(\d+)>/g,(function(e,t){return"/".concat(t)}));return null==r?Q.Z.Messages.MESSAGE_TTS.format({username:t,body:i}):Q.Z.Messages.MESSAGE_TTS_REPLY.format({username:t,body:i,replyUsername:r})}function vp(){if(!rp.Zh)return!1;var e=tl.default.locale;if(null==gp){
var t;gp=null===(t=window.speechSynthesis)||void 0===t?void 0:t.getVoices()}var n=gp.filter((function(t){return t.lang===e||t.lang.slice(0,e.length)===e}));bp=n.length>0?n[0]:null}function _p(e,t,n,r,o){return Ip.apply(this,arguments)}function Ip(){return(Ip=hp((function(e,t,n,r,o){var i;return Ep(this,(function(a){switch(a.label){case 0:if(null===(i=rp.e6(e,n)))return[2];null==bp&&vp();return t?[4,(0,up.NB)()]:[3,2];case 1:a.sent();return[3,3];case 2:null==mp||mp.removeEventListener("end",up.NB);a.label=3;case 3:i.addEventListener("end",up.NB);null!=r&&i.addEventListener("start",r);null!=o&&i.addEventListener("end",o);mp=i;rp.iq(i,bp);return[2]}}))}))).apply(this,arguments)}function Sp(e,t,n,r,o){_p(e,t,o,(function(){(0,up.Bo)(n,r)}))}function Tp(e){_p(e.text,e.interrupt,e.maxLength,e.onStart,e.onEnd)}function Np(){null!==mp&&mp.removeEventListener("end",up.NB);rp.M9();mp=null;return!0}function Ap(e){
var t,n,r,o=e.message,i=e.channel,a=o.type===M.uaV.REPLY?ip.Z.getMessageByReference(o.messageReference):null,s=(null==a?void 0:a.state)===ip.Y.LOADED?null==a||null===(t=a.message)||void 0===t?void 0:t.author:null,c=null!=s?null!==(n=qa.ZP.getNick(i.guild_id,null==s?void 0:s.id))&&void 0!==n?n:lp.ZP.getName(s):null,l=i.getGuildId(),u=null!==(r=qa.ZP.getNick(l,o.author.id))&&void 0!==r?r:lp.ZP.getName(o.author);Sp(Op(o.content,u,l,c),!0,i.id,o.id);return!0}function Cp(e){var t=e.channelId,n=e.message;if(e.optimistic||Ye.Z.isSelfDeaf())return!1;var r=S.Z.getChannel(t);if(null==r)return!1;var o=C.Z.getChannelId(),i=ap.ZP.getCurrentSidebarChannelId(o),a=t===o||t===i,s=ct.OW.getSetting()&&n.tts&&a,c=sp.Z.getTTSType(),l=n.author.id!==Jn.default.getId()&&(c===M.PrB.ALL_CHANNELS||c===M.PrB.SELECTED_CHANNEL&&a);if((s||l)&&!Ja.Z.isBlocked(n.author.id)){var u;if(yp.indexOf(n.id)>=0)return!1;yp.unshift(n.id)>10&&yp.pop();var f,d=r.getGuildId();if(null!=d&&cp.Z.getMutedChannels(d).has(t))return!1
;var p,h=null!==(f=qa.ZP.getNick(d,n.author.id))&&void 0!==f?f:lp.ZP.getName(n.author),E=n.type===M.uaV.REPLY?null===(u=n.referenced_message)||void 0===u?void 0:u.author:null,y=null!=E?null!==(p=qa.ZP.getNick(d,null==E?void 0:E.id))&&void 0!==p?p:lp.ZP.getName(E):null;Sp(Op(n.content,h,d,y),!1,r.id,n.id,dp.f)}return!1}function Pp(e){var t=e.id,n=e.channelId,r=fp.Z.currentMessage;if(null!=r&&t===r.messageId&&n===r.channelId){(0,up.NB)();return!0}return!1}function jp(){Ye.Z.isSelfDeaf()&&rp.M9()}const Rp=function(){O.Z.subscribe("SPEAK_TEXT",Tp);O.Z.subscribe("SPEAK_MESSAGE",Ap);O.Z.subscribe("STOP_SPEAKING",Np);O.Z.subscribe("MESSAGE_CREATE",Cp);O.Z.subscribe("MESSAGE_DELETE",Pp);O.Z.subscribe("AUDIO_TOGGLE_SELF_DEAF",jp);O.Z.subscribe("USER_SETTINGS_PROTO_UPDATE",vp);O.Z.subscribe("I18N_LOAD_SUCCESS",vp)};var xp=n(762423),Mp=n(710528),wp=n(924308),Dp=n(966334);function Zp(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}
function Lp(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Zp(i,r,o,a,s,"next",e)}function s(e){Zp(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Up(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kp(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Gp(e){Gp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Gp(e)}function Bp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){kp(e,t,n[t])}))}return e}function Hp(e,t){t=null!=t?t:{}
;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Vp(e,t){return!t||"object"!==Yp(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Fp(e,t){Fp=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Fp(e,t)}var Yp=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function zp(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{
Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Gp(e);if(t){var o=Gp(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Vp(this,n)}}var Wp=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0
;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Kp=null;function qp(e){return Xp.apply(this,arguments)}function Xp(){Xp=Lp((function(e){var t,o,i,a,s,l,u,f,d,p,h,E,y,m,b,g,O,v,_,I,S;return Wp(this,(function(T){switch(T.label){case 0:t=e.userId,o=e.section,i=e.guildId,a=void 0===i?M.ME:i,s=e.channelId,l=e.friendToken,u=e.autoFocusNote,f=e.analyticsLocation;p=Y.default.getUser(t);h=wp.Z.getUserProfile(t);if(null==p)return[2];if(null!=(E=$a.Z.getPrimaryActivity(t))){y=E.party;m=E.assets;b=null!=E.application_id?Rn.Z.getGame(E.application_id):null}g=$a.Z.getStatus(t);O=$a.Z.isMobileOnline(t);v=g;g===M.Skl.ONLINE&&(v=O?M.j28.ONLINE_MOBILE:M.j28.ONLINE_DESKTOP);return[4,(0,c.ZDy)(Lp((function(){var e,t
;return Wp(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(40813)]).then(n.bind(n,940813))];case 1:e=i.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Hp(Bp({},e),{user:p,autoFocusNote:u,guildId:a,friendToken:l,initialSection:o}))}]}}))})))];case 1:Kp=T.sent();Ie.default.track(M.rMx.OPEN_MODAL,Bp({type:"Profile Modal",guild_id:a!==M.ME?a:null,channel_id:s,other_user_id:t,application_id:null!==(_=null==E?void 0:E.application_id)&&void 0!==_?_:null,application_name:null==E?void 0:E.name,sku_id:null!==(I=null==b?void 0:b.primarySkuId)&&void 0!==I?I:null,is_friend:Ja.Z.isFriend(t),has_images:Boolean(null!==(S=null==m?void 0:m.large_image)&&void 0!==S?S:null==m?void 0:m.small_image),party_max:null==y||null===(d=y.size)||void 0===d?void 0:d[1],party_id:null==y?void 0:y.id,party_platform:(0,Dp.Ps)(null==y?void 0:y.id)?M.ABu.SPOTIFY:null,game_platform:(0,Mp.Z)(E),profile_user_status:v,profile_has_nitro_customization:null!=(null==h?void 0:h.banner)
},null==f?null:(0,Ie.expandLocation)(f)));return[2]}}))}));return Xp.apply(this,arguments)}function Qp(){null!=Kp&&(0,c.Mr3)(Kp);Kp=null}var $p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Fp(e,t)}(n,e);var t=zp(n);function n(){Up(this,n);return t.apply(this,arguments)}var r=n.prototype;r._initialize=function(){O.Z.subscribe("USER_PROFILE_MODAL_OPEN",qp);O.Z.subscribe("USER_PROFILE_MODAL_CLOSE",Qp)};r._terminate=function(){O.Z.unsubscribe("USER_PROFILE_MODAL_OPEN",qp);O.Z.unsubscribe("USER_PROFILE_MODAL_CLOSE",Qp)};r.__getLocalVars=function(){return{modalKey:Kp}};return n}(_.Z);const Jp=new $p;var eh=n(735885),th=n(895303),nh=n(634698),rh=n(241166),oh=n(674748),ih=n(426797),ah=n(82726),sh=n(984237),ch=n(294184),lh=n.n(ch),uh=n(107364),fh=n(237745),dh=n.n(fh);function ph(e,t,n){
t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var hh=function(e){return(0,r.jsx)(dh(),function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){ph(e,t,n[t])}))}return e}({sitekey:M.OL7},e))};hh.Themes={LIGHT:"light",DARK:"dark"};hh.Sizes={COMPACT:"compact",NORMAL:"normal",INVISIBLE:"invisible"};const Eh=hh;var yh=n(671418),mh=n.n(yh),bh=n(518280),gh=n.n(bh);function Oh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vh(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function _h(e){_h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)}
;return _h(e)}function Ih(e,t){return!t||"object"!==Th(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Sh(e,t){Sh=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Sh(e,t)}var Th=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Nh(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=_h(e);if(t){var o=_h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ih(this,n)}}var Ah=X.Z.getArticleURL(M.BhN.VERIFICATION_FAQ),Ch=function(e){!function(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Sh(e,t)}(n,e);var t=Nh(n);function n(){Oh(this,n);var e;(e=t.apply(this,arguments)).handleClick=function(t){var n=e.props.onClick;null==n||n(t)};return e}var o=n.prototype;o.renderFields=function(){var e=this,t=this.props,n=t.types,o=t.captchaKey,i=t.theme,a=t.onCaptchaVerify;return(0,r.jsx)(r.Fragment,{children:n.map((function(t){return t===M.PUi.CAPTCHA?(0,r.jsx)(Eh,{onVerify:a,theme:i},o):(0,r.jsx)(c.zxk,{className:lh()(gh().marginBottom20),onClick:function(){return e.handleClick(t)},children:ah.Z.getButtonTitle(t)},t)}))})};o.render=function(){return(0,r.jsxs)(uh.Z,{className:mh().verification,align:uh.Z.Align.CENTER,direction:uh.Z.Direction.VERTICAL,children:[(0,r.jsxs)(uh.Z,{className:lh()(mh().container,vh({},mh().isMobile,no.tq)),direction:uh.Z.Direction.VERTICAL,
align:uh.Z.Align.CENTER,justify:uh.Z.Justify.CENTER,children:[(0,r.jsx)("div",{className:mh().image}),(0,r.jsx)("div",{className:lh()(mh().title,gh().marginTop20),children:Q.Z.Messages.VERIFICATION_TITLE}),(0,r.jsx)("div",{className:lh()(mh().body,gh().marginTop4,gh().marginBottom20),children:Q.Z.Messages.VERIFICATION_BODY_WITH_HELP_LINK.format({helpCenterURL:Ah})}),(0,r.jsx)(uh.Z,{grow:0,direction:uh.Z.Direction.VERTICAL,justify:uh.Z.Justify.CENTER,children:this.renderFields()})]}),(0,r.jsx)("div",{className:lh()(mh().footer,gh().marginTop20),children:Q.Z.Messages.VERIFICATION_FOOTER}),(0,r.jsxs)(uh.Z,{className:lh()(gh().marginTop4,gh().marginBottom20),grow:0,children:[(0,r.jsx)("div",{className:lh()(mh().footer,mh().footerAction),children:Q.Z.Messages.VERIFICATION_FOOTER_SUPPORT.format({supportURL:X.Z.getSubmitRequestURL()})}),(0,r.jsx)("div",{className:lh()(mh().footer,mh().footerBullet),children:"•"}),(0,r.jsx)("div",{className:lh()(mh().footer,mh().footerAction),
children:Q.Z.Messages.VERIFICATION_FOOTER_LOGOUT.format({logoutOnClick:this.props.onLogout})})]})]})};return n}(o.PureComponent);Ch.defaultProps={types:[M.PUi.CAPTCHA],onCaptchaVerify:M.dG4,onLogout:M.dG4};const Ph=Ch;var jh=n(145),Rh=n(441143),xh=n.n(Rh),Mh=n(973646),wh=n(450383),Dh=n(468811),Zh=n.n(Dh),Lh=n(614034),Uh=n.n(Lh),kh=n(913957),Gh=n.n(kh);function Bh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Hh(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Vh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fh(e){Fh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Fh(e)}function Yh(e,t){return!t||"object"!==Kh(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}
function zh(e,t){zh=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return zh(e,t)}function Wh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Bh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Kh=function(e){
return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function qh(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Fh(e);if(t){var o=Fh(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Yh(this,n)}}var Xh=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,
o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Qh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&zh(e,t)}(o,e);var t=qh(o);function o(){Vh(this,o);var e;(e=t.apply(this,arguments))._animItem=null;e._timeout=new Uu.V7;e._headerId=Zh().v4();e.state={resent:!1,
shouldClose:!1,email:"",password:""};e.setLottieRef=function(t){e._lottieRef=t};e.handleVerify=function(){(0,e.props.onVerify)(e.state.email,e.state.password)};e.handleResendEmail=function(){var t=e.props,n=t.onResend,r=t.onClose;n();if(!e.state.resent){e.setState({resent:!0,shouldClose:!0});e._timeout.start(3e3,(function(){e.state.shouldClose&&r()}))}};e.handleChangeEmailClick=function(){var t=e.props.onChangeEmailClick;e.setState({resent:!1,shouldClose:!1});t()};e.handleEmailChange=function(t){e.setState({email:t})};e.handlePasswordChange=function(t){e.setState({password:t})};e.handleKeyPress=function(t){var n=e.state,r=n.email,o=n.password;if(13===t.which&&r.length>0&&o.length>0){t.preventDefault();e.handleVerify()}};return e}var i=o.prototype;i.componentDidMount=function(){var e,t=this;return(e=function(){var e,r,o,i;return Xh(this,(function(a){switch(a.label){case 0:return[4,Promise.all([n.e(63266).then(n.t.bind(n,763266,19)),Promise.resolve().then(n.t.bind(n,211248,23))])]
;case 1:e=Wh.apply(void 0,[a.sent(),2]),r=e[0],o=e[1],i=o.default;t._animItem=i.loadAnimation({container:t._lottieRef,renderer:"svg",loop:!0,autoplay:!0,animationData:r});return[2]}}))},function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Hh(i,r,o,a,s,"next",e)}function s(e){Hh(i,r,o,a,s,"throw",e)}a(void 0)}))})()};i.componentWillUnmount=function(){this._timeout.stop();if(null!=this._animItem){this._animItem.destroy();this._animItem=void 0}};i.renderInputs=function(){var e=this.props,t=e.emailError,n=e.passwordError,o=e.submitting,i=this.state,a=i.email,s=i.password;return(0,r.jsxs)("div",{className:Uh().container,children:[(0,r.jsx)(c.xJW,{title:Q.Z.Messages.FORM_LABEL_EMAIL,className:gh().marginBottom20,children:(0,r.jsx)(c.oil,{value:a,error:t,onChange:this.handleEmailChange,onKeyPress:this.handleKeyPress,autoFocus:!0})}),(0,r.jsx)(c.xJW,{title:Q.Z.Messages.FORM_LABEL_PASSWORD,className:gh().marginBottom40,children:(0,r.jsx)(c.oil,{
type:"password",value:s,error:n,onChange:this.handlePasswordChange,onKeyPress:this.handleKeyPress})}),(0,r.jsx)(c.zxk,{fullWidth:!0,size:c.zxk.Sizes.LARGE,onClick:this.handleVerify,submitting:o,disabled:0===a.length||0===s.length,children:Q.Z.Messages.VERIFY_ACCOUNT})]})};i.renderActions=function(){var e=this.props.canChange;return(0,r.jsxs)("div",{className:Uh().container,children:[(0,r.jsx)(c.zxk,{className:gh().marginTop20,fullWidth:!0,size:c.zxk.Sizes.LARGE,look:c.iLD.INVERTED,color:c.Ttl.PRIMARY,onClick:this.handleResendEmail,children:Q.Z.Messages.RESEND_EMAIL}),e&&(0,r.jsx)(c.zxk,{className:gh().marginTop20,fullWidth:!0,size:c.zxk.Sizes.MEDIUM,look:c.iLD.LINK,color:c.Ttl.PRIMARY,onClick:this.handleChangeEmailClick,children:Q.Z.Messages.CHANGE_EMAIL})]})};i.render=function(){var e,t=this.state.resent,n=this.props,o=n.email,i=n.canResend,a=n.transitionState;e=t&&null!=o?Q.Z.Messages.VERIFY_EMAIL_BODY_RESENT.format({email:o
}):i?Q.Z.Messages.VERIFY_EMAIL_BODY:Q.Z.Messages.ENTER_EMAIL_BODY;return(0,r.jsxs)(c.Y0X,{transitionState:a,"aria-labelledby":this._headerId,className:lh()(Uh().emailVerificationModal,Gh().vertical,Gh().alignCenter,Gh().justifyCenter,gh().marginTop60),children:[(0,r.jsx)("div",{className:Uh().animationContainer,ref:this.setLottieRef}),(0,r.jsx)("div",{id:this._headerId,className:lh()(Uh().title,gh().marginBottom8),children:Q.Z.Messages.VERIFY_BY_EMAIL}),(0,r.jsx)("div",{className:lh()(Uh().body,gh().marginBottom20),children:e}),i?this.renderActions():this.renderInputs()]})};return o}(o.PureComponent);Qh.defaultProps={canResend:!1,canChange:!0,onChangeEmailClick:M.dG4,onVerify:function(e,t){},onResend:M.dG4,onClose:M.dG4};const $h=Qh;function Jh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){
var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Jh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const tE=function(e){var t=e.transitionState,n=e.onClose,i=function(e){var t,n;return null!==(n=null==a||null===(t=a[e])||void 0===t?void 0:t[0])&&void 0!==n?n:""},a=(0,s.e7)([wh.Z],(function(){
return wh.Z.getErrors()})),c=(0,s.e7)([wh.Z],(function(){return wh.Z.getFormState()})),u=(0,s.e7)([Y.default],(function(){var e=Y.default.getCurrentUser();xh()(null!=e,"EmailVerificationModal: user cannot be undefined");return e})),f=(0,s.e7)([sh.Z],(function(){return sh.Z.getAction()})),d=!ah.Z.isEmailReverification(f),p=null!=u.email,h=eE(o.useState(!0),2),E=h[0],y=h[1],m=c===M.QZA.SUBMITTING,b=i("email"),g=i("password");return(0,r.jsx)($h,{transitionState:t,email:u.email,emailError:b,passwordError:g,submitting:m,canResend:E&&!m&&p&&0===b.length&&0===g.length,canChange:d,onChangeEmailClick:function(){y(!1)},onVerify:function(e,t){(0,Ia.Mn)({email:e,password:t}).then((function(e){var t;(null==e?void 0:e.ok)||null==(null==e||null===(t=e.body)||void 0===t?void 0:t.username)||(0,Mh.P)()}));y(!0)},onResend:function(){l.Z.verifyResend()},onClose:n})};var nE=n(411177),rE=n(58118);function oE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}
function iE(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function aE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){iE(e,t,n[t])}))}return e}function sE(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function cE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){
var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return oE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var lE="Email Verification";function uE(){var e=(0,s.cj)([sh.Z,st.Z],(function(){return{action:sh.Z.getAction(),theme:st.Z.theme}
})),t=e.action,n=e.theme,i=ah.Z.getVerificationTypes(t),a=cE(o.useState(0),2),u=a[0],f=a[1],d=(0,nh.Z)(i);(0,oh.Z)({type:W.nv.MODAL,name:W.zs.USER_ACTION_REQUIRED,properties:{verification_type:i[0],verification_types:i}},{},[i.toString()]);var p=function(){(0,Ia.FD)();(0,c.h7j)((function(e){return(0,r.jsx)(tE,aE({},e))}),{modalKey:lE,Layer:jh.ZP})};o.useEffect((function(){rh.Z.disable();return function(){rh.Z.enable()}}),[]);o.useEffect((function(){(null==d?void 0:d[0])===M.PUi.PHONE&&(null==i?void 0:i[0])===M.PUi.EMAIL&&(0,c.h7j)((function(e){return(0,r.jsx)(th.default,sE(aE({},e),{title:Q.Z.Messages.PHONE_THEN_EMAIL_INTERSTITIAL_TITLE,body:Q.Z.Messages.PHONE_THEN_EMAIL_INTERSTITIAL_BODY,confirmText:Q.Z.Messages.PHONE_THEN_EMAIL_INTERSTITIAL_CONFIRM}))}),{modalKey:"PHONE_THEN_EMAIL_INTERSTITIAL_MODAL_KEY",Layer:jh.ZP,onCloseCallback:p})}),[i,d]);return(0,r.jsx)(Ph,{types:i,captchaKey:u,onCaptchaVerify:function(e){cs.Z.post({url:M.ANM.CAPTCHA,body:{captcha_key:e},oldFormErrors:!0
}).then(eh.xf,(function(){f((function(e){return e+1}))}))},theme:n,onClick:function(e){e===M.PUi.EMAIL_OR_PHONE||e===M.PUi.EMAIL||e===M.PUi.REVERIFY_EMAIL?p():(0,c.h7j)((function(e){return(0,r.jsx)(nE.default,aE({reason:ih.L.USER_ACTION_REQUIRED},e))}),{modalKey:rE.M,Layer:jh.ZP})},onLogout:function(){return(0,c.h7j)((function(e){return(0,r.jsx)(c.sm4,sE(aE({header:Q.Z.Messages.LOGOUT,confirmText:Q.Z.Messages.LOGOUT,cancelText:Q.Z.Messages.CANCEL,onConfirm:function(){return l.Z.logout()}},e),{children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:Q.Z.Messages.USER_SETTINGS_CONFIRM_LOGOUT})}))}),{Layer:jh.ZP})}})}var fE=n(585798),dE=n(318715),pE=n(333053),hE=n.n(pE);function EE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yE(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function mE(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){
var i=e.apply(t,n);function a(e){yE(i,r,o,a,s,"next",e)}function s(e){yE(i,r,o,a,s,"throw",e)}a(void 0)}))}}function bE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return EE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return EE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}
var gE=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}
if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function OE(e){var t=e.transitionState,i=(0,dE.ZP)([sh.Z],(function(){return sh.Z.getAction()})),a=bE(o.useState(!1),2),s=a[0],l=a[1],u=(0,q.Dt)();function f(){f=mE((function(){var e;return gE(this,(function(t){switch(t.label){case 0:l(!0);return i!==M.c2C.AGREEMENTS?[3,2]:[4,(0,rl.Lr)()];case 1:e=t.sent();l(e);t.label=2;case 2:return[2,null]}}))}));return f.apply(this,arguments)}return(0,r.jsxs)(c.Y0X,{"aria-labelledby":u,transitionState:t,children:[(0,r.jsx)("div",{id:u}),(0,r.jsx)(c.xBx,{separator:!1,children:(0,r.jsx)(c.X6q,{variant:"heading-lg/semibold",children:Q.Z.Messages.NEW_TERMS_TITLE})}),(0,r.jsxs)(c.hzk,{children:[(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:i===M.c2C.AGREEMENTS?Q.Z.Messages.TERMS_OF_SERVICE_UPDATE_03_27_2023_DESCRIPTION.format():null}),(0,r.jsxs)("div",{className:hE().container,children:[(0,r.jsxs)("ul",{className:hE().links,children:[(0,r.jsx)("li",{
children:Q.Z.Messages.TERMS_OF_SERVICE.format({url:M.EYA.TERMS})}),(0,r.jsx)("li",{children:Q.Z.Messages.PAID_SERVICES_TERMS.format({url:M.EYA.PAID_TERMS})}),(0,r.jsx)("li",{children:Q.Z.Messages.PRIVACY_POLICY.format({url:M.EYA.PRIVACY})}),(0,r.jsx)("li",{children:Q.Z.Messages.COMMUNITY_GUIDELINES.format({url:M.EYA.GUIDELINES})})]}),(0,r.jsx)("img",{className:hE().image,alt:"",src:n(31890)})]})]}),(0,r.jsx)(c.mzw,{children:(0,r.jsx)(c.zxk,{submitting:s,onClick:function(){return f.apply(this,arguments)},color:c.zxk.Colors.GREEN,children:Q.Z.Messages.AGREE})})]})}function vE(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var _E="AGREEMENTS_MODAL_KEY";const IE={init:function(){O.Z.subscribe("CONNECTION_OPEN",this.handleRequiredAction);O.Z.subscribe("USER_REQUIRED_ACTION_UPDATE",this.handleRequiredAction);O.Z.subscribe("CURRENT_USER_UPDATE",this.handleCurrentUserUpdate);O.Z.subscribe("LOGOUT",this.handleLogout)},
handleRequiredAction:function(e){var t=e.requiredAction;if(!Bi.s.isDisallowPopupsSet())if(null==Y.default.getCurrentUser()){(0,fE.ob)("verification");(0,c.nfh)(_E)&&(0,c.Mr3)(_E)}else if(t===M.c2C.REQUIRE_CAPTCHA||t===M.c2C.REQUIRE_VERIFIED_EMAIL||t===M.c2C.REQUIRE_VERIFIED_PHONE||t===M.c2C.REQUIRE_REVERIFIED_PHONE||t===M.c2C.REQUIRE_REVERIFIED_EMAIL_OR_REVERIFIED_PHONE||t===M.c2C.REQUIRE_VERIFIED_EMAIL_OR_REVERIFIED_PHONE||ah.Z.isEmailReverification(t))(0,fE.q4)((function(){return(0,r.jsx)(uE,{})}),{layerKey:"verification",Layer:jh.ZP});else if(t===M.c2C.AGREEMENTS)(0,c.h7j)((function(e){return(0,r.jsx)(OE,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){vE(e,t,n[t])}))}return e}({},e))}),{modalKey:_E,onCloseRequest:hc.Vq
});else if(null==t){(0,fE.ob)("verification");(0,c.nfh)(_E)&&(0,c.Mr3)(_E)}},handleLogout:function(){(0,fE.ob)("verification")},handleCurrentUserUpdate:function(e){e.user.verified&&(0,c.Mr3)(lE)}};var SE=n(213192),TE=n.n(SE),NE=n(38773),AE=n(609182),CE=n(131559);function PE(e){var t=TE()({IMAGE:null,VIDEO:null}),n=s.ZP.PersistedStore.migrateAndReadStoreState("GIFFavoritesStore",[function(e){return null==e?{favorites:[],timesFavorited:0}:Array.isArray(e)?{favorites:e,timesFavorited:0}:e},function(e){return Array.isArray(e.favorites)?e:{favorites:[],timesFavorited:0}}]).state;return null==n||0===n.favorites.length?[]:n.favorites.map((function(r,o){var i=NE.JM.create();i.format=r.format===t.IMAGE?NE.EO.IMAGE:r.format===t.VIDEO?NE.EO.VIDEO:NE.EO.NONE;i.src=r.src;i.width=r.width;i.height=r.height;i.order=n.favorites.length-o+e;return{url:r.url,favorite:i}}))}var jE=[{version:2,run:function(e){var t=PE(1);if(0===t.length)return!1;null==e.favoriteGifs&&(e.favoriteGifs=NE.wK.create())
;e.favoriteGifs.gifs={};var n=!0,r=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=i.value,c=s.url,l=s.favorite;e.favoriteGifs.gifs[c]=l}}catch(e){r=!0;o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}e.favoriteGifs.hideTooltip=t.length>2;return!0},cleanup:function(){}},{version:3,run:function(e){var t=s.ZP.PersistedStore.migrateAndReadStoreState("StickersPersistedStore",[function(e){return null==e||0===Object.keys(e).length?{usageHistory:{},favorites:[]}:e},function(e){if(null==e||0===Object.keys(e).length)return{usageHistory:{},favorites:[]};null==e.favorites&&(e.favorites=[]);return e}]).state;if(null==t)return!1;var n=!1;if(t.favorites.length>0){e.favoriteStickers=NE.Lt.create();e.favoriteStickers.stickerIds=Wa().uniq(t.favorites).slice(0,CE.oX);n=!0}if(Wa().size(t.usageHistory)>0){e.stickerFrecency=NE.ls.create();e.stickerFrecency.stickers=(0,AE.tU)(t.usageHistory,100);n=!0}return n},cleanup:function(){
_e.Z.remove("StickersPersistedStore")}},{version:4,run:function(e){var t=s.ZP.PersistedStore.migrateAndReadStoreState("EmojiStore",[function(){return{usageHistory:_e.Z.get("EmojiUsageHistory")||{}}}]).state;if(null==t)return!1;var n=!1;if(null!=t.favorites&&t.favorites.length>0){e.favoriteEmojis=NE.ND.create();e.favoriteEmojis.emojis=Wa().uniq(t.favorites).slice(0,CE.oX);n=!0}if(Wa().size(t.usageHistory)>0){e.emojiFrecency=NE.PL.create();e.emojiFrecency.emojis=(0,AE.tU)(t.usageHistory,100);n=!0}return n},cleanup:function(){_e.Z.remove("EmojiStore");_e.Z.remove("EmojiUsageHistory");_e.Z.remove("EmojiDiversitySurrogate")}},{version:6,run:function(e){null==e.favoriteGifs&&(e.favoriteGifs=NE.wK.create());null==e.favoriteGifs.gifs&&(e.favoriteGifs.gifs={});var t=PE(1);if(0===t.length)return!1;Wa()(e.favoriteGifs.gifs).values().sortBy("order").forEach((function(e,n){return e.order=t.length+1+n}));var n=NE.wK.toBinary(e.favoriteGifs).length,r=0,o=!0,i=!1,a=void 0;try{
for(var s,c=t[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){var l=s.value,u=l.url,f=l.favorite;f.order=t.length-r;r++;if(u in e.favoriteGifs.gifs)e.favoriteGifs.gifs[u].order=f.order;else{var d=NE.JM.toBinary(f).length+u.length+7;if(!(n+d>CE.vY)){n+=d;e.favoriteGifs.gifs[u]=f}}}}catch(e){i=!0;a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}n=NE.wK.toBinary(e.favoriteGifs).length;for(;n>CE.vY;){var p=0;for(var h in e.favoriteGifs.gifs){delete e.favoriteGifs.gifs[h];if(++p>=10)break}n=NE.wK.toBinary(e.favoriteGifs).length}return!0},cleanup:function(){}},{version:7,run:function(e){var t=s.ZP.PersistedStore.migrateAndReadStoreState("ApplicationCommandFrecency",[]).state;if(null==t)return!1;var n=!1;if(Wa().size(t.usageHistory)>0){e.applicationCommandFrecency=NE.YI.create();e.applicationCommandFrecency.applicationCommands=(0,AE.tU)(t.usageHistory,500);n=!0}return n},cleanup:function(){_e.Z.remove("ApplicationCommandFrecency")}},{version:8,run:function(e){
var t=s.ZP.PersistedStore.migrateAndReadStoreState("SoundboardFavoriteStore",[]).state;if(null==t)return!1;var n=!1;if(Wa().size(t.favoriteSounds)>0){e.favoriteSoundboardSounds=NE.h_.create();Object.keys(t.favoriteSounds).forEach((function(n){new Set(t.favoriteSounds[n]).forEach((function(t){var n;null===(n=e.favoriteSoundboardSounds)||void 0===n||n.soundIds.push(t)}))}));n=!0}return n},cleanup:function(){_e.Z.remove("SoundboardFavoriteStore")}}];const RE=jE;var xE=n(970168),ME=n(256764),wE=n(169067);function DE(e,t){var n=!1;null==e.userContent&&(e.userContent={dismissedContents:new Uint8Array});null==e.userContent.dismissedContents&&(e.userContent.dismissedContents=new Uint8Array);if(!(0,ME.jl)(e.userContent.dismissedContents,t)){e.userContent.dismissedContents=(0,ME.GV)(e.userContent.dismissedContents,t);n=!0}return n}function ZE(e,t,n){return!!ld.qc.hasHiddenHotspot(t)&&DE(e,n)}var LE=[{version:2,run:function(e){var t;!function(e){e.Mentions="Recent Mentions";e.Unreads="Inbox"
}(t||(t={}));if(null!=e.inbox)return!1;var n=!1,r=ln.f9.create();e.inbox=r;if(_e.Z.get("seenInboxTutorial",!1)){r.viewedTutorial=!0;n=!0}var o,i=_e.Z.get("recentsButtonTab2");if(null!=i){r.currentTab=i===t.Mentions?ln.X.MENTIONS:ln.X.UNREADS;n=!0}var a=null!==(o=_e.Z.get("unread-messages-collapsed-channels"))&&void 0!==o?o:{};for(var s in a)if(a[s]){var c=S.Z.getChannel(s);if(null!=c){n=!0;var l;(0,AE.i7)(e,null!==(l=c.guild_id)&&void 0!==l?l:"0",c.id,(function(e){e.collapsedInInbox=!0}))}}return n},cleanup:function(){_e.Z.remove("seenInboxTutorial");_e.Z.remove("recentsButtonTab2");_e.Z.remove("unread-messages-collapsed-channels")}},{version:3,run:function(e){var t=s.ZP.PersistedStore.migrateAndReadStoreState("EmojiStore",[function(){return{diversitySurrogate:_e.Z.get("EmojiDiversitySurrogate")||""}}]).state;if(null==t)return!1;var n=!1;if(null!=t.diversitySurrogate&&""!==t.diversitySurrogate){null==e.textAndImages&&(e.textAndImages=ln.Me.create())
;null==e.textAndImages.diversitySurrogate&&(e.textAndImages.diversitySurrogate=xE.Gm.create());e.textAndImages.diversitySurrogate.value=t.diversitySurrogate;n=!0}return n},cleanup:function(){}},{version:4,run:function(e){var t=!1;(!0===_e.Z.get("HAS_SEEN_HUB_UPSELL")||ld.qc.hasHiddenHotspot(ld.v6.HUB_SECOND_EMAIL_CONNECTION_UPSELL))&&(t=DE(e,ln.z$.HUB_WAITLIST_UPSELL));return t},cleanup:function(){_e.Z.remove("HAS_SEEN_HUB_UPSELL")}},{version:5,run:function(e){var t,n,r,o,i,a,s,c=!1;e.textAndImages=null!==(t=e.textAndImages)&&void 0!==t?t:ln.Me.create();e.notifications=null!==(n=e.notifications)&&void 0!==n?n:ln.sf.create();e.privacy=null!==(r=e.privacy)&&void 0!==r?r:ln.bE.create();e.voiceAndVideo=null!==(o=e.voiceAndVideo)&&void 0!==o?o:ln.v_.create();e.gameLibrary=null!==(i=e.gameLibrary)&&void 0!==i?i:ln.Fm.create();e.debug=null!==(a=e.debug)&&void 0!==a?a:ln.tA.create();var l=null!==(s=_e.Z.get("UserSettingsStore"))&&void 0!==s?s:{};if("boolean"==typeof l.useRichChatTextBox){
e.textAndImages.useRichChatInput=xE.D5.create({value:l.useRichChatTextBox});c=!0}if("string"==typeof l.renderSpoilers){e.textAndImages.renderSpoilers=xE.Gm.create({value:l.renderSpoilers});c=!0}if("boolean"==typeof l.useThreadSidebar){e.textAndImages.useThreadSidebar=xE.D5.create({value:l.useThreadSidebar});c=!0}if("boolean"==typeof l.showInAppNotifications){e.notifications.showInAppNotifications=xE.D5.create({value:l.showInAppNotifications});c=!0}if(l.emojiPickerCollapsedSections instanceof Array){e.textAndImages.emojiPickerCollapsedSections=l.emojiPickerCollapsedSections;c=!0}if(l.stickerPickerCollapsedSections instanceof Array){e.textAndImages.stickerPickerCollapsedSections=l.stickerPickerCollapsedSections;c=!0}if("boolean"==typeof l.viewImageDescriptions){e.textAndImages.viewImageDescriptions=xE.D5.create({value:l.viewImageDescriptions});c=!0}if("boolean"==typeof l.showCommandSuggestions){e.textAndImages.showCommandSuggestions=xE.D5.create({value:l.showCommandSuggestions});c=!0}
if("boolean"==typeof l.alwaysPreviewVideo){e.voiceAndVideo.alwaysPreviewVideo=xE.D5.create({value:l.alwaysPreviewVideo});c=!0}if("boolean"==typeof l.notifyFriendsOnGoLive){e.notifications.notifyFriendsOnGoLive=xE.D5.create({value:l.notifyFriendsOnGoLive});c=!0}if("boolean"==typeof l.installShortcutDesktop){e.gameLibrary.installShortcutDesktop=xE.D5.create({value:l.installShortcutDesktop});c=!0}if("boolean"==typeof l.installShortcutStartMenu){e.gameLibrary.installShortcutStartMenu=xE.D5.create({value:l.installShortcutStartMenu});c=!0}if("boolean"==typeof l.allowActivityPartyPrivacyFriends){e.privacy.allowActivityPartyPrivacyFriends=xE.D5.create({value:l.allowActivityPartyPrivacyFriends});c=!0}if("boolean"==typeof l.allowActivityPartyPrivacyVoiceChannel){e.privacy.allowActivityPartyPrivacyVoiceChannel=xE.D5.create({value:l.allowActivityPartyPrivacyVoiceChannel});c=!0}if("boolean"==typeof l.rtcPanelShowVoiceStates){e.debug.rtcPanelShowVoiceStates=xE.D5.create({
value:l.rtcPanelShowVoiceStates});c=!0}return c},cleanup:function(){}},{version:7,run:function(e){return ZE(e,ld.v6.APPLICATION_COMMAND_TOOLTIP,ln.z$.APPLICATION_COMMAND_TOOLTIP)},cleanup:function(){}},{version:8,run:function(e){return ZE(e,ld.v6.CHANNEL_BANNER_MEMBER_LIST_NOTICE,ln.z$.CHANNELINFO_CHANNELBANNER_NOTICE)},cleanup:function(){}},{version:9,run:function(e){ld.qc.hasHiddenHotspot(ld.v6.MULTI_ACCOUNT_TOOLTIP)&&_e.Z.set(wE.Ip,"true");return ZE(e,ld.v6.MULTI_ACCOUNT_TOOLTIP,ln.z$.ACCOUNT_MULTIACCOUNT_TOOLTIP)},cleanup:function(){}},{version:10,run:function(e){var t,n=ZE(e,ld.v6.HUB_LINK_CHANNEL_NOTICE,ln.z$.CHANNEL_NOTICE_HUBLINK),r=null!==(t=_e.Z.get("channelNotices"))&&void 0!==t?t:{};!1===r[M.vID.INVITE]&&DE(e,ln.z$.CHANNEL_NOTICE_INVITE)&&(n=!0);!1===r[M.vID.QUICKSWITCHER]&&DE(e,ln.z$.CHANNEL_NOTICE_QUICKSWITCHER)&&(n=!0);!1===r[M.vID.GUILD_BOOSTING]&&DE(e,ln.z$.CHANNEL_NOTICE_PREMIUM_GUILD_SUBSCRIPTION)&&(n=!0);return n},cleanup:function(){_e.Z.remove("channelNotices")}},{
version:11,run:function(e){var t=!1;ZE(e,ld.v6.GUILD_EVENT_UPSELL,ln.z$.GUILD_HEADER_EVENT_UPSELL)&&(t=!0);ZE(e,ld.v6.PREMIUM_PROGRESS_BAR_GUILD_HEADER_TOOLTIP,ln.z$.GUILD_HEADER_PREMIUM_GUILD_PROGRESS)&&(t=!0);ZE(e,ld.v6.ANIMATED_GUILD_BANNER_GUILD_HEADER_TOOLTIP,ln.z$.GUILD_HEADER_ANIMATED_GUILD_BANNER)&&(t=!0);return t},cleanup:function(){}},{version:12,run:function(e){var t=!1;_e.Z.get("hideNag")&&DE(e,ln.z$.NAGBAR_NOTICE_DOWNLOAD)&&(t=!0);_e.Z.get("hideConnectSpotify")&&DE(e,ln.z$.NAGBAR_NOTICE_CONNECT_SPOTIFY)&&(t=!0);_e.Z.get("hideConnectPlayStation")&&DE(e,ln.z$.NAGBAR_NOTICE_CONNECT_SPOTIFY)&&(t=!0);_e.Z.get("hideMFASMSNotice")&&DE(e,ln.z$.NAGBAR_NOTICE_MFA_SMS_BACKUP)&&(t=!0);return t},cleanup:function(){_e.Z.remove("hideNag");_e.Z.remove("hideConnectSpotify");_e.Z.remove("hideConnectPlayStation");_e.Z.remove("hideMFASMSNotice")}},{version:13,run:function(e){var t=!1;_e.Z.get("hidePremiumPromo")&&DE(e,ln.z$.NAGBAR_NOTICE_PREMIUM_PROMO)&&(t=!0)
;_e.Z.get("hidePremiumTier2TrialEnding")&&DE(e,ln.z$.NAGBAR_NOTICE_PREMIUM_TIER_TWO_TRIAL_ENDING)&&(t=!0);_e.Z.get("hidePremiumReactivateNotice")&&DE(e,ln.z$.NAGBAR_NOTICE_PREMIUM_REACTIVATE)&&(t=!0);ZE(e,ld.v6.INVITE_SPLASH_GUILD_HEADER_TOOLTIP,ln.z$.GUILD_HEADER_INVITE_SPLASH)&&(t=!0);return t},cleanup:function(){_e.Z.remove("hidePremiumPromo");_e.Z.remove("hidePremiumTier2TrialEnding");_e.Z.remove("hidePremiumReactivateNotice")}},{version:14,run:function(e){return ZE(e,ld.v6.ACTIVITY_BEB_TUTORIAL,ln.z$.ACTIVITIES_TUTORIAL_COACH_MARK)},cleanup:function(){}},{version:15,run:function(e){return ZE(e,ld.v6.NOW_PLAYING_CONSENT_CARD,ln.z$.NOW_PLAYING_CONSENT_CARD)},cleanup:function(){}},{version:16,run:function(e){var t=_e.Z.get("PromotionsPersistedStore");if(null==t)return!1;var n=t._state.lastDismissedOutboundPromotionStartDate;if(null!=n){null==e.userContent&&(e.userContent=ln.az.create());if(null==e.userContent.lastDismissedOutboundPromotionStartDate){
e.userContent.lastDismissedOutboundPromotionStartDate=xE.Gm.create({value:n});return!0}}return!1},cleanup:function(){}},{version:17,run:function(e){var t=s.ZP.PersistedStore.migrateAndReadStoreState("ExpressionSuggestionsPersistedStore",null).state;if(null==t)return!1;var n=t.expressionSuggestionsEnabled;if(null!=n){null==e.textAndImages&&(e.textAndImages=ln.Me.create());if(null==e.textAndImages.expressionSuggestionsEnabled){e.textAndImages.expressionSuggestionsEnabled=xE.D5.create({value:n});return!0}}return!1},cleanup:function(){_e.Z.remove("ExpressionSuggestionsPersistedStore")}},{version:18,run:function(e){var t=!1;ZE(e,ld.v6.GUILD_DELETE_FEEDBACK,ln.z$.GUILD_DELETE_FEEDBACK)&&(t=!0);ZE(e,ld.v6.GUILD_LEAVE_FEEDBACK,ln.z$.GUILD_LEAVE_FEEDBACK)&&(t=!0);return t},cleanup:function(){}},{version:19,run:function(e){var t,n=!1;null!==(t=_e.Z.get("forumHelperCardStorageKey"))&&void 0!==t&&t&&(n=DE(e,ln.z$.FORUM_CHANNEL_HELPER_CARD));return n},cleanup:function(){
_e.Z.remove("forumHelperCardStorageKey")}}];const UE=LE;var kE=n(969223),GE=n(917019);const BE=function(){kE.Z[CE.yP.PRELOADED_USER_SETTINGS]=UE;kE.Z[CE.yP.FRECENCY_AND_FAVORITES_SETTINGS]=RE;O.Z.subscribe("CONNECTION_OPEN",HE);O.Z.subscribe("USER_SETTINGS_PROTO_ENQUEUE_UPDATE",VE);O.Z.subscribe("USER_SETTINGS_PROTO_LOAD_IF_NECESSARY",FE);O.Z.subscribe("APP_STATE_UPDATE",YE)};function HE(){var e=lt.Z.getFullState(),t=e[CE.yP.PRELOADED_USER_SETTINGS];t.editInfo.triggeredMigrations&&GE.hW.markDirtyFromMigration(t.proto,t.editInfo.cleanupFuncs);Wa().forEach(GE.aj,(function(t,n){null!=e[Number(n)].editInfo.offlineEditDataVersion&&t.scheduleSaveFromOfflineEdit()}))}function VE(e){var t=e.settings,n=t.proto,r=t.type,o=e.delaySeconds,i=e.jitter;GE.aj[r].markDirty(n,{delaySeconds:o,jitter:i})}function FE(e){var t=e.settingsType;GE.aj[t].loadIfNecessary()}function YE(e){var t=e.state;"inactive"!==t&&"background"!==t||Wa().forEach(GE.aj,(function(e,t){
if(null!=lt.Z.getFullState()[Number(t)].editInfo.timeout){e.logger.log("Triggering persistChanges due to AppStateUpdate");e.persistChanges()}}))}var zE=n(721110);function WE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KE(e){KE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return KE(e)}function qE(e,t){return!t||"object"!==$E(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function XE(e,t){XE=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return XE(e,t)}var QE,$E=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function JE(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{
Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=KE(e);if(t){var o=KE(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return qE(this,n)}}function ey(){var e,t=QE;if(null==t||!N.Z.isOpen(t))return!1;O.Z.wait((function(){return v.xv(t)}));null===(e=A.Z.getRTCConnection())||void 0===e||e.setPipOpen(!1);QE=null}function ty(){var e=A.Z.getChannelId(),t=QE===e;if(function(){var e=A.Z.getChannelId(),t=C.Z.getChannelId();if(!Ye.Z.supports(Ke.AN.VIDEO))return!0;if(I.Z.getWindowOpen(M.KJ3.CHANNEL_CALL_POPOUT))return!0;var n=Pr.Z.getAllActiveStreams().length>0;if(!(null!=e&&Object.values(j.Z.getVideoVoiceStatesForChannel(e)).some((function(e){var t=e.userId;return!Ye.Z.isLocalVideoDisabled(t)}))||n))return!0;var r=T.Z.hasLayers();return!(r&&T.Z.getLayers().includes(M.S9g.RTC_DEBUG)||!r&&e!==t)}())return ey();t||ey();return null!=e&&function(e){var t,n=S.Z.getChannel(e)
;if(null==n||N.Z.isOpen(e))return!1;O.Z.wait((function(){return v.bA(n.id,M.NYg.VIDEO,{channel:n})}));null===(t=A.Z.getRTCConnection())||void 0===t||t.setPipOpen(!0);QE=e}(e)}var ny=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&XE(e,t)}(n,e);var t=JE(n);function n(){WE(this,n);return t.apply(this,arguments)}var r=n.prototype;r._initialize=function(){C.Z.addChangeListener(ty);P.Z.addChangeListener(ty);A.Z.addChangeListener(ty);j.Z.addChangeListener(ty);T.Z.addChangeListener(ty);Pr.Z.addChangeListener(ty);I.Z.addChangeListener(ty);Ye.Z.addChangeListener(ty);R.ZP.addChangeListener(ty)};r._terminate=function(){C.Z.removeChangeListener(ty);P.Z.removeChangeListener(ty);A.Z.removeChangeListener(ty);j.Z.removeChangeListener(ty);T.Z.removeChangeListener(ty);Pr.Z.removeChangeListener(ty)
;I.Z.removeChangeListener(ty);Ye.Z.removeChangeListener(ty);R.ZP.removeChangeListener(ty)};r.__getLocalVars=function(){return{openChannelId:QE}};return n}(_.Z);const ry=new ny;var oy=n(595970);function iy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ay(e){ay=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return ay(e)}function sy(e,t){return!t||"object"!==ly(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function cy(e,t){cy=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return cy(e,t)}var ly=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function uy(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{
Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=ay(e);if(t){var o=ay(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return sy(this,n)}}var fy=18e6,dy=new Uu.V7,py=new Uu.V7,hy=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&cy(e,t)}(n,e);var t=uy(n);function n(){iy(this,n);return t.apply(this,arguments)}var r=n.prototype;r._initialize=function(){O.Z.subscribe("IDLE",this.handleIdleUpdate)};r._terminate=function(){dy.stop();py.stop();O.Z.unsubscribe("IDLE",this.handleIdleUpdate)};r.handleIdleUpdate=function(){var e=oy.Z.getIdleSince();if(Lt.FB){dy.stop();py.stop();var t=Pr.Z.getAllActiveStreams(),n=!0,r=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){
if(i.value.state!==M.jm8.ENDED)return}}catch(e){r=!0;o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}if(null!=e){var s=A.Z.getChannelId();if(null!=s){py.start(fy,(function(){d.default.selectVoiceChannel(null)}));var c=Zt.Z.getGuild(A.Z.getGuildId());if(null!=c&&null!=c.afkChannelId&&c.afkChannelId!==s&&null!=c.afkTimeout){var l=S.Z.getChannel(s);null!=l&&(l.isGuildStageVoice()||dy.start(e+1e3*c.afkTimeout-Date.now(),(function(){null!=(c=Zt.Z.getGuild(A.Z.getGuildId()))&&null!=c.afkChannelId&&d.default.selectVoiceChannel(c.afkChannelId)})))}}}}};r.__getLocalVars=function(){return{AUTO_DISCONNECT_TIME:fy,afkTimeout:dy,autoDisconnectTimeout:py}};return n}(_.Z);const Ey=new hy;var yy=n(536038),my=n(532548),by=n(489770),gy=n(10712),Oy=n(801991),vy=n(912735);function _y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Iy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1;r.configurable=!0
;"value"in r&&(r.writable=!0);Object.defineProperty(e,r.key,r)}}function Sy(e){Sy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Sy(e)}function Ty(e,t){return!t||"object"!==Ay(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ny(e,t){Ny=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Ny(e,t)}var Ay=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Cy(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Sy(e);if(t){var o=Sy(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments)
;return Ty(this,n)}}var Py={},jy=Py,Ry=!1,xy={},My={},wy={},Dy={id:null,justChanged:!1},Zy={id:null,justChanged:!1},Ly=/\(([^)]+)\)/;function Uy(e){if((0,Lt.Xf)()===Lt.AB.WINDOWS){var t=e.name.match(Ly);if(null!=t)return t[1]}return e.name}function ky(e,t,n){return null==e||e.displayName!==t?{displayName:t,type:n}:e.type===M.QyF.INPUT&&n===M.QyF.OUTPUT||e.type===M.QyF.OUTPUT&&n===M.QyF.INPUT?{displayName:t,type:M.QyF.INPUT_AND_OUTPUT}:e}var Gy=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Ny(e,t)}(n,e);var t=Cy(n);function n(){_y(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(e){this.waitFor(Ye.Z,lt.Z);jy=null!=e?e:Py};r.getUserAgnosticState=function(){return jy};r.__getLocalVars=function(){return{initialState:Py,state:jy,initialized:Ry,inputDevices:xy,outputDevices:My,
lastDeviceConnected:wy,lastInputSystemDevice:Dy,lastOutputSystemDevice:Zy,WINDOWS_DEVICE_NAME_REGEX:Ly}};!function(e,t,n){t&&Iy(e.prototype,t);n&&Iy(e,n)}(n,[{key:"initialized",get:function(){return Ry}},{key:"lastDeviceConnected",get:function(){return wy}},{key:"inputDevices",get:function(){return xy}},{key:"lastInputSystemDevice",get:function(){return Dy}},{key:"outputDevices",get:function(){return My}},{key:"lastOutputSystemDevice",get:function(){return Zy}}]);return n}(s.ZP.DeviceSettingsStore);Gy.displayName="ConnectedDeviceStore";Gy.persistKey="ConnectedDeviceStore";const By=new Gy(O.Z,{MEDIA_ENGINE_DEVICES:function(e){var t=e.inputDevices,n=e.outputDevices,r={};Dy.justChanged=!1;t.forEach((function(e){r[Uy(e)]=e.id;if(e.id===Ke.w5){var t,n=null!==(t=e.originalId)&&void 0!==t?t:e.originalName;n!==Dy.id&&(Dy.justChanged=!0);Dy.id=n}}));var o={};Zy.justChanged=!1;n.forEach((function(e){o[Uy(e)]=e.id;if(e.id===Ke.w5){var t,n=null!==(t=e.originalId)&&void 0!==t?t:e.originalName
;n!==Zy.id&&(Zy.justChanged=!0);Zy.id=n}}));if(Ry){var i=Object.keys(xy),a=Object.keys(r),s=Object.keys(My),c=Object.keys(o),l=Wa().difference(i,a),u=Wa().difference(s,c);if(l.length>0||u.length>0)wy={};else{Wa().difference(a,i).forEach((function(e){wy[e]=ky(wy[e],e,M.QyF.INPUT)}));Wa().difference(c,s).forEach((function(e){wy[e]=ky(wy[e],e,M.QyF.OUTPUT)}))}if(!Wa().isEqual(i,a)||!Wa().isEqual(s,c)){xy=r;My=o;return!0}return!1}xy=r;My=o;Ry=!0},CONNECTED_DEVICE_SET:function(e){var t=e.displayName;!function(e,t,n){if(t===M.aVf.INPUT||t===M.aVf.INPUT_AND_OUTPUT){var r=xy[e];null!=r&&O.Z.wait((function(){return Fe.Z.setInputDevice(r,n)}))}if(t===M.aVf.OUTPUT||t===M.aVf.INPUT_AND_OUTPUT){var o=My[e];O.Z.wait((function(){return Fe.Z.setOutputDevice(o,n)}))}}(t,e.connectedDevicePreference,e.location);delete wy[t]},CONNECTED_DEVICE_IGNORE:function(e){var t=e.displayName;delete wy[t]},CONNECTED_DEVICE_NEVER_SHOW_MODAL:function(){wy={};jy={neverShowModal:!0}}});function Hy(e,t,n,r,o,i,a){try{
var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Vy(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Hy(i,r,o,a,s,"next",e)}function s(e){Hy(i,r,o,a,s,"throw",e)}a(void 0)}))}}var Fy=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,
o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Yy=new Set(["DisplayPort"]),zy=!1;function Wy(){if(!zy){var e=Ye.Z.getInputDeviceId(),t=Ye.Z.getOutputDeviceId();if(!By.getState().neverShowModal&&!Wa().isEmpty(By.lastDeviceConnected)){var o=Uy(Ye.Z.getInputDevices()[e]),i=Uy(Ye.Z.getOutputDevices()[t]),a=Wa().some(By.lastDeviceConnected,(function(e){return Yy.has(e.displayName)||e.displayName===o||e.displayName===i}));if(!a){var s=Wa().some(By.lastDeviceConnected,(function(e){return vy.Z.isCertified(By.inputDevices[e.displayName])||vy.Z.isCertified(By.outputDevices[e.displayName])}))
;if(!(e===Ke.w5&&By.lastInputSystemDevice.justChanged||t===Ke.w5&&By.lastOutputSystemDevice.justChanged)||s){var l=Wa().first(Object.keys(By.lastDeviceConnected)),u=null!=l&&""!==l?By.lastDeviceConnected[l]:null;if(null!=u){var f;By.initialized&&null!=l&&(vy.Z.isCertified(By.inputDevices[l])?f=vy.Z.getCertifiedDevice(By.inputDevices[l]):vy.Z.isCertified(By.outputDevices[l])&&(f=vy.Z.getCertifiedDevice(By.outputDevices[l])));zy=!0;(0,c.ZDy)(Vy((function(){var e,t;return Fy(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(87812)]).then(n.bind(n,887812))];case 1:e=o.sent(),t=e.default;return[2,function(e){var n=e.transitionState,o=e.onClose;return(0,r.jsx)(t,{device:u,certifiedDeviceMetadata:f,transitionState:n,onClose:function(){zy=!1;return o()}})}]}}))})))}}}}}}const Ky=function(){By.addChangeListener(Wy)};var qy=n(713094);function Xy(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Qy(e){
return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Xy(i,r,o,a,s,"next",e)}function s(e){Xy(i,r,o,a,s,"throw",e)}a(void 0)}))}}var $y=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}
if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Jy=!1,em=null;const tm=function(){O.Z.subscribe("CONNECTION_OPEN",(function(e){var t=e.pendingPayments;if(null!=t&&t.length>0){if(em===t[0])return;if(null==(em=t[0]))return;!function(e){if(!Jy){Jy=!0;(0,c.ZDy)(Qy((function(){var t,o;return $y(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(43569)]).then(n.bind(n,43569))];case 1:t=i.sent(),o=t.default;return[2,function(t){var n=t.transitionState,i=t.onClose;return(0,r.jsx)(o,{pendingPayment:e,transitionState:n,onClose:function(){Jy=!1;return i()}})}]}}))})))}}(em)}}))};var nm=n(647136),rm=n(409125),om=n(377128),im=n(602397),am=n(716118);function sm(e,t,n){o.useEffect((function(){var r=t(),o=new s.Fh(e,(function(){var e=t(),o=n(r,e)
;null==o||sp.Z.isSoundDisabled(o)||(0,am.GN)(o,.4);r=e}));o.attach("useSound");return function(){return o.detach()}}))}function cm(){sm([Ye.Z,C.Z],(function(){return{inVoiceChannel:null!=C.Z.getVoiceChannelId(),selfMute:Ye.Z.isSelfMute(),selfDeaf:Ye.Z.isSelfDeaf(),audioPermissionReady:Ye.Z.isNativeAudioPermissionReady()}}),(function(e,t){var n=t.inVoiceChannel,r=t.selfMute,o=t.selfDeaf,i=t.audioPermissionReady;if(n){if(e.selfDeaf!==o)return o?"deafen":"undeafen";if(i&&(n||e.audioPermissionReady))return e.selfMute!==r?r?"mute":"unmute":void 0}}));return null}function lm(){sm([S.Z,A.Z,C.Z,rm.Z],(function(){var e=S.Z.getChannel(C.Z.getVoiceChannelId()),t=null==e?void 0:e.type,n=A.Z.getWasEverRtcConnected(),r=A.Z.getState();return{channelType:t,connected:r===M.hes.RTC_CONNECTED,connectHasStarted:!n&&r!==M.hes.DISCONNECTED||r===M.hes.RTC_CONNECTED,awaitingRemote:null!=rm.Z.getAwaitingRemoteSessionInfo(),connectedRemote:null!=rm.Z.getRemoteSessionId()}}),(function(e,t){
var n=t.channelType,r=t.connected,o=t.connectHasStarted,i=t.awaitingRemote,a=t.connectedRemote,s=e.channelType,c=e.connectedRemote,l=i||a,u=e.connected&&!r;if(!e.connectHasStarted&&o||a&&!c){if(null!=n&&Ss.Lr.has(n))return;return"user_join"}if(u){if(l||null!=s&&Ss.Lr.has(s))return;return"disconnect"}}));return null}function um(){sm([om.Z],(function(){return om.Z.isCurrentUserSpeaking()}),(function(e,t){if(e!==t){var n=Ye.Z.isSelfMute();if(Ye.Z.getMode()===M.pM4.PUSH_TO_TALK&&!n)return t?"ptt_start":"ptt_stop"}}));return null}function fm(){sm([Ye.Z],(function(){return Ye.Z.isSelfMutedTemporarily()}),(function(e,t){if(e!==t){var n=Ye.Z.isSelfMute();if(Ye.Z.getMode()===M.pM4.VOICE_ACTIVITY&&!n)return t?"ptt_stop":"ptt_start"}}));return null}function dm(){sm([j.Z],(function(){return j.Z.userHasBeenMovedVersion}),(function(e,t){if(e!==t)return"user_moved"}));return null}function pm(){sm([C.Z,j.Z],(function(){var e=C.Z.getVoiceChannelId();if(null==e)return Rd.xO.NONE
;var t=j.Z.getVoiceStateForChannel(e);return(0,Rd.gf)(t)}),(function(e,t){if(e!==t&&t===Rd.xO.REQUESTED_TO_SPEAK_AND_AWAITING_USER_ACK)return"reconnect"}));return null}function hm(){sm([C.Z,Pr.Z,Jn.default,j.Z,S.Z],(function(){var e,t=C.Z.getVoiceChannelId(),n=Jn.default.getId(),r=void 0,o=[],i=null,a=0,s=Pr.Z.getAllActiveStreams();if(null!=t){var c=S.Z.getChannel(t);if(null!=c){e=c.type;r=im.ZP.countVoiceStatesForChannel(c.id)-(j.Z.isInChannel(c.id)?1:0);o=Pr.Z.getAllApplicationStreamsForChannel(c.id).map((function(e){return e.ownerId}))}}var l=null;(null==(l=1===s.length?s[0]:Pr.Z.getCurrentUserActiveStream())?void 0:l.state)===M.jm8.CONNECTING&&(l=null);if(null!=l){i=(0,Cr.V9)(l);a=Pr.Z.getViewerIds(i).filter((function(e){return e!==n})).length}return{channelType:e,voiceChannelId:t,voiceChannelUserCount:r,streamingUserIds:o,singleActiveStreamKey:i,singleActiveStreamViewerCount:a,currentUserId:n,allActiveStreams:s}}),(function(e,t){
var n=t.channelType,r=t.voiceChannelId,o=t.voiceChannelUserCount,i=t.streamingUserIds,a=t.singleActiveStreamKey,s=t.singleActiveStreamViewerCount,c=t.currentUserId;if(e.voiceChannelId===r&&null!=r&&!(function(e){var t=S.Z.getChannel(e);if(null==t)return!1;var n=t.getGuildId();if(null==n)return!1;var r=Zt.Z.getGuild(n);return null!=r&&r.afkChannelId===t.id}(r)||null!=n&&Ss.Lr.has(n))){var l=null!=a&&e.singleActiveStreamKey===a,u=i.some((function(t){return!e.streamingUserIds.includes(t)})),f=e.allActiveStreams.map((function(e){return e.ownerId})),d=e.streamingUserIds.some((function(e){return!i.includes(e)&&(e===c||f.includes(e))}))
;return u?"stream_started":d?"stream_ended":e.singleActiveStreamViewerCount<=25&&l&&s>e.singleActiveStreamViewerCount?"stream_user_joined":null!=e.voiceChannelUserCount&&null!=o&&e.voiceChannelUserCount<=25&&o>e.voiceChannelUserCount?"user_join":null!=e.voiceChannelUserCount&&null!=o&&e.voiceChannelUserCount<=25&&o<e.voiceChannelUserCount?"user_leave":e.singleActiveStreamViewerCount<=25&&l&&s<e.singleActiveStreamViewerCount?"stream_user_left":void 0}}));return null}function Em(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(cm,{}),(0,r.jsx)(lm,{}),(0,r.jsx)(um,{}),(0,r.jsx)(fm,{}),(0,r.jsx)(dm,{}),(0,r.jsx)(hm,{}),(0,r.jsx)(pm,{})]})}var ym=n(344524),mm=n(248088),bm=n(419289),gm=n(95354),Om=n.n(gm);function vm(){var e=[{keybinds:["Spacebar","Enter"],name:Q.Z.Messages.DND_OPERATION_LABEL_DROP},{keybinds:["up","down"],name:Q.Z.Messages.DND_OPERATION_LABEL_MOVE},{keybinds:["ESC"],name:Q.Z.Messages.DND_OPERATION_LABEL_CANCEL}],t=(0,s.e7)([E.Z],(function(){return E.Z.useReducedMotion
})),n=(0,bm.zP)();return(0,mm.useTransition)(n,{enter:{from:{opacity:0,y:t?0:80},to:{opacity:1,y:0}},leave:{opacity:0,y:t?0:80},config:mm.config.stiff})((function(t,n){return n?(0,r.jsx)("div",{className:Om().positioner,children:(0,r.jsx)(mm.animated.div,{className:Om().container,style:t,children:e.map((function(t,n){var i=t.keybinds,a=t.name;return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(c.xvT,{variant:"text-md/semibold",className:Om().bindName,children:a}),i.map((function(e){return(0,r.jsx)(c.M2$,{shortcut:e,className:Om().shortcut},e)})),n<e.length-1?(0,r.jsx)("span",{className:Om().separator}):null]},a)}))})}):null}))}var _m=n(454871),Im=n(479049),Sm=n.n(Im),Tm=n(131795),Nm=n.n(Tm),Am=n(792800),Cm=n(813869);function Pm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jm(e){jm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return jm(e)}function Rm(e,t){
return!t||"object"!==Mm(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xm(e,t){xm=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return xm(e,t)}var Mm=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function wm(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=jm(e);if(t){var o=jm(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Rm(this,n)}}var Dm="IncomingCallStore",Zm={width:232,height:315},Lm=new Set,Um=[],km=new Map,Gm=new Set,Bm=0,Hm=0,Vm=!1;!function(){0;var e=_e.Z.get(Dm);if(null!=e){Bm=+e.x;Hm=+e.y}else{
var t=n(901654).Z.windowSize();Bm=t.width/2-Zm.width/2;Hm=t.height/2-Zm.height/2}}();function Fm(e){if(null==e)return!1;if(null==km.get(e))return!1;km.delete(e);(Gm=new Set(Gm)).delete(e)}function Ym(e){var t=e.channelId,n=e.ringing.includes(Jn.default.getId());if(!Gm.has(t)&&n){var r=S.Z.getChannel(t);if(null==r)return!1;var o=10*Gm.size;km.set(t,{channel:r,x:Bm+o,y:Hm+o});(Gm=new Set(Gm)).add(t)}else{if(!Gm.has(t)||n)return!1;Fm(t)}}function zm(){Vm=Au.Z.getStatus()===M.Skl.DND}var Wm=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&xm(e,t)}(n,e);var t=wm(n);function n(){Pm(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(S.Z,Au.Z);this.syncWith([Au.Z],zm)};r.getIncomingCalls=function(){return Vm?Um:Array.from(km.values())}
;r.getIncomingCallChannelIds=function(){return Vm?Lm:Gm};r.getFirstIncomingCallId=function(){return Vm?null:Gm.values().next().value};r.hasIncomingCalls=function(){return!Vm&&Gm.size>0};r.__getLocalVars=function(){return{INCOMING_CALL_MODAL_POSITION:Dm,DIMENSIONS:Zm,MULTIPLE_MODAL_OFFSET:10,DND_ACTIVE_CALLS:Lm,NO_INCOMING_CALLS:Um,incomingCalls:km,activeCalls:Gm,x:Bm,y:Hm,dnd:Vm}};return n}(s.ZP.Store);Wm.displayName="IncomingCallStore";const Km=new Wm(O.Z,{CALL_CREATE:Ym,CALL_UPDATE:Ym,CALL_DELETE:function(e){return Fm(e.channelId)},VOICE_CHANNEL_SELECT:function(e){return Fm(e.channelId)},INCOMING_CALL_MOVE:function(e){var t=e.x,n=e.y;Bm=t;Hm=n;_e.Z.set(Dm,{x:Bm,y:Hm});return!1},CHANNEL_DELETE:function(e){return Fm(e.channel.id)}});var qm=new Set(["Blink","Gecko","WebKit"]),Xm=M.dG4;if(Lt.FB)Xm=function(e){return ss.default.setBadge(e)};else if(qm.has(Nm().layout)){var Qm=new(Sm())({animation:"none"});Xm=function(e){try{(0,Am.PR)(e);Qm.badge(-1===e?"•":e)}catch(e){}}}function $m(e,t){
if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jm(e){Jm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Jm(e)}function eb(e,t){return!t||"object"!==nb(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function tb(e,t){tb=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return tb(e,t)}var nb=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function rb(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Jm(e);if(t){var o=Jm(this).constructor;n=Reflect.construct(r,arguments,o)
}else n=r.apply(this,arguments);return eb(this,n)}}var ob=TE()({DEFAULT:null,UNREAD:null,CONNECTED:null,SPEAKING:null,MUTED:null,DEAFENED:null}),ib=(0,Lt.id)()?null:ob.DEFAULT,ab=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&tb(e,t)}(n,e);var t=rb(n);function n(){$m(this,n);var e;(e=t.apply(this,arguments)).getIcon=function(){var t=e.props,n=t.deafened,r=t.muted,o=t.speaking,i=t.connected,a=t.unread,s=ib;if((0,Lt.id)()&&!i)return s;if((0,Lt.IJ)()||!i){a&&(s=ob.UNREAD);return s}return s=n?ob.DEAFENED:r?ob.MUTED:o?ob.SPEAKING:ob.CONNECTED};return e}var r=n.prototype;r.componentDidMount=function(){ss.default.setSystemTrayIcon(this.getIcon())};r.componentDidUpdate=function(){ss.default.setSystemTrayIcon(this.getIcon())};r.componentWillUnmount=function(){ss.default.setSystemTrayIcon(ib)};r.render=function(){
return null};return n}(o.PureComponent),sb=function(){return null};if(Lt.FB){ss.default.on("SYSTEM_TRAY_TOGGLE_MUTE",(function(){return Fe.Z.toggleSelfMute()}));ss.default.on("SYSTEM_TRAY_TOGGLE_DEAFEN",(function(){return Fe.Z.toggleSelfDeaf()}));ss.default.on("SYSTEM_TRAY_OPEN_VOICE_SETTINGS",(function(){h.Z.open(M.oAB.VOICE)}));sb=s.ZP.connectStores([A.Z,Ye.Z,om.Z,Cm.Z,Ja.Z,sp.Z],(function(){var e=Cm.Z.getTotalMentionCount(),t=Cm.Z.hasAnyUnread(),n=Ja.Z.getPendingCount(),r=!sp.Z.getDisableUnreadBadge()&&!!(t||e+n>0);return{connected:A.Z.isConnected(),speaking:om.Z.isCurrentUserSpeaking(),muted:Ye.Z.isSelfMute()||Ye.Z.isSelfMutedTemporarily(),deafened:Ye.Z.isSelfDeaf(),unread:r}}))(ab)}const cb=sb;var lb=n(570814),ub=n(113512),fb=n(566706),db=n(908741),pb=n(457217),hb=n(973553),Eb=n(591821),yb=n(672380),mb=n(677681),bb=n(333568),gb=n(914964),Ob=n(971402),vb=n(764079),_b=n(341305),Ib=n(704271),Sb=n(396043),Tb=n(281808),Nb=n(347005),Ab=n(128169),Cb=n(386531),Pb=n(689175),jb=n(549511)
;function Rb(e,t){var n=(0,dE.ZP)([Zt.Z],(function(){return Zt.Z.getGuild(e)})),r=(0,dE.ZP)([S.Z],(function(){return S.Z.getChannel(t)})),o=(0,jb.a)().showOnboardingHome;return(0,dE.ZP)([Pb.Z,Cb.Z,qa.ZP],(function(){var e,t;return null!=n&&null!=r&&o&&n.hasFeature(M.oNc.GUILD_SERVER_GUIDE)&&!ms.yE(null!==(t=null===(e=qa.ZP.getSelfMember(n.id))||void 0===e?void 0:e.flags)&&void 0!==t?t:0,Ab.qQ.COMPLETED_HOME_ACTIONS)&&Cb.Z.hasMemberAction(n.id,r.id)&&!Pb.Z.hasCompletedActionForChannel(n.id,r.id)}))}var xb=n(25410),Mb=n(684412),wb=n(944522),Db=n(284610),Zb=n(747126),Lb=n(598123),Ub=n(189865),kb=n(373438),Gb=n(840484),Bb=n.n(Gb);function Hb(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Vb(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Hb(i,r,o,a,s,"next",e)}function s(e){Hb(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Fb(e,t,n){
t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Yb(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var zb=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),
0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Wb(e){var t=e.channelId,i=e.baseChannelId,a=e.channelViewSource,c=void 0===a?"Split View":a,l=e.isResourceChannelView,u=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(t)})),f=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(null==u?void 0:u.getGuildId())})),d=(0,s.e7)([Y.default],(function(){return Y.default.getCurrentUser()})),p=(0,
s.e7)([Zb.Z],(function(){return Zb.Z.didAgree(null==u?void 0:u.guild_id)})),h=!0===(null==d?void 0:d.nsfwAllowed),E=(0,op.ZP)(u),y=(0,s.e7)([wb.Z],(function(){return null!=(null==f?void 0:f.id)&&wb.Z.isLurking(f.id)}),[f]),m=(0,s.e7)([dn.Z],(function(){return dn.Z.can(M.Plq.SEND_MESSAGES,u)})),b=Rb(null==f?void 0:f.id,null==u?void 0:u.id),g=o.useRef(!1);o.useEffect((function(){if(null!=u&&!g.current){g.current=!0;(0,Sb.yw)(M.rMx.CHANNEL_OPENED,{channel_id:u.id,guild_id:u.guild_id,parent_id:u.parent_id,channel_view:c,can_send_message:m,has_pending_member_action:b})}}),[u,c,m,b]);if(null==u||null==f)return null;var O=[];y||O.push((0,r.jsx)(xb.Z,{channel:u},"notifications"));O.push((0,r.jsx)(kb.ZP.Icon,{icon:Ub.Z,tooltip:Q.Z.Messages.CLOSE,onClick:function(){return cd.Z.closeChannelSidebar(i)}},"close"));return!u.isNSFW()||h&&p?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(_b.Z,{channel:u,draftType:Db.d.ChannelMessage}),(0,r.jsx)(kb.ZP,{toolbar:O,
"aria-label":Q.Z.Messages.CHANNEL_HEADER_BAR_A11Y_LABEL,children:(0,Mb.ud)({channel:u,channelName:E,guild:f,inSidebar:!0,handleContextMenu:function(e){(0,Ob.jW)(e,Vb((function(){var e,t;return zb(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(84663),n.e(59295)]).then(n.bind(n,359295))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Yb(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Fb(e,t,n[t])}))}return e}({},e),{channel:u,guild:f}))}]}}))})))},handleClick:function(){var e=Lb.Z.getMessages(u.id);l?(0,Nb.C3)(u.id):(0,K.XU)(u.guild_id,u.id,e.jumpTargetId)}})}),(0,r.jsx)("div",{className:Bb().chat,children:(0,r.jsx)(vb.Z,{channel:u,guild:f,chatInputType:Tb.I.SIDEBAR},t)})]}):(0,r.jsx)(Ib.Z,{
guild:f})}var Kb=n(270946),qb=n(504698),Xb=n(123398),Qb=n(848465),$b=n(336194),Jb=n(74535),eg=n(206986),tg=n(124251),ng=n(709189),rg=n(217674),og=n(655402),ig=n(223251),ag=n.n(ig),sg=n(404940),cg=n.n(sg),lg=n(185802),ug=n.n(lg);function fg(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function dg(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){fg(i,r,o,a,s,"next",e)}function s(e){fg(i,r,o,a,s,"throw",e)}a(void 0)}))}}function pg(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function hg(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))
;n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var Eg=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}
if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},yg=function(e){var t=o.useMemo((function(){return null==e?null:Ds.ZP.getGuildHomeHeaderURL({id:e.id,homeHeader:e.homeHeader})}),[e]);return{homeHeaderImage:t,isHomeHeaderImageSet:null!=t,homeHeaderScroll:null!=t?200:0}};function mg(e){var t=e.guild,n=function(){pr.Z.open(t.id,M.pNK.OVERVIEW,void 0,M.KsC.DISPLAY)};return t.hasFeature(M.oNc.BANNER)?(0,r.jsxs)(c.zxk,{className:ag().editButton,innerClassName:ag().editButtonInner,type:"button",size:c.zxk.Sizes.MEDIUM,color:c.zxk.Colors.BRAND,onClick:n,children:[(0,r.jsx)(og.Z,{height:16,width:16,color:$b.Z.unsafe_rawColors.WHITE_500.css}),Q.Z.Messages.EDIT_IMAGE]}):(0,r.jsxs)(ng.C,{color:c.zxk.Colors.GREEN,className:ag().editButton,innerClassName:ag().editButtonInner,onClick:n,children:[(0,r.jsx)(rg.Z,{height:16,width:16,
className:ag().premiumUpsellBadge}),Q.Z.Messages.PREMIUM_GUILD_UNLOCK_WTH_BOOSTING_CTA]})}var bg=o.memo((function(e){var t=e.guild,o=yg(t),i=o.homeHeaderImage,a=o.isHomeHeaderImageSet,l=(0,s.e7)([dn.Z],(function(){return dn.Z.can(M.Plq.MANAGE_GUILD,t)})),u=(0,s.e7)([dn.Z],(function(){return(0,Tu.b)(dn.Z,t)})),f="dark"===(0,Jb.ZP)()?cg():ug();return(0,r.jsxs)("div",{className:ag().header,children:[(0,r.jsxs)("div",{className:ag().headerArtWrapper,children:[(0,r.jsx)("div",{className:lh()(ag().headerArt,pg({},ag().headerArtPlaceholder,!a)),style:{backgroundImage:"url(".concat(a?i:f,")")}}),l&&(0,r.jsx)(mg,{guild:t})]}),(0,r.jsx)(tg.Z,{className:ag().headerIcon,guild:t,size:tg.Z.Sizes.XLARGE,active:!0}),(0,r.jsx)(c.y5t,{children:(0,r.jsxs)("div",{className:ag().headerName,children:[(0,r.jsx)(c.X6q,{className:ag().headerName,variant:"heading-xxl/bold",children:t.name}),(0,r.jsx)(eg.Z,{size:24,guild:t,tooltipPosition:"bottom",tooltipColor:c.ua7.Colors.PRIMARY,className:ag().guildBadge
}),u&&(0,r.jsx)(c.zxk,{className:ag().inviteButton,size:c.zxk.Sizes.MEDIUM,color:c.zxk.Colors.PRIMARY,onClick:function(){return(0,c.ZDy)(dg((function(){var e,o;return Eg(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(45446)]).then(n.bind(n,945446))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,hg(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){pg(e,t,n[t])}))}return e}({},e),{guild:t,source:M.t4x.GUILD_HOME}))}]}}))})))},children:Q.Z.Messages.INSTANT_INVITE})]})})]})}));const gg=bg;var Og=n(283099),vg=n(409005),_g=n(745623),Ig=n(897196);function Sg(e){var t=e.pageWidth,n=e.onSidebarResize,o=(0,s.e7)([ap.ZP],(function(){return ap.ZP.getSidebarState(Ig.oC.GUILD_HOME)}))
;if(null==o||null==o.channelId)return null;var i=t-M.PrS-656;return(0,r.jsx)(hb.Z,{sidebarType:hb.y.HomeSidebar,maxWidth:i,onWidthChange:n,children:(0,r.jsx)(Wb,{channelId:o.channelId,baseChannelId:Ig.oC.GUILD_HOME,channelViewSource:"Home View",isResourceChannelView:!0})})}var Tg=n(34947),Ng=n(250384);function Ag(e){var t=e.width,n=void 0===t?16:t,o=e.height,i=void 0===o?16:o,a=e.color,s=void 0===a?"currentColor":a,c=e.className,l=e.foreground;return(0,r.jsx)("svg",{className:c,width:n,height:i,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{className:l,fill:s,
d:"M3.99984 1.33301C3.64622 1.33301 3.30708 1.47348 3.05703 1.72353C2.80698 1.97358 2.6665 2.31272 2.6665 2.66634V13.333C2.6665 13.6866 2.80698 14.0258 3.05703 14.2758C3.30708 14.5259 3.64622 14.6663 3.99984 14.6663H11.9998C12.3535 14.6663 12.6926 14.5259 12.9426 14.2758C13.1927 14.0258 13.3332 13.6866 13.3332 13.333V5.33301L9.33317 1.33301H3.99984ZM3.99984 2.66634H8.6665V5.99967H11.9998V13.333H3.99984V2.66634ZM5.33317 7.99967V9.33301H10.6665V7.99967H5.33317ZM5.33317 10.6663V11.9997H8.6665V10.6663H5.33317Z"})})}var Cg=n(755284),Pg=n(981990);function jg(e){return(0,dE.Wu)([Cb.Z,S.Z],(function(){return Cb.Z.getResourceChannels(e).filter((function(e){return null!=S.Z.getChannel(e.channelId)}))}))}var Rg=n(12162),xg=n.n(Rg),Mg=o.memo((function(e){var t=e.guild,n=(0,dE.ZP)([Ng.Z],(function(){return Ng.Z.getGuild(t.id)}),[t]);o.useEffect((function(){null==n&&(0,Tg.P)(t.id)}),[t.id,n]);return(0,r.jsxs)("div",{className:xg().sidebarCard,children:[(0,r.jsx)(c.X6q,{
className:xg().sidebarCardHeader,variant:"heading-md/bold",color:"header-primary",children:Q.Z.Messages.GUILD_HOME_ABOUT}),(0,r.jsx)(c.xvT,{className:xg().guildDescription,variant:"text-md/normal",color:"text-normal",children:t.description}),(0,r.jsxs)("div",{className:xg().guildInfo,children:[(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Cg.Z,{width:14,height:14}),(0,r.jsx)(c.xvT,{className:xg().guildInfoText,variant:"text-xs/normal",color:"text-muted",children:Q.Z.Messages.DISCOVERABLE_GUILD_HEADER_PUBLIC})]}),null!=(null==n?void 0:n.memberCount)&&null!=(null==n?void 0:n.presenceCount)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:xg().dotOnline}),(0,r.jsx)(c.xvT,{className:xg().guildInfoText,variant:"text-xs/normal",color:"text-muted",children:Q.Z.Messages.GUILD_ONBOARDING_HOME_GUILD_MEMBERS_RATIO.format({online:null==n?void 0:n.presenceCount,total:null==n?void 0:n.memberCount})})]})]})]})})),wg=o.memo((function(e){var t=e.guild,n=jg(t.id);return(0,r.jsxs)("div",{
className:xg().sidebarCard,children:[(0,r.jsx)(c.X6q,{className:xg().sidebarCardHeader,variant:"heading-md/bold",color:"header-primary",children:Q.Z.Messages.GUILD_HOME_RESOURCES}),(0,r.jsx)("div",{className:xg().resourceChannelsList,children:n.map((function(e){return(0,r.jsx)(c.P3F,{className:xg().resourceChannel,onClick:function(t){return function(e,t){var n=S.Z.getChannel(t);null!=n&&(e.shiftKey?(0,Nb.C3)(n.id):cd.Z.openResourceChannelAsSidebar({guildId:n.guild_id,channelId:n.id}))}(t,e.channelId)},children:(0,r.jsxs)(r.Fragment,{children:[e.channelId===t.rulesChannelId?(0,r.jsx)(Pg.Z,{}):(0,r.jsx)(Ag,{}),(0,r.jsx)(c.xvT,{className:xg().guildInfoText,variant:"text-sm/semibold",color:"none",children:e.title})]})},e.channelId)}))})]})}));const Dg=o.memo((function(e){var t=e.guild,n=e.isNewMember;return(0,r.jsxs)("aside",{className:xg().sidebar,children:[(0,r.jsx)(Mg,{guild:t}),n&&(0,r.jsx)(wg,{guild:t})]})}))
;var Zg=n(805318),Lg=n(665472),Ug=n(99440),kg=n(883064),Gg=n(916286),Bg=n(918771),Hg=n(5544),Vg=n(413297);var Fg=n(493254),Yg=n(707735),zg=n.n(Yg),Wg=n(597055),Kg=n.n(Wg);function qg(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Xg(e){var t,n,o,i=e.firstMedia,a=e.channelId,c=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(a)})),l=(0,s.e7)([dn.Z],(function(){return dn.Z.can(M.Plq.MANAGE_MESSAGES,c)})),u=ct.cC.useSetting(),f=null!==(t=null==i?void 0:i.spoiler)&&void 0!==t&&t&&!(0,Gg.Z)(u,l),d=(0,s.e7)([We.Z],(function(){return We.Z.isFocused()})),p=Fg.LR.test(i.src),h=ct.QK.useSetting(),E=i.src,y=i.width,m=i.height,b=i.alt;m>y?o=72:n=72;return(0,r.jsxs)("div",{className:zg().media,children:[(0,Bg.Yi)({src:E,maxHeight:n,maxWidth:o,width:y,height:m,alt:null!=b&&f?Q.Z.Messages.SPOILER_HIDDEN_A11Y_LABEL:b,autoPlay:h,animated:p&&!f&&d,containerClassName:zg().thumbnailContainer,imageClassName:lh()(qg({},zg().spoiler,f))
}),f&&(0,r.jsx)(Vg.Z,{className:zg().spoilerTag})]})}function Qg(e){var t=e.resource,n=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(t.channelId)})),i=(0,s.e7)([Lb.Z],(function(){return Lb.Z.getMessages(t.channelId)})),a=i.first(),l=function(e){var t,n;if(null==e)return null;if((null===(t=e.content)||void 0===t?void 0:t.length)>0)return e.content;if((null===(n=e.embeds)||void 0===n?void 0:n.length)>0){var r=!0,o=!1,i=void 0;try{for(var a,s=e.embeds[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value;if(null!=c.rawDescription&&c.rawDescription.length>0)return c.rawDescription}}catch(e){o=!0;i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}}return null}(a),u=(0,Ug.zy)(a,!1),f=(null==u?void 0:u.length)>0?u[0]:null,d=null!=n&&null==i.first()&&!i.loadingMore&&!i.ready&&!i.hasFetched;o.useEffect((function(){d&&Lg.Z.fetchMessages({channelId:t.channelId,after:t.channelId,limit:5})}),[t.channelId,d]);return(0,r.jsxs)(c.P3F,{className:zg().row,onClick:function(e){
null!=n&&(e.shiftKey?(0,Nb.C3)(n.id):cd.Z.openResourceChannelAsSidebar({guildId:n.guild_id,channelId:n.id}))},children:[(0,r.jsxs)("div",{className:zg().content,children:[(0,r.jsx)(c.xvT,{className:zg().title,variant:"text-md/semibold",color:"header-primary",children:t.title}),null!=l&&(0,r.jsx)(c.xvT,{className:zg().messageContent,variant:"text-sm/normal",color:"header-secondary",lineClamp:3,children:kg.Z.parse(l)})]}),null!=f?(0,r.jsx)(Xg,{firstMedia:f,channelId:t.channelId}):null]})}function $g(e){var t=e.guild,n=e.isNewMember,o=jg(t.id);return 0===o.length?n?null:(0,r.jsxs)("div",{className:zg().emptyContainer,children:[(0,r.jsx)(c.X6q,{variant:"heading-xl/bold",color:"header-primary",children:Q.Z.Messages.MEMBER_ACTION_COMPLETE_EMPTY_STATE}),(0,r.jsx)("img",{className:zg().emptyStateImage,src:Kg(),alt:""}),(0,r.jsx)(c.zxk,{className:zg().emptyStateButton,onClick:function(){var e=Hg.ZP.getDefaultChannel(t.id);null!=e&&(0,K.uL)(M.Z5c.CHANNEL(t.id,e.id))},fullWidth:!0,
children:Q.Z.Messages.MEMBER_ACTION_COMPLETE_EMPTY_STATE_CTA})]}):(0,r.jsxs)("div",{className:zg().container,children:[(0,r.jsx)(c.X6q,{variant:"heading-lg/bold",color:"header-primary",children:Q.Z.Messages.GUILD_HOME_RESOURCES}),o.map((function(e){return(0,r.jsx)(Qg,{resource:e},e.channelId)}))]})}var Jg=n(708674),eO=n(222752),tO=n(258875),nO=n.n(tO);function rO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function oO(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function iO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){oO(e,t,n[t])}))}return e}function aO(e,t){t=null!=t?t:{}
;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function sO(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function cO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){
var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return rO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var lO=o.memo((function(e){var t=e.guild;return(0,r.jsxs)(Og.Z,{channelId:Ig.oC.GUILD_HOME,guildId:t.id,className:lh()(xg().title,xg().background),innerClassname:xg().headerBarInner,children:[(0,r.jsx)(Og.Z.Icon,{icon:vg.Z,"aria-hidden":!0}),(0,r.jsxs)(Og.Z.Title,{children:[(0,r.jsx)(c.nn4,{
children:t.name}),Q.Z.Messages.SERVER_GUIDE]})]})}));var uO=n(730381),fO=n.n(uO),dO=n(349289),pO=n(813357),hO=n(357088),EO=n(239813),yO=n(910149);function mO(e,t){var n,r=function(n){var r=e[n],o=t[n];return r.length!==o.length?{v:!1}:r.some((function(e,t){return o[t]!==e}))?void 0:{v:!1}};if(e.length!==t.length)return!1;for(var o=0;o<e.length;o++){var i=r(o);if("object"==((n=i)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n))return i.v}return!0}var bO=n(258985),gO=n(487868),OO=n(633878);function vO(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function _O(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n
}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function IO(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function SO(e){var t=e.width,n=void 0===t?16:t,o=e.height,i=void 0===o?16:o,a=e.color,s=void 0===a?"currentColor":a,c=IO(e,["width","height","color"]);return(0,r.jsxs)("svg",_O(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){vO(e,t,n[t])}))}return e}({},(0,
OO.Z)(c)),{width:n,height:i,viewBox:"0 0 16 16",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"5.5",transform:"rotate(180 8 8)",stroke:"#A3A6AA"}),(0,r.jsx)("path",{d:"M13.197 5.00035C12.6704 4.08824 11.913 3.33081 11.0008 2.8042C10.0887 2.27759 9.05406 2.00035 8.00084 2.00035L8.00084 8.00035L13.197 5.00035Z",fill:s})]}))}function TO(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function NO(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function AO(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{}
;var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function CO(e){var t=e.width,n=void 0===t?16:t,o=e.height,i=void 0===o?16:o,a=e.color,s=void 0===a?"currentColor":a,c=AO(e,["width","height","color"]);return(0,r.jsxs)("svg",NO(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){TO(e,t,n[t])}))}return e}({},(0,OO.Z)(c)),{width:n,height:i,viewBox:"0 0 16 16",children:[(0,r.jsx)("circle",{cx:"8.19531",cy:"8.19629",r:"5.5",transform:"rotate(180 8.19531 8.19629)",stroke:"#A3A6AA"}),(0,r.jsx)("path",{
d:"M3.00027 11.1964C3.52688 12.1085 4.28431 12.866 5.19643 13.3926C6.10854 13.9192 7.14321 14.1964 8.19643 14.1964C9.24965 14.1964 10.2843 13.9192 11.1964 13.3926C12.1085 12.866 12.866 12.1085 13.3926 11.1964C13.9192 10.2843 14.1964 9.24965 14.1964 8.19643C14.1964 7.14321 13.9192 6.10854 13.3926 5.19643C12.866 4.28431 12.1085 3.52688 11.1964 3.00027C10.2843 2.47366 9.24964 2.19643 8.19642 2.19643L8.19643 8.19643L3.00027 11.1964Z",fill:s})]}))}function PO(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function jO(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function RO(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function xO(e){var t=e.width,n=void 0===t?16:t,o=e.height,i=void 0===o?16:o,a=e.color,s=void 0===a?"currentColor":a,c=RO(e,["width","height","color"]);return(0,r.jsxs)("svg",jO(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){PO(e,t,n[t])}))}return e}({},(0,OO.Z)(c)),{width:n,height:i,
viewBox:"0 0 16 16",children:[(0,r.jsx)("circle",{cx:"8.19531",cy:"8.19629",r:"5.5",transform:"rotate(180 8.19531 8.19629)",stroke:"#A3A6AA"}),(0,r.jsx)("path",{d:"M8.19727 14.1963C9.78856 14.1963 11.3147 13.5641 12.4399 12.4389C13.5651 11.3137 14.1973 9.78759 14.1973 8.19629C14.1973 6.60499 13.5651 5.07887 12.4399 3.95365C11.3147 2.82843 9.78857 2.19629 8.19727 2.19629L8.19727 8.19629L8.19727 14.1963Z",fill:s})]}))}var MO=n(354031),wO=n.n(MO),DO=n(435696),ZO=n.n(DO),LO=n(454675),UO=n.n(LO);function kO(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function GO(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){kO(i,r,o,a,s,"next",e)}function s(e){kO(i,r,o,a,s,"throw",e)}a(void 0)}))}}function BO(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function HO(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){BO(e,t,n[t])}))}return e}function VO(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var FO,YO=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){
return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},zO=(FO=GO((function(){return YO(this,(function(e){switch(e.label){case 0:return[4,n.e(1025).then(n.bind(n,101025))];case 1:return[2,e.sent().default]}}))})),function(){
return FO.apply(this,arguments)}),WO=function(e){var t,n,i=e.featuredItem,a=e.className,l=$b.Z.colors.TEXT_POSITIVE,u=CO,f=(0,s.e7)([Y.default],(function(){return Y.default.getUser(i.details.actorUserId)}),[i]),d=o.useMemo((function(){return null==f?{}:BO({},i.guildId,[f.id])}),[i.guildId,f]);(0,hO.$)(d);switch(l=(t=i.details.expiresAt,(n=fO()(t).diff(fO()(),"s"))<=yO.qZ.ONE_DAY?$b.Z.colors.TEXT_DANGER:n<=yO.qZ.THREE_DAYS?$b.Z.colors.TEXT_WARNING:$b.Z.colors.TEXT_POSITIVE)){case $b.Z.colors.TEXT_DANGER:u=SO;break;case $b.Z.colors.TEXT_WARNING:u=xO;break;case $b.Z.colors.TEXT_POSITIVE:u=CO}return(0,r.jsxs)("div",{className:lh()(a,wO().header),children:[(0,r.jsxs)("div",{className:wO().expirationContainer,children:[(0,r.jsx)(u,{color:l.css,"aria-hidden":!0,className:wO().expiredIcon}),(0,r.jsx)(c.xvT,{style:{color:l.css},variant:"text-sm/normal",children:Q.Z.Messages.GUILD_FEED_FEATURED_EXPIRED_IN.format({fromNow:fO()(i.details.expiresAt).fromNow()})})]}),(0,r.jsx)(bO.Z,{height:4,
width:4,"aria-hidden":"true",className:wO().dotIcon}),(0,r.jsxs)("div",{className:wO().featuredByContainer,children:[(0,r.jsx)(c.xvT,{className:wO().featuredByText,variant:"text-sm/normal",children:Q.Z.Messages.GUILD_FEED_FEATURED_BY}),null!=f&&(0,r.jsx)(c.qEK,{size:c.EFr.SIZE_16,src:f.getAvatarURL(void 0,16),"aria-hidden":!0})]})]})},KO=function(e){var t=e.channel,n=(0,op.ZP)(t),o=(0,EO.KS)(t),i=(0,EO.bT)(t);return null==t?null:(0,r.jsxs)("div",{className:wO().channelHeaderContainer,children:[null!=o?(0,r.jsx)(c.ua7,{text:i,delay:500,children:function(e){return(0,r.jsx)(o,VO(HO({},e),{className:wO().channelIcon,height:16,width:16}))}}):null,(0,r.jsx)(c.X6q,{className:wO().channelHeader,variant:"text-sm/semibold",children:n})]})},qO=o.memo((function(e){var t=e.guildId,n=e.featuredItem,o=(0,s.e7)([Xb.ZP],(function(){return Xb.ZP.getCachedMessage(t,n.message.channel_id,n.message.id)})),i=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(null==o?void 0:o.channel_id)}))
;if(null==i||null==o)return null;return(0,r.jsxs)(c.P3F,{onContextMenu:function(e){e.stopPropagation();(0,Ob.jW)(e,GO((function(){var e;return YO(this,(function(t){switch(t.label){case 0:return[4,zO()];case 1:e=t.sent();return[2,function(t){return(0,r.jsx)(e,VO(HO({},t),{messageItem:n,channel:i,message:o}))}]}}))})))},className:wO().featuredItemsGroupWrapper,children:[(0,r.jsx)(WO,{featuredItem:n.featuredItem}),(0,r.jsx)(KO,{channel:i}),(0,r.jsx)(gO.Z,{className:wO().featuredItemsGroupCozy,message:o,channel:i})]})})),XO=o.memo((function(e){var t=e.guildId,n=e.featuredItem,o=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(n.thread.id)})),i=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(null==o?void 0:o.parent_id)})),a=(0,s.e7)([Xb.ZP],(function(){return Xb.ZP.getCachedMessage(t,n.message.channel_id,n.message.id)}));if(null==a||null==i||null==o)return null;return(0,r.jsxs)(c.P3F,{onContextMenu:function(e){e.stopPropagation();(0,Ob.jW)(e,GO((function(){var e
;return YO(this,(function(t){switch(t.label){case 0:return[4,zO()];case 1:e=t.sent();return[2,function(t){return(0,r.jsx)(e,VO(HO({},t),{messageItem:n,channel:o,message:a}))}]}}))})))},className:wO().featuredItemsGroupWrapper,children:[(0,r.jsx)(WO,{featuredItem:n.featuredItem}),(0,r.jsx)(KO,{channel:i}),(0,r.jsx)(c.X6q,{className:wO().forumPostHeading,variant:"heading-md/semibold",children:o.name}),(0,r.jsx)(gO.Z,{className:wO().featuredItemsGroupCozy,message:a,channel:o})]},a.id)}));function QO(e){var t=e===M.BRd.LIGHT?UO():ZO();return(0,r.jsxs)("div",{className:wO().emptyPlaceholder,children:[(0,r.jsx)("div",{className:wO().emptyImage,style:{backgroundImage:"url(".concat(t,")")}}),(0,r.jsx)("div",{className:wO().emptyBody,children:Q.Z.Messages.GUILD_FEED_FEATURED_ITEMS_NO_ITEMS})]})}function $O(){return(0,r.jsx)(pO.h4,{title:Q.Z.Messages.GUILD_FEED_FEATURE_MESSAGE})}function JO(e){var t=e.guildId,n=(0,s.Wu)([Xb.ZP],(function(){return Xb.ZP.getFeaturedItems(t)}),[t]),i=(0,
s.e7)([Xb.ZP],(function(){return Xb.ZP.getFeaturedItemsFetchStatus(t)}),[t]);o.useEffect((function(){(0,qb.ZR)(t)}),[t]);return(0,r.jsx)(c.VqE,{"aria-label":Q.Z.Messages.GUILD_FEED_FEATURED_MESSAGES,children:(0,r.jsx)(pO.QV,{analyticsName:"Featured Feed Items Popout",listName:"featuredMessages",items:n,loading:i.loading!==Xb.Q.NONE,renderEmptyState:QO,renderHeader:$O,renderItem:function(e){return null==e?[]:e.type===dO.w.MESSAGE?[(0,r.jsx)(qO,{guildId:t,featuredItem:e},e.id)]:e.type===dO.w.FORUM_POST?[(0,r.jsx)(XO,{guildId:t,featuredItem:e},e.id)]:[]}})})}var ev=n(71236);function tv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nv(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function rv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){nv(e,t,n[t])}))}return e}function ov(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function iv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{
try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return tv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const av=function(e){var t=e.guildId,n=iv(o.useState(!1),2),i=n[0],a=n[1],s=o.useCallback((function(){a((function(e){return!e}))}),[]);return(0,r.jsx)(c.yRy,{shouldShow:i,animation:c.yRy.Animation.NONE,position:"bottom",align:"right",autoInvert:!1,ignoreModalClicks:!0,onRequestClose:function(){return a(!1)},renderPopout:function(e){return(0,r.jsx)(JO,rv({guildId:t},e))},children:function(e,t){var n=t.isShown;return(0,
r.jsx)(kb.JO,ov(rv({},e),{onClick:s,tooltip:n?null:Q.Z.Messages.GUILD_FEED_FEATURED_ITEMS,icon:ev.Z,"aria-label":Q.Z.Messages.GUILD_FEED_FEATURED_ITEMS,selected:n}))}})};var sv=n(451458),cv=n(878709),lv=n(841800),uv=n(136836),fv=n(821229),dv=n(733300),pv=n(83527),hv=n(256827),Ev=n(858519),yv=n(614244);var mv=n(433932),bv=n(118712),gv=n(945549),Ov=n(269300),vv=n(201441);function _v(){var e=(0,a.TH)(),t=(0,i.parse)(e.search),n=t.highlight_channel_id,r=t.highlight_message_id;return o.useMemo((function(){return null!=r&&null!=n?{messageId:r,channelId:n}:null}),[n,r])}var Iv=n(247346),Sv=n(556389),Tv=n(808749);var Nv=n(718831);function Av(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Cv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){
i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Av(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Av(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Pv=function(e){var t=Cv(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[S.Z,dn.Z,Tv.Z],3),n=t[0],r=t[1],o=t[2],i=o.getActiveChannelIds(e),a=null!=i?Array.from(i):[];return a.map((function(e){return n.getChannel(e)})).filter(_o.lm).filter((function(e){if(null==e?void 0:e.hasFlag(Ig.zZ.ACTIVE_CHANNELS_REMOVED))return!1;if(!(0,Ss.Qm)(e.type))return!1
;if(!r.can(M.Plq.VIEW_CHANNEL,e))return!1;var t=n.getChannel(e.parent_id);return!e.isThread()||null==t||!(null==t?void 0:t.hasFlag(Ig.zZ.ACTIVE_CHANNELS_REMOVED))}))},jv=function(e,t){var n,r=Cv(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[dn.Z,S.Z,im.ZP,Zt.Z],4),o=r[0],i=r[1],a=r[2],s=r[3],c=a.getVoiceStates(e),l=Object.keys(c).filter((function(e){return c[e].length>0})),u=null===(n=s.getGuild(e))||void 0===n?void 0:n.afkChannelId;return l.filter((function(e){return e!==u&&e!==(null==t?void 0:t.channel_id)})).map((function(e){return i.getChannel(e)})).filter(_o.lm).filter((function(e){return!(null==e?void 0:e.hasFlag(Ig.zZ.ACTIVE_CHANNELS_REMOVED))&&o.can(M.Plq.VIEW_CHANNEL,e)}))},Rv=n(96606),xv=n(973713),Mv=n.n(xv),wv=n(572274),Dv=n.n(wv);function Zv(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Lv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Zv(e,t,n[t])}))}return e}function Uv(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var kv=o.forwardRef((function(e,t){var n,o=e.shouldUseCollapsedLayout,i=void 0===o||o,a=e.listItemId,s=e.onClick,l=e.icon,u=e.iconTooltipText,f=e.textNode,d=e.header,p=e.accessoryNode,h=e.children,E=(0,bb.Z)(eO.Gj),y=(0,pb.JA)(null!=a?a:"");return(0,r.jsxs)("div",{ref:t,className:lh()(Mv().container,(n={},
Zv(n,Mv().containerCard,E),Zv(n,Mv().collapsedLayout,E&&i),n)),children:[(0,r.jsxs)(c.P3F,Uv(Lv({className:Mv().body,onClick:s},null!=a?y:void 0),{children:[(0,r.jsxs)("div",{className:Mv().details,children:[null!=l?(0,r.jsx)(c.ua7,{text:u,delay:500,children:function(e){return(0,r.jsx)("div",Uv(Lv({},e),{className:Mv().iconContainer,children:l}))}}):null,(0,r.jsx)(c.X6q,{className:Mv().title,variant:"heading-sm/semibold",lineClamp:1,children:d}),(0,r.jsx)("div",{className:Mv().subtitle,children:f})]}),null!=p&&(0,r.jsx)("div",{className:Mv().accessoryContainer,children:p})]})),h]})})),Gv=o.forwardRef((function(e,t){var n=e.children,o=e.guildId,i=e.channel,a=e.text,s=e.activityIndicator,l=e.usersInSummary,u=e.onChannelClick,f=e.channelIconOptions,d=(0,bb.Z)(eO.Gj),p=(0,EO.KS)(i,null,f);return(0,r.jsx)(kv,{ref:t,textNode:null!=a?(0,r.jsx)(c.xvT,{className:Mv().channelSubtitle,variant:"text-xs/normal",children:a}):null,listItemId:i.id,accessoryNode:(0,r.jsx)(Rv.Z,{guildId:o,users:l,
size:d?Rv.u.SIZE_24:Rv.u.SIZE_16,max:d?5:3,extraDetail:s}),onClick:u,icon:null!=p&&(0,r.jsx)(p,{width:16,height:16}),iconTooltipText:(0,EO.bT)(i),header:i.name,children:n})}));function Bv(){return(0,r.jsxs)("div",{className:lh()(Mv().container,Mv().containerCard,Mv().fillerCard),children:[(0,r.jsx)("img",{src:Dv(),className:Mv().spacerChannelImg,alt:"","aria-hidden":!0}),(0,r.jsxs)("div",{className:Mv().fillerText,children:[(0,r.jsx)(c.X6q,{className:Mv().title,variant:"heading-sm/semibold",children:Q.Z.Messages.ACTIVE_CHANNELS_COLLAPSED_SPACER_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",children:Q.Z.Messages.ACTIVE_CHANNELS_COLLAPSED_SPACER_SUBTITLE})]})]})}var Hv=n(941498);function Vv(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Fv(e){var t=e.guildId,n=(0,bb.Z)(eO.Gj);return(0,r.jsxs)(r.Fragment,{children:[za.times(n?4:3,(function(e){var o;return(0,r.jsxs)("div",{className:lh()(Mv().container,(o={},
Vv(o,Mv().loadingContainer,!0),Vv(o,Mv().containerCard,n),Vv(o,Mv().collapsedLayout,n),o)),children:[(0,r.jsxs)("div",{className:Mv().body,children:[(0,r.jsxs)("div",{className:Mv().details,children:[(0,r.jsx)("div",{className:Mv().iconContainer}),(0,r.jsx)(Hv.ZT,{className:Mv().title,opacity:.2,width:72}),(0,r.jsx)(Hv.ZT,{className:Mv().subtitle,opacity:.1,width:100})]}),(0,r.jsx)("div",{className:Mv().accessoryContainer,children:(0,r.jsx)(Rv.Z,{guildId:t,renderUser:function(){return(0,r.jsx)("div",{className:Mv().loadingUser,style:{width:n?24:16,height:n?24:16}})},users:[null,null],size:n?Rv.u.SIZE_24:Rv.u.SIZE_16,extraDetail:(0,r.jsx)("div",{className:Mv().typingIndicator})})})]}),2===e&&(0,r.jsx)("div",{className:Mv().previewContainer})]},e)})),(0,r.jsx)("div",{})," "]})}var Yv=n(426089),zv=n(788169);function Wv(e){var t,n=e.guildId,o=e.channel,i=e.trackChannelClick,a=(0,s.Wu)([Tv.Z],(function(){return null!==(t=Tv.Z.getChannelMessageData(o.id))&&void 0!==t?t:[]
})),l=Wa().uniq(Wa().map(a,"userId")),u=(0,s.Wu)([Y.default],(function(){return l.map((function(e){return Y.default.getUser(e)}))})),f=(0,s.e7)([zv.Z],(function(){var e=zv.Z.getTypingUsers(o.id);return Object.keys(e).length>0}),[o.id]),d=a.length<Tv.L?Q.Z.Messages.ACTIVE_CHANNELS_FEW_MESSAGES.format({count:a.length}):Q.Z.Messages.ACTIVE_CHANNELS_MANY_MESSAGES,p=f?(0,r.jsx)("div",{className:Mv().typingIndicator,children:(0,r.jsx)(c.bbz,{className:Mv().ellipsis,dotRadius:2,themed:!0})}):null;return(0,r.jsx)(Gv,{guildId:n,channel:o,usersInSummary:u.filter(_o.lm),text:d,activityIndicator:p,onChannelClick:function(){i(o);(0,Yv.Z)(M.Z5c.CHANNEL(o.guild_id,o.id,ho.Z.fromTimestamp(Date.now())))}})}var Kv=n(14096),qv=n(538272),Xv=n(246549),Qv=n(414306),$v=n(425454);function Jv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function e_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){
var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Jv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t_(e){var t=e.channel,n=e.voiceStates,o=e.showPlaceholder,i=(0,s.e7)([Pr.Z],(function(){return Pr.Z.getAllApplicationStreamsForChannel(t.id)[0]})),a=(0,s.e7)([Pr.Z],(function(){
return null!=i?Pr.Z.getActiveStreamForApplicationStream(i):null})),l=(0,s.e7)([Jn.default],(function(){return Jn.default.getId()})),u=e_((0,Rr.wq)(t),2),f=u[0],p=u[1];if(null==i)return null;var h,E=Wa().chain(n).map("member").find(["userId",i.ownerId]).value(),y=Wa().chain(n).map("user").find(["id",i.ownerId]).value(),m=null!==(h=null==E?void 0:E.nick)&&void 0!==h?h:lp.ZP.getName(y),b=null!=a&&null!=i&&a.state!==M.jm8.ENDED&&a.ownerId===i.ownerId;return(0,r.jsxs)(c.P3F,{onClick:function(){d.default.selectVoiceChannel(t.id);b||(0,Tr.iV)(i)},className:Mv().previewContainer,children:[o?(0,r.jsx)(Xv.c,{className:Mv().previewImage,isLoading:!0}):(0,r.jsx)(Xv.Z,{className:Mv().previewImage,stream:i}),f?(0,r.jsx)("div",{className:Mv().previewHover,children:(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"none",className:Mv().previewButton,children:(0,qv.Z)(i,a,l,p)})}):null,null!=m?(0,r.jsxs)("div",{className:Mv().previewName,children:[(0,r.jsx)($v.Z,{width:18,height:18,className:Mv().icon
}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"none",children:m})]}):null]})}function n_(e){var t,n=e.guildId,i=e.channel,a=e.voiceStates,c=e.trackChannelClick,l=e.showPreview,u=a.map((function(e){return e.user})),f=(0,Qv.Z)(null!==(t=null==i?void 0:i.id)&&void 0!==t?t:void 0).needSubscriptionToAccess,d=(0,s.e7)([dn.Z],(function(){return!dn.Z.can(M.Plq.CONNECT,i)})),p=o.useRef(null),h=function(e){var t=o.useRef(null),n=e_(o.useState(!1),2),r=n[0],i=n[1];o.useEffect((function(){t.current=new IntersectionObserver((function(e){var t=e_(e,1)[0];return i(t.isIntersecting)}))}),[]);o.useEffect((function(){var n;if(null!=e.current){null===(n=t.current)||void 0===n||n.observe(e.current);return function(){var e;null===(e=t.current)||void 0===e||e.disconnect()}}}),[e]);return r}(p),E=o.useRef(!1);o.useEffect((function(){h&&(E.current=!0)}),[h]);var y,m=Wa().map(a,(function(e){var t;return null!==(y=null===(t=e.member)||void 0===t?void 0:t.nick)&&void 0!==y?y:lp.ZP.getName(e.user)
})),b=m.join(", ");return(0,r.jsx)(Gv,{ref:p,guildId:n,channel:i,text:b,usersInSummary:u,onChannelClick:function(){if((0,Ss.bw)(i.type)){var e=C.Z.getVoiceChannelId(),t=!dn.Z.can(M.Plq.CONNECT,i);c(i);Kv.Z.handleVoiceConnect({channel:i,locked:t,connected:e===i.id,needSubscriptionToAccess:f})}},channelIconOptions:{locked:d},children:l&&(0,r.jsx)(t_,{channel:i,voiceStates:a,showPlaceholder:!E.current})})}var r_=n(210595),o_=kg.Z.parseGuildEventDescription,i_=n(32421),a_=n(371188),s_=n(205316),c_=n(915840),l_=n(82274),u_=n(808194),f_=n(570202),d_=n(457997),p_=n(710674),h_=n(3155),E_=n(509692),y_=n.n(E_);function m_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b_(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function g_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){
var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return m_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m_(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var O_=12;function v_(e){var t=e.event,n=t.scheduled_start_time,i=t.scheduled_end_time,a=(0,Ov.xt)(t),s=g_(o.useState((0,
a_.ub)(n,i)),2),l=s[0],u=l.startDateTimeString,f=l.endDateTimeString,d=l.currentOrPastEvent,p=l.upcomingEvent,h=l.diffMinutes,E=s[1];o.useEffect((function(){var e=setInterval((function(){return E((0,a_.ub)(n,i))}),1e3);return function(){clearInterval(e)}}),[]);var y,m=u,b="header-secondary";if(a){m=Q.Z.Messages.STAGE_CHANNEL_LIVE_NOW;b="text-positive"}else if(d){m=Q.Z.Messages.STARTING_SOON;b="text-brand"}else if(p){m=h>0?Q.Z.Messages.STARTING_IN_MINUTES.format({minutes:h}):Q.Z.Messages.STARTING_SOON;b="text-brand"}else null!=f&&""!==f&&(m=Q.Z.Messages.START_DATE_TO_END_DATE.format({start:u,end:f}));return(0,r.jsxs)("div",{className:lh()(y_().eventTime,(y={},b_(y,y_().isActive,a),b_(y,y_().isBrand,d||p),y)),children:[(0,r.jsx)(d_.Z,{width:O_,height:O_}),(0,r.jsxs)(c.xvT,{color:b,variant:"text-xs/normal",className:y_().eventTimeLabel,children:[m,(0,r.jsx)("span",{className:y_().separator,children:"•"})]})]})}function __(e){
var t=e.event,n=e.channel,i=e.isCollapsedSize,a=e.onEventClick,l=(0,s.e7)([dn.Z],(function(){return dn.Z.can(M.Plq.CONNECT,n)})),u=o.useCallback((function(){if(null!=n&&null!=n.getGuildId()&&l){(0,c_.Cq)(n);(0,K.XU)(n.getGuildId(),n.id)}}),[n,l]),f=(0,s_.Z)(t),d=t.entity_type===h_.WX.STAGE_INSTANCE?Q.Z.Messages.STAGE_CHANNEL_JOIN_BUTTON:Q.Z.Messages.JOIN;return null==t.image||i?null!=n&&l?(0,r.jsx)("div",{className:y_().eventJoinContainer,children:(0,r.jsx)(c.zxk,{className:y_().joinButton,onClick:u,fullWidth:!0,color:c.zxk.Colors.GREEN,children:d})}):null:null!=n&&l?(0,r.jsxs)(c.P3F,{onClick:u,className:y_().eventJoinContainer,children:[(0,r.jsx)("div",{className:y_().eventImg,style:{backgroundImage:"url(".concat(f,")")}}),(0,r.jsx)("div",{className:y_().eventImgHover,children:(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"none",className:y_().eventImgJoinButton,children:d})})]}):(0,r.jsx)(c.P3F,{onClick:a,className:y_().eventJoinContainer,children:(0,r.jsx)("div",{
className:y_().eventImg,style:{backgroundImage:"url(".concat(f,")")}})})}function I_(e){var t,n=e.event,o=e.channel,i=e.isActive,a=e.isCollapsedSize,s=(0,EO.KS)(o);return(0,r.jsxs)("div",{className:y_().eventInfo,children:[(!i||a)&&(0,r.jsx)(v_,{event:n}),(0,r.jsx)("div",{className:y_().location,children:null!=o&&null!=s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s,{width:O_,height:O_,className:y_().icon}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",className:y_().locationLabel,children:o.name})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p_.Z,{height:O_,width:O_,className:lh()(y_().channelContainer,y_().icon)}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",className:y_().locationLabel,children:o_(null!==(t=(0,i_.cS)(n))&&void 0!==t?t:void 0,!0)})]})})]})}function S_(e){var t=e.event,n=e.isInList,i=t.guild_id,a=(0,bb.Z)(eO.Gj),c=(0,Ov.xt)(t),l=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(t.channel_id)})),u=(0,s.e7)([wb.Z],(function(){return wb.Z.isLurking(i)
}),[i]),f=o.useCallback((function(){Ie.default.track(M.rMx.HOME_EVENT_CLICKED,{guild_id:i,home_session_id:yv.Z.getHomeSessionId(i),guild_scheduled_event_id:t.id,is_active:c});(0,dr.bO)({eventId:t.id,parentGuildId:i})}),[t,i,c]),d=(0,s.Wu)([im.ZP],(function(){return null==l?[]:im.ZP.getVoiceStatesForChannel(l).map((function(e){return e.user}))}),[l]),p=(0,s.e7)([l_.Z],(function(){if(null!=l&&l.type===r_.d.GUILD_STAGE_VOICE)return l_.Z.getParticipantCount(null==l?void 0:l.id,u_.pV.AUDIENCE)}),[l]);return(0,r.jsx)(kv,{listItemId:n?t.id:void 0,shouldUseCollapsedLayout:!1,onClick:u?void 0:f,icon:c?(0,r.jsx)("div",{className:y_().liveNowIcon}):(0,r.jsx)(f_.Z,{width:16,height:16}),iconTooltipText:Q.Z.Messages.GUILD_HOME_EVENTS_TOOLTIP_TEXT,header:t.name,textNode:(0,r.jsx)(I_,{event:t,channel:l,isActive:c,isCollapsedSize:a}),accessoryNode:c?(0,r.jsx)(Rv.Z,{guildId:i,users:d,count:p,size:Rv.u.SIZE_16,max:3}):null,children:c&&(0,r.jsx)(__,{event:t,channel:l,isCollapsedSize:a,onEventClick:f})})}
var T_=n(134658),N_=n.n(T_),A_=n(404024),C_=n.n(A_),P_=n(764728),j_=n.n(P_);function R_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function x_(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function M_(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function w_(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){
var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function D_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||L_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z_(e){return function(e){if(Array.isArray(e))return R_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||L_(e)||function(){
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L_(e,t){if(e){if("string"==typeof e)return R_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);return"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R_(e,t):void 0}}var U_={overflowX:void 0,overflowY:void 0};function k_(){var e="dark"===(0,Jb.ZP)()?C_():j_();return(0,r.jsxs)("div",{className:N_().emptyStateContainer,children:[(0,r.jsx)("img",{className:N_().image,src:e,width:154,height:48,alt:""}),(0,r.jsx)(c.X6q,{className:N_().title,variant:"heading-md/semibold",children:Q.Z.Messages.ACTIVE_CHANNELS_EMPTY_TITLE}),(0,r.jsx)(c.xvT,{className:N_().subtitle,color:"header-secondary",variant:"text-sm/normal",children:Q.Z.Messages.ACTIVE_CHANNELS_EMPTY_SUBTITLE})]})}function G_(e){
var t=e.isUsingCollapsedLayout,n=e.scrollerRef,o=e.handleScroll,i=e.activeChannels,a=e.totalActiveChannels,s=(0,gb.Z)("active-channels",n,{orientation:t?Iv.hy.HORIZONTAL:Iv.hy.VERTICAL});return(0,r.jsx)(pb.bG,{navigator:s,children:(0,r.jsx)(pb.SJ,{children:function(e){var s=e.ref,l=w_(e,["ref"]);return(0,r.jsxs)(c.xVE,M_(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){x_(e,t,n[t])}))}return e}({className:N_().channelList,orientation:"horizontal",paddingFix:!1,onScroll:o,style:t?void 0:U_,ref:function(e){n.current=e;var t;s.current=null!==(t=null==e?void 0:e.getScrollerNode())&&void 0!==t?t:null;o()}},l),{children:[i,t&&a<4&&(0,r.jsx)(Bv,{})]}))}})})}function B_(e){var t=e.guildId,n=e.isUsingCollapsedLayout,i=(0,s.e7)([Tv.Z],(function(){
return Tv.Z.getActiveChannelsFetchStatus(t)})),a=function(e){return(0,s.Wu)([S.Z,dn.Z,Tv.Z],(function(){return Pv(e,[S.Z,dn.Z,Tv.Z])}))}(t),l=(0,vv.k5)(t),u=(0,s.e7)([im.ZP],(function(){return im.ZP.getVoiceStates(t)})),f=function(e,t){return(0,s.Wu)([dn.Z,S.Z,im.ZP,Zt.Z],(function(){return jv(e,t,[dn.Z,S.Z,im.ZP,Zt.Z])}))}(t,l),d=a.length+f.length+(null!=l?1:0),p=d>0,h=o.useRef(null),E=(0,vv.ZP)(t).filter((function(e){return!(0,Ov.xt)(e)})),y=D_(o.useState(0===E.length),2),m=y[0],b=y[1],g=D_(o.useState(!0),2),O=g[0],v=g[1],_=D_(o.useState(!1),2),I=_[0],T=_[1],N=(0,mb.Z)(),A=N.ref,C=N.width,P=o.useCallback((function(){var e=h.current;if(null!=e&&null!=C){var t=e.getScrollerState(),n=t.scrollLeft,r=t.scrollWidth;v(n<=0);T(n>=r-C-1)}}),[C]),j=o.useCallback((function(){var e=h.current;if(null!=e&&null!=C){var t=e.getScrollerState().scrollLeft,n=C+12,r=Math.max(.25*C-9,140),o=Math.ceil((t-n)/r)*r;e.scrollTo({to:Math.max(0,o),animate:!0})}}),[C]),R=o.useCallback((function(){var e=h.current
;if(null!=e&&null!=C){var t=e.getScrollerState(),n=t.scrollLeft,r=t.scrollWidth,o=C+12,i=Math.max(.25*C-9,140),a=Math.floor((n+o)/i)*i;e.scrollTo({to:Math.min(r,a),animate:!0})}}),[C]);o.useEffect((function(){Tv.Z.shouldFetch(t)&&(0,Sv.n)(t)}),[t]);!function(e,t,n){var r=(0,s.e7)([Tv.Z],(function(){var t=Tv.Z.getActiveChannelsFetchStatus(e);return null!=t&&!t.loading}),[e]);o.useEffect((function(){r&&Ie.default.track(M.rMx.ACTIVE_CHANNELS_LOADED,{guild_id:e,text_channels_shown:t.length,voice_channels_shown:n.length,home_session_id:yv.Z.getHomeSessionId(e)})}),[e,r])}(t,a,f);var x=o.useCallback((function(e){Ie.default.track(M.rMx.ACTIVE_CHANNEL_CLICKED,{guild_id:e.guild_id,channel_id:e.id,channel_type:e.type,text_channels_shown:a.length,voice_channels_shown:f.length,home_session_id:yv.Z.getHomeSessionId(e.guild_id)})}),[a,f]),w=a.map((function(e){return(0,r.jsx)(Wv,{guildId:t,channel:e,trackChannelClick:x},e.id)})),D=f.map((function(e){return(0,r.jsx)(n_,{guildId:t,channel:e,
voiceStates:u[e.id],trackChannelClick:x,showPreview:!n},e.id)})),Z=[];if(n)Z=Z_(w).concat(Z_(D));else if(m)Z=za.compact([null!=l&&(0,r.jsx)(S_,{event:l,isInList:!0},"event")].concat(Z_(w.slice(0,10)),Z_(D)));else{var L=za.take(w,3-(D.length>0?1:0)-(null!=l?1:0)),U=za.take(D,3-L.length-(null!=l?1:0));Z=za.compact([null!=l&&(0,r.jsx)(S_,{event:l,isInList:!0},"event")].concat(Z_(L),Z_(U)))}return(0,r.jsx)("div",{ref:A,className:N_().container,children:(0,r.jsxs)(c.y5t,{component:(0,r.jsxs)("div",{className:N_().header,children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:Q.Z.Messages.ACTIVE_CHANNELS_HEADER}),!n&&!0!==(null==i?void 0:i.loading)&&d>3&&(0,r.jsx)(c.P3F,{onClick:function(){return b(!m)},children:(0,r.jsx)(c.xvT,{className:N_().showAll,variant:"text-sm/normal",children:m?Q.Z.Messages.GUILD_HOME_SEE_LESS:Q.Z.Messages.GUILD_HOME_SEE_ALL.format({count:d})})})]}),children:[(null==i?void 0:i.loading)?(0,r.jsx)(c.xVE,{className:N_().channelList,orientation:"horizontal",
paddingFix:!1,children:(0,r.jsx)(Fv,{guildId:t})}):p?(0,r.jsx)(G_,{isUsingCollapsedLayout:n,scrollerRef:h,handleScroll:P,activeChannels:Z,totalActiveChannels:d}):(0,r.jsx)(k_,{}),n&&p&&!O&&(0,r.jsx)(c.P3F,{className:lh()(N_().scrollIcon,N_().left),onClick:j,"aria-hidden":!0,children:(0,r.jsx)(Nv.Z,{direction:Nv.Z.Directions.LEFT,height:12,width:12})}),n&&p&&!I&&(0,r.jsx)(c.P3F,{className:lh()(N_().scrollIcon,N_().right),onClick:R,"aria-hidden":!0,children:(0,r.jsx)(Nv.Z,{direction:Nv.Z.Directions.RIGHT,height:12,width:12})})]})})}var H_=n(170892),V_=n(764334);function F_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Y_(e){Y_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Y_(e)}function z_(e,t){return!t||"object"!==K_(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}
function W_(e,t){W_=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return W_(e,t)}var K_=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function q_(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Y_(e);if(t){var o=Y_(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return z_(this,n)}}var X_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&W_(e,t)}(n,e);var t=q_(n);function n(){F_(this,n);return t.apply(this,arguments)}var r=n.prototype;r._initialize=function(){
O.Z.subscribe("MESSAGE_REACTION_ADD",this.handleReaction);O.Z.subscribe("MESSAGE_REACTION_REMOVE",this.handleReaction);O.Z.subscribe("SIDEBAR_VIEW_CHANNEL",this.handleSidebarViewChannel);O.Z.subscribe("MESSAGE_CREATE",this.handleMessageCreate);O.Z.subscribe("APP_STATE_UPDATE",this.handleAppStateUpdate)};r._terminate=function(){O.Z.unsubscribe("MESSAGE_REACTION_ADD",this.handleReaction);O.Z.unsubscribe("MESSAGE_REACTION_REMOVE",this.handleReaction);O.Z.unsubscribe("SIDEBAR_VIEW_CHANNEL",this.handleSidebarViewChannel);O.Z.unsubscribe("MESSAGE_CREATE",this.handleMessageCreate);O.Z.unsubscribe("APP_STATE_UPDATE",this.handleAppStateUpdate)};r.handleReaction=function(e){var t=e.type,n=e.userId,r=e.messageId,o=e.optimistic;if(n===Jn.default.getId()&&o){var i=P.Z.getGuildId();if(null!=i){var a=C.Z.getChannelId();if((0,Ig.ME)(a)){var s=Xb.ZP.getItemForMessageId(i,r);if(null!=s){var c=(0,H_.ZP)(s);(0,qb.wA)({feed_item_type:(0,V_.NH)(s.id),feed_item_id:s.id,load_id:Xb.ZP.getLoadId(i),
action_type:"MESSAGE_REACTION_ADD"===t?eO.w8.REACTION_ADDED:eO.w8.REACTION_REMOVED,guild_id:i,channel_id:c.channel_id,message_id:r,home_session_id:yv.Z.getHomeSessionId(i)})}}}}};r.handleSidebarViewChannel=function(e){var t=e.channelId,n=e.baseChannelId;if(e.sidebarType===lv.t.VIEW_THREAD&&(0,Ig.ME)(n)){var r=P.Z.getGuildId();if(null!=r){var o=Xb.ZP.getItemForMessageId(r,t);null!=o&&o.type!==dO.w.FORUM_POST&&(0,qb.wA)({feed_item_type:(0,V_.NH)(o.id),feed_item_id:o.id,load_id:Xb.ZP.getLoadId(r),action_type:eO.w8.THREAD_EMBED_CLICKED,guild_id:r,channel_id:(0,yO.xp)(o),message_id:t,home_session_id:yv.Z.getHomeSessionId(r)})}}};r.handleMessageCreate=function(e){var t=e.optimistic,n=e.message;if(t&&n.state===M.yb.SENDING){var r=P.Z.getGuildId();if(null!=r){var o=ap.ZP.getSidebarState(Ig.oC.GUILD_HOME);if(null!=o&&(0,ap.D5)(o)){var i=S.Z.getChannel(o.channelId),a=(0,yO.FW)(o,i);if(null!=a){var s=Xb.ZP.getItemForMessageId(r,a);if(null!=s){var c,l;if(n.type===M.uaV.DEFAULT){
c=eO.w8.MESSAGED_IN_SIDEBAR;l=a}else if(n.type===M.uaV.REPLY){var u,f;l=null===(u=n.message_reference)||void 0===u?void 0:u.message_id;c=(null===(f=n.message_reference)||void 0===f?void 0:f.message_id)===a?eO.w8.REPLIED_TO_MESSAGE:eO.w8.REPLIED_IN_SIDEBAR}null!=c&&(0,qb.wA)({feed_item_type:(0,V_.NH)(s.id),feed_item_id:s.id,load_id:Xb.ZP.getLoadId(r),action_type:c,guild_id:r,channel_id:n.channel_id,message_id:l,home_session_id:yv.Z.getHomeSessionId(r)})}}}}}};r.handleAppStateUpdate=function(e){if("background"===e.state){var t=P.Z.getGuildId();null!=t&&Ie.default.track(M.rMx.HOME_BACKGROUNDED,{guild_id:t,home_session_id:yv.Z.getHomeSessionId(t),load_id:Xb.ZP.getLoadId(t)})}};r.__getLocalVars=function(){return{}};return n}(_.Z);const Q_=new X_;var $_=n(151154),J_=n(146358),eI=n(809784);function tI(e,t,n){for(var r=n.feedItemId,o=n.guildId,i=n.channelId,a=n.messageId,s=e.target;(0,eI.k)(s);){var c,l;if(s===t)break
;var u=null!==(l=null===(c=s.getAttribute("data-role"))||void 0===c?void 0:c.toUpperCase())&&void 0!==l?l:s.tagName;if("A"===u){(0,qb.wA)({feed_item_type:(0,V_.NH)(r),feed_item_id:r,load_id:Xb.ZP.getLoadId(o),action_type:eO.w8.LINK_CLICKED,guild_id:o,channel_id:i,message_id:a,home_session_id:yv.Z.getHomeSessionId(o)});return!0}if("IMG"===u){(0,qb.wA)({feed_item_type:(0,V_.NH)(r),feed_item_id:r,load_id:Xb.ZP.getLoadId(o),action_type:eO.w8.IMAGE_CLICKED,guild_id:o,channel_id:i,message_id:a,home_session_id:yv.Z.getHomeSessionId(o)});return!0}if("BUTTON"===u||"button"===s.getAttribute("role")){var f=eO.w8.BUTTON_CLICKED;if("view-more-replies"===s.getAttribute("data-action"))f=eO.w8.VIEW_MORE_REPLIES;(0,qb.wA)({feed_item_type:(0,V_.NH)(r),feed_item_id:r,load_id:Xb.ZP.getLoadId(o),action_type:f,guild_id:o,channel_id:i,message_id:a,home_session_id:yv.Z.getHomeSessionId(o)});return!0}s=s.parentNode}return!1}function nI(e){
var t=e.guildId,n=e.channelId,r=e.feedItemId,o=e.onChannelClick,i=e.onContentClick,a=function(e,o){e.stopPropagation();var a=Xb.ZP.getItem(t,r);if(null!=a){var s;(0,qb.wA)({feed_item_type:(0,V_.NH)(r),feed_item_id:r,load_id:Xb.ZP.getLoadId(t),action_type:eO.w8.MESSAGE_CLICKED,guild_id:t,channel_id:n,message_id:null!==(s=null==o?void 0:o.id)&&void 0!==s?s:(0,H_.ZP)(a).id,home_session_id:yv.Z.getHomeSessionId(t)});i(o)}};return{handleMessageClick:function(e,o,i){e.stopPropagation();tI(e,o,{feedItemId:r,guildId:t,channelId:n,messageId:i.id})||a(e,i)},handleChannelClick:function(e){e.stopPropagation();(0,qb.wA)({feed_item_type:(0,V_.NH)(r),feed_item_id:r,load_id:Xb.ZP.getLoadId(t),action_type:eO.w8.MESSAGE_CHANNEL_CLICKED,guild_id:t,channel_id:n,home_session_id:yv.Z.getHomeSessionId(t)});o()},handleCardClick:function(e,o){tI(e,o,{feedItemId:r,guildId:t,channelId:n})||a(e)},handleItemClick:a}}
var rI=n(550131),oI=n(834876),iI=n(62994),aI=n(855395),sI=n(96812),cI=n(283285),lI=n(277600),uI=n(723876),fI=n(824803),dI=n(42028),pI=n(377557),hI=n.n(pI);function EI(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function yI(e){var t=e.message,n=e.guildId,i=e.animateAvatar,a=e.channel,s=e.author,l=(0,sI.Z)(t.id,Fg.d$),u=l.popouts,f=l.setPopout,d=u.usernameProfile,p=u.avatarProfile,h=o.useMemo((function(){return function(e){return(0,iI.Z)(e,t)}}),[t]),E=(0,aI.wq)(t.author.id,a.id),y=(0,aI.XO)(t,a,d,f),m=(0,aI.R9)(p,f),b=o.useCallback((function(){return f({usernameProfile:!1,avatarProfile:!1,referencedUsernameProfile:!1})}),[f]),g=(0,fI.F2)({props:{message:t,channel:a,author:s,guildId:n,compact:!0,displayCompactAvatars:!0,animate:i,showAvatarPopout:p,showUsernamePopout:d,onContextMenu:E,onClickUsername:y,onClickAvatar:m,onPopoutRequestClose:b},guildId:n,handleRenderPopout:h,className:hI().avatar}),O=(0,fI.xP)(e,h),v=(0,
oI.XX)(t),_=(0,oI.Dv)(t),I="".concat(v," ").concat(_),S=(0,oI.Gq)(t);return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(c.H,{className:hI().header,"aria-describedby":S,"aria-labelledby":I,children:[g,(0,r.jsx)("span",{id:(0,oI.XX)(t),className:hI().username,children:(0,r.jsx)(r.Fragment,{children:O})}),(0,r.jsx)(dI.Z,{id:(0,oI.Dv)(t),timestamp:t.timestamp,className:hI().timestamp})]})})}var mI=o.forwardRef((function(e,t){var n=e.message,i=e.className,a=e.onMessageClick,s=e.children,l=e.isTruncated,u=e.channel,f=e.guildId,d=e.animateAvatar,p=o.useRef(null),h=(0,cI.Z)(n,{hideSimpleEmbedContent:!0}),E=h.content,y=h.hasSpoilerEmbeds,m=(0,rI.ZP)(n),b=o.useCallback((function(e){a(e,p.current,n)}),[a,n]);return(0,r.jsxs)("div",{ref:p,className:i,onClick:b,role:"article",children:[(0,r.jsx)(c.tEY,{offset:{left:4,right:4},children:(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(yI,{author:m,message:n,channel:u,guildId:f,animateAvatar:d}),(0,r.jsx)(uI.ZP,{
className:lh()(hI().messageContent,EI({},hI().truncatedReply,l)),message:n,content:E,contentRef:t})]}),(0,lI.Z)({className:hI().accessories,channelMessageProps:e,hasSpoilerEmbeds:y,isInteracting:!1})]})}),s]})})),bI=n(720504),gI=n(677483),OI=n(754242),vI=n(384157),_I=n.n(vI),II=n(635232),SI=n.n(II),TI=n(312154),NI=n.n(TI),AI=n(22513),CI=n.n(AI),PI=n(515861),jI=n.n(PI),RI=n(568909),xI=n.n(RI),MI=n(531239),wI=n.n(MI),DI=n(302048),ZI=n.n(DI),LI=n(180263),UI=n.n(LI),kI=n(677291),GI=n.n(kI),BI=n(864678),HI=n.n(BI),VI=n(367627),FI=n.n(VI),YI=n(874744),zI=n.n(YI),WI=n(101872),KI=n.n(WI),qI=n(46802),XI=n.n(qI),QI=n(726954),$I=n.n(QI),JI=n(897295),eS=n.n(JI);function tS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{
for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return tS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var rS=[{light:XI(),dark:KI(),selected:$I(),value:OI.Pq.TERRIBLE,altDescription:function(){return Q.Z.Messages.GUILD_FEED_FEEDBACK_RATING_TERRIBLE},description:function(){return Q.Z.Messages.GUILD_FEED_FEEDBACK_RATING_TERRIBLE}},{light:NI(),dark:SI(),selected:CI(),value:OI.Pq.BAD,altDescription:function(){
return Q.Z.Messages.GUILD_FEED_FEEDBACK_RATING_BAD}},{light:FI(),dark:HI(),selected:zI(),value:OI.Pq.OKAY,altDescription:function(){return Q.Z.Messages.GUILD_FEED_FEEDBACK_RATING_OKAY}},{light:UI(),dark:ZI(),selected:GI(),value:OI.Pq.GOOD,altDescription:function(){return Q.Z.Messages.GUILD_FEED_FEEDBACK_RATING_GOOD}},{light:xI(),dark:jI(),selected:wI(),value:OI.Pq.EXCELLENT,altDescription:function(){return Q.Z.Messages.GUILD_FEED_FEEDBACK_RATING_EXCELLENT},description:function(){return Q.Z.Messages.GUILD_FEED_FEEDBACK_RATING_EXCELLENT}}];function oS(e){var t=e.defaultSrc,n=e.selectedSrc,i=e.selected,a=e.disableAnimation,s=e.alt,c=nS((0,mm.useSpring)((function(){return{from:{opacity:1},config:{duration:a?0:OI.$D}}}),[i,a]),2),l=c[0],u=c[1],f=nS((0,mm.useSpring)((function(){return{from:{opacity:0},config:{duration:a?0:OI.$D}}}),[i,a]),2),d=f[0],p=f[1];o.useEffect((function(){if(i){u({opacity:0});p({opacity:1})}else{u({opacity:1});p({opacity:0})}}),[i,a,u,p]);return(0,r.jsxs)(r.Fragment,{
children:[(0,r.jsx)(mm.animated.img,{style:{opacity:d.opacity},src:n,width:40,height:40,alt:s}),(0,r.jsx)(mm.animated.img,{className:_I().ratingInner,style:{opacity:l.opacity},src:t,width:40,height:40,alt:s})]})}function iS(e){var t=e.selectedRating,n=e.setSelectedRating,o=e.disableAnimation,i=(0,Jb.ZP)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:Q.Z.Messages.GUILD_FEED_FEEDBACK_SECTION_1_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:Q.Z.Messages.GUILD_FEED_FEEDBACK_SECTION_1_SUBTITLE}),(0,r.jsx)("div",{className:_I().ratingsContainer,children:rS.map((function(e){return(0,r.jsxs)("div",{className:_I().ratingContainer,children:[(0,r.jsx)(c.P3F,{className:_I().rating,onClick:function(){n(e.value)},children:(0,r.jsx)(oS,{defaultSrc:i===hc.BR.DARK?e.dark:e.light,selectedSrc:e.selected,selected:t===e.value,alt:e.altDescription(),disableAnimation:o})}),null!=e.description?(0,r.jsx)(c.xvT,{variant:"text-xs/normal",
children:e.altDescription()}):null]},e.value)}))})]})}function aS(e){var t,n=e.selectedRating,o=e.selectedReasons,i=e.onSelectedReasons,a=e.onUserFeedbackChanged,s=e.onSubmitPressed,l=e.canSubmit;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:Q.Z.Messages.GUILD_FEED_FEEDBACK_SECTION_2_TITLE.format({rating:n.toLowerCase()})}),(0,r.jsx)("div",{className:_I().pillContainer,children:(null!==(t=OI.gq[n])&&void 0!==t?t:[]).map((function(e){return(0,r.jsx)(c.P3F,{onClick:function(){return i(e)},className:lh()(_I().pill,o.has(e)?_I().pillSelected:null),children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:(0,bI.i1)(e)})},e)}))}),o.has(OI.Jh.OTHER)?(0,r.jsx)(c.oil,{autoFocus:!0,className:_I().textInput,onChange:a,placeholder:Q.Z.Messages.GUILD_FEED_FEEDBACK_OTHER_PLACEHOLDER}):null,(0,r.jsx)(c.zxk,{className:_I().button,disabled:!l,onClick:s,children:Q.Z.Messages.SUBMIT})]})}function sS(){return(0,r.jsxs)("div",{children:[(0,r.jsx)("img",{
src:eS(),width:75,height:75,alt:""}),(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:Q.Z.Messages.GUILD_FEED_FEEDBACK_SECTION_3_TITLE})]})}function cS(e){var t,n,o=(0,bI.IT)(e),i=o.selectedRating,a=o.setSelectedRating,s=o.selectedReasons,l=o.setSelectedReasons,u=o.setUserFeedback,f=o.backPressed,d=o.onSubmitPressed,p=o.onBackPressed,h=o.onClosePressed,E=o.showSubmitted,y=o.canSubmit,m=o.isAnimating,b=o.useReducedMotion;if(E){n=!1;t=(0,r.jsx)(sS,{})}else if(null==i||f||m){n=!1;t=(0,r.jsx)(iS,{disableAnimation:f||b,selectedRating:i,setSelectedRating:a})}else{n=!0;t=(0,r.jsx)(aS,{selectedRating:i,selectedReasons:s,onSelectedReasons:l,onUserFeedbackChanged:u,onBackPressed:p,onSubmitPressed:d,canSubmit:y})}return(0,r.jsx)("div",{className:_I().parentContainer,onClick:function(e){return e.stopPropagation()},children:(0,r.jsxs)("div",{className:lh()(_I().container,_I().containerDivider),children:[t,n?(0,r.jsx)(c.P3F,{className:lh()(_I().icon,_I().back),onClick:p,children:(0,
r.jsx)(gI.Z,{direction:gI.Z.Directions.LEFT})}):null,(0,r.jsx)(c.P3F,{className:lh()(_I().icon,_I().close),onClick:h,children:(0,r.jsx)(Ub.Z,{})})]})})}var lS=n(101318),uS=n(968501),fS=n.n(uS);function dS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pS(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function hS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){pS(e,t,n[t])}))}return e}function ES(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e)
;t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function yS(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function mS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}
}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return dS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const bS=o.forwardRef((function(e,t){var n=e.className,i=e.children,a=e.ariaLabel,s=e.onContextMenu,l=e.onCardClick,u=e.onItemClick,f=e.listItemProps,d=e.itemId,p=e.selected,h=yS(e,["className","children","ariaLabel","onContextMenu","onCardClick","onItemClick","listItemProps","itemId","selected"]),E=mS((0,lS.Z)(t),2),y=E[0],m=E[1],b=o.useRef(null);return(0,r.jsxs)("div",ES(hS({ref:m,className:lh()(fS().card,fS().interactiveCard,pS({},fS().selected,p),n),"data-item-id":d,onContextMenu:s,
onClick:function(e){return null==l?void 0:l(e,y.current)}},h),{children:[(0,r.jsx)(c.P3F,hS({className:fS().clickableTarget,innerRef:b,"aria-label":a,onClick:u},f)),i]}))}));var gS=n(864997),OS=n.n(gS);function vS(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function _S(e){var t=e.children,n=e.hideBorder;return(0,r.jsx)("div",{className:lh()(OS().feedItemHeader,vS({},OS().hideBorder,n)),children:t})}var IS=n(186440),SS=n(942450),TS=n.n(SS);function NS(e){e.stopPropagation()}function AS(e){var t=e.onContextMenu,n=Q.Z.Messages.MORE;return(0,r.jsx)("div",{onClick:NS,onContextMenu:NS,children:(0,r.jsx)(c.ua7,{text:n,hideOnClick:!0,children:function(e){var o=e.onMouseEnter,i=e.onMouseLeave,a=e.onClick;return(0,r.jsx)(c.zxk,{onMouseEnter:o,onMouseLeave:i,look:c.zxk.Looks.BLANK,size:c.zxk.Sizes.NONE,onClick:function(e){null==a||a();t(e)},"aria-label":n,className:TS().overflowButton,children:(0,r.jsx)(IS.Z,{className:TS().icon})})
}})})}function CS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function PS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return CS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return CS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}
function jS(e,t){var n=PS(o.useState(!1),2),r=n[0],i=n[1];return[r,o.useCallback((function(n,r){n.stopPropagation();i(!0);(0,qb.wA)({feed_item_type:(0,V_.NH)(t),feed_item_id:t,load_id:Xb.ZP.getLoadId(e),action_type:eO.w8.EXPANDED_ITEM,guild_id:e,channel_id:r.channel_id,message_id:r.id,home_session_id:yv.Z.getHomeSessionId(e)})}),[e,t])]}var RS=n(4361),xS=n(837162),MS=n(791707),wS=n(566591),DS=n(649252),ZS=n(714357),LS=n(508754),US=n(699209),kS=n.n(US),GS=n(13489),BS=n.n(GS);function HS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function VS(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function FS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))))
;r.forEach((function(t){VS(e,t,n[t])}))}return e}function YS(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function zS(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function WS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){
var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return HS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return HS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var KS=o.memo((function(e){var t=e.message,n=e.channel,i=e.animateAvatar,a=e.repliedMessage,s=(0,sI.Z)(t.id,Fg.d$),c=s.popouts,l=s.setPopout,u=c.usernameProfile,f=c.avatarProfile,d=(0,
aI.wq)(t.author.id,n.id),p=(0,aI.XO)(t,n,u,l),h=(0,aI.R9)(f,l),E=o.useCallback((function(){return l({usernameProfile:!1,avatarProfile:!1,referencedUsernameProfile:!1})}),[l]),y=(0,rI.ZP)(t),m=(0,xS.p9)({guildId:n.guild_id,roleId:y.iconRoleId});return(0,r.jsx)(fI.ZP,{guildId:n.guild_id,message:t,channel:n,repliedMessage:a,author:y,showTimestampOnHover:t.type!==M.uaV.REPLY,renderPopout:iI.Z,showAvatarPopout:f,showUsernamePopout:u,onClickAvatar:h,onClickUsername:p,onPopoutRequestClose:E,onContextMenu:d,roleIcon:m,animate:i})})),qS=o.forwardRef((function(e,t){var n=e.guildId,i=e.channel,a=e.message,l=e.feedItemId,u=e.className,f=e.animateAvatar,d=e.contentClassName,p=e.children,h=e.groupId,E=e.onMessageClick,y=e.hideHeader,m=void 0!==y&&y,b=e.forceAddReactions,g=void 0===b||b,O=zS(e,["guildId","channel","message","feedItemId","className","animateAvatar","contentClassName","children","groupId","onMessageClick","hideHeader","forceAddReactions"]),v=o.useRef(null),_=(0,s.e7)([S.Z],(function(){
return S.Z.getChannel(i.id)})),I=null!=_&&a.isFirstMessageInForumPost(_),T=(0,RS.dj)(a.id),N=(0,RS.tu)(n,a.id),A=T||N,C=(0,cI.Z)(a,{hideSimpleEmbedContent:!0,allowList:I||A,allowHeading:I||A,allowLinks:A,previewLinkTarget:A}),P=C.content,j=C.hasSpoilerEmbeds,R=a.type===M.uaV.REPLY?a.messageReference:void 0,x=(0,s.e7)([ip.Z],(function(){return ip.Z.getMessageByReference(R)})),w=(0,s.e7)([S.Z],(function(){return a.hasFlag(M.iLy.HAS_THREAD)&&S.Z.getChannel(a.id)})),D=(0,oI.iG)(a,h,{hasTimestamp:a.id===h}),Z=(0,oI.Gx)(a),L=null!=R?(0,r.jsx)(c.P3F,{onClick:function(e){if(null!=x.message){e.stopPropagation();(0,qb.wA)({feed_item_type:(0,V_.NH)(l),feed_item_id:l,load_id:Xb.ZP.getLoadId(n),action_type:eO.w8.REFERENCED_MESSAGE_CLICKED,guild_id:n,channel_id:i.id,message_id:a.id,home_session_id:yv.Z.getHomeSessionId(n)});cd.Z.openChannelAsSidebar({guildId:i.guild_id,channelId:i.id,baseChannelId:Ig.oC.GUILD_HOME,details:{type:lv.F.HOME,initialMessageId:x.message.id}})}},children:(0,
ZS.Z)(a,i,R,x,!1)}):null,U=(0,MS.Z)(a),k=o.useCallback((function(e){E(e,v.current,a)}),[E,a]);return(0,r.jsx)(LS.Z,FS({messageRef:v,className:lh()(u,VS({},BS().mentioned,a.mentioned&&!(0,MS.Z)(a))),onClick:k,childrenRepliedMessage:L,childrenExecutedCommand:(0,DS.Z)(a,i,!1),childrenHeader:U||m?null:(0,r.jsx)(KS,{channel:i,message:a,animateAvatar:f,repliedMessage:x}),childrenAccessories:(0,lI.Z)({channelMessageProps:e,hasSpoilerEmbeds:j,isInteracting:!1,forceAddReactions:g}),childrenMessageContent:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(uI.ZP,{className:d,message:a,content:P,contentRef:t}),p]}),childrenSystemMessage:(0,wS.Z)(e),hasThread:null!=w&&a.hasFlag(M.iLy.HAS_THREAD),hasReply:a.type===M.uaV.REPLY,isSystemMessage:U,"aria-labelledby":D,"aria-describedby":Z},O))}));function XS(e){var t,n=e.message,i=e.guildId,a=e.feedItemId,s=e.disableTruncation,l=n.attachments.length>0,u=WS(o.useState(!1),2),f=u[0],d=u[1],p=WS(jS(i,a),2),h=p[0],E=p[1];return(0,r.jsx)(qS,YS(FS({ref:function(e){
null==e||s||d(e.scrollHeight>e.clientHeight)},contentClassName:lh()((t={},VS(t,kS().clampLarge,!s&&!h&&!l),VS(t,kS().clampSmall,!s&&!h&&l),t))},e),{children:f&&!h?(0,r.jsx)(c.P3F,{className:kS().showMore,onClick:function(e){return E(e,n)},"aria-hidden":!0,children:Q.Z.Messages.GUILD_FEED_TRUNCATED_MESSAGE_SEE_MORE}):null}))}const QS=o.memo(XS);function $S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function JS(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function eT(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function tT(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return $S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $S(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nT(e){
var t=e.guildId,n=e.feedItemId,i=e.messages,a=o.useRef([]),s=i.some((function(e){return e.attachments.length>0}))?4:8,l=tT(o.useState(),2),u=l[0],f=l[1],d=tT(o.useState(),2),p=d[0],h=d[1],E=tT(jS(t,n),2),y=E[0],m=E[1];o.useLayoutEffect((function(){var e=0,t=!0,n=!1,r=void 0;try{for(var o,i=a.current.entries()[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var c=tT(o.value,2),l=c[0],u=c[1];if(null!=u){var d,p=parseFloat(null!==(d=window.getComputedStyle(u).getPropertyValue("line-height"))&&void 0!==d?d:"0"),E=u.scrollHeight/p;if((e+=E)>s){f(l);h(E-(e-s));break}}}}catch(e){n=!0;r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}),[i,s]);if(0===i.length)return null;var b=i[0].id;return(0,r.jsx)(r.Fragment,{children:i.map((function(t,n){if(null!=u&&n>u&&!y)return null;var o=u===n,s=o&&null!=p?function(e){if(e>=10)return kS().clampLarge;if(e>=4&&e<10)return kS().clampMed;if(e<4)return kS().clampSmall;return}(p):null,l=o&&null!=s&&!y;return(0,r.jsx)(qS,eT(function(e){
for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){JS(e,t,n[t])}))}return e}({message:t,groupId:b},e),{contentClassName:l?s:void 0,children:l?(0,r.jsx)(c.P3F,{className:kS().showMore,onClick:function(e){return m(e,t)},"aria-hidden":!0,children:Q.Z.Messages.GUILD_FEED_TRUNCATED_MESSAGE_SEE_MORE}):null,ref:function(e){return a.current[n]=e},hideHeader:0!==n,forceAddReactions:n===i.length-1}),t.id)}))})}const rT=o.memo(nT);var oT=n(39775),iT=n.n(oT);function aT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sT(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function cT(e){return function(){var t=this,n=arguments
;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){sT(i,r,o,a,s,"next",e)}function s(e){sT(i,r,o,a,s,"throw",e)}a(void 0)}))}}function lT(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function uT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){lT(e,t,n[t])}))}return e}function fT(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function dT(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return aT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return aT(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var pT=function(e,t){var n,r,o,i,a={label:0,
sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{
value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},hT=function(){var e=cT((function(){var e;return pT(this,(function(t){switch(t.label){case 0:return[4,n.e(87485).then(n.bind(n,187485))];case 1:e=t.sent();return[2,e.default]}}))}));return function(){return e.apply(this,arguments)}}();function ET(e){var t=e.item,n=e.referenceMessageBundles,i=e.channel,a=e.guildId,s=e.animateAvatar,l=e.onMessageClick,u=o.useCallback((function(){var e,r,o=n[n.length-2+1];cd.Z.openChannelAsSidebar({guildId:a,channelId:i.id,baseChannelId:Ig.oC.GUILD_HOME,flash:!1,details:{type:lv.F.HOME,initialMessageId:null!==(r=null==o||null===(e=o[0])||void 0===e?void 0:e.id)&&void 0!==r?r:n[0][0].id,highlightMessageIds:new Set((0,H_.bE)(t))}})}),[t,i,a,n]);return(0,r.jsxs)("div",{className:iT().conversationArea,children:[n.slice(0,2).map((function(e,t){var o=e[0];return null==o?null:(0,r.jsx)(mI,{className:lh()(iT().conversationMessage,lT({},iT().mentioned,o.mentioned)),guildId:a,channel:i,message:o,onMessageClick:l,
isTruncated:e.length>1,animateAvatar:s,children:t!==n.length-1&&(0,r.jsx)("div",{className:iT().replySpine})},o.id)})),n.length>2&&(0,r.jsx)("div",{className:lh()(iT().conversationMessage,iT().viewMoreReplies),children:(0,r.jsx)(c.P3F,{onClick:u,"data-action":"view-more-replies",children:Q.Z.Messages.GUILD_FEED_TRUNCATED_REPLIES_VIEW_MORE.format({count:n.length-2})})},"view-more")]})}const yT=o.forwardRef((function(e,t){var n,i,a=e.guildId,l=e.conversationItem,u=e.showFeedback,f=e.setOnDismissedFeedback,d=l.root,p=d.messages,h=d.children,E=p[0],y=p[p.length-1],m=y.channel_id,b=(0,s.Wu)([Xb.ZP],(function(){return p.map((function(e){return Xb.ZP.getCachedMessage(a,m,e.id)})).filter(_o.lm)}),[a,m,p]),g=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(m)})),O=(0,EO.KS)(g,void 0,{textFocused:!0}),v=(0,EO.bT)(g),_=(0,op.ZP)(g),I=dT(o.useState(!1),2),T=I[0],N=I[1],A=(0,s.e7)([Ja.Z],(function(){return null!=y&&Ja.Z.isBlocked(y.author.id)})),C=(0,
pb.JA)(null!==(i=null===(n=b[b.length-1])||void 0===n?void 0:n.id)&&void 0!==i?i:l.id),P=l.id,j=(0,s.e7)([ap.ZP],(function(){return ap.ZP.getSidebarState(Ig.oC.GUILD_HOME)})),R=(0,yO.FW)(j,g),x=null!=R&&E.id===R,w=nI({guildId:a,channelId:m,feedItemId:P,onChannelClick:function(){return(0,Yv.Z)(M.Z5c.CHANNEL(a,m,E.id))},onContentClick:function(e){var t;cd.Z.openChannelAsSidebar({guildId:a,channelId:m,baseChannelId:Ig.oC.GUILD_HOME,flash:!1,details:{type:lv.F.HOME,initialMessageId:null!==(t=null==e?void 0:e.id)&&void 0!==t?t:E.id,highlightMessageIds:new Set((0,H_.bE)(l))}})}}),D=w.handleItemClick,Z=w.handleChannelClick,L=w.handleCardClick,U=w.handleMessageClick,k=(0,s.e7)([Xb.ZP],(function(){return null==g?[]:h.map((function(e){return e.messages.map((function(e){return Xb.ZP.getCachedMessage(a,g.id,e.id)})).filter(_o.lm)})).filter((function(e){return 0!==e.length}))}),[a,g,h],mO);if(null==g||null==E||null==y||A)return null;var G,B=function(e){e.stopPropagation();(0,
Ob.jW)(e,cT((function(){var e;return pT(this,(function(t){switch(t.label){case 0:return[4,hT()];case 1:e=t.sent();return[2,function(t){return(0,r.jsx)(e,fT(uT({},t),{item:l,channel:g}))}]}}))})))};return(0,r.jsxs)(bS,{className:u?iT().containerNoPadding:iT().container,ref:t,selected:x,onCardClick:L,onItemClick:D,onContextMenu:B,itemId:P,ariaLabel:Q.Z.Messages.GUILD_FEED_MESSAGE_ITEM_A11Y_LABEL.format({channelName:_}),listItemProps:C,onMouseEnter:function(){return N(!0)},onMouseLeave:function(){return N(!1)},children:[(0,r.jsxs)(c.y5t,{component:(0,r.jsxs)(_S,{children:[(0,r.jsx)("div",{className:iT().messageHeaderMenuLeft,children:(0,r.jsxs)(c.P3F,{className:iT().channelNameContainer,onClick:Z,children:[null!=O?(0,r.jsx)(c.ua7,{text:v,delay:500,children:function(e){return(0,r.jsx)(O,fT(uT({},e),{className:iT().channelIcon,height:16,width:16}))}}):null,(0,r.jsx)(c.X6q,{lineClamp:1,variant:"heading-sm/semibold",children:_})]})}),(0,r.jsx)("div",{className:iT().messageHeaderMenuRight,
children:(0,r.jsx)(AS,{feedItem:l,guildId:a,onContextMenu:B})})]}),children:[(0,r.jsx)("div",{className:lh()(iT().messageBundleItemBody,(G={},lT(G,iT().conversationRoot,k.length>0),lT(G,iT().hasReply,E.type===M.uaV.REPLY),G)),children:(0,r.jsx)(rT,{feedItemId:l.id,guildId:a,channel:g,messages:b,animateAvatar:T,onMessageClick:U})}),(0,r.jsx)(ET,{item:l,channel:g,guildId:a,referenceMessageBundles:k,onMessageClick:U,animateAvatar:T})]}),u&&(0,r.jsx)(cS,{guildId:a,guildFeedItem:l,setOnDismissFeedback:f})]})}));var mT=n(708313),bT=n(749131),gT=n(310246),OT=n(773148),vT=n(548028),_T=n.n(vT);function IT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ST(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}
}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return IT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IT(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function TT(e){var t=e.guildId,n=e.feedItem,o=e.onSendFeedback,i=(0,H_.ZP)(n),a=i.channel_id,l=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(a)})),u=(0,op.ZP)(l),f=(0,EO.KS)(l),d=(0,s.e7)([Y.default],(function(){return Y.default.getUser(i.author.id)})),p=(0,s.e7)([S.Z,qa.ZP,Ja.Z],(function(){return OT.Z.getName(t,a,d)})),h=function(e){(0,qb.Jm)(t,e);o()};return(0,r.jsxs)("div",{className:_T().options,
children:[(0,r.jsx)(c.P3F,{className:_T().option,onClick:function(){return h({channel_id:a,message_id:i.id,entity_type:mT.C.MESSAGE})},children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"interactive-active",children:Q.Z.Messages.GUILD_FEED_HIDDEN_MESSAGE_FEEDBACK_NO_LIKE})}),(0,r.jsx)(c.P3F,{className:_T().option,onClick:function(){return h({channel_id:a,entity_type:mT.C.CHANNEL})},children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"interactive-active",children:Q.Z.Messages.GUILD_FEED_HIDDEN_MESSAGE_FEEDBACK_SHOW_LESS_CHANNEL.format({channelName:u,channelNameHook:function(e,t){return(0,r.jsxs)("span",{children:[null!=f&&(0,r.jsx)(f,{className:_T().mentionIcon,width:20,height:20})," ",e]},t)}})})}),(0,r.jsx)(c.P3F,{className:_T().option,onClick:function(){var e;return h({user_id:null==i||null===(e=i.author)||void 0===e?void 0:e.id,entity_type:mT.C.USER})},children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"interactive-active",
children:Q.Z.Messages.GUILD_FEED_HIDDEN_MESSAGE_FEEDBACK_SHOW_LESS_USER.format({username:p,usernameHook:function(e,t){return(0,r.jsxs)("span",{children:[(0,r.jsx)(bT.Z,{className:_T().mentionIcon,width:20,height:20})," ",e]},t)}})})})]})}function NT(e){var t=e.guildId,n=e.feedItem,i=ST(o.useState(!1),2),a=i[0],s=i[1],l=(0,pb.JA)(n.id);return(0,r.jsxs)(bS,{ariaLabel:Q.Z.Messages.GUILD_FEED_HIDDEN_MESSAGE_ITEM,listItemProps:l,children:[(0,r.jsxs)(_S,{hideBorder:a,children:[(0,r.jsx)(gT.Z,{className:_T().icon,width:16,height:16,foregroundColor:"currentColor"}),a?(0,r.jsxs)("div",{className:_T().title,children:[(0,r.jsx)(c.xvT,{className:_T().title,variant:"text-md/medium",color:"interactive-active",children:Q.Z.Messages.GUILD_FEED_HIDDEN_MESSAGE_ITEM_FEEDBACK_RECEIVED_TITLE}),(0,r.jsx)(c.xvT,{className:_T().title,variant:"text-xs/medium",color:"interactive-normal",children:Q.Z.Messages.GUILD_FEED_HIDDEN_MESSAGE_ITEM_FEEDBACK_RECEIVED_SUBTITLE})]}):(0,r.jsx)(c.xvT,{className:_T().title,
variant:"text-md/medium",color:"interactive-active",children:Q.Z.Messages.GUILD_FEED_HIDDEN_MESSAGE_ITEM}),(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,color:c.zxk.Colors.PRIMARY,onClick:function(){(0,qb.L0)(n,t)},children:Q.Z.Messages.UNDO})]}),!a&&(0,r.jsx)(TT,{guildId:t,feedItem:n,onSendFeedback:function(){return s(!0)}})]})}var AT=n(469140),CT=n.n(AT);function PT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jT(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function RT(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){jT(i,r,o,a,s,"next",e)}function s(e){jT(i,r,o,a,s,"throw",e)}a(void 0)}))}}function xT(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function MT(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){xT(e,t,n[t])}))}return e}function wT(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function DT(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){
i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return PT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PT(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ZT=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,
r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},LT=function(){var e=RT((function(){var e;return ZT(this,(function(t){switch(t.label){case 0:return[4,n.e(1025).then(n.bind(n,101025))];case 1:e=t.sent();return[2,e.default]}}))}));return function(){return e.apply(this,arguments)}}();function UT(e){
var t=e.guildId,n=e.maxUsers,o=e.users,i=e.text;return(0,r.jsxs)("div",{className:CT().referenceMessagesText,children:[(0,r.jsx)(Rv.Z,{guildId:t,users:o,size:Rv.u.SIZE_16,className:CT().userSummaryItem,max:n,showDefaultAvatarsForNullUsers:!0}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"header-secondary",children:i})]})}function kT(e){var t=e.referenceMessages,n=e.guildId,i=o.useMemo((function(){var e=new Set;return t.map((function(e){return e.author})).filter((function(t){if(null==t||e.has(t.id))return!1;e.add(t.id);return!0})).slice(0,3)}),[t]),a=t.length;if(0===a)return null;var s=a>3?Q.Z.Messages.GUILD_FEED_MESSAGE_ITEM_MAX_REPLIES.format({maxReplies:3}):Q.Z.Messages.GUILD_FEED_MESSAGE_ITEM_NUM_REPLIES.format({numReplies:a});return(0,r.jsx)(UT,{guildId:n,users:i,text:s})}const GT=o.forwardRef((function(e,t){var n,i,a=e.guildId,l=e.messageItem,u=e.showFeedback,f=e.setOnDismissedFeedback,d=l.message.channel_id,p=l.message.id,h=(0,s.cj)([Xb.ZP],(function(){
var e=Xb.ZP.getCachedMessage(a,d,p);return{message:e,isFeaturedMessage:null!=e&&Xb.ZP.getIsItemFeatured({guildId:a,entity:e,entityType:dO.w.MESSAGE})}}),[a,d,p]),E=h.message,y=h.isFeaturedMessage,m=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(d)})),b=(0,EO.KS)(m,void 0,{textFocused:!0}),g=(0,EO.bT)(m),O=null!==(n=null==l?void 0:l.referenceMessages)&&void 0!==n?n:[],v=(0,op.ZP)(m),_=DT(o.useState(!1),2),I=_[0],T=_[1],N=(0,s.e7)([Ja.Z],(function(){return null!=E&&Ja.Z.isBlocked(null==E?void 0:E.author.id)})),A=(0,pb.JA)(null!==(i=null==E?void 0:E.id)&&void 0!==i?i:p),C=(0,V_.ZP)(l),P=(0,s.e7)([ap.ZP],(function(){return ap.ZP.getSidebarState(Ig.oC.GUILD_HOME)})),j=(0,yO.FW)(P,m),R=null!=j&&l.message.id===j,x=l.highlighted?Q.Z.Messages.GUILD_FEED_SPECIAL_HIGHLIGHT:y?Q.Z.Messages.GUILD_FEED_FEATURED_BY_MODERATORS:null,w=nI({guildId:a,channelId:d,feedItemId:C,onChannelClick:function(){return(0,Yv.Z)(M.Z5c.CHANNEL(a,d,p))},onContentClick:function(){cd.Z.openChannelAsSidebar({guildId:a,
channelId:d,baseChannelId:Ig.oC.GUILD_HOME,details:{type:lv.F.HOME,initialMessageId:p,highlightMessageIds:new Set([p])}})}}),D=w.handleItemClick,Z=w.handleChannelClick,L=w.handleCardClick,U=w.handleMessageClick;if(null==m||null==E||null==l||N)return null;var k=function(e){e.stopPropagation();(0,Ob.jW)(e,RT((function(){var e;return ZT(this,(function(t){switch(t.label){case 0:return[4,LT()];case 1:e=t.sent();return[2,function(t){return(0,r.jsx)(e,wT(MT({},t),{messageItem:l,channel:m,message:E}))}]}}))})))};return(0,r.jsxs)(bS,{className:u?CT().containerNoPadding:CT().container,ref:t,selected:R,onCardClick:L,onItemClick:D,onContextMenu:k,itemId:C,ariaLabel:Q.Z.Messages.GUILD_FEED_MESSAGE_ITEM_A11Y_LABEL.format({channelName:v}),listItemProps:A,onMouseEnter:function(){return T(!0)},onMouseLeave:function(){return T(!1)},children:[(0,r.jsxs)(c.y5t,{component:(0,r.jsxs)(_S,{children:[(0,r.jsxs)("div",{className:CT().messageHeaderMenuLeft,children:[(0,r.jsxs)(c.P3F,{
className:CT().channelNameContainer,onClick:Z,children:[null!=b?(0,r.jsx)(c.ua7,{text:g,delay:500,children:function(e){return(0,r.jsx)(b,wT(MT({},e),{className:CT().channelIcon,height:16,width:16}))}}):null,(0,r.jsx)(c.X6q,{lineClamp:1,variant:"heading-sm/semibold",children:v})]}),null!=x&&(0,r.jsxs)("div",{className:CT().featuredMessageContainer,children:[(0,r.jsx)(bO.Z,{height:4,width:4,"aria-hidden":"true",className:CT().featuredMessageIcon}),(0,r.jsx)(c.xvT,{className:CT().featuredMessageText,variant:"text-sm/normal",color:"header-secondary",children:x})]})]}),(0,r.jsx)("div",{className:CT().messageHeaderMenuRight,children:(0,r.jsx)(AS,{feedItem:l,guildId:a,onContextMenu:k})})]}),children:[(0,r.jsx)(QS,{className:CT().messageItemBody,guildId:a,animateAvatar:I,channel:m,message:E,feedItemId:l.id,onMessageClick:U}),(0,r.jsx)(kT,{referenceMessages:O,guildId:a})]}),u&&(0,r.jsx)(cS,{guildId:a,guildFeedItem:l,setOnDismissFeedback:f})]})}));var BT=n(858435),HT=n.n(BT);function VT(e,t){
(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function FT(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function YT(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){FT(i,r,o,a,s,"next",e)}function s(e){FT(i,r,o,a,s,"throw",e)}a(void 0)}))}}function zT(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function WT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){zT(e,t,n[t])}))}return e}function KT(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){
var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function qT(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return VT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n)
;if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VT(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var XT=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,
o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},QT=function(){var e=YT((function(){var e;return XT(this,(function(t){switch(t.label){case 0:return[4,n.e(87485).then(n.bind(n,187485))];case 1:e=t.sent();return[2,e.default]}}))}));return function(){return e.apply(this,arguments)}}();const $T=o.forwardRef((function(e,t){var n,i,a,l=e.guildId,u=e.messageBundleItem,f=e.showFeedback,d=e.setOnDismissedFeedback,p=u.messages,h=p[0].message,E=p[p.length-1].message,y=E.channel_id,m=(0,s.Wu)([Xb.ZP],(function(){return p.map((function(e){return Xb.ZP.getCachedMessage(l,y,e.message.id)})).filter(_o.lm)}),[l,y,p]),b=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(y)
})),g=(0,EO.KS)(b,void 0,{textFocused:!0}),O=(0,EO.bT)(b),v=(0,op.ZP)(b),_=qT(o.useState(!1),2),I=_[0],T=_[1],N=(0,s.e7)([Ja.Z],(function(){return null!=E&&Ja.Z.isBlocked(E.author.id)})),A=(0,pb.JA)(null!==(i=null===(n=m[m.length-1])||void 0===n?void 0:n.id)&&void 0!==i?i:u.id),C=u.id,P=(0,s.e7)([ap.ZP],(function(){return ap.ZP.getSidebarState(Ig.oC.GUILD_HOME)})),j=(0,yO.FW)(P,b),R=null!=j&&h.id===j,x=nI({guildId:l,channelId:y,feedItemId:C,onChannelClick:function(){return(0,Yv.Z)(M.Z5c.CHANNEL(l,y,h.id))},onContentClick:function(e){var t;cd.Z.openChannelAsSidebar({guildId:l,channelId:y,baseChannelId:Ig.oC.GUILD_HOME,flash:!1,details:{type:lv.F.HOME,initialMessageId:null!==(t=null==e?void 0:e.id)&&void 0!==t?t:h.id,highlightMessageIds:new Set((0,H_.bE)(u))}})}}),w=x.handleItemClick,D=x.handleChannelClick,Z=x.handleCardClick,L=x.handleMessageClick,U=o.useMemo((function(){return p.map((function(e){return null!==(a=e.referenceMessages)&&void 0!==a?a:[]})).flat()}),[p])
;if(null==b||null==h||null==E||N)return null;var k=function(e){e.stopPropagation();(0,Ob.jW)(e,YT((function(){var e;return XT(this,(function(t){switch(t.label){case 0:return[4,QT()];case 1:e=t.sent();return[2,function(t){return(0,r.jsx)(e,KT(WT({},t),{item:u,channel:b}))}]}}))})))};return(0,r.jsxs)(bS,{className:f?HT().containerNoPadding:HT().container,ref:t,selected:R,onCardClick:Z,onItemClick:w,onContextMenu:k,itemId:C,ariaLabel:Q.Z.Messages.GUILD_FEED_MESSAGE_ITEM_A11Y_LABEL.format({channelName:v}),listItemProps:A,onMouseEnter:function(){return T(!0)},onMouseLeave:function(){return T(!1)},children:[(0,r.jsxs)(c.y5t,{component:(0,r.jsxs)(_S,{children:[(0,r.jsx)("div",{className:HT().messageHeaderMenuLeft,children:(0,r.jsxs)(c.P3F,{className:HT().channelNameContainer,onClick:D,children:[null!=g?(0,r.jsx)(c.ua7,{text:O,delay:500,children:function(e){return(0,r.jsx)(g,KT(WT({},e),{className:HT().channelIcon,height:16,width:16}))}}):null,(0,r.jsx)(c.X6q,{lineClamp:1,
variant:"heading-sm/semibold",children:v})]})}),(0,r.jsx)("div",{className:HT().messageHeaderMenuRight,children:(0,r.jsx)(AS,{feedItem:u,guildId:l,onContextMenu:k})})]}),children:[(0,r.jsx)("div",{className:HT().messageBundleItemBody,children:(0,r.jsx)(rT,{feedItemId:u.id,guildId:l,channel:b,messages:m,animateAvatar:I,onMessageClick:L})}),(0,r.jsx)(kT,{referenceMessages:U,guildId:l})]}),f&&(0,r.jsx)(cS,{guildId:l,guildFeedItem:u,setOnDismissFeedback:d})]})}));var JT=n(358969),eN=n(727081),tN=n(666613),nN=n(591684),rN=n(379364),oN=n(79955),iN=n.n(oN);function aN(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sN(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function cN(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){sN(i,r,o,a,s,"next",e)}function s(e){sN(i,r,o,a,s,"throw",e)}a(void 0)}))}}function lN(e,t,n){
t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function uN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){lN(e,t,n[t])}))}return e}function fN(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function dN(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){
var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return aN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return aN(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var pN=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},
"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},hN=new Set(["Electron","Chrome"]),EN=function(){var e=cN((function(){var e
;return pN(this,(function(t){switch(t.label){case 0:return[4,n.e(1025).then(n.bind(n,101025))];case 1:e=t.sent();return[2,e.default]}}))}));return function(){return e.apply(this,arguments)}}();function yN(e){var t,n=e.channel,o=(0,s.e7)([nN.Z],(function(){return null!==(t=nN.Z.getCount(n.id))&&void 0!==t?t:0})),i=o>=rN.M3?Q.Z.Messages.GUILD_FEED_MESSAGE_ITEM_MAX_REPLIES.format({maxReplies:rN.M3}):Q.Z.Messages.GUILD_FEED_MESSAGE_ITEM_NUM_REPLIES.format({numReplies:o}),a=(0,s.e7)([tN.Z],(function(){return tN.Z.getMemberIdsPreview(n.id)})),c=(0,JT.iM)(n,null!=a?a:[]);return 0===o?null:(0,r.jsx)(UT,{guildId:n.guild_id,maxUsers:5,users:c,text:i})}const mN=o.forwardRef((function(e,t){var n,i=e.guildId,a=e.postItem,l=e.showFeedback,u=e.setOnDismissedFeedback,f=a.thread,d=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(f.id)}),[f.id]),p=(0,s.cj)([Xb.ZP],(function(){return{message:Xb.ZP.getCachedMessage(i,f.id,a.message.id),isFeaturedPost:Xb.ZP.getIsItemFeatured({guildId:i,entity:f,
entityType:dO.w.FORUM_POST})}}),[i,a.message.id,f]),h=p.message,E=p.isFeaturedPost,y=(0,op.ZP)(f),m=(0,s.e7)([Ja.Z],(function(){return null!=h&&Ja.Z.isBlocked(null==h?void 0:h.author.id)})),b=(0,pb.JA)(null!==(n=null==h?void 0:h.id)&&void 0!==n?n:a.message.id),g=(0,V_.ZP)(a),O=(0,EO.bT)(f),v=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(f.parent_id)})),_=(0,op.ZP)(v),I=(0,EO.KS)(v),T=dN(o.useState(!1),2),N=T[0],A=T[1],C=(0,s.e7)([ap.ZP],(function(){return ap.ZP.getSidebarState(Ig.oC.GUILD_HOME)})),P=(0,yO.FW)(C,d),j=null!=P&&a.message.id===P,R=a.highlighted?Q.Z.Messages.GUILD_FEED_SPECIAL_HIGHLIGHT:E?Q.Z.Messages.GUILD_FEED_FEATURED_BY_MODERATORS:null,x=nI({guildId:i,channelId:f.id,feedItemId:g,onChannelClick:function(){return(0,Yv.Z)(M.Z5c.CHANNEL(i,f.parent_id))},onContentClick:function(){return cd.Z.openThreadAsSidebar({guildId:i,baseChannelId:Ig.oC.GUILD_HOME,channelId:f.id})}}),w=x.handleItemClick,D=x.handleChannelClick,Z=x.handleCardClick,L=x.handleMessageClick,U=dN((0,
JT.ur)(f),2),k=U[0],G=U[1],B=k[0],H=(0,JT.eV)(f).slice(1),V=null!=Nm().name&&!hN.has(Nm().name);if(null==f||null==d||null==h||null==a||m)return null;var F=function(e){e.stopPropagation();(0,Ob.jW)(e,cN((function(){var e;return pN(this,(function(t){switch(t.label){case 0:return[4,EN()];case 1:e=t.sent();return[2,function(t){return(0,r.jsx)(e,fN(uN({},t),{messageItem:a,channel:d,message:h}))}]}}))})))};return(0,r.jsxs)(bS,{className:l?iN().containerNoPadding:iN().container,ref:t,selected:j,onCardClick:Z,onItemClick:w,onContextMenu:F,itemId:g,ariaLabel:Q.Z.Messages.GUILD_FEED_MESSAGE_ITEM_A11Y_LABEL.format({channelName:y}),listItemProps:b,onMouseEnter:function(){return A(!0)},onMouseLeave:function(){return A(!1)},children:[(0,r.jsx)(c.y5t,{component:(0,r.jsxs)(_S,{children:[(0,r.jsxs)("div",{className:iN().postHeaderMenuLeft,children:[(0,r.jsxs)(c.P3F,{className:iN().channelNameContainer,onClick:D,children:[null!=I?(0,r.jsx)(c.ua7,{text:O,delay:500,children:function(e){return(0,
r.jsx)(I,fN(uN({},e),{className:iN().channelIcon,height:16,width:16}))}}):null,(0,r.jsx)(c.X6q,{className:iN().channelName,variant:"heading-sm/semibold",lineClamp:1,children:_})]}),null!=R&&(0,r.jsxs)("div",{className:iN().featuredPostContainer,children:[(0,r.jsx)(bO.Z,{height:4,width:4,"aria-hidden":"true",className:iN().featuredPostIcon}),(0,r.jsx)(c.xvT,{className:iN().featuredPostText,variant:"text-sm/normal",color:"header-secondary",children:R})]})]}),(0,r.jsx)("div",{className:iN().postHeaderMenuRight,children:(0,r.jsx)(AS,{feedItem:a,guildId:i,onContextMenu:F})})]}),children:(0,r.jsxs)(c.y5t,{component:(0,r.jsxs)("div",{className:iN().titleContainer,children:[(0,r.jsx)(c.X6q,{className:iN().title,variant:"heading-lg/semibold",children:f.name}),null!=B?(0,r.jsxs)("div",{className:iN().tags,children:[(0,r.jsx)(eN.ZP,{tag:B,size:eN.ZP.Sizes.SMALL}),G>0?(0,r.jsx)(eN.fz,{tags:H,count:G,size:eN.ZP.Sizes.SMALL}):null]}):null]}),children:[(0,r.jsx)(QS,{className:iN().messageItemBody,
guildId:f.guild_id,animateAvatar:N,channel:f,message:h,feedItemId:a.id,onMessageClick:L,disableTruncation:V}),(0,r.jsx)(yN,{channel:f})]})}),l&&(0,r.jsx)(cS,{guildId:i,guildFeedItem:a,setOnDismissFeedback:u})]})}));function bN(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gN(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n)
;if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bN(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const ON=o.memo((function(e){var t=e.guildId,n=e.itemId,i=e.scrollerHeight,a=e.scrollerRef,c=e.showFeedback,l=e.setOnDismissedFeedback,u=gN((0,s.Wu)([Xb.ZP],(function(){return[Xb.ZP.getItem(t,n),Xb.ZP.getIsItemHiding(t,n),Xb.ZP.getIsItemHidden(t,n)]})),3),f=u[0],d=u[1],p=u[2],h=o.useRef(null);o.useEffect((function(){var e,r=h.current;if(null!=r&&null!=i){var o=r.clientHeight,s=null===(e=a.current)||void 0===e?void 0:e.getScrollerNode();if(null!=s){var c=Math.min(.5,.5*i/o),l=new IntersectionObserver((function(e){return function(e,t,n){var r=!0,o=!1,i=void 0;try{for(var a,s=n[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value,l=c.target.dataset.itemId;if(null==l)return;var u=Date.now()
;c.intersectionRatio>=t?(0,qb.pb)(e,l,u):(0,qb.v)(e,l,u)}}catch(e){o=!0;i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}}(t,c,e)}),{root:s,rootMargin:"0px 100000px 0px 100000px",threshold:c});l.observe(r);return function(){l.disconnect()}}}else(0,qb.v)(t,n,Date.now())}),[n,t,a,i,d,p]);if(null==f||p)return null;if(d)return(0,r.jsx)(NT,{guildId:t,feedItem:f});switch(f.type){case dO.w.FORUM_POST:return(0,r.jsx)(mN,{ref:h,guildId:t,postItem:f,showFeedback:c,setOnDismissedFeedback:l});case dO.w.MESSAGE:return(0,r.jsx)(GT,{ref:h,guildId:t,messageItem:f,showFeedback:c,setOnDismissedFeedback:l});case dO.w.MESSAGE_BUNDLE:return(0,r.jsx)($T,{ref:h,guildId:t,messageBundleItem:f,showFeedback:c,setOnDismissedFeedback:l});case dO.w.CONVERSATION:return(0,r.jsx)(yT,{ref:h,guildId:t,conversationItem:f,showFeedback:c,setOnDismissedFeedback:l});default:(0,_o.vE)(f)}}));var vN=n(861426),_N=n(613677),IN=n(575978),SN=n(921122),TN=n(465637),NN=n(265367);function AN(e){var t=(0,
s.e7)([Hg.ZP],(function(){return Hg.ZP.getChannels(e)}))[Hg.sH];return(0,s.Wu)([cp.Z],(function(){return t.filter((function(e){var t=e.channel;return r_.T.READABLE.has(t.type)&&!r_.T.GUILD_VOCAL.has(t.type)})).filter((function(t){var n=t.channel;return cp.Z.isChannelMuted(e,n.id)||cp.Z.isCategoryMuted(e,n.id)}))}),[e,t]).length}var CN=n(216595),PN=n.n(CN);function jN(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function RN(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){jN(i,r,o,a,s,"next",e)}function s(e){jN(i,r,o,a,s,"throw",e)}a(void 0)}))}}function xN(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function MN(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){
var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var wN=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0
;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function DN(e,t,o){return(0,r.jsx)(c.P3F,{className:PN().mutedChannelsHook,onClick:function(){(0,c.ZDy)(RN((function(){var e,t;return wN(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(45829)]).then(n.bind(n,845829))];case 1:e=i.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,MN(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){xN(e,t,n[t])}))}return e}({},e),{guildId:o}))
}]}}))})))},children:e},t)}var ZN=o.memo((function(e){var t=e.guildId,n=e.onReloadClick,o=AN(t);return(0,r.jsxs)("div",{className:lh()(PN().container,PN().footerContainer),children:[(0,r.jsxs)("div",{className:PN().iconContainer,children:[(0,r.jsx)(SN.Z,{className:PN().icon,width:20,height:20}),(0,r.jsx)(TN.Z,{className:PN().stars,width:52,height:40})]}),(0,r.jsx)(c.X6q,{className:PN().header,variant:"heading-md/semibold",children:Q.Z.Messages.GUILD_FEED_FOOTER_TITLE}),(0,r.jsx)(c.xvT,{color:"header-secondary",variant:"text-sm/normal",children:o>0?Q.Z.Messages.GUILD_FEED_MUTED_CHANNELS_SUBTITLE.format({numMutedChannels:o,mutedChannelsHook:function(e,n){return DN(e,n,t)}}):Q.Z.Messages.GUILD_FEED_FOOTER_SUBTITLE}),(0,r.jsx)(c.zxk,{onClick:n,className:PN().button,children:Q.Z.Messages.GUILD_FEED_RELOAD})]})})),LN=o.memo((function(e){var t=e.guildId,n=e.onReloadClick,o=AN(t);return(0,r.jsxs)("div",{className:lh()(PN().container,PN().background),children:[(0,r.jsxs)("div",{
className:PN().iconContainer,children:[(0,r.jsx)(SN.Z,{className:PN().icon,width:36,height:36}),(0,r.jsx)(TN.Z,{className:PN().stars})]}),(0,r.jsx)(c.X6q,{className:PN().header,variant:"heading-md/semibold",children:Q.Z.Messages.GUILD_FEED_EMPTY_TITLE}),(0,r.jsx)(c.xvT,{color:"header-secondary",variant:"text-sm/normal",children:o>0?Q.Z.Messages.GUILD_FEED_MUTED_CHANNELS_SUBTITLE.format({numMutedChannels:o,mutedChannelsHook:function(e,n){return DN(e,n,t)}}):Q.Z.Messages.GUILD_FEED_EMPTY_SUBTITLE}),(0,r.jsx)(c.zxk,{onClick:n,className:PN().button,children:Q.Z.Messages.GUILD_FEED_RELOAD})]})})),UN=o.memo((function(e){var t=e.onReloadClick;return(0,r.jsxs)("div",{className:lh()(PN().container,PN().background),children:[(0,r.jsx)("div",{className:PN().iconContainer,children:(0,r.jsx)(NN.Z,{className:PN().icon,width:36,height:36})}),(0,r.jsx)(c.X6q,{className:PN().header,variant:"heading-md/semibold",children:Q.Z.Messages.GUILD_FEED_ERROR_TITLE}),(0,r.jsx)(c.xvT,{color:"header-secondary",
variant:"text-sm/normal",children:Q.Z.Messages.GUILD_FEED_ERROR_SUBTITLE.format({url:M.yXt.STATUS})}),(0,r.jsx)(c.zxk,{onClick:t,className:PN().button,children:Q.Z.Messages.GUILD_FEED_RELOAD})]})})),kN=o.memo((function(e){var t=e.onReloadClick;return(0,r.jsxs)("div",{className:lh()(PN().container,PN().paginationContainer,PN().primaryBackground),children:[(0,r.jsx)("div",{className:PN().iconContainer,children:(0,r.jsx)(NN.Z,{className:PN().icon,width:36,height:36})}),(0,r.jsx)(c.X6q,{className:PN().header,variant:"heading-md/semibold",children:Q.Z.Messages.GUILD_FEED_ERROR_TITLE}),(0,r.jsx)(c.xvT,{color:"header-secondary",variant:"text-sm/normal",children:Q.Z.Messages.GUILD_FEED_ERROR_SUBTITLE.format({url:M.yXt.STATUS})}),(0,r.jsx)(c.zxk,{onClick:t,className:PN().button,children:Q.Z.Messages.RETRY})]})})),GN=n(627027),BN=n(427506),HN=n.n(BN);function VN(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function FN(e,t){
t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function YN(){var e=o.useMemo((function(){if(!(Wa().random(1)<.5))return FN(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){VN(e,t,n[t])}))}return e}({},(0,GN.Rr)()),{last:!0})}),[]);return(0,r.jsxs)(bS,{"aria-hidden":!0,ariaLabel:"",children:[(0,r.jsx)(_S,{children:(0,r.jsx)(Hv.ZT,{
className:HN().channelName,opacity:.3,width:80})}),(0,r.jsx)("div",{className:HN().body,children:(0,r.jsx)(Hv.ZP,{messages:5,attachmentSpecs:e,className:HN().withoutCustomBackground})})]})}const zN=o.memo((function(e){var t=e.count;return(0,r.jsx)(r.Fragment,{children:Wa().times(null!=t?t:5,(function(e){return(0,r.jsx)(YN,{},e)}))})}));var WN=n(627342);function KN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qN(e){qN=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return qN(e)}function XN(e,t){return!t||"object"!==$N(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function QN(e,t){QN=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return QN(e,t)}var $N=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function JN(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=qN(e);if(t){var o=qN(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return XN(this,n)}}var eA={};var tA=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&QN(e,t)}(n,e);var t=JN(n);function n(){KN(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(e){if(null!=e){var t;eA=null!==(t=e.numCleanLoadsForGuild)&&void 0!==t?t:{}}};r.getState=function(){return{numCleanLoadsForGuild:eA}};r.getTotalNumCleanLoads=function(){var e=0;for(var t in eA){var n
;e+=null!==(n=eA[t])&&void 0!==n?n:0}return e};r.__getLocalVars=function(){return{MAX_NUM_CLEAN_LOADS:50,numCleanLoadsForGuild:eA}};return n}(s.ZP.PersistedStore);tA.displayName="GuildHomeFeedbackStore";tA.persistKey="GuildHomeFeedbackStore";const nA=new tA(O.Z,{GUILD_FEED_FETCH_SUCCESS:function(e){var t,n=e.guildId;if(!e.fresh)return!1;eA[n]=Math.min(50,(null!==(t=eA[n])&&void 0!==t?t:0)+1)},LOGOUT:function(){eA={}}});var rA=new Date(Date.UTC(2022,7,6));var oA=n(897266),iA=n.n(oA),aA=n(934104),sA=n.n(aA);function cA(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function lA(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){cA(i,r,o,a,s,"next",e)}function s(e){cA(i,r,o,a,s,"throw",e)}a(void 0)}))}}function uA(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var fA=function(e,t){var n,r,o,i,a={label:0,
sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{
value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function dA(e){var t=e.children,n=e.onClose;return(0,r.jsxs)("div",{className:iA().container,children:[(0,r.jsx)(c.P3F,{className:iA().closeButton,onClick:n,children:(0,r.jsx)(Ub.Z,{className:iA().closeIcon})}),(0,r.jsx)("div",{className:iA().textContainer,children:t}),(0,r.jsx)("img",{className:iA().image,src:sA(),alt:""})]})}function pA(e){var t=e.onClose;return(0,r.jsxs)(dA,{onClose:t,children:[(0,r.jsx)(c.X6q,{style:{color:"white"},variant:"heading-lg/semibold",color:"none",children:Q.Z.Messages.GUILD_FEED_NUX_MEMBER_TITLE}),(0,r.jsx)(c.xvT,{className:iA().bodySection,variant:"text-sm/normal",color:"none",children:Q.Z.Messages.GUILD_FEED_NUX_MEMBER_BODY_1}),(0,r.jsx)(c.xvT,{className:iA().bodySection,variant:"text-sm/normal",color:"none",children:Q.Z.Messages.GUILD_FEED_NUX_MEMBER_BODY_2}),(0,r.jsx)(c.eee,{className:lh()(iA().cta,iA().ctaLink,(0,c.nYM)({look:c.zxk.Looks.LINK,color:c.zxk.Colors.WHITE})),
href:X.Z.getArticleURL(M.BhN.GUILD_HOME),children:Q.Z.Messages.GUILD_FEED_NUX_MEMBER_BODY_3})]})}function hA(){(0,c.ZDy)(lA((function(){var e,t;return fA(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(1650)]).then(n.bind(n,101650))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){uA(e,t,n[t])}))}return e}({},e))}]}}))})))}function EA(e){var t=e.onClose;return(0,r.jsxs)(dA,{onClose:t,children:[(0,r.jsx)(c.X6q,{style:{color:"white"},variant:"heading-lg/semibold",color:"none",children:Q.Z.Messages.GUILD_FEED_NUX_MODERATOR_TITLE}),(0,r.jsx)(c.xvT,{className:iA().bodySection,variant:"text-sm/normal",color:"none",
children:Q.Z.Messages.GUILD_FEED_NUX_MEMBER_BODY_1}),(0,r.jsx)(c.xvT,{className:iA().bodySection,variant:"text-sm/normal",color:"none",children:Q.Z.Messages.GUILD_FEED_NUX_MEMBER_BODY_2}),(0,r.jsx)(c.zxk,{className:iA().cta,look:c.zxk.Looks.INVERTED,color:c.zxk.Colors.BRAND,onClick:hA,children:Q.Z.Messages.GUILD_FEED_NUX_MODERATOR_CTA})]})}function yA(e){var t=e.guild,n=e.onClose,i=(0,s.e7)([dn.Z],(function(){return dn.Z.can(M.Plq.MANAGE_MESSAGES,t)})),a=function(e,t){var n=(0,dE.ZP)([nA],(function(){return nA.getTotalNumCleanLoads()<=2})),r=(0,dE.ZP)([Y.default],(function(){var e=Y.default.getCurrentUser();return null==e||e.createdAt.getTime()<rA.getTime()})),i=o.useMemo((function(){return null!=(null==e?void 0:e.joinedAt)&&rA.getTime()>e.joinedAt.getTime()}),[null==e?void 0:e.joinedAt]),a=n&&r&&!i;o.useEffect((function(){a||t(hn.L.AUTO)}),[a]);return a||!0}(t,n);return a?i?(0,r.jsx)(EA,{onClose:n}):(0,r.jsx)(pA,{onClose:n}):null}var mA=[ln.z$.GUILD_FEED_NUX_CARD]
;const bA=o.memo((function(e){var t=e.guild;return(0,r.jsx)(WN.Z,{contentTypes:mA,groupName:hn.R.GUILD_FEED_TOP,children:function(e){var n=e.visibleContent,o=e.markAsDismissed;return n===ln.z$.GUILD_FEED_NUX_CARD?(0,r.jsx)(yA,{guild:t,onClose:o}):null}})}));var gA=n(621329),OA=n(318195),vA=n.n(OA);const _A=o.memo((function(){return(0,r.jsxs)("div",{className:vA().container,children:[(0,r.jsxs)("div",{className:vA().divider,children:[(0,r.jsx)("div",{className:vA().line}),(0,r.jsx)("div",{className:vA().icon,children:(0,r.jsx)(gA.Z,{height:24,width:24})}),(0,r.jsx)("div",{className:vA().line})]}),(0,r.jsx)(c.xvT,{className:vA().title,color:"header-primary",variant:"text-md/semibold",children:Q.Z.Messages.GUILD_FEED_UNREAD_DIVIDER_TITLE}),(0,r.jsx)(c.xvT,{className:vA().subtitle,color:"header-secondary",variant:"text-sm/normal",children:Q.Z.Messages.GUILD_FEED_UNREAD_DIVIDER_SUBTITLE})]})}));var IA=n(419984),SA=n.n(IA);function TA(e,t){(null==t||t>e.length)&&(t=e.length)
;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NA(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function AA(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){NA(i,r,o,a,s,"next",e)}function s(e){NA(i,r,o,a,s,"throw",e)}a(void 0)}))}}function CA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||jA(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PA(e){return function(e){
if(Array.isArray(e))return TA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||jA(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jA(e,t){if(e){if("string"==typeof e)return TA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);return"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?TA(e,t):void 0}}var RA=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,
r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},xA=o.memo((function(e){var t=e.guildId;return(0,s.e7)([vN.Z],(function(){return vN.Z.isViewingRoles(t)}))?(0,r.jsx)(_N.Z,{messageType:_N.Q.WARNING,children:Q.Z.Messages.GUILD_FEED_VIEW_AS_ROLE_WARNING}):null}));var MA=o.memo((function(e){
var t=e.guildId,n=e.hasMoreItems,i=e.scrollerRef,a=e.error,s=e.fetchPage,c=e.onReloadClick,l=o.useRef(null);o.useEffect((function(){var e,t=l.current,r=null===(e=i.current)||void 0===e?void 0:e.getScrollerNode();if(null!=r&&null!=t&&n){var o=new IntersectionObserver((function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.intersectionRatio>0&&s()}}catch(e){n=!0;r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}),{root:r,rootMargin:"0px 0px 200px 0px",threshold:0});o.observe(t);return function(){o.disconnect()}}}),[i,l,s,t,n]);return null!=a?(0,r.jsx)(kN,{guildId:t,onReloadClick:s}):n?(0,r.jsx)("div",{className:SA().container,ref:l,children:(0,r.jsx)(zN,{count:1})}):(0,r.jsx)(ZN,{guildId:t,onReloadClick:c})}));function wA(e){var t,n,i,a=e.guild,c=e.renderMode,l=e.scrollerRef,u=e.seenManagerRef,f=_v(),d=CA((0,s.Wu)([Xb.ZP],(function(){return[eO.Ji.READ,eO.Ji.UNREAD,eO.Ji.HIGHLIGHTED,eO.Ji.ALL].map((function(e){
return Xb.ZP.getFeedItemSection(a.id,e)}))})),4),p=d[0],h=d[1],E=d[2],y=d[3],m=(0,s.e7)([Xb.ZP],(function(){return Xb.ZP.getLoadId(a.id)})),b=(0,s.e7)([yv.Z],(function(){return yv.Z.getHomeSessionId(a.id)})),g=(0,J_.Z)({guildId:a.id,highlightedItemData:f}),O=g.loading,v=g.error,_=g.fetchFresh,I=g.fetchPage,S=(0,s.e7)([Xb.ZP],(function(){return Xb.ZP.getPaginationStatus(a.id)})).hasMoreItems,T=bv.M.useExperiment({guildId:a.id}).hasNewHeader,N=yg(a).homeHeaderScroll;o.useEffect((function(){Q_.initialize();return function(){Q_.terminate()}}),[]);o.useLayoutEffect((function(){if(null!=m&&null!=b){(0,qb.Ps)(a.id);var e=(0,IN.UU)(),t=new $_.Z({guildId:a.id,loadId:m,homeSessionId:b,windowId:e,isPaused:!We.Z.isFocused(e)});t.initialize();u.current=t;return function(){t.terminate()}}}),[u,a.id,m,b]);var A=function(e){var t=CA(o.useState(null),2),n=t[0],r=t[1];o.useEffect((function(){var t,n=null===(t=e.current)||void 0===t?void 0:t.getScrollerNode();if(null!=n){
var o=new ResizeObserver((function(e){var t=!0,n=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var s=i.value;r(s.contentRect.height)}}catch(e){n=!0;o=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw o}}}));o.observe(n);return function(){o.disconnect()}}}),[e]);return n}(l),C=o.useMemo((function(){return c!==eO.EO.NEW?[]:PA(y).sort((function(e,t){return-ho.Z.compare((0,H_.ZP)(e).id,(0,H_.ZP)(t).id)}))}),[y,c]),P=o.useCallback(AA((function(){var e;return RA(this,(function(t){switch(t.label){case 0:return[4,null===(e=u.current)||void 0===e?void 0:e.maybeFlushSeenItems(Ev.cs.IMMEDIATE)];case 1:t.sent();_({force:!0,flushSeenItems:function(){var e;return null===(e=u.current)||void 0===e?void 0:e.maybeFlushSeenItems(Ev.cs.IMMEDIATE)}});return[2]}}))})),[u,_]);o.useEffect((function(){if(O===Xb.Q.LOADING_FRESH_FEED)if(T){var e;null===(e=l.current)||void 0===e||e.scrollTo({to:N})}else{var t;null===(t=l.current)||void 0===t||t.scrollToTop()}
}),[O,T,N]);var j,R,x=0===y.length,M=(0,bI.vL)(),w=M.showFeedback,D=M.setOnDismissedFeedback;if(x)return O===Xb.Q.LOADING_FRESH_FEED?(0,r.jsx)("div",{className:SA().container,children:(0,r.jsx)(zN,{})}):null!=v?(0,r.jsx)(UN,{guildId:a.id,onReloadClick:P}):(0,r.jsx)(LN,{guildId:a.id,onReloadClick:P});if(c===eO.EO.TOP)return(0,r.jsxs)("div",{className:SA().container,children:[(0,r.jsx)(bA,{guild:a}),y.map((function(e,t){return(0,r.jsx)(ON,{guildId:a.id,itemId:e.id,scrollerHeight:A,scrollerRef:l,showFeedback:0===t&&w,setOnDismissedFeedback:D},e.id)})),(0,r.jsx)(MA,{guildId:a.id,hasMoreItems:null!=S&&S,scrollerRef:l,error:v,fetchPage:I,onReloadClick:P})]});if(c===eO.EO.NEW)return(0,r.jsxs)("div",{className:SA().container,children:[(0,r.jsx)(bA,{guild:a}),C.map((function(e,t){return(0,r.jsx)(ON,{guildId:a.id,itemId:e.id,scrollerHeight:A,scrollerRef:l,showFeedback:0===t&&w,setOnDismissedFeedback:D},e.id)})),(0,r.jsx)(MA,{guildId:a.id,hasMoreItems:null!=S&&S,scrollerRef:l,error:v,fetchPage:I,
onReloadClick:P})]});var Z=null!==(R=null!==(j=null===(t=E[0])||void 0===t?void 0:t.id)&&void 0!==j?j:null===(n=h[0])||void 0===n?void 0:n.id)&&void 0!==R?R:null===(i=p[0])||void 0===i?void 0:i.id;return(0,r.jsxs)("div",{className:SA().container,children:[(0,r.jsx)(xA,{guildId:a.id}),(0,r.jsx)(bA,{guild:a}),E.map((function(e){return(0,r.jsx)(ON,{guildId:a.id,itemId:e.id,scrollerHeight:A,scrollerRef:l,showFeedback:e.id===Z&&w,setOnDismissedFeedback:D},e.id)})),h.map((function(e){return(0,r.jsx)(ON,{guildId:a.id,itemId:e.id,scrollerHeight:A,scrollerRef:l,showFeedback:e.id===Z&&w,setOnDismissedFeedback:D},e.id)})),p.length>0?(0,r.jsx)(_A,{}):null,p.map((function(e){return(0,r.jsx)(ON,{guildId:a.id,itemId:e.id,scrollerHeight:A,scrollerRef:l,showFeedback:e.id===Z&&w,setOnDismissedFeedback:D},e.id)})),(0,r.jsx)(MA,{guildId:a.id,hasMoreItems:null!=S&&S,scrollerRef:l,error:v,fetchPage:I,onReloadClick:P})]})}var DA=n(99270),ZA=n.n(DA);function LA(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value
}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function UA(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){LA(i,r,o,a,s,"next",e)}function s(e){LA(i,r,o,a,s,"throw",e)}a(void 0)}))}}function kA(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function GA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){kA(e,t,n[t])}))}return e}function BA(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){
return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var HA=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break
}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function VA(e){var t=e.guild,i=(0,bb.Z)(eO.Gj),a=(0,vv.ZP)(t.id),s=o.useMemo((function(){var e=a.filter((function(e){return(0,Ov.xt)(e)}));return i&&e.length>0?Wa().head(e):Wa().chain(a).filter((function(e){return!(0,Ov.xt)(e)})).minBy((function(e){return fO()(e.scheduled_start_time)})).value()}),[a,i]);if(null==s)return null;function l(){l=UA((function(){return HA(this,(function(e){switch(e.label){case 0:return[4,(0,c.ZDy)(UA((function(){var e,o;return HA(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(40706),n.e(89853)]).then(n.bind(n,389853))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,BA(GA({},e),{guildId:t.id}))}]}}))})))];case 1:e.sent();(0,
un.EW)(ln.z$.GUILD_HEADER_EVENT_UPSELL);return[2]}}))}));return l.apply(this,arguments)}return(0,r.jsxs)("div",{className:ZA().container,children:[(0,r.jsxs)("div",{className:ZA().header,children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:i?Q.Z.Messages.GUILD_EVENTS:Q.Z.Messages.GUILD_HOME_EVENTS_TITLE}),a.length>=2?(0,r.jsx)(c.P3F,{onClick:function(){return l.apply(this,arguments)},children:(0,r.jsx)(c.xvT,{className:ZA().showEvents,variant:"text-sm/normal",children:Q.Z.Messages.GUILD_HOME_SEE_ALL.format({count:a.length})})}):null]}),(0,r.jsx)("div",{className:ZA().events,children:(0,r.jsx)(S_,{event:s,isInList:!1})})]})}var FA=n(831855),YA=n.n(FA);function zA(e){var t=e.guild;o.useEffect((function(){(0,Tg.P)(t.id)}),[t.id]);var n=(0,s.e7)([Ng.Z],(function(){return Ng.Z.getGuild(t.id)}),[t]);return(0,r.jsxs)("div",{className:YA().memberInfo,children:[null!=(null==n?void 0:n.presenceCount)?(0,r.jsxs)("div",{className:YA().memberCount,children:[(0,r.jsx)("div",{
className:YA().dotOnline}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:YA().memberText,children:Q.Z.Messages.MEMBER_VERIFICATION_NUM_ONLINE.format({membersOnline:n.presenceCount})})]}):null,null!=(null==n?void 0:n.memberCount)?(0,r.jsxs)("div",{className:YA().memberCount,children:[(0,r.jsx)("div",{className:YA().dotOffline}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:YA().memberText,children:Q.Z.Messages.MEMBER_VERIFICATION_NUM_MEMBERS.format({members:n.memberCount})})]}):null]})}function WA(e){var t=e.guild;return(0,r.jsxs)("div",{className:YA().container,children:[(0,r.jsx)("div",{className:YA().iconWrapper,children:(0,r.jsx)(tg.Z,{className:YA().icon,guild:t,size:tg.Z.Sizes.LARGER,active:!0})}),(0,r.jsx)(c.xvT,{tag:"div",className:YA().name,variant:"heading-xl/semibold",children:t.name}),null!=t.description?(0,r.jsx)(c.xvT,{className:YA().description,variant:"text-md/normal",children:t.description}):null,(0,r.jsx)(zA,{guild:t})]})}const KA=o.memo(WA);function qA(e){
var t=e.guild;o.useEffect((function(){(0,Tg.P)(t.id)}),[t.id]);var n=(0,s.e7)([Ng.Z],(function(){return Ng.Z.getGuild(t.id)}),[t]);return(0,r.jsxs)("div",{className:YA().memberInfo,children:[t.hasCommunityInfoSubheader()&&(0,r.jsxs)("div",{className:YA().memberCount,children:[(0,r.jsx)(Cg.Z,{width:14,height:14}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"text-muted",children:Q.Z.Messages.DISCOVERABLE_GUILD_HEADER_PUBLIC})]}),null!=(null==n?void 0:n.presenceCount)&&(0,r.jsxs)("div",{className:YA().memberCount,children:[(0,r.jsx)("div",{className:YA().dotOnline}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"text-muted",children:Q.Z.Messages.MEMBER_VERIFICATION_NUM_ONLINE.format({membersOnline:n.presenceCount})})]}),null!=(null==n?void 0:n.memberCount)&&(0,r.jsxs)("div",{className:YA().memberCount,children:[(0,r.jsx)("div",{className:YA().dotOffline}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"text-muted",children:Q.Z.Messages.MEMBER_VERIFICATION_NUM_MEMBERS.format({
members:n.memberCount})})]})]})}function XA(e){var t=e.guild;return(0,r.jsx)("div",{className:YA().container,children:(0,r.jsxs)(c.y5t,{component:(0,r.jsx)("div",{className:YA().header,children:(0,r.jsx)(c.X6q,{variant:"heading-md/medium",children:Q.Z.Messages.GUILD_HOME_ABOUT})}),children:[null!=t.description?(0,r.jsx)(c.xvT,{className:YA().description,variant:"text-md/normal",children:t.description}):null,(0,r.jsx)(qA,{guild:t})]})})}const QA=o.memo(XA);var $A=n(866314),JA=n.n($A);function eC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tC(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function nC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))))
;r.forEach((function(t){tC(e,t,n[t])}))}return e}function rC(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function oC(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function iC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){
var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return eC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eC(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var aC=o.memo((function(e){var t=e.guild,n=function(e,t){var n=mv.jD.useExperiment({}).showRefreshButton;o.useEffect((function(){mv.jD.trackExposure({})}),[]);var i=(0,s.e7)([dn.Z],(function(){
return dn.Z.can(M.Plq.MANAGE_MESSAGES,e)}),[e]),a=[];n&&a.push((0,r.jsx)(kb.JO,{tooltip:Q.Z.Messages.REFRESH,icon:hv.Z,onClick:function(){(0,qb.QF)({guildId:e.id,refresh:!0,flushSeenItems:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.maybeFlushSeenItems(Ev.cs.IMMEDIATE)}})}}));i&&a.push((0,r.jsx)(av,{guildId:e.id}));return a}(t,e.seenManagerRef);return(0,r.jsxs)(Og.Z,{channelId:Ig.oC.GUILD_HOME,guildId:t.id,className:lh()(nO().title,JA().background),innerClassname:JA().headerBarInner,toolbar:n,children:[(0,r.jsx)(Og.Z.Icon,{icon:pv.Z,"aria-hidden":!0}),(0,r.jsxs)(Og.Z.Title,{children:[(0,r.jsx)(c.nn4,{children:t.name}),Q.Z.Messages.GUILD_HOME]}),(0,r.jsx)(Kb.Z,{})]})})),sC=o.memo((function(e){var t=e.guild,n=e.containerHeight,i=e.isUsingCollapsedLayout,a=iC(o.useState(0),2),s=a[0],l=a[1],u=(0,mb.Z)(),f=u.ref,d=u.height;!function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=(0,vv.ZP)(e);o.useEffect((function(){
t&&Ie.default.track(M.rMx.HOME_EVENTS_LOADED,{guild_id:e,active_events_shown:n.some((function(e){return(0,Ov.xt)(e)}))?1:0,upcoming_events_shown:n.some((function(e){return!(0,Ov.xt)(e)}))?1:0,home_session_id:yv.Z.getHomeSessionId(e)})}),[e,t])}(t.id);o.useEffect((function(){if(null!=d){l(d+128-n)}}),[n,d]);var p=(0,c.mFp)(),h=bv.M.useExperiment({guildId:t.id}).hasNewHeader,E=h?-48:0;return(0,r.jsx)("aside",{className:JA().widgets,style:{top:Math.min(-s,E)},children:(0,r.jsx)(c.tEY,{children:(0,r.jsxs)("div",rC(nC({className:JA().widgetsContainer,ref:f,tabIndex:i?void 0:0,"aria-label":Q.Z.Messages.GUILD_HOME_SIDEBAR_A11Y_LABEL},i?{}:p),{children:[h?(0,r.jsx)(QA,{guild:t}):(0,r.jsx)(KA,{guild:t}),(0,r.jsx)(B_,{guildId:t.id,isUsingCollapsedLayout:i}),(0,r.jsx)(VA,{guild:t})]}))})})}));function cC(e){var t=e.pageWidth,n=e.onSidebarResize,o=(0,s.e7)([ap.ZP],(function(){return ap.ZP.getSidebarState(Ig.oC.GUILD_HOME)}));if(null==o)return null;var i,a=t-M.PrS-552
;o.type===lv.t.VIEW_THREAD?i=(0,r.jsx)(uv.Z,{channelId:o.channelId,baseChannelId:Ig.oC.GUILD_HOME,channelViewSource:"Home View"}):o.type===lv.t.VIEW_CHANNEL&&(i=(0,r.jsx)(Wb,{channelId:o.channelId,baseChannelId:Ig.oC.GUILD_HOME,channelViewSource:"Home View"}));return(0,r.jsx)(hb.Z,{sidebarType:hb.y.HomeSidebar,maxWidth:a,onWidthChange:n,children:i})}var lC=[{label:"Segment Reads",value:eO.EO.SEGMENTED_READ},{label:"Top",value:eO.EO.TOP},{label:"New",value:eO.EO.NEW}];function uC(e){var t=e.renderMode,n=e.setRenderMode;return mv.Dx.useExperiment({}).showSelector?(0,r.jsx)(c.PhF,{className:JA().selector,options:lC,select:n,isSelected:function(e){return e===t},serialize:function(e){return String(e)}}):null}var fC=(0,yb.Z)((function(e){var t=e.guild,n=e.width,i=e.height,a=t.id,l=(0,s.e7)([ap.ZP],(function(){return ap.ZP.getSection(Ig.oC.GUILD_HOME)})),u=(0,s.e7)([dv.Z],(function(){return dv.Z.getCurrentSearchId()
})),f=iC(o.useState(!1),2),d=f[0],p=f[1],h=iC(o.useState(M.$Y6),2),E=h[0],y=h[1],m=l===M.ULH.SEARCH,b=l===M.ULH.SIDEBAR_CHAT,g=m||b,v=o.useRef(null),_=(0,gb.Z)("top-messages",v),I=(0,mb.Z)().ref,S=iC(o.useState(eO.EO.SEGMENTED_READ),2),T=S[0],N=S[1],A=(0,bb.Z)(eO.Gj),C=o.useRef(!1),P=bv.M.useExperiment({guildId:a}).hasNewHeader,j=yg(t).homeHeaderScroll;o.useEffect((function(){C.current=!1}),[a]);o.useEffect((function(){null==Xb.ZP.getLoadId(a)&&cd.Z.closeChannelSidebar(Ig.oC.GUILD_HOME)}),[a]);!function(e){o.useEffect((function(){var t=yv.Z.getHomeSessionId(e);return function(){Ie.default.track(M.rMx.HOME_EXITED,{guild_id:e,home_session_id:t})}}),[e])}(a);o.useLayoutEffect((function(){var e=yv.Z.getSavedScrollPosition(a);if(!P||0!==e&&null!=e){if(null!=e){var t;null===(t=v.current)||void 0===t||t.scrollTo({to:e})}}else{var n;null===(n=v.current)||void 0===n||n.scrollTo({to:j})}return function(){var e,t=null===(e=v.current)||void 0===e?void 0:e.getScrollerState();null!=t&&function(e,t){
O.Z.dispatch({type:"GUILD_HOME_SET_SCROLL_POSITION",guildId:e,scrollPosition:t})}(a,t.scrollTop)}}),[a,P,j]);var R=n-M.PrS-E,x=!(g&&R<936)||A,w=o.useRef(null),D=o.useCallback((function(){if(!C.current){(0,gv.X)(a);C.current=!0;Ie.default.track(M.rMx.HOME_FIRST_SCROLL_STARTED,{guild_id:a,home_session_id:yv.Z.getHomeSessionId(a)})}}),[a]);(0,Am.Tt)({location:Q.Z.Messages.GUILD_HOME_HTML_TITLE.format({guildName:t.name})});var Z,L=(0,c.mFp)(),U=mv.fV.useExperiment({guildId:a}).showDeprecationNotice,k=x?(0,r.jsx)(sC,{guild:t,containerHeight:i,isUsingCollapsedLayout:A},"widgets"):null;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:lh()(nO().chat,JA().background,(Z={},tC(Z,nO().threadSidebarOpen,g),tC(Z,nO().threadSidebarFloating,g&&d),Z)),children:[(0,r.jsx)(aC,{guild:t,seenManagerRef:w}),(0,r.jsxs)("div",{ref:I,className:nO().content,children:[(0,r.jsx)(pb.bG,{navigator:_,children:(0,r.jsx)(pb.SJ,{children:function(e){var n=e.ref,o=oC(e,["ref"]);return(0,
r.jsxs)(c.yWw,rC(nC({customTheme:!0,onScroll:D,className:lh()(JA().homeContainer,tC({},JA().homeContainerCollapsed,A)),ref:function(e){v.current=e;var t;n.current=null!==(t=null==e?void 0:e.getScrollerNode())&&void 0!==t?t:null}},o,L),{children:[P&&(0,r.jsx)(gg,{guild:t}),A?k:null,(0,r.jsxs)("div",{className:JA().homeContent,children:[U&&!t.hasFeature(M.oNc.GUILD_HOME_DEPRECATION_OVERRIDE)&&(0,r.jsxs)("div",{className:JA().deprecationNotice,children:[(0,r.jsxs)("div",{className:JA().deprecationNoticeContent,children:[(0,r.jsx)(c.X6q,{className:JA().heading,variant:"heading-lg/semibold",color:"always-white",children:Q.Z.Messages.GUILD_HOME_DEPRECATION_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"always-white",children:Q.Z.Messages.GUILD_HOME_DEPRECATION_DESCRIPTION})]}),(0,r.jsx)("img",{width:180,className:JA().image,src:sA(),alt:"","aria-hidden":!0})]}),(0,r.jsx)(c.y5t,{component:(0,r.jsxs)("div",{className:JA().topMessagesHeader,children:[(0,r.jsx)(c.X6q,{
variant:"heading-md/semibold",children:Q.Z.Messages.GUILD_FEED_TITLE}),(0,r.jsx)(uC,{renderMode:T,setRenderMode:N})]}),children:(0,r.jsx)(wA,{guild:t,renderMode:T,scrollerRef:v,seenManagerRef:w})})]}),A?null:k]}))}})}),m&&null!=u&&(0,r.jsx)(cv.Z,{searchId:u})]})]}),b?(0,r.jsx)(cC,{pageWidth:n,onSidebarResize:function(e,t){p(t);y(e)}}):null]})})),dC=(0,yb.Z)((function(e){var t,n=e.guild,i=e.width,a=(0,dE.ZP)([ap.ZP],(function(){return ap.ZP.getSection(Ig.oC.GUILD_HOME)})),s=cO(o.useState(!1),2),l=s[0],u=s[1],f=cO(o.useState(M.$Y6),2),d=f[0],p=f[1],h=a===M.ULH.SIDEBAR_CHAT,E=o.useRef(null),y=(0,gb.Z)("top-messages",E),m=(0,c.mFp)(),b=(0,bb.Z)(eO.Gj),g=i-M.PrS-d,O=h&&g<1020||b,v=(0,dE.ZP)([Cb.Z],(function(){return Cb.Z.getSettings(n.id)})),_=null==v?void 0:v.welcomeMessage,I=(0,_g.Z)(n.id);o.useEffect((function(){if(v===Cb.P)(0,Nb.cP)(n.id);else if(null!=v){var e,t,r,o,i;Ie.default.track(M.rMx.SERVER_GUIDE_VIEWED,aO(iO({},(0,Sb.hH)(n.id)),{
num_member_actions:null!==(r=null===(e=v.newMemberActions)||void 0===e?void 0:e.length)&&void 0!==r?r:0,num_member_actions_completed:Object.keys(null!==(o=Pb.Z.getCompletedActions(n.id))&&void 0!==o?o:{}).length,num_resource_channels:null!==(i=null===(t=v.resourceChannels)||void 0===t?void 0:t.length)&&void 0!==i?i:0}))}}),[n.id,v]);o.useEffect((function(){return function(){cd.Z.closeChannelSidebar(Ig.oC.GUILD_HOME)}}),[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:lh()(nO().chat,xg().background,(t={},oO(t,nO().threadSidebarOpen,h),oO(t,nO().threadSidebarFloating,h&&l),t)),children:[(0,r.jsx)(lO,{guild:n}),(0,r.jsx)(pb.bG,{navigator:y,children:(0,r.jsx)(pb.SJ,{children:function(e){var t=e.ref,o=sO(e,["ref"]);return(0,r.jsxs)(c.yWw,aO(iO({className:lh()(xg().homeContainer,oO({},xg().homeContainerCollapsed,O)),ref:function(e){E.current=e;var n;t.current=null!==(n=null==e?void 0:e.getScrollerNode())&&void 0!==n?n:null}},o,m),{children:[(0,r.jsx)("div",{
className:xg().maxWidthWrapper,children:(0,r.jsx)(gg,{guild:n})}),(0,r.jsxs)("div",{className:lh()(xg().homeContent,xg().maxWidthWrapper),children:[(0,r.jsxs)("div",{className:xg().mainContent,children:[(0,r.jsx)(Jg.Z,{guildId:n.id,welcomeMessage:_}),I&&(0,r.jsx)(Zg.Z,{guildId:n.id}),!I||O?(0,r.jsx)($g,{guild:n,isNewMember:I}):null]}),O?null:(0,r.jsx)(Dg,{guild:n,isNewMember:I})]})]}))}})})]}),h?(0,r.jsx)(Sg,{pageWidth:i,onSidebarResize:function(e,t){u(t);p(e)}}):null]})}));const pC=function(e){var t=e.guildId,n=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(t)}),[t]),i=_v(),a=(0,s.e7)([fv.Z],(function(){return fv.Z.hasLoadedExperiments})),c=(0,Qb.g)(t);o.useLayoutEffect((function(){!function(e){O.Z.dispatch({type:"GUILD_HOME_ENSURE_HOME_SESSION",guildId:e})}(t)}),[t]);o.useEffect((function(){if(a){var e=yv.Z.getHomeSessionSource(t),n=(0,mv.YM)(t)||c;if(null!=i){var r=i.channelId,o=i.messageId;if(!n){(0,sv.jd)(r,o);return}e=eO.SB.HIGHLIGHTS}else if(!n){f.Z.escapeToDefaultChannel(t)
;return}!function(e,t){Ie.default.track(M.rMx.HOME_OPENED,{guild_id:e,home_session_id:yv.Z.getHomeSessionId(e),home_session_source:t})}(t,e)}}),[t,i,a,c]);return null==n?(0,r.jsx)(Eb.Z,{channelId:void 0}):c?(0,r.jsx)(dC,{guild:n}):(0,r.jsx)(fC,{guild:n})};var hC=n(630346),EC=n(130585),yC=n(153771),mC=n(714305),bC=n(976685),gC=n(886391),OC=n(201615),vC=n(989280),_C=n(571094),IC=n.n(_C),SC=n(692760),TC=n.n(SC);const NC=function(e){var t=e.onCancel,n=e.onLeave,o=e.guild,i=void 0===o?null:o;return(0,r.jsxs)("div",{className:IC().confirmation,children:[(0,r.jsxs)("div",{className:IC().confirmationContent,children:[null!==i?(0,r.jsx)(tg.Z,{size:tg.Z.Sizes.LARGER,guild:i,className:IC().guildIcon}):(0,r.jsx)("img",{alt:Q.Z.Messages.MEMBER_VERIFICATION_PENDING_APPLICATION_ICON,src:TC(),className:IC().verificationStateIcon}),(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:IC().header,
children:null!=(null==i?void 0:i.name)?Q.Z.Messages.MEMBER_VERIFICATION_APPLICATION_CONFIRMATION_TITLE_WITH_GUILD_NAME.format({guildName:i.name}):Q.Z.Messages.MEMBER_VERIFICATION_APPLICATION_CONFIRMATION_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"header-secondary",children:Q.Z.Messages.MEMBER_VERIFICATION_APPLICATION_CONFIRMATION_SUBTITLE})]}),(0,r.jsxs)("div",{className:IC().confirmationButtonColumn,children:[(0,r.jsx)(c.zxk,{onClick:t,look:c.zxk.Looks.LINK,color:c.zxk.Colors.LINK,size:c.zxk.Sizes.SMALL,children:Q.Z.Messages.MEMBER_VERIFICATION_CANCEL_APPLICATION}),(0,r.jsx)(c.zxk,{onClick:n,look:c.zxk.Looks.LINK,color:c.zxk.Colors.LINK,size:c.zxk.Sizes.SMALL,children:Q.Z.Messages.MEMBER_VERIFICATION_PENDING_APPLICATION_MODAL_WITHDRAW_AND_LEAVE})]})]})};var AC=n(680068),CC=n(79543),PC=n(748492),jC=n.n(PC);function RC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xC(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value
}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function MC(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function wC(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function DC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()
}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return RC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return RC(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ZC=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,
o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};const LC=function(e){var t,n=e.guildId,i=e.inviteCode,a=DC(o.useState(CC.hO.INITIAL),2),l=a[0],u=a[1],f=(0,s.e7)([bC.Z],(function(){return bC.Z.get(n)})),d=(0,s.e7)([OC.Z],(function(){return OC.Z.getRequest(n)})),p=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(n)})),h=(0,s.cj)([OC.Z],(function(){return{hasFetchedRequestToJoinGuilds:OC.Z.hasFetchedRequestToJoinGuilds,
guildPreviewDisabled:OC.Z.getJoinRequestGuild(n)}})),E=h.hasFetchedRequestToJoinGuilds,y=h.guildPreviewDisabled;o.useEffect((function(){null!=p&&(0,K.uL)(M.Z5c.CHANNEL(n))}),[p,n]);o.useEffect((function(){E||yC.Z.fetchRequestToJoinGuilds()}),[E]);var m=o.useCallback((function(e){u((function(t){return Math.max(t,e)}))}),[]),b=function(e,t){return function(){(0,c.h7j)((function(n){return(0,r.jsx)(c.sm4,wC(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){MC(e,t,n[t])}))}return e}({header:Q.Z.Messages.MEMBER_VERIFICATION_CONFIRM_LEAVE_TITLE,cancelText:Q.Z.Messages.NEVERMIND,onConfirm:t,confirmText:Q.Z.Messages.YES_TEXT,confirmButtonColor:c.zxk.Colors.RED},n),{children:(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"header-secondary",
children:e})}))}))}},g=function(){var e,t=(e=function(e){return ZC(this,(function(t){switch(t.label){case 0:return[4,mC.Z.submitVerificationForm(n,e)];case 1:t.sent();return[2]}}))},function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){xC(i,r,o,a,s,"next",e)}function s(e){xC(i,r,o,a,s,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}(),O=function(){yC.Z.resetGuildJoinRequest(n)},v=b(Q.Z.Messages.LEAVE_SERVER_BODY.format({name:null==p?void 0:p.toString()}),(function(){u(Math.max(l,CC.hO.FILLING));yC.Z.removeGuildJoinRequest(n);(0,K.uL)(M.Z5c.ME)})),_=null!=(null==f||null===(t=f.guild)||void 0===t?void 0:t.splash)?Ds.ZP.getGuildSplashURL({id:f.guild.id,splash:f.guild.splash}):(0,EC.gK)();return(0,r.jsx)("div",{className:jC().page,children:(0,r.jsxs)(hC.Z,{embedded:!0,splash:_,waveState:l,showLogo:!1,updateWaveState:m,children:[(0,r.jsx)("div",{className:jC().dragRegion}),(0,r.jsx)("div",{
className:jC().contentWrapper,children:function(){switch(null==d?void 0:d.applicationStatus){case gC.wB.SUBMITTED:return(0,r.jsx)(NC,{onCancel:b(Q.Z.Messages.MEMBER_VERIFICATION_CANCEL_PENDING_APPLICATION_MODAL_TITLE,O),onLeave:v,guild:y});case gC.wB.REJECTED:return(0,r.jsx)(vC.Z,{reapplyText:Q.Z.Messages.MEMBER_VERIFICATION_APPLICATION_REAPPLY,onReapply:O,confirmText:Q.Z.Messages.LEAVE_SERVER,onConfirm:v,rejectionReason:null==d?void 0:d.rejectionReason,guild:y});default:return(0,r.jsx)(AC.Z,{guildId:n,inviteCode:i,onComplete:g})}}()})]})})};var UC=n(722406),kC=n(460259);function GC(e){var t=e.guildId;return(0,s.e7)([kC.Z],(function(){return kC.Z.getSelectedGuildJoinRequest(t)}),[t])}var BC=n(842227),HC=n(347365);function VC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function FC(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function YC(e,t,n){t in e?Object.defineProperty(e,t,{
value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function zC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){YC(e,t,n[t])}))}return e}function WC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return VC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name)
;if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VC(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var KC=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,
o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},qC=gC.tB*gC.hW;function XC(e){var t=e.guildId,n=e.guildJoinRequests,r=o.useRef(!1),i=WC(o.useState(null),2),a=i[0],s=i[1],c=o.useRef(null),l=o.useRef(!1),u=o.useCallback(function(){var e,o=(e=function(e,o){var i,u,f,d,p,h;return KC(this,(function(E){switch(E.label){case 0:if(r.current)return[2];i="".concat(e,"-").concat(o);u=!1;if(i!==c.current){c.current=i;l.current=!1;u=!0}if(l.current)return[2];null!=a&&s(null);f=function(e,t,n,r){var o=n===gC.wB.SUBMITTED;if(t===gC.Nw.TIMESTAMP_DESC){if(r)return{before:BC.default.fromTimestamp((new Date).getTime())};var i=e[e.length-1];return{
before:o?i.id:i.actionedAt}}if(r)return{after:BC.default.fromTimestamp(fO()().subtract(180,"days").valueOf())};var a=e[e.length-1];return{after:o?a.id:a.actionedAt}}(n,e,o,u);E.label=1;case 1:E.trys.push([1,3,4,5]);r.current=!0;return[4,yC.Z.fetchGuildJoinRequests(zC({guildId:t,status:o,limit:qC},f))];case 2:null!=(d=E.sent())&&d.body.guild_join_requests.length<qC&&(l.current=!0);return[3,5];case 3:p=E.sent();h=new HC.Hx(p);s(h.getAnyErrorMessage());return[3,5];case 4:r.current=!1;return[7];case 5:return[2]}}))},function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){FC(i,r,o,a,s,"next",e)}function s(e){FC(i,r,o,a,s,"throw",e)}a(void 0)}))});return function(e,t){return o.apply(this,arguments)}}(),[a,t,n]);return{fetchNextPage:u,error:a}}function QC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $C(e){return function(e){if(Array.isArray(e))return QC(e)}(e)||function(e){
if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return QC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return QC(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var JC=n(408114);const eP=function(e){var t=e.className,n=e.sortOrder,i=e.onSortChange,a=o.useMemo((function(){return[{value:gC.Nw.TIMESTAMP_DESC,label:Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_SORT_NEWEST},{value:gC.Nw.TIMESTAMP_ASC,label:Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_SORT_OLDEST}]}),[]);return(0,r.jsx)(c.q4e,{className:t,onChange:i,value:n,options:a})}
;var tP=n(120306),nP=n(463803),rP=n.n(nP);const oP=function(e){var t=e.pendingGuildJoinRequestsTotal,n=e.applicationStatus,o=e.onTabItemSelect;return(0,r.jsxs)(Og.Z,{className:rP().container,hideSearch:!0,toolbar:(0,r.jsx)("div",{}),children:[(0,r.jsx)(Og.Z.Icon,{icon:tP.Z,disabled:!0,"aria-label":Q.Z.Messages.MEMBER_VERIFICATION_MEMBER_APPLICATIONS}),(0,r.jsx)(Og.Z.Title,{className:rP().title,children:Q.Z.Messages.MEMBER_VERIFICATION_MEMBER_APPLICATIONS}),(0,r.jsx)(Og.Z.Divider,{className:rP().divider}),(0,r.jsxs)(c.njP,{"aria-label":Q.Z.Messages.FRIENDS,selectedItem:n,type:"top-pill",onItemSelect:o,className:rP().tabBar,children:[(0,r.jsx)(c.njP.Item,{id:gC.wB.SUBMITTED,children:0===t?Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_PENDING:Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_PENDING_COUNT.format({count:t})}),(0,r.jsx)(c.njP.Item,{id:gC.wB.APPROVED,children:Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_APPROVED}),(0,r.jsx)(c.njP.Item,{id:gC.wB.REJECTED,
children:Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_REJECTED})]})]})};var iP=n(106200),aP=n(298182),sP=n(509644),cP=n(469215),lP=n.n(cP);function uP(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fP(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function dP(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){fP(i,r,o,a,s,"next",e)}function s(e){fP(i,r,o,a,s,"throw",e)}a(void 0)}))}}function pP(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function hP(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){
return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function EP(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return uP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uP(e,t)}(e,t)||function(){
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var yP=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){
a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function mP(e){var t=e.icon,n=e.onClick,o=e.submitting,i=e.disabled;return(0,r.jsx)(c.P3F,{className:lh()(lP().actionIconContainer,pP({},lP().disabled,i||o)),onClick:n,children:o?(0,r.jsx)(c.bbz,{className:lP().icon,dotRadius:2,themed:!0}):(0,r.jsx)(t,{className:lP().icon,height:12,width:12})})}function bP(e){var t=e.applicationStatus,i=e.guild,a=e.guildJoinRequest,s=e.className,l=e.onClick,u=EP(o.useState(null),2),f=u[0],d=u[1],p=a.user,h=a.createdAt;if(null==p)throw new Error("Missing user on this guild join request!");var E=o.useMemo((function(){return new UC.Z(p)}),[p]),y=Ds.ZP.getUserAvatarURL(E),m=t===gC.wB.SUBMITTED,b=o.useCallback(function(){var e=dP((function(e,t){var n,r;return yP(this,(function(o){switch(o.label){case 0:n=e.guildId,r=e.userId
;if(null!=f)return[2];d(t);o.label=1;case 1:o.trys.push([1,3,,4]);return[4,yC.Z.updateGuildJoinRequest(n,r,t)];case 2:o.sent();return[3,4];case 3:o.sent();(0,c.CFj)((0,c.Yz2)(Q.Z.Messages.ERROR_GENERIC_TITLE,c.pCN.FAILURE));d(null);return[3,4];case 4:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}(),[f]),g=function(){var e=dP((function(){return yP(this,(function(e){switch(e.label){case 0:return[4,b(a,gC.wB.APPROVED)];case 1:e.sent();return[2]}}))}));return function(){return e.apply(this,arguments)}}(),O=function(){var e=dP((function(){return yP(this,(function(e){switch(e.label){case 0:return[4,b(a,gC.wB.REJECTED)];case 1:e.sent();return[2]}}))}));return function(){return e.apply(this,arguments)}}();return(0,r.jsxs)(c.P3F,{className:lh()(lP().container,s),onClick:l,children:[(0,r.jsx)(c.qEK,{src:y,size:c.EFr.SIZE_40,"aria-label":p.username,className:lP().spacer}),(0,r.jsxs)("div",{className:lP().userDetails,children:[(0,r.jsx)(c.xvT,{variant:"text-md/semibold",
color:"header-primary",children:p.username}),(0,r.jsx)(c.xvT,{className:lP().createdAt,variant:"text-sm/normal",color:"header-secondary",children:fO()(h).format("lll")})]}),m&&(0,r.jsx)(mP,{icon:gA.Z,onClick:g,submitting:f===gC.wB.APPROVED,disabled:null!=f&&f!==gC.wB.APPROVED}),m&&(0,r.jsx)(mP,{icon:Ub.Z,onClick:O,submitting:f===gC.wB.REJECTED,disabled:null!=f&&f!==gC.wB.REJECTED}),(0,r.jsx)(c.P3F,{className:lh()(lP().overflowMenuContainer,pP({},lP().disabled,null!=f)),onClick:function(e){(0,Ob.jW)(e,dP((function(){var e,t;return yP(this,(function(o){switch(o.label){case 0:return[4,n.e(50764).then(n.bind(n,450764))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,hP(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){
pP(e,t,n[t])}))}return e}({},e),{guild:i,user:E}))}]}}))})),{position:"bottom",align:"right"})},children:(0,r.jsx)(IS.Z,{className:lP().icon,width:18})})]})}function gP(){var e="".concat(Math.floor(50*Math.random())+100,"px"),t="".concat(Math.floor(25*Math.random())+50,"px");return(0,r.jsxs)("div",{className:lP().placeholder,children:[(0,r.jsx)("div",{className:lh()(lP().placeholderAvatar)}),(0,r.jsxs)("div",{className:lP().userDetails,children:[(0,r.jsx)("div",{className:lP().placeholderUsername,style:{maxWidth:e}}),(0,r.jsx)("div",{className:lP().placeholderCreatedAt,style:{maxWidth:t}})]})]})}function OP(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function vP(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e)
;for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}var _P=function(){return null};function IP(e,t){var n=t.toLocaleString();switch(e){case gC.wB.SUBMITTED:return Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_PENDING_COUNT_HYPEN.format({count:n});case gC.wB.REJECTED:return Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_REJECTED_COUNT_HYPEN.format({count:n});case gC.wB.APPROVED:return Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_APPROVED_COUNT_HYPEN.format({count:n});default:return""}}function SP(e){var t=e.status,n=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_EMPTY_PENDING_APPLICATIONS_TITLE,o=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_EMPTY_PENDING_APPLICATIONS_BODY;switch(t){case gC.wB.REJECTED:n=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_EMPTY_REJECTED_APPLICATIONS_TITLE;o=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_EMPTY_REJECTED_APPLICATIONS_BODY;break;case gC.wB.APPROVED:
n=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_EMPTY_APPROVED_APPLICATIONS_TITLE;o=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_EMPTY_APPROVED_APPLICATIONS_BODY;break;default:n=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_EMPTY_PENDING_APPLICATIONS_TITLE;o=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_EMPTY_PENDING_APPLICATIONS_BODY}return(0,r.jsxs)("div",{className:lP().emptyContainer,children:[(0,r.jsxs)("div",{className:lP().emptyIcon,children:[(0,r.jsx)(sP.Z,{className:lP().star}),(0,r.jsx)(gA.Z,{className:lP().checkmark}),(0,r.jsx)(aP.Z,{className:lP().plus})]}),(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",children:n}),(0,r.jsx)(c.xvT,{color:"header-secondary",className:lP().emptyBody,variant:"text-sm/normal",children:o})]})}const TP=function(e){var t=e.applicationStatus,n=e.guildJoinRequests,o=e.guildId,i=e.onScroll,a=e.listRef,l=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(o)}),[o]),u=(0,s.e7)([kC.Z],(function(){return kC.Z.isFetching()
})),f=u?[n.length+25]:[n.length],d=GC({guildId:o}),p=(0,JC.A)({guildId:o}),h=(0,iP.Z)("guild-join-requests"),E=function(e){var i,a=e.row,s=n[a];return null==s?(0,r.jsx)(gP,{},a):(0,r.jsx)(bP,{className:lh()((i={},OP(i,lP().selected,d===s),OP(i,lP().siblingSelected,d===n[a-1]),i)),guild:l,guildJoinRequest:s,onClick:function(){return yC.Z.setSelectedGuildJoinRequest(o,s)},applicationStatus:t},"".concat(s.userId,"-").concat(s.applicationStatus,"-").concat(a))};return u||0!==n.length?(0,r.jsxs)(r.Fragment,{children:[0!==p&&t===gC.wB.SUBMITTED&&(0,r.jsx)(c.xvT,{className:lP().title,variant:"text-xs/semibold",color:"header-secondary",children:IP(t,p).toUpperCase()}),(0,r.jsx)(pb.bG,{navigator:h,children:(0,r.jsx)(pb.SJ,{children:function(e){var t=e.ref,n=e.role,o=vP(e,["ref","role"]);return(0,r.jsx)(c.aVo,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){OP(e,t,n[t])}))}return e}({innerRole:n,innerAriaLabel:Q.Z.Messages.MEMBERS,ref:function(e){a.current=e;var n;t.current=null!==(n=null==e?void 0:e.getScrollerNode())&&void 0!==n?n:null},paddingTop:0,paddingBottom:16,sectionHeight:0,rowHeight:64,renderSection:_P,renderRow:E,sections:f,onScroll:i,fade:!0},o),"guild-application-review")}})})]}):(0,r.jsx)(SP,{status:t})};var NP=n(203623),AP=n.n(NP);function CP(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function PP(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){CP(i,r,o,a,s,"next",e)}function s(e){CP(i,r,o,a,s,"throw",e)}a(void 0)}))}}var jP=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1]
;return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}
;function RP(e){var t=e.guildId,n=o.useRef(null),i=function(e){var t=e.guildId;return(0,s.e7)([kC.Z],(function(){return kC.Z.getSelectedApplicationStatus(t)}),[t])}({guildId:t}),a=function(e){var t=e.guildId;return(0,s.e7)([kC.Z],(function(){return kC.Z.getSelectedSortOrder(t)}),[t])}({guildId:t}),l=GC({guildId:t}),u=(0,JC.A)({guildId:t}),f=function(e){var t=e.guildId,n=e.applicationStatus,r=e.sortOrder,i=(0,s.e7)([kC.Z],(function(){return kC.Z.getRequests(t,n)}),[n,t]);return{guildJoinRequests:o.useMemo((function(){return r===gC.Nw.TIMESTAMP_DESC?$C(i).reverse():i}),[r,i])}}({guildId:t,applicationStatus:i,sortOrder:a}).guildJoinRequests,d=XC({guildId:t,guildJoinRequests:f}).fetchNextPage,p=o.useRef(!1);if(!p.current){p.current=!0;d(a,i)}var h=o.useRef(!1);o.useEffect((function(){h.current=!0}),[a,i]);o.useEffect((function(){if(h.current&&0!==f.length){var e;h.current=!1;yC.Z.setSelectedGuildJoinRequest(t,f[0]);null===(e=n.current)||void 0===e||e.scrollToTop()}}),[t,f,l])
;var E=o.useCallback(function(){var e=PP((function(e){return jP(this,(function(n){switch(n.label){case 0:if(a===e)return[2];yC.Z.setSelectedSortOrder(t,e);return[4,d(e,i)];case 1:n.sent();return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),[i,a,t,d]),y=o.useCallback(function(){var e=PP((function(e){return jP(this,(function(n){switch(n.label){case 0:if(i===e)return[2];yC.Z.setSelectedApplicationStatus(t,e);yC.Z.setSelectedGuildJoinRequest(t,null);return[4,d(a,e)];case 1:n.sent();return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),[i,a,t,d]),m=o.useCallback(PP((function(){var e,t;return jP(this,(function(r){switch(r.label){case 0:return null==(t=null===(e=n.current)||void 0===e?void 0:e.getScrollerState())?[2]:t.scrollHeight-t.scrollTop-t.offsetHeight<200?[4,d(a,i)]:[3,2];case 1:r.sent();r.label=2;case 2:return[2]}}))})),[i,a,d]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(oP,{applicationStatus:i,onTabItemSelect:y,pendingGuildJoinRequestsTotal:u
}),(0,r.jsxs)("div",{className:AP().content,children:[(0,r.jsx)("div",{className:AP().listControls,children:(0,r.jsx)(eP,{className:AP().sortSelect,sortOrder:a,onSortChange:E})}),(0,r.jsx)(c.xvT,{className:AP().description,variant:"text-xs/normal",color:"header-secondary",children:Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_LIST_DESCRIPTION}),(0,r.jsx)(TP,{applicationStatus:i,guildJoinRequests:f,guildId:t,onScroll:m,listRef:n})]})]})}const xP=o.memo(RP);var MP=n(104630);function wP(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function DP(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function ZP(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function LP(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=ZP(e,["width","height","color","foreground"]);return(0,r.jsx)("svg",DP(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){wP(e,t,n[t])}))}return e}({},(0,
OO.Z)(l)),{width:n,height:i,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{className:c,fill:s,d:"M12 1L3 5V11C3 16.55 6.84 21.74 12 23C17.16 21.74 21 16.55 21 11V5L12 1ZM12 11.99H19C18.47 16.11 15.72 19.78 12 20.93V12H5V6.3L12 3.19V11.99Z"})}))}var UP=n(668844),kP=n(448124),GP=n(434823),BP=n(388025),HP=n(880213);const VP=function(e){var t=e.formFields,n=e.user;return null==(0,s.e7)([Y.default],(function(){return null!=n?n:Y.default.getCurrentUser()}))?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(UP.Ih,{icon:LP,text:Q.Z.Messages.MEMBER_VERIFICATION_FORM_PASSED_REQUIREMENTS,meetsRequirement:!0}),t.map((function(e,t){return function(e,t){switch(e.field_type){case gC.QJ.TERMS:return(0,r.jsx)(BP.QC,{formField:e},t);case gC.QJ.TEXT_INPUT:return(0,r.jsx)(HP.YJ,{formField:e},t);case gC.QJ.PARAGRAPH:return(0,r.jsx)(GP.jn,{formField:e},t);case gC.QJ.MULTIPLE_CHOICE:return(0,r.jsx)(kP.QH,{formField:e},t)}}(e,t)}))]})};var FP=n(83623),YP=n(127661),zP=n(449401),WP=n(71193),KP=n.n(WP)
;function qP(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function XP(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function QP(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){XP(i,r,o,a,s,"next",e)}function s(e){XP(i,r,o,a,s,"throw",e)}a(void 0)}))}}function $P(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function JP(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e
}function ej(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qP(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var tj=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={
next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},nj=24;function rj(e){
var t,i=e.guildJoinRequest,a=e.guild,l=e.guildJoinRequestUser,u=ej(o.useState(!1),2),f=u[0],d=u[1],p=i.createdAt,h=i.actionedAt,E=i.guildId,y=i.userId,m=null===(t=i.actionedByUser)||void 0===t?void 0:t.id,b=(0,s.e7)([Y.default],(function(){return Y.default.getUser(m)})),g=(0,s.e7)([qa.ZP],(function(){return null!=m?qa.ZP.getMember(E,m):null}),[m,E]),O=o.useCallback((function(){(0,c.CFj)((0,c.Yz2)(Q.Z.Messages.ERROR_GENERIC_TITLE,c.pCN.FAILURE))}),[]),v=function(){var e=QP((function(){return tj(this,(function(e){switch(e.label){case 0:if(f)return[2];d(!0);e.label=1;case 1:e.trys.push([1,3,4,5]);return[4,yC.Z.updateGuildJoinRequest(E,y,gC.wB.APPROVED)];case 2:e.sent();return[3,5];case 3:e.sent();O();return[3,5];case 4:d(!1);return[7];case 5:return[2]}}))}));return function(){return e.apply(this,arguments)}}(),_=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_PENDING,I=(0,r.jsx)(zP.Z,{width:nj,height:nj,className:KP().icon});if(i.applicationStatus===gC.wB.APPROVED){
_=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_APPROVED;I=(0,r.jsx)(FP.Z,{width:nj,height:nj,className:KP().iconApproved,backgroundColor:$b.Z.unsafe_rawColors.WHITE_500.css})}else if(i.applicationStatus===gC.wB.REJECTED){_=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_REJECTED;I=(0,r.jsx)(YP.Z,{width:nj,height:nj,className:KP().iconRejected,backgroundColor:$b.Z.unsafe_rawColors.WHITE_500.css})}var S=null!=b&&null!=h?Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_ACTIONED_BY_HOOK.format({date:fO()(BC.default.extractTimestamp(h)).format("ll"),usernameHook:function(){var e;return(0,r.jsx)(c.P3F,{className:KP().actionedByUser,onClick:function(){return(0,xp.m)({userId:b.id,guildId:E,analyticsLocation:{section:M.jXE.GUILD_MEMBER_VERIFICATION_APPLICATION_REVIEW,object:M.qAy.ACTIONED_BY_USER}})},tag:"div",role:"link",children:(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"header-primary",children:null!==(e=null==g?void 0:g.nick)&&void 0!==e?e:b.username})},"username-hook")}
}):fO()(p).format("lll");return(0,r.jsxs)("div",{className:KP().container,children:[(0,r.jsxs)("div",{className:KP().wrapper,children:[(0,r.jsxs)("div",{className:KP().inline,children:[I,(0,r.jsxs)("div",{children:[(0,r.jsx)(c.X6q,{variant:"heading-sm/semibold",children:_}),(0,r.jsx)(c.xvT,{className:KP().headerSubtext,variant:"text-xs/normal",color:"header-secondary",children:S})]})]}),(0,r.jsxs)("div",{className:KP().inline,children:[i.applicationStatus===gC.wB.SUBMITTED&&(0,r.jsxs)("div",{className:KP().buttons,children:[(0,r.jsx)(c.zxk,{color:c.zxk.Colors.GREEN,submitting:f,onClick:function(){return v()},children:Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_APPROVE_APPLICATION}),(0,r.jsx)(c.zxk,{color:c.zxk.Colors.RED,onClick:function(){(0,c.ZDy)(QP((function(){var e,t;return tj(this,(function(o){switch(o.label){case 0:return[4,n.e(28478).then(n.bind(n,528478))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,{modalProps:e,guildId:E,userId:y,onError:O})}]}
}))})))},disabled:f,children:Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_DENY_APPLICATION})]}),(0,r.jsx)(c.P3F,{onClick:function(e){(0,Ob.jW)(e,QP((function(){var e,t;return tj(this,(function(o){switch(o.label){case 0:return[4,n.e(50764).then(n.bind(n,450764))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,JP(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){$P(e,t,n[t])}))}return e}({},e),{guild:a,user:l}))}]}}))})))},className:KP().overflow,children:(0,r.jsx)(IS.Z,{width:20,height:20,className:KP().iconInteractive})})]})]}),i.applicationStatus===gC.wB.REJECTED&&null!=i.rejectionReason&&(0,r.jsx)("div",{className:KP().rejectionReason,children:(0,r.jsx)(c.xvT,{variant:"text-sm/normal",children:i.rejectionReason
})})]})}var oj=n(133222),ij=n.n(oj);function aj(e){var t=e.user,n=e.className,o=t.discriminator,i=t.username,a=Ds.ZP.getUserAvatarURL(t);return(0,r.jsxs)("div",{className:lh()(ij().container,n),children:[(0,r.jsx)(c.qEK,{src:a,size:c.EFr.SIZE_80,"aria-label":i,className:ij().avatar}),(0,r.jsxs)("div",{className:ij().username,children:[(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",children:i}),(0,r.jsxs)(c.xvT,{variant:"text-md/normal",color:"header-secondary",children:["#",o]})]}),(0,r.jsx)(c.eee,{onClick:function(){(0,xp.m)({userId:t.id,analyticsLocation:{section:M.jXE.GUILD_MEMBER_VERIFICATION_APPLICATION_REVIEW,object:M.qAy.JOIN_REQUEST}})},children:Q.Z.Messages.VIEW_PROFILE})]})}var sj=n(364260),cj=n.n(sj);const lj=function(e){var t,n=e.guild,i=e.guildJoinRequest,a=e.guildJoinRequestUser,s=e.onClose,l=o.useMemo((function(){return null!==(t=i.formResponses)&&void 0!==t?t:[]}),[i.formResponses]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(kb.ZP,{toolbar:(0,r.jsx)(kb.ZP.Icon,{
icon:Ub.Z,onClick:s,tooltip:Q.Z.Messages.CLOSE}),children:[(0,r.jsx)(kb.ZP.Icon,{icon:MP.Z,disabled:!0,"aria-label":Q.Z.Messages.MEMBER_VERIFICATION_MEMBER_APPLICATION}),(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:lp.ZP.getName(a)})]}),(0,r.jsx)(rj,{guildJoinRequest:i,guildJoinRequestUser:a,guild:n}),(0,r.jsxs)(c.Ttm,{children:[(0,r.jsx)(aj,{user:a,className:cj().container}),(0,r.jsx)("div",{className:cj().disabledFormRenderer,children:(0,r.jsx)(VP,{guildId:n.id,formFields:l,user:a})})]})]})};var uj=n(509197),fj=n.n(uj);const dj=function(e){var t=e.guildId,n=GC({guildId:t}),i=(null!=n?n:{}).user,a=o.useMemo((function(){return null!=i?new UC.Z(i):null}),[i]),c=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(t)}),[t]);(0,Am.Tt)({subsection:Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_REQUIREMENTS,location:null==c?void 0:c.name});o.useEffect((function(){mC.Z.fetchVerificationForm(t)}),[t]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:fj().content,
children:(0,r.jsx)(xP,{guildId:t})}),null!=n&&null!=c&&null!=a&&(0,r.jsx)("section",{className:fj().sidebar,children:(0,r.jsx)(lj,{guild:c,guildJoinRequest:n,guildJoinRequestUser:a,onClose:function(){return yC.Z.setSelectedGuildJoinRequest(t,null)}})})]})};var pj=n(630203),hj=n(995247),Ej=n(877475),yj=n(190186),mj=n(795909),bj=n(439683),gj=n(510758),Oj=n(18882),vj=n(971611),_j=n(531441),Ij=n(786522),Sj=n(968968),Tj=n(347834),Nj=n(873629);function Aj(e){O.Z.dispatch({type:"CLEAR_PENDING_CHANNEL_AND_ROLE_UPDATES",guildId:e})}function Cj(e,t,n){return(0,s.e7)([cp.Z],(function(){return t===n?cp.Z.isChannelOptedIn(e,t,!0):function(e,t,n){return!!(0,Nj.hi)(e)||n.isChannelOptedIn(e,t,!0)}(e,t,cp.Z)||null!=n&&cp.Z.isChannelOptedIn(e,n,!0)}))}function Pj(e,t,n){return(0,s.e7)([cp.Z],(function(){return t!==n&&null!=n&&cp.Z.isChannelOptedIn(e,n,!0)}))}var jj=n(33941),Rj=n(489610),xj=n(678510),Mj=n.n(xj),wj=n(522627),Dj=n.n(wj);function Zj(e,t,n){t in e?Object.defineProperty(e,t,{value:n,
enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Lj(e){var t=e.guild,n=(0,Rj.te)(t.id),o=(0,un.wE)(ln.z$.GUILD_HEADER_COMMUNITY_ONBOARDING_ADMIN_UPSELL),i=n&&!o?ln.z$.GUILD_HEADER_COMMUNITY_ONBOARDING_ADMIN_UPSELL:ln.z$.CHANNEL_BROWSER_NUX;(0,un.kk)(i);var a=n?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(c.X6q,{className:Mj().heading,color:"always-white",variant:"heading-lg/semibold",children:Q.Z.Messages.CHANNEL_BROWSER_ADMIN_NUX_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"always-white",children:Q.Z.Messages.CHANNEL_BROWSER_ADMIN_NUX_DESCRIPTION}),(0,r.jsx)(c.zxk,{className:Mj().checkItOut,onClick:function(){pr.Z.open(t.id,M.pNK.ONBOARDING);(0,un.EW)(i,{dismissAction:hn.L.PRIMARY})},look:c.zxk.Looks.INVERTED,children:(0,r.jsx)(c.xvT,{variant:"text-md/medium",color:"none",children:Q.Z.Messages.CHANNEL_BROWSER_ADMIN_NUX_CTA})})]}),(0,r.jsx)(jj.j,{isTooltip:!0})]}):(0,r.jsxs)("div",{className:Mj().nuxContent,children:[(0,
r.jsx)("img",{width:180,className:Mj().image,src:Dj(),alt:"","aria-hidden":!0}),(0,r.jsxs)("div",{children:[(0,r.jsx)(c.X6q,{className:Mj().heading,variant:"heading-lg/semibold",color:"header-primary",children:Q.Z.Messages.CHANNEL_BROWSER_NUX_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"header-secondary",children:Q.Z.Messages.CHANNEL_BROWSER_NUX_DESCRIPTION}),(0,r.jsx)(c.xvT,{className:Mj().tip,variant:"text-md/normal",color:"header-secondary",children:Q.Z.Messages.CHANNEL_BROWSER_NUX_DESCRIPTION_2.format()})]})]});return(0,r.jsxs)("div",{className:lh()(Mj().container,Zj({},Mj().adminUpsell,n)),children:[(0,r.jsx)(c.P3F,{className:Mj().closeButton,onClick:function(){(0,un.EW)(i,{dismissAction:hn.L.DISMISS})},children:(0,r.jsx)(Ub.Z,{})}),a]})}var Uj=n(112598),kj=n.n(Uj);function Gj(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Bj(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){
var i=e.apply(t,n);function a(e){Gj(i,r,o,a,s,"next",e)}function s(e){Gj(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Hj(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Vj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Hj(e,t,n[t])}))}return e}function Fj(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var Yj=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}
o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},zj=new Set([M.d4z.GUILD_FORUM]),Wj=new Set([M.d4z.GUILD_VOICE,M.d4z.GUILD_STAGE_VOICE]);function Kj(e){var t=e.guild,o=e.channel,i=e.onCategoryClick,a=Cj(t.id,o.id,o.id),s=Pj(t.id,o.id,o.id);return(0,r.jsxs)("div",{className:lh()(kj().categoryRow,Hj({},kj().uncategorized,"null"===o.id)),onContextMenu:function(e){(0,Ob.jW)(e,Bj((function(){var e,i;return Yj(this,(function(a){switch(a.label){case 0:return[4,n.e(96006).then(n.bind(n,696006))];case 1:e=a.sent(),i=e.default;return[2,function(e){return(0,r.jsx)(i,Fj(Vj({},e),{channel:o,guild:t}))}]}}))})))},children:[(0,r.jsx)(c.xvT,{className:kj().categoryText,color:"text-muted",variant:"text-xs/semibold",lineClamp:1,children:o.name}),"null"!==o.id&&!s&&(0,r.jsxs)(c.P3F,{className:kj().selectAll,onClick:function(){s||i(t.id,o.id,o.id)},children:[(0,r.jsx)(c.XZJ,{
className:kj().selectAllCheckbox,size:14,shape:c.XZJ.Shapes.SMALL_BOX,value:a,type:c.XZJ.Types.INVERTED,displayOnly:!0}),(0,r.jsx)(c.xvT,{color:"text-muted",variant:"text-xs/medium",children:Q.Z.Messages.CHANNEL_BROWSER_SELECT_ALL})]})]})}var qj=o.memo((function(){return(0,r.jsx)("div",{className:kj().separator})})),Xj=o.memo((function(e){var t=e.index;return(0,r.jsx)(c.xvT,{variant:"text-xs/normal",className:kj().subtitleSeparator,children:"·"},"separator-".concat(t))}));var Qj=o.memo((function(e){var t,o,i=e.channel,a=e.category,l=e.guild,u=e.isFirstChannel,f=e.isLastChannel,d=e.onChannelClick,p=e.tooltipDirection,h=void 0===p?"right":p,E=Cj(l.id,i.id,a.id),y=Pj(l.id,i.id,a.id),m=(t=l.id,o=a.id,(0,s.e7)([cp.Z],(function(){if(null!=o&&cp.Z.isChannelOptedIn(t,o,!0))return Q.Z.Messages.CHANNEL_BROWSER_DISABLED_BY_CATEGORY}))),b=(0,s.e7)([Oj.Z],(function(){return Oj.Z.getActiveThreadCount(l.id,i.id)})),g=(0,s.e7)([bj.Z],(function(){return bj.Z.getHighlightedMessageIdCount(i.id)})),O=(0,
s.e7)([gj.Z],(function(){return gj.Z.shouldIndicateNewChannel(l.id,i.id)})),v=function(e){if(!y){e.stopPropagation();d(l.id,i.id,a.id);return!0}},_=function(e){i.isGuildVocal()?(0,Ob.jW)(e,Bj((function(){var e,t;return Yj(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(84663),n.e(58539),n.e(26981)]).then(n.bind(n,926981))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Fj(Vj({},e),{channel:i,guild:l}))}]}}))}))):(0,Ob.jW)(e,Bj((function(){var e,t;return Yj(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(84663),n.e(58539),n.e(11261)]).then(n.bind(n,811261))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Fj(Vj({},e),{channel:i,guild:l}))}]}}))})))},I=function(e,t,n){var o=[];n>0&&o.push((0,r.jsx)(c.xvT,{variant:"text-xs/medium",className:kj().channelSubtitle,color:"text-brand",children:Q.Z.Messages.CHANNEL_HIGHLIGHTS_COUNT.format({count:n})},"thread-count"));e.type===M.d4z.GUILD_FORUM&&t>=1&&o.push((0,
r.jsx)(c.xvT,{variant:"text-xs/normal",className:kj().channelSubtitle,children:Q.Z.Messages.ACTIVE_FORUM_POST_COUNT.format({count:t})},"thread-count"));Wj.has(e.type)||o.push((0,r.jsx)(c.xvT,{variant:"text-xs/normal",className:kj().channelSubtitle,children:(0,hj.qw)(e.id)},"active"));null!=e.topic&&e.topic.length>0&&o.push((0,r.jsx)(vj.Z,{children:(0,r.jsx)(c.xvT,{className:kj().topic,variant:"text-xs/normal",children:kg.Z.parseTopic(e.topic,!0,{channelId:e.id})})},"topic"));return[o.map((function(e,t){return[e,(0,r.jsx)(Xj,{index:t},"subtitle-separator-".concat(t))]}))].flat(2).slice(0,-1)}(i,b,g),S=function(e){e.stopPropagation();if(zj.has(i.type)||e.shiftKey){(0,K.XU)(l.id,i.id);return!0}if(i.isGuildStageVoice()||i.isGuildVoice()){(0,c_.Cq)(i);return!0}cd.Z.openChannelAsSidebar({guildId:i.guild_id,channelId:i.id,baseChannelId:Ig.oC.CHANNEL_BROWSER});return!0},T=Q.Z.Messages.CHANNEL_BROWSER_VIEW
;i.isGuildStageVoice()||i.isGuildVoice()?T=Q.Z.Messages.JOIN:i.isForumChannel()&&(T=Q.Z.Messages.OPEN);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.ua7,{text:m,delay:500,position:h,children:function(e){var t;return(0,r.jsxs)(c.P3F,Fj(Vj({className:lh()(kj().channelRow,(t={},Hj(t,kj().firstChannel,u),Hj(t,kj().lastChannel,f),Hj(t,kj().disabled,y),t))},e),{onClick:v,onContextMenu:_,children:[(0,r.jsxs)("div",{className:kj().channelInfo,children:[(0,r.jsxs)("div",{className:kj().channelName,children:[(0,r.jsx)(pj._,{channel:i,guild:l}),(0,r.jsx)(vj.Z,{className:kj().name,children:(0,r.jsx)(c.xvT,{className:kj().channelText,variant:"text-md/medium",lineClamp:1,color:y?"text-muted":"text-normal",children:i.name})}),O?(0,r.jsx)(_j.IG,{text:Q.Z.Messages.NEW,color:$b.Z.unsafe_rawColors.BRAND_260.css,className:kj().titleBadge}):null]}),(0,r.jsx)("div",{className:kj().channelSubtitles,children:I})]}),(0,r.jsxs)("div",{className:kj().channelActions,children:[(0,r.jsx)(c.zxk,{
look:c.iLD.OUTLINED,color:c.Ttl.PRIMARY,size:c.PhG.SMALL,className:kj().viewChannelButton,onClick:S,children:T}),(0,r.jsx)(c.XZJ,{"aria-checked":E,value:E,type:c.XZJ.Types.INVERTED,disabled:y,innerClassName:kj().checkboxInner,displayOnly:!0})]})]}))}}),!f&&(0,r.jsx)(qj,{})]})}));function $j(e){var t,n=e.categories,i=e.guild,a=e.className,l=e.innerClassName,u=e.hasSidebar,f=function(e){var t=(0,s.e7)([cp.Z],(function(){return cp.Z.getPendingChannelUpdates(e)}));o.useEffect((function(){Aj(e);return function(){return Aj(e)}}),[e]);o.useEffect((function(){null!=t&&(0,Tj.C1)(e,t)}),[e,t]);var n=o.useCallback((function(e,t,n){var r=cp.Z.isChannelOptedIn(e,t),o=t===n;!r&&Sj.Z.isCollapsed(n)&&null!=n&&(0,Ij.mJ)(n);(0,Nj.hi)(e)?o?(0,Nj.rz)(e,{include:new Set([t])}):(0,Nj.rz)(e,{exclude:new Set([t])}):(0,Tj.k$)(e,t,!r,{section:M.jXE.CHANNEL_BROWSER})}),[]);return{onChannelClick:n}}(i.id).onChannelClick,d=(0,un.wE)(ln.z$.CHANNEL_BROWSER_NUX)?0:-1,p=o.useCallback((function(e){var t=e.section
;if(0===t&&-1===d)return null;var o=n._categories[t+d];return(0,r.jsx)(Kj,{channel:o.channel,guild:i,onCategoryClick:f},o.channel.id)}),[n,i,d,f]),h=o.useCallback((function(e){var t=e.section,o=e.row;if(0===t&&-1===d)return(0,r.jsx)(Lj,{guild:i});var a=n._categories[t+d],s=n[a.channel.id][o];return null==s?null:(0,r.jsx)(Qj,{category:a.channel,channel:s.channel,guild:i,isFirstChannel:0===o,isLastChannel:n[a.channel.id].length-1===o,tooltipDirection:u?"right":"top",onChannelClick:f},s.channel.id)}),[n,i,d,u,f]),E=(t=i.id,(0,Rj.te)(t)?250:152),y=(0,hj.tn)(i.id,n,64,E);return(0,r.jsx)(c._2F,{className:a,innerClassName:lh()(l,kj().scrollerInner),sectionHeight:48,rowHeight:function(e){return y[e].rowHeight},renderSection:p,renderRow:h,sections:y.map((function(e){return e.rowCount}))},"channel-browser-list")}var Jj=n(820272),eR=n.n(Jj);function tR(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nR(e,t,n,r,o,i,a){try{
var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function rR(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){nR(i,r,o,a,s,"next",e)}function s(e){nR(i,r,o,a,s,"throw",e)}a(void 0)}))}}function oR(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function iR(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function aR(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){
var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return tR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tR(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var sR=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},
"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function cR(e){var t=e.channelId;return(0,r.jsx)(hb.Z,{
sidebarType:hb.y.ThreadSidebar,maxWidth:600,children:(0,r.jsx)(Wb,{channelId:t,baseChannelId:Ig.oC.CHANNEL_BROWSER})})}function lR(e){var t=e.guildId,i=aR(o.useState(""),2),a=i[0],l=i[1],u=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(t)})),f=(0,s.e7)([Hg.ZP],(function(){return Hg.ZP.getChannels(t)})),d=(0,s.e7)([Ej.Z],(function(){return Ej.Z.getCategories(t)})),p=(0,hj.Fo)(t,d,f,a),h=(0,s.e7)([dn.Z],(function(){return dn.Z.canWithPartialContext(M.Plq.MANAGE_CHANNELS,{guildId:t})})),E=(0,s.e7)([ap.ZP],(function(){return null!=ap.ZP.getCurrentSidebarChannelId(Ig.oC.CHANNEL_BROWSER)})),y=o.useCallback((function(){return l("")}),[l]),m=o.useCallback((function(){(0,c.ZDy)(rR((function(){var e,o;return sR(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(94805)]).then(n.bind(n,394805))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,iR(function(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){oR(e,t,n[t])}))}return e}({},e),{channelType:null,guildId:t}))}]}}))})))}),[t]);return null==u?null:(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:lh()(nO().chat,eR().container),children:(0,r.jsxs)("div",{className:lh()(eR().pageBody),children:[(0,r.jsxs)("div",{className:eR().header,children:[(0,r.jsx)(yj.Z,{className:eR().search,size:yj.Z.Sizes.MEDIUM,query:a,onChange:function(e){""===a&&""!==e&&Ie.default.track(M.rMx.SEARCH_STARTED,{search_type:"channel browser"});l(e.toLowerCase())},onClear:y,placeholder:Q.Z.Messages.CHANNEL_BROWSER_SEARCH_PLACEHOLDER}),h?(0,r.jsxs)(c.zxk,{className:eR().createButton,innerClassName:eR().createButtonInner,onClick:m,children:[(0,r.jsx)(mj.Z,{className:eR().createIcon}),Q.Z.Messages.CREATE]
}):null]}),(0,r.jsx)($j,{className:eR().browser,channels:f,categories:p,guild:u,hasSidebar:E})]})})})}var uR=n(353886),fR=n(977997),dR=n(547308),pR=n(80317),hR=n(995141),ER=n(795470),yR=n(129993),mR=n(725691),bR=n(436817),gR=n(170740),OR=n(717091),vR=n(47635),_R=n(888236),IR=n(404741),SR=n(185219);function TR(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function NR(e){O.Z.dispatch({type:"CLEAR_PENDING_CHANNEL_AND_ROLE_UPDATES",guildId:e})}var AR={};function CR(e){var t,n=(0,s.e7)([IR.Z],(function(){return null!==(t=IR.Z.getPendingResponseOptions(e))&&void 0!==t?t:AR}),[e]);o.useEffect((function(){NR(e);return function(){return NR(e)}}),[e]);o.useEffect((function(){null!=n&&0!==Object.keys(n).length&&vR.Z.updateOnboardingResponses(e)}),[e,n]);var r=o.useCallback((function(t,n,r){var o=IR.Z.getOnboardingResponses(e),i=function(e,t,n,r){var o=[],i=[];if(e.singleSelect&&n){var a,s,c,l,u=e.options.find((function(e){
return r.includes(e.id)}));o=Wa().difference(null!==(a=t.roleIds)&&void 0!==a?a:[],null!==(s=null==u?void 0:u.roleIds)&&void 0!==s?s:[]);i=Wa().difference(null!==(c=null==u?void 0:u.roleIds)&&void 0!==c?c:[],null!==(l=t.roleIds)&&void 0!==l?l:[])}else if(n){var f;o=null!==(f=t.roleIds)&&void 0!==f?f:[];i=[]}else{var d=e.options.filter((function(e){return r.includes(e.id)})),p=d.filter((function(e){return t.id!==e.id})),h=d.map((function(e){return e.roleIds})).flat().filter(_o.lm),E=p.map((function(e){return e.roleIds})).flat().filter(_o.lm);o=[];i=Wa().difference(h,E)}return{addedRoleIds:o,removedRoleIds:i}}(t,n,r,o),a=i.addedRoleIds,s=i.removedRoleIds,c=function(e,t,n,r){var o=[],i=[];if(e.singleSelect&&n){var a,s,c,l,u=e.options.find((function(e){return r.includes(e.id)}));o=Wa().difference(null!==(a=t.channelIds)&&void 0!==a?a:[],null!==(s=null==u?void 0:u.channelIds)&&void 0!==s?s:[])
;i=Wa().difference(null!==(c=null==u?void 0:u.channelIds)&&void 0!==c?c:[],null!==(l=t.channelIds)&&void 0!==l?l:[])}else if(n){var f;o=null!==(f=t.channelIds)&&void 0!==f?f:[];i=[]}else{var d=e.options.filter((function(e){return r.includes(e.id)})),p=d.filter((function(e){return t.id!==e.id})),h=d.map((function(e){return e.channelIds})).flat().filter(_o.lm),E=p.map((function(e){return e.channelIds})).flat().filter(_o.lm);o=[];i=Wa().difference(h,E)}return{addedChannelIds:o,removedChannelIds:i}}(t,n,r,o),l=c.addedChannelIds,u=c.removedChannelIds,f=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){TR(e,t,n[t])}))}return e}({},l.reduce((function(t,n){var r=cp.Z.getGuildChannelFlags(e,n);t[n]={flags:(0,ms.mB)(r,CE.ic.OPT_IN_ENABLED,!0)}
;return t}),{}),u.reduce((function(t,n){var r=cp.Z.getGuildChannelFlags(e,n);t[n]={flags:(0,ms.mB)(r,CE.ic.OPT_IN_ENABLED,!1)};return t}),{}));vR.Z.selectOption(e,t.id,n.id,r);O.Z.dispatch({type:"USER_GUILD_SETTINGS_CHANNEL_UPDATE_BULK",guildId:e,overrides:f});vR.Z.updateRolesLocal(e,a,s)}),[e]);return{handleSelectOption:r}}function PR(e,t,n){return 0===e.length?"":(n?Q.Z.Messages.ONBOARDING_HELP_TEXT_ADD_ROLES_ALSO:Q.Z.Messages.ONBOARDING_HELP_TEXT_ADD_ROLES).format({count:e.length,extraCount:Math.max(e.length-2,0),role1:e[0],role2:e[1],itemHook:t})}function jR(e){var t,n=e.guild,r=e.prompt,o=e.selectedRoleIds,i=e.selectedChannelIds,a=e.itemHook,c=(0,s.Wu)([S.Z,Y.default,Ja.Z],(function(){return Array.from(i).map((function(e){return S.Z.getChannel(e)})).filter(_o.lm).map((function(e){return(0,op.F6)(e,Y.default,Ja.Z,!0)}))})),l=Array.from(o).map((function(e){var r;return null===(r=(null!==(t=null==n?void 0:n.roles)&&void 0!==t?t:{})[e])||void 0===r?void 0:r.name
})).filter(_o.lm).map((function(e){return"@".concat(e)})),u=(null==r?void 0:r.singleSelect)?"":Q.Z.Messages.ONBOARDING_CHOOSE_ALL_OPTIONS,f="";if(0===c.length&&l.length>0)u=PR(l,a);else if(c.length>0){u=function(e,t){return 0===e.length?"":Q.Z.Messages.ONBOARDING_HELP_TEXT_ADD_CHANNELS.format({count:e.length,extraCount:Math.max(e.length-2,0),channel1:e[0],channel2:e[1],itemHook:t})}(c,a);l.length>0&&(f=PR(l,a,!0))}return{helpText:u,helpTextAdditional:f}}function RR(e){var t,n=e.guild,r=e.prompt,o=e.selectedRoleIds,i=e.selectedChannelIds,a=e.itemHook,c=(0,s.Wu)([S.Z,Y.default,Ja.Z],(function(){return Array.from(i).map((function(e){return S.Z.getChannel(e)})).filter(_o.lm).map((function(e){return(0,op.F6)(e,Y.default,Ja.Z,!0)}))})),l=Array.from(o).map((function(e){var r;return null===(r=(null!==(t=null==n?void 0:n.roles)&&void 0!==t?t:{})[e])||void 0===r?void 0:r.name})).filter(_o.lm).map((function(e){return"@".concat(e)
})),u=(null==r?void 0:r.singleSelect)?"":Q.Z.Messages.ONBOARDING_CHOOSE_ALL_OPTIONS;0===c.length&&l.length>0?u=Q.Z.Messages.CUSTOMIZE_COMMUNITY_ADD_ROLES.format({count:l.length,extraCount:Math.max(l.length-2,0),role1:l[0],role2:l[1],itemHook:a}):c.length>0&&0===l.length?u=Q.Z.Messages.CUSTOMIZE_COMMUNITY_ADD_CHANNELS.format({count:c.length,extraCount:Math.max(c.length-2,0),channel1:c[0],channel2:c[1],itemHook:a}):c.length>0&&l.length>0&&(u=Q.Z.Messages.CUSTOMIZE_COMMUNITY_ADD_CHANNELS_AND_ROLES.format({channelCount:c.length,extraChannelCount:Math.max(c.length-2,0),channel1:c[0],channel2:c[1],itemHook:a,roleCount:l.length,extraRoleCount:Math.max(l.length-2,0),role1:l[0],role2:l[1]}));return{helpText:u,helpTextAdditional:""}}function xR(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function MR(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){
var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function wR(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function DR(e){var t=e.width,n=void 0===t?120:t,o=e.height,i=void 0===o?80:o,a=e.backgroundColor,s=e.foregroundColor,c=wR(e,["width","height","backgroundColor","foregroundColor"]);return(0,r.jsxs)("svg",MR(function(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){xR(e,t,n[t])}))}return e}({},(0,OO.Z)(c)),{width:n,height:i,viewBox:"0 0 120 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("circle",{cx:"60",cy:"40",r:"32",fill:a}),(0,r.jsx)("path",{
d:"M75.0832 29.8546L75.0835 29.8548C75.1362 29.884 75.1683 29.9391 75.1683 29.9983C75.1683 30.5369 75.1197 37.4409 73.0784 44.1629C71.005 50.9907 67.1615 56.8317 60.0016 56.8317C52.8418 56.8317 48.9982 50.9907 46.9248 44.1629C44.8836 37.4409 44.835 30.5369 44.835 29.9983C44.835 29.9391 44.8671 29.884 44.9197 29.8548L44.9201 29.8546L59.919 21.5218C59.9191 21.5218 59.9193 21.5217 59.9194 21.5216C59.9718 21.4928 60.0316 21.4928 60.0839 21.5217C60.084 21.5217 60.0842 21.5218 60.0843 21.5218L75.0832 29.8546ZM52.2516 46.6667V48.1667H53.7516H66.2516H67.7516V46.6667C67.7516 44.43 67.0409 42.4584 65.6254 41.0429C64.7687 40.1861 63.7082 39.5876 62.5086 39.2485C64.3809 38.3237 65.6683 36.3949 65.6683 34.165C65.6683 31.0349 63.1317 28.4983 60.0016 28.4983C56.8715 28.4983 54.335 31.0349 54.335 34.165C54.335 36.3949 55.6224 38.3237 57.4947 39.2485C56.295 39.5876 55.2346 40.1861 54.3778 41.0429C52.9623 42.4584 52.2516 44.43 52.2516 46.6667Z",fill:s,stroke:s,strokeWidth:"3"}),(0,r.jsx)("path",{
d:"M103.67 1.80634C103.67 0.808724 102.862 0 101.864 0C100.866 0 100.058 0.808724 100.058 1.80634V3.64278C100.058 4.64039 100.866 5.44911 101.864 5.44911C102.862 5.44911 103.67 4.64039 103.67 3.64278V1.80634Z",fill:"#58F287"}),(0,r.jsx)("path",{d:"M103.67 16.3574C103.67 15.3597 102.862 14.551 101.864 14.551C100.866 14.551 100.058 15.3597 100.058 16.3574V18.1938C100.058 19.1914 100.866 20.0001 101.864 20.0001C102.862 20.0001 103.67 19.1914 103.67 18.1938V16.3574Z",fill:"#58F287"}),(0,r.jsx)("path",{d:"M110.194 11.8412C111.191 11.8412 112 11.0325 112 10.0349C112 9.03724 111.191 8.22852 110.194 8.22852H108.357C107.36 8.22852 106.551 9.03724 106.551 10.0349C106.551 11.0325 107.36 11.8412 108.357 11.8412H110.194Z",fill:"#58F287"}),(0,r.jsx)("path",{d:"M95.6429 11.7413C96.6405 11.7413 97.4492 10.9326 97.4492 9.935C97.4492 8.93739 96.6405 8.12866 95.6429 8.12866H93.8064C92.8088 8.12866 92.0001 8.93739 92.0001 9.935C92.0001 10.9326 92.8088 11.7413 93.8064 11.7413H95.6429Z",fill:"#58F287"}),(0,
r.jsx)("path",{
d:"M19.1501 74.4573L23.3147 73.0684C23.5192 72.9747 23.6925 72.8241 23.814 72.6347C23.9354 72.4454 24 72.225 24 72C24 71.775 23.9354 71.5546 23.814 71.3653C23.6925 71.1759 23.5192 71.0253 23.3147 70.9316L19.1501 69.5427C18.8657 69.4142 18.6378 69.1862 18.5094 68.9016L17.0145 64.7348C16.9442 64.521 16.8083 64.3349 16.6262 64.203C16.444 64.071 16.2249 64 16 64C15.7751 64 15.556 64.071 15.3738 64.203C15.1917 64.3349 15.0558 64.521 14.9855 64.7348L13.4906 68.9016C13.3622 69.1862 13.1343 69.4142 12.8499 69.5427L8.68528 70.9316C8.4808 71.0253 8.30752 71.1759 8.18604 71.3653C8.06457 71.5546 8 71.775 8 72C8 72.225 8.06457 72.4454 8.18604 72.6347C8.30752 72.8241 8.4808 72.9747 8.68528 73.0684L12.8499 74.4573C13.0011 74.5032 13.1387 74.5858 13.2505 74.6976C13.3622 74.8094 13.4447 74.9471 13.4906 75.0984L14.9855 79.2652C15.0558 79.479 15.1917 79.6651 15.3738 79.797C15.556 79.929 15.7751 80 16 80C16.2249 80 16.444 79.929 16.6262 79.797C16.8083 79.6651 16.9442 79.479 17.0145 79.2652L18.5094 75.0984C18.5553 74.9471 18.6378 74.8094 18.7495 74.6976C18.8613 74.5858 18.9989 74.5032 19.1501 74.4573Z",
fill:"#FFD01A"})]}))}var ZR=n(77413),LR=n(859853),UR=n(134954),kR=n(797815);function GR(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function BR(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function HR(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r]
;t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function VR(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=HR(e,["width","height","color","foreground"]);return(0,r.jsx)("svg",BR(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){GR(e,t,n[t])}))}return e}({},(0,OO.Z)(l)),{width:n,height:i,viewBox:"0 0 11 10",children:(0,r.jsx)("path",{className:c,fill:s,fillRule:"evenodd",clipRule:"evenodd",d:"M4.20096 9.92805L0.157959 5.88505L1.92496 4.11705L3.88196 6.07305L8.02396 0.274048L10.059 1.72705L4.20096 9.92805Z"})}))}var FR=n(404237),YR=n.n(FR);function zR(e,t){(null==t||t>e.length)&&(t=e.length)
;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function WR(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function KR(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||XR(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qR(e){return function(e){if(Array.isArray(e))return zR(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||XR(e)||function(){
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function XR(e,t){if(e){if("string"==typeof e)return zR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);return"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zR(e,t):void 0}}function QR(e){var t,n,i=e.guildId,a=e.option,s=e.selected,l=e.onSelect,u=e.hideMemberCount,f=e.canBeNew,d=(0,Jb.ZP)()===M.BRd.DARK,p=KR(o.useState(!1),2),h=p[0],E=p[1],y=h&&!u,m=o.useRef(null),b=o.useContext(LR.S).reducedMotion,g=(0,dE.ZP)([kR.Z],(function(){var e,t,r;return null!=(null===(e=a.emoji)||void 0===e?void 0:e.id)&&null!==(n=null===(r=kR.Z.getCustomEmojiById(null===(t=a.emoji)||void 0===t?void 0:t.id))||void 0===r?void 0:r.animated)&&void 0!==n&&n})),O=(0,
UR.Z)(i,1e3),v=null==O||null==a.roleIds?0:(t=Math).max.apply(t,qR(a.roleIds.map((function(e){return O[e]})))),_=f&&!s&&a.isUnseen,I=(0,mm.useSpring)({transform:s||b.enabled?"scale(1)":"scale(0.7)",opacity:s?1:0,config:{duration:150}}),S=(0,c.dQu)($b.Z.colors.BACKGROUND_MODIFIER_ACCENT),T=(0,c.dQu)($b.Z.unsafe_rawColors.BRAND_500),N=(0,mm.useSpring)({from:{color:T.spring()},color:S.spring({opacity:d?.5:.25}),config:{duration:300},delay:500}),A=(0,mm.useTransition)(y,{from:{transform:b.enabled?"translateX(0)":"translateX(8px)",opacity:0},enter:{transform:"translateX(0)",opacity:1},leave:{opacity:0},trail:400,config:{duration:150}}),C=KR(o.useState(!1),2),P=C[0],j=C[1];o.useEffect((function(){if(y){m.current=setTimeout((function(){E(!1);m.current=null}),3e3);return function(){null!=m.current&&clearTimeout(m.current)}}}),[y]);var R,x=lh()(YR().optionButtonWrapper,(WR(R={},YR().selected,s),WR(R,YR().pressed,P),R)),w=_?{borderColor:N.color}:{};return(0,r.jsx)(r.Fragment,{children:(0,
r.jsx)(mm.animated.div,{style:w,className:x,children:(0,r.jsxs)(c.P3F,{className:lh()(YR().optionButton),onClick:function(){E(!s);l(!s)},onMouseDown:function(){return j(!0)},onMouseUp:function(){return j(!1)},children:[null==a.emoji||null==a.emoji.id&&null==a.emoji.name?null:(0,r.jsx)(ZR.Z,{animated:a.emoji.animated||g,className:YR().buttonEmoji,emojiId:a.emoji.id,emojiName:a.emoji.name}),(0,r.jsxs)("div",{className:YR().buttonText,children:[(0,r.jsx)(c.xvT,{variant:"text-md/medium",color:"header-primary",children:a.title}),a.description.length>0?(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"header-secondary",children:a.description}):null]}),(0,r.jsx)(mm.animated.div,{className:YR().checkIcon,style:I,children:(0,r.jsx)(VR,{width:10,height:10,color:$b.Z.unsafe_rawColors.WHITE_500.css})}),A((function(e,t){return v>0&&t&&(0,r.jsx)(mm.animated.div,{className:YR().memberCount,style:e,children:(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"always-white",
children:Q.Z.Messages.ONBOARDING_OPTION_ROLE_COUNTS.format({memberCount:v})})})})),_&&(0,r.jsx)(_j.IG,{color:$b.Z.unsafe_rawColors.BRAND_260.css,text:Q.Z.Messages.NEW,className:YR().newBadge})]})})})}var $R=n(824390),JR=n.n($R),ex=n(737797),tx=n(312406),nx=n.n(tx);function rx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ox(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function ix(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){ox(e,t,n[t])}))}return e}function ax(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e)
;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function sx(e){return function(e){if(Array.isArray(e))return rx(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return rx(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rx(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cx(e){
return null!=e&&(null!=e.id||null!=e.name)}var lx=ax(ix({},ex.v),{control:function(e,t){var n=t.isDisabled,r=t.menuIsOpen;return ax(ix({},e),{backgroundColor:"var(--input-background)",borderColor:"var(--input-background)",opacity:n?.6:1,boxShadow:void 0,borderRadius:r?"8px 8px 0 0":"8px",minHeight:40,transition:"border 0.15s ease",cursor:n?"not-allowed":void 0,pointerEvents:n?"none":void 0,"&:hover":{borderColor:"var(--input-background)"}})},valueContainer:function(e){return ax(ix({},e),{padding:"8px",display:"flex",flexDirection:"row",gap:"8px",cursor:"text"})},indicatorsContainer:function(e){return ax(ix({},e),{alignItems:"flex-start",paddingTop:4})},option:function(e,t){var n=t.isSelected,r=t.isFocused;return ax(ix({},e,n?{backgroundColor:"var(--background-modifier-selected)",color:"var(--interactive-active)"}:r?{backgroundColor:"var(--background-modifier-hover)",color:"var(--interactive-hover)"}:{backgroundColor:"transparent",color:"var(--interactive-normal)"}),{cursor:"pointer",
display:"flex",padding:12,alignItems:"center",minHeight:40,"&:active":{backgroundColor:"var(--background-modifier-selected)",color:"var(--interactive-active)"},"&:hover [data-hover=true]":{opacity:1}})}});function ux(e){var t=e.options,n=e.value,i=e.onChange,a=e.canBeNew,s=e.memberCounts,l=function(e){e.preventDefault();e.stopPropagation()},u=o.useCallback((function(e){var o,a,s,u;return(0,r.jsxs)("div",{className:nx().selectValuePill,onMouseDown:l,children:[cx(e.emoji)&&(0,r.jsx)(ZR.Z,{emojiId:null===(o=e.emoji)||void 0===o?void 0:o.id,emojiName:null===(a=e.emoji)||void 0===a?void 0:a.name,animated:null!==(u=null===(s=e.emoji)||void 0===s?void 0:s.animated)&&void 0!==u&&u}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",children:e.title}),(0,r.jsx)(c.P3F,{className:nx().selectValuePillClose,onClick:function(){i(t.filter((function(t){return n.includes(t.id)&&t.id!==e.id})))},children:(0,r.jsx)(Ub.Z,{className:nx().selectValuePillCloseIcon})})]})}),[i,t,n]),f=o.useCallback((function(e){
var t,n,o,i,l,u=null==s||null==e.roleIds?0:(t=Math).max.apply(t,sx(e.roleIds.map((function(e){return s[e]})))),f=null!=s&&u>0;return(0,r.jsxs)("div",{className:nx().selectOption,children:[(0,r.jsxs)("div",{className:nx().selectOptionTitle,children:[cx(e.emoji)&&(0,r.jsx)(ZR.Z,{emojiId:null===(n=e.emoji)||void 0===n?void 0:n.id,emojiName:null===(o=e.emoji)||void 0===o?void 0:o.name,animated:null!==(l=null===(i=e.emoji)||void 0===i?void 0:i.animated)&&void 0!==l&&l}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",children:e.title})]}),a&&e.isUnseen&&(0,r.jsx)(_j.IG,{color:$b.Z.unsafe_rawColors.BRAND_260.css,text:Q.Z.Messages.NEW,className:nx().optionNewBadge}),f&&(0,r.jsx)("div",{className:nx().selectOptionMemberCount,"data-hover":!0,children:(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"always-white",children:Q.Z.Messages.ONBOARDING_OPTION_ROLE_COUNTS.format({memberCount:u})})})]})}),[a,s]),d=o.useCallback((function(e,t){var n=e.data
;return 0===t.length||JR()(t.toLowerCase(),n.title.toLowerCase())}),[]);return(0,r.jsx)(ex.Z,{styleOverrides:lx,clearable:!1,isMulti:!0,options:t,onChange:i,value:n,closeMenuOnSelect:!1,multiValueRenderer:u,optionRenderer:f,filterOption:d})}var fx=n(322008),dx=n(290679),px=n(814178),hx=n.n(px),Ex=n(913198),yx=n.n(Ex);function mx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bx(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function gx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){bx(e,t,n[t])}))}return e}function Ox(e,t){t=null!=t?t:{}
;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function vx(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return mx(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name)
;if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mx(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var _x=c.EFr.SIZE_80,Ix="required";function Sx(e){var t=e.guild,n=e.user,i=(0,gR.w)({user:n,guildId:t.id,size:120}),a=i.avatarSrc,l=i.eventHandlers,u=i.isAvatarAnimating,f=(0,pR.U)().canUseAvatarDecorations?(0,Ds.NZ)({userId:n.id,avatarDecoration:n.avatarDecoration,size:(0,hR.y)(_x),canAnimate:u}):null,d=(0,s.e7)([qa.ZP],(function(){return qa.ZP.getMember(t.id,n.id)})),p=(0,s.Wu)([qa.ZP],(function(){return qa.ZP.getMemberRoleWithPendingUpdates(t.id,n.id)})),h=Wa()(p).filter((function(e){return t.roles.hasOwnProperty(e)})).map((function(e){return t.roles[e]})).orderBy("position","desc").value(),E=(0,bR.Z)(n.id,t.id);o.useEffect((function(){(0,
mR.Z)(n.id,n.getAvatarURL(t.id,80),{guildId:t.id})}),[]);var y,m=(0,yR.Y)(null==E?void 0:E.bio),b=ss.default.getEnableHardwareAcceleration()?c.Xo$:c.qEK;return(0,r.jsxs)("div",{className:hx().profile,children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",color:"header-primary",children:Q.Z.Messages.CUSTOMIZE_COMMUNITY_PROFILE}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"text-muted",children:Q.Z.Messages.CUSTOMIZE_COMMUNITY_PROFILE_DESCRIPTION}),(0,r.jsxs)("div",{className:hx().profileCard,children:[(0,r.jsx)("div",Ox(gx({},l),{children:(0,r.jsx)(b,{src:a,avatarDecoration:f,size:_x,"aria-label":n.username})})),(0,r.jsx)(c.xvT,{variant:"text-lg/medium",color:"header-primary",className:hx().username,children:null!==(y=null==d?void 0:d.nick)&&void 0!==y?y:lp.ZP.getName(n)}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"text-muted",className:lh()(yx().markup,hx().bio),children:m}),null!=h&&h.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("hr",{className:hx().separator}),(0,
r.jsx)(c.xvT,{variant:"text-xs/semibold",color:"text-muted",className:hx().title,children:Q.Z.Messages.ROLES}),(0,r.jsx)("div",{className:hx().roles,children:null==h?void 0:h.map((function(e){var t;return(0,r.jsxs)("div",{className:hx().role,children:[(0,r.jsx)(c.xko,{color:null!==(t=e.colorString)&&void 0!==t?t:(0,dR.Rf)(M.p6O),className:hx().roleDot}),(0,r.jsx)(c.xvT,{variant:"text-xs/medium",color:"header-primary",children:e.name})]},e.id)}))})]})]})]})}function Tx(e){var t,n=e.prompt,i=e.guild,a=vx(o.useState(null),2),l=a[0],u=a[1],f=vx(o.useState(new Set),2),d=f[0],p=f[1],h=null==n||null===(t=n.options)||void 0===t?void 0:t.filter((function(e){return d.has(e.id)})),E=(0,SR.L6)(h),y=(0,SR.dX)(h),m=(0,s.Wu)([IR.Z],(function(){return IR.Z.getOnboardingResponsesForPrompt(i.id,n.id)})),b=RR({guild:i,prompt:n,selectedRoleIds:E,selectedChannelIds:y,itemHook:function(e,t){return(0,r.jsx)(c.xvT,{variant:"text-xs/medium",color:"header-primary",children:e},t)}
}),g=b.helpText,O=b.helpTextAdditional,v=CR(i.id).handleSelectOption,_=(0,c.dQu)($b.Z.unsafe_rawColors.BRAND_500),I=(0,mm.useSpring)({from:{color:n.isNew?_.hex({opacity:1}):_.hex({opacity:0})},color:_.hex({opacity:0}),config:{duration:300},delay:500}),S=n.options.map((function(e){return gx({value:e.id},e)})),T=n.options.filter((function(e){return m.includes(e.id)})).map((function(e){return e.id}));return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(mm.animated.div,{className:hx().prompt,style:{borderColor:I.color},children:[n.isNew&&(0,r.jsx)(_j.IG,{color:(0,ER.Lq)(M.Ilk.BRAND_260),text:Q.Z.Messages.NEW,className:hx().newBadge}),(0,r.jsxs)(c.X6q,{className:hx().promptTitle,variant:"heading-md/semibold",color:"header-primary",children:[n.title,n.required?(0,r.jsx)("span",{className:lh()(hx().required,bx({},hx().error,(null==l?void 0:l.type)===Ix)),children:"*"}):null]}),(0,r.jsx)(ux,{options:S,value:T,onChange:function(e){var t=e.find((function(e){return!m.includes(e.id)
})),r=e.map((function(e){return e.id}));if(null!=t){v(n,t,!0);n.singleSelect&&n.options.forEach((function(e){return d.delete(e.id)}));d.add(t.id)}else{var o=m.filter((function(e){return!r.includes(e)})),i=n.options.filter((function(e){return o.includes(e.id)}));if(m.length<=i.length&&n.required){u({type:Ix});return}i.forEach((function(e){v(n,e,!1);d.delete(e.id)}))}p(new Set(d));u(null)},canBeNew:!n.isNew}),(0,r.jsxs)(c.xvT,{variant:"text-xs/normal",color:"text-muted",className:hx().helpText,children:[g," ",O]})]})})}function Nx(e){var t,n=e.prompt,i=e.guild,a=vx(o.useState(null),2),l=a[0],u=a[1],f=vx(o.useState(new Set),2),d=f[0],p=f[1],h=null==n||null===(t=n.options)||void 0===t?void 0:t.filter((function(e){return d.has(e.id)})),E=(0,SR.L6)(h),y=(0,SR.dX)(h),m=(0,s.Wu)([IR.Z],(function(){return IR.Z.getOnboardingResponsesForPrompt(i.id,n.id)})),b=RR({guild:i,prompt:n,selectedRoleIds:E,selectedChannelIds:y,itemHook:function(e,t){return(0,r.jsx)(c.xvT,{variant:"text-xs/medium",
color:"header-primary",children:e},t)}}),g=b.helpText,O=b.helpTextAdditional,v=CR(i.id).handleSelectOption,_=(0,c.dQu)($b.Z.unsafe_rawColors.BRAND_500),I=(0,mm.useSpring)({from:{color:n.isNew?_.hex({opacity:1}):_.hex({opacity:0})},color:_.hex({opacity:0}),config:{duration:300},delay:500});return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(mm.animated.div,{className:hx().prompt,style:{borderColor:I.color},children:[n.isNew&&(0,r.jsx)(_j.IG,{color:(0,ER.Lq)(M.Ilk.BRAND_260),text:Q.Z.Messages.NEW,className:hx().newBadge}),(0,r.jsxs)(c.X6q,{className:hx().promptTitle,variant:"heading-md/semibold",color:"header-primary",children:[n.title,n.required?(0,r.jsx)("span",{className:lh()(hx().required,bx({},hx().error,(null==l?void 0:l.type)===Ix)),children:"*"}):null]}),(0,r.jsx)("div",{className:hx().promptOptions,children:n.options.map((function(e){return(0,r.jsx)(QR,{hideMemberCount:!0,guildId:i.id,option:e,onSelect:function(t){return function(e,t){if(t||1!==m.length||!n.required){
v(n,e,null!=t&&t);n.singleSelect&&t&&n.options.forEach((function(e){return d.delete(e.id)}));t?d.add(e.id):d.delete(e.id);p(new Set(d));u(null)}else u({type:Ix})}(e,t)},selected:m.includes(e.id),canBeNew:!n.isNew},e.id)}))}),(0,r.jsxs)(c.xvT,{variant:"text-xs/normal",color:"text-muted",className:hx().helpText,children:[g," ",O]})]})})}function Ax(e){var t=e.guildId,n=e.onBrowseChannels,i=(0,Jb.ZP)()===M.BRd.DARK,a=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(t)})),l=(0,s.e7)([Y.default],(function(){return Y.default.getCurrentUser()})),u=(0,bb.Z)("(min-width: 1344px)")&&null!=l,f=o.useCallback((function(){(0,K.uL)(M.Z5c.CHANNEL(t,Ig.oC.CHANNEL_BROWSER));null==n||n()}),[t,n]),d=(0,s.e7)([OR.ZP],(function(){return OR.ZP.hasUnread(t,dx.W.GUILD_ONBOARDING_QUESTION)})),p=function(e){var t=(0,dE.Wu)([IR.Z],(function(){return IR.Z.getEnabledOnboardingPrompts(e)}));return o.useMemo((function(){for(var e=0,n=[],r=[],o=[],i=[],a=0;a<t.length;a++){var s=t[a]
;if(s.isNew)n.push(s);else if(s.hasNewAnswers){r.push(s);e+=s.options.filter((function(e){return e.isUnseen})).length}else s.inOnboarding?i.push(s):o.push(s)}return{onboardingPromptsRaw:t,newOnboardingPrompts:n,onboardingPromptsWithNewAnswers:r,newAnswersCount:e,onboardingPrompts:o.concat(i)}}),[t])}(t),h=p.onboardingPromptsRaw,E=p.newOnboardingPrompts,y=p.onboardingPromptsWithNewAnswers,m=p.newAnswersCount,b=p.onboardingPrompts;o.useEffect((function(){null!=(null==a?void 0:a.id)&&(vN.Z.isFullServerPreview(a.id)||(IR.Z.shouldFetchPrompts(a.id)||d)&&(0,_R.eM)(a.id))}),[null==a?void 0:a.id,d]);o.useEffect((function(){if(null!=(null==a?void 0:a.id)&&!vN.Z.isFullServerPreview(a.id))return function(){(0,Iu.Ju)(a.id,dx.W.GUILD_ONBOARDING_QUESTION,IR.Z.ackIdForGuild(a.id));vR.Z.updateOnboardingResponses(a.id)}}),[null==a?void 0:a.id]);var g=o.useCallback((function(e){if(null==a)return null;switch(e.type){case fx.FN.MULTIPLE_CHOICE:return(0,r.jsx)(Nx,{prompt:e,guild:a},e.id)
;case fx.FN.DROPDOWN:return(0,r.jsx)(Tx,{prompt:e,guild:a},e.id);default:(0,_o.vE)(e.type)}}),[a]);if(null==a)return null;if(0===h.length){var O=(0,ER.Lq)(i?M.Ilk.PRIMARY_300:M.Ilk.PRIMARY_500),v=(0,ER.Lq)(i?M.Ilk.PRIMARY_700:M.Ilk.PRIMARY_230);return(0,r.jsx)("div",{className:nO().chat,children:(0,r.jsx)("div",{className:lh()(nO().content,hx().emptyPage),children:(0,r.jsxs)("div",{className:hx().emptyContainer,children:[(0,r.jsx)(DR,{className:hx().emptyIcon,foregroundColor:O,backgroundColor:v}),(0,r.jsx)(c.X6q,{className:hx().emptyHeader,variant:"heading-md/semibold",children:Q.Z.Messages.CUSTOMIZE_COMMUNITY_EMPTY_HEADER}),(0,r.jsx)(c.xvT,{variant:"text-sm/medium",children:Q.Z.Messages.CUSTOMIZE_COMMUNITY_EMPTY_SUBHEADER.format({onBrowseChannels:f})})]})})})}return(0,r.jsx)("div",{className:lh()(nO().chat,hx().scrollerContainer),children:(0,r.jsxs)(c.Den,{className:hx().scroller,fade:!0,children:[(0,r.jsxs)("div",{className:hx().pageBody,children:[(E.length>0||y.length>0)&&(0,
r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{children:(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",color:"header-primary",children:Q.Z.Messages.ONBOARDING_PROMPT_ANSWERS_NEW.format({count:E.length+m})})}),E.map(g),y.map(g),(0,r.jsx)("div",{className:hx().sectionSeparator})]}),b.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",color:"header-primary",children:Q.Z.Messages.ONBOARDING_PROMPT_QUESTIONS_HEADER.format({count:b.length})}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"text-muted",children:Q.Z.Messages.ONBOARDING_PROMPT_MEMBER_DESCRIPTION})]}),b.map(g)]})]}),u&&(0,r.jsx)(Sx,{guild:a,user:l})]})})}var Cx=n(142665),Px=n.n(Cx);function jx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Rx(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function xx(e,t){return function(e){
if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return jx(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jx(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mx(e){var t=e.guild,n=e.previousChannel,i=(0,fR.Z)(t);o.useEffect((function(){(0,un.EW)(ln.z$.CHANNEL_BROWSER_NEW_BADGE_NUX,{dismissAction:hn.L.DISMISS})
}));var a=i?Q.Z.Messages.CHANNELS_AND_ROLES_HTML_TITLE.format({guildName:t.name}):Q.Z.Messages.CHANNEL_BROWSER_HTML_TITLE.format({guildName:t.name}),s=i?Q.Z.Messages.CHANNELS_AND_ROLES:Q.Z.Messages.CHANNEL_BROWSER_TITLE;(0,Am.Tt)({location:a});return(0,r.jsxs)(Og.Z,{className:Px().header,innerClassname:Px().innerHeader,hideSearch:!0,channelId:Ig.oC.CUSTOMIZE_COMMUNITY,guildId:t.id,toolbar:null!=n?(0,r.jsx)(c.zxk,{className:Px().returnButton,size:c.zxk.Sizes.SMALL,look:c.zxk.Looks.OUTLINED,color:c.zxk.Colors.PRIMARY,onClick:function(){null!=n&&(0,K.XU)(t.id,n.id)},children:(0,r.jsx)(c.xvT,{className:Px().returnButtonText,variant:"text-xs/medium",color:"none",children:Q.Z.Messages.RETURN_TO_CHANNEL.format({channelNameHook:function(){return null==n?null:(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(pj._,{className:Px().returnIcon,guild:t,channel:n}),(0,r.jsx)(vj.Z,{children:(0,r.jsx)(c.xvT,{variant:"text-xs/medium",color:"none",children:n.name})})]},n.id)}})})}):[],children:[(0,
r.jsx)(Og.Z.Icon,{icon:uR.Z,"aria-hidden":!0}),(0,r.jsx)(Og.Z.Title,{children:s})]})}function wx(e){var t=e.guildId,n=e.selectedSection,i=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(t)})),a=(0,fR.Z)(i),l=xx(o.useState(null!=n?n:fx.l7.CUSTOMIZE),2),u=l[0],f=l[1];o.useEffect((function(){null!=n&&f(n)}),[n]);var d=(0,s.e7)([C.Z],(function(){return C.Z.getLastSelectedChannelId(t)})),p=(0,s.e7)([ap.ZP],(function(){return ap.ZP.getCurrentSidebarChannelId(Ig.oC.CHANNEL_BROWSER)})),h=null!=p&&u===fx.l7.BROWSE,E=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(d)})),y=(0,s.e7)([gj.Z],(function(){return gj.Z.getNewChannelIds(t).size>0})),m=(0,hj.fU)(t);return null==i?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:lh()(nO().chat,Rx({},nO().threadSidebarOpen,h)),children:[(0,r.jsx)(Mx,{guild:i,previousChannel:E}),(0,r.jsxs)("div",{className:lh()(nO().content,Px().container),children:[a&&(0,r.jsxs)(c.njP,{className:Px().tabBar,type:"top",look:"brand",selectedItem:u,
onItemSelect:function(e){return f(e)},children:[(0,r.jsx)(c.njP.Item,{className:Px().tabBarItem,id:fx.l7.CUSTOMIZE,children:Q.Z.Messages.OPT_IN_GUILD_NOTICE_CTA},fx.l7.CUSTOMIZE),(0,r.jsxs)(c.njP.Item,{className:Px().tabBarItem,id:fx.l7.BROWSE,"aria-label":Q.Z.Messages.CHANNEL_BROWSER_TITLE,children:[Q.Z.Messages.CHANNEL_BROWSER_TITLE,(0,r.jsx)(_j.IG,{text:y?Q.Z.Messages.CHANNEL_TYPE_NEW:m,color:y?$b.Z.unsafe_rawColors.BRAND_260.css:$b.Z.colors.BACKGROUND_ACCENT.css,className:lh()(Rx({},Px().newBadge,y))})]},fx.l7.BROWSE)]}),function(){switch(u){case fx.l7.CUSTOMIZE:return(0,r.jsx)(Ax,{guildId:t,onBrowseChannels:function(){return f(fx.l7.BROWSE)}});case fx.l7.BROWSE:default:return(0,r.jsx)(lR,{guildId:t})}}()]})]}),h&&(0,r.jsx)(cR,{channelId:p})]})}var Dx=n(465704),Zx=n(302685),Lx=n(48543),Ux=n(362660),kx=n(189827),Gx=n(28417);const Bx=(0,tc.B)({kind:"user",id:"2023-01_guild_onboarding_includes_rules",label:"Guild Onboarding includes rules experience",defaultConfig:{includeRules:!1},
treatments:[{id:1,label:"Last page of onboarding is rules",config:{includeRules:!0}}]});var Hx=n(780409),Vx=n(742053),Fx=n.n(Vx);function Yx(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function zx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Yx(e,t,n[t])}))}return e}function Wx(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Kx(e,t){return(0,r.jsx)("span",{className:Fx().helpTextItem,children:e},t)}function qx(e){var t=e.headerId,n=e.guild,o=e.step,i=e.lastPrompt,a=e.questionCount,s=e.currentPrompt,l=e.selectOption,u=e.gotoPrevPrompt,f=e.gotoNextPrompt,d=e.completeOnboarding,p=(0,dE.Wu)([IR.Z],(function(){return IR.Z.getOnboardingResponsesForPrompt(n.id,s.id)})),h=0===p.length&&(null==s?void 0:s.required),E=null==s?void 0:s.options.filter((function(e){return p.includes(e.id)})),y=(0,SR.L6)(E),m=(0,SR.dX)(E),b=0===p.length,g=jR({guild:n,prompt:s,selectedRoleIds:y,selectedChannelIds:m,itemHook:Kx}),O=g.helpText,v=g.helpTextAdditional,_=(0,UR.Z)(n.id,1e3),I=s.options.map((function(e){return zx({value:e.id},e)})),S=s.options.filter((function(e){return p.includes(e.id)})).map((function(e){return e.id}));return(0,r.jsx)("div",{className:Fx().prompt,children:(0,r.jsxs)("div",{className:Fx().promptContent,children:[(0,
r.jsxs)(c.zJl,{className:Fx().scrollerContent,children:[(0,r.jsxs)("div",{className:Fx().questionHeader,children:[(0,r.jsx)(c.xvT,{variant:"text-sm/medium",color:"text-muted",children:Q.Z.Messages.ONBOARDING_QUESTION_COUNT.format({currentQuestion:o+1,questionCount:a})}),s.required?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xvT,{variant:"text-xs/normal",className:Fx().headerSeparator,children:"·"}),(0,r.jsx)(c.xvT,{variant:"text-sm/medium",color:"text-brand",children:Q.Z.Messages.ONBOARDING_PROMPT_REQUIRED_LABEL})]}):null]}),(0,r.jsx)(c.X6q,{className:Fx().title,variant:"heading-xl/semibold",color:"header-primary",id:t,children:s.title}),(0,r.jsx)(ux,{options:I,value:S,onChange:function(e){var t=e.find((function(e){return!p.includes(e.id)})),n=e.map((function(e){return e.id}));if(null!=t)l(s.id,t.id,!0);else{var r=p.filter((function(e){return!n.includes(e)}));s.options.filter((function(e){return r.includes(e.id)})).forEach((function(e){l(s.id,e.id,!1)}))}},memberCounts:_})]}),(0,
r.jsxs)("div",{className:Fx().navButtons,children:[(0,r.jsx)("div",{className:Fx().leftButtons,children:o>0&&(0,r.jsxs)(c.zxk,{className:Fx().button,innerClassName:Fx().buttonInner,onClick:function(){return u(p.length)},size:c.zxk.Sizes.MEDIUM,look:c.zxk.Looks.OUTLINED,grow:!1,color:c.zxk.Colors.PRIMARY,children:[(0,r.jsx)(gI.Z,{className:Fx().arrow,direction:gI.Z.Directions.LEFT}),Q.Z.Messages.BACK]})}),(0,r.jsxs)("div",{className:Fx().rightButtons,children:[(0,r.jsxs)(c.xvT,{className:Fx().helpText,variant:"text-xs/normal",color:"text-muted",children:[O," ",v]}),(0,r.jsx)(c.ua7,{text:h?Q.Z.Messages.ONBOARDING_REQUIRED_QUESTION:null,children:function(e){var t=e.onMouseEnter,n=e.onMouseLeave;return(0,r.jsx)(c.zxk,{className:Fx().button,innerClassName:Fx().buttonInner,onMouseEnter:t,onMouseLeave:n,onClick:function(){return i?d():f(p.length)},disabled:h,size:c.zxk.Sizes.MEDIUM,look:c.zxk.Looks.FILLED,grow:!1,color:b?c.zxk.Colors.PRIMARY:c.zxk.Colors.BRAND,children:i?(0,
r.jsxs)(r.Fragment,{children:[Q.Z.Messages.FINISH,(0,r.jsx)("span",{className:Fx().finishEmoji,role:"img","aria-hidden":!0,children:"🎉"})]}):(0,r.jsxs)(r.Fragment,{children:[b?Q.Z.Messages.SKIP:Q.Z.Messages.NEXT,(0,r.jsx)(gI.Z,{className:Fx().arrow,direction:gI.Z.Directions.RIGHT})]})})}})]})]})]})})}function Xx(e){var t=e.headerId,n=e.guild,o=e.step,i=e.lastPrompt,a=e.questionCount,s=e.currentPrompt,l=e.selectOption,u=e.gotoPrevPrompt,f=e.gotoNextPrompt,d=e.completeOnboarding,p=(0,dE.Wu)([IR.Z],(function(){return IR.Z.getOnboardingResponsesForPrompt(n.id,s.id)})),h=0===p.length&&(null==s?void 0:s.required),E=null==s?void 0:s.options.filter((function(e){return p.includes(e.id)})),y=(0,SR.L6)(E),m=(0,SR.dX)(E),b=0===p.length,g=jR({guild:n,prompt:s,selectedRoleIds:y,selectedChannelIds:m,itemHook:Kx}),O=g.helpText,v=g.helpTextAdditional;return(0,r.jsx)("div",{className:Fx().prompt,children:(0,r.jsxs)("div",{className:Fx().promptContent,children:[(0,r.jsxs)(c.zJl,{
className:Fx().scrollerContent,children:[(0,r.jsxs)("div",{className:Fx().questionHeader,children:[(0,r.jsx)(c.xvT,{variant:"text-sm/medium",color:"text-muted",children:Q.Z.Messages.ONBOARDING_QUESTION_COUNT.format({currentQuestion:o+1,questionCount:a})}),s.required?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xvT,{variant:"text-xs/normal",className:Fx().headerSeparator,children:"·"}),(0,r.jsx)(c.xvT,{variant:"text-sm/medium",color:"text-brand",children:Q.Z.Messages.ONBOARDING_PROMPT_REQUIRED_LABEL})]}):null]}),(0,r.jsx)(c.X6q,{className:Fx().title,variant:"heading-xl/semibold",color:"header-primary",id:t,children:s.title}),(0,r.jsx)("div",{className:Fx().promptOptions,children:s.options.map((function(e){return(0,r.jsx)(QR,{guildId:n.id,option:e,onSelect:function(t){return l(s.id,e.id,null!=t&&t)},selected:p.includes(e.id)},e.id)}))})]}),(0,r.jsxs)("div",{className:Fx().navButtons,children:[(0,r.jsx)("div",{className:Fx().leftButtons,children:o>0&&(0,r.jsxs)(c.zxk,{
className:Fx().button,innerClassName:Fx().buttonInner,onClick:function(){return u(p.length)},size:c.zxk.Sizes.MEDIUM,look:c.zxk.Looks.OUTLINED,grow:!1,color:c.zxk.Colors.PRIMARY,children:[(0,r.jsx)(gI.Z,{className:Fx().arrow,direction:gI.Z.Directions.LEFT}),Q.Z.Messages.BACK]})}),(0,r.jsxs)("div",{className:Fx().rightButtons,children:[(0,r.jsxs)(c.xvT,{className:Fx().helpText,variant:"text-xs/normal",color:"text-muted",children:[O," ",v]}),(0,r.jsx)(c.ua7,{text:h?Q.Z.Messages.ONBOARDING_REQUIRED_QUESTION:null,children:function(e){var t=e.onMouseEnter,n=e.onMouseLeave;return(0,r.jsx)(c.zxk,{className:Fx().button,innerClassName:Fx().buttonInner,onMouseEnter:t,onMouseLeave:n,onClick:function(){return i?d():f(p.length)},disabled:h,size:c.zxk.Sizes.MEDIUM,look:c.zxk.Looks.FILLED,grow:!1,color:b?c.zxk.Colors.PRIMARY:c.zxk.Colors.BRAND,children:i?(0,r.jsxs)(r.Fragment,{children:[Q.Z.Messages.FINISH,(0,r.jsx)("span",{className:Fx().finishEmoji,role:"img","aria-hidden":!0,children:"🎉"})]}):(0,
r.jsxs)(r.Fragment,{children:[b?Q.Z.Messages.SKIP:Q.Z.Messages.NEXT,(0,r.jsx)(gI.Z,{className:Fx().arrow,direction:gI.Z.Directions.RIGHT})]})})}})]})]})]})})}function Qx(e){var t=e.guild,n=e.prompts,i=e.step,a=e.selectOption,s=e.completeOnboarding,c=e.setCurrentStep,l=e.headerId,u=e.disableTracking,f=(0,dE.ZP)([bC.Z],(function(){return bC.Z.getRulesPrompt(t.id)})),d=(Bx.getCurrentConfig({}).includeRules||Hx.Z.getCurrentConfig({}).landOnHome)&&null!=f;o.useEffect((function(){mC.Z.fetchVerificationForm(t.id)}),[t.id]);var p=n[i],h=i+1>=n.length&&!d,E=n[0].required;o.useEffect((function(){u||Ie.default.track(M.rMx.GUILD_ONBOARDING_STEP_VIEWED,Wx(zx({},(0,Sb.hH)(t.id)),{step:0,required:E}))}),[t.id,E,u]);var y=function(e){if(!u){Ie.default.track(M.rMx.GUILD_ONBOARDING_STEP_COMPLETED,Wx(zx({},(0,Sb.hH)(t.id)),{step:i,options_selected:e,skipped:0===e,back:!1,in_onboarding:!0,is_final_step:!1}));i<n.length-1&&Ie.default.track(M.rMx.GUILD_ONBOARDING_STEP_VIEWED,Wx(zx({},(0,Sb.hH)(t.id)),{
step:i,required:n[i+1].required}))}i+1<n.length?c(i+1):d&&c("rules")},m=function(e){if(!u){Ie.default.track(M.rMx.GUILD_ONBOARDING_STEP_COMPLETED,Wx(zx({},(0,Sb.hH)(t.id)),{step:i,skipped:!1,back:!0,options_selected:e,in_onboarding:!0,is_final_step:!1}));i>0&&Ie.default.track(M.rMx.GUILD_ONBOARDING_STEP_VIEWED,Wx(zx({},(0,Sb.hH)(t.id)),{step:i-1,required:n[i-1].required}))}c(Math.max(0,i-1))};if(null==p)return null;switch(p.type){case fx.FN.MULTIPLE_CHOICE:return(0,r.jsx)(Xx,{guild:t,headerId:l,step:i,questionCount:n.length,currentPrompt:p,lastPrompt:h,selectOption:a,gotoPrevPrompt:m,gotoNextPrompt:y,completeOnboarding:s});case fx.FN.DROPDOWN:return(0,r.jsx)(qx,{guild:t,headerId:l,step:i,questionCount:n.length,currentPrompt:p,lastPrompt:h,selectOption:a,gotoPrevPrompt:m,gotoNextPrompt:y,completeOnboarding:s});default:(0,_o.vE)(p.type)}}function $x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Jx(e,t,n,r,o,i,a){try{
var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function eM(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Jx(i,r,o,a,s,"next",e)}function s(e){Jx(i,r,o,a,s,"throw",e)}a(void 0)}))}}function tM(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function nM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){tM(e,t,n[t])}))}return e}function rM(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){
return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function oM(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return $x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $x(e,t)}(e,t)||function(){
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var iM=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){
a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function aM(e){var t,n=e.guild,i=e.prompts,a=e.completeOnboarding,s=e.setCurrentStep,l=e.disableTracking,u=e.previousPromptIndex,f=o.useRef(null),d=(0,dE.ZP)([bC.Z],(function(){return bC.Z.getRulesPrompt(n.id)})),p=oM(o.useState(null!==(t=null==d?void 0:d.response)&&void 0!==t&&t),2),h=p[0],E=p[1],y=(0,dE.ZP)([bC.Z],(function(){return bC.Z.get(n.id)})),m=o.useCallback(eM((function(){return iM(this,(function(e){switch(e.label){case 0:if(null==y||null==d)return[2];e.label=1;case 1:e.trys.push([1,3,,4]);return[4,mC.Z.submitVerificationForm(n.id,rM(nM({},y),{formFields:[rM(nM({},d),{response:h})]}))];case 2:e.sent();return[3,4];case 3:e.sent();return[3,4];case 4:a();return[2]}}))})),[n.id,y,d,h,a]);o.useEffect((function(){
null!=f.current&&f.current.isScrolledToBottom()&&E(!0)}),[n.id,E,f]);return null==d?null:(0,r.jsx)("div",{className:Fx().prompt,children:(0,r.jsxs)("div",{className:Fx().promptContent,children:[(0,r.jsxs)(c.h21,{className:Fx().scrollerContent,ref:f,onScroll:function(){null!=f.current&&f.current.isScrolledToBottom()&&E(!0)},children:[(0,r.jsx)(c.xvT,{variant:"text-sm/medium",color:"text-muted",children:Q.Z.Messages.ONBOARDING_RULES_STEP}),(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",children:Q.Z.Messages.ONBOARDING_RULES_TITLE}),(0,r.jsx)("div",{className:Fx().termsFieldBody,children:d.values.map((function(e,t){return(0,r.jsxs)("div",{className:Fx().termsRow,children:[(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"text-muted",children:"".concat(t+1,".")}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:Fx().termsRowContent,children:kg.Z.parseGuildVerificationFormRule(e,!0,{channelId:n.rulesChannelId})})]},"term-".concat(t))}))})]}),(0,r.jsx)("div",{className:Fx().overlay}),(0,
r.jsxs)("div",{className:Fx().navButtons,children:[(0,r.jsx)("div",{className:Fx().leftButtons,children:-1!==u&&(0,r.jsxs)(c.zxk,{innerClassName:Fx().buttonInner,onClick:function(){if(!l){Ie.default.track(M.rMx.GUILD_ONBOARDING_STEP_COMPLETED,rM(nM({},(0,Sb.hH)(n.id)),{step:-1,skipped:!1,back:!0,options_selected:0,in_onboarding:!0,is_final_step:!1}));u>=0&&Ie.default.track(M.rMx.GUILD_ONBOARDING_STEP_VIEWED,rM(nM({},(0,Sb.hH)(n.id)),{step:u,required:i[u].required}))}s(u)},size:c.zxk.Sizes.MEDIUM,look:c.zxk.Looks.OUTLINED,grow:!1,color:c.zxk.Colors.PRIMARY,children:[(0,r.jsx)(gI.Z,{className:Fx().arrow,direction:gI.Z.Directions.LEFT}),Q.Z.Messages.BACK]})}),(0,r.jsxs)("div",{className:Fx().rightButtons,children:[(0,r.jsx)(c.xvT,{className:Fx().helpText,variant:"text-xs/normal",color:"text-muted",children:h?Q.Z.Messages.MEMBER_VERIFICATION_READ_AGREE_RULES:Q.Z.Messages.MEMBER_VERIFICATION_MUST_READ_RULES}),(0,r.jsxs)(c.zxk,{innerClassName:Fx().buttonInner,onClick:m,disabled:!h,
size:c.zxk.Sizes.MEDIUM,look:c.zxk.Looks.FILLED,grow:!1,color:c.zxk.Colors.BRAND,children:[Q.Z.Messages.FINISH,(0,r.jsx)("span",{className:Fx().finishEmoji,role:"img","aria-hidden":!0,children:"🎉"})]})]})]})]})})}var sM=n(196583),cM=n.n(sM);function lM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uM(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function fM(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){uM(i,r,o,a,s,"next",e)}function s(e){uM(i,r,o,a,s,"throw",e)}a(void 0)}))}}function dM(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{
a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return lM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lM(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var pM=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),
0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function hM(){return(hM=fM((function(e){var t;return pM(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(t,n){var r=new Image;r.crossOrigin="Anonymous";r.onerror=function(e){n(e);r.onerror=r.onload=null;r=null};r.onload=function(){t((0,Zs.XN)(r,2,10));r.onerror=r.onload=null;r=null};r.src=e}))];case 1:
return[2,null==(t=n.sent())?void 0:t.map((function(e){var t=dM(e,3),n=t[0],r=t[1],o=t[2];return(0,Ux.vq)(n,r,o)}))]}}))}))).apply(this,arguments)}function EM(e){var t=e.guildId,n=(0,s.e7)([E.Z],(function(){return E.Z.useReducedMotion})),i=(0,mb.Z)(),a=i.ref,l=i.width,u=i.height,d=dM(o.useState(),2),p=d[0],h=d[1],y=(0,s.Wu)([IR.Z],(function(){return IR.Z.getOnboardingPromptsForOnboarding(t)})),m=(0,s.e7)([IR.Z],(function(){return IR.Z.getEnabled(t)})),b=o.useCallback((function(e,n,r){vR.Z.selectOption(t,e,n,r)}),[t]),g=o.useCallback((function(){vR.Z.completeOnboarding(t,y)}),[t,y]),O=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(t)})),v=o.useMemo((function(){return null==O?null:Ds.ZP.getGuildSplashURL({id:O.id,splash:O.splash})}),[O]),_=(0,s.e7)([kx.ZP],(function(){return kx.ZP.getCurrentOnboardingStep(t)})),I=dM(o.useState(null!=v?null:"cover"),2),S=I[0],T=I[1];null!=v&&null==p&&function(e){return hM.apply(this,arguments)}(v).then((function(e){h(e[0])}))
;var N=o.useCallback((function(e){T(_);vR.Z.setUserOnboardingStep(t,e)}),[t,_]),A=(0,s.e7)([kx.ZP],(function(){return kx.ZP.getOnboardingStatus(t)})),C=null!=y&&y.length>0,P=o.useCallback((function(){(0,kx.kp)(A)&&m&&C?N(0):g()}),[A,m,C,N,g]);o.useEffect((function(){if(!kx.ZP.shouldShowOnboarding(t))return f.Z.escapeToDefaultChannel(t);(0,Zx.E)(t)}),[t]);var j=(0,mm.useTransition)(_,{config:mm.config.default,from:{scale:.8,opacity:0},enter:{scale:1,opacity:1},immediate:n||"cover"!==S&&null!==S}),R=kx.ZP.shouldShowOnboarding(t),x=null==O;o.useEffect((function(){if(!R||x){var e=setTimeout((function(){0;(0,K.uL)(M.Z5c.CHANNEL(t))}),1e3);return function(){return clearTimeout(e)}}}),[R,x,t]);if(!kx.ZP.shouldShowOnboarding(t))return null;if(null==O)return null;var w=function(){switch(_){case"cover":return(0,r.jsx)(Gx.ZP,{guild:O,onboardingStatus:kx.uX.READY,onStart:P});case"rules":return(0,r.jsx)(aM,{setCurrentStep:N,previousPromptIndex:y.length-1,guild:O,prompts:y,completeOnboarding:g})
;case null:return null;default:return(0,r.jsx)(Qx,{guild:O,prompts:y,step:_,selectOption:b,completeOnboarding:g,setCurrentStep:N})}};return(0,r.jsxs)("div",{className:cM().main,ref:a,children:[null!=v?(0,r.jsx)(Lx.Z,{className:lh()(cM().artwork),src:v,width:l,height:u,imageClassName:cM().cover}):(0,r.jsx)(Dx.Z,{className:cM().artwork,preserveAspectRatio:"xMinYMin slice"}),null!=p&&(0,r.jsx)("div",{className:cM().gradient,style:{background:"linear-gradient(180deg, ".concat((0,Ux.aD)(p,.16)," 0%, ").concat((0,Ux.aD)(p,1)," 100%)")}}),(0,r.jsx)("div",{className:cM().gradient}),j((function(e,t,n){var o=n.key;return(0,r.jsx)(mm.animated.div,{ref:t===_?a:null,style:e,children:w()},o)})),"cover"===_&&(0,r.jsx)("div",{className:cM().bottomCenterContent,children:(0,r.jsx)(c.X6q,{variant:"heading-sm/normal",color:"header-secondary",children:Q.Z.Messages.ONBOARDING_COVER_PRIVACY_POLICY.format({privacyLink:M.EYA.PRIVACY})})})]})}
var yM=n(710965),mM=n(202176),bM=n(198895),gM=n(615796),OM=n(547721),vM=n(783423),_M=n(772040),IM=n(973935),SM=n(142926),TM=n(840249),NM=n(383163),AM=n(873308),CM=n(936337),PM=n(202833),jM=n.n(PM);function RM(e){var t=e.buttonText,n=e.onGoBack,o=e.onDismiss,i=e.showCloseButton;return(0,r.jsxs)(CM.ZP,{className:jM().backNotice,children:[i&&(0,r.jsx)(CM.Ry,{onClick:o,noticeType:M.kVF.BACK_TO_PREVIOUS_SCREEN}),(0,r.jsxs)(c.zxk,{className:jM().backButton,innerClassName:jM().backButtonInner,look:c.zxk.Looks.OUTLINED,color:c.zxk.Colors.WHITE,size:c.zxk.Sizes.NONE,onClick:n,children:[(0,r.jsx)(AM.Z,{width:16,height:16,direction:AM.Z.Directions.LEFT,className:jM().backArrow}),t]})]})}var xM=n(223430),MM=n(436622),wM=n(371768),DM=n(249052),ZM=n(534681),LM=n(543491),UM=n(340562),kM=n(856744),GM=n(707276),BM=n.n(GM);function HM(e){var t,n,o=e.value,i=e.type;if(0===o)return null;if(i===kM.Qs.CHANNEL){t=MM.Z;n=Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PURCHASE_GROUP_CHANNEL_BENEFIT_PREVIEW.format({
value:o})}else{if(i!==kM.Qs.INTANGIBLE)throw new Error("Unsupported benefit type");t=wM.Z;n=Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PURCHASE_GROUP_INTANGIBLE_BENEFIT_PREVIEW.format({value:o})}return(0,r.jsxs)(c.xvT,{variant:"text-sm/normal",color:"interactive-normal",className:BM().benefitSummary,children:[(0,r.jsx)(t,{className:BM().benefitIcon})," ",n]})}function VM(e){var t=e.listing,n=t.subscription_plans[0],o=(0,ZM._W)(t.application_id,t.image_asset,40),i=t.role_benefits.benefits.filter((function(e){return e.ref_type===kM.Qs.CHANNEL})).length,a=t.role_benefits.benefits.filter((function(e){return e.ref_type===kM.Qs.INTANGIBLE})).length,s=i+a>0;return(0,r.jsxs)("div",{className:BM().listingPreview,children:[(0,r.jsx)("img",{src:o,alt:"",className:BM().listingPreviewImage}),(0,r.jsxs)("div",{className:BM().listingPreviewText,children:[(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"interactive-active",children:t.name}),(0,r.jsx)(xM.Z,{size:2}),(0,r.jsxs)(c.xvT,{
variant:"text-sm/normal",color:"interactive-normal",children:[(0,DM.T4)(n.price,n.currency)," / ",(0,LM.JE)(n)]}),s&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(xM.Z,{size:12}),(0,r.jsxs)("div",{className:BM().benefitSummaries,children:[(0,r.jsx)(HM,{type:kM.Qs.CHANNEL,value:i}),(0,r.jsx)(HM,{type:kM.Qs.INTANGIBLE,value:a})]})]})]})]})}function FM(e){var t=e.groupListing,n=e.onSelectGroup,o=(0,OM._k)(t.id),i=(0,s.e7)([vN.Z],(function(){return vN.Z.isViewingSubscriptionRoles(t.guild_id)})),a=o.filter((function(e){return i||e.published})),l=(0,bb.Z)(kM.iP),u=(0,q.Dt)(),f=(0,q.Dt)();return 0===a.length?null:(0,r.jsx)("article",{className:BM().container,"aria-labelledby":u,children:(0,r.jsxs)(c.y5t,{component:(0,r.jsx)(c.X6q,{variant:"heading-lg/semibold",id:u,children:t.name}),children:[(0,r.jsx)(xM.Z,{size:8}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"header-secondary",children:t.description}),(0,r.jsx)("div",{className:BM().divider}),(0,r.jsx)(c.X6q,{
variant:"heading-deprecated-12/semibold",className:BM().sectionHeader,id:f,children:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PURCHASE_AVAILABLE_TIERS.format({numTiers:a.length})}),l?(0,r.jsx)("ul",{className:BM().subscriptionCardContainer,"aria-labelledby":f,children:a.map((function(e){return(0,r.jsx)("li",{children:(0,r.jsx)(UM.Z,{guildId:t.guild_id,groupListingId:t.id,listingId:e.id,analyticsLocation:M.Sbl.ROLE_SUBSCRIPTIONS_TAB},e.id)},e.id)}))}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("ul",{className:BM().listingPreviews,"aria-labelledby":f,children:a.map((function(e){return(0,r.jsx)("li",{children:(0,r.jsx)(VM,{listing:e},e.id)},e.id)}))}),(0,r.jsx)(xM.Z,{size:24}),(0,r.jsx)(c.zxk,{onClick:n,fullWidth:!0,children:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PURCHASE_GROUP_CARD_CTA})]})]})})}var YM=n(341095),zM=n(506847),WM=n(805537),KM=n(504834),qM=n(196142),XM=n(96270);function QM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}
function $M(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return QM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return QM(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function JM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ew(e,t){
return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return JM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return JM(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tw(e){var t=ew(function(){var e=$M((0,XM.Z)(),2),t=e[0],n=e[1],r=$M(o.useState(),2),i=r[0],a=r[1];o.useEffect((function(){
null==i&&null!=n&&a(n)}),[i,n]);return[t,i]}(),2),n=t[0],r=t[1];return[n,null!=(null==e?void 0:e.application_id)&&null!=r?(0,ZM._W)(e.application_id,e,r):void 0]}var nw=n(874669),rw=n.n(nw);function ow(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function iw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ow(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ow(e,t)
}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function aw(e){var t=e.coverImageAsset,n=e.title,o=e.guild,i=e.description,a=e.children,s=iw(tw(null!=t?t:void 0),2),l=s[0],u=s[1];return(0,r.jsxs)("div",{className:rw().container,children:[(0,r.jsx)("div",{ref:l,className:rw().coverImageContainer,children:null!=u&&(0,r.jsx)("img",{src:u,alt:"",className:rw().coverImage})}),(0,r.jsx)("div",{className:rw().guildIconContainer,children:(0,r.jsx)(tg.Z,{guild:o,size:tg.Z.Sizes.XLARGE})}),(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:rw().ctaTitle,children:n}),(0,r.jsx)(c.xvT,{className:rw().ctaSubtitle,variant:"text-md/normal",color:"header-secondary",children:i}),a]})}var sw=n(677296),cw=n.n(sw),lw=function(e){var t=e.subscription;if(null==t)return null;if(t.status===M.O0b.PAST_DUE){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(xM.Z,{size:16
}),(0,r.jsx)(KM.Z,{message:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_USER_SUBSCRIPTION_PAST_DUE_WARNING,ctaMessage:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_USER_SUBSCRIPTION_PAST_DUE_CTA,onClick:function(){h.Z.open(M.oAB.SUBSCRIPTIONS,CE.cP)}})]})}return null};const uw=function(e){var t=e.guild,n=e.groupListing,o=e.singleGroupView,i=e.editGroupId;(0,WM.Z)({guildId:t.id,groupListingId:null==n?void 0:n.id,location:M.Sbl.ROLE_SUBSCRIPTIONS_TAB,relevantSubscriptionListingIds:null==n?void 0:n.subscription_listings_ids});var a,s,l,u=(0,zM.Z)(null==n?void 0:n.id).activeSubscription,f=(0,OM.YB)(t.id),d=o?null==f?void 0:f.description:null==n?void 0:n.description,p=YM.B7(null!==(a=null==n?void 0:n.id)&&void 0!==a?a:null,i).editStateIds;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(aw,{title:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PURCHASE_PAGE_GROUP_CTA.format({serverName:t.toString()}),description:null!=d?d:null,coverImageAsset:null!==(s=null==f?void 0:f.cover_image_asset)&&void 0!==s?s:null,guild:t,
children:[null!=n?(0,r.jsx)(qM.Z,{className:cw().pendingPlanChangeNotice,groupListingId:n.id,subscription:u}):null,(0,r.jsx)(lw,{subscription:u})]}),(0,r.jsx)(c.y5t,{children:(0,r.jsx)(NM.Z,{guildId:t.id,children:p.map((function(e){return(0,r.jsx)(UM.Z,{guildId:t.id,groupListingId:null!==(l=null==n?void 0:n.id)&&void 0!==l?l:"",listingId:e,analyticsLocation:M.Sbl.ROLE_SUBSCRIPTIONS_TAB},e)}))})})]})};var fw="guild-role-subscription-overview-notice",dw=n(765037),pw=n.n(dw);function hw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ew(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){
if(!e)return;if("string"==typeof e)return hw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hw(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yw(e){var t=e.onGoBack,n=e.onDismiss,i=o.useMemo((function(){return document.getElementById(fw)}),[]);return null==i?null:IM.createPortal((0,r.jsx)(RM,{buttonText:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PURCHASE_BACK_TO_GROUPS_VIEW_CTA,onGoBack:t,onDismiss:n,showCloseButton:!1}),i)}function mw(e){var t=e.guild,n=(0,SM.z5)(t.id),i=(0,OM.YB)(t.id),a=(0,OM.GG)(t.id),l=Ew(o.useState(null),2),u=l[0],f=l[1],d=(0,s.e7)([vN.Z],(function(){return vN.Z.isViewingSubscriptionRoles(t.id)})),p=Ew(o.useState(!1),2),h=p[0],E=p[1],y=(0,
s.Wu)([TM.Z],(function(){return a.filter((function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=e.subscription_listings_ids[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value,s=TM.Z.getSubscriptionListing(a);if(null!=s&&(d||s.published))return!0}}catch(e){n=!0;r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return!1}))}),[a,d]);if(!n){var m=y[0];return null!=m||d?(0,r.jsx)(uw,{guild:t,groupListing:m,singleGroupView:!0,editGroupId:t.id}):null}var b,g,O=y.find((function(e){return e.id===u}));return null!=O?(0,r.jsxs)(r.Fragment,{children:[!h&&(0,r.jsx)(yw,{onGoBack:function(){return f(null)},onDismiss:function(){return E(!0)}}),(0,r.jsx)(uw,{guild:t,groupListing:O,singleGroupView:!1,editGroupId:O.id})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(aw,{title:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PURCHASE_PAGE_GROUP_CTA.format({serverName:t.toString()}),description:null!==(b=null==i?void 0:i.description)&&void 0!==b?b:null,
coverImageAsset:null!==(g=null==i?void 0:i.cover_image_asset)&&void 0!==g?g:null,guild:t}),(0,r.jsx)(c.y5t,{children:(0,r.jsx)(NM.Z,{className:pw().groupListings,guildId:t.id,children:y.map((function(e){return(0,r.jsx)(FM,{groupListing:e,onSelectGroup:function(){return f(e.id)}},e.id)}))})})]})}var bw,gw=n(447079),Ow=n.n(gw),vw=n(302147),_w=n.n(vw);!function(e){e.GUILD_NOT_ELIGIBLE="guild_not_eligible";e.NOT_GUILD_MEMBER="not_guild_member"}(bw||(bw={}));var Iw=function(e){var t=e.errorType;(0,oh.Z)({type:W.nv.PAGE,name:W.zs.ROLE_SUBSCRIPTION_LISTING_UPSELL_ERROR_PAGE,properties:{error_page_type:t}});return(0,r.jsx)("div",{className:Ow().errorPageContainer,children:(0,r.jsxs)("div",{className:Ow().errorPageContent,children:[(0,r.jsx)("img",{src:_w(),alt:"",className:Ow().errorPageIllo}),(0,r.jsx)(c.X6q,{variant:"heading-xl/extrabold",className:Ow().errorPageTitle,
children:t===bw.GUILD_NOT_ELIGIBLE?Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PURCHASE_ERROR_PAGE_GUILD_NOT_ELIGIBLE_TITLE:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PURCHASE_ERROR_PAGE_NOT_GUILD_MEMBER_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",className:Ow().errorPagSubtitle,children:t===bw.GUILD_NOT_ELIGIBLE?Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PURCHASE_ERROR_PAGE_GUILD_NOT_ELIGIBLE_SUBTITLE:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PURCHASE_ERROR_PAGE_NOT_GUILD_MEMBER_SUBTITLE})]})})},Sw=n(10024),Tw=n.n(Sw),Nw=n(691634),Aw=n.n(Nw);function Cw(){return(0,r.jsx)("div",{className:Tw().container,children:(0,r.jsxs)("div",{className:Tw().content,children:[(0,r.jsx)("img",{src:Aw(),alt:Q.Z.Messages.CREATOR_MONETIZATION_NOTICE_ILLO_A11Y_LABEL}),(0,r.jsx)(xM.Z,{size:12}),(0,r.jsx)(c.X6q,{className:Tw().header,variant:"heading-lg/semibold",children:Q.Z.Messages.CREATOR_MONETIZATION_DISABLED_NOTICE_TITLE}),(0,r.jsx)(xM.Z,{size:8}),(0,r.jsx)(c.xvT,{color:"header-secondary",variant:"text-sm/normal",
children:Q.Z.Messages.CREATOR_MONETIZATION_DISABLED_NOTICE_DESCRIPTION})]})})}var Pw=n(452454),jw=n.n(Pw);function Rw(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function xw(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Rw(i,r,o,a,s,"next",e)}function s(e){Rw(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Mw(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var ww=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),
0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};const Dw=function(e){var t=e.guildId,i=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(t)}),[t]),a=(0,s.e7)([my.Z],(function(){return my.Z.isConnected()})),l=(0,mM.Z)(t),u=(0,vM.Z)(t),f=(0,s.e7)([gM.Z],(function(){return gM.Z.isSubscriptionFetching})),d=(0,OM.tT)(null==i?void 0:i.id,{refetchOnMount:!0}).listingsLoaded,p=(0,
bM.VV)(t),h=p.shouldHideRoleSubscriptionPurchaseEntryPoints,E=p.restrictionsLoading,y=null==i||!d||f||E;(0,Am.Tt)({subsection:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTIONS_CHANNEL_LABEL,location:null==i?void 0:i.name});(0,yM.Z)(no.tq?"role-subscriptions-overview":void 0);var m=a&&(null==i||!(l||u)||h&&!E);o.useEffect((function(){pf.jg()}),[]);o.useEffect((function(){if(m&&!no.tq){(0,c.ZDy)(xw((function(){var e,t;return ww(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(33086)]).then(n.bind(n,433086))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Mw(e,t,n[t])}))}return e}({},e))}]}}))})));if(C.Z.getChannelId(t)===Ig.oC.ROLE_SUBSCRIPTIONS){var e
;(0,K.dL)(M.Z5c.CHANNEL(t,null===(e=Hg.ZP.getDefaultChannel(t))||void 0===e?void 0:e.id))}else(0,K.dL)(yy.Z.defaultRoute)}}),[t,m]);if(no.tq&&m){var b=null==i?bw.NOT_GUILD_MEMBER:bw.GUILD_NOT_ELIGIBLE;return(0,r.jsx)(Iw,{errorType:b})}return(0,r.jsxs)("div",{className:jw().container,children:[(0,r.jsxs)(Og.Z,{toolbar:(0,r.jsx)(o.Fragment,{}),className:jw().headerBar,children:[(0,r.jsx)(Og.Z.Icon,{icon:_M.Z,"aria-hidden":!0}),(0,r.jsx)(Og.Z.Title,{children:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTIONS_CHANNEL_LABEL})]}),(0,r.jsx)("div",{id:fw}),(0,r.jsx)("div",{className:jw().content,children:l?(0,r.jsx)(c.u2D,{className:jw().scroller,children:(0,r.jsx)("div",{className:jw().scrollerContent,children:y?(0,r.jsx)(c.$jN,{}):(0,r.jsx)(mw,{guild:i})})}):(0,r.jsx)(Cw,{})})]})};var Zw=n(661299),Lw=n(516217),Uw=n(679724),kw=n(240697),Gw=(0,tc.B)({kind:"user",id:"2023-03_activity_gartic_phone_coach_mark",label:"Activity Coach Mark Gartic Phone",defaultConfig:{enabled:!1},treatments:[{id:1,
label:"Enable Activity Coach Mark Gartic Phone",config:{enabled:!0}}]}),Bw=(0,tc.B)({kind:"user",id:"2022-11_activitiesbashoutcoachmark",label:"Bash Out Coach Mark",defaultConfig:{enabled:!1},treatments:[{id:0,label:"Control",config:{enabled:!1}},{id:1,label:"Enable Bash Out Coach Mark",config:{enabled:!0}}]}),Hw=n(19585),Vw=n(363287);function Fw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Yw(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function zw(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Yw(i,r,o,a,s,"next",e)}function s(e){Yw(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Ww(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Kw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){
var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Fw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fw(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var qw=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},
"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Xw(e){
var t=e.canManageGuild,i=e.guildId,a=Kw(o.useState(!1),2),s=a[0],l=a[1],u=(0,un.wE)(ln.z$.APP_DIRECTORY_UPSELL_MODAL),f=Vw.sD.useExperiment({},{autoTrackExposure:!t&&!u}).enabled||t,d=f&&!u;o.useEffect((function(){if(d&&!s){l(!0);Ie.default.track(M.rMx.DISMISSIBLE_CONTENT_SHOWN,{type:ln.z$[ln.z$.APP_DIRECTORY_UPSELL_MODAL],guild_id:i});(0,c.ZDy)(zw((function(){var e,t;return qw(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(80664)]).then(n.bind(n,580664))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Ww(e,t,n[t])}))}return e}({guildId:i},e))}]}}))})),{onCloseCallback:function(){return(0,un.EW)(ln.z$.APP_DIRECTORY_UPSELL_MODAL,{
forceTrack:!0,dismissAction:hn.L.AUTO,guildId:i})}})}}),[i,d,s]);var p=(0,fE.QP)((function(e){return e.fullScreenLayers.length>0})),h=f&&u,E=p,y=(0,Xt.bn)(ln.z$.APP_DIRECTORY_COACH_MARK);o.useEffect((function(){return function(){y&&(0,un.EW)(ln.z$.APP_DIRECTORY_COACH_MARK,{dismissAction:hn.L.AUTO,guildId:i})}}),[i,y]);return{shouldRenderAppDirectoryCoachMark:h,hidesAppDirectoryCoachMark:E}}var Qw=n(387099),$w=n(653224),Jw=n(301443),eD=n(766496),tD=n(886077);function nD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rD(e){rD=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return rD(e)}function oD(e,t){return!t||"object"!==aD(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function iD(e,t){iD=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return iD(e,t)}var aD=function(e){
return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function sD(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=rD(e);if(t){var o=rD(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return oD(this,n)}}var cD={hiddenEventsAndStages:[]};function lD(e){var t=e.eventId,n=e.stageId;null==t&&null==n||O.Z.dispatch({type:"LIVE_CHANNEL_NOTICE_HIDE",eventId:t,stageId:n})}var uD=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&iD(e,t)}(n,e);var t=sD(n);function n(){nD(this,n);return t.apply(this,arguments)}
var r=n.prototype;r.initialize=function(e){null!=e&&null!=e.hiddenEventsAndStages&&(cD=e)};r.isLiveChannelNoticeHidden=function(e){var t=e.eventId,n=e.stageId;return!(null==n||!cD.hiddenEventsAndStages.includes("stage-".concat(n)))||null!=t&&cD.hiddenEventsAndStages.includes("event-".concat(t))};r.getState=function(){return cD};r.__getLocalVars=function(){return{state:cD}};return n}(s.ZP.PersistedStore);uD.displayName="LiveChannelNoticesStore";uD.persistKey="liveChannelNotices_v2";const fD=new uD(O.Z,{LIVE_CHANNEL_NOTICE_HIDE:function(e){var t=e.eventId,n=e.stageId;null!=t?cD.hiddenEventsAndStages.push("event-".concat(t)):null!=n&&cD.hiddenEventsAndStages.push("stage-".concat(n))},GUILD_SCHEDULED_EVENT_UPDATE:function(e){var t=e.guildScheduledEvent,n="event-".concat(t.id);!cD.hiddenEventsAndStages.includes(n)||t.status!==h_.p1.CANCELED&&t.status!==h_.p1.COMPLETED||(cD.hiddenEventsAndStages=cD.hiddenEventsAndStages.filter((function(e){return e!==n})))},
GUILD_SCHEDULED_EVENT_DELETE:function(e){var t=e.guildScheduledEvent,n="event-".concat(t.id);cD.hiddenEventsAndStages.includes(n)&&(cD.hiddenEventsAndStages=cD.hiddenEventsAndStages.filter((function(e){return e!==n})))},STAGE_INSTANCE_DELETE:function(e){var t=e.instance,n="stage-".concat(t.id);cD.hiddenEventsAndStages.includes(n)&&(cD.hiddenEventsAndStages=cD.hiddenEventsAndStages.filter((function(e){return e!==n})))}});var dD=(0,tc.B)({kind:"guild",id:"2021-10_study_group",label:"Student hub study group",defaultConfig:{enableStudyGroup:!1},treatments:[{id:1,label:"Enables study group sidebar",config:{enableStudyGroup:!0}}]}),pD=function(e){o.useEffect((function(){null!=e&&e.hasFeature(M.oNc.HUB)&&dD.trackExposure({guildId:e.id})}),[e]);var t;return dD.useExperiment({guildId:null!==(t=null==e?void 0:e.id)&&void 0!==t?t:""},{disable:null==e||!e.hasFeature(M.oNc.HUB)})};var hD=n(96299),ED=n(940455);function yD(e,t){
if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mD(e){mD=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return mD(e)}function bD(e,t){return!t||"object"!==OD(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function gD(e,t){gD=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return gD(e,t)}var OD=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function vD(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=mD(e);if(t){var o=mD(this).constructor;n=Reflect.construct(r,arguments,o)
}else n=r.apply(this,arguments);return bD(this,n)}}var _D="publicUpsellChannelNoticeGuilds",ID=new Set;var SD=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&gD(e,t)}(n,e);var t=vD(n);function n(){yD(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(dn.Z,Zt.Z,fn.Z);this.syncWith([dn.Z,Zt.Z,fn.Z],M.dG4);var e;ID=null!==(e=new Set(_e.Z.get(_D)))&&void 0!==e?e:new Set};r.isVisible=function(e){if(null!=e){var t=fn.Z.getMemberCount(e.id);return!ID.has(e.id)&&null!=t&&t>=ED.U3&&dn.Z.can(M.Plq.ADMINISTRATOR,e)&&!e.hasFeature(M.oNc.COMMUNITY)}};r.__getLocalVars=function(){return{PUBLIC_UPSELL_CHANNEL_NOTICE_GUILDS_KEY:_D,guildIds:ID}};return n}(s.ZP.Store);SD.displayName="EnablePublicGuildUpsellNoticeStore";const TD=new SD(O.Z,{PUBLIC_UPSELL_NOTICE_DISMISS:function(e){
var t=e.guildId;if(!ID.has(t)){ID.add(t);_e.Z.set(_D,ID);return!0}}});var ND=n(985801),AD=n(930865);function CD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PD(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function jD(e){jD=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return jD(e)}function RD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){PD(e,t,n[t])}))}return e}function xD(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){
var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function MD(e,t){return!t||"object"!==DD(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function wD(e,t){wD=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return wD(e,t)}var DD=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function ZD(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=jD(e);if(t){var o=jD(this).constructor
;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return MD(this,n)}}var LD={},UD=function(){LD={lastDismissedGracePeriods:{},isVisible:{}}};UD();var kD=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&wD(e,t)}(n,e);var t=ZD(n);function n(){CD(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(e){null!=e&&(LD=e)};r.getLastDismissedGracePeriodForGuild=function(e){return null!=LD.lastDismissedGracePeriods[e]?LD.lastDismissedGracePeriods[e]:null};r.isVisible=function(e){return null!=e&&(null!=LD.isVisible[e]&&LD.isVisible[e])};r.getState=function(){return LD};r.__getLocalVars=function(){return{state:LD,setDefaultState:UD}};return n}(s.ZP.PersistedStore);kD.displayName="GuildBoostingGracePeriodNoticeStore";kD.persistKey="PremiumGuildGracePeriodNoticeStore"
;kD.migrations=[function(e){return xD(RD({},e),{lastDismissedGracePeriods:null!=e?RD({},e.lastDismissedGracePeriods):{},isVisible:{}})}];const GD=new kD(O.Z,{GUILD_APPLIED_BOOSTS_FETCH_SUCCESS:function(e){var t=e.guildId,n=e.appliedBoosts,r=null!=LD.lastDismissedGracePeriods[t]?LD.lastDismissedGracePeriods[t]:null,o=null!=r&&Date.now()-r<=M.Dge,i=null!=n&&!o&&(0,AD.Vx)(n,t);LD=xD(RD({},LD),{isVisible:xD(RD({},LD.isVisible),PD({},t,i))})},BOOSTED_GUILD_GRACE_PERIOD_NOTICE_DISMISS:function(e){var t=e.guildId;LD=xD(RD({},LD),{lastDismissedGracePeriods:xD(RD({},LD.lastDismissedGracePeriods),PD({},t,Date.now())),isVisible:xD(RD({},LD.isVisible),PD({},t,!1))})}});function BD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HD(e){HD=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return HD(e)}function VD(e,t){return!t||"object"!==YD(t)&&"function"!=typeof t?function(e){
if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function FD(e,t){FD=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return FD(e,t)}var YD=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function zD(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=HD(e);if(t){var o=HD(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return VD(this,n)}}var WD=null;function KD(){var e=Y.default.getCurrentUser();if(null==e||e.mfaEnabled===WD)return!1;WD=e.mfaEnabled}var qD=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
;e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&FD(e,t)}(n,e);var t=zD(n);function n(){BD(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(Y.default,Hg.ZP);this.syncWith([Y.default,Hg.ZP],KD)};r.isVisible=function(e){return null!=e&&e.mfaLevel===M.BpS.ELEVATED&&!1===WD&&Hg.ZP.hasElevatedPermissions(e.id)};r.__getLocalVars=function(){return{mfaEnabled:WD}};return n}(s.ZP.Store);qD.displayName="GuildMFAWarningStore";const XD=new qD(O.Z,{CONNECTION_OPEN:KD,GUILD_UPDATE:function(){return!0}});function QD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $D(e){$D=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return $D(e)}function JD(e,t){return!t||"object"!==tZ(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
;return e}(e):t}function eZ(e,t){eZ=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return eZ(e,t)}var tZ=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function nZ(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=$D(e);if(t){var o=$D(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return JD(this,n)}}var rZ={MAX_MEMBER_COUNT:new Set};var oZ=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&eZ(e,t)}(n,e);var t=nZ(n);function n(){QD(this,n);return t.apply(this,arguments)}
var r=n.prototype;r.initialize=function(){this.waitFor(dn.Z,Zt.Z,fn.Z);this.syncWith([dn.Z,Zt.Z,fn.Z],M.dG4);_e.Z.remove(M.vID.MAX_MEMBER_COUNT_100);_e.Z.remove(M.vID.MAX_MEMBER_COUNT_250);var e;rZ[M.vID.MAX_MEMBER_COUNT]=null!==(e=new Set(_e.Z.get(M.vID.MAX_MEMBER_COUNT)))&&void 0!==e?e:new Set};r.isVisible=function(e){if(null==e)return!1;var t,n=null!==(t=fn.Z.getMemberCount(e.id))&&void 0!==t?t:0,r=dn.Z.can(M.Plq.ADMINISTRATOR,e);return!rZ[M.vID.MAX_MEMBER_COUNT].has(e.id)&&r&&e.maxMembers>0&&e.maxMembers-n<=1e4};r.__getLocalVars=function(){return{CHANNEL_MEMBER_CAP_THRESHOLD:1e4,guildIds:rZ}};return n}(s.ZP.Store);oZ.displayName="MaxMemberCountChannelNoticeStore";const iZ=new oZ(O.Z,{MAX_MEMBER_COUNT_NOTICE_DISMISS:function(e){var t=e.guildId;if(!rZ[M.vID.MAX_MEMBER_COUNT].has(t)){rZ[M.vID.MAX_MEMBER_COUNT].add(t);_e.Z.set(M.vID.MAX_MEMBER_COUNT,rZ[M.vID.MAX_MEMBER_COUNT]);return!0}}});var aZ;!function(e){e[e.ENABLE_PUBLIC_GUILD=0]="ENABLE_PUBLIC_GUILD"
;e[e.APPLIED_GUILD_BOOST_GRACE_PERIOD=1]="APPLIED_GUILD_BOOST_GRACE_PERIOD";e[e.MAX_MEMBER_COUNT=2]="MAX_MEMBER_COUNT";e[e.GUILD_LIVE_CHANNEL=3]="GUILD_LIVE_CHANNEL";e[e.GUILD_MFA_WARNING=4]="GUILD_MFA_WARNING";e[e.COMMANDS_MIGRATION=5]="COMMANDS_MIGRATION";e[e.APPLICATION_SUBSCRIPTION_EXPIRATION=6]="APPLICATION_SUBSCRIPTION_EXPIRATION";e[e.HUB_STUDY_ROOM=7]="HUB_STUDY_ROOM"}(aZ||(aZ={}));function sZ(e){var t,n=null!==(t=null==e?void 0:e.id)&&void 0!==t?t:"",r=(0,s.cj)([ND.Z],(function(){return{appliedGuildBoosts:ND.Z.getAppliedGuildBoostsForGuild(n),lastFetchedAt:ND.Z.getLastFetchedAtForGuild(n)}})).lastFetchedAt,i=(0,s.cj)([GD],(function(){return{lastDismissedGracePeriod:GD.getLastDismissedGracePeriodForGuild(n),isGracePeriodVisible:GD.isVisible(n)}})),a=i.lastDismissedGracePeriod,c=i.isGracePeriodVisible,l=(0,s.e7)([TD],(function(){return TD.isVisible(e)})),u=(0,s.e7)([iZ],(function(){return iZ.isVisible(e)})),f=(0,s.e7)([dn.Z],(function(){return dn.Z.can(M.Plq.ADMINISTRATOR,e)
})),d=null!=a&&Date.now()-a<=M.Dge,p=null!=e?e.premiumSubscriberCount:0,h=(0,AD.rF)(p,n)!==M.Eu4.NONE,E=!(null!=r&&Date.now()-r<=432e5)&&(!d&&f&&h),y=function(e){var t,n=(0,tD.ZP)(e),r=S.Z.getChannel(null===(t=n[0])||void 0===t?void 0:t.id),o=(0,s.e7)([eD.Z],(function(){return eD.Z.getStageInstanceByChannel(null==r?void 0:r.id)}),[r]),i=(0,vv.k5)(e),a=(0,s.cj)([fD],(function(){return{isStageNoticeHidden:fD.isLiveChannelNoticeHidden({stageId:null==o?void 0:o.id}),isEventNoticeHidden:fD.isLiveChannelNoticeHidden({eventId:null==i?void 0:i.id})}}),[o,i]),c=a.isStageNoticeHidden,l=a.isEventNoticeHidden;return null!=i?null!=o?!c:!l:null!=o&&!c}(n),m=(0,s.e7)([XD],(function(){return XD.isVisible(e)})),b=hD.Z.useShouldShowChannelNotice(n),g=(0,Jw.h6)(e),O=pD(e).enableStudyGroup,v=g.length>0,_=O&&!Boolean(null==e?void 0:e.hasFeature(M.oNc.HUB));o.useEffect((function(){var e=-1;E&&(e=window.setTimeout((function(){null!=n&&(0,$w.C0)(n)}),30*Math.random()*1e3));return function(){
window.clearTimeout(e)}}),[n,E]);return l?aZ.ENABLE_PUBLIC_GUILD:c?aZ.APPLIED_GUILD_BOOST_GRACE_PERIOD:u?aZ.MAX_MEMBER_COUNT:y?aZ.GUILD_LIVE_CHANNEL:m?aZ.GUILD_MFA_WARNING:b?aZ.COMMANDS_MIGRATION:v?aZ.APPLICATION_SUBSCRIPTION_EXPIRATION:_?aZ.HUB_STUDY_ROOM:null}var cZ=n(24230),lZ=n(179138),uZ=n(495085),fZ=n(213013),dZ=n(383950),pZ=n(830001),hZ=n(833667),EZ=n(342147),yZ=n(955514),mZ=n(485911);function bZ(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function gZ(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){bZ(i,r,o,a,s,"next",e)}function s(e){bZ(i,r,o,a,s,"throw",e)}a(void 0)}))}}function OZ(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var vZ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},
"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function _Z(e){var t,i=(0,EZ.SE)(e),a=ED.$X.some((function(t){
return(null==e?void 0:e.id)!==mZ._&&Tl.ZP.canEveryone(t,e)})),s=(null==e?void 0:e.defaultMessageNotifications)===M.bL.ALL_MESSAGES,l=(0,yZ.F)(ln.CW.DISABLE_UNSAFE_COMMUNITY_PERMISSIONS_NOTICE,null!==(t=null==e?void 0:e.id)&&void 0!==t?t:""),u=i&&(a||s)&&!l,f=o.useCallback((function(){var t;(0,yZ.Q)(ln.CW.DISABLE_UNSAFE_COMMUNITY_PERMISSIONS_NOTICE,null!==(t=null==e?void 0:e.id)&&void 0!==t?t:"",!0,hn.L.DISMISS)}),[e]),d=o.useRef(!1);o.useEffect((function(){if(u&&!d.current){(0,c.ZDy)(gZ((function(){var t,o;return vZ(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(95937)]).then(n.bind(n,195937))];case 1:t=i.sent(),o=t.default;return[2,function(t){return(0,r.jsx)(o,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))))
;r.forEach((function(t){OZ(e,t,n[t])}))}return e}({guild:e,canEveryoneModerate:a,isDefaultNotificationsAllMessages:s},t))}]}}))})),{onCloseCallback:f});var t;Ie.default.track(M.rMx.DISMISSIBLE_CONTENT_SHOWN,{type:ln.CW[ln.CW.DISABLE_UNSAFE_COMMUNITY_PERMISSIONS_NOTICE],guild_id:null!==(t=null==e?void 0:e.id)&&void 0!==t?t:""});d.current=!0}}),[a,e,f,s,u])}var IZ=n(529428),SZ=n(603927);var TZ=n(10390);function NZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AZ(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function CZ(e){CZ=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return CZ(e)}function PZ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){
return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){AZ(e,t,n[t])}))}return e}function jZ(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function RZ(e,t){return!t||"object"!==MZ(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xZ(e,t){xZ=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return xZ(e,t)}var MZ=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function wZ(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=CZ(e);if(t){var o=CZ(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return RZ(this,n)}}var DZ="hasSeenGuildTemplatePromotionTooltip",ZZ={},LZ=!0===_e.Z.get(DZ);function UZ(e){var t=e.guildId;ZZ=jZ(PZ({},ZZ),AZ({},t,!1))}var kZ=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&xZ(e,t)}(n,e);var t=wZ(n);function n(){NZ(this,n);return t.apply(this,arguments)}var r=n.prototype;r.shouldShowGuildTemplateDirtyTooltip=function(e){var t;return null!==(t=ZZ[e])&&void 0!==t&&t}
;r.shouldShowGuildTemplatePromotionTooltip=function(){return!LZ};r.__getLocalVars=function(){return{HAS_SEEN_GUILD_TEMPLATE_PROMOTION_TOOLTIP_KEY:DZ,showGuildTemplateDirtyTooltipFlags:ZZ,seenGuildTemplatePromotionTooltip:LZ}};return n}(s.ZP.Store);kZ.displayName="GuildTemplateTooltipStore";const GZ=new kZ(O.Z,{GUILD_TEMPLATE_DIRTY_TOOLTIP_REFRESH:function(e){var t=e.guildTemplate;ZZ=jZ(PZ({},ZZ),AZ({},t.source_guild_id,t.is_dirty||!1))},GUILD_TEMPLATE_PROMOTION_TOOLTIP_HIDE:function(){_e.Z.set(DZ,!0);LZ=!0},GUILD_TEMPLATE_SYNC_SUCCESS:function(e){ZZ=jZ(PZ({},ZZ),AZ({},e.guildTemplate.source_guild_id,!1))},GUILD_TEMPLATE_DIRTY_TOOLTIP_HIDE:UZ,GUILD_TEMPLATE_DELETE_SUCCESS:UZ});var BZ=n(198325),HZ=n(156620),VZ=n(305082),FZ=n(455469),YZ=n(964262),zZ=n(536945),WZ=n(736543),KZ=n(361925),qZ=n(620597),XZ=n(953727),QZ=n(7602),$Z=n(604160),JZ=n(330768),eL=n(95891),tL=n(636795),nL=n(61894),rL=n.n(nL),oL=n(50976),iL=n.n(oL);function aL(e,t,n){t in e?Object.defineProperty(e,t,{value:n,
enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var sL,cL=function(e){var t=e.markAsDismissed,n=e.guildId,o=Lw.ZP.getCurrentConfig({guildId:n},{autoTrackExposure:!1}).hasInfinite,i=Y.default.getCurrentUser(),a=(0,tL.I5)(i),s=Q.Z.Messages.SUPER_REACTION_COACHMARK_DESCRIPTION.format({helpdeskArticle:o?X.Z.getArticleURL(M.BhN.NITRO):X.Z.getArticleURL(M.BhN.SUPER_REACTIONS)}),l=null==i?void 0:i.premiumType,u=null!=l?(0,Na.Px)(l):null;if(a&&null!=u&&!o){var f=(0,JZ.UY)(i);s=Q.Z.Messages.SUPER_REACTION_COACHMARK_NITRO_DESCRIPTION.format({helpdeskArticle:X.Z.getArticleURL(M.BhN.SUPER_REACTIONS),refillAmount:f,premiumTier:u})}return(0,r.jsx)("div",{className:rL().wrapper,children:(0,r.jsx)("div",{className:rL().container,children:(0,r.jsxs)("div",{className:rL().content,children:[(0,r.jsx)("img",{className:rL().banner,src:iL(),alt:"","aria-label":""}),(0,r.jsxs)("div",{className:rL().header,children:[(0,r.jsx)(eL.Z,{width:14,height:14}),(0,r.jsx)(c.X6q,{className:rL().headerText,
variant:"heading-md/bold",color:"always-white",children:Q.Z.Messages.SUPER_REACTION_COACHMARK_TITLE})]}),(0,r.jsx)(c.xvT,{className:lh()(rL().subheaderText,aL({},rL().hideBetaLink,o)),variant:"text-sm/normal",color:"always-white",children:s}),(0,r.jsx)("div",{className:rL().ctaActionWrapper,children:a?(0,r.jsx)(c.zxk,{className:rL().readyButton,color:c.zxk.Colors.BRAND,look:c.zxk.Looks.INVERTED,onClick:function(){return t()},children:Q.Z.Messages.TUTORIAL_CLOSE}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.zxk,{color:c.zxk.Colors.BRAND,look:c.zxk.Looks.BLANK,onClick:function(){return t()},children:Q.Z.Messages.DISMISS}),(0,r.jsx)(c.zxk,{color:c.zxk.Colors.BRAND,look:c.zxk.Looks.INVERTED,onClick:function(){(0,$Z.Z)({subscriptionTier:jf.Si.TIER_2,analyticsLocations:[Pf.Z.BURST_REACTION_TUTORIAL_COACHMARK],analyticsObject:{object:M.qAy.BUTTON_CTA,section:M.jXE.NOTIFICATION_BAR},onClose:function(){return t()}});t()},children:Q.Z.Messages.PREMIUM_SETTINGS_GET})]})})]})})})
},lL=n(811182),uL=n(26468),fL=n(582762),dL=n(691648),pL=n(786170),hL=n(456517),EL=n.n(hL);!function(e){e.BOOSTING="BOOSTING";e.NITRO="NITRO";e.BASH_OUT="BASH_OUT";e.GARTIC_PHONE="GARTIC_PHONE"}(sL||(sL={}));var yL="https://cdn.discordapp.com/attachments/860252504826445825/1029516100356018217/Activities_NUX_GL_1.mp4",mL="https://cdn.discordapp.com/attachments/887469171804356628/916446867586416660/activities-video-poster-512.png";var bL=function(e){var t=e.channelId,n=e.markAsDismissed,i=function(e){switch(e){case sL.BOOSTING:return{analyticsLocation:Pf.Z.ACTIVITY_COACH_MARK_BOOSTING,analyticsType:"embedded_activity_discovery_tutorial",description:Q.Z.Messages.EMBEDDED_ACTIVITY_NOTICE_WTP_DESCRIPTION,learnMore:!0,title:Q.Z.Messages.EMBEDDED_ACTIVITY_NOTICE_TITLE,videoPosterUrl:mL,videoUrl:yL,ctaText:Q.Z.Messages.EMBEDDED_ACTIVITIES_TRY_IT_OUT,dismissText:Q.Z.Messages.DISMISS};case sL.NITRO:return{analyticsLocation:Pf.Z.ACTIVITY_COACH_MARK_NITRO,
analyticsType:"embedded_activity_nitro_discovery_tutorial",description:Q.Z.Messages.EMBEDDED_ACTIVITY_NOTICE_NITRO_DESCRIPTION,learnMore:!0,title:Q.Z.Messages.EMBEDDED_ACTIVITY_NOTICE_NITRO_TITLE,videoPosterUrl:mL,videoUrl:yL,ctaText:Q.Z.Messages.EMBEDDED_ACTIVITIES_TRY_IT_OUT,dismissText:Q.Z.Messages.DISMISS};case sL.BASH_OUT:return{analyticsLocation:Pf.Z.ACTIVITY_COACH_MARK_BASH_OUT,analyticsType:"embedded_activity_bash_out_tutorial",description:Q.Z.Messages.EMBEDDED_ACTIVITY_NOTICE_BASH_OUT_DESCRIPTION,learnMore:!1,title:Q.Z.Messages.EMBEDDED_ACTIVITIES_AVAILABLE_NOW,videoPosterUrl:"https://cdn.discordapp.com/attachments/860252504826445825/1037963592227635230/bash_out.jpg",videoUrl:"https://cdn.discordapp.com/attachments/860252504826445825/1037967755955146762/bash_out.mp4",ctaText:Q.Z.Messages.PLAY,dismissText:Q.Z.Messages.DISMISS};case sL.GARTIC_PHONE:return{analyticsLocation:Pf.Z.ACTIVITY_COACH_MARK_GARTIC_PHONE,analyticsType:"embedded_activity_gartic_phone_tutorial",
description:Q.Z.Messages.EMBEDDED_ACTIVITY_GARTIC_PHONE_DESCRIPTION,learnMore:!1,title:Q.Z.Messages.EMBEDDED_ACTIVITY_GARTIC_PHONE_TITLE,videoPosterUrl:"https://cdn.discordapp.com/attachments/860252504826445825/1083484393609367563/23_023_GarticPhone_Web_Coachmark_English.jpg",videoUrl:"https://cdn.discordapp.com/attachments/860252504826445825/1083484048539779173/23_023_GarticPhone_Web_Coachmark_English.mp4",ctaText:Q.Z.Messages.PLAY_NOW,dismissText:Q.Z.Messages.MAYBE_LATER};default:return{analyticsLocation:Pf.Z.ACTIVITY_COACH_MARK_NITRO,analyticsType:"",description:"",learnMore:!1,title:"",videoPosterUrl:"",videoUrl:"",ctaText:"",dismissText:""}}}(e.tutorialType),a=i.analyticsLocation,l=i.analyticsType,u=i.ctaText,f=i.dismissText,d=i.description,p=i.learnMore,h=i.title,E=i.videoPosterUrl,y=i.videoUrl,m=(0,Hw.Z)(a),b=m.analyticsLocations,g=m.AnalyticsLocationProvider;o.useEffect((function(){Ie.default.track(M.rMx.TOOLTIP_VIEWED,{type:l})}),[l]);var O=(0,uL.bp)()===M.IlC.POPOUT,v=(0,
s.e7)([S.Z],(function(){return S.Z.getChannel(t)}),[t]);return(0,r.jsx)(g,{children:(0,r.jsx)("div",{className:EL().wrapper,children:(0,r.jsx)("div",{className:EL().container,children:(0,r.jsxs)("div",{className:EL().content,children:[(0,r.jsx)(pL.Z,{className:EL().video,src:y,poster:E,width:224,height:126,loop:!0,muted:!0,autoPlay:!0}),(0,r.jsx)("div",{className:EL().header,children:(0,r.jsx)(c.X6q,{className:EL().headerText,variant:"text-sm/bold",color:"always-white",children:h})}),(0,r.jsxs)(c.xvT,{className:EL().subheaderText,variant:"text-xs/normal",color:"always-white",children:[d,p?(0,r.jsxs)(r.Fragment,{children:[" ",(0,r.jsx)(c.eee,{className:EL().learnMoreLink,href:"https://support.discord.com/hc/articles/4422142836759",children:Q.Z.Messages.LEARN_MORE})]}):null]}),(0,r.jsxs)("div",{className:EL().ctaActionWrapper,children:[(0,r.jsx)(c.zxk,{color:c.zxk.Colors.BRAND,onClick:function(){n()},children:f}),(0,r.jsx)(c.zxk,{color:c.zxk.Colors.BRAND,look:c.zxk.Looks.INVERTED,
onClick:function(){n();if(null!=v){(0,dL.Z)({channel:v.isGuildVoice()?v:void 0,guildId:v.guild_id,locationObject:{page:M.ZY5.GUILD_CHANNEL,section:M.jXE.GUILD_CHANNEL_LIST,object:M.qAy.ACTIVITIES_COACH_MARK,objectType:M.Qqv.ACTIVITY},openInPopout:O,analyticsLocations:b});(0,fL.w1)(v.guild_id)}},children:u})]})]})})})})},gL=n(63054),OL=n(338935),vL=n(692969),_L=n.n(vL),IL=n(694111),SL=n.n(IL);function TL(e){var t=e.guild,n=e.markAsDismissed;return(0,r.jsx)(qZ.ZP,{header:Q.Z.Messages.DISCOVERY_LANDING_PAGE_UPSELL_TITLE,content:Q.Z.Messages.DISCOVERY_LANDING_PAGE_UPSELL_DESCRIPTION,asset:(0,r.jsx)("div",{className:_L().image,children:(0,r.jsx)("img",{alt:"",src:SL()})}),buttonCTA:Q.Z.Messages.DISCOVERY_LANDING_PAGE_UPSELL_BUTTON_ACCEPT,onClick:function(e){!function(e,t){t&&pr.Z.open(e.id,M.pNK.DISCOVERY_LANDING_PAGE)}(t,!0)},secondaryButtonCTA:Q.Z.Messages.DISCOVERY_LANDING_PAGE_UPSELL_BUTTON_DISMISS,onSecondaryClick:function(){},markAsDismissed:n})}
var NL=n(718116),AL=n(741159),CL=n.n(AL);function PL(e){var t=e.onClick,n=e.onSecondaryClick,i=e.onComponentMount,a=e.markAsDismissed;o.useEffect((function(){null==i||i()}),[i]);var s=o.useCallback((function(e){t(e);null==a||a(hn.L.PRIMARY)}),[t,a]),l=o.useCallback((function(){null==n||n();null==a||a(hn.L.SECONDARY)}),[n,a]);return(0,r.jsxs)("div",{className:CL().tooltipWrapper,children:[(0,r.jsx)(c.X6q,{className:CL().tooltipHeader,variant:"heading-md/semibold",children:Q.Z.Messages.SERVER_DISCOVERY_TOOLTIP_TITLE}),(0,r.jsx)(c.xvT,{className:CL().tooltipText,variant:"text-sm/normal",children:Q.Z.Messages.SERVER_DISCOVERY_TOOLTIP_DESCRIPTION.format({count:NL.WZ})}),(0,r.jsxs)("div",{className:CL().buttonsContainer,children:[(0,r.jsx)(c.zxk,{fullWidth:!0,size:c.zxk.Sizes.SMALL,color:c.zxk.Colors.BRAND,onClick:s,children:Q.Z.Messages.LEARN_MORE}),(0,r.jsx)(c.zxk,{fullWidth:!0,size:c.zxk.Sizes.SMALL,look:c.zxk.Looks.BLANK,onClick:l,children:Q.Z.Messages.NO_THANKS})]})]})}
var jL=n(311846),RL=n(743219),xL=n(894243),ML=n(442535),wL=n(983449),DL=n.n(wL);function ZL(){var e=(0,ML.j)(!0);return(0,r.jsx)("div",{children:(0,r.jsx)(c.qEK,{src:e,size:c.EFr.SIZE_40,"aria-label":Q.Z.Messages.GUILD_AUTOMOD_USERNAME})})}function LL(e){var t=e.guildId,n=e.onDismissed,i=e.contentHeader,a=e.contentBody,s=e.acceptButtonText,l=e.dismissButtonText,u=e.imageHeader,f=e.analyticsTooltipViewedType,d=e.onAccept,p=e.onInitialized,h=null!=d?d:function(){n();pr.Z.open(t,M.pNK.GUILD_AUTOMOD);pr.Z.setSection(M.pNK.GUILD_AUTOMOD)};o.useEffect((function(){null!=p&&p()}),[p]);return(0,r.jsx)(qZ.ZP,{className:DL().message,header:i,content:a,onComponentMount:function(){null!=f&&Ie.default.track(M.rMx.TOOLTIP_VIEWED,{type:f,location:{page:M.ZY5.GUILD_CHANNEL}})},asset:(0,r.jsx)("div",{className:DL().container,children:(0,r.jsxs)("div",{className:DL().card,children:[(0,r.jsx)(ZL,{}),(0,r.jsxs)("div",{className:DL().content,children:[(0,r.jsxs)("div",{className:DL().name,children:[(0,
r.jsx)(c.xvT,{variant:"text-sm/semibold",color:"text-brand",className:DL().nameText,children:null!=u?u:Q.Z.Messages.GUILD_AUTOMOD_DEFAULT_UPSELL_ASSET_HEADER}),(0,r.jsx)(xL.Z,{width:16,height:16,color:jL.Z.BLUE_345,className:DL().shield})]}),(0,r.jsx)("div",{className:DL().spoiler})]})]})}),buttonCTA:null!=s?s:Q.Z.Messages.GUILD_AUTOMOD_DEFAULT_UPSELL_CTA,onClick:h,secondaryButtonCTA:null!=l?l:Q.Z.Messages.GUILD_AUTOMOD_DEFAULT_UPSELL_DISMISSAL,markAsDismissed:n})}function UL(e){var t=e.guildId,n=e.onDismissed;return(0,r.jsx)(LL,{guildId:t,onDismissed:n,contentHeader:Q.Z.Messages.GUILD_AUTOMOD_CUSTOM_BLOCK_MESSAGE_UPSELL_HEADER,contentBody:Q.Z.Messages.GUILD_AUTOMOD_CUSTOM_BLOCK_MESSAGE_UPSELL_CONTENT.format(),analyticsTooltipViewedType:"guild_automod_custom_block_message"})}function kL(e){var t=e.guildId,n=e.onDismissed;return(0,r.jsx)(LL,{guildId:t,onDismissed:n,imageHeader:Q.Z.Messages.GUILD_MENTION_RAID_LIMIT_UPSELL_ASSET_HEADER,
contentHeader:Q.Z.Messages.GUILD_MENTION_RAID_LIMIT_UPSELL_HEADER,contentBody:Q.Z.Messages.GUILD_MENTION_RAID_LIMIT_UPSELL_CONTENT,analyticsTooltipViewedType:"guild_mention_raid_limit",onAccept:function(){n();pr.Z.open(t,M.pNK.GUILD_AUTOMOD);pr.Z.setSection(M.pNK.GUILD_AUTOMOD,M.KsC.AUTOMOD_MENTION_SPAM)}})}function GL(e){var t=e.guildId,n=e.onDismissed;return(0,r.jsx)(LL,{guildId:t,onDismissed:n,imageHeader:Q.Z.Messages.GUILD_ANTIRAID_UPSELL_ASSET_HEADER,contentHeader:Q.Z.Messages.GUILD_ANTIRAID_UPSELL_HEADER,contentBody:Q.Z.Messages.GUILD_ANTIRAID_UPSELL_CONTENT.format(),analyticsTooltipViewedType:"guild_anti_raid_upsell",dismissButtonText:Q.Z.Messages.GUILD_ANTIRAID_UPSELL_DISMISSAL,onAccept:function(){n();pr.Z.open(t,M.pNK.MODERATION)},onInitialized:function(){RL.l.trackExposure({guildId:t})}})}var BL=n(596801),HL=n(64300),VL=n.n(HL),FL=n(204186),YL=n.n(FL);function zL(e){var t=e.guildId,n=e.markAsDismissed,o=(0,dE.ZP)([Zt.Z,Y.default],(function(){
var e=Y.default.getCurrentUser(),n=Zt.Z.getGuild(t);return!0===(null==n?void 0:n.isOwner(e))}));(0,oh.Z)({type:W.nv.POPOUT,name:W.zs.CREATOR_PROMO_PAGE_GUILD_HEADER_UPSELL,properties:{guild_id:t,is_owner:o}});return(0,r.jsx)("div",{className:VL().container,children:(0,r.jsx)(qZ.ZP,{header:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PROMO_PAGE_UPSELL_HEADER,content:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PROMO_PAGE_UPSELL_BODY,asset:(0,r.jsx)("div",{className:VL().image,children:(0,r.jsx)("img",{alt:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_UPSELL_IMG_ALT,src:YL(),className:VL().image})}),buttonCTA:Q.Z.Messages.CHECK_IT_OUT,onClick:function(){pr.Z.open(t,M.pNK.ROLE_SUBSCRIPTIONS_STORE_PAGE)},secondaryButtonCTA:Q.Z.Messages.DISMISS,markAsDismissed:n})})}var WL=n(513095),KL=n.n(WL);function qL(e){var t=e.guildId,n=e.markAsDismissed,o=(0,dE.ZP)([Zt.Z,Y.default],(function(){var e=Y.default.getCurrentUser(),n=Zt.Z.getGuild(t);return!0===(null==n?void 0:n.isOwner(e))}));(0,oh.Z)({type:W.nv.POPOUT,
name:W.zs.ENABLE_CREATOR_MONETIZATION_GUILD_HEADER_UPSELL,properties:{guild_id:t,is_owner:o}});return(0,r.jsx)("div",{className:KL().container,children:(0,r.jsx)(qZ.ZP,{header:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_UPSELL_HEADER,content:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_UPSELL_BODY,asset:(0,r.jsx)("div",{className:KL().image,children:(0,r.jsx)("img",{alt:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_UPSELL_IMG_ALT,src:Aw(),className:KL().image})}),buttonCTA:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTIONS_UPSELL_CTA,onClick:function(){pr.Z.open(t,M.pNK.ROLE_SUBSCRIPTIONS)},secondaryButtonCTA:Q.Z.Messages.DISMISS,markAsDismissed:n})})}var XL=n(621722),QL=n.n(XL);function $L(e){var t=e.markAsDismissed;return(0,r.jsxs)("div",{className:QL().container,children:[(0,r.jsx)("div",{className:QL().pointer}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:QL().content,children:Q.Z.Messages.HUB_PRIVACY_SETTINGS_TOOLTIP}),(0,r.jsx)(c.zxk,{look:c.zxk.Looks.INVERTED,fullWidth:!0,onClick:function(){t(hn.L.AUTO)},
children:Q.Z.Messages.GOT_IT})]})}var JL=n(255088),eU=n(609853),tU=n(557877),nU=n(937106),rU=n.n(nU),oU=n(289954),iU=n.n(oU),aU=n(998240),sU=n.n(aU),cU=n(810540),lU=n.n(cU),uU=n(705206),fU=n.n(uU),dU=n(567012),pU=n.n(dU),hU=n(862470),EU=n.n(hU),yU=n(283920),mU=n.n(yU),bU=n(49349),gU=n.n(bU);function OU(e){null!=e&&pr.Z.open(e.id,M.pNK.OVERVIEW,{section:M.jXE.PREMIUM_GUILD_PROGRESS_BAR},M.KsC.DISPLAY)}function vU(e,t){t&&pr.Z.open(e.id,M.pNK.DISCOVERY)}function _U(e,t){null!=t&&((0,AD.f2)(t,M.Eu4.TIER_1)?pr.Z.open(t.id,M.pNK.OVERVIEW,{section:M.jXE.PREMIUM_GUILD_INVITE_SPLASH},M.KsC.INVITE):(0,BL.Z)({analyticsLocations:e,analyticsSourceLocation:M.jXE.PREMIUM_GUILD_INVITE_SPLASH,guild:t,perks:(0,tU.o9)()}))}function IU(e){var t=e.renderPopout,n=e.renderGuildHeaderDropdownButton;return(0,r.jsx)(c.yRy,{renderPopout:function(){return(0,r.jsx)("div",{onClick:function(e){return e.stopPropagation()},children:t})},position:"bottom",align:"center",animation:c.yRy.Animation.TRANSLATE,
shouldShow:!0,children:function(){return n()}})}const SU=o.memo((function(e){var t=e.contentTypes,n=e.theme,o=e.guild,i=e.canManageRoles,a=e.renderGuildHeaderDropdownButton,s=e.hidesAppDirectoryCoachMark,c=e.useReducedMotion,l=(0,Hw.Z)().analyticsLocations,u=function(){Ie.default.track(M.rMx.TOOLTIP_VIEWED,{type:jf.cd.PREMIUM_PROGRESS_BAR,location:{page:M.ZY5.GUILD_CHANNEL}})},f=function(){Ie.default.track(M.rMx.PREMIUM_UPSELL_VIEWED,{type:jf.cd.INVITE_SPLASH_UPSELL,location:{page:M.ZY5.GUILD_CHANNEL},location_stack:l})},d=n===hc.BR.DARK?pU():EU(),p=JL.ZP.useExperiment({guildId:o.id}).allowSoundboard;return(0,r.jsx)(WN.Z,{contentTypes:t,groupName:hn.R.GUILD_HEADER_TOOLTIPS,children:function(e){var t=e.visibleContent,n=e.markAsDismissed;switch(t){case ln.z$.GUILD_MENTION_RAID_LIMIT:return(0,r.jsx)(IU,{renderPopout:(0,r.jsx)(kL,{guildId:o.id,onDismissed:n}),renderGuildHeaderDropdownButton:a});case ln.z$.GUILD_AUTOMOD_CUSTOM_BLOCK_MESSAGE:return(0,r.jsx)(IU,{renderPopout:(0,r.jsx)(UL,{
guildId:o.id,onDismissed:n}),renderGuildHeaderDropdownButton:a});case ln.z$.ANTI_RAID_SAFETY_ALERT_NOTICE:return(0,r.jsx)(IU,{renderPopout:(0,r.jsx)(GL,{guildId:o.id,onDismissed:n}),renderGuildHeaderDropdownButton:a});case ln.z$.GUILD_HEADER_PREMIUM_GUILD_PROGRESS:return(0,r.jsx)(IU,{renderPopout:(0,r.jsx)(qZ.ZP,{onComponentMount:u,header:Q.Z.Messages.PREMIUM_PROGRESS_BAR_GUILD_HEADER_TOOLTIP_TITLE,asset:(0,r.jsx)("img",{alt:"",src:d,className:iU().fullWidthImage}),content:Q.Z.Messages.PREMIUM_PROGRESS_BAR_GUILD_HEADER_TOOLTIP_CONTENT.format(),buttonCTA:Q.Z.Messages.PREMIUM_PROGRESS_BAR_GUILD_HEADER_TOOLTIP_CTA_PRIMARY_ROLE_SETTINGS,secondaryButtonCTA:Q.Z.Messages.PREMIUM_PROGRESS_BAR_GUILD_HEADER_TOOLTIP_CTA_SECONDARY,onSecondaryClick:function(){return OU()},onClick:function(){return OU(o)},markAsDismissed:n}),renderGuildHeaderDropdownButton:a});case ln.z$.GUILD_HEADER_PROGRESS_BAR_SIZE_COACH_MARK:return(0,r.jsx)(IU,{renderPopout:(0,r.jsx)(qZ.ZP,{onComponentMount:u,
header:Q.Z.Messages.PREMIUM_PROGRESS_BAR_GUILD_HEADER_SIZE_TOOLTIP_TITLE,asset:(0,r.jsx)("img",{alt:"",src:d,className:iU().fullWidthImage}),content:Q.Z.Messages.PREMIUM_PROGRESS_BAR_GUILD_HEADER_SIZE_TOOLTIP_CONTENT.format(),buttonCTA:Q.Z.Messages.PREMIUM_PROGRESS_BAR_GUILD_HEADER_TOOLTIP_CTA_PRIMARY_ROLE_SETTINGS,secondaryButtonCTA:Q.Z.Messages.PREMIUM_PROGRESS_BAR_GUILD_HEADER_TOOLTIP_CTA_SECONDARY,onSecondaryClick:function(){return OU()},onClick:function(){return OU(o)},markAsDismissed:n}),renderGuildHeaderDropdownButton:a});case ln.z$.GUILD_HEADER_ROLE_SUBSCRIPTION_UPSELL:return(0,r.jsx)(IU,{renderPopout:(0,r.jsx)(qL,{guildId:o.id,markAsDismissed:n}),renderGuildHeaderDropdownButton:a});case ln.z$.GUILD_HEADER_SERVER_DISCOVERY_TOOLTIP:return(0,r.jsx)(IU,{renderPopout:(0,r.jsx)(PL,{onClick:function(){return vU(o,!0)},onSecondaryClick:function(){return vU(o)},markAsDismissed:n}),renderGuildHeaderDropdownButton:a});case ln.z$.GUILD_DISCOVERY_LANDING_PAGE_SETTINGS_UPSELL:return(0,
r.jsx)(IU,{renderPopout:(0,r.jsx)(TL,{guild:o,markAsDismissed:n}),renderGuildHeaderDropdownButton:a});case ln.z$.GUILD_HEADER_INVITE_SPLASH:var h=(0,AD.f2)(o,M.Eu4.TIER_1)?Q.Z.Messages.INVITE_SPLASH_GUILD_HEADER_TOOLTIP_CONTENT.format():Q.Z.Messages.INVITE_SPLASH_GUILD_HEADER_TOOLTIP_CONTENT_LOCKED.format({boostCount:(0,AD.KK)(o,M.Eu4.TIER_1)}),E=(0,AD.f2)(o,M.Eu4.TIER_1)?Q.Z.Messages.INVITE_SPLASH_GUILD_HEADER_TOOLTIP_CTA_PRIMARY_ROLE_SETTINGS:Q.Z.Messages.LEARN_MORE;return(0,r.jsx)(IU,{renderPopout:(0,r.jsx)(qZ.ZP,{onComponentMount:f,header:Q.Z.Messages.INVITE_SPLASH_GUILD_HEADER_TOOLTIP_TITLE,asset:(0,r.jsx)("img",{alt:"",src:fU(),className:iU().fullWidthImage}),content:h,buttonCTA:E,secondaryButtonCTA:Q.Z.Messages.INVITE_SPLASH_GUILD_HEADER_TOOLTIP_CTA_SECONDARY,onSecondaryClick:function(){return _U(l)},onClick:function(){return _U(l,o)},markAsDismissed:n}),renderGuildHeaderDropdownButton:a});case ln.z$.GUILD_HEADER_APPLICATION_COMMAND_PERMISSIONS:return(0,r.jsx)(IU,{
renderPopout:(0,r.jsx)(qZ.ZP,{header:Q.Z.Messages.INTEGRATIONS_PERMISSIONS_TOOLTIP_HEADER,asset:(0,r.jsx)("img",{alt:"",src:sU(),className:rU().tooltipIntegrationsPermissionsAsset}),content:Q.Z.Messages.INTEGRATIONS_PERMISSIONS_TOOLTIP_CONTENT,buttonCTA:Q.Z.Messages.INTEGRATIONS_PERMISSIONS_TOOLTIP_CTA,onClick:function(){pr.Z.open(o.id,M.pNK.INTEGRATIONS)},secondaryButtonCTA:Q.Z.Messages.DISMISS,markAsDismissed:n}),renderGuildHeaderDropdownButton:a});case ln.z$.STUDENT_HUB_PRIVACY_SETTINGS_TOOLTIP:return(0,r.jsx)(IU,{renderPopout:(0,r.jsx)($L,{markAsDismissed:n}),renderGuildHeaderDropdownButton:a});case ln.z$.GUILD_HEADER_ACTIVE_THREADS_NOTICE:return(0,r.jsx)(IU,{renderPopout:(0,r.jsx)(qZ.ZP,{className:rU().tooltipOverrideColor,header:Q.Z.Messages.ACTIVE_THREADS_UPSELL_HEADER,content:Q.Z.Messages.ACTIVE_THREADS_UPSELL_CONTENT,buttonCTA:Q.Z.Messages.GOT_IT,onClick:function(){return n()},markAsDismissed:n}),renderGuildHeaderDropdownButton:a});case ln.z$.APP_DIRECTORY_COACH_MARK:return(0,
r.jsx)(IU,{renderPopout:(0,r.jsx)(qZ.ZP,{className:s?rU().visibilityHidden:void 0,header:Q.Z.Messages.APP_DIRECTORY_COACHMARK_HEADER,content:Q.Z.Messages.APP_DIRECTORY_COACHMARK,asset:(0,r.jsx)("img",{alt:"",src:lU(),className:rU().tooltipAsset}),buttonCTA:Q.Z.Messages.GOT_IT,onClick:function(){return n()},markAsDismissed:n}),renderGuildHeaderDropdownButton:a});case ln.z$.VERIFIED_ROLES_COACH_MARK:var y=i?"https://cdn.discordapp.com/attachments/1049469146498334781/1049763848305000458/linked_roles_admin_nux_final.mp4":"https://cdn.discordapp.com/attachments/1049469146498334781/1049763935072550952/Linked_roles_member_nux_final.mp4";return(0,r.jsx)(IU,{renderPopout:(0,r.jsx)(qZ.ZP,{className:rU().tooltipContainer,onComponentMount:function(){return function(e){Ie.default.track(M.rMx.TOOLTIP_VIEWED,{type:e?"VERIFIED_ROLES_ADMIN_COACH_MARK":"VERIFIED_ROLES_COACH_MARK",location:{page:M.ZY5.GUILD_CHANNEL}})}(i)},header:(0,r.jsxs)(r.Fragment,{
children:[i?Q.Z.Messages.VERIFIED_ROLES_ADMIN_COACHMARK_HEADER:Q.Z.Messages.VERIFIED_ROLES_COACHMARK_HEADER,(0,r.jsx)(Kb.Z,{className:rU().betaTag,color:$b.Z.unsafe_rawColors.WHITE_500.css})]}),headerClassName:rU().tooltipHeaderContainer,asset:(0,r.jsx)(pL.Z,{className:rU().tooltipVideo,src:y,loop:!0,autoPlay:!c,width:240,height:135}),content:(i?Q.Z.Messages.VERIFIED_ROLES_ADMIN_COACHMARK_CONTENT:Q.Z.Messages.VERIFIED_ROLES_COACHMARK_CONTENT).format({helpdeskArticle:X.Z.getArticleURL(M.BhN.CONNECTION_DETAILS)}),buttonCTA:Q.Z.Messages.CHECK_IT_OUT,secondaryButtonCTA:Q.Z.Messages.DISMISS,onClick:function(){if(i){pr.Z.init(o.id);pr.Z.open(o.id,M.pNK.ROLES)}else(0,OL.Am)(o.id)},markAsDismissed:function(){!function(e){Ie.default.track(M.rMx.DISMISSIBLE_CONTENT_DISMISSED,{type:e?"VERIFIED_ROLES_ADMIN_COACH_MARK":"VERIFIED_ROLES_COACH_MARK",location:{page:M.ZY5.GUILD_CHANNEL}})}(i);n()}}),renderGuildHeaderDropdownButton:a});case ln.z$.CREATOR_PROMO_PAGE_COACH_MARK:return(0,r.jsx)(IU,{
renderPopout:(0,r.jsx)(zL,{guildId:o.id,markAsDismissed:n}),renderGuildHeaderDropdownButton:a});case ln.z$.CLYDE_GUILD_HEADER_NUX:return(0,r.jsx)(IU,{renderPopout:(0,r.jsx)(qZ.ZP,{header:(0,r.jsxs)(r.Fragment,{children:[Q.Z.Messages.CLYDE_MODAL_TITLE,(0,r.jsx)(eU.Z,{className:rU().botTag,type:eU.H.AI,verified:!0})]}),headerClassName:rU().clydeTooltipHeaderContainer,asset:(0,r.jsx)("img",{alt:"",src:mU(),className:rU().clydeTooltipAsset}),content:Q.Z.Messages.CLYDE_GUILD_TOOLTIP_DETAILS.format({learnMoreURL:X.Z.getArticleURL(M.BhN.CLYDE_AI)}),buttonCTA:Q.Z.Messages.ENABLE,onClick:function(){pr.Z.open(o.id,M.pNK.INTEGRATIONS)},secondaryButtonCTA:Q.Z.Messages.DISMISS,markAsDismissed:n}),renderGuildHeaderDropdownButton:a});case ln.z$.GUILD_HEADER_SOUNDBOARD_PERMISSION:return(0,r.jsx)(IU,{renderPopout:(0,r.jsx)(qZ.ZP,{header:p?Q.Z.Messages.SOUNDBOARD_TOOLTIP_TITLE_NEW:Q.Z.Messages.SOUNDBOARD_TOOLTIP_TITLE,content:Q.Z.Messages.SOUNDBOARD_TOOLTIP_BODY,buttonCTA:Q.Z.Messages.CHECK_IT_OUT,
secondaryButtonCTA:Q.Z.Messages.NO_THANKS,asset:(0,r.jsx)("img",{alt:"",src:gU(),className:iU().fullWidthImage}),onClick:function(){pr.Z.open(o.id,M.pNK.ROLES);pr.Z.selectRole(o.id,Q.Z.Messages.USE_SOUNDBOARD)},markAsDismissed:n}),renderGuildHeaderDropdownButton:a});case ln.z$.GUILD_ONBOARDING_UPSELL_HEADER:return(0,r.jsx)(IU,{renderPopout:(0,r.jsx)(qZ.ZP,{className:rU().tooltipOverrideColor,header:Q.Z.Messages.GUILD_ONBOARDING_UPSELL_COACHMARK_TITLE,content:Q.Z.Messages.GUILD_ONBOARDING_UPSELL_COACHMARK_DESCRIPTION,buttonCTA:Q.Z.Messages.GUILD_ONBOARDING_UPSELL_COACHMARK_CHECK_IT_OUT,onClick:function(){pr.Z.open(o.id,M.pNK.ONBOARDING)},secondaryButtonCTA:Q.Z.Messages.DISMISS,markAsDismissed:n}),renderGuildHeaderDropdownButton:a});default:return a()}}})}));var TU=n(333398),NU=(0,tc.B)({kind:"user",id:"2022-12_channel_notice_redesign",label:"Channel Notice Redesign",defaultConfig:{showRedesignedChannelNotice:!1,showRedesignedLiveChannelNotice:!1},treatments:[{id:1,
label:"Show Redesigned Channel Notices",config:{showRedesignedChannelNotice:!0,showRedesignedLiveChannelNotice:!1}},{id:2,label:"Show Redesigned Stage/Event Notices",config:{showRedesignedChannelNotice:!1,showRedesignedLiveChannelNotice:!0}},{id:3,label:"Show Redesigned Channel Notices & Stage/Event Notices",config:{showRedesignedChannelNotice:!0,showRedesignedLiveChannelNotice:!0}}]});function AU(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=NU.useExperiment({},{autoTrackExposure:e}),n=t.showRedesignedChannelNotice,r=t.showRedesignedLiveChannelNotice;return{showRedesignedChannelNotice:n,showRedesignedLiveChannelNotice:r}}var CU=n(772260),PU=n.n(CU);function jU(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var RU=(0,za.debounce)(Sb.ZP.trackWithMetadata,500);const xU=function(e){
var t=e.guild,n=e.title,i=e.message,a=e.image,s=e.type,l=e.imageMarginX,u=e.imageMarginTop,f=e.trackingSource,d=e.undismissable,p=e.onDismissed,h=e.onClick,E=e.cta,y=e.ctaColor;o.useEffect((function(){RU(M.rMx.CHANNEL_NOTICE_VIEWED,{notice_type:s,guild_id:t.id})}),[t.id,s]);var m=null;"function"==typeof E?m=E():null!=E&&(m=(0,r.jsx)(c.zxk,{className:PU().button,size:c.zxk.Sizes.SMALL,onClick:function(){null!=s&&Ie.default.track(M.rMx.CHANNEL_NOTICE_CTA_CLICKED,{source:f,guild_id:t.id,notice_type:s});null==h||h()},fullWidth:!0,color:y,children:E}));var b=null!=l?"".concat(l,"px"):"16px";return(0,r.jsxs)("div",{className:PU().container,children:[!0===d?null:(0,r.jsx)(c.P3F,{onClick:function(){Sb.ZP.trackWithMetadata(M.rMx.CHANNEL_NOTICE_CLOSED,{notice_type:s});null==p||p()},className:PU().close,"aria-label":Q.Z.Messages.DISMISS,children:(0,r.jsx)(Ub.Z,{className:PU().closeIcon})}),null!=a&&(0,r.jsx)("div",{className:PU().imageContainer,style:{marginTop:"".concat(u,"px"),marginLeft:b,
marginRight:b},children:(0,r.jsx)("img",{className:PU().image,src:a,alt:""})}),(0,r.jsxs)("div",{className:PU().message,children:[null!=n?(0,r.jsx)(c.xvT,{variant:"text-md/medium",color:"header-primary",className:lh()(PU().title,jU({},PU().noImageTitle,null==a)),children:n}):null,(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"text-muted",children:i}),m]})]})};var MU=n(899060),wU=n.n(MU);function DU(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function ZU(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){DU(e,t,n[t])}))}return e}var LU=Wa().debounce(Sb.ZP.trackWithMetadata,500),UU=function(e){
var t=e.guild,n=e.title,i=e.message,a=e.image,s=e.type,l=e.imageMarginX,u=e.imageMarginTop,f=e.trackingSource,d=e.undismissable,p=e.onDismissed,h=e.onClick,E=e.cta,y=e.ctaColor;o.useEffect((function(){LU(M.rMx.CHANNEL_NOTICE_VIEWED,{notice_type:s,guild_id:t.id})}),[t.id,s]);var m=null;"function"==typeof E?m=E():null!=E&&(m=(0,r.jsx)(c.zxk,{className:wU().btn,size:c.zxk.Sizes.SMALL,onClick:function(){null!=s&&Ie.default.track(M.rMx.CHANNEL_NOTICE_CTA_CLICKED,{source:f,guild_id:t.id,notice_type:s});null==h||h()},fullWidth:!0,color:y,children:E}));var b=null!=l?"".concat(l,"px"):"16px";return(0,r.jsxs)("div",{className:wU().channelNotice,children:[!0===d?null:(0,r.jsx)(c.P3F,{onClick:function(){Sb.ZP.trackWithMetadata(M.rMx.CHANNEL_NOTICE_CLOSED,{notice_type:s});null==p||p()},className:wU().close,"aria-label":Q.Z.Messages.DISMISS,children:(0,r.jsx)(Ub.Z,{className:wU().closeIcon})}),(0,r.jsx)("div",{className:wU().imageContainer,style:{marginTop:"".concat(u,"px"),marginLeft:b,
marginRight:b},children:(0,r.jsx)("img",{className:wU().image,src:a,alt:""})}),(0,r.jsxs)("div",{className:wU().message,children:[null!=n?(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",className:wU().title,children:n}):null,(0,r.jsx)(c.xvT,{variant:"text-sm/normal",children:i}),m]})]})};const kU=function(e){return AU(!0).showRedesignedChannelNotice?(0,r.jsx)(xU,ZU({},e)):(0,r.jsx)(UU,ZU({},e))};var GU=n(108881),BU=n.n(GU);function HU(e){var t=e.guild,n=(0,Jw.h6)(t),i=function(){return(0,Cc.sB)(t.id)},a=o.useMemo((function(){return new Set(n.map((function(e){return e.applicationId})))}),[n]),c=(0,s.e7)([TU.Z],(function(){return TU.Z.getApplications()})),l=o.useMemo((function(){var e=[],t=!0,n=!1,r=void 0;try{for(var o,i=a[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var s=o.value,l=c[s];null!=l&&e.push(l)}}catch(e){n=!0;r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return e}),[c,a]);if(0===l.length)return null;var u=""
;u=1===l.length?Q.Z.Messages.ONE_APPLICATION_SUBSCRIPTION_EXPIRATION_CHANNEL_NOTICE_CONTENT.format({a:l[0].name}):2===l.length?Q.Z.Messages.TWO_APPLICATION_SUBSCRIPTION_EXPIRATION_CHANNEL_NOTICE_CONTENT.format({a:l[0].name,b:l[1].name}):3===l.length?Q.Z.Messages.THREE_APPLICATION_SUBSCRIPTION_EXPIRATION_CHANNEL_NOTICE_CONTENT.format({a:l[0].name,b:l[1].name,c:l[2].name}):Q.Z.Messages.MORE_APPLICATION_SUBSCRIPTION_EXPIRATION_CHANNEL_NOTICE_CONTENT;return(0,r.jsx)(kU,{guild:t,onDismissed:i,message:u,type:M.vID.APPLICATION_SUBSCRIPTION_EXPIRATION,image:BU(),onClick:function(){i();pr.Z.open(t.id,M.pNK.INTEGRATIONS)},imageMarginTop:6,imageMarginX:46,cta:Q.Z.Messages.APPLICATION_SUBSCRIPTION_EXPIRATION_CHANNEL_NOTICE_CTA})}var VU=n(228667);var FU=n(509142),YU=n.n(FU);function zU(e){var t=e.guild,n=e.markAsDismissed,o=(0,dE.ZP)([fd.Z],(function(){return fd.Z.getKeybindForAction(M.kg4.SAVE_CLIP)}));return null==o?null:(0,r.jsx)(kU,{image:YU(),guild:t,onDismissed:n,onClick:n,
message:Q.Z.Messages.CLIPS_CHANNEL_NOTICE_EDUCATION_BODY.format({keybind:Gf.BB(o.shortcut,!0)}),cta:Q.Z.Messages.GOT_IT,trackingSource:M.PsQ.CLIPS_EDUCATION,type:M.vID.CLIPS_EDUCATION})}var WU=n(226867),KU=n.n(WU);function qU(e){var t=e.guild,n=e.markAsDismissed;return(0,r.jsx)(kU,{image:KU(),guild:t,onDismissed:n,onClick:function(){open(X.Z.getArticleURL(M.BhN.CONNECTION_DETAILS));n()},title:Q.Z.Messages.LINKED_ROLES_ADMIN_NUX_TITLE,message:Q.Z.Messages.LINKED_ROLES_ADMIN_NUX_CONTENT,cta:Q.Z.Messages.LEARN_MORE,trackingSource:M.PsQ.LINKED_ROLES_ADMIN_NUX,type:M.vID.LINKED_ROLES_ADMIN})}var XU=n(23943),QU=n.n(XU);const $U=function(e){var t=e.guild,n=t.id,o=(0,s.e7)([ND.Z],(function(){return ND.Z.getAppliedGuildBoostsForGuild(t.id)}));return null==o||(0,AD._k)(o,n)<=0?null:(0,r.jsx)(kU,{guild:t,onDismissed:function(){!function(e){O.Z.dispatch({type:"BOOSTED_GUILD_GRACE_PERIOD_NOTICE_DISMISS",guildId:e})}(n)},onClick:function(){pr.Z.open(n,M.pNK.GUILD_PREMIUM)},
message:Q.Z.Messages.PREMIUM_GUILD_GRACE_PERIOD_NOTICE,trackingSource:M.PsQ.GRACE_PERIOD_NOTICE,type:M.vID.GUILD_BOOSTING_GRACE_PERIOD,image:QU(),cta:Q.Z.Messages.PREMIUM_GUILD_GRACE_PERIOD_NOTICE_BUTTON,ctaColor:c.Ttl.PRIMARY})};var JU=n(484771),ek=n.n(JU);function tk(e){var t=e.guild,n=e.markAsDismissed,o=(0,AD.KK)(t,M.Eu4.TIER_2),i=(0,Hw.Z)(Pf.Z.GUILD_BANNER_NOTICE).analyticsLocations;return(0,r.jsx)(kU,{guild:t,onDismissed:n,cta:Q.Z.Messages.GUILD_BANNER_NOTICE_CTA,message:Q.Z.Messages.GUILD_BANNER_NOTICE.format({boostsNeeded:o}),type:M.vID.GUILD_BANNER,image:ek(),onClick:function(){return(0,BL.Z)({analyticsLocations:i,analyticsSourceLocation:{section:M.jXE.CHANNEL_NOTICE,object:M.qAy.SERVER_BANNER_TOOLTIP},guild:t,perks:(0,tU.XO)()})},imageMarginTop:15,imageMarginX:22})}var nk=n(727869),rk=n.n(nk);function ok(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ik(e){ik=Object.setPrototypeOf?Object.getPrototypeOf:function(e){
return e.__proto__||Object.getPrototypeOf(e)};return ik(e)}function ak(e,t){return!t||"object"!==ck(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function sk(e,t){sk=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return sk(e,t)}var ck=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function lk(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=ik(e);if(t){var o=ik(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ak(this,n)}}var uk=function(e){!function(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&sk(e,t)}(n,e);var t=lk(n);function n(){ok(this,n);var e;(e=t.apply(this,arguments)).handleButtonClick=function(){var t=e.props.guild;(0,hZ.f)({guildId:t.id,location:{section:M.jXE.CHANNEL_NOTICE,object:M.qAy.SERVER_STATUS_CTA}})};return e}n.prototype.render=function(){var e=this.props,t=e.guild,n=e.memberCount,o=e.markAsDismissed,i=null==n||n<M.gpl;return(0,r.jsx)(kU,{guild:t,onDismissed:o,onClick:this.handleButtonClick,message:i?Q.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_NOTICE_SMALL_GUILD:Q.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_NOTICE,cta:Q.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_NOTICE_BUTTON,trackingSource:M.PsQ.GUILD_SUBSCRIPTION_NOTICE,type:M.vID.GUILD_BOOSTING,image:rk(),imageMarginX:26})};return n}(o.PureComponent);const fk=s.ZP.connectStores([fn.Z],(function(e){var t=e.guild
;return{memberCount:fn.Z.getMemberCount(t.id)}}))(uk);var dk=n(599467);function pk(e){var t,n=(0,vv.eF)(e),r=(0,tD.ZP)(e),o=S.Z.getChannel(null===(t=r[0])||void 0===t?void 0:t.id);return null!=n?n:o}var hk=n(933022);function Ek(e){return(0,s.e7)([Jn.default,C.Z,hk.ZP],(function(){var t=Jn.default.getId();return C.Z.getVoiceChannelId()===e?hk.ZP.getPermissionsForUser(t,e):null}),[e])}var yk=n(183640),mk=n(23727);function bk(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function gk(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}
function Ok(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function vk(e){var t=e.width,n=void 0===t?32:t,o=e.height,i=void 0===o?32:o,a=e.color,s=void 0===a?"currentColor":a,c=Ok(e,["width","height","color"]);return(0,r.jsx)("svg",gk(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){bk(e,t,n[t])}))}return e}({},(0,OO.Z)(c)),{width:n,height:i,viewBox:"0 0 ".concat(n," ").concat(i),fill:"none",children:(0,r.jsx)("path",{
fillRule:"evenodd",clipRule:"evenodd",d:"M8 3C7.44772 3 7 3.44772 7 4V12C7 12.5523 7.44772 13 8 13C8.55228 13 9 12.5523 9 12V4C9 3.44772 8.55228 3 8 3ZM3 6C3 5.44772 3.44772 5 4 5C4.55228 5 5 5.44772 5 6V10C5 10.5523 4.55228 11 4 11C3.44772 11 3 10.5523 3 10V6ZM11 6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V10C13 10.5523 12.5523 11 12 11C11.4477 11 11 10.5523 11 10V6Z",fill:s})}))}var _k=n(516909);function Ik(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Sk(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Tk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Sk(e,t,n[t])}))}return e}function Nk(e,t){t=null!=t?t:{}
;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Ak(e){return function(e){if(Array.isArray(e))return Ik(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ik(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ik(e,t)}(e)||function(){
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ck,Pk=16,jk=12;!function(e){e[e.STAGE=0]="STAGE";e[e.EVENT_EXTERNAL=1]="EVENT_EXTERNAL";e[e.EVENT_VOICE=2]="EVENT_VOICE";e[e.STUDY_ROOM=3]="STUDY_ROOM"}(Ck||(Ck={}));function Rk(e){var t=e.guild,n=e.isStudyRoomNotice,i=void 0!==n&&n,a=pk(t.id),l=(0,vv.k5)(t.id),u=(0,s.e7)([eD.Z],(function(){return eD.Z.getStageInstanceByChannel(null==a?void 0:a.id)}),[a]),f=(0,s.cj)([fD],(function(){return{isStageNoticeHidden:fD.isLiveChannelNoticeHidden({stageId:null==u?void 0:u.id}),isEventNoticeHidden:fD.isLiveChannelNoticeHidden({eventId:null==l?void 0:l.id})}}),[u,l]),d=f.isStageNoticeHidden,p=f.isEventNoticeHidden,h=(0,s.cj)([l_.Z],(function(){var e=l_.Z.getMutableParticipants(null==a?void 0:a.id,u_.pV.SPEAKER),t=null!=a?l_.Z.getParticipantCount(a.id,u_.pV.AUDIENCE):0;return{speakers:Ak(new Set(e.map((function(e){return e.user})))),
listenerCount:t}}),[null==a?void 0:a.id]),E=h.speakers,y=h.listenerCount,m=(0,s.e7)([dn.Z],(function(){return dn.Z.can(M.Plq.CONNECT,a)})),b=Ek(null==a?void 0:a.id),g=null==l?void 0:l.creator_id,O=(0,s.e7)([Y.default],(function(){return Y.default.getUser(g)}),[g]);o.useEffect((function(){null!=g&&(0,rl.PR)(g)}),[g]);var v=o.useMemo((function(){return function(e){var t=e.guildEvent,n=e.stageInstance,o=e.activeChannel,i=e.canConnect,a=e.myRole,s=e.eventCreator,l=e.speakers,u=e.listenerCount,f=e.isEventNoticeHidden,d=e.isStageNoticeHidden,p=e.isStudyRoomNotice,h=null!=n&&null!=o&&!d;if(p&&null!=o){var E=(0,EO.KS)(o);return{noticeType:Ck.STUDY_ROOM,title:"📚☕ ".concat(o.name),location:Q.Z.Messages.HUB_STUDY_ROOM_VOICE_CHANNEL_TOOLTIP,locationIcon:null!=E?(0,r.jsx)(E,{width:Pk,height:Pk,className:PU().locationIcon}):null,canListenIn:i,buttonText:Q.Z.Messages.HUB_STUDY_ROOM_NOTICE_VOICE_CTA,users:[],overflowUsers:null}}if(null==t||f){if(h){var y=Q.Z.Messages.STAGE_CHANNEL_JOIN_BUTTON
;(null==a?void 0:a.speaker)?y=Q.Z.Messages.STAGE_CHANNEL_JOINED_SPEAKER_BUTTON:null!=a&&(y=Q.Z.Messages.STAGE_CHANNEL_JOINED_AUDIENCE_BUTTON);return{noticeType:Ck.STAGE,title:n.topic,location:o.name,locationIcon:(0,r.jsx)(_k.Z,{width:Pk,height:Pk,className:PU().locationIcon}),canListenIn:i,buttonText:y,onClose:function(){return lD({stageId:null==n?void 0:n.id})},users:l.length>5?l.slice(0,5):l,overflowUsers:u<1?null:(0,r.jsxs)("div",{className:PU().pill,children:[(0,r.jsx)(mk.Z,{width:jk,height:jk,className:PU().pillIcon}),(0,r.jsx)(c.xvT,{variant:"text-xs/medium",color:"header-secondary",className:PU().pillLabel,children:u})]})}}}else{if(t.entity_type===h_.WX.STAGE_INSTANCE&&h){var m=Q.Z.Messages.STAGE_CHANNEL_JOIN_BUTTON;(null==a?void 0:a.speaker)?m=Q.Z.Messages.STAGE_CHANNEL_JOINED_SPEAKER_BUTTON:null!=a&&(m=Q.Z.Messages.STAGE_CHANNEL_JOINED_AUDIENCE_BUTTON);return{noticeType:Ck.STAGE,title:n.topic,location:o.name,locationIcon:(0,r.jsx)(_k.Z,{width:Pk,height:Pk,
className:PU().locationIcon}),canListenIn:i,buttonText:m,onClose:function(){return lD({stageId:null==n?void 0:n.id})},users:l.length>5?l.slice(0,5):l,overflowUsers:u<1?null:(0,r.jsxs)("div",{className:PU().pill,children:[(0,r.jsx)(mk.Z,{width:jk,height:jk,className:PU().pillIcon}),(0,r.jsx)(c.xvT,{variant:"text-xs/medium",color:"header-secondary",className:PU().pillLabel,children:u})]})}}if(t.entity_type===h_.WX.EXTERNAL){var b=(0,i_.cS)(t);return null==b?{noticeType:null}:{noticeType:Ck.EVENT_EXTERNAL,title:t.name,location:(0,dk.m)(b,!0),locationIcon:(0,r.jsx)(p_.Z,{width:Pk,height:Pk,className:PU().locationIcon}),canListenIn:!1,buttonText:Q.Z.Messages.GUILD_EVENT_DETAILS_INFO_TAB_TITLE,onClose:function(){return lD({eventId:null==t?void 0:t.id})},users:null==s?[]:[s],overflowUsers:null==t.user_count||t.user_count<1?null:(0,r.jsxs)("div",{className:PU().pill,children:[(0,r.jsx)(ev.Z,{width:jk,height:jk,className:PU().pillIcon}),(0,r.jsx)(c.xvT,{variant:"text-xs/medium",
color:"header-secondary",className:PU().pillLabel,children:t.user_count})]})}}if(t.entity_type===h_.WX.VOICE&&null!=o){var g=(0,EO.KS)(o);return{noticeType:Ck.EVENT_VOICE,title:t.name,location:o.name,locationIcon:null!=g?(0,r.jsx)(g,{width:Pk,height:Pk,className:PU().locationIcon}):null,canListenIn:i,buttonText:Q.Z.Messages.GUILD_EVENT_JOIN,onClose:function(){return lD({eventId:null==t?void 0:t.id})},users:null==s?[]:[s],overflowUsers:null==t.user_count||t.user_count<1?null:(0,r.jsxs)("div",{className:PU().pill,children:[(0,r.jsx)(ev.Z,{width:jk,height:jk,className:PU().pillIcon}),(0,r.jsx)(c.xvT,{variant:"text-xs/medium",color:"header-secondary",className:PU().pillLabel,children:t.user_count})]})}}}return{noticeType:null}}({guildEvent:l,stageInstance:u,activeChannel:a,canConnect:m,myRole:b,eventCreator:O,speakers:E,listenerCount:y,isEventNoticeHidden:p,isStageNoticeHidden:d,isStudyRoomNotice:i})
}),[l,u,a,m,b,O,E,y,p,d,i]),_=v.noticeType,I=v.title,S=v.location,T=v.locationIcon,N=v.canListenIn,A=v.buttonText,C=v.users,P=v.overflowUsers,j=v.onClose;if(null==_)return null;return(0,r.jsxs)("div",{className:PU().container,children:[null!=j?(0,r.jsx)(c.P3F,{onClick:j,className:PU().close,"aria-label":Q.Z.Messages.DISMISS,children:(0,r.jsx)(Ub.Z,{className:PU().closeIcon})}):null,(0,r.jsxs)("div",{className:PU().header,children:[(0,r.jsx)(vk,{color:$b.Z.unsafe_rawColors.GREEN_230.css,width:Pk,height:Pk}),(0,r.jsx)(c.xvT,{variant:"text-xs/semibold",color:"text-positive",children:Q.Z.Messages.LIVE})]}),(C.length>0||null!=P)&&(0,r.jsxs)("div",{className:PU().participants,children:[C.map((function(e){return(0,r.jsx)(c.yRy,{preload:function(){return(0,mR.Z)(e.id,e.getAvatarURL(t.id,80),{guildId:t.id})},renderPopout:function(t){return(0,r.jsx)(yk.Z,Nk(Tk({},t),{userId:e.id}))},position:"right",children:function(n){return(0,r.jsx)(c.qEK,Nk(Tk({},n),{src:e.getAvatarURL(t.id,24),
"aria-label":e.username,size:c.EFr.SIZE_24,className:PU().avatar}))}},e.id)})),P]}),(0,r.jsx)(c.xvT,{variant:"text-md/medium",color:"header-primary",className:lh()(PU().title,PU().live),children:I}),(0,r.jsxs)("div",{className:PU().locationContainer,children:[T,(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"text-muted",className:PU().location,children:S})]}),N||_===Ck.EVENT_EXTERNAL?(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,color:c.zxk.Colors.GREEN,onClick:function(){if(N){if(null==a||null==a.getGuildId())return;(0,c_.Cq)(a);(0,K.XU)(a.getGuildId(),a.id)}else{if(null==l)return;(0,dr.bO)({eventId:l.id})}},className:PU().button,fullWidth:!0,children:A}):null]})}var xk=n(68537),Mk=n(274740),wk=n.n(Mk);function Dk(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zk(e){return function(e){if(Array.isArray(e))return Dk(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)
}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Dk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dk(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Lk,Uk=16,kk=o.memo((function(e){var t=e.heading,n=e.location,o=e.locationIcon,i=e.details,a=e.detailsIcon,s=e.topic,l=e.onClickCloseIcon,u=e.children;return(0,r.jsxs)("div",{className:wk().channelNotice,children:[(0,r.jsxs)("div",{className:wk().textBlock,children:[(0,r.jsx)("div",{className:wk().liveIndicator}),(0,r.jsx)(c.xvT,{color:"text-positive",variant:"text-xs/bold",className:wk().liveNowText,children:t}),null!=l&&(0,r.jsx)(c.P3F,{onClick:l,className:wk().closeIcon,"aria-label":Q.Z.Messages.CLOSE,
children:(0,r.jsx)(Ub.Z,{height:16,width:16})})]}),(0,r.jsx)(c.xvT,{color:"header-primary",variant:"text-md/semibold",className:wk().eventName,children:s}),(0,r.jsxs)("div",{className:wk().textBlock,children:[o,(0,r.jsx)(c.xvT,{color:"header-secondary",variant:"text-xs/normal",className:wk().channelName,children:n}),null!=i&&null!=a&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xvT,{className:wk().dotDivider,color:"header-secondary",variant:"text-xs/normal",children:"•"}),a,(0,r.jsx)(c.xvT,{color:"header-secondary",variant:"text-xs/normal",children:i})]})]}),u]})}));function Gk(e){var t=e.guildEvent,n=e.channel,o=(0,s.Wu)([im.ZP],(function(){return im.ZP.getVoiceStatesForChannel(n).map((function(e){return e.user}))}),[n]),i=(0,EO.KS)(n);return(0,r.jsx)(kk,{onClickCloseIcon:function(){return lD({eventId:null==t?void 0:t.id})},heading:Q.Z.Messages.STAGE_CHANNEL_LIVE_NOW,topic:t.name,location:n.name,locationIcon:null!=i?(0,r.jsx)(i,{width:Uk,height:Uk,className:wk().stageIcon}):null,
children:(0,r.jsx)(Yk,{channel:n,speakers:o,voiceType:Lk.VOICE})})}function Bk(e){var t=e.guildEvent,n=(0,i_.cS)(t);return null==n?null:(0,r.jsx)(kk,{onClickCloseIcon:function(){return lD({eventId:null==t?void 0:t.id})},heading:Q.Z.Messages.HAPPENING_NOW,topic:t.name,location:(0,dk.m)(n,!0),locationIcon:(0,r.jsx)(p_.Z,{width:Uk,height:Uk,className:wk().stageIcon}),children:(0,r.jsx)(Hk,{guildEvent:t})})}function Hk(e){var t=e.guildEvent,n=o.useCallback((function(){(0,dr.bO)({eventId:t.id})}),[t]);return(0,r.jsx)(c.zxk,{fullWidth:!0,className:wk().joinButton,onClick:n,color:c.zxk.Colors.GREEN,size:c.zxk.Sizes.SMALL,children:Q.Z.Messages.SEE_DETAIL})}function Vk(e){var t=e.channel,n=e.label;return(0,r.jsx)(c.zxk,{fullWidth:!0,className:wk().joinButton,onClick:function(){if(null!=t&&null!=t.getGuildId()){(0,c_.Cq)(t);(0,K.XU)(t.getGuildId(),t.id)}},color:c.zxk.Colors.GREEN,size:c.zxk.Sizes.SMALL,children:n})}function Fk(e){var t=e.stageInstance,n=e.channel,o=(0,s.cj)([l_.Z],(function(){
var e=l_.Z.getMutableParticipants(n.id,u_.pV.SPEAKER),t=l_.Z.getParticipantCount(n.id,u_.pV.AUDIENCE);return{speakers:Zk(new Set(e.map((function(e){return e.user})))),listenerCount:t}}),[n.id]),i=o.speakers,a=o.listenerCount,c=Q.Z.Messages.LISTENING_COUNT.format({count:"".concat(a)});return(0,r.jsx)(kk,{onClickCloseIcon:function(){return lD({stageId:null==t?void 0:t.id})},heading:Q.Z.Messages.STAGE_CHANNEL_LIVE_NOW,location:n.name,details:c,detailsIcon:(0,r.jsx)(mk.Z,{width:14,height:14,className:wk().stageIcon}),locationIcon:(0,r.jsx)(_k.Z,{width:Uk,height:Uk,className:wk().stageIcon}),topic:t.topic,children:(0,r.jsx)(Yk,{channel:n,speakers:i,voiceType:Lk.STAGE})})}!function(e){e[e.VOICE=1]="VOICE";e[e.STAGE=2]="STAGE";e[e.STUDY_ROOM=3]="STUDY_ROOM"}(Lk||(Lk={}));function Yk(e){var t=e.channel,n=e.speakers,i=e.voiceType,a=t.getGuildId(),l=o.useMemo((function(){return n.slice(0,3)}),[n]),u=(0,s.e7)([dn.Z],(function(){return dn.Z.can(M.Plq.CONNECT,t)})),f=Ek(t.id),d=Q.Z.Messages.JOIN
;switch(i){case Lk.VOICE:d=Q.Z.Messages.JOIN;break;case Lk.STAGE:d=Q.Z.Messages.STAGE_CHANNEL_JOIN_BUTTON;(null==f?void 0:f.speaker)?d=Q.Z.Messages.STAGE_CHANNEL_JOINED_SPEAKER_BUTTON:null!=f&&(d=Q.Z.Messages.STAGE_CHANNEL_JOINED_AUDIENCE_BUTTON);break;case Lk.STUDY_ROOM:d=Q.Z.Messages.HUB_STUDY_ROOM_NOTICE_VOICE_CTA;break;default:(0,_o.vE)(i)}return null==a?null:(0,r.jsxs)(r.Fragment,{children:[l.length>0?(0,r.jsxs)("div",{className:wk().textBlock,children:[(0,r.jsx)(Rv.Z,{guildId:a,users:l,showUserPopout:!0,size:Rv.u.SIZE_16}),(0,r.jsx)(c.xvT,{color:"header-secondary",variant:"text-xs/normal",className:wk().userNames,children:(0,xk.ER)(a,l,null==t?void 0:t.id,n.length)})]}):null,u&&null==f&&(0,r.jsx)(Vk,{channel:t,label:d})]})}const zk=o.memo((function(e){var t=e.guild,n=AU(!0).showRedesignedLiveChannelNotice,o=pk(t.id),i=(0,vv.k5)(t.id),a=(0,s.e7)([eD.Z],(function(){return eD.Z.getStageInstanceByChannel(null==o?void 0:o.id)}),[o]),c=(0,s.cj)([fD],(function(){return{
isStageNoticeHidden:fD.isLiveChannelNoticeHidden({stageId:null==a?void 0:a.id}),isEventNoticeHidden:fD.isLiveChannelNoticeHidden({eventId:null==i?void 0:i.id})}}),[a,i]),l=c.isStageNoticeHidden,u=c.isEventNoticeHidden,f=null,d=null!=a&&null!=o&&!l;if(n)return(0,r.jsx)(Rk,{guild:t});null==i||u?d&&(f=(0,r.jsx)(Fk,{stageInstance:a,channel:o})):i.entity_type===h_.WX.STAGE_INSTANCE&&d?f=(0,r.jsx)(Fk,{stageInstance:a,channel:o}):i.entity_type===h_.WX.EXTERNAL?f=(0,r.jsx)(Bk,{guildEvent:i}):i.entity_type===h_.WX.VOICE&&null!=o&&(f=(0,r.jsx)(Gk,{guildEvent:i,channel:o}));return f}));var Wk=n(148167),Kk=n.n(Wk);function qk(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Xk(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){qk(i,r,o,a,s,"next",e)}function s(e){qk(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Qk(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,
configurable:!0,writable:!0}):e[t]=n;return e}var $k=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}
i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Jk(e){var t=e.guild,o=e.markAsDismissed;return(0,r.jsx)(kU,{guild:t,onDismissed:o,onClick:function(){(0,c.ZDy)(Xk((function(){var e,t;return $k(this,(function(o){switch(o.label){case 0:return[4,Promise.resolve().then(n.bind(n,966658))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Qk(e,t,n[t])}))}return e}({},e))}]}}))})))},message:Q.Z.Messages.HUB_LINK_CHANNEL_NOTICE_BODY,cta:Q.Z.Messages.LEARN_MORE,trackingSource:M.PsQ.HUB_LINK_NOTICE,type:M.vID.HUB_LINK,image:Kk()})}var eG=n(976518),tG=n.n(eG);const nG=function(e){
var t=e.channel,n=e.guild;return(0,r.jsx)(kU,{guild:n,onDismissed:function(){(0,ld.Kw)(ld.v6.HUB_STUDY_ROOM_NOTICE)},onClick:function(){(0,ld.Kw)(ld.v6.HUB_STUDY_ROOM_NOTICE);if(null!=t&&null!=t.getGuildId()){(0,c_.Cq)(t);(0,K.XU)(t.getGuildId(),t.id)}},title:Q.Z.Messages.HUB_STUDY_ROOM_NOTICE_TITLE,message:Q.Z.Messages.HUB_STUDY_ROOM_NOTICE_DESCRIPTION,cta:Q.Z.Messages.HUB_STUDY_ROOM_NOTICE_VOICE_CTA,image:tG(),type:M.vID.HUB_STUDY_ROOM})};var rG=n(149698),oG=n.n(rG);const iG=function(e){var t=e.name,n=e.channel,o=(0,s.Wu)([im.ZP],(function(){return im.ZP.getVoiceStatesForChannel(n).map((function(e){return e.user}))}),[n]),i=(0,EO.KS)(n);return(0,r.jsx)(kk,{heading:Q.Z.Messages.STAGE_CHANNEL_LIVE_NOW,topic:t,location:Q.Z.Messages.HUB_STUDY_ROOM_VOICE_CHANNEL_TOOLTIP,locationIcon:null!=i?(0,r.jsx)(i,{width:16,height:16,className:oG().icon}):null,children:(0,r.jsx)(Yk,{channel:n,speakers:o,voiceType:Lk.STUDY_ROOM})})};var aG=n(126976);function sG(e){var t=e.channel,n=e.guild,o=(0,
s.e7)([ld.qc],(function(){return ld.qc.hasHotspot(ld.v6.HUB_STUDY_ROOM_NOTICE)})),i=(0,aG.r)(t.guild_id),a=(0,mm.useSpring)({maxHeight:i?0:300,overflow:"hidden",delay:400});return(0,r.jsx)(mm.animated.div,{style:a,children:o?(0,r.jsx)(nG,{channel:t,guild:n}):(0,r.jsx)(iG,{name:"📚☕ ".concat(t.name),channel:t})})}const cG=function(e){var t=e.guild,n=(0,s.e7)([Hg.ZP],(function(){return Hg.ZP.getChannels(t.id)[Hg.Zb][0]})),o=(0,s.e7)([dn.Z],(function(){return null!=n&&dn.Z.can(M.Plq.CONNECT,n.channel)}));return t.hasFeature(M.oNc.HUB)?null==n?null:o?(0,r.jsx)(sG,{channel:n.channel,guild:t}):null:null};var lG=n(323236),uG=n.n(lG);function fG(e){var t=e.guild,n=function(){return hD.Z.dismissNotice(t.id)};return(0,r.jsx)(kU,{guild:t,onDismissed:n,cta:Q.Z.Messages.INTEGRATIONS_PERMISSIONS_TOOLTIP_CTA,message:Q.Z.Messages.COMMANDS_SCOPE_MIGRATION_ADMIN_NOTICE.format(),type:M.vID.COMMANDS_MIGRATION,image:uG(),onClick:function(){n();pr.Z.open(t.id,M.pNK.INTEGRATIONS)},imageMarginTop:15,
imageMarginX:22})}var dG=n(864244),pG=n.n(dG);const hG=function(e){var t=e.guild,n=o.useCallback((function(){e=t.id,O.Z.dispatch({type:"PUBLIC_UPSELL_NOTICE_DISMISS",guildId:e});var e}),[t.id]);return(0,r.jsx)(kU,{guild:t,onDismissed:n,onClick:function(){return pr.Z.open(t.id,M.pNK.COMMUNITY)},message:Q.Z.Messages.NOTICE_ENABLE_PUBLIC_GUILD_UPSELL_MESSAGE,trackingSource:M.PsQ.ENABLE_PUBLIC_GUILD_UPSELL_NOTICE,type:M.vID.PUBLIC_UPSELL,image:pG(),cta:Q.Z.Messages.LEARN_MORE})};var EG=n(785538),yG=n.n(EG);function mG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bG(e){bG=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return bG(e)}function gG(e,t){return!t||"object"!==vG(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function OG(e,t){OG=Object.setPrototypeOf||function(e,t){e.__proto__=t
;return e};return OG(e,t)}var vG=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function _G(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=bG(e);if(t){var o=bG(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return gG(this,n)}}var IG=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&OG(e,t)}(n,e);var t=_G(n);function n(){mG(this,n);return t.apply(this,arguments)}n.prototype.render=function(){return(0,r.jsx)(kU,{guild:this.props.guild,onClick:function(){return h.Z.open(M.oAB.ACCOUNT)},
message:Q.Z.Messages.TWO_FA_GUILD_MFA_WARNING_MESSAGE_WITH_SPACING.format(),cta:Q.Z.Messages.TWO_FA_GUILD_MFA_WARNING_RESOLVE_BUTTON,trackingSource:M.PsQ.GUILD_MFA_WARNING,type:M.vID.MFA_WARNING,image:yG(),imageMarginX:54,undismissable:!0})};return n}(o.PureComponent);const SG=IG;const TG=function(e){var t=e.guild,n=e.markAsDismissed,i=o.useCallback((function(){pr.Z.open(t.id,M.pNK.ONBOARDING);(0,un.EW)(ln.z$.GUILD_ONBOARDING_UPSELL_CHANNEL_NOTICE,{dismissAction:hn.L.PRIMARY})}),[t.id]);return(0,r.jsx)(xU,{guild:t,onDismissed:n,onClick:i,title:Q.Z.Messages.GUILD_ONBOARDING_CHANNEL_NOTICE_TITLE,message:Q.Z.Messages.GUILD_ONBOARDING_CHANNEL_NOTICE_MESSAGE,cta:Q.Z.Messages.CHECK_IT_OUT,trackingSource:M.PsQ.GUILD_ONBOARDING_UPSELL_NOTICE,type:M.vID.GUILD_ONBOARDING_UPSELL})};var NG=n(947079),AG=n.n(NG);function CG(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function PG(e){return function(){var t=this,n=arguments
;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){CG(i,r,o,a,s,"next",e)}function s(e){CG(i,r,o,a,s,"throw",e)}a(void 0)}))}}function jG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RG(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function xG(e){xG=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return xG(e)}function MG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){RG(e,t,n[t])}))}return e}function wG(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e)
;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function DG(e,t){return!t||"object"!==LG(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ZG(e,t){ZG=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return ZG(e,t)}var LG=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function UG(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=xG(e);if(t){
var o=xG(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return DG(this,n)}}var kG=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2]
;a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},GG=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&ZG(e,t)}(o,e);var t=UG(o);function o(){jG(this,o);var e;(e=t.apply(this,arguments)).handleInvite=function(){var t=e.props.guild;(0,c.ZDy)(PG((function(){var e,o;return kG(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(45446)]).then(n.bind(n,945446))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,wG(MG({},e),{guild:t,source:M.t4x.INVITE_NOTICE}))}]}}))})))};e.handleClose=function(){var t=C.Z.getChannelId();e.props.markAsDismissed();null!=t&&Lg.Z.sendBotMessage(t,Q.Z.Messages.HOW_TO_INVITE_OTHERS.format({
invitePeople:Q.Z.Messages.INVITE_PEOPLE}))};return e}o.prototype.render=function(){var e="".concat(Q.Z.Messages.INVITE_NOTICE_MESSAGE,"\n").concat(Q.Z.Messages.INVITE_NOTICE_MESSAGE_PART_2);return(0,r.jsx)(kU,{guild:this.props.guild,onDismissed:this.handleClose,onClick:this.handleInvite,message:e,cta:Q.Z.Messages.INVITE_PEOPLE,trackingSource:M.PsQ.INVITE_NOTICE,type:M.vID.INVITE,image:AG(),imageMarginX:46})};return o}(o.PureComponent);const BG=GG;var HG=n(389515),VG=n.n(HG);const FG=function(e){var t=e.guild,n=o.useCallback((function(){e=t.id,O.Z.dispatch({type:"MAX_MEMBER_COUNT_NOTICE_DISMISS",guildId:e});var e}),[t.id]);return(0,r.jsx)(kU,{guild:t,onDismissed:n,message:Q.Z.Messages.NOTICE_CHANNEL_MAX_MEMBERS_CAP_REACHED_MESSAGE.format({maxMemberCount:t.maxMembers,maxMembersUrl:X.Z.getArticleURL(M.BhN.MAX_MEMBERS)}),type:M.vID.MAX_MEMBER_COUNT,image:VG(),imageMarginX:61})};var YG=n(327203),zG=n(956485),WG=n(10439),KG=n.n(WG);const qG=function(e){
var t=YG.$.binds[0].split("+").map((function(e){return null!=c.cXz[e]?c.cXz[e]():e})).join(" + ").toUpperCase();return(0,r.jsx)(kU,{guild:e.guild,onDismissed:e.markAsDismissed,onClick:function(){return(0,zG.$Z)("CHANNEL_NOTICE")},message:Q.Z.Messages.QUICKSWITCHER_NOTICE,cta:t,trackingSource:M.PsQ.QUICK_SWITCHER_NOTICE,type:M.vID.QUICKSWITCHER,image:KG(),imageMarginX:50})};var XG=n(482507),QG=n(337285),$G=n.n(QG);function JG(e){var t=e.guild,n=e.markAsDismissed;return(0,r.jsx)(kU,{guild:t,onDismissed:n,onClick:function(){return(0,XG.J)((0,Ts.wR)(t.id,Ig.oC.ROLE_SUBSCRIPTIONS))},message:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTIONS_MWEB_PURCHASE_DESKTOP_UPSELL_BODY,cta:Q.Z.Messages.COPY_LINK,trackingSource:M.PsQ.ROLE_SUBSCRIPTION_MWEB_PURCHASE_NOTICE,type:M.vID.ROLE_SUBSCRIPTION_MWEB_PURCHASE,image:$G()})}function eB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tB(e){tB=Object.setPrototypeOf?Object.getPrototypeOf:function(e){
return e.__proto__||Object.getPrototypeOf(e)};return tB(e)}function nB(e,t){return!t||"object"!==oB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function rB(e,t){rB=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return rB(e,t)}var oB=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function iB(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=tB(e);if(t){var o=tB(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return nB(this,n)}}var aB=function(e){!function(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&rB(e,t)}(n,e);var t=iB(n);function n(){eB(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.syncWith([Zt.Z,dn.Z],M.dG4)};r.channelNoticePredicate=function(e,t){return Date.now()-t>=M.Hqc&&e.hasFeature(M.oNc.CREATOR_MONETIZABLE)&&e.hasFeature(M.oNc.ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE)&&(0,Dt.H2)(e)&&(0,SM.LA)(e.id)};r.__getLocalVars=function(){return{}};return n}(s.ZP.Store);aB.displayName="RoleSubscriptionMWebPurchaseNoticeStore";const sB=new aB(O.Z);var cB=n(980604);function lB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uB(e){uB=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return uB(e)}function fB(e,t){
return!t||"object"!==pB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function dB(e,t){dB=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return dB(e,t)}var pB=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function hB(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=uB(e);if(t){var o=uB(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return fB(this,n)}}var EB=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{
value:e,writable:!0,configurable:!0}});t&&dB(e,t)}(n,e);var t=hB(n);function n(){lB(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(Zt.Z);this.syncWith([Zt.Z],M.dG4)};r.channelNoticePredicate=function(e,t){return!e.hasFeature(M.oNc.BANNER)&&Date.now()-t>=M.Hqc};r.__getLocalVars=function(){return{}};return n}(s.ZP.Store);EB.displayName="GuildBoostingNoticeStore";const yB=new EB(O.Z);function mB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bB(e){bB=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return bB(e)}function gB(e,t){return!t||"object"!==vB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function OB(e,t){OB=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return OB(e,t)}var vB=function(e){
return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function _B(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=bB(e);if(t){var o=bB(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return gB(this,n)}}var IB=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&OB(e,t)}(n,e);var t=_B(n);function n(){mB(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(dn.Z);this.syncWith([dn.Z],M.dG4)};r.channelNoticePredicate=function(e,t){
return Date.now()-t>=M.Hqc&&dn.Z.can(M.Plq.MANAGE_GUILD,e)};r.__getLocalVars=function(){return{}};return n}(s.ZP.Store);IB.displayName="GuildBoostingNoticeStore";const SB=new IB(O.Z);function TB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NB(e){NB=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return NB(e)}function AB(e,t){return!t||"object"!==PB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function CB(e,t){CB=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return CB(e,t)}var PB=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function jB(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{
Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=NB(e);if(t){var o=NB(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return AB(this,n)}}function RB(){return!0}var xB=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&CB(e,t)}(n,e);var t=jB(n);function n(){TB(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(dn.Z);this.syncWith([dn.Z],RB)};r.channelNoticePredicate=function(e){var t=(0,SR.wC)(e.id),n=e.hasFeature(M.oNc.GUILD_ONBOARDING_EVER_ENABLED);return t&&!n};r.__getLocalVars=function(){return{}};return n}(s.ZP.Store);xB.displayName="GuildOnboardingUpsellNoticeStore";const MB=new xB(O.Z);function wB(e,t){
if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DB(e){DB=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return DB(e)}function ZB(e,t){return!t||"object"!==UB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function LB(e,t){LB=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return LB(e,t)}var UB=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function kB(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=DB(e);if(t){var o=DB(this).constructor;n=Reflect.construct(r,arguments,o)
}else n=r.apply(this,arguments);return ZB(this,n)}}var GB=!1;function BB(e){var t=Zt.Z.getGuild(e);if(null==t)return!1;if(!t.hasFeature(M.oNc.HUB))return!1;GB=!0;return!0}function HB(){return!0}var VB=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&LB(e,t)}(n,e);var t=kB(n);function n(){wB(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(Zt.Z,ud.Z);this.syncWith([ud.Z],HB)};r.channelNoticePredicate=function(e){return!!e.hasFeature(M.oNc.LINKED_TO_HUB)&&!GB};r.__getLocalVars=function(){return{isAlreadyInHub:GB}};return n}(s.ZP.Store);VB.displayName="HubLinkNoticeStore";const FB=new VB(O.Z,{CONNECTION_OPEN:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=e.guilds[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){if(BB(o.value.id))return!0}}catch(e){n=!0;r=e
}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return!1},GUILD_CREATE:function(e){return BB(e.guild.id)}});function YB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zB(e){zB=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return zB(e)}function WB(e,t){return!t||"object"!==qB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function KB(e,t){KB=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return KB(e,t)}var qB=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function XB(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0
}catch(e){return!1}}();return function(){var n,r=zB(e);if(t){var o=zB(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return WB(this,n)}}function QB(){return!0}var $B=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&KB(e,t)}(n,e);var t=XB(n);function n(){YB(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(dn.Z);this.syncWith([dn.Z],QB)};r.channelNoticePredicate=function(e,t){return Date.now()-t>=M.Hqc&&dn.Z.can(M.Plq.ADMINISTRATOR,e)};r.__getLocalVars=function(){return{}};return n}(s.ZP.Store);$B.displayName="InviteNoticeStore";const JB=new $B(O.Z);var eH="lastHiddenChannelNotice",tH=[{type:M.vID.GUILD_BOOSTING,store:SB,dismissibleContentType:ln.z$.CHANNEL_NOTICE_PREMIUM_GUILD_SUBSCRIPTION},{type:M.vID.GUILD_BANNER,store:yB,
dismissibleContentType:ln.z$.CHANNEL_NOTICE_GUILD_BANNER},{type:M.vID.INVITE,store:JB,dismissibleContentType:ln.z$.CHANNEL_NOTICE_INVITE},{type:M.vID.HUB_LINK,store:FB,dismissibleContentType:ln.z$.CHANNEL_NOTICE_HUBLINK},{type:M.vID.QUICKSWITCHER,store:cB.Z,dismissibleContentType:ln.z$.CHANNEL_NOTICE_QUICKSWITCHER},{type:M.vID.ROLE_SUBSCRIPTION_MWEB_PURCHASE,store:sB,dismissibleContentType:ln.z$.GUILD_ROLE_SUBSCRIPTION_MWEB_PURCHASE_UPSELL},{type:M.vID.GUILD_ONBOARDING_UPSELL,store:MB,dismissibleContentType:ln.z$.GUILD_ONBOARDING_UPSELL_CHANNEL_NOTICE},{type:M.vID.CLIPS_EDUCATION,dismissibleContentType:ln.z$.CLIPS_CHANNEL_NOTICE_EDUCATION},{type:M.vID.LINKED_ROLES_ADMIN,dismissibleContentType:ln.z$.LINKED_ROLE_ADMIN_GUILD}],nH=tH.map((function(e){return e.store})).filter(_o.lm);function rH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function oH(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){
var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return rH(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rH(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function iH(e){e.stopPropagation()}function aH(e){var t,n,i,a=e.guild,c=oH(o.useState(null!==(t=_e.Z.get(eH))&&void 0!==t?t:0),2),l=c[0],u=c[1],f=(0,s.Wu)(nH,(function(){return tH.filter((function(e){
var t=e.store;return null==t?void 0:t.channelNoticePredicate(a,l)})).map((function(e){return e.dismissibleContentType}))}));(n=VU.N.useExperiment({}).enableUpsells,i=Lt.nI(),n&&i)&&f.push(ln.z$.CLIPS_CHANNEL_NOTICE_EDUCATION);return(0,r.jsx)(WN.Z,{contentTypes:f,groupName:hn.R.CHANNEL_NOTICES,children:function(e){var t=e.visibleContent,n=e.markAsDismissed,o=function(){!function(e){_e.Z.set(eH,e);u(e)}(Date.now());n()},i=function(){switch(t){case ln.z$.CHANNEL_NOTICE_HUBLINK:return(0,r.jsx)(Jk,{guild:a,markAsDismissed:o});case ln.z$.CHANNEL_NOTICE_INVITE:return(0,r.jsx)(BG,{guild:a,markAsDismissed:o});case ln.z$.CHANNEL_NOTICE_PREMIUM_GUILD_SUBSCRIPTION:return(0,r.jsx)(fk,{guild:a,markAsDismissed:o});case ln.z$.CHANNEL_NOTICE_QUICKSWITCHER:return(0,r.jsx)(qG,{guild:a,markAsDismissed:o});case ln.z$.CHANNEL_NOTICE_GUILD_BANNER:return(0,r.jsx)(tk,{guild:a,markAsDismissed:o});case ln.z$.GUILD_ROLE_SUBSCRIPTION_MWEB_PURCHASE_UPSELL:return(0,r.jsx)(JG,{guild:a,markAsDismissed:o})
;case ln.z$.GUILD_ONBOARDING_UPSELL_CHANNEL_NOTICE:return(0,r.jsx)(TG,{guild:a,markAsDismissed:o});case ln.z$.CLIPS_CHANNEL_NOTICE_EDUCATION:return(0,r.jsx)(zU,{guild:a,markAsDismissed:n});case ln.z$.LINKED_ROLE_ADMIN_GUILD:return(0,r.jsx)(qU,{guild:a,markAsDismissed:n});default:return null}}();return null==i?null:(0,r.jsx)("div",{onContextMenu:iH,children:i})}})}const sH=function(e){var t=e.guild;switch(sZ(t)){case aZ.ENABLE_PUBLIC_GUILD:return(0,r.jsx)(hG,{guild:t});case aZ.APPLIED_GUILD_BOOST_GRACE_PERIOD:return(0,r.jsx)($U,{guild:t});case aZ.MAX_MEMBER_COUNT:return(0,r.jsx)(FG,{guild:t});case aZ.GUILD_LIVE_CHANNEL:return(0,r.jsx)(zk,{guild:t});case aZ.GUILD_MFA_WARNING:return(0,r.jsx)(SG,{guild:t});case aZ.COMMANDS_MIGRATION:return(0,r.jsx)(fG,{guild:t});case aZ.APPLICATION_SUBSCRIPTION_EXPIRATION:return(0,r.jsx)(HU,{guild:t});case aZ.HUB_STUDY_ROOM:return(0,r.jsx)(cG,{guild:t})}return Bi.s.isDisallowPopupsSet()?null:(0,r.jsx)(aH,{guild:e.guild})};var cH=n(29802),lH=n.n(cH)
;function uH(e){var t=e.guild,n=e.setHasSubheader,i=o.useRef(null);o.useLayoutEffect((function(){var e=i.current;null!=e&&n(e.childNodes.length>0)}));return(0,r.jsx)("div",{className:lH().container,ref:i,children:(0,r.jsx)(sH,{guild:t})})}var fH=n(918288),dH=n.n(fH);function pH(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var hH=function(){return(0,r.jsx)("div",{className:dH().spacer})},EH=function(){return(0,r.jsx)("div",{className:dH().category})},yH=function(e){var t=e.width;return(0,r.jsxs)("div",{className:dH().channel,children:[(0,r.jsx)("div",{className:dH().channelIcon}),(0,r.jsx)("div",{className:dH().channelName,style:{width:"".concat(t,"px")}})]})};const mH=function(e){var t=e.withBannerPadding;return(0,r.jsxs)("div",{className:lh()(dH().container,pH({},dH().bannerPadding,t)),children:[(0,r.jsx)(EH,{}),(0,r.jsx)(yH,{width:100}),(0,r.jsx)(yH,{width:74}),(0,r.jsx)(yH,{width:100}),(0,r.jsx)(yH,{width:70}),(0,
r.jsx)(yH,{width:112}),(0,r.jsx)(yH,{width:175}),(0,r.jsx)(hH,{}),(0,r.jsx)(EH,{}),(0,r.jsx)(yH,{width:100}),(0,r.jsx)(yH,{width:74}),(0,r.jsx)(yH,{width:100}),(0,r.jsx)(yH,{width:70}),(0,r.jsx)(yH,{width:112}),(0,r.jsx)(yH,{width:56})]})};function bH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gH(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OH(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function vH(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){OH(i,r,o,a,s,"next",e)}function s(e){OH(i,r,o,a,s,"throw",e)}a(void 0)}))}}function _H(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IH(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n
;return e}function SH(e){SH=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return SH(e)}function TH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){IH(e,t,n[t])}))}return e}function NH(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function AH(e,t){if(null==e)return{};var n,r,o=function(e,t){
if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function CH(e,t){return!t||"object"!==RH(t)&&"function"!=typeof t?gH(e):t}function PH(e,t){PH=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return PH(e,t)}function jH(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bH(e,t);var n=Object.prototype.toString.call(e).slice(8,-1)
;"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bH(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var RH=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function xH(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=SH(e);if(t){var o=SH(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return CH(this,n)}}var MH=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]
};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},wH=88,DH=1e3,ZH="server-settings",LH={
origin:{x:-8,y:-48},targetWidth:40,targetHeight:40,offset:{x:0,y:0}},UH=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&PH(e,t)}(o,e);var t=xH(o);function o(){_H(this,o);var e;(e=t.apply(this,arguments)).historyUnlisten=function(){};e.showTimeout=new Uu.V7;e.state={controller:new mm.Controller({value:1,immediate:!0}),renderBanner:!1,bannerVisible:!1,communityInfoVisible:!1,shouldShowSubscribeTooltip:!1,bannerVisibleHeight:wH,hasGuildSubheader:!1};e.handleHistoryChange=function(t){null!=t.state&&t.state.shouldShowSubscribeTooltip&&e.showTimeout.start(DH,(function(){return e.setState({shouldShowSubscribeTooltip:!0})}))};e.handleHeaderMenuToggle=function(t){var n=e.props.isHeaderPopoutOpen;t.stopPropagation();(0,fZ.l)(!n);(0,YZ.$u)(ln.z$.PREMIUM_TUTORIAL_SERVER_MENU_TOOLTIP);e.closeAllHeaderNotices()}
;e.handleContextMenu=function(t){var o=e.props.guild;null!=o&&(0,Ob.jW)(t,vH((function(){var e,t;return MH(this,(function(i){switch(i.label){case 0:return[4,n.e(41818).then(n.bind(n,941818))];case 1:e=i.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,NH(TH({},e),{guild:o}))}]}}))})))};e.handleHeaderContextMenu=function(t){var o=e.props.guild;null!=o&&(0,Ob.jW)(t,vH((function(){var e,t;return MH(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(19669),n.e(66240)]).then(n.bind(n,166240))];case 1:e=i.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,NH(TH({},e),{guild:o}))}]}}))})))};e.closeAllHeaderNotices=function(){e.handleCloseSubscribeTooltip();e.handleCloseTemplateDirtyTooltip();e.handleCloseStudentHubPrivacySettingsTooltip()};e.handleCloseStudentHubPrivacySettingsTooltip=function(){var t,n=(0,un.un)(ln.z$.STUDENT_HUB_PRIVACY_SETTINGS_TOOLTIP),r=null===(t=e.props.guild)||void 0===t?void 0:t.hasFeature(M.oNc.HUB);!n&&r&&(0,
un.EW)(ln.z$.STUDENT_HUB_PRIVACY_SETTINGS_TOOLTIP,{dismissAction:hn.L.AUTO})};e.handleCloseSubscribeTooltip=function(){e.showTimeout.stop();e.state.shouldShowSubscribeTooltip&&e.setState({shouldShowSubscribeTooltip:!1})};e.handleCloseTemplateDirtyTooltip=function(){var t=e.props,n=t.guild,r=t.showGuildTemplateDirtyTooltip;null!=n&&r&&TZ.Z.hideGuildTemplateDirtyTooltip(n.id)};var i=gH(e);e.renderMenuPopout=vH((function(){var e,t;return MH(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(19669),n.e(33777)]).then(n.bind(n,433777))];case 1:e=o.sent(),t=e.default;return[2,function(e){var n=e.closePopout,o=i.props.guild;return null!=o&&(0,r.jsx)(t,{onClose:n,guild:o})}]}}))}));e.renderGuildHeaderUpsellPopout=function(t){
var n=e.props,o=n.showGuildBoostingProgressBarUpsell,i=n.showGuildBoostingProgressBarSizeUpsell,a=n.showRoleSubscriptionUpsell,s=n.showDiscoveryTooltip,c=n.showInviteSplashUpsell,l=n.showIntegrationPermissionTooltip,u=n.showDiscoveryLandingPageSettingsUpsell,f=n.showHubPrivacySettingsTooltip,d=n.showActiveThreadsNotice,p=n.showAntiRaidUpsellNotice,h=n.showMentionRaidLimitUpsell,E=n.showAutomodCustomBlockMessageUpsell,y=n.shouldRenderAppDirectoryCoachMark,m=n.showVerifiedRolesCoachmark,b=n.showCreatorPromoPageTooltip,g=n.showClydeAITooltip,O=n.showGuildSoundboardPermissionUpsell,v=n.showOnboardingUpsellCoachmark,_=n.guild,I=n.theme,S=n.hidesAppDirectoryCoachMark,T=n.canManageRoles,N=n.useReducedMotion;if(null==_)return e.renderGuildHeaderDropdownButton(t);var A=[];f&&A.push(ln.z$.STUDENT_HUB_PRIVACY_SETTINGS_TOOLTIP);d&&A.push(ln.z$.GUILD_HEADER_ACTIVE_THREADS_NOTICE);v&&A.push(ln.z$.GUILD_ONBOARDING_UPSELL_HEADER);o&&A.push(ln.z$.GUILD_HEADER_PREMIUM_GUILD_PROGRESS)
;i&&A.push(ln.z$.GUILD_HEADER_PROGRESS_BAR_SIZE_COACH_MARK);a&&A.push(ln.z$.GUILD_HEADER_ROLE_SUBSCRIPTION_UPSELL);O&&A.push(ln.z$.GUILD_HEADER_SOUNDBOARD_PERMISSION);c&&A.push(ln.z$.GUILD_HEADER_INVITE_SPLASH);s&&A.push(ln.z$.GUILD_HEADER_SERVER_DISCOVERY_TOOLTIP);u&&A.push(ln.z$.GUILD_DISCOVERY_LANDING_PAGE_SETTINGS_UPSELL);l&&A.push(ln.z$.GUILD_HEADER_APPLICATION_COMMAND_PERMISSIONS);y&&A.push(ln.z$.APP_DIRECTORY_COACH_MARK);m&&A.push(ln.z$.VERIFIED_ROLES_COACH_MARK);b&&A.push(ln.z$.CREATOR_PROMO_PAGE_COACH_MARK);p&&A.push(ln.z$.ANTI_RAID_SAFETY_ALERT_NOTICE);h&&A.push(ln.z$.GUILD_MENTION_RAID_LIMIT);E&&A.push(ln.z$.GUILD_AUTOMOD_CUSTOM_BLOCK_MESSAGE);g&&A.push(ln.z$.CLYDE_GUILD_HEADER_NUX);return 0===A.length?e.renderGuildHeaderDropdownButton(t):(0,r.jsx)(SU,{contentTypes:A,theme:I,guild:_,renderGuildHeaderDropdownButton:function(){return e.renderGuildHeaderDropdownButton(t)},hidesAppDirectoryCoachMark:S,canManageRoles:T,useReducedMotion:N})}
;e.renderGuildHeaderDropdownButton=function(t){var n=e.props,o=n.guild,i=n.shouldShowBoostingHighlight,a=n.isTutorialHighlightDismissed,s=n.isBoostingFlowDismissed,c=HZ.Z.getCurrentConfig({}).enabled,l=i&&!a&&!s,u=c&&!t||null==o;return(0,r.jsx)(FZ.$,{substeps:[jf.H6.BOOSTING_GUILD_MENU_ITEM],disableFlow:u,tooltipPosition:"right",tooltipSpacing:16,onNext:function(){null!=o&&(0,hZ.f)({guildId:o.id,location:{section:M.jXE.GUILD_HEADER_POPOUT}})},disableHighlight:!0,children:function(e){return(0,r.jsx)("div",{className:lh()(IH({},rU().dropdownWrapperHighlighted,l)),children:(0,r.jsx)(Zw.Z,{open:t,className:rU().dropdownButton,withHighlight:l})})}})};e.pinBannerOrGuildInfo=function(t){var n=t.scrollTop;e.setAnimatedValue(n)};return e}var i=o.prototype;i.componentDidMount=function(){var e,t=this;this.setAnimatedValue(0);O.Z.subscribe("LAYER_PUSH",this.closeAllHeaderNotices);this.historyUnlisten=Fa.Z.addRouteChangeListener(this.handleHistoryChange)
;(null===(e=Fa.Z.getHistory().location.state)||void 0===e?void 0:e.shouldShowSubscribeTooltip)&&this.showTimeout.start(DH,(function(){return t.setState({shouldShowSubscribeTooltip:!0})}))};i.componentWillUnmount=function(){this.showTimeout.stop();this.state.controller.dispose();this.historyUnlisten();O.Z.unsubscribe("LAYER_PUSH",this.closeAllHeaderNotices)};i.getGuildBannerHash=function(){var e=this.props,t=e.guild,n=e.hasChannelNotice;return null==t||n?null:t.banner};i.renderGuildHeaderNotices=function(e){var t=this,n=this.props,o=n.showGuildTemplateDirtyTooltip,i=n.showGuildHeaderTutorial,a=n.anyLayerOpen,s=this.state.shouldShowSubscribeTooltip;return i?(0,r.jsx)("div",{onClick:function(t){return e?null:t.stopPropagation()},children:(0,r.jsx)(WZ.Z,{tutorialId:ZH,position:"bottom",inlineSpecs:LH,children:this.renderGuildHeaderDropdownButton(e)})}):o?(0,r.jsx)(c.ua7,{forceOpen:!0,color:c.FGA.BRAND,position:"bottom",shouldShow:!e&&!a,text:Q.Z.Messages.GUILD_TEMPLATES_UNSYNCED_TOOLTIP,
"aria-label":Q.Z.Messages.GUILD_TEMPLATES_UNSYNCED_TOOLTIP,children:function(){return t.renderGuildHeaderDropdownButton(e)}}):a||e?this.renderGuildHeaderDropdownButton(e):s?(0,r.jsx)(c.yRy,{renderPopout:function(){return(0,r.jsx)("div",{onClick:function(e){return e.stopPropagation()},children:(0,r.jsx)(qZ.ZP,{header:Q.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_HEADER_SUBSCRIBE_TOOLTIP_HEADER,content:Q.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_HEADER_SUBSCRIBE_TOOLTIP_TEXT,buttonCTA:Q.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_HEADER_SUBSCRIBE_TOOLTIP_CLOSE,onClick:t.handleCloseSubscribeTooltip})})},position:"bottom",align:"center",animation:c.yRy.Animation.TRANSLATE,shouldShow:!0,children:function(){return t.renderGuildHeaderDropdownButton(e)}}):this.renderGuildHeaderUpsellPopout(e)};i.renderGuildHeader=function(e){
var t=this,n=this.props,o=n.guild,i=n.isHeaderPopoutOpen,a=n.showGuildHeaderTutorial,s=n.showGuildTemplateDirtyTooltip,l=n.isGuildHeaderDismissibleTooltipShown,u=n.HeaderAnalyticsLocationProvider,f=this.state,d=f.controller,p=f.renderBanner,h=f.bannerVisible,E=f.bannerVisibleHeight,y=f.communityInfoVisible,m=a||s||l;return null==o?null:(0,r.jsx)(u,{children:(0,r.jsx)(c.KeG,{renderPopout:this.renderMenuPopout,position:"bottom",align:"center",animation:c.yRy.Animation.SCALE,shouldShow:i,onRequestClose:function(){(0,YZ.RI)(jf.QD.BOOSTING);(0,fZ.l)(!1)},children:function(n){n.onClick;var a=AH(n,["onClick"]);return(0,r.jsx)(gL.ZP,NH(TH({guild:o,controller:d,renderBanner:p,hasSubheader:e,bannerVisible:h,communityInfoVisible:y,guildBanner:t.getGuildBannerHash(),onClick:t.handleHeaderMenuToggle,onContextMenu:t.handleHeaderContextMenu,disableBannerAnimation:m,animationOverlayHeight:E},a),{children:t.renderGuildHeaderNotices(i)}))}})})};i.setAnimatedValue=function(e){
var t=this.props.guild,n=null!=this.getGuildBannerHash(),r=null==t?void 0:t.hasCommunityInfoSubheader();null!=t&&(n||r)&&(n?this.setAnimatedValueForBanner(e):this.setAnimatedValueForGuildInfo(e))};i.setAnimatedValueForBanner=function(e){var t=this.state,n=t.renderBanner,r=t.communityInfoVisible,o=t.bannerVisible,i=t.bannerVisibleHeight,a=t.controller;(e>=64&&o||e<64&&!o)&&(o=!o);(e>=wH&&!n||e<wH&&n)&&(n=!n);i=Math.max(wH-e,0);r=o;n===this.state.renderBanner&&o===this.state.bannerVisible&&i===this.state.bannerVisibleHeight&&r===this.state.communityInfoVisible||this.setState({renderBanner:n,bannerVisible:o,bannerVisibleHeight:i,communityInfoVisible:r});a.update({value:Math.min(1,Math.max(0,1-e/wH)),immediate:!0}).start()};i.setAnimatedValueForGuildInfo=function(e){var t=this.state,n=t.communityInfoVisible,r=t.controller;(e>=20&&n||e<20&&!n)&&(n=!n);n!==this.state.communityInfoVisible&&this.setState({communityInfoVisible:n});r.update({value:Math.min(1,Math.max(0,1-e/20)),immediate:!0
}).start()};i.renderChannelList=function(){var e=this.props,t=e.isUnavailable,n=e.guild,o=e.selectedChannel,i=e.enableStudyGroup,a=AH(e,["isUnavailable","guild","selectedChannel","enableStudyGroup"]);if(t||null==n)return(0,r.jsx)(mH,{withBannerPadding:null!=n&&null!=this.getGuildBannerHash()});if(n.hasFeature(M.oNc.HUB)&&!i)return(0,r.jsx)("div",{className:rU().hubContainer,children:(0,r.jsx)(BZ.Z,{guild:n,channel:null!=o?o:Hg.ZP.getDefaultChannel(n.id)})});var s=n.id===mZ._?lL.j:lL.E;return(0,r.jsx)(s,NH(TH({guild:n},a),{guildBanner:this.getGuildBannerHash(),hasGuildSubheader:this.state.hasGuildSubheader,onScroll:null==n||null==this.getGuildBannerHash()&&!n.hasCommunityInfoSubheader()?null:this.pinBannerOrGuildInfo}))};i.renderFooter=function(){var e=this.props,t=e.guild,n=e.selectedChannelId,o=e.shouldRenderNitroActivitiesCoachMark,i=e.shouldRenderBashOutCoachMark,a=e.shouldRenderBurstCoachmark,s=e.shouldRenderGarticPhoneCoachMark,c=[]
;o&&c.push(ln.z$.ACTIVITIES_NITRO_TUTORIAL_COACH_MARK_V2);i&&c.push(ln.z$.BASH_OUT_COACH_MARK);s&&c.push(ln.z$.ACTIVITY_COACH_MARK_GARTIC_PHONE);a&&c.push(ln.z$.BURST_REACTION_COACHMARK);return(0,r.jsx)(WN.Z,{contentTypes:c,children:function(e){var o=e.visibleContent,i=e.markAsDismissed;switch(o){case ln.z$.ACTIVITIES_NITRO_TUTORIAL_COACH_MARK_V2:return(0,r.jsx)(bL,{channelId:null!=n?n:void 0,markAsDismissed:function(){(0,un.EW)(ln.z$.ACTIVITIES_NITRO_TUTORIAL_COACH_MARK_V2,{forceTrack:!0,dismissAction:hn.L.DISMISS});c.includes(ln.z$.BASH_OUT_COACH_MARK)&&(0,un.EW)(ln.z$.BASH_OUT_COACH_MARK,{forceTrack:!0,dismissAction:hn.L.AUTO});s&&(0,un.EW)(ln.z$.ACTIVITY_COACH_MARK_GARTIC_PHONE,{forceTrack:!0,dismissAction:hn.L.AUTO})},tutorialType:sL.NITRO});case ln.z$.BASH_OUT_COACH_MARK:return(0,r.jsx)(bL,{channelId:null!=n?n:void 0,markAsDismissed:i,tutorialType:sL.BASH_OUT});case ln.z$.ACTIVITY_COACH_MARK_GARTIC_PHONE:return(0,r.jsx)(bL,{channelId:null!=n?n:void 0,markAsDismissed:i,
tutorialType:sL.GARTIC_PHONE});case ln.z$.BURST_REACTION_COACHMARK:var a;return(0,r.jsx)(cL,{markAsDismissed:i,guildId:null!==(a=null==t?void 0:t.id)&&void 0!==a?a:""});default:return(0,r.jsx)(r.Fragment,{})}}})};i.render=function(){var e=this,t=this.props,n=t.guild,o=t.FooterAnalyticsLocationProvider;return(0,r.jsxs)("nav",{className:rU().container,onContextMenu:this.handleContextMenu,"aria-label":Q.Z.Messages.GUILD_SIDEBAR_A11Y_LABEL.format({guildName:null!=n?n.toString():""}),children:[null!=n&&this.renderGuildHeader(this.state.hasGuildSubheader),null!=n&&(0,r.jsx)(uH,{guild:n,setHasSubheader:function(t){return e.setState({hasGuildSubheader:t})}}),this.renderChannelList(),(0,r.jsx)(o,{children:this.renderFooter()})]})};o.getDerivedStateFromProps=function(e){var t=e.guild,n=e.hasChannelNotice;return null==t||null==t.banner||n?{renderBanner:!1,bannerVisible:!1}:null};return o}(o.PureComponent);function kH(e){var t=e.guildId,n=e.hideSelectedChannel,i=e.selectedChannelId,a=(0,
s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(t)})),l=(0,uZ.Z)(t),u=(0,s.e7)([XZ.Z],(function(){return XZ.Z.getGuildDimensions(t).scrollTo})),f=(0,s.e7)([A.Z],(function(){return A.Z.getChannelId()})),d=jH((0,s.Wu)([dn.Z],(function(){return[dn.Z.can(M.Plq.MANAGE_GUILD,a),dn.Z.can(M.Plq.MANAGE_ROLES,a),dn.Z.can(M.Plq.MANAGE_THREADS,a)]})),3),p=d[0],h=d[1],y=d[2],m=(0,s.e7)([vo.Z],(function(){return vo.Z.isUnavailable(t)})),b=(0,s.e7)([Y.default],(function(){return Y.default.getCurrentUser()})),g=(0,s.e7)([st.Z],(function(){return st.Z.darkSidebar?M.BRd.DARK:st.Z.theme})),O=pD(a).enableStudyGroup,v=kw.s8.useExperiment({},{autoTrackExposure:!0}).enableNitroActivities,_=(0,Xt.ZP)((function(e){return e.currentlyShown.has(ln.z$.NAGBAR_NOTICE_CONNECT_PLAYSTATION)})),I=jH(o.useState(!_),2),N=I[0],C=I[1],P=(0,nh.Z)(t),j=(0,Hw.Z)(Pf.Z.GUILD_HEADER).AnalyticsLocationProvider,R=(0,Hw.Z)(Pf.Z.GUILD_CHANNEL_LIST_FOOTER).AnalyticsLocationProvider;o.useEffect((function(){t!==P&&C(!_)}),[t,P,_])
;var x=jH((0,Xt.ZP)((function(e){return[tH.some((function(t){return e.currentlyShown.has(t.dismissibleContentType)})),e.currentlyShownGroup.has(hn.R.GUILD_HEADER_TOOLTIPS)]})),2),w=x[0],D=x[1],Z=null!=sZ(a)||w,L=(0,c.s9z)(c.JQI),U=(0,s.e7)([T.Z],(function(){return T.Z.hasLayers()})),k=(0,s.e7)([KZ.Z],(function(){return KZ.Z.shouldShow(ZH)})),G=p&&!1===(null==a?void 0:a.premiumProgressBarEnabled)&&!Bi.s.isDisallowPopupsSet(),B=(0,s.e7)([fn.Z],(function(){return fn.Z.getMemberCount(t)})),H=p&&null!=B&&B>=30&&!1===(null==a?void 0:a.premiumProgressBarEnabled)&&!Bi.s.isDisallowPopupsSet(),V=h&&null!=a&&(a.hasFeature(M.oNc.COMMUNITY)||null!=B&&B>=200),F=function(e){var t,n=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(e)})),r=(0,s.e7)([Y.default],(function(){return Y.default.getCurrentUser()})),o=(null==n?void 0:n.ownerId)===(null==r?void 0:r.id),i=(0,SZ.Sd)()
;return o&&null!==(t=null==n?void 0:n.hasFeature(M.oNc.COMMUNITY))&&void 0!==t&&t&&i&&!((null==n?void 0:n.hasFeature(M.oNc.CREATOR_MONETIZABLE))||(null==n?void 0:n.hasFeature(M.oNc.CREATOR_MONETIZABLE_PROVISIONAL))||(null==n?void 0:n.hasFeature(M.oNc.CREATOR_MONETIZABLE_DISABLED)))}(t),z=(0,lZ._)(t),W=p&&h,K=!0===(null==a?void 0:a.hasFeature(M.oNc.HUB)),q=p&&!0===(null==a?void 0:a.hasFeature(M.oNc.DISCOVERABLE)),X=(0,Qw.Q)(),Q=(p||(null==a?void 0:a.premiumTier)===M.Eu4.NONE)&&!Bi.s.isDisallowPopupsSet()&&!X,$=(0,s.e7)([GZ,T.Z],(function(){return null!=a&&null!=b&&p&&!T.Z.hasLayers()&&GZ.shouldShowGuildTemplateDirtyTooltip(t)})),J=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(i)})),ee=(0,s.e7)([E.Z],(function(){return E.Z.useReducedMotion})),te=(0,fZ.y)().isPopoutOpen,ne=(0,Rj.i8)(t),re=(0,s.e7)([zZ.Z],(function(){return!Wa().isEmpty(zZ.Z.getThreadsForGuild(t))})),oe=y&&null!=B&&B>=200&&re,ie=(0,
IZ.z4)(),ae=v&&N,se=!0===(null==a?void 0:a.hasFeature(M.oNc.ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE)),ce=(0,SM.vS)(a)&&p&&se,le=(0,VZ.AR)(),ue=(0,un.wE)(jf.QD.BOOSTING),fe=Xw({canManageGuild:p,guildId:t}),de=fe.shouldRenderAppDirectoryCoachMark,pe=fe.hidesAppDirectoryCoachMark,he=Bw.useExperiment({},{autoTrackExposure:!0}).enabled,Ee=Na.ZP.canUsePremiumActivities(b),ye=v&&N&&he&&Ee,me=(0,Lw.Qd)(t).enabled,be=N&&me,ge=Gw.useExperiment({},{autoTrackExposure:!0}).enabled,Oe=v&&N&&ge,ve=!1;void 0!==a&&(ve=Object.values(a.roles).some((function(e){var t;return null===(null==e||null===(t=e.tags)||void 0===t?void 0:t.guild_connections)})));var _e=ve||h;_Z(a);var Ie=(0,un.wE)(ln.z$.PREMIUM_TUTORIAL_SERVER_MENU_TOOLTIP),Se=(0,dZ.MR)(a),Te=(0,dZ.WR)(a),Ne=(0,pZ.LK)(a),Ae=null!=a&&a.clydeEnabled(),Ce=(0,cZ.FF)(a,p)&&p&&!Ae,Pe=Uw._.useExperiment({}).enabled,je=(0,QZ.Z)(t,!Pe);return(0,r.jsx)(UH,{guildId:t,hideSelectedChannel:n,guild:a,scrollToChannel:u,selectedChannelId:n?null:i,
selectedChannel:J,selectedVoiceChannelId:f,voiceStates:l,isUnavailable:m,theme:g,user:b,hasChannelNotice:Z,anyLayerOpen:L||U,showGuildBoostingProgressBarUpsell:G,showGuildBoostingProgressBarSizeUpsell:H,showInviteSplashUpsell:Q,showDiscoveryLandingPageSettingsUpsell:q,showGuildHeaderTutorial:k,showGuildTemplateDirtyTooltip:$,showRoleSubscriptionUpsell:F,showDiscoveryTooltip:z,showIntegrationPermissionTooltip:W,showHubPrivacySettingsTooltip:K,showCreatorPromoPageTooltip:ce,showNewUnreadsBar:ne,showActiveThreadsNotice:oe,showAntiRaidUpsellNotice:Se,showMentionRaidLimitUpsell:Te,showAutomodCustomBlockMessageUpsell:Ne,showClydeAITooltip:Ce,showGuildSoundboardPermissionUpsell:V,isHeaderPopoutOpen:te,enableStudyGroup:O,isGuildHeaderDismissibleTooltipShown:D,canShowCoachMarkAtBottom:N,HeaderAnalyticsLocationProvider:j,FooterAnalyticsLocationProvider:R,shouldRenderNitroActivitiesCoachMark:ae,shouldShowBoostingHighlight:le,isBoostingFlowDismissed:ue,shouldRenderAppDirectoryCoachMark:de,
hidesAppDirectoryCoachMark:pe,shouldRenderBashOutCoachMark:ye,shouldRenderGarticPhoneCoachMark:Oe,showVerifiedRolesCoachmark:_e,canManageRoles:h,useReducedMotion:ee,isTutorialHighlightDismissed:Ie,shouldRenderBurstCoachmark:be,channelEmojis:je,showOnboardingUpsellCoachmark:ie})}var GH=n(917313),BH=n(757753),HH=n(966658),VH=n(826357),FH=n.n(VH);function YH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zH(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return YH(e,t);var n=Object.prototype.toString.call(e).slice(8,-1)
;"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return YH(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const WH=function(e){var t=e.guildId,n=e.inviteCode,i=zH(o.useState(CC.hO.INITIAL),2),a=i[0],c=i[1],l=zH(o.useState(null!=n),2),u=l[0],f=l[1];o.useEffect((function(){null!=n&&ir.Z.resolveInvite(n,"Hub").finally((function(){return f(!1)}))}),[n]);var d=(0,s.e7)([BH.Z],(function(){return null!=n?BH.Z.getInvite(n):null})),p=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(t)}));o.useEffect((function(){null!=p&&(0,K.uL)(M.Z5c.CHANNEL(t))}),[p,t]);var h=o.useCallback((function(e){c((function(t){return Math.max(t,e)}))}),[]),E=(0,EC.gK)();return(0,r.jsx)("div",{className:FH().page,children:(0,r.jsxs)(hC.Z,{embedded:!0,splash:E,
waveState:a,showLogo:!1,updateWaveState:h,children:[(0,r.jsx)("div",{className:FH().dragRegion}),(0,r.jsx)("div",{className:FH().contentWrapper,children:!u&&(0,r.jsx)(HH.HubEmailConnectionModalView,{invite:d})})]})})};var KH=n(125776);function qH(e){O.Z.dispatch({type:"APP_VIEW_SET_HOME_LINK",link:e})}var XH=(0,tc.B)({kind:"user",id:"2023-01_clear_all_message_requests",label:"Safety Experience Reject All Message Requests",defaultConfig:{enabled:!1},treatments:[{id:1,label:"Enabled",config:{enabled:!0}}]});function QH(){return XH.useExperiment({},{autoTrackExposure:!0}).enabled}var $H=n(996344),JH=n(48315),eV=n(544488);function tV(){return(0,s.e7)([JH.Z],(function(){return JH.Z.getSpamChannelsCount()}))}function nV(){var e=(0,eV.q)(),t=o.useRef(e),n=(0,s.e7)([$H.Z],(function(){return $H.Z.isReady()})),r=o.useRef(n);o.useEffect((function(){if(n&&!r.current){r.current=!0;t.current=e}}),[n,e]);return t.current<=1&&1===e}function rV(){var e=tV(),t=o.useRef(e),n=(0,s.e7)([JH.Z],(function(){
return JH.Z.isReady()})),r=o.useRef(n);o.useEffect((function(){if(n&&!r.current){r.current=!0;t.current=e}}),[n,e]);return t.current<=1&&1===e}var oV=n(525008),iV=n(771344),aV=n(272403),sV=n.n(aV);function cV(e){var t=e.channel,n=e.baseChannelId,i=(0,op.ZP)(t),a=nV(),l=rV(),u=(0,s.e7)([$H.Z],(function(){return $H.Z.isMessageRequest(t.id)})),f=(0,s.e7)([JH.Z],(function(){return JH.Z.isSpam(t.id)})),d=(0,iV.V)(t.id,t.getRecipientId()),p=o.useCallback((function(){cd.Z.closeChannelSidebar(ap.uZ);u&&a&&(0,sv.Kh)(t.id);f&&l&&(0,sv.Kh)(t.id)}),[t.id,f,l,u,a]),h=o.useCallback((function(){(0,c.CFj)((0,c.Yz2)(Q.Z.Messages.MESSAGE_REQUESTS_SPAM_ERROR_ALERT_TITLE,c.pCN.FAILURE))}),[]),E=(0,oV.m)({onAcceptSuccess:p,onError:h}).markAsNotSpam;if(null==t||!t.isDM())return null;var y=[(0,r.jsx)(kb.ZP.Icon,{icon:Ub.Z,tooltip:Q.Z.Messages.CLOSE,onClick:function(){return cd.Z.closeChannelSidebar(n)}},"close")];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(kb.ZP,{toolbar:y,
"aria-label":Q.Z.Messages.CHANNEL_HEADER_BAR_A11Y_LABEL,children:(0,Mb.ud)({channel:t,channelName:i,inSidebar:!0})}),f&&(0,r.jsxs)("div",{className:sV().hamBanner,children:[(0,r.jsx)(c.xvT,{className:sV().hamBannerText,variant:"text-sm/normal",children:Q.Z.Messages.MESSAGE_REQUESTS_CHANNEL_SIDEBAR_HAM_HEADER}),(0,r.jsx)(c.zxk,{className:sV().hamBannerButton,size:c.PhG.SMALL,onClick:function(){return E(t,d)},children:Q.Z.Messages.MESSAGE_REQUESTS_CHANNEL_SIDEBAR_HAM_BUTTON})]}),(0,r.jsx)("div",{className:Bb().chat,children:(0,r.jsx)(vb.Z,{channel:t,guild:null,chatInputType:Tb.I.SIDEBAR},t.id)})]})}var lV=n(582906),uV=n(686874),fV=n(218372),dV=n(202237),pV=n(463473),hV=n(652119),EV=n(132167);function yV(e){return e.sort((function(e,t){return BC.default.compare(e.lastMessageId,t.lastMessageId)})).reverse()}var mV=n(327860),bV=n(234594),gV=n(490530),OV=n.n(gV),vV=n(96972),_V=n.n(vV),IV=n(540579),SV=n.n(IV);function TV(e){
return e===bV.pS.SPAM?Q.Z.Messages.MESSAGE_REQUESTS_SPAM_EMPTY_STATE_BODY:Q.Z.Messages.MESSAGE_REQUESTS_EMPTY_STATE_BODY}function NV(e){var t=e.section,n=(0,s.e7)([st.Z],(function(){return st.Z.theme}));return(0,r.jsxs)(mV.ZP,{theme:n,className:OV().emptyStateContainer,children:[(0,r.jsx)(mV.ZP.Image,{width:415,height:200,lightSrc:SV(),darkSrc:_V()}),(0,r.jsx)(mV.ZP.Text,{note:TV(t)})]})}var AV=n(110599),CV=n.n(AV);function PV(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jV(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function RV(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){jV(i,r,o,a,s,"next",e)}function s(e){jV(i,r,o,a,s,"throw",e)}a(void 0)}))}}function xV(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function MV(e){
for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){xV(e,t,n[t])}))}return e}function wV(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function DV(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{
for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return PV(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PV(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ZV=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){
if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};const LV=function(e){
var t=e.children,i=e.user,a=e.channel,s=e.onClick,l=e.isFocused,u=e.isActive,f=e.onOtherHover,d=e.className,p=DV(o.useState(!1),2),h=p[0],E=p[1],y=DV(o.useState(!1),2),m=y[0],b=y[1],g=function(){E(!0);!l||u||m||null==f||f()},O=function(){E(!1)};return(0,r.jsx)(pb.mh,{id:a.id,children:function(e){return(0,r.jsx)(c.tEY,{offset:{left:-8,right:-8},children:(0,r.jsx)(ji.Z.div,wV(MV({className:lh()(CV().messageRequestItem,d,xV({},CV().active,u||m)),onContextMenu:function(e){return function(e,t){if(null!=t){b(!0);(0,Ob.jW)(e,RV((function(){var e,o;return ZV(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(49244),n.e(85572)]).then(n.bind(n,810848))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,wV(MV({},e),{user:t}))}]}}))})),{onClose:function(){b(!1)}})}}(e,i)},onMouseEnter:g,onMouseLeave:O,onClick:null!=s?s:void 0,style:{LIST_ROW_HEIGHT:bV.WN,opacity:1}},e),{children:t(h||u||m)}))})}})}
;var UV=n(334835),kV=n(621647),GV=n(217973),BV=n(761465);function HV(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function VV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){HV(e,t,n[t])}))}return e}function FV(e){var t=e.lastMessageId,n=e.message;return e.loaded&&null!=n?BC.default.extractTimestamp(n.id):null!=t?BC.default.extractTimestamp(t):null}var YV=n(804808),zV=n(507488),WV=n(763536),KV=n(939198),qV=n(22556),XV=n.n(qV);function QV(e){var t=e.channel,n=(0,BV.a)(t),i=n.loaded,a=n.error,l=n.message,u=(0,s.e7)([Ja.Z],(function(){return null!=l&&Ja.Z.isBlocked(l.author.id)}),[l]),f=(0,s.e7)([dn.Z],(function(){return dn.Z.can(M.Plq.MANAGE_MESSAGES,t)
})),d=ct.cC.useSetting(),p=o.useMemo((function(){return null!=(null==l?void 0:l.content)&&""!==l.content?(0,YV.ZP)(l,{formatInline:!0,noStyleAndInteraction:!0}):{content:null}}),[l]).content,h=null;if(a)h=(0,r.jsx)(c.xvT,{className:XV().messageReplacement,variant:"text-sm/normal",color:"text-muted",children:Q.Z.Messages.MESSAGE_REQUESTS_ERROR_LOADING_PREVIEW});else if(i)if(null!=l&&u)h=(0,r.jsx)(c.xvT,{className:XV().messageReplacement,variant:"text-sm/normal",color:"text-muted",children:Q.Z.Messages.MESSAGE_REQUESTS_BLOCKED_MESSAGE});else if(null!=l){var E=(0,WV.f)(l,p,u,lh()(XV().messageContent,yx().inlineFormat,yx().smallFontSize),{iconClass:XV().messageContentIcon,iconSize:KV.WW}),y=E.contentPlaceholder,m=E.renderedContent;h=null!=m?(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"text-muted",className:XV().messageContent,children:m}):(0,r.jsx)(c.xvT,{tag:"span",variant:"text-sm/normal",color:"text-muted",className:XV().messageReplacement,children:y})}else h=(0,r.jsx)(c.xvT,{
className:XV().messageReplacement,variant:"text-sm/normal",color:"text-muted",children:Q.Z.Messages.MESSAGE_REQUESTS_DELETED_MESSAGE});else h=null;return(0,r.jsx)(zV.a.Provider,{value:(0,Gg.Z)(d,f),children:(0,r.jsx)(c.Rny,{className:XV().messageFocusBlock,children:h})})}const $V=o.memo(QV);var JV=n(808573),eF=n.n(JV),tF=ss.default.getEnableHardwareAcceleration()?c.Xo$:c.qEK;function nF(e){var t=e.channel,n=e.otherUser,o=e.active,i=(0,s.e7)([E.Z],(function(){return E.Z.useReducedMotion})),a=(0,s.e7)([Ja.Z],(function(){return null==n?null:Ja.Z.getNickname(n.id)})),l=(0,pR.U)().canUseAvatarDecorations,u=!i&&o,f=function(e){var t=(0,BV.a)(e),n=FV(VV({lastMessageId:(0,s.e7)([OR.ZP],(function(){return OR.ZP.lastMessageId(e.id)}))},t));return null==n?"":(0,GV.Ye)(n)}(t),d=l?(0,Ds.NZ)({userId:n.id,avatarDecoration:n.avatarDecoration,size:(0,hR.y)(c.EFr.SIZE_40),canAnimate:u}):null;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tF,{className:eF().avatar,src:(0,kV.x)(t,40,u),
avatarDecoration:d,size:c.EFr.SIZE_40,"aria-label":n.username}),(0,r.jsxs)("div",{className:eF().userPreview,children:[(0,r.jsxs)("div",{className:eF().userContainerWithPreview,children:[(0,r.jsx)(UV.Z,{nick:a,user:n,showAccountIdentifier:!0,className:eF().tagContainer,usernameClass:eF().username,discriminatorClass:null!=lp.ZP.getGlobalName(n)?null:eF().discriminator}),(0,r.jsx)(c.xvT,{className:eF().timestampWithPreview,color:"text-muted",variant:"text-xs/normal",children:f})]}),(0,r.jsx)("div",{className:eF().messagePreview,children:(0,r.jsx)($V,{channel:t})})]})]})}var rF=n(254814),oF=n.n(rF);function iF(e){var t=e.active,n=e.user,i=e.channel,a=nV(),s=o.useCallback((function(){(0,c.CFj)((0,c.Yz2)(Q.Z.Messages.MESSAGE_REQUEST_REQUEST_ERROR_ALERT_TITLE,c.pCN.FAILURE))}),[]),l=o.useCallback((function(){cd.Z.closeChannelSidebar(ap.uZ)}),[]),u=o.useCallback((function(){cd.Z.closeChannelSidebar(ap.uZ);a&&(0,sv.Kh)(i.id)}),[i.id,a]),f=(0,oV.m)({user:n,onAcceptSuccess:u,onRejectSuccess:l,
onError:s}),d=f.acceptMessageRequest,p=f.rejectMessageRequest,h=f.isAcceptLoading,E=f.isRejectLoading,y=f.isUserProfileLoading,m=f.isOptimisticAccepted,b=f.isOptimisticRejected,g=h||E||y||(m||b);return(0,r.jsxs)("div",{className:oF().container,children:[(0,r.jsx)(nF,{channel:i,otherUser:n,active:t}),(0,r.jsxs)("div",{className:oF().actions,children:[(0,r.jsx)(c.zxk,{className:oF().button,color:c.Ttl.PRIMARY,size:c.zxk.Sizes.SMALL,onClick:function(e){e.stopPropagation();p(i.id)},disabled:g,submitting:E||b,children:Q.Z.Messages.MESSAGE_REQUEST_IGNORE}),(0,r.jsx)(c.zxk,{className:oF().button,color:c.Ttl.BRAND,size:c.zxk.Sizes.SMALL,onClick:function(e){e.stopPropagation();d(i.id)},disabled:g,submitting:h||y||m,children:Q.Z.Messages.MESSAGE_REQUEST_ACCEPT})]})]})}function aF(e){var t=e.className,n=e.channel,o=e.user,i=e.hasSingleMessageRequest,a=(0,EV._)().channelId;return(0,r.jsx)(LV,{className:t,isFocused:a===n.id,channel:n,user:o,onClick:function(e){e.stopPropagation()
;cd.Z.openPrivateChannelAsSidebar({channelId:n.id,baseChannelId:ap.uZ,hasSingleMessageRequest:i});setTimeout((function(){Yl.S.dispatch(M.CkL.FOCUS_CHANNEL_TEXT_AREA,{channelId:n.id})}),0)},children:function(e){return(0,r.jsx)(iF,{active:e,user:o,channel:n})}})}var sF=n(986923),cF=n(478797),lF=n.n(cF);function uF(e){var t=e.active,n=e.user,i=e.channel,a=rV(),s=o.useCallback((function(){(0,c.CFj)((0,c.Yz2)(Q.Z.Messages.MESSAGE_REQUESTS_SPAM_ERROR_ALERT_TITLE,c.pCN.FAILURE));lV.Z.increment({name:KH.V.SPAM_MESSAGE_REQUEST_ERROR_VIEW})}),[]),l=o.useCallback((function(){cd.Z.closeChannelSidebar(ap.uZ)}),[]),u=o.useCallback((function(){cd.Z.closeChannelSidebar(ap.uZ);a&&(0,sv.Kh)(i.id)}),[i.id,a]),f=(0,oV.m)({user:n,onAcceptSuccess:u,onRejectSuccess:l,onError:s}),d=f.acceptMessageRequest,p=f.isAcceptLoading,h=f.isUserProfileLoading,E=f.isOptimisticAccepted,y=p||h,m=y||E;return(0,r.jsxs)("div",{className:lF().container,children:[(0,r.jsx)(nF,{otherUser:n,channel:i,active:t}),(0,r.jsxs)("div",{
className:lF().actions,children:[(0,r.jsx)(c.zxk,{className:lF().button,color:c.Ttl.PRIMARY,size:c.zxk.Sizes.SMALL,onClick:function(e){d(i.id);e.stopPropagation()},disabled:m,submitting:y,children:Q.Z.Messages.MESSAGE_REQUESTS_SPAM_ACCEPT}),(0,r.jsx)(sF.Z,{className:lF().button,channel:i,buttonSize:c.zxk.Sizes.SMALL})]})]})}function fF(e){var t=e.className,n=e.channel,o=e.user,i=e.hasSingleMessageRequest;return(0,r.jsx)(LV,{className:t,isFocused:!1,channel:n,user:o,onClick:function(e){e.stopPropagation();cd.Z.openPrivateChannelAsSidebar({channelId:n.id,baseChannelId:ap.uZ,hasSingleMessageRequest:i});setTimeout((function(){Yl.S.dispatch(M.CkL.FOCUS_CHANNEL_TEXT_AREA,{channelId:n.id})}),0)},children:function(e){return(0,r.jsx)(uF,{active:e,user:o,channel:n})}})}var dF=n(342637),pF=n.n(dF);function hF(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function EF(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{}
;var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function yF(){var e=o.useRef(null),t=function(){var e=(0,s.e7)([S.Z],(function(){return S.Z.getPrivateChannelsVersion()})),t=(0,s.Wu)([S.Z,JH.Z],(function(){var e=S.Z.getMutablePrivateChannels();return yV(Array.from(JH.Z.getSpamChannelIds()).map((function(t){return e[t]})).filter((function(e){return null!=e})))}),[e]),n=(0,s.cj)([Y.default],(function(){var e={};t.forEach((function(t){var n=Y.default.getUser(t.recipients[0]);null!=n&&(e[t.id]=n)}));return e}),[t]);return o.useMemo((function(){return t.map((function(e){return{channel:e,user:n[e.id]}}))}),[t,n])}(),n=tV(),i=rV(),a=QH(),l=(0,iP.Z)("message-requests-spam-list"),u=(0,EV._)().channelId,f=o.useCallback((function(){(0,c.CFj)((0,
c.Yz2)(Q.Z.Messages.MESSAGE_REQUEST_REQUEST_ERROR_ALERT_TITLE,c.pCN.FAILURE))}),[]),d=(0,oV.m)({onError:f}).rejectAll,p=o.useCallback((function(){var e=t.map((function(e){return e.channel.id}));d(e)}),[t,d]);o.useEffect((function(){Ie.default.track(M.rMx.SPAM_MESSAGE_REQUESTS_VIEWED,{num_spam_message_requests:n});lV.Z.increment({name:KH.V.SPAM_MESSAGE_REQUEST_VIEW})}),[]);var h=o.useCallback((function(e){var n,o,a,s=e.row,c=t[s],l=null===(n=t[s+1])||void 0===n||null===(o=n.channel)||void 0===o?void 0:o.id,f=c.channel.id,d=null!=u&&u===f,p=null!=u&&u===l;return(0,r.jsx)(fF,{className:lh()((a={},hF(a,pF().selected,d),hF(a,pF().siblingSelected,p),a)),channel:c.channel,user:c.user,hasSingleMessageRequest:i},f)}),[t,i,u]),E=o.useCallback((function(){return(0,r.jsxs)(dV.Z,{className:pF().sectionTitle,children:[Q.Z.Messages.MESSAGE_REQUESTS_SPAM_HEADER.format({count:n}),a&&n>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xvT,{className:pF().titleDivider,variant:"eyebrow",
color:"header-secondary",tag:"span",children:"•"}),(0,r.jsx)(c.zxk,{onClick:p,look:c.iLD.LINK,color:c.Ttl.LINK,size:c.PhG.SMALL,className:pF().clearAllButton,"aria-label":Q.Z.Messages.MESSAGE_REQUESTS_CLEAR_ALL,children:Q.Z.Messages.MESSAGE_REQUESTS_CLEAR_ALL})]}):null]},"message-requests-spam-title")}),[n,p,a]);return 0===t.length?(0,r.jsx)(NV,{section:bV.pS.SPAM}):(0,r.jsx)(pb.bG,{navigator:l,children:(0,r.jsx)(pb.SJ,{children:function(n){var o=n.ref,i=n.role,a=EF(n,["ref","role"]);return(0,r.jsx)(c.aVo,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){hF(e,t,n[t])}))}return e}({className:pF().list,innerRole:i,innerAriaLabel:Q.Z.Messages.MESSAGE_REQUESTS,ref:function(t){e.current=t;var n
;o.current=null!==(n=null==t?void 0:t.getScrollerNode())&&void 0!==n?n:null},paddingTop:24,paddingBottom:24,sectionHeight:bV.oi,rowHeight:bV.WN,renderSection:E,renderRow:h,sections:[t.length],chunkSize:30,fade:!0},a),"message-requests-spam-list")}})})}var mF=n(279597),bF=n.n(mF);function gF(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function OF(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function vF(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function _F(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){
var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return gF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gF(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IF(){var e=o.useRef(null),t=(0,eV.q)(),n=function(){var e=(0,s.e7)([S.Z],(function(){return S.Z.getPrivateChannelsVersion()})),t=(0,s.Wu)([S.Z,$H.Z],(function(){var e=S.Z.getMutablePrivateChannels()
;return yV(Array.from($H.Z.getMessageRequestChannelIds()).map((function(t){return e[t]})).filter((function(e){return null!=e})))}),[e]),n=(0,s.cj)([Y.default],(function(){var e={};t.forEach((function(t){var n=Y.default.getUser(t.recipients[0]);null!=n&&(e[t.id]=n)}));return e}),[t]);return o.useMemo((function(){return t.map((function(e){return{channel:e,user:n[e.id]}}))}),[t,n])}(),i=nV(),a=QH(),l=o.useCallback((function(){(0,c.CFj)((0,c.Yz2)(Q.Z.Messages.MESSAGE_REQUEST_REQUEST_ERROR_ALERT_TITLE,c.pCN.FAILURE))}),[]),u=(0,oV.m)({onError:l}).rejectAll,f=(0,iP.Z)("message-requests-list"),d=(0,EV._)().channelId,p=o.useCallback((function(){var e=n.map((function(e){return e.channel.id}));u(e)}),[n,u]),h=o.useCallback((function(e){var t,o,a,s=e.row,c=n[s],l=null===(t=n[s+1])||void 0===t||null===(o=t.channel)||void 0===o?void 0:o.id,u=c.channel.id,f=null!=d&&d===u,p=null!=d&&d===l;return(0,r.jsx)(aF,{className:lh()((a={},OF(a,bF().selected,f),OF(a,bF().siblingSelected,p),a)),
channel:c.channel,user:c.user,hasSingleMessageRequest:i},u)}),[i,n,d]),E=o.useCallback((function(){return(0,r.jsxs)(dV.Z,{className:bF().sectionTitle,children:[t>0?Q.Z.Messages.MESSAGE_REQUESTS_PAGE_TITLE_WITH_COUNT.format({count:t}):Q.Z.Messages.MESSAGE_REQUESTS_PAGE_TITLE,a&&t>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xvT,{className:bF().titleDivider,variant:"eyebrow",color:"header-secondary",tag:"span",children:"•"}),(0,r.jsx)(c.zxk,{onClick:p,look:c.iLD.LINK,color:c.Ttl.LINK,size:c.PhG.SMALL,className:bF().clearAllButton,"aria-label":Q.Z.Messages.MESSAGE_REQUESTS_CLEAR_ALL,children:Q.Z.Messages.MESSAGE_REQUESTS_CLEAR_ALL})]}):null]},"title")}),[t,p,a]);n.length!==t&&lV.Z.increment({name:KH.V.MESSAGE_REQUEST_COUNT_DRIFT});return 0===n.length?(0,r.jsx)(NV,{section:bV.pS.REQUESTS}):(0,r.jsx)(pb.bG,{navigator:f,children:(0,r.jsx)(pb.SJ,{children:function(t){var o=t.ref,i=t.role,a=vF(t,["ref","role"]);return(0,r.jsx)(c.aVo,function(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){OF(e,t,n[t])}))}return e}({className:bF().list,innerRole:i,innerAriaLabel:Q.Z.Messages.MESSAGE_REQUESTS,ref:function(t){e.current=t;var n;o.current=null!==(n=null==t?void 0:t.getScrollerNode())&&void 0!==n?n:null},paddingTop:24,paddingBottom:24,sectionHeight:bV.oi,rowHeight:bV.WN,renderSection:E,renderRow:h,sections:[n.length],chunkSize:30,fade:!0},a),"message-requests-list")}})})}function SF(e){var t=e.pageWidth,n=e.onSidebarResize,o=(0,s.e7)([ap.ZP],(function(){return ap.ZP.getSidebarState(ap.uZ)})),i=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(null==o?void 0:o.channelId)}));if(null==o||o.type!==lv.t.VIEW_MESSAGE_REQUEST||null==i||!i.isPrivate())return null;var a=t-M.R7I;return(0,r.jsx)(hb.Z,{
sidebarType:hb.y.MessageRequestSidebar,maxWidth:a,onWidthChange:n,children:(0,r.jsx)(cV,{channel:i,baseChannelId:ap.uZ})})}var TF=function(e){var t=e.markAsDismissed;return(0,r.jsx)(qZ.ZP,{header:Q.Z.Messages.MESSAGE_REQUESTS_COACHMARK_TITLE,content:Q.Z.Messages.MESSAGE_REQUESTS_COACHMARK_CONTENT_TEENS,buttonCTA:Q.Z.Messages.MESSAGE_REQUESTS_COACHMARK_DISMISS,className:bF().messageRequestCoachmark,onClick:t,markAsDismissed:t,caretPosition:qZ.DF.TOP_CENTER,headerClassName:bF().header})},NF=function(e){var t=(0,hV.Z)(),n=(0,s.e7)([E.Z],(function(){return E.Z.useReducedMotion}));o.useEffect((function(){(0,un.kk)(ln.z$.MESSAGE_REQUEST_SETTINGS_COACH_MARK)}),[]);return(0,r.jsx)(WN.Z,{contentTypes:[ln.z$.MESSAGE_REQUEST_SETTINGS_COACH_MARK],children:function(o){var i=o.visibleContent,a=o.markAsDismissed;return i===ln.z$.MESSAGE_REQUEST_SETTINGS_COACH_MARK?(0,r.jsx)(c.yRy,{renderPopout:function(){return t?(0,r.jsx)(TF,{markAsDismissed:a}):(0,r.jsx)(qZ.ZP,{
header:Q.Z.Messages.MESSAGE_REQUESTS_COACHMARK_TITLE,content:Q.Z.Messages.MESSAGE_REQUESTS_COACHMARK_CONTENT,buttonCTA:Q.Z.Messages.MESSAGE_REQUESTS_COACHMARK_CONFIRM,secondaryButtonCTA:Q.Z.Messages.MESSAGE_REQUESTS_COACHMARK_DISMISS,className:bF().messageRequestCoachmark,onClick:function(e){e.stopPropagation();(0,K.uL)(M.Z5c.SETTINGS("privacy-and-safety"))},markAsDismissed:a,caretPosition:qZ.DF.TOP_CENTER,headerClassName:bF().header})},position:"bottom",align:"center",animation:n?c.yRy.Animation.NONE:c.yRy.Animation.TRANSLATE,shouldShow:!(T.Z.hasLayers()||(0,c.$sL)()),spacing:16,children:function(){return e.children}}):e.children}})};function AF(e){return e.section===bV.pS.SPAM?(0,r.jsx)(yF,{}):(0,r.jsx)(IF,{})}var CF=(0,yb.Z)((function(e){var t=e.width,n=(0,eV.q)();o.useEffect((function(){qH(M.Z5c.MESSAGE_REQUESTS);(0,uV.e)("message-requests");Ie.default.track(M.rMx.MESSAGE_REQUESTS_VIEWED,{num_message_requests:n});lV.Z.increment({name:KH.V.MESSAGE_REQUEST_VIEW})}),[]);var i,a=(0,
s.e7)([st.Z],(function(){return st.Z.theme})),l=tV(),u=_F(o.useState(!1),2),f=u[0],d=u[1],p=(0,s.e7)([ap.ZP,$H.Z,JH.Z],(function(){var e=ap.ZP.getSidebarState(ap.uZ);return null!=e&&e.type===lv.t.VIEW_MESSAGE_REQUEST&&($H.Z.isMessageRequest(e.channelId)||JH.Z.isSpam(e.channelId))})),h=_F(o.useState(bV.pS.REQUESTS),2),E=h[0],y=h[1];(0,Am.Tt)({location:Q.Z.Messages.MESSAGE_REQUESTS});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:lh()(nO().chat,bF().container,(i={},OF(i,nO().threadSidebarOpen,p),OF(i,nO().threadSidebarFloating,p&&f),i)),children:[(0,r.jsxs)(Og.Z,{className:(0,pV.Q)(a),toolbar:!0,children:[(0,r.jsx)(Og.Z.Icon,{icon:fV.Z,"aria-hidden":!0}),(0,r.jsx)(NF,{children:(0,r.jsx)(Og.Z.Title,{children:Q.Z.Messages.MESSAGE_REQUESTS})}),(0,r.jsx)(Og.Z.Divider,{}),(0,r.jsxs)(c.njP,{"aria-label":Q.Z.Messages.MESSAGE_REQUESTS,selectedItem:E,type:"top-pill",onItemSelect:function(e){y(e)},className:bF().tabBar,children:[(0,r.jsx)(c.njP.Item,{id:bV.pS.REQUESTS,
className:bF().item,children:Q.Z.Messages.MESSAGE_REQUESTS_REQUESTS_TAB_TITLE}),(0,r.jsx)(c.njP.Item,{id:bV.pS.SPAM,className:bF().item,children:0===l?Q.Z.Messages.MESSAGE_REQUESTS_SPAM_TAB_TITLE:Q.Z.Messages.MESSAGE_REQUESTS_SPAM_TAB_TITLE_WITH_COUNT.format({count:l})})]})]}),(0,r.jsx)("div",{className:nO().content,children:(0,r.jsx)(AF,{section:E})})]}),p&&(0,r.jsx)(SF,{pageWidth:t,onSidebarResize:function(e,t){d(t)}})]})}));const PF=CF;var jF=n(363582),RF=n(719174),xF=n(58034),MF=n(532378),wF=(0,tc.B)({kind:"user",id:"2023-02_parent_tools_launch",label:"Safety - Parent Tools Launch",defaultConfig:{enabled:!1},treatments:[{id:1,label:"Enabled",config:{enabled:!0}}]});var DF=n(637493),ZF=n(643676),LF=n(129471);function UF(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function kF(e){kF=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return kF(e)}function GF(e){
for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){UF(e,t,n[t])}))}return e}function BF(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function HF(e,t){return!t||"object"!==FF(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function VF(e,t){
VF=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return VF(e,t)}var FF=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function YF(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=kF(e);if(t){var o=kF(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return HF(this,n)}}var zF={},WF={};function KF(e){var t=GF({},zF);for(var n in e)void 0===t[n]?t[n]={parentToolsTeenActivity:null,linkedUser:e[n]}:t[n].linkedUser=e[n];zF=t}function qF(e){var t=e.linkedUsersMap,n=e.users;KF(t);WF=n.reduce((function(e,t){return BF(GF({},e),UF({},t.id,new UC.Z(t)))}),{})}function XF(e){KF(e.linkedUsersMap)}function QF(e){var t=e.parentToolsTeenActivity;if(null!=t){var n=t.teen_id
;void 0===zF[n]?zF[n]={parentToolsTeenActivity:t,linkedUser:null}:zF[n].parentToolsTeenActivity=t}}function $F(e){var t=e.parentToolsTeenActivity;if(null!=t){var n=t.teen_id;if(void 0!==zF[n]){var r=zF[n].parentToolsTeenActivity;if(null==r)zF[n]={parentToolsTeenActivity:t,linkedUser:void 0===zF[n].linkedUser?null:zF[n].linkedUser};else{var o;r.actions=(UF(o={},LF.nP.DM_MESSAGE_SEND,nY(r.actions,t.actions,LF.nP.DM_MESSAGE_SEND)),UF(o,LF.nP.GDM_MESSAGE_SEND,nY(r.actions,t.actions,LF.nP.GDM_MESSAGE_SEND)),UF(o,LF.nP.MESSAGE_REACT,nY(r.actions,t.actions,LF.nP.MESSAGE_REACT)),UF(o,LF.nP.ADD_FRIEND,nY(r.actions,t.actions,LF.nP.ADD_FRIEND)),UF(o,LF.nP.SEND_CALL,nY(r.actions,t.actions,LF.nP.SEND_CALL)),UF(o,LF.nP.CALL_JOIN,nY(r.actions,t.actions,LF.nP.CALL_JOIN)),UF(o,LF.nP.GUILD_JOIN,nY(r.actions,t.actions,LF.nP.GUILD_JOIN)),o);r.users=GF({},r.users,t.users);r.guilds=GF({},r.guilds,t.guilds)}}else zF[n]={parentToolsTeenActivity:t,linkedUser:null}}}function JF(e){KF(e.linkedUsersMap)}
function eY(){wF.getCurrentConfig({}).enabled&&ZF.Z.fetchLinkedUsers()}function tY(){zF={};WF={}}function nY(e,t,n){return GF({},e[n],t[n])}var rY=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&VF(e,t)}(n,e);var t=YF(n);function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var e;(e=t.call(this)).loadCache=function(){var t=e.readSnapshot(n.LATEST_SNAPSHOT_VERSION);if(null!=t){zF=t.linkedUsers.reduce((function(e,t){if(null==t.linkedUser)return e;var n=t.linkedUser;return BF(GF({},e),UF({},n.user_id,t))}),{});WF=t.linkedUserDetails.reduce((function(e,t){return BF(GF({},e),UF({},t.id,t))}),{})}};e.registerActionHandlers({CONNECTION_OPEN:eY,CACHE_LOADED_LAZY:e.loadCache,PARENT_TOOLS_LINKED_USERS_FETCH_SUCCESS:qF,
PARENT_TOOLS_TEEN_ACTIVITY_FETCH_SUCCESS:QF,PARENT_TOOLS_TEEN_ACTIVITY_MORE_FETCH_SUCCESS:$F,PARENT_TOOLS_REQUEST_LINK_SUCCESS:XF,PARENT_TOOLS_REQUEST_LINK_UPDATE_SUCCESS:JF,LOGOUT:tY});return e}var r=n.prototype;r.takeSnapshot=function(){return{version:n.LATEST_SNAPSHOT_VERSION,data:{linkedUsers:Object.values(zF),linkedUserDetails:Object.values(WF)}}};r.getLinkedUsers=function(){return zF};r.getUserRecordForId=function(e){return WF[e]};r.getLinkTimestamp=function(e){var t,n=zF[e];return null==n?null:null===(t=n.linkedUser)||void 0===t?void 0:t.created_at};return n}(DF.Z);rY.displayName="FamilyCenterStore";rY.LATEST_SNAPSHOT_VERSION=1;const oY=new rY;function iY(e){var t=(0,dE.ZP)([oY],(function(){return oY.getLinkedUsers()}));return Object.values(t).filter((function(t){return null!=t.linkedUser&&t.linkedUser.link_status===e})).map((function(e){return e.linkedUser})).map((function(e){return oY.getUserRecordForId(e.user_id)}))}var aY=n(801311),sY=n.n(aY),cY=n(583334),lY=n.n(cY)
;const uY=function(){var e=iY(LF.ne.ACTIVE);return(0,r.jsxs)("div",{className:sY().container,children:[(0,r.jsxs)("div",{className:sY().row,children:[(0,r.jsxs)("div",{className:sY().headerText,children:[(0,r.jsx)(c.X6q,{variant:"heading-xl/medium",children:(0,r.jsx)(c.y5t,{children:Q.Z.Messages.FAMILY_CENTER_ACTIVITY_BANNER_HEADER})}),(0,r.jsx)(c.xvT,{variant:"text-sm/medium",color:"text-muted",children:Q.Z.Messages.FAMILY_CENTER_ACTIVITY_BANNER_DESCRIPTION.format({articleLink:"https://discord.com"})})]}),(0,r.jsx)("div",{className:sY().headerImage,children:(0,r.jsx)("img",{src:lY(),alt:Q.Z.Messages.FAMILY_CENTER_ACTIVITY_CHECKLIST_BANNER_DESCRIPTION})})]}),e.length>0?(0,r.jsx)(c.zxk,{className:sY().button,fullWidth:!1,size:c.PhG.LARGE,children:Q.Z.Messages.GET_STARTED}):null]})};var fY=n(895724),dY=n(138043),pY=n.n(dY);function hY(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}const EY=function(e){
var t=e.header,n=e.count,o=e.tooltipDescription,i=n>0?"text-brand":"text-muted";return(0,r.jsxs)("div",{className:pY().counter,children:[(0,r.jsx)(c.X6q,{variant:"heading-xxl/medium",color:i,children:(0,r.jsx)(c.y5t,{children:n})}),(0,r.jsxs)("div",{className:pY().textRow,children:[(0,r.jsx)(c.xvT,{variant:"text-sm/semibold",children:t}),(0,r.jsx)(c.ua7,{text:o,tooltipClassName:pY().tooltip,children:function(e){return(0,r.jsx)(fY.Z,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){hY(e,t,n[t])}))}return e}({className:pY().info,width:12,height:12},e))}})]})]})};var yY=n(779224),mY=n(500351),bY=n(554316),gY=n.n(bY);const OY=function(e){var t=e.text,n=e.className;return(0,r.jsxs)("div",{className:n,children:[(0,r.jsx)("img",{
className:gY().image,src:_V(),alt:""}),(0,r.jsx)(c.xvT,{className:gh().marginTop8,variant:"text-sm/medium",color:"text-muted",children:t})]})};var vY=n(467171),_Y=n.n(vY);function IY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function SY(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return IY(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IY(e,t)}(e,t)||function(){
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const TY=function(e){var t=e.user,n=iY(LF.ne.ACTIVE),o=Array.from(LF.tx.entries()),i=(0,RF.Z)();return 0===n.length?null:(0,r.jsxs)("div",{className:_Y().container,children:[i?null:(0,r.jsxs)("div",{className:_Y().connectedCounter,children:[(0,r.jsx)(MF.Z,{className:_Y().eyeIcon}),(0,r.jsx)(c.xvT,{variant:"eyebrow",children:Q.Z.Messages.FAMILY_CENTER_ACTIVITY_OVERVIEW_VISBILITY_COUNT.format({activeLinks:n})})]}),(0,r.jsxs)("div",{className:_Y().card,children:[(0,r.jsxs)("div",{className:_Y().header,children:[(0,r.jsx)(yY.r,{user:t}),(0,r.jsxs)("div",{className:_Y().headerText,children:[(0,r.jsx)(mY.Z,{user:t}),(0,r.jsx)(c.xvT,{variant:"text-sm/medium",color:"text-muted",children:Q.Z.Messages.FAMILY_CENTER_ACTIVITY_OVERVIEW_DESCRIPTION_TEEN.format({isAdult:i})})]})]}),(0,r.jsxs)("div",{className:_Y().content,children:[(0,
r.jsx)("div",{className:_Y().activityCounterRow,children:o.map((function(e){var t=SY(e,2),n=t[0],o=t[1];return(0,r.jsx)(EY,{count:0,header:o.counterHeader(),tooltipDescription:o.counterTooltip()},n)}))}),(0,r.jsx)("div",{className:_Y().activityOverview,children:(0,r.jsx)(OY,{text:Q.Z.Messages.FAMILY_CENTER_ACTIVITY_OVERVIEW_NO_ACTIVITY})})]})]})]})};var NY=n(573438),AY=n.n(NY),CY=n(630228),PY=n.n(CY);const jY=function(){return(0,r.jsxs)("div",{className:AY().container,children:[(0,r.jsxs)("div",{className:AY().content,children:[(0,r.jsx)(c.X6q,{className:AY().header,variant:"heading-md/bold",children:(0,r.jsx)(c.y5t,{children:Q.Z.Messages.FAMILY_CENTER_ACTIVITY_CHECKLIST_BANNER_HEADER})}),(0,r.jsx)(c.xvT,{className:AY().description,variant:"text-sm/medium",color:"text-muted",children:Q.Z.Messages.FAMILY_CENTER_ACTIVITY_CHECKLIST_BANNER_DESCRIPTION})]}),(0,r.jsx)("div",{children:(0,r.jsx)("img",{src:PY(),alt:Q.Z.Messages.FAMILY_CENTER_ACTIVITY_CHECKLIST_BANNER_DESCRIPTION})})]})}
;var RY=n(762633),xY=n.n(RY);const MY=function(e){var t=e.icon,n=e.iconClassName,o=e.header,i=e.description;return(0,r.jsxs)("div",{className:xY().container,children:[(0,r.jsx)("div",{className:xY().circle,children:(0,r.jsx)(t,{className:lh()(xY().icon,n),width:21,height:21})}),(0,r.jsx)(c.X6q,{variant:"heading-md/bold",className:xY().header,children:(0,r.jsx)(c.y5t,{children:o})}),(0,r.jsx)(c.xvT,{variant:"text-sm/medium",color:"text-muted",children:i})]})};function wY(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function DY(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function ZY(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function LY(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=ZY(e,["width","height","color","foreground"]);return(0,r.jsxs)("svg",DY(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){wY(e,t,n[t])}))}return e}({},(0,
OO.Z)(l)),{width:n,height:i,viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M2.36002 2.35999V7.39991H7.39994V2.35999H2.36002ZM5.96009 5.96006H3.80009V3.80006H5.96009V5.96006Z",fill:s,fillRule:"evenodd",clipRule:"evenodd",className:c}),(0,r.jsx)("path",{d:"M2.36002 14.5999V19.6401H7.39994V14.5999H2.36002ZM5.96009 18.2002H3.80009V16.0402H5.96009V18.2002Z",fill:s,fillRule:"evenodd",clipRule:"evenodd",className:c}),(0,r.jsx)("path",{d:"M14.6001 2.35999V7.39991H19.64V2.35999H14.6001ZM18.2 5.96006H16.04V3.80006H18.2V5.96006Z",fill:s,fillRule:"evenodd",clipRule:"evenodd",className:c}),(0,r.jsx)("path",{d:"M18.2 8.84003V13.16H14.6001V14.5999H19.64V8.84003H18.2Z",fill:s,fillRule:"evenodd",clipRule:"evenodd",className:c}),(0,r.jsx)("path",{d:"M14.6001 16.0402V19.64H16.04V17.48H18.2V19.64H19.64V16.0402H14.6001Z",fill:s,fillRule:"evenodd",clipRule:"evenodd",className:c}),(0,r.jsx)("path",{d:"M8.84006 2.35999V3.80006H11.72V7.39991H13.1601V2.35999H8.84006Z",fill:s,fillRule:"evenodd",
clipRule:"evenodd",className:c}),(0,r.jsx)("path",{d:"M11.72 8.84003V11.7202H8.84006V16.0402H11.72V19.64H13.1601V14.5999H10.2801V13.16H13.1601V10.2801H14.6001V11.7202H16.04V8.84003H11.72Z",fill:s,fillRule:"evenodd",clipRule:"evenodd",className:c}),(0,r.jsx)("path",{d:"M10.2801 17.48H8.84006V19.64H10.2801V17.48Z",fill:s,fillRule:"evenodd",clipRule:"evenodd",className:c}),(0,r.jsx)("path",{d:"M7.39999 11.7202H5.23999V13.1601H7.39999V11.7202Z",fill:s,fillRule:"evenodd",clipRule:"evenodd",className:c}),(0,r.jsx)("path",{d:"M8.84001 5.23999V8.84006H2.36002V13.1601H3.80009V10.2801H10.2801V5.23999H8.84001Z",fill:s,fillRule:"evenodd",clipRule:"evenodd",className:c})]}))}var UY=n(757949),kY=n.n(UY);const GY=function(){var e=iY(LF.ne.ACTIVE),t=(0,dE.ZP)([Y.default],(function(){return Y.default.getCurrentUser()}));return void 0===t?null:(0,r.jsxs)("div",{className:kY().container,children:[(0,r.jsx)("div",{className:kY().banner,children:(0,r.jsx)(uY,{})}),(0,r.jsxs)("div",{
className:kY().featureCards,children:[(0,r.jsx)(MY,{iconClassName:kY().chatCheckIcon,icon:xF.Z,header:Q.Z.Messages.FAMILY_CENTER_FEATURE_CARD_MESSAGES_HEADER,description:Q.Z.Messages.FAMILY_CENTER_FEATURE_CARD_MESSAGES_DESCRIPTION}),(0,r.jsx)(MY,{icon:MF.Z,header:Q.Z.Messages.FAMILY_CENTER_FEATURE_CARD_SHARING_HEADER,description:Q.Z.Messages.FAMILY_CENTER_FEATURE_CARD_SHARING_DESCRIPTION}),(0,r.jsx)(MY,{icon:LY,header:Q.Z.Messages.FAMILY_CENTER_FEATURE_CARD_PAIRING_HEADER,description:Q.Z.Messages.FAMILY_CENTER_FEATURE_CARD_PAIRING_DESCRIPTION})]}),e.length>0?(0,r.jsx)(jY,{}):null,(0,r.jsx)(TY,{user:t})]})};var BY=n(897746),HY=n.n(BY);function VY(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function FY(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e)
;t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function YY(e){var t=e.icon,n=e.tooltip,o=e.onClick,i=e.className;return(0,r.jsx)(c.ua7,{text:n,children:function(e){return(0,r.jsx)(c.P3F,FY(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){VY(e,t,n[t])}))}return e}({},e),{"aria-label":n,onClick:o,className:lh()(HY().actionButton,i),children:(0,r.jsx)(t,{className:HY().icon})}))}})}var zY=n(501943),WY=n(984136),KY=n.n(WY);function qY(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function XY(e){
for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){qY(e,t,n[t])}))}return e}function QY(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var $Y=ss.default.getEnableHardwareAcceleration()?c.Xo$:c.qEK,JY=function(){return{minutes:Q.Z.Messages.FAMILY_CENTER_TIMESTAMP_MINUTES,hours:Q.Z.Messages.FAMILY_CENTER_TIMESTAMP_HOURS,
days:Q.Z.Messages.FAMILY_CENTER_TIMESTAMP_DAYS,month:Q.Z.Messages.FAMILY_CENTER_TIMESTAMP_MORE_THAN_MONTH}};function ez(e){var t=e.otherUser,n=e.active,o=(0,s.e7)([E.Z],(function(){return E.Z.useReducedMotion})),i=(0,s.e7)([oY],(function(){return null==t?null:oY.getLinkTimestamp(t.id)})),a=(0,pR.U)().canUseAvatarDecorations,l=(0,gR.w)({user:t,size:40}),u=l.avatarSrc,f=l.isAvatarAnimating,d=l.eventHandlers,p=!o&&(n||f),h=null!=i?(0,zY.Z)(Date.parse(i),JY):null,y=a?(0,Ds.NZ)({userId:t.id,avatarDecoration:t.avatarDecoration,size:(0,hR.y)(c.EFr.SIZE_40),canAnimate:p}):null;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",QY(XY({},d),{children:(0,r.jsx)($Y,{className:KY().avatar,src:u,avatarDecoration:y,size:c.EFr.SIZE_40,"aria-label":t.username})})),(0,r.jsxs)("div",{className:KY().userPreview,children:[(0,r.jsx)("div",{className:KY().userContainerWithTimestamp,children:(0,r.jsx)(UV.Z,{user:t,showAccountIdentifier:!0,className:KY().tagContainer,usernameClass:KY().username,
discriminatorClass:KY().discriminator})}),(0,r.jsx)(c.xvT,{className:KY().timestamp,color:"text-muted",variant:"text-xs/normal",children:h})]})]})}var tz=n(482699),nz=n.n(tz);function rz(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function oz(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){rz(i,r,o,a,s,"next",e)}function s(e){rz(i,r,o,a,s,"throw",e)}a(void 0)}))}}function iz(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function az(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var sz=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}
o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function cz(e){var t=e.active,i=e.user,a=(0,dE.ZP)([Y.default],(function(){return Y.default.getCurrentUser()})),s=o.useCallback((function(){xh()(void 0!==a,"User must be logged in to accept a link request");(0,c.ZDy)(oz((function(){var e,t;return sz(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(50562)]).then(n.bind(n,250562))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,az(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){iz(e,t,n[t])}))}return e}({},e),{currentUser:a,otherUser:i}))}]}}))})))}),[a,i]);return(0,r.jsxs)("div",{
className:nz().container,children:[(0,r.jsx)("div",{className:nz().details,children:(0,r.jsx)(ez,{otherUser:i,active:t})}),(0,r.jsx)("div",{className:nz().actions,children:(0,r.jsx)(YY,{icon:Ub.Z,className:nz().actionDeny,tooltip:Q.Z.Messages.FAMILY_CENTER_LINK_ACTION_DISCONNECT,onClick:s})})]})}function lz(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function uz(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){lz(i,r,o,a,s,"next",e)}function s(e){lz(i,r,o,a,s,"throw",e)}a(void 0)}))}}function fz(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function dz(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){
return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){fz(e,t,n[t])}))}return e}function pz(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var hz=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),
0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Ez(e){var t=e.active,i=e.user,a=(0,RF.Z)(),s=(0,dE.ZP)([Y.default],(function(){return Y.default.getCurrentUser()})),l=o.useCallback((function(){xh()(void 0!==s,"User must be logged in to accept a link request");(0,c.ZDy)(uz((function(){var e,t;return hz(this,(function(o){switch(o.label){case 0:
return[4,Promise.all([n.e(40532),n.e(13774)]).then(n.bind(n,213774))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,pz(dz({},e),{currentUser:s,otherUser:i}))}]}}))})))}),[s,i]),u=o.useCallback((function(){xh()(void 0!==s,"User must be logged in to reject a link request");(0,c.ZDy)(uz((function(){var e,t;return hz(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(20737)]).then(n.bind(n,420737))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,pz(dz({},e),{currentUser:s,otherUser:i}))}]}}))})))}),[s,i]);return(0,r.jsxs)("div",{className:nz().container,children:[(0,r.jsx)("div",{className:nz().details,children:(0,r.jsx)(ez,{otherUser:i,active:t})}),(0,r.jsxs)("div",{className:nz().actions,children:[a?null:(0,r.jsx)(YY,{icon:gA.Z,className:nz().actionAccept,tooltip:Q.Z.Messages.FAMILY_CENTER_LINK_ACTION_ACCEPT,onClick:l}),(0,r.jsx)(YY,{icon:Ub.Z,className:nz().actionDeny,
tooltip:Q.Z.Messages.FAMILY_CENTER_LINK_ACTION_DECLINE,onClick:u})]})]})}var yz=n(647446),mz=n(129290),bz=n.n(mz);function gz(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Oz(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function vz(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Oz(e,t,n[t])}))}return e}function _z(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))
;n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Iz(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return gz(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gz(e,t)}(e,t)||function(){
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const Sz=function(e){var t=e.user,n=e.children,i=e.isLast,a=Iz(o.useState(!1),2),s=a[0],c=a[1],l=function(){c(!0)},u=function(){c(!1)};return(0,r.jsx)(pb.mh,{id:t.id,children:function(e){var t;return(0,r.jsx)(yz.tE,{offset:{left:-8,right:-8},children:(0,r.jsx)(ji.Z.div,_z(vz({style:{opacity:1},className:lh()(bz().userLinkRequestItem,(t={},Oz(t,bz().active,s),Oz(t,bz().last,i),t)),onMouseEnter:l,onMouseLeave:u},e),{children:n(s)}))})}})};var Tz=n(74110),Nz=n.n(Tz);function Az(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Cz(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){
var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function Pz(e){var t=e.sectionType,n=e.sectionTitle,i=e.requests,a=o.useRef(null),s="".concat(t,"-list"),l=(0,iP.Z)(s),u=o.useCallback((function(e){var n=e.row,o=e.listIndex,a=i[n],s=o===i.length;return(0,r.jsx)(Sz,{user:a,isLast:s,children:function(e){return t===LF.ne.ACTIVE?(0,r.jsx)(cz,{active:e,user:a}):(0,r.jsx)(Ez,{active:e,user:a})}})}),[i,t]),f=o.useCallback((function(){return(0,r.jsx)(dV.Z,{className:Nz().sectionTitle,children:(0,r.jsx)(c.xvT,{className:gh().marginBottom8,variant:"eyebrow",color:"header-secondary",children:n})},"title")}),[n]);return(0,r.jsx)("div",{className:Nz().section,children:(0,r.jsx)(pb.bG,{navigator:l,children:(0,r.jsx)(pb.SJ,{children:function(e){var t=e.ref,o=e.role,l=Cz(e,["ref","role"]);return(0,r.jsx)(c.aVo,function(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Az(e,t,n[t])}))}return e}({className:Nz().list,innerRole:o,innerAriaLabel:n,ref:function(e){a.current=e;var n;t.current=null!==(n=null==e?void 0:e.getScrollerNode())&&void 0!==n?n:null},paddingTop:24,paddingBottom:24,sectionHeight:LF.zE,rowHeight:LF.ip,renderSection:f,renderRow:u,sections:[i.length],chunkSize:30,fade:!0},l),s)}})})})}var jz=function(){var e=(0,RF.Z)(),t=iY(LF.ne.ACTIVE),n=e?LF.AG:LF.i0,o=(e?Q.Z.Messages.FAMILY_CENTER_ACCEPTED_REQUESTS_TITLE_PARENT:Q.Z.Messages.FAMILY_CENTER_ACCEPTED_REQUESTS_TITLE_TEEN).format({count:t.length,max:n});return(0,r.jsx)(r.Fragment,{children:t.length>0?(0,r.jsx)(Pz,{sectionType:LF.ne.ACTIVE,sectionTitle:o,requests:t}):(0,r.jsxs)("div",{className:Nz().section,children:[(0,r.jsx)(c.xvT,{
className:gh().marginBottom8,variant:"eyebrow",color:"header-secondary",children:o}),(0,r.jsx)("div",{className:Nz().box,children:(0,r.jsx)(OY,{text:Q.Z.Messages.FAMILY_CENTER_ACCEPTED_REQUESTS_EMPTY_DESCRIPTION.format({isAdult:e})})})]})})},Rz=function(){var e=(0,RF.Z)(),t=iY(LF.ne.PENDING);return 0===t.length?null:(0,r.jsx)(Pz,{sectionType:LF.ne.PENDING,sectionTitle:Q.Z.Messages.FAMILY_CENTER_PENDING_REQUESTS_TITLE.format({isAdult:e,count:t.length}),requests:t})};const xz=function(){return(0,r.jsxs)("div",{className:Nz().container,children:[(0,r.jsx)(jz,{}),(0,r.jsx)(Rz,{})]})};var Mz,wz,Dz=n(469858),Zz=n.n(Dz);function Lz(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Uz(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function kz(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){
var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Lz(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lz(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}!function(e){e.ACTIVITY="ACTIVITY";e.REQUESTS="REQUESTS"}(Mz||(Mz={}));var Gz=(Uz(wz={},Mz.REQUESTS,(function(){return(0,r.jsx)(xz,{})})),Uz(wz,Mz.ACTIVITY,(function(){return(0,r.jsx)(GY,{})})),wz)
;const Bz=function(){var e=(0,RF.Z)();o.useEffect((function(){qH(M.Z5c.PARENT_TOOLS);(0,uV.e)("parent-tools");Ie.default.track(M.rMx.PARENT_TOOLS_VIEWED,{is_considered_adult:e})}),[]);var t=(0,dE.ZP)([st.Z],(function(){return st.Z.theme})),n=kz(o.useState(Mz.ACTIVITY),2),i=n[0],a=n[1],s=(0,q.Dt)(),l=(0,q.Dt)(),u=Gz[i];return(0,r.jsxs)("main",{className:Zz().container,"aria-label":Q.Z.Messages.FAMILY_CENTER_TITLE,children:[(0,r.jsx)(Am.yY,{location:Q.Z.Messages.FAMILY_CENTER_TITLE}),(0,r.jsxs)(kb.ZP,{className:(0,pV.Q)(t),scrollable:no.tq,role:"navigation","aria-labelledby":s,children:[(0,r.jsx)(kb.ZP.Icon,{icon:jF.Z,"aria-hidden":!0}),(0,r.jsx)(kb.ZP.Title,{id:s,children:Q.Z.Messages.FAMILY_CENTER_TITLE}),(0,r.jsx)(kb.ZP.Divider,{}),(0,r.jsxs)(c.njP,{"aria-label":Q.Z.Messages.FAMILY_CENTER_TITLE,selectedItem:i,type:"top-pill",onItemSelect:function(e){a(e)},className:Zz().tabBar,children:[(0,r.jsx)(c.njP.Item,{id:Mz.ACTIVITY,className:Zz().item,
children:Q.Z.Messages.FAMILY_CENTER_ACTIVITY_TAB}),(0,r.jsx)(c.njP.Item,{id:Mz.REQUESTS,className:Zz().item,children:Q.Z.Messages.FAMILY_CENTER_REQUESTS_TAB})]})]}),(0,r.jsx)(c.njP.Panel,{id:i,"aria-labelledby":l,className:Zz().contentPanel,children:(0,r.jsx)("div",{className:Zz().content,children:u()})})]})};var Hz=n(299192);function Vz(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}var Fz=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++
;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};const Yz=function(){return(e=function(){var e;return Fz(this,(function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,cs.Z.get(M.ANM.FRIEND_SUGGESTIONS)];case 1:e=t.sent();O.Z.dispatch({type:"LOAD_FRIEND_SUGGESTIONS_SUCCESS",suggestions:e.body});return[3,3];case 2:t.sent();O.Z.dispatch({type:"LOAD_FRIEND_SUGGESTIONS_FAILURE"});return[3,3];case 3:return[2]}}))},function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){
Vz(i,r,o,a,s,"next",e)}function s(e){Vz(i,r,o,a,s,"throw",e)}a(void 0)}))})();var e},zz=function(e){cs.Z.delete(M.ANM.FRIEND_SUGGESTION(e))};function Wz(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Kz(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qz(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Xz(e){Xz=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Xz(e)}function Qz(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function $z(e,t){return!t||"object"!==tW(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Jz(e,t){Jz=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Jz(e,t)}function eW(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Wz(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n)
;if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wz(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var tW=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function nW(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Xz(e);if(t){var o=Xz(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return $z(this,n)}}var rW={},oW=0,iW=!1,aW=!1;function sW(e){var t;return{key:e.suggested_user.id,name:null===(t=Wa().first(e.reasons))||void 0===t?void 0:t.name,user:new UC.Z(e.suggested_user)}}var cW=function(e){
!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Jz(e,t)}(n,e);var t=nW(n);function n(){Kz(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(Y.default)};r.getSuggestionCount=function(){return oW};r.getSuggestions=function(){return Object.entries(rW).map((function(e){var t=eW(e,2);t[0];return t[1]}))};r.getSuggestion=function(e){return rW[e]};r.__getLocalVars=function(){return{suggestions:rW,suggestionCount:oW,fetching:iW,shouldFetch:aW}};return n}(s.ZP.Store);cW.displayName="FriendSuggestionStore";const lW=new cW(O.Z,{CONNECTION_OPEN:function(e){rW={};if((oW=e.friendSuggestionCount)>0){aW=!0;!function(){if(!iW&&aW){iW=!0;aW=!1;Yz()}}()}},FRIEND_SUGGESTION_CREATE:function(e){var t=sW(e.suggestion);if(null!=rW[t.key])return!1;oW++;rW=Qz(function(e){
for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){qz(e,t,n[t])}))}return e}({},rW),qz({},t.key,t))},FRIEND_SUGGESTION_DELETE:function(e){oW=Math.max(0,--oW);delete rW[e.suggestedUserId]},LOAD_FRIEND_SUGGESTIONS_SUCCESS:function(e){iW=!1;rW=Wa().chain(e.suggestions).map(sW).keyBy((function(e){return e.key})).value();oW=Wa().keys(rW).length},LOAD_FRIEND_SUGGESTIONS_FAILURE:function(){iW=!1;rW={}}});var uW=n(76107),fW=n(213276),dW=n(546274),pW=n(399370),hW=n(773165),EW=n.n(hW);function yW(e){var t=e.className,n=e.markAsDismissed;return(0,r.jsxs)(pW.Z,{className:lh()(EW().card,t),children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",className:EW().header,children:Q.Z.Messages.NOW_PLAYING_GDPR_HEADER}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",
children:Q.Z.Messages.NOW_PLAYING_GDPR_BODY.format({onPrivacyClick:function(){return h.Z.open(M.oAB.PRIVACY_AND_SAFETY)}})}),(0,r.jsxs)("div",{className:EW().buttonContainer,children:[(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,onClick:function(){return(0,dW.g)([M.pjP.PERSONALIZATION],[])},children:Q.Z.Messages.ACTIVITY_FEED_CARD_GDPR_BUTTON_YES}),(0,r.jsx)(c.zxk,{color:c.zxk.Colors.PRIMARY,size:c.zxk.Sizes.SMALL,onClick:function(){return n(hn.L.DISMISS)},look:c.zxk.Looks.LINK,children:Q.Z.Messages.NO_THANKS})]})]})}var mW=n(31914),bW=n(758635),gW=n(120819),OW=n(322422),vW=n(71854),_W=n(542517),IW=n(113666),SW=n(503370),TW=n(625620),NW=n(983586);function AW(e){var t,n,i=e.activity,a=(null!==(t=(0,NW.rq)(i))&&void 0!==t?t:{}).channelId,s=(0,dE.ZP)([eD.Z],(function(){return eD.Z.getStageInstanceByChannel(a)}),[a]),l=o.useRef(null),u=o.useCallback((function(){var e=S.Z.getChannel(a);null!=e&&c_.Cq(e)
}),[a]),f=null!==(n=null==s?void 0:s.topic)&&void 0!==n?n:i.name,d=Q.Z.Messages.STAGE_CHANNEL_ACTIVITY_FEED_JOIN.format({channel:f});return(0,r.jsx)("div",{ref:l,children:(0,r.jsx)(c.P3F,{onClick:u,focusProps:{ringTarget:l},children:(0,r.jsx)(c.X6q,{variant:"heading-sm/semibold",children:d})})})}var CW=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);this.body=AW}var t=e.prototype;t.shouldShow=function(e){return(0,NW.JE)(e)};t.createHeader=function(e){return{subtitle:Q.Z.Messages.STAGE_CHANNEL_ACTIVITY_FEED_DEFAULT,icon:null}};return e}(),PW=n(79462),jW=n(168491),RW=n.n(jW);var xW=function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},PW.gD,new CW);function MW(e){var t,n=e.application_id;if(null!=n){var r=xW[n];return null!=r&&!1!==(null===(t=r.shouldShow)||void 0===t?void 0:t.call(r,e))?r.createHeader(e):void 0}}function wW(e){
var t,n=e.application_id;if(null!=n){var o=xW[n];if(null!=(null==o?void 0:o.body)&&!1!==(null===(t=o.shouldShow)||void 0===t?void 0:t.call(o,e))){var i=o.body;return(0,r.jsx)("section",{className:RW().section,children:(0,r.jsx)(i,{activity:e})},"delegate-".concat(n))}}}var DW=n(402008),ZW=n(995688),LW=n(809118),UW=n(776477),kW=n(22176);function GW(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function BW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HW(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1;r.configurable=!0;"value"in r&&(r.writable=!0);Object.defineProperty(e,r.key,r)}}function VW(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function FW(e){FW=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return FW(e)}function YW(e){
for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){VW(e,t,n[t])}))}return e}function zW(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function WW(e,t){return!t||"object"!==XW(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function KW(e,t){
KW=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return KW(e,t)}function qW(e){return function(e){if(Array.isArray(e))return GW(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return GW(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return GW(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var XW=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function QW(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=FW(e);if(t){var o=FW(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return WW(this,n)}}var $W="party-",JW="channel-",eK="user-",tK=!1,nK=!1,rK=[],oK=[],iK={},aK={},sK=new Set,cK=new Set;function lK(){var e=Ja.Z.getFriendIDs();return mW.Z.hasConsented(M.pjP.PERSONALIZATION)?new Set(qW(es.Z.getUserAffinitiesUserIds()).concat(qW(e))):new Set(e)}function uK(e){return $a.Z.findActivity(e,(function(e){return e.type!==M.IIU.CUSTOM_STATUS}))}function fK(e){null==iK[e]&&(iK=zW(YW({},iK),VW({},e,new LW.Z({name:e}))));return iK[e]}function dK(e){null==aK[e]&&(aK=zW(YW({},aK),VW({},e,new ZW.Z({url:e}))));return aK[e]}function pK(e){cK.has(e)||sK.add(e)}function hK(e){if((0,_W.Z)(e))return DW.r9;var t=null!=e.application_id?Rn.Z.getGame(e.application_id):null;if(null!=t)return t;if((0,
IW.Z)(e))return fK(e.name);if((0,SW.Z)(e)&&null!=e.url)return dK(e.url);null!=e.application_id&&pK(e.application_id);return t}function EK(e){var t=j.Z.getVoiceStateForUser(e);return null!=(null==t?void 0:t.channelId)&&dn.Z.canWithPartialContext(M.Plq.VIEW_CHANNEL,{channelId:t.channelId})?t.channelId:null}function yK(e,t){return Wa()(e).orderBy([t,function(e){return e.game.name}],["desc","asc"])}function mK(e){return Ja.Z.isFriend(e.id)}function bK(e,t,n){var r,o=Y.default.getCurrentUser(),i=t.map((function(e){return e.id})),a=t.filter((function(t){return e.has(t.id)})),s=!1,c=[],l=new Set,u=!1,f=[],d=!0,p=!1,h=void 0;try{for(var E,y=function(){var e,n,r=E.value,i=Pr.Z.getAnyStreamForUser(r.id),a=uK(r.id);null!=i&&f.push({stream:i,streamUser:r,activity:a});if(null==a)return"continue";var d=(0,gW.a)();if((0,vW.Z)(a)&&(0,OW.ZP)({userId:r.id,activity:a,application:void 0,channelId:null===(e=j.Z.getVoiceStateForUser(r.id))||void 0===e?void 0:e.channelId,currentUser:o,
isActivitiesEnabledForCurrentPlatform:d,ChannelStore:S.Z,VoiceStateStore:j.Z,PermissionStore:dn.Z,GuildStore:Zt.Z})!==OW.Fw.CAN_JOIN)return"continue";var p=null===(n=a.timestamps)||void 0===n?void 0:n.start;if(null==p&&!(0,vW.Z)(a))return"continue";var h=(0,TW.Z)(a);if(null==h)return"continue";u=h===DW.XB;if(!function(e){var t,n=e.application_id;if(null==n)return!0;var r=xW[n];return null==r||!1!==(null===(t=r.shouldShow)||void 0===t?void 0:t.call(r,e))}(a))return"continue";var y=function(e){var t=Rn.Z.getGame(e);if(null!=t)return t;if("string"!=typeof e){kW.Z.captureMessage("Unknown type for applicationId: ".concat(void 0===e?"undefined":XW(e),", value: ").concat(e),{tags:{source:"ACTIVITIES"}});return null}if(e===DW.XB)return DW.r9;if(e.startsWith(LW.H))return fK(e.slice(LW.H.length));if(e.startsWith(ZW._))return dK(e.slice(ZW._.length));pK(e);return null}(h);if(null==y||l.has(y.id))return"continue";var m=null!=a?hK(a):null;null!=m&&m.id===y.id||(a=null);var b=[]
;if(null!=a&&null!=a.party&&null!=a.party.id){var g,O=null!==(g=UW.Z.getParty(a.party.id))&&void 0!==g?g:[];b=Array.from(O).reduce((function(e,t){var n=Y.default.getUser(t);null!=n&&e.push(n);return e}),[])}else b=t.filter((function(e){var t=uK(e.id),n=null!=t?hK(t):null;return null!=n&&n.id===y.id}));(b=Wa().orderBy(b,[mK],["desc"])).length!==t.length&&(s=!0);l.add(y.id);c.push({game:y,activity:a,activityUser:r,startedPlayingTime:p,playingMembers:b})},m=t[Symbol.iterator]();!(d=(E=m.next()).done);d=!0)y()}catch(e){p=!0;h=e}finally{try{d||null==m.return||m.return()}finally{if(p)throw h}}var b,g=1===a.length,O=[],v=new Set,_=new Set,I=!0,T=!1,N=void 0;try{for(var A,C=t[Symbol.iterator]();!(I=(A=C.next()).done);I=!0){var P=EK(A.value.id),R=S.Z.getChannel(P),x=null!=R?R.getGuildId():null,M=Zt.Z.getGuild(x);if(_.has(x)&&v.has(P)||null==R||null==M||R.id===M.afkChannelId){if(null==R){r=null;g=!0}}else{var w=Wa()(j.Z.getVoiceStatesForChannel(R.id)).map((function(e){var t=e.userId
;return Y.default.getUser(t)})).filter(_o.lm).orderBy([mK],["desc"]).value();w.filter((function(e){return!i.includes(e.id)})).forEach((function(e){return t.push(e)}));if(g)_.has(x)||(r=null);else{r=M;g=!0}_.add(x);v.add(P);O.push({channel:R,guild:M,members:w})}}}catch(e){T=!0;N=e}finally{try{I||null==C.return||C.return()}finally{if(T)throw N}}return{id:n,voiceChannels:O,isSpotifyActivity:u,priorityMembers:a.map((function(e){return{user:e,status:$a.Z.getStatus(e.id)}})),partiedMembers:t,showPlayingMembers:s,guildContext:r,currentActivities:yK(c,(function(e){return null!==(b=e.startedPlayingTime)&&void 0!==b?b:0})).value(),applicationStreams:f}}function gK(){return tK&&my.Z.isConnected()}function OK(){if(!gK())return!1;sK.clear();var e,t,n,r=function(e){return Wa()(e).groupBy((function(e){var t,n=EK(e.id),r=uK(e.id);return null!=n?"".concat(JW,"-").concat(n):null!=(null==r||null===(t=r.party)||void 0===t?void 0:t.id)?"".concat($W,"-").concat(r.party.id):"".concat(eK,"-").concat(e.id)}))
}(Array.from(lK()).reduce((function(e,t){var n=Y.default.getUser(t);null==n||n.bot||e.push(n);return e}),[])),o=(e=r,t=lK(),n=bK.bind(null,t),Wa()(e).mapValues(n)),i=o.values().orderBy([function(e){return e.partiedMembers.length>1},function(e){return e.applicationStreams.length>0},function(e){return e.voiceChannels.length>0},function(e){return e.currentActivities.length>0},function(e){return e.isSpotifyActivity},function(e){return e.priorityMembers.map((function(e){return e.user.username.toLowerCase()})).join(" ")}],["desc","desc","desc","desc","asc","asc"]).value();rK=function(e){return e.filter((function(e){return e.voiceChannels.length>=1||e.currentActivities.length>0||e.applicationStreams.length>0}))}(i);oK=function(e){return e.map((function(e){return{type:M.GOo.USER,party:e}}))}(rK);!function(){if(sK.size>0){var e=Array.from(sK);Pn.Z.fetchApplications(e);e.forEach((function(e){return cK.add(e)}));sK.clear()}}();nK=!0}var vK=Wa().throttle((function(){OK();SK.emitChange()}),1e3)
;function _K(){if(!gK())return!1;vK();return!1}var IK=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&KW(e,t)}(n,e);var t=QW(n);function n(){BW(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.syncWith([Y.default,Rn.Z,$a.Z,UW.Z,j.Z,Pr.Z,Ja.Z,mW.Z,es.Z],_K);this.waitFor(my.Z,Zt.Z,Rn.Z,Y.default,es.Z)};r.__getLocalVars=function(){return{PARTY_ID_START_PARTY:$W,PARTY_ID_START_CHANNEL:JW,PARTY_ID_START_USER:eK,RECOMPUTE_NOW_PLAYING_THROTTLE:1e3,isMounted:tK,loaded:nK,currentActivityParties:rK,nowPlayingCards:oK,xboxGames:iK,twitchRecords:aK,applicationIdsToFetch:sK,applicationIdsFetched:cK,throttledRecomputeNowPlaying:vK,instance:SK}};!function(e,t,n){t&&HW(e.prototype,t);n&&HW(e,n)}(n,[{key:"currentActivityParties",get:function(){return rK}},{key:"nowPlayingCards",
get:function(){return oK}},{key:"isMounted",get:function(){return tK}},{key:"loaded",get:function(){return nK}}]);return n}(s.ZP.Store);IK.displayName="NowPlayingViewStore";var SK=new IK(O.Z,{LOGOUT:function(){tK=!1;rK=[];oK=[];sK.clear()},NOW_PLAYING_MOUNTED:function(){tK=!0;vK()},NOW_PLAYING_UNMOUNTED:function(){tK=!1}});const TK=SK;var NK=n(83797),AK=n(934870),CK=n(429041),PK=n(579581),jK=n(265688),RK=n(61040),xK=n(101604),MK=n(712776),wK=n(983073),DK=n(483535),ZK=n(767484),LK=n(993137),UK=n(641277),kK=n(686910),GK=n(247729),BK=n(129010),HK=n(753724),VK=n(796938),FK=n(977005),YK=n(399098);function zK(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function WK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KK(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function qK(e){qK=Object.setPrototypeOf?Object.getPrototypeOf:function(e){
return e.__proto__||Object.getPrototypeOf(e)};return qK(e)}function XK(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){KK(e,t,n[t])}))}return e}function QK(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function $K(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r]
;t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function JK(e,t){return!t||"object"!==nq(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function eq(e,t){eq=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return eq(e,t)}function tq(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return zK(e,t)
;var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zK(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var nq=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function rq(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=qK(e);if(t){var o=qK(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return JK(this,n)}}
var oq,iq=64,aq=160,sq=[14,14,12,12,10,8,6],cq=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return(0,r.jsx)(c.xvT,{className:lh()(RW().textContent,t),variant:"text-sm/semibold",children:e})},lq=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return(0,r.jsx)(c.xvT,{className:lh()(RW().textContent,t),variant:"text-xs/normal",children:e})},uq=(0,CK.Z)((function(e){var t=e.message;return(0,r.jsx)("div",{className:RW().timestamp,children:t})})),fq=function(e){var t=e.children;return(0,r.jsx)("section",{className:RW().section,children:t})},dq=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&eq(e,t)}(o,e);var t=rq(o);function o(){WK(this,o);return t.apply(this,arguments)}var i=o.prototype;i.renderTimePlayed=function(){
var e,t=this.props.activity,n=t.timestamps;if(null==n||!(0,MK.Z)(t)||(0,_W.Z)(t))return null;e=(0,NK.Z)(t)?(0,r.jsx)(uq,{timestamps:n}):(0,r.jsx)(kK.ZP,{start:n.start,end:n.end,location:kK.ZP.Locations.USER_ACTIVITY,className:RW().playTime});return lq(e)};i.render=function(){var e,t,o=this.props,i=o.activity,a=i.assets,s=i.details,c=i.state,l=i.application_id,u=o.getAssetImage;return(0,r.jsx)(fq,{children:(0,r.jsxs)("div",{className:RW().activitySection,children:[null!=a&&0!==Object.keys(a).length?(0,r.jsxs)("div",{className:RW().activitySectionAssets,children:[(0,r.jsx)("img",{alt:null!==(e=a.large_text)&&void 0!==e?e:"",src:u(l,a.large_image,[aq,aq]),className:lh()(RW().largeImage,KK({},RW().largeImageMask,null!=a.small_image))}),null!=a.small_image?(0,r.jsx)("img",{alt:null!==(t=a.small_text)&&void 0!==t?t:"",src:u(l,a.small_image,[iq,iq]),className:RW().smallImage}):null]}):(0,r.jsx)("div",{className:RW().activitySectionAssets,children:(0,r.jsx)("img",{alt:"",src:n(534413),
className:RW().largeImage})}),(0,r.jsxs)("div",{children:[cq(null!=s&&""!==s?s:Q.Z.Messages.USER_ACTIVITY_HEADER_PLAYING),null!=c?lq(c):null,this.renderTimePlayed()]})]})})};return o}(o.Component),pq=TE()({XBOX:null,SPOTIFY:null,MULTIPLE:null}),hq=function(e){var t,n=e.src,o=e.onClick,i=e.onContextMenu;switch(n){case pq.XBOX:t=(0,r.jsx)(HK.Z,{className:RW().headerIcon,color:$b.Z.unsafe_rawColors.PRIMARY_300.css});break;case pq.SPOTIFY:t=(0,r.jsx)(BK.Z,{className:RW().headerIcon,color:$b.Z.unsafe_rawColors.SPOTIFY.css});break;case pq.MULTIPLE:t=(0,r.jsx)("div",{className:RW().multipleIconWrapper,children:(0,r.jsx)(GK.Z,{className:lh()(RW().headerIcon,RW().multipleIcon),color:$b.Z.unsafe_rawColors.PRIMARY_300.css})});break;default:t=(0,r.jsx)("img",{src:null!=n?n:void 0,alt:"",className:RW().headerIcon})}return null!=o||null!=i?(0,r.jsx)(c.P3F,{onClick:o,className:lh()(null!=o?RW().clickableIcon:""),onContextMenu:i,children:t}):t};hq.Src=pq;var Eq=function(e){
var t=e.priorityUser,n=e.title,o=e.subtitle,i=e.icon,a=e.onContextMenu,s=e.guildId;return(0,r.jsxs)("header",{className:null!=i?RW().headerFull:RW().headerSimple,children:[(0,r.jsx)(c.qEK,{src:t.user.getAvatarURL(s,32),"aria-label":t.user.username,size:c.EFr.SIZE_32,className:RW().headerAvatar,status:t.status,onContextMenu:a}),(0,r.jsxs)("div",{className:RW().headerDetails,children:[(0,r.jsx)(c.xvT,{className:lh()(RW().textContent),variant:"text-md/semibold",children:n}),(0,r.jsx)(c.xvT,{color:"header-secondary",className:RW().textContent,variant:"text-sm/normal",children:o})]}),null!=i?i:null]})};Eq.Icon=hq;var yq=function(e){var t=e.children,n=e.className,o=$K(e,["children","className"]);return(0,r.jsx)(c.tEY,{children:(0,r.jsx)(pW.Z,QK(XK({className:lh()(n,RW().wrapper),padded:!0},o),{children:t}))})};yq.Header=Eq;yq.Body=function(e){var t=e.children;return(0,r.jsx)(pW.Z,{inset:!0,padded:!1,className:RW().body,children:t})};yq.Separator=function(e){var t=e.inset,n=e.className
;return(0,r.jsx)("div",{className:lh()(RW().separator,KK({},RW().inset,t),n)})};yq.VoiceSection=function(e){var t,n,i=e.guild,a=e.channel,s=e.onGuildClick,l=e.partySize,u=e.members,f=e.onChannelContextMenu,d=o.useRef(null),p=(0,op.ZP)(a,!0);return(0,r.jsx)(fq,{children:(0,r.jsxs)("div",{className:RW().voiceSection,ref:d,onContextMenu:function(e){return f(e,a)},children:[(0,r.jsx)(c.P3F,{onClick:s,"aria-hidden":!0,tabIndex:-1,children:(0,r.jsxs)("div",{className:RW().voiceSectionAssets,children:[null!=i.getIconURL(32)?(0,r.jsx)("img",{alt:"",src:null!==(t=i.getIconURL(32))&&void 0!==t?t:void 0,className:lh()(RW().voiceSectionGuildImage,RW().largeImageMask)}):(0,r.jsx)("div",{className:RW().voiceSectionNoGuildImageWrapper,children:(0,r.jsx)("div",{className:RW().voiceSectionNoGuildImage,style:{fontSize:null!==(n=sq[i.acronym.length])&&void 0!==n?n:sq[sq.length-1]},children:i.acronym})}),(0,r.jsx)("div",{className:RW().voiceSectionIconWrapper,children:(0,r.jsx)(VK.Z,{
className:RW().voiceSectionIcon})})]})}),(0,r.jsx)(c.P3F,{onClick:s,focusProps:{ringTarget:d},children:(0,r.jsxs)("div",{className:RW().voiceSectionDetails,children:[cq(i.toString(),RW().voiceSectionText),lq(p,RW().voiceSectionText)]})}),(0,r.jsx)(YK.Z,{partySize:l,members:u,guildId:i.id})]})})};yq.GameSection=function(e){var t=e.icon,n=e.name,o=e.partySize,i=e.members;return(0,r.jsx)(fq,{children:(0,r.jsxs)("div",{className:RW().gameSection,children:[null!=t?(0,r.jsx)("img",{alt:"",src:t,className:RW().gameSectionIcon}):null,(0,r.jsxs)("div",{children:[cq(n),lq(Q.Z.Messages.ACTIVITY_FEED_SINGLE_MEMBER_LIST_HEADER.format({memberCount:o.totalSize}))]}),(0,r.jsx)(YK.Z,{partySize:o,members:i})]})})};yq.RichPresenceSection=dq;yq.XboxSection=function(e){var t=e.title;return(0,r.jsx)(fq,{children:(0,r.jsxs)("div",{className:RW().xboxSection,children:[(0,r.jsx)(HK.Z,{className:RW().xboxSectionIcon}),(0,r.jsxs)("div",{className:RW().xboxSectionDetails,
children:[cq(t),lq(Q.Z.Messages.GAME_FEED_ACTIVITY_PLAYING_XBOX)]})]})})};yq.SpotifySection=function(e){var t=e.activity,n=t.assets,o=t.details,i=t.state,a=t.application_id,s=e.partySize,c=e.members,l=e.isSolo,u=e.getAssetImage;return(0,r.jsx)(fq,{children:(0,r.jsxs)("div",{className:RW().spotifySection,children:[null!=n?(0,r.jsxs)("div",{className:RW().activitySectionAssets,children:[(0,r.jsx)("img",{alt:null!==(oq=n.large_text)&&void 0!==oq?oq:"",src:u(a,n.large_image,[aq,aq]),className:lh()(RW().largeImage,RW().borderRadius0,KK({},RW().largeImageMask,null!=n.small_image))}),l?null:(0,r.jsx)(BK.Z,{className:RW().smallImage,color:$b.Z.unsafe_rawColors.SPOTIFY.css})]}):(0,r.jsx)("div",{}),(0,r.jsxs)("div",{children:[null!=o?cq(o):null,null!=i?lq(i):null]}),(0,r.jsx)(YK.Z,{minAvatarsShown:l?2:1,partySize:s,members:c})]})})};yq.TwitchSection=function(e){var t,o,i=e.activity,a=e.user,s=e.getAssetImage,l=e.guildId,u=i.name,f=i.details,d=i.assets,p=i.application_id;if(null!=d&&(0,SW.Z)(i)){
var h;t=(0,r.jsx)(LK.Z,{className:RW().twitchSectionPreviewWrapper,aspectRatio:16/9,children:(0,r.jsxs)(c.P3F,{href:(0,xK.Z)(i),tag:"a",target:"_blank",children:[(0,r.jsx)("img",{alt:null!==(h=d.large_text)&&void 0!==h?h:"",src:s(p,d.large_image,[900,500]),className:RW().twitchSectionPreview}),(0,r.jsx)("img",{src:n(182105),className:RW().twitchSectionPlayButton,alt:""})]})})}return(0,r.jsxs)(fq,{children:[(0,r.jsxs)("div",{className:lh()((o={},KK(o,RW().twitchSectionSimple,null==a),KK(o,RW().twitchSectionFull,null!=a),o)),children:[(0,r.jsx)("img",{alt:"",src:jK.Z.get(M.ABu.TWITCH).icon.lightSVG,className:RW().twitchSectionIcon}),(0,r.jsxs)("div",{children:[cq(u),null!=f?lq(f):null]}),null!=a?(0,r.jsx)(c.qEK,{src:a.getAvatarURL(l,24),"aria-label":a.username,className:RW().twitchSectionAvatar,size:c.EFr.SIZE_24}):null]}),t]})};yq.ApplicationStreamingSection=function(e){var t,n=e.activity,o=e.user,i=e.applicationStream,a=e.onPreviewClick,l=e.guildId,u=(0,s.e7)([S.Z],(function(){
return S.Z.getChannel(i.channelId)})),f=tq((0,Rr.wq)(u),2),d=f[0],p=f[1],h=(0,r.jsx)(LK.Z,{className:RW().applicationStreamingPreviewWrapper,aspectRatio:16/9,children:(0,r.jsxs)(c.P3F,{onClick:d?a:void 0,className:RW().applicationStreamingPreviewSize,children:[(0,r.jsx)(Xv.Z,{stream:i,className:RW().applicationStreamingPreviewSize}),(0,r.jsx)("div",{className:RW().applicationStreamingHoverWrapper,children:(0,r.jsx)("div",{className:RW().applicationStreamingHoverText,children:(0,Rr.P9)(p)})})]})}),E=null!==(t=(0,wK.Z)(n,i))&&void 0!==t?t:Q.Z.Messages.SHARING_SCREEN;return(0,r.jsxs)(fq,{children:[(0,r.jsxs)("div",{className:RW().applicationStreamingSection,children:[(0,r.jsx)(c.qEK,{size:c.EFr.SIZE_32,src:o.getAvatarURL(l,32),"aria-label":o.username,className:RW().applicationStreamingAvatar}),(0,r.jsxs)("div",{children:[cq(lp.ZP.getName(o)),lq(E)]}),(0,r.jsx)(FK.ZP,{size:FK.ZP.Sizes.SMALL})]}),h]})};yq.EmbeddedActivitySection=function(e){
var t=e.activity,n=e.channel,i=e.guildId,a=e.participants,l=(0,DK.Z)(),u=tq(o.useState(null),2),f=u[0],d=u[1];o.useEffect((function(){null!=t.application_id&&(0,bc.GR)(t.application_id,["embedded_background"]).then((function(e){var t=tq(e,1)[0];return d(t)}))}),[t.application_id]);var p,h=(0,s.Wu)([Y.default,Jn.default],(function(){return Array.from(a).map((function(e){return Jn.default.getId()===e?null:Y.default.getUser(e)})).filter(_o.lm)})),E=(0,PK.O)(),y=(0,Hw.Z)().analyticsLocations,m=Rn.Z.getGame(null!==(p=null==t?void 0:t.application_id)&&void 0!==p?p:"");if(null==m)return null;var b=null!=t.created_at&&t.created_at>0?{start:t.created_at}:void 0,O=(0,bc.xF)(m.id,f,300);return(0,r.jsxs)(fq,{children:[(0,r.jsxs)("div",{className:RW().embeddedActivityTopRow,children:[(0,r.jsx)(UK.Z,{game:m,size:UK.Z.Sizes.XSMALL,className:RW().embeddedActivityIcon}),(0,r.jsx)("div",{className:RW().embeddedActivityName,children:(0,r.jsx)(c.xvT,{variant:"text-sm/semibold",children:m.name})
}),null!=b?(0,r.jsx)("div",{className:RW().embeddedActivityTimeElapsed,children:(0,r.jsx)(c.xvT,{color:"text-muted",variant:"text-sm/normal",children:(0,r.jsx)(uq,{timestamps:b})})}):null]}),(0,r.jsx)(LK.Z,{aspectRatio:16/9,children:(0,r.jsxs)("div",{className:RW().embeddedActivityPlayerContainer,children:[null!=O?(0,r.jsx)("img",{src:O,alt:m.name,className:RW().embeddedActivityImage}):null,(0,r.jsxs)("div",{className:RW().embeddedActivityImageOverlay,children:[(0,r.jsx)(ZK.OV,{users:h,guildId:i,channelId:n.id}),(0,r.jsx)("div",{className:RW().embeddedActivityJoinWrapper,children:(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,onClick:function(e){e.stopPropagation();(0,RK.Z)({activity:t,currentEmbeddedApplication:l,activityChannelId:n.id,locationObject:E.location,embeddedActivitiesManager:g.Z,analyticsLocations:y})},children:Q.Z.Messages.JOIN})})]})]})})]})};const mq=yq;var bq=64;function gq(e,t){var n,r=e.length,o=0;if(null!=t&&null!=t.party&&null!=t.party.size&&t.party.size.length>=2){
var i=t.party.size;o=Math.max(i[0]-e.length,0);n=i[1]}else n=r+o;return{knownSize:r,unknownSize:o,totalSize:n}}function Oq(e){var t=e.party,n=e.onChannelContextMenu,o=t.voiceChannels,i=t.currentActivities,a=t.partiedMembers,s=t.applicationStreams,c=t.guildContext,l=[],u=function(e){var t=l.length;if(0!==t){var n,o,i=l[t-1],a="".concat(null!==(n=null==e?void 0:e.key)&&void 0!==n?n:""),s="".concat(null!==(o=null==i?void 0:i.key)&&void 0!==o?o:"").startsWith("game")&&a.startsWith("rich-presence");l.push((0,r.jsx)(mq.Separator,{inset:s},"sep-".concat(a)));l.push(e)}else l.push(e)};o.length>0&&o.forEach((function(e){var t=e.members,o=e.channel,i=e.guild;u((0,r.jsx)(mq.VoiceSection,{guild:i,channel:o,members:t,partySize:gq(t),onChannelContextMenu:n,onGuildClick:function(){(0,AK.X)(i.id)}},"voice-".concat(o.id)))}));var f=!0,p=!1,h=void 0;try{for(var E,y=t.currentActivities[Symbol.iterator]();!(f=(E=y.next()).done);f=!0){var m=E.value.activity;if(null!=m){var b=wW(m);if(null!=b){u(b);break}}}
}catch(e){p=!0;h=e}finally{try{f||null==y.return||y.return()}finally{if(p)throw h}}s.length>0&&s.forEach((function(e){var t=e.stream,n=e.streamUser,o=e.activity;u((0,r.jsx)(mq.ApplicationStreamingSection,{guildId:null==c?void 0:c.id,user:n,activity:o,applicationStream:t,onPreviewClick:function(){d.default.selectVoiceChannel(t.channelId);(0,Tr.iV)(t)}},"application-stream-".concat(t.ownerId)))}));i.forEach((function(e,t){var n=e.activity,s=e.game,l=e.playingMembers,f=e.activityUser;if(null==n||null==n.type)return null;if(i.length>1&&n.type===M.IIU.PLAYING&&!(0,NK.Z)(n)&&null!=s){var d,p;u((0,r.jsx)(mq.GameSection,{icon:s.getIconURL(bq),name:s.name,partySize:{knownSize:l.length,unknownSize:0,totalSize:l.length},members:l},"game-".concat(null!==(d=n.session_id)&&void 0!==d?d:t,"-").concat(null!==(p=n.application_id)&&void 0!==p?p:t)))}else if((0,vW.Z)(n)){var h,E=new Set(l.map((function(e){return e.id}))),y=null===(h=o.find((function(e){return null!=e})))||void 0===h?void 0:h.channel
;null!=y&&u((0,r.jsx)(mq.EmbeddedActivitySection,{activity:n,participants:E,channel:y,guildId:y.guild_id},"embedded-activity-".concat(n.application_id)))}else if(null==n.assets&&!(0,NK.Z)(n)||n.type!==M.IIU.PLAYING)if((0,SW.Z)(n)){var m,b=o.length>0&&o[0].members.length>1,g=l.length>1;u((0,r.jsx)(mq.TwitchSection,{guildId:null==c?void 0:c.id,activity:n,user:b||g?f:null,getAssetImage:bc.xF},"streaming-".concat(null!==(m=n.session_id)&&void 0!==m?m:t)))}else if((0,_W.Z)(n)){var O;u((0,r.jsx)(mq.SpotifySection,{activity:n,isSolo:1===a.length,partySize:{knownSize:l.length,unknownSize:0,totalSize:l.length},getAssetImage:bc.xF,members:l},"spotify-".concat(null!==(O=n.session_id)&&void 0!==O?O:t,"-").concat(f.id)))}else if(null==n.assets&&!(0,NK.Z)(n)||n.type!==M.IIU.LISTENING){if((0,IW.Z)(n)){var v;u((0,r.jsx)(mq.XboxSection,{title:s.name},"xbox-".concat(null!==(v=n.session_id)&&void 0!==v?v:t)))}}else{var _;u((0,r.jsx)(mq.RichPresenceSection,{activity:n,getAssetImage:bc.xF
},"rich-presence-".concat(null!==(_=n.session_id)&&void 0!==_?_:t,"-").concat(f.id)))}else{var I;u((0,r.jsx)(mq.RichPresenceSection,{activity:n,getAssetImage:bc.xF},"rich-presence-".concat(null!==(I=n.session_id)&&void 0!==I?I:t,"-").concat(f.id)))}}));return l.length>0?(0,r.jsx)(mq.Body,{children:l}):null}function vq(e){var t=e.party,o=e.onUserContextMenu,i=t.priorityMembers,a=t.guildContext,s=i[0],c=function(e){var t=e.priorityMembers,n=e.partiedMembers,r=new Set(t.map((function(e){return e.user.id}))),o=n.filter((function(e){return!r.has(e.id)})),i=lp.ZP.getName(t[0].user),a=null!=t[1]?lp.ZP.getName(t[1].user):null!=o[0]?lp.ZP.getName(o[0]):null;switch(n.length){case 1:return i;case 2:return Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_HEADER_TWO_KNOWN_ONLY.format({user1:i,user2:a});default:return Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_HEADER_TWO_KNOWN.format({user1:i,user2:a,extras:n.length-2})}}(t),l=function(e){
var t,o=e.priorityMembers,i=e.partiedMembers,a=e.voiceChannels,s=e.currentActivities,c=o.length,l=c+(i.length-c)===1,u=s[0],f=null==u?void 0:u.activity,d=null==u?void 0:u.startedPlayingTime,p={name:null!==(t=null==f?void 0:f.name)&&void 0!==t?t:""};if((0,vW.Z)(f)&&null!=f)return{subtitle:(0,r.jsx)(kK.ZP,{start:d,location:kK.ZP.Locations.ACTIVITY_FEED_NEW,messageProps:p}),icon:null};if(l&&null!=u){var h=u.game;if(null==f)return{subtitle:null,icon:null};var E=MW(f);if(null!=E)return E;switch(f.type){case M.IIU.PLAYING:return(0,IW.Z)(f)?{subtitle:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_XBOX,icon:(0,r.jsx)(mq.Header.Icon,{src:mq.Header.Icon.Src.XBOX})}:{subtitle:(0,r.jsx)(kK.ZP,{start:d,location:kK.ZP.Locations.ACTIVITY_FEED_NEW,messageProps:p}),icon:null!=h?(0,r.jsx)(mq.Header.Icon,{src:null!=h.getIconURL(bq)?h.getIconURL(bq):n(534413)}):null};case M.IIU.STREAMING:return{subtitle:Q.Z.Messages.ACTIVITY_FEED_NOW_STREAMING_TWITCH,icon:null!=h&&null!=h.getIconURL(bq)?(0,r.jsx)(mq.Header.Icon,{
src:h.getIconURL(bq)}):null};case M.IIU.LISTENING:var y;y=(0,_W.Z)(f)?(0,r.jsx)(mq.Header.Icon,{src:mq.Header.Icon.Src.SPOTIFY}):null!=h.getIconURL(bq)?(0,r.jsx)(mq.Header.Icon,{src:h.getIconURL(bq)}):(0,r.jsx)(mq.Header.Icon,{src:n(534413)});return{subtitle:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_LISTENING.format({name:f.name}),icon:y};case M.IIU.WATCHING:return{subtitle:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_WATCHING,icon:null!=h&&null!=h.getIconURL(bq)?(0,r.jsx)(mq.Header.Icon,{src:h.getIconURL(bq)}):null};default:return{subtitle:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_IN_A_VOICE_CHANNEL,icon:null}}}if(0===s.length){if(a.length>0)return{subtitle:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_IN_A_VOICE_CHANNEL,icon:null};var m=s[0];if(null!=m){var b=m.activity;if(null!=b){var g=MW(b);if(null!=g)return g}if(null!=b&&b.type===M.IIU.LISTENING)return{subtitle:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_SPOTIFY,icon:(0,r.jsx)(mq.Header.Icon,{src:mq.Header.Icon.Src.SPOTIFY})}}}else if(1===s.length){
var O=s.find((function(e){return null!=e.activity}));if(null==O)return{subtitle:null,icon:null};var v=O.activity,_=O.game,I=O.startedPlayingTime;xh()(null!=v,"Activity was null somehow");return{subtitle:(0,r.jsx)(kK.ZP,{start:I,location:kK.ZP.Locations.ACTIVITY_FEED_NEW,messageProps:p}),icon:null!=_&&null!=_.getIconURL(bq)?(0,r.jsx)(mq.Header.Icon,{src:_.getIconURL(bq)}):null}}return{subtitle:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_MULTIPLE_GAMES,icon:(0,r.jsx)(mq.Header.Icon,{src:mq.Header.Icon.Src.MULTIPLE})}}(t),u=l.subtitle,f=l.icon;return(0,r.jsx)(mq.Header,{priorityUser:s,guildId:null==a?void 0:a.id,title:c,subtitle:u,icon:f,onContextMenu:function(e){return o(e,s.user)}})}var _q=n(545580),Iq=n(629223),Sq=n(476020);function Tq(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Nq(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Aq(e){return function(){
var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Nq(i,r,o,a,s,"next",e)}function s(e){Nq(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Cq(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Pq(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Cq(e,t,n[t])}))}return e}function jq(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Rq(e){return function(e){if(Array.isArray(e))return Tq(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Tq(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Tq(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var xq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){
return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Mq=jK.Z.get(M.ABu.XBOX).name;function wq(e,t){var n=e.canJoin,o=e.activity,i=e.activityUser;if(!n||null==o)return null;function a(){return(a=Aq((function(){var e
;return xq(this,(function(t){switch(t.label){case 0:return null==o?[2]:[4,vu.Z.sendActivityInviteUser({type:M.mFx.JOIN_REQUEST,userId:i.id,activity:o,location:M.Sbl.PROFILE_POPOUT})];case 1:null!=(e=t.sent())&&d.default.selectPrivateChannel(e.id);return[2]}}))}))).apply(this,arguments)}return(0,r.jsx)(c.sNh,{id:"join-".concat(o.session_id),label:t?Q.Z.Messages.USER_ACTIVITY_ACTION_ASK_TO_JOIN_USER.format({name:i.toString()}):Q.Z.Messages.USER_ACTIVITY_ACTION_ASK_TO_JOIN,action:function(){return a.apply(this,arguments)}})}function Dq(e,t){var n=e.activity,o=e.game,i=e.libraryApplication,a=e.location,s=e.canPlay,l=e.isRunning,u=e.isLaunching;if(!s||null==n)return null;var f=l?Q.Z.Messages.ACTIVITY_FEED_POPOUT_APPLICATION_RUNNING.format({name:o.name}):u?Q.Z.Messages.ACTIVITY_FEED_POPOUT_APPLICATION_LAUNCHING.format({name:o.name}):void 0;return(0,r.jsx)(c.sNh,{id:"play-".concat(n.session_id),action:function(){(0,nm.playApplication)(o.id,i,{analyticsParams:{location:jq(Pq({},a),{
object:M.qAy.LIST_ITEM})}})},label:t?Q.Z.Messages.APPLICATION_CONTEXT_MENU_LAUNCH_APPLICATION_NAME.format({name:o.name}):Q.Z.Messages.APPLICATION_CONTEXT_MENU_LAUNCH,subtext:f})}function Zq(e){var t=e.currentActivities.length>1,n=function(e){var t=e.currentActivities,n=(0,s.e7)([Iq.Z],(function(){return Iq.Z.getAccounts().some((function(e){return e.type===jK.Z.get(M.ABu.XBOX).type}))})),o=t.some((function(e){var t=e.activity;return(0,IW.Z)(t)}));return n||!o?null:(0,r.jsx)(c.sNh,{id:"xbox-connect",action:function(){return h.Z.open(M.oAB.CONNECTIONS)},label:Q.Z.Messages.USER_ACTIVITY_CONNECT_PLATFORM.format({platform:Mq})})}(e),i=function(e){var t=e.currentActivities,n=o.useContext(Ie.AnalyticsContext);return(0,s.Wu)([ze.ZP,Ln.Z,Wn.Z,qy.Z,Sq.Z],(function(){return t.filter((function(e){return!(0,vW.Z)(e.activity)})).map((function(e){var t=e.activity,r=e.game,o=Ln.Z.getActiveLibraryApplication(r.id);return jq(Pq({},e),{libraryApplication:o,canJoin:null!=t&&(0,
_q.Z)(t,M.xjy.JOIN)&&t.type===M.IIU.PLAYING,canPlay:(0,er.t)({LibraryApplicationStore:Ln.Z,LaunchableGameStore:Wn.Z,DispatchApplicationStore:qy.Z,ConnectedAppsStore:Sq.Z,applicationId:r.id,branchId:null!=o?o.branchId:null}),isLaunching:Wn.Z.launchingGames.has(r.id),isRunning:ze.ZP.getRunningVerifiedApplicationIds().includes(r.id),location:n.location})}))}),[t])}(e),a=[],l=!0,u=!1,f=void 0;try{for(var d,p=i[Symbol.iterator]();!(l=(d=p.next()).done);l=!0){var E=d.value,y=E.activity;null!=y&&null!=y.type&&a.push(wq(E,t),Dq(E,t))}}catch(e){u=!0;f=e}finally{try{l||null==p.return||p.return()}finally{if(u)throw f}}return[n].concat(Rq(a))}var Lq=n(386691),Uq=n.n(Lq);function kq(e){var t=e.user,n=e.status,o=e.isFocused,i=e.guildId;return(0,r.jsxs)("div",{className:Uq().memberItem,children:[(0,r.jsx)(c.qEK,{src:t.getAvatarURL(i,24),className:Uq().avatar,"aria-label":t.username,size:c.EFr.SIZE_24,status:n,statusColor:o?"currentColor":void 0}),(0,r.jsx)(UV.Z,{user:t,hideDiscriminator:!0})]})}
function Gq(e){var t=e.label;return(0,r.jsxs)("div",{className:Uq().memberItem,children:[(0,r.jsx)("div",{className:lh()(Uq().avatar,Uq().unknown)}),(0,r.jsx)("div",{children:t})]})}function Bq(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Hq(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Vq(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Hq(e,t,n[t])}))}return e}function Fq(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e)
;t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Yq(e){return function(e){if(Array.isArray(e))return Bq(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Bq(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bq(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zq(e,t,n,o,i){var a=[],s=!0,l=!1,u=void 0;try{for(var f,d=function(){var e=f.value,t=e.user,n=e.status
;a.push((0,r.jsx)(c.sNh,{id:t.id,keepItemStyles:!0,render:function(e){return(0,r.jsx)(kq,Fq(Vq({},e),{user:t,status:n,guildId:i}))},action:function(){return(0,xp.m)({userId:t.id,analyticsLocation:{section:M.jXE.ACTIVITY_FEED_NOW_PLAYING_CONTEXT_MENU}})}}))},p=e[Symbol.iterator]();!(s=(f=p.next()).done);s=!0)d()}catch(e){l=!0;u=e}finally{try{s||null==p.return||p.return()}finally{if(l)throw u}}var h=!0,E=!1,y=void 0;try{for(var m,b=function(){var e=m.value;a.push((0,r.jsx)(c.sNh,{id:e.id,keepItemStyles:!0,render:function(t){return(0,r.jsx)(kq,Fq(Vq({},t),{user:e,guildId:i}))},action:function(){return(0,xp.m)({userId:e.id,analyticsLocation:{section:M.jXE.ACTIVITY_FEED_NOW_PLAYING_CONTEXT_MENU}})}}))},g=t[Symbol.iterator]();!(h=(m=g.next()).done);h=!0)b()}catch(e){E=!0;y=e}finally{try{h||null==g.return||g.return()}finally{if(E)throw y}}var O=n-a.length;O>0&&a.push((0,r.jsx)(c.sNh,{id:"unknown-members-".concat(null==o?void 0:o.session_id),render:function(e){return(0,r.jsx)(Gq,Fq(Vq({},e),{
label:Q.Z.Messages.GAME_FEED_UNKNOWN_PLAYERS.format({count:O})}))}}));return a}var Wq=n(761953);function Kq(e){return{af_voice_chat:e.voiceChannels.length>0,af_people_count:e.partiedMembers.length,af_rich_presence:e.currentActivities.some((function(e){var t=e.activity;return(0,NK.Z)(t)})),game_platform:e.currentActivities.length>0?(0,Mp.Z)(e.currentActivities[0].activity):null}}function qq(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Xq(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){qq(e,t,n[t])}))}return e}function Qq(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e)
;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var $q=n(73727),Jq=n(557162),eX=n(47038),tX=n(304493),nX=n(979965);function rX(e){var t=e.currentActivities,n=e.isSpotifyActivity,o=t[0],i=function(e,t,n){var o=(0,s.e7)([$q.Z,Jn.default],(function(){return null!=t?(0,eX.Z)($q.Z,Jn.default,t,e):void 0}),[e,t]);if(null==o||null==e||null==t)return null;var i=o.isCurrentUser||o.notPlayable||o.playingSameTrack,a=o.isCurrentUser||o.syncingWithUser||o.syncingWithParty;return[(0,r.jsx)(c.sNh,{id:"spotify-play-".concat(e.session_id),action:function(){return(0,nX.Z)(o,Dp.kG.USER_ACTIVITY_PLAY,n)},label:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_ACTION_PLAY_ON_SPOTIFY,subtext:i?(0,Jq.Z)(o,Dp.kG.USER_ACTIVITY_PLAY):void 0,disabled:i
},"spotify-play-".concat(e.session_id)),o.canPlaySpotify?(0,r.jsx)(c.sNh,{id:"spotify-sync-".concat(e.session_id),action:function(){return(0,tX.Z)(o,Dp.kG.USER_ACTIVITY_SYNC,n)},label:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_ACTION_LISTEN_ALONG,subtext:a?(0,Jq.Z)(o,Dp.kG.USER_ACTIVITY_SYNC):void 0,disabled:a},"spotify-sync-".concat(e.session_id)):null]}(null==o?void 0:o.activity,null==o?void 0:o.activityUser);return n?i:null}function oX(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function iX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){oX(e,t,n[t])}))}return e}function aX(e,t){t=null!=t?t:{}
;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function sX(e){var t=e.party,n=e.close,i=e.onSelect,a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(){Wq.Z.openPrivateChannel(l).then((function(t){return Sb.ZP.trackWithMetadata(M.rMx.ACTIVITY_FEED_DM_VISITED,Xq({source:Qq(Xq({},s.location),{object:M.qAy.LIST_ITEM}),channel_id:t,recipient_id:"string"==typeof l?l:l[0],af_recently_played:!1},Kq(e)))}))},i=e.priorityMembers,a=e.partiedMembers,s=o.useContext(Ie.AnalyticsContext),l=i.map((function(e){return e.user.id})),u=1===a.length&&1===i.length,f=i.length-a.length>0
;return!u&&!t||f||0===l.length?null:(0,r.jsx)(c.sNh,{id:"message",action:n,label:Q.Z.Messages.SEND_DM})}(t),l=function(e){var t=o.useContext(Ie.AnalyticsContext),n=e.voiceChannels[0],i=(0,s.e7)([dn.Z],(function(){return null!=n&&dn.Z.can(M.Plq.CONNECT,n.channel)}));return null==n?null:[(0,r.jsx)(c.sNh,{id:"join-voice",action:function(){(0,AK.X)(n.guild.id);d.default.selectVoiceChannel(n.channel.id);Sb.ZP.trackWithMetadata(M.rMx.ACTIVITY_FEED_VOICE_CHANNEL_VISITED,iX({source:aX(iX({},t.location),{object:M.qAy.LIST_ITEM}),guild_id:n.guild.id,channel_id:n.channel.id},Kq(e)))},label:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_ACTION_JOIN_CHANNEL,disabled:!i},"join-voice"),(0,r.jsx)(c.sNh,{id:"goto-server",action:function(){(0,AK.X)(n.guild.id);Sb.ZP.trackWithMetadata(M.rMx.ACTIVITY_FEED_GUILD_VISITED,iX({source:aX(iX({},t.location),{object:M.qAy.LIST_ITEM}),guild_id:n.guild.id,af_recently_played:!1},Kq(e)))},label:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_ACTION_GO_TO_SERVER},"goto-server")]
}(t),u=function(e){return e.applicationStreams.map((function(e){var t=e.stream,n=e.streamUser;return(0,r.jsx)(c.sNh,{id:"spectate-".concat(t.ownerId),action:function(){d.default.selectVoiceChannel(t.channelId);(0,Tr.iV)(t)},label:Q.Z.Messages.WATCH_USER_STREAM.format({streamerName:lp.ZP.getName(n)})},"spectate-".concat(t.ownerId))}))}(t),f=rX(t),p=Zq(t),h=function(e){var t=e.priorityMembers,n=e.partiedMembers,i=e.currentActivities,a=e.guildContext,s=new Set(t.map((function(e){return e.user.id}))),l=n.filter((function(e){return!s.has(e.id)})),u=o.useMemo((function(){var e=i.flatMap((function(e){return e.playingMembers})).map((function(e){return e.id}));return n.filter((function(t){return!e.includes(t.id)}))}),[n,i]);if(i.length<=1&&0===u.length){var f,d;return(0,r.jsx)(c.kSQ,{label:n.length>1?Q.Z.Messages.ACTIVITY_FEED_SINGLE_MEMBER_LIST_HEADER.format({memberCount:n.length}):void 0,
children:zq(t,l,n.length,null!==(d=null===(f=i[0])||void 0===f?void 0:f.activity)&&void 0!==d?d:void 0,null==a?void 0:a.id)})}var p=i.map((function(e,n){var o=e.playingMembers,i=e.game,l=e.activity,u=new Set(o.map((function(e){return e.id})));return(0,r.jsx)(c.kSQ,{label:"".concat(i.name," - ").concat(o.length),children:zq(t.filter((function(e){var t=e.user;return u.has(t.id)})),o.filter((function(e){return!s.has(e.id)})),o.length,null!=l?l:void 0,null==a?void 0:a.id)},n)})),h=u.map((function(e){return e.id})),E=(0,r.jsx)(c.kSQ,{label:"".concat(Q.Z.Messages.ACTIVITY_FEED_OTHER_MEMBER_LIST_HEADER," - ").concat(u.length),children:zq(t.filter((function(e){var t=e.user;return h.includes(t.id)})),u.filter((function(e){return!s.has(e.id)})),u.length,void 0,null==a?void 0:a.id)});return Yq(p).concat([E])}(t);return(0,r.jsxs)(c.v2r,{navId:"now-playing-menu",onClose:n,"aria-label":Q.Z.Messages.GENERIC_ACTIONS_MENU_LABEL,onSelect:i,children:[a,(0,r.jsxs)(c.kSQ,{children:[l,u]}),(0,r.jsx)(c.kSQ,{
children:f}),(0,r.jsx)(c.kSQ,{children:p}),h]})}var cX=n(658689);function lX(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function uX(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){lX(i,r,o,a,s,"next",e)}function s(e){lX(i,r,o,a,s,"throw",e)}a(void 0)}))}}function fX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dX(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function pX(e){pX=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return pX(e)}function hX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){
return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){dX(e,t,n[t])}))}return e}function EX(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function yX(e,t){return!t||"object"!==bX(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function mX(e,t){mX=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return mX(e,t)}var bX=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function gX(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=pX(e);if(t){var o=pX(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return yX(this,n)}}var OX=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0]
;continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};var vX=n(184137),_X=n.n(vX);function IX(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function SX(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var TX,NX=(TX=function(e){var t=e.party,n=e.onUserContextMenu,o=e.onChannelContextMenu,i=(0,r.jsx)(vq,{party:t,onUserContextMenu:n}),a=(0,r.jsx)(Oq,{party:t,onChannelContextMenu:o});return null!=i||null!=a?(0,r.jsx)(c.yRy,{position:"left",renderPopout:function(e){var n=e.closePopout;return(0,r.jsx)(sX,{party:t,close:n})},spacing:8,children:function(e,t){var n=t.isShown;return(0,r.jsx)(mq,SX(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){IX(e,t,n[t])}))}return e}({},e),{"aria-haspopup":"menu",className:_X().itemCard,active:n,children:(0,r.jsxs)("div",{children:[i,a]})}))}}):null},(0,cX.Z)(function(e){!function(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&mX(e,t)}(o,e);var t=gX(o);function o(){fX(this,o);return t.apply(this,arguments)}var i=o.prototype;i.render=function(){return(0,r.jsx)(TX,EX(hX({},this.props),{onMessageUser:this.handleMessageUser,onUserContextMenu:this.handleUserContextMenu,onGuildContextMenu:this.handleGuildContextMenu,onChannelContextMenu:this.handleChannelContextMenu}))};i.handleMessageUser=function(e,t){return Wq.Z.openPrivateChannel(t.id)};i.handleUserContextMenu=function(e,t,o){(0,Ob.jW)(e,uX((function(){var e,o;return OX(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(49244),n.e(85572)]).then(n.bind(n,810848))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,EX(hX({},e),{user:t}))}]}}))})),{onClose:o})};i.handleGuildContextMenu=function(e,t){(0,
Ob.jW)(e,uX((function(){var e,o;return OX(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(19669),n.e(66240)]).then(n.bind(n,166240))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,EX(hX({},e),{guild:t}))}]}}))})))};i.handleChannelContextMenu=function(e,t){var o=Zt.Z.getGuild(t.getGuildId());if(null==o)return null;(0,Ob.jW)(e,uX((function(){var e,i;return OX(this,(function(a){switch(a.label){case 0:return[4,Promise.all([n.e(84663),n.e(44522)]).then(n.bind(n,544522))];case 1:e=a.sent(),i=e.default;return[2,function(e){return(0,r.jsx)(i,EX(hX({},e),{channel:t,guild:o}))}]}}))})))};return o}(o.Component))),AX=Wa().throttle((function(){return bW.W(!1)}),3e5);function CX(){var e=(0,s.cj)([TK,es.Z,Y.default],(function(){return{nowPlayingCards:TK.nowPlayingCards,loaded:TK.loaded,needsRefresh:es.Z.needsRefresh(),fetching:es.Z.getFetching(),currentUser:Y.default.getCurrentUser()}
})),t=e.nowPlayingCards,n=e.loaded,i=e.needsRefresh,a=e.fetching,l=e.currentUser;o.useEffect((function(){O.Z.wait((function(){O.Z.dispatch({type:"NOW_PLAYING_MOUNTED"})}));return function(){return O.Z.wait((function(){O.Z.dispatch({type:"NOW_PLAYING_UNMOUNTED"})}))}}),[null==l?void 0:l.id]);o.useEffect((function(){i&&!a&&AX()}),[i,a]);var u=null;if(!n)return(0,r.jsx)("div",{className:_X().emptyCard,children:(0,r.jsx)(c.$jN,{})});u=t.length>0?t.map((function(e){var t=e.party;return(0,r.jsx)(NX,{party:t},t.id)})):(0,r.jsxs)("div",{className:_X().emptyCard,children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",className:_X().emptyHeader,children:Q.Z.Messages.ACTIVITY_FEED_NONE_PLAYING_HEADER}),(0,r.jsx)(c.xvT,{color:"none",className:_X().emptyText,variant:"text-sm/normal",children:Q.Z.Messages.ACTIVITY_FEED_NONE_PLAYING_BODY})]});return(0,r.jsx)(r.Fragment,{children:u})}var PX=n(252569),jX=n.n(PX);function RX(){var e=(0,Hw.Z)(Pf.Z.ACTIVE_NOW_COLUMN).AnalyticsLocationProvider,t=(0,
s.e7)([mW.Z],(function(){return mW.Z.hasConsented(M.pjP.PERSONALIZATION)}))?[]:[ln.z$.NOW_PLAYING_CONSENT_CARD],n=(0,q.Dt)();return(0,r.jsx)(e,{children:(0,r.jsx)(fW.Z,{section:M.jXE.ACTIVE_NOW_COLUMN,children:(0,r.jsx)("aside",{className:jX().container,"aria-labelledby":n,children:(0,r.jsxs)(c.Ttm,{className:jX().scroller,children:[(0,r.jsx)(c.X6q,{variant:"heading-lg/semibold",className:jX().header,id:n,children:Q.Z.Messages.GAME_FEED_CURRENT_HEADER_TITLE}),(0,r.jsx)(WN.Z,{contentTypes:t,children:function(e){var t=e.visibleContent,n=e.markAsDismissed;if(t===ln.z$.NOW_PLAYING_CONSENT_CARD)return(0,r.jsx)(yW,{className:jX().consentCard,markAsDismissed:n})}}),(0,r.jsx)(CX,{})]})})})})}var xX=n(864928),MX=n(169376);function wX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1;r.configurable=!0;"value"in r&&(r.writable=!0);Object.defineProperty(e,r.key,r)}}
function ZX(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function LX(e){LX=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return LX(e)}function UX(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&BX(e,t)}function kX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){ZX(e,t,n[t])}))}return e}function GX(e,t){return!t||"object"!==HX(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e
}(e):t}function BX(e,t){BX=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return BX(e,t)}var HX=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function VX(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=LX(e);if(t){var o=LX(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return GX(this,n)}}function FX(e){var t=Y.default.getUser(e);return{user:t,usernameLower:null!=t?t.username.toLowerCase():null}}function YX(e){return{status:$a.Z.getStatus(e),isMobile:$a.Z.isMobileOnline(e),activities:$a.Z.getActivities(e),applicationStream:Pr.Z.getAnyStreamForUser(e)}}function zX(e){var t=[];Wa()(qa.ZP.memberOf(e)).map(Zt.Z.getGuild).sortBy((function(e){
return null!=e?e.name.toLowerCase():null})).forEach((function(e){null!=e&&t.push(e)}));return{mutualGuildsLength:t.length,mutualGuilds:t.slice(0,M.$Xn)}}var WX=function(e){UX(n,e);var t=VX(n);function n(e){wX(this,n);var r;(r=t.call(this)).key=e.key;r.type=e.type;r.status=e.status;r.activities=e.activities;r.applicationStream=e.applicationStream;r.user=e.user;r.isMobile=e.isMobile;r.usernameLower=e.usernameLower;r.mutualGuildsLength=e.mutualGuildsLength;r.mutualGuilds=e.mutualGuilds;r.nickname=e.nickname;return r}!function(e,t,n){t&&DX(e.prototype,t);n&&DX(e,n)}(n,[{key:"comparator",get:function(){var e,t;return[this.type,null!==(t=null===(e=this.nickname)||void 0===e?void 0:e.toLowerCase())&&void 0!==t?t:this.usernameLower]}}]);return n}(MX.Z),KX=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];wX(this,e);this._rows=t}var t=e.prototype;t.reset=function(){var t=Wa().map(Ja.Z.getRelationships(),(function(e,t){return new WX(kX({key:t,type:e,
nickname:Ja.Z.getNickname(t)},FX(t),YX(t),zX(t)))})),n=Wa().map(lW.getSuggestions(),(function(e){return new WX(kX({key:e.key,type:99,nickname:e.name},FX(e.key),YX(e.key),zX(e.key)))}));return new e(Wa().concat(t,n))};t.clone=function(){return new e(this._rows)};t.update=function(e){for(var t=!1,n=0;n<this._rows.length;n++){var r=this._rows[n],o=r.merge(e(r.key));t=t||o!==r;this._rows[n]=o}return t};t.filter=function(e,t){return Wa()(this._rows).filter((function(e){if(null==e.user)return!1;if(null!=t&&""!==t){var n=t.toLowerCase();return[e.usernameLower,e.nickname].map((function(e){return null==e?void 0:e.toLowerCase()})).some((function(e){return null==e?void 0:e.includes(n)}))}return!0})).filter((function(t){switch(e){case M.pJs.ONLINE:return t.type===M.OGo.FRIEND&&t.status!==M.Skl.OFFLINE;case M.pJs.PENDING:return t.type===M.OGo.PENDING_INCOMING||t.type===M.OGo.PENDING_OUTGOING;case M.pJs.SUGGESTIONS:return 99===t.type;case M.pJs.BLOCKED:return t.type===M.OGo.BLOCKED;case M.pJs.ALL:
default:return t.type===M.OGo.FRIEND}})).sortBy((function(e){return e.comparator})).value()};t.getRelationshipCounts=function(){var e,t=(ZX(e={},M.OGo.FRIEND,0),ZX(e,M.OGo.PENDING_INCOMING,0),ZX(e,M.OGo.PENDING_OUTGOING,0),ZX(e,99,0),ZX(e,M.OGo.BLOCKED,0),e);this._rows.forEach((function(e){null!=e.user&&null!=t[e.type]&&t[e.type]++}));return t};return e}(),qX=!0,XX=!1,QX=M.pJs.ONLINE,$X=new KX,JX=!0,eQ=!1;function tQ(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(qX&&(e||QX!==M.pJs.ONLINE&&QX!==M.pJs.ADD_FRIEND)&&!XX){qX=!1;XX=!0;xX.Z.fetchRelationships()}}function nQ(){qX=!0;JX?XX=!1:tQ();$X=$X.reset();if(!eQ){var e=$X.getRelationshipCounts();QX=0===e[M.OGo.FRIEND]?0!==e[M.OGo.PENDING_INCOMING]?M.pJs.PENDING:M.pJs.ADD_FRIEND:M.pJs.ONLINE}}function rQ(){$X=JX?new KX:$X.reset()}function oQ(e){return function(){if(JX)return!1;if($X.update(e)){$X=$X.clone();return!0}return!1}}var iQ=function(e){UX(n,e);var t=VX(n);function n(){wX(this,n);return t.apply(this,arguments)}
var r=n.prototype;r.initialize=function(){this.waitFor(Ja.Z,$a.Z,Y.default,Zt.Z,qa.ZP,Pr.Z,lW);this.syncWith([Ja.Z],rQ);this.syncWith([lW],rQ);this.syncWith([Y.default],oQ(FX));this.syncWith([$a.Z,Pr.Z],oQ(YX));nQ()};r.getState=function(){return{fetching:XX,section:QX,pendingCount:Ja.Z.getPendingCount(),rows:$X}};r.__getLocalVars=function(){return{SUGGESTION_TYPE:99,shouldFetch:qX,fetching:XX,section:QX,rows:$X,pause:JX,initialSectionSet:eQ}};return n}(s.ZP.Store);iQ.displayName="FriendsStore";const aQ=new iQ(O.Z,{CONNECTION_OPEN:function(){nQ()},FRIENDS_SET_SECTION:function(e){QX=e.section;tQ()},CHANNEL_SELECT:function(e){var t=e.channelId;JX=null!=t;rQ();return!JX},LOAD_RELATIONSHIPS_SUCCESS:function(){XX=!1},LOAD_RELATIONSHIPS_FAILURE:function(){qX=!0;XX=!0},DRAWER_SELECT_TAB:function(e){var t=e.tab;JX=t!==M.cII.FRIENDS;rQ();return!JX},FRIENDS_SET_INITIAL_SECTION:function(e){QX=e.section;eQ=!0}});var sQ=n(491275),cQ=n(792708),lQ=n(908478),uQ=n(668785),fQ=n(780929),dQ=n.n(fQ)
;function pQ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hQ(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function EQ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){hQ(e,t,n[t])}))}return e}function yQ(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function mQ(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return pQ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pQ(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var bQ={canSend:!1,hint:null,success:null,
error:null},gQ=(0,q.hQ)(),OQ="".concat(gQ,"-decription"),vQ="".concat(gQ,"-error");function _Q(e,t){switch(t.type){case"RESET":return bQ;case"SUCCESS":return yQ(EQ({},bQ),{success:t.text});case"HINT":return yQ(EQ({},bQ),{canSend:!0,hint:t.text});case"ERROR":return yQ(EQ({},e),{canSend:!0,error:t.text})}}function IQ(){var e=o.createRef(),t=o.createRef(),n=mQ(o.useReducer(_Q,bQ),2),i=n[0],a=n[1],s=i.canSend,l=i.hint,u=i.success,f=i.error,d=(0,cQ.y)();o.useEffect((function(){if(null!=u){xh()(null!=e.current,"Input is submitting when not mounted");e.current.value="";e.current.focus()}}),[u,e]);var p;return(0,r.jsxs)("form",{onSubmit:function(t){t.preventDefault();xh()(null!=e.current,"Input is submitted when not mounted");var n=e.current.value.trim(),r=(0,lQ.Z)(n,d);null==r?xX.Z.sendRequest(n,{location:"Add Friend"}).then((function(){return a({type:"SUCCESS",text:Q.Z.Messages.ADD_FRIEND_SUCCESS.format({discordTag:n})})}),(function(e){return a({type:"ERROR",text:(0,lQ.N)(e.body.code,n,d)})
})):a({type:"ERROR",text:r})},autoComplete:"off",children:[(0,r.jsx)(c.R94,{id:OQ,type:c.R94.Types.DESCRIPTION,children:d?Q.Z.Messages.POMELO_ADD_FRIEND_DESCRIPTION:Q.Z.Messages.ADD_FRIEND_DESCRIPTION}),(0,r.jsx)(c.tEY,{focusTarget:e,ringTarget:t,ringClassName:dQ().ring,children:(0,r.jsxs)("div",{ref:t,className:lh()(dQ().addFriendInputWrapper,(p={},hQ(p,dQ().success,u),hQ(p,dQ().error,f),p)),children:[(0,r.jsx)(c.oil,{id:gQ,inputRef:e,className:dQ().addFriendInput,inputClassName:dQ().input,onKeyPress:function(t){var n=t.currentTarget.value;if(t.key!==uQ.mR.Enter&&n.includes("#")){xh()(null!=e.current,"Input is handling keypress when not mounted");var r=n.indexOf("#"),o=e.current.selectionStart,i=t.key===uQ.mR.Backspace||t.key===uQ.mR.ArrowRight||t.key===uQ.mR.ArrowLeft,a=t.which>=48&&t.which<=57;(null!=o&&o>r&&/^(.+?#\d{4})$/.test(n)&&!i||null!=o&&o>r&&!a&&!i)&&t.preventDefault()}},onChange:function(e){if(e.length<=0)a({type:"RESET"});else{var t="",n=mQ(e.split("#"),2)[1]
;d&&null==n||(t=e+M.LYt.slice(null!=n?n.length+1:0));a({type:"HINT",text:t})}},maxLength:37,autoFocus:!0,autoComplete:"off",name:"add-friend","data-lpignore":!0,placeholder:d?Q.Z.Messages.POMELO_ADD_FRIEND_DESCRIPTION:Q.Z.Messages.ADD_FRIEND_PLACEHOLDER,"aria-label":d?Q.Z.Messages.POMELO_ADD_FRIEND_DESCRIPTION:Q.Z.Messages.ADD_FRIEND_PLACEHOLDER,"aria-invalid":null!=f||void 0,"aria-describedby":null!=f?vQ:OQ}),null!=l&&(0,r.jsx)("div",{className:dQ().addFriendHint,"aria-hidden":!0,children:l}),(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,disabled:!s,type:"submit",children:Q.Z.Messages.ADD_FRIEND_BUTTON})]})}),null!=f&&(0,r.jsx)(c.R94,{role:"alert",id:vQ,type:c.R94.Types.ERROR,className:gh().marginTop8,children:f}),null!=u&&(0,r.jsx)(c.R94,{role:"status",type:c.R94.Types.SUCCESS,className:gh().marginTop8,children:u})]})}var SQ=n(215841),TQ=n(106750);function NQ(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function AQ(e,t){
t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function CQ(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function PQ(e){var t=e.color,n=void 0===t?"currentColor":t,o=CQ(e,["color"]);return(0,r.jsx)("svg",AQ(function(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){NQ(e,t,n[t])}))}return e}({},o),{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{clipRule:"evenodd",d:"m5.41667 4.2625 5.66573 5.7375-5.66573 5.7375 1.74426 1.7625 7.42237-7.5-7.42237-7.5z",fill:n,fillRule:"evenodd"})}))}var jQ=n(463806),RQ=n.n(jQ),xQ=n(794649),MQ=n.n(xQ);function wQ(e,t,n){return(0,r.jsxs)("button",{className:RQ().container,onClick:n,children:[(0,r.jsx)("img",{className:RQ().icon,alt:"",src:e}),(0,r.jsx)(c.xvT,{className:RQ().text,variant:"text-md/medium",children:t}),(0,r.jsx)(PQ,{className:RQ().arrow})]},t)}function DQ(){var e=Object.values(Zt.Z.getGuilds()).filter((function(e){return e.hasFeature(M.oNc.HUB)}));return(0,r.jsxs)(o.Fragment,{
children:[(0,r.jsx)("header",{className:RQ().header,children:(0,r.jsx)(c.vwX,{tag:"h2",className:RQ().title,children:Q.Z.Messages.ADD_FRIEND_MAKE_FRIENDS})}),(0,r.jsxs)("div",{className:RQ().grid,children:[e.map((function(e){return wQ(Ds.ZP.getGuildIconURL({id:e.id,icon:e.icon,size:240}),e.name,(function(){!function(e){Ie.default.track(M.rMx.ADD_FRIEND_OTHER_PLACES_HUB_CLICKED,{guild_id:e});(0,AK.X)(e)}(e.id)}))})),wQ(MQ(),Q.Z.Messages.ADD_FRIEND_EXPLORE_PUBLIC_SERVERS,(function(){(0,TQ.AQ)();Ie.default.track(M.rMx.ADD_FRIEND_OTHER_PLACES_DISCOVERY_CLICKED);(0,K.uL)(M.Z5c.GUILD_DISCOVERY)}))]})]})}var ZQ=n(984710),LQ=n.n(ZQ);function UQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kQ(e){kQ=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return kQ(e)}function GQ(e,t){return!t||"object"!==VQ(t)&&"function"!=typeof t?function(e){
if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function BQ(e,t){BQ=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return BQ(e,t)}var HQ,VQ=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function FQ(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=kQ(e);if(t){var o=kQ(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return GQ(this,n)}}!function(e){e.SECTION_NO_RESULTS="SECTION_NO_RESULTS"}(HQ||(HQ={}));var YQ=Object.freeze({SECTION_ALL:{lightSrc:n(607603),darkSrc:n(74700),width:376,height:162,renderContent:function(e){return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(mV.ZP.Text,{
note:Q.Z.Messages.FRIENDS_EMPTY_STATE_ALL}),(0,r.jsx)(c.zxk,{className:LQ().button,onClick:e,children:Q.Z.Messages.ADD_FRIEND})]})}},SECTION_ONLINE:{lightSrc:n(688224),darkSrc:n(376354),width:421,height:218,renderContent:function(){return(0,r.jsx)(mV.ZP.Text,{note:Q.Z.Messages.FRIENDS_EMPTY_STATE_ONLINE})}},SECTION_BLOCKED:{lightSrc:n(399898),darkSrc:n(492623),width:433,height:232,renderContent:function(){return(0,r.jsx)(mV.ZP.Text,{note:Q.Z.Messages.FRIENDS_EMPTY_STATE_BLOCKED})}},SECTION_PENDING:{lightSrc:n(540579),darkSrc:n(96972),width:415,height:200,renderContent:function(){return(0,r.jsx)(mV.ZP.Text,{note:Q.Z.Messages.FRIENDS_EMPTY_STATE_PENDING})}},SECTION_SUGGESTIONS:{lightSrc:n(540579),darkSrc:n(96972),width:415,height:200,renderContent:function(){return(0,r.jsx)(mV.ZP.Text,{note:Q.Z.Messages.FRIENDS_EMPTY_STATE_SUGGESTIONS})}},SECTION_NO_RESULTS:{lightSrc:n(688224),darkSrc:n(376354),width:421,height:218,renderContent:function(){return(0,r.jsx)(mV.ZP.Text,{
note:Q.Z.Messages.FRIEND_REQUEST_NO_RESULTS_FOUND})}}});var zQ=function(e){var t=e.theme,n=Q.Z.Messages.FRIENDS_EMPTY_STATE_ALL,i=YQ.SECTION_ALL;return(0,r.jsx)(o.Fragment,{children:(0,r.jsxs)(mV.ZP,{theme:t,children:[(0,r.jsx)(mV.ZP.Image,{width:i.width,height:i.height,lightSrc:i.lightSrc,darkSrc:i.darkSrc}),(0,r.jsx)(mV.ZP.Text,{note:n})]})})},WQ=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&BQ(e,t)}(n,e);var t=FQ(n);function n(){UQ(this,n);var e;(e=t.apply(this,arguments)).state={opacity:new ji.Z.Value(1)};e.componentWillEnter=function(t){e.state.opacity.setValue(0);ji.Z.timing(e.state.opacity,{toValue:1,duration:250}).start(t)};e.componentWillLeave=function(t){ji.Z.timing(e.state.opacity,{toValue:0,duration:250}).start(t)};return e}n.prototype.render=function(){
var e=this.props,t=e.type,n=e.onClick,o=e.theme,i={opacity:this.state.opacity},a=function(e){switch(e){case M.pJs.ADD_FRIEND:case M.pJs.ALL:return YQ.SECTION_ALL;case M.pJs.ONLINE:return YQ.SECTION_ONLINE;case M.pJs.PENDING:return YQ.SECTION_PENDING;case M.pJs.SUGGESTIONS:return YQ.SECTION_SUGGESTIONS;case M.pJs.BLOCKED:return YQ.SECTION_BLOCKED;case HQ.SECTION_NO_RESULTS:return YQ.SECTION_NO_RESULTS;default:throw new Error("FriendsEmptyState: Invalid empty state")}}(t);return t===M.pJs.ADD_FRIEND?(0,r.jsx)(ji.Z.div,{className:LQ().friendsEmpty,style:i,children:(0,r.jsx)(zQ,{theme:o})}):(0,r.jsx)(ji.Z.div,{className:LQ().friendsEmpty,style:i,children:(0,r.jsxs)(mV.ZP,{theme:o,children:[(0,r.jsx)(mV.ZP.Image,{width:a.width,height:a.height,lightSrc:a.lightSrc,darkSrc:a.darkSrc}),a.renderContent(n)]})})};return n}(o.PureComponent);const KQ=s.ZP.connectStores([st.Z],(function(){return{theme:st.Z.theme}}),{forwardRef:!0})(WQ);var qQ=n(837151),XQ=n.n(qQ);function QQ(){return(0,
r.jsxs)("header",{className:XQ().header,children:[(0,r.jsx)(c.vwX,{tag:"h2",className:XQ().title,children:Q.Z.Messages.ADD_FRIEND}),(0,r.jsx)(IQ,{})]})}const $Q=function(){return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(QQ,{}),(0,SQ.b)()&&(0,r.jsx)(DQ,{}),(0,r.jsx)("div",{className:XQ().emptyState,children:(0,r.jsx)(KQ,{type:M.pJs.ADD_FRIEND})})]})};function JQ(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function e$(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function t$(e,t){if(null==e)return{};var n,r,o=function(e,t){
if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function n$(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=t$(e,["width","height","color","foreground"]);return(0,r.jsx)("svg",e$(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){JQ(e,t,n[t])}))}return e}({},(0,OO.Z)(l)),{width:n,height:i,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{className:c,fill:s,fillRule:"evenodd",clipRule:"evenodd",
d:"M20.2949 0.298996L21.7089 1.713L19.4169 4.006L21.7089 6.299L20.2949 7.713L18.0019 5.42L15.7099 7.713L14.2949 6.299L16.5879 4.006L14.2949 1.713L15.7099 0.298996L18.0019 2.592L20.2949 0.298996ZM8.00195 13.006C10.207 13.006 12.002 11.211 12.002 9.006C12.002 6.801 10.207 5.006 8.00195 5.006C5.79695 5.006 4.00195 6.801 4.00195 9.006C4.00195 11.211 5.79695 13.006 8.00195 13.006ZM8.00195 14.006C3.29095 14.006 0.00195312 16.473 0.00195312 20.006V21.006H16.002V20.006C16.002 16.473 12.713 14.006 8.00195 14.006Z"})}))}var r$,o$=n(559347),i$=n.n(o$);function a$(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function s$(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))
;n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}!function(e){e[e.ACCEPT=0]="ACCEPT";e[e.DENY=1]="DENY";e[e.DEFAULT=2]="DEFAULT"}(r$||(r$={}));function c$(e){var t=e.icon,n=e.tooltip,o=e.onClick,i=e.actionType,a=void 0===i?r$.DEFAULT:i,s=e.shouldHighlight;return(0,r.jsx)(c.ua7,{text:n,children:function(e){var i;return(0,r.jsx)(c.P3F,s$(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){a$(e,t,n[t])}))}return e}({},e),{"aria-label":n,onClick:o,className:lh()(i$().actionButton,(i={},a$(i,i$().actionAccept,a===r$.ACCEPT),a$(i,i$().actionDeny,a===r$.DENY),a$(i,i$().highlight,s),i)),children:(0,r.jsx)(t,{className:i$().icon})}))}})}c$.ActionTypes=r$
;const l$=c$;var u$=n(35330),f$=n.n(u$);function d$(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function p$(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){d$(i,r,o,a,s,"next",e)}function s(e){d$(i,r,o,a,s,"throw",e)}a(void 0)}))}}function h$(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E$(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function y$(e){y$=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return y$(e)}function m$(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))))
;r.forEach((function(t){E$(e,t,n[t])}))}return e}function b$(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function g$(e,t){return!t||"object"!==v$(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function O$(e,t){O$=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return O$(e,t)}var v$=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function _$(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=y$(e);if(t){var o=y$(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g$(this,n)}}var I$=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue
;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},S$=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&O$(e,t)}(o,e);var t=_$(o);function o(){h$(this,o);var e;(e=t.apply(this,arguments)).state={height:new ji.Z.Value(62),opacity:new ji.Z.Value(1),hovered:!1,isContextMenuActive:!1};e.handleMouseEnter=function(){var t=e.props,n=t.isFocused,r=t.isActive,o=t.onOtherHover,i=e.state.isContextMenuActive;e.setState({hovered:n});!n||r||i||null==o||o()}
;e.handleMouseLeave=function(){e.setState({hovered:!1})};e.handleContextMenu=function(t,o){e.setState({isContextMenuActive:!0});(0,Ob.jW)(t,p$((function(){var e,t;return I$(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(49244),n.e(85572)]).then(n.bind(n,810848))];case 1:e=i.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,b$(m$({},e),{user:o}))}]}}))})),{onClose:function(){e.setState({isContextMenuActive:!1})}})};return e}var i=o.prototype;i.componentWillLeave=function(e){ji.Z.parallel([ji.Z.timing(this.state.opacity,{toValue:0,duration:200}),ji.Z.timing(this.state.height,{toValue:0,duration:200})]).start(e)};i.componentWillEnter=function(e){this.state.opacity.setValue(0);this.state.height.setValue(0);ji.Z.parallel([ji.Z.timing(this.state.opacity,{toValue:1,duration:200}),ji.Z.timing(this.state.height,{toValue:62,duration:200})]).start(e)};i.render=function(){
var e=this,t=this.state,n=t.height,o=t.opacity,i=t.hovered,a=t.isContextMenuActive,s=this.props,l=s.children,u=s.user,f=s.onClick,d=s.isActive;return(0,r.jsx)(pb.mh,{id:u.id,children:function(t){return(0,r.jsx)(c.tEY,{offset:{left:-8,right:-8},children:(0,r.jsx)(ji.Z.div,b$(m$({className:lh()(f$().peopleListItem,E$({},f$().active,d||a)),onContextMenu:function(t){return e.handleContextMenu(t,u)},onMouseEnter:e.handleMouseEnter,onMouseLeave:e.handleMouseLeave,onClick:null!=f?f:void 0,style:{height:n,opacity:o}},t),{children:l(i||d||a)}))})}})};return o}(o.PureComponent);const T$=S$;var N$=n(657539),A$=n(715402),C$=n.n(A$);function P$(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}const j$=function(e){var t=e.user,n=e.hovered,o=e.subText,i=e.showAccountIdentifier,a=e.status,c=e.isMobile,l=e.className,u=(0,s.e7)([Ja.Z],(function(){return Ja.Z.getNickname(t.id)}));return(0,r.jsxs)("div",{
className:lh()(C$().userInfo,l,P$({},C$().hovered,n)),children:[(0,r.jsx)(N$.Z,{user:t,className:C$().avatar,animate:n,status:a,isMobile:c}),(0,r.jsxs)("div",{className:C$().text,children:[(0,r.jsx)(UV.Z,{user:t,nick:u,botClass:C$().botTag,className:C$().discordTag,usernameClass:C$().username,discriminatorClass:C$().discriminator,showAccountIdentifier:i}),(0,r.jsx)("div",{className:C$().subtext,children:o})]})]})};var R$=n(707673),x$=n.n(R$);function M$(e){var t=e.user,n=e.key,i=e.isFocused,a=o.useContext(Ie.AnalyticsContext),s=function(e){e.stopPropagation();xX.Z.unblockUser(t.id,{location:"Friends"})};return(0,r.jsx)(T$,{isFocused:i,onClick:function(){return(0,xp.m)({userId:t.id,analyticsLocation:a.location})},user:t,children:function(e){return(0,r.jsxs)("div",{className:x$().listItemContents,children:[(0,r.jsx)(j$,{user:t,hovered:e,status:M.Skl.UNKNOWN,subText:Q.Z.Messages.BLOCKED}),(0,r.jsx)(l$,{icon:n$,actionType:l$.ActionTypes.DENY,tooltip:Q.Z.Messages.UNBLOCK,onClick:s,
shouldHighlight:e})]})}},n)}var w$=n(693622),D$=n(106555),Z$=n(306473),L$=n.n(Z$);const U$=function(e){var t=e.hovered,n=e.activities,o=e.applicationStream,i=e.status;return n.length>0?(0,r.jsx)(D$.Z,{className:L$().activity,textClassName:L$().text,emojiClassName:L$().customStatusEmoji,activities:n,applicationStream:o,animate:t}):(0,r.jsx)("div",{className:L$().text,children:(0,lp.u5)(i)})};var k$=n(299677),G$=n.n(k$);function B$(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function H$(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function V$(e){V$=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return V$(e)}function F$(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){
return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){H$(e,t,n[t])}))}return e}function Y$(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function z$(e,t){return!t||"object"!==K$(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function W$(e,t){W$=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return W$(e,t)}var K$=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function q$(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=V$(e);if(t){var o=V$(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return z$(this,n)}}function X$(e){var t=e.user,n=e.onSelect,o=function(){xX.Z.removeFriend(t.id,{location:"Friends"})},i=(0,s.e7)([Ye.Z],(function(){return Ye.Z.supports(Ke.AN.VIDEO)}));return(0,r.jsxs)(c.v2r,{navId:"friend-row","aria-label":Q.Z.Messages.USER_ACTIONS_MENU_LABEL,onClose:Ob.Zy,onSelect:n,children:[i?(0,r.jsx)(c.sNh,{id:"start-video-call",label:Q.Z.Messages.START_VIDEO_CALL,action:function(){Wq.Z.openPrivateChannel(t.id,!0,!0)}}):null,(0,r.jsx)(c.sNh,{id:"start-voice-call",label:Q.Z.Messages.START_VOICE_CALL,action:function(){Wq.Z.openPrivateChannel(t.id,!0)}}),(0,r.jsx)(c.sNh,{id:"remove-friend",
label:Q.Z.Messages.REMOVE_FRIEND,action:function(){(0,c.h7j)((function(e){return(0,r.jsx)(c.sm4,Y$(F$({header:Q.Z.Messages.REMOVE_FRIEND_TITLE.format({name:lp.ZP.getName(t)}),confirmText:Q.Z.Messages.REMOVE_FRIEND,cancelText:Q.Z.Messages.CANCEL,onConfirm:o},e),{children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:Q.Z.Messages.REMOVE_FRIEND_BODY.format({name:lp.ZP.getName(t)})})}))}))},color:"danger"})]})}var Q$=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&W$(e,t)}(n,e);var t=q$(n);function n(){B$(this,n);var e;(e=t.apply(this,arguments)).peopleListItemRef=o.createRef();e.state={isActiveRow:!1};e.handleOpenPrivateChannel=function(t){var n=e.props.user;t.stopPropagation();var r=Wa().find(S.Z.getMutablePrivateChannels(),(function(e){return e.type===M.d4z.DM&&e.getRecipientId()===n.id}));null!=r?(0,
K.uL)(M.Z5c.CHANNEL(M.ME,r.id)):Wq.Z.openPrivateChannel(n.id)};e.handleOpenActionsMenu=function(t){var n=e.props.user;(0,Ob.vq)(t,(function(e){return(0,r.jsx)(X$,Y$(F$({},e),{user:n}))}),{onClose:function(){e.setState({isActiveRow:!1})}});e.setState({isActiveRow:!0})};return e}var i=n.prototype;i.componentWillLeave=function(e){null!=this.peopleListItemRef.current&&this.peopleListItemRef.current.componentWillLeave(e)};i.componentWillEnter=function(e){null!=this.peopleListItemRef.current&&this.peopleListItemRef.current.componentWillEnter(e)};i.render=function(){var e=this,t=this.props,n=t.user,o=t.isFocused,i=t.activities,a=t.applicationStream,s=t.status,c=t.isMobile,l=this.state.isActiveRow;return(0,r.jsx)(T$,{ref:this.peopleListItemRef,isFocused:o,isActive:l,user:n,onOtherHover:function(){return l?null:(0,Ob.Zy)()},onClick:this.handleOpenPrivateChannel,children:function(t){return(0,r.jsxs)("div",{className:G$().listItemContents,children:[(0,r.jsx)(j$,{user:n,status:s,isMobile:c,
subText:(0,r.jsx)(U$,{hovered:t,activities:i,applicationStream:a,status:s}),hovered:t,showAccountIdentifier:!0}),(0,r.jsxs)("div",{className:G$().actions,children:[(0,r.jsx)(l$,{icon:SN.Z,tooltip:Q.Z.Messages.SEND_DM,onClick:e.handleOpenPrivateChannel,shouldHighlight:t}),(0,r.jsx)(l$,{icon:w$.Z,tooltip:Q.Z.Messages.MORE,onClick:e.handleOpenActionsMenu,shouldHighlight:t})]})]})}})};return n}(o.PureComponent);const $$=Q$;var J$=n(660396),eJ=n.n(J$);function tJ(e){var t=e.user,n=e.type,i=e.status,a=e.isFocused,s=o.useContext(Ie.AnalyticsContext),c=function(e){e.stopPropagation();xX.Z.cancelFriendRequest(t.id,{location:"Friends"})},l=function(e){e.stopPropagation();xX.Z.addRelationship({userId:t.id,context:{location:"Friends"}})},u=i===M.Skl.OFFLINE?M.Skl.UNKNOWN:i,f=n===M.OGo.PENDING_INCOMING?Q.Z.Messages.INCOMING_FRIEND_REQUEST:Q.Z.Messages.OUTGOING_FRIEND_REQUEST;return(0,r.jsx)(T$,{isFocused:a,user:t,onClick:function(){return(0,xp.m)({userId:t.id,analyticsLocation:s.location})},
children:function(e){var o,i=n===M.OGo.PENDING_INCOMING?(0,r.jsxs)(r.Fragment,{children:[(null===(o=Y.default.getCurrentUser())||void 0===o?void 0:o.isStaff())&&(null==t?void 0:t.isStaff())&&(0,r.jsx)("div",{className:eJ().staffIndicator,children:(0,r.jsx)(_j.IG,{color:$b.Z.unsafe_rawColors.BRAND_500.css,text:Q.Z.Messages.STAFF_BADGE_TOOLTIP})}),(0,r.jsx)(l$,{icon:gA.Z,actionType:l$.ActionTypes.ACCEPT,tooltip:Q.Z.Messages.FRIEND_REQUEST_ACCEPT,onClick:l,shouldHighlight:e}),(0,r.jsx)(l$,{icon:Ub.Z,actionType:l$.ActionTypes.DENY,tooltip:Q.Z.Messages.FRIEND_REQUEST_IGNORE,onClick:c,shouldHighlight:e})]}):(0,r.jsx)(l$,{icon:Ub.Z,actionType:l$.ActionTypes.DENY,tooltip:Q.Z.Messages.FRIEND_REQUEST_CANCEL,onClick:c,shouldHighlight:e});return(0,r.jsxs)("div",{className:eJ().listItemContents,children:[(0,r.jsx)(j$,{user:t,hovered:e,showAccountIdentifier:!0,status:u,subText:f,className:eJ().userInfo}),(0,r.jsx)("div",{className:eJ().actions,children:i})]})}})}
var nJ=n(798159),rJ=n(712837),oJ=n.n(rJ);function iJ(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function aJ(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}const sJ=function(e){var t=e.statusSections,n=e.renderRow,i=e.searchQuery,a=function(e){return 0===t[e].length?0:40},l=function(e){var r=e.section,o=e.row,i=t[r];if(null==i||null==o)return null;var a=i[o];return null==a?null:n(a)},u=(0,s.e7)([E.Z],(function(){return E.Z.keyboardModeEnabled})),f=o.useRef(null),d=o.useCallback((function(){return new Promise((function(e){var t=f.current;if(null==t)return e();t.scrollToTop({callback:function(){
return requestAnimationFrame((function(){return e()}))}})}))}),[]),p=o.useCallback((function(){return new Promise((function(e){var t=f.current;if(null==t)return e();t.scrollToBottom({callback:function(){return requestAnimationFrame((function(){return e()}))}})}))}),[]),h=o.useCallback((function(e){var t=document.querySelector(e),n=f.current;null!=t&&null!=n&&n.scrollIntoViewNode({node:t,padding:8,callback:function(){return null==t?void 0:t.focus()}})}),[]),y=(0,nJ.ZP)({id:"people-list",isEnabled:u,scrollToStart:d,scrollToEnd:p,setFocus:h});return(0,r.jsx)(pb.bG,{navigator:y,children:(0,r.jsx)(pb.SJ,{children:function(e){var n=e.ref,o=aJ(e,["ref"]);return(0,r.jsx)(c._2F,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){iJ(e,t,n[t])}))}
return e}({ref:function(e){f.current=e;var t;n.current=null!==(t=null==e?void 0:e.getScrollerNode())&&void 0!==t?t:null},sectionHeight:a,renderRow:l,rowHeight:62,sections:t.map((function(e){return""!==i&&0===e.length?e.length+1:e.length})),className:oJ().peopleList},o))}})})};var cJ=n(443660);function lJ(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function uJ(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){lJ(i,r,o,a,s,"next",e)}function s(e){lJ(i,r,o,a,s,"throw",e)}a(void 0)}))}}function fJ(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function dJ(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){
return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function pJ(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}var hJ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),
0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};const EJ=function(e){var t=e.statusSections,n=e.renderRow,o=e.searchQuery,i=e.sectionFilter,a=e.useReducedMotion,l=(0,s.e7)([E.Z],(function(){return E.Z.keyboardModeEnabled})),u=(0,nJ.ZP)({id:"people",isEnabled:l,scrollToStart:function(){return uJ((function(){return hJ(this,(function(e){return[2]}))}))()},scrollToEnd:function(){
return uJ((function(){return hJ(this,(function(e){return[2]}))}))()}}),f=i!==M.pJs.ONLINE&&i!==M.pJs.ALL,d=a||""!==o||f,p=t.map((function(e,t){return d?(0,r.jsx)("div",{children:e.map(n)},t):(0,r.jsx)(cJ.Z,{transitionAppear:!1,component:"div",children:e.map(n)},t)}));return(0,r.jsx)(pb.bG,{navigator:u,children:(0,r.jsx)(pb.SJ,{children:function(e){var t=e.ref,n=pJ(e,["ref"]);return(0,r.jsx)(c.w0Z,dJ(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){fJ(e,t,n[t])}))}return e}({ref:t,className:oJ().peopleList},n),{children:p}))}})})};function yJ(e){var t=e.relationshipCount,n=e.statusSections,o=e.renderRow,i=e.searchQuery,a=e.sectionFilter,s=e.useReducedMotion;return t>=64?(0,r.jsx)(sJ,{statusSections:n,renderRow:o,searchQuery:i}):(0,
r.jsx)(EJ,{statusSections:n,renderRow:o,sectionFilter:a,searchQuery:i,useReducedMotion:s})}var mJ=n(791451),bJ=n.n(mJ);function gJ(e){var t=e.title,n=e.id;return(0,r.jsx)(dV.Z,{className:bJ().title,id:n,children:t})}var OJ=n(227580),vJ=n.n(OJ);function _J(e){var t=e.user,n=e.nickname,i=e.status,a=e.isFocused,s=o.useContext(Ie.AnalyticsContext),c=function(e){null==e||e.stopPropagation();xX.Z.addRelationship({userId:t.id,context:{location:"Friends"},type:void 0,friendToken:void 0,fromFriendSuggestion:!0})},l=function(e){null==e||e.stopPropagation();zz(t.id)},u=i===M.Skl.OFFLINE?M.Skl.UNKNOWN:i;return(0,r.jsx)(T$,{isFocused:a,user:t,onClick:function(){return(0,xp.m)({userId:t.id,analyticsLocation:s.location})},children:function(e){var o=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l$,{icon:gA.Z,actionType:l$.ActionTypes.ACCEPT,tooltip:Q.Z.Messages.FRIEND_REQUEST_ACCEPT,onClick:c,shouldHighlight:e}),(0,r.jsx)(l$,{icon:Ub.Z,actionType:l$.ActionTypes.DENY,
tooltip:Q.Z.Messages.FRIEND_REQUEST_IGNORE,onClick:l,shouldHighlight:e})]});return(0,r.jsxs)("div",{className:vJ().listItemContents,children:[(0,r.jsx)(j$,{user:t,hovered:e,status:u,subText:n,className:vJ().userInfo}),(0,r.jsx)("div",{className:vJ().actions,children:o})]})}})}function IJ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function SJ(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function TJ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){SJ(e,t,n[t])}))}return e}function NJ(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e)
;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function AJ(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return IJ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IJ(e,t)
}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function CJ(e,t){switch(e){case M.pJs.ONLINE:return Q.Z.Messages.FRIENDS_ONLINE_HEADER.format({online:t.toString()});case M.pJs.PENDING:return Q.Z.Messages.FRIENDS_PENDING_HEADER.format({count:t.toString()});case M.pJs.SUGGESTIONS:return Q.Z.Messages.FRIENDS_FRIEND_SUGGESTIONS_HEADER.format({count:t.toString()});case M.pJs.BLOCKED:return Q.Z.Messages.FRIENDS_BLOCKED_HEADER.format({count:t.toString()});default:return Q.Z.Messages.FRIENDS_ALL_HEADER.format({count:t.toString()})}}const PJ=function(e){var t=e.sectionFilter,n=e.titleId,i=(0,s.cj)([aQ],(function(){return aQ.getState()})),a=i.rows,c=i.section,l=(0,s.e7)([We.Z],(function(){return We.Z.isFocused()})),u=(0,s.e7)([Ja.Z],(function(){return Ja.Z.getRelationshipCount()})),f=AJ(o.useState((function(){var e={},t=!0,n=!1,r=void 0;try{
for(var o,i=Object.values(M.pJs)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){e[o.value]=""}}catch(e){n=!0;r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return e})),2),d=f[0],p=f[1],h=o.useCallback((function(e){p(NJ(TJ({},d),SJ({},t,e)))}),[d,t]),y=o.useCallback((function(){p(NJ(TJ({},d),SJ({},t,"")))}),[d,t]),m=a.filter(t,d[t]);if(0===m.length&&""===d[t])return(0,r.jsx)("div",{className:oJ().emptyStateContainer,children:(0,r.jsx)(KQ,{type:t,onClick:function(){Hz.Z.setSection(M.pJs.ADD_FRIEND)}},c)});var b=[m],g=0===m.length&&""!==d[t];return(0,r.jsxs)(fW.Z,{section:M.jXE.FRIENDS_LIST,children:[(0,r.jsx)(yj.Z,{className:lh()(oJ().searchBar,g?oJ().searchEmptyState:null),query:d[t],onChange:h,onClear:y,size:yj.Z.Sizes.MEDIUM}),(0,r.jsx)("div",{className:oJ().SectionTitle,children:(0,r.jsx)(gJ,{id:n,title:CJ(t,m.length)})}),g?(0,r.jsx)("div",{className:oJ().emptyStateContainer,children:(0,r.jsx)(KQ,{type:HQ.SECTION_NO_RESULTS},c)}):(0,r.jsx)(yJ,{
relationshipCount:u,statusSections:b,renderRow:function(e){switch(t){case M.pJs.BLOCKED:return(0,r.jsx)(M$,NJ(TJ({},e),{isFocused:l}));case M.pJs.PENDING:return(0,r.jsx)(tJ,NJ(TJ({},e),{isFocused:l}));case M.pJs.SUGGESTIONS:return(0,r.jsx)(_J,NJ(TJ({},e),{isFocused:l}));case M.pJs.ONLINE:case M.pJs.ALL:default:return(0,r.jsx)($$,NJ(TJ({},e),{isFocused:l}))}},sectionFilter:t,searchQuery:d[t],useReducedMotion:E.Z.useReducedMotion})]})};var jJ=n(433979),RJ=n.n(jJ);function xJ(){return(0,r.jsxs)("div",{className:RJ().inviteToolbar,children:[(0,r.jsx)(uW.Z,{tooltip:Q.Z.Messages.NEW_GROUP_DM}),(0,r.jsx)(Og.Z.Divider,{})]})}const MJ=function(e){var t=e.initialSection;o.useEffect((function(){qH(M.Z5c.FRIENDS);(0,uV.e)("friends")}));o.useEffect((function(){null!=t&&Hz.Z.setInitialSection(t)}),[t]);var n=(0,s.e7)([st.Z],(function(){return st.Z.theme})),i=(0,s.cj)([aQ],(function(){return aQ.getState()})),a=i.section,l=i.pendingCount,u=(0,s.cj)([lW],(function(){return lW.getSuggestionCount()
})),f=(0,q.Dt)(),d=(0,q.Dt)();return(0,r.jsxs)("main",{className:RJ().container,"aria-label":Q.Z.Messages.FRIENDS,children:[(0,r.jsx)(Am.yY,{location:Q.Z.Messages.FRIENDS}),(0,r.jsxs)(Og.Z,{className:(0,pV.Q)(n),toolbar:(0,r.jsx)(xJ,{}),scrollable:no.tq,role:"navigation","aria-labelledby":f,children:[(0,r.jsx)(Og.Z.Icon,{icon:sQ.Z,"aria-hidden":!0}),(0,r.jsx)(Og.Z.Title,{id:f,children:Q.Z.Messages.FRIENDS}),(0,r.jsx)(Og.Z.Divider,{}),(0,r.jsxs)(c.njP,{"aria-label":Q.Z.Messages.FRIENDS,selectedItem:a,type:"top-pill",onItemSelect:function(e){Hz.Z.setSection(e)},className:RJ().tabBar,children:[(0,r.jsx)(c.njP.Item,{id:M.pJs.ONLINE,className:RJ().item,children:Q.Z.Messages.FRIENDS_SECTION_ONLINE}),(0,r.jsx)(c.njP.Item,{id:M.pJs.ALL,className:RJ().item,children:Q.Z.Messages.FRIENDS_SECTION_ALL}),(0,r.jsxs)(c.njP.Item,{id:M.pJs.PENDING,className:RJ().item,"aria-label":Q.Z.Messages.FRIENDS_SECTION_PENDING,children:[Q.Z.Messages.FRIENDS_SECTION_PENDING,l>0?(0,r.jsx)(_j.mA,{count:l,
className:RJ().badge,style:{paddingRight:0}}):null]}),u>0?(0,r.jsxs)(c.njP.Item,{id:M.pJs.SUGGESTIONS,className:RJ().item,"aria-label":Q.Z.Messages.FRIENDS_SECTION_SUGGESTIONS,children:[Q.Z.Messages.FRIENDS_SECTION_SUGGESTIONS,(0,r.jsx)(_j.mA,{count:u,className:RJ().badge,style:{paddingRight:0}})]}):null,(0,r.jsx)(c.njP.Item,{id:M.pJs.BLOCKED,className:RJ().item,children:Q.Z.Messages.BLOCKED}),(0,r.jsx)(c.njP.Item,{"aria-label":Q.Z.Messages.FRIENDS_SECTION_ADD_FRIEND,className:lh()(RJ().item,RJ().addFriend),id:M.pJs.ADD_FRIEND,children:(0,r.jsx)("span",{children:Q.Z.Messages.FRIENDS_SECTION_ADD_FRIEND})})]})]}),(0,r.jsxs)("div",{className:RJ().tabBody,children:[(0,r.jsx)(c.njP.Panel,{id:a,className:RJ().peopleColumn,"aria-labelledby":d,children:a===M.pJs.ADD_FRIEND?(0,r.jsx)($Q,{}):(0,r.jsx)(PJ,{titleId:d,sectionFilter:a})}),(0,r.jsx)("div",{className:RJ().nowPlayingColumn,children:(0,r.jsx)(RX,{})})]})]})}
;var wJ=n(247250),DJ=n(43566),ZJ=n(394352),LJ=n(442658),UJ=n(401080),kJ=n(552889),GJ=n(796909),BJ=n(58838),HJ=n(173808),VJ=n(136317),FJ=n(436145),YJ=n(821),zJ=n(398344),WJ=n(195363),KJ=n(401340),qJ=n(940581),XJ=n(788138),QJ=n.n(XJ),$J=n(163471),JJ=n.n($J),e0=n(770631),t0=n.n(e0),n0=n(961088),r0=n.n(n0),o0=n(630234),i0=n.n(o0),a0=n(456202),s0=n.n(a0),c0=n(791643),l0=n.n(c0),u0=n(565411),f0=n.n(u0);function d0(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p0(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function h0(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{
if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return d0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d0(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var E0,y0=function(e){var t=e.stepDescription,n=e.hasCompletedStep,o=e.image,i=e.onClick,a=e.tooltipText,s=e.isEnabled,l=void 0===s||s,u=e.shouldPreventDefaultEmojiPickerToggle,f=void 0!==u&&u;return(0,r.jsx)(c.ua7,{shouldShow:!l,text:a,position:"right",tooltipContentClassName:QJ().tooltipText,spacing:20,children:function(e){var a,s,u,d,p,h=e.onMouseEnter,E=e.onMouseLeave;return(0,r.jsx)(c.P3F,{onMouseEnter:h,onMouseLeave:E,onClick:function(){l&&i()},className:lh()((a={},
p0(a,QJ().tutorialLinkcontainer,!0),p0(a,QJ().tutorialLinkcontainerEnabled,l),a)),"data-premium-tutorial-persistent-coachmark-emoji-step":f,children:(0,r.jsxs)("div",{className:lh()(p0({},QJ().tutorialLinkBackground,!0)),children:[(0,r.jsx)("div",{className:lh()((s={},p0(s,QJ().tutorialLinkImageContainer,!0),p0(s,QJ().tutorialLinkImageContainerDisabled,!l),s)),children:o}),(0,r.jsx)(c.xvT,{variant:"text-sm/medium",className:lh()((u={},p0(u,QJ().tutorialLink,!0),p0(u,QJ().tutorialLinkEnabled,l),p0(u,QJ().tutorialLinkDisabled,!l),u)),children:t}),n?(0,r.jsx)(gA.Z,{className:lh()((d={},p0(d,QJ().tutorialCheckmark,!0),p0(d,QJ().tutorialCheckmarkEnabled,l),p0(d,QJ().tutorialCheckmarkDisabled,!l),d))}):(0,r.jsx)("div",{className:QJ().rightCaretContainer,children:(0,r.jsx)(VJ.Z,{width:16,className:lh()((p={},p0(p,QJ().tutorialRightCaret,!0),p0(p,QJ().tutorialRightCaretEnabled,l),p0(p,QJ().tutorialRightCaretDisabled,!l),p))})})]})})}})};!function(e){e[e.JUMP_TO_DM=0]="JUMP_TO_DM"
;e[e.JUMP_TO_SERVER=1]="JUMP_TO_SERVER";e[e.OPEN_CHAT=2]="OPEN_CHAT"}(E0||(E0={}));var m0=function(e){var t=e.hasCompletedProfileTutorial,n=e.hasCompletedBoostTutorial,i=e.hasCompletedEmojiTutorial,a=e.analyticsLocations,c=(0,UJ.Z)({analyticsLocation:{page:M.ZY5.PREMIUM_TRIAL_TUTORIAL_COACHMARK}}),l=(0,s.e7)([P.Z],(function(){return P.Z.getGuildId()})),u=(0,s.e7)([C.Z],(function(){return C.Z.getChannelId(l)})),f=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(u)})),d=null!=f&&f.type===r_.d.GUILD_VOICE,p=(0,s.Wu)([kJ.Z],(function(){return kJ.Z.getFlattenedGuildIds()})),h=function(e,t,n,r){var o=(0,s.cj)([kR.Z,dn.Z,OR.ZP],(function(){if(!kR.Z.hasUsableEmojiInAnyGuild())return{canUserSendEmoji:!1,userCantSendEmojiReason:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_EMOJI_FLOW_DISABLED_TOOLTIP};if(null==r){var o=e.find((function(e){return!OR.ZP.hasUnread(e)}));return null!=o?{canUserSendEmoji:!0,userCantSendEmojiReason:void 0,actionType:E0.JUMP_TO_DM,firstChannelWithNoNewMessages:o}:t.length>0?{
canUserSendEmoji:!0,userCantSendEmojiReason:void 0,actionType:E0.JUMP_TO_SERVER,guildId:t[0]}:{canUserSendEmoji:!1,userCantSendEmojiReason:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_OPEN_CHANNEL_TOOLTIP}}if(r.type!==r_.d.DM&&r.type!==r_.d.GUILD_TEXT&&r.type!==r_.d.GROUP_DM&&r.type!==r_.d.PUBLIC_THREAD&&r.type!==r_.d.PRIVATE_THREAD&&r.type!==r_.d.GUILD_VOICE)return{canUserSendEmoji:!1,userCantSendEmojiReason:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_CHANNEL_DOESNT_ALLOW_EMOJI_TOOLTIP};if(null!=n){if(!dn.Z.can(M.Plq.SEND_MESSAGES,r))return{canUserSendEmoji:!1,userCantSendEmojiReason:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_OPEN_CHANNEL_TOOLTIP};if(!dn.Z.can(M.Plq.USE_EXTERNAL_EMOJIS,r))return{canUserSendEmoji:!1,userCantSendEmojiReason:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_CHANNEL_DOESNT_ALLOW_EMOJI_TOOLTIP}}return{canUserSendEmoji:!0,userCantSendEmojiReason:void 0,actionType:E0.OPEN_CHAT}})),i=o.canUserSendEmoji,a=o.userCantSendEmojiReason,c=o.actionType,l=o.firstChannelWithNoNewMessages,u=o.guildId
;return{canUserSendEmoji:i,userCantSendEmojiReason:a,onClickEmojiTutorial:function(){i&&(c===E0.JUMP_TO_DM&&void 0!==l?(0,K.uL)(M.Z5c.CHANNEL(M.ME,l)):c===E0.JUMP_TO_SERVER&&void 0!==u?(0,AK.X)(u):c===E0.OPEN_CHAT&&void 0!==r&&r.type===r_.d.GUILD_VOICE&&wJ.Z.updateChatOpen(r.id,!0))}}}((0,s.Wu)([GJ.Z,$H.Z,JH.Z],(function(){var e=GJ.Z.getPrivateChannelIds();return(0,LJ.tU)(e,[$H.Z,JH.Z])})),p,l,f),E=h.canUserSendEmoji,y=h.userCantSendEmojiReason,m=h.onClickEmojiTutorial,b=function(e){var t=(0,s.cj)([P.Z,Zt.Z],(function(){if(0===e.length)return{isBoostStepEnabled:!1};var t=P.Z.getGuildId();return{isBoostStepEnabled:!0,currentGuild:Zt.Z.getGuild(t)}})),n=t.isBoostStepEnabled,r=t.currentGuild;return{isBoostStepEnabled:n,onClickBoostingTutorial:function(){n&&null==r&&e.length>0&&(0,AK.X)(e[0])}}}(p),g=b.isBoostStepEnabled,O=b.onClickBoostingTutorial,v=(0,Jb.ZP)();o.useEffect((function(){E||Ie.default.track(M.rMx.PREMIUM_FEATURE_TUTORIAL_FLOW_DISABLED,{flow:"emoji"})
;g||Ie.default.track(M.rMx.PREMIUM_FEATURE_TUTORIAL_FLOW_DISABLED,{flow:"boost"})}),[E,g]);return(0,r.jsxs)("div",{className:QJ().tutorialStepsContainer,children:[(0,r.jsx)(y0,{stepDescription:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_CUSTOM_PROFILES,hasCompletedStep:t,image:(0,r.jsx)("img",{alt:"",src:i0()}),onClick:function(){(0,GE.w9)(jf.QD.PROFILE_CUSTOMIZATION);!function(e,t){Ie.default.track(M.rMx.PREMIUM_FEATURE_HELPER_ACTIONS,{location_stack:t,helper_action:jf.wt.CUSTOM_PROFILES_CLICKED});(0,KJ.k)(jf.MY[jf.QD.PROFILE_CUSTOMIZATION][0]);e();(0,FJ.p)(!0)}(c,a)}}),(0,r.jsx)("hr",{className:QJ().tutorialLinkSeparator}),(0,r.jsx)(y0,{stepDescription:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_EMOJI,hasCompletedStep:i,image:(0,r.jsx)("img",{alt:"",src:r0(),className:QJ().emojiTutorialImg}),onClick:function(){null==m||m();(0,GE.w9)(jf.QD.CUSTOM_EMOJI);!function(e,t){Ie.default.track(M.rMx.PREMIUM_FEATURE_HELPER_ACTIONS,{location_stack:e,helper_action:jf.wt.UNLOCK_EMOJI_CLICKED})
;var n=t?Tb.I.SIDEBAR:Tb.I.NORMAL;(0,ZJ.RO)(qJ.X1.EMOJI,n);(0,YZ.$u)(ln.z$.PREMIUM_TUTORIAL_EMOJI_PICKER_COMPOSER_TOOLTIP);(0,KJ.k)(jf.MY[jf.QD.CUSTOM_EMOJI][0]);(0,FJ.p)(!0)}(a,d);!function(){var e=P.Z.getGuildId(),t=0;kR.Z.getTopEmoji(e).length>0&&t++;kR.Z.getDisambiguatedEmojiContext(e).favoriteEmojisWithoutFetchingLatest.length>0&&t++;kR.Z.getDisambiguatedEmojiContext(e).getFrequentlyUsedEmojisWithoutFetchingLatest().length>0&&t++;DJ.kJ.setActiveCategoryIndex(t)}()},tooltipText:y,isEnabled:E,shouldPreventDefaultEmojiPickerToggle:!0}),(0,r.jsx)("hr",{className:QJ().tutorialLinkSeparator}),(0,r.jsx)(y0,{stepDescription:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_BOOSTS,hasCompletedStep:n,image:(0,r.jsx)("img",{alt:"",src:v===M.BRd.DARK?JJ():t0(),className:QJ().boostTutorialImg}),onClick:function(){null==O||O();(0,GE.w9)(jf.QD.BOOSTING);!function(e){Ie.default.track(M.rMx.PREMIUM_FEATURE_HELPER_ACTIONS,{location_stack:e,helper_action:jf.wt.SERVER_BOOSTS_CLICKED});(0,fZ.l)(!0);(0,
YZ.$u)(ln.z$.PREMIUM_TUTORIAL_SERVER_MENU_TOOLTIP);(0,KJ.k)(jf.MY[jf.QD.BOOSTING][0]);(0,FJ.p)(!0)}(a)},tooltipText:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_BOOST_FLOW_DISABLED_TOOLTIP,isEnabled:g})]})},b0=function(e,t){if(!t&&e>=1&&e<3)return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_WELCOME_BACK;switch(e){case 1:return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_HEADER_COMPLETED_ONE;case 2:return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_HEADER_LAST_ONE;case 3:return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_HEADER_COMPLETED;default:return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_HEADER}},g0=function(e){switch(e){case 1:return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_SUB_HEADER_CHOOSE_ANOTHER_PERK;case 2:return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_SUB_HEADER_LAST_ONE;case 3:return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_SUB_HEADER_COMPLETED;default:return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_SUB_HEADER}},O0=function(e){
var t=zJ.Z.isPersistentCoachmarkCollapsed?jf.wt.HELPER_UNCOLLAPSED:jf.wt.HELPER_COLLAPSED;Ie.default.track(M.rMx.PREMIUM_FEATURE_HELPER_ACTIONS,{location_stack:e,helper_action:t});(0,FJ.Lt)()},v0=function(e){var t=e.analyticsLocations,n=e.setDisplayDismissConfirmation,o=e.dismissedTutorialStepsLength,i=e.hasCompletedStepDuringSession,a=e.hasCompletedProfileTutorial,s=e.hasCompletedBoostTutorial,l=e.hasCompletedEmojiTutorial,u=e.hasCompletedAllSteps;return(0,r.jsxs)("div",{className:QJ().expandedCoachmarkContent,children:[(0,r.jsx)(c.xvT,{className:QJ().expandedCoachmarkHeader,variant:"text-md/semibold",children:b0(o,i)}),(0,r.jsx)(c.xvT,{className:QJ().expandedCoachmarkSubheader,variant:"text-sm/normal",children:g0(o)}),(0,r.jsx)(m0,{hasCompletedProfileTutorial:a,hasCompletedBoostTutorial:s,hasCompletedEmojiTutorial:l,analyticsLocations:t}),u&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("hr",{className:QJ().tutorialLinkSeparator}),(0,r.jsxs)("div",{
className:QJ().expandedCoachmarkFooterContent,children:[(0,r.jsx)(c.P3F,{onClick:function(){return n(!0)},children:(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:QJ().closeHelperLink,children:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_MARKETING_CLOSE})}),(0,r.jsx)(c.P3F,{onClick:function(){return function(e){Ie.default.track(M.rMx.PREMIUM_FEATURE_HELPER_ACTIONS,{location_stack:e,helper_action:jf.wt.EXPLORE_ALL_PERKS_CLICKED});(0,K.uL)(M.Z5c.APPLICATION_STORE)}(t)},children:(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:QJ().seeAllPerksLink,children:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_MARKETING_REDIRECT})})]})]})]})},_0=function(e){var t=e.analyticsLocations,n=e.setDisplayDismissConfirmation;return(0,r.jsxs)("div",{className:QJ().expandedCoachmarkContent,children:[(0,r.jsx)(c.xvT,{className:QJ().expandedCoachmarkHeader,variant:"text-md/semibold",children:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_CLOSE_CONFIRMATION_HEADER}),(0,r.jsx)(c.xvT,{
className:QJ().expandedCoachmarkSubheader,variant:"text-sm/normal",children:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_CLOSE_CONFIRMATION_SUBHEADER}),(0,r.jsx)("hr",{className:QJ().tutorialDismissConfirmationSeparator}),(0,r.jsxs)("div",{className:QJ().expandedCoachmarkFooterContent,children:[(0,r.jsx)(c.zxk,{onClick:function(){return n(!1)},look:c.iLD.BLANK,color:QJ().cancelButtonColor,children:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_CLOSE_CANCEL}),(0,r.jsx)(c.zxk,{onClick:function(){return function(e){Ie.default.track(M.rMx.PREMIUM_FEATURE_HELPER_ACTIONS,{location_stack:e,helper_action:jf.wt.HELPER_DISMISSED});(0,un.EW)(ln.z$.PREMIUM_TUTORIAL_EXPERIENCE)}(t)},children:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_CLOSE_YES})]})]})},I0=function(e){var t=e.analyticsLocations,n=(0,VZ.eM)(),i=n.includes(jf.QD.PROFILE_CUSTOMIZATION),a=n.includes(jf.QD.BOOSTING),l=n.includes(jf.QD.CUSTOM_EMOJI),u=h0(o.useState(!1),2),f=u[0],d=u[1];o.useEffect((function(){i&&a&&l&&d(!0)}),[i,a,l])
;var p=(0,s.e7)([YJ.Z],(function(){return YJ.Z.hasCompletedStepDuringSession})),h=h0(o.useState(!1),2),y=h[0],m=h[1],b=(0,s.e7)([E.Z],(function(){return E.Z.useReducedMotion})),g=(0,s.e7)([zJ.Z],(function(){return zJ.Z.canPlayWowMoment}));o.useEffect((function(){return function(){g&&(0,FJ.HY)(!1)}}),[g]);var O=g&&!b;return(0,r.jsxs)("div",{className:lh()(QJ().expandedCoachmarkContentContainer,O&&QJ().slideInFromBottomAnimation),children:[O&&(0,r.jsx)(WJ.PremiumSubscriptionWowMomentForHelper,{}),(0,r.jsxs)("div",{className:QJ().expandedCoachmarkBannerContainer,children:[(0,r.jsx)("div",{className:QJ().expandedCoachmarkBannerBranding,children:(0,r.jsx)(HJ.Z,{color:$b.Z.unsafe_rawColors.WHITE_500.css,height:"26px"})}),(0,r.jsx)("div",{className:QJ().expandedCoachmarkBannerImageContainer,children:p||f?(0,r.jsx)("img",{alt:"",src:s0(),className:QJ().expandedCoachmarkCelebrationBannerImage}):(0,r.jsx)("img",{alt:"",src:f0(),className:QJ().expandedCoachmarkBannerImage})}),(0,r.jsx)(c.P3F,{
onClick:function(){return O0(t)},className:QJ().expandedCoachmarkCollapseButtonContainer,children:(0,r.jsx)(Zw.Z,{open:!1,className:QJ().expandedCoachmarkCollapseButton})})]}),y?(0,r.jsx)(_0,{analyticsLocations:t,setDisplayDismissConfirmation:m}):(0,r.jsx)(v0,{analyticsLocations:t,setDisplayDismissConfirmation:m,dismissedTutorialStepsLength:n.length,hasCompletedStepDuringSession:p,hasCompletedProfileTutorial:i,hasCompletedBoostTutorial:a,hasCompletedEmojiTutorial:l,hasCompletedAllSteps:f})]})},S0=function(e){var t=e.analyticsLocations;return(0,r.jsxs)(c.P3F,{onClick:function(){return O0(t)},className:QJ().collapsedCoachmarkContainer,children:[(0,r.jsx)("img",{alt:"",src:l0(),className:QJ().collapsedCoachmarkImage}),(0,r.jsx)(c.xvT,{variant:"text-sm/medium",className:QJ().collapsedCoachmarkHeading,children:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COLLAPSED_COACHMARK_HEADING}),(0,r.jsx)(BJ.Z,{className:QJ().collapsedCoachmarkExpandButton})]})};const T0=function(){var e=(0,
s.e7)([zJ.Z],(function(){return zJ.Z.isPersistentCoachmarkCollapsed})),t=(0,Hw.Z)(Pf.Z.PREMIUM_TRIAL_TUTORIAL_COACHMARK).analyticsLocations;if((0,s.e7)([zJ.Z],(function(){return zJ.Z.isPersistentHelperHidden})))return(0,r.jsx)(r.Fragment,{});Ie.default.track(M.rMx.PREMIUM_FEATURE_HELPER_ACTIONS,{location_stack:t,helper_action:jf.wt.HELPER_RENDERED});return e?(0,r.jsx)(S0,{analyticsLocations:t}):(0,r.jsx)(I0,{analyticsLocations:t})};var N0=n(628486),A0=n(88818),C0=n(595689);function P0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j0(e){j0=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return j0(e)}function R0(e,t){return!t||"object"!==M0(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function x0(e,t){x0=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return x0(e,t)}
var M0=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function w0(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=j0(e);if(t){var o=j0(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R0(this,n)}}var D0={};var Z0=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&x0(e,t)}(n,e);var t=w0(n);function n(){P0(this,n);return t.apply(this,arguments)}var r=n.prototype;r.getSkuIdForChannel=function(e){return D0[e]};r.__getLocalVars=function(){return{channelIdToSkuId:D0}};return n}(s.ZP.Store)
;Z0.displayName="ChannelSKUStore";const L0=new Z0(O.Z,{CONNECTION_OPEN:function(){D0={}},STORE_LISTING_FETCH_SUCCESS:function(e){var t=e.channelId,n=e.storeListing;null!=t&&(D0[t]=n.sku.id)}});var U0=n(491509),k0=n(954640),G0=n(252411),B0=n.n(G0);function H0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V0(e){V0=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return V0(e)}function F0(e,t){return!t||"object"!==z0(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Y0(e,t){Y0=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Y0(e,t)}var z0=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function W0(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=V0(e);if(t){var o=V0(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return F0(this,n)}}var K0=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Y0(e,t)}(n,e);var t=W0(n);function n(){H0(this,n);var e;(e=t.apply(this,arguments)).fetchStoreListing=function(t){var n=e.props,r=n.channel,o=n.inputSkuId;return null!=t?Wq.Z.fetchChannelStoreListing(r.id,t):null!=o?Wq.Z.fetchChannelStoreListing(r.id,o):Wq.Z.fetchChannelStoreListing(r.id)};e.renderApplicationListing=function(t){var n=t.location,o=e.props,i=o.channel,a=o.skuId,s=o.width;return(0,r.jsx)(k0.Z,{channel:i,inputSkuId:a,
fetchStoreListing:e.fetchStoreListing,location:n,pageSize:(0,U0.getPageSize)(s)})};return e}var o=n.prototype;o.componentDidMount=function(){this.fetchStoreListing();(0,uV.e)("channel_store_listing")};o.render=function(){return null!=this.props.skuId?(0,r.jsx)(fW.Z,{page:M.ZY5.CHANNEL_STORE_LISTING,root:!0,children:(0,r.jsx)("div",{className:B0().applicationStore,children:(0,r.jsx)(a.AW,{path:"*",render:this.renderApplicationListing})})}):null};return n}(o.Component);const q0=(0,yb.Z)(s.ZP.connectStores([L0],(function(e){var t=e.channel,n=e.inputSkuId;return{skuId:null!=n?n:L0.getSkuIdForChannel(t.id)}}))(K0));function X0(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Q0(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e)
;t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function $0(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function J0(e){var t=e.width,n=void 0===t?14:t,o=e.height,i=void 0===o?14:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=$0(e,["width","height","color","foreground"]);return(0,r.jsx)("svg",Q0(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){X0(e,t,n[t])}))}return e}({},(0,OO.Z)(l)),{width:n,height:i,viewBox:"0 0 14 14",children:(0,r.jsx)("path",{fill:s,className:c,
d:"M6.99471698,9.67522659 C8.47108874,9.67522659 9.66792453,8.47748685 9.66792453,7 C9.66792453,5.52251315 8.47108874,4.32477341 6.99471698,4.32477341 C5.51834522,4.32477341 4.32150943,5.52251315 4.32150943,7 C4.32150943,8.47748685 5.51834522,9.67522659 6.99471698,9.67522659 Z M6.99471698,2.67522659 C8.18867925,2.67522659 9.26641509,3.16163142 10.0483019,3.94410876 L11.9396226,2.05135952 C10.6822642,0.782477341 8.92830189,0 6.99471698,0 C3.12754717,0 0,3.14048338 0,7 L2.67320755,7 C2.67320755,4.6102719 4.60679245,2.67522659 6.99471698,2.67522659 Z M11.3267925,7 C11.3267925,9.3897281 9.39320755,11.3247734 7.00528302,11.3247734 C5.81132075,11.3247734 4.73358491,10.8383686 3.94113208,10.0558912 L2.04981132,11.9486405 C3.31773585,13.2175227 5.06113208,14 6.99471698,14 C10.8618868,14 14,10.8595166 14,7 L11.3267925,7 Z"})}))}var e1=n(61738),t1=n.n(e1);function n1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function r1(e,t){
return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return n1(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var o1="isHideDevBanner";const i1=function(){var e,t=r1((0,
o.useState)("true"===(null===(e=_e.Z.get(o1,"false"))||void 0===e?void 0:e.toString())),2),n=t[0],i=t[1];if(n)return null;var a=function(){_e.Z.set(o1,!0);i(!0)},s=function(){return(0,r.jsx)(c.P3F,{onClick:a,className:t1().closeButton,"aria-label":Q.Z.Messages.DISMISS,children:(0,r.jsx)(Ub.Z,{className:t1().closeIcon})})};0;if("staging"===window.GLOBAL_ENV.RELEASE_CHANNEL){return(0,r.jsxs)("div",{className:lh()(t1().devBanner,t1().staging),children:[(0,r.jsx)(J0,{className:t1().icon}),Q.Z.Messages.DEV_NOTICE_STAGING.format({buildNumber:"184344"}),(0,r.jsx)(s,{})]})}return null};var a1=n(473727),s1=n(105783);function c1(e){O.Z.dispatch({type:"DETECTED_OFF_PLATFORM_PREMIUM_PERKS_DISMISS",skuId:e})}var l1=n(216421);const u1=function(){O.Z.dispatch({type:"CLEAR_REMOTE_DISCONNECT_VOICE_CHANNEL_ID"})};var f1=n(481117),d1=n(762572),p1=n(419087),h1=n(683323),E1=n(293078),y1=n(457185),m1=n.n(y1);const b1=function(e){var t=e.noticeType,n=e.markAsDismissed,o=e.partnerGame,i=(0,
s.e7)([Y.default],(function(){return Y.default.getCurrentUser()}));if(null==o)return null;var a=(0,E1.BS)(o);if(null==a)return null;var c,l="https://survey.alchemer.com/s3/7043057/Drops-NPS?user_id=".concat(null!==(c=null==i?void 0:i.id)&&void 0!==c?c:"");return(0,r.jsxs)(CM.ZP,{className:m1().colorGuildBlue,children:[Q.Z.Messages.DROPS_BANNER_ENDED_INCOMPLETE.format({gameTitle:a.title}),(0,r.jsx)(CM.u3,{href:l,target:"_blank",onClick:function(){n(hn.L.PRIMARY)},children:Q.Z.Messages.DROPS_FEEDBACK_SURVEY}),(0,r.jsx)(CM.Ry,{onClick:function(){n(hn.L.DISMISS)},noticeType:t})]})};var g1=n(516659),O1=n(297629),v1=n.n(O1);const _1=function(e){var t=e.noticeType,n=e.markAsDismissed,o=e.partnerGame,i=(0,g1.au)(o);if(null==i)return null;var a,s,c=(a=i.drop,s=i.config.streamLengthRequirement,{bodyText:Q.Z.Messages.DROPS_BANNER_NOTICE.format({gameName:a.title,endDate:fO()(a.endDate,"YYYY-MM-DD HH:mm").format("MMM Do"),streamLengthRequirement:s}),articleUrl:a.articleUrl
}),l=c.bodyText,u=c.articleUrl;return(0,r.jsxs)(CM.ZP,{className:v1().colorGuildBlue,children:[l,(0,r.jsx)(CM.u3,{href:u,target:"_blank",onClick:function(){n(hn.L.PRIMARY)},children:Q.Z.Messages.LEARN_MORE}),(0,r.jsx)(CM.Ry,{onClick:function(){n(hn.L.DISMISS)},noticeType:t})]})};function I1(e){var t=e.dismissCurrentNotice,n=(0,dE.ZP)([P.Z],(function(){return P.Z.getGuildId()}),[]),o=(0,dE.ZP)([Zt.Z],(function(){return Zt.Z.getGuild(n)}),[n]);return null==o?null:(0,r.jsxs)(CM.ZP,{color:CM.DM.DEFAULT,children:[(0,r.jsx)(CM.Ry,{onClick:t}),Q.Z.Messages.GUILD_ONBOARDING_CHANNEL_NOTICE_MESSAGE,(0,r.jsx)(CM.Ey,{onClick:function(){pr.Z.open(o.id,M.pNK.ONBOARDING)},children:Q.Z.Messages.GUILD_ONBOARDING_UPSELL_COACHMARK_CHECK_IT_OUT})]})}var S1=n(43299),T1=n(895058),N1=n(201556),A1=n(838229),C1=n.n(A1);const P1=function(e){var t=e.notice,n=e.noticeType,o=e.dismissCurrentNotice,i=null!=(null==t?void 0:t.metadata.premiumSubscription),a=(0,T1.n)();(0,
N1.U)(M.jXE.NOTIFICATION_BAR,null==a?void 0:a.countryCode);if(null==a)return null;var s=a.countryCode,c=a.currency,l=a.paymentSourceTypes.length>0;return(0,r.jsxs)(CM.ZP,{color:i?CM.DM.BRAND:CM.DM.PREMIUM_TIER_2,children:[(0,r.jsx)(CM.Ry,{onClick:o,noticeType:n}),!i&&(0,r.jsx)(eL.Z,{className:C1().premiumIcon}),(0,S1.Gv)(s,c,l,i),(0,r.jsx)(CM.No,{onClick:function(){o();h.Z.open(M.oAB.PREMIUM)},noticeType:n,children:Q.Z.Messages.LEARN_MORE})]})};var j1=n(73407),R1=n(4572);function x1(e){switch(e){case jf.Si.TIER_0:return CM.DM.PREMIUM_TIER_0;case jf.Si.TIER_2:return CM.DM.PREMIUM_TIER_2;default:throw new Error("Unsupported subscription tier: ".concat(e))}}function M1(e,t){switch(e){case jf.Si.TIER_0:return t.days>0?Q.Z.Messages.NOTICE_PREMIUM_TIER_0_TRIAL_ENDING_DAYS_VARIANT.format({days:t.days}):t.hours>0?Q.Z.Messages.NOTICE_PREMIUM_TIER_0_TRIAL_ENDING_HOURS_VARIANT.format({hours:t.hours}):Q.Z.Messages.NOTICE_PREMIUM_TIER_0_TRIAL_ENDING_MINUTES_VARIANT.format({
minutes:Math.max(t.minutes,1)});case jf.Si.TIER_2:return t.days>0?Q.Z.Messages.NOTICE_PREMIUM_TIER_2_TRIAL_ENDING_DAYS_VARIANT.format({days:t.days}):t.hours>0?Q.Z.Messages.NOTICE_PREMIUM_TIER_2_TRIAL_ENDING_HOURS_VARIANT.format({hours:t.hours}):Q.Z.Messages.NOTICE_PREMIUM_TIER_2_TRIAL_ENDING_MINUTES_VARIANT.format({minutes:Math.max(t.minutes,1)});default:throw new Error("Unsupported subscription tier: ".concat(e))}}function w1(e){switch(e){case jf.Si.TIER_0:return Q.Z.Messages.NOTICE_PREMIUM_TIER_0_TRIAL_ENDING_CTA_VARIANT;case jf.Si.TIER_2:return Q.Z.Messages.NOTICE_PREMIUM_TIER_2_TRIAL_ENDING_CTA_VARIANT;default:throw new Error("Unsupported subscription tier: ".concat(e))}}const D1=function(e){var t,n=e.dismissCurrentNotice,o=e.subscriptionTier,i=(0,Hw.Z)(function(e){switch(e){case jf.Si.TIER_0:return Pf.Z.PREMIUM_TIER_0_TRIAL_ENDING_NOTICE;case jf.Si.TIER_2:return Pf.Z.PREMIUM_TIER_2_TRIAL_ENDING_NOTICE;default:throw new Error("Unsupported subscription tier: ".concat(e))}
}(o)).analyticsLocations,a=(0,R1.Np)(),s=(0,j1.Z)(null!=a&&null!=a.expires_at?Date.parse(a.expires_at):0);return null==a||(null===(t=a.subscription_trial)||void 0===t?void 0:t.sku_id)!==o||null==a.expires_at||Object.values(s).every((function(e){return 0===e}))?null:(0,r.jsxs)(CM.ZP,{color:x1(o),children:[(0,r.jsx)(CM.Ry,{onClick:n}),(0,r.jsx)(eL.Z,{className:C1().premiumIcon}),M1(o,s),(0,r.jsx)(CM.Ey,{onClick:function(){(0,$Z.Z)({trialId:a.trial_id,subscriptionTier:o,analyticsLocations:i,analyticsObject:{page:M.ZY5.IN_APP,section:M.jXE.NOTIFICATION_BAR,object:M.qAy.BUTTON_CTA}})},children:w1(o)})]})};function Z1(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function L1(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Z1(i,r,o,a,s,"next",e)}function s(e){Z1(i,r,o,a,s,"throw",e)}a(void 0)}))}}function U1(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,
configurable:!0,writable:!0}):e[t]=n;return e}var k1=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}
i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},G1=function(e){var t=e.dismissibleContent,o=e.noticeType,i=(0,s.e7)([A0.Z],(function(){return A0.Z.getNotice()}));return(0,r.jsx)(WN.Z,{contentTypes:[t],children:function(e){var t=e.visibleContent,a=e.markAsDismissed;switch(t){case ln.z$.GUILD_ONBOARDING_UPSELL_NAGBAR:return(0,r.jsx)(I1,{dismissCurrentNotice:a});case ln.z$.NAGBAR_NOTICE_DOWNLOAD:return(0,r.jsxs)(CM.ZP,{color:CM.DM.DEFAULT,children:[(0,r.jsx)(CM.Ry,{onClick:a,noticeType:o}),Q.Z.Messages.NOTICE_NATIVE_APPS_2020_06,(0,r.jsx)("i",{className:C1().iconApple}),(0,r.jsx)("i",{className:C1().iconAndroid}),(0,r.jsx)("i",{className:C1().iconWindows}),(0,r.jsx)(CM.No,{noticeType:o,onClick:function(){(0,c.ZDy)(L1((function(){var e,t;return k1(this,(function(o){switch(o.label){case 0:return[4,Promise.resolve().then(n.bind(n,908056))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,function(e){
for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){U1(e,t,n[t])}))}return e}({source:"Top Bar Nag"},e))}]}}))})))},children:Q.Z.Messages.DOWNLOAD})]});case ln.z$.NAGBAR_NOTICE_CONNECT_SPOTIFY:return(0,r.jsxs)(CM.ZP,{color:CM.DM.SPOTIFY,children:[(0,r.jsx)(CM.Ry,{onClick:a,noticeType:o}),(0,r.jsx)(BK.Z,{className:C1().platformIcon}),Q.Z.Messages.NOTICE_CONNECT_SPOTIFY,(0,r.jsx)(CM.No,{onClick:function(){return(0,p1.Z)(M.ABu.SPOTIFY,"Notice Bar")},noticeType:o,children:Q.Z.Messages.CONNECT})]});case ln.z$.NAGBAR_NOTICE_CONNECT_PLAYSTATION:return(0,r.jsxs)(CM.ZP,{color:CM.DM.PLAYSTATION,children:[(0,r.jsx)(CM.Ry,{onClick:a}),(0,r.jsx)("img",{alt:"",className:C1().platformIcon,src:jK.Z.get(M.ABu.PLAYSTATION).icon.whiteSVG
}),Q.Z.Messages.NOTICE_CONNECT_PLAYSTATION,(0,r.jsx)(CM.Ey,{onClick:function(){return(0,p1.Z)(M.ABu.PLAYSTATION,"Notice Bar")},children:Q.Z.Messages.CONNECT})]});case ln.z$.NAGBAR_NOTICE_MFA_SMS_BACKUP:return(0,r.jsxs)(CM.ZP,{color:CM.DM.DEFAULT,children:[(0,r.jsx)(CM.Ry,{onClick:a,noticeType:o}),Q.Z.Messages.NOTICE_MFA_SMS_BACKUP,(0,r.jsx)(CM.No,{onClick:function(){return h.Z.open(M.oAB.ACCOUNT)},noticeType:o,children:Q.Z.Messages.NOTICE_MFA_SMS_BACKUP_BUTTON})]});case ln.z$.NAGBAR_NOTICE_PREMIUM_PROMO:return(0,r.jsxs)(CM.ZP,{color:CM.DM.PREMIUM_TIER_2,children:[(0,r.jsx)("span",{className:C1().premiumLogo}),(0,r.jsx)("span",{className:C1().premiumText,children:Q.Z.Messages.NOTICE_PREMIUM_PROMO_MESSAGE}),(0,r.jsx)(CM.No,{className:C1().premiumAction,noticeType:o,onClick:function(){Ie.default.track(M.rMx.PREMIUM_PROMOTION_OPENED,{location_section:M.jXE.NOTIFICATION_BAR,location_object:M.qAy.BUTTON_CTA});h.Z.open(M.oAB.PREMIUM)},children:Q.Z.Messages.NOTICE_PREMIUM_PROMO_ACTION}),(0,
r.jsx)(CM.Ry,{onClick:function(){a();(0,rl.mB)(M.xW$.PREMIUM_PROMO_DISMISSED,!0)},noticeType:o})]});case ln.z$.NAGBAR_NOTICE_PREMIUM_TIER_TWO_TRIAL_ENDING:return(0,r.jsx)(D1,{dismissCurrentNotice:a,subscriptionTier:jf.Si.TIER_2});case ln.z$.NAGBAR_NOTICE_PREMIUM_TIER_0_TRIAL_ENDING:return(0,r.jsx)(D1,{dismissCurrentNotice:a,subscriptionTier:jf.Si.TIER_0});case ln.z$.NAGBAR_NOTICE_PREMIUM_REACTIVATE:return(0,r.jsxs)(CM.ZP,{color:CM.DM.PREMIUM_TIER_2,children:[(0,r.jsx)(CM.Ry,{noticeType:o,onClick:a}),Q.Z.Messages.PREMIUM_SUBSCRIPTION_REACTIVATION_NOTICE_TEXT,(0,r.jsx)(CM.No,{noticeType:o,onClick:function(){a();h.Z.open(M.oAB.PREMIUM)},children:Q.Z.Messages.PREMIUM_SUBSCRIPTION_REACTIVATION_NOTICE_BUTTON_TEXT})]});case ln.z$.NAGBAR_NOTICE_LOCALIZED_PRICING:return(0,r.jsx)(P1,{notice:i,noticeType:o,dismissCurrentNotice:a});case ln.z$.QUEST_1_GO_LIVE_BANNER:var s,l=null==i||null===(s=i.metadata)||void 0===s?void 0:s.partnerGame;return(0,r.jsx)(_1,{noticeType:o,markAsDismissed:a,
partnerGame:l});case ln.z$.PREMIUM_TIER_0_NOTICE:var u=i.metadata.monthlyPrice;return(0,r.jsxs)(CM.ZP,{color:CM.DM.PREMIUM_TIER_2,children:[(0,r.jsx)(CM.Ry,{noticeType:o,onClick:a}),(0,r.jsx)(eL.Z,{className:C1().premiumIcon}),Q.Z.Messages.PREMIUM_TIER_0_NOTICE_TEXT.format({monthlyPrice:u}),(0,r.jsx)(CM.No,{noticeType:o,onClick:function(){a();(0,K.uL)(M.Z5c.APPLICATION_STORE)},children:Q.Z.Messages.LEARN_MORE})]});case ln.z$.QUEST_1_ENDED_INCOMPLETE:var f,d=null==i||null===(f=i.metadata)||void 0===f?void 0:f.partnerGame;return(0,r.jsx)(b1,{noticeType:o,markAsDismissed:a,partnerGame:d});case ln.z$.NAGBAR_BOUNCED_EMAIL_NOTICE:return(0,r.jsxs)(CM.ZP,{color:CM.DM.DANGER,children:[(0,r.jsx)(CM.Ry,{onClick:a,noticeType:o}),Q.Z.Messages.BOUNCED_EMAIL_DETECTED_NOTICE,(0,r.jsx)(CM.No,{noticeType:o,onClick:function(){(0,K.uL)(M.Z5c.SETTINGS("account"))},children:Q.Z.Messages.CHANGE_EMAIL_SHORT})]});case ln.z$.NAGBAR_ACTIVATE_SERVER_SUBSCRIPTION:var p=h1.Z.getEligibleGuildsForNagActivate()
;return(0,r.jsxs)(CM.ZP,{color:CM.DM.DEFAULT,children:[(0,r.jsx)(CM.Ry,{onClick:a,noticeType:o}),Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_NAGBAR_TEXT,(0,r.jsx)(CM.No,{noticeType:o,onClick:function(){a(hn.L.PRIMARY);(0,K.uL)(1===p.length?M.Z5c.GUILD_SETTINGS(p[0],"role-subscriptions"):M.Z5c.PICK_GUILD_SETTINGS("role-subscriptions",void 0,"server-subscriptions-finish-setting-up"))},children:Q.Z.Messages.LETS_GO})]})}}})},B1=n(920096),H1=n(11414),V1=n(716371),F1=n(745499),Y1=n.n(F1),z1=n(253166),W1=n.n(z1);function K1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function q1(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function X1(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){q1(i,r,o,a,s,"next",e)}function s(e){q1(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Q1(e,t,n){t in e?Object.defineProperty(e,t,{value:n,
enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function $1(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Q1(e,t,n[t])}))}return e}function J1(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function e2(e){return function(e){if(Array.isArray(e))return K1(e)}(e)||function(e){
if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return K1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K1(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var t2=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),
0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};const n2=function(){var e,t=(0,s.e7)([P.Z],(function(){return P.Z.getGuildId()}),[]),o=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(t)}),[t]),i=(0,s.e7)([OC.Z],(function(){return null!=t?OC.Z.getRequest(t):null}),[t]),l=(0,a.TH)(),u=!0===(null===(e=(0,
a.LX)(l.pathname,M.Z5c.CHANNEL(null==o?void 0:o.id,Ig.oC.GUILD_ONBOARDING)))||void 0===e?void 0:e.isExact);if(null==o||!o.hasVerificationGate()||u)return null;var f,d=null!==(f=null==i?void 0:i.applicationStatus)&&void 0!==f?f:gC.wB.STARTED,p=null,h=null,E=null,y=[Y1().notice,W1().notice];switch(d){case gC.wB.SUBMITTED:p=Q.Z.Messages.MEMBER_VERIFICATION_APPLICATION_CONFIRMATION_TITLE;h=Q.Z.Messages.MEMBER_VERIFICATION_CANCEL_APPLICATION;E=function(){(0,c.h7j)((function(e){return(0,r.jsx)(c.sm4,J1($1({header:Q.Z.Messages.MODIFY_FOLLOWED_NEWS_HEADER,confirmText:Q.Z.Messages.CONFIRM,cancelText:Q.Z.Messages.CANCEL,onConfirm:function(){return yC.Z.removeGuildJoinRequest(o.id)},confirmButtonColor:c.zxk.Colors.BRAND},e),{children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:Q.Z.Messages.MEMBER_VERIFICATION_CANCEL_APPLICATION_SUBTITLE})}))}))};break;case gC.wB.REJECTED:p=Q.Z.Messages.MEMBER_VERIFICATION_REJECTED_TITLE;h=Q.Z.Messages.MEMBER_VERIFICATION_LEARN_MORE;E=function(){(0,
c.ZDy)(X1((function(){var e,t;return t2(this,(function(i){switch(i.label){case 0:return[4,n.e(13621).then(n.bind(n,713621))];case 1:e=i.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,$1({guildId:o.id},e))}]}}))})))};y.push(Y1().error);break;default:p=Q.Z.Messages.MEMBER_VERIFICATION_NOTICE_TEXT;h=Q.Z.Messages.MEMBER_VERIFICATION_NOTICE_CTA;E=function(){(0,mo.hk)(o.id)}}return(0,r.jsxs)("div",{className:lh().apply(void 0,e2(y)),children:[(0,r.jsx)(c.xvT,{className:Y1().header,variant:"text-sm/normal",children:p}),(0,r.jsx)(c.zxk,{className:Y1().button,look:c.zxk.Looks.OUTLINED,color:c.zxk.Colors.WHITE,size:c.zxk.Sizes.NONE,onClick:E,children:h})]})};var r2=n(345550),o2=n(727599),i2=n(709992),a2=n(398868),s2=n.n(a2);function c2(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l2(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function u2(e,t,n){
t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function f2(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c2(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var d2=function(e,t){
var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1]
;return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};const p2=function(){var e=(0,s.e7)([P.Z],(function(){return P.Z.getGuildId()}),[]),t=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(e)}),[e]),n=(0,s.e7)([wb.Z],(function(){return wb.Z.getHistorySnapshot()}),[]),i=f2(o.useState(!1),2),a=i[0],l=i[1];if(null==t)return null;var u=function(){var e,n=(e=function(){return d2(this,(function(e){switch(e.label){case 0:l(!0);e.label=1;case 1:e.trys.push([1,3,,4]);i2.mT(t.id);return[4,f.Z.joinGuild(t.id,{source:M.vtS.NOTICE_BAR})];case 2:e.sent();return[3,4];case 3:e.sent();l(!1);return[3,4];case 4:return[2]}}))},function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){l2(i,r,o,a,s,"next",e)}function s(e){l2(i,r,o,a,s,"throw",e)}a(void 0)}))});return function(){return n.apply(this,arguments)}}();return(0,r.jsxs)("div",{className:lh()(s2().notice,W1().notice),children:[(0,r.jsxs)(c.zxk,{look:c.zxk.Looks.OUTLINED,color:c.zxk.Colors.WHITE,
size:c.zxk.Sizes.NONE,className:lh()(s2().button,s2().back),innerClassName:s2().iconButton,onClick:function(){var e=(0,K.s1)();null!=n&&null!=n.location?(0,K.dL)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){u2(e,t,n[t])}))}return e}({},n.location)):e.goBack()},children:[(0,r.jsx)(o2.Z,{width:16,height:16,className:s2().arrow}),Q.Z.Messages.BACK]}),(0,r.jsx)(c.xvT,{className:s2().header,variant:"text-sm/normal",children:Q.Z.Messages.LURKER_MODE_NAG_BAR_HEADER}),(0,r.jsx)(c.zxk,{className:s2().button,look:c.zxk.Looks.OUTLINED,color:c.zxk.Colors.WHITE,size:c.zxk.Sizes.NONE,submitting:a,onClick:u,children:Q.Z.Messages.LURKER_MODE_NAG_BAR_BUTTON.format({guild:t.name})})]})}
;var h2=n(247253),E2=n(742257),y2=n(771575),m2=n(499219),b2=n(426404),g2=n(304924),O2=n.n(g2);function v2(e){var t=C.Z.getVoiceChannelId();if(null!=t){var n=S.Z.getChannel(t);null!=n&&(0,y2.RK)(n,e)}}function _2(){var e,t=(0,m2.Z)(),n=null!==(e=(0,b2._d)(null==t?void 0:t.id))&&void 0!==e?e:0;return(0,r.jsxs)(CM.ZP,{className:O2().container,color:CM.DM.DEFAULT,children:[(0,r.jsx)("div",{children:Q.Z.Messages.STAGE_SPEAK_INVITE_HEADER}),n>0?(0,r.jsxs)("div",{className:O2().blocked,children:[(0,r.jsx)(E2.Z,{width:12,height:12,className:O2().blockedIcon}),(0,r.jsx)("div",{className:O2().blockedText,children:Q.Z.Messages.STAGE_SPEAK_INVITE_HEADER_BLOCKED_USERS.format({number:n})})]}):null,(0,r.jsx)(c.zxk,{className:lh()(O2().button,O2().acceptButton),size:c.zxk.Sizes.MIN,color:c.zxk.Colors.WHITE,onClick:function(){return v2(!1)},children:(0,r.jsx)(c.xvT,{className:O2().acceptText,variant:"text-xs/normal",color:"none",children:Q.Z.Messages.STAGE_SPEAK_INVITE_ACCEPT})}),(0,r.jsx)(c.zxk,{
className:lh()(O2().button,O2().declineButton),look:c.zxk.Looks.OUTLINED,size:c.zxk.Sizes.MIN,color:c.zxk.Colors.WHITE,onClick:function(){return v2(!0)},children:(0,r.jsx)(c.xvT,{className:O2().declineText,variant:"text-xs/normal",color:"none",children:Q.Z.Messages.STAGE_SPEAK_INVITE_DECLINE})})]})}var I2=n(746974),S2=n(842020);function T2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N2(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function A2(e){A2=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return A2(e)}function C2(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))
;n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function P2(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function j2(e,t){return!t||"object"!==x2(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function R2(e,t){R2=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return R2(e,t)}var x2=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function M2(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=A2(e);if(t){var o=A2(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return j2(this,n)}}var w2={DropdownSizes:S2.Z.DropdownSizes,Sizes:S2.Z.Sizes,Colors:S2.Z.Colors,Looks:S2.Z.Looks},D2=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&R2(e,t)}(n,e);var t=M2(n);function n(){T2(this,n);var e;(e=t.apply(this,arguments)).renderContextMenu=function(){var t=e.props,n=t.skus,o=t.onSKUSelect,i=t.onMenuSelect;return(0,r.jsx)(c.v2r,{onSelect:i,navId:"test-skus","aria-label":Q.Z.Messages.GENERIC_ACTIONS_MENU_LABEL,onClose:Ob.Zy,children:n.map((function(e){return(0,
r.jsx)(c.sNh,{id:"".concat(e.id),label:e.name,action:function(){null==o||o(e)}},"".concat(e.id))}))})};e.handleContextMenu=function(t){t.stopPropagation();Ob.vq(t,e.renderContextMenu)};e.handleClick=function(){var t=e.props,n=t.onSKUSelect,r=t.primarySKU;null!=r&&(null==n||n(r))};return e}n.prototype.render=function(){var e=this.props,t=e.skus,n=e.children,o=(e.applicationId,e.primarySKU,e.onSKUSelect,P2(e,["skus","children","applicationId","primarySKU","onSKUSelect"]));return(0,r.jsx)(S2.Z,C2(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){N2(e,t,n[t])}))}return e}({onClick:this.handleClick,onDropdownClick:t.length>0?this.handleContextMenu:null,onContextMenu:t.length>0?this.handleContextMenu:void 0},o),{children:n}))};return n
}(o.PureComponent);const Z2=s.ZP.connectStores([I2.Z,Rn.Z],(function(e){var t,n=e.applicationId,r=(0,ZM.uF)(n,Rn.Z,I2.Z);return{skus:(null!==(t=I2.Z.getForApplication(n))&&void 0!==t?t:[]).sort((function(e,t){return null!=r&&e.id===r.id?-1:null!=r&&t.id===r.id?1:e.name>=t.name?-1:1})),primarySKU:r}}))(D2);function L2(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var U2=null;function k2(){null!==U2&&(0,c.Mr3)(U2);U2=null}function G2(){Fe.Z.setSilenceWarning(!1);k2()}function B2(){U2=(0,c.h7j)((function(e){return(0,r.jsx)(th.default,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){L2(e,t,n[t])}))}return e}({title:Q.Z.Messages.CONFIRM_DISABLE_SILENCE_TITLE,
body:Q.Z.Messages.CONFIRM_DISABLE_SILENCE_BODY,secondaryConfirmText:Q.Z.Messages.CONFIRM_DISABLE_SILENCE_DONT_SHOW,onConfirmSecondary:G2,onConfirm:k2,confirmText:Q.Z.Messages.OKAY},e))}))}var H2=n(811276);function V2(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function F2(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){V2(i,r,o,a,s,"next",e)}function s(e){V2(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Y2(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function z2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Y2(e,t,n[t])}))}return e}function W2(e,t){
t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var K2=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{
value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},q2=function(){return(0,r.jsxs)(CM.ZP,{color:CM.DM.DANGER,children:[(0,r.jsx)(CM.Ry,{onClick:function(){Q2();B2()}}),Q.Z.Messages.NOTICE_NO_INPUT_DETECTED,(0,r.jsx)(CM.u3,{href:X.Z.getArticleURL(M.BhN.NO_INPUT_DETECTED),children:Q.Z.Messages.NOTICE_NO_INPUT_DETECTED_HELP_LINK_TEXT})]})},X2=function(){return(0,r.jsxs)(CM.ZP,{color:CM.DM.DANGER,children:[(0,r.jsx)(CM.Ry,{onClick:function(){Q2();B2()}}),Q.Z.Messages.NOTICE_NO_INPUT_DETECTED_SETTINGS,(0,r.jsx)(CM.Ey,{onClick:function(){
(0,eh.jN)(M.S9g.USER_SETTINGS);h.Z.setSection(M.oAB.VOICE)},children:Q.Z.Messages.NOTICE_NO_INPUT_DETECTED_SETTINGS_LINK_TEXT})]})};function Q2(e){l1.Z.dismiss(null!=e?{untilAtLeast:fO()(e)}:void 0)}var $2=o.memo((function(){var e,t=(0,s.e7)([Y.default],(function(){return Y.default.getCurrentUser()})),i=(0,s.e7)([P.Z],(function(){return P.Z.getGuildId()})),a=(0,s.e7)([A0.Z],(function(){return A0.Z.getNotice()})),u=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(i)})),f=(0,Hw.Z)().analyticsLocations,E=(0,UJ.Z)({guild:u,analyticsLocations:f,openWithoutBackstack:!0}),y=null==a?void 0:a.type,m=(0,V1.J)(i);o.useEffect((function(){null!=y&&function(e,t){var n={notice_type:e};null!=t&&(n.guild_id=t);Ie.default.track(M.rMx.APP_NOTICE_VIEWED,n)}(y,i)}),[y,i]);o.useEffect((function(){if(null!=a&&a.type===M.kVF.SURVEY&&null!=a.metadata){var e=a.metadata,t=B1.En.getUserExperimentDescriptor(e.id);null!=t&&(0,B1.W9)(e.id,t)}}),[a]);if(null==a)return null;var b=A0.m[a.type];if(null!=b)return(0,
r.jsx)(G1,{dismissibleContent:b,noticeType:a.type});var g=null===(e=a.metadata)||void 0===e?void 0:e.premiumType;switch(a.type){case M.kVF.LURKING_GUILD:return(0,r.jsx)(p2,{});case M.kVF.PENDING_MEMBER:return(0,r.jsx)(n2,{});case M.kVF.INVITED_TO_SPEAK:return(0,r.jsx)(_2,{});case M.kVF.GENERIC:return(0,r.jsxs)(CM.ZP,{color:CM.DM.DEFAULT,children:[(0,r.jsx)(CM.Ry,{onClick:function(){return Q2()},noticeType:M.kVF.GENERIC}),a.message,null!=a.buttonText?(0,r.jsx)(CM.No,{onClick:a.callback,noticeType:M.kVF.GENERIC,children:a.buttonText}):null]});case M.kVF.LAUNCH_GAME_FAILURE:return(0,r.jsxs)(CM.ZP,{color:CM.DM.DANGER,children:[(0,r.jsx)(CM.Ry,{onClick:function(){return Q2()},noticeType:M.kVF.LAUNCH_GAME_FAILURE}),a.message,null!=a.buttonText?(0,r.jsx)(CM.No,{onClick:a.callback,noticeType:M.kVF.LAUNCH_GAME_FAILURE,children:a.buttonText}):null]});case M.kVF.VOICE_DISABLED:return(0,r.jsxs)(CM.ZP,{color:CM.DM.WARNING,children:[(0,r.jsx)(CM.Ry,{onClick:function(){u1();Q2()},
noticeType:M.kVF.VOICE_DISABLED}),Q.Z.Messages.NOTICE_CONNECTION_CONFLICT,(0,r.jsx)(CM.No,{onClick:function(){var e=A.Z.getRemoteDisconnectVoiceChannelId();if(null!=e){null!=S.Z.getChannel(e)&&d.default.selectVoiceChannel(e)}},noticeType:M.kVF.VOICE_DISABLED,children:Q.Z.Messages.RECONNECT})]});case M.kVF.SPOTIFY_AUTO_PAUSED:var O=jK.Z.get(M.ABu.SPOTIFY);return(0,r.jsxs)(CM.ZP,{color:CM.DM.DANGER,children:[(0,r.jsx)(CM.Ry,{onClick:function(){return Q2()},noticeType:M.kVF.SPOTIFY_AUTO_PAUSED}),(0,r.jsx)("img",{alt:"",className:C1().platformIcon,src:O.icon.whiteSVG}),Q.Z.Messages.NOTICE_SPOTIFY_AUTO_PAUSED,(0,r.jsx)(CM.No,{onClick:function(){return h.Z.open(M.oAB.VOICE)},noticeType:M.kVF.SPOTIFY_AUTO_PAUSED,children:Q.Z.Messages.VOICE_SETTINGS}),(0,r.jsx)(c.eee,{className:C1().textLinkSmall,href:X.Z.getArticleURL(M.BhN.SPOTIFY_AUTO_PAUSED),target:"_blank",children:Q.Z.Messages.NOTICE_WHATS_THIS})]});case M.kVF.UNCLAIMED_ACCOUNT:return(0,r.jsxs)(CM.ZP,{color:CM.DM.DEFAULT,
children:[Q.Z.Messages.NOTICE_UNCLAIMED_ACCOUNT,(0,r.jsx)(CM.No,{noticeType:M.kVF.UNCLAIMED_ACCOUNT,onClick:function(){return m&&null!=i?(0,mo.hk)(i):yo.j()},children:Q.Z.Messages.CLAIM_ACCOUNT})]});case M.kVF.UNVERIFIED_ACCOUNT:return(0,r.jsxs)(CM.ZP,{color:CM.DM.DEFAULT,children:[Q.Z.Messages.NOTICE_UNVERIFIED_ACCOUNT,(0,r.jsx)(CM.No,{noticeType:M.kVF.UNVERIFIED_ACCOUNT,onClick:function(){l.Z.verifyResend();s1.Z.show({title:Q.Z.Messages.VERIFICATION_EMAIL_TITLE,body:Q.Z.Messages.VERIFICATION_EMAIL_BODY.format({email:null==t?void 0:t.email}),secondaryConfirmText:Q.Z.Messages.CHANGE_EMAIL,onConfirmSecondary:yo.j})},children:Q.Z.Messages.RESEND})]});case M.kVF.SCHEDULED_MAINTENANCE:return null==a.metadata?null:(0,r.jsxs)(CM.ZP,{color:CM.DM.DEFAULT,children:[(0,r.jsx)(CM.Ry,{onClick:function(){return f1.Z.ackScheduledMaintenance()},noticeType:M.kVF.SCHEDULED_MAINTENANCE}),Q.Z.Messages.NOTICE_SCHEDULED_MAINTENANCE.format(a.metadata),(0,r.jsx)(CM.u3,{
href:"".concat(M.yXt.STATUS,"/incidents/").concat(a.metadata.id),children:Q.Z.Messages.LEARN_MORE})]});case M.kVF.NO_INPUT_DETECTED:return Ye.Z.supports(Ke.AN.LOOPBACK)?(0,r.jsx)(X2,{}):(0,r.jsx)(q2,{});case M.kVF.HARDWARE_MUTE:if(null==a.metadata)return null;var v=a.metadata,_=v.vendor,I=v.model;return(0,r.jsxs)(CM.ZP,{color:CM.DM.DANGER,children:[Q.Z.Messages.NOTICE_HARDWARE_MUTE.format({vendorName:_.name,modelName:I.name}),(0,r.jsx)(CM.u3,{href:I.url,target:"_blank",rel:"noreferrer noopener",children:Q.Z.Messages.SUPPORT})]});case M.kVF.STREAMER_MODE:return(0,r.jsxs)(CM.ZP,{color:CM.DM.STREAMER_MODE,children:[(0,r.jsx)(CM.Ry,{onClick:function(){return Q2()},noticeType:M.kVF.STREAMER_MODE}),Q.Z.Messages.NOTICE_STREAMER_MODE_TEXT,(0,r.jsx)(CM.No,{onClick:function(){return Nr.Z.setEnabled(!1)},noticeType:M.kVF.STREAMER_MODE,children:Q.Z.Messages.DISABLE})]});case M.kVF.H264_DISABLED:return(0,r.jsxs)(CM.ZP,{color:CM.DM.DANGER,children:[(0,r.jsx)(CM.Ry,{onClick:function(){Q2()}
}),Q.Z.Messages.NOTICE_H264_DISABLED_SETTINGS,(0,r.jsx)(CM.Ey,{onClick:function(){(0,eh.jN)(M.S9g.USER_SETTINGS);h.Z.setSection(M.oAB.VOICE)},children:Q.Z.Messages.NOTICE_H264_DISABLED_SETTINGS_LINK_TEXT})]});case M.kVF.DETECTED_OFF_PLATFORM_PREMIUM_PERK:if(null==a.metadata)return null;var T=a.metadata,N=T.skuId,C=T.applicationId,j=I2.Z.get(N),R=Rn.Z.getGame(C);if(null==j||null==R)return null;var x={page:M.ZY5.IN_APP};return(0,r.jsxs)(CM.ZP,{color:CM.DM.PREMIUM_TIER_1,children:[(0,r.jsx)(CM.Ry,{onClick:function(){return c1(j.id)},noticeType:M.kVF.DETECTED_OFF_PLATFORM_PREMIUM_PERK}),(0,r.jsx)(eL.Z,{className:C1().premiumIcon}),Q.Z.Messages.NOTICE_DETECTED_OFF_PLATFORM_PREMIUM_PERK_MESSAGE.format({applicationName:R.name,skuName:j.name}),(0,r.jsx)(CM.No,{noticeType:M.kVF.DETECTED_OFF_PLATFORM_PREMIUM_PERK,onClick:function(){return(0,Cf.S)({applicationId:R.id,skuId:j.id,openPremiumPaymentModal:function(){(0,$Z.Z)({initialPlanId:null,subscriptionTier:jf.Si.TIER_2,analyticsLocations:f,
analyticsObject:x})},analyticsLocations:f,analyticsLocation:x,context:__OVERLAY__?M.IlC.OVERLAY:M.IlC.APP}).then((function(){return c1(j.id)}))},children:Q.Z.Messages.NOTICE_DETECTED_OFF_PLATFORM_PREMIUM_PERK_BUTTON})]});case M.kVF.DETECTED_OFF_PLATFORM_PREMIUM_PERK_UPSELL:if(null==a.metadata)return null;var w=a.metadata,D=w.skuId,Z=w.applicationId,L=I2.Z.get(D),U=Rn.Z.getGame(Z);return null==L||null==U?null:(0,r.jsxs)(CM.ZP,{color:CM.DM.PREMIUM_TIER_1,children:[(0,r.jsx)(CM.Ry,{onClick:function(){return Q2()},noticeType:M.kVF.DETECTED_OFF_PLATFORM_PREMIUM_PERK_UPSELL}),(0,r.jsx)(eL.Z,{className:C1().premiumIcon}),Q.Z.Messages.NOTICE_DETECTED_OFF_PLATFORM_NO_PREMIUM_PERK_MESSAGE.format({applicationName:U.name,skuName:L.name}),(0,r.jsx)(CM.Ey,{children:(0,r.jsx)(a1.rU,{onClick:function(){return Q2()},to:{pathname:M.Z5c.APPLICATION_STORE_LISTING_SKU(L.id),state:{scrollRestoration:!1}},children:Q.Z.Messages.LEARN_MORE})})]});case M.kVF.SURVEY:var k=a.metadata;if(null==k)return null
;var G=k.key,B=k.prompt,H=k.cta,V=k.url;return(0,r.jsxs)(CM.ZP,{color:CM.DM.CUSTOM,children:[(0,r.jsx)(CM.Ry,{noticeType:M.kVF.SURVEY,onClick:function(){(0,d1.hZ)(G,!0)}}),B,(0,r.jsx)(CM.No,{noticeType:M.kVF.SURVEY,onClick:function(){window.open(V,"_blank");(0,d1.hZ)(G,!1)},children:H})]});case M.kVF.CORRUPT_INSTALLATION:return(0,r.jsxs)(CM.ZP,{color:CM.DM.DANGER,children:[Q.Z.Messages.NOTICE_CORRUPT_INSTALLATION,(0,r.jsx)(CM.u3,{href:X.Z.getArticleURL(M.BhN.CORRUPT_INSTALLATION),target:"_blank",children:Q.Z.Messages.NOTICE_CORRUPT_INSTALLATION_HELP_LINK_TEXT})]});case M.kVF.VIDEO_UNSUPPORTED_BROWSER:return(0,r.jsxs)(CM.ZP,{color:CM.DM.WARNING,children:[(0,r.jsx)(CM.Ry,{onClick:function(){return Q2()},noticeType:M.kVF.VIDEO_UNSUPPORTED_BROWSER}),Q.Z.Messages.VIDEO_UNSUPPORTED_BROWSER_BODY,(0,r.jsx)(CM.No,{noticeType:M.kVF.VIDEO_UNSUPPORTED_BROWSER,onClick:function(){(0,c.ZDy)(F2((function(){var e,t;return K2(this,(function(o){switch(o.label){case 0:
return[4,Promise.resolve().then(n.bind(n,908056))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,z2({source:"Video unsupported browser"},e))}]}}))})))},children:Q.Z.Messages.DOWNLOAD})]});case M.kVF.DISPATCH_ERROR:if(null==a.metadata)return null;var F=a.metadata.error;return(0,r.jsxs)(CM.ZP,{color:CM.DM.DANGER,children:[(0,r.jsx)(CM.Ry,{onClick:function(){return Q2()},noticeType:M.kVF.DISPATCH_ERROR}),null==F?void 0:F.displayMessage,(0,r.jsx)(CM.No,{noticeType:M.kVF.DISPATCH_ERROR,onClick:function(){return(0,c.ZDy)(F2((function(){var e,t;return K2(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(78185)]).then(n.bind(n,278185))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,z2({},e))}]}}))})))},children:Q.Z.Messages.LEARN_MORE})]});case M.kVF.DISPATCH_INSTALL_SCRIPT_PROGRESS:if(null==a.metadata)return null;var z=a.metadata,W=z.progress,K=z.total,q=z.name;return(0,r.jsxs)(CM.ZP,{color:CM.DM.DEFAULT,children:[(0,
r.jsx)(CM.Ry,{onClick:function(){return Q2()},noticeType:M.kVF.DISPATCH_INSTALL_SCRIPT_PROGRESS}),(0,r.jsxs)(uh.Z,{justify:uh.Z.Justify.CENTER,children:[null!=q?Q.Z.Messages.NOTICE_DISPATCH_INSTALL_SCRIPT_PROGRESS_WITH_NAME.format({name:"".concat(q),progress:"".concat(W),total:"".concat(K)}):Q.Z.Messages.NOTICE_DISPATCH_INSTALL_SCRIPT_PROGRESS.format({progress:"".concat(W),total:"".concat(K)}),(0,r.jsx)(c.$jN,{type:c.$jN.Type.PULSING_ELLIPSIS,className:C1().ellipsis})]})]});case M.kVF.APPLICATION_TEST_MODE:return null==a.metadata?null:null!=Xn.Z.testModeEmbeddedApplicationId?(0,r.jsx)(CM.ZP,{color:CM.DM.WARNING,children:(0,r.jsxs)(uh.Z,{justify:uh.Z.Justify.CENTER,align:uh.Z.Align.CENTER,children:[(0,r.jsx)("div",{children:Q.Z.Messages.NOTICE_EMBEDDED_APPLICATION_TEST_MODE.format({applicationName:a.metadata.applicationName})}),(0,r.jsx)(CM.Ry,{onClick:p.mc,noticeType:M.kVF.APPLICATION_TEST_MODE})]})}):(0,r.jsx)(CM.ZP,{color:CM.DM.WARNING,children:(0,r.jsxs)(uh.Z,{
justify:uh.Z.Justify.CENTER,align:uh.Z.Align.CENTER,children:[(0,r.jsx)("div",{children:Q.Z.Messages.NOTICE_APPLICATION_TEST_MODE.format({applicationName:a.metadata.applicationName})}),(0,r.jsx)(Z2,{dropdownSize:w2.DropdownSizes.SMALL,className:C1().testModeSKUSelector,color:w2.Colors.WHITE,look:w2.Looks.OUTLINED,size:w2.Sizes.MIN,onSKUSelect:function(e){return Ac.yt(e.id,{analyticsSource:{page:null,section:M.jXE.NOTIFICATION_BAR,object:M.qAy.NAVIGATION_LINK}})},applicationId:a.metadata.applicationId,children:Q.Z.Messages.NOTICE_APPLICATION_TEST_MODE_GO_TO_LISTING}),(0,r.jsx)(CM.Ry,{onClick:p.mc,noticeType:M.kVF.APPLICATION_TEST_MODE})]})});case M.kVF.OUTBOUND_PROMOTION:return(0,r.jsxs)(CM.ZP,{color:CM.DM.PREMIUM_TIER_2,children:[(0,r.jsx)(CM.Ry,{noticeType:M.kVF.OUTBOUND_PROMOTION,onClick:function(){h2.ZP.dismissOutboundPromotionNotice()}}),(0,r.jsx)(eL.Z,{className:C1().premiumIcon}),Q.Z.Messages.OUTBOUND_PROMOTION_NOTICE,(0,r.jsx)(CM.No,{noticeType:M.kVF.OUTBOUND_PROMOTION,
onClick:function(){Ie.default.track(M.rMx.OUTBOUND_PROMOTION_NOTICE_CLICKED);h.Z.open(M.oAB.INVENTORY);h2.ZP.dismissOutboundPromotionNotice()},children:Q.Z.Messages.TAKE_ME_THERE})]});case M.kVF.VIEWING_ROLES:return(0,r.jsx)(r2.Z,{});case M.kVF.PREMIUM_UNCANCEL:return(0,r.jsxs)(CM.ZP,{color:g===jf.p9.TIER_1?CM.DM.PREMIUM_TIER_1:g===jf.p9.TIER_0?CM.DM.PREMIUM_TIER_0:CM.DM.PREMIUM_TIER_2,children:[(0,r.jsx)(CM.Ry,{noticeType:M.kVF.PREMIUM_UNCANCEL,onClick:function(){var e,t;Q2(null===(e=a.metadata)||void 0===e||null===(t=e.premiumSubscription)||void 0===t?void 0:t.currentPeriodEnd)}}),(0,r.jsx)(eL.Z,{className:C1().premiumIcon}),g===jf.p9.TIER_1?Q.Z.Messages.PREMIUM_SUBSCRIPTION_ENDING_TIER_1_NOTICE_TEXT.format({daysLeft:a.metadata.daysLeft}):g===jf.p9.TIER_0?Q.Z.Messages.PREMIUM_SUBSCRIPTION_ENDING_TIER_0_NOTICE_TEXT.format({daysLeft:a.metadata.daysLeft}):Q.Z.Messages.PREMIUM_SUBSCRIPTION_ENDING_NOTICE_TEXT.format({daysLeft:a.metadata.daysLeft}),(0,r.jsx)(CM.No,{
noticeType:M.kVF.PREMIUM_UNCANCEL,onClick:function(){var e,t;Q2(null===(e=a.metadata)||void 0===e||null===(t=e.premiumSubscription)||void 0===t?void 0:t.currentPeriodEnd);(0,c.ZDy)(F2((function(){var e,t;return K2(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(67550),n.e(96546),n.e(59330)]).then(n.bind(n,159330))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,W2(z2({},e),{daysLeft:a.metadata.daysLeft,premiumType:g,analyticsSource:"Nag Bar",premiumSubscription:a.metadata.premiumSubscription}))}]}}))})))},children:g===jf.p9.TIER_1?Q.Z.Messages.PREMIUM_SUBSCRIPTION_ENDING_TIER_1_NOTICE_BUTTON_TEXT:g===jf.p9.TIER_0?Q.Z.Messages.PREMIUM_SUBSCRIPTION_ENDING_TIER_0_NOTICE_BUTTON_TEXT:Q.Z.Messages.PREMIUM_SUBSCRIPTION_ENDING_NOTICE_BUTTON_TEXT})]});case M.kVF.PREMIUM_PAST_DUE_ONE_TIME_PAYMENT:var $=a.metadata,J=$.daysPastDue,ee=$.dismissUntil;return(0,r.jsxs)(CM.ZP,{color:CM.DM.WARNING,children:[(0,r.jsx)(CM.Ry,{noticeType:y,
onClick:function(){Q2(ee)}}),Q.Z.Messages.PREMIUM_SUBSCRIPTION_ONE_TIME_PAYMENT_PAST_DUE_SUBSCRIPTION_TEXT_NO_ACTION.format({daysPastDue:J}),(0,r.jsx)(CM.No,{noticeType:M.kVF.PREMIUM_PAST_DUE_ONE_TIME_PAYMENT,onClick:function(){Q2(ee);h.Z.open(M.oAB.SUBSCRIPTIONS)},children:Q.Z.Messages.PREMIUM_SUBSCRIPTION_PAST_DUE_RENEW_NOW_BUTTON_TEXT})]});case M.kVF.PREMIUM_PAST_DUE_INVALID_PAYMENT:return(0,r.jsxs)(CM.ZP,{color:CM.DM.DANGER,children:[(0,r.jsx)(CM.Ry,{noticeType:M.kVF.PREMIUM_PAST_DUE_INVALID_PAYMENT,onClick:function(){var e,t;Q2(null===(e=a.metadata)||void 0===e||null===(t=e.premiumSubscription)||void 0===t?void 0:t.currentPeriodEnd)}}),Q.Z.Messages.PREMIUM_SUBSCRIPTION_PAST_DUE_INVALID_PAYMENT_NOTICE_TEXT,(0,r.jsx)(CM.No,{noticeType:M.kVF.PREMIUM_PAST_DUE_INVALID_PAYMENT,onClick:function(){var e,t;Q2(null===(e=a.metadata)||void 0===e||null===(t=e.premiumSubscription)||void 0===t?void 0:t.currentPeriodEnd);h.Z.open(M.oAB.SUBSCRIPTIONS)},
children:Q.Z.Messages.PREMIUM_SUBSCRIPTION_PAST_DUE_INVALID_PAYMENT_NOTICE_BUTTON_TEXT})]});case M.kVF.PREMIUM_PAST_DUE_MISSING_PAYMENT:return(0,r.jsxs)(CM.ZP,{color:CM.DM.WARNING,children:[(0,r.jsx)(CM.Ry,{noticeType:M.kVF.PREMIUM_PAST_DUE_MISSING_PAYMENT,onClick:function(){var e,t;Q2(null===(e=a.metadata)||void 0===e||null===(t=e.premiumSubscription)||void 0===t?void 0:t.currentPeriodEnd)}}),Q.Z.Messages.PREMIUM_SUBSCRIPTION_PAST_DUE_MISSING_PAYMENT_NOTICE_TEXT,(0,r.jsx)(CM.No,{noticeType:M.kVF.PREMIUM_PAST_DUE_MISSING_PAYMENT,onClick:function(){var e,t;Q2(null===(e=a.metadata)||void 0===e||null===(t=e.premiumSubscription)||void 0===t?void 0:t.currentPeriodEnd);h.Z.open(M.oAB.SUBSCRIPTIONS)},children:Q.Z.Messages.PREMIUM_SUBSCRIPTION_PAST_DUE_MISSING_PAYMENT_NOTICE_BUTTON_TEXT})]});case M.kVF.PREMIUM_MISSING_PAYMENT:return(0,r.jsxs)(CM.ZP,{color:CM.DM.WARNING,children:[(0,r.jsx)(CM.Ry,{noticeType:M.kVF.PREMIUM_MISSING_PAYMENT,onClick:function(){var e,t
;Q2(null===(e=a.metadata)||void 0===e||null===(t=e.premiumSubscription)||void 0===t?void 0:t.currentPeriodEnd)}}),g===jf.p9.TIER_1?Q.Z.Messages.PREMIUM_SUBSCRIPTION_ENDING_MISSING_PAYMENT_TIER_1_NOTICE_TEXT.format({daysLeft:a.metadata.daysLeft}):g===jf.p9.TIER_0?Q.Z.Messages.PREMIUM_SUBSCRIPTION_ENDING_MISSING_PAYMENT_TIER_0_NOTICE_TEXT.format({daysLeft:a.metadata.daysLeft}):Q.Z.Messages.PREMIUM_SUBSCRIPTION_ENDING_MISSING_PAYMENT_NOTICE_TEXT.format({daysLeft:a.metadata.daysLeft}),(0,r.jsx)(CM.No,{noticeType:M.kVF.PREMIUM_MISSING_PAYMENT,onClick:function(){var e,t;Q2(null===(e=a.metadata)||void 0===e||null===(t=e.premiumSubscription)||void 0===t?void 0:t.currentPeriodEnd);h.Z.open(M.oAB.SUBSCRIPTIONS)},children:g===jf.p9.TIER_1?Q.Z.Messages.PREMIUM_SUBSCRIPTION_ENDING_MISSING_PAYMENT_TIER_1_NOTICE_BUTTON_TEXT:g===jf.p9.TIER_0?Q.Z.Messages.PREMIUM_SUBSCRIPTION_ENDING_MISSING_PAYMENT_TIER_0_NOTICE_BUTTON_TEXT:Q.Z.Messages.PREMIUM_SUBSCRIPTION_ENDING_MISSING_PAYMENT_NOTICE_BUTTON_TEXT})]
});case M.kVF.BACK_TO_PREVIOUS_SCREEN:var te;return(0,r.jsx)(RM,{buttonText:null!==(te=a.buttonText)&&void 0!==te?te:Q.Z.Messages.GO_BACK,onGoBack:a.callback,onDismiss:function(){return Q2()},showCloseButton:!0});case M.kVF.AUTOMOD_QUARANTINED_USER_PROFILE:return(0,r.jsxs)(CM.ZP,{color:CM.DM.CUSTOM,className:C1().quarantineNotice,children:[Q.Z.Messages.GUILD_AUTOMOD_NAGBAR_QUARANTINED_USER_PROFILE,(0,r.jsx)(CM.Ey,{onClick:E,children:Q.Z.Messages.GUILD_AUTOMOD_NAGBAR_QUARANTINED_USER_PROFILE_CTA})]});case M.kVF.QUARANTINED:return(0,r.jsxs)(CM.ZP,{color:CM.DM.CUSTOM,className:C1().quarantineNotice,children:[Q.Z.Messages.LIMITED_ACCESS_NAG_BAR_NOTICE,(0,r.jsx)(CM.u3,{href:H2.Z,target:"_blank",children:Q.Z.Messages.LIMITED_ACCESS_NAG_BAR_APPEAL}),(0,r.jsx)(c.eee,{href:X.Z.getArticleURL(M.BhN.QUARANTINE),target:"_blank",className:C1().quarantineLearnMoreLink,children:Q.Z.Messages.LEARN_MORE})]});case M.kVF.DROPS_PROGRESS_INTERRUPTION:return(0,r.jsxs)(CM.ZP,{color:CM.DM.DANGER,
children:[Q.Z.Messages.DROPS_PROGRESS_INTERRUPTION_WARNING.format({gameTitle:a.metadata.gameTitle}),(0,r.jsx)(CM.Ey,{onClick:a.metadata.reloadCallback,children:Q.Z.Messages.ERRORS_RESTART_APP})]});case M.kVF.AUTO_MODERATION_MENTION_RAID_DETECTION:var ne=a.metadata,re=ne.dismissUntil,oe=ne.decisionId;return(0,r.jsxs)(CM.ZP,{color:CM.DM.WARNING,children:[(0,r.jsx)(CM.Ry,{noticeType:M.kVF.AUTO_MODERATION_MENTION_RAID_DETECTION,onClick:function(){null!=i&&(0,H1.T9)(i);Q2(re)}}),Q.Z.Messages.GUILD_AUTOMOD_MENTION_SPAM_NOTICE_MESSAGE,(0,r.jsx)(CM.Ey,{onClick:function(){null!=i&&(0,H1.UE)(i,oe,(function(){Q2(re);(0,H1.T9)(i)}))},children:Q.Z.Messages.GUILD_AUTOMOD_MENTION_SPAM_NOTICE_REMOVE_RESTRICTION}),null!=i?(0,r.jsx)(CM.Ey,{onClick:function(){return pr.Z.open(i,M.pNK.GUILD_AUTOMOD,void 0,M.KsC.AUTOMOD_MENTION_SPAM)},children:Q.Z.Messages.GUILD_AUTOMOD_MENTION_SPAM_NOTICE_CONFIGURE_SETTINGS}):null]});default:return null}}));function J2(){var e=(0,
Hw.Z)(Pf.Z.NOTICE).AnalyticsLocationProvider;return(0,r.jsx)(e,{children:(0,r.jsx)($2,{})})}var e4=n(503528);var t4=n(350247),n4=n(169445),r4=n(132148),o4=n(699992),i4=n(181913),a4=n(779854),s4=n(536392),c4=n(7114),l4=n(493221),u4=n(425650),f4=n(557931),d4=n(879639),p4=n(284952),h4=n(576725),E4=n(779622),y4=n.n(E4);function m4(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b4(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function g4(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){b4(e,t,n[t])}))}return e}function O4(e,t){t=null!=t?t:{}
;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function v4(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function _4(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){
var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return m4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m4(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var I4=function(e){var t=e.selected,n=v4(e,["selected"]),o=(0,pb.JA)("friends"),i=(0,s.e7)([Ja.Z],(function(){return Ja.Z.getPendingCount()}));return(0,r.jsx)(d4.Qj,O4(g4({selected:t,route:M.Z5c.FRIENDS,icon:sQ.Z,text:Q.Z.Messages.FRIENDS},n,o),{children:i>0?(0,r.jsx)(_j.mA,{count:i}):null}))
},S4=function(e){var t=e.selected,n=e.hideGameUpdateProgressIndicator,o=v4(e,["selected","hideGameUpdateProgressIndicator"]),i=(0,pb.JA)("library");return(0,r.jsx)(d4.Qj,O4(g4({selected:t,route:M.Z5c.APPLICATION_LIBRARY,icon:u4.Z,text:Q.Z.Messages.LIBRARY},o,i),{children:(0,r.jsx)(h4.Z,{className:lh()(y4().downloadProgressCircle,b4({},y4().hideGameUpdateProgressIndicator,n))})}))},T4=function(e){var t,n,o=e.selected,i=e.route,a=e.locationState,c=v4(e,["selected","route","locationState"]),l=(0,s.e7)([Y.default],(function(){return Y.default.getCurrentUser()})),u=(0,s.e7)([s4.Z],(function(){return s4.Z.getPremiumTypeSubscription()})),f=(0,la.n3)(),d=(0,pb.JA)("nitro"),p=(0,R1.Np)(),h=(0,s.e7)([gM.Z],(function(){return gM.Z.isLocalizedPromoEnabled}))&&null==p,E=(0,t4.ij)().shouldShowUpsells,y=ca.L.useExperiment({}).enableTier0?2592e6:7776e6,m=(0,Vi.$k)(E||f||null!=p);if(!(o||null!=p||null!=l&&Date.now()-l.createdAt.getTime()>y||(0,Na.Qo)(l,u)||f))return null;if(E)n=(0,r.jsx)(n4.Z,{
isSelected:o});else if(f){n=(0,r.jsx)(WN.Z,{contentTypes:[ln.z$.PREMIUM_TIER_0_DESKTOP_MARKETING_PAGE_BADGE],children:function(e){if(e.visibleContent===ln.z$.PREMIUM_TIER_0_DESKTOP_MARKETING_PAGE_BADGE)return(0,r.jsx)("div",{className:y4().premiumTier0Badge,children:(0,r.jsx)(i4.Z,{})})}});t=y4().premiumTier0BadgeLinkButton}else if(null!=p)n=(0,r.jsx)(a4.Z,{trialOffer:p,isTabSelected:o});else if(m)n=(0,r.jsx)(o4.Z,{});else if(h){n=(0,r.jsx)(r4.k,{entryPoint:r4.U.PrivateMessages});o||(t=y4().localizedPricingBadge)}return(0,r.jsx)(d4.Qj,O4(g4({selected:o,route:i,icon:eL.Z,text:Q.Z.Messages.PREMIUM,locationState:a},c,d),{className:t,children:n}))},N4=function(e){var t=e.selected,n=(0,eV.q)(),o=(0,pb.JA)("messageRequests"),i=(0,EV._)().channelId;if(!(0,s.e7)([$H.Z,JH.Z],(function(){return(0,LJ.IO)([$H.Z,JH.Z])})))return null;var a=null==i?void 0:function(){return Wq.Z.preload(M.ME,i)};return(0,r.jsx)(d4.Qj,O4(g4({selected:t,route:M.Z5c.MESSAGE_REQUESTS,icon:fV.Z,
text:Q.Z.Messages.MESSAGE_REQUESTS,onClick:a},o),{children:n>0?(0,r.jsx)(_j.mA,{count:n}):null}))},A4=function(e){var t=e.selected,n=Q.Z.Messages.FAMILY_CENTER_SIDEBAR_TITLE,o=(0,pb.JA)("family-center");return wF.useExperiment({}).enabled?(0,r.jsx)(d4.Qj,g4({selected:t,route:M.Z5c.PARENT_TOOLS,icon:jF.Z,text:n},o)):null},C4=function(){return(0,zG.$Z)("DM_SEARCH")};function P4(e){switch(e){case M.Z5c.APPLICATION_LIBRARY:return M.ZY5.LIBRARY;case M.Z5c.FRIENDS:return M.ZY5.FRIENDS_LIST}return e.startsWith(M.Z5c.APPLICATION_STORE)?e===M.Z5c.APPLICATION_STORE?M.ZY5.STORE_DIRECTORY_HOME:e.startsWith(M.Z5c.APPLICATION_STORE)?M.ZY5.STORE_DIRECTORY_BROWSE:M.ZY5.STORE_LISTING:M.ZY5.DM_CHANNEL}var j4=function(e){var t=e.showLibrary,n=e.hasLibraryApplication,o=e.homeLink,i=e.storeLink,a=e.premiumTabSelected,s=_4((0,N0.Z)((function(e){return[e.channelId,e.path]}),e4.Z),2),c=s[0],l=s[1];return(0,r.jsxs)("nav",{className:y4().privateChannels,"aria-label":Q.Z.Messages.PRIVATE_CHANNELS_A11Y_LABEL,
children:[(0,r.jsx)(WZ.Z,{tutorialId:"direct-messages",position:"right",offsetX:-52,children:(0,r.jsx)("div",{className:y4().searchBar,children:(0,r.jsx)("button",{type:"button",className:y4().searchBarComponent,onClick:C4,children:Q.Z.Messages.DM_SEARCH_PLACEHOLDER})})}),(0,r.jsxs)(p4.Z,O4(g4({},e),{version:l,selectedChannelId:c,showDMHeader:!0,children:[(0,r.jsx)(I4,{selected:null!=l?l===M.Z5c.FRIENDS:o===M.Z5c.FRIENDS},"friends"),n&&t?(0,r.jsx)(S4,{selected:null==l?null!=o&&o.startsWith(M.Z5c.APPLICATION_LIBRARY):l.startsWith(M.Z5c.APPLICATION_LIBRARY),hideGameUpdateProgressIndicator:o===M.Z5c.APPLICATION_LIBRARY},"library"):null,(0,r.jsx)(T4,{selected:null==l?a:l.startsWith(M.Z5c.APPLICATION_STORE),route:null==i||location.pathname.startsWith(M.Z5c.APPLICATION_STORE)?M.Z5c.APPLICATION_STORE:i,locationState:{analyticsSource:{page:P4(o),section:M.jXE.NAVIGATION,object:M.qAy.NAVIGATION_LINK}}},"premium"),(0,r.jsx)(N4,{
selected:null==l?null!=o&&o.startsWith(M.Z5c.MESSAGE_REQUESTS):l===M.Z5c.MESSAGE_REQUESTS},"message-requests"),(0,r.jsx)(A4,{selected:null==l?null!=o&&o.startsWith(M.Z5c.PARENT_TOOLS):l===M.Z5c.PARENT_TOOLS},"parent-tools")]}))]})};function R4(){var e=(0,s.e7)([l4.Z],(function(){return l4.Z.getHomeLink()})),t=(0,s.e7)([I2.Z],(function(){if(e===M.Z5c.APPLICATION_STORE)return!0;var t=(0,f4.ZK)(e);if(null!=t){var n,r;return null!==(r=null===(n=I2.Z.get(t))||void 0===n?void 0:n.premium)&&void 0!==r&&r}return!1}),[e]),n=!ct.bm.useSetting(),o=(0,s.cj)([st.Z],(function(){return{theme:st.Z.theme}})).theme,i=(0,s.e7)([Ln.Z],(function(){return Ln.Z.hasLibraryApplication()})),a=(0,s.e7)([c4.Z],(function(){return c4.Z.getCurrentPath()}));return(0,r.jsx)(j4,{theme:o,showLibrary:n,hasLibraryApplication:i,storeLink:a,homeLink:e,premiumTabSelected:t})}var x4=n(9941),M4=n(458922),w4=n(412961);function D4(e){O.Z.dispatch({type:"LIBRARY_APPLICATION_FILTER_UPDATE",query:e})}function Z4(e){
var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];O.Z.dispatch({type:"LIBRARY_TABLE_ACTIVE_ROW_ID_UPDATE",key:e,isKeyboardEvent:t})}var L4=n(770819),U4=n(276433),k4=n(763993),G4=n(629904),B4=n.n(G4);function H4(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F4(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Y4(e){Y4=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Y4(e)}function z4(e,t){return!t||"object"!==K4(t)&&"function"!=typeof t?H4(e):t}function W4(e,t){W4=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return W4(e,t)}var K4=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function q4(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Y4(e);if(t){var o=Y4(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return z4(this,n)}}var X4=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&W4(e,t)}(n,e);var t=q4(n);function n(){V4(this,n);var e;(e=t.apply(this,arguments)).searchBarRef=null;e.state={focused:!1};e.setRef=function(t){e.searchBarRef=t};e.handleKeyDown=function(t){var n,r=e.props,o=r.activeRowKey,i=r.hasModalOpen,a=r.applicationViewItems,s=H4(e).searchBarRef;if(!(i||t.ctrlKey||t.altKey||t.metaKey||null==s)){var c=null===(n=(0,
k4.uB)(t))||void 0===n?void 0:n.activeElement;if(c===s.inputRef.current||!(0,k4.VG)(c))switch(t.which){case M.yXg.ESCAPE:t.target!==s.inputRef.current?e.reset():null!=s.inputRef.current&&s.blur();break;case M.yXg.ENTER:if(null!=o){t.preventDefault();var l=a.find((function(e){return e.key===o}));if(null==l)return;var u=l.libraryApplication;nm.performDefaultLibraryApplicationAction(u,{analyticsParams:{source:M.Sbl.APPLICATION_LIBRARY,location:{page:M.ZY5.LIBRARY,section:M.jXE.LIBRARY_APPLICATION_LIST,object:M.qAy.BUTTON_CTA}}})}break;case M.yXg.ARROW_DOWN:case M.yXg.ARROW_UP:t.preventDefault();t.stopPropagation();e.updateActiveRow(t.which===M.yXg.ARROW_DOWN?1:-1);break;default:null!=s.inputRef.current&&t.target!==s.inputRef.current&&s.focus()}}};return e}var o=n.prototype;o.componentDidMount=function(){document.addEventListener("keydown",this.handleKeyDown)};o.componentWillUnmount=function(){O.Z.wait((function(){return Z4(null)}))
;document.removeEventListener("keydown",this.handleKeyDown)};o.reset=function(){Z4(null);D4("")};o.focusInput=function(){var e=this.searchBarRef;null!=e&&e.focus()};o.updateActiveRow=function(e){var t=this.props,n=t.applicationViewItems,r=t.activeRowKey,o=n.findIndex((function(e){return e.key===r})),i=0;o>=0&&(i=(o+e)%n.length)<0&&(i=n.length-1);var a=n[i];Z4(null!=a?a.key:null,!0)};o.render=function(){var e,t=this,n=this.props.filterQuery,o=this.state.focused;return(0,r.jsx)("div",{className:lh()((e={},F4(e,B4().libraryFilter,!0),F4(e,B4().focused,o),e)),children:(0,r.jsx)(yj.Z,{className:B4().searchBar,ref:this.setRef,onChange:D4,onFocus:function(){return t.setState({focused:!0})},onBlur:function(){return t.setState({focused:!1})},name:"filter",onClear:function(){t.reset();t.focusInput()},maxLength:100,query:n,placeholder:Q.Z.Messages.APPLICATION_LIBRARY_FILTER_PLACEHOLDER})})};return n}(o.Component);function Q4(){var e=(0,s.e7)([T.Z],(function(){return T.Z.hasLayers()})),t=(0,
c.s9z)(c.JQI);return(0,r.jsx)(X4,{activeRowKey:(0,s.e7)([U4.Z],(function(){return U4.Z.activeRowKey})),hasModalOpen:t||e,filterQuery:(0,s.e7)([L4.Z],(function(){return L4.Z.applicationFilterQuery})),applicationViewItems:(0,s.e7)([L4.Z],(function(){return L4.Z.sortedFilteredLibraryApplicationViewItems}))})}var $4=n(956958),J4=n.n($4);function e3(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function t3(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){e3(e,t,n[t])}))}return e}function n3(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){
var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var r3=(0,er.Q)()||!1;function o3(e){var t=e.currentRoute,n=e.renderToolbar,i=o.useContext(Ie.AnalyticsContext),a=r3||t===M.Z5c.APPLICATION_LIBRARY_SETTINGS;return(0,r.jsxs)(Og.Z,{className:J4().libraryHeader,toolbar:null==n?void 0:n(),children:[(0,r.jsx)(Og.Z.Icon,{icon:u4.Z,"aria-hidden":!0}),(0,r.jsx)(Og.Z.Title,{children:Q.Z.Messages.LIBRARY}),(0,r.jsx)(Og.Z.Divider,{}),(0,r.jsxs)(c.njP,{type:"top-pill",selectedItem:t,onItemSelect:function(e){e!==t&&(0,K.uL)(e,{state:{analyticsSource:n3(t3({},i.location),{section:M.jXE.TABS,object:M.qAy.NAVIGATION_LINK})}})},children:[(0,r.jsx)(c.njP.Item,{id:M.Z5c.APPLICATION_LIBRARY,children:Q.Z.Messages.APPLICATION_LIBRARY_MY_GAMES}),a?(0,r.jsx)(c.njP.Item,{
id:M.Z5c.APPLICATION_LIBRARY_SETTINGS,children:Q.Z.Messages.SETTINGS}):null]})]})}const i3=o.memo(o3);var a3=n(192607),s3=n(424160),c3=n(351317),l3=n(416044),u3=n(954419),f3=n(421281),d3=n(534540),p3=n(168062);const h3=function(e){var t=e.id,n=e.startColor,o=e.stopColor,i=e.color,a=e.stop;return(0,r.jsxs)("linearGradient",{id:t,children:[(0,r.jsx)("stop",{offset:"0",stopColor:n}),(0,r.jsx)("stop",{offset:a,stopColor:o}),(0,r.jsx)("stop",{offset:a,stopColor:i}),(0,r.jsx)("stop",{offset:"1",stopColor:i})]})};function E3(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function y3(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){E3(e,t,n[t])}))}return e}function m3(e,t){t=null!=t?t:{}
;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function b3(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function g3(e){return"CloudDone-".concat(e)}function O3(e){
var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=e.gradientConfig,u=b3(e,["width","height","color","foreground","gradientConfig"]),f=null;null!=l&&(f=(0,r.jsx)(h3,m3(y3({},l),{color:s,id:g3(l.id)})));return(0,r.jsxs)("svg",m3(y3({},(0,OO.Z)(u)),{width:n,height:i,viewBox:"0 0 24 24",children:[(0,r.jsx)("defs",{children:f}),(0,r.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,r.jsx)("path",{fill:null!=l?"url(#".concat(g3(l.id),")"):s,className:c,d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM10 17l-3.5-3.5 1.41-1.41L10 14.17 15.18 9l1.41 1.41L10 17z"})]}))}function v3(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function _3(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){v3(e,t,n[t])}))}return e}function I3(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function S3(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r]
;t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function T3(e){return"CloudDownload-".concat(e)}function N3(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function A3(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){N3(e,t,n[t])}))}return e}function C3(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function P3(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function j3(e){return"CloudUpload-".concat(e)}function R3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x3(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function M3(e){M3=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return M3(e)}function w3(e,t){return!t||"object"!==Z3(t)&&"function"!=typeof t?function(e){
if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function D3(e,t){D3=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return D3(e,t)}var Z3=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function L3(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=M3(e);if(t){var o=M3(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return w3(this,n)}}var U3,k3=new Set([M.TzF.PUSHING,M.TzF.PULLING]),G3=Object.freeze((x3(U3={},M.TzF.DONE,p3.Z),x3(U3,M.TzF.PLANNING,p3.Z),x3(U3,M.TzF.PREPARING,p3.Z),x3(U3,M.TzF.PUSHING,(function(e){
var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=e.gradientConfig,u=P3(e,["width","height","color","foreground","gradientConfig"]),f=null;null!=l&&(f=(0,r.jsx)(h3,C3(A3({},l),{color:s,id:j3(l.id)})));return(0,r.jsxs)("svg",C3(A3({},(0,OO.Z)(u)),{width:n,height:i,viewBox:"0 0 24 24",children:[(0,r.jsx)("defs",{children:f}),(0,r.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,r.jsx)("path",{fill:null!=l?"url(#".concat(j3(l.id),")"):s,className:c,d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"})]}))})),x3(U3,M.TzF.PULLING,(function(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=e.gradientConfig,u=S3(e,["width","height","color","foreground","gradientConfig"]),f=null;null!=l&&(f=(0,r.jsx)(h3,I3(_3({},l),{color:s,
id:T3(l.id)})));return(0,r.jsxs)("svg",I3(_3({},(0,OO.Z)(u)),{width:n,height:i,viewBox:"0 0 24 24",children:[(0,r.jsx)("defs",{children:f}),(0,r.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,r.jsx)("path",{fill:null!=l?"url(#".concat(T3(l.id),")"):s,className:c,d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z"})]}))})),x3(U3,M.TzF.CONFLICT,p3.Z),x3(U3,M.TzF.ERROR,p3.Z),U3)),B3=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&D3(e,t)}(n,e);var t=L3(n);function n(){R3(this,n);var e;(e=t.apply(this,arguments))._doneTimer=new Uu.V7;return e}var o=n.prototype;o.componentDidMount=function(){this.getIsRecentlySynced()&&this.setRecentlySyncedTimeout()}
;o.componentDidUpdate=function(e){null!=this.props.cloudSyncState&&(this.props.cloudSyncState.type!==M.TzF.DONE||null==this.props.cloudSyncState.timestamp||null!=e.cloudSyncState&&null!=e.cloudSyncState.timestamp||this.setRecentlySyncedTimeout())};o.componentWillUnmount=function(){this._doneTimer.stop()};o.setRecentlySyncedTimeout=function(){var e=this;this._doneTimer.start(2e3,(function(){return e.forceUpdate()}))};o.getIsRecentlySynced=function(){var e=this.props.cloudSyncState;if(null!=e&&e.type===M.TzF.DONE){var t=e.timestamp;return null!=t&&Date.now()-t<=2e3}return!1};o.getStop=function(e,t){if(t)return 1;if(e.type===M.TzF.PUSHING||e.type===M.TzF.PULLING){return e.progress/e.total}return 0};o.getTooltip=function(e,t){switch(e.type){case M.TzF.DONE:return t?Q.Z.Messages.CLOUD_SYNC_ICON_TOOLTIP_DONE:Q.Z.Messages.CLOUD_SYNC_ICON_TOOLTIP_SUPPORTED;case M.TzF.CONFLICT:case M.TzF.ERROR:return Q.Z.Messages.CLOUD_SYNC_ICON_TOOLTIP_SUPPORTED;case M.TzF.PLANNING:
return Q.Z.Messages.CLOUD_SYNC_ICON_TOOLTIP_PLANNING;case M.TzF.PREPARING:return Q.Z.Messages.CLOUD_SYNC_ICON_TOOLTIP_PREPARING;case M.TzF.PUSHING:return Q.Z.Messages.CLOUD_SYNC_ICON_TOOLTIP_PUSHING;case M.TzF.PULLING:return Q.Z.Messages.CLOUD_SYNC_ICON_TOOLTIP_PULLING;default:return null}};o.render=function(){var e=this.props,t=e.cloudSyncState,n=e.libraryApplication,o=e.className,i=null==t?{type:M.TzF.DONE}:t,a=this.getIsRecentlySynced(),s={};(k3.has(i.type)||a)&&(s.gradientConfig={id:n.id,startColor:"rgba(199, 208, 240, 1)",stopColor:"rgba(114, 137, 218, 1)",stop:this.getStop(i,a)});var l=a?O3:G3[i.type];return(0,r.jsx)(c.ua7,{text:this.getTooltip(i,a),children:function(e){return(0,r.jsx)(l,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))))
;r.forEach((function(t){x3(e,t,n[t])}))}return e}({className:o},s,e))}})};return n}(o.PureComponent);const H3=s.ZP.connectStores([d3.Z],(function(e){var t=e.libraryApplication;return{cloudSyncState:d3.Z.getState(t.id,t.branchId)}}))(B3);var V3=n(825700),F3=n.n(V3);function Y3(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function z3(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Y3(i,r,o,a,s,"next",e)}function s(e){Y3(i,r,o,a,s,"throw",e)}a(void 0)}))}}function W3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K3(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function q3(e){q3=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return q3(e)}function X3(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){K3(e,t,n[t])}))}return e}function Q3(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function $3(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e)
;for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function J3(e,t){return!t||"object"!==t6(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function e6(e,t){e6=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return e6(e,t)}var t6=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function n6(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=q3(e);if(t){var o=q3(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return J3(this,n)}}var r6,o6=function(e,t){var n,r,o,i,a={label:0,sent:function(){
if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}
}([i,s])}}},i6=(0,f3.Mg)(F3().rowMinHeight),a6=(0,f3.Mg)(F3().linkedToGlowDuration),s6=Object.freeze((K3(r6={},M.iEv.PLATFORM,"Platform"),K3(r6,M.iEv.LAST_PLAYED,"Last Played"),K3(r6,M.iEv.NAME,"Name"),r6));var c6=function(e){var t=e.flag,n=e.icon,o=e.item,i=e.tooltip,a=o.libraryApplication.hasFlag(t);return(0,r.jsx)(c.ua7,{text:i,children:function(e){return(0,r.jsx)(n,X3({className:lh()(F3().settingIcon,K3({},F3().hidden,!a))},e))}})},l6=[{key:M.iEv.NAME,renderHeader:function(){return Q.Z.Messages.GAME_LIBRARY_LIST_HEADER_NAME},sort:!0,cellClassName:F3().nameCell,bodyCellClassName:F3().nameBodyCell,render:function(e){return(0,r.jsxs)(uh.Z,{align:uh.Z.Align.CENTER,children:[(0,r.jsx)(UK.Z,{game:e.application,size:UK.Z.Sizes.SMALL,className:F3().gameIcon}),(0,r.jsxs)("div",{className:F3().nameCellInfo,children:[(0,r.jsx)("div",{className:F3().nameCellText,children:e.libraryApplication.getBranchedName(e.application)}),e.libraryApplication.hasFlag(M.eHb.PREMIUM)?(0,r.jsx)(c.ua7,{
text:Q.Z.Messages.PREMIUM_GAME,children:function(e){return(0,r.jsx)(eL.Z,X3({className:F3().nitroIcon},e))}}):null]})]})}},{key:M.iEv.PLATFORM,renderHeader:function(){return Q.Z.Messages.GAME_LIBRARY_LIST_HEADER_PLATFORM},sort:!0,cellClassName:F3().platformCell,bodyCellClassName:F3().textCell,render:function(e){var t=e.libraryApplication.getDistributor();return(0,r.jsx)(uh.Z,{align:uh.Z.Align.CENTER,children:null!=t?M.EOG[t]:Q.Z.Messages.GAME_LIBRARY_NOT_APPLICABLE})}},{key:M.iEv.LAST_PLAYED,renderHeader:function(){return Q.Z.Messages.GAME_LIBRARY_LIST_HEADER_LAST_PLAYED},sort:!0,cellClassName:F3().lastPlayedCell,bodyCellClassName:F3().textCell,render:function(e){var t;t=e.isRunning?Q.Z.Messages.GAME_LIBRARY_LAST_PLAYED_PLAYING_NOW:e.isNew?Q.Z.Messages.GAME_LIBRARY_NEW:0!==e.lastPlayed?(0,r.jsx)(kK.ZP,{end:e.lastPlayed,location:kK.ZP.Locations.GAME_LIBRARY_LAST_PLAYED}):Q.Z.Messages.GAME_LIBRARY_LAST_PLAYED_NONE;return(0,r.jsx)(uh.Z,{align:uh.Z.Align.CENTER,
className:lh()(K3({},F3().lastPlayedCellNew,e.isNew)),children:t})}},{key:M.iEv.ACTIONS,renderHeader:function(){return null},cellClassName:F3().actionsCell,render:function(e,t,n){if(null==t)throw new Error("No cell props defined.");var i,a,s=e.key===t.activeRowKey;return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsxs)("div",{className:F3().settingIcons,children:[(0,r.jsx)(c6,{flag:M.eHb.PRIVATE,item:e,icon:gT.Z,tooltip:Q.Z.Messages.GAME_LIBRARY_PRIVATE_TOOLTIP}),(0,r.jsx)(c6,{flag:M.eHb.OVERLAY_DISABLED,item:e,icon:l3.Z,tooltip:Q.Z.Messages.GAME_LIBRARY_OVERLAY_DISABLED_TOOLTIP}),(0,r.jsx)(H3,{className:lh()(F3().settingIcon,K3({},F3().hidden,!e.supportsCloudSync)),libraryApplication:e.libraryApplication})]}),(0,u3.Je)(e.libraryApplication)?(0,r.jsx)(s3.Z,{analyticsListSort:(i=t.sortKey,a=t.sortDirection,"".concat(s6[i]," ").concat(a===M.sHY.ASCENDING?"ASC":"DESC")),analyticsListIndex:n,source:M.Sbl.APPLICATION_LIBRARY,libraryApplication:e.libraryApplication,
color:s?c.zxk.Colors.GREEN:c.zxk.Colors.PRIMARY,isPlayShiny:s&&e.defaultAction===M.apO.PLAY,size:F3().actionButtonSize,hideProgress:null!=e.defaultAction,onDropdownOpen:function(){return null!=t&&t.setActiveRowKey(e)},onDropdownClose:function(){return null!=t&&t.clearActiveRowKey()}}):(0,r.jsx)(a3.Z,{skuId:e.libraryApplication.sku.id,applicationId:e.application.id,color:s?c.zxk.Colors.GREEN:c.zxk.Colors.PRIMARY,customDisabledColor:c.zxk.Colors.PRIMARY,size:F3().actionButtonSize})]})}}],u6=function(e){var t,n=e.item,o=e.activeRowKey,i=e.highlightedApplicationKey,a=e.onMouseEnter,s=e.onMouseLeave,c=e.onContextMenu,l=e.setRef,u=$3(e,["item","activeRowKey","highlightedApplicationKey","onMouseEnter","onMouseLeave","onContextMenu","setRef"]),f=n.key===o,d=n.key===i;return(0,r.jsx)("div",{className:lh()((t={},K3(t,F3().rowWrapperActive,f&&!d),K3(t,F3().rowWrapperGlow,d),K3(t,F3().rowWrapper,!f&&!d),K3(t,F3().rowWrapperDim,!f&&!n.isLaunchable),t)),ref:function(e){return l(e,n.key)},
onMouseEnter:function(){return a(n)},onMouseLeave:s,onContextMenu:function(e){return c(e,n)},children:(0,r.jsx)("div",X3({},u))})},f6=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&e6(e,t)}(i,e);var t=n6(i);function i(){W3(this,i);var e;(e=t.apply(this,arguments))._didUnmount=!1;e._rowRefs={};e.state={overflowMenuRowKey:null,highlightedApplicationKey:null!=e.props.location.state?e.props.location.state.applicationId:null};e.setActiveRowKey=function(t){e.setState({overflowMenuRowKey:t.key})};e.clearActiveRowKey=function(){e._didUnmount||e.setState({overflowMenuRowKey:null})};e.handleRowMouseEnter=function(t){e.props.isNavigatingByKeyboard||Z4(t.key)};e.handleRowMouseLeave=function(){e.props.isNavigatingByKeyboard||Z4(null)};e.setRowRef=function(t,n){e._rowRefs[n]=t}
;e.handleApplicationContextMenu=function(t,o){e.setActiveRowKey(o);var i=e.props.analyticsContext;(0,Ob.jW)(t,z3((function(){var e,t;return o6(this,(function(a){switch(a.label){case 0:return[4,n.e(96743).then(n.bind(n,196743))];case 1:e=a.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Q3(X3({},e),{applicationId:o.libraryApplication.id,branchId:o.libraryApplication.branchId,analyticsContext:i}))}]}}))})),{onClose:e.clearActiveRowKey})};return e}var a=i.prototype;a.componentDidMount=function(){if(this.props.fetched){this.handleHighlightedApplicationKey();this.trackViewed()}};a.componentWillUnmount=function(){this._didUnmount=!0};a.componentDidUpdate=function(e){if(!e.fetched&&this.props.fetched){this.handleHighlightedApplicationKey();this.trackViewed()}var t=this.props.activeRowKey;if(null!=t&&e.activeRowKey!==t&&this.props.isNavigatingByKeyboard){var n=this._rowRefs[t];if(null!=n){O.Z.wait(Ob.Zy);this.props.scrollToRow(n,i6)}}};a.handleHighlightedApplicationKey=function(){
var e=this,t=this.state.highlightedApplicationKey;if(null!=t&&null!=this._rowRefs[t]){this.props.scrollToRow(this._rowRefs[t],i6);(new Uu.V7).start(a6,(function(){e._didUnmount||e.setState({highlightedApplicationKey:null})}))}};a.trackViewed=function(){var e={num_applications_total:0,num_applications_discord:0,num_applications_steam:0,num_applications_battlenet:0,num_applications_twitch:0,num_applications_uplay:0,num_applications_origin:0,num_applications_gog:0,num_applications_epic:0},t=this.props,n=t.analyticsContext,r=t.applicationViewItems,o=!0,i=!1,a=void 0;try{for(var s,c=r[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){switch(s.value.libraryApplication.getDistributor()){case M.GQo.DISCORD:e.num_applications_discord++;break;case M.GQo.STEAM:e.num_applications_steam++;break;case M.GQo.BATTLENET:e.num_applications_battlenet++;break;case M.GQo.TWITCH:e.num_applications_twitch++;break;case M.GQo.UPLAY:e.num_applications_uplay++;break;case M.GQo.ORIGIN:e.num_applications_origin++
;break;case M.GQo.GOG:e.num_applications_gog++;break;case M.GQo.EPIC:e.num_applications_epic++}e.num_applications_total++}}catch(e){i=!0;a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}Ie.default.track(M.rMx.LIBRARY_VIEWED,Q3(X3({},e),{load_id:n.loadId}))};a.handleSort=function(e,t){!function(e,t){O.Z.dispatch({type:"LIBRARY_TABLE_SORT_UPDATE",key:e,direction:t})}(e,t)};a.renderImportHelp=function(){var e,t=this.props,n=t.applicationViewItems,o=t.filterQuery,i=n.length>0;if(i)return null;e=""!==o?Q.Z.Messages.APPLICATION_LIBRARY_EMPTY_SEARCH_DESCRIPTION.format({query:o}):Q.Z.Messages.APPLICATION_LIBRARY_EMPTY_STATE_DESCRIPTION_NO_IMPORT;return(0,r.jsxs)("div",{className:i?F3().emptyStateSmall:F3().emptyStateLarge,children:[(0,r.jsx)("div",{className:F3().emptyWumpus}),(0,r.jsx)(uh.Z,{grow:0,shrink:i?1:0,direction:uh.Z.Direction.VERTICAL,children:(0,r.jsxs)("div",{className:F3().emptyStateText,children:[(0,r.jsx)("div",{className:F3().emptyStateHeader,
children:Q.Z.Messages.APPLICATION_LIBRARY_EMPTY_STATE_HEADER}),(0,r.jsx)("div",{className:F3().emptyStateDescription,children:e})]})})]})};a.render=function(){var e=this.props,t=e.sortKey,n=e.sortDirection,i=e.applicationViewItems,a=e.activeRowKey,s=e.stickyHeader,c=this.state,l=c.overflowMenuRowKey,u=c.highlightedApplicationKey;return(0,r.jsxs)(o.Fragment,{children:[i.length>0?(0,r.jsx)(c3.Z,{columns:l6,data:i,sortData:!1,rowComponent:u6,className:F3().table,headerClassName:s?F3().stickyHeader:F3().header,headerCellClassName:F3().headerCell,sortedHeaderCellClassName:F3().headerCellSorted,bodyCellClassName:F3().bodyCell,rowClassName:F3().row,sortKey:t,sortDirection:n,stickyHeader:s,rowProps:{activeRowKey:null!=l?l:a,highlightedApplicationKey:u,onMouseEnter:this.handleRowMouseEnter,onMouseLeave:this.handleRowMouseLeave,onContextMenu:this.handleApplicationContextMenu,setRef:this.setRowRef},cellProps:{activeRowKey:null!=l?l:a,onContextMenu:this.handleApplicationContextMenu,
setActiveRowKey:this.setActiveRowKey,clearActiveRowKey:this.clearActiveRowKey,sortKey:t,sortDirection:n},onSort:this.handleSort}):null,this.renderImportHelp()]})};return i}(o.PureComponent);f6.defaultProps={stickyHeader:!1};function d6(e){var t=o.useContext(Ie.AnalyticsContext),n=(0,a.TH)(),i=(0,s.cj)([L4.Z],(function(){return{applicationViewItems:L4.Z.sortedFilteredLibraryApplicationViewItems,filterQuery:L4.Z.applicationFilterQuery,fetched:L4.Z.hasFetchedApplications}})),c=i.applicationViewItems,l=i.filterQuery,u=i.fetched,f=(0,s.cj)([U4.Z],(function(){return{sortKey:U4.Z.sortKey,sortDirection:U4.Z.sortDirection,activeRowKey:U4.Z.activeRowKey,isNavigatingByKeyboard:U4.Z.isNavigatingByKeyboard}})),d=f.sortKey,p=f.sortDirection,h=f.activeRowKey,E=f.isNavigatingByKeyboard;return(0,r.jsx)(f6,Q3(X3({},e),{analyticsContext:t,location:n,applicationViewItems:c,filterQuery:l,fetched:u,sortKey:d,sortDirection:p,activeRowKey:h,isNavigatingByKeyboard:E}))}
var p6,h6=n(454708),E6=n(592659),y6=n(911220),m6=n.n(y6);function b6(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g6(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function O6(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){g6(e,t,n[t])}))}return e}function v6(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}
}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return b6(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b6(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}!function(e){e.XSMALL="xsmall";e.SMALL="small";e.LARGE="large"}(p6||(p6={}));var _6=function(e){var t=e.className,n=e.percents,o=e.size,i=void 0===o?p6.SMALL:o,a=e.foregroundColors,s=void 0===a?[$b.Z.unsafe_rawColors.BRAND_500.css]:a,c=e.backgroundColor,l=void 0===c?"var(--background-modifier-active)":c,u=e.animate,f=void 0===u||u,d=Wa().zip(n,s).map((function(e,t){var n,o=v6(e,2),a=o[0],s=o[1];n=Array.isArray(s)?{background:"linear-gradient(to right, ".concat(s[0],", ").concat(s[1],")")}:{
backgroundColor:s};return(0,r.jsx)("div",{className:lh()(m6().progressBar,m6()[i],g6({},m6().animating,f)),style:O6({transform:"translate3d(".concat(Math.min(Math.max(0,a),100)-100,"%, 0, 0)")},n)},t)})).reverse();return(0,r.jsx)("div",{className:lh()(t,m6().progress,m6()[i]),style:{backgroundColor:l},children:d})};_6.Sizes=p6;const I6=_6;var S6=n(829389),T6=n(222641),N6=n(701190),A6=n(452723),C6=n(963429),P6=n(852007),j6=n.n(P6);function R6(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function x6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M6(e){M6=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return M6(e)}function w6(e,t){return!t||"object"!==L6(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function D6(e,t){
D6=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return D6(e,t)}function Z6(e){return function(e){if(Array.isArray(e))return R6(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return R6(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R6(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var L6=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function U6(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=M6(e);if(t){var o=M6(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return w6(this,n)}}var k6=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&D6(e,t)}(n,e);var t=U6(n);function n(){x6(this,n);var e;(e=t.apply(this,arguments)).canvas=o.createRef();e.updateAnimation=function(t){var n=e.canvas.current;if(null!=n){var r=e.props,o=r.data,i=r.updateInterval,a=r.color,s=r.numUpdatesToShow,c=r.lineWidth,l=r.animate,u=r.gradientStopColor;if(!(o.length<2)){var f=Math.max(Math.min((t-e.dataChangedAt)/i,1),0),d=n.getContext("2d"),p=e.maxValue;d.strokeStyle=a;d.lineWidth=c
;var h=n.height-d.lineWidth,E=d.createLinearGradient(0,0,0,h);if(null!=u)E.addColorStop(0,u);else{var y=Ux.oo(a),m=y.r,b=y.g,g=y.b;E.addColorStop(0,"rgba(".concat(m,", ").concat(b,", ").concat(g,", 0)"))}E.addColorStop(1,e.fillColor);d.fillStyle=E;var O=o.length>=s?s:o.length;d.setTransform(1,0,0,-1,0,n.height);d.clearRect(0,0,n.width,n.height);d.translate(0,.5*d.lineWidth);var v,_,I=Math.floor(n.width/(O-3)),S=.5*I,T=I-I*f;d.translate(T,0);d.beginPath();var N=-I;o.forEach((function(e,t){v={x:N,y:h*e/p};0===t?d.moveTo(v.x,v.y):d.bezierCurveTo(_.x+S,_.y,v.x-S,v.y,v.x,v.y);_=v;N+=I}));d.stroke();d.lineTo(N-I,0);d.lineTo(0,0);d.fill();l&&f<1&&(e.animationFrameRequestId=window.requestAnimationFrame(e.updateAnimation))}}};return e}var i=n.prototype;i.onDataUpdate=function(e,t){var n=this.props,r=n.maxValue,o=n.data,i=n.animate,a=null==e||e.data!==t.data&&!Wa().isEqual(e.data,t.data);if(a){var s;this.dataChangedAt=performance.now();this.maxValue=null!=r?r:(s=Math).max.apply(s,Z6(o))}
if(a||null==e||!e.animate&&i||e.color!==this.props.color){var c=Ux.oo(this.props.color);this.fillColor="rgba(".concat(c.r,", ").concat(c.g,", ").concat(c.b,", 0.5)");window.cancelAnimationFrame(this.animationFrameRequestId);this.animationFrameRequestId=window.requestAnimationFrame(this.updateAnimation)}};i.componentDidMount=function(){this.animationFrameRequestId=0;this.onDataUpdate(null,this.props)};i.componentDidUpdate=function(e){this.onDataUpdate(e,this.props)};i.componentWillUnmount=function(){window.cancelAnimationFrame(this.animationFrameRequestId);this.animationFrameRequestId=0};i.render=function(){var e=this.props,t=e.className,n=e.pixelWidth,o=e.pixelHeight;return(0,r.jsx)("div",{className:t,children:(0,r.jsx)("canvas",{ref:this.canvas,className:j6().canvas,width:n,height:o})})};return n}(o.PureComponent);k6.defaultProps={animate:!0};const G6=k6;var B6=n(275746),H6=n.n(B6);const V6=function(e){
var t,n=e.title,o=e.className,i=e.color,a=e.animate,s=e.gradientStopColor,c=e.getHistoricalTotalBytes,l=(0,ER.Sl)(i).hex,u=null===(t=(0,ER.Sl)(s))||void 0===t?void 0:t.hex;return(0,r.jsx)(C6.Z,{getHistoricalTotalBytes:c,children:function(e,t,i){return(0,r.jsx)("div",{className:lh()(H6().monitor,o),children:(0,r.jsxs)(uh.Z,{align:uh.Z.Align.CENTER,children:[(0,r.jsxs)(uh.Z,{className:H6().text,direction:uh.Z.Direction.VERTICAL,children:[(0,r.jsx)("div",{className:H6().title,children:n}),(0,r.jsx)("div",{className:H6().rate,children:(s=e[e.length-1]/t*1e3,s>1e3?Q.Z.Messages.FILE_RATE_MB.format({size:Math.round(s/1e3)}):Q.Z.Messages.FILE_RATE_KB.format({size:Math.round(s)}))})]}),(0,r.jsx)("div",{className:H6().overflowContainer,children:(0,r.jsx)(G6,{data:e,maxValue:Math.max(Math.max.apply(null,e),1e3),className:H6().sparkChart,updateInterval:t,color:l,gradientStopColor:u,numUpdatesToShow:i,animate:a,pixelWidth:600,pixelHeight:48,lineWidth:4})})]})});var s}})};var F6=n(51786),Y6=n.n(F6)
;function z6(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function W6(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function K6(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){W6(i,r,o,a,s,"next",e)}function s(e){W6(i,r,o,a,s,"throw",e)}a(void 0)}))}}function q6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function X6(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1;r.configurable=!0;"value"in r&&(r.writable=!0);Object.defineProperty(e,r.key,r)}}function Q6(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function $6(e){$6=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return $6(e)}function J6(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&n5(e,t)}function e5(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function t5(e,t){return!t||"object"!==o5(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function n5(e,t){n5=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return n5(e,t)}function r5(e){return function(e){
if(Array.isArray(e))return z6(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return z6(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z6(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var o5=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function i5(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1
}}();return function(){var n,r=$6(e);if(t){var o=$6(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return t5(this,n)}}var a5,s5,c5,l5,u5=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){
a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},f5=function(e){var t=e.className,n=e.children,o=e.onContextMenu,i=e.item;return(0,r.jsx)("div",{className:t,onContextMenu:function(e){return o(e,i)},children:n})},d5=[$b.Z.unsafe_rawColors.BLUE_345.css,$b.Z.colors.INTERACTIVE_NORMAL.css],p5=function(e){var t=e.tooltip,n=e.onClick,o=e.icon;return(0,r.jsx)(c.ua7,{text:t,children:function(e){var i=e.onMouseEnter,a=e.onMouseLeave;return(0,r.jsx)(c.zxk,{"aria-label":t,className:Y6().actionButton,innerClassName:Y6().actionButtonContents,color:c.zxk.Colors.PRIMARY,size:c.zxk.Sizes.ICON,onClick:n,onMouseEnter:i,onMouseLeave:a,children:(0,r.jsx)(o,{className:Y6().actionIcon})})}})};function h5(e,t){switch(t){case M.f07.POST_INSTALL_SCRIPTS:case M.f07.PLANNING:case M.f07.FINALIZING:case M.f07.ALLOCATING_DISK:
return"".concat(e);default:return(0,A6.BU)(e,{useKibibytes:!0})}}var E5=(Q6(l5={},M.vxO.INSTALLING,(Q6(a5={},kK.J6.NONE,(function(e,t,n,r){return Q.Z.Messages.GAME_LIBRARY_UPDATES_INSTALLING.format({percent:e,progress:t,total:n})})),Q6(a5,kK.J6.SECONDS,(function(e,t,n,r){return Q.Z.Messages.GAME_LIBRARY_UPDATES_INSTALLING_SECONDS.format({percent:e,progress:t,total:n,timeRemaining:r})})),Q6(a5,kK.J6.MINUTES,(function(e,t,n,r){return Q.Z.Messages.GAME_LIBRARY_UPDATES_INSTALLING_MINUTES.format({percent:e,progress:t,total:n,timeRemaining:r})})),Q6(a5,kK.J6.HOURS,(function(e,t,n,r){return Q.Z.Messages.GAME_LIBRARY_UPDATES_INSTALLING_HOURS.format({percent:e,progress:t,total:n,timeRemaining:r})})),a5)),Q6(l5,M.vxO.UPDATING,(Q6(s5={},kK.J6.NONE,(function(e,t,n,r){return Q.Z.Messages.GAME_LIBRARY_UPDATES_UPDATING.format({percent:e,progress:t,total:n})})),Q6(s5,kK.J6.SECONDS,(function(e,t,n,r){return Q.Z.Messages.GAME_LIBRARY_UPDATES_UPDATING_UPDATING_SECONDS.format({percent:e,progress:t,
total:n,timeRemaining:r})})),Q6(s5,kK.J6.MINUTES,(function(e,t,n,r){return Q.Z.Messages.GAME_LIBRARY_UPDATES_UPDATING_UPDATING_MINUTES.format({percent:e,progress:t,total:n,timeRemaining:r})})),Q6(s5,kK.J6.HOURS,(function(e,t,n,r){return Q.Z.Messages.GAME_LIBRARY_UPDATES_UPDATING_UPDATING_HOURS.format({percent:e,progress:t,total:n,timeRemaining:r})})),s5)),Q6(l5,M.vxO.REPAIRING,(Q6(c5={},kK.J6.NONE,(function(e,t,n,r){return Q.Z.Messages.GAME_LIBRARY_UPDATES_INSTALLING.format({percent:e,progress:t,total:n})})),Q6(c5,kK.J6.SECONDS,(function(e,t,n,r){return Q.Z.Messages.GAME_LIBRARY_UPDATES_INSTALLING_SECONDS.format({percent:e,progress:t,total:n,timeRemaining:r})})),Q6(c5,kK.J6.MINUTES,(function(e,t,n,r){return Q.Z.Messages.GAME_LIBRARY_UPDATES_INSTALLING_MINUTES.format({percent:e,progress:t,total:n,timeRemaining:r})})),Q6(c5,kK.J6.HOURS,(function(e,t,n,r){return Q.Z.Messages.GAME_LIBRARY_UPDATES_INSTALLING_HOURS.format({percent:e,progress:t,total:n,timeRemaining:r})})),c5)),l5)
;function y5(e,t,n,r,o){var i=null!=e?e/60:null,a=E5[t],s=null!=a?Object.keys(a):[],c=(0,kK.CI)(i,s),l=c.unit,u=c.time;if(null!=a&&null!=l){var f=a[l];return null!=f?f(n,r,o,u):null}return null}function m5(e){var t=e.type,n=e.stage,r=e.percent,o=e.progress,i=e.total,a=e.secondsRemaining,s=h5(i,n),c=h5(o,n);switch(n){case M.f07.QUEUED:return 0===o?Q.Z.Messages.GAME_LIBRARY_UPDATES_PROGRESS_WAITING_FOR_ANOTHER_NO_TRANSITION:Q.Z.Messages.GAME_LIBRARY_UPDATES_PROGRESS_WAITING_FOR_ANOTHER.format({percent:r,progress:c,total:s});case M.f07.PLANNING:return Q.Z.Messages.GAME_LIBRARY_UPDATES_PROGRESS_PLANNING.format({percent:r});case M.f07.ALLOCATING_DISK:return Q.Z.Messages.GAME_LIBRARY_UPDATES_PROGRESS_ALLOCATING_DISK.format({percent:r});case M.f07.PATCHING:return y5(a,t,r,c,s);case M.f07.FINALIZING:return Q.Z.Messages.GAME_LIBRARY_UPDATES_PROGRESS_FINALIZING.format({percent:r});case M.f07.PAUSING:return Q.Z.Messages.GAME_LIBRARY_UPDATES_PROGRESS_PAUSING.format({percent:r,progress:c,total:s})
;case M.f07.VERIFYING:return Q.Z.Messages.GAME_LIBRARY_UPDATES_PROGRESS_VERIFYING.format({percent:r,progress:c,total:s});case M.f07.POST_INSTALL_SCRIPTS:return Q.Z.Messages.GAME_LIBRARY_UPDATES_PROGRESS_POST_INSTALL_SCRIPTS.format({percent:r,progress:c,total:s});case M.f07.REPAIRING:return t===M.vxO.REPAIRING?y5(a,t,r,c,s):Q.Z.Messages.GAME_LIBRARY_UPDATES_PROGRESS_REPAIRING.format({percent:r,progress:c,total:s})}throw new Error("Invalid Dispatch stage")}function b5(e,t,o){Ob.jW(e,K6((function(){var e,i;return u5(this,(function(a){switch(a.label){case 0:return[4,n.e(96743).then(n.bind(n,196743))];case 1:e=a.sent(),i=e.default;return[2,function(e){return(0,r.jsx)(i,e5(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Q6(e,t,n[t])}))}
return e}({},e),{applicationId:t.applicationId,branchId:t.branchId,analyticsContext:o}))}]}}))})))}var g5="name",O5="progress",v5="actions",_5=function(e){J6(n,e);var t=i5(n);function n(){q6(this,n);var e;(e=t.apply(this,arguments)).renderProgressPatchingBody=function(t,n){var r=e.props.item.state;if(null==r)return null;var o=r.stage,i=r.progress,a=r.total,s=r.type,c=r.readerProgress;if(null==i||null==a||null==o)return null;var l=u3.xI(i,a),u=u3.xI(null!=c?c:0,a),f=t[t.length-1]/n*1e3,d=a-i,p=0!==f?Math.max(1,d/f):null,h=m5({type:s,stage:o,percent:Math.floor(l),progress:i,total:a,secondsRemaining:p});return e.renderStackedProgress({percents:[l,u],message:h})};return e}var o=n.prototype;o.renderBody=function(e){var t=e.percent,n=e.foregroundColor,o=e.foregroundGradientColor,i=e.message;return(0,r.jsxs)(uh.Z,{direction:uh.Z.Direction.VERTICAL,children:[(0,r.jsx)(E6.Z,{percent:t,size:E6.Z.Sizes.SMALL,foregroundColor:(0,ER.Lq)(n),foregroundGradientColor:null!=o?[(0,ER.Lq)(o[0]),(0,
ER.Lq)(o[1])]:void 0,animate:this.isFocused}),(0,r.jsx)("div",{className:Y6().progressCellText,children:null!=i?i:""})]})};o.renderStackedProgress=function(e){var t=e.percents,n=e.message;return(0,r.jsxs)(uh.Z,{direction:uh.Z.Direction.VERTICAL,children:[(0,r.jsx)(I6,{percents:t,size:E6.Z.Sizes.SMALL,foregroundColors:d5,animate:this.isFocused}),(0,r.jsx)("div",{className:Y6().progressCellText,children:null!=n?n:""})]})};o.renderFinished=function(){var e=this.props.item;return this.renderBody({message:Q.Z.Messages.GAME_LIBRARY_UPDATES_PROGRESS_FINISHED.format({remove:function(){return $n.wi(e.applicationId,e.branchId)}}),foregroundColor:e.theme===M.BRd.LIGHT?M.Ilk.PRIMARY_300:M.Ilk.PRIMARY_500,percent:100})};o.renderQueued=function(){var e,t,n=this.props.item,r=n.state,o=n.theme;if(null!=r){var i=r.progress,a=r.total,s=r.stage;if(null!=i&&null!=a){var c=h5(a,s),l=h5(i,s);t=u3.xI(i,a);var u=Math.floor(t);e=s===M.f07.PAUSING?Q.Z.Messages.GAME_LIBRARY_UPDATES_PROGRESS_PAUSING.format({
percent:u,progress:l,total:c}):Q.Z.Messages.GAME_LIBRARY_UPDATES_PROGRESS_QUEUED.format({percent:u,progress:l,total:c})}}if(null==t||null==e){t=0;e=Q.Z.Messages.GAME_LIBRARY_UPDATES_PROGRESS_QUEUED_NO_TRANSITION}return this.renderBody({percent:t,foregroundColor:o===M.BRd.LIGHT?M.Ilk.PRIMARY_300:M.Ilk.PRIMARY_500,message:e})};o.renderPaused=function(){var e=this.props.item,t=e.state,n=e.theme;if(null==t)return null;var r=t.progress,o=t.total;if(null==r||null==o)return null;var i=u3.xI(r,o),a=Math.floor(i),s=0===r&&1===o?Q.Z.Messages.GAME_LIBRARY_UPDATES_PROGRESS_PAUSED_NO_TRANSITION:Q.Z.Messages.GAME_LIBRARY_UPDATES_PROGRESS_PAUSED.format({percent:a,progress:(0,A6.BU)(r),total:(0,A6.BU)(o)});return this.renderBody({message:s,foregroundColor:n===M.BRd.LIGHT?M.Ilk.PRIMARY_300:M.Ilk.PRIMARY_500,percent:i})};o.renderProgressPatching=function(){return(0,r.jsx)(C6.Z,{getHistoricalTotalBytes:qy.Z.getHistoricalTotalBytesWritten,updateInterval:5e3,children:this.renderProgressPatchingBody})}
;o.renderProgressDefault=function(){var e=this.props.item.state;if(null==e)return null;var t=e.total,n=e.progress,r=e.stage,o=e.type;if(null==t||null==n||null==r)return null;var i=u3.xI(n,t),a=Math.floor(i);return this.renderBody({percent:i,message:m5({type:o,stage:r,percent:a,progress:n,total:t}),foregroundColor:M.Ilk.BLUE_345})};o.renderProgress=function(){var e=this.props.item.state;switch(null!=e?e.stage:null){case M.f07.PATCHING:case M.f07.REPAIRING:return this.renderProgressPatching();default:return this.renderProgressDefault()}};o.render=function(){var e=this.props,t=e.item,n=e.cellProps;return t.finished?this.renderFinished():t.index>0?this.renderQueued():null==t.state||t.state.type!==M.vxO.UPDATING&&t.state.type!==M.vxO.REPAIRING&&t.state.type!==M.vxO.INSTALLING?null:null!=n&&n.paused?this.renderPaused():this.renderProgress()};!function(e,t,n){t&&X6(e.prototype,t);n&&X6(e,n)}(n,[{key:"isFocused",get:function(){var e=this.props.cellProps;return null!=e&&e.isFocused}}]);return n
}(o.PureComponent),I5=function(){return(0,r.jsx)(p5,{icon:N6.Z,tooltip:Q.Z.Messages.GAME_LIBRARY_UPDATES_ACTION_RESUME,onClick:function(){return $n.v4()}})},S5=function(){return(0,r.jsx)(p5,{icon:T6.Z,tooltip:Q.Z.Messages.GAME_LIBRARY_UPDATES_ACTION_PAUSE,onClick:function(){return $n.wO()}})},T5=function(e){var t=e.item;return(0,r.jsx)(p5,{icon:S6.Z,tooltip:Q.Z.Messages.GAME_LIBRARY_UPDATES_ACTION_MOVE_UP,onClick:function(){return $n.A1(t.applicationId,t.branchId)}})},N5=function(e){var t=e.item;return(0,r.jsx)(p5,{icon:Ub.Z,tooltip:Q.Z.Messages.GAME_LIBRARY_UPDATES_ACTION_REMOVE,onClick:function(){return $n.al(t.applicationId,t.branchId)}})},A5=[{key:g5,cellClassName:Y6().nameCell,render:function(e){return(0,r.jsxs)(uh.Z,{align:uh.Z.Align.CENTER,children:[(0,r.jsx)(UK.Z,{game:e.application,className:Y6().gameIcon,size:UK.Z.Sizes.SMALL}),(0,r.jsx)("div",{className:Y6().nameCellText,children:e.application.name})]})}},{key:O5,cellClassName:Y6().progressCell,
headerCellClassName:Y6().progressCellHeader,bodyCellClassName:Y6().progressCellBody,render:function(e,t){return(0,r.jsx)(_5,{item:e,cellProps:t})}},{key:v5,cellClassName:Y6().actionsCell,render:function(e,t){var n,o;if(e.finished)n=null!=e.libraryApplication?(0,r.jsx)(s3.Z,{libraryApplication:e.libraryApplication,size:c.zxk.Sizes.SMALL,className:Y6().gameActionButton,source:M.Sbl.APPLICATION_LIBRARY_UPDATES}):null;else if(null!=e.state){if(e.state.type!==M.vxO.UP_TO_DATE){n=e.index>0?(0,r.jsx)(T5,{item:e}):null!=t&&t.paused?(0,r.jsx)(I5,{}):(0,r.jsx)(S5,{item:e});o=(0,r.jsx)(N5,{item:e})}}else o=(0,r.jsx)(N5,{item:e});return(0,r.jsxs)(uh.Z,{justify:uh.Z.Justify.END,children:[n,o]})}}],C5=function(e){J6(n,e);var t=i5(n);function n(){q6(this,n);var e;(e=t.apply(this,arguments)).isUnmounted=!1;e.isTallerThanHalfViewport=!1;e.throttledUpdateHeight=Wa().throttle((function(){if(!e.isUnmounted){var t=e.props,n=t.height,r=t.onHeightTallerThanHalfViewportChange,o=n>window.innerHeight/2
;if(e.isTallerThanHalfViewport!==o){e.isTallerThanHalfViewport=o;r(o)}}}),1e3);return e}var o=n.prototype;o.componentDidMount=function(){window.addEventListener("resize",this.throttledUpdateHeight)};o.componentDidUpdate=function(e){this.props.height!==e.height&&this.throttledUpdateHeight()};o.componentWillUnmount=function(){this.props.applications.forEach((function(e){e.finished&&O.Z.wait((function(){$n.wi(e.applicationId,e.branchId)}))}));window.removeEventListener("resize",this.throttledUpdateHeight);this.isUnmounted=!0};o.render=function(){var e=this.props,t=e.applications,n=e.paused,o=e.isFocused,i=e.theme,a=e.analyticsContext;return 0===t.length?null:(0,r.jsxs)("div",{className:Y6().gameUpdates,children:[(0,r.jsxs)("div",{className:Y6().headerRow,children:[(0,r.jsx)(V6,{className:lh()(Y6().headerCell,Y6().networkProgress),title:Q.Z.Messages.GAME_LIBRARY_UPDATES_HEADER_NETWORK,getHistoricalTotalBytes:qy.Z.getHistoricalTotalBytesDownloaded,color:M.Ilk.GREEN_360,animate:o}),(0,
r.jsx)(V6,{className:lh()(Y6().headerCell,Y6().diskProgress),title:Q.Z.Messages.GAME_LIBRARY_UPDATES_HEADER_DISK,getHistoricalTotalBytes:qy.Z.getHistoricalTotalBytesWritten,color:M.Ilk.BLUE_345,animate:o})]}),(0,r.jsx)(c3.Z,{hasHeader:!1,columns:A5,data:t,className:Y6().table,rowClassName:Y6().row,rowComponent:f5,cellProps:{paused:n,isFocused:o,theme:i},rowProps:{onContextMenu:function(e,t){return b5(e,t,a)}},bodyCellClassName:Y6().cell})]})};return n}(o.PureComponent);function P5(e,t,n,r){return e.reduce((function(e,o,i){var a=o.applicationId,s=o.branchId,c=n.getGame(a),l=r.getState(a,s);null!=c&&e.push({key:"".concat(a,":").concat(s),applicationId:a,branchId:s,state:l,application:c,libraryApplication:Ln.Z.getLibraryApplication(a,s),finished:t,index:i});return e}),[])}const j5=(0,yb.Z)(s.ZP.connectStores([h6.Z,st.Z,We.Z,Rn.Z,qy.Z],(function(){var e=P5(h6.Z.activeItems,!1,Rn.Z,qy.Z),t=P5(h6.Z.finishedItems,!0,Rn.Z,qy.Z);return{applications:r5(e).concat(r5(t)),paused:h6.Z.paused,
isFocused:We.Z.isFocused(),theme:st.Z.theme}}))((0,cX.Z)(C5)));var R5=n(248231),x5=n.n(R5);function M5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w5(e){w5=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return w5(e)}function D5(e,t){return!t||"object"!==L5(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Z5(e,t){Z5=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Z5(e,t)}var L5=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function U5(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}()
;return function(){var n,r=w5(e);if(t){var o=w5(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return D5(this,n)}}var k5=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Z5(e,t)}(n,e);var t=U5(n);function n(){M5(this,n);var e;(e=t.apply(this,arguments))._scrollerRef=o.createRef();e._scrollToPadding=0;e.state={includeUpdatesInScroller:!1};e.handleHeightTallerThanHalfViewportChange=function(t){e.setState({includeUpdatesInScroller:t})};e.scrollToRow=function(t,n){var r=e._scrollerRef.current;if(null!=r){t.focus();r.scrollIntoViewRect({start:n,end:n});e._scrollToOnMount=null}else{e._scrollToOnMount=t;e._scrollToPadding=n}};return e}var i=n.prototype;i.componentDidMount=function(){qH(M.Z5c.APPLICATION_LIBRARY);(0,w4.T)(M.jEp.LIBRARY);O.Z.wait((function(){return(0,x4.o)()}))
;(0,M4.N)();null!=this._scrollToOnMount&&null!=this._scrollerRef.current&&this.scrollToRow(this._scrollToOnMount,this._scrollToPadding)};i.renderToolbar=function(){return(0,r.jsx)(Q4,{})};i.render=function(){var e=this.state.includeUpdatesInScroller,t=(0,r.jsx)("div",{children:(0,r.jsx)(fW.Z,{section:M.jXE.LIBRARY_INSTALL_MODULE,children:(0,r.jsx)(j5,{onHeightTallerThanHalfViewportChange:this.handleHeightTallerThanHalfViewportChange})})});return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(i3,{currentRoute:M.Z5c.APPLICATION_LIBRARY,renderToolbar:this.renderToolbar}),e?null:t,(0,r.jsxs)(c.yWw,{className:lh()(x5().container,x5().scroller),ref:this._scrollerRef,children:[e?t:null,(0,r.jsx)(fW.Z,{section:M.jXE.LIBRARY_APPLICATION_LIST,children:(0,r.jsx)(d6,{stickyHeader:!e,scrollToRow:this.scrollToRow})})]})]})};return n}(o.PureComponent),G5=n(324171),B5=n(980151),H5=n(840974),V5=n(282019),F5=n.n(V5);function Y5(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,
writable:!0}):e[t]=n;return e}function z5(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var W5=Math.ceil(2*Math.PI*20);function K5(e){var t=Math.round(-85*e+199),n=Math.round(-71*e+208),r=Math.round(-22*e+240);return"rgb(".concat(t,", ").concat(n,", ").concat(r,")")}function q5(e){var t=Math.floor(W5*e);return"".concat(t,", ").concat(W5)}const X5=function(e){var t=e.total,n=e.used,o=Math.max(0,Math.min(1,n/t)),i="".concat(Math.floor(100*o),"%");return(0,r.jsx)(c.ua7,{text:Q.Z.Messages.APPLICATION_INSTALLATION_SPACE_USED.format({used:i}),children:function(e){return(0,
r.jsxs)("div",z5(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Y5(e,t,n[t])}))}return e}({className:F5().wrapper,role:"progressbar","aria-label":Q.Z.Messages.APPLICATION_INSTALLATION_SPACE_USED.format({used:i})},e),{children:[(0,r.jsxs)("svg",{viewBox:"25 25 50 50",className:F5().svg,"aria-hidden":!0,children:[(0,r.jsx)("circle",{className:F5().background,cx:"50",cy:"50",r:20}),(0,r.jsx)("circle",{className:F5().foreground,cx:"50",cy:"50",r:20,stroke:K5(o),strokeDasharray:q5(o)})]}),(0,r.jsx)("aside",{className:F5().usageInfo,"aria-hidden":!0,children:i})]}))}})};var Q5=n(108106),$5=n(94093),J5=n.n($5);function e7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t7(e,t,n){
t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function n7(e){n7=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return n7(e)}function r7(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&s7(e,t)}function o7(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){t7(e,t,n[t])}))}return e}function i7(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){
var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function a7(e,t){return!t||"object"!==c7(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s7(e,t){s7=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return s7(e,t)}var c7=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function l7(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=n7(e);if(t){var o=n7(this).constructor
;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return a7(this,n)}}var u7=function(e){r7(n,e);var t=l7(n);function n(){e7(this,n);var e;(e=t.apply(this,arguments)).state={label:void 0,isDefault:null};e.handleStartEditing=function(){var t=e.props,n=t.path,r=t.label,o=t.isDefault;(0,t.onToggleEditing)(n);e.setState({label:r,isDefault:o})};e.handleStopEditing=function(){(0,e.props.onToggleEditing)(null);e.setState({label:void 0,isDefault:null})};e.handleRemoveLocation=function(){(0,c.h7j)((function(t){return(0,r.jsx)(c.sm4,i7(o7({},t),{header:Q.Z.Messages.USER_SETTINGS_GAMES_INSTALL_LOCATION_REMOVE,confirmText:Q.Z.Messages.USER_SETTINGS_GAMES_INSTALL_LOCATION_REMOVE,cancelText:Q.Z.Messages.CANCEL,onConfirm:function(){e.handleStopEditing();(0,B5.iD)(e.props.path)},children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:Q.Z.Messages.USER_SETTINGS_GAMES_REMOVE_LOCATION_BODY})}))}))};e.handleSaveChanges=function(){(0,B5.Tb)(e.props.path,{
label:null!=e.state.label?e.state.label:e.props.label,isDefault:null!=e.state.isDefault?e.state.isDefault:e.props.isDefault});e.handleStopEditing()};e.handleLabelChange=function(t){e.setState({label:t})};e.handleToggleDefault=function(){e.setState({isDefault:!e.state.isDefault})};return e}var o=n.prototype;o.renderDiskUsageCircle=function(){var e=this.props.metadata;return null!=e&&null!=e.availableKB&&null!=e.totalKB?(0,r.jsx)(X5,{total:e.totalKB,used:e.totalKB-e.availableKB}):null};o.renderViewing=function(){var e,t,n=this.props,o=n.path,i=n.label,a=n.editingPath,s=n.isDefault,l=n.metadata;if(null!=l){e=null!=l.availableKB?(0,A6.BU)(l.availableKB,{useKibibytes:!0}):null;t=null!=l.totalKB?(0,A6.BU)(l.totalKB,{useKibibytes:!0}):null}return(0,r.jsxs)(uh.Z,{className:J5().installationPath,align:uh.Z.Align.CENTER,children:[this.renderDiskUsageCircle(),(0,r.jsxs)(uh.Z,{direction:uh.Z.Direction.VERTICAL,className:J5().descriptionWrapper,children:[(0,r.jsxs)(uh.Z,{align:uh.Z.Align.CENTER,
children:[(0,r.jsx)(c.X6q,{className:J5().rowTitle,variant:"heading-md/semibold",children:null!=i?i:H5.Z.getLabelFromPath(o)}),s?(0,r.jsx)("span",{className:J5().defaultIndicator,children:Q.Z.Messages.DEFAULT}):null]}),null!=l&&null!=e&&null!=t?(0,r.jsx)(Q5.Z,{className:J5().rowBody,hoverText:Q.Z.Messages.USER_SETTINGS_GAMES_INSTALL_LOCATION_SPACE.format({available:e,total:t}),children:o}):(0,r.jsx)(c.xvT,{className:J5().rowBody,variant:"text-xs/normal",children:o})]}),(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,disabled:null!=a,color:c.zxk.Colors.PRIMARY,onClick:this.handleStartEditing,children:Q.Z.Messages.EDIT})]})};o.renderEditing=function(){var e=this.props,t=e.path,n=e.hasGamesInstalledInPath,o=this.state,i=o.label,a=o.isDefault;return(0,r.jsx)(c.Zbd,{editable:!0,className:J5().installationPathEditing,children:(0,r.jsxs)(uh.Z,{children:[this.renderDiskUsageCircle(),(0,r.jsxs)(uh.Z.Child,{children:[(0,r.jsx)(c.xJW,{title:Q.Z.Messages.USER_SETTINGS_GAMES_INSTALL_LOCATION_NAME,
children:(0,r.jsx)(c.oil,{value:i,placeholder:H5.Z.getLabelFromPath(t),onChange:this.handleLabelChange})}),(0,r.jsx)(c.xJW,{title:Q.Z.Messages.USER_SETTINGS_GAMES_INSTALL_LOCATION,className:gh().marginTop20,children:(0,r.jsx)(c.oil,{disabled:!0,value:t})}),(0,r.jsx)(c.XZJ,{type:c.XZJ.Types.INVERTED,value:null!=a?a:this.props.isDefault,disabled:this.props.isDefault,className:J5().defaultLocationCheckbox,onChange:this.handleToggleDefault,children:Q.Z.Messages.USER_SETTINGS_GAMES_INSTALL_LOCATION_MAKE_DEFAULT}),(0,r.jsx)(c.$i$,{className:J5().separator}),(0,r.jsxs)(uh.Z,{children:[(0,r.jsx)(c.zxk,{disabled:n||this.props.isDefault,size:c.zxk.Sizes.SMALL,color:c.zxk.Colors.RED,look:c.zxk.Looks.OUTLINED,onClick:this.handleRemoveLocation,children:Q.Z.Messages.USER_SETTINGS_GAMES_INSTALL_LOCATION_REMOVE}),(0,r.jsxs)(uh.Z,{justify:uh.Z.Justify.END,children:[(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,color:c.zxk.Colors.PRIMARY,look:c.zxk.Looks.LINK,onClick:this.handleStopEditing,
children:Q.Z.Messages.CANCEL}),(0,r.jsx)(c.zxk,{disabled:t===this.props.path&&i===this.props.label&&a===this.props.isDefault,size:c.zxk.Sizes.SMALL,color:c.zxk.Colors.GREEN,onClick:this.handleSaveChanges,children:Q.Z.Messages.SAVE})]})]})]})]})})};o.render=function(){return this.props.editingPath===this.props.path?this.renderEditing():this.renderViewing()};return n}(o.PureComponent),f7=function(e){r7(n,e);var t=l7(n);function n(){e7(this,n);var e;(e=t.apply(this,arguments)).state={editingPath:null};e.handleAddInstallationLocation=function(){ss.default.showOpenDialog(["openDirectory"]).then((function(e){null!=e&&0!==e.length&&null!=e[0]&&"undefined"!==e[0]&&(0,B5.RY)(e[0])}))};e.handleToggleEditing=function(t){e.setState({editingPath:t})};return e}var o=n.prototype;o.componentDidMount=function(){(0,B5.ec)(this.props.installationPaths.map((function(e){return e.path})))};o.render=function(){
var e=this,t=this.props,n=t.installationPaths,o=t.installationPathsMetadata,i=t.defaultInstallationPath,a=this.state.editingPath;return(0,r.jsxs)(c.hjN,{className:J5().wrapper,title:Q.Z.Messages.USER_SETTINGS_GAMES_INSTALL_LOCATIONS,children:[n.map((function(t){var n=t.path,s=t.label;return(0,r.jsx)(u7,{path:n,label:s,metadata:o[n],isDefault:i===n,editingPath:a,hasGamesInstalledInPath:H5.Z.hasGamesInstalledInPath(n),onToggleEditing:e.handleToggleEditing},n)})),(0,r.jsx)("div",{className:J5().buttonRowWrapper,children:(0,r.jsx)(c.zxk,{disabled:!Lt.FB,onClick:this.handleAddInstallationLocation,size:c.zxk.Sizes.SMALL,children:Q.Z.Messages.USER_SETTINGS_GAMES_INSTALL_LOCATION_ADD})})]})};return n}(o.PureComponent);const d7=s.ZP.connectStores([H5.Z],(function(){return{installationPaths:H5.Z.installationPaths,installationPathsMetadata:H5.Z.installationPathsMetadata,defaultInstallationPath:H5.Z.defaultInstallationPath}}))(f7);var p7=n(735793),h7=n.n(p7);function E7(e,t){
if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y7(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function m7(e){m7=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return m7(e)}function b7(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){y7(e,t,n[t])}))}return e}function g7(e,t){return!t||"object"!==v7(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function O7(e,t){O7=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return O7(e,t)}var v7=function(e){
return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function _7(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=m7(e);if(t){var o=m7(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g7(this,n)}}function I7(e){var t=e.applicationViewItems,n=e.restoreApplication;if(0===t.length)return null;var o=t.map((function(e){var t=e.libraryApplication.getDistributor();return(0,r.jsxs)("div",{className:h7().hiddenLibraryApplication,children:[(0,r.jsxs)(uh.Z,{direction:uh.Z.Direction.VERTICAL,className:h7().hiddenLibraryApplicationContent,children:[(0,r.jsx)("div",{className:h7().applicationName,children:e.libraryApplication.getBranchedName(e.application)}),null!=t?(0,r.jsx)("div",{
className:h7().applicationSubText,children:M.EOG[t]}):null]}),(0,r.jsx)(c.P3F,{className:h7().restoreButton,onClick:function(){return n(e.libraryApplication)},children:(0,r.jsx)(Ub.Z,{className:h7().restoreIcon})})]},e.key)}));return(0,r.jsxs)(c.hjN,{className:h7().hiddenLibraryApplications,children:[(0,r.jsx)(c.vwX,{className:h7().hiddenLibraryApplicationsTitle,children:Q.Z.Messages.SETTINGS_GAMES_HIDDEN_LIBRARY_APPLICATIONS_LABEL}),o]})}var S7=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&O7(e,t)}(n,e);var t=_7(n);function n(){E7(this,n);var e;(e=t.apply(this,arguments)).handleRestoreHiddenLibraryApplication=function(t){var n=ms.x9(t.getFlags(),M.eHb.HIDDEN);G5.h(t.id,t.branchId,n);e.trackRestoreApplication(t,ms.yE(n,M.eHb.HIDDEN))};return e}var i=n.prototype;i.handleToggleShortcutDesktop=function(e){
ct.Xc.updateSetting(e)};i.handleToggleShortcutStartMenu=function(e){ct.Pe.updateSetting(e)};i.trackRestoreApplication=function(e,t){Ie.default.track(M.rMx.APPLICATION_SETTINGS_UPDATED,b7({hidden_enabled:t},e.getAnalyticsData()))};i.renderBody=function(){var e=this.props,t=e.hiddenLibraryApplicationViewItems,n=e.installShortcutDesktop,i=e.installShortcutStartMenu;return(0,r.jsxs)("div",{className:h7().body,children:[(0,er.Q)()?(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(c.j7V,{value:n,onChange:this.handleToggleShortcutDesktop,note:Q.Z.Messages.USER_SETTINGS_GAMES_SHORTCUTS_DESKTOP_NOTE,children:Q.Z.Messages.USER_SETTINGS_GAMES_SHORTCUTS_DESKTOP}),(0,r.jsx)(c.j7V,{value:i,onChange:this.handleToggleShortcutStartMenu,note:Q.Z.Messages.USER_SETTINGS_GAMES_SHORTCUTS_START_MENU_NOTE,children:Q.Z.Messages.USER_SETTINGS_GAMES_SHORTCUTS_START_MENU}),(0,r.jsx)(d7,{})]}):null,(0,r.jsx)(I7,{restoreApplication:this.handleRestoreHiddenLibraryApplication,applicationViewItems:t})]})}
;i.render=function(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i3,{currentRoute:M.Z5c.APPLICATION_LIBRARY_SETTINGS}),(0,r.jsx)(c.w0Z,{className:h7().scroller,children:this.renderBody()})]})};return n}(o.PureComponent);function T7(){var e={installShortcutDesktop:ct.Xc.useSetting(),installShortcutStartMenu:ct.Pe.useSetting(),hiddenLibraryApplicationViewItems:(0,s.e7)([L4.Z],(function(){return L4.Z.hiddenLibraryApplicationViewItems}))};return(0,r.jsx)(S7,b7({},e))}var N7=n(998854),A7=n.n(N7);function C7(){return(0,r.jsxs)(a.rs,{children:[(0,r.jsx)(ub.Z,{path:M.Z5c.APPLICATION_LIBRARY_SETTINGS,exact:!0,children:(0,r.jsxs)(fW.Z,{page:M.ZY5.LIBRARY_SETTINGS,root:!0,children:[(0,r.jsx)(Am.yY,{subsection:Q.Z.Messages.SETTINGS}),(0,r.jsx)(T7,{})]})}),(0,r.jsx)(ub.Z,{path:M.Z5c.APPLICATION_LIBRARY,children:(0,r.jsxs)(fW.Z,{page:M.ZY5.LIBRARY,root:!0,children:[(0,r.jsx)(Am.yY,{subsection:Q.Z.Messages.APPLICATION_LIBRARY_MY_GAMES}),(0,r.jsx)(k5,{})]})})]})}function P7(){
o.useEffect((function(){(0,uV.e)("application_library")}),[]);return(0,r.jsxs)("div",{className:A7().container,children:[(0,r.jsx)(Am.yY,{location:Q.Z.Messages.LIBRARY}),(0,r.jsx)(C7,{})]})}const j7=o.memo(P7);var R7=n(868844);var x7=(0,tc.B)({kind:"user",id:"2021-11_discovery_tags",label:"Discovery Tags",defaultConfig:{shouldDisplayTags:!1,shouldDisplayRecommendedSearchTags:!1},treatments:[{id:1,label:"Show keyword tags on home and search result pages",config:{shouldDisplayTags:!0,shouldDisplayRecommendedSearchTags:!1}},{id:2,label:"Show keyword tags on home and search result pages and under the search bar",config:{shouldDisplayTags:!0,shouldDisplayRecommendedSearchTags:!0}}]}),M7=n(64672),w7=n(218767),D7=n(819633),Z7=n(288634),L7=n(549069),U7=n(935576),k7=n(857012),G7=n.n(k7);function B7(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function H7(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0
}):e[t]=n;return e}function V7(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){H7(e,t,n[t])}))}return e}function F7(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Y7(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){
var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return B7(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B7(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var z7=["egirl","egirls","waifu","dating","nsfw","sex","playboy","stupid","harem","playgirl","shitcoin","shitpost","porno","nudes","sexy","horny","fart","tits","balls","cum"],W7=function(e){var t=e.text,n=e.onClick,o=e.className,i=e.hide;return(0,r.jsx)("li",{
className:lh()(G7().tag,o,H7({},G7().hide,i)),children:(0,r.jsx)(c.P3F,{className:G7().tagText,onClick:function(e){e.stopPropagation();e.preventDefault();n(e)},children:t})})},K7=function(e){var t=e.tags,n=e.onTagClick,i=e.guildId,a=e.section;o.useEffect((function(){Ie.default.track(M.rMx.OPEN_POPOUT,{type:"Discovery Tags Overflow",guild_id:i,location:{page:M.ZY5.GUILD_DISCOVERY,section:a}})}),[i,a]);return(0,r.jsx)(c.VqE,{className:G7().overflowTagsPopout,children:(0,r.jsx)("ul",{children:t.map((function(e){return(0,r.jsx)(W7,{onClick:function(){return n(e)},className:G7().tagAlt,text:e},e)}))})})},q7=function(e){var t=e.className,n=e.count;return(0,r.jsx)(c.yRy,{renderPopout:function(){return(0,r.jsx)(K7,V7({},e))},position:"right",align:"top",closeOnScroll:!0,children:function(e){return(0,r.jsx)(W7,F7(V7({className:t},e),{text:"+".concat(n)}))}})},X7={DEFAULT:G7().tagDefault,LIGHT:G7().tagLight,ALT:G7().tagAlt},Q7=function(e){
var t=e.tags,n=e.onTagClick,i=e.className,a=e.discoveryTagStyle,s=void 0===a?X7.DEFAULT:a,c=e.hideOverflow,l=void 0!==c&&c,u=e.guildId,f=e.section,d=(0,mb.Z)(),p=d.ref,h=d.width,E=Y7(o.useState(null),2),y=E[0],m=E[1],b=t.filter((function(e){return!z7.includes(e.toLowerCase())}));o.useLayoutEffect((function(){if(null!=p.current&&null!=h&&0!==h){for(var e=0,t=0,n=h-40-4,r=0;r<b.length;r++){t+=p.current.children[r].clientWidth+4;if(r===b.length-1?t>n+40:t>n)break;e++}m((function(t){return e<=b.length?e:t}))}}),[h,p,b]);return(0,r.jsxs)("ul",{ref:p,className:lh()(G7().tagContainer,i,H7({},G7().invisible,null==y)),children:[b.map((function(e,t){return(0,r.jsx)(W7,{className:s,onClick:function(){return n(e)},hide:null!=y&&t>=y,text:e},e)})),!l&&null!=y&&y<b.length&&(0,r.jsx)(q7,{className:s,onTagClick:n,tags:b.slice(y),count:b.length-y,guildId:u,section:f})]})},$7=n(584656),J7=n(668159),e8=n(473444),t8=n(734897),n8=n.n(t8);function r8(e,t){(null==t||t>e.length)&&(t=e.length)
;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o8(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function i8(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function a8(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}
return o}function s8(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r8(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const c8=function(e){var t=e.guild,n=s8(o.useState(!1),2),i=n[0],a=n[1],s=o.useCallback((function(){return a(!0)
}),[a]),l=o.useCallback((function(){return a(!0)}),[a]);return(0,r.jsx)("div",{className:lh()(n8().actionButtonsContainer,o8({},n8().forceButtonsShow,i)),children:(0,r.jsx)(J7.ZP,{children:(0,r.jsx)(e8.GuildDiscoveryMenuPopout,{onRequestOpen:s,onRequestClose:l,guild:t,children:function(e){var t=e.onClick,n=a8(e,["onClick"]);return(0,r.jsx)(c.ua7,{text:Q.Z.Messages.MORE,hideOnClick:!0,children:function(e){var o=e.onClick,i=a8(e,["onClick"]);return(0,r.jsx)(J7.zx,i8(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){o8(e,t,n[t])}))}return e}({},n,i),{onClick:function(e){e.stopPropagation();null==o||o();t(e)},"aria-label":Q.Z.Messages.MORE,children:(0,r.jsx)(IS.Z,{className:n8().overflowIcon})}))}})}})})})}
;var l8=n(874049),u8=n(211482),f8=n(475196),d8=n.n(f8),p8=n(860321),h8=n.n(p8),E8=n(145792),y8=n.n(E8),m8=n(348833),b8=n.n(m8);function g8(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O8(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function v8(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){O8(i,r,o,a,s,"next",e)}function s(e){O8(i,r,o,a,s,"throw",e)}a(void 0)}))}}function _8(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I8(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function S8(e){S8=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return S8(e)}function T8(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){I8(e,t,n[t])}))}return e}function N8(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function A8(e,t){return!t||"object"!==P8(t)&&"function"!=typeof t?g8(e):t}function C8(e,t){C8=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return C8(e,t)}var P8=function(e){
return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function j8(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=S8(e);if(t){var o=S8(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return A8(this,n)}}var R8=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,
o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},x8=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&C8(e,t)}(o,e);var t=j8(o);function o(){_8(this,o);var e;(e=t.apply(this,arguments)).state={loaded:!1,hasBeenSeen:!1,isVisible:!1,submitting:!1};var i=g8(e)
;e.handleClickView=function(){var e=v8((function(e){var t,n,r;return R8(this,(function(o){switch(o.label){case 0:if(e.target.className.includes("Menu"))return[2];t=i.props,n=t.onView,r=t.guild;e.stopPropagation();i.setState({submitting:!0});o.label=1;case 1:o.trys.push([1,,4,5]);return null!=n?[4,n(r.id)]:[3,3];case 2:o.sent();o.label=3;case 3:return[3,5];case 4:i.setState({submitting:!1});return[7];case 5:return[2]}}))}));return function(t){return e.apply(this,arguments)}}();e.handleVisibilityChange=function(t){var n=e.props,r=n.onGuildCardSeen,o=n.guild;if(null!=o&&!e.state.hasBeenSeen&&t){e.setState({hasBeenSeen:t});null!=r&&r(o.id)}};e.handleContextMenu=function(t){var o=g8(e);(0,Ob.jW)(t,v8((function(){var e,t;return R8(this,(function(i){switch(i.label){case 0:return[4,Promise.resolve().then(n.bind(n,473444))];case 1:e=i.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,N8(T8({},e),{guild:o.props.guild}))}]}}))})))};e.setIsVisible=function(t){e.setState({isVisible:t})}
;return e}var i=o.prototype;i.getDefaultSplashURL=function(e,t){if(t)return b8();switch(e){case M.BRd.DARK:return h8();case M.BRd.LIGHT:return y8()}};i.render=function(){var e,t=this,n=this.props,o=n.guild,i=n.className,a=n.theme,s=n.onTagClick,l=this.state,u=l.loaded,f=l.hasBeenSeen,d=l.isVisible,p=l.submitting,h=o.name,E=o.description,y=o.presenceCount,m=o.memberCount,b=o.keywords,g=null===(e=o.features)||void 0===e?void 0:e.has(M.oNc.HUB),O=Ds.ZP.getGuildDiscoverySplashURL({id:o.id,splash:o.discoverySplash,size:300*(0,l8.x_)()}),v=null!=O?O:this.getDefaultSplashURL(a,g),_=Ds.ZP.getGuildIconURL({id:o.id,icon:o.icon,size:40});x7.trackExposure({});var I=x7.getCurrentConfig({}).shouldDisplayTags,S=$7.N.getCurrentConfig({}).canSeeInAppReportingButtons;$7.N.trackExposure({});var T,N,A=ct.Sb.getSetting()||S;return(0,r.jsx)(U7.$,{active:!d,onChange:this.setIsVisible,threshold:.1,children:d?(0,r.jsx)(U7.$,{onChange:this.handleVisibilityChange,active:!f,threshold:.55,children:(0,
r.jsxs)("div",{className:lh()(i,(T={},I8(T,d8().loaded,u),I8(T,d8().loading,!u),T)),children:[p?(0,r.jsx)(c.$jN,{type:c.$jN.Type.PULSING_ELLIPSIS,className:d8().spinner}):null,(0,r.jsxs)(c.P3F,{onClick:this.handleClickView,className:lh()(d8().card,(N={},I8(N,d8().submitting,p),I8(N,d8().cardWithTags,I),N)),onContextMenu:this.handleContextMenu,children:[(0,r.jsxs)("div",{className:d8().cardHeader,children:[(0,r.jsx)("div",{className:d8().splash,children:(0,r.jsx)("img",{src:v,alt:"",className:lh()(d8().splashImage,I8({},d8().splashImageHeight,!g)),onLoad:function(){return t.setState({loaded:!0})}})}),A?(0,r.jsx)("div",{className:d8().actionButtons,children:(0,r.jsx)(c8,{guild:o})}):null,(0,r.jsx)("div",{className:d8().guildIcon,children:(0,r.jsx)(u8.ZP,{mask:u8.ZP.Masks.SQUIRCLE,width:48,height:48,children:(0,r.jsx)("div",{className:d8().iconMask,children:(0,r.jsx)(u8.ZP,{mask:u8.ZP.Masks.SQUIRCLE,width:40,height:40,children:(0,r.jsx)("img",{src:_,alt:"",className:d8().avatar})})})})})]
}),(0,r.jsxs)("div",{className:d8().guildInfo,children:[(0,r.jsxs)("div",{className:d8().title,children:[(0,r.jsx)(eg.Z,{className:d8().guildBadge,guild:o,tooltipColor:c.ua7.Colors.PRIMARY}),(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",className:d8().guildName,children:h})]}),(0,r.jsx)(c.xvT,{className:d8().description,variant:"text-sm/normal",color:"header-secondary",children:E}),I&&b&&s&&(0,r.jsx)(Q7,{tags:b,onTagClick:function(e){return s(e,o.id)},guildId:o.id,section:i2.P1.POPULAR}),(0,r.jsxs)("div",{className:d8().memberInfo,children:[null!=y&&(0,r.jsxs)("div",{className:d8().memberCount,children:[(0,r.jsx)("div",{className:d8().dotOnline}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"header-secondary",children:Q.Z.Messages.INSTANT_INVITE_GUILD_MEMBERS_ONLINE.format({membersOnline:y})})]}),null!=m&&(0,r.jsxs)("div",{className:d8().memberCount,children:[(0,r.jsx)("div",{className:d8().dotOffline}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"header-secondary",
children:Q.Z.Messages.INSTANT_INVITE_GUILD_MEMBERS_TOTAL.format({count:m})})]})]})]})]})]})}):(0,r.jsx)("div",{className:lh()(d8().card,I8({},d8().cardWithTags,I))})})};return o}(o.PureComponent);x8.Placeholder=function(e){return(0,r.jsx)("div",{className:lh()(e.className,d8().cardPlaceholder)})};const M8=x8;function w8(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function D8(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return w8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name)
;if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w8(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Z8=n(259906),L8=n.n(Z8);function U8(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}var k8=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:
a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},G8=[[1696,20],[1432,16],[1168,12],[0,8]],B8=[[1696,30],[1432,24],[1168,18],[0,12]];const H8=function(e){var t=e.title,n=e.subtitle,i=e.guildsData,a=e.analyticsContext,s=e.theme,l=e.onViewGuild,u=e.fetchGuilds,f=e.onGuildCardSeen,d=e.currentCategoryId,p=e.loadId,h=e.onTagClick,E=e.showMoreCards,y=void 0!==E&&E;o.useEffect((function(){O.Z.wait((function(){return u()}))}),[d]);var m=function(e){var t=D8(o.useState(0),2),n=t[0],r=t[1],i=o.useCallback((function(){
var t=window.innerWidth,n=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var c=D8(a.value,2),l=c[0],u=c[1];if(t>=l){r(u);return}}}catch(e){o=!0;i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}}),[e]);o.useEffect((function(){i()}),[i]);o.useEffect((function(){window.addEventListener("resize",i);return function(){window.removeEventListener("resize",i)}}));return n}(y?B8:G8),b=(0,Hw.Z)().analyticsLocations;if(null==i)return null;var g=i.guilds,v=i.loading,_=null==g||0===g.length;if(!v&&_)return null;var I,S=function(){var e,t=(e=function(e){var t;return k8(this,(function(n){switch(n.label){case 0:if(!(0,Z7.yU)())return[3,1];(0,L7.Z)({analyticsSource:{page:M.ZY5.GUILD_DISCOVERY},analyticsLocation:{page:M.ZY5.GUILD_DISCOVERY,section:M.jXE.GUILD_CAP_UPSELL_MODAL},analyticsLocations:b});return[3,3];case 1:t=g.findIndex((function(t){return t.id===e}));return[4,l(e,t,a,p)];case 2:n.sent();n.label=3;case 3:return[2]}}))},function(){
var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){U8(i,r,o,a,s,"next",e)}function s(e){U8(i,r,o,a,s,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}();if(v||null==g){for(var T=[],N=0;N<m;N++)T.push((0,r.jsx)(M8.Placeholder,{},N));I=T}else I=g.slice(0,m).map((function(e){return(0,r.jsx)(M8,{className:L8().guildCard,guild:e,onView:S,theme:s,onGuildCardSeen:f,onTagClick:h},e.id)}));return(0,r.jsx)("section",{className:L8().guildListSection,children:(0,r.jsxs)(c.y5t,{component:(0,r.jsx)(c.X6q,{className:L8().title,variant:"heading-lg/semibold",children:t}),children:[null!=n&&(0,r.jsx)(c.xvT,{className:L8().subtitle,variant:"text-sm/normal",color:"header-secondary",children:n}),(0,r.jsx)("div",{className:L8().guildList,children:I})]})})};function V8(e){V8=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return V8(e)}function F8(e,t){
return!t||"object"!==z8(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Y8(e,t){Y8=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Y8(e,t)}var z8=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function W8(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=V8(e);if(t){var o=V8(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return F8(this,n)}}var K8=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{
value:e,writable:!0,configurable:!0}});t&&Y8(e,t)}(n,e);var t=W8(n);function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var r;(r=t.call(this,e)).handlePageChange=function(e){var t=r.props.onPageChange;r.setState({currentPage:e});null!=t&&t(e)};var o=(0,K.s1)().location.search,i=(null!=o&&o.length>0&&o.startsWith("?")?vl.parse(o):{}).offset,a=null!=i?Math.floor(parseInt(i,10)/e.pageSize)+1:1;r.state={currentPage:a};return r}var o=n.prototype;o.componentDidUpdate=function(e){var t=this.props.resetCurrentPage;!e.resetCurrentPage&&t&&this.setState({currentPage:1})};o.render=function(){var e=this.props,t=e.totalCount,n=e.pageSize,o=e.maxVisiblePages,i=e.children,a=this.state.currentPage;return i({controller:(0,r.jsx)(c.DsT,{totalCount:t,pageSize:n,currentPage:a,maxVisiblePages:o,onPageChange:this.handlePageChange})})};return n}(o.PureComponent);const q8=K8
;var X8=n(638057),Q8=n(340974),$8=n(282898),J8=n(594697),e9=n(325971),t9=n.n(e9);function n9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function r9(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function o9(e){o9=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return o9(e)}function i9(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function a9(e,t){return!t||"object"!==l9(t)&&"function"!=typeof t?function(e){
if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s9(e,t){s9=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return s9(e,t)}function c9(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return n9(e,t)}(e,t)||function(){
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var l9=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function u9(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=o9(e);if(t){var o=o9(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return a9(this,n)}}var f9=Wa().throttle(i2.c6,1e3,{leading:!1,trailing:!0}),d9=function(e){var t=e.isSelected,n=e.onCategoryChange,o=e.categoryId,i=e.name,a=e.count;return(0,r.jsx)(c.P3F,{onClick:function(){return n(o)},className:lh()(t9().categoryPill,r9({},t9().selected,t)),children:(0,r.jsx)(c.xvT,{
className:t9().categoryLabel,variant:"text-sm/normal",children:null!=a?"".concat(i," (").concat(a,")"):i})})},p9=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&s9(e,t)}(n,e);var t=u9(n);function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var r;(r=t.call(this,e))._searchRef=o.createRef();r.canSearch=function(e){return e.trim().length>=2&&!(0,X8.x)(e)};r.doSearch=function(e,t,n,o){var i,a=r.props,s=a.defaultLanguage,c=a.currentCategoryId,l=r.state,u=l.query,f=l.selectedLanguage,d={approximate_member_count:i2.sq};o&&TQ.G7(u,d);r.setState({searchId:(0,M7.P)(),queryHasChanged:!1,isSearching:!0});TQ.bR(u,{categoryId:null==n?c:n,preferredLocale:null!==(i=null==f?void 0:f.code)&&void 0!==i?i:s.code,offset:e,length:t,filters:d})}
;r.handleSearchBlurred=function(e){var t=r.props.onSearchBlur;r.setState({inputFocused:!1});null==t||t()};r.handleSearchKeyPress=function(e){var t=r.state,n=t.query,o=t.queryHasChanged,i=r.props,a=i.loadId,s=i.currentCategoryId,c=s!==J8.Hk?s:null;if(r.canSearch(n)&&o&&e.charCode===M.yXg.ENTER){i2.tI(a,c);r.doSearch(0,12,void 0,!0)}else 0===n.length&&e.charCode===M.yXg.ENTER&&r.setState({isSearching:!1})};r.handleQueryChanged=function(e){r.setState({query:e,queryHasChanged:!0})};r.handleQueryCleared=function(){r.setState({query:"",queryHasChanged:!0,isSearching:!1})};r.handleLanguageChange=function(e){var t=r.props,n=t.mostRecentQuery,o=t.availableLanguages,i=null==o?void 0:o.find((function(t){return t.name===e}));r.setState({selectedLanguage:i},(function(){r.canSearch(n)&&r.doSearch(0,12)}))};r.handleCategoryChange=function(e){var t=r.props.mostRecentQuery;TQ.uY(e);r.canSearch(t)&&r.doSearch(0,12,e)};r.handleFocus=function(){var e=r.props.onSearchFocus;r.setState({inputFocused:!0})
;null==e||e()};r.focusInput=function(){var e;null===(e=r._searchRef.current)||void 0===e||e.focus()};r.state={searchId:(0,M7.P)(),query:e.isSearchPage?e.mostRecentQuery:"",queryHasChanged:!1,isSearching:!1,selectedLanguage:e.defaultLanguage,inputFocused:!1,isHandlingTagSearch:e.isTagSearch||!1};return r}var i=n.prototype;i.componentDidMount=function(){var e=this.props,t=e.loadId,n=e.searchResults,r=e.currentCategoryId,o=this.state,i=o.searchId,a=o.query,s=o.isHandlingTagSearch,c=this.context;null==Q8.ZP.getSearchIndex()&&TQ.Ue();Yl.S.subscribe(M.CkL.GLOBAL_CLIPBOARD_PASTE,this.focusInput);Yl.S.subscribe(M.CkL.TEXTAREA_FOCUS,this.focusInput);if(a.length>0){var l=r!==J8.Hk?r:null;f9({loadId:t,searchId:i,query:a,guildResults:n.guilds,analyticsContext:c,categoryId:l,isTagSearch:s})}};i.componentDidUpdate=function(e,t){
var n=this.props,r=n.loadId,o=n.isFetchingSearch,i=n.searchResults,a=n.currentCategoryId,s=n.mostRecentQuery,c=this.state,l=c.isSearching,u=c.searchId,f=c.query,d=c.isHandlingTagSearch,p=this.context,h=e.isFetchingSearch&&!o,E=a!==J8.Hk?a:null;if((l||d)&&h){f9({loadId:r,searchId:u,query:f,guildResults:i.guilds,analyticsContext:p,categoryId:E,isTagSearch:d});this.setState({isHandlingTagSearch:!1})}!t.isSearching&&l&&i2.tI(r,E,p);e.mostRecentQuery!==s&&this.setState({query:s,searchId:(0,M7.P)(),isHandlingTagSearch:!0})};i.componentWillUnmount=function(){Yl.S.unsubscribe(M.CkL.GLOBAL_CLIPBOARD_PASTE,this.focusInput);Yl.S.unsubscribe(M.CkL.TEXTAREA_FOCUS,this.focusInput)};i.renderSearchOptions=function(){var e=this.props.availableLanguages,t=this.state.selectedLanguage;if(null==e)return null;var n,o=e.map((function(e){var t=e.name;return{label:t,value:t}}));return(0,r.jsx)(c.q4e,{className:t9().languageSelector,options:o,value:null!==(n=null==t?void 0:t.name)&&void 0!==n?n:"",
onChange:this.handleLanguageChange,maxVisibleItems:6})};i.renderCategories=function(){var e=this,t=this.props,n=t.currentCategoryId,o=t.countsByCategory;return(0,r.jsx)("div",{className:t9().categories,children:null==o?void 0:o.map((function(t){var o=c9(t,2),i=o[0],a=o[1];return(0,r.jsx)(d9,{categoryId:i,name:i===J8.Hk?Q.Z.Messages.GUILD_DISCOVERY_ALL_CATEGORY_FILTER:D7.Z.getCategoryName(i),onCategoryChange:e.handleCategoryChange,isSelected:n===i,count:a},i)}))})};i.render=function(){var e=this.state,t=e.query,n=e.inputFocused,o=this.props,i=o.placeholder,a=o.isSearchPage;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:lh()(t9().container,r9({},t9().searchPage,a)),children:[(0,r.jsx)("div",{className:t9().search,children:(0,r.jsx)($8.Z,{ref:this._searchRef,searchTerm:t,className:a?void 0:t9().searchBox,inputClassName:a?void 0:t9().searchBoxInput,closeIconClassName:a?void 0:t9().closeIcon,searchIconClassName:a?void 0:t9().searchIcon,
label:Q.Z.Messages.GUILD_DISCOVERY_SEARCH_LABEL,placeholder:i,onChange:this.handleQueryChanged,onClear:this.handleQueryCleared,onFocus:this.handleFocus,onBlur:this.handleSearchBlurred,onKeyPress:this.handleSearchKeyPress,autoFocus:!a,cta:n&&null!=t&&t.length>1?Q.Z.Messages.GUILD_DISCOVERY_SEARCH_ENTER_CTA:null})}),a?this.renderSearchOptions():null]}),a?this.renderCategories():null]})};return n}(o.PureComponent);p9.contextType=Ie.AnalyticsContext;function h9(e){var t=(0,s.e7)([D7.Z],(function(){return D7.Z.getDiscoveryCategories()}),[],D7.j),n=(0,s.e7)([Q8.ZP],(function(){return Q8.ZP.getTopCategoryCounts(e.mostRecentQuery)}));return(0,r.jsx)(p9,i9(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){r9(e,t,n[t])}))}return e}({},e),{
categories:t,countsByCategory:n}))}var E9=n(993665),y9=n.n(E9);function m9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b9(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function g9(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){b9(i,r,o,a,s,"next",e)}function s(e){b9(i,r,o,a,s,"throw",e)}a(void 0)}))}}function O9(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function v9(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function _9(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return m9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m9(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var I9=function(e,t){var n,r,o,i,a={label:0,
sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{
value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};var S9=function(){return(0,r.jsx)("div",{className:y9().placeholder})};const T9=function(e){var t,i=e.guild,a=e.theme,s=e.onView,l=e.onTagClick,u=i.id,f=i.discoverySplash,d=i.icon,p=i.name,h=i.description,E=i.presenceCount,y=i.memberCount,m=i.keywords,b=_9(o.useState(!1),2),g=b[0],O=b[1],v=_9(o.useState(!1),2),_=v[0],I=v[1],S=(0,Hw.Z)().analyticsLocations,T=Ds.ZP.getGuildDiscoverySplashURL({id:u,splash:f,size:240*(0,l8.x_)()}),N=null!=T?T:function(e){switch(e){case M.BRd.DARK:return h8();case M.BRd.LIGHT:return y8()}}(a),A=null!==(t=Ds.ZP.getGuildIconURL({id:u,icon:d,size:32}))&&void 0!==t?t:void 0,C=function(){var e=g9((function(e){return I9(this,(function(t){switch(t.label){case 0:if(e.target.className.includes("Menu"))return[2];if((0,Z7.yU)()){(0,L7.Z)({analyticsSource:{page:M.ZY5.GUILD_DISCOVERY},analyticsLocation:{page:M.ZY5.GUILD_DISCOVERY,section:M.jXE.GUILD_CAP_UPSELL_MODAL},analyticsLocations:S});return[2]}I(!0);t.label=1;case 1:
t.trys.push([1,,4,5]);return null!=s?[4,s(i.id)]:[3,3];case 2:t.sent();t.label=3;case 3:return[3,5];case 4:I(!1);return[7];case 5:return[2]}}))}));return function(t){return e.apply(this,arguments)}}();o.useEffect((function(){return x7.trackExposure({})}));var P,j=x7.useExperiment({}).shouldDisplayTags,R=(0,$7.I)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:y9().card,children:[_?(0,r.jsx)(c.$jN,{type:c.$jN.Type.PULSING_ELLIPSIS,className:y9().spinner}):null,(0,r.jsxs)(c.P3F,{className:lh()(y9().container,(P={},O9(P,y9().hover,g),O9(P,y9().submitting,_),P)),onClick:C,onContextMenu:function(e){(0,Ob.jW)(e,g9((function(){var e,t;return I9(this,(function(o){switch(o.label){case 0:return[4,Promise.resolve().then(n.bind(n,473444))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,v9(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){O9(e,t,n[t])}))}return e}({},e),{guild:i}))}]}}))})))},onMouseEnter:function(){return O(!0)},onMouseLeave:function(){return O(!1)},children:[(0,r.jsx)("div",{className:lh()(y9().splashContainer,O9({},y9().splashContainerWithTags,j)),children:(0,r.jsx)("img",{src:N,alt:"",className:y9().splashImage,width:240})}),(0,r.jsxs)("div",{className:lh()(y9().content,O9({},y9().contentWithTags,j)),children:[(0,r.jsxs)("div",{className:y9().header,children:[(0,r.jsx)(u8.ZP,{mask:u8.ZP.Masks.SQUIRCLE,width:32,height:32,children:(0,r.jsx)("img",{src:A,alt:"",className:y9().avatar})}),(0,r.jsxs)("div",{className:y9().headerName,children:[(0,r.jsx)("div",{children:(0,r.jsx)(eg.Z,{guild:i,className:y9().guildBadge,size:16})}),(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",className:y9().headerTitle,children:p
})]})]}),(0,r.jsx)(c.xvT,{className:y9().description,variant:"text-sm/normal",children:h}),j&&m&&l&&(0,r.jsx)(Q7,{guildId:i.id,discoveryTagStyle:X7.ALT,onTagClick:function(e){return l(e,i.id)},tags:m,section:i2.P1.SEARCH}),(0,r.jsxs)("div",{className:y9().memberInfo,children:[null!=E&&(0,r.jsx)("div",{className:y9().memberCount,children:(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"header-secondary",children:Q.Z.Messages.INSTANT_INVITE_GUILD_MEMBERS_ONLINE.format({membersOnline:E})})}),null!=y&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:y9().dotSeparator}),(0,r.jsx)("div",{className:y9().memberCount,children:(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"header-secondary",children:Q.Z.Messages.INSTANT_INVITE_GUILD_MEMBERS_TOTAL.format({count:y})})})]})]})]}),R?(0,r.jsx)("div",{className:y9().actionButtons,children:(0,r.jsx)(c8,{guild:i})}):null]})]}),(0,r.jsx)("hr",{className:y9().separator})]})};var N9=n(968370),A9=n.n(N9);function C9(e){
if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P9(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function j9(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){P9(i,r,o,a,s,"next",e)}function s(e){P9(i,r,o,a,s,"throw",e)}a(void 0)}))}}function R9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x9(e){x9=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return x9(e)}function M9(e,t){return!t||"object"!==D9(t)&&"function"!=typeof t?C9(e):t}function w9(e,t){w9=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return w9(e,t)}var D9=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Z9(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=x9(e);if(t){var o=x9(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return M9(this,n)}}var L9=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0]
;continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},U9=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&w9(e,t)}(n,e);var t=Z9(n);function n(){R9(this,n);var e,o=C9(e=t.apply(this,arguments));e.handleViewGuild=function(){var e=j9((function(e){var t,n,r,i,a;return L9(this,(function(s){switch(s.label){case 0:t=o.props,n=t.guilds,r=t.analyticsContext,i=t.onViewGuild;a=n.findIndex((function(t){
return t.id===e}));return[4,i(e,a,r)];case 1:s.sent();return[2]}}))}));return function(t){return e.apply(this,arguments)}}();e.renderGuild=function(t,n){var o=e.props,i=o.theme,a=o.onTagClick;return(0,r.jsx)(T9,{guild:t,theme:i,onView:e.handleViewGuild,onTagClick:a},n)};return e}var o=n.prototype;o.renderPlaceholders=function(){for(var e=this.props.loadingPlaceholderCount,t=[],n=0;n<e;n++)t.push((0,r.jsx)(S9,{},n));return t};o.render=function(){var e=this,t=this.props,n=t.guilds,o=t.loading;return(0,r.jsx)(mm.Spring,{from:{opacity:o?0:1},to:{opacity:1},delay:100,children:function(t){return(0,r.jsx)(mm.animated.div,{className:A9().guildList,style:t,children:o||null==n?e.renderPlaceholders():n.map(e.renderGuild)})}})};return n}(o.PureComponent);U9.defaultProps={loadingPlaceholderCount:12};const k9=U9;var G9=n(171659),B9=n.n(G9);function H9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function V9(e,t){return function(e){
if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return H9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H9(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var F9=12,Y9=function(){var e=(0,K.s1)().location.search;return null!=e&&e.length>0&&e.startsWith("?")?vl.parse(e):{}},z9=function(e){
var t=e.categoryId,n=e.categoryName,o=e.onClick,i=t===J8.Hk,a=i?Q.Z.Messages.GUILD_DISCOVERY_SEARCH_EMPTY_HEADER:Q.Z.Messages.GUILD_DISCOVERY_SEARCH_EMPTY_CATEGORY_HEADER.format({categoryName:n}),s=i?Q.Z.Messages.GUILD_DISCOVERY_SEARCH_EMPTY_BODY:Q.Z.Messages.GUILD_DISCOVERY_SEARCH_EMPTY_CATEGORY_BODY.format({onClick:o});return(0,r.jsxs)("div",{className:B9().emptyContainer,children:[(0,r.jsx)("div",{className:B9().emptyImage}),(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:B9().emptyHeader,children:a}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"header-secondary",children:s})]})},W9=function(){return(0,r.jsxs)("div",{className:B9().emptyContainer,children:[(0,r.jsx)("div",{className:B9().errorImage}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"header-secondary",className:B9().emptyHeader,children:Q.Z.Messages.GUILD_DISCOVERY_SEARCH_ERROR})]})};const K9=function(e){
var t=e.loadId,n=e.searchResults,i=e.mostRecentQuery,a=e.defaultLanguage,l=e.availableLanguages,u=e.isFetchingSearch,f=e.scroller,d=e.loadingGuildId,p=e.theme,h=e.currentCategoryId,E=e.currentCategoryName,y=e.onViewGuild,m=e.onGuildCardSeen,b=e.placeholder,g=e.onTagClick,O=Wa().uniqueId("GuildDiscovery"),v=n.guilds,_=n.loading,I=n.total,S=V9(o.useState(!1),2),T=S[0],N=S[1],A=Y9().tag,C=V9(o.useState(A),2),P=C[0],j=C[1],R=(0,s.e7)([Q8.ZP],(function(){return Q8.ZP.hasSearchError()})),x=function(e,t,n){TQ.bR(i,{categoryId:n?J8.Hk:h,preferredLocale:a.code,offset:e,length:t,filters:{approximate_member_count:i2.sq}});N(!1)};o.useEffect((function(){var e=Y9(),t=e.offset,n=e.tag,r=null!=t?Math.floor(parseInt(t,10)/F9)+1:1;j(!!n);1===r&&N(!0)}),[i]);var M=h===J8.Hk?Q.Z.Messages.GUILD_DISCOVERY_SEARCH_RESULTS_HEADER.format({count:null!=I?I.toLocaleString():"0",query:i}):Q.Z.Messages.GUILD_DISCOVERY_SEARCH_RESULTS_CATEGORY_HEADER.format({count:null!=I?I.toLocaleString():"0",query:i,category:E})
;return(0,r.jsxs)("div",{className:B9().container,children:[(0,r.jsxs)("div",{className:B9().searchHeader,children:[(0,r.jsx)(c.P3F,{onClick:function(){TQ.AQ();i2.IZ(t)},className:B9().arrow,"aria-label":Q.Z.Messages.BACK,children:(0,r.jsx)(AM.Z,{direction:AM.Z.Directions.LEFT})}),(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:B9().header,children:M})]}),(0,r.jsx)(h9,{loadId:t,searchResults:n,mostRecentQuery:i,isFetchingSearch:u,defaultLanguage:a,placeholder:b,availableLanguages:l,isSearchPage:!0,currentCategoryId:h,isTagSearch:P}),R?(0,r.jsx)(W9,{}):I<=0?(0,r.jsx)(z9,{categoryId:h,categoryName:E,onClick:function(){TQ.uY(J8.Hk);x(0,F9,!0)}}):(0,r.jsx)("div",{className:B9().results,children:(0,r.jsx)(q8,{pageSize:F9,totalCount:I,resetCurrentPage:T,onPageChange:function(e){x((e-1)*F9,F9);null==f||f.scrollTo({to:0})},children:function(e){var t=e.controller;return(0,r.jsxs)("section",{"aria-labelledby":O,children:[(0,r.jsx)(k9,{guilds:v,loading:_,loadingPlaceholderCount:F9,
onViewGuild:y,loadingGuildId:d,theme:p,analyticsContext:i2.P1.SEARCH,onGuildCardSeen:m,onTagClick:g}),t]})}})})]})};var q9=n(116433);function X9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Q9(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return X9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X9(e,t)}(e,t)||function(){
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var $9=n(928130),J9=n.n($9);function eee(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function tee(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){eee(i,r,o,a,s,"next",e)}function s(e){eee(i,r,o,a,s,"throw",e)}a(void 0)}))}}function nee(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var ree=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,
r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};const oee=function(e){var t=e.hasHub;return(0,r.jsxs)("div",{className:J9().container,children:[(0,r.jsx)("div",{className:J9().iconContainer,children:(0,r.jsx)("div",{className:J9().icon})}),(0,r.jsx)(c.xvT,{color:"header-primary",variant:"text-lg/semibold",className:J9().header,
children:t?Q.Z.Messages.HUB_EMAIL_CONNECTION_ADD_HEADER:Q.Z.Messages.HUB_EMAIL_CONNECTION_JOIN_HEADER}),(0,r.jsx)(c.xvT,{color:"header-secondary",variant:"text-sm/normal",className:J9().description,children:t?Q.Z.Messages.HUB_EMAIL_CONNECTION_ADD_DESCRIPTION:Q.Z.Messages.HUB_EMAIL_CONNECTION_JOIN_CARD_DESCRIPTION}),(0,r.jsx)("div",{className:J9().gap}),(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.LARGE,color:t?c.zxk.Colors.PRIMARY:c.zxk.Colors.GREEN,onClick:function(){return(0,c.ZDy)(tee((function(){var e,t;return ree(this,(function(o){switch(o.label){case 0:return[4,Promise.resolve().then(n.bind(n,966658))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){nee(e,t,n[t])}))}
return e}({},e))}]}}))})))},children:(0,r.jsx)(c.xvT,{variant:"text-sm/semibold",className:J9().addButton,color:"none",children:t?Q.Z.Messages.HUB_EMAIL_CONNECTION_JOIN_ANOTHER:Q.Z.Messages.HUB_EMAIL_CONNECTION_JOIN_MY_SCHOOOL})})]})};var iee=n(185874),aee=n.n(iee);function see(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function cee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){see(e,t,n[t])}))}return e}function lee(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){
return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}const uee=function(e){var t=e.guilds,n=(0,s.e7)([st.Z],(function(){return st.Z.theme})),o=t.map((function(e){return(0,r.jsx)(M8,{className:aee().guildCard,onView:function(){return f.Z.transitionToGuildSync(e.id)},guild:lee(cee({},e),{presenceCount:void 0,memberCount:void 0,premiumSubscriptionCount:void 0,emojis:void 0}),theme:n},e.id)}));return(0,r.jsx)("section",{className:aee().guildListSection,children:t.length>0?(0,r.jsxs)("div",{children:[(0,r.jsx)(c.X6q,{className:aee().title,variant:"heading-lg/semibold",children:Q.Z.Messages.YOUR_HUB}),(0,r.jsxs)("div",{className:aee().guildList,children:[o,(0,r.jsx)(oee,{hasHub:!0})]})]}):(0,r.jsx)("div",{className:aee().guildList,children:(0,r.jsx)(oee,{hasHub:!1})})})};var fee=n(610982),dee=n.n(fee),pee=n(237018),hee=n.n(pee);const Eee=function(e){
var t=e.loadId,n=(0,s.e7)([Zt.Z],(function(){var e=Zt.Z.getGuilds();return Object.entries(e).filter((function(e){var t=Q9(e,2);t[0];return t[1].hasFeature(M.oNc.HUB)})).map((function(e){var t=Q9(e,2);t[0];return t[1]}))}));o.useEffect((function(){(0,i2.Zt)({loadId:t,gamesYouPlayGuilds:[],allGuilds:[],categoryId:J8.U})}),[t]);(0,Am.Tt)({subsection:Q.Z.Messages.HUB_SCHOOL_HUBS,location:Q.Z.Messages.HUB_DIRECTORY_SEARCH_TITLE});return(0,r.jsx)(c.Ttm,{className:dee().scroller,children:(0,r.jsxs)("div",{className:dee().viewWrapper,children:[(0,r.jsxs)("div",{className:dee().headerContainer,children:[(0,r.jsx)("img",{alt:"",className:dee().headerImage,src:hee()}),(0,r.jsxs)("div",{className:dee().headerContent,children:[(0,r.jsx)(c.X6q,{className:dee().headerText,variant:"heading-xl/semibold",children:Q.Z.Messages.HUB_DIRECTORY_SEARCH_TITLE}),(0,r.jsx)(c.xvT,{className:dee().headerDescription,variant:"text-md/normal",color:"none",children:Q.Z.Messages.HUB_DIRECTORY_SEARCH_SUBTITLE})]})]
}),(0,r.jsx)(uee,{guilds:n}),(0,r.jsx)("div",{className:dee().divider}),(0,r.jsx)(c.xvT,{className:dee().footerDescription,variant:"text-md/medium",color:"header-secondary",children:Q.Z.Messages.HUB_DISCOVERY_FOOTER_DESCRIPTION})]})})};var yee=n(575136),mee=n(80210),bee=n.n(mee),gee=n(236481),Oee=n.n(gee);function vee(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _ee(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Iee(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){_ee(i,r,o,a,s,"next",e)}function s(e){_ee(i,r,o,a,s,"throw",e)}a(void 0)}))}}function See(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tee(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Nee(e){
Nee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Nee(e)}function Aee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Tee(e,t,n[t])}))}return e}function Cee(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Pee(e,t){return!t||"object"!==Ree(t)&&"function"!=typeof t?vee(e):t}
function jee(e,t){jee=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return jee(e,t)}var Ree=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function xee(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Nee(e);if(t){var o=Nee(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Pee(this,n)}}var Mee=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,
r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},wee=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&jee(e,t)}(n,e);var t=xee(n);function n(){See(this,n)
;var e;(e=t.apply(this,arguments))._scroller=o.createRef();e._guildIdsSeen=new Set;e.loadId=(0,M7.P)();e.state={animatedValue:new ji.Z.Value(0),loadingGuildId:null};e.scrollToTop=function(){null!=e._scroller.current&&e._scroller.current.scrollTo({to:0})};e.handleScroll=function(){var t,n,r=e.state.animatedValue,o=null!==(n=null===(t=e._scroller.current)||void 0===t?void 0:t.getScrollerState().scrollTop)&&void 0!==n?n:0;r.setValue(Math.min(1,o/200))};var r=vee(e);e.handleViewGuild=function(){var e=Iee((function(e,t,n,o){var i,a,s,c,l,u,f;return Mee(this,(function(d){switch(d.label){case 0:a=r.props.currentCategoryId;s=r.state.loadingGuildId;if(e===s)return[2];l=null!==(c=null===(i=r._scroller.current)||void 0===i?void 0:i.getScrollerState().scrollTop)&&void 0!==c?c:0;u=(0,K.s1)().location;(0,K.dL)(Cee(Aee({},u),{state:l}));r.setState({loadingGuildId:e});f=a!==J8.Hk?a:null;d.label=1;case 1:d.trys.push([1,3,,4]);return[4,i2.Lq({loadId:null!=o?o:r.loadId,guildId:e,index:t,
analyticsContext:n,categoryId:f})];case 2:d.sent();return[3,4];case 3:d.sent();r.setState({loadingGuildId:null});return[3,4];case 4:return[2]}}))}));return function(t,n,r,o){return e.apply(this,arguments)}}();e.handleGuildCardSeen=function(t){e._guildIdsSeen.add(t)};e.handleTagSearch=function(t,n,r){var o=e.props,i=o.currentCategoryId,a=o.defaultLanguage;if(null!=i){var s={approximate_member_count:i2.sq};(0,TQ.G7)(t,s);(0,TQ.bR)(t,{filters:s,categoryId:i,preferredLocale:a.code,offset:0,length:F9,tag:!0});i2.j$(e.loadId,i,r,n);e.scrollToTop()}};return e}var i=n.prototype;i.componentDidMount=function(){var e,t=this.props,n=t.isFetching,r=t.guilds,o=r.gamesYouPlay,i=r.featured,a=t.searchRoute,s=t.currentHomepageCategoryId,c=t.mostRecentQuery;(0,M4.N)();(0,w7.le)();null==Q8.ZP.getSearchIndex()&&(0,TQ.Ue)();O.Z.wait((function(){e=M.x8Z.SERVER_DISCOVERY_BADGE,O.Z.dispatch({type:"VIEW_HISTORY_MARK_VIEW",key:e});var e}));n||0!==c.length||i2.Zt({loadId:this.loadId,gamesYouPlayGuilds:o.guilds,
allGuilds:i.guilds,categoryId:s});if(null!=a){var l=vl.parse(a),u=l.query,f=l.offset,d=l.limit,p=l.preferredLocale,h=l.categoryId;(0,TQ.bR)(u,{categoryId:parseInt(h,10),preferredLocale:p,offset:parseInt(f,10),filters:{approximate_member_count:i2.sq},length:parseInt(d,10)})}else null!=s&&s!==J8.Hk&&O.Z.wait((function(){return(0,TQ.uY)(s)}));var E,y=null!==(E=null===(e=(0,K.s1)().location.state)||void 0===e?void 0:e.scrollTop)&&void 0!==E?E:0;if(y>0){var m;null===(m=this._scroller.current)||void 0===m||m.scrollTo({to:y})}(0,uV.e)("guild_discovery")};i.componentDidUpdate=function(e){var t=this.props,n=t.guilds,r=n.gamesYouPlay,o=n.featured,i=t.isFetching,a=t.mostRecentQuery,s=t.currentHomepageCategoryId,c=t.currentCategoryId;e.isFetching&&!i&&i2.Zt({loadId:this.loadId,gamesYouPlayGuilds:r.guilds,allGuilds:o.guilds,categoryId:s});if(e.currentCategoryId!==c){var l;null===(l=this._scroller.current)||void 0===l||l.scrollTo({to:0})}
e.currentCategoryId!==c&&i2.Az(this.loadId,Array.from(this._guildIdsSeen));e.mostRecentQuery.length>0&&a.length<1&&s!==c&&(0,TQ.uY)(s)};i.componentWillUnmount=function(){var e=this.props,t=e.currentCategoryId,n=e.recommendationsLoadId,r=e.recommendationsGuilds;t===J8.Hk?null!=r&&null!=n&&i2.Az(n,this.getOrderedGuildIdsSeen(r.map((function(e){return e.id}))),"Game Recommendations"):i2.Az(this.loadId,Array.from(this._guildIdsSeen))};i.getOrderedGuildIdsSeen=function(e){var t=this;return e.filter((function(e){return t._guildIdsSeen.has(e)}))};i.renderGamesYouPlay=function(){var e=this.props,t=e.guilds,n=e.mightHaveGamesYouPlay,o=e.theme,i=e.userGuilds,a=Object.keys(i),s=t[M.Lcj.GAMES_YOU_PLAY];s.guilds=s.guilds.filter((function(e){return!a.includes(e.id)}));var c=this.state.loadingGuildId;return n?(0,r.jsx)(H8,{loadId:this.loadId,title:Q.Z.Messages.GUILD_DISCOVERY_HEADER_GAMES_YOU_PLAY,guildsData:s,loadingGuildId:c,analyticsContext:i2.P1.RECOMMENDED,onViewGuild:this.handleViewGuild,
onGuildCardSeen:this.handleGuildCardSeen,fetchGuilds:TQ.gk,theme:o}):null};i.renderSearchBar=function(){var e,t=this.props,n=t.mostRecentQuery,o=t.guilds.search,i=t.defaultLanguage,a=t.isFetchingSearch,s=t.currentCategoryId,c=t.categories,l=t.currentCategoryName;x7.trackExposure({});var u,f=x7.getCurrentConfig({}).shouldDisplayRecommendedSearchTags?s===J8.Hk?Q.Z.Messages.GUILD_DISCOVERY_SEARCH_PLACEHOLDER_TAGS:Q.Z.Messages.GUILD_DISCOVERY_CATEGORY_SEARCH_PLACEHOLDER_TAGS.format({categoryName:l}):s===J8.Hk?Q.Z.Messages.GUILD_DISCOVERY_SEARCH_PLACEHOLDER:Q.Z.Messages.GUILD_DISCOVERY_CATEGORY_SEARCH_PLACEHOLDER.format({categoryName:l}),d=null!==(u=null===(e=o[n])||void 0===e?void 0:e[s])&&void 0!==u?u:Q8.xk;return(0,r.jsx)(h9,{loadId:this.loadId,searchResults:d,mostRecentQuery:n,isFetchingSearch:a,defaultLanguage:i,placeholder:f,currentCategoryId:s,categories:c})};i.renderSearchResults=function(){
var e,t,n=this,o=this.props,i=o.mostRecentQuery,a=o.guilds.search,s=o.availableLanguages,c=o.defaultLanguage,l=o.isFetchingSearch,u=o.theme,f=o.currentCategoryId,d=o.currentCategoryName,p=this.state.loadingGuildId,h=f===J8.Hk?Q.Z.Messages.GUILD_DISCOVERY_SEARCH_PLACEHOLDER:Q.Z.Messages.GUILD_DISCOVERY_CATEGORY_SEARCH_PLACEHOLDER.format({categoryName:d}),E=null!==(t=null===(e=a[i])||void 0===e?void 0:e[f])&&void 0!==t?t:Q8.xk;return(0,r.jsx)(K9,{loadId:this.loadId,availableLanguages:s,defaultLanguage:c,placeholder:h,isFetchingSearch:l,searchResults:E,mostRecentQuery:i,loadingGuildId:p,currentCategoryId:f,currentCategoryName:d,scroller:this._scroller.current,theme:u,onViewGuild:this.handleViewGuild,onGuildCardSeen:this.handleGuildCardSeen,onTagClick:function(e,t){return n.handleTagSearch(e,t,i2.P1.SEARCH)}})};i.renderRecommendedGuildsSection=function(){var e=this,t=this.props,n=t.guilds,o=t.theme,i=this.state.loadingGuildId;return(0,r.jsx)(H8,{loadId:this.loadId,
title:Q.Z.Messages.GUILD_DISCOVERY_FEATURED_HEADER,guildsData:n.featured,analyticsContext:i2.P1.POPULAR,onViewGuild:this.handleViewGuild,onGuildCardSeen:this.handleGuildCardSeen,fetchGuilds:function(){return(0,TQ.$z)(0,30)},loadingGuildId:i,theme:o,onTagClick:function(t,n){return e.handleTagSearch(t,n,i2.P1.POPULAR)}})};i.renderPopularGuildsSection=function(){var e=this,t=this.props,n=t.guilds,o=t.theme,i=t.currentCategoryId,a=this.state.loadingGuildId;return(0,r.jsx)(H8,{loadId:this.loadId,title:Q.Z.Messages.GUILD_DISCOVERY_POPULAR_HEADER,guildsData:n[i],loadingGuildId:a,analyticsContext:i2.P1.POPULAR,onViewGuild:this.handleViewGuild,onGuildCardSeen:this.handleGuildCardSeen,fetchGuilds:function(){return(0,TQ.K5)(i)},currentCategoryId:i,theme:o,onTagClick:function(t,n){return e.handleTagSearch(t,n,i2.P1.POPULAR)}})};i.render=function(){var e,t,n=this,i=this.props,a=i.currentCategoryName,s=i.mostRecentQuery,l=i.currentCategoryId,u=i.guilds,f=s.length>0;x7.trackExposure({})
;var d=x7.getCurrentConfig({}).shouldDisplayRecommendedSearchTags,p=l===J8.Hk?null===(e=u[M.Lcj.FEATURED])||void 0===e?void 0:e.guilds:null===(t=u[l])||void 0===t?void 0:t.guilds;if(l===J8.U)return(0,r.jsx)(Eee,{loadId:this.loadId});var h=l===J8.Hk?Q.Z.Messages.GUILD_DISCOVERY_HOME_TITLE:Q.Z.Messages.GUILD_DISCOVERY_CATEGORY_TITLE.format({categoryName:a});return(0,r.jsxs)("div",{className:A9().pageWrapper,children:[(0,r.jsx)(Am.yY,{subsection:f?s:void 0,location:h}),(0,r.jsx)("div",{className:lh()(A9().dragRegion,A9().pageHeaderDrag,Tee({},A9().searchPageDrag,f))}),no.tq&&(0,r.jsx)(kb.ZP,{children:(0,r.jsx)(o.Fragment,{})}),(0,r.jsx)(c.yWw,{className:A9().scroller,ref:this._scroller,onScroll:this.handleScroll,children:(0,r.jsx)("div",{className:lh()(A9().viewWrapper,Tee({},A9().searchPage,f)),children:f?this.renderSearchResults():(0,r.jsxs)(c.y5t,{forceLevel:1,component:(0,r.jsxs)("div",{className:A9().searchHeader,children:[(0,r.jsx)("img",{alt:"",className:A9().headerImage,src:Oee()
}),(0,r.jsx)("div",{className:A9().headerContentWrapper,children:(0,r.jsxs)("div",{className:A9().headerContent,children:[(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:A9().searchTitle,children:l===J8.Hk?Q.Z.Messages.GUILD_DISCOVERY_HOME_TITLE:Q.Z.Messages.GUILD_DISCOVERY_CATEGORY_TITLE.format({categoryName:a})}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",className:A9().searchSubtitle,children:l===J8.Hk&&Q.Z.Messages.GUILD_DISCOVERY_HOME_SUBTITLE}),this.renderSearchBar(),d&&(0,r.jsx)(Q7,{hideOverflow:!0,section:i2.P1.HEADER,className:A9().headerTagContainer,discoveryTagStyle:X7.LIGHT,onTagClick:function(e){return n.handleTagSearch(e,void 0,i2.P1.HEADER)},tags:Wa().chain(p).flatMap((function(e){return e.keywords})).compact().uniq().sampleSize(10).value()})]})})]}),children:[(0,r.jsx)("div",{className:A9().featuredBody,children:l===J8.Hk?this.renderRecommendedGuildsSection():this.renderPopularGuildsSection()}),(0,r.jsxs)("div",{className:A9().footer,children:[(0,r.jsx)("img",{
alt:"",src:bee(),className:A9().footerImage}),(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:Q.Z.Messages.GUILD_DISCOVERY_CATEGORY_FOOTER_TITLE}),(0,r.jsx)(c.zxk,{look:c.zxk.Looks.LINK,color:c.zxk.Colors.LINK,size:c.zxk.Sizes.MIN,onClick:this.scrollToTop,children:Q.Z.Messages.GUILD_DISCOVERY_FOOTER_BODY})]})]})})})]})};return n}(o.PureComponent),Dee=s.ZP.connectStores([st.Z,tl.default,yee.Z,mW.Z,Q8.ZP,D7.Z,Zt.Z],(function(){var e,t=J8.dU,n=tl.default.locale,r=null!==(e=Wa().find(t,{code:n}))&&void 0!==e?e:t[0],o=yee.Z.applicationStatistics,i=Object.keys(o),a=mW.Z.hasConsented(M.pjP.PERSONALIZATION)&&i.length>0,s=Q8.ZP.getCurrentCategoryId(),c=Q8.ZP.getCurrentHomepageCategoryId();return{isFetching:Q8.ZP.isFetching(),isFetchingSearch:Q8.ZP.isFetchingSearch(),guilds:Q8.ZP.getDiscoverableGuilds(),mostRecentQuery:Q8.ZP.getMostRecentQuery(),currentCategoryId:s,currentHomepageCategoryId:c,currentCategoryName:D7.Z.getCategoryName(s),categories:D7.Z.getDiscoveryCategories(),
userGuilds:Zt.Z.getGuilds(),theme:st.Z.theme,mightHaveGamesYouPlay:a,availableLanguages:t,defaultLanguage:r}}))(wee);function Zee(e){var t=(0,s.cj)([q9.Z],(function(){return{recommendedGuilds:q9.Z.getRecommendedGuilds(),loadId:q9.Z.getLoadId(),fetching:q9.Z.isFetching()}})),n=t.fetching,o=t.loadId,i=t.recommendedGuilds;return(0,r.jsx)(Dee,Cee(Aee({},e),{fetchingRecommendations:n,usingGameRecommendations:!1,recommendationsGuilds:i,recommendationsLoadId:o}))}var Lee=n(794547);function Uee(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function kee(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Gee(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function Bee(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.className,l=e.foreground,u=Gee(e,["width","height","color","className","foreground"]);return(0,r.jsx)("svg",kee(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){
Uee(e,t,n[t])}))}return e}({},(0,OO.Z)(u)),{className:c,width:n,height:i,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{className:l,fill:s,fillRule:"evenodd",clipRule:"evenodd",
d:"M22.447 8.11002L12.447 3.11002C12.166 2.96902 11.834 2.96902 11.552 3.11002L1.552 8.11002C1.35 8.21002 1.197 8.38402 1.107 8.57302C1.046 8.69502 1 8.90202 1 9.00502V14.77C1 15.322 1.448 15.77 2 15.77C2.552 15.77 3 15.322 3 14.77V10.172L12.015 13.927L22.372 9.93302C22.737 9.78602 22.983 9.44002 22.999 9.04602C23.016 8.65202 22.799 8.28702 22.447 8.11002ZM12 16.005C11.869 16.005 11.738 15.979 11.615 15.928L5 13.172V16.185C5 16.564 5.214 16.91 5.553 17.08C5.7173 17.1621 5.88209 17.2461 6.04836 17.3308C7.61773 18.1306 9.31996 18.998 12 18.998C14.6812 18.998 16.3872 18.1284 17.956 17.3287C18.1208 17.2447 18.2842 17.1614 18.447 17.08C18.786 16.911 19 16.564 19 16.186V13.385L12.359 15.939C12.243 15.982 12.122 16.005 12 16.005ZM1 18.005C1 17.453 1.448 17.005 2 17.005C2.552 17.005 3 17.453 3 18.005V20.005C3 20.557 2.552 21.005 2 21.005C1.448 21.005 1 20.557 1 20.005V18.005Z"})}))}function Hee(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n
;return e}function Vee(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Fee(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function Yee(e){
var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.className,l=e.foreground,u=Fee(e,["width","height","color","className","foreground"]);return(0,r.jsx)("svg",Vee(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Hee(e,t,n[t])}))}return e}({},(0,OO.Z)(u)),{className:c,width:n,height:i,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{className:l,fill:s,
d:"M19.396 3.29898C19.016 3.01598 18.524 2.93098 18.07 3.06498L8.07 6.06498C7.435 6.25498 7 6.83998 7 7.50298V15.054C6.835 15.03 6.671 15.003 6.5 15.003C4.566 15.003 3 16.571 3 18.503C3 20.434 4.566 22.003 6.5 22.003C8.434 22.003 10 20.434 10 18.503V8.61798L17 6.51798V13.054C16.835 13.03 16.671 13.003 16.5 13.003C14.566 13.003 13 14.571 13 16.503C13 18.434 14.566 20.003 16.5 20.003C18.434 20.003 20 18.434 20 16.503V4.50298C20 4.02698 19.775 3.58198 19.396 3.29898Z"})}))}function zee(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Wee(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Kee(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function qee(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.className,l=e.foreground,u=Kee(e,["width","height","color","className","foreground"]);return(0,r.jsx)("svg",Wee(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){
zee(e,t,n[t])}))}return e}({},(0,OO.Z)(u)),{className:c,width:n,height:i,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{className:l,fill:s,fillRule:"evenodd",clipRule:"evenodd",
d:"M18.6683 11.9964C19.5992 13.2208 20.3732 14.4331 20.9422 15.5701C22.5858 18.8593 22.0118 20.4688 21.2418 21.2398C20.895 21.5846 20.2596 21.9978 19.1951 21.9978C17.3645 21.9978 14.7478 20.7553 12.0004 18.6683C9.25198 20.7553 6.63527 21.9978 4.80569 21.9978C3.74111 21.9978 3.10478 21.5846 2.75896 21.2398C1.98792 20.4677 1.41392 18.8593 3.05853 15.5701C3.62751 14.4331 4.40257 13.2218 5.33245 11.9964C2.51569 8.28291 1.00176 4.51719 2.75896 2.75898C3.10578 2.41316 3.74111 2 4.80569 2C6.63628 2 9.25298 3.24251 12.0004 5.32944C14.7488 3.24251 17.3655 2 19.1951 2C20.2596 2 20.895 2.41216 21.2418 2.75898C22.999 4.51618 21.4851 8.28191 18.6683 11.9964ZM19.8203 4.18042C19.6806 4.03969 19.4032 4.01053 19.1951 4.01053C18.0481 4.01053 15.9933 4.9203 13.6209 6.64835C15.0262 7.86472 16.2346 9.08512 17.3655 10.395C19.752 7.13188 20.3541 4.71422 19.8203 4.18042ZM14.1325 14.1316C14.8654 13.3987 15.5108 12.689 16.0928 12.0024C15.4876 11.2856 14.8342 10.5689 14.1325 9.86621C13.4128 9.14744 12.701 8.51312 12.0004 7.92202C11.2997 8.51312 10.588 9.14744 9.86821 9.86621C9.16653 10.5689 8.51311 11.2856 7.90794 12.0024C8.48999 12.689 9.13637 13.3987 9.86821 14.1316C10.588 14.8513 11.2997 15.4856 12.0004 16.0747C12.701 15.4856 13.4128 14.8513 14.1325 14.1316ZM4.80569 4.01053C4.5986 4.01053 4.32115 4.03969 4.18142 4.18042C3.64661 4.71422 4.24977 7.13088 6.63628 10.394C7.83556 9.00469 9.05696 7.79435 10.3799 6.64735C8.00645 4.9203 5.95269 4.01053 4.80569 4.01053ZM4.18041 19.8183C4.32014 19.9581 4.5976 19.9872 4.80569 19.9872C5.95269 19.9872 8.00746 19.0785 10.3799 17.3514C8.98357 16.1421 7.7873 14.9348 6.6413 13.6078C5.92053 14.593 5.31133 15.56 4.85695 16.4688C3.79539 18.5909 3.9502 19.5881 4.18041 19.8183ZM19.1941 19.9872C19.4021 19.9872 19.6796 19.9581 19.8193 19.8183C20.0495 19.5881 20.2044 18.5919 19.1428 16.4688C18.6884 15.559 18.0792 14.592 17.3584 13.6078C16.2114 14.9358 15.0152 16.1431 13.6199 17.3514C15.9933 19.0785 18.0471 19.9872 19.1941 19.9872ZM14.0109 11.9984C14.0109 13.1088 13.1108 14.0089 12.0004 14.0089C10.89 14.0089 9.98984 13.1088 9.98984 11.9984C9.98984 10.888 10.89 9.98784 12.0004 9.98784C13.1108 9.98784 14.0109 10.888 14.0109 11.9984Z"
})}))}var Xee=n(707073),Qee=n(651034),$ee=n(545289),Jee=n.n($ee),ete=function(e){switch(e){case J8.fW.Activity:return(0,r.jsx)(GK.Z,{});case J8.fW.Discover:return(0,r.jsx)(Lee.Z,{});case J8.fW.Education:return(0,r.jsx)(Bee,{});case J8.fW.Music:return(0,r.jsx)(Yee,{});case J8.fW.Science:return(0,r.jsx)(qee,{});case J8.fW.Stage:return(0,r.jsx)(_k.Z,{height:22,width:22});case J8.fW.Television:return(0,r.jsx)(Xee.Z,{});default:(0,_o.vE)(e)}},tte=function(e){var t=e.categories,n=e.currentCategoryId,o=e.handleCategorySelect,i=e.shouldDisplaySelectedCategory,a=void 0===i||i;return(0,r.jsx)(r.Fragment,{children:t.map((function(e){return(0,r.jsx)(Qee.Z,{avatar:ete(e.icon),name:e.name,focusProps:{offset:{right:4,top:1,bottom:1}},onClick:function(){return o(e.categoryId)},wrapContent:!0,selected:a&&e.categoryId===n,className:Jee().categoryItem,selectedClassName:Jee().selectedCategoryItem,innerClassName:Jee().itemInner},e.categoryId)}))})};tte.Icons=J8.fW;const nte=tte
;var rte=n(623028),ote=n.n(rte);function ite(e){var t=e.text;return(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:ote().discoverHeader,children:t})}var ate=n(348311);const ste=function(e){var t=e.handleCategorySelect,n=e.shouldDisplaySelectedCategory,o=e.currentCategoryId,i=(0,s.e7)([ud.Z],(function(){return ud.Z.hasHotspot(ld.v6.HUB_NEW)}));return(0,r.jsx)(Qee.Z,{avatar:(0,r.jsx)(ate.Z,{}),name:Q.Z.Messages.HUB_SCHOOL_HUBS,focusProps:{offset:{right:4,top:1,bottom:1}},onClick:function(){t(J8.U);(0,ld.Kw)(ld.v6.HUB_NEW)},wrapContent:!0,selected:n&&J8.U===o,className:Jee().categoryItem,selectedClassName:Jee().selectedCategoryItem,innerClassName:Jee().itemInner,children:i&&(0,r.jsx)("div",{className:Jee().new,children:(0,r.jsx)(c.xvT,{color:"none",variant:"text-xs/semibold",className:Jee().newText,children:Q.Z.Messages.NEW})})},J8.U)};function cte(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function lte(e,t){
t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var ute=function(e){switch(e){case 1:return J8.fW.Activity;case 2:return J8.fW.Music;case 3:return J8.fW.Television;case 5:return J8.fW.Science;case 6:return J8.fW.Education;default:return J8.fW.Discover}};const fte=function(){var e=(0,s.cj)([Q8.ZP],(function(){return{currentCategoryId:Q8.ZP.getCurrentCategoryId(),isViewingSearchResults:Q8.ZP.getMostRecentQuery().length>0}})),t=e.currentCategoryId,n=e.isViewingSearchResults,o=(0,s.e7)([D7.Z],(function(){return D7.Z.getDiscoveryCategories()}),[],D7.j),i=null==o?void 0:o.map((function(e){
return lte(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){cte(e,t,n[t])}))}return e}({},e),{icon:ute(e.categoryId)})})),a=function(e){(0,TQ.uY)(e,!0);eo();n&&(0,TQ.AQ)()};return(0,r.jsxs)(c.Ttm,{children:[(0,r.jsx)(ite,{text:Q.Z.Messages.DISCOVER}),(0,r.jsx)(nte,{categories:i,handleCategorySelect:a,currentCategoryId:t,shouldDisplaySelectedCategory:!n}),(0,r.jsx)(ste,{handleCategorySelect:a,currentCategoryId:t,shouldDisplaySelectedCategory:!n})]})};var dte=n(876759);function pte(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function hte(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){pte(i,r,o,a,s,"next",e)}
function s(e){pte(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Ete(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function yte(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Ete(e,t,n[t])}))}return e}var mte=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,
o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function bte(e,t,n){return gte.apply(this,arguments)}function gte(){return(gte=hte((function(e,t,n){var r;return mte(this,(function(o){switch(o.label){case 0:null==t&&(t=Au.Z.getStatus());return[4,ct.co.updateSetting(e)];case 1:o.sent();r={next_status:e,prev_status:t};null!=n&&(r=yte({},r,n));Ie.default.track(M.rMx.USER_STATUS_UPDATED,r);return[2]}}))}))).apply(this,arguments)}
function Ote(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function vte(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ote(i,r,o,a,s,"next",e)}function s(e){Ote(i,r,o,a,s,"throw",e)}a(void 0)}))}}function _te(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var Ite=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{
value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Ste(){(0,c.ZDy)(vte((function(){var e,t;return Ite(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(65494),n.e(34840)]).then(n.bind(n,234840))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){
return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){_te(e,t,n[t])}))}return e}({},e))}]}}))})),{onCloseCallback:function(){O.Z.dispatch({type:"CLEAR_AUTHENTICATION_ERRORS"});O.Z.dispatch({type:"LOGIN_RESET",isMultiAccount:!0})},modalKey:wE.Ui})}var Tte=n(196644),Nte=n(873553),Ate=n(22724),Cte=n(696307),Pte=n.n(Cte);function jte(){var e=(0,s.e7)([Y.default],(function(){return Y.default.getCurrentUser()})),t=(0,s.e7)([Lr.Z],(function(){return Lr.Z.hidePersonalInformation})),n=(0,Ate.L)().multiAccountUsers,o=n.map((function(n){var o=new UC.Z(n),i=o.id===(null==e?void 0:e.id),a=n.tokenStatus===Nte.q.INVALID,s=t?null:"#".concat(o.discriminator);return(0,r.jsx)(c.sNh,{id:o.id,focusedClassName:Pte().focused,label:function(e){var l=e.isFocused;return(0,r.jsxs)("div",{className:Pte().userMenuItem,children:[(0,r.jsx)(c.qEK,{src:o.getAvatarURL(void 0,40),size:c.EFr.SIZE_24,"aria-label":n.username}),(0,r.jsxs)("div",{className:Pte().userMenuUsername,children:[(0,
r.jsx)(c.xvT,{className:Pte().userMenuText,variant:"text-sm/normal",children:lp.ZP.getUserTag(o,{mode:"username",identifiable:t?"never":"always"})}),!o.isPomelo()&&(0,r.jsx)(c.xvT,{className:Pte().userMenuDiscriminator,variant:"text-sm/normal",children:s})]}),i&&(0,r.jsx)(FP.Z,{color:(0,ER.Lq)(l?M.Ilk.WHITE_500:M.Ilk.BRAND_500),backgroundColor:(0,ER.Lq)(l?M.Ilk.BRAND_500:M.Ilk.WHITE_500),width:18,height:18,className:Pte().activeIcon}),a&&(0,r.jsx)(NN.Z,{color:(0,ER.Lq)(M.Ilk.RED_400),backgroundColor:(0,ER.Lq)(M.Ilk.WHITE_500),width:15,height:15,className:Pte().activeIcon})]})},action:function(){a?Ste():function(t){if(t!==(null==e?void 0:e.id)){Ie.default.track(M.rMx.MULTI_ACCOUNT_SWITCH_ATTEMPT,{location:{section:M.jXE.PROFILE_POPOUT}});Tte.yD(t)}}(o.id)}},o.id)}));o.push((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.Clw,{}),(0,r.jsx)(c.sNh,{id:"manage-accounts",label:Q.Z.Messages.SWITCH_ACCOUNTS_MANAGE_ACCOUNTS,action:Ste})]}));return o}function Rte(e,t,n){
t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function xte(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Mte(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function wte(e){
var t=e.width,n=void 0===t?20:t,o=e.height,i=void 0===o?20:o,a=e.color,s=void 0===a?"currentColor":a,c=Mte(e,["width","height","color"]);return(0,r.jsxs)("svg",xte(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Rte(e,t,n[t])}))}return e}({},(0,OO.Z)(c)),{width:n,height:i,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{
d:"M13.4996 0H6.72144C6.62254 1.34004e-06 6.52586 0.0293272 6.44363 0.0842743C6.36141 0.139221 6.29733 0.217322 6.25949 0.308693C6.22165 0.400063 6.21176 0.500602 6.23106 0.597595C6.25037 0.694589 6.298 0.783679 6.36794 0.8536L7.63564 2.1213C7.82317 2.30884 7.92853 2.56319 7.92853 2.8284C7.92853 3.09361 7.82317 3.34796 7.63564 3.5355L6.22144 4.9498C5.65884 5.51241 5.34277 6.27546 5.34277 7.0711C5.34277 7.86674 5.65884 8.62979 6.22144 9.1924C6.40897 9.37993 6.66331 9.48528 6.92853 9.48528C7.19374 9.48528 7.4481 9.37993 7.63564 9.1924L9.75703 7.0711C10.1321 6.69603 10.6408 6.48533 11.1712 6.48533C11.7017 6.48533 12.2104 6.69603 12.5854 7.0711L13.146 7.6317C13.2159 7.70164 13.305 7.74927 13.402 7.76858C13.499 7.78788 13.5996 7.77799 13.6909 7.74015C13.7823 7.70231 13.8604 7.63823 13.9154 7.556C13.9703 7.47377 13.9996 7.37709 13.9996 7.2782V0.5C13.9996 0.367392 13.9469 0.240214 13.8532 0.146446C13.7594 0.052678 13.6322 0 13.4996 0Z",fill:s}),(0,r.jsx)("path",{
d:"M4.5 17.9999H11.2782C11.3771 17.9999 11.4738 17.9706 11.556 17.9157C11.6382 17.8607 11.7023 17.7826 11.7401 17.6912C11.778 17.5999 11.7879 17.4993 11.7686 17.4023C11.7493 17.3053 11.7016 17.2163 11.6317 17.1463L10.364 15.8786C10.1765 15.6911 10.0711 15.4367 10.0711 15.1715C10.0711 14.9063 10.1765 14.652 10.364 14.4644L11.7782 13.0501C12.3408 12.4875 12.6569 11.7245 12.6569 10.9288C12.6569 10.1332 12.3408 9.37014 11.7782 8.80753C11.5907 8.62 11.3363 8.51465 11.0711 8.51465C10.8059 8.51465 10.5515 8.62 10.364 8.80753L8.2426 10.9288C7.86753 11.3039 7.35883 11.5146 6.8284 11.5146C6.29797 11.5146 5.78927 11.3039 5.4142 10.9288L4.85361 10.3682C4.78369 10.2983 4.69459 10.2507 4.5976 10.2314C4.5006 10.2121 4.40006 10.2219 4.30869 10.2598C4.21731 10.2976 4.13922 10.3617 4.08427 10.4439C4.02933 10.5262 4 10.6228 4 10.7217V17.4999C4 17.6325 4.05269 17.7597 4.14645 17.8535C4.24022 17.9473 4.36739 17.9999 4.5 17.9999Z",fill:s})]}))}var Dte=n(951035),Zte=n.n(Dte);function Lte(e,t,n,r,o,i,a){try{
var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Ute(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Lte(i,r,o,a,s,"next",e)}function s(e){Lte(i,r,o,a,s,"throw",e)}a(void 0)}))}}function kte(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Gte(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){kte(e,t,n[t])}))}return e}function Bte(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e)
;t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var Hte=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}
if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Vte(e){var t=e.status,n=e.description,o=e.focused;return(0,r.jsxs)("div",{className:Zte().statusItem,children:[(0,r.jsx)(c.qbd,{status:t,className:Zte().icon,size:10,color:o?"currentColor":void 0}),(0,r.jsx)("div",{className:Zte().status,children:(0,lp.u5)(t)}),null!=n&&(0,r.jsx)("div",{className:Zte().description,children:n})]})}function Fte(e){var t=e.customStatus,n=function(e){e.stopPropagation();ct.Ok.updateSetting(void 0)};return null!=t?(0,r.jsx)("div",{"aria-label":Q.Z.Messages.CUSTOM_STATUS_EDIT_CUSTOM_STATUS_PLACEHOLDER,children:(0,r.jsx)(dte.Z,{className:null!=t.emoji?Zte().customStatusWithEmoji:Zte().customStatusItem,activity:t,
emojiClassName:Zte().customEmoji,textClassName:Zte().customText,placeholderText:Q.Z.Messages.CUSTOM_STATUS_EDIT_CUSTOM_STATUS_PLACEHOLDER,children:(0,r.jsx)(c.ua7,{text:Q.Z.Messages.CUSTOM_STATUS_CLEAR_CUSTOM_STATUS,children:function(e){return(0,r.jsx)(c.zxk,Bte(Gte({},e),{className:Zte().clearStatusButton,onClick:n,look:c.zxk.Looks.BLANK,size:c.zxk.Sizes.NONE,tabIndex:-1,"aria-hidden":!0,children:(0,r.jsx)(YP.Z,{className:Zte().clearStatusIcon})}))}})})}):(0,r.jsxs)("div",{className:lh()(Zte().statusItem,Zte().customStatusContentIcon),"aria-label":Q.Z.Messages.CUSTOM_STATUS_SET_CUSTOM_STATUS,children:[(0,r.jsx)("div",{className:Zte().customEmojiPlaceholder}),(0,r.jsx)("div",{className:Zte().status,children:Q.Z.Messages.CUSTOM_STATUS_SET_CUSTOM_STATUS})]})}function Yte(e){var t=e.focused;return(0,r.jsxs)("div",{className:lh()(Zte().statusItem,Zte().statusItemNoPadding,Zte().customStatusContentIcon,Zte().switchAccountsItem),"aria-label":Q.Z.Messages.SWITCH_ACCOUNTS_MENU_ITEM_TITLE,
children:[(0,r.jsx)(wte,{width:18,height:18,className:Zte().switchAccountsIcon,color:t?$b.Z.unsafe_rawColors.WHITE_500.css:"currentColor"}),(0,r.jsx)("div",{className:Zte().status,children:Q.Z.Messages.SWITCH_ACCOUNTS_MENU_ITEM_TITLE})]})}var zte=function(e){var t=e.customStatus,i=e.onClose,a=e.analyticsContext,s=e.onSelect,l=jte();o.useEffect((function(){Ie.default.track(M.rMx.OPEN_POPOUT,{type:"User Status Menu",has_custom_status:null!=t,location:a.location})}),[]);var u=function(e){bte(e,void 0,{location:a.location})};return(0,r.jsxs)(c.v2r,{navId:"status-picker",variant:"fixed","aria-label":Q.Z.Messages.SET_STATUS,onClose:i,onSelect:s,children:[(0,r.jsx)(c.sNh,{id:"online",keepItemStyles:!0,render:function(e){var t=e.isFocused;return(0,r.jsx)(Vte,{status:c.Skl.ONLINE,focused:t})},action:function(){return u(c.Skl.ONLINE)}}),(0,r.jsx)(c.Clw,{}),(0,r.jsx)(c.sNh,{id:"idle",keepItemStyles:!0,render:function(e){var t=e.isFocused;return(0,r.jsx)(Vte,{status:c.Skl.IDLE,focused:t})},
action:function(){return u(c.Skl.IDLE)}}),(0,r.jsx)(c.sNh,{id:"dnd",keepItemStyles:!0,render:function(e){var t=e.isFocused;return(0,r.jsx)(Vte,{status:c.Skl.DND,description:Q.Z.Messages.STATUS_DND_HELP,focused:t})},action:function(){return u(c.Skl.DND)}}),(0,r.jsx)(c.sNh,{id:"invisible",keepItemStyles:!0,render:function(e){var t=e.isFocused;return(0,r.jsx)(Vte,{status:c.Skl.INVISIBLE,description:Q.Z.Messages.STATUS_INVISIBLE_HELPER,focused:t})},action:function(){return u(c.Skl.INVISIBLE)}}),(0,r.jsx)(c.Clw,{}),(0,r.jsx)(c.sNh,{id:"custom-status",keepItemStyles:!0,render:function(){return(0,r.jsx)(Fte,{customStatus:t})},action:function(){(0,c.ZDy)(Ute((function(){var e,t;return Hte(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(88005)]).then(n.bind(n,388005))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Bte(Gte({},e),{sourceAnalyticsContext:a}))}]}}))})))}}),(0,r.jsx)(c.Clw,{}),(0,r.jsx)(c.sNh,{id:"switch-account",action:Ste,
label:function(e){var t=e.isFocused;return(0,r.jsx)(Yte,{focused:t})},children:l},"switch-account")]})};const Wte=(0,cX.Z)((function(e){var t=(0,s.e7)([Nu.Z],(function(){return Nu.Z.getCustomStatusActivity()})),n=ct.co.useSetting();return(0,r.jsx)(zte,Bte(Gte({},e),{customStatus:t,status:n}))}));var Kte=(0,tc.B)({kind:"user",id:"2023-01_consumer_education_launch",label:"Safety Consumer Education Launch - Block/Mute",defaultConfig:{bucket:0,enabled:!1},treatments:[{id:1,label:"Mute",config:{bucket:1,enabled:!0}},{id:2,label:"Block",config:{bucket:2,enabled:!0}}]});var qte=n(540825),Xte=n(473664),Qte=n(258441),$te=n(37969),Jte=n.n($te);function ene(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}const tne=o.forwardRef((function(e,t){
var n,i=e.body,a=e.header,s=e.artClassName,l=e.headerClassName,u=e.tryItText,f=e.onTryFeature,d=e.onClose,p=e.className,h=e.inlineArt,E=void 0!==h&&h,y=e.isPremiumFeature,m=void 0!==y&&y,b=e.shouldUseHorizontalButtons,g=void 0!==b&&b,O=e.showGIFTag,v=void 0!==O&&O,_=e.dismissibleContent,I=function(e){(0,un.EW)(_,{dismissAction:e})},S=g?c.zxk.Sizes.SMALL:c.zxk.Sizes.MAX;o.useEffect((function(){(0,un.kk)(_)}),[_]);return(0,r.jsx)("div",{className:p,ref:t,children:(0,r.jsxs)("div",{className:lh()(Jte().content,(n={},ene(n,Jte().contentNoArt,null==s||E),ene(n,Jte().contentPremium,m),n)),children:[(0,r.jsx)("div",{className:lh()(s,E?Jte().artInline:Jte().artAbsolute),children:v&&(0,r.jsx)(Qte.Z,{className:Jte().gifTag})}),(0,r.jsxs)("div",{className:Jte().body,children:[(0,r.jsxs)(c.X6q,{className:lh()(m?Jte().headerWithPremiumIcon:Jte().header,l),variant:"heading-md/bold",color:"always-white",children:[m?(0,r.jsx)(eL.Z,{className:Jte().premiumIcon}):null,a]
}),null==i?null:"string"==typeof i?(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"always-white",children:i}):i]}),null!=f?(0,r.jsxs)("div",{className:g?Jte().buttonContainerHorizontal:Jte().buttonContainerVertical,children:[(0,r.jsx)(c.zxk,{className:Jte().button,size:S,onClick:function(){null==d||d();f();I(hn.L.PRIMARY)},color:m?c.zxk.Colors.BRAND:c.zxk.Colors.WHITE,look:m?c.zxk.Looks.INVERTED:c.zxk.Looks.FILLED,children:null!=u?u:Q.Z.Messages.EDUCATION_NEW_FEATURE_TRY_IT}),(0,r.jsx)(c.zxk,{className:Jte().button,size:S,onClick:function(){null==d||d();I(hn.L.DISMISS)},color:m?c.zxk.Colors.WHITE:c.zxk.Colors.BRAND,look:m?c.zxk.Looks.LINK:c.zxk.Looks.FILLED,children:Q.Z.Messages.EDUCATION_NEW_FEATURE_DISMISS})]}):(0,r.jsx)(c.zxk,{className:Jte().button,size:c.zxk.Sizes.MAX,onClick:function(){null==d||d();I(hn.L.PRIMARY)},color:c.zxk.Colors.WHITE,children:Q.Z.Messages.EDUCATION_NEW_FEATURE_CONFIRM}),(0,r.jsx)("div",{className:Jte().pointer})]})})}));var nne=n(824232),rne=n.n(nne)
;const one=function(e){var t=e.user,n=Na.ZP.canUsePremiumProfileCustomization(t),i=(0,UJ.Z)({}),a=(0,Hw.Z)().analyticsLocations;o.useEffect((function(){Ie.default.track(M.rMx.PREMIUM_UPSELL_VIEWED,{type:jf.cd.AVATAR_DECORATIONS_TOOLTIP,location_stack:a})}),[a]);return(0,r.jsx)(tne,{dismissibleContent:ln.z$.AVATAR_DECORATIONS_SPRING_2023_FEATURE_EDUCATION_TOOLTIP,header:(0,r.jsx)("span",{className:rne().title,children:Q.Z.Messages.AVATAR_DECORATIONS_SPRING_2023_FEATURE_EDUCATION_TITLE}),body:n?Q.Z.Messages.AVATAR_DECORATIONS_SPRING_2023_FEATURE_EDUCATION_DESCRIPTION_PREMIUM:Q.Z.Messages.AVATAR_DECORATIONS_SPRING_2023_FEATURE_EDUCATION_DESCRIPTION,isPremiumFeature:!0,shouldUseHorizontalButtons:!0,inlineArt:!0,artClassName:rne().art,tryItText:Q.Z.Messages.CHECK_IT_OUT,onTryFeature:i})};var ine=n(585730),ane=n(940007);function sne(e,t,n){return n?Q.Z.Messages.CONSOLE_CONNECTING_DISABLED:t?Q.Z.Messages.SERVER_DEAFENED_DIALOG_TITLE:e?Q.Z.Messages.UNDEAFEN:Q.Z.Messages.DEAFEN}
var cne=n(180306);function lne(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function une(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function fne(e){e?(0,c.h7j)((function(e){return(0,r.jsx)(th.default,une(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){lne(e,t,n[t])}))}return e
}({},e),{title:Q.Z.Messages.SERVER_DEAFENED_DIALOG_TITLE,body:Q.Z.Messages.SERVER_DEAFENED_DIALOG_BODY}))})):Fe.Z.toggleSelfDeaf()}var dne=n(668269),pne=n(450136),hne=n(169071);const Ene=(0,tc.B)({kind:"user",id:"2022-04_account_profile_popout",label:"Account Profile Popout",defaultConfig:{isPopupEnabled:!1,isTaglessAccountPanelEnabled:!1,isJoinedTagButtonEnabled:!1},treatments:[{id:1,label:"Enable Account Profile Popout",config:{isPopupEnabled:!0,isTaglessAccountPanelEnabled:!1,isJoinedTagButtonEnabled:!1}},{id:2,label:"Enable Account Profile Popout w/ DiscordTag button",config:{isPopupEnabled:!0,isTaglessAccountPanelEnabled:!1,isJoinedTagButtonEnabled:!0}}]});var yne=n(125890),mne=n.n(yne);function bne(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function gne(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){bne(i,r,o,a,s,"next",e)}function s(e){
bne(i,r,o,a,s,"throw",e)}a(void 0)}))}}function One(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function vne(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){One(e,t,n[t])}))}return e}function _ne(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var Ine=function(e,t){var n,r,o,i,a={label:0,
sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{
value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};var Sne=n(362658),Tne=n(190954),Nne=n(735100),Ane=n(777532),Cne=n(249139);const Pne=(0,Cne.Z)({id:"2022-07_user_panel_context_menu_profile_entrypoint_behavior",label:"User Panel Context Menu Profile Entrypoint (behavior)",kind:"user",defaultConfig:{enabled:!1},treatments:[{id:1,label:"Enabled",config:{enabled:!0}}]}),jne=(0,Cne.Z)({id:"2022-07_user_panel_context_menu_profile_entrypoint",label:"User Panel Context Menu Profile Entrypoint",kind:"user",defaultConfig:{entryPointTexti18nKey:void 0},treatments:[{id:1,label:"Customize Your Profile",config:{entryPointTexti18nKey:"PREMIUM_FEATURES_PROFILE_CUSTOMIZATION_MENU_ITEM_TITLE"}},{id:2,label:"Customize Your Profile With Nitro",config:{entryPointTexti18nKey:"PREMIUM_FEATURES_PROFILE_CUSTOMIZATION_MENU_ITEM_TITLE_LONGER"}}]});var Rne=n(698544),xne=n(448898),Mne=n(558149),wne=n.n(Mne);function Dne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}
function Zne(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Lne(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Zne(i,r,o,a,s,"next",e)}function s(e){Zne(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Une(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function kne(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Une(e,t,n[t])}))}return e}function Gne(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){
var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Bne(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Dne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dne(e,t)}(e,t)||function(){
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Hne=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){
a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Vne(e,t,n,o){return(0,r.jsx)(c.sNh,{id:e,keepItemStyles:!0,render:function(t){var n=t.isFocused;return(0,r.jsxs)("div",{className:wne().statusItem,children:[(0,r.jsx)(c.qbd,{status:e,className:wne().icon,size:10,color:n?"currentColor":void 0}),(0,r.jsx)("div",{className:wne().status,children:(0,lp.u5)(e)}),null!=o&&(0,r.jsx)("div",{className:wne().description,children:o})]})},action:function(){return bte(e,t,n)}})}function Fne(e){var t=e.user,i=e.customStatus,a=e.guildId,l=e.isApplicationStreaming,u=e.onClose,f=e.onSelect,d=e.closePopout,p=(0,PK.O)(),E=(0,Hw.Z)(Pf.Z.ACCOUNT_PROFILE_POPOUT).AnalyticsLocationProvider,y=(0,bR.Z)(t.id,a),m=Na.ZP.canUsePremiumProfileCustomization(t),b=jne.useExperiment({},{autoTrackExposure:!m
}).entryPointTexti18nKey,g=void 0!==b&&!m,O=Bne((0,s.Wu)([$a.Z],(function(){var e,n=t.id;return"string"!=typeof n?[void 0,void 0,M.Skl.UNKNOWN,!1]:[null!==(e=$a.Z.findActivity(n,(function(e){return e.type!==M.IIU.CUSTOM_STATUS})))&&void 0!==e?e:void 0,$a.Z.findActivity(t.id,(function(e){return e.type===M.IIU.CUSTOM_STATUS})),$a.Z.getStatus(n),$a.Z.isMobileOnline(n)]})),4),v=O[0],_=O[1],I=O[2],S=O[3],T=function(e,t){return(0,r.jsxs)(r.Fragment,{children:[Vne(M.Skl.ONLINE,e,t),(0,r.jsx)(c.Clw,{},"menu-separator-statuses"),Vne(M.Skl.IDLE,e,t),Vne(M.Skl.DND,e,t,Q.Z.Messages.STATUS_DND_HELP),Vne(M.Skl.INVISIBLE,e,t,Q.Z.Messages.STATUS_INVISIBLE_HELPER)]})}(I,p);o.useEffect((function(){Ie.default.track(M.rMx.OPEN_POPOUT,{type:"User Status Menu",has_custom_status:null!=i,other_user_id:t.id,application_id:null!=v?v.application_id:void 0,is_streaming:l,application_name:null!=v?v.name:void 0,profile_has_nitro_customization:null!=(null==y?void 0:y.banner),location:p.location})}),[])
;var N=lh()(wne().menuItemFocused,Une({},wne().menuItemFocusedPremium,m)),A=jte(),C=function(e,t){var o=function(e){e.stopPropagation();ct.Ok.updateSetting(void 0)},i=function(){(0,c.ZDy)(gne((function(){var e,t;return Ine(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(88005)]).then(n.bind(n,388005))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,vne({sourceAnalyticsContext:a},e))}]}}))})))},a=(0,PK.O)();if(null!=e){var s=null!=e.emoji?function(t){var n=t.className;return(0,r.jsx)(D$.I,{className:n,emoji:e.emoji,animate:!0,hideTooltip:!0})}:void 0;return(0,r.jsx)(c.sNh,{id:"edit-custom-status",label:Q.Z.Messages.CUSTOM_STATUS_EDIT_CUSTOM_STATUS_PLACEHOLDER,icon:s,focusedClassName:t,showIconFirst:!0,hint:function(e){return(0,r.jsx)(c.P3F,_ne(vne({},e),{onClick:o,tabIndex:-1,children:(0,r.jsx)(YP.Z,{width:18,height:18})}))},action:i})}return(0,r.jsx)(c.sNh,{id:"set-custom-status",focusedClassName:t,
label:Q.Z.Messages.CUSTOM_STATUS_SET_CUSTOM_STATUS_CTA,icon:function(e){return(0,r.jsx)("div",{className:lh()(mne().customEmojiPlaceholder,e)})},action:i,showIconFirst:!0})}(null!=i?i:void 0,N),P="PREMIUM_FEATURES_PROFILE_CUSTOMIZATION_MENU_ITEM_TITLE_LONGER"===b?Q.Z.Messages.PREMIUM_FEATURES_PROFILE_CUSTOMIZATION_MENU_ITEM_TITLE_LONGER:Q.Z.Messages.PREMIUM_FEATURES_PROFILE_CUSTOMIZATION_MENU_ITEM_TITLE;return(0,r.jsx)(E,{children:(0,r.jsxs)(Sne.Z,{user:t,profileType:xne.y0.POPOUT,children:[(0,r.jsx)(Ane.ZP,{user:t,displayProfile:y,onClose:function(){return null==d?void 0:d()},isMobile:S,isStreaming:(0,SW.Z)(v),status:I,onOpenPremiumSettings:function(){Ie.default.track(M.rMx.PREMIUM_PROMOTION_OPENED,{location_page:null,location_section:M.jXE.PROFILE_POPOUT,location_object:M.qAy.TOOLTIP});h.Z.open(M.oAB.PREMIUM);null==d||d()},disableUserProfileLink:__OVERLAY__,isHovering:!1}),(0,r.jsxs)(Sne.Z.Inner,{children:[(0,r.jsx)(Tne.Z,{activity:v,customStatusActivity:_,displayProfile:y,user:t,
onClose:u,setNote:!1,canDM:!1,hideNote:!0,showCopiableUsername:!0}),(0,r.jsx)(Nne.Z,{className:wne().divider}),(0,r.jsxs)(c.v2r,{navId:"account","aria-label":Q.Z.Messages.SET_STATUS,hideScroller:!0,className:wne().menu,onClose:u,onSelect:f,children:[(0,r.jsxs)(c.kSQ,{children:[(0,r.jsx)(c.sNh,{id:"status-picker",label:(0,lp.u5)(I),focusedClassName:N,action:no.tq?function(){(0,c.ZDy)((function(){return new Promise((function(e){e((function(e){return(0,r.jsx)(c.Y0X,Gne(kne({},e),{size:c.CgR.SMALL,className:wne().modal,"aria-label":Q.Z.Messages.SET_STATUS,children:(0,r.jsx)(c.v2r,{navId:"account",variant:"fixed","aria-label":Q.Z.Messages.SET_STATUS,hideScroller:!0,className:wne().statusPickerModalMenu,onClose:e.onClose,onSelect:e.onClose,children:T})}))}))}))}))}:void 0,showIconFirst:!0,icon:function(e){var t=e.className,n=e.isFocused;return(0,r.jsx)(c.qbd,{status:I,size:12,className:lh()(t,wne().mainStatusIcon),color:n?"currentColor":void 0})},children:no.tq?void 0:T
},"status-picker"),C,g?(0,r.jsx)(c.sNh,{id:"style-your-profile",focusedClassName:N,color:"brand",label:P,action:function(){if(Pne.getCurrentConfig({},{autoTrackExposure:!m}).enabled){Ie.default.track(M.rMx.OPEN_MODAL,{type:M.jXE.AGGREGATE_PREMIUM_UPSELL_MODAL,location:{section:M.jXE.PROFILE_POPOUT}});(0,c.ZDy)(Lne((function(){var e,t;return Hne(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(43329)]).then(n.bind(n,443329))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Gne(kne({},e),{ingressPremiumFeatureId:Rne.c.PREMIUM_FEATURE_CUSTOM_PROFILES_ID}))}]}}))})))}else(0,c.ZDy)(Lne((function(){var e,t;return Hne(this,(function(o){switch(o.label){case 0:return[4,n.e(92189).then(n.bind(n,92189))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Gne(kne({},e),{source:{section:M.jXE.PROFILE_POPOUT,object:M.qAy.BUTTON_CTA}}))}]}}))})))},icon:eL.Z,showIconFirst:!0},"style-your-profile"):null]}),(0,r.jsx)(c.kSQ,{children:(0,
r.jsx)(c.sNh,{id:"switch-account",focusedClassName:N,label:Q.Z.Messages.SWITCH_ACCOUNTS_MENU_ITEM_TITLE,icon:wte,showIconFirst:!0,action:Ste,children:A},"switch-account")})]})]})]})})}function Yne(e){var t=e.userId,n=e.user,i=e.guildId,a=e.onClose,c=e.onSelect,l=(0,s.e7)([Y.default],(function(){return Y.default.getUser(t)}),[t]),u=(0,s.e7)([Nu.Z],(function(){return Nu.Z.getCustomStatusActivity()})),f=Bne(o.useState(!1),2),d=f[0],p=f[1],h=null!=l?l:n,E=(0,s.e7)([Pr.Z],(function(){return null!=h&&null!=Pr.Z.getAnyStreamForUser(h.id)}));o.useEffect((function(){null==l&&function(){e.apply(this,arguments)}();function e(){return(e=Lne((function(){return Hne(this,(function(e){switch(e.label){case 0:return"string"!=typeof t?[3,2]:[4,(0,rl.PR)(t)];case 1:e.sent();p(!0);e.label=2;case 2:return[2]}}))}))).apply(this,arguments)}}),[l,t]);if(null==h){d&&xh()(null!=h,"Unexpected missing user");return null}return(0,r.jsx)(Fne,{closePopout:a,user:h,customStatus:u,guildId:i,isApplicationStreaming:E,
onClose:a,onSelect:c})}var zne=function(){var e=Kte.useExperiment({},{autoTrackExposure:!0}).enabled,t=(0,dE.ZP)([Y.default],(function(){return Y.default.getCurrentUser()})),n=(0,dE.ZP)([fn.Z],(function(){return Object.values(fn.Z.getMemberCounts()).some((function(e){return e>=200}))}));return e&&!(0,lp.EO)(t)&&n},Wne=n(620440),Kne=n.n(Wne);const qne=function(e){var t=e.markAsDismissed,n=(0,dE.ZP)([E.Z],(function(){return E.Z.useReducedMotion}));return zne()?(0,r.jsx)(qZ.ZP,{asset:(0,r.jsx)(pL.Z,{className:Kne().video,src:"https://cdn.discordapp.com/attachments/1067194967979733053/1067195117439557712/Safety_BLOCK_Coachmark.mp4",loop:!0,autoPlay:!n,width:"100%"}),header:Q.Z.Messages.SAFETY_CONSUMER_EDUCATION_BLOCK_HEADER,content:Q.Z.Messages.SAFETY_CONSUMER_EDUCATION_BLOCK_CONTENT,buttonCTA:Q.Z.Messages.GOT_IT,className:Kne().coachmark,onClick:function(e){e.stopPropagation();t()},markAsDismissed:t,caretPosition:qZ.DF.BOTTOM_CENTER,headerClassName:Kne().header}):null}
;var Xne=n(618599),Qne=n.n(Xne);const $ne=function(e){var t=e.markAsDismissed,n=(0,dE.ZP)([E.Z],(function(){return E.Z.useReducedMotion}));return zne()?(0,r.jsx)(qZ.ZP,{asset:(0,r.jsx)(pL.Z,{className:Qne().video,src:"https://cdn.discordapp.com/attachments/1067194967979733053/1067195118026772480/Safety_MUTE_Coachmark.mp4",loop:!0,autoPlay:!n,width:"100%"}),header:Q.Z.Messages.SAFETY_CONSUMER_EDUCATION_MUTE_HEADER,content:Q.Z.Messages.SAFETY_CONSUMER_EDUCATION_MUTE_CONTENT,buttonCTA:Q.Z.Messages.GOT_IT,className:Qne().coachmark,onClick:function(e){e.stopPropagation();t()},markAsDismissed:t,caretPosition:qZ.DF.BOTTOM_CENTER,headerClassName:Qne().header}):null};var Jne,ere=n(784686);!function(e){e[e.VIEW=0]="VIEW";e[e.DISMISS=1]="DISMISS";e[e.CHANGE_SETTING=2]="CHANGE_SETTING"}(Jne||(Jne={}));var tre=n(218713),nre=n.n(tre),rre=n(660588),ore=n.n(rre);const ire=function(e){var t=e.markAsDismissed;o.useEffect((function(){Ie.default.track(M.rMx.DM_SAFETY_COACHMARK_ACTION,{action:Jne.VIEW})
}),[]);return(0,r.jsx)(qZ.ZP,{asset:(0,r.jsx)("img",{src:ore(),alt:Q.Z.Messages.USER_EXPLICIT_CONTENT_FILTER_COACHMARK_ASSET_ALT,className:nre().art}),header:Q.Z.Messages.USER_EXPLICIT_CONTENT_FILTER_COACHMARK_HEADER,content:Q.Z.Messages.USER_EXPLICIT_CONTENT_FILTER_COACHMARK_CONTENT,buttonCTA:Q.Z.Messages.GOT_IT,secondaryButtonCTA:Q.Z.Messages.USER_EXPLICIT_CONTENT_FILTER_COACHMARK_REDIRECT,className:nre().coachmark,onClick:function(e){e.stopPropagation();t();Ie.default.track(M.rMx.DM_SAFETY_COACHMARK_ACTION,{action:Jne.DISMISS})},onSecondaryClick:function(){(0,K.uL)(M.Z5c.SETTINGS("privacy-and-safety"));Ie.default.track(M.rMx.DM_SAFETY_COACHMARK_ACTION,{action:Jne.CHANGE_SETTING})},markAsDismissed:t,caretPosition:qZ.DF.BOTTOM_CENTER,headerClassName:nre().header})};const are=function(e){return(0,s.cj)([j.Z,Ye.Z,Jn.default],(function(){return function(e){
var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:j.Z,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ye.Z,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Jn.default,i=null!=e?n.getVoiceState(e.getGuildId(),o.getId()):null;return{selfDeaf:r.isSelfDeaf(),deaf:null!==(t=null==i?void 0:i.deaf)&&void 0!==t&&t}}(e,j.Z,Ye.Z,Jn.default)}))};var sre=n(79987),cre=n(377463),lre=n(466317),ure=n(308377),fre=n(6171),dre=n(961241),pre=n(554647),hre=n(168775),Ere=n(630781),yre=n(984479),mre=n(691797),bre=n(575709),gre=n.n(bre);function Ore(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vre(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function _re(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){vre(i,r,o,a,s,"next",e)}function s(e){vre(i,r,o,a,s,"throw",e)}a(void 0)}))}}
function Ire(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sre(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1;r.configurable=!0;"value"in r&&(r.writable=!0);Object.defineProperty(e,r.key,r)}}function Tre(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Nre(e){Nre=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Nre(e)}function Are(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Tre(e,t,n[t])}))}return e}function Cre(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){
var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Pre(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function jre(e,t){return!t||"object"!==xre(t)&&"function"!=typeof t?Ore(e):t}function Rre(e,t){Rre=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Rre(e,t)}var xre=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Mre(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Nre(e);if(t){var o=Nre(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return jre(this,n)}}var wre=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:
a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Dre=ss.default.getEnableHardwareAcceleration()?c.Xo$:c.qEK;var Zre=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Rre(e,t)}(o,e);var t=Mre(o);function o(){Ire(this,o);var e;(e=t.apply(this,arguments)).copiedTimeout=new Uu.V7;e.copiedDecayTimeout=new Uu.V7;e.speakingWhileMutedTooltipTimeout=new Uu.V7;e.state={hovered:!1,
copiedStreak:0,shouldShowNametagTooltip:!1,shouldShowCopiedFeedback:!1,shouldShowSpeakingWhileMutedTooltip:!1,hoveringOnMute:!1};e.handleToggleSelfMute=function(){var t=e.props,n=t.serverMute,r=t.suppress;(0,dne.Z)(n,r)};e.handleToggleSelfDeaf=function(){fne(e.props.serverDeaf)};e.handleOpenAccountSettings=function(){e.handleOpenSettings()};e.handleOpenSettings=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M.oAB.ACCOUNT,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;h.Z.open(e,t,n)};e.handleOpenSettingsContextMenu=function(t){var o=e.props.currentUser;if(null!=o){var i=Ore(e);(0,Ob.jW)(t,_re((function(){var e,t;return wre(this,(function(a){switch(a.label){case 0:return[4,n.e(22587).then(n.bind(n,22587))];case 1:e=a.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Cre(Are({},e),{user:o,premiumSubscription:i.props.premiumSubscription,webBuildOverride:i.props.webBuildOverride}))}]}}))})))}}
;e.handleInputAudioContextMenu=function(e){(0,Ob.jW)(e,_re((function(){var e,t;return wre(this,(function(o){switch(o.label){case 0:return[4,Promise.resolve().then(n.bind(n,666305))];case 1:e=o.sent(),t=e.default;return[2,function(){return(0,r.jsx)(t,{onClose:Ob.Zy,renderInputDevices:!0,renderInputModes:!0,renderInputVolume:!0})}]}}))})))};e.handleOutputAudioContextMenu=function(e){(0,Ob.jW)(e,_re((function(){var e,t;return wre(this,(function(o){switch(o.label){case 0:return[4,Promise.resolve().then(n.bind(n,666305))];case 1:e=o.sent(),t=e.default;return[2,function(){return(0,r.jsx)(t,{onClose:Ob.Zy,renderOutputDevices:!0,renderOutputVolume:!0})}]}}))})))};e.handleMouseEnter=function(){e.setState({hovered:!0})};e.handleMouseLeave=function(){e.setState({hovered:!1})};e.handleMouseEnterMute=function(){e.setState({hoveringOnMute:!0,shouldShowSpeakingWhileMutedTooltip:!1});e.speakingWhileMutedTooltipTimeout.stop()};e.handleMouseLeaveMute=function(){e.setState({hoveringOnMute:!1})}
;e.handleCopyTag=function(){var t=e.props.currentUser,n=e.state,r=n.shouldShowNametagTooltip,o=n.copiedStreak;if(null!=t){(0,mre.JG)(lp.ZP.getUserTag(t,{decoration:"never",identifiable:"always"}));Ie.default.track(M.rMx.TEXT_COPIED,{type:"User Tag"});var i={shouldShowCopiedFeedback:!0,shouldShowNametagTooltip:!0};r||(i.copiedStreak=o+1);e.setState(i,(function(){e.copiedTimeout.start(1e3,(function(){return e.setState({shouldShowNametagTooltip:!1})}));e.copiedDecayTimeout.start(2e3,(function(){return e.setState({copiedStreak:0})}))}))}};e.handleOccludedChanged=function(){e.props.occluded&&e.setState({shouldShowNametagTooltip:!1,shouldShowSpeakingWhileMutedTooltip:!1})};e.handleSpeakingWhileMutedChanged=function(){var t=e.props,n=t.selfMute,r=t.serverMute,o=t.suppress,i=t.speakingWhileMuted,a=t.occluded,s=e.state.hoveringOnMute;if(i)s||!n||r||o||a||e.setState({shouldShowSpeakingWhileMutedTooltip:!0},(function(){e.speakingWhileMutedTooltipTimeout.start(2e3,(function(){return e.setState({
shouldShowSpeakingWhileMutedTooltip:!1})}))}));else{e.setState({shouldShowSpeakingWhileMutedTooltip:!1});e.speakingWhileMutedTooltipTimeout.stop()}};e.renderStatusPickerPopout=function(t){var n=t.closePopout,o=e.props,i=o.showRichProfilePopup,a=o.currentUser;if(i){var s={userId:null==a?void 0:a.id,user:a,onClose:function(){e.handleMouseLeave();null==n||n()}};return(0,r.jsx)("div",{className:gre().accountProfilePopoutWrapper,children:(0,r.jsx)(Yne,Are({},s))})}return(0,r.jsx)(Wte,{onClose:function(){e.handleMouseLeave();null==n||n()}})};e.renderSettingsGear=function(){var t=e.props.webBuildOverride;return(0,r.jsx)(hre.Z,{tooltipText:null!=t?Q.Z.Messages.USER_SETTINGS_WITH_BUILD_OVERRIDE.format({webBuildOverride:t.id}):Q.Z.Messages.USER_SETTINGS,onClick:e.handleOpenAccountSettings,onContextMenu:e.handleOpenSettingsContextMenu,innerClassName:null!=t?gre().buildOverrideButton:null,icon:lre.Z,children:null!=t?(0,r.jsx)(fre.Z,{width:9,height:9,className:gre().hasBuildOverride,
"aria-hidden":!0}):null})};return e}var i=o.prototype;i.componentDidUpdate=function(e){var t=e.speakingWhileMuted,n=e.occluded,r=this.props,o=r.speakingWhileMuted;r.occluded!==n&&this.handleOccludedChanged();o!==t&&this.handleSpeakingWhileMutedChanged()};i.componentWillUnmount=function(){this.copiedTimeout.stop();this.copiedDecayTimeout.stop();this.speakingWhileMutedTooltipTimeout.stop()};i.renderCopiedSuccess=function(){var e=this.state.copiedStreak,t=[Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_1,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_2,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_3,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_4,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_5,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_6,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_7,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_8,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_9,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_10,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_11],n=Math.min(Math.max(0,e-1),t.length-1)
;return(0,r.jsx)(c.UkV,{isShaking:this.isCopiedStreakGodlike,children:t[n]})};i.renderNameTagV2=function(){var e=this.state.hovered,t=this.props,n=t.customStatusActivity,o=t.userTag,i=t.currentUser;if(null==i)return null;var a=lp.ZP.getName(i),s="@"+o,c=null!=n?(0,r.jsx)(Q5.Z,{hoverText:s,forceHover:e,children:(0,r.jsx)(dte.Z,{activity:n,emojiClassName:gre().emoji,className:gre().customStatus})}):void 0;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:gre().panelTitleContainer,children:(0,r.jsx)(yre.Z,{children:a})}),(0,r.jsx)("div",{className:gre().panelSubtextContainer,children:(0,r.jsx)(Ere.Z,{children:null!=c?c:s})})]})};i.renderNameTag=function(){if(this.props.inGlobalDisplayNameExperiment)return this.renderNameTagV2();var e=this.props,t=e.customStatusActivity,n=e.hidePrivateData,o=e.currentUser,i=this.state.hovered;if(null==o)return null;var a=n?null:"#".concat(o.discriminator),s=null!=t?(0,r.jsx)(Q5.Z,{hoverText:a,forceHover:i,children:(0,r.jsx)(dte.Z,{
activity:t,emojiClassName:gre().emoji,className:gre().customStatus})}):a;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xvT,{className:gre().usernameContainer,variant:"text-sm/normal",children:(0,r.jsx)(yre.Z,{children:o.username})}),null!=s?(0,r.jsx)(Ere.Z,{className:gre().discriminator,children:s}):null]})};i.renderCopiableNameTag=function(){var e=this,t=this.props.currentUser,n=this.state,o=n.shouldShowNametagTooltip,i=n.shouldShowCopiedFeedback;if(null==t)return null;var a=null,s=c.FGA.PRIMARY;if(mre.wS){a=Q.Z.Messages.ACCOUNT_CLICK_TO_COPY;if(i){a=this.renderCopiedSuccess();s=this.isCopiedStreakGodlike?c.FGA.RED:c.FGA.GREEN}}return(0,r.jsx)(c.ua7,{text:a,forceOpen:o,"aria-label":!!mre.wS&&Q.Z.Messages.ACCOUNT_CLICK_TO_COPY,color:s,delay:500,onAnimationRest:function(t,n){i&&!o&&n.phase===M.UkZ.LEAVE&&e.setState({shouldShowCopiedFeedback:!1})},children:function(t){var n=t.onClick,o=t.onMouseEnter,a=Pre(t,["onClick","onMouseEnter"]);return(0,r.jsx)(c.P3F,Cre(Are({},a),{
onMouseEnter:function(){if(i){e.copiedTimeout.stop();e.setState({shouldShowNametagTooltip:!1},o)}else null==o||o()},onClick:function(){null==n||n();e.handleCopyTag()},className:lh()(gre().nameTag,Tre({},gre().canCopy,mre.wS)),children:e.renderNameTag()}))}})};i.renderAvatarWithPopout=function(){var e=this,t=this.props,n=t.speaking,o=t.streaming,i=t.currentUser,a=t.status,s=t.showTagAsButton,l=t.showTaglessAccountPanel,u=t.canUseAvatarDecorations;if(null==i)return null;var f=u?(0,Ds.NZ)({userId:i.id,avatarDecoration:i.avatarDecoration,size:(0,hR.y)(c.EFr.SIZE_32)}):null;return(0,r.jsx)(fW.Z,{object:M.qAy.AVATAR,children:(0,r.jsx)(c.yRy,{renderPopout:this.renderStatusPickerPopout,position:"top",align:"left",animation:c.yRy.Animation.FADE,spacing:14,fixed:!0,preload:function(){return(0,mR.Z)(i.id,null==i?void 0:i.getAvatarURL(null,80))},children:function(t,u){var d;return(0,r.jsxs)(c.P3F,Cre(Are({},t),{"aria-label":Q.Z.Messages.SET_STATUS,className:lh()(gre().avatarWrapper,(d={},
Tre(d,gre().withTagAsButton,s),Tre(d,gre().withTagless,l),d)),children:[(0,r.jsx)(Dre,{size:c.EFr.SIZE_32,src:i.getAvatarURL(void 0,32,!1),avatarDecoration:f,"aria-label":i.username,status:o?M.Skl.STREAMING:a,isSpeaking:n,className:gre().avatar}),s||l?(0,r.jsx)("div",{className:lh()(gre().nameTag,Tre({},gre().canCopy,mre.wS)),children:l?(0,r.jsx)(hre.Z,{tooltipText:null,icon:u.isShown?cre.Z:BJ.Z,role:"switch","aria-label":Q.Z.Messages.SET_STATUS}):e.renderNameTag()}):null]}))}})})};i.renderNameZone=function(){var e=this,t=this.props,n=t.currentUser,o=t.dismissibleContents,i=this.props,a=i.showTagAsButton,s=i.showTaglessAccountPanel;return null==n?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(WN.Z,{contentTypes:o.avatar,children:function(t){t.visibleContent;return e.renderAvatarWithPopout()}}),a||s?null:this.renderCopiableNameTag()]})};i.render=function(){
var e=this,t=this.props,n=t.currentUser,o=t.selfDeaf,i=t.selfMute,a=t.awaitingRemote,s=t.serverMute,l=t.serverDeaf,u=t.suppress,f=t.dismissibleContents,d=this.state.shouldShowSpeakingWhileMutedTooltip;if(null==n)return null;var p=i||u||s,h=o||l;return(0,r.jsxs)("div",{className:gre().container,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,children:[this.renderNameZone(),(0,r.jsxs)(uh.Z,{grow:0,children:[(0,r.jsx)(hre.Z,{tooltipText:d?Q.Z.Messages.ACCOUNT_SPEAKING_WHILE_MUTED:(0,cne.Z)(i,s,u,a),tooltipColor:d?c.FGA.GREEN:void 0,tooltipForceOpen:d||void 0,onMouseEnter:this.handleMouseEnterMute,onMouseLeave:this.handleMouseLeaveMute,icon:p?pre.Z:dre.Z,iconForeground:p?gre().strikethrough:null,onClick:this.handleToggleSelfMute,innerClassName:lh()(Tre({},gre().redIcon,s||u)),onContextMenu:this.handleInputAudioContextMenu,role:"switch","aria-label":Q.Z.Messages.MUTE,"aria-checked":p,disabled:a}),(0,r.jsx)(hre.Z,{tooltipText:sne(o,l,a),icon:o?ure.Z:mk.Z,
onClick:this.handleToggleSelfDeaf,onContextMenu:this.handleOutputAudioContextMenu,innerClassName:lh()(Tre({},gre().redIcon,l)),iconForeground:h?gre().strikethrough:null,role:"switch","aria-label":Q.Z.Messages.DEAFEN,"aria-checked":h,disabled:a}),(0,r.jsx)(WN.Z,{contentTypes:f.settings,children:function(t){var o=t.visibleContent,i=t.markAsDismissed;switch(o){case ln.z$.USER_SAFETY_SAFE_DIRECT_MESSAGING:return(0,r.jsx)(c.yRy,{position:"top",align:"center",shouldShow:!0,renderPopout:function(){return(0,r.jsx)(ire,{markAsDismissed:i})},children:e.renderSettingsGear});case ln.z$.USER_SAFETY_CONSUMER_EDUCATION_BLOCK:return(0,r.jsx)(c.yRy,{position:"top",align:"center",shouldShow:!0,renderPopout:function(){return(0,r.jsx)(qne,{markAsDismissed:i})},children:e.renderSettingsGear});case ln.z$.USER_SAFETY_CONSUMER_EDUCATION_MUTE:return(0,r.jsx)(c.yRy,{position:"top",align:"center",shouldShow:!0,renderPopout:function(){return(0,r.jsx)($ne,{markAsDismissed:i})},children:e.renderSettingsGear})
;case ln.z$.AVATAR_DECORATIONS_SPRING_2023_FEATURE_EDUCATION_TOOLTIP:return(0,r.jsx)(c.yRy,{position:"top",align:"center",shouldShow:!0,renderPopout:function(){return(0,r.jsx)(one,{user:n})},children:e.renderSettingsGear});default:return e.renderSettingsGear()}}})]})]})};!function(e,t,n){t&&Sre(e.prototype,t);n&&Sre(e,n)}(o,[{key:"isCopiedStreakGodlike",get:function(){return this.state.copiedStreak>=10}}]);return o}(o.PureComponent);function Lre(){var e=(0,s.e7)([Y.default],(function(){return Y.default.getCurrentUser()})),t=(0,s.e7)([Jn.default],(function(){return Jn.default.getId()})),n=ct.Ok.useSetting(),i=o.useMemo((function(){return null!=n?(0,pne.Z)(n):null}),[n]),a=(0,s.cj)([Au.Z],(function(){return{streaming:null!=Au.Z.findActivity((function(e){return e.type===M.IIU.STREAMING})),status:Au.Z.getStatus()}})),l=a.streaming,u=a.status,f=(0,Xte.Z)({userId:t}),d=lp.ZP.useUserTag(e,{decoration:"never"}),p=(0,s.e7)([Lr.Z],(function(){return Lr.Z.hidePersonalInformation})),h=(0,
s.e7)([A.Z,S.Z],(function(){var e=A.Z.getChannelId();return null!=e?S.Z.getChannel(e):null})),E=(0,sre.Z)(h),y=E.mute,m=E.selfMute,b=E.suppress,g=are(h),O=g.selfDeaf,v=g.deaf,_=(0,s.e7)([ine.C],(function(){var e;return(0,ane.fD)()?null===(e=ine.C.getCurrentBuildOverride().overrides)||void 0===e?void 0:e.discord_web:null})),I=(0,s.e7)([s4.Z],(function(){return s4.Z.getPremiumTypeSubscription()})),N=(0,s.e7)([Ye.Z],(function(){return Ye.Z.getEverSpeakingWhileMuted()})),C=(0,s.e7)([T.Z],(function(){return T.Z.hasLayers()})),P=(0,c.s9z)(c.JQI)||C||Bi.s.isDisallowPopupsSet(),j=(0,ere.rW)(),R=(0,pR.U)(!0).canUseAvatarDecorations;o.useEffect((function(){Ene.trackExposure({})}));var x=(0,s.e7)([rm.Z],(function(){return null!=rm.Z.getAwaitingRemoteSessionInfo()})),w=Ene.useExperiment({}),D=w.isPopupEnabled,Z=w.isJoinedTagButtonEnabled,L=w.isTaglessAccountPanelEnabled,U=(0,hne.n)(),k=(0,qte.n)(),G=zne(),B=Kte.useExperiment({}).bucket,H={avatar:[],settings:[]};if(!P){
U&&k&&H.settings.push(ln.z$.USER_SAFETY_SAFE_DIRECT_MESSAGING);G&&(1===B?H.settings.push(ln.z$.USER_SAFETY_CONSUMER_EDUCATION_MUTE):H.settings.push(ln.z$.USER_SAFETY_CONSUMER_EDUCATION_BLOCK))}return(0,r.jsx)(Zre,{currentUser:e,customStatusActivity:i,dismissibleContents:H,userTag:d,hidePrivateData:p,inGlobalDisplayNameExperiment:j,occluded:P,premiumSubscription:I,selfDeaf:O,selfMute:m,serverDeaf:v,serverMute:y,showRichProfilePopup:D,showTagAsButton:Z,showTaglessAccountPanel:L,speaking:f,speakingWhileMuted:N,status:u,streaming:l,suppress:b,webBuildOverride:_,awaitingRemote:x,canUseAvatarDecorations:R})}var Ure=n(75529),kre=n(783072),Gre=n.n(kre);function Bre(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Hre(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Bre(i,r,o,a,s,"next",e)}function s(e){Bre(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Vre(e,t){
if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fre(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Yre(e){Yre=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Yre(e)}function zre(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Wre(e,t){return!t||"object"!==qre(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}
function Kre(e,t){Kre=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Kre(e,t)}var qre=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Xre(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Yre(e);if(t){var o=Yre(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Wre(this,n)}}var Qre=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,
r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},$re=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Kre(e,t)}(o,e);var t=Xre(o);function o(){Vre(this,o)
;return t.apply(this,arguments)}var i=o.prototype;i.handleContextMenu=function(e,t){(0,Ob.jW)(e,Hre((function(){var e,o;return Qre(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(49244),n.e(85572)]).then(n.bind(n,810848))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,zre(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Fre(e,t,n[t])}))}return e}({},e),{user:t}))}]}}))})))};i.renderUser=function(e){var t=this;return null==e?null:(0,r.jsxs)(uh.Z,{className:Gre().user,align:uh.Z.Align.CENTER,onContextMenu:function(n){null!=e&&t.handleContextMenu(n,e)},children:[(0,r.jsx)(c.qEK,{src:e.getAvatarURL(void 0,24),"aria-label":e.username,size:c.EFr.SIZE_24,className:Gre().avatar}),(0,
r.jsx)(UV.Z,{user:e,className:Gre().tag,usernameClass:Gre().username,discriminatorClass:Gre().discriminator})]},e.id)};i.render=function(){var e=this,t=this.props,n=t.party,o=t.header,i=n.map((function(t){return e.renderUser(t)}));return(0,r.jsxs)("div",{className:Gre().userList,children:[(0,r.jsx)("div",{className:Gre().header,children:o}),(0,r.jsx)(c.zJl,{className:Gre().content,fade:!0,children:i})]})};return o}(o.PureComponent);const Jre=$re;var eoe=n(811324),toe=n(294162),noe=n(697960),roe=n.n(noe);function ooe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ioe(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function aoe(e){aoe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return aoe(e)}function soe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){ioe(e,t,n[t])}))}return e}function coe(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function loe(e,t){return!t||"object"!==foe(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function uoe(e,t){uoe=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return uoe(e,t)}var foe=function(e){
return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function doe(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=aoe(e);if(t){var o=aoe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return loe(this,n)}}var poe=5,hoe=4,Eoe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&uoe(e,t)}(n,e);var t=doe(n);function n(){ooe(this,n);var e;(e=t.apply(this,arguments)).renderPartyMember=function(t,n){if(null==t)return null;var i,a=e.props,s=a.host,l=a.renderUserPopout,u=a.onUserContextMenu
;i=(null==s?void 0:s.id)===t.id?Q.Z.Messages.SPOTIFY_LISTEN_ALONG_HOST:Q.Z.Messages.SPOTIFY_LISTEN_ALONG_LISTENER;return(0,r.jsx)(c.yRy,{preload:function(){return(0,mR.Z)(t.id,t.getAvatarURL(void 0,80))},renderPopout:function(e){xh()(null!=t,"");return l(e,t)},position:"top",align:"center",children:function(e){return(0,r.jsx)(c.ua7,{text:i,children:function(r){var i=r.onMouseEnter,a=r.onMouseLeave;return(0,o.createElement)(c.qEK,coe(soe({},e),{key:t.id,src:t.getAvatarURL(void 0,24),size:c.EFr.SIZE_24,className:lh()(roe().avatar,n),"aria-label":t.username,onMouseEnter:i,onMouseLeave:a,onContextMenu:function(e){null!=t&&(null==u||u(e,t))}}))}})}},t.id)};e.renderPartyMemberOverflow=function(t,n,o){var i=e.props.renderOverflowPopout;return(0,r.jsx)(c.yRy,{renderPopout:i,children:function(e){return(0,r.jsx)(c.ua7,{text:Q.Z.Messages.SPOTIFY_LISTEN_ALONG_LISTENERS,children:function(o){return(0,r.jsx)("div",coe(soe({className:lh()(roe().overflow,n)},o,e),{children:t}))}})}},o)};return e}
var i=n.prototype;i.isHost=function(){var e=this.props,t=e.currentUser,n=e.host;return t.id===(null==n?void 0:n.id)};i.renderTitle=function(){return(0,r.jsxs)("div",{children:[(0,r.jsx)(yre.Z,{children:this.isHost()?Q.Z.Messages.SPOTIFY_LISTEN_ALONG_TITLE_HOST.format({count:this.props.party.length}):Q.Z.Messages.SPOTIFY_LISTEN_ALONG_TITLE_LISTENER}),(0,r.jsx)(Ere.Z,{children:Q.Z.Messages.SPOTIFY_LISTEN_ALONG_SUBTITLE_LISTENER})]})};i.renderStopListeningButton=function(){var e=this.props.onStopListening;return this.isHost()?null:(0,r.jsx)(hre.Z,{tooltipText:Q.Z.Messages.SPOTIFY_LISTEN_ALONG_STOP,onClick:e,icon:Ub.Z})};i.renderHelpIcon=function(){if(!this.isHost())return null;return(0,r.jsx)(hre.Z,{tooltipText:Q.Z.Messages.SPOTIFY_LISTEN_ALONG_INFO,onClick:function(){window.open(X.Z.getArticleURL(M.BhN.SPOTIFY_CONNECTION),"_blank")},icon:fre.Z})};i.render=function(){return(0,r.jsxs)("div",{className:roe().listeningAlong,children:[this.renderTitle(),(0,r.jsx)(uh.Z,{
justify:uh.Z.Justify.END,className:roe().party,children:(0,r.jsx)(toe.Z,{users:this.props.party,max:this.isHost()?poe:hoe,renderUser:this.renderPartyMember,renderMoreUsers:this.renderPartyMemberOverflow})}),(0,r.jsxs)("div",{className:roe().icons,children:[this.renderHelpIcon(),this.renderStopListeningButton()]})]})};return n}(o.PureComponent);const yoe=Eoe;function moe(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function boe(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){moe(i,r,o,a,s,"next",e)}function s(e){moe(i,r,o,a,s,"throw",e)}a(void 0)}))}}function goe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ooe(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function voe(e){voe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){
return e.__proto__||Object.getPrototypeOf(e)};return voe(e)}function _oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Ooe(e,t,n[t])}))}return e}function Ioe(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Soe(e,t){return!t||"object"!==Noe(t)&&"function"!=typeof t?function(e){
if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Toe(e,t){Toe=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Toe(e,t)}var Noe=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Aoe(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=voe(e);if(t){var o=voe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Soe(this,n)}}var Coe=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){
return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Poe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
;e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Toe(e,t)}(o,e);var t=Aoe(o);function o(){goe(this,o);var e;(e=t.apply(this,arguments)).handleUserContextMenu=function(e,t){(0,Ob.jW)(e,boe((function(){var e,o;return Coe(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(49244),n.e(85572)]).then(n.bind(n,810848))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,Ioe(_oe({},e),{user:t}))}]}}))})))};e.renderOverflowPopout=function(){var t=e.props.party;return(0,r.jsx)(Jre,{party:t,header:Q.Z.Messages.SPOTIFY_LISTEN_ALONG_LISTENING_ALONG_COUNT.format({count:t.length})})};return e}var i=o.prototype;i.hasParty=function(e){return e.length>1};i.handleStopListening=function(){(0,eoe.Z)()};i.renderUserPopout=function(e,t){return(0,r.jsx)(yk.Z,Ioe(_oe({},e),{userId:t.id}))};i.render=function(){var e=this.props,t=e.currentUser,n=e.host,o=e.party;return this.hasParty(o)&&null!=t?(0,r.jsx)(yoe,{
currentUser:t,host:n,party:o,renderUserPopout:this.renderUserPopout,renderOverflowPopout:this.renderOverflowPopout,onStopListening:this.handleStopListening,onUserContextMenu:this.handleUserContextMenu}):null};return o}(o.PureComponent);const joe=s.ZP.connectStores([$q.Z,Y.default,Ja.Z,UW.Z],(function(){var e,t,n=$q.Z.getSyncingWith(),r=$q.Z.getActivity(),o=Y.default.getCurrentUser(),i=[];if(null!=n){e=Y.default.getUser(n.userId);t=n.partyId}else if(null!=r&&null!=r.party&&null!=r.party.id){e=o;t=r.party.id}if(null!=t){var a;i=Wa()(Array.from(null!==(a=UW.Z.getParty(t))&&void 0!==a?a:[])).map((function(e){return Y.default.getUser(e)})).filter(_o.lm).orderBy([function(t){return null==e||e.id===t.id},function(e){return Ja.Z.isFriend(e.id)}],["desc","desc"]).value()}return{currentUser:o,host:e,party:i}}))(Poe);var Roe,xoe,Moe=n(216151),woe=n(946767),Doe=n(976010),Zoe=[(Roe="Watch Together",xoe="2021-09_watch_together_rollout",(0,tc.B)({kind:"guild",id:xoe,
label:"Exposure tracking for ".concat(Roe," (do not override)"),defaultConfig:{},treatments:[]}))];var Loe=n(555086),Uoe=n(22664),koe=n(59732),Goe=n(436771),Boe=n(948243),Hoe=n(496388),Voe=n(122590),Foe=n(423871),Yoe=n(484802),zoe=n(550677),Woe=n(397897),Koe=n.n(Woe);function qoe(e){var t=e.platform;return t===zoe.YE.XBOX?(0,r.jsx)(HK.Z,{className:Koe().icon}):t===zoe.YE.PLAYSTATION?(0,r.jsx)(Foe.Z,{className:Koe().icon}):null}function Xoe(e){var t,n=e.voiceState,o=e.awaitingRemoteSessionInfo,i=null!=o?(0,Yoe.y)(o.type):null,a=(0,s.e7)([Gd.Z],(function(){var e;return null===(e=Gd.Z.getSessionById(null!==(t=null==n?void 0:n.sessionId)&&void 0!==t?t:""))||void 0===e?void 0:e.clientInfo.os})),l=null!=i?i:a;if(null==l||!zoe.al.has(l))return null;var u=null!=o,f=u?l===zoe.YE.XBOX?Q.Z.Messages.XBOX_TRANSFERRING_ELLIPSIS:Q.Z.Messages.PLAYSTATION_TRANSFERRING_ELLIPSIS:l===zoe.YE.XBOX?Q.Z.Messages.XBOX_REMOTE_CONNECTED.format():Q.Z.Messages.PLAYSTATION_REMOTE_CONNECTED.format();return(0,
r.jsxs)("div",{className:lh()(Koe().root,u?Koe().connecting:Koe().connected),children:[(0,r.jsx)(qoe,{platform:l}),(0,r.jsx)(c.xvT,{color:u?"header-primary":"always-white",variant:"text-xs/medium",children:f})]})}var Qoe=n(371607),$oe=n(113865),Joe=n(203158),eie=n(641429),tie=n(261258),nie=n.n(tie);function rie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function oie(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function iie(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){oie(i,r,o,a,s,"next",e)}function s(e){oie(i,r,o,a,s,"throw",e)}a(void 0)}))}}function aie(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function sie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){aie(e,t,n[t])}))}return e}function cie(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function lie(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r]
;t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function uie(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return rie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rie(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var fie=function(e,t){
var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1]
;return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function die(e){var t=function(e){null==e||e();v()},i=function(e){null!=b&&(0,Ob.jW)(e,iie((function(){var e,t;return fie(this,(function(o){switch(o.label){case 0:return[4,n.e(56674).then(n.bind(n,656674))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,sie({guildId:b},e))}]}}))})))},a=e.channel,s=e.iconClassName,l=lie(e,["channel","iconClassName"]),u=(0,dE.ZP)([Y.default],(function(){return Y.default.getCurrentUser()})),f=(0,sre.Z)(a),d=f.mute,p=f.suppress,h=(0,dE.ZP)([Ye.Z],(function(){return Ye.Z.isDeaf()})),E=uie(o.useState(!1),2),y=E[0],m=E[1],b=a.getGuildId(),g=uie((0,$oe.c)([ln.z$.SOUNDBOARD_EDUCATION]),2),O=g[0],v=g[1],_=(0,Hw.Z)(Pf.Z.SOUNDBOARD_BUTTON).AnalyticsLocationProvider,I=Zh().v4();if(null==b)return null;var S=function(e){return(0,r.jsx)(c.yRy,{shouldShow:y,position:"top",onRequestClose:function(){return m(!1)},renderPopout:function(e){var t=e.closePopout;return(0,r.jsx)(eie.Z,{guildId:b,
onClose:t,analyticsSource:"rtc panel"})},children:function(n){return(0,r.jsx)("div",{children:(0,r.jsx)(c.zxk,cie(sie(cie(sie({},e,n),{disabled:d||p||h,onClick:function(){var n;t();null==e||null===(n=e.onClick)||void 0===n||n.call(e);m(!y)},onContextMenu:i,fullWidth:!0,size:c.zxk.Sizes.SMALL}),l),{children:(0,r.jsx)(Joe.Z,{className:s})}))})}})};return O===ln.z$.SOUNDBOARD_EDUCATION&&(0,lp.Fc)(u)?(0,r.jsx)(c.yRy,{positionKey:I,position:"top",align:"center",shouldShow:!0,renderPopout:function(e){var n=e.closePopout;return(0,r.jsx)(tne,{header:Q.Z.Messages.SOUNDBOARD_NEW_FEATURE_TOOLTIP_HEADER,body:Q.Z.Messages.SOUNDBOARD_NEW_FEATURE_TOOLTIP_BODY.format(),tryItText:Q.Z.Messages.SOUNDBOARD_NEW_FEATURE_TOOLTIP_TRY_IT_OUT,dismissibleContent:ln.z$.SOUNDBOARD_EDUCATION,artClassName:nie().headerArt,onTryFeature:function(){m(!0);t(n)},onClose:function(){return t(n)},shouldUseHorizontalButtons:!0,inlineArt:!0})},children:function(){return S()}}):(0,r.jsx)(_,{children:(0,r.jsx)(c.ua7,{
text:d?Q.Z.Messages.SOUNDBOARD_OPEN_SOUNDBOARD_ERROR_GUILD_MUTE:p?Q.Z.Messages.SOUNDBOARD_OPEN_SOUNDBOARD_ERROR_SUPPRESSED:h?Q.Z.Messages.SOUNDBOARD_OPEN_SOUNBOARRD_ERROR_DEAFENED:Q.Z.Messages.SOUNDBOARD_OPEN_SOUNDBOARD,children:function(e){return S(e)}})})}var pie=n(713717),hie=n(672522),Eie=n(137390),yie=n(130166),mie=n(199047),bie=n(708258),gie=n(259099),Oie=n(740106),vie=n(289261),_ie=n(665435),Iie=n(537077),Sie=n(904333),Tie=n(759864),Nie=n(542231);function Aie(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Cie(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Pie(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function jie(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=Pie(e,["width","height","color","foreground"]);return(0,r.jsxs)("svg",Cie(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Aie(e,t,n[t])}))}return e}({},(0,
OO.Z)(l)),{width:n,height:i,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{className:c,d:"M10.889 4C10.889 3.44772 11.3367 3 11.889 3H12.1112C12.6635 3 13.1112 3.44772 13.1112 4V20C13.1112 20.5523 12.6635 21 12.1112 21H11.889C11.3367 21 10.889 20.5523 10.889 20V4Z",fill:s}),(0,r.jsx)("path",{className:c,d:"M6.44439 6.25C6.44439 5.69772 6.89211 5.25 7.44439 5.25H7.66661C8.2189 5.25 8.66661 5.69772 8.66661 6.25V17.75C8.66661 18.3023 8.2189 18.75 7.66661 18.75H7.44439C6.89211 18.75 6.44439 18.3023 6.44439 17.75V6.25Z",fill:s}),(0,r.jsx)("path",{className:c,d:"M3.22222 15.375C3.77451 15.375 4.22222 14.9273 4.22222 14.375L4.22222 9.625C4.22222 9.07272 3.77451 8.625 3.22222 8.625H3C2.44772 8.625 2 9.07272 2 9.625V14.375C2 14.9273 2.44772 15.375 3 15.375H3.22222Z",fill:s}),(0,r.jsx)("path",{className:c,
d:"M22.0001 13.25C22.0001 13.8023 21.5523 14.25 21.0001 14.25H20.7778C20.2255 14.25 19.7778 13.8023 19.7778 13.25V10.75C19.7778 10.1977 20.2255 9.75 20.7778 9.75H21.0001C21.5523 9.75 22.0001 10.1977 22.0001 10.75V13.25Z",fill:s}),(0,r.jsx)("path",{className:c,d:"M16.3333 7.5C15.781 7.5 15.3333 7.94772 15.3333 8.5V15.5C15.3333 16.0523 15.781 16.5 16.3333 16.5H16.5555C17.1078 16.5 17.5555 16.0523 17.5555 15.5V8.5C17.5555 7.94772 17.1078 7.5 16.5555 7.5H16.3333Z",fill:s})]}))}function Rie(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function xie(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Mie(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function wie(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=Mie(e,["width","height","color","foreground"]);return(0,r.jsxs)("svg",xie(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Rie(e,t,n[t])}))}return e}({},(0,
OO.Z)(l)),{width:n,height:i,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M30.6666 24.9644L35.1111 20.5199V31C35.1111 32.1046 34.2156 33 33.1111 33H32.6666C31.562 33 30.6666 32.1046 30.6666 31V24.9644Z",fill:s}),(0,r.jsx)("path",{d:"M26.2224 14.1463V8C26.2224 6.89543 25.327 6 24.2224 6H23.7779C22.6734 6 21.7779 6.89543 21.7779 8V18.5907L26.2224 14.1463Z",fill:s}),(0,r.jsx)("path",{d:"M21.7779 33.8543L21.9254 33.7056L26.2224 29.4086V40C26.2224 41.1046 25.327 42 24.2224 42H23.7779C22.6734 42 21.7779 41.1046 21.7779 40V33.8543Z",fill:s}),(0,r.jsx)("path",{d:"M17.3332 23.0354L12.8888 27.4799V12.5C12.8888 11.3954 13.7842 10.5 14.8888 10.5H15.3332C16.4378 10.5 17.3332 11.3954 17.3332 12.5V23.0354Z",fill:s}),(0,r.jsx)("path",{d:"M8.44445 28.75C8.44445 29.8546 7.54902 30.75 6.44445 30.75H6C4.89543 30.75 4 29.8546 4 28.75V19.25C4 18.1454 4.89543 17.25 6 17.25H6.44445C7.54902 17.25 8.44445 18.1454 8.44445 19.25L8.44445 28.75Z",fill:s}),(0,
r.jsx)("path",{d:"M44.0001 26.5C44.0001 27.6046 43.1047 28.5 42.0001 28.5H41.5557C40.4511 28.5 39.5557 27.6046 39.5557 26.5V21.5C39.5557 20.3954 40.4511 19.5 41.5557 19.5H42.0001C43.1047 19.5 44.0001 20.3954 44.0001 21.5V26.5Z",fill:s}),(0,r.jsx)("path",{d:"M42 8.54L39.46 6L6 39.46L8.54 42L16.92 33.64L19.38 31.16L22.7 27.84L29.98 20.56L42 8.54Z",fill:s,className:c})]}))}var Die=n(108206),Zie=n(235606),Lie=n(161482),Uie=n(102770),kie=n(39732),Gie=n(877116),Bie=n(636246),Hie=n(519718),Vie=n(419348);function Fie(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Yie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Fie(e,t,n[t])}))}return e}function zie(e){var t=e.channel;return(0,
r.jsx)(hre.Z,{tooltipText:Q.Z.Messages.AUDIENCE_DISCONNECT,onClick:function(){(0,Hie.Z)(t)?(0,Bie.Us)(t):d.default.disconnect()},icon:Vie.Z})}function Wie(e){var t=e.channel,n=(0,kie.c)({channelId:t.id,shouldDisconnectCall:!0});return(0,r.jsx)(hre.Z,{tooltipText:Q.Z.Messages.DISCONNECT_SELF,onClick:function(){n()||((0,Gie.Z)(t)?(0,dr.lC)(t):d.default.disconnect())},icon:Vie.Z})}function Kie(e){return e.channel.isGuildStageVoice()?(0,r.jsx)(zie,Yie({},e)):(0,r.jsx)(Wie,Yie({},e))}var qie=n(895462),Xie=n(839184),Qie=n(933850),$ie=n(462360),Jie=n(69540),eae=n(249090),tae=n.n(eae);function nae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rae(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function oae(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){rae(i,r,o,a,s,"next",e)}function s(e){rae(i,r,o,a,s,"throw",e)}
a(void 0)}))}}function iae(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function aae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){iae(e,t,n[t])}))}return e}function sae(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function cae(e,t){return function(e){if(Array.isArray(e))return e
}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nae(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var lae=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},
"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},uae={offset:2},fae={serverDeaf:{icon:ure.Z,colorize:!0,getStatus:function(){
return Q.Z.Messages.SERVER_DEAFENED}},serverMute:{icon:pre.Z,colorize:!0,getStatus:function(){return Q.Z.Messages.SERVER_MUTED}},deaf:{icon:ure.Z,colorize:!1,getStatus:function(){return Q.Z.Messages.VOICE_CHANNEL_DEAFENED}},mute:{icon:pre.Z,colorize:!1,getStatus:function(){return Q.Z.Messages.VOICE_CHANNEL_MUTED}}};function dae(e){var t,o,i=function(e){null!=m?(0,Ob.jW)(e,oae((function(){var e,t;return lae(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(49244),n.e(3454),n.e(14136)]).then(n.bind(n,914136))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,sae(aae({},e),{user:l,guildId:m,channel:a,showMediaItems:!0}))}]}}))}))):(0,Ob.jW)(e,oae((function(){var e,t;return lae(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(49244),n.e(85572)]).then(n.bind(n,810848))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,sae(aae({},e),{user:l,showMediaItems:!0}))}]}}))})))
},a=e.channel,l=e.user,u=e.nick,f=e.mute,d=e.deaf,p=e.serverMute,h=e.serverDeaf,E=(0,s.e7)([Ye.Z],(function(){return Ye.Z.isLocalMute(l.id)})),y=(0,Xte.Z)({userId:l.id,checkSoundSharing:!0}),m=null!==(t=a.getGuildId())&&void 0!==t?t:void 0,b=l.getAvatarURL(a.guild_id,24),g=null!=u?u:l.username,O=null!==(o=h?fae.serverDeaf:d?fae.deaf:p?fae.serverMute:f||E?fae.mute:void 0)&&void 0!==o?o:{},v=O.icon,_=O.colorize,I=O.getStatus,S=null!=I?Q.Z.Messages.VOICE_PANEL_USER_TOOLTIP.format({userName:g,status:I()}):g;return(0,r.jsx)(c.yRy,{preload:function(){return(0,mR.Z)(l.id,l.getAvatarURL(m,80),{guildId:m,channelId:a.id})},position:"top",renderPopout:function(e){return(0,r.jsx)(yk.Z,aae({userId:l.id,guildId:m,channelId:a.id},e))},children:function(e){return(0,r.jsx)(c.ua7,{text:S,children:function(t){return(0,r.jsx)(c.P3F,sae(aae({},t,e),{className:tae().avatarContainer,onContextMenu:i,focusProps:uae,children:(0,r.jsx)(qie.Z,{shakeLocation:Jie.oZ.VOICE_USER,isShaking:y,children:(0,r.jsx)("div",{
className:lh()(tae().avatar,iae({},tae().speaking,y)),style:{backgroundImage:"url(".concat(b,")")},children:null!=v?(0,r.jsx)(v,{className:lh()(tae().avatarIconOverlay,iae({},tae().avatarIconRed,_)),width:16,height:16,foreground:tae().avatarIconRed}):null})})}))}})}})}function pae(e){var t=e.voiceStates,n=e.channel,i=e.className,a=cae(o.useState(!1),2),l=a[0],u=a[1],f=l?$ie.Z:Qie.Z,d=(0,r.jsx)(Xie.ZP,{className:tae().expandButton,onClick:function(){return u(!l)},color:Xie.YX.PRIMARY,size:Xie.tT.SIZE_24,tooltip:l?Q.Z.Messages.VOICE_PANEL_HIDE_EXTRAS:Q.Z.Messages.VOICE_PANEL_SHOW_EXTRAS,icon:(0,r.jsx)(f,{width:16,height:16}),focusProps:uae}),p=(0,s.e7)([Jn.default],(function(){return Jn.default.getId()}),[]),h=cae(function(e,t){var n,r=[],o=!0,i=!1,a=void 0;try{for(var s,c=function(){var e=s.value;if(e.user.id===t)return"continue";if(r.some((function(t){return t.user.id===e.user.id})))return"continue";if(r.length>=7)return{v:[r,!0]};r.push(e)
},l=e[Symbol.iterator]();!(o=(s=l.next()).done);o=!0){var u=c();if("object"==((n=u)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n))return u.v}}catch(e){i=!0;a=e}finally{try{o||null==l.return||l.return()}finally{if(i)throw a}}return[r,!1]}(t,p),2),E=h[0],y=h[1],m=y&&l?t:E;return m.length<=0?null:(0,r.jsx)(c.zJl,{className:lh()(tae().scroller,i),fade:!0,children:(0,r.jsxs)("div",{className:tae().voiceUsers,role:"group","aria-label":Q.Z.Messages.VOICE_PANEL_USERS_A11Y_LABEL,children:[m.map((function(e){var t=e.user,o=e.nick,i=e.voiceState;return t.id!==p?(0,r.jsx)(dae,{channel:n,user:t,nick:o,mute:i.isVoiceMuted(),deaf:i.isVoiceDeafened(),video:i.selfVideo,serverMute:i.mute,serverDeaf:i.deaf},t.id):null})),y?d:null]})})}var hae=n(58005),Eae=n.n(hae);function yae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mae(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}
s.done?t(c):Promise.resolve(c).then(r,o)}function bae(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){mae(i,r,o,a,s,"next",e)}function s(e){mae(i,r,o,a,s,"throw",e)}a(void 0)}))}}function gae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oae(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function vae(e){vae=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return vae(e)}function _ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Oae(e,t,n[t])}))}return e}function Iae(e,t){t=null!=t?t:{}
;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Sae(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function Tae(e,t){return!t||"object"!==Cae(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}
function Nae(e,t){Nae=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Nae(e,t)}function Aae(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yae(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Cae=function(e){
return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Pae(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=vae(e);if(t){var o=vae(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Tae(this,n)}}var jae=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,
o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Rae(e){var t=e.currentTarget;Ie.default.track(M.rMx.NOISE_CANCELLATION_LINK_CLICKED,{text:t.text,href:t.href,location:{section:M.jXE.NOISE_CANCELLATION_POPOUT}})}function xae(){var e=o.useRef(null);(0,c.Tbt)(e);o.useEffect((function(){return Ie.default.track(M.rMx.OPEN_POPOUT,{type:M.jXE.NOISE_CANCELLATION_POPOUT})}),[]);var t=(0,s.e7)([Ye.Z],(function(){return Ye.Z.getNoiseCancellation()
}));return(0,r.jsxs)("div",{ref:e,className:Eae().noiseCancellationPopout,children:[(0,r.jsx)(c.j7V,{hideBorder:!0,className:gh().marginBottom4,value:t,onChange:function(){return Fe.Z.setNoiseCancellation(!t,{section:M.jXE.NOISE_CANCELLATION_POPOUT})},note:Q.Z.Messages.NOISE_CANCELLATION_POPOUT_DESCRIPTION,children:Q.Z.Messages.NOISE_CANCELLATION_POPOUT_HEADER}),(0,r.jsx)(woe.Z,{title:Q.Z.Messages.NOISE_CANCELLATION_POPOUT_MIC_TEST_TITLE,notchBackground:woe._.BLACK,buttonTest:Q.Z.Messages.NOISE_CANCELLATION_POPOUT_TEST,buttonStop:Q.Z.Messages.NOISE_CANCELLATION_POPOUT_STOP,buttonClassName:Eae().micTestButton,buttonColor:c.zxk.Colors.PRIMARY,location:{section:M.jXE.NOISE_CANCELLATION_POPOUT}}),(0,r.jsx)(c.vwX,{tag:c.RB0.H5,className:lh()(gh().marginBottom8,gh().marginTop20),children:Q.Z.Messages.NOISE_CANCELLATION_POPOUT_FOOTER}),(0,r.jsxs)(uh.Z,{justify:uh.Z.Justify.BETWEEN,className:Eae().footer,children:[(0,r.jsx)(c.eee,{href:M.EYA.KRISP,onClick:function(e){return Rae(e)},
children:(0,r.jsx)("div",{className:Eae().krispLogo})}),(0,r.jsx)(c.eee,{href:X.Z.getArticleURL(M.BhN.NOISE_SUPPRESSION),className:Eae().krispLink,onClick:function(e){return Rae(e)},children:Q.Z.Messages.LEARN_MORE})]})]})}function Mae(){var e=(0,s.e7)([yie.Z],(function(){return yie.Z.isMuted()})),t=e?Q.Z.Messages.STAGE_MUSIC_UNMUTE:Q.Z.Messages.STAGE_MUSIC_MUTE;return(0,r.jsx)(hre.Z,{"aria-label":t,tooltipText:t,icon:e?Uie.Z:Lie.Z,onClick:function(){return(0,hie.v)(!e)}})}function wae(e){var t=e.channel,n=e.enableActivities,i=e.disabled,a=(0,mie.Z)(),l=(0,gie.Z)(t),u=t.getGuildId(),f=(0,s.cj)([R.ZP],(function(){return null!=R.ZP.getSelfEmbeddedActivityForChannel(t.id)})),d=JL.ZP.useExperiment({guildId:null!=u?u:""}).allowSoundboard,p=(0,bie.Z)(t),h=p.reachedLimit,E=p.limit,y=o.useCallback((function(){(0,vie.Z)()}),[]),m=(0,uL.bp)(),b=o.useCallback((function(e){if(Ye.Z.isVideoEnabled()!==e){var n=function(){Fe.Z.setVideoEnabled(e);if(e){var n;(0,
K.uL)(M.Z5c.CHANNEL(null!==(n=t.getGuildId())&&void 0!==n?n:M.ME,t.id))}};e?(0,Sie.Z)(n,m):n()}}),[t,m]),g=f||n||d,O=(0,r.jsx)(Nie.Z,{className:lh()(Eae().buttonIcon,Oae({},Eae().withText,!g))});return(0,r.jsx)(Tie.Z,Iae(_ae({onChange:b,onCameraUnavailable:y,hasPermission:l,channelLimit:E,channelLimitReached:h},a),{enabled:!i&&a.enabled,children:function(e){var t=e.unavailable,n=e.active,o=e.label,i=(e.iconComponent,Sae(e,["unavailable","active","label","iconComponent"]));return(0,r.jsx)(c.yRy,{renderPopout:function(e){var t=e.closePopout;return(0,r.jsx)(Hoe.Z,{onClose:t})},position:"top",align:"center",animation:c.yRy.Animation.FADE,children:function(e,a){var s=e.onClick,l=Sae(e,["onClick"]),u=a.isShown;return(0,r.jsx)(c.ua7,{text:o,children:function(e){var o;return(0,r.jsx)(c.zxk,Iae(_ae({},i,e,l),{onClick:function(t){var n;i.onClick(t);null===(n=e.onClick)||void 0===n||n.call(e);u&&s(t)},onContextMenu:function(t){var n;s(t);null===(n=e.onContextMenu)||void 0===n||n.call(e)},
size:c.zxk.Sizes.SMALL,className:lh()(Eae().button,Eae().buttonColor,(o={},Oae(o,Eae().buttonActive,n),Oae(o,Eae().fauxDisabled,t),Oae(o,Eae().disabled,i.disabled),o)),innerClassName:Eae().buttonContents,wrapperClassName:Eae().button,fullWidth:!0,children:g?O:(0,r.jsxs)(uh.Z,{align:uh.Z.Align.CENTER,children:[O,Q.Z.Messages.VIDEO]})}))}})}})}}))}function Dae(e){var t=e.channel,n=e.enableActivities,i=(0,uL.bp)(),a=(0,Hw.Z)().analyticsLocations,l=i===M.IlC.POPOUT,u=(0,s.e7)([ys.Z],(function(){return ys.Z.getIsEnabled()}),[]);!function(e){o.useEffect((function(){null!=e&&Zoe.forEach((function(t){t.trackExposure({guildId:e})}))}),[e])}(t.getGuildId());var f=(0,koe.KF)(t.id),d=(0,koe.g5)(f),p=Aae((0,s.e7)([R.ZP],(function(){return null!=t.id&&""!==t.id?R.ZP.getEmbeddedActivitiesForChannel(t.id):R.i6})),1)[0],h=(0,s.cj)([R.ZP],(function(){return{userInActivity:null!=R.ZP.getSelfEmbeddedActivityForChannel(t.id)}})).userInActivity,E=(0,PK.O)(),y=(0,Uoe.a)({}),m=f!==koe.jy.CAN_LAUNCH
;return n?(0,r.jsx)(c.ua7,{text:d,children:function(e){var n;return(0,r.jsxs)(c.zxk,Iae(_ae({},e),{fullWidth:!0,size:c.zxk.Sizes.SMALL,onClick:function(){var n;(0,dL.Z)({channel:t,guildId:t.guild_id,locationObject:E.location,openInPopout:l,analyticsLocations:a});null===(n=e.onClick)||void 0===n||n.call(e)},disabled:m,className:lh()(Eae().button,Eae().buttonColor,(n={},Oae(n,Eae().buttonDeveloperActivityShelf,u),Oae(n,Eae().buttonActive,h||null!=p),Oae(n,Eae().disabled,m),n)),innerClassName:Eae().buttonContents,wrapperClassName:Eae().button,children:[y?(0,r.jsx)(Boe.A,{top:-1,right:-1}):null,(0,r.jsx)(Die.Z,{className:Eae().buttonIcon})]}))}}):null}function Zae(e){var t,n=e.channel,i=e.canGoLive,a=e.enableActivities,l=e.disabled,u=(0,s.e7)([Y.default],(function(){return Y.default.getCurrentUser()})),f=(0,s.Wu)([Pr.Z],(function(){return Pr.Z.getAllActiveStreams()})),d=(0,gie.Z)(n),p=n.getGuildId(),h=(0,s.cj)([R.ZP],(function(){return null!=R.ZP.getSelfEmbeddedActivityForChannel(n.id)
})),E=JL.ZP.useExperiment({guildId:null!=p?p:""}).allowSoundboard,y=o.useCallback((function(){(0,Iie.Z)(p,n.id,M.jXE.ACTIVITY_PANEL)}),[p,n.id]),m=f.find((function(e){return e.ownerId===(null==u?void 0:u.id)})),b=(0,Oie.E)(n,u,f);t=null==m?i?y:_ie.Z:function(){return(0,Qoe.Z)(m)};var g=null!=m||b.length>0,O=d?Q.Z.Messages.SHARE_YOUR_SCREEN:Q.Z.Messages.ACTIVITY_PANEL_GO_LIVE_TOOLTIP_NO_PERMISSION_IN_VOICE,v=h||a||E,_=(0,r.jsx)(Zie.Z,{className:lh()(Eae().buttonIcon,Oae({},Eae().withText,!v))});return(0,r.jsx)(c.yRy,{renderPopout:function(e){var t=e.closePopout;return(0,r.jsx)(Oie.Z,{channel:n,currentUser:u,activeStreams:f,onClose:t,handleGoLive:i?y:_ie.Z})},position:"top",align:"center",animation:c.yRy.Animation.FADE,children:function(e){var n=e.onClick,o=Sae(e,["onClick"]);return(0,r.jsx)(c.ua7,{text:O,children:function(e){var i;return(0,r.jsx)(c.zxk,Iae(_ae(Iae(_ae({},e),{size:c.zxk.Sizes.SMALL,onClick:function(r){var o;g?n(r):t();null===(o=e.onClick)||void 0===o||o.call(e)},
disabled:!d||l,className:lh()(Eae().button,Eae().buttonColor,(i={},Oae(i,Eae().buttonActive,null!=m),Oae(i,Eae().disabled,!d||l),i))}),g?o:null),{innerClassName:Eae().buttonContents,wrapperClassName:Eae().button,children:v?_:(0,r.jsxs)(uh.Z,{align:uh.Z.Align.CENTER,children:[_,Q.Z.Messages.GO_LIVE_SHARE_SCREEN]})}))}})}})}var Lae=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Nae(e,t)}(o,e);var t=Pae(o);function o(){gae(this,o);var e;(e=t.apply(this,arguments)).canScreenshare=function(){var t=e.props,n=t.channel;return t.canGoLive&&null!=n&&null!=n.getGuildId()};e.handleNoiseCancellationClicked=function(){var t=e.props.noiseCancellationActive;Fe.Z.setNoiseCancellation(!t,{section:M.jXE.NOISE_CANCELLATION_POPOUT})};e.handleGoLive=function(){
var t=e.props,n=t.guild,r=t.channel,o=null!=r?r.getGuildId():null!=n?n.id:null;null!=o&&(0,Iie.Z)(o,r.id,M.Sbl.VOICE_PANEL)};e.handleChannelLinkClick=function(t){var n,r=e.props,o=r.guild,i=r.channel;xh()(null!=i,"Channel is null during navigation click");t.stopPropagation();Moe.Z.channelListScrollTo(null!==(n=null==o?void 0:o.id)&&void 0!==n?n:M.ME,i.id)};e.handleChannelLinkContextMenu=function(t){var o=e.props.channel;(0,Ob.jW)(t,bae((function(){var e,t;return jae(this,(function(i){switch(i.label){case 0:return[4,n.e(1048).then(n.bind(n,101048))];case 1:e=i.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Iae(_ae({},e),{channel:o}))}]}}))})))};e.handleCloseVoicePanelIntroduction=function(){Or.Kw(vr.v.VOICE_PANEL_INTRODUCTION)};e.renderVoicePanelIntroduction=function(){return(0,r.jsxs)("div",{className:lh()(Eae().voicePanelIntroductionWrapper,"theme-light"),children:[(0,r.jsx)(c.X6q,{className:Eae().voicePanelIntroductionHeader,variant:"heading-md/semibold",
children:Q.Z.Messages.VOICE_PANEL_INTRODUCTION_HEADER}),(0,r.jsx)(c.xvT,{className:Eae().voicePanelIntroductionText,variant:"text-sm/normal",children:Q.Z.Messages.VOICE_PANEL_INTRODUCTION_TEXT}),(0,r.jsx)(c.zxk,{className:Eae().voicePanelIntroductionButton,color:c.zxk.Colors.BRAND,onClick:e.handleCloseVoicePanelIntroduction,children:Q.Z.Messages.VOICE_PANEL_INTRODUCTION_CLOSE})]})};return e}var i=o.prototype;i.renderConnectionStatus=function(){var e=this.props,t=e.channel,n=e.guild,o=e.rtcConnectionQuality,i=e.rtcConnectionState,a=e.rtcConnectionLastPing,s=e.hasVideo;if(null==t)return null;var l,u=(0,op.F6)(t,Y.default,Ja.Z,!0);if(null!=n){l=M.Z5c.CHANNEL(n.id,t.id);u="".concat(u," / ").concat(n.name)}else l=M.Z5c.CHANNEL(M.ME,t.id);return(0,r.jsx)(Doe.Z,{statusTextClassName:Eae().statusWithPopout,quality:o,state:i,lastPing:a,hasVideo:s,children:(0,r.jsx)(c.tEY,{children:(0,r.jsx)(a1.rU,{to:l,onClick:this.handleChannelLinkClick,onContextMenu:this.handleChannelLinkContextMenu,
children:(0,r.jsx)(Ere.Z,{className:Eae().channel,children:u})})})})};i.renderNoiseCancellation=function(){var e=this.props,t=e.noiseCancellationActive,n=e.noiseCancellationError,o=e.hasLayers,i=e.remoteVoiceState,a=e.channel,s=e.voiceStates,l=!o&&n;if(null!=i)return null;if(null==a?void 0:a.isGuildStageVoice()){if(!(null!=s.find((function(e){return e.user.id===Jn.default.getId()&&(0,Rd.gf)(e.voiceState)===Rd.xO.ON_STAGE})))&&(0,Eie.U5)(a.id))return(0,r.jsx)(Mae,{})}return l?(0,r.jsx)(c.ua7,{text:Q.Z.Messages.NOISE_CANCELLATION_CPU_OVERUSE,tooltipClassName:Eae().noiseCancellationTooltip,forceOpen:!0,children:function(e){var t=e["aria-label"];return(0,r.jsx)(hre.Z,{"aria-label":t,tooltipText:null,disabled:!0,icon:wie})}}):(0,r.jsx)(c.yRy,{position:"top",align:"center",renderPopout:function(){return(0,r.jsx)(xae,{})},children:function(e,n){var o=n.isShown;return(0,r.jsx)(hre.Z,Iae(_ae({},e),{tooltipClassName:Eae().noiseCancellationTooltip,
tooltipText:o?null:Q.Z.Messages.NOISE_CANCELLATION_TOOLTIP,icon:t?jie:wie}))}},"krisp-popout")};i.renderVoiceStates=function(){var e=this.props,t=e.channel,n=e.voiceStates,o=e.showVoiceStates;return null!=t&&o&&0!==n.length?(0,r.jsx)(pae,{voiceStates:n,channel:t,className:Eae().voiceUsers}):null};i.renderChannelButtons=function(){var e=this.props,t=e.channel,n=e.canGoLive,o=e.canUseSoundboard,i=e.remoteVoiceState,a=e.enableActivities,s=e.voiceStates,c=e.selfStream,l=e.isPrivateChannelWithEnabledActivities;if(null==t||null!=i)return null;var u=Jn.default.getId();if(t.isGuildStageVoice()){if(!(0,pie.tu)(t.guild_id))return null;if(!n)return null;var f=s.find((function(e){return e.user.id===u}));if(null==f||f.voiceState.suppress)return null}var d=(t.isGuildVoice()||l)&&a,p=(0,bie.t)(t).reachedLimit,h=(0,pie.xJ)(t.id);return(0,r.jsxs)("div",{className:Eae().actionButtons,children:[(0,r.jsx)(wae,{channel:t,enableActivities:d,disabled:!h&&p}),(0,r.jsx)(Zae,{channel:t,canGoLive:n,
enableActivities:d,disabled:t.isGuildStageVoice()&&(h&&null==c||!h&&p)}),(0,r.jsxs)(r.Fragment,{children:[d?(0,r.jsx)(Dae,{channel:t,enableActivities:a}):null,t.isGuildVoice()&&o&&(0,wr.Z)(t)?(0,r.jsx)(die,{className:lh()(Eae().button,Eae().buttonColor),iconClassName:Eae().buttonIcon,channel:t}):null]})]})};i.render=function(){var e=this,t=this.props,n=t.channel,o=t.noiseCancellationSupported,i=t.shouldShowVoicePanelIntroduction;return null==n?null:(0,r.jsx)(c.yRy,{renderPopout:this.renderVoicePanelIntroduction,position:"top",align:"center",animation:c.yRy.Animation.TRANSLATE,shouldShow:i,children:function(){return(0,r.jsxs)("div",{className:Eae().container,children:[(0,r.jsxs)(uh.Z,{className:Eae().connection,align:uh.Z.Align.CENTER,children:[(0,r.jsx)("div",{className:Eae().inner,children:e.renderConnectionStatus()}),(0,r.jsxs)(uh.Z,{grow:0,shrink:0,children:[o?e.renderNoiseCancellation():null,(0,r.jsx)(Kie,{channel:n})]})]}),e.renderVoiceStates(),e.renderChannelButtons()]})}})}
;return o}(o.PureComponent);const Uae=(0,cX.Z)((function(e){var t,n,i=(0,Voe.Z)(),a=(0,s.e7)([rm.Z],(function(){return rm.Z.getAwaitingRemoteSessionInfo()})),l=(0,s.e7)([Y.default],(function(){return Y.default.getCurrentUser()})),u=(0,s.cj)([A.Z],(function(){return null!=i?{channelId:i.channelId,rtcConnectionQuality:M.IE4.FINE,rtcConnectionState:M.hes.RTC_CONNECTED,rtcConnectionLastPing:0}:{channelId:A.Z.getChannelId(),rtcConnectionQuality:A.Z.getQuality(),rtcConnectionState:A.Z.getState(),rtcConnectionLastPing:A.Z.getLastPing()}})),f=u.channelId,d=Sae(u,["channelId"]),p=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(f)}),[f]),h=null==p?void 0:p.getGuildId(),E=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(h)}),[h]),y=(0,s.cj)([Ye.Z],(function(){return{noiseCancellationSupported:Ye.Z.isNoiseCancellationSupported(),noiseCancellationActive:Ye.Z.getNoiseCancellation(),noiseCancellationError:Ye.Z.isNoiseCancellationError(),canGoLive:(0,xr.Z)(Ye.Z)}})),m=(0,
s.e7)([Ye.Z,ud.Z],(function(){return ud.Z.hasHotspot(vr.v.VOICE_PANEL_INTRODUCTION)&&(0,lp.EO)(l)&&!Ye.Z.isInteractionRequired()&&!(null==p?void 0:p.isGuildStageVoice())})),b=(0,s.e7)([j.Z],(function(){return null!=f&&j.Z.hasVideo(f)}),[f]),g=(0,s.e7)([Pr.Z],(function(){return Pr.Z.getCurrentUserActiveStream()})),O=(0,s.e7)([T.Z],(function(){return T.Z.hasLayers()})),v=(0,s.e7)([vN.Z],(function(){return vN.Z.isViewingRoles(h)})),_=(0,s.e7)([dn.Z],(function(){return v&&!dn.Z.can(M.Plq.VIEW_CHANNEL,p)}),[v,p]),I=ct.Fg.useSetting(),N=Aae((0,s.Wu)([im.ZP,l_.Z],(function(){return(null==p?void 0:p.isGuildStageVoice())?[l_.Z.getMutableParticipants(p.id,u_.pV.SPEAKER),l_.Z.getParticipantsVersion(p.id),null]:[null,null,null!=p?im.ZP.getVoiceStatesForChannel(p):null]}),[p]),3),C=N[0],P=N[1],R=N[2],x=o.useMemo((function(){return null!==(n=null!==(t=null==C?void 0:C.map((function(e){return{user:e.user,nick:e.userNick,voiceState:e.voiceState}})))&&void 0!==t?t:R)&&void 0!==n?n:[]
}),[C,P,R]),w=Aae(o.useState(!1),2),D=w[0],Z=w[1];o.useEffect((function(){(v||_)&&Z(!1)}),[v,_,Z]);var L=JL.ZP.useExperiment({guildId:null!=h?h:""},{autoTrackExposure:!0,trackExposureOptions:{location:Pf.Z.RTC_PANEL}}).allowSoundboard,U=(0,Dr.f)(),k=(0,Hw.Z)(Pf.Z.RTC_PANEL).AnalyticsLocationProvider,G=(0,Loe.Z)(null!=h?h:"",null==p?void 0:p.id),B=(0,Goe.Z)(null==p?void 0:p.id);return(0,r.jsx)(k,{children:(0,r.jsxs)("div",{className:Eae().wrapper,children:[null!=i||null!=a?(0,r.jsx)(Xoe,{voiceState:i,awaitingRemoteSessionInfo:a}):null,(0,r.jsx)(Lae,Iae(_ae({},e,y,d),{enableActivities:G,remoteVoiceState:i,guild:E,channel:p,hasVideo:b,selfStream:g,hasLayers:O,voiceStates:x,showVoiceStates:I,shouldShowVoicePanelIntroduction:m,canUseSoundboard:L&&U,isPrivateChannelWithEnabledActivities:B})),!D&&v&&null!=h?(0,r.jsxs)("div",{className:Eae().viewAsRolesWarning,children:[(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:Eae().viewAsRolesWarningText,
children:_?Q.Z.Messages.VIEW_AS_ROLES_HIDDEN_VC_WARNING:Q.Z.Messages.VIEW_AS_ROLES_VOICE_WARNING}),(0,r.jsx)(c.zxk,{className:Eae().viewAsRolesWarningButton,size:c.zxk.Sizes.MIN,onClick:function(){Z(!0)},children:Q.Z.Messages.DISMISS})]}):null]})})}));var kae=n(399920),Gae=n.n(kae);function Bae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Hae(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Vae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Hae(e,t,n[t])}))}return e}function Fae(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){
var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Yae(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Bae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n)
;if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bae(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var zae=function(e){var t=e.match,n=(0,s.e7)([S.Z,C.Z],(function(){var e=C.Z.getChannelId();return S.Z.getChannel(e)})),o=t.params,i=o.guildId,a=o.channelId;if(null!=i&&null!=a&&(0,Ig.AB)(a))switch(a){case Ig.oC.ROLE_SUBSCRIPTIONS:return(0,r.jsx)(Dw,{guildId:i});case Ig.oC.MEMBER_APPLICATIONS:return(0,r.jsx)(dj,{guildId:i});case Ig.oC.GUILD_HOME:return(0,r.jsx)(pC,{guildId:i});case Ig.oC.CHANNEL_BROWSER:return(0,r.jsx)(wx,{guildId:i,selectedSection:fx.l7.BROWSE});case Ig.oC.GUILD_ONBOARDING:return(0,r.jsx)(EM,{guildId:i});case Ig.oC.CUSTOMIZE_COMMUNITY:return(0,r.jsx)(wx,{guildId:i,selectedSection:fx.l7.CUSTOMIZE});default:(0,_o.vE)(a)}if((null==n?void 0:n.type)===M.d4z.GUILD_STORE){var c=t.params.messageId;return(0,
r.jsx)(q0,{channel:n,inputSkuId:c},n.id)}return(0,r.jsx)(C0.Z,{})},Wae=o.memo((function(){var e=(0,N0.Z)(),t=e.guildId,n=e.channelId,o=(0,s.e7)([C.Z],(function(){return null!=n?n:C.Z.getChannelId(t)}));return window.location.pathname.startsWith(M.Z5c.GUILD_DISCOVERY)?(0,r.jsx)(fte,{}):null!=t?(0,r.jsx)(kH,{selectedChannelId:o,guildId:t},t):(0,r.jsx)(R4,{})}));function Kae(e){var t=(0,N0.Z)((function(e){return e.guildId}));return(0,r.jsx)(Ure.Z,Fae(Vae({},e),{guildId:t}))}var qae=function(e){return(0,r.jsx)(zae,Vae({},e))},Xae=function(e){var t=e.match;return null!=t.params.guildId?(0,r.jsx)(LC,{guildId:t.params.guildId,inviteCode:t.params.inviteCode}):null},Qae=function(e){var t=e.match;return null!=t.params.guildId?(0,r.jsx)(WH,{guildId:t.params.guildId,inviteCode:t.params.inviteCode}):null},$ae=function(){return(0,r.jsx)(j7,{})},Jae=function(){return(0,r.jsx)(R7.Z,{})},ese=function(){return(0,r.jsx)(MJ,{})},tse=function(){return(0,r.jsx)(PF,{})},nse=function(){return(0,r.jsx)(Bz,{})
},rse=function(e){switch(e.match.params.feature){case"addFriends":return(0,r.jsx)(MJ,{initialSection:M.pJs.ADD_FRIEND});case"pendingFriends":return(0,r.jsx)(MJ,{initialSection:M.pJs.PENDING});case"sessionManagement":return(0,r.jsx)(a.l_,{to:M.Z5c.SETTINGS("sessions")});case"connections":return(0,r.jsx)(a.l_,{to:{pathname:M.Z5c.SETTINGS("connections"),search:e.location.search}});default:return(0,r.jsx)(a.l_,{to:M.Z5c.ME})}};function ose(e){var t,n=e.hasNotice,o=e.sidebarTheme,i=e.hideSidebar,a=(0,s.e7)([fb.Z],(function(){return fb.Z.isFullscreenInContext()})),c=(0,VZ.AR)();return i?null:(0,r.jsxs)("div",{className:lh()(Gae().sidebar,(0,pV.Q)(o),(t={},Hae(t,Gae().hasNotice,n),Hae(t,Gae().fullWidth,no.tq),Hae(t,Gae().hidden,a),t)),children:[(0,r.jsx)(Wae,{}),c&&(0,r.jsx)(T0,{}),(0,r.jsxs)("section",{className:Gae().panels,"aria-label":Q.Z.Messages.ACCOUNT_A11Y_LABEL,children:[(0,r.jsx)(joe,{}),(0,r.jsx)(fW.Z,{section:M.jXE.ACTIVITY_PANEL,children:(0,r.jsx)(Kae,{
className:Gae().activityPanel})}),(0,r.jsx)(fW.Z,{section:M.jXE.RTC_CONNECTION_PANEL,children:(0,r.jsx)(Uae,{})}),(0,r.jsx)(fW.Z,{section:M.jXE.ACCOUNT_PANEL,children:(0,r.jsx)(Lre,{})})]}),(0,r.jsx)(i1,{})]})}function ise(){var e,t=(0,s.e7)([A0.Z],(function(){return A0.Z.hasNotice()})),n=(0,s.e7)([st.Z],(function(){return st.Z.darkSidebar?M.BRd.DARK:void 0})),i=function(){var e=Yae(o.useState((function(){return window.location.pathname.startsWith(M.Z5c.GUILD_MEMBER_VERIFICATION(""))})),2),t=e[0],n=e[1];o.useEffect((function(){return Fa.Z.addRouteChangeListener((function(e){n(e.pathname.startsWith(M.Z5c.GUILD_MEMBER_VERIFICATION("")))}))}),[]);return t}(),c=function(){var e=Yae(o.useState((function(){return window.location.pathname.startsWith(M.Z5c.GUILD_MEMBER_VERIFICATION_FOR_HUB(""))})),2),t=e[0],n=e[1];o.useEffect((function(){return Fa.Z.addRouteChangeListener((function(e){n(e.pathname.startsWith(M.Z5c.GUILD_MEMBER_VERIFICATION_FOR_HUB("")))}))}),[]);return t}(),l=function(){
var e,t=(0,a.TH)();return!0===(null===(e=(0,a.LX)(t.pathname,M.Z5c.GUILD_BOOSTING_MARKETING(":guildId")))||void 0===e?void 0:e.isExact)}(),u=(0,s.e7)([fo],(function(){return fo.getIsOpen()})),f=(0,a.$B)([M.Z5c.CHANNEL(M.ME,":channelId"),M.Z5c.CHANNEL(":guildId",":channelId?",":messageId?")]),d=(null==f||null===(e=f.params)||void 0===e?void 0:e.channelId)===Ig.oC.GUILD_ONBOARDING,p=i||c||l||d,h=o.useCallback((function(){return to()}),[]);return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:Gae().container,children:[u&&(0,r.jsx)(GH.Z,{className:Gae().guilds,themeOverride:n}),(0,r.jsx)(db.Z.Provider,{value:(null==f?void 0:f.params.guildId)===M.ME||null==f?void 0:f.params.guildId,children:(0,r.jsxs)("div",{className:Gae().base,children:[no.tq?null:(0,r.jsx)(J2,{}),(0,r.jsxs)("div",{className:Gae().content,children:[(0,r.jsx)(ose,{hasNotice:t,sidebarTheme:n,hideSidebar:p||!u}),(0,r.jsx)(lb.Z.Provider,{value:h,children:(0,r.jsxs)(a.rs,{children:[(0,r.jsx)(ub.Z,{
path:M.Z5c.ACTIVITY,disableTrack:!0,children:(0,r.jsx)(a.l_,{to:M.Z5c.ME})}),(0,r.jsx)(ub.Z,{path:M.Z5c.APPLICATION_LIBRARY,render:$ae,impressionName:W.zs.APPLICATION_LIBRARY,disableTrack:!0}),(0,r.jsx)(ub.Z,{path:M.Z5c.APPLICATION_STORE,render:Jae,impressionName:W.zs.APPLICATION_STORE,disableTrack:!0}),(0,r.jsx)(ub.Z,{path:M.Z5c.MESSAGE_REQUESTS,render:tse,disableTrack:!0}),(0,r.jsx)(ub.Z,{path:M.Z5c.PARENT_TOOLS,render:nse,disableTrack:!0}),(0,r.jsx)(ub.Z,{path:M.Z5c.ME,exact:!0,render:ese,impressionName:W.zs.FRIENDS,disableTrack:!0}),(0,r.jsx)(ub.Z,{path:[M.Z5c.CHANNEL_THREAD_VIEW(":guildId",":channelId",":threadId"),M.Z5c.CHANNEL(M.ME,":channelId"),M.Z5c.CHANNEL(":guildId",":channelId?",":messageId?")],render:qae,impressionName:W.zs.GUILD_CHANNEL,disableTrack:!0}),(0,r.jsx)(ub.Z,{path:M.Z5c.GUILD_DISCOVERY,render:function(e){return function(e){var t=null!=e&&e.length>0&&e.startsWith("?")?e.split("?")[1]:null;return(0,r.jsx)(Zee,{searchRoute:t})}(e.location.search)},
impressionName:W.zs.GUILD_DISCOVERY,disableTrack:!0}),(0,r.jsx)(ub.Z,{path:M.Z5c.GUILD_MEMBER_VERIFICATION(":guildId",":inviteCode?"),render:Xae,impressionName:W.zs.GUILD_MEMBER_VERIFICATION,disableTrack:!0}),(0,r.jsx)(ub.Z,{path:M.Z5c.GUILD_MEMBER_VERIFICATION_FOR_HUB(":guildId",":inviteCode?"),render:Qae,impressionName:W.zs.HUB_EMAIL_SIGNUP,impressionProperties:function(e){return{has_invite:void 0!==e.computedMatch.params.inviteCode}}}),(0,r.jsx)(ub.Z,{path:M.Z5c.FEATURE(":feature"),exact:!0,render:rse,disableTrack:!0})]})})]})]})})]})})}const ase=n(549869).Z;var sse=n(597967);var cse=n(978868);function lse(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function use(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fse(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function dse(e){
dse=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return dse(e)}function pse(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){fse(e,t,n[t])}))}return e}function hse(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Ese(e,t){return!t||"object"!==bse(t)&&"function"!=typeof t?function(e){
if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function yse(e,t){yse=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return yse(e,t)}function mse(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return lse(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lse(e,t)}(e,t)||function(){
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var bse=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function gse(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=dse(e);if(t){var o=dse(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ese(this,n)}}var Ose=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&yse(e,t)}(n,e);var t=gse(n);function n(){use(this,n);var e
;(e=t.apply(this,arguments)).isMessageRequestsInitialized=!1;return e}var r=n.prototype;r.componentDidMount=function(){var e=this.props,t=e.selectedChannelId,n=e.connected,r=e.isNSFWChannel,o=e.channelParentId,i=e.isTextInVoice,a=e.canSendMessage,s=e.hasPendingMemberAction;if(n&&null!=t){(0,Sb.yw)(M.rMx.CHANNEL_OPENED,{channel_is_nsfw:r,parent_id:o,can_send_message:a,has_pending_member_action:s});i&&(0,Sb.yw)(M.rMx.TEXT_IN_VOICE_OPENED,{channel_is_nsfw:r})}};r.componentDidUpdate=function(e){var t=this.props,n=t.voiceChannelId,r=t.voiceChannelIdJoined,o=t.voiceChannelGuildId,i=t.voiceChannelType,a=t.voiceChannelBitrate,s=t.videoEnabled,c=t.isScreenSharing,l=t.runningGame,u=t.runningGamePid,f=t.selectedChannelId,d=t.selectedGuildId,p=t.channelParentId,h=t.connected,E=t.homeLink,y=t.friendsTabSection,m=t.isNSFWChannel,b=t.isMemberPending,g=t.hasPreviewEnabled,O=t.rtcConnectionId,v=t.postableChannelCount,_=t.isTextInVoice,I=t.canSendMessage,T=t.numMessageRequests,N=t.hasPendingMemberAction
;if(e.voiceChannelId!==n&&null!=e.voiceChannelId){var C=ze.ZP.getCurrentGame(),j=null!=C?C.name:"",R=eD.Z.getStageInstanceByChannel(e.voiceChannelId),x=Ov.ZP.getActiveEventByChannel(e.voiceChannelId);Ie.default.track(M.rMx.LEAVE_VOICE_CHANNEL,pse({channel_id:e.voiceChannelId,channel_type:e.voiceChannelType,channel_bitrate:e.voiceChannelBitrate,guild_id:e.voiceChannelGuildId,rtc_connection_id:e.rtcConnectionId,game_name:j,duration:A.Z.getDuration(),game_platform:this.props.gamePlatform,game_id:this.props.gameId,media_session_id:e.mediaSessionId,stage_instance_id:null==R?void 0:R.id,guild_scheduled_event_id:null==x?void 0:x.id},(0,Sb.kO)(e.voiceChannelGuildId,e.voiceChannelId,e.videoEnabled),A.Z.getVoiceStateStats(),fb.Z.getSelectedParticipantStats(e.voiceChannelId)))}if(e.voiceChannelIdJoined!==r&&null!=r){var w=ze.ZP.getCurrentGame(),D=null!=w?w.name:"";if(null!=r&&null!=n){var Z=eD.Z.getStageInstanceByChannel(n),L=Ov.ZP.getActiveEventByChannel(n)
;Ie.default.track(M.rMx.JOIN_VOICE_CHANNEL,pse({channel_id:n,channel_type:i,channel_bitrate:a,guild_id:o,rtc_connection_id:O,game_name:D,game_platform:this.props.gamePlatform,game_id:this.props.gameId,stage_instance_id:null==Z?void 0:Z.id,guild_scheduled_event_id:null==L?void 0:L.id},(0,Sb.oG)(o,n),(0,Sb.kO)(o,n,s)))}}if(e.runningGame!==l&&null!=l&&!l.isLauncher){var U=Rn.Z.getGameByName(l.name);Ie.default.track(M.rMx.LAUNCH_GAME,{game:l.name,game_id:null==U?null:U.id,verified:null!=U,elevated:l.elevated,game_platform:M.M7m.DESKTOP,distributor:l.distributor});if(null!=l.name&&null!=u&&Rn.Z.shouldReport(l.name)){var k=l.name,G=u;Pn.Z.identifyGame(G,k).then((function(e){return Pn.Z.reportUnverifiedGame(e)})).catch((function(e){return new jn.Z("AutoAnalytics").error("Cannot identify game",e)}))}}if((e.videoEnabled!==s||e.isScreenSharing!==c)&&null!=n){var B="none",H=[c?"screen":null,s?"camera":null].filter(_o.lm),V=null;if(c){B="screen";V=(0,sse.t)()}else s&&(B="camera")
;Ie.default.track(M.rMx.VIDEO_INPUT_TOGGLED,pse({video_input_type:B,video_toggle_source:__OVERLAY__?"overlay":"app",enabled_inputs:H,preview_enabled:ct.qF.getSetting()},V,this.getGameMetadata(),(0,Sb.AB)(n)))}if(h&&null!=d&&(d!==e.selectedGuildId||!e.connected||b&&!e.isMemberPending)){var F,Y,z=hse(pse({},b?{is_pending:b,preview_enabled:g}:{}),{postable_channels:v,premium_progress_bar_enabled:null!==(Y=null===(F=Zt.Z.getGuild(P.Z.getGuildId()))||void 0===F?void 0:F.premiumProgressBarEnabled)&&void 0!==Y&&Y,viewing_all_channels:!cp.Z.isOptInEnabled(d),num_recent_channels:cse.Z.recentsChannelCount(d)});(0,Sb.yw)(M.rMx.GUILD_VIEWED,z)}else if(!h||null!=d||E!==M.Z5c.FRIENDS||e.connected&&y===e.friendsTabSection&&E===e.homeLink){if(h&&null==d&&E===M.Z5c.MESSAGE_REQUESTS&&(!e.connected||E!==e.homeLink)&&!this.isMessageRequestsInitialized){this.isMessageRequestsInitialized=!0;Ie.default.track(M.rMx.MESSAGE_REQUESTS_INITIALIZED,{num_message_requests:T})}
}else Ie.default.track(M.rMx.FRIENDS_LIST_VIEWED,pse({tab_opened:y},ase()));if(h&&null!=f&&(!e.connected||f!==e.selectedChannelId||d!==e.selectedGuildId)){var W=(0,Sb.KG)(S.Z.getChannel(f),!0);(0,Sb.yw)(M.rMx.CHANNEL_OPENED,pse({channel_is_nsfw:m,parent_id:p,can_send_message:I,has_pending_member_action:N},W));_&&(0,Sb.yw)(M.rMx.TEXT_IN_VOICE_OPENED,{channel_is_nsfw:m})}};r.getGameMetadata=function(){return{game_platform:this.props.gamePlatform,game_name:this.props.gameName,game_exe_name:this.props.gameExeName,game_id:this.props.gameId}};r.render=function(){return null};return n}(o.PureComponent);function vse(){var e,t,n,o,i,a=mse((0,s.Wu)([C.Z],(function(){return[C.Z.getVoiceChannelId(),C.Z.getChannelId()]}),[]),2),c=a[0],l=a[1],u=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(l)}),[l]),f=(0,s.e7)([fb.Z],(function(){return null!=(null==u?void 0:u.id)&&fb.Z.getChatOpen(u.id)}),[u]),d=null==u?void 0:u.nsfw,p=null!==(e=null==u?void 0:u.parent_id)&&void 0!==e?e:void 0,h=(0,
s.e7)([S.Z],(function(){return S.Z.getChannel(c)}),[c]),E=(0,s.e7)([P.Z],(function(){return P.Z.getGuildId()}),[]),y=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(E)}),[E]),m=(0,s.e7)([Y.default],(function(){return Y.default.getCurrentUser()}),[]),b=(0,s.e7)([qa.ZP],(function(){var e;return null!=m&&null!=E&&(null!==(t=null===(e=qa.ZP.getMember(E,m.id))||void 0===e?void 0:e.isPending)&&void 0!==t&&t)}),[m,E]),g=(0,s.e7)([aQ],(function(){return aQ.getState().section}),[]),O=(0,s.e7)([l4.Z],(function(){return l4.Z.getHomeLink()}),[]),v=(0,s.e7)([my.Z],(function(){return my.Z.isConnected()}),[]),_=mse((0,s.Wu)([Ye.Z],(function(){return[Ye.Z.isVideoEnabled(),Ye.Z.isScreenSharing()]}),[]),2),I=_[0],T=_[1],N=(0,s.e7)([A.Z],(function(){return A.Z.getChannelId()}),[]),j=(0,s.e7)([Au.Z],(function(){return Au.Z.getPrimaryActivity()}),[]),R=(0,s.e7)([ze.ZP],(function(){return ze.ZP.getCurrentGame()}),[]),x=(0,s.e7)([A.Z],(function(){return A.Z.getMediaSessionId()}),[]),w=(0,
s.e7)([A.Z],(function(){return A.Z.getRTCConnectionId()}),[]),D=(n=E,0===(i=(0,s.e7)([Hg.ZP],(function(){return null!==(o=Hg.ZP.getChannels(n)[Hg.sH])&&void 0!==o?o:[]}),[n])).length?0:i.filter((function(e){var t=e.channel;return dn.Z.can(_l.Z.combine(M.Plq.SEND_MESSAGES,M.Plq.VIEW_CHANNEL),t)})).length),Z=(0,s.e7)([dn.Z],(function(){return dn.Z.can(M.Plq.SEND_MESSAGES,u)})),L=(0,s.e7)([$H.Z],(function(){return $H.Z.getMessageRequestsCount()}),[]),U=Rb(null==y?void 0:y.id,null==u?void 0:u.id),k={selectedChannelId:l,channelParentId:p,isNSFWChannel:d,selectedGuildId:E,friendsTabSection:g,homeLink:O,connected:v,videoEnabled:I,isScreenSharing:T,voiceChannelId:null==h?void 0:h.id,voiceChannelIdJoined:N,voiceChannelGuildId:null==h?void 0:h.getGuildId(),voiceChannelType:null==h?void 0:h.type,voiceChannelBitrate:null==h?void 0:h.bitrate,runningGame:R,runningGamePid:null!=R?R.pid:null,gamePlatform:(0,Mp.Z)(j),gameName:null!=j?j.name:null,gameId:null!=j?j.application_id:null,
gameExeName:null!=R?R.exeName:null,hasPreviewEnabled:null==y?void 0:y.features.has(M.oNc.PREVIEW_ENABLED),isMemberPending:b,mediaSessionId:x,rtcConnectionId:w,postableChannelCount:D,isTextInVoice:f,canSendMessage:Z,numMessageRequests:L,hasPendingMemberAction:U};return(0,r.jsx)(Ose,pse({},k))}var _se=n(685269),Ise=n(997244);const Sse=function(e,t){O.Z.dispatch({type:"INCOMING_CALL_MOVE",x:e,y:t})};function Tse(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Nse(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ase(e){Ase=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Ase(e)}function Cse(e,t){return!t||"object"!==Rse(t)&&"function"!=typeof t?Nse(e):t}function Pse(e,t){Pse=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Pse(e,t)}function jse(e,t){return function(e){
if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Tse(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Tse(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Rse=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function xse(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Ase(e);if(t){var o=Ase(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Cse(this,n)}}var Mse,wse,Dse=Math.pow(3,2);!function(e){e[e.DISABLED=0]="DISABLED";e[e.DEFAULT=1]="DEFAULT";e[e.OFFSET=2]="OFFSET"}(Mse||(Mse={}));!function(e){e.TOP="TOP";e.BOTTOM="BOTTOM";e.RIGHT="RIGHT";e.LEFT="LEFT"}(wse||(wse={}));function Zse(e,t,n,r,o){var i=e.top,a=e.bottom,s=e.left,c=e.right;if(null==i&&null==a){i=0;a=n-o}else null==i&&null!=a?i=n-(a+o):null!=i&&(a=n-(i+o));if(null==s&&null==c){s=0;c=t-r}else null==s&&null!=c?s=t-(c+r):null==c&&null!=s&&(c=t-(s+r));if(null==i||null==a||null==s||null==c)throw new Error("Logically this can never happen based on our if/else statements");return{top:i,
left:s,bottom:a,right:c}}function Lse(e){return[null==e.bottom?wse.TOP:wse.BOTTOM,null==e.right?wse.LEFT:wse.RIGHT]}function Use(e){var t=e.top,n=e.left,r=e.bottom,o=e.right;0===t||t<=r?r=null:t=null;0===n||n<=o?o=null:n=null;return{top:t,left:n,bottom:r,right:o}}function kse(e){var t=e.top,n=e.left,r=e.bottom,o=e.right;if(r<0){t+=r;r=0}if(t<0){r+=t;t=0}if(o<0){n+=o;o=0}if(n<0){o+=n;n=0}return{top:t,left:n,bottom:r,right:o}}function Gse(e){return null!=e?"".concat(e,"px"):"auto"}var Bse=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Pse(e,t)}(n,e);var t=xse(n);function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var r;(r=t.call(this,e)).draggableRef=o.createRef();r._dragStart={x:0,y:0};r.handleMouseDown=function(e){
var t=r.position,n=t.top,o=t.left,i=t.bottom,a=t.right,s=r.props,c=s.dragAnywhere,l=s.selector,u=s.maxX,f=s.maxY,d=e.target,p=r.draggableRef.current;if(null!=p&&e.button===M.AeJ.PRIMARY&&(c||null!=d&&null!=l&&""!==l&&null!=d.closest(l))){var h=function(e){var t=e.top;return{x:e.left,y:t}}(Zse({top:n,left:o,bottom:i,right:a},u,f,p.clientWidth,p.clientHeight)),E=h.x,y=h.y;r._dragStart={x:e.clientX,y:e.clientY};r._offsetX=e.clientX-E;r._offsetY=e.clientY-y;window.addEventListener("mousemove",r.handleMouseMove);window.addEventListener("mouseup",r.handleMouseUp)}};r.handleMouseMove=function(e){e.preventDefault();var t=e.clientX,n=e.clientY,o=r.draggableRef.current,i=r.props,a=i.maxX,s=i.maxY,c=i.flipVertical,l=i.flipHorizontal,u=i.onDragStart,f=i.onDrag,d=i.onFlip,p=i.snapOrientation,h=r.state,E=h.dragging,y=h.dragging,m=h.verticalOrientation,b=h.horizontalOrientation,g=!1;if(!(null==o||!E&&(O=r._dragStart,v={x:t,y:n},_=O.x,I=O.y,S=v.x,T=v.y,Math.pow(_-S,2)+Math.pow(I-T,2))<Dse)){
var O,v,_,I,S,T;E=!0;var N=o.clientWidth,A=o.clientHeight,C=kse(Zse({top:n-r._offsetY,left:t-r._offsetX},a,s,N,A));if(p){var P=Lse(C=Use(C));m=P[0];b=P[1]}else C={top:C.top,left:C.left};if(l===Mse.OFFSET&&b!==r.state.horizontalOrientation){r._offsetX=N-r._offsetX;g=!0}if(c===Mse.OFFSET&&m!==r.state.verticalOrientation){r._offsetY=A-r._offsetY;g=!0}r.setDOMPositions(C);y||null==u||u(C,o);null==f||f(C,o);g&&(null==d||d([m,b]));r.setState({dragging:E,verticalOrientation:m,horizontalOrientation:b,atTopEdge:0===C.top})}};r.handleMouseUp=function(){window.removeEventListener("mousemove",r.handleMouseMove);window.removeEventListener("mouseup",r.handleMouseUp);r.state.dragging&&r.setState({dragging:!1},(function(){var e=r.props.onDragEnd,t=r.draggableRef.current;null!=t&&null!=e&&e(r.position,t)}))};r._checkBoundsRAF=null;r.checkBounds=function(){null!=r._checkBoundsRAF&&cancelAnimationFrame(r._checkBoundsRAF);r._checkBoundsRAF=requestAnimationFrame(r._performCheckBounds)}
;r._performCheckBounds=function(){var e=Nse(r),t=e.position,n=e.state,o=e.draggableRef.current,i=e.props,a=i.maxX,s=i.maxY,c=i.onRelocated,l=i.snapOrientation,u=r.state,f=u.verticalOrientation,d=u.horizontalOrientation;if(null!=o){var p,h=o.clientHeight,E=Zse(t,a,s,o.clientWidth,h);E=kse(E);if(l){var y=Lse(p=Use(E));f=y[0];d=y[1]}else p={top:E.top,left:E.left,right:null,bottom:null};if(t.left!==p.left||t.right!==p.right||t.top!==p.top||t.bottom!==p.bottom){null==c||c(p,o);r.setDOMPositions(p);var m=0===p.top;f===n.verticalOrientation&&d===n.horizontalOrientation&&m===n.atTopEdge||r.setState({verticalOrientation:f,horizontalOrientation:d,atTopEdge:m})}}};var i=jse(Lse(e.initialPosition),2),a=i[0],s=i[1];r.position=function(e){var t=e.top,n=e.left,r=e.bottom,o=e.right;null==n&&null==o&&(n=0);null!=n&&null!=o&&(o=null);null==t&&null==r&&(t=0);null!=t&&null!=r&&(r=null);return{top:t,left:n,bottom:r,right:o}}(e.initialPosition);r.state={dragging:!1,verticalOrientation:a,
horizontalOrientation:s,atTopEdge:0===r.position.top};return r}var i=n.prototype;i.componentDidMount=function(){this.checkBounds();this.setDOMPositions(this.position)};i.componentDidUpdate=function(e,t){var n=this.state,r=n.verticalOrientation,o=n.horizontalOrientation,i=n.atTopEdge,a=this.props,s=a.maxX,c=a.maxY,l=a.onRelocated,u=a.snapOrientation;(e.maxX!==s||e.maxY!==c||e.onRelocated!==l||e.snapOrientation!==u||t.verticalOrientation!==r||t.horizontalOrientation!==o||t.atTopEdge!==i)&&this.checkBounds()};i.componentWillUnmount=function(){window.removeEventListener("mousemove",this.handleMouseMove);window.removeEventListener("mouseup",this.handleMouseUp)};i.setDOMPositions=function(e){var t=e.top,n=e.left,r=e.bottom,o=e.right,i=this.draggableRef.current;this.position={top:t,left:n,bottom:r,right:o};if(null!=i){i.style.top=Gse(t);i.style.bottom=Gse(r);i.style.left=Gse(n);i.style.right=Gse(o)}};i.render=function(){
var e=this.props,t=e.children,n=e.className,i=this.state,a=i.dragging,s=i.verticalOrientation,c=i.horizontalOrientation,l=i.atTopEdge,u=this.position,f=u.top,d=u.left,p=u.right,h={pointerEvents:a?"none":"auto",position:"absolute",top:f,left:d,bottom:u.bottom,right:p};return(0,r.jsx)("div",{ref:this.draggableRef,className:n,onMouseDown:this.handleMouseDown,style:h,children:o.cloneElement(o.Children.only(t),{flipped:c===wse.RIGHT,verticalFlipped:s===wse.BOTTOM,checkBounds:this.checkBounds,atTopEdge:l})})};return n}(o.PureComponent);Bse.FlipTypes=Mse;Bse.defaultProps={snapOrientation:!1,maxX:0,maxY:0,flipVertical:Mse.DISABLED,flipHorizontal:Mse.DISABLED,dragAnywhere:!1};var Hse=n(535312),Vse=n(359721),Fse=n(504001),Yse=n(732068),zse=n(731209),Wse=n(661782),Kse=n(140975),qse=n.n(Kse),Xse=n(637678),Qse=n.n(Xse);function $se(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Jse(e,t,n){t in e?Object.defineProperty(e,t,{value:n,
enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function ece(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Jse(e,t,n[t])}))}return e}function tce(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function nce(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){
var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return $se(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $se(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var rce={width:232,height:315},oce={width:232,height:267},ice=475,ace=267;function sce(e){var t=e.header,n=Ye.Z.getCameraComponent(),i=(0,s.e7)([Ye.Z],(function(){return Ye.Z.getVideoDeviceId()})),a=(0,
Fse.Z)();o.useEffect((function(){var e=Y.default.getCurrentUser();if(a&&null!=e){var t=(0,Hse.P)(e);(0,Vse.FU)(t,i,{track:!1}).catch(M.dG4)}}),[a,i]);return(0,r.jsxs)("div",{className:qse().previewRoot,children:[(0,r.jsx)(c.$jN,{}),(0,r.jsx)("div",{className:qse().preview,children:(0,r.jsx)(n,{disabled:!1,deviceId:i,width:ice,height:ace})}),(0,r.jsx)("div",{className:qse().previewChannelHeader,children:t})]})}function cce(e){var t=e.canVideo,n=e.channel,o=e.numVideoDevices,i=(0,mie.Z)(),a=i.cameraUnavailable,s=i.enabled,l=(0,gie.Z)(n);return(0,r.jsxs)("div",{className:qse().actions,children:[(0,r.jsx)(Yse.d,{iconComponent:Ub.Z,color:"red",className:qse().actionButton,label:Q.Z.Messages.DISMISS,onClick:function(){return Ise.Z.stopRinging(n.id)}}),t&&(0,r.jsx)(c.yRy,{renderPopout:function(e){var t=e.closePopout;return(0,r.jsx)(Hoe.Z,{onClose:t})},position:"top",align:"center",animation:c.yRy.Animation.FADE,children:function(e,t){var i=e.onClick,c=t.isShown;return(0,r.jsx)(Tie.C,{join:!0,
enabled:s,color:"green",centerButton:!0,hasPermission:l,cameraUnavailable:a,channel:n,onPopoutClick:o>1?i:null,className:qse().actionButton,popoutOpen:c,onCameraUnavailable:vie.Z,onChange:function(){d.default.selectVoiceChannel(n.id,!0);(0,K.XU)(M.ME,n.id)}})}}),(0,r.jsx)(zse.Z,{channel:n,color:"green",centerButton:!0,className:lh()(qse().actionButton,qse().last),onClick:function(){return d.default.selectVoiceChannel(n.id)}})]})}function lce(e){var t=e.animatedStyle,n=e.y,i=e.x,a=e.channel,l=nce(o.useState(!1),2),u=l[0],f=l[1],d=(0,kV.x)(a),p=(0,op.ZP)(a),h=nce((0,s.Wu)([Ye.Z],(function(){return[Ye.Z.supports(Ke.AN.VIDEO),Object.keys(Ye.Z.getVideoDevices()).length]})),2),E=h[0],y=h[1],m=(0,s.e7)([We.Z],(function(){return We.Z.isFocused()})),b=(0,s.e7)([fb.Z],(function(){return fb.Z.getMode(a.id)})),g=o.useCallback((function(e){null!=e.top&&null!=e.left&&Sse(e.left,e.top)}),[]),O=(0,mm.useSpring)({value:u?1:0,config:tce(ece({},mm.config.stiff),{clamp:!0})});o.useEffect((function(){
var e=function(e){e.keyCode===M.yXg.ESCAPE&&Ise.Z.stopRinging(a.id)};window.addEventListener("keydown",e);return function(){return window.removeEventListener("keydown",e)}}),[a]);var v=b===M.WtW.VIDEO&&E&&y>0,_=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Wse.Z,{className:qse().icon,ringing:m,src:null!=d?d:"",ringingType:Wse.Z.RingingType.INCOMING,size:u?c.EFr.SIZE_40:c.EFr.SIZE_80}),(0,r.jsxs)("div",{className:qse().titleGroup,children:[(0,r.jsx)(c.xvT,{className:qse().title,color:"header-primary",variant:u?"text-md/semibold":"text-lg/semibold",children:p}),(0,r.jsx)(c.xvT,{color:"header-secondary",className:qse().subtitle,variant:u?"text-sm/normal":"text-md/normal",children:b===M.WtW.VOICE?Q.Z.Messages.INCOMING_CALL_ELLIPSIS:Q.Z.Messages.INCOMING_VIDEO_CALL_ELLIPSIS})]})]}),I=v?rce:oce;return(0,r.jsx)(Bse,{className:qse().wrapper,selector:".".concat(qse().root),initialPosition:{left:i,top:n},maxX:window.innerWidth,maxY:window.innerHeight,onDragEnd:g,dragAnywhere:!0,children:(0,
r.jsx)(r.Fragment,{children:(0,r.jsxs)(mm.animated.div,{className:lh()(qse().root,Qse().elevationHigh,Jse({},qse().previewCamera,u),u?(0,pV.Q)("dark"):null),style:tce(ece({},t),{width:O.value.interpolate([0,1],[I.width,ice]),minHeight:O.value.interpolate([0,1],[I.height,ace]),translateX:O.value.interpolate([0,1],[0,-1*Math.abs(ice-I.width)/2])}),children:[u?(0,r.jsx)(sce,{header:_}):(0,r.jsx)("div",{className:qse().mainChannelInfo,children:_}),(0,r.jsx)(cce,{canVideo:v,channel:a,numVideoDevices:y}),v&&!u?(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,fullWidth:!0,look:c.zxk.Looks.LINK,color:c.zxk.Colors.PRIMARY,className:qse().previewButton,onClick:function(){return f(!0)},children:Q.Z.Messages.INCOMING_CALL_PREVIEW_CAMERA}):null]})})})}var uce=n(669754),fce=n(292832);function dce(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function pce(e,t){t=null!=t?t:{}
;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var hce={transform:"scale(0.7)",opacity:0},Ece={transform:"scale(1)",opacity:1};const yce=function(){var e=(0,s.e7)([C.Z],(function(){return C.Z.getChannelId()})),t=(0,s.Wu)([Km],(function(){return Km.getIncomingCalls().filter((function(t){var n=t.channel;return e!==n.id}))})),n=(0,s.e7)([Km],(function(){return Km.hasIncomingCalls()})),i=(0,s.e7)([sp.Z],(function(){return sp.Z.isSoundDisabled("call_ringing")})),a=(0,s.e7)([Lr.Z],(function(){return Lr.Z.disableSounds})),c=(0,s.e7)([uce.Z],(function(){return uce.Z.getSoundpack()})),l=o.useRef(!1),u=(0,
_se.Z)((function(){if(c===fce.YC.CLASSIC){var e=500===Wa().random(1,1e3)?"call_ringing_beat":"call_ringing";return(0,am.tu)(e,"call_ringing")}return(0,am.uk)("call_ringing",c)}),[c]);o.useEffect((function(){return function(){u.stop()}}),[u]);o.useEffect((function(){if(a||i){if(l.current){u.stop();l.current=!1}}else if(n&&!l.current){u.loop();l.current=!0}else if(!n&&l.current){u.stop();l.current=!1}}),[i,a,n,u]);var f=(0,mm.useTransition)(t,{keys:function(e){var t;return null===(t=e.channel)||void 0===t?void 0:t.id},enter:{from:hce,to:Ece},leave:hce,config:{mass:1,tension:500,friction:18,clamp:!0}});return f((function(e,t){return(0,r.jsx)(lce,pce(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){dce(e,t,n[t])}))}return e}({},t),{
animatedStyle:e}))}))};var mce=n(242839),bce=n(519837),gce=n(858456),Oce=n.n(gce);function vce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _ce(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Ice(e){Ice=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Ice(e)}function Sce(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Pce(e,t)}function Tce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){_ce(e,t,n[t])}))}return e}
function Nce(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Ace(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function Cce(e,t){return!t||"object"!==jce(t)&&"function"!=typeof t?function(e){
if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Pce(e,t){Pce=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Pce(e,t)}var jce=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Rce(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Ice(e);if(t){var o=Ice(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Cce(this,n)}}var xce,Mce=(0,mi.Un)({createPromise:function(){return n.e(54313).then(n.bind(n,95581))},webpackId:95581,name:"UserSettings"}),wce=(0,mi.Un)({createPromise:function(){return Promise.all([n.e(40532),n.e(56054),n.e(97621)]).then(n.bind(n,27314))},
webpackId:27314,name:"ChannelSettings"}),Dce=(_ce(xce={},M.S9g.USER_SETTINGS,(function(){return(0,r.jsx)(Mce,{})})),_ce(xce,M.S9g.CHANNEL_SETTINGS,(function(){return(0,r.jsx)(wce,{})})),_ce(xce,M.S9g.GUILD_SETTINGS,(function(){return(0,r.jsx)(bce.Z,{})})),xce),Zce="SHOWN",Lce="HIDDEN",Uce={friction:10,tension:100};function kce(){o.useEffect((function(){rh.Z.enable();rh.Z.enableTemp(mce.u);return function(){return rh.Z.disableTemp()}}),[]);return null}var Gce=function(e){Sce(n,e);var t=Rce(n);function n(e){vce(this,n);var r;(r=t.call(this,e)).containerRef=o.createRef();var i=1,a=1;if(e.mode===Lce){i=.93;a=0}r.state={animating:!1,scale:new ji.Z.Value(i),opacity:new ji.Z.Value(a),mode:e.mode};return r}var i=n.prototype;i.componentDidUpdate=function(e){var t=this.props.mode,n=e.mode;if(t!==n)return t===Zce&&n===Lce?this.animateIn():t===Lce&&n===Zce?this.animateUnder():void 0};i.componentWillEnter=function(e){var t=this,n=this.state,r=n.opacity;n.scale.setValue(1.1);r.setValue(0);e()
;this.setState({animating:!0},(function(){return t.animateIn()}))};i.componentWillLeave=function(e){var t=this;this.setState({animating:!0},(function(){return t.animateOut(e)}))};i.animateIn=function(e){var t=this;s.ZP.Emitter.pause(500);var n=this.state,r=n.opacity,o=n.scale;ji.Z.parallel([ji.Z.spring(r,Tce({toValue:1},Uce)),ji.Z.spring(o,Tce({toValue:1},Uce))]).start((function(){return t.animateComplete(e)}))};i.animateOut=function(e){s.ZP.Emitter.pause(500);var t=this.state,n=t.opacity,r=t.scale;Yl.S.dispatch(M.CkL.LAYER_POP_START);ji.Z.parallel([ji.Z.spring(n,Tce({toValue:0},Uce)),ji.Z.spring(r,Tce({toValue:1.1},Uce))]).start((function(){e();Yl.S.dispatch(M.CkL.LAYER_POP_COMPLETE)}))};i.animateUnder=function(){var e=this;s.ZP.Emitter.pause(500);var t=this.state,n=t.opacity,r=t.scale;ji.Z.parallel([ji.Z.spring(n,Tce({toValue:0},Uce)),ji.Z.spring(r,Tce({toValue:.93},Uce))]).start((function(){return e.animateComplete()}))};i.animateComplete=function(e){this.setState({animating:!1},e)}
;i.render=function(){var e,t=this,n=this.state.animating,o=this.props,i=o.mode,a=o.children,s=o.baseLayer,l=Ace(o,["mode","children","baseLayer"]),u=n||i===Lce?this.getAnimatedStyle():null,f=(0,r.jsx)(ji.Z.div,Nce(Tce({ref:function(e){return t.containerRef.current=null!=e?e.refs.node:void 0},"aria-hidden":i===Lce,className:lh()(Oce().layer,(e={},_ce(e,Oce().baseLayer,s),_ce(e,Oce().animating,n),_ce(e,"stop-animations",i===Lce),e)),style:u},l),{children:a}));return s?f:(0,r.jsx)(c.EqS,{containerRef:this.containerRef,children:f})};i.getAnimatedStyle=function(){var e=this.state,t=e.opacity,n=e.scale;return{opacity:t,transform:this.context.reducedMotion.enabled?void 0:[{scale:n},{translateZ:0}]}};n.getDerivedStateFromProps=function(e,t){return e.mode!==t.mode?{animating:!0,mode:e.mode}:null};return n}(o.PureComponent);Gce.defaultProps={baseLayer:!1};Gce.contextType=LR.S;var Bce=function(e){Sce(n,e);var t=Rce(n);function n(){vce(this,n);return t.apply(this,arguments)}var o=n.prototype
;o.componentDidMount=function(){Yl.S.subscribe(M.CkL.LAYER_POP_ESCAPE_KEY,eh.xf)};o.componentWillUnmount=function(){Yl.S.unsubscribe(M.CkL.LAYER_POP_ESCAPE_KEY,eh.xf)};o.renderLayers=function(){var e=this,t=this.props,n=t.children,o=t.layers,i=t.hasFullScreenLayer,a=o.length,s=[];s.push((0,r.jsx)(Gce,{mode:0!==a||i?Lce:Zce,baseLayer:!0,children:n},"layer-base"));o.forEach((function(t,n){return s.push(e.renderComponent(t,n,a))}));return s};o.renderComponent=function(e,t,n){var o,i=t===n-1;o="string"==typeof e?Dce[e]():(0,r.jsx)(e,{});return(0,r.jsxs)(Gce,{mode:i?Zce:Lce,children:[(0,r.jsx)(kce,{}),o]},"layer-".concat(t))};o.renderArtisanalHack=function(){return(0,r.jsx)("div",{className:lh()(Oce().bg,(0,pV.Q)(this.props.sidebarTheme))})};o.render=function(){return(0,r.jsxs)(r.Fragment,{children:[this.renderArtisanalHack(),(0,r.jsx)(cJ.Z,{component:"div",className:lh()(Oce().layers,this.props.className),children:this.renderLayers()})]})};return n}(o.PureComponent);function Hce(e){
var t=(0,s.e7)([st.Z],(function(){return st.Z.darkSidebar}))?M.BRd.DARK:void 0,n=(0,s.e7)([T.Z],(function(){return T.Z.getLayers()})),o=(0,fE.QP)((function(e){return e.fullScreenLayers.length>0}));return(0,r.jsx)(Bce,Nce(Tce({},e),{sidebarTheme:t,layers:n,hasFullScreenLayer:o}))}var Vce=n(854735),Fce=n.n(Vce);function Yce(){var e=o.useRef(null),t=o.useCallback((function(t){var n=t.duration,r=t.intensity;if(!E.Z.useReducedMotion&&We.Z.isFocused()){var o=e.current;xh()(null!=o,"Shakeable is shaken when not mounted");o.shake(n,r)}}),[]);o.useEffect((function(){rh.Z.setLayout(ym.ZP);rh.Z.enable();return function(){return rh.Z.disable()}}),[]);o.useEffect((function(){Yl.S.subscribe(M.CkL.SHAKE_APP,t);return function(){Yl.S.unsubscribe(M.CkL.SHAKE_APP,t)}}),[t]);!function(){var e=(0,s.e7)([Km],(function(){return Km.hasIncomingCalls()})),t=(0,s.e7)([Cm.Z,Ja.Z,sp.Z],(function(){var e=Cm.Z.getTotalMentionCount(),t=Ja.Z.getPendingCount(),n=Cm.Z.hasAnyUnread(),r=sp.Z.getDisableUnreadBadge(),o=e+t
;0===o&&n&&!r&&(o=-1);return o}));o.useEffect((function(){if(e){var t=ss.default.bounceDock("critical"),n=(0,Am.EM)({messages:[Q.Z.Messages.INCOMING_CALL],count:50});return function(){null==t||t();n()}}}),[e]);o.useEffect((function(){Xm(t)}),[t]);o.useEffect((function(){return function(){return Xm(0)}}),[])}();return(0,r.jsxs)(c.F0h,{ref:e,className:Fce().app,children:[(0,r.jsx)(Hce,{className:Fce().layers,children:(0,r.jsx)(ise,{})}),(0,r.jsx)(cb,{}),(0,r.jsx)(Em,{}),(0,r.jsx)(vse,{}),(0,r.jsx)(_m.Z,{}),(0,r.jsx)(vm,{}),(0,r.jsx)(yce,{})]})}const zce=o.memo(Yce);var Wce=n(112184),Kce=n(219264),qce=n(313197),Xce=n(408481),Qce=n(502925),$ce=n.n(Qce);function Jce(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function ele(e){ele=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return ele(e)}function tle(e,t){return!t||"object"!==rle(t)&&"function"!=typeof t?function(e){
if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function nle(e,t){nle=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return nle(e,t)}var rle=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function ole(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=ele(e);if(t){var o=ele(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return tle(this,n)}}var ile=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&nle(e,t)}(n,e)
;var t=ole(n);function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var o,i;(o=t.call(this,e)).videoRef=null;o._noProblemsTimeout=null;o._problemsTimeout=null;o._connectedSound=o.createSound();o._loadingText=(i=[Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_1,Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_2,Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_3,Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_4,Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_5,Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_6.format({tabHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"tab",className:$ce().keybind},t)}}),Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_7,Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_8,Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_9,Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_10.format({F6Hook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"f6",className:$ce().keybind},t)},tabHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"tab",className:$ce().keybind},t)}
}),Q.Z.Messages.LOADING_LINE_1,Q.Z.Messages.LOADING_LINE_2,Q.Z.Messages.LOADING_LINE_4,Q.Z.Messages.LOADING_LINE_5,Q.Z.Messages.LOADING_LINE_6,Q.Z.Messages.LOADING_LINE_7,Q.Z.Messages.LOADING_LINE_8,Q.Z.Messages.LOADING_LINE_9,Q.Z.Messages.LOADING_LINE_10,Q.Z.Messages.LOADING_LINE_11,Q.Z.Messages.LOADING_LINE_12,Q.Z.Messages.LOADING_LINE_13,Q.Z.Messages.LOADING_LINE_14,Q.Z.Messages.LOADING_LINE_15,Q.Z.Messages.LOADING_TIP_1,Q.Z.Messages.LOADING_TIP_2,Q.Z.Messages.LOADING_TIP_3,Q.Z.Messages.LOADING_TIP_4,Q.Z.Messages.LOADING_TIP_5,Q.Z.Messages.LOADING_TIP_6,Q.Z.Messages.LOADING_TIP_7,Q.Z.Messages.LOADING_TIP_8,Q.Z.Messages.LOADING_TIP_9,Q.Z.Messages.LOADING_TIP_10,Q.Z.Messages.LOADING_TIP_11,Q.Z.Messages.LOADING_TIP_12,Q.Z.Messages.LOADING_TIP_13,Q.Z.Messages.LOADING_TIP_14,Q.Z.Messages.LOADING_TIP_15,Q.Z.Messages.LOADING_TIP_16,Q.Z.Messages.LOADING_TIP_17,Q.Z.Messages.LOADING_TIP_18,Q.Z.Messages.LOADING_TIP_19,Q.Z.Messages.LOADING_TIP_20,Q.Z.Messages.LOADING_TIP_21,Q.Z.Messages.LOADING_TIP_22,Q.Z.Messages.LOADING_TIP_23,Q.Z.Messages.LOADING_TIP_24,Q.Z.Messages.LOADING_TIP_25,Q.Z.Messages.LOADING_TIP_26,Q.Z.Messages.LOADING_TIP_27.format({
asterisks:"**"}),Q.Z.Messages.LOADING_KEYBIND_TIP_1.format({quickSwitcherHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"mod+k",className:$ce().keybind},t)}}),Q.Z.Messages.LOADING_KEYBIND_TIP_2.format({markUnreadHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"alt+click",className:$ce().keybind},t)}}),Q.Z.Messages.LOADING_KEYBIND_TIP_3.format({markServerUnreadHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"shift+esc",className:$ce().keybind},t)}}),Q.Z.Messages.LOADING_KEYBIND_TIP_4.format({navigateUnreadHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"shift+alt+up",className:$ce().keybind},t)},downHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"down",className:$ce().keybind},t)}}),Q.Z.Messages.LOADING_KEYBIND_TIP_5.format({keyboardShortcutsHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"mod+/",className:$ce().keybind},t)}}),Q.Z.Messages.LOADING_KEYBIND_TIP_6.format({messageNewlineHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"shift+return",
className:$ce().keybind},t)}}),Q.Z.Messages.LOADING_KEYBIND_TIP_7.format({shiftHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"shift",className:$ce().keybind},t)}}),Q.Z.Messages.LOADING_KEYBIND_TIP_8.format({upHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"up",className:$ce().keybind},t)}})])[Wa().random(i.length-1)];o.handleReady=function(){o.setState({ready:!0});if((0,Lt.nI)()){ss.default.send("UPDATED_QUOTES",["Hold Tight — Loading Discord"]);ss.default.send("UPDATE_OPEN_ON_STARTUP")}};o.setVideoRef=function(e){o.videoRef=e};o.setProblemsTimeout=function(){null==o._problemsTimeout&&(o._problemsTimeout=setTimeout((function(){return o.setState({problems:!0})}),1e4))};o.clearProblemsTimeout=function(){clearTimeout(o._problemsTimeout);o._problemsTimeout=null};var a=e.connected;o.state={ready:a,hide:a,problems:!1,shouldRender:!a,opacity:new ji.Z.Value(a?0:1)};o._connectedSound.volume=1;return o}var o=n.prototype;o.createSound=function(){var e=this.props.soundpack,t=(0,
am.uk)("discodo",e);t.volume=1;return t};o.componentDidMount=function(){this.setProblemsTimeout()};o.componentDidUpdate=function(e,t){var n=this,r=this.state,o=r.ready,i=r.hide,a=r.problems,s=r.opacity,c=this.props,l=c.connected,u=c.soundpack,f=c.reducedMotion,d=l&&o&&!i&&!a;e.soundpack!==u&&(this._connectedSound=this.createSound());if(e.connected!==l||d)if(l&&null!=this.videoRef){var p=Math.max(Math.ceil(1e3*(this.videoRef.duration-this.videoRef.currentTime)),600);clearTimeout(this._noProblemsTimeout);_e.Z.get(M.wli)&&this._connectedSound.play();f?this.setState({problems:!1,hide:l}):this._noProblemsTimeout=setTimeout((function(){n.setState({problems:!1,hide:l})}),p)}else this.setState({problems:!1,hide:l});else if(t.hide!==i){i?this.clearProblemsTimeout():this.setProblemsTimeout();this.setState({shouldRender:!0});ji.Z.timing(s,{toValue:i?0:1,duration:200}).start((function(){return n.setState({shouldRender:!i})}))}else t.problems!==a&&a&&f1.Z.checkIncidents()}
;o.componentWillUnmount=function(){this.clearProblemsTimeout();clearTimeout(this._noProblemsTimeout)};o.render=function(){if(this.state.shouldRender){var e=this._loadingText,t=null;if(null!=this.props.incident){e=this.props.incident.name;t=this.props.incident.incident_updates[0].body}return(0,r.jsxs)(ji.Z.div,{className:$ce().container,style:{opacity:this.state.opacity},children:[(0,r.jsxs)("div",{className:$ce().content,children:[(0,r.jsx)(Xce.Z,{autoPlay:!0,loop:!this.props.connected,setRef:this.setVideoRef,onReady:this.handleReady,className:this.state.ready?$ce().ready:""}),(0,r.jsxs)("div",{className:$ce().text,children:[null!=this.props.incident?null:(0,r.jsx)("div",{className:$ce().tipTitle,children:Q.Z.Messages.LOADING_DID_YOU_KNOW}),(0,r.jsx)("div",{className:null!=this.props.incident?$ce().title:$ce().tip,children:e}),(0,r.jsx)("div",{className:$ce().body,children:t})]})]}),(0,r.jsxs)("div",{className:lh()($ce().problems,Jce({},$ce().slideIn,this.state.problems)),children:[(0,
r.jsx)("div",{className:$ce().problemsText,children:Q.Z.Messages.CONNECTING_PROBLEMS_CTA}),(0,r.jsxs)("div",{children:[(0,r.jsxs)(c.eee,{className:$ce().twitterLink,href:(0,Wce.Z)(M.RK.TWITTER),target:"_blank",children:[(0,r.jsx)(qce.Z,{className:$ce().icon}),Q.Z.Messages.TWEET_US]}),(0,r.jsxs)(c.eee,{className:$ce().statusLink,href:M.yXt.STATUS,target:"_blank",children:[(0,r.jsx)(J0,{className:$ce().icon}),Q.Z.Messages.SERVER_STATUS]})]})]})]})}return null};return n}(o.PureComponent);const ale=s.ZP.connectStores([my.Z,Kce.Z,uce.Z,E.Z],(function(){return{isTryingToConnect:my.Z.isTryingToConnect(),connected:my.Z.isConnected(),incident:Kce.Z.getIncident(),soundpack:uce.Z.getSoundpack(),reducedMotion:E.Z.useReducedMotion}}))((function(e){var t=e.isTryingToConnect,n=e.connected,o=e.incident,i=e.soundpack,a=e.reducedMotion;return t?(0,r.jsx)(ile,{reducedMotion:a,soundpack:i,connected:n,incident:o}):null}));var sle=n(389740);n(705429);function cle(e,t){
if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lle(e){lle=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return lle(e)}function ule(e,t){return!t||"object"!==ple(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function fle(e,t){fle=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return fle(e,t)}var dle,ple=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function hle(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=lle(e);if(t){var o=lle(this).constructor;n=Reflect.construct(r,arguments,o)
}else n=r.apply(this,arguments);return ule(this,n)}}var Ele=new Uu.V7,yle=3e5;function mle(){if(null!=dle){if(null!=R.ZP.getSelfEmbeddedActivityForChannel(dle)){Lg.Z.sendBotMessage(dle,Q.Z.Messages.BOT_CALL_IDLE_DISCONNECT);d.default.selectVoiceChannel(null)}}}var ble=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&fle(e,t)}(n,e);var t=hle(n);function n(){cle(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(j.Z)};r.__getLocalVars=function(){return{currentChannelId:dle,_timeout:Ele,IDLE_TIMEOUT:yle}};return n}(s.ZP.Store);ble.displayName="CallIdleStore";new ble(O.Z,{CONNECTION_CLOSED:function(){dle=null;Ele.stop()},VOICE_STATE_UPDATES:function(e){return e.voiceStates.reduce((function(e,t){if(null!=t.guildId)return e;var n=j.Z.getCurrentClientVoiceChannelId(null)
;if(null==n){Ele.stop();return e}if(1===im.ZP.countVoiceStatesForChannel(n)){dle=n;Ele.start(yle,mle,!1)}else Ele.stop();return e}),!1)},EMBEDDED_ACTIVITY_DISCONNECT:function(){(0,_o.lm)(dle)&&1===im.ZP.countVoiceStatesForChannel(dle)&&Ele.start(yle,mle,!0)}});n(600958),n(227172),n(412732),n(881532),n(242928);var gle=n(32162);function Ole(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vle(e){vle=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return vle(e)}function _le(e,t){return!t||"object"!==Sle(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ile(e,t){Ile=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Ile(e,t)}var Sle=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Tle(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=vle(e);if(t){var o=vle(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _le(this,n)}}var Nle=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Ile(e,t)}(n,e);var t=Tle(n);function n(){Ole(this,n);return t.apply(this,arguments)}n.prototype.__getLocalVars=function(){return{NOTIFICATION_ICON_SIZE:64}};return n}(s.ZP.Store);Nle.displayName="UserAchievementStore";new Nle(O.Z,{USER_ACHIEVEMENT_UPDATE:function(e){var t=e.userAchievement,n=t.application_id,r=t.achievement
;if(100===t.percent_complete&&null!=r){var o=Rn.Z.getGame(n),i=null!=o?o.getIconURL(64):null;gle.default.showNotification(i,r.name,r.description,{notif_type:"USER_ACHIEVEMENT_UPDATE"},{omitViewTracking:!0})}}});n(69660),n(647428),n(223219),n(825781),n(424127),n(367891),n(425187),n(502569),n(353049),n(996246),n(431187),n(849172),n(533404),n(423427),n(266909),n(588415),n(747820),n(82443);var Ale=n(264076);n(866893),n(572615),n(926578),n(955089),n(524600),n(883650);function Cle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ple(e){Ple=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Ple(e)}function jle(e,t){return!t||"object"!==xle(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Rle(e,t){Rle=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Rle(e,t)}
var xle=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Mle(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Ple(e);if(t){var o=Ple(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return jle(this,n)}}var wle=288e5,Dle={};function Zle(e){if(null==e||e===M.ME||e===M.I_8)return!1;var t,n=null!==(t=Dle[e])&&void 0!==t?t:0;if(Date.now()<=n+wle)return!1;Dle[e]=Date.now();Ie.default.track(M.rMx.HIGHLIGHTS_TEST_LOADED,{guild_id:e})}var Lle=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}})
;t&&Rle(e,t)}(n,e);var t=Mle(n);function n(){Cle(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(e){this.waitFor(P.Z);null!=e&&(Dle=e.lastHighlightsLoadMillis)};r.getState=function(){return{lastHighlightsLoadMillis:Dle}};r.__getLocalVars=function(){return{FETCH_HIGHLIGHTS_THRESHOLD_MILLIS:wle,lastHighlightsLoadMillis:Dle}};return n}(s.ZP.PersistedStore);Lle.displayName="HighlightsTestStore";Lle.persistKey="HighlightsTestStore";new Lle(O.Z,{CONNECTION_OPEN:function(){return Zle(P.Z.getGuildId())},CHANNEL_SELECT:function(e){return Zle(e.guildId)}});var Ule=n(909647);function kle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gle(e){Gle=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Gle(e)}function Ble(e,t){return!t||"object"!==Vle(t)&&"function"!=typeof t?function(e){
if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Hle(e,t){Hle=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Hle(e,t)}var Vle=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Fle(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Gle(e);if(t){var o=Gle(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ble(this,n)}}var Yle={};function zle(e,t){var n=Yle[e];if(null==n)return!1;if(n.has(t))return!1;Yle[e]=new Set(n.add(t));return!0}var Wle=function(e){!function(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Hle(e,t)}(n,e);var t=Fle(n);function n(){kle(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(e){this.waitFor(Jn.default,Zt.Z);Yle={};null!=e&&Object.keys(e).forEach((function(t){var n=e[t];null!=n&&"function"==typeof n[Symbol.iterator]&&(Yle[t]=new Set(n))}))};r.getProgress=function(e){return Yle[e]};r.hasProgress=function(e){var t=Yle[e];return null!=t&&!t.has(Ule.Rg.DISMISSED)};r.getState=function(){return Yle};r.__getLocalVars=function(){return{guildProgress:Yle}};return n}(s.ZP.PersistedStore);Wle.displayName="GuildProgressStore";Wle.persistKey="GuildProgressStore";new Wle(O.Z,{CONNECTION_OPEN:function(){var e=[];Object.keys(Yle).forEach((function(t){Yle[t].has(Ule.Rg.COMPLETED)&&e.push(t)}));e.forEach((function(e){return zle(e,Ule.Rg.DISMISSED)}))},
GUILD_PROGRESS_INITIALIZE:function(e){var t=e.guildId;null==Yle[t]&&(Yle[t]=new Set);Yle[t].has(Ule.Rg.COMPLETED)||Yle[t].delete(Ule.Rg.DISMISSED)},GUILD_PROGRESS_COMPLETED_SEEN:function(e){var t=e.guildId;if(null==Yle[t])return!1;Yle[t]=new Set(Yle[t].add(Ule.Rg.COMPLETED))},GUILD_PROGRESS_DISMISS:function(e){return zle(e.guildId,Ule.Rg.DISMISSED)},GUILD_CREATE:function(e){var t=e.guild,n=t.id,r=t.member_count,o=Zt.Z.getGuild(n);if(null==o)return!1;if(o.ownerId===Jn.default.getId()&&null!=Yle[o.id]){null!=o.icon&&Yle[o.id].add(Ule.Rg.AVATAR);r>1&&Yle[o.id].add(Ule.Rg.INVITE)}},CHANNEL_CREATE:function(e){var t=e.channel;return null!=t&&null!=t.guild_id&&null!=Yle[t.guild_id]&&zle(t.guild_id,Ule.Rg.CHANNEL)},CHANNEL_UPDATES:function(e){var t=e.updates,n=!1,r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value.channel;null!=c&&null!=c.guild_id&&null!=Yle[c.guild_id]&&!1!==zle(c.guild_id,Ule.Rg.CHANNEL)&&(n=!0)}}catch(e){o=!0;i=e}finally{try{
r||null==s.return||s.return()}finally{if(o)throw i}}return n},GUILD_SETTINGS_SUBMIT_SUCCESS:function(e){var t=e.guild;return null!=t&&(null!=t.id&&null!=Yle[t.id]&&null!=t.icon&&zle(t.id,Ule.Rg.AVATAR))},MESSAGE_CREATE:function(e){var t=e.channelId,n=e.message,r=S.Z.getChannel(t);return n.author.id===Jn.default.getId()&&null!=r&&null!=Yle[r.guild_id]&&zle(r.guild_id,Ule.Rg.MESSAGE)},GUILD_MEMBER_LIST_UPDATE:function(e){var t=e.guildId,n=e.memberCount;return null!=Yle[t]&&n>1&&zle(t,Ule.Rg.INVITE)}});n(11879),n(832748),n(206932),n(833589);var Kle=n(994130),qle=n(978396),Xle=n(4798),Qle=n(649536);function $le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Jle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eue(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function tue(e,t,n){
tue="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=nue(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}};return tue(e,t,n||e)}function nue(e){nue=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return nue(e)}function rue(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function oue(e,t){return!t||"object"!==sue(t)&&"function"!=typeof t?function(e){
if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function iue(e,t){iue=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return iue(e,t)}function aue(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return $le(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $le(e,t)}(e,t)||function(){
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var sue=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function cue(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=nue(e);if(t){var o=nue(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return oue(this,n)}}var lue=new jn.Z("ChannelMessagePreviewStore"),uue={connected:!1,latestChannelMessages:{}},fue=1e3;var due=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,
writable:!0,configurable:!0}});t&&iue(e,t)}(n,e);var t=cue(n);function n(){Jle(this,n);var e;(e=t.apply(this,arguments)).throttledAppStatePersist=Wa().throttle((function(){return e.persist()}),fue,{leading:!1});return e}var r=n.prototype;r.initialize=function(e){if(null!=(null==e?void 0:e.latestChannelMessages)){Wa().update(e,"latestChannelMessages",(function(e){return Wa().chain(e).entries().map((function(e){var t=aue(e,2),n=t[0],r=t[1];return[n,new Xle.Z(r)]})).fromPairs().value()}));Wa().merge(uue.latestChannelMessages,null==e?void 0:e.latestChannelMessages)}this.waitFor(Ale.Z,Jn.default,Lb.Z)};r.persist=function(){lue.verbose("Persisting store");tue(nue(n.prototype),"persist",this).call(this)};r.getState=function(){var e;return rue(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){
return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){eue(e,t,n[t])}))}return e}({},uue),{latestChannelMessages:Wa().chain(uue.latestChannelMessages).entries().map((function(t){var n,r=aue(t,2),o=r[0],i=r[1];return[o,null!==(e=null===(n=i.toJS)||void 0===n?void 0:n.call(i))&&void 0!==e?e:void 0]})).fromPairs().value()})};r.latestMessage=function(e){return uue.latestChannelMessages[e]};r.latestMessages=function(){return uue.latestChannelMessages};r.__getLocalVars=function(){return{logger:lue,state:uue,MAX_WRITE_THROTTLE_MS:6e4,MAX_FORCE_WRITE_THROTTLE_MS:fue,store:pue}};return n}(s.ZP.PersistedStore);due.displayName="ChannelMessagePreviewStore";due.persistKey="ChannelMessagePreviewStore";due.throttleDelay=6e4;var pue=new due(O.Z,{CONNECTION_OPEN:function(){uue.connected=!0;return!1},CONNECTION_CLOSED:function(){uue.connected=!1;return!1},MESSAGE_CREATE:function(e){var t=e.message;if(!(0,qle.cn)())return!1;var n=uue.latestChannelMessages[t.channel_id]
;if(null==n||ho.Z.extractTimestamp(t.id)>ho.Z.extractTimestamp(null==n?void 0:n.id)){var r=(0,Qle.e5)(t);if(null!=r){uue.latestChannelMessages[t.channel_id]=r;return!0}}return!1},CHANNEL_MESSAGE_PREVIEW_LOAD_MESSAGES:function(e){var t=e.messages;if(!(0,qle.cn)())return!1;var n=!0,r=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=i.value;uue.latestChannelMessages[s.channel_id]=(0,Qle.e5)(s)}}catch(e){r=!0;o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}},LOAD_MESSAGES_SUCCESS:function(e){var t=e.messages;if(!(0,qle.cn)()||0===t.length)return!1;var n=(0,Qle.e5)(t[0]),r=uue.latestChannelMessages[n.getChannelId()];ho.Z.compare(n.id,null==r?void 0:r.id)>-1&&(uue.latestChannelMessages[n.getChannelId()]=n)},LOCAL_MESSAGES_LOADED:function(e){var t;if(!(0,qle.cn)()||0===e.messages.length)return!1;(0,Kle.Z)(e.messages)
;ho.Z.compare(e.messages[0].id,null===(t=uue.latestChannelMessages[e.channelId])||void 0===t?void 0:t.id)>0&&(uue.latestChannelMessages[e.channelId]=(0,Qle.e5)(e.messages[0]))},APP_STATE_UPDATE:function(e){var t=e.state;((0,Lt.Dt)()?M.$7l.BACKGROUND:M.$7l.INACTIVE)===t&&uue.connected&&pue.throttledAppStatePersist();return!1},WINDOW_FOCUS:function(e){e.focused||pue.throttledAppStatePersist();return!1},MESSAGE_DELETE:function(e){var t=e.id,n=e.channelId;if(!(0,qle.cn)())return!1;var r=uue.latestChannelMessages[n];if(null!=r&&r.id===t){delete uue.latestChannelMessages[n];var o=Lb.Z.getMessages(n).last();null!=o&&(uue.latestChannelMessages[n]=o)}}});n(858311),n(560837),n(877778),n(523649),n(798808),n(218086),n(78551),n(79308),n(359067),n(487685),n(29975),n(96483);function hue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Eue(e){Eue=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)}
;return Eue(e)}function yue(e,t){return!t||"object"!==bue(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function mue(e,t){mue=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return mue(e,t)}var bue=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function gue(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Eue(e);if(t){var o=Eue(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return yue(this,n)}}var Oue,vue="ActivityTrackingStore",_ue=18e5,Iue=3e5,Sue=null!==(Oue=_e.Z.get(vue))&&void 0!==Oue?Oue:{},Tue={},Nue=!1;function Aue(e){
var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t&&Cue(e,!0);var n=Tue[e.applicationId];if(null!=n){n.stop();delete Tue[e.applicationId]}delete Sue[e.applicationId];_e.Z.set(vue,Sue)}function Cue(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Date.now(),r=null!=e.updatedAt?n-e.updatedAt:0;r>21e5&&(r=0);vu.Z.updateActivity({applicationId:e.applicationId,distributor:e.isDiscordApplication?M.GQo.DISCORD:e.distributor,shareActivity:(0,u3.OT)(e.applicationId,Ln.Z),token:e.token,duration:Math.floor(r/1e3),closed:t});e.updatedAt=n;var o=Tue[e.applicationId];null==o&&(o=Tue[e.applicationId]=new Uu.Xp).start(_ue,(function(){return Cue(e)}));if(!t){Sue[e.applicationId]=e;_e.Z.set(vue,Sue)}}function Pue(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=ze.ZP.getRunningGames(),n=new Set,r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value,l=c.name,u=c.distributor,f=Rn.Z.getGameByName(l)
;if(null!=f){n.add(f.id);f.id in Sue||Cue({applicationId:f.id,updatedAt:Date.now(),distributor:u})}}}catch(e){o=!0;i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}var d=!0,p=!1,h=void 0;try{for(var E,y=Object.keys(Sue)[Symbol.iterator]();!(d=(E=y.next()).done);d=!0){var m=E.value;n.has(m)||Aue(Sue[m],e)}}catch(e){p=!0;h=e}finally{try{d||null==y.return||y.return()}finally{if(p)throw h}}}function jue(){var e=!0,t=!1,n=void 0;try{for(var r,o=Object.keys(Sue)[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var i=r.value;Aue(Sue[i])}}catch(e){t=!0;n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}Nue=!1}var Rue=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&mue(e,t)}(n,e);var t=gue(n);function n(){hue(this,n);return t.apply(this,arguments)}var r=n.prototype
;r.initialize=function(){this.waitFor(ze.ZP,lt.Z,Ln.Z);this.syncWith([lt.Z],Pue)};r.getActivities=function(){return Sue};r.__getLocalVars=function(){return{STORAGE_KEY:vue,ACTIVITY_WINDOW:_ue,ACTIVITY_WINDOW_GRACE_PERIOD:Iue,CLOSE_AUTHENTICATION_FAILED:4004,applicationActivities:Sue,applicationIntervals:Tue,hasUpdatedOnConnectionOpen:Nue}};return n}(s.ZP.Store);Rue.displayName="ActivityTrackingStore";new Rue(O.Z,{RUNNING_GAMES_CHANGE:function(){return Pue()},CONNECTION_OPEN:function(){if(Nue)return!1;var e=!0,t=!1,n=void 0;try{for(var r,o=Object.keys(Sue)[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var i=r.value;Cue(Sue[i])}}catch(e){t=!0;n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}Pue(!1);Nue=!0},CONNECTION_CLOSED:function(e){4004===e.code&&jue()},LOGOUT:jue,ACTIVITY_UPDATE_SUCCESS:function(e){var t=e.applicationId,n=e.token,r=Sue[t];if(null==r)return!1;r.token=n;_e.Z.set(vue,Sue)},ACTIVITY_UPDATE_FAIL:function(e){var t=e.applicationId,n=Sue[t]
;if(null==n)return!1;n.token=null;n.updatedAt=null;_e.Z.set(vue,Sue)}});n(711338),n(180172),n(8489),n(610773),n(82863),n(381186),n(592981),n(490989),n(996077),n(440031),n(213818),n(70321);function xue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1;r.configurable=!0;"value"in r&&(r.writable=!0);Object.defineProperty(e,r.key,r)}}function wue(e){wue=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return wue(e)}function Due(e,t){return!t||"object"!==Lue(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Zue(e,t){Zue=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Zue(e,t)}var Lue=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Uue(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=wue(e);if(t){var o=wue(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Due(this,n)}}var kue=864e5,Gue={},Bue=function(){Gue={guildAffinitiesByGuildId:{},guildAffinities:[],lastFetched:0}};Bue();var Hue=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Zue(e,t)}(n,e);var t=Uue(n);function n(){xue(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(e){null!=e&&(Gue=e);this.waitFor(Zt.Z)};r.getState=function(){return Gue};r.getGuildAffinity=function(e){
return Gue.guildAffinitiesByGuildId[e]};r.__getLocalVars=function(){return{AFFINITY_DATA_TTL:kue,state:Gue,setDefaultState:Bue}};!function(e,t,n){t&&Mue(e.prototype,t);n&&Mue(e,n)}(n,[{key:"affinities",get:function(){return Gue.guildAffinities}},{key:"hasRequestResolved",get:function(){return 0!==Gue.lastFetched}}]);return n}(s.ZP.PersistedStore);Hue.displayName="GuildAffinitiesStore";Hue.persistKey="GuildAffinitiesStore";new Hue(O.Z,{CONNECTION_OPEN:function(){Date.now()-Gue.lastFetched>kue&&cs.Z.get({url:M.ANM.GUILD_AFFINITIES,oldFormErrors:!0}).then((function(e){var t=e.body.guild_affinities;O.Z.dispatch({type:"LOAD_GUILD_AFFINITIES_SUCCESS",guildAffinities:t})}),(function(){O.Z.dispatch({type:"LOAD_GUILD_AFFINITIES_FAILURE"})}));return!1},LOAD_GUILD_AFFINITIES_SUCCESS:function(e){var t=e.guildAffinities;Gue.guildAffinities=[];Gue.guildAffinitiesByGuildId={};Gue.lastFetched=Date.now();t.forEach((function(e,t){var n=e.affinity,r=e.guild_id,o={score:n,guildId:r,index:t}
;Gue.guildAffinitiesByGuildId[r]=o;Gue.guildAffinities.push(o)}))},LOGOUT:function(){Bue()}});n(984216),n(512291),n(746477),n(470758),n(869160),n(558095),n(279812),n(371689),n(977528),n(40134),n(66768),n(876296),n(107218),n(688013),n(107403),n(256727);function Vue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fue(e){Fue=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Fue(e)}function Yue(e,t){return!t||"object"!==Wue(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function zue(e,t){zue=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return zue(e,t)}var Wue=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Kue(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Fue(e);if(t){var o=Fue(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Yue(this,n)}}function que(){return!0}var Xue=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&zue(e,t)}(n,e);var t=Kue(n);function n(){Vue(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(Ale.Z)};r.getExperimentAssignment=function(e,t){return Ale.Z.getGuildExperimentDescriptor(t,e)};r.__getLocalVars=function(){return{}};return n}(s.ZP.Store);Xue.displayName="GuildExperimentStore";new Xue(O.Z,{LOGOUT:que,LOGIN_SUCCESS:que,CONNECTION_OPEN:que,
EXPERIMENTS_FETCH_SUCCESS:que,OVERLAY_INITIALIZE:que,CACHE_LOADED:que,EXPERIMENTS_FETCH_FAILURE:que,EXPERIMENT_REGISTER_LEGACY:que,EXPERIMENT_OVERRIDE_BUCKET:que});n(430091);n(727266);function Que(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $ue(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Jue(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){$ue(i,r,o,a,s,"next",e)}function s(e){$ue(i,r,o,a,s,"throw",e)}a(void 0)}))}}function efe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tfe(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function nfe(e){nfe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return nfe(e)}function rfe(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&sfe(e,t)}function ofe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){tfe(e,t,n[t])}))}return e}function ife(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))
;return e}function afe(e,t){return!t||"object"!==cfe(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function sfe(e,t){sfe=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return sfe(e,t)}var cfe=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function lfe(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=nfe(e);if(t){var o=nfe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return afe(this,n)}}var ufe=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},
"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ffe=!1;s.ZP.initialize();Xf.loadServer();if(Lt.FB){
ss.default.on("USER_SETTINGS_OPEN",(function(){T.Z.getLayers().includes(M.S9g.USER_SETTINGS)||h.Z.open(M.oAB.ACCOUNT)}));ss.default.on("LAUNCH_APPLICATION",(function(e,t){var n=Ln.Z.getActiveLibraryApplication(t);nm.playApplication(t,n,{analyticsParams:{location:{page:M.ZY5.DIRECT,object:M.qAy.WEB_URL}}})}))}var dfe=s.ZP.connectStores([my.Z,yy.Z,Jn.default],(function(){return{isConnected:my.Z.isConnected(),defaultRoute:yy.Z.defaultRoute,defaultRouteFallback:yy.Z.fallbackRoute,token:Jn.default.getToken()}}))(function(e){rfe(n,e);var t=lfe(n);function n(){efe(this,n);return t.apply(this,arguments)}var o=n.prototype;o.componentDidMount=function(){var e=this.props.match;null!=e&&null!=e.params.inviteCode&&function(e){ur.apply(this,arguments)}({code:e.params.inviteCode})};o.render=function(){var e=this.props,t=e.isConnected,n=e.defaultRoute,o=e.token,i=e.defaultRouteFallback;if(null==o)return(0,r.jsx)(a.l_,{to:M.Z5c.DEFAULT_LOGGED_OUT});if(t){var s=vfe(n)
;return null==s||(s.params.guildId===M.ME||null!=Zt.Z.getGuild(s.params.guildId))&&null!=S.Z.getChannel(s.params.channelId)?(0,r.jsx)(a.l_,{to:n}):(0,r.jsx)(a.l_,{to:i})}return null};return n}(o.Component));var pfe,hfe=(0,Ve.e)(zce,null,{passProps:!1}),Efe=(0,Ve.e)((function(e){var t=e.match.params,o=t.applicationId,i=t.section;(0,by.h)(Jue((function(){return ufe(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(n.bind(n,570272))];case 1:(0,e.sent().openApplicationDirectoryModal)({applicationId:o,directoryDisabled:!1,section:hr(sle.c,i)});return[2]}}))})));return(0,r.jsx)(a.l_,{to:yy.Z.defaultRoute})})),yfe=[M.Z5c.GUILD_BOOSTING_MARKETING(":guildId")].concat(function(e){if(Array.isArray(e))return Que(e)}(pfe=Array.from(Ig.Vg).map((function(e){return M.Z5c.CHANNEL(":guildId",e)})))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(pfe)||function(e,t){if(e){if("string"==typeof e)return Que(e,t)
;var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);return"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Que(e,t):void 0}}(pfe)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());function mfe(e){var t=e.params,n=t.guildId,r=t.channelId,o=void 0===r?null:r,i=t.messageId,a=void 0===i?null:i,s=t.threadId,c=void 0===s?null:s;return{guildId:null!=n?n:M.ME,channelId:o,messageId:a,threadId:c}}var bfe=[{path:[M.Z5c.APP_WITH_INVITE_AND_GUILD_ONBOARDING(":inviteCode")],render:function(e){var t=e.match;return(0,r.jsx)(dfe,{match:t})},isSessionRequired:!0},{path:[M.Z5c.APP],render:function(){return(0,r.jsx)(dfe,{})},isSessionRequired:!0},{path:[M.Z5c.USERS(":id")],render:function(e){var t=e.match,n=e.location,o=(0,i.parse)(n.search).friend_token,s=t.params.id;(0,
by.h)((function(){return(0,xp.m)({userId:s,guildId:M.ME,friendToken:o,analyticsLocation:{section:M.jXE.DIRECT_ROUTE_ACCESS}})}));return(0,r.jsx)(a.l_,{to:yy.Z.defaultRoute})}},{path:[M.Z5c.APPLICATION_LIBRARY_ACTION(":gameId",":action")],render:function(e){var t=e.match.params,n=t.gameId,o=t.action;qy.Z.whenInitialized((function(){Ln.Z.whenInitialized((function(){switch(o){case"launch":var e=Ln.Z.getActiveLibraryApplication(n);if(null==e)return;nm.playApplication(e.id,e,{analyticsParams:{location:{page:M.ZY5.DIRECT,object:M.qAy.WEB_URL}}});break;case"test-mode":Xn.Z.whenInitialized((function(){return p.Wt(n)}));break;case"uninstall":var t=Ln.Z.getActiveLibraryApplication(n);if(null==t)return;(0,u.W)(t.id,t.branchId,M.Sbl.URI_SCHEME)}}))}));return(0,r.jsx)(a.l_,{to:M.Z5c.APPLICATION_LIBRARY})}},{path:[M.Z5c.GUILD_CREATE],render:function(){(0,by.h)((function(){return wt.Z.openCreateGuildModal({location:"External link"})}));return(0,r.jsx)(a.l_,{to:yy.Z.defaultRoute})}},{
path:[M.Z5c.PICK_GUILD_SETTINGS(":section?",":subsection?")],render:function(e){var t=e.match.params,n=t.section,o=t.subsection,s=(0,i.parse)(location.search).feature;(0,by.h)((function(){return gr({section:hr(M.pNK,n),subsection:hr(M.KsC,o),feature:s})}));return(0,r.jsx)(a.l_,{to:yy.Z.defaultRoute})},isSessionRequired:!0},{path:[M.Z5c.SETTINGS(":section",":subsection?")],render:function(e){var t,n,o=e.match,s=e.location,c=/-/g,l=null===(t=o.params.section)||void 0===t?void 0:t.toUpperCase().replace(c,"_"),u=null===(n=o.params.subsection)||void 0===n?void 0:n.toUpperCase().replace(c,"_"),f=(0,zE.Z)({}).filter((function(e){var t;return!1===(null===(t=e.predicate)||void 0===t?void 0:t.call(e))})).map((function(e){return e.section}));if(M.oAB.hasOwnProperty(l)&&(["SESSIONS"].includes(l)||!f.includes(M.oAB[l]))&&(null==u||""===u||M.oAB.hasOwnProperty(u)&&!f.includes(M.oAB[u]))){var d=(0,i.parse)(s.search).source;(0,by.h)((function(){return h.Z.open(M.oAB[l],u,{openWithoutBackstack:!1,
impressionSource:d})}))}return(0,r.jsx)(a.l_,{to:yy.Z.defaultRoute})},isSessionRequired:!0},{path:[M.Z5c.USER_GUILD_NOTIFICATION_SETTINGS(":guildId")],render:function(e){var t=e.match.params.guildId;(0,by.h)((function(){(0,c.ZDy)(Jue((function(){var e,o;return ufe(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(45829)]).then(n.bind(n,845829))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,ife(ofe({},e),{guildId:t}))}]}}))})))}));return(0,r.jsx)(a.l_,{to:M.Z5c.CHANNEL(t)})},isSessionRequired:!0},{path:[M.Z5c.APPLICATION_LIBRARY_INVENTORY],render:function(){(0,by.h)((function(){return h.Z.open(M.oAB.INVENTORY)}));return(0,r.jsx)(a.l_,{to:yy.Z.defaultRoute})},isSessionRequired:!0},{path:[M.Z5c.WELCOME(":guildId?",":channelId?")],render:function(e){var t=e.match.params,n=t.guildId,o=t.channelId;(0,po.c)(So.M5.MARKETING_UNCLAIMED);var i=M.Z5c.CHANNEL(n,o);return(0,r.jsx)(a.l_,{to:i})},isSessionRequired:!0},{
path:[M.Z5c.GUILD_EVENT_DETAILS(":guildId?",":guildEventId")],render:function(e){var t=e.match.params,n=t.guildId,o=t.guildEventId;(0,by.h)((function(){(0,dr.bO)({eventId:o})}));return(0,r.jsx)(a.l_,{to:M.Z5c.CHANNEL(n)})},isSessionRequired:!0},{path:[M.Z5c.GUILD_SETTINGS(":guildId",":section?",":subsection?")],render:function(e){var t=e.match.params,n=t.guildId,o=t.section,i=t.subsection;(0,by.h)((function(){pr.Z.open(n,hr(M.pNK,o),void 0,hr(M.KsC,i))}));return(0,r.jsx)(a.l_,{to:M.Z5c.CHANNEL(n)})},isSessionRequired:!0,isChatRoute:!0},{path:[M.Z5c.CHANNEL_THREAD_VIEW(":guildId",":channelId",":threadId"),M.Z5c.CHANNEL(":guildId",":channelId?",":messageId?"),M.Z5c.ACTIVITY,M.Z5c.APPLICATION_LIBRARY,M.Z5c.APPLICATION_STORE,M.Z5c.MESSAGE_REQUESTS,M.Z5c.GUILD_DISCOVERY,M.Z5c.GUILD_MEMBER_VERIFICATION(":guildId",":inviteCode?"),M.Z5c.GUILD_MEMBER_VERIFICATION_FOR_HUB(":guildId",":inviteCode?"),M.Z5c.GUILD_BOOSTING_MARKETING(":guildId"),M.Z5c.FEATURE(":feature"),M.Z5c.PARENT_TOOLS],
render:hfe,isSessionRequired:!0,isChatRoute:!0},{path:[M.Z5c.APPLICATION_DIRECTORY(":applicationId?",":section?")],render:Efe,isSessionRequired:!0}];function gfe(e){if(!my.Z.isConnected()&&!my.Z.isTryingToConnect()){var t=Jn.default.getToken();if(null!=t){var n=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=bfe[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var s=o.value,c=s.path;if(s.isSessionRequired){var l=(0,a.LX)(e,{path:c});if(null!=l)return l}}}catch(e){n=!0;r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return null}(e);null!=n&&l.Z.startSession(t)}}}function Ofe(e){var t=vfe(e);if(null!=t){var n=mfe(t),r=n.guildId,o=n.channelId,i=n.messageId,s=n.threadId,c=(0,Ya.S)(r),l=(0,Ya.c)(o),u=(0,Ya.c)(s),p=P.Z.getGuildId(),h=p!==r;c&&h&&f.Z.selectGuild(r);if(c&&l){var E=C.Z.getChannelId(p),y=E!==o;if(!ffe||h||y||null!=i){ffe=!0;d.default.selectChannel({guildId:r,channelId:o,messageId:i})}if(null!=s&&u){var m=ap.ZP.getCurrentSidebarChannelId(E)
;null!=o&&null!=s&&m!==s&&cd.Z.openThreadAsSidebar({guildId:r,baseChannelId:o,channelId:s})}else null==o||y||cd.Z.closeChannelSidebar(o);var b=fo.getIsOpen(),g=y&&b,O=!h&&!y;if(o===Ig.oC.ROLE_SUBSCRIPTIONS)eo();else if(h&&b){var v=null==p&&r===M.ME,_=e===M.Z5c.GUILD_DISCOVERY;v||_?eo():to()}else(g||O)&&eo()}else(function(e){return yfe.some((function(t){var n;return!0===(null===(n=(0,a.LX)(e,t))||void 0===n?void 0:n.isExact)}))})(e)||(0,K.dL)(yy.Z.fallbackRoute)}}function vfe(e){var t=!0,n=!1,r=void 0;try{for(var o,i=bfe[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var s=o.value,c=s.path;if(s.isChatRoute){var l=(0,a.LX)(e,{path:c});if(null!=l)return l}}}catch(e){n=!0;r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return null}function _fe(e){var t=e.channelId,n=e.guildId,r=e.pathname;if(my.Z.isConnected()){(0,K.s1)().location.pathname===r&&(null==S.Z.getChannel(t)?(0,K.dL)(M.Z5c.CHANNEL(n)):(0,K.dL)(r))}}var Ife=function(e){rfe(i,e);var t=lfe(i);function i(){
efe(this,i);var e;(e=t.apply(this,arguments)).historyUnlisten=function(){};e.rewriterUnlisten=function(){};return e}var s=i.prototype;s.componentDidMount=function(){Ot.initialize();ss.default.setZoomFactor(E.Z.zoom);He.initialize();Xf.init();at.initialize();ki.initialize();Yn.initialize();Dn();Ey.initialize();qn();na.Z.initialize();$r.initialize();y.Z.init();rr();Qn();Yo.initialize();ge.initialize();Cn.initialize();Ga.initialize();F.initialize();ry.initialize();Pi.initialize();g.Z.initialize();or.Z.init();_r();Ky();tm();b.Z.initialize();Rp();Oy.Z.init();gy.Z.init();IE.init();kd.initialize();tp.initialize();Jp.initialize();BE();cn.initialize();m.Z.initialize();sd.initialize();jd.initialize();ai.Z.initialize();ii.initialize();yi.initialize();Mt.initialize();Ir.Z.init({hasModalOpen:c.$sL,openModal:function(){return(0,c.ZDy)(Jue((function(){var e,t;return ufe(this,(function(o){switch(o.label){case 0:return[4,Promise.resolve().then(n.bind(n,966658))];case 1:e=o.sent(),t=e.default
;return[2,function(e){return(0,r.jsx)(t,ofe({},e))}]}}))})))}});Qt();Jr.Z.initialize();Va.Z.initialize();ta.initialize();_a.initialize();qt.initialize();this.rewriterUnlisten=Fa.Z.addRouteRewriter(this.ensureChannelMatchesGuild);this.historyUnlisten=Fa.Z.addRouteChangeListener(this.handleHistoryChange)};s.componentWillUnmount=function(){Ot.terminate();Yn.terminate();Ey.terminate();na.Z.terminate();ki.terminate();at.terminate();He.terminate();F.terminate();ry.terminate();g.Z.terminate();Ga.terminate();Pi.terminate();Jp.terminate();b.Z.terminate();cn.terminate();Jr.Z.terminate();m.Z.terminate();Va.Z.terminate();sd.terminate();jd.terminate();ai.Z.terminate();ii.terminate();yi.terminate();Mt.terminate();ta.terminate();_a.terminate();qt.terminate();this.historyUnlisten();this.rewriterUnlisten()};s.handleHistoryChange=function(e){var t=e.pathname;gfe(t);Ofe(t)};s.ensureChannelMatchesGuild=function(e){if(!my.Z.isConnected())return null;var t=e.pathname,n=vfe(t);if(null==n)return null
;var r=mfe(n),o=r.guildId,i=r.channelId,a=r.threadId,s=(0,Ya.S)(o)&&o!==M.ME&&o!==M.I_8;if(null!=i&&(0,Ya.c)(i)&&!(0,Ig.AB)(i)&&s){var c=S.Z.getChannel(i);if(null==c)np.Z.loadThread(i).then((function(){return _fe({channelId:i,guildId:o,pathname:t})}));else if(c.guild_id!==o)return{path:M.Z5c.CHANNEL(o),state:e.state};if(null!=a){if(!((0,Ya.c)(a)&&!(0,Ig.AB)(i)))return null;var l=S.Z.getChannel(a);if(null==l)np.Z.loadThread(a).then((function(){return _fe({channelId:a,guildId:o,pathname:t})}));else if((null==l?void 0:l.parent_id)!==i){cd.Z.closeChannelSidebar(i);return{path:M.Z5c.CHANNEL(o,i),state:e.state}}}}return null};s.render=function(){return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsxs)(a.rs,{children:[(0,r.jsx)(a.l_,{exact:!0,from:"/channels",to:"/"}),bfe.map((function(e){var t=e.path,n=e.render;return(0,r.jsx)(a.AW,{path:t,render:n},t[0])})),(0,r.jsx)(a.l_,{to:"/"})]}),(0,r.jsx)(ale,{})]})};return i}(o.PureComponent);const Sfe=Ife},219402:(e,t,n)=>{"use strict";n.d(t,{HZ:()=>r,
d$:()=>o,Of:()=>s});var r,o,i=n(213192),a=n.n(i);!function(e){e[e.OTHER=0]="OTHER";e[e.GIFTING_REFUND=1]="GIFTING_REFUND";e[e.BUYERS_REMORSE=2]="BUYERS_REMORSE";e[e.WRONG_PURCHASE=3]="WRONG_PURCHASE";e[e.FORGOT_TO_CANCEL=4]="FORGOT_TO_CANCEL";e[e.SERVER_BOOSTING_COOLDOWN=5]="SERVER_BOOSTING_COOLDOWN";e[e.USER_CONFUSION=6]="USER_CONFUSION";e[e.WANT_TO_SWITCH_TIERS=7]="WANT_TO_SWITCH_TIERS";e[e.DONT_NEED=8]="DONT_NEED"}(r||(r={}));!function(e){e[e.OTHER=0]="OTHER";e[e.ALREADY_REFUNDED=1]="ALREADY_REFUNDED";e[e.NOT_USER_REFUNDABLE_TYPE=2]="NOT_USER_REFUNDABLE_TYPE";e[e.PAST_REFUNDABLE_DATE=3]="PAST_REFUNDABLE_DATE";e[e.ENTITLEMENT_ALREADY_CONSUMED=4]="ENTITLEMENT_ALREADY_CONSUMED";e[e.ALREADY_REFUNDED_PREMIUM=5]="ALREADY_REFUNDED_PREMIUM";e[e.ALREADY_REFUNDED_PREMIUM_GUILD=6]="ALREADY_REFUNDED_PREMIUM_GUILD"}(o||(o={}));var s=Object.freeze(a()({Authorised:null,Error:null}))},415324:(e,t,n)=>{"use strict";n.d(t,{b:()=>s,Z:()=>c});var r=n(785893),o=(n(667294),n(707961)),i=n(473708)
;function a(e){switch(e){case"brl":return i.Z.Messages.BRL_NAME;case"pln":return i.Z.Messages.PLN_NAME;case"try":return i.Z.Messages.TRY_NAME;case"usd":return i.Z.Messages.USD_NAME;case"aud":return i.Z.Messages.AUD_NAME;case"pen":return i.Z.Messages.PEN_NAME;case"php":return i.Z.Messages.PHP_NAME;case"ars":return i.Z.Messages.ARS_NAME;case"cop":return i.Z.Messages.COP_NAME;case"clr":return i.Z.Messages.CLR_NAME;case"jpy":return i.Z.Messages.JPY_NAME;case"idr":return i.Z.Messages.IDR_NAME;case"vnd":return i.Z.Messages.VND_NAME;case"thb":return i.Z.Messages.THB_NAME;case"myr":return i.Z.Messages.MYR_NAME;case"krw":return i.Z.Messages.KRW_NAME;case"mxn":return i.Z.Messages.MXN_NAME;case"bgn":return i.Z.Messages.BGN_NAME;case"czk":return i.Z.Messages.CZK_NAME;case"dkk":return i.Z.Messages.DKK_NAME;case"huf":return i.Z.Messages.HUF_NAME;case"ron":return i.Z.Messages.RON_NAME;case"sek":return i.Z.Messages.SEK_NAME;case"eur":return i.Z.Messages.EUR_NAME;default:return""}}function s(e){
var t=e.currencies,n=e.className,o=e.children;return t.length<2?null:(0,r.jsx)("div",{className:n,children:o})}const c=function(e){var t=e.currencies,n=e.onChange,i=e.selectedCurrency,s=e.className,c=e.disabled,l=void 0!==c&&c;if(t.length<2)return null;var u=t.map((function(e,t){return{key:t,value:e,label:"".concat(e.toUpperCase()," - ").concat(a(e))}}));return(0,r.jsx)(o.q4e,{value:i,options:u,onChange:function(e){null!=e&&n(e)},className:s,isDisabled:l})}},794249:(e,t,n)=>{"use strict";n.d(t,{Z:()=>S});var r=n(785893),o=n(667294),i=n(294184),a=n.n(i),s=n(707961),c=n(283124),l=n(370521),u=n(107364),f=n(926696),d=n(264628),p=n(421281),h=n(473708),E=n(348909),y=n.n(E);function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1;r.configurable=!0;"value"in r&&(r.writable=!0);Object.defineProperty(e,r.key,r)}}function g(e){
g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return g(e)}function O(e,t){return!t||"object"!==_(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function v(e,t){v=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return v(e,t)}var _=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=g(e);if(t){var o=g(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return O(this,n)}}var S=function(e){!function(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&v(e,t)}(n,e);var t=I(n);function n(){m(this,n);return t.apply(this,arguments)}var o=n.prototype;o.getLabel=function(e){return e instanceof l.dm?h.Z.Messages.PAYMENT_SOURCE_CARD_ENDING.format({brand:(0,p.De)(e.brand),last_4:e.last4
}):e instanceof l.qo?h.Z.Messages.PAYMENT_SOURCE_PAYPAL:e instanceof l.Sf?h.Z.Messages.PAYMENT_SOURCE_SOFORT:e instanceof l.fv?h.Z.Messages.PAYMENT_SOURCE_GIROPAY:e instanceof l.Vg?h.Z.Messages.PAYMENT_SOURCE_PRZELEWY24:e instanceof l.sn?h.Z.Messages.PAYMENT_SOURCE_PAYSAFE_CARD:e instanceof l.o_?h.Z.Messages.PAYMENT_SOURCE_GCASH:e instanceof l.kX?h.Z.Messages.PAYMENT_SOURCE_GRABPAY:e instanceof l.z?h.Z.Messages.PAYMENT_SOURCE_MOMO_WALLET:e instanceof l.Xc?h.Z.Messages.PAYMENT_SOURCE_VENMO:e instanceof l.Om?h.Z.Messages.PAYMENT_SOURCE_KAKAOPAY:e instanceof l.JC?h.Z.Messages.PAYMENT_SOURCE_GOPAY_WALLET:e instanceof l.U4?h.Z.Messages.PAYMENT_SOURCE_BANCONTACT:e instanceof l.jc?h.Z.Messages.PAYMENT_SOURCE_IDEAL_WITH_BANK.format({bank:(0,c.YE)(e.bank)}):e instanceof l.D0?h.Z.Messages.PAYMENT_SOURCE_EPS_WITH_BANK.format({bank:(0,c.Ul)(e.bank)}):h.Z.Messages.PAYMENT_SOURCE_UNKNOWN};o.renderDescription=function(){var e=this.props,t=e.paymentSource,n=e.descriptionClassName;return(0,
r.jsx)(s.xvT,{className:a()(y().description,n),variant:"text-md/semibold",children:this.getLabel(t)})};o.renderSubText=function(){var e=this.props,t=e.paymentSource,n=e.locale,r=null;t instanceof l.dm?r=h.Z.Messages.PAYMENT_SOURCE_CARD_EXPIRES.format({month:(0,d.E2)(t.expiresMonth,n),year:t.expiresYear}):t instanceof l.qo||t instanceof l.Sf||t instanceof l.Vg?r=t.email:t instanceof l.Xc&&(r="@"+t.username);return r};o.render=function(){var e=this.props,t=e.isDefault,n=e.paymentSource,o=e.showSubtext,i=e.isForSubscription,a=this.renderSubText();return(0,r.jsxs)(u.Z,{children:[(0,r.jsx)(f.ZP,{type:this.typeString}),(0,r.jsxs)(u.Z,{direction:u.Z.Direction.VERTICAL,className:y().descriptionWrapper,children:[(0,r.jsxs)(u.Z,{align:u.Z.Align.CENTER,children:[this.renderDescription(),t?(0,r.jsx)("div",{className:y().defaultIndicator,children:h.Z.Messages.DEFAULT}):null,i?(0,r.jsx)("div",{className:y().premiumIndicator,children:h.Z.Messages.PAYMENT_SOURCE_SUBSCRIPTION}):null,n.invalid?(0,
r.jsx)("div",{className:y().invalidIndicator,children:h.Z.Messages.PAYMENT_SOURCE_INVALID}):null]}),o&&null!=a?(0,r.jsx)("div",{className:y().subText,children:a}):null]})]})};!function(e,t,n){t&&b(e.prototype,t);n&&b(e,n)}(n,[{key:"typeString",get:function(){var e=this.props.paymentSource;return e instanceof l.qo?f.ZP.Types.PAYPAL:e instanceof l.Sf?f.ZP.Types.SOFORT:e instanceof l.dm?f.ZP.getType(e.brand):e instanceof l.fv?f.ZP.Types.GIROPAY:e instanceof l.Vg?f.ZP.Types.PRZELEWY24:e instanceof l.sn?f.ZP.Types.PAYSAFECARD:e instanceof l.o_?f.ZP.Types.GCASH:e instanceof l.kX?f.ZP.Types.GRABPAY:e instanceof l.z?f.ZP.Types.MOMO_WALLET:e instanceof l.Xc?f.ZP.Types.VENMO:e instanceof l.Om?f.ZP.Types.KAKAOPAY:e instanceof l.JC?f.ZP.Types.GOPAY_WALLET:e instanceof l.U4?f.ZP.Types.BANCONTACT:e instanceof l.D0?f.ZP.Types.EPS:e instanceof l.jc?f.ZP.Types.IDEAL:f.ZP.Types.UNKNOWN}}]);return n}(o.PureComponent);S.defaultProps={isForSubscription:!1,isDefault:!1,showSubtext:!1}},487683:(e,t,n)=>{
"use strict";n.d(t,{Z:()=>yt});var r=n(785893),o=n(667294),i=n(294184),a=n.n(i),s=n(441143),c=n.n(s),l=n(457217),u=n(202351),f=n(707961),d=n(744564),p=n(673679),h=n(458922),E=n(810978),y=n(914964),m=n(169376),b=n(661123),g=n(370521),O=n(177774),v=n(54709),_=n(2590),I=n(203600);function S(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1;r.configurable=!0;"value"in r&&(r.writable=!0);Object.defineProperty(e,r.key,r)}}function T(e){T=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return T(e)}function N(e,t){return!t||"object"!==C(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function A(e,t){A=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return A(e,t)}var C=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=T(e);if(t){var o=T(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return N(this,n)}}var j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&A(e,t)}(n,e);var t=P(n);function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var r;(r=t.call(this)).id=e.id;r.amount=e.amount;r.amountRefunded=e.amountRefunded;r.createdAt=e.createdAt;r.currency=e.currency;r.description=e.description;r.paymentSource=e.paymentSource;r.status=e.status;r.tax=e.tax
;r.taxInclusive=e.taxInclusive;r.subscription=e.subscription;r.skuId=e.skuId;r.skuPrice=e.skuPrice;r.sku=e.sku;r.flags=e.flags;r.downloadableInvoice=e.downloadableInvoice;r.downloadableRefundInvoices=e.downloadableRefundInvoices;r.premiumRefundDisqualificationReasons=e.premiumRefundDisqualificationReasons;return r}n.createFromServer=function(e){var t=null!=e.payment_source?g.ZP.createFromServer(e.payment_source):null,r=null!=e.sku?O.Z.createFromServer(e.sku):null,o=null!=e.subscription?v.Z.createFromServer(e.subscription):null;return new n({id:e.id,createdAt:new Date(e.created_at),currency:e.currency,tax:e.tax,taxInclusive:e.tax_inclusive,amount:e.amount,amountRefunded:e.amount_refunded,status:e.status,metadata:e.metadata,description:e.description,paymentSource:t,paymentGateway:e.payment_gateway,paymentGatewayPaymentId:e.payment_gateway_payment_id,flags:e.flags,subscription:o,skuId:e.sku_id,skuPrice:e.sku_price,sku:r,downloadableInvoice:e.downloadable_invoice,
downloadableRefundInvoices:e.downloadable_refund_invoices,premiumRefundDisqualificationReasons:e.premium_refund_disqualification_reasons})};!function(e,t,n){t&&S(e.prototype,t);n&&S(e,n)}(n,[{key:"isPurchasedViaApple",get:function(){return this.paymentGateway===_.gg$.APPLE}},{key:"isPurchasedViaGoogle",get:function(){return this.paymentGateway===_.gg$.GOOGLE}},{key:"isPurchasedExternally",get:function(){return this.isPurchasedViaApple||this.isPurchasedViaGoogle}},{key:"isSubscription",get:function(){return null!=this.subscription}},{key:"isPremiumSubscription",get:function(){return null!=this.subscription&&I.dJ.has(this.subscription.planId)}},{key:"isPremiumGuildSubscription",get:function(){return null!=this.subscription&&null!=this.subscription.additionalPlans.find((function(e){var t=e.planId;return I.Z1.has(t)}))}},{key:"isGift",get:function(){return b.yE(this.flags,_.Hrn.GIFT)}},{key:"isPremiumGift",get:function(){return this.isGift&&Object.values(I.Si).includes(this.skuId)}},{
key:"isPreorder",get:function(){return b.yE(this.flags,_.Hrn.PREORDER)}}]);return n}(m.Z);function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M(e){M=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return M(e)}function w(e,t){return!t||"object"!==L(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function D(e,t){D=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return D(e,t)}function Z(e){return function(e){if(Array.isArray(e))return R(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return R(e,t)
;var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var L=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=M(e);if(t){var o=M(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return w(this,n)}}var k=[];function G(e){
var t=e.payment,n=j.createFromServer(t),r=k.findIndex((function(e){return e.id===t.id}));if(-1===r){k.push(n);k.sort((function(e,t){return t.createdAt.getTime()-e.createdAt.getTime()}))}else k[r]=n;k=Z(k)}var B=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&D(e,t)}(n,e);var t=U(n);function n(){x(this,n);return t.apply(this,arguments)}var r=n.prototype;r.getPayment=function(e){return k.find((function(t){return t.id===e}))};r.getPayments=function(){return k};r.__getLocalVars=function(){return{payments:k}};return n}(u.ZP.Store);B.displayName="PaymentStore";const H=new B(d.Z,{BILLING_PAYMENTS_FETCH_SUCCESS:function(e){var t=e.payments,n=!0,r=!1,o=void 0;try{for(var i,a=function(){var e=i.value,t=j.createFromServer(e),n=k.findIndex((function(t){return t.id===e.id}));-1!==n?k[n]=t:k.push(t)
},s=t[Symbol.iterator]();!(n=(i=s.next()).done);n=!0)a()}catch(e){r=!0;o=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw o}}k.sort((function(e,t){return t.createdAt.getTime()-e.createdAt.getTime()}));k=Z(k)},PAYMENT_UPDATE:G,BILLING_PAYMENT_FETCH_SUCCESS:G,LOGOUT:function(){k=[]}});var V=n(551778),F=n(536392),Y=n(107364),z=n(249697),W=n(136317),K=n(473708),q=n(857425),X=n.n(q);function Q(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function $(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function J(e,t){
if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}const ee=o.forwardRef((function(e,t){var n=e.currentPageIndex,o=e.numPages,i=e.onChangePage,s=e.children,c=e.className,l=e.showPageCount,u=void 0===l||l,d=J(e,["currentPageIndex","numPages","onChangePage","children","className","showPageCount"]),p=n<=0,h=n>=o-1;return(0,r.jsxs)("div",$(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Q(e,t,n[t])}))}return e}({
className:a()(X().paginator,c),ref:t},d),{children:[s,(0,r.jsxs)("div",{className:X().pageActions,children:[(0,r.jsx)(f.P3F,{className:a()(X().pageButtonPrev,Q({},X().disabled,p)),tabIndex:p?-1:0,onClick:p?void 0:function(){return i(n-1)},children:(0,r.jsx)(z.Z,{className:X().pageButtonIcon,"aria-label":K.Z.Messages.PAGINATION_PREVIOUS})}),u?(0,r.jsx)("div",{className:X().pageIndicator,children:K.Z.Messages.PAGINATOR_OF_PAGES.format({currentPage:n+1,numPages:o})}):(0,r.jsx)("div",{className:X().pageIndicator,children:K.Z.Messages.PAGINATOR_CURRENT_PAGE.format({currentPage:n+1})}),(0,r.jsx)(f.P3F,{className:a()(X().pageButtonNext,Q({},X().disabled,h)),tabIndex:h?-1:0,onClick:h?void 0:function(){return i(n+1)},children:(0,r.jsx)(W.Z,{className:X().pageButtonIcon,"aria-label":K.Z.Messages.PAGINATION_NEXT})})]})]}))}))
;var te=n(850841),ne=n(213192),re=n.n(ne),oe=n(730381),ie=n.n(oe),ae=n(410111),se=n(333398),ce=n(513586),le=n(600277),ue=n(959207),fe=n(711531),de=n(575136),pe=n(641277),he=n(926696),Ee=n(718831),ye=n(621329),me=n(189865),be=n(799043),ge=n(95891),Oe=n(70145),ve=n(249052),_e=n(794249),Ie=(0,n(260561).B)({id:"2021-08_user_initiated_refunds",label:"User Initiated Refunds",kind:"user",defaultConfig:{enabled:!1},treatments:[{id:0,label:"Control",config:{enabled:!1}},{id:1,label:"Can refund",config:{enabled:!0}}]});function Se(){var e=Ie.getCurrentConfig({}).enabled;Ie.trackExposure({});return e}var Te=n(219402),Ne=n(488462),Ae=n(100321),Ce=n.n(Ae);function Pe(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function je(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Pe(i,r,o,a,s,"next",e)}function s(e){Pe(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Re(e,t){
if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1;r.configurable=!0;"value"in r&&(r.writable=!0);Object.defineProperty(e,r.key,r)}}function Me(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function we(e){we=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return we(e)}function De(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Me(e,t,n[t])}))}return e}function Ze(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e)
;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Le(e,t){return!t||"object"!==ke(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ue(e,t){Ue=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Ue(e,t)}var ke=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Ge(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=we(e);if(t){
var o=we(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Le(this,n)}}var Be=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2]
;a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},He=function(e){return"https://".concat(_.xr4,"/hc/").concat(e.toLowerCase(),"/requests/new?ticket_form_id=360000118612")},Ve=[_.epS.DURABLE_PRIMARY,_.epS.DURABLE,_.epS.CONSUMABLE],Fe=re()({TIME_PLAYED:null,PURCHASE_DATE:null,SKU_TYPE:null,ALREADY_REFUNDED:null,PAYMENT_STATUS:null,PAYMENT_GATEWAY:null,SKU_STICKER_PACK:null,SUBSCRIPTION_TYPE:null});function Ye(e){switch(e){case Te.d$.ALREADY_REFUNDED_PREMIUM:return K.Z.Messages.BILLING_REFUND_ALREADY_REFUNDED_PREMIUM_REASON;case Te.d$.ALREADY_REFUNDED_PREMIUM_GUILD:return K.Z.Messages.BILLING_REFUND_ALREADY_REFUNDED_PREMIUM_GUILD_REASON;case Te.d$.ENTITLEMENT_ALREADY_CONSUMED:return K.Z.Messages.BILLING_REFUND_ALREADY_CONSUMED_REASON;default:return K.Z.Messages.BILLING_REFUND_GENERIC_REASON}}
var ze=[_.PyE.FAILED,_.PyE.REVERSED,_.PyE.CANCELED],We=[Ne.gg.APPLE],Ke=function(e){var t=e.description,n=e.cost;return(0,r.jsx)("li",{className:Ce().paymentDetail,children:(0,r.jsxs)(Y.Z,{justify:Y.Z.Justify.BETWEEN,children:[(0,r.jsx)("div",{children:t}),(0,r.jsx)("div",{children:n})]})})},qe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Ue(e,t)}(i,e);var t=Ge(i);function i(){Re(this,i);var e;(e=t.apply(this,arguments)).state={expanded:!1};e.refundRules=[{rule:Fe.TIME_PLAYED,canRefund:function(){if(e.isSkuPreorder)return!0;var t=e.timePlayed;return null==t||t.asMilliseconds()<ie().duration(2,"hours").asMilliseconds()}},{rule:Fe.PURCHASE_DATE,canRefund:function(){var t=e.props.payment;if(e.isSkuPreorder)return!0;var n=t.isPremiumSubscription||t.isPremiumGuildSubscription||t.isPremiumGift?5:14
;return e.daysSincePurchase<=n}},{rule:Fe.SKU_TYPE,canRefund:function(){var t=e.props.payment;return null==t.sku||t.sku.type!==_.epS.CONSUMABLE}},{rule:Fe.ALREADY_REFUNDED,canRefund:function(){var t=e.props.payment;return t.amountRefunded<t.amount}},{rule:Fe.PAYMENT_STATUS,canRefund:function(){var t=e.props.payment;return!ze.includes(t.status)}},{rule:Fe.PAYMENT_GATEWAY,canRefund:function(){var t=e.props.payment;return null==t.paymentGateway||!We.includes(t.paymentGateway)}},{rule:Fe.SKU_STICKER_PACK,canRefund:function(){var t=e.props.payment;return null==t.sku||!(0,b.yE)(t.sku.flags,_.l4R.STICKER_PACK)}},{rule:Fe.SUBSCRIPTION_TYPE,canRefund:function(){var t,n,r=e.props.payment;return(null===(t=r.subscription)||void 0===t?void 0:t.type)!==_.NYc.GUILD&&(null===(n=r.subscription)||void 0===n?void 0:n.type)!==_.NYc.APPLICATION}}];e.handleExpandInfo=function(){e.setState({expanded:!e.state.expanded})};return e}var s=i.prototype;s.validateRefundRules=function(){
return this.refundRules.filter((function(e){return!(0,e.canRefund)()})).map((function(e){return e.rule}))};s.renderStatus=function(){var e=this.props.payment;switch(e.status){case _.PyE.PENDING:return(0,r.jsx)("span",{className:Ce().statusTagGrey,children:K.Z.Messages.BILLING_TAG_PENDING});case _.PyE.FAILED:return(0,r.jsx)("span",{className:Ce().statusTagRed,children:K.Z.Messages.BILLING_TAG_FAILED});case _.PyE.REFUNDED:return e.amountRefunded!==e.amount?(0,r.jsx)("span",{className:Ce().statusTagGreen,children:K.Z.Messages.BILLING_TAG_PARTIALLY_REFUNDED}):(0,r.jsx)("span",{className:Ce().statusTagGreen,children:K.Z.Messages.BILLING_TAG_REFUNDED});case _.PyE.REVERSED:return(0,r.jsx)("span",{className:Ce().statusTagRed,children:K.Z.Messages.BILLING_TAG_REVERSED});case _.PyE.CANCELED:return(0,r.jsx)("span",{className:Ce().statusTagRed,children:K.Z.Messages.BILLING_TAG_CANCELED});default:return null}};s.renderPrice=function(){var e=this.props.payment,t=e.amount-e.amountRefunded;return(0,
r.jsx)("span",{className:Ce().price,children:(0,ve.T4)(t,e.currency)})};s.renderPaymentBreakdown=function(){var e=this.props,t=e.payment,n=e.locale,i=t.taxInclusive,s=t.tax,c=t.amount,l=t.amountRefunded,u=t.currency;return(0,r.jsxs)("div",{className:a()(Ce().paymentText,Ce().paymentBreakdown),children:[null!=t.paymentSource?(0,r.jsx)(_e.Z,{paymentSource:t.paymentSource,locale:n,descriptionClassName:Ce().paymentText}):null,(0,r.jsxs)("ul",{children:[!i&&s>0?(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(Ke,{description:t.description,cost:(0,ve.T4)(c-s,u)}),(0,r.jsx)(Ke,{description:K.Z.Messages.BILLING_PAYMENT_BREAKDOWN_TAXES,cost:(0,ve.T4)(s,u)})]}):null,(0,r.jsx)(Ke,{description:K.Z.Messages.BILLING_PAYMENT_BREAKDOWN_TOTAL,cost:(0,ve.T4)(c,u)}),l>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ke,{description:K.Z.Messages.BILLING_PAYMENT_BREAKDOWN_REFUNDED,cost:(0,ve.T4)(l,u)}),(0,r.jsx)(Ke,{description:K.Z.Messages.BILLING_PAYMENT_BREAKDOWN_NET,cost:(0,ve.T4)(c-l,u)})]})]})]})}
;s.renderInvoiceDownload=function(){var e=this.props.payment;return null==e.downloadableInvoice||""===e.downloadableInvoice?null:(0,r.jsxs)("div",{className:Ce().downloadInvoice,children:[(0,r.jsx)(f.eee,{href:e.downloadableInvoice,children:K.Z.Messages.BILLING_DOWNLOAD_INVOICE}),null!=e.downloadableRefundInvoices?e.downloadableRefundInvoices.map((function(e,t){return(0,r.jsx)(f.eee,{className:Ce().downloadRefundInvoice,href:e,children:K.Z.Messages.BILLING_DOWNLOAD_REFUND_INVOICE},t)})):null]})};s.renderRefundDetails=function(){var e=this.props,t=e.locale,n=e.payment,i=this.validateRefundRules();if(i.includes(Fe.PAYMENT_GATEWAY)||i.includes(Fe.PAYMENT_STATUS)||i.includes(Fe.ALREADY_REFUNDED)||i.includes(Fe.SKU_STICKER_PACK)||i.includes(Fe.SUBSCRIPTION_TYPE))return null;var a,s=0===i.length,c=He(t),l=this.isPremium?5:14;a=i.includes(Fe.SKU_TYPE)?K.Z.Messages.BILLING_APPLICATION_CONSUMABLE_REFUND_TEXT_UNABLE.format({supportURL:c
}):s?n.isPreorder&&this.isSkuPreorder?K.Z.Messages.BILLING_PREORDER_REFUND_TEXT.format({supportURL:c}):n.isPremiumSubscription||n.isPremiumGuildSubscription?K.Z.Messages.BILLING_PREMIUM_REFUND_TEXT.format({dateLimit:l,supportURL:c}):n.isGift?K.Z.Messages.BILLING_GIFT_REFUND_TEXT.format({dateLimit:l,supportURL:c}):K.Z.Messages.BILLING_APPLICATION_REFUND_TEXT.format({dateLimit:l,playtimeLimit:2,supportURL:c}):n.isGift?K.Z.Messages.BILLING_GIFT_REFUND_TEXT_UNABLE.format({dateLimit:l}):n.isPremiumSubscription||n.isPremiumGuildSubscription?K.Z.Messages.BILLING_PREMIUM_REFUND_TEXT_UNABLE.format({dateLimit:l}):K.Z.Messages.BILLING_APPLICATION_REFUND_TEXT_UNABLE.format({dateLimit:l,playtimeLimit:2});this.isPremium&&Se()&&(a=null);return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(f.H,{className:Ce().paymentHeader,children:K.Z.Messages.BILLING_REFUND_HEADER}),(0,r.jsxs)("div",{className:Ce().paymentText,children:[(0,r.jsx)("div",{children:a}),this.renderRefundActions(i)]})]})}
;s.renderRefundCriteria=function(e,t,n,o){return(0,r.jsxs)("div",{className:Ce().refundCriteria,children:[(0,r.jsx)(f.H,{className:Ce().refundSubHeader,children:e}),(0,r.jsxs)("div",{className:Ce().refundIconContainer,children:[(0,r.jsx)(t,{className:Ce().refundCriteriaIcon}),null!=n&&(0,r.jsx)("div",{children:n})]})]},o)};s.renderRefundActions=function(e){var t,o=this.props,i=o.locale,a=o.payment;if(this.isSkuPreorder||e.includes(Fe.SKU_TYPE))return null;var s,c=e.includes(Fe.PURCHASE_DATE)?me.Z:ye.Z,l=e.includes(Fe.TIME_PLAYED)||(null===(t=a.premiumRefundDisqualificationReasons)||void 0===t?void 0:t.includes(Te.d$.PAST_REFUNDABLE_DATE))?me.Z:ye.Z;if(!this.isPremium||!Se())return(0,r.jsxs)("div",{className:Ce().refundActions,children:[(0,r.jsxs)("div",{className:Ce().refundRules,children:[this.renderRefundCriteria(a.isPreorder?K.Z.Messages.BILLING_REFUND_RELEASE_DATE_SUBHEADER:K.Z.Messages.BILLING_REFUND_PURCHASE_DATE_SUBHEADER,c,K.Z.Messages.BILLING_REFUND_PURCHASE_DATE.format({
daysSincePurchase:this.daysSincePurchase})),a.isSubscription||a.isGift?null:this.renderRefundCriteria(K.Z.Messages.BILLING_REFUND_PLAY_TIME_SUBHEADER,l,null!=this.timePlayed?this.timePlayed.humanize():K.Z.Messages.BILLING_REFUND_PLAY_TIME_NEVER_PLAYED)]}),(0,r.jsx)(f.eee,{href:He(i),children:K.Z.Messages.BILLING_REFUND_REPORT_A_PROBLEM})]});var u=(null!==(s=a.premiumRefundDisqualificationReasons)&&void 0!==s?s:[Te.d$.OTHER])[0],d=null!=u||0!==e.length||a.isPurchasedExternally;return(0,r.jsxs)("div",{className:Ce().refundActions,children:[(0,r.jsx)(f.ua7,{shouldShow:d,text:Ye(u),children:function(e){return(0,r.jsx)(f.zxk,Ze(De({},e),{color:f.zxk.Colors.PRIMARY,disabled:d,onClick:function(){return(0,f.ZDy)(je((function(){var e,t;return Be(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(80099)]).then(n.bind(n,480099))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,De({payment:a,reportProblemUrl:He(i)},e))}]}}))})))},
children:K.Z.Messages.BILLING_REFUND_BUTTON_TEXT}))}}),(0,r.jsx)(f.eee,{href:He(i),children:K.Z.Messages.BILLING_REFUND_REPORT_A_PROBLEM})]})};s.renderDescription=function(){var e,t,n=this.props,i=n.compactMode,a=n.payment,s=n.application,l=n.stickerPack,u=this.state.expanded,d=a.sku,p=a.subscription,h=null!=a.paymentSource&&_.Uk1.has(a.paymentSource.type);if(null!=p&&0!==p.items.length){var E=[],y=null;if(p.type===_.NYc.PREMIUM)p.items.forEach((function(e){var t=e.planId,n=e.quantity;if((0,te.PV)(t)){E.push(te.ZP.getDisplayName(t,!1,h));y=I.GP[t].skuId}else{E.push("".concat(n>1?"".concat(n,"x "):"").concat(te.ZP.getDisplayName(t,!1,h)));null==y&&(y=I.GP[t].skuId)}}));else if(p.type===_.NYc.GUILD){var m=V.Z.get(p.items[0].planId);c()(null!=m,"Guild subscription plan should already have been loaded");var b=m.interval===I.rV.YEAR?K.Z.Messages.YEARLY_GUILD_SUBSCRIPTION:K.Z.Messages.MONTHLY_GUILD_SUBSCRIPTION;E.push(b.format({planName:m.name}));y=m.skuId
}else if(p.type===_.NYc.APPLICATION){var g=V.Z.get(p.items[0].planId);c()(null!=g,"Application subscription plan should already have been loaded");null!=s?E.push(K.Z.Messages.MONTHLY_APPLICATION_SUBSCRIPTION_V2.format({tier:null==d?void 0:d.name})):E.push(K.Z.Messages.APPLICATION_SUBSCRIPTION_FROM_DELETED_APPLICATION);y=g.skuId}t=E.join(", ");e=(0,r.jsx)(pe.Z,{className:Ce().descriptionIcon,game:s,size:pe.Z.Sizes.XSMALL,skuId:y})}else if(null!=d){t=a.isPreorder?K.Z.Messages.PREORDER_SKU_NAME.format({name:d.name}):d.name;if(null!=l){var O=(0,ce.Zt)(l);e=(0,r.jsx)(le.ZP,{disableAnimation:!u,isInteracting:u,sticker:O,className:Ce().descriptionIcon,size:24})}else e=(0,r.jsx)(pe.Z,{className:Ce().descriptionIcon,game:s,size:pe.Z.Sizes.XSMALL,skuId:d.id})}else{e=(0,r.jsx)(ge.Z,{className:Ce().descriptionIcon});t=a.description}var v=(0,r.jsx)("div",{className:Ce().date,children:(0,Oe.vc)(ie()(a.createdAt),"MM/DD/YYYY")}),S=a.isGift?(0,r.jsx)(f.ua7,{
text:K.Z.Messages.BILLING_GIFT_PURCHASE_TOOLTIP,children:function(e){return(0,r.jsx)(be.Z,De({className:Ce().giftIcon},e))}}):null;return i?(0,r.jsxs)("div",{className:Ce().description,children:[e,(0,r.jsxs)("div",{children:[t,v]}),S]}):(0,r.jsxs)(o.Fragment,{children:[v,(0,r.jsxs)("div",{className:Ce().description,children:[e,(0,r.jsx)("div",{children:t}),S]})]})};s.renderExpandedSection=function(){return(0,r.jsx)(f.P3F,{onClick:function(e){return e.stopPropagation()},children:(0,r.jsxs)("div",{className:Ce().expandedInfo,children:[(0,r.jsx)(f.H,{className:Ce().paymentHeader,children:K.Z.Messages.BILLING_PURCHASE_DETAILS_HEADER}),this.renderPaymentBreakdown(),this.renderInvoiceDownload(),this.renderRefundDetails()]})})};s.render=function(){var e=this,t=this.props,n=t.payment,o=t.className,i=t.compactMode,s=this.state.expanded;return(0,r.jsx)(l.mh,{id:n.id,children:function(t){return(0,r.jsxs)(f.P3F,Ze(De({onClick:e.handleExpandInfo,
className:a()(s?Ce().payment:Ce().hoverablePayment,o,Me({},Ce().compact,i)),focusProps:{offset:4}},t),{children:[(0,r.jsxs)(Y.Z,{className:Ce().summaryInfo,align:Y.Z.Align.CENTER,children:[e.renderDescription(),(0,r.jsxs)("div",{className:Ce().amount,children:[e.renderStatus(),e.renderPrice()]}),(0,r.jsx)(Ee.Z,{className:Ce().expand,direction:s?Ee.Z.Directions.UP:Ee.Z.Directions.DOWN})]}),s?e.renderExpandedSection():null]}))}})};!function(e,t,n){t&&xe(e.prototype,t);n&&xe(e,n)}(i,[{key:"timePlayed",get:function(){var e=this.props.applicationStatistics;return null!=e&&null!=e.total_discord_sku_duration?ie().duration(e.total_discord_sku_duration,"seconds"):null}},{key:"daysSincePurchase",get:function(){var e=this.props.payment,t=null!=e.sku?e.sku.releaseDate:null,n=null!=t&&t.isAfter(e.createdAt)?t:e.createdAt;return ie()().diff(n,"days")}},{key:"isSkuPreorder",get:function(){var e=this.props.payment;return null!=e.sku&&e.sku.isPreorder()}},{key:"isPremium",get:function(){
var e=this.props.payment;return e.isPremiumSubscription||e.isPremiumGuildSubscription||e.isPremiumGift}},{key:"typeString",get:function(){var e=this.props.payment.paymentSource;return e instanceof g.qo?he.ZP.Types.PAYPAL:e instanceof g.dm?he.ZP.getType(e.brand):he.ZP.Types.UNKNOWN}}]);return i}(o.PureComponent);qe.defaultProps={compactMode:!1};function Xe(e){var t,n,i=e.payment,a=e.locale,s=e.compactMode,c=e.className,l=null!=i.sku&&Ve.includes(i.sku.type)?i.sku.applicationId:null,f=null===(t=i.sku)||void 0===t?void 0:t.applicationId,d=(null===(n=i.subscription)||void 0===n?void 0:n.type)===_.NYc.APPLICATION,p=(0,u.cj)([de.Z,ue.Z,fe.Z],(function(){return{applicationStatistics:null!=l?de.Z.getCurrentUserStatisticsForApplication(l):null,gameApplication:null!=l?ue.Z.getGame(l):null,paymentSources:fe.Z.paymentSources}})),h=p.applicationStatistics,E=p.gameApplication,y=p.paymentSources,m=(0,u.e7)([se.Z],(function(){return null!=f?se.Z.getApplication(f):null}));o.useEffect((function(){
d&&null!=f&&(0,ae.i6)(f)}),[f,d]);return(0,r.jsx)(qe,{applicationStatistics:h,application:d?m:E,stickerPack:null,paymentSources:y,locale:a,compactMode:s,className:c,payment:i})}var Qe=n(288436),$e=n.n(Qe);function Je(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function et(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1;r.configurable=!0;"value"in r&&(r.writable=!0);Object.defineProperty(e,r.key,r)}}function nt(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function rt(e){rt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return rt(e)}function ot(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){nt(e,t,n[t])}))}return e}function it(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function at(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r]
;t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function st(e,t){return!t||"object"!==ut(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ct(e,t){ct=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return ct(e,t)}function lt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Je(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n)
;if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Je(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ut=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function ft(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=rt(e);if(t){var o=rt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return st(this,n)}}var dt=10;function pt(e){var t=e.payments,n=e.locale,i=e.compactMode,s=e.numPages,c=o.useRef(null),u=lt(o.useState(0),2),d=u[0],h=u[1],E=lt(o.useState(null),2),m=E[0],b=E[1],g=t.slice(d*dt,(d+1)*dt)
;o.useEffect((function(){var e;null===(e=c.current)||void 0===e||e.scrollTo({to:0})}),[d]);var O=o.useCallback((function(e){h(e);var n=t[t.length-1].id;if(e===s-1&&m!==n){(0,p.cQ)(dt,n);b(n)}}),[t,s,m]),v=(0,y.Z)("billing-history",c);return(0,r.jsx)(l.bG,{navigator:v,children:(0,r.jsx)(l.SJ,{children:function(e){var t=e.ref,o=at(e,["ref"]);return(0,r.jsx)(ee,it(ot({className:a()($e().verticalFit,$e().paginator),currentPageIndex:d,onChangePage:O,numPages:s,ref:t},o),{children:(0,r.jsx)(f.Den,{className:$e().bottomDivider,ref:c,children:g.map((function(e,t){return(0,r.jsx)(Xe,{className:a()($e().paymentRow,$e().bottomDivider),payment:e,locale:n,compactMode:i},t)}))})}))}})})}var ht=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&ct(e,t)}(n,e);var t=ft(n);function n(){et(this,n);var e
;(e=t.apply(this,arguments)).scrollerRef=o.createRef();return e}var i=n.prototype;i.componentDidMount=function(){d.Z.wait((function(){(0,h.N)();(0,p.cQ)(20)}))};i.renderPremiumExternalSubscription=function(e){c()(null!=e.paymentGateway,"Expected payment gateway when rendering for external subscription");return(0,r.jsxs)(f.Zbd,{className:$e().externalRow,children:[(0,r.jsx)("div",{className:$e().externalRowHeader,children:K.Z.Messages.BILLING_EXTERNAL_HEADER.format({paymentGatewayName:Ne.Vz[e.paymentGateway]})}),(0,r.jsx)("div",{className:$e().externalRowBody,children:K.Z.Messages.BILLING_EXTERNAL_DESCRIPTION.format({paymentGatewayName:Ne.Vz[e.paymentGateway],billingHistoryLink:(0,te.JE)(e.paymentGateway,"BILLING_HISTORY")})})]})};i.render=function(){var e=this.props,t=e.compactMode,n=e.payments,o=e.subscription,i=e.locale,s=null!=o&&o.isPurchasedExternally;return 0!==n.length||s?(0,r.jsxs)("div",{className:$e().verticalFit,
children:[null!=o&&s?this.renderPremiumExternalSubscription(o):null,n.length>0?(0,r.jsxs)("div",{className:a()($e().paymentPane,$e().verticalFit),children:[t?null:(0,r.jsx)("div",{className:a()($e().paymentRow,$e().bottomDivider),children:(0,r.jsxs)(Y.Z,{className:$e().paymentRowHeader,children:[(0,r.jsx)("div",{className:Ce().date,children:K.Z.Messages.BILLING_PAYMENT_TABLE_HEADER_DATE}),(0,r.jsx)("div",{className:$e().paymentRowHeaderDescription,children:K.Z.Messages.BILLING_PAYMENT_TABLE_HEADER_DESCRIPTION}),(0,r.jsx)("div",{className:Ce().amount,children:K.Z.Messages.BILLING_PAYMENT_TABLE_HEADER_AMOUNT})]})}),(0,r.jsx)(pt,{compactMode:t,locale:i,payments:n,numPages:this.numPages})]}):null]}):null};!function(e,t,n){t&&tt(e.prototype,t);n&&tt(e,n)}(n,[{key:"numPages",get:function(){return Math.max(Math.ceil(this.props.payments.length/dt),1)}}]);return n}(o.PureComponent);ht.defaultProps={compactMode:!1};function Et(e){
var t,n=e.skuId,r=null===(t=e.subscription)||void 0===t?void 0:t.items[0].planId;return!(null==n||null==r||Object.values(I.Si).includes(n)||(0,te.PV)(r))}function yt(e){var t=(0,u.e7)([H],(function(){return H.getPayments()})),n=(0,u.e7)([F.Z],(function(){return F.Z.getPremiumTypeSubscription()})),i=o.useMemo((function(){return new Set(t.filter(Et).map((function(e){var t=e.subscription;return null==t?void 0:t.items[0].planId})))}),[t]),a=o.useMemo((function(){return new Set(t.filter(Et).map((function(e){return e.skuId})))}),[t]),s=(0,u.Wu)([V.Z],(function(){return V.Z.getPlanIdsForSkus(Array.from(a))})),c=o.useCallback((function(){return s.length===i.size}),[s,i]);o.useEffect((function(){c()||d.Z.wait((function(){a.forEach((function(e){return(0,E.GZ)(e,void 0,void 0,!0,void 0)}))}))}),[c,a]);return(0,r.jsx)(ht,it(ot({},e),{payments:c()?t:[],subscription:n}))}},176785:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(785893),o=(n(667294),
n(294184)),i=n.n(o),a=n(707961),s=n(74535),c=n(265688),l=n(419087),u=n(652591),f=n(2590),d=n(91019),p=n.n(d);const h=function(e){var t=e.disabled,n=void 0!==t&&t,o=e.type,d=e.className,h=e.innerClassName,E=e.onConnect,y=(0,s.ZP)(),m=c.Z.get(o);return(0,r.jsx)(a.ua7,{text:m.name,children:function(e){var t=e.onMouseEnter,s=e.onMouseLeave;return(0,r.jsx)("div",{className:i()(p().wrapper,d),children:(0,r.jsx)(a.tEY,{children:(0,r.jsx)("button",{onMouseEnter:t,onMouseLeave:s,className:i()(p().inner,h),type:"button",disabled:n,style:{backgroundImage:"url('".concat(y===f.BRd.DARK?m.icon.darkSVG:m.icon.lightSVG,"')")},onClick:null!=E?E:function(){return function(e){var t=c.Z.get(e);(0,l.Z)(t.type,"Friends List");u.default.track(f.rMx.ACCOUNT_LINK_STEP,{previous_step:"desktop connections",current_step:"desktop oauth",platform_type:t.type})}(o)},"aria-label":m.name})})})}})}},322837:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(667294),o=n(178598),i=n(306472),a=n(120415);function s(e,t){
if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e){c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return c(e)}function l(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e,t){u=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return u(e,t)}var f=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var o=c(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments)
;return l(this,n)}}var p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&u(e,t)}(n,e);var t=d(n);function n(){s(this,n);var e;(e=t.apply(this,arguments)).handleFileDownload=function(t){t.preventDefault();var n=e.getFileContents(),r=e.props,o=r.fileName,i=r.onDownload;a.FB?e.downloadNative(n,o):e.downloadHtml5(n,o);null==i||i()};return e}var c=n.prototype;c.getFileContents=function(){var e=this.props.fileContents;"function"==typeof e&&(e=e());return e};c.downloadNative=function(e,t){i.Z.fileManager.saveWithDialog(e,t)};c.downloadHtml5=function(e,t){var n=new Blob([e],{type:this.props.contentType});(0,o.saveAs)(n,t)};c.render=function(){var e=this.props.children,t=r.Children.only(e);return r.cloneElement(t,{onClick:this.handleFileDownload})};return n}(r.Component)},164045:(e,t,n)=>{"use strict";n.d(t,{
Z:()=>re});var r=n(785893),o=n(667294),i=n(427537),a=n.n(i),s=n(717187),c=n.n(s),l=n(120415),u=n(310126),f=n(79251),d=n(2590);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e){E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return E(e)}function y(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?h(e):t}function m(e,t){m=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return m(e,t)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()
}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var g=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function O(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=E(e);if(t){var o=E(this).constructor;n=Reflect.construct(r,arguments,o)
}else n=r.apply(this,arguments);return y(this,n)}}var v=[],_=function(e,t,n){var r=(0,l.ED)()?0:1;e===d.MoX.MOUSE_BUTTON&&n===r||v.forEach((function(r){return r._handleEvent(e,t,n)}))},I=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&m(e,t)}(n,e);var t=O(n);function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var e;(e=t.call(this)).combo=[];v.push(h(e));1===v.length&&u.default.setOnInputEventCallback(_);return e}var r=n.prototype;r.destroy=function(){var e=this;this.removeAllListeners();0===(v=v.filter((function(t){return t!==e}))).length&&u.default.setOnInputEventCallback(null)};r.toString=function(){return(0,f.BB)(this.combo)};r._handleEvent=function(e,t,n){if(0===t)this.combo=this.combo.filter((function(t){var r=b(t,2),o=r[0],i=r[1]
;return!(o===e&&i===n)}));else{this.combo.push([e,n,(0,f.dU)()]);this.emit("change",this)}};return n}(c()),S=n(294184),T=n.n(S),N=n(238736),A=n.n(N),C=n(496486),P=n.n(C),j=n(707961),R=n(107364),x=n(473708),M=n(666499),w=n.n(M);function D(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function L(e){L=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return L(e)}function U(e,t){return!t||"object"!==H(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function k(e,t){k=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return k(e,t)}var G,B,H=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function V(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=L(e);if(t){var o=L(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return U(this,n)}}!function(e){e.DEFAULT="DEFAULT";e.RECORDING="RECORDING"}(G||(G={}));var F=(Z(B={},G.DEFAULT,w().default),Z(B,G.RECORDING,w().recording),B),Y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&k(e,t)}(n,e);var t=V(n);function n(){D(this,n);var e;(e=t.apply(this,arguments))._inputId=P().uniqueId("key-recorder-");e._unregisterNativeRecorder=null;e._mousedownMode=null;e._inputRef=o.createRef();e._containerRef=o.createRef()
;e.setInputRef=function(t){e._input=t;e._inputRef.current=t};e.handleClick=function(t){t.stopPropagation();t.preventDefault();var n=e.props,r=n.onClick;n.disableOnClickWhileRecording&&e._mousedownMode===G.RECORDING||r()};e.handleMouseDown=function(){e._mousedownMode=e.props.mode};return e}var i=n.prototype;i.componentDidMount=function(){var e=this.props.onChange;if(null!=this.props.registerNativeRecorder&&null!=e)this._unregisterNativeRecorder=this.props.registerNativeRecorder(this._inputId,e);else if(null!=e&&null!=this._input){new(A())(this._input).handleKey=e}};i.componentWillUnmount=function(){null!=this._unregisterNativeRecorder&&this._unregisterNativeRecorder()};i.componentDidUpdate=function(e){var t=this.props.mode;if(e.mode!==t){var n=this._input;if(null!=n){var r=document.activeElement;t===G.DEFAULT&&n===r&&n.blur();t===G.RECORDING&&n!==r&&n.focus()}}};i.render=function(){var e,t=this,n=this.props,o=n.mode,i=n.value,a=n.disabled,s=(0,f.BB)(i,!0)
;e=o===G.RECORDING?x.Z.Messages.SHORTCUT_RECORDER_BUTTON_RECORDING:0===i.length?x.Z.Messages.SHORTCUT_RECORDER_BUTTON:x.Z.Messages.SHORTCUT_RECORDER_BUTTON_EDIT;var c,l=o===G.DEFAULT&&i.length>0;return(0,r.jsx)(j.tEY,{focusTarget:this._inputRef,ringTarget:this._containerRef,children:(0,r.jsx)("div",{onClick:this.handleClick,onMouseDown:this.handleMouseDown,ref:this._containerRef,className:T()(w().container,F[o],(c={},Z(c,w().hasValue,l),Z(c,w().disabled,a),c)),children:(0,r.jsxs)(R.Z,{className:w().layout,children:[(0,r.jsx)(R.Z.Child,{className:w().input,children:(0,r.jsx)("input",{id:this._inputId,placeholder:x.Z.Messages.SHORTCUT_RECORDER_NO_BIND,type:"text",ref:this.setInputRef,readOnly:!0,value:s,disabled:this.props.mode!==G.RECORDING||a})}),(0,r.jsx)(R.Z,{shrink:1,grow:0,style:{margin:0},children:(0,r.jsxs)(j.zxk,{className:w().button,disabled:a,onClick:function(e){e.stopPropagation();e.preventDefault();t.handleClick(e)},size:j.zxk.Sizes.MIN,color:j.Ttl.PRIMARY,children:[(0,
r.jsx)("span",{className:w().text,children:e}),(0,r.jsx)("span",{className:w().editIcon})]})})]})})})};return n}(o.PureComponent);const z=Y;function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function K(e){K=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return K(e)}function q(e,t){return!t||"object"!==J(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function X(e,t){X=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return X(e,t)}function Q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{
a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||ee(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e){return function(e){if(Array.isArray(e))return W(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ee(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var J=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function ee(e,t){if(e){if("string"==typeof e)return W(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name)
;return"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?W(e,t):void 0}}function te(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=K(e);if(t){var o=K(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return q(this,n)}}var ne=l.FB&&null!=u.default.getDiscordUtils().inputCaptureRegisterElement;const re=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&X(e,t)}(n,e);var t=te(n);function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")
}(this,n);var r;(r=t.call(this,e))._mounted=!1;r.recordStart=function(){if(l.FB&&!ne){r.gs=new I;r.gs.on("change",r.handleGSChange)}r.setState({mode:G.RECORDING})};r.recordEnd=function(){r.cleanUp();r.setState({mode:G.DEFAULT})};r.toggleRecordMode=function(){r.state.mode===G.DEFAULT?r.recordStart():r.recordEnd()};r.handleComboKeys=function(e,t,n){n.preventDefault();if("keydown"===n.type){var o=t.map((function(e){return[d.MoX.KEYBOARD_KEY,a()(e),d.CgE.BROWSER]})),i=n.keyCode;null==o.find((function(e){var t=Q(e,2)[1];return i===t}))&&o.push([d.MoX.KEYBOARD_KEY,i,d.CgE.BROWSER]);r.handleComboChange(o)}};r.handleGSChange=function(e){if(!1!==r._mounted){var t=$(e.combo);r.handleComboChange(t)}};r.handleNativeChange=function(e){e.length>0&&r.handleComboChange(e);r.recordEnd()};var o=e.defaultValue;r.state={codes:o,mode:G.DEFAULT};return r}var o=n.prototype;o.componentDidMount=function(){this._mounted=!0};o.componentWillUnmount=function(){this._mounted=!1;this.cleanUp()}
;o.componentDidUpdate=function(e){this.props.defaultValue!==e.defaultValue&&this.setState({codes:this.props.defaultValue})};o.cleanUp=function(){if(l.FB&&null!=this.gs){this.gs.destroy();this.gs=null}};o.handleComboChange=function(e){var t=this.state.mode,n=this.props.onChange;if(t===G.RECORDING){null!=n&&n(e);this.setState({codes:e})}};o.render=function(){var e,t,n=this.state,o=n.codes,i=n.mode,a=this.props.disabled;if(ne){t=u.default.getDiscordUtils().inputCaptureRegisterElement;e=this.handleNativeChange}else l.FB||(e=this.handleComboKeys);return(0,r.jsx)(z,{disabled:a,value:o,mode:i,onClick:this.toggleRecordMode,onChange:e,registerNativeRecorder:t,disableOnClickWhileRecording:ne})};return n}(o.PureComponent)},342147:(e,t,n)=>{"use strict";n.d(t,{D2:()=>c,SE:()=>l});var r=n(202351),o=n(260561),i=n(682776),a=n(2590),s=(0,o.B)({kind:"guild",id:"2022-11_default_disable_mass_mention",label:"Disable mass mentions for communities by default",defaultConfig:{enabled:!1},treatments:[{id:1,
label:"Enabled",config:{enabled:!0}}]});function c(e){return s.useExperiment({guildId:e},{autoTrackExposure:!0})}function l(e){var t,n=(0,r.e7)([i.Z],(function(){return i.Z.can(a.Plq.MANAGE_GUILD,e)})),o=s.useExperiment({guildId:null!==(t=null==e?void 0:e.id)&&void 0!==t?t:""},{autoTrackExposure:!0}).enabled;if(null==e)return!1;var c=e.hasFeature(a.oNc.COMMUNITY);return n&&c&&o}},540825:(e,t,n)=>{"use strict";n.d(t,{n:()=>o});var r=(0,n(260561).B)({kind:"user",id:"2022-05_safety_coms_update",label:"Safety Integrity Platform Coms Update",defaultConfig:{enabled:!1,forceConfirmationOnAccept:!1},treatments:[{id:1,label:"Enabled",config:{enabled:!0,forceConfirmationOnAccept:!1}}]});function o(){return r.useExperiment({}).enabled}},145800:(e,t,n)=>{"use strict";n.d(t,{Zh:()=>o,e6:()=>i,iq:()=>a,M9:()=>s});var r=n(813216),o=null!=window.speechSynthesis;function i(e,t){var n=e.replace(/(https?:\/\/[^\s]+)/g,(function(e){var t=e.match(/^https?:\/\/(?:www\.)?([^/?#]+)(?:[/?#]|$)/i)
;return null!=t?t[1]:""}));null!=t&&n.length>t&&(n=(n=n.substring(0,t)).substring(0,Math.min(n.length,n.lastIndexOf(" "))));var o=new SpeechSynthesisUtterance(n);o.rate=r.Z.speechRate;return o}function a(e,t){if(o){e.voice=t;speechSynthesis.speak(e)}}function s(){o&&speechSynthesis.cancel()}},863715:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=(0,n(260561).B)({kind:"user",id:"2022-05_role_styles_setting",label:"Role Styles Setting",defaultConfig:{allowRoleStyles:!1},treatments:[{id:1,label:"Allow Role Styles Setting",config:{allowRoleStyles:!0}}]})},122012:(e,t,n)=>{"use strict";n.d(t,{d:()=>o,Y$:()=>i,jS:()=>a,tZ:()=>s,a8:()=>c});var r=n(744564);function o(){r.Z.dispatch({type:"DEVELOPER_ACTIVITY_SHELF_TOGGLE_ENABLED"})}function i(){r.Z.dispatch({type:"DEVELOPER_ACTIVITY_SHELF_TOGGLE_USE_ACTIVITY_URL_OVERRIDE"})}function a(e){r.Z.dispatch({type:"DEVELOPER_ACTIVITY_SHELF_SET_ACTIVITY_URL_OVERRIDE",activityUrlOverride:e})}function s(e){r.Z.dispatch({
type:"DEVELOPER_ACTIVITY_SHELF_MARK_ACTIVITY_USED",applicationId:e,timestamp:(new Date).getTime()})}function c(e){r.Z.dispatch({type:"DEVELOPER_ACTIVITY_SHELF_UPDATE_FILTER",filter:e})}},649222:(e,t,n)=>{"use strict";n.r(t);n.d(t,{ACTIVITY_ENCOURAGES_HW_ACCELERATION:()=>O,default:()=>v});var r=n(785893),o=n(667294),i=n(707961),a=n(944010),s=n(28661),c=n(107364),l=n(652591),u=n(310126),f=n(2590),d=n(473708),p=n(743140),h=n.n(p);function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function m(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}
return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function b(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1)
;"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var O="Activity Encourages Hardware Acceleration";function v(e){var t,n=e.applicationId,p=b(e,["applicationId"]),E=g(o.useState(!1),2),v=E[0],_=E[1],I=g((0,s.Z)([n]),1)[0],S=null!==(t=null==I?void 0:I.name)&&void 0!==t?t:"This Activity";o.useEffect((function(){l.default.track(f.rMx.OPEN_MODAL,{type:O})}),[]);var T=function(){var e="temporary";if(v){e="permanent";a.ZP.updatedUnsyncedSettings({disableActivityHardwareAccelerationPrompt:!0})}l.default.track(f.rMx.MODAL_DISMISSED,{type:O,dismiss_type:e});p.onClose()};return(0,r.jsxs)(i.Y0X,m(function(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){y(e,t,n[t])}))}return e}({className:h().root,"aria-label":d.Z.Messages.ACTIVITY_HARDWARE_ACCELERATION_BETTER_TITLE},p),{children:[(0,r.jsxs)(i.xBx,{separator:!1,children:[(0,r.jsx)(i.xvT,{className:h().header,variant:"text-lg/normal",children:d.Z.Messages.ACTIVITY_HARDWARE_ACCELERATION_BETTER_TITLE}),(0,r.jsx)(i.olH,{onClick:T,className:h().closeButton})]}),(0,r.jsx)(i.hzk,{className:h().content,children:(0,r.jsx)(i.xvT,{variant:"text-md/normal",className:h().ratingBody,children:d.Z.Messages.ACTIVITY_HARDWARE_ACCELERATION_BETTER_BODY.format({applicationName:S})})}),(0,r.jsxs)(i.mzw,{className:h().footer,direction:c.Z.Direction.HORIZONTAL,children:[(0,r.jsx)(i.XZJ,{type:i.XZJ.Types.INVERTED,size:18,value:v,onChange:function(){
return _(!v)},children:(0,r.jsx)(i.xvT,{variant:"text-sm/normal",children:d.Z.Messages.DONT_SHOW_AGAIN})}),(0,r.jsx)(i.zxk,{color:i.zxk.Colors.PRIMARY,onClick:T,children:d.Z.Messages.ACTIVITY_HARDWARE_ACCELERATION_NO_THANKS}),(0,r.jsx)(i.zxk,{color:i.zxk.Colors.BRAND,onClick:function(){l.default.track(f.rMx.ACTIVITY_ENABLE_HARDWARE_ACCELERATION,{application_id:n});u.default.setEnableHardwareAcceleration(!0)},children:d.Z.Messages.ACTIVITY_HARDWARE_ACCELERATION_TURN_IT_ON})]})]}))}},189041:(e,t,n)=>{"use strict";n.d(t,{mN:()=>a,qV:()=>s,qq:()=>c,C8:()=>l});var r=n(744564),o=(n(784426),n(652591)),i=n(2590);function a(e){o.default.track(i.rMx.OPEN_MODAL,{type:"Enter Your Birthday",source:{section:e}});r.Z.dispatch({type:"AGE_GATE_MODAL_OPEN",source:e})}function s(){r.Z.wait((function(){return r.Z.dispatch({type:"AGE_GATE_MODAL_CLOSE"})}))}function c(){r.Z.wait((function(){r.Z.dispatch({type:"AGE_GATE_SUCCESS_MODAL_OPEN"})}))}function l(e){r.Z.wait((function(){r.Z.dispatch({
type:"AGE_GATE_FAILURE_MODAL_OPEN",underageMessage:e})}))}},549869:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});function r(){return{}}},926543:(e,t,n)=>{"use strict";n.d(t,{M:()=>c,Z:()=>l});var r=n(785893),o=(n(667294),n(751615)),i=n(80783),a=n(2590),s=n(199790);function c(){var e=location.pathname+location.search;return s.a?a.Z5c.REGISTER:(0,i.U)(e,!1)}const l=function(){return(0,r.jsx)(o.l_,{to:c()})}},61200:(e,t,n)=>{"use strict";n.d(t,{e:()=>u});var r=n(785893),o=(n(667294),n(736818)),i=n(130585),a=n(926543),s=n(2590);function c(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){c(e,t,n[t])}))}return e}function u(e,t){
var n,c,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{passProps:!0},f=function(n){return!(0,i.$8)()&&o.default.getLoginStatus()!==s.u34.LOGGING_IN&&o.default.allowLogoutRedirect()?null!=t?(0,r.jsx)(t,{renderRedirect:(0,r.jsx)(a.Z,{})}):(0,r.jsx)(a.Z,{}):(0,r.jsx)(e,l({},u.passProps?n:null))};f.displayName="Authenticated(".concat(null!==(c=null!==(n=e.displayName)&&void 0!==n?n:e.name)&&void 0!==c?c:"<Unknown>",")");return f}},710965:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(667294),o=n(402391);function i(e){r.useEffect((function(){if(null!=e){o.Z.lockChangeLog(e);return function(){o.Z.unlockChangeLog(e)}}}),[e])}},584656:(e,t,n)=>{"use strict";n.d(t,{N:()=>a,I:()=>s});var r=n(667294),o=n(260561),i=n(769321),a=(0,o.B)({kind:"user",id:"2022-01_discovery_iar",label:"Ability to report servers in Server Discovery",defaultConfig:{canSeeInAppReportingButtons:!1},treatments:[{id:1,label:"Show IAR buttons in Server Discovery",config:{canSeeInAppReportingButtons:!0}}]})
;function s(){var e=a.useExperiment({}).canSeeInAppReportingButtons,t=i.Sb.useSetting(),n=e||t;r.useEffect((function(){a.trackExposure({})}),[]);return n}},473444:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>E,GuildDiscoveryMenuPopout:()=>y});var r=n(785893),o=(n(667294),n(202351)),i=n(707961),a=n(971402),s=n(112897),c=n(424871),l=n(567403),u=n(682776),f=n(528334),d=n(584656),p=n(2590),h=n(473708);function E(e){var t=e.guild,n=e.shiftId,E=e.onSelect,y=e.closePopout,m=e["aria-label"],b=(0,s.Z)(t.id,n,void 0,y),g=(0,o.e7)([l.Z],(function(){return l.Z.getGuild(t.id)}),[t.id]),O=(0,o.e7)([u.Z],(function(){return u.Z.can(p.Plq.ADMINISTRATOR,g)})),v=d.N.useExperiment({}).canSeeInAppReportingButtons;return(0,r.jsxs)(i.v2r,{onSelect:E,navId:"guild-discovery-context-menu","aria-label":null!=m?m:h.Z.Messages.GENERIC_ACTIONS_MENU_LABEL,onClose:a.Zy,children:[(0,r.jsx)(i.kSQ,{children:!O&&v?(0,r.jsx)(i.sNh,{id:"report-guild-discovery-listing",label:h.Z.Messages.REPORT_SERVER_NO_NAME,
action:function(){(0,c.lt)(t);!function(){(0,a.Zy)();null==y||y()}()},icon:f.Z,color:"danger"}):null}),(0,r.jsx)(i.kSQ,{children:b})]})}var y=function(e){var t=e.guild,n=e.children,o=e.onRequestOpen,a=e.onRequestClose;return(0,r.jsx)(i.yRy,{onRequestOpen:o,onRequestClose:a,animation:i.yRy.Animation.NONE,position:"bottom",spacing:4,align:"right",renderPopout:function(e){var n=e.closePopout;return(0,r.jsx)(E,{guild:t,closePopout:n})},children:n})}},520330:(e,t,n)=>{"use strict";n.d(t,{o1:()=>I,L1:()=>S,ZP:()=>T});var r=n(785893),o=n(667294),i=n(202351),a=n(707961),s=n(744564),c=n(498442),l=n(443812),u=n(618887),f=n(99827),d=n(293078),p=n(473708),h=n(232862),E=n.n(h);function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function b(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){
var i=e.apply(t,n);function a(e){m(i,r,o,a,s,"next",e)}function s(e){m(i,r,o,a,s,"throw",e)}a(void 0)}))}}function g(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function O(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{
try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var _=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),
0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function I(e){var t=e.onClose,n=e.code,o=e.copyInputTitle,i=e.bodyText;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a.xBx,{separator:!1,className:E().headerContainer,children:[(0,r.jsx)("div",{className:E().dropArt}),(0,r.jsx)(a.X6q,{variant:"heading-xl/semibold",children:p.Z.Messages.OUTBOUND_PROMOTION_REDEMPTION_MODAL_TITLE})]}),(0,
r.jsxs)(a.hzk,{className:E().modalContent,children:[(0,r.jsx)(a.xvT,{variant:"text-md/normal",className:E().codeBodyText,children:i}),(0,r.jsx)(a.$i$,{className:E().formDivider}),(0,r.jsx)(a.hjN,{title:o,className:E().formSection,children:(0,r.jsx)(c.Z,{value:n,buttonColor:a.zxk.Colors.BRAND,buttonLook:a.zxk.Looks.FILLED,delay:1e3,inputClassName:E().textInput})})]}),(0,r.jsx)(a.mzw,{className:E().modalFooter,children:(0,r.jsx)(a.zxk,{className:E().closeButton,onClick:t,look:a.zxk.Looks.LINK,color:E().closeButton,children:p.Z.Messages.CLOSE})})]})}function S(e){var t=e.onClose,n=e.errorCode,o={26e4:p.Z.Messages.DROPS_USER_NOT_ENROLLED_ERROR,260001:p.Z.Messages.DROPS_QUEST_NOT_COMPLETED_ERROR,260002:p.Z.Messages.DROPS_NO_CODE_AVAILABLE_ERROR,260003:p.Z.Messages.DROPS_CODE_ALREADY_CLAIMED_ERROR},i=p.Z.Messages.GENERIC_ERROR_BODY;null!=o[n]&&(i=o[n]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a.xBx,{separator:!1,className:E().errorHeader,children:[(0,r.jsx)("div",{
className:E().errorArt}),(0,r.jsx)(a.X6q,{variant:"heading-xl/semibold",children:p.Z.Messages.GENERIC_ERROR_TITLE})]}),(0,r.jsx)(a.hzk,{className:E().errorBody,children:(0,r.jsx)(a.xvT,{variant:"text-md/normal",className:E().bodyText,children:i})}),(0,r.jsx)(a.mzw,{children:(0,r.jsx)(a.zxk,{color:a.zxk.Colors.BRAND,onClick:t,children:p.Z.Messages.CLOSE})})]})}const T=function(e){var t=e.onClose,c=e.code,h=e.drop,y=e.platform,m=e.transitionState,S=(0,l.Dt)(),T=v(o.useState(),2),N=T[0],A=T[1];o.useEffect((function(){null==c&&s.Z.wait(b((function(){return _(this,(function(e){switch(e.label){case 0:return[4,(0,u.dN)(h.dropsQuestId)];case 1:e.sent();return[2]}}))})))}),[h.dropsQuestId,c]);var C=(0,i.e7)([f.Z],(function(){return f.Z.platformAvailability}));return(0,r.jsx)(a.Y0X,{transitionState:m,"aria-labelledby":S,children:(0,r.jsx)(r.Fragment,{children:function(){if(null!=c)return(0,r.jsx)(I,{bodyText:h.messages.claimTip(),onClose:t,
copyInputTitle:p.Z.Messages.DROPS_REDEMPTION_CODE_PLATFORM_TITLE.format({platform:y}),code:c});if(null===C)return(0,r.jsx)("div",{className:E().spinnerContainer,children:(0,r.jsx)(a.$jN,{})});var e=C.length>0,o=1===C.length;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a.xBx,{separator:!1,className:E().headerContainer,children:[(0,r.jsx)("div",{className:E().dropArt}),(0,r.jsx)(a.X6q,{variant:"heading-lg/semibold",children:p.Z.Messages.OUTBOUND_PROMOTION_REDEMPTION_MODAL_TITLE})]}),(0,r.jsxs)(a.hzk,{children:[(0,r.jsx)(a.xvT,{variant:"text-md/normal",className:E().dropBodyText,children:o?p.Z.Messages.DROPS_MODAL_CHOOSE_SINGLE_PLATFORM.format({platform:(0,d.Un)(C[0])}):p.Z.Messages.DROPS_MODAL_CHOOSE_PLATFORM.format({title:h.title})}),(0,r.jsx)(a.$i$,{className:E().formDivider}),(0,r.jsxs)(a.hjN,{className:E().dropFormSection,children:[(0,r.jsx)(a.q4e,{onChange:A,options:C.map((function(e){return{value:e,label:(0,d.Un)(e)}})),value:o?C[0]:N,isDisabled:!e,
className:e?"":E().selectDangerBorder,look:e?a.qQH.FILLED:a.qQH.CUSTOM}),!e&&(0,r.jsx)(a.xvT,{variant:"text-sm/medium",color:"text-danger",className:E().errorCodesText,children:p.Z.Messages.DROPS_CODES_RAN_OUT})]})]}),(0,r.jsxs)(a.mzw,{children:[e&&(0,r.jsx)(a.zxk,{color:a.zxk.Colors.BRAND,onClick:function(){(0,a.ZDy)(b((function(){var e,i;return _(this,(function(a){switch(a.label){case 0:return[4,Promise.all([n.e(40532),n.e(95132)]).then(n.bind(n,195132))];case 1:e=a.sent(),i=e.default;return[2,function(e){return(void 0!==N||o)&&(0,r.jsx)(i,O(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){g(e,t,n[t])}))}return e}({},e),{platform:void 0===N?C[0]:N,code:c,dropsQuestId:h.dropsQuestId,closeParentModal:t,singlePlatformClaim:o}))}]}}))})))
},disabled:void 0===N&&!o,children:p.Z.Messages.UNLOCK_CODE}),e?(0,r.jsx)(a.zxk,{onClick:t,look:a.zxk.Looks.LINK,color:E().maybeLaterButton,children:p.Z.Messages.MAYBE_LATER}):(0,r.jsx)(a.zxk,{onClick:t,look:a.zxk.Looks.LINK,color:E().closeButton,children:p.Z.Messages.CLOSE})]})]})}()})})}},130962:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var r=(0,n(260561).B)({kind:"user",id:"2022-08_churro_experiment",label:"PS5 Voice Experiment",defaultConfig:{allowPlayStationStaging:!1},treatments:[{id:3,label:"PS Experiment + upsells + Staging",config:{allowPlayStationStaging:!0}}]})},647428:(e,t,n)=>{"use strict";n.d(t,{Z:()=>v});var r=n(202351),o=n(744564),i=n(120415),a=n(310126),s=new Set(["nvidia"]);var c=n(236625),l=n.n(c);var u=function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},i.AB.WINDOWS,{nvidia:">=397.93.0"});function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){
for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1;r.configurable=!0;"value"in r&&(r.writable=!0);Object.defineProperty(e,r.key,r)}}function p(e){p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return p(e)}function h(e,t){return!t||"object"!==y(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function E(e,t){E=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return E(e,t)}var y=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=p(e);if(t){var o=p(this).constructor
;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h(this,n)}}var b=!1,g=!0;var O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&E(e,t)}(n,e);var t=m(n);function n(){f(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){var e=this;i.FB&&!__OVERLAY__&&a.default.getGPUDriverVersions().then((function(t){b=function(e){var t=u[(0,i.Xf)()];if(null==t)return!1;var n,r,o,a=!0,s=!1,c=void 0;try{for(var f,d=Object.keys(e)[Symbol.iterator]();!(a=(f=d.next()).done);a=!0){var p=f.value,h=e[p],E=t[p];if(null!=h&&null!=E&&null==h.error){var y=(r=void 0,o=void 0,"".concat(null!==(r=(n=h).major)&&void 0!==r?r:0,".").concat(null!==(o=n.minor)&&void 0!==o?o:0,".0"));if(!l().satisfies(y,E))return!0}}}catch(e){s=!0;c=e}finally{try{a||null==d.return||d.return()}finally{
if(s)throw c}}return!1}(t);g=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=Object.keys(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value,c=e[a];if(null!=c&&null==c.error&&s.has(a))return!0}}catch(e){n=!0;r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return!1}(t);e.emitChange()}))};r.getState=function(){return{GPUDriversOutdated:b,canUseHardwareAcceleration:g}};r.__getLocalVars=function(){return{GPUDriversOutdated:b,canUseHardwareAcceleration:g}};!function(e,t,n){t&&d(e.prototype,t);n&&d(e,n)}(n,[{key:"GPUDriversOutdated",get:function(){return b}},{key:"canUseHardwareAcceleration",get:function(){return g}}]);return n}(r.ZP.Store);O.displayName="StreamingCapabilitiesStore";const v=new O(o.Z,{OVERLAY_INITIALIZE:function(e){var t=e.streamingCapabilitiesStoreState;b=t.GPUDriversOutdated;g=t.canUseHardwareAcceleration}})},213013:(e,t,n)=>{"use strict";n.d(t,{l:()=>a,y:()=>s});var r=n(38736),o=Object.freeze({isPopoutOpen:!1}),i=(0,r.Z)((function(e){
return o})),a=function(e){i.setState((function(){return{isPopoutOpen:e}}))},s=i},955514:(e,t,n)=>{"use strict";n.d(t,{F:()=>p,Q:()=>h});var r=n(202351),o=n(418705),i=n(917019),a=n(473419),s=n(652591),c=n(256764),l=n(2590),u=n(458947),f=n(131559);function d(e,t){var n=a.Z.getDismissedGuildContent(t);return null!=n&&(0,c.jl)(n,e)}function p(e,t){return(0,r.e7)([a.Z],(function(){return d(e,t)}))}function h(e,t,n,r){(0,i.PS)(t,(function(n){if(d(e,t))return!1;n.dismissedGuildContent=(0,c.GV)(n.dismissedGuildContent,e)}),f.fy.INFREQUENT_USER_ACTION);n&&s.default.track(l.rMx.DISMISSIBLE_CONTENT_DISMISSED,{type:o.CW[e],guild_id:t,action:null!=r?r:u.L.AUTO})}},754242:(e,t,n)=>{"use strict";n.d(t,{iq:()=>s,Cl:()=>c,$D:()=>l,Pq:()=>o,Jh:()=>i,gq:()=>u});function r(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var o,i,a,s="guild_feed_feedback_last_seen",c=6048e5,l=450;!function(e){e.TERRIBLE="terrible";e.BAD="bad";e.OKAY="okay"
;e.GOOD="good";e.EXCELLENT="excellent"}(o||(o={}));!function(e){e[e.ALREADY_SAW=0]="ALREADY_SAW";e[e.IRRELEVANT=1]="IRRELEVANT";e[e.TOO_OLD=2]="TOO_OLD";e[e.CONFUSING_OR_RANDOM=3]="CONFUSING_OR_RANDOM";e[e.INAPPROPRIATE=4]="INAPPROPRIATE";e[e.UNINTERESTING=5]="UNINTERESTING";e[e.ENTERTAINING=6]="ENTERTAINING";e[e.INFORMATIVE=7]="INFORMATIVE";e[e.USEFUL=8]="USEFUL";e[e.OTHER=9]="OTHER";e[e.FUNNY=10]="FUNNY"}(i||(i={}));var u=(r(a={},o.TERRIBLE,[i.ALREADY_SAW,i.IRRELEVANT,i.TOO_OLD,i.CONFUSING_OR_RANDOM,i.INAPPROPRIATE,i.OTHER]),r(a,o.BAD,[i.ALREADY_SAW,i.IRRELEVANT,i.TOO_OLD,i.CONFUSING_OR_RANDOM,i.INAPPROPRIATE,i.OTHER]),r(a,o.OKAY,[i.IRRELEVANT,i.TOO_OLD,i.UNINTERESTING,i.ALREADY_SAW,i.OTHER]),r(a,o.GOOD,[i.FUNNY,i.ENTERTAINING,i.INFORMATIVE,i.USEFUL,i.OTHER]),r(a,o.EXCELLENT,[i.FUNNY,i.ENTERTAINING,i.INFORMATIVE,i.USEFUL,i.OTHER]),a)},720504:(e,t,n)=>{"use strict";n.d(t,{Cd:()=>m,vL:()=>b,i1:()=>g,IT:()=>O})
;var r=n(667294),o=n(202351),i=n(630631),a=n(316878),s=n(123398),c=n(821229),l=n(652591),u=n(433932),f=n(614244),d=n(754242),p=n(2590),h=n(473708);function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(e,t)}(e,t)||function(){
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(){i.Z.set(d.iq,null)}function b(){var e=r.useMemo((function(){return c.Z.getExperimentBucket(u.Xp.definition.id)}),[]),t=y(r.useState(!1),2),n=t[0],o=t[1],a=r.useMemo((function(){return i.Z.get(d.iq)}),[n]);return{showFeedback:r.useMemo((function(){return 100*Math.random()<e&&(null==a||Date.now()-a>d.Cl)}),[e,a]),setOnDismissedFeedback:o}}function g(e){switch(e){case d.Jh.ALREADY_SAW:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_ALREADY_SAW;case d.Jh.IRRELEVANT:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_IRRELEVANT;case d.Jh.TOO_OLD:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_TOO_OLD;case d.Jh.CONFUSING_OR_RANDOM:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_CONFUSING;case d.Jh.INAPPROPRIATE:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_INAPPROPRIATE;case d.Jh.UNINTERESTING:
return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_UNINTERESTING;case d.Jh.ENTERTAINING:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_ENTERTAINING;case d.Jh.INFORMATIVE:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_INFORMATIVE;case d.Jh.USEFUL:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_USEFUL;case d.Jh.OTHER:return h.Z.Messages.GUILD_FEED_FEEDBACK_OTHER_REASON;case d.Jh.FUNNY:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_FUNNY;default:return null}}function O(e){var t=e.guildId,n=e.guildFeedItem,c=e.setOnDismissFeedback,u=y(r.useState(),2),h=u[0],E=u[1],m=y(r.useState(new Set),2),b=m[0],O=m[1],v=y(r.useState(),2),_=v[0],I=v[1],S=y(r.useState(!1),2),T=S[0],N=S[1],A=y(r.useState(!1),2),C=A[0],P=A[1],j=y(r.useState(!1),2),R=j[0],x=j[1],M=r.useCallback((function(e){E(e);x(!0);N(!1);setTimeout((function(){x(!1)}),d.$D+150)}),[E,N,x]),w=r.useCallback((function(e){e===d.Jh.OTHER&&b.has(d.Jh.OTHER)&&I(null);var t=new Set(b);t.has(e)?t.delete(e):t.add(e);O(t)
}),[b,I,O]),D=r.useCallback((function(){N(!0);O(new Set)}),[N,O]),Z=r.useCallback((function(e){!function(e){var t,n=e.guildId,r=e.guildFeedItem,o=e.dismissed,i=e.selectedRating,a=void 0===i?null:i,c=e.selectedReasons,u=void 0===c?null:c,d=e.userFeedback,h=void 0===d?null:d,E=Array.from(null!=u?u:[]);l.default.track(p.rMx.HOME_FEEDBACK_SUBMITTED,{guild_id:n,home_session_id:f.Z.getHomeSessionId(n),feed_item_id:r.id,feed_item_position:0,dismissed:o,report_name:"feed_item_feedback",load_id:s.ZP.getLoadId(n),rating:a,reason_codes:E,reason_descriptions:E.map((function(e){return null!==(t=g(e))&&void 0!==t?t:""})),user_feedback:h})}({guildId:t,guildFeedItem:n,dismissed:e,selectedRating:h,selectedReasons:b,userFeedback:_})}),[t,n,h,b,_]),L=r.useCallback((function(){i.Z.set(d.iq,Date.now());null==c||c(!0);C||Z(!0)}),[Z,c,C]),U=r.useCallback((function(){Z(!1);P(!0);i.Z.set(d.iq,Date.now())}),[Z]),k=r.useMemo((function(){return b.size>0&&(!b.has(d.Jh.OTHER)||null!=_&&""!==_)}),[b,_]),G=(0,
o.e7)([a.Z],(function(){return a.Z.useReducedMotion})),B=r.useRef(!1);r.useEffect((function(){return function(){B.current=!0}}),[]);r.useEffect((function(){return function(){B.current&&null!=h&&L()}}),[h,L]);return{selectedRating:h,setSelectedRating:M,selectedReasons:b,setSelectedReasons:w,setUserFeedback:I,backPressed:T,onBackPressed:D,onSubmitPressed:U,onClosePressed:L,showSubmitted:C,isAnimating:R,canSubmit:k,useReducedMotion:G}}},825781:(e,t,n)=>{"use strict";n.d(t,{Z:()=>P});var r=n(202351),o=n(744564),i=n(2590);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return s(e)}function c(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e,t){l=Object.setPrototypeOf||function(e,t){
e.__proto__=t;return e};return l(e,t)}var u=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function f(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var o=s(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}var d,p,h,E,y,m,b,g,O,v=i.QZA.CLOSED,_={},I=!1;function S(){v=i.QZA.CLOSED;_={};b=null;g=void 0;O=[]}function T(){N();A();_={};v=i.QZA.OPEN}function N(){d=void 0;y=void 0}function A(){p=void 0;h=void 0;E=void 0;m=void 0}var C=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,
configurable:!0}});t&&l(e,t)}(n,e);var t=f(n);function n(){a(this,n);return t.apply(this,arguments)}var r=n.prototype;r.getFormState=function(){return v};r.getErrors=function(){return _};r.showNotice=function(){return void 0!==d||void 0!==p||void 0!==h||void 0!==E||void 0!==y||void 0!==m};r.getPendingAvatar=function(){return d};r.getPendingBanner=function(){return p};r.getPendingBio=function(){return h};r.getPendingNickname=function(){return y};r.getPendingPronouns=function(){return E};r.getPendingAccentColor=function(){return y};r.getPendingThemeColors=function(){return m};r.getAllPending=function(){return{pendingAvatar:d,pendingBanner:p,pendingBio:h,pendingPronouns:E,pendingNickname:y,pendingThemeColors:m}};r.getGuild=function(){return b};r.getSource=function(){return g};r.getAnalyticsLocations=function(){return O};r.getIsDisableSubmit=function(){return I};r.__getLocalVars=function(){return{formState:v,errors:_,pendingAvatar:d,pendingBanner:p,pendingBio:h,pendingPronouns:E,
pendingNickname:y,pendingThemeColors:m,guild:b,source:g,analyticsLocations:O,disableSubmit:I}};return n}(r.ZP.Store);C.displayName="GuildIdentitySettingsStore";const P=new C(o.Z,{GUILD_IDENTITY_SETTINGS_INIT:function(e){b=e.guild;v=i.QZA.OPEN;_={};g=e.source;O=e.analyticsLocations},GUILD_IDENTITY_SETTINGS_CLOSE:S,GUILD_IDENTITY_SETTINGS_RESET_AND_CLOSE_FORM:function(){T();S()},GUILD_IDENTITY_SETTINGS_SET_GUILD:function(e){b=e.guild;_={}},GUILD_IDENTITY_SETTINGS_SUBMIT:function(){v=i.QZA.SUBMITTING;_={}},GUILD_IDENTITY_SETTINGS_SUBMIT_FAILURE:function(e){if(v!==i.QZA.SUBMITTING)return!1;v=i.QZA.OPEN;var t;_=null!==(t=e.errors)&&void 0!==t?t:{}},USER_PROFILE_UPDATE_FAILURE:function(e){v=i.QZA.OPEN;_=e.errors},GUILD_IDENTITY_SETTINGS_SET_PENDING_AVATAR:function(e){var t=e.avatar;d=t},GUILD_IDENTITY_SETTINGS_SET_PENDING_BANNER:function(e){var t=e.banner;p=t},GUILD_IDENTITY_SETTINGS_SET_PENDING_BIO:function(e){var t=e.bio;h=t},GUILD_IDENTITY_SETTINGS_SET_PENDING_PRONOUNS:function(e){
var t=e.pronouns;E=t},GUILD_IDENTITY_SETTINGS_SET_PENDING_NICKNAME:function(e){var t=e.nickname;y=t},GUILD_IDENTITY_SETTINGS_SET_PENDING_THEME_COLORS:function(e){var t=e.themeColors;m=t},GUILD_IDENTITY_SETTINGS_RESET_PENDING_MEMBER_CHANGES:N,GUILD_IDENTITY_SETTINGS_RESET_PENDING_PROFILE_CHANGES:A,GUILD_IDENTITY_SETTINGS_RESET_ALL_PENDING:T,GUILD_IDENTITY_SETTINGS_SUBMIT_SUCCESS:T,GUILD_IDENTITY_SETTINGS_CLEAR_ERRORS:function(){_={}},GUILD_IDENTITY_SETTINGS_SET_DISABLE_SUBMIT:function(e){var t=e.disable;I=t}})},989280:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(785893),o=(n(667294),n(707961)),i=n(124251),a=n(473708),s=n(571094),c=n.n(s),l=n(946137),u=n.n(l);const f=function(e){var t=e.headerId,n=e.reapplyText,s=e.onReapply,l=e.confirmText,f=e.onConfirm,d=e.rejectionReason,p=void 0===d?null:d,h=e.guild,E=void 0===h?null:h;return(0,r.jsxs)("div",{className:c().confirmation,children:[(0,r.jsxs)("div",{className:c().confirmationContent,children:[null!==E?(0,r.jsx)(i.Z,{
size:i.Z.Sizes.LARGER,guild:E,className:c().guildIcon}):(0,r.jsx)("img",{alt:a.Z.Messages.MEMBER_VERIFICATION_APPLICATION_REJECTED_ICON,src:u(),className:c().verificationStateIcon}),(0,r.jsx)(o.X6q,{id:t,variant:"heading-xl/semibold",className:c().header,children:null!=(null==E?void 0:E.name)?a.Z.Messages.MEMBER_VERIFICATION_APPLICATION_REJECTED_TITLE_WITH_GUILD_NAME.format({guildName:E.name}):a.Z.Messages.MEMBER_VERIFICATION_APPLICATION_REJECTED_TITLE}),null!=p&&""!==p?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(o.xvT,{variant:"text-sm/normal",children:[(0,r.jsx)("span",{className:c().rejectionReasonLabel,children:a.Z.Messages.MEMBER_VERIFICATION_APPLICATION_REJECTED_REASON}),(0,r.jsx)("span",{className:c().rejectionReason,children:p})]})}):null]}),(0,r.jsxs)("div",{className:c().confirmationButtonRow,children:[(0,r.jsx)(o.zxk,{onClick:s,color:o.zxk.Colors.PRIMARY,className:c().confirmationButton,children:n}),(0,r.jsx)(o.zxk,{onClick:f,color:o.zxk.Colors.PRIMARY,
className:c().confirmationButton,children:l})]})]})}},504834:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(785893),o=(n(667294),n(294184)),i=n.n(o),a=n(707961),s=n(223430),c=n(265367),l=n(477598),u=n.n(l);function f(e){var t=e.message,n=e.error,o=e.onClick,l=e.submitting,f=e.className,d=e.ctaMessage;return(0,r.jsxs)("div",{className:i()(u().container,f),children:[(0,r.jsxs)("div",{className:u().textContainer,children:[(0,r.jsx)(c.Z,{className:u().warningIcon}),(0,r.jsx)(s.Z,{size:10,horizontal:!0}),(0,r.jsxs)("div",{children:[(0,r.jsx)(s.Z,{size:1}),(0,r.jsx)(a.xvT,{className:u().info,variant:"text-sm/normal",children:t}),null!=n&&(0,r.jsx)(a.xvT,{className:i()(u().info,u().error),variant:"text-sm/normal",children:n})]})]}),(0,r.jsx)(s.Z,{size:16,horizontal:!0}),(0,r.jsx)(a.zxk,{className:u().undoButton,color:a.zxk.Colors.LINK,look:a.zxk.Looks.LINK,size:a.zxk.Sizes.ICON,onClick:o,submitting:l,children:d})]})}},196142:(e,t,n)=>{"use strict";n.d(t,{Z:()=>b})
;var r=n(785893),o=n(667294),i=n(730381),a=n.n(i),s=n(673679),c=n(153686),l=n(19585),u=n(547721),f=n(504834),d=n(473708);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n)
;if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var y=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,
o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},m=function(e){var t,n,r=E(o.useState(!1),2),i=r[0],a=r[1],c=E(o.useState(null),2),l=c[0],u=c[1],f=(n=(t=function(t){var n;return y(this,(function(r){switch(r.label){case 0:a(!0);u(null);r.label=1;case 1:r.trys.push([1,3,4,5]);return[4,(0,s.qu)(t,e)];case 2:r.sent();return[3,5];case 3:n=r.sent();u(n);return[3,5];case 4:a(!1);return[7];case 5:return[2]}}))},function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(e){h(i,r,o,a,s,"next",e)}function s(e){h(i,r,o,a,s,"throw",e)}a(void 0)}))}),function(e){return n.apply(this,arguments)});return{resetRenewalMutation:f,
submitting:i,error:l}};function b(e){var t=e.groupListingId,n=e.subscription,i=e.className,s=(0,l.Z)(c.Z.PENDING_PLAN_CHANGE_NOTICE).analyticsLocations,p=m(s),h=p.resetRenewalMutation,E=p.submitting,y=p.error,b=(0,u._k)(t,{includeSoftDeleted:!0}),g=o.useMemo((function(){if(null==(null==n?void 0:n.renewalMutations))return{currentListing:void 0,nextListing:void 0};var e=n.items[0].planId,t=n.renewalMutations.items[0].planId;return{currentListing:b.find((function(t){return t.subscription_plans[0].id===e})),nextListing:b.find((function(e){return e.subscription_plans[0].id===t}))}}),[n,b]),O=g.currentListing,v=g.nextListing;if(null==n||null==O||null==v)return null;var _=a()(n.currentPeriodEnd).format("MMM DD, YYYY");return(0,r.jsx)(f.Z,{message:d.Z.Messages.GUILD_ROLE_CANCEL_SUBSCRIPTION_DELETE_MUTATION_DESCRIPTION.format({currentListing:O.name,nextListing:v.name,changeDate:_}),error:null==y?void 0:y.message,onClick:function(){return h(n)},submitting:E,
ctaMessage:d.Z.Messages.GUILD_ROLE_CANCEL_SUBSCRIPTION_DELETE_MUTATION_CTA,className:i})}},945514:(e,t,n)=>{"use strict";n.d(t,{kZ:()=>d,W4:()=>p,Sn:()=>h,gq:()=>E,I4:()=>m,Ui:()=>b,U3:()=>g});var r=n(281110),o=n(744564),i=n(49621),a=n(248046),s=n(2590);function c(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){c(i,r,o,a,s,"next",e)}function s(e){c(i,r,o,a,s,"throw",e)}a(void 0)}))}}function u(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var f=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){
if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function d(){o.Z.dispatch({type:"INTEGRATION_PERMISSION_SETTINGS_CLEAR"})}function p(e,t,n){o.Z.dispatch({applicationId:e,commandId:t,permissions:n,type:"INTEGRATION_PERMISSION_SETTINGS_EDIT"})}function h(e,t){
r.Z.get(s.ANM.GUILD_COMMANDS_FOR_APPLICATION(e,t)).then((function(n){o.Z.dispatch({type:"INTEGRATION_PERMISSION_SETTINGS_COMMANDS_FETCH_SUCCESS",applicationId:t,commands:n.body.application_commands,guildId:e,permissions:n.body.permissions})}),(function(){o.Z.dispatch({type:"INTEGRATION_PERMISSION_SETTINGS_COMMANDS_FETCH_FAILURE",applicationId:t})}))}function E(e,t,n){return y.apply(this,arguments)}function y(){return(y=l((function(e,t,n){var i,a;return f(this,(function(c){switch(c.label){case 0:i=[];c.label=1;case 1:c.trys.push([1,3,,4]);return[4,r.Z.get(s.ANM.APPLICATION_BOT_GUILD_COMMAND_PERMISSIONS(e,t,n))];case 2:(a=c.sent()).ok&&(i=a.body.permissions);return[3,4];case 3:if(404!==c.sent().status){o.Z.dispatch({type:"INTEGRATION_PERMISSION_SETTINGS_APPLICATION_PERMISSIONS_FETCH_FAILURE",applicationId:e,commandId:n,guildId:t});return[2]}return[3,4];case 4:o.Z.dispatch({type:"INTEGRATION_PERMISSION_SETTINGS_COMMAND_UPDATE",applicationId:e,commandId:n,guildId:t,permissions:i})
;return[2]}}))}))).apply(this,arguments)}function m(e){o.Z.dispatch({applicationId:e,type:"INTEGRATION_PERMISSION_SETTINGS_INIT"})}function b(e){o.Z.dispatch({commandId:e,type:"INTEGRATION_PERMISSION_SETTINGS_RESET"})}function g(e){return O.apply(this,arguments)}function O(){return(O=l((function(e){var t,n,r,a,s,c,l,u;return f(this,(function(f){switch(f.label){case 0:t=e.applicationId,n=e.commandId,r=e.defaultEveryoneValue,a=e.defaultEverywhereValue,s=e.guildId,c=e.permissions;l=n===t?v(s,c,r,a):c;return[4,i.dh(t,s,n,l)];case 1:(u=f.sent()).ok&&o.Z.dispatch({type:"INTEGRATION_PERMISSION_SETTINGS_COMMAND_UPDATE",applicationId:t,commandId:n,guildId:s,permissions:u.body.permissions});return[2]}}))}))).apply(this,arguments)}function v(e,t,n,r){if(!n||!r)return t;var o,i=(u(o={},e,n),u(o,(0,a.bD)(e),r),o);return t.filter((function(e){var t=i[e.id];return null==t||e.permission!==t}))}},145739:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p})
;var r=n(125333),o=n(58964),i=n(97245),a=n(269823),s=n(652591),c=n(877815),l=n(873297),u=n(2590);function f(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var d="template";const p=function(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){
f(e,t,n[t])}))}return e}({},l.Z),{openNativeAppModal:function(e){a.Z.openNativeAppModal(e,u.Etm.GUILD_TEMPLATE_BROWSER)},openMobileApp:function(e,t){if(!(null!=platform.ua&&platform.ua.toLowerCase().indexOf("googlebot")>-1)){var n=null!=e?(0,r.Oh)(e):(0,r.Gk)(),a=(0,o.WS)(),l=(0,o.ZP)(n,{utmSource:d,fingerprint:t,attemptId:a});s.default.track(u.rMx.DEEP_LINK_CLICKED,{fingerprint:(0,i.K)(t),attempt_id:a,source:d,guild_template_code:e});c.Z.launch(l,(function(){}))}}})},876003:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r,o=n(785893),i=(n(667294),n(294184)),a=n.n(i),s=n(74535),c=n(795470),l=n(912250),u=n(655402),f=n(888291),d=n(2590),p=n(240162),h=n.n(p);function E(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){E(e,t,n[t])}))}return e}function m(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}var b=(E(r={},d.BRd.DARK,d.Ilk.PRIMARY_400),E(r,d.BRd.LIGHT,d.Ilk.PRIMARY_500),r);function g(e){var t,n=e.enabled,r=e.imageClassName,i=e.iconWrapperClassName,d=m(e,["enabled","imageClassName","iconWrapperClassName"]),p=(0,s.ZP)(),g={height:18,width:18,color:(0,c.Lq)(b[p])};return(0,o.jsx)(f.Z,y({className:a()((t={},E(t,h().avatarUploader,n),E(t,h().avatarUploaderDisabled,!n),t)),
imageClassName:a()(r,h().avatarUploaderInnerSquare,E({},h().avatarUploaderInnerSquareDisabled,!n)),icon:null!=d.image&&""!==d.image?(0,o.jsx)(l.Z,y({},g)):(0,o.jsx)(u.Z,y({},g)),iconClassName:a()(h().avatarUploadIcon,h().hideDefaultIcon),iconWrapperClassName:i,showIcon:!0,showIconDisabled:!0,hideSize:!0},d))}},888291:(e,t,n)=>{"use strict";n.d(t,{S:()=>T,Z:()=>A});var r=n(785893),o=n(667294),i=n(294184),a=n.n(i),s=n(441143),c=n.n(s),l=n(707961),u=n(421281),f=n(694755),d=n(2590),p=n(473708),h=n(326726),E=n.n(h);function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function b(e){b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return b(e)}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){m(e,t,n[t])}))}return e}function O(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function v(e,t){return!t||"object"!==I(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _(e,t){_=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return _(e,t)}var I=function(e){
return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var o=b(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return v(this,n)}}function T(e){var t=e.className,n=e.icon,o=void 0===n?null:n;return(0,r.jsx)("div",{className:a()(E().imageUploaderIcon,t),children:o})}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&_(e,t)}(n,e);var t=S(n);function n(){y(this,n);var e;(e=t.apply(this,arguments)).inputRef=o.createRef()
;e.handleRemove=function(){e.props.onChange(null)};return e}var i=n.prototype;i.handleExternalFileChange=function(e){c()(null!=this.inputRef.current,"ImageInputRef asked to handleExternalFileChange when not mounted");this.inputRef.current.handleFileChange(e)};i.render=function(){var e,t,n,o,i,s=this.props,c=s.image,h=s.hint,y=s.name,m=s.makeURL,b=s.disabled,v=s.onChange,_=s.showIcon,I=s.showIconDisabled,S=s.className,N=s.imageClassName,A=s.iconClassName,C=s.iconWrapperClassName,P=s.icon,j=s.hideSize,R=s.imageStyle,x=s.showRemoveButton,M=s.maxFileSizeBytes,w=s.onFileSizeError,D=s.onOpenImageSelectModal,Z=s["aria-label"];null!=(e=null!=c&&/^data:/.test(c)?c:m(c))?t='url("'.concat(e,'")'):null!=y&&(n=(0,r.jsx)("div",{className:E().imageUploaderAcronym,children:(0,u.Zg)(y)}));if(b)return(0,r.jsx)("div",{className:a()(E().imageUploader,E().disabled,S),children:(0,r.jsxs)("div",{className:a()(E().imageUploaderInner,N),style:O(g({},R),{backgroundImage:t}),children:[n,I&&(0,r.jsx)("div",{
className:a()(E().imageUploaderIcon,E().imageUploaderIconDisabled,A),children:P})]})});null!=c?o=(0,r.jsx)(l.eee,{className:E().removeButton,onClick:this.handleRemove,children:p.Z.Messages.REMOVE}):j||(o=(0,r.jsx)("small",{className:E().sizeInfo,children:p.Z.Messages.MINIMUM_SIZE.format({size:d.IXf})}));var L=null!==(i=null!=Z?Z:h)&&void 0!==i?i:p.Z.Messages.CHANGE_AVATAR;return(0,r.jsxs)("div",{className:a()(E().imageUploader,S),children:[(0,r.jsx)(l.tEY,{within:!0,children:(0,r.jsxs)("div",{className:_?a()(E().imageUploaderIconWrapper,C):void 0,children:[(0,r.jsxs)("div",{className:a()(E().imageUploaderInner,N),style:O(g({},R),{backgroundImage:t}),children:[(0,r.jsx)("span",{"aria-hidden":!0,children:n}),null!=D?(0,r.jsx)(l.P3F,{className:E().imageUploaderFileInput,"aria-label":L,onClick:D}):(0,r.jsx)(f.ZP,{ref:this.inputRef,onChange:v,className:E().imageUploaderFileInput,"aria-label":L,tabIndex:0,maxFileSizeBytes:M,onFileSizeError:w})]}),null!=h&&(0,r.jsx)("div",{
className:E().imageUploaderHint,"aria-hidden":"true",children:h}),_&&(0,r.jsx)(T,{className:A,icon:P})]})}),x?o:null]})};return n}(o.PureComponent);N.defaultProps={name:"",makeURL:function(e){return e},disabled:!1,showIcon:!1,hideSize:!1,showRemoveButton:!0,maxFileSizeBytes:1/0,icon:null};const A=N},727266:(e,t,n)=>{"use strict";n.d(t,{i:()=>h,Z:()=>I});var r=n(441143),o=n.n(r),i=n(202351),a=n(744564),s=n(665472),c=n(73904),l=n(869854);function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e){f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return f(e)}function d(e,t){return!t||"object"!==O(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function p(e,t){p=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return p(e,t)}var h,E,y,m,b,g,O=function(e){
return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function v(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=f(e);if(t){var o=f(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d(this,n)}}!function(e){e[e.IN_FLIGHT=0]="IN_FLIGHT";e[e.ERRORED=1]="ERRORED";e[e.SUCCEEDED=2]="SUCCEEDED"}(h||(h={}));var _=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&p(e,t)}(n,e);var t=v(n);function n(){u(this,n);return t.apply(this,arguments)}var r=n.prototype;r.getModalState=function(e){return e!==E?null:y}
;r.__getLocalVars=function(){return{currentNonce:E,currentState:y,queuedMessageId:m,queuedMessageChannelId:b,queuedMessageNonce:g}};return n}(i.ZP.Store);_.displayName="InteractionModalStore";const I=new _(a.Z,{LOGOUT:function(){E=null;y=null;m=null;b=null;g=null;return!0},INTERACTION_MODAL_CREATE:function(e){if(e.nonce===g){s.Z.deleteMessage(b,m,!0);m=null;b=null;g=null}return!1},INTERACTION_QUEUE:function(e){var t=e.messageId,n=e.nonce,r=e.data;switch(r.interactionType){case c.B8.APPLICATION_COMMAND:m=t;b=r.channelId;g=n;return!1;case c.B8.MODAL_SUBMIT:o()(null==E||y===h.ERRORED||y===h.SUCCEEDED,"cannot submit multiple modals at once");E=n;y=h.IN_FLIGHT;setTimeout((function(){E===n&&y===h.IN_FLIGHT&&(0,l.yr)(n)}),1e4);return!0;default:return!1}},INTERACTION_SUCCESS:function(e){var t=e.nonce;if(null==t||t!==E)return!1;y=h.SUCCEEDED;return!0},INTERACTION_FAILURE:function(e){var t=e.nonce;if(null==t||t!==E)return!1;y=h.ERRORED;return!0}})},196644:(e,t,n)=>{"use strict";n.d(t,{HJ:()=>d,
yD:()=>p,Zd:()=>h});var r=n(541554),o=n(281110),i=n(744564),a=n(84441),s=n(736818),c=n(873553),l=n(2590);function u(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}var f=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}
if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function d(){var e,t,n=s.default.getId();c.Z.getUsers().forEach((t=(e=function(e){var t,a,s,c,u;return f(this,(function(f){switch(f.label){case 0:t=e.id;if(null==(a=r.Z.getToken(t))||""===a){i.Z.dispatch({type:"MULTI_ACCOUNT_VALIDATE_TOKEN_FAILURE",userId:t});return[2]}i.Z.dispatch({type:"MULTI_ACCOUNT_VALIDATE_TOKEN_REQUEST",userId:t});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,o.Z.get({url:l.ANM.ME,headers:{authorization:a},retries:3})];case 2:s=f.sent();return[3,4];case 3:c=f.sent();u=401===(null==c?void 0:c.status)||403===(null==c?void 0:c.status);i.Z.dispatch({type:u?"MULTI_ACCOUNT_VALIDATE_TOKEN_FAILURE":"MULTI_ACCOUNT_VALIDATE_TOKEN_SUCCESS",userId:t})
;return[2];case 4:i.Z.dispatch({type:n===t?"CURRENT_USER_UPDATE":"USER_UPDATE",user:s.body});i.Z.dispatch({type:"MULTI_ACCOUNT_VALIDATE_TOKEN_SUCCESS",userId:t});return[2]}}))},function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){u(i,r,o,a,s,"next",e)}function s(e){u(i,r,o,a,s,"throw",e)}a(void 0)}))}),function(e){return t.apply(this,arguments)}))}function p(e){var t=r.Z.getToken(e);null!=t?a.Z.switchAccountToken(t):i.Z.dispatch({type:"MULTI_ACCOUNT_VALIDATE_TOKEN_FAILURE",userId:e})}function h(e){i.Z.dispatch({type:"MULTI_ACCOUNT_REMOVE_ACCOUNT",userId:e})}},22724:(e,t,n)=>{"use strict";n.d(t,{L:()=>c});var r=n(667294),o=n(202351),i=n(744564),a=n(196644),s=n(873553);function c(){var e=(0,o.cj)([s.Z],(function(){return{isLoading:s.Z.getIsValidatingUsers(),multiAccountUsers:s.Z.getUsers()}}));r.useEffect((function(){i.Z.wait((function(){a.HJ()}))}),[]);return e}},226613:(e,t,n)=>{"use strict";n.d(t,{c:()=>o,H:()=>i});var r=n(744564)
;function o(e){r.Z.wait((function(){return r.Z.dispatch({type:"NUF_NEW_USER",newUserType:e})}))}function i(){r.Z.wait((function(){return r.Z.dispatch({type:"NUF_COMPLETE"})}))}},239527:(e,t,n)=>{"use strict";n.d(t,{M5:()=>r});var r;!function(e){e[e.MARKETING_UNCLAIMED=0]="MARKETING_UNCLAIMED";e[e.INVITE_UNCLAIMED=1]="INVITE_UNCLAIMED";e[e.ORGANIC_REGISTERED=2]="ORGANIC_REGISTERED";e[e.ORGANIC_REGISTERED_GUILD_TEMPLATE=3]="ORGANIC_REGISTERED_GUILD_TEMPLATE"}(r||(r={}))},88415:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(202351),o=n(744564);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return a(e)}function s(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e,t){
c=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return c(e,t)}var l=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=a(e);if(t){var o=a(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return s(this,n)}}var f=null;var d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&c(e,t)}(n,e);var t=u(n);function n(){i(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(e){var t
;f=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:null};r.getType=function(){return f};r.getState=function(){return{type:f}};r.__getLocalVars=function(){return{type:f}};return n}(r.ZP.PersistedStore);d.displayName="NewUserStore";d.persistKey="nuf";const p=new d(o.Z,{NUF_NEW_USER:function(e){var t=e.newUserType;f=t},NUF_COMPLETE:function(){f=null}})},936323:(e,t,n)=>{"use strict";n.d(t,{F:()=>r});var r;!function(e){e.AGE_GATE="age-gate";e.CHOOSE_TEMPLATE="choose-template";e.CUSTOMIZE_GUILD="customize-server";e.CHANNEL_PROMPT="channel-prompt";e.JOIN_GUILD="join-server";e.CREATION_INTENT="creation-intent";e.COMPLETE="complete"}(r||(r={}))},643676:(e,t,n)=>{"use strict";n.d(t,{Y:()=>f,Z:()=>p});var r=n(281110),o=n(744564),i=n(2590);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function c(e){return function(){
var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){s(i,r,o,a,c,"next",e)}function c(e){s(i,r,o,a,c,"throw",e)}a(void 0)}))}}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e,t)||function(){
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var u=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){
a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function f(e,t){return d.apply(this,arguments)}function d(){return(d=c((function(e,t){return u(this,(function(n){switch(n.label){case 0:return[4,r.Z.patch({url:i.ANM.PARENT_TOOLS_LINKED_USERS,body:{linked_user_id:e,link_status:t}}).then((function(e){var t=e.body;o.Z.dispatch({type:"PARENT_TOOLS_REQUEST_LINK_UPDATE_SUCCESS",linkedUsersMap:t});return t}))];case 1:n.sent();return[2]}}))}))).apply(this,arguments)}const p={requestLink:function(e){return c((function(){var t,n,a,s,c;return u(this,(function(u){switch(u.label){case 0:t=l(e.split("#"),2),n=t[0],a=t[1];return[4,r.Z.post({url:i.ANM.PARENT_TOOLS_LINKED_USERS,body:{username:n,discriminator:a}})];case 1:s=u.sent(),c=s.body;o.Z.dispatch({type:"PARENT_TOOLS_REQUEST_LINK_SUCCESS",linkedUsersMap:c})
;return[2,c]}}))}))()},fetchLinkedUsers:function(){return c((function(){var e,t,n;return u(this,(function(a){switch(a.label){case 0:return[4,r.Z.get({url:i.ANM.PARENT_TOOLS_LINKED_USERS})];case 1:e=a.sent().body;t=e.linked_users;n=e.users;o.Z.dispatch({type:"PARENT_TOOLS_LINKED_USERS_FETCH_SUCCESS",linkedUsersMap:t,users:n});return[2,{linkedUserMap:t,users:n}]}}))}))()},fetchTeenActivity:function(e){return c((function(){var t,n,a;return u(this,(function(s){switch(s.label){case 0:t=void 0===e?i.ANM.PARENT_TOOLS_TEEN_ACTIVITY_ME:i.ANM.PARENT_TOOLS_TEEN_ACTIVITY(e);return[4,r.Z.get({url:t})];case 1:n=s.sent(),a=n.body;o.Z.dispatch({type:"PARENT_TOOLS_TEEN_ACTIVITY_FETCH_SUCCESS",parentToolsTeenActivity:a});return[2,a]}}))}))()},fetchMoreTeenActivity:function(e,t,n){return c((function(){var a,s;return u(this,(function(c){switch(c.label){case 0:return[4,r.Z.get({url:i.ANM.PARENT_TOOLS_TEEN_ACTIVITY_MORE(e,t,n)})];case 1:a=c.sent(),s=a.body;o.Z.dispatch({
type:"PARENT_TOOLS_TEEN_ACTIVITY_MORE_FETCH_SUCCESS",parentToolsTeenActivity:s});return[2,s]}}))}))()}}},129471:(e,t,n)=>{"use strict";n.d(t,{AG:()=>c,i0:()=>l,zE:()=>u,ip:()=>f,nP:()=>r,ne:()=>i,tx:()=>d});var r,o,i,a,s=n(473708),c=8,l=3,u=26,f=73;!function(e){e[e.DM_MESSAGE_SEND=1]="DM_MESSAGE_SEND";e[e.GDM_MESSAGE_SEND=2]="GDM_MESSAGE_SEND";e[e.MESSAGE_REACT=3]="MESSAGE_REACT";e[e.ADD_FRIEND=4]="ADD_FRIEND";e[e.SEND_CALL=5]="SEND_CALL";e[e.CALL_JOIN=6]="CALL_JOIN";e[e.GUILD_JOIN=7]="GUILD_JOIN"}(r||(r={}));!function(e){e[e.PARENT=1]="PARENT";e[e.CHILD=2]="CHILD"}(o||(o={}));!function(e){e[e.PENDING=1]="PENDING";e[e.ACTIVE=2]="ACTIVE";e[e.INACTIVE=3]="INACTIVE";e[e.DECLINED=4]="DECLINED";e[e.EXPIRED=5]="EXPIRED"}(i||(i={}));!function(e){e[e.USER_ADD=1]="USER_ADD";e[e.GUILD_ADD=2]="GUILD_ADD";e[e.USER_INTERACTION=3]="USER_INTERACTION";e[e.GUILD_INTERACTION=4]="GUILD_INTERACTION"}(a||(a={}));var d=new Map([[a.USER_INTERACTION,{counterHeader:function(){
return s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_INTERACTION_HEADER},counterTooltip:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_INTERACTION_TOOLTIP},sectionHeader:function(e){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_INTERACTION_SECTION_HEADER.format({count:e})},timestampFormatter:function(){return{today:s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_MESSAGED_TIMESTAMP_TODAY,yesterday:s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_MESSAGED_TIMESTAMP_YESTERDAY,days:s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_MESSAGED_TIMESTAMP_DAYS}}}],[a.USER_ADD,{counterHeader:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_ADD_FRIENDS_HEADER},counterTooltip:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_ADD_FRIENDS_TOOLTIP},sectionHeader:function(e){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_ADD_FRIENDS_SECTION_HEADER.format({count:e})},timestampFormatter:function(){return{today:s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_ADDED_TIMESTAMP_TODAY,
yesterday:s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_ADDED_TIMESTAMP_YESTERDAY,days:s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_ADDED_TIMESTAMP_DAYS}}}],[a.GUILD_ADD,{counterHeader:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_GUILD_JOIN_HEADER},counterTooltip:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_GUILD_JOIN_TOOLTIP},sectionHeader:function(e){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_GUILD_JOIN_SECTION_HEADER.format({count:e})},sectionDescription:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_GUILD_JOIN_DESCRIPTION}}],[a.GUILD_INTERACTION,{counterHeader:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_GUILD_INTERACTION_HEADER},counterTooltip:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_GUILD_INTERACTION_TOOLTIP},sectionHeader:function(e){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_GUILD_INTERACTION_SECTION_HEADER.format({count:e})},sectionDescription:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_GUILD_INTERACTION_DESCRIPTION}}]])},
719174:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(202351),o=n(473903);function i(){var e=(0,r.e7)([o.default],(function(){var e;return null===(e=o.default.getCurrentUser())||void 0===e?void 0:e.nsfwAllowed}));return null!=e&&e}},779224:(e,t,n)=>{"use strict";n.d(t,{r:()=>O,Z:()=>v});var r=n(785893),o=(n(667294),n(318715)),i=n(707961),a=n(316878),s=n(80317),c=n(995141),l=n(170740),u=n(775173),f=n(310126),d=n(473708),p=n(763910),h=n.n(p);function E(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function y(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var m,b=f.default.getEnableHardwareAcceleration()?i.Xo$:i.qEK,g=(E(m={},i.EFr.SIZE_40,40),E(m,i.EFr.SIZE_48,48),m),O=function(e){var t=e.user,n=e.avatarSize,f=void 0===n?i.EFr.SIZE_48:n,p=(0,o.ZP)([a.Z],(function(){return a.Z.useReducedMotion})),m=g[f],O=(0,s.U)().canUseAvatarDecorations,v=(0,l.w)({user:t,size:m}),_=v.avatarSrc,I=v.isAvatarAnimating,S=v.eventHandlers,T=!p&&I,N=O?(0,u.NZ)({userId:t.id,avatarDecoration:t.avatarDecoration,size:(0,c.y)(f),canAnimate:T}):null;return(0,r.jsx)("div",y(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){E(e,t,n[t])}))}return e}({},S),{children:(0,r.jsx)(b,{className:h().avatar,src:_,avatarDecoration:N,size:f,
"aria-label":d.Z.Messages.FAMILY_CENTER_AVATAR_ARIA.format({name:t.username})})}))};const v=function(e){var t=e.currentUser,n=e.otherUser,o=e.children;return(0,r.jsx)("div",{className:h().avatarPairContainer,children:(0,r.jsxs)("div",{className:h().avatarPair,children:[(0,r.jsx)(O,{user:t}),o,(0,r.jsx)(O,{user:n})]})})}},500351:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(785893),o=(n(667294),n(707961)),i=n(334835),a=n(720810),s=n.n(a);const c=function(e){var t=e.user;return(0,r.jsx)(o.xvT,{className:"tag",variant:"text-md/medium",children:(0,r.jsx)(i.Z,{user:t,showAccountIdentifier:!0,className:s().tagContainer,usernameClass:s().username,discriminatorClass:s().discriminator})})}},560837:(e,t,n)=>{"use strict";n.d(t,{Z:()=>y});var r=n(202351),o=n(744564),i=n(335186);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)}
;return s(e)}function c(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e,t){l=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return l(e,t)}var u,f=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var o=s(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}var p=(0,i.K4)();function h(e){var t=e.countryCode;if(null!=t){var n;p=null!==(n=(0,i.Zz)(t))&&void 0!==n?n:(0,i.K4)()}}var E=function(e){!function(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&l(e,t)}(n,e);var t=d(n);function n(){a(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(e){null!=e&&(u=e.selectedCountryCode)};r.getUserAgnosticState=function(){return{selectedCountryCode:u}};r.getCountryCode=function(){return null!=u?u:p};r.__getLocalVars=function(){return{selectedCountryCode:u,defaultCountryCode:p}};return n}(r.ZP.DeviceSettingsStore);E.displayName="PhoneStore";E.persistKey="PhoneStore";const y=new E(o.Z,{PHONE_SET_COUNTRY_CODE:function(e){var t=e.countryCode;u=t},CONNECTION_OPEN:h,SET_LOCATION_METADATA:h})},998330:(e,t,n)=>{"use strict";n.d(t,{D:()=>b,T:()=>m});var r=n(785893),o=n(667294),i=n(707961),a=n(744564),s=n(494425),c=n(294184),l=n.n(c),u=n(530991),f=n(17229),d=n(510036),p=n.n(d),h=function(e){var t=e.color;return(0,
r.jsxs)("svg",{width:"48",height:"28",viewBox:"0 0 55 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("rect",{x:"10.1968",y:"7",width:"14.4203",height:"14.4203",transform:"rotate(45 10.1968 7)",className:p().toastBG}),(0,r.jsx)("rect",{x:"27.3936",y:"0.59021",width:"23.4851",height:"23.4851",transform:"rotate(45 27.3936 0.59021)",className:p().toastBG}),(0,r.jsx)("rect",{x:"44.5903",y:"7",width:"14.4203",height:"14.4203",transform:"rotate(45 44.5903 7)",className:p().toastBG}),(0,r.jsx)("rect",{x:"10.1968",y:"13",width:"6",height:"6",transform:"rotate(45 10.1968 13)",fill:t}),(0,r.jsx)("path",{d:"M27.3936 4.39355L34.1233 16.2873L27.3936 28.1811L20.6638 16.2873L27.3936 4.39355Z",fill:t}),(0,r.jsx)("rect",{x:"44.5903",y:"13",width:"6",height:"6",transform:"rotate(45 44.5903 13)",fill:t})]})};function E(e){var t=e.achievement,n=e.unlocked,a=t.name,c=t.description,d=t.rarity,E=t.hideDescriptionUntilUnlock,y=t.onAction,m=(0,s.F7)(d).color;o.useEffect((function(){
var e=setTimeout((function(){u.Z.playAchievementUnlockSound()}),50);return function(){clearTimeout(e)}}),[]);var b=null!=y&&n,g=b?i.P3F:"div";return(0,r.jsxs)(g,{className:l()(p().container,b&&p().actionable),onClick:function(){b&&y()},children:[(0,r.jsx)("div",{className:p().iconContainer,children:(0,r.jsx)(f.Z,{achievementId:t.id,size:f.Z.Sizes.SIZE_40,unlocked:n})}),(0,r.jsxs)("div",{className:p().nameContainer,children:[(0,r.jsx)(i.xvT,{variant:"text-md/semibold",color:"header-primary",children:a()}),(0,r.jsx)(i.xvT,{variant:"text-xs/medium",color:"header-secondary",children:E&&!n?"?????":c()})]}),(0,r.jsx)("div",{className:p().flair,children:(0,r.jsx)(h,{color:m})})]})}var y=n(473708);function m(e){a.Z.dispatch({type:"POGGERMODE_ACHIEVEMENT_UNLOCK",achievementId:e})}function b(e,t){var n=(0,s.oX)(e);null!=n&&(0,i.CFj)((0,i.Yz2)(y.Z.Messages.POGGERMODE_ACHIEVEMENTS,i.pCN.CUSTOM,{position:i.azu.BOTTOM,component:(0,r.jsx)(E,{achievement:n,unlocked:t}),duration:6e3}))}},
896971:(e,t,n)=>{"use strict";n.d(t,{Z:()=>v});var r=n(202351),o=n(744564),i=n(736818),a=n(998330),s=n(785085),c=n(44616);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function f(e){f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return f(e)}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){u(e,t,n[t])}))}return e}function p(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){
var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function h(e,t){return!t||"object"!==y(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function E(e,t){E=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return E(e,t)}var y=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=f(e);if(t){var o=f(this).constructor
;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h(this,n)}}var b={unlockedAchievements:{}},g=d({},b);var O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&E(e,t)}(n,e);var t=m(n);function n(){l(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(e){this.waitFor(i.default,c.ZP);var t=null!=e?e:d({},b);for(var n in t)g[n]=t[n]};r.getState=function(){return g};r.getAllUnlockedAchievements=function(){return g.unlockedAchievements};r.getUnlocked=function(e){var t;return null!==(t=g.unlockedAchievements[e])&&void 0!==t?t:null};r.__getLocalVars=function(){return{ACHIEVEMENT_UNLOCK_TOAST_DELAY_MS:2e3,initialState:b,state:g}};return n}(r.ZP.PersistedStore);O.displayName="PoggermodeAchievementStore";O.persistKey="PoggermodeAchievementStore";const v=new O(o.Z,{
POGGERMODE_ACHIEVEMENT_UNLOCK:function(e){var t=e.achievementId;if(!s.Z.isEnabled())return!1;!function(e){if(null!=g.unlockedAchievements[e])return!1;g.unlockedAchievements=p(d({},g.unlockedAchievements),u({},e,{achievementId:e,dateUnlocked:Date.now()}));setTimeout((function(){(0,a.D)(e,!0)}),2e3)}(t)}})},494425:(e,t,n)=>{"use strict";n.d(t,{hn:()=>r,EP:()=>o,LG:()=>l,oX:()=>u,F7:()=>f});var r,o,i,a=n(673383),s=n(473708);function c(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}!function(e){e[e.ENABLE_POGGERMODE=0]="ENABLE_POGGERMODE";e[e.DISABLE_POGGERMODE=1]="DISABLE_POGGERMODE";e[e.PING_SOMEONE=2]="PING_SOMEONE";e[e.PING_ME=3]="PING_ME";e[e.COMBO_MULTI_LEVEL_1=4]="COMBO_MULTI_LEVEL_1";e[e.COMBO_MULTI_LEVEL_2=5]="COMBO_MULTI_LEVEL_2";e[e.COMBO_MULTI_LEVEL_3=6]="COMBO_MULTI_LEVEL_3";e[e.COMBO_MULTI_LEVEL_4=7]="COMBO_MULTI_LEVEL_4";e[e.TOTAL_SCORE_LEVEL_1=8]="TOTAL_SCORE_LEVEL_1"
;e[e.TOTAL_SCORE_LEVEL_2=9]="TOTAL_SCORE_LEVEL_2";e[e.TOTAL_SCORE_LEVEL_3=10]="TOTAL_SCORE_LEVEL_3";e[e.TOTAL_SCORE_LEVEL_4=11]="TOTAL_SCORE_LEVEL_4";e[e.TOTAL_SCORE_LEVEL_5=12]="TOTAL_SCORE_LEVEL_5";e[e.VISITOR_100=13]="VISITOR_100";e[e.CUSTOMIZE_CONFETTI=14]="CUSTOMIZE_CONFETTI";e[e.MORE=15]="MORE";e[e.COMBO_VALUE_LEVEL_1=16]="COMBO_VALUE_LEVEL_1";e[e.COMBO_VALUE_LEVEL_2=17]="COMBO_VALUE_LEVEL_2";e[e.COMBO_VALUE_LEVEL_3=18]="COMBO_VALUE_LEVEL_3";e[e.COMBO_VALUE_LEVEL_4=19]="COMBO_VALUE_LEVEL_4"}(r||(r={}));!function(e){e[e.COMMON=0]="COMMON";e[e.UNCOMMON=1]="UNCOMMON";e[e.RARE=2]="RARE";e[e.EPIC=3]="EPIC";e[e.LEGENDARY=4]="LEGENDARY"}(o||(o={}));var l=(c(i={},r.ENABLE_POGGERMODE,{id:r.ENABLE_POGGERMODE,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_ENABLE_POGGERMODE_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_ENABLE_POGGERMODE_DESCRIPTION},rarity:o.COMMON,hideDescriptionUntilUnlock:!1}),c(i,r.DISABLE_POGGERMODE,{id:r.DISABLE_POGGERMODE,
name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_DISABLE_POGGERMODE_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_DISABLE_POGGERMODE_DESCRIPTION},rarity:o.UNCOMMON,hideDescriptionUntilUnlock:!1}),c(i,r.VISITOR_100,{id:r.VISITOR_100,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_VISITOR_100_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_VISITOR_100_DESCRIPTION},rarity:o.LEGENDARY,hideDescriptionUntilUnlock:!0,onAction:function(){window.open("https://www.youtube.com/watch?v=dQw4w9WgXcQ","_blank")}}),c(i,r.CUSTOMIZE_CONFETTI,{id:r.CUSTOMIZE_CONFETTI,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_CUSTOMIZE_CONFETTI_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_CUSTOMIZE_CONFETTI_DESCRIPTION},rarity:o.COMMON,hideDescriptionUntilUnlock:!1}),c(i,r.MORE,{id:r.MORE,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_MORE_NAME},description:function(){
return s.Z.Messages.POGGERMODE_ACHIEVEMENT_MORE_DESCRIPTION},rarity:o.UNCOMMON,hideDescriptionUntilUnlock:!1}),c(i,r.PING_SOMEONE,{id:r.PING_SOMEONE,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_PING_SOMEONE_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_PING_SOMEONE_DESCRIPTION},rarity:o.COMMON,hideDescriptionUntilUnlock:!1}),c(i,r.PING_ME,{id:r.PING_ME,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_PING_ME_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_PING_ME_DESCRIPTION},rarity:o.UNCOMMON,hideDescriptionUntilUnlock:!1}),c(i,r.COMBO_MULTI_LEVEL_1,{id:r.COMBO_MULTI_LEVEL_1,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_MULTI_LEVEL_1_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_MULTI_LEVEL_1_DESCRIPTION},rarity:o.COMMON,hideDescriptionUntilUnlock:!1,checkUnlock:function(e){return e.multiplier>=2}}),c(i,r.COMBO_MULTI_LEVEL_2,{id:r.COMBO_MULTI_LEVEL_2,
name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_MULTI_LEVEL_2_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_MULTI_LEVEL_2_DESCRIPTION},rarity:o.UNCOMMON,hideDescriptionUntilUnlock:!1,checkUnlock:function(e){return e.multiplier>=4}}),c(i,r.COMBO_MULTI_LEVEL_3,{id:r.COMBO_MULTI_LEVEL_3,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_MULTI_LEVEL_3_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_MULTI_LEVEL_3_DESCRIPTION},rarity:o.RARE,hideDescriptionUntilUnlock:!1,checkUnlock:function(e){return e.multiplier>=5}}),c(i,r.COMBO_MULTI_LEVEL_4,{id:r.COMBO_MULTI_LEVEL_4,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_MULTI_LEVEL_4_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_MULTI_LEVEL_4_DESCRIPTION},rarity:o.RARE,hideDescriptionUntilUnlock:!1,checkUnlock:function(e){return e.multiplier>=7}}),c(i,r.TOTAL_SCORE_LEVEL_1,{id:r.TOTAL_SCORE_LEVEL_1,
name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_1_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_1_DESCRIPTION},rarity:o.EPIC,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 430===(0,a.Eo)(e)}}),c(i,r.TOTAL_SCORE_LEVEL_2,{id:r.TOTAL_SCORE_LEVEL_2,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_2_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_2_DESCRIPTION},rarity:o.EPIC,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 555===(0,a.Eo)(e)}}),c(i,r.TOTAL_SCORE_LEVEL_3,{id:r.TOTAL_SCORE_LEVEL_3,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_3_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_3_DESCRIPTION},rarity:o.EPIC,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 898===(0,a.Eo)(e)}}),c(i,r.TOTAL_SCORE_LEVEL_4,{id:r.TOTAL_SCORE_LEVEL_4,
name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_4_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_4_DESCRIPTION},rarity:o.LEGENDARY,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 1337===(0,a.Eo)(e)}}),c(i,r.TOTAL_SCORE_LEVEL_5,{id:r.TOTAL_SCORE_LEVEL_5,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_5_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_5_DESCRIPTION},rarity:o.LEGENDARY,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 2048===(0,a.Eo)(e)}}),c(i,r.COMBO_VALUE_LEVEL_1,{id:r.COMBO_VALUE_LEVEL_1,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_VALUE_LEVEL_1_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_VALUE_LEVEL_1_DESCRIPTION},rarity:o.RARE,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 64===e.value}}),c(i,r.COMBO_VALUE_LEVEL_2,{
id:r.COMBO_VALUE_LEVEL_2,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_VALUE_LEVEL_2_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_VALUE_LEVEL_2_DESCRIPTION},rarity:o.EPIC,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 88===e.value}}),c(i,r.COMBO_VALUE_LEVEL_3,{id:r.COMBO_VALUE_LEVEL_3,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_VALUE_LEVEL_3_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_VALUE_LEVEL_3_DESCRIPTION},rarity:o.EPIC,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 99===e.value}}),c(i,r.COMBO_VALUE_LEVEL_4,{id:r.COMBO_VALUE_LEVEL_4,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_VALUE_LEVEL_4_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_VALUE_LEVEL_4_DESCRIPTION},rarity:o.LEGENDARY,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 113===e.value}}),i);function u(e){return l[e]}
var f=function(e){switch(e){case o.COMMON:return{color:"#1ABC9C"};case o.UNCOMMON:return{color:"#3498DB"};case o.RARE:return{color:"#9B59B6"};case o.EPIC:return{color:"#E91E63"};case o.LEGENDARY:return{color:"#E67E22"}}}},530991:(e,t,n)=>{"use strict";n.d(t,{Z:()=>w});var r=n(744564),o=n(301928),i=n(669754),a=n(736818),s=n(563367),c=n(715107),l=n(788169),u=n(716118),f=n(785085),d=n(44616),p=n(2590);function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e){y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return y(e)}function m(e,t){return!t||"object"!==O(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function b(e,t){b=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e
};return b(e,t)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var O=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function v(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return m(this,n)}}var _=(0,u.uk)("poggermode_applause",i.Z.getSoundpack()),I=.1,S=!1,T=!1,N=[],A=null,C=function(){if(!S){_.loop();S=!0}},P=function(){_.stop();S=!1},j=function(){var e=f.Z.isEnabled(),t=f.Z.comboSoundsEnabled;return!(!e||!t)&&null!=c.Z.getChannelId()},R=function(){if(0!==N.length&&j()&&!T){T=!0;var e=g(N[N.length-1],2),t=e[0],n=e[1];(0,u.GN)(t,n);A=setTimeout(x,1e3)}},x=function(){N.pop();T=!1;R()},M=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=s.Z.isConnected(),r=n?I:1;N.push([e,t*r]);R()};const w=new(function(e){!function(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&b(e,t)}(n,e);var t=v(n);function n(){E(this,n);return t.apply(this,arguments)}var o=n.prototype;o._initialize=function(){d.ZP.addChangeListener(this.startAudio);r.Z.subscribe("RTC_CONNECTION_STATE",this.setVolume);r.Z.subscribe("TYPING_STOP",this.stopAudio);r.Z.subscribe("TYPING_STOP_LOCAL",this.stopAudio);r.Z.subscribe("CHANNEL_SELECT",this.stopAudio);r.Z.subscribe("POGGERMODE_SETTINGS_UPDATE",this.stopAudio)};o._terminate=function(){d.ZP.removeChangeListener(this.startAudio);r.Z.unsubscribe("RTC_CONNECTION_STATE",this.setVolume);r.Z.unsubscribe("TYPING_STOP",this.stopAudio);r.Z.unsubscribe("TYPING_STOP_LOCAL",this.stopAudio);r.Z.unsubscribe("CHANNEL_SELECT",this.stopAudio);r.Z.unsubscribe("POGGERMODE_SETTINGS_UPDATE",this.stopAudio);clearTimeout(A)};o.setVolume=function(e){
e.state===p.hes.RTC_CONNECTED?_.volume=I:_.volume=1};o.handleTypingStop=function(e){var t=e.userId;a.default.getId()===t&&P()};o.stopAudio=function(){P()};o.startAudio=function(){if(j()){var e=c.Z.getChannelId();if(null!=e){var t,n=a.default.getId(),r=l.Z.isTyping(e,n),o=d.ZP.getUserCombo(n,e),i=null!==(t=null==o?void 0:o.multiplier)&&void 0!==t?t:1;r&&i>=7?C():P()}}};o.playAchievementUnlockSound=function(){j()&&M("poggermode_achievement_unlock")};o.__getLocalVars=function(){return{applause:_,COMBO_SOUND_EFFECT_MULTIPLIER_THRESHOLD:7,REGULAR_VOLUME:1,REDUCED_VOLUME:I,SOUND_DEQUEUE_TIMEOUT_MS:1e3,isLooping:S,isPlaying:T,soundQueue:N,soundTimeoutId:A,loopApplause:C,stopApplause:P,canPlaySound:j,playSoundFromQueue:R,queueNextSound:x,enqueueSound:M}};return n}(o.Z))},17229:(e,t,n)=>{"use strict";n.d(t,{Z:()=>b});var r,o=n(785893),i=(n(667294),n(707961)),a=n(74535),s=n(795470),c=n(436187),l=n(349491),u=n(382518),f=n(494425),d=n(488462),p=n(97291),h=n.n(p);function E(e,t,n){
t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){E(e,t,n[t])}))}return e}var m=(E(r={},d.BR.DARK,{trophy:d.Il.PRIMARY_400,locked:d.Il.PRIMARY_400,unlocked:d.Il.GREEN_330}),E(r,d.BR.LIGHT,{trophy:d.Il.PRIMARY_400,locked:d.Il.PRIMARY_400,unlocked:d.Il.GREEN_330}),r);b.Sizes=i.EFr;function b(e){var t=e.achievementId,n=e.unlocked,r=e.size,d=void 0===r?i.EFr.SIZE_40:r,p=(0,a.ZP)(),E=(0,f.oX)(t);if(null==E)return null;var b,g=(0,i.UCu)(d),O=E.name,v=E.rarity,_=(0,f.F7)(v).color,I=m[p],S=.8*(g.size-g.offset-2*g.stroke),T=g.size-g.stroke,N={width:.4*S,height:.4*S},A={width:N.width+1,height:N.height+1,right:g.stroke+1,bottom:g.stroke+1,
padding:0};return(0,o.jsxs)("div",{className:h().container,style:{width:T,height:T,padding:g.stroke},"aria-label":"".concat(null!==(b=O())&&void 0!==b?b:""),children:[(0,o.jsx)("div",{className:h().trophyIconContainer,children:(0,o.jsx)(u.Z,{color:n?_:(0,s.Lq)(I.trophy),width:S,height:S})}),!n&&(0,o.jsx)("div",{className:h().lockContainer,style:A,children:(0,o.jsx)(l.Z,y({color:(0,s.Lq)(I.locked)},N))}),n&&v===f.EP.LEGENDARY&&(0,o.jsx)("div",{className:h().lockContainer,style:A,children:(0,o.jsx)(c.Z,y({className:h().confettiIcon},N))})]})}},698544:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var r;!function(e){e[e.PREMIUM_FEATURE_LARGER_FILE_UPLOADS_ID=0]="PREMIUM_FEATURE_LARGER_FILE_UPLOADS_ID";e[e.PREMIUM_FEATURE_ANIMATED_EMOJI_ID=1]="PREMIUM_FEATURE_ANIMATED_EMOJI_ID";e[e.PREMIUM_FEATURE_HD_VIDEO_STREAMING_ID=2]="PREMIUM_FEATURE_HD_VIDEO_STREAMING_ID";e[e.PREMIUM_FEATURE_CUSTOM_PROFILES_ID=3]="PREMIUM_FEATURE_CUSTOM_PROFILES_ID"
;e[e.PREMIUM_FEATURE_BUY_ONE_GET_ONE_ID=4]="PREMIUM_FEATURE_BUY_ONE_GET_ONE_ID"}(r||(r={}))},100749:(e,t,n)=>{"use strict";n.d(t,{hz:()=>v,ED:()=>T,Ox:()=>N,pV:()=>A});var r=n(667294),o=n(202351),i=n(281110),a=n(347365),s=n(370459),c=n(536392),l=n(850841),u=n(2590);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function p(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){d(i,r,o,a,s,"next",e)}function s(e){d(i,r,o,a,s,"throw",e)}a(void 0)}))}}function h(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){h(e,t,n[t])}))}return e}function y(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function m(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r]
;t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var g=function(e,t){var n,r,o,i,a={
label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{
value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function O(){return(O=p((function(e){var t,n,r,o,c,f,d,p,h,b,O,v;return g(this,(function(g){switch(g.label){case 0:t=e.items,n=e.paymentSourceId,r=e.trialId,o=e.code,c=e.applyEntitlements,f=void 0!==c&&c,d=e.currency,p=e.renewal,h=e.metadata;t=(0,l.gB)(t);b={items:t.map((function(e){var t=e.planId;return y(E({},m(e,["planId"])),{plan_id:t})})),payment_source_id:n,trial_id:r,code:o,apply_entitlements:f,currency:d,renewal:p,metadata:h};g.label=1;case 1:g.trys.push([1,3,,4]);return[4,i.Z.post({url:u.ANM.BILLING_SUBSCRIPTIONS_PREVIEW,body:b,oldFormErrors:!0})];case 2:O=g.sent();return[2,s.Z.createInvoiceFromServer(O.body)];case 3:v=g.sent();throw new a.HF(v);case 4:return[2]}}))}))).apply(this,arguments)}function v(e){return _.apply(this,arguments)}function _(){return(_=p((function(e){var t,n,r,o,c,f,d,p,h,b;return g(this,(function(g){switch(g.label){case 0:t=e.subscriptionId,n=e.items,r=e.paymentSourceId,o=e.renewal,c=e.currency,
f=e.applyEntitlements,d=void 0!==f&&f;null!=n&&(n=(0,l.gB)(n));p={items:null==n?void 0:n.map((function(e){var t=e.planId;return y(E({},m(e,["planId"])),{plan_id:t})})),payment_source_id:r,renewal:o,apply_entitlements:d,currency:c};g.label=1;case 1:g.trys.push([1,3,,4]);return[4,i.Z.patch({url:u.ANM.BILLING_SUBSCRIPTION_PREVIEW(t),body:p,oldFormErrors:!0})];case 2:h=g.sent();return[2,s.Z.createInvoiceFromServer(h.body)];case 3:b=g.sent();throw new a.HF(b);case 4:return[2]}}))}))).apply(this,arguments)}function I(){return(I=p((function(e){var t,n;return g(this,(function(r){switch(r.label){case 0:t=e.subscriptionId;return e.preventFetch?[2,null]:[4,i.Z.get({url:u.ANM.BILLING_SUBSCRIPTION_INVOICE(t),oldFormErrors:!0})];case 1:n=r.sent();return[2,s.Z.createInvoiceFromServer(n.body)]}}))}))).apply(this,arguments)}function S(e,t){var n=e.preventFetch,i=void 0!==n&&n,a=b((0,r.useState)(null),2),s=a[0],l=a[1],u=b((0,r.useState)(null),2),f=u[0],d=u[1],h=(0,o.e7)([c.Z],(function(){
return c.Z.getSubscriptions()}));(0,r.useEffect)((function(){var e=!1;function n(){return(n=p((function(){var n,r;return g(this,(function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);d(null);l(null);return[4,t()];case 1:n=o.sent();e||l(n);return[3,3];case 2:r=o.sent();e||d(r);return[3,3];case 3:return[2]}}))}))).apply(this,arguments)}i||function(){n.apply(this,arguments)}();return function(){e=!0}}),[i,t,h]);return[s,f]}function T(e){if("subscriptionId"in e&&null==e.subscriptionId){e.subscriptionId;var t=m(e,["subscriptionId"]);e=t}var n=(0,r.useCallback)((function(){return"subscriptionId"in e?v(e):"items"in e?function(e){return O.apply(this,arguments)}(e):null}),[JSON.stringify(e)]);return S(e,n)}function N(e){var t=(0,r.useCallback)((function(){return function(e){return I.apply(this,arguments)}(e)}),[JSON.stringify(e)]);return S(e,t)}function A(e){var t=e.subscriptionPlanPrice;e.discounts.forEach((function(n){var r=n.amount/e.quantity;t-=r}));return t}},499171:(e,t,n)=>{
"use strict";n.d(t,{U:()=>d});var r=n(730381),o=n.n(r),i=n(202351),a=n(711531),s=n(551778),c=n(536392),l=n(850841),u=n(2590),f=n(488462);function d(){var e=(0,i.e7)([c.Z],(function(){return c.Z.getPremiumTypeSubscription()})),t=(0,i.e7)([s.Z],(function(){return null!=e&&null!=e.planIdFromItems?s.Z.get(null==e?void 0:e.planIdFromItems):null})),n=(0,i.e7)([a.Z],(function(){return null!=e&&null!=e.paymentSourceId?a.Z.getPaymentSource(e.paymentSourceId):null}),[e]),r=null!=n&&f.Uk.has(n.type),d=(null==e?void 0:e.status)===u.O0b.PAST_DUE?o()().diff(o()(e.currentPeriodStart),"days"):0;return!(null==e||null==t||!(0,l.uZ)(t.id))&&(r&&d>=0&&d<=(0,l.lU)(e)&&e.status===u.O0b.PAST_DUE&&!e.isPurchasedExternally)}},83435:(e,t,n)=>{"use strict";n.d(t,{l:()=>b,Y:()=>g});var r=n(667294),o=n(202351),i=n(744564),a=n(473903),s=n(850841),c=n(666870),l=n(803548),u=n(247253),f=n(188435),d=n(203600);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}
function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||y(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||y(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){if(e){if("string"==typeof e)return p(e,t)
;var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);return"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function m(){var e=(0,o.Wu)([f.Z],(function(){return f.Z.outboundPromotions})),t=(0,o.e7)([f.Z],(function(){return f.Z.consumedInboundPromotionId}));return r.useMemo((function(){return e.filter((function(e){return e.id!==t}))}),[e,t])}function b(){var e=(0,o.e7)([f.Z],(function(){return f.Z.lastFetchedActivePromotions})),t=m(),n=(0,o.e7)([a.default],(function(){return a.default.getCurrentUser()})),p=(0,c._O)(),y=h(r.useState(!1),2),b=y[0],g=y[1],O=h(r.useState([]),2),v=O[0],_=O[1];r.useEffect((function(){null!=e&&i.Z.wait((function(){return u.ZP.markOutboundPromotionsSeen()}))}),[e]);var I=r.useCallback((function(e){_((function(t){return t.some((function(t){return t.promotion.id===e.promotion.id}))?t:E(t).concat([e])}))}),[]),S=(0,s.M5)(n,d.p9.TIER_2)
;r.useEffect((function(){i.Z.wait((function(){S&&null==e&&u.ZP.fetchActiveOutboundPromotions()}))}),[e,S]);r.useEffect((function(){i.Z.wait((function(){(0,l.t8)().then((function(e){_(e);g(!0)})).catch((function(){_([]);g(!0)}))}))}),[]);var T={},N=!0,A=!1,C=void 0;try{for(var P,j=v[Symbol.iterator]();!(N=(P=j.next()).done);N=!0){var R=P.value,x=R.code,M=R.promotion;T[M.id]=x}}catch(e){A=!0;C=e}finally{try{N||null==j.return||j.return()}finally{if(A)throw C}}var w=new Set(t.map((function(e){return e.id}))),D=v.filter((function(e){var t=e.promotion;return!w.has(t.id)}));return{promotionsLoaded:b&&(!S||null!=e),activeOutboundPromotions:t.filter((function(e){return(0,l.ZC)(e)&&(!p||(0,l.Qf)(e,T))})),claimedEndedOutboundPromotions:D.filter((function(e){return(0,l.ZC)(e.promotion)})),claimedOutboundPromotionCodeMap:T,addClaimedOutboundPromotionCode:I}}function g(){var e=(0,o.e7)([f.Z],(function(){return f.Z.lastSeenOutboundPromotionStartDate})),t=(0,c._O)(),n=m();return r.useMemo((function(){
if(null==e)return t?n.filter((function(e){return(0,l.Nw)(e)})):n;var r=n.filter((function(t){var n=t.startDate;return new Date(n)>new Date(e)}));return t?r.filter((function(e){return(0,l.Nw)(e)})):r}),[n,e,t])}},392649:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(785893),o=(n(667294),n(707961)),i=n(225416),a=n.n(i);function s(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function c(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function l(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{}
;var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function u(e){var t=e.children,n=l(e,["children"]);return(0,r.jsx)(o.zxk,c(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){s(e,t,n[t])}))}return e}({},n),{size:o.zxk.Sizes.SMALL,look:o.zxk.Looks.INVERTED,className:a().button,children:t}))}},195363:(e,t,n)=>{"use strict";n.r(t);n.d(t,{PremiumSubscriptionWowMomentForHelper:()=>Y,default:()=>z})
;var r=n(785893),o=n(667294),i=n(248088),a=n(202351),s=n(744564),c=n(316878),l=n(786170),u=n(652591),f=n(245305),d=n(930948),p=n(666870),h=n(436145),E=n(398344),y=n(156620),m=n(305082),b=n(266997),g=n(955426),O=n.n(g),v=n(621491),_=n.n(v),I=n(470752),S=n.n(I),T=n(734207),N=n.n(T),A=n(2590),C=n(732278),P=n.n(C),j=n(861197),R=n.n(j),x=n(109177),M=n.n(x),w=n(919098),D=n.n(w),Z=n(900615),L=n.n(Z);function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function k(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function G(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){k(i,r,o,a,s,"next",e)}function s(e){k(i,r,o,a,s,"throw",e)}a(void 0)}))}}function B(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){
var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return U(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var H,V=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){
if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function F(){F=G((function(e){var t,n,r,o,i,a;return V(this,(function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);s.Z.dispatch({type:"PREMIUM_TUTORIAL_IS_FETCHING_WOW_MOMENT_MEDIA",value:!0})
;"(min-width: 1012px) and (max-width: 1980px)";"(min-height: 720px) and (max-height: 1408px)";"(min-width: 1980px)";"(min-height: 1408px)";t=e?_():M();window.matchMedia("(min-width: 1012px) and (max-width: 1980px)").matches||window.matchMedia("(min-height: 720px) and (max-height: 1408px)").matches?t=e?S():D():(window.matchMedia("(min-width: 1980px)").matches||window.matchMedia("(min-height: 1408px)").matches)&&(t=e?N():L());n=fetch(t).then((l=G((function(e){var t;return V(this,(function(n){switch(n.label){case 0:return[4,e.blob()];case 1:t=n.sent();return[2,window.URL.createObjectURL(t)]}}))})),function(e){return l.apply(this,arguments)}));r=fetch(e?O():R()).then(function(){var e=G((function(e){var t;return V(this,(function(n){switch(n.label){case 0:return[4,e.blob()];case 1:t=n.sent();return[2,window.URL.createObjectURL(t)]}}))}));return function(t){return e.apply(this,arguments)}}());return[4,Promise.all([n,r])];case 1:o=B.apply(void 0,[c.sent(),2]),i=o[0],a=o[1];s.Z.dispatch({
type:"PREMIUM_TUTORIAL_FETCH_WOW_MOMENT_MEDIA_SUCCESS",wumpusMedia:i,helperMedia:a});return[3,3];case 2:c.sent();s.Z.dispatch({type:"PREMIUM_TUTORIAL_IS_FETCHING_WOW_MOMENT_MEDIA",value:!1});(0,h.Dd)(!1);return[3,3];case 3:return[2]}var l}))}));return F.apply(this,arguments)}function Y(){var e=B(o.useState(!0),2),t=e[0],n=e[1],i=(0,a.e7)([E.Z],(function(){return E.Z.wowMomentHelperMedia})),s=(0,f.rO)()?"video/mp4":"video/webm";return(0,r.jsx)("div",{children:t&&null!==i&&(0,r.jsx)(l.Z,{className:P().videoWrapperForHelper,autoPlay:!0,onEnded:function(){n(!1);(0,h.HY)(!1)},children:(0,r.jsx)("source",{src:i,type:s})})})}const z=function(){var e=(0,a.e7)([c.Z],(function(){return c.Z.useReducedMotion})),t=(0,m.AR)(),n=(0,b.zW)(),s=t||n,g=(0,a.cj)([E.Z],(function(){return{wumpusMedia:E.Z.wowMomentWumpusMedia,helperMedia:E.Z.wowMomentHelperMedia,isFetchingMedia:E.Z.isFetchingWowMomentMedia,canPlayWowMoment:E.Z.canPlayWowMoment}
})),O=g.wumpusMedia,v=g.helperMedia,_=g.isFetchingMedia,I=g.canPlayWowMoment,S=B(o.useState(!1),2),T=S[0],N=S[1],C=(0,f.vu)(),j=C>52||-1===C,R=(0,f.rO)(),x=j||R,M=R?"video/mp4":"video/webm";x&&!e&&I&&s&&null===O&&null===v&&!1===_&&function(e){F.apply(this,arguments)}(R);o.useEffect((function(){var t=function(){var t=(0,p._y)(),n=(0,b.fz)();if(y.Z.getCurrentConfig({},{disable:e||!t||!x}).enabled||n){N(!0);H=setTimeout((function(){N(!1);Z(!0);u.default.track(A.rMx.PREMIUM_WOW_MOMENT_VIEWED,{wow_moment_type:y.X.GRADIENT_HIGHLIGHT})}),2e3)}if(e){(0,h.HY)(!1);(0,h.Dd)(!1)}x||(0,h.Dd)(!1)};d.S.subscribe(A.CkL.PREMIUM_SUBSCRIPTION_CREATED,t);return function(){d.S.unsubscribe(A.CkL.PREMIUM_SUBSCRIPTION_CREATED,t)}}),[e,x]);var w=B(o.useState(!1),2),D=w[0],Z=w[1],L=B(o.useState(!1),2),U=L[0],k=L[1],G=(0,i.useSpring)({opacity:D?.2:0,config:{duration:100},immediate:e}),V=(0,i.useSpring)({x:U?"100%":"-100%",config:{duration:500},immediate:e||!U});o.useEffect((function(){var e=-1
;D&&(e=window.setTimeout((function(){k(!0)}),1e3));return function(){window.clearTimeout(e)}}),[D]);o.useEffect((function(){var e=-1;U&&(e=window.setTimeout((function(){k(!1);Z(!1);(0,h.Dd)(!1)}),1e3));return function(){window.clearTimeout(e)}}),[U]);return(0,r.jsxs)("div",{className:P().wrapper,children:[T&&null!==O&&(0,r.jsx)(l.Z,{autoPlay:!0,className:P().videoWrapper,onPlay:function(){clearTimeout(H);u.default.track(A.rMx.PREMIUM_WOW_MOMENT_VIEWED,{wow_moment_type:y.X.WUMPUS_FLIGHT})},onTimeUpdate:function(e){if(e.currentTarget.currentTime>4){(0,h.HY)(!0);(0,h.Dd)(!1)}},onEnded:function(){N(!1)},children:(0,r.jsx)("source",{src:O,type:M})}),(0,r.jsx)(i.animated.div,{className:P().gadientHighlight,style:G}),(0,r.jsx)(i.animated.div,{className:P().swipeWrapper,style:V,children:(0,r.jsxs)("svg",{className:P().swipe,viewBox:"0 0 848 1024",fill:"none",children:[(0,r.jsx)("path",{d:"M257.206 1024L0 0H341.333L598.539 1024H257.206Z",fill:"white"}),(0,r.jsx)("path",{
d:"M847.975 1024H690.436L433.231 0H590.769L847.975 1024Z",fill:"white"})]})})]})}},798564:(e,t,n)=>{"use strict";n.d(t,{MM:()=>re,ZP:()=>oe});var r=n(785893),o=n(667294),i=n(294184),a=n.n(i),s=n(441143),c=n.n(s),l=n(730381),u=n.n(l),f=n(202351),d=n(336194),p=n(707961),h=n(734691),E=n(153686),y=n(19585),m=n(845882),b=n(604160),g=n(800336),O=n(473903),v=n(107364),_=n(641277),I=n(265367),S=n(652591),T=n(850841),N=n(447246),A=n(100749),C=n(499171),P=n(392649),j=n(250740),R=n(666800),x=n(673679),M=n(64234),w=n(551778),D=n(249052),Z=n(2590),L=n(473708),U=n(551047),k=n.n(U);function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function B(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function H(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){B(i,r,o,a,s,"next",e)}function s(e){B(i,r,o,a,s,"throw",e)}a(void 0)}))}}
function V(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return G(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return G(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var F=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),
throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Y(e){
var t=e.subscription,n=e.renewalMutations,o=e.transitionState,i=e.onClose,a=e.analyticsLocation,s=(0,f.e7)([M.Z],(function(){return M.Z.theme})),l=(0,y.Z)(E.Z.SUBSCRIPTION_CANCEL_DOWNGRADE_MODAL).analyticsLocations;function u(){return(u=H((function(){return F(this,(function(e){switch(e.label){case 0:return[4,(0,x.dP)(t,t.planId,l,a)];case 1:e.sent();i();return[2]}}))}))).apply(this,arguments)}var d=w.Z.get(t.planId);c()(null!=d,"Missing subscriptionPlan");var h=(0,T.aS)(t.planId,!1,!1,{paymentSourceId:t.paymentSourceId,currency:t.currency}),m=(0,D.og)((0,D.T4)(h.amount,h.currency),d.interval,d.intervalCount);return(0,r.jsxs)(p.Y0X,{transitionState:o,"aria-label":L.Z.Messages.PREMIUM_PENDING_PLAN_CHANGE_CANCEL_HEADER,children:[(0,r.jsxs)(p.xBx,{justify:v.Z.Justify.BETWEEN,separator:!1,children:[(0,r.jsx)(p.vwX,{tag:p.RB0.H4,children:L.Z.Messages.PREMIUM_PENDING_PLAN_CHANGE_CANCEL_HEADER}),(0,r.jsx)(p.olH,{onClick:i})]}),(0,r.jsx)(p.hzk,{className:k().modalBody,children:(0,
g.Q)(t.planId)?L.Z.Messages.PREMIUM_PENDING_PLAN_CHANGE_CANCEL_BODY_NO_EXISTING_PLAN.format({downgradedPlan:T.ZP.getDisplayName(n.planId),existingRate:m}):L.Z.Messages.PREMIUM_PENDING_PLAN_CHANGE_CANCEL_BODY.format({existingPlan:T.ZP.getDisplayName(t.planId),downgradedPlan:T.ZP.getDisplayName(n.planId),existingRate:m})}),(0,r.jsxs)(p.mzw,{children:[(0,r.jsx)(p.zxk,{onClick:function(){return u.apply(this,arguments)},children:L.Z.Messages.PREMIUM_PENDING_PLAN_CHANGE_CANCEL_BUTTON}),(0,r.jsx)(p.zxk,{look:p.zxk.Looks.LINK,color:s===Z.BRd.LIGHT?p.zxk.Colors.PRIMARY:p.zxk.Colors.WHITE,onClick:i,children:L.Z.Messages.NEVERMIND})]})]})}function z(e){var t=e.subscription,n=e.renewalMutations,i=e.className,s=e.analyticsLocation,c=V(o.useState(!1),2),l=c[0],u=c[1];return(0,r.jsxs)("div",{className:a()(k().root,i),children:[(0,r.jsx)(I.Z,{className:k().infoIcon}),(0,r.jsx)("div",{className:k().text,children:L.Z.Messages.PREMIUM_PENDING_PLAN_CHANGE_NOTICE.format({
planName:t.hasExternalPlanChange?(0,T.zL)(n):T.ZP.getDisplayName(n.planId),date:t.currentPeriodEnd})}),t.isPurchasedExternally?null:(0,r.jsx)(p.eee,{onClick:function(e){u(!0);e.preventDefault()},className:k().cancelLink,children:L.Z.Messages.CANCEL}),l?(0,r.jsx)(p.u_l,{renderModal:function(e){var o=e.transitionState;return(0,r.jsx)(Y,{subscription:t,renewalMutations:n,transitionState:o,onClose:function(){return u(!1)},analyticsLocation:s})},onCloseRequest:function(){return u(!1)}}):null]})}var W=n(349263),K=n.n(W);function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function X(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){
i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e){var t=e.subscription,n=e.fromStandaloneBillingPage,o=void 0===n||n,i=e.className,s=(0,f.e7)([O.default],(function(){var e=O.default.getCurrentUser();c()(null!=e,"GuildBoostingHeader: currentUser cannot be undefined");return e}));if(0===(0,T.uV)(t.additionalPlans))return null;var l,u=t.status,d=(0,T.v6)(t);l=d?K().guildBoostingSubscriptionRowCanceled:(0,
T.zV)(u)?K().guildBoostingSubscriptionRowFailedPayment:K().guildBoostingSubscriptionRowActive;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:a()(l,i),children:[(0,r.jsx)("div",{className:K().guildBoostingSubscriptionRowBackground}),(0,r.jsx)("div",{className:K().guildBoostingImage}),(0,r.jsxs)("div",{className:K().guildBoostingSubscriptionRowBody,children:[(0,r.jsx)("div",{className:a()(K().guildBoostingWordmark,X({},K().canceled,d))}),(0,r.jsx)("div",{children:(0,T.bt)(t,s)})]}),o&&(0,r.jsx)(P.Z,{color:p.zxk.Colors.BRAND,onClick:function(){return h.Z.open(Z.oAB.GUILD_BOOSTING)},children:L.Z.Messages.PREMIUM_GUILD_PERKS_MODAL_MANAGE_YOUR_SUBSCRIPTIONS})]}),!o&&(0,r.jsx)(p.xvT,{className:K().boostingDesktopAppBlurb,variant:"text-sm/normal",children:L.Z.Messages.GUILD_BOOSTING_MANAGEMENT_OPEN_DESKTOP_APP.format({openAppHook:function(){return(0,m.Z)("app")}})})]})}function J(){o.useEffect((function(){S.default.track(Z.rMx.TOOLTIP_VIEWED,{
type:"subscription_settings_missing_payment_method"})}),[]);return(0,r.jsxs)("div",{className:K().paymentBanner,children:[(0,r.jsx)(I.Z,{className:K().paymentBannerIcon,color:d.Z.unsafe_rawColors.YELLOW_260.css}),(0,r.jsx)(p.xvT,{className:K().paymentBannerText,variant:"text-sm/normal",children:L.Z.Messages.MISSING_PAYMENT_METHOD_BANNER})]})}function ee(){o.useEffect((function(){S.default.track(Z.rMx.TOOLTIP_VIEWED,{type:"subscription_settings_invalid_payment_method"})}),[]);return(0,r.jsxs)("div",{className:K().paymentBanner,children:[(0,r.jsx)(I.Z,{className:K().paymentBannerIcon,color:d.Z.unsafe_rawColors.RED_360.css}),(0,r.jsx)(p.xvT,{className:K().paymentBannerText,variant:"text-sm/normal",children:L.Z.Messages.INVALID_PAYMENT_METHOD_BANNER})]})}function te(e){var t=e.daysPastDue,n=e.subscription,i=e.openInvoiceId,a=(0,y.Z)(E.Z.PAST_DUE_ONE_TIME_PAYMENT_METHOD_BANNER).analyticsLocations;o.useEffect((function(){S.default.track(Z.rMx.TOOLTIP_VIEWED,{
type:"subscription_settings_invalid_payment_method"})}),[]);return(0,r.jsxs)("div",{className:K().paymentBanner,children:[(0,r.jsx)(I.Z,{className:K().paymentBannerIcon,color:d.Z.unsafe_rawColors.YELLOW_260.css}),(0,r.jsx)(p.xvT,{className:K().paymentBannerText,variant:"text-sm/normal",children:L.Z.Messages.PREMIUM_SUBSCRIPTION_ONE_TIME_PAYMENT_PAST_DUE_SUBSCRIPTION_TEXT.format({daysPastDue:t,paymentModalRedirect:function(){(0,b.Z)({initialPlanId:n.planIdFromItems,openInvoiceId:i,analyticsLocations:a})}})})]})}function ne(e){var t=e.subscription,n=e.renewalInvoicePreview,o=e.className;return(0,r.jsxs)("div",{className:a()(K().billingInformation,o),children:[(0,r.jsx)(p.vwX,{tag:"h3",className:K().detailBlockHeader,children:L.Z.Messages.PREMIUM_SETTINGS_BILLING_INFO}),(0,r.jsx)("div",{children:T.ZP.getBillingInformationString(t,n)})]})}function re(e){var t=e.className;return(0,r.jsxs)("div",{className:t,children:[(0,r.jsx)(p.vwX,{className:K().sectionTitle,tag:"h1",
children:L.Z.Messages.USER_SETTINGS_SUBSCRIPTIONS_HEADER}),(0,r.jsx)("p",{className:K().sectionDescription,children:L.Z.Messages.BILLING_PAYMENT_PREMIUM_DESCRIPTION}),(0,r.jsx)(p.Zbd,{className:K().noItemsCard,type:p.Zbd.Types.CUSTOM,children:(0,r.jsxs)(v.Z,{align:v.Z.Align.CENTER,children:[(0,r.jsx)(_.Z,{game:null,size:_.Z.Sizes.SMALL,className:K().noItemsIcon}),(0,r.jsx)("span",{className:K().cardText,children:L.Z.Messages.USER_SETTINGS_NO_SUBSCRIPTIONS})]})})]})}function oe(e){var t,n,o=e.subscription,i=e.paymentSource,s=e.busy,c=e.className,l=e.fromStandaloneBillingPage,d=void 0===l||l,h=e.analyticsLocation,E=Q((0,A.ED)({subscriptionId:o.id,renewal:!0}),1)[0],y=Q((0,A.ED)({subscriptionId:o.id,renewal:!0,applyEntitlements:!0}),1)[0],m=(0,f.e7)([O.default],(function(){var e;return null===(e=O.default.getCurrentUser())||void 0===e?void 0:e.hasFreePremium()
})),b=u()(o.currentPeriodEnd),v=null!=o.paymentSourceId,_=null!==(t=null==y?void 0:y.total)&&void 0!==t?t:0,I=null==i?void 0:i.invalid,S=!v&&_>0&&(b.diff(u()(),"days")<=7||o.status===Z.O0b.PAST_DUE)&&!m&&!o.isPurchasedExternally,T=I&&o.status===Z.O0b.PAST_DUE&&!m&&!o.isPurchasedExternally,P=(0,C.U)(),x=!m&&P,M=(null==o?void 0:o.status)===Z.O0b.PAST_DUE?u()().diff(u()(o.currentPeriodStart),"days"):0,w=Q((0,A.Ox)({subscriptionId:o.id,preventFetch:!x}),1)[0];if(null==E||null==y)return(0,r.jsx)(p.$jN,{});null!=o.renewalMutations&&(o.renewalMutations.planId!==o.planId&&!(0,g.Q)(o.renewalMutations.planId)||o.hasExternalPlanChange)&&(n=(0,r.jsx)(z,{subscription:o,renewalMutations:o.renewalMutations,className:K().renewalMutationNotice,analyticsLocation:h}));return(0,r.jsx)("div",{className:c,children:(0,r.jsxs)(p.y5t,{component:(0,r.jsx)(p.vwX,{className:K().sectionTitle,tag:"h1",children:L.Z.Messages.USER_SETTINGS_SUBSCRIPTIONS_HEADER}),children:[S?(0,r.jsx)(J,{}):null,T?(0,
r.jsx)(ee,{}):null,x&&null!=w?(0,r.jsx)(te,{daysPastDue:M,subscription:o,openInvoiceId:w.id}):null,n,(0,r.jsxs)("div",{className:K().subscriptionRows,children:[(0,r.jsx)("p",{className:K().sectionDescription,children:L.Z.Messages.BILLING_PAYMENT_PREMIUM_DESCRIPTION}),(0,r.jsx)(j.Z,{subscription:o,renewalInvoicePreview:E,paymentSource:i,busy:s,analyticsLocation:h}),(0,r.jsx)($,{subscription:o,fromStandaloneBillingPage:d,className:K().guildSubscriptionRow})]}),(0,r.jsx)("div",{children:(0,r.jsx)(p.y5t,{component:(0,r.jsx)(p.vwX,{tag:"h5",children:L.Z.Messages.BILLING_STEP_PAYMENT}),children:(0,r.jsxs)("div",{className:K().details,children:[(0,r.jsx)(ne,{subscription:o,renewalInvoicePreview:y,className:K().detailsBlock}),(0,r.jsxs)("div",{className:a()(K().detailsBlock,X({},K().redBorder,T)),children:[(0,r.jsx)(p.vwX,{tag:"h3",className:K().detailBlockHeader,children:o.isPurchasedExternally&&null!=o.paymentGateway?L.Z.Messages.BILLING_MANAGED_BY_PAYMENT_GATEWAY.format({
paymentGatewayName:Z.Vzj[o.paymentGateway]}):L.Z.Messages.BILLING_PAY_FOR_IT_WITH}),(0,r.jsx)(R.Z,{subscription:o,onPaymentSourceAdded:N.i1,highlightAddPaymentMethodButton:S||T,analyticsLocation:h,currentInvoicePreview:E,dropdownClassName:K().paymentDropdown}),(0,r.jsx)("div",{className:K().paymentDropdownFinePrint,children:L.Z.Messages.BILLING_APPLIES_TO_ALL_SUBSCRIPTIONS})]})]})})})]})})}},250740:(e,t,n)=>{"use strict";n.d(t,{R:()=>Z,Z:()=>L});var r=n(785893),o=(n(667294),n(294184)),i=n.n(o),a=n(441143),s=n.n(a),c=n(707961),l=n(665082),u=n(153686),f=n(19585),d=n(296602),p=n(604160),h=n(800336),E=n(551778),y=n(759890),m=n(345392),b=n(850841),g=n(447246),O=n(392649),v=n(203600),_=n(2590),I=n(473708),S=n(812879),T=n.n(S);function N(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function A(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){N(i,r,o,a,s,"next",e)}
function s(e){N(i,r,o,a,s,"throw",e)}a(void 0)}))}}function C(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){C(e,t,n[t])}))}return e}function j(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var R=function(e,t){var n,r,o,i,a={label:0,
sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{
value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},x=new d.Z("SubscriptionHeader.tsx"),M={page:_.ZY5.USER_SETTINGS,section:_.jXE.SETTINGS_PREMIUM,object:_.qAy.CARD};function w(e){var t=e.wordMark,n=e.subscriptionInfo,o=e.buttons,a=e.statusClasses;return(0,r.jsxs)("div",{className:i()(T().banner,a),children:[(0,r.jsx)("div",{className:T().bannerBackgroundImage}),(0,r.jsxs)("div",{className:T().detailsContainer,children:[(0,r.jsx)("div",{className:T().image}),(0,r.jsxs)("div",{className:T().details,children:[t,n]})]}),(0,r.jsx)("div",{className:T().buttons,children:o})]})}function D(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.Z,{className:T().discordWordmark,"aria-label":I.Z.Messages.PREMIUM_TIER_1}),(0,r.jsx)("div",{className:T().classicWordmark})]})}function Z(){var e=(0,f.Z)(u.Z.ACCOUNT_CREDIT_BANNER).analyticsLocations;return(0,r.jsx)(w,{wordMark:(0,r.jsx)(D,{}),subscriptionInfo:(0,r.jsx)("div",{className:T().planInfo,
children:I.Z.Messages.PREMIUM_TIER_1_ACCOUNT_CREDIT_BANNER_DESCRIPTION}),buttons:(0,r.jsx)(O.Z,{className:T().toolsButton,onClick:function(){return(0,p.Z)({subscriptionTier:v.Si.TIER_1,analyticsLocations:e,analyticsObject:M})},children:I.Z.Messages.PREMIUM_TIER_1_ACCOUNT_CREDIT_BANNER_CTA}),statusClasses:C({},T().tier1,!0)})}const L=function(e){var t=e.subscription,o=e.renewalInvoicePreview,a=e.paymentSource,d=e.busy,S=e.analyticsLocation,N=(0,f.Z)(u.Z.SUBSCRIPTION_HEADER).analyticsLocations,Z=function(){t.status!==_.O0b.ACTIVE&&t.status!==_.O0b.PAST_DUE||L()},L=function(){(0,c.ZDy)(A((function(){var e,o;return R(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(96546),n.e(54780)]).then(n.bind(n,35751))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,j(P({},e),{premiumSubscription:t,analyticsLocation:S,analyticsLocations:N}))}]}}))})))},U=function(){if(null!=t&&null!=t.planIdFromItems){var e=E.Z.get(t.planIdFromItems);if(null==e){
x.info("Plan not fetched for plan id: ".concat(t.planIdFromItems));return}var n=(0,g.DE)(e,null==a?void 0:a.id,!1),r=n.length>0?n[0]:t.currency,o=!1;1===n.length&&(null==a?void 0:a.id)===t.paymentSourceId&&(0,g.tD)(e.id,r,null==a?void 0:a.id)?o=!0:null==a||(0,b.Z8)()||(o=!0);o?l.O5(t,N):(0,p.Z)({initialPlanId:t.planIdFromItems,analyticsLocations:N,analyticsLocation:S,analyticsObject:M})}},k=b.ZP.getPlanIdFromInvoice(t,o);if((0,h.Q)(k))return null;var G,B=b.ZP.getStatusFromInvoice(t,o),H=b.ZP.getPremiumType(k),V=(C(G={},T().tier0,H===v.p9.TIER_0),C(G,T().tier1,H===v.p9.TIER_1),C(G,T().tier2,H===v.p9.TIER_2),C(G,T().canceled,B===_.O0b.CANCELED),C(G,T().failedPayment,(0,b.zV)(B)),G),F=null;switch(H){case v.p9.TIER_0:F=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.Z,{className:T().discordWordmark,"aria-label":I.Z.Messages.PREMIUM_TIER_0}),(0,r.jsx)("div",{className:T().basicWordmark})]});break;case v.p9.TIER_1:F=(0,r.jsx)(D,{});break;case v.p9.TIER_2:F=(0,r.jsx)(y.Z,{className:T().planName,
"aria-label":I.Z.Messages.PREMIUM_TITLE})}return(0,r.jsx)(w,{wordMark:F,subscriptionInfo:function(e){s()(null!=o,"Expected renewalInvoicePreview");return(0,r.jsx)("div",{className:T().planInfo,children:(0,b.qV)({planId:e,subscription:t,renewalInvoicePreview:o})})}(k),buttons:function(){var e=t.status;if(t.isPurchasedExternally){var n=(0,b.JE)(t.paymentGateway,"SUBSCRIPTION_MANAGEMENT");return(0,r.jsx)(c.eee,{href:n,useDefaultUnderlineStyles:!1,children:(0,r.jsx)(c.zxk,{className:i()(T().toolsButton,T().externalButton),size:c.zxk.Sizes.SMALL,look:c.iLD.OUTLINED,color:c.Ttl.WHITE,submitting:d,children:I.Z.Messages.BILLING_MANAGE_SUBSCRIPTION})})}if(b.ZP.isBaseSubscriptionCanceled(t))return(0,r.jsx)(c.zxk,{className:T().toolsButton,size:c.zxk.Sizes.SMALL,look:c.iLD.INVERTED,color:c.Ttl.BRAND,submitting:d,onClick:U,children:I.Z.Messages.RESUBSCRIBE});if(e===_.O0b.ACTIVE||e===_.O0b.PAST_DUE){var o=!1,a=null;if(null!=t.renewalMutations){o=!0
;a=t.renewalMutations.planId!==t.planId?I.Z.Messages.PREMIUM_SWITCH_PLAN_DISABLED_PENDING_MUTATION_PLAN:I.Z.Messages.PREMIUM_SWITCH_PLAN_DISABLED_PENDING_MUTATION_PREMIUM_GUILD_SUBSCRIPTION}if(null!=t.trialEndsAt){o=!0;a=I.Z.Messages.PREMIUM_SWITCH_PLAN_DISABLED_IN_TRIAL}e===_.O0b.PAST_DUE&&(o=!0);return(0,r.jsxs)("div",{className:T().toolsButtons,children:[(0,r.jsx)(c.zxk,{className:T().toolsButton,size:c.zxk.Sizes.SMALL,look:c.iLD.LINK,color:c.Ttl.WHITE,submitting:d,onClick:Z,children:I.Z.Messages.CANCEL}),(0,r.jsx)(c.ua7,{text:a,children:function(e){return(0,r.jsx)(O.Z,j(P({},e),{disabled:o,className:T().toolsButton,onClick:function(){(0,p.Z)({analyticsLocations:N,analyticsLocation:S,analyticsObject:M})},children:I.Z.Messages.PREMIUM_SWITCH_PLANS}))}})]})}}(),statusClasses:V})}},666800:(e,t,n)=>{"use strict";n.d(t,{Z:()=>U})
;var r=n(785893),o=n(667294),i=n(294184),a=n.n(i),s=n(441143),c=n.n(s),l=n(202351),u=n(707961),f=n(933599),d=n(665082),p=n(810978),h=n(415324),E=n(700812),y=n(19585),m=n(266472),b=n(793461),g=n(711531),O=n(551778),v=n(850841),_=n(447246),I=n(530562),S=n(100749),T=n(2590),N=n(473708),A=n(57274),C=n.n(A),P=n(913957),j=n.n(P);function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function x(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function M(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){x(i,r,o,a,s,"next",e)}function s(e){x(i,r,o,a,s,"throw",e)}a(void 0)}))}}function w(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function D(e,t){t=null!=t?t:{}
;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name)
;if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var L=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,
o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function U(e){var t,i,s=e.subscription,A=e.onPaymentSourceAdded,P=e.highlightAddPaymentMethodButton,R=e.dropdownClassName,x=e.analyticsLocation,U=e.currentInvoicePreview,k=(0,l.e7)([b.Z],(function(){return b.Z.hidePersonalInformation})),B=Z((0,l.Wu)([g.Z],(function(){return[g.Z.paymentSources,g.Z.hasFetchedPaymentSources]})),2),H=B[0],V=B[1],F=(0,m.V)((0,I.yb)(s)),Y=(0,y.Z)().analyticsLocations,z=o.useMemo((function(){return Object.values(H).filter((function(e){return!e.invalid}))}),[H]),W=Z(o.useState(!1),2),K=W[0],q=W[1],X=Z(o.useState(s.currency),2),Q=X[0],$=X[1],J=(t=M((function(e,t){
return L(this,(function(n){switch(n.label){case 0:if(null==s||null==e&&!(0,v.Z8)())throw Error("missing subscription and paymentSource");return null!=e?[3,2]:[4,d.fG(s,t,Y,x)];case 1:n.sent();return[3,4];case 2:return[4,d.tq(s,e,t,Y,x)];case 3:n.sent();n.label=4;case 4:q(!1);$(t);return[2]}}))})),function(e,n){return t.apply(this,arguments)}),ee=function(){var e=M((function(e,t,n){var r;return L(this,(function(o){switch(o.label){case 0:if(null==e&&!(0,v.Z8)())throw Error("PaymentSource required");q(!0);return[4,(0,S.hz)({subscriptionId:s.id,paymentSourceId:null==e?void 0:e.id,renewal:!0,currency:t})];case 1:r=o.sent();return U.currency!==r.currency||U.currency===r.currency&&U.total!==r.total?[4,G(r,(function(){n(e,t);if(!(0,v.Z8)()){c()(null!=e,"paymentSource required");(0,p.Y2)(e.country,e.id)}}),(function(){q(!1)}))]:[3,3];case 2:o.sent();return[3,4];case 3:n(e,t);o.label=4;case 4:return[2]}}))}));return function(t,n,r){return e.apply(this,arguments)}}(),te=function(e){
var t=O.Z.get(s.planIdForCurrencies);c()(null!=e,"paymentSource not specified for change");c()(null!=t,"Unable to fetch plan");var n=(0,_.DE)(t.id,e.id,!1);return n.length>0?n[0]:T.pKx.USD},ne=function(e){null!=e&&ee(e,te(e),J)},re=function(e){(0,_.i1)(e.id,(0,I.yb)(s)).then((function(){ee(e,te(e),J)}));"function"==typeof A&&A(e.id)},oe=function(){(0,u.ZDy)(M((function(){var e,t;return L(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(38039),n.e(27059),n.e(84501)]).then(n.bind(n,184501))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,D(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){w(e,t,n[t])}))}return e}({},e),{onAddPaymentSource:re,analyticsLocation:x}))}]}}))})),{
onCloseCallback:function(){(0,f.fw)()}})};if(s.isPurchasedExternally)return function(e){c()(null!=e.paymentGateway,"Expected payment gateway when managed externally");var t=(0,v.JE)(e.paymentGateway,"PAYMENT_SOURCE_MANAGEMENT");return(0,r.jsx)(u.eee,{href:t,useDefaultUnderlineStyles:!1,className:C().externalLink,children:(0,r.jsx)(u.zxk,{fullWidth:!0,look:u.zxk.Looks.FILLED,color:u.zxk.Colors.PRIMARY,children:N.Z.Messages.BILLING_MANAGE_BILLING})})}(s);if(V&&F){if(z.length>0){var ie=O.Z.get(s.planIdForCurrencies);c()(null!=ie,"Unable to fetch plan");var ae=(0,_.DE)(ie,s.paymentSourceId,!1);return(0,r.jsxs)(r.Fragment,{children:[(i=s.paymentSourceId,(0,r.jsx)(E.Z,{prependOption:null==i?{label:N.Z.Messages.ATTACH_PAYMENT_SOURCE_PROMPT_OPTION,value:null}:null,className:R,paymentSources:z,hidePersonalInformation:k,selectedPaymentSourceId:i,onChange:ne,onPaymentSourceAdd:oe,dropdownLoading:K})),null!=s.paymentSourceId?(0,r.jsx)(h.b,{currencies:ae,children:(0,r.jsxs)("div",{
className:a()(C().currency,j().flex,j().alignCenter),children:[(0,r.jsx)("div",{children:N.Z.Messages.PAYMENT_CURRENCY_PAYING_IN}),(0,r.jsx)(h.Z,{className:C().currencyDropdown,selectedCurrency:Q,currencies:ae,onChange:function(e){ee(void 0,e,J)}})]})}):null]})}return(0,r.jsx)(u.zxk,{fullWidth:!0,look:u.zxk.Looks.FILLED,color:P?u.zxk.Colors.BRAND:u.zxk.Colors.PRIMARY,onClick:oe,children:N.Z.Messages.BILLING_ADD_PAYMENT_METHOD})}return(0,r.jsx)(u.$jN,{})}var k,G=(k=M((function(e,t,o){var i;return L(this,(function(a){switch(a.label){case 0:return[4,(0,u.ZDy)(M((function(){var i,a;return L(this,(function(s){switch(s.label){case 0:return[4,n.e(2010).then(n.bind(n,302010))];case 1:i=s.sent(),a=i.default;return[2,function(n){return(0,r.jsx)(a,{newInvoice:e,onConfirm:t,onCancel:o,modalProps:n})}]}}))})),{onCloseRequest:function(){null!=i&&(0,u.Mr3)(i);o()}})];case 1:i=a.sent();return[2]}}))})),function(e,t,n){return k.apply(this,arguments)})},282196:(e,t,n)=>{"use strict";n.d(t,{RE:()=>M,
T5:()=>D,Xb:()=>Z,aE:()=>L,cD:()=>U,s9:()=>k,zM:()=>G,zy:()=>B,S5:()=>H,t9:()=>V,fy:()=>F,vv:()=>Y,YK:()=>W,tr:()=>K,FJ:()=>q,bu:()=>X,_f:()=>Q});n(496486);var r=n(608575),o=n(281110),i=n(580085),a=n(630631),s=n(665472),c=n(84894),l=n(883064),u=n(550131),f=n(769321),d=n(382060),p=n(567403),h=n(736097),E=n(598123),y=n(491260),m=n(473903),b=n(407561),g=n(773148),O=n(968696),v=n(860872),_=n(425636),I=n(2590);function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function T(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function N(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){T(i,r,o,a,s,"next",e)}function s(e){T(i,r,o,a,s,"throw",e)}a(void 0)}))}}function A(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){
if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var C=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),
0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};var P=function(){var e=I.Hae.split(":")[0];if(!e.includes("."))return e;var t=e.split("."),n=t[t.length-1];return/^\d+$/.test(n)?e:t.slice(-2).join(".")}(),j=new RegExp("^".concat(O.Z.escape("https://"),"(?:[a-z]+\\.)?(").concat(O.Z.escape(P),"|discordapp.com|discord.com)$")),R={};function x(e){"customEmoji"===e.type&&(e.type="emoji")
;"emoji"===e.type&&e.src&&(e.src=M(e.src));Array.isArray(e.content)&&(e.content=e.content.map(x));return e}function M(e){return/^http/.test(e)?e:"".concat(location.protocol,"//").concat(location.host).concat("/"===e.charAt(0)?"":"/").concat(e)}function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.indexOf(e)>-1}function D(e,t){var n=[],r=e.getGuildId();[I.d4z.GUILD_CATEGORY].concat(A(d.tx)).includes(e.type)||n.push(new Promise((function(t){E.Z.whenReady(e.id,(function(){return t()}));s.Z.fetchMessages({channelId:e.id,limit:I.AQB})})));return Promise.all(n).then((function(){var n,o=(!e.isNSFW()||!0===(null===(n=m.default.getCurrentUser())||void 0===n?void 0:n.nsfwAllowed))&&t?E.Z.getMessages(e.id).toArray().map(Z):[],i=Object.values(b.Z.getVoiceStatesForChannel(e.id)).map((function(t){return L(r,e.id,t)}));return{id:e.id,name:e.name,type:e.type,topic:e.topic,bitrate:e.bitrate,user_limit:e.userLimit,guild_id:r,position:e.position,messages:o,voice_states:i}
}))}function Z(e){var t=l.Z.parseToAST(e.content,!0,{channelId:e.channel_id}).map(x),n=(0,u.ZH)(e),r=n.colorString,o=n.nick;return{id:e.id,blocked:e.blocked,bot:e.bot,content:e.content,content_parsed:t.length?t:void 0,nick:o,author_color:r,edited_timestamp:e.edited_timestamp||e.editedTimestamp,timestamp:e.timestamp,tts:e.tts,mentions:e.mentions,mention_everyone:e.mention_everyone||e.mentionEveryone,mention_roles:e.mention_roles||e.mentionRoles,embeds:e.embeds,attachments:e.attachments,author:e.author?(0,_.Z)(e.author):void 0,pinned:e.pinned,type:e.type}}function L(e,t,n){var r=n.mute,o=n.deaf,i=n.selfMute,a=n.selfDeaf,s=n.suppress,c=n.userId,l=m.default.getUser(c);if(null==l)throw new Error("Invalid user id: ".concat(c));return{nick:g.Z.getName(e,t,l),mute:h.Z.isLocalMute(l.id),volume:h.Z.getLocalVolume(l.id),pan:h.Z.getLocalPan(l.id),voice_state:{mute:r,deaf:o,self_mute:i,self_deaf:a,suppress:s},user:(0,_.Z)(l)}}function U(e,t,n){var r=m.default.getUser(t);return{type:e,
user:null!=r?(0,_.Z)(r):null,presence:{status:y.Z.getStatus(t),activity:null!=n?y.Z.getApplicationActivity(t,n):y.Z.getPrimaryActivity(t)}}}function k(e){if(null==e)return!1;var t,n=window.location.origin;if(e===n)return!0;try{t=r.parse(e).hostname}catch(e){return!1}return window.location.hostname===t&&"localhost"===t||null==e.match("staging")&&!(!j.test(e)||!j.test(n))}function G(e,t,n){var r=p.Z.getGuild(e.getGuildId());return(null!=r?r.getApplicationId():e.getApplicationId())===t||n.indexOf(I.xVR.MESSAGES_READ)>-1}function B(e){switch(e){case I.hes.RTC_CONNECTED:case I.hes.RTC_CONNECTING:case I.hes.RTC_DISCONNECTED:return e.replace(/^RTC_/,"VOICE_");default:return e}}function H(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.instance,r=e.secrets,o=e.party,i=0;n&&(i|=I.xjy.INSTANCE);null!=(null==r?void 0:r.join)&&(i|=I.xjy.JOIN);if(t){i|=I.xjy.EMBEDDED;return i|=I.xjy.PARTY_PRIVACY_VOICE_CHANNEL}
if((null==o?void 0:o.privacy)===I.RYY.PUBLIC||a.Z.get("ACTIVITIES_FORCE_PUBLIC")){f.cP.getSetting()&&(i|=I.xjy.PARTY_PRIVACY_FRIENDS);f.Ou.getSetting()&&(i|=I.xjy.PARTY_PRIVACY_VOICE_CHANNEL)}return i}function V(e,t,n){return e===I.mFx.JOIN&&(null!=t&&null!=t.id&&null!=n.join)}function F(e,t,n){return o.Z.get({url:I.ANM.APPLICATION_RPC(t),oldFormErrors:!0,retries:3}).then((function(r){var o=r.body,i=o.rpc_origins,a=o.id,s=o.name,l=o.icon,u=o.cover_image,f=o.flags;if("string"==typeof n)if(e.transport===I.Hej.POST_MESSAGE){var d=(0,c.Z)(t);if(null==d||!w(n,[d]))throw new v.Z(I.$VG.INVALID_ORIGIN,"Invalid Origin")}else if(!w(n,i))throw new v.Z(I.$VG.INVALID_ORIGIN,"Invalid Origin");e.application={id:a,name:s,icon:l,coverImage:u,flags:f}}),(function(){throw new v.Z(I.$VG.INVALID_CLIENTID,"Invalid Client ID")}))}function Y(e,t){return z.apply(this,arguments)}function z(){return(z=N((function(e,t){var n,r;return C(this,(function(o){switch(o.label){case 0:if(null==(n=R[e])){r=t?2:60
;n=new i.Z(r,6e4);R[e]=n}return[4,n.process()];case 1:o.sent();return[2]}}))}))).apply(this,arguments)}function W(e,t){null==t&&(e.authorization.scopes=[I.lHf])}function K(e){var t=h.Z.getSettings(),n=function(e){return Object.values(e).sort((function(e,t){return e.index-t.index})).map((function(e){return{id:e.id,name:e.name}}))},r=e(t);return{input:{available_devices:n(h.Z.getInputDevices()),device_id:t.inputDeviceId,volume:t.inputVolume},output:{available_devices:n(h.Z.getOutputDevices()),device_id:t.outputDeviceId,volume:t.outputVolume},mode:{type:t.mode,auto_threshold:t.modeOptions.autoThreshold,threshold:t.modeOptions.threshold,shortcut:r,delay:t.modeOptions.delay},automatic_gain_control:t.automaticGainControl,echo_cancellation:t.echoCancellation,noise_suppression:t.noiseSuppression,qos:t.qos,silence_warning:t.silenceWarning,deaf:t.deaf,mute:t.mute}}function q(e,t){var n=h.Z.getSettings(e),r=t(n);return{input_mode:{type:n.mode,shortcut:r},local_mutes:Object.keys(n.localMutes),
local_volumes:n.localVolumes,self_mute:n.mute,self_deaf:n.deaf}}function X(e){if(e!==I.Hej.POST_MESSAGE)throw new v.Z(I.lTL.INVALID_COMMAND,'command not available from "'.concat(e," transport"))}function Q(e){if(null==e.id)throw new v.Z(I.lTL.INVALID_COMMAND,"Invalid application")}},196389:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(2590);function o(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){o(e,t,n[t])}))}return e}function a(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){
var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var s="<removed>";function c(e){var t=i({},e);(function(e){var t=e;return"object"==typeof t.args&&"string"==typeof t.cmd})(t)&&(t=function(e){return e.cmd===r.Etm.AUTHENTICATE?a(i({},e),{args:a(i({},e.args),{access_token:s})}):i({},e)}(t));(function(e){var t=e;return"object"==typeof t.data&&"string"==typeof t.cmd})(t)&&(t=function(e){return e.cmd===r.Etm.AUTHENTICATE?a(i({},e),{data:a(i({},e.data),{access_token:s})}):i({},e)}(t));return t}},731458:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(496486),o=n.n(r),i=n(860872),a=n(2590);var s=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);this.transport=t;this.version=n;this.encoding=r;this.id=o().uniqueId()
;this.authorization={authing:!1,scopes:[],accessToken:null,expires:new Date(0)};this.application={id:null,name:null,icon:null};if(null==n||n>a.X6Q||n<1)throw new i.Z(a.$VG.INVALID_VERSION,"Invalid Version: ".concat(n))}},232949:(e,t,n)=>{"use strict";n.d(t,{s0:()=>p,em:()=>y,_X:()=>m,GC:()=>b});var r=n(993754),o=n(304275),i=n(310126),a=n(79251),s=n(860872),c=n(282196),l=n(2590);function u(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}var f=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value])
;switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},d=["207646673902501888"];function p(e){if(o.Z.isReady(e)){r.Z.setLocked(!1,e);return{lock:function(){r.Z.setLocked(!0,e)},context:l.IlC.OVERLAY}}i.default.focus(null,!0);return{lock:function(){i.default.setForegroundProcess(e)},context:l.IlC.APP}}var h,E,y=(E=(h=function(e,t,n){var r;return f(this,(function(o){switch(o.label){case 0:(0,c.YK)(e,t);if((null==n||""===n)&&(0,c.s9)(t)){e.authorization.scopes=[l.cEn,l.CND]
;return[2,Promise.resolve()]}if(null==n||""===n)return[2,Promise.reject(new s.Z(l.$VG.INVALID_CLIENTID,"No Client ID Specified"))];r=i.default.releaseChannel!==l.R5N.CANARY&&!d.includes(n)&&e.transport!==l.Hej.POST_MESSAGE;return[4,(0,c.vv)(n,r)];case 1:o.sent();return[2,(0,c.fy)(e,n,t)]}}))},function(){var e=this,t=arguments;return new Promise((function(n,r){var o=h.apply(e,t);function i(e){u(o,n,r,i,a,"next",e)}function a(e){u(o,n,r,i,a,"throw",e)}i(void 0)}))}),function(e,t,n){return E.apply(this,arguments)});var m=function(){return(0,c.tr)((function(e){var t=[];null!=e.modeOptions.shortcut&&Array.isArray(e.modeOptions.shortcut)&&(t=function(e){return e.map((function(e){var t;return{type:e[0],code:e[1],name:null!==(t=(0,a.H9)(e))&&void 0!==t?t:"unknown"}}))}(e.modeOptions.shortcut));return t}))},b=function(e){return(0,c.FJ)(e,(function(e){var t="";null!=e.modeOptions.shortcut&&Array.isArray(e.modeOptions.shortcut)&&(t=(0,a.BB)(e.modeOptions.shortcut));return t}))}},199830:(e,t,n)=>{
"use strict";n.d(t,{Z:()=>R});var r=n(348764),o=n(717187),i=n.n(o),a=n(496486),s=n.n(a),c=n(296602),l=n(310126),u=n(196389),f=n(731458),d=n(232949),p=n(2590);function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(e){E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return E(e)}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&b(e,t)}function m(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function b(e,t){b=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return b(e,t)}var g=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}
;function O(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=E(e);if(t){var o=E(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return m(this,n)}}var v,_=l.default.requireModule("discord_rpc").RPCIPC,I=new c.Z("RPCServer:IPC"),S={HANDSHAKE:0,FRAME:1,CLOSE:2,PING:3,PONG:4};function T(e,t){null!=e.setHandshakeComplete?e.setHandshakeComplete(t):e._didHandshake=t}function N(e){return null!=e.getHandshakeComplete?e.getHandshakeComplete():e._didHandshake}function A(e){return new Promise((function(t,n){"string"==typeof e&&(e=_.net.createConnection(e));e.pause();e.on("readable",(function(){try{P(e)}catch(t){e.end(C(S.CLOSE,{code:1003,message:t.message}));e.destroy()}}));var r=function(){try{e.end();e.destroy()}catch(e){}
},o=Promise.race([new Promise((function(t){return e.on("error",(function(){return t()}))})),new Promise((function(t,n){e.on("pong",(function(){return n(new Error("socket responded with pong"))}))})),new Promise((function(e,t){setTimeout((function(){return t(new Error("socket alive timeout"))}),1e3)}))]).then((function(){r()}),(function(e){r();throw e}));e.write(C(S.PING,s().uniqueId()));return o.then(t,n)}))}function C(e,t){t=JSON.stringify(t);var n=r.Buffer.byteLength(t),o=r.Buffer.alloc(8+n);o.writeInt32LE(e,0);o.writeInt32LE(n,4);o.write(t,8,n);return function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}(o)}function P(e){var t=e.read(8);if(t){var n=(t=r.Buffer.from(t)).readInt32LE(0),o=t.readInt32LE(4);if(!Object.values(S).includes(n)||o<0)throw new Error("protocol error");if(!(t=e.read(o)))throw new Error("data size does not match what was received");t=r.Buffer.from(t);var i=JSON.parse(t.toString());switch(n){case S.PING:e.emit("ping",i);e.write(C(S.PONG,i))
;break;case S.PONG:e.emit("pong",i);break;case S.HANDSHAKE:if(N(e))throw new Error("already did handshake");T(e,!0);e.emit("handshake",i);break;case S.FRAME:if(!N(e))throw new Error("did not handshake");e.emit("request",i);break;case S.CLOSE:e.end();e.destroy()}P(e)}}var j=function(e){y(n,e);var t=O(n);function n(e,r,o){h(this,n);var i;(i=t.call(this,"ipc",r,o))._socket=e;return i}var r=n.prototype;r.send=function(e){I.info("Socket Emit: ".concat(this.id),(0,u.Z)(e));this._socket.write(C(S.FRAME,e))};r.close=function(e,t){this._socket.end(C(S.CLOSE,{code:e,message:t}));this._socket.destroy()};return n}(f.Z);const R=new(function(e){y(n,e);var t=O(n);function n(){h(this,n);var e;e=t.call(this);(v=_.net.createServer((function(t){return e.handleConnection(t)}))).on("error",(function(e){return I.error("Error: ".concat(e.message))}));_.getAvailableSocket(A).then((function(e){v.listen(e,(function(){
("function"==typeof v.listening?v.listening():v.listening)&&I.info("Starting on ".concat(v.address()))}))}));return e}n.prototype.handleConnection=function(e){var t=this;T(e,!1);e.pause();e.on("readable",(function(){try{P(e)}catch(t){e.end(C(S.CLOSE,{code:p.$VG.CLOSE_UNSUPPORTED,message:t.message}));e.destroy()}}));e.once("handshake",(function(n){var r,o=n.client_id,i=+n.v;try{r=new j(e,i,"json")}catch(t){e.end(C(S.CLOSE,{code:t.code,message:t.message}));e.destroy();return}I.info("Socket Opened: ".concat(r.id));e.on("error",(function(e){return I.error("Socket Error: ".concat(e.message))}));e.on("close",(function(){I.info("Socket Close: ".concat(r.id));t.emit("disconnect",r)}));(0,d.em)(r,null,o).then((function(){e.on("request",(function(e){I.info("Socket Message: ".concat(r.id),(0,u.Z)(e));t.emit("request",r,e)}));t.emit("connect",r)})).catch((function(e){var t=e.code,n=e.message;return r.close(t,n)}))}))};return n}(i()))},907709:(e,t,n)=>{"use strict";n.d(t,{Z:()=>V})
;var r=n(717187),o=n.n(r),i=n(496486),a=n.n(i),s=n(817673),c=n(608575),l=n(744564),u=n(296602),f=n(118044),d=n(310126),p=n(860872),h=n(196389),E=n(731458),y=n(232949),m=n(2590),b=n(348764).Buffer;function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function I(e){I=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return I(e)}function S(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&A(e,t)}
function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){_(e,t,n[t])}))}return e}function N(e,t){return!t||"object"!==j(t)&&"function"!=typeof t?O(e):t}function A(e,t){A=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return A(e,t)}function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1)
;"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var P,j=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function R(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=I(e);if(t){var o=I(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return N(this,n)}}try{P=d.default.requireModule("discord_erlpack")}catch(e){try{P=d.default.requireModule("erlpack")}catch(e){}}
var x,M=d.default.requireModule("discord_rpc").RPCWebSocket,w=window.GLOBAL_ENV.MARKETING_ENDPOINT,D=new u.Z("RPCServer:WSS"),Z=[];function L(e){return"function"==typeof e?e():e}function U(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=e>0?void 0:function(){if(L(x.listening)){var e=x.address().port;D.info("Starting on ".concat(e));l.Z.dispatch({type:"RPC_SERVER_READY",port:e})}};x.listen(m.V6Z+e%m.frH,"127.0.0.1",t)}function k(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:200,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=L(e.headers).origin?{"Access-Control-Allow-Origin":L(e.headers).origin,"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Methods":"POST, GET, PUT, PATCH, DELETE","Access-Control-Allow-Headers":["Content-Type","Authorization"].join(", ")}:{};n=n?JSON.stringify(n):"";r=200!==r||n.length?r:204;t.setHeader("Content-Length",b.byteLength(n));t.setHeader("Content-Type","application/json")
;t.writeHead(r,T({},o,i));t.end(n)}function G(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;k(e,t,{code:o,message:r},n)}var B=function(e){S(n,e);var t=R(n);function n(e,r,o){v(this,n);var i;i=t.call(this,"ws",r,o);if(-1===["etf","json"].indexOf(o))throw new p.Z(m.$VG.INVALID_ENCODING,"Invalid Encoding: ".concat(o));if("etf"===o&&null==P)throw new p.Z(m.$VG.INVALID_ENCODING,"Erlpack cannot be used on this client");i._socket=e;return i}var r=n.prototype;r.send=function(e){(f.default.isLoggingOverlayEvents||e.cmd!==m.Etm.OVERLAY&&e.evt!==m.zMe.OVERLAY)&&D.info("Socket Emit: ".concat(this.id),(0,h.Z)(e));null!=P&&"etf"===this.encoding?this._socket.send(P.pack(e),{binary:!0}):this._socket.send(JSON.stringify(e))};r.close=function(e,t){this._socket.close(e,t)};return n}(E.Z),H=function(e){S(n,e);var t=R(n);function n(e,r,o,i){v(this,n);var a;a=t.call(this,"http",o,i);if("json"!==i)throw new p.Z(m.$VG.INVALID_ENCODING,"Invalid Encoding: ".concat(i));a._sendCallback=e
;a._closeCallback=r;return a}var r=n.prototype;r.send=function(e){(f.default.isLoggingOverlayEvents||e.cmd!==m.Etm.OVERLAY)&&D.info("Socket Emit: ".concat(this.id),e);this._sendCallback(e)};r.close=function(e,t){this._closeCallback(t,e)};return n}(E.Z);const V=new(function(e){S(n,e);var t=R(n);function n(){v(this,n);var e;e=t.call(this);var r=0;(x=M.http.createServer()).on("error",(function(e){D.error("Error: ".concat(e.message));("EADDRINUSE"===e.code||e.message.includes("EADDRINUSE"))&&setTimeout((function(){return U(++r)}),1e3)}));x.on("request",e.handleRequest.bind(O(e)));U(r);var o={instanceId:x.instanceId||0,server:x};new M.ws.Server(o).on("connection",(function(t){return e.handleConnection(t)}));return e}var r=n.prototype;r.handleRequest=function(e,t){var n=this,r=C(L(e.url).split("?"),2),o=r[0],i=r[1],a=L(e.method);if("/rpc"!==o||"OPTIONS"!==a){var l="POST"===a;if("/rpc"!==o||"GET"!==a&&!l)G(e,t,404,"Not Found");else{
var u=s.parse(i),f=l?L(e.headers)["content-type"].split("/")[1]:"json",d=function(){var e=c.parse(u.callback),n=e.protocol,r=e.host;n===location.protocol&&r===location.host?t.setHeader("Location",u.callback):t.setHeader("Location",w);t.writeHead(301);t.end()},p=new H(l?k.bind(null,e,t):d,l?G.bind(null,e,t,400):d,+u.v,f);if(l)(0,y.em)(p,L(e.headers).origin,u.client_id).then((function(){var r="";e.on("data",(function(e){return r+=e}));e.on("error",(function(){return G(e,t,500,"Internal Server Error")}));e.on("end",(function(){return n.handleMessage(p,r)}))})).catch((function(e){var t=e.code,n=e.message;return p.close(t,n)}));else{p.authorization.scopes=[m.CND];this.handleMessage(p,decodeURIComponent(u.payload))}}}else k(e,t,{body:""})};r.handleConnection=function(e){var t,n=this,r=s.parse(L(e.upgradeReq).url.split("?")[1]),o=L(e.upgradeReq).headers.origin||"";try{t=new B(e,+r.v,r.encoding||"json")}catch(t){e.close(t.code,t.message);return}D.info("Socket Opened: ".concat(t.id))
;e.on("error",(function(e){return D.error("WS Error: ".concat(e.message))}));e.on("close",(function(e,r){D.info("Socket Closed: ".concat(t.id,", code ").concat(e,", message ").concat(r));a().remove(Z,(function(e){return e===t}));n.emit("disconnect",t)}));(0,y.em)(t,o,r.client_id).then((function(){Z.push(t);e.on("message",(function(e){return n.handleMessage(t,e)}));n.emit("connect",t)})).catch((function(e){var n=e.code,r=e.message;return t.close(n,r)}))};r.handleMessage=function(e,t){var n;try{if(null!=P&&"etf"===e.encoding)n=P.unpack(t);else{if("string"!=typeof t)throw new Error;n=JSON.parse(t)}}catch(t){e.close(m.$VG.CLOSE_UNSUPPORTED,"Payload not ".concat(e.encoding));return}(f.default.isLoggingOverlayEvents||n.cmd!==m.Etm.OVERLAY)&&D.info("Socket Message: ".concat(e.id),(0,h.Z)(n));this.emit("request",e,n)};return n}(o()))},938058:(e,t,n)=>{"use strict";n.d(t,{f:()=>r,q:()=>o})
;var r=200,o=[0,.25,.5,.75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3,3.25,3.5,3.75,4,4.25,4.5,4.75,5,5.25,5.5,5.75,6,6.25,6.5,6.75,7,7.25,7.5,7.75,8,8.25,8.5,8.75,9,9.25,9.5,9.75,10]},42261:(e,t,n)=>{"use strict";n.d(t,{vG:()=>i,M0:()=>a,Od:()=>s});var r,o=n(473708),i="emails";!function(e){e.COMMUNICATION="communication";e.SOCIAL="social";e.TIPS="tips";e.RECOMMENDATIONS_AND_EVENTS="recommendations_and_events";e.UPDATES_AND_ANNOUNCEMENTS="updates_and_announcements"}(r||(r={}));var a=[r.TIPS,r.RECOMMENDATIONS_AND_EVENTS,r.UPDATES_AND_ANNOUNCEMENTS],s=[{category:r.COMMUNICATION,label:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_COMMUNICATION},subLabel:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_COMMUNICATION_SUBLABEL}},{category:r.SOCIAL,label:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_SOCIAL},subLabel:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_SOCIAL_SUBLABEL}},{category:r.UPDATES_AND_ANNOUNCEMENTS,label:function(){
return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_UPDATES_AND_ANNOUNCEMENTS},subLabel:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_UPDATES_AND_ANNOUNCEMENTS_SUBLABEL}},{category:r.TIPS,label:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_TIPS},subLabel:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_TIPS_SUBLABEL}},{category:r.RECOMMENDATIONS_AND_EVENTS,label:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_RECOMMENDATIONS_AND_EVENTS},subLabel:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_RECOMMENDATIONS_AND_EVENTS_SUBLABEL}}]},96483:(e,t,n)=>{"use strict";n.d(t,{Z:()=>y});var r=n(202351),o=n(744564);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function s(e){s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){
return e.__proto__||Object.getPrototypeOf(e)};return s(e)}function c(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e,t){l=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return l(e,t)}var u=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function f(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var o=s(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}var d={},p=null;function h(){d={};p=null}var E=function(e){!function(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&l(e,t)}(n,e);var t=f(n);function n(){i(this,n);return t.apply(this,arguments)}var r=n.prototype;r.getEmailSettings=function(){return{categories:d,initialized:p}};r.__getLocalVars=function(){return{categories:d,initialized:p}};return n}(r.ZP.Store);E.displayName="EmailSettingsStore";const y=new E(o.Z,{CONNECTION_OPEN:h,LOGOUT:h,EMAIL_SETTINGS_FETCH_SUCCESS:function(e){var t=e.settings;d=t.categories;p=t.initialized},EMAIL_SETTINGS_UPDATE_SUCCESS:function(e){var t=e.settings;d=t.categories},EMAIL_SETTINGS_UPDATE:function(e){var t=e.updates;d=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){
return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){a(e,t,n[t])}))}return e}({},d,t)}})},489655:(e,t,n)=>{"use strict";n.d(t,{X:()=>l});var r=n(202351),o=n(53645),i=n(130962),a=n(473903),s=(0,n(260561).B)({kind:"user",id:"2022-10_crunchyroll_connection",label:"Crunchyroll connection",defaultConfig:{enabled:!1},treatments:[{id:1,label:"Enable Crunchyroll connection",config:{enabled:!0}}]}),c=n(2590),l=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=i.c.useExperiment({}).allowPlayStationStaging,n=s.useExperiment({}).enabled,l=(0,r.e7)([a.default],(function(){return a.default.getCurrentUser()}));return function(r){var i;return r.type===c.ABu.PLAYSTATION_STAGING?t:r.type===c.ABu.CRUNCHYROLL?n:!(void 0===l||!(null===(i=o.bO[r.type])||void 0===i?void 0:i.includes(l.id)))||(!!e||r.enabled)}}},517672:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(785893),o=(n(667294),n(294184)),i=n.n(o),a=n(707961),s=n(895724),c=n(404576),l=n.n(c)
;function u(e){var t=e.children,n=e.className;return(0,r.jsxs)("div",{className:i()(l().root,n),children:[(0,r.jsx)(s.Z,{className:l().info}),(0,r.jsx)(a.xvT,{className:l().text,variant:"text-sm/medium",color:"text-normal",children:t})]})}},265508:(e,t,n)=>{"use strict";n.d(t,{Z:()=>I});var r=n(785893),o=n(667294),i=n(441143),a=n.n(i),s=n(202351),c=n(707961),l=n(84441),u=n(895303),f=n(473903),d=n(473708);function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function E(e){E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return E(e)}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){
return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){h(e,t,n[t])}))}return e}function m(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function b(e,t){return!t||"object"!==O(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function g(e,t){g=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return g(e,t)}var O=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function v(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=E(e);if(t){var o=E(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return b(this,n)}}var _=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&g(e,t)}(n,e);var t=v(n);function n(){p(this,n);var e;(e=t.apply(this,arguments)).state={isSendingVerificationEmail:!1};e.handleResendVerification=function(){var t=e.props,n=t.currentUser,o=t.onClick;null==o||o();e.setState({isSendingVerificationEmail:!0},(function(){l.Z.verifyResend().then((function(){return(0,c.h7j)((function(e){return(0,r.jsx)(c.sm4,m(y({
header:d.Z.Messages.VERIFICATION_EMAIL_TITLE,confirmText:d.Z.Messages.OKAY,confirmButtonColor:c.zxk.Colors.BRAND},e),{children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:d.Z.Messages.VERIFICATION_EMAIL_BODY.format({email:n.email})})}))}))})).catch((function(e){var t=e.body,n=d.Z.Messages.VERIFICATION_EMAIL_ERROR_BODY;null!=t&&t.email&&(n=t.email);(0,c.h7j)((function(e){return(0,r.jsx)(u.default,y({title:d.Z.Messages.VERIFICATION_EMAIL_ERROR_TITLE,body:n},e))}))})).then((function(){return e.setState({isSendingVerificationEmail:!1})}))}))};return e}n.prototype.render=function(){var e=this.props,t=e.color,n=e.look,o=e.size;return(0,r.jsx)(c.zxk,{look:n,size:o,color:t,disabled:this.state.isSendingVerificationEmail,onClick:this.handleResendVerification,children:d.Z.Messages.RESEND_VERIFICATION_EMAIL})};return n}(o.Component);_.defaultProps={size:c.zxk.Sizes.MEDIUM,color:c.zxk.Colors.BRAND};const I=s.ZP.connectStores([f.default],(function(){var e=f.default.getCurrentUser()
;a()(null!=e,"ResendEmailVerificationButton: currentUser cannot be undefined");return{currentUser:e}}))(_)},751388:(e,t,n)=>{"use strict";n.d(t,{Z:()=>M});var r=n(785893),o=n(667294),i=n(165695),a=n(707961),s=n(130671),c=n(2590),l=n(473708);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function d(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){f(i,r,o,a,s,"next",e)}function s(e){f(i,r,o,a,s,"throw",e)}a(void 0)}))}}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],(function(){})));return!0}catch(e){return!1}}function h(e,t,n){h=p()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t)
;var o=new(Function.bind.apply(e,r));n&&v(o,n.prototype);return o};return h.apply(null,arguments)}function E(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function y(e){y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return y(e)}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){E(e,t,n[t])}))}return e}function b(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))
;n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function g(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function O(e,t){return!t||"object"!==I(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function v(e,t){v=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return v(e,t)}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1
;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var I=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function S(e){var t="function"==typeof Map?new Map:void 0;S=function(e){if(null===e||!(n=e,-1!==Function.toString.call(n).indexOf("[native code]")))return e;var n
;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return h(e,arguments,y(this).constructor)}r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}});return v(r,e)};return S(e)}function T(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return O(this,n)}}var N=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i
;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
;e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&v(e,t)}(n,e);var t=T(n);function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);return t.call(this,null!=e?e:"Canceled")}return n}(S(Error));function C(e){var t=e.onError,n=e.onSuccess,a=e.PasswordConfirm,u=g(e,["onError","onSuccess","PasswordConfirm"]),f=_(o.useState(""),2),d=f[0],p=f[1];return(0,r.jsx)(a,b(m({},u),{handleSubmit:function(e){return s.Z.enableMFAStart(e)},onError:function(e){if(function(e){return"object"==typeof e&&null!=e&&(0,i.nr)(e,"code")&&"number"==typeof e.code?e.code:0}(e)===c.evJ.MFA_INVALID_SECRET){n(d);u.onClose()}else t(e)},onPasswordChange:p,title:l.Z.Messages.TWO_FA_ENABLE,actionText:l.Z.Messages.CONTINUE}))}function P(){return new Promise((function(e,t){(0,a.ZDy)(d((function(){var o,i;return N(this,(function(a){switch(a.label){case 0:
return[4,Promise.all([n.e(40532),n.e(75651)]).then(n.bind(n,975651))];case 1:o=a.sent(),i=o.default;return[2,function(n){return(0,r.jsx)(C,b(m({},n),{onSuccess:e,onError:t,PasswordConfirm:i}))}]}}))})),{onCloseCallback:function(){t(new A)}})}))}function j(e){return new Promise((function(t,o){(0,a.ZDy)(d((function(){var o,i;return N(this,(function(a){switch(a.label){case 0:return[4,Promise.all([n.e(40532),n.e(1653),n.e(73356)]).then(n.bind(n,173356))];case 1:o=a.sent(),i=o.default;return[2,function(n){return(0,r.jsx)(i,b(m({},n),{password:e,handleEnableMFASuccess:t}))}]}}))})),{onCloseCallback:function(){o(new A)}})}))}function R(){return new Promise((function(e){(0,a.ZDy)(d((function(){var e,t;return N(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(11177),n.e(86651)]).then(n.bind(n,286651))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,m({},e))}]}}))})),{onCloseCallback:e,onCloseRequest:c.VqG})}))}function x(){
return(x=d((function(){return N(this,(function(e){switch(e.label){case 0:return[4,P()];case 1:return[4,j(e.sent())];case 2:e.sent();return[4,R()];case 3:e.sent();return[2]}}))}))).apply(this,arguments)}const M={enableMFA:function(){return x.apply(this,arguments)}}},528562:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>O});var r=n(785893),o=n(667294),i=n(202351),a=n(707961),s=n(579194),c=n(450383),l=n(98265),u=n(973646),f=n(2590),d=n(473708),p=n(550478),h=n.n(p);function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function m(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){y(i,r,o,a,s,"next",e)}function s(e){y(i,r,o,a,s,"throw",e)}a(void 0)}))}}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){
var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var g=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){
return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function O(e){
var t,n,p,E,y=e.transitionState,O=e.onSuccess,v=e.onClose,_=e.requirementsUpdated,I=e.noSkip,S=void 0!==I&&I,T=b(o.useState(""),2),N=T[0],A=T[1],C=b(o.useState(""),2),P=C[0],j=C[1],R=b(o.useState(""),2),x=R[0],M=R[1],w=b(o.useState(null),2),D=w[0],Z=w[1],L=b(o.useState(null),2),U=L[0],k=L[1],G=(0,i.e7)([c.Z],(function(){return c.Z.getErrors()})),B=(0,i.e7)([c.Z],(function(){return c.Z.getFormState()})),H=o.useRef(null);o.useEffect((function(){if(y===a.Dvm.ENTERED){var e;null===(e=H.current)||void 0===e||e.focus()}}),[y]);function V(){V=m((function(e){var t,n,r;return g(this,(function(o){switch(o.label){case 0:e.preventDefault();(0,s.b9)();t=!1;if(""===P){Z(d.Z.Messages.PASSWORD_REQUIREMENTS_EMPTY);t=!0}else Z(null);if(P!==x){k(d.Z.Messages.FORM_LABEL_NEW_PASSWORD_MISMATCH);t=!0}else k(null);return t?[2]:[4,(0,s.Mn)({password:N,newPassword:P})];case 1:(null==(n=o.sent())?void 0:n.ok)?O():null!=(null==n||null===(r=n.body)||void 0===r?void 0:r.username)&&(0,u.P)();return[2]}}))}))
;return V.apply(this,arguments)}return(0,r.jsxs)(a.Y0X,{transitionState:y,children:[(0,r.jsxs)(a.xBx,{separator:!1,className:h().header,children:[(0,r.jsx)(l.Z,{color:l.Z.Colors.HEADER_PRIMARY,size:l.Z.Sizes.SIZE_24,className:h().title,children:d.Z.Messages.UPDATE_PASSWORD}),(0,r.jsx)(a.xvT,{color:"header-secondary",variant:"text-md/normal",className:h().subtitle,children:_?d.Z.Messages.FORCE_PASSWORD_UPDATE_DESCRIPTION:d.Z.Messages.USER_SETTINGS_ACCOUNT_CHANGE_PASSWORD_PROMPT_DESKTOP}),!0!==S&&(0,r.jsx)(a.olH,{onClick:v,className:h().modalCloseButton})]}),(0,r.jsxs)("form",{onSubmit:function(e){return V.apply(this,arguments)},children:[(0,r.jsxs)(a.hzk,{className:h().content,children:[(0,r.jsx)(a.xJW,{title:d.Z.Messages.FORM_LABEL_CURRENT_PASSWORD,error:null==G||null===(t=G.password)||void 0===t?void 0:t[0],children:(0,r.jsx)(a.oil,{type:"password",value:N,onChange:A,inputRef:H})}),(0,r.jsx)(a.xJW,{className:h().newPassword,title:d.Z.Messages.FORM_LABEL_NEW_PASSWORD,
error:null!==(E=null!==(p=null==G||null===(n=G.new_password)||void 0===n?void 0:n[0])&&void 0!==p?p:D)&&void 0!==E?E:void 0,children:(0,r.jsx)(a.oil,{type:"password",value:P,onChange:j})}),(0,r.jsx)(a.xJW,{className:h().newPassword,title:d.Z.Messages.FORM_LABEL_CONFIRM_NEW_PASSWORD,error:null!=U?U:void 0,children:(0,r.jsx)(a.oil,{type:"password",value:x,onChange:M})})]}),(0,r.jsxs)(a.mzw,{children:[(0,r.jsx)(a.zxk,{type:"submit",color:a.zxk.Colors.BRAND,size:a.zxk.Sizes.MEDIUM,submitting:B===f.QZA.SUBMITTING,children:d.Z.Messages.DONE}),!0!==S&&(0,r.jsx)(a.zxk,{className:h().cancel,look:a.zxk.Looks.LINK,color:a.zxk.Colors.PRIMARY,onClick:v,children:d.Z.Messages.CANCEL})]})]})]})}},721110:(e,t,n)=>{"use strict";n.d(t,{Z:()=>mC});var r=n(785893),o=n(667294),i=n(999357),a=n(418705),s=n(336194),c=n(707961),l=n(744564),u=n(84441),f=n(579194),d=n(734691),p=n(888312),h=n(604375),E=n(19585),y=n(202351),m=n(384411),b=n(468235),g=n(335072),O=n(294184),v=n.n(O),_=n(476893),I=n.n(_)
;function S(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){S(e,t,n[t])}))}return e}function N(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function A(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{}
;var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function C(e){var t=e.title,n=e.note,o=e.children,i=e.className;return(0,r.jsxs)("div",{className:v()(I().inputItem,i),children:[(0,r.jsxs)("div",{className:I().inputItemText,children:[(0,r.jsx)(c.xvT,{className:I().inputItemTitle,variant:"text-md/semibold",color:"interactive-active",children:t}),null!=n&&(0,r.jsx)(c.xvT,{className:I().note,variant:"text-sm/medium",color:"header-secondary",children:n})]}),o]})}function P(e){var t=e.options,n=e.value,o=e.select,i=e.selectClassName,a=A(e,["options","value","select","selectClassName"]);return(0,r.jsx)(C,N(T({},a),{children:(0,r.jsx)(c.PhF,{className:v()(I().selectControl,i),options:t,isSelected:function(e){return e===n},select:o,
serialize:function(e){return String(e)}})}))}function j(e){var t=e.value,n=e.onChange,o=e.editable,i=e.textInputClassName,a=e.onClick,s=A(e,["value","onChange","editable","textInputClassName","onClick"]);return(0,r.jsx)(C,N(T({},s),{children:(0,r.jsx)(c.oil,{onClick:a,editable:o,className:v()(I().selectControl,i),value:t,onChange:n})}))}var R=n(453790),x=n(473708),M=n(764147),w=n.n(M);function D(){var e=(0,y.e7)([g.Z],(function(){return g.Z.getSettings()})),t=e.viewerClipsEnabled,n=e.viewerConnectivity,i=(0,y.e7)([m.default],(function(){return m.default.locale})),a=o.useMemo((function(){return[{value:R.dJ.ALL,label:x.Z.Messages.CLIPS_CONNECTIVITY_ALL},{value:R.dJ.FRIENDS,label:x.Z.Messages.CLIPS_CONNECTIVITY_FRIENDS}]}),[i]);return(0,r.jsxs)(c.hjN,{children:[(0,r.jsx)(c.j7V,{className:w().formItem,hideBorder:!0,value:t,note:x.Z.Messages.CLIPS_SETTINGS_ALLOW_VIEWER_CLIPS_HELP,onChange:b.yl,children:x.Z.Messages.CLIPS_SETTINGS_ALLOW_VIEWER_CLIPS}),(0,r.jsx)(P,{className:w().formItem,
title:x.Z.Messages.CLIPS_SETTINGS_WHO_CAN_CAPTURE,note:x.Z.Messages.CLIPS_SETTINGS_WHO_CAN_CAPTURE_HELP,value:n,select:b.QM,options:a})]})}var Z=n(441143),L=n.n(Z),U=n(731503),k=n(164045),G=n(138049),B=n(2590),H=n(494628),V=n.n(H),F=n(102670),Y=n.n(F);function z(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function W(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function K(){var e=(0,y.cj)([g.Z],(function(){return g.Z.getSettings()})),t=e.clipsEnabled,n=e.clipsQuality,i=e.clipsLength,a=(0,y.e7)([G.Z],(function(){
return G.Z.getKeybindForAction(B.kg4.SAVE_CLIP,!0)}));L()(null!=a,"Save clip keybind unset");var s=(0,y.e7)([m.default],(function(){return m.default.locale})),l=o.useMemo((function(){return[{value:R.Rp.DEFAULT,label:x.Z.Messages.CLIPS_QUALITY_DEFAULT}]}),[s]),u=o.useMemo((function(){return[{value:R.OT.SECONDS_30,label:x.Z.Messages.CLIPS_LENGTH_SECONDS.format({count:30})},{value:R.OT.MINUTES_1,label:x.Z.Messages.CLIPS_LENGTH_MINUTES.format({count:1})},{value:R.OT.MINUTES_2,label:x.Z.Messages.CLIPS_LENGTH_MINUTES.format({count:2})}]}),[s]),f=o.useCallback((function(e){U.Z.setKeybind(W(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){z(e,t,n[t])}))}return e}({},a),{shortcut:e}))}),[a]);return(0,r.jsxs)(c.hjN,{children:[(0,r.jsx)(c.j7V,{
hideBorder:!0,className:Y().formItem,value:t,note:x.Z.Messages.CLIPS_SETTINGS_ENABLE_CLIPS_HELP,onChange:b.em,children:x.Z.Messages.CLIPS_SETTINGS_ENABLE_CLIPS}),(0,r.jsx)(C,{className:Y().formItem,title:x.Z.Messages.CLIPS_SETTINGS_KEYBIND,note:x.Z.Messages.CLIPS_SETTINGS_KEYBIND_HELP,children:(0,r.jsx)("div",{className:V().keyRecorder,children:(0,r.jsx)(k.Z,{defaultValue:a.shortcut,onChange:f})})}),(0,r.jsx)(P,{className:Y().formItem,select:b.yi,title:x.Z.Messages.CLIPS_SETTINGS_VIDEO_QUALITY,note:x.Z.Messages.CLIPS_SETTINGS_VIDEO_QUALITY_HELP,value:n,options:l}),(0,r.jsx)(P,{className:Y().formItem,select:b.eU,title:x.Z.Messages.CLIPS_SETTINGS_LENGTH,note:x.Z.Messages.CLIPS_SETTINGS_LENGTH_HELP,value:i,options:u})]})}var q=n(306472);function X(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Q(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){
X(i,r,o,a,s,"next",e)}function s(e){X(i,r,o,a,s,"throw",e)}a(void 0)}))}}var $=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop()
;a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function J(){var e=(0,y.e7)([g.Z],(function(){return g.Z.getSettings().storageLocation}));return(0,r.jsx)(c.hjN,{children:(0,r.jsx)(j,{className:Y().formItem,title:x.Z.Messages.CLIPS_SETTINGS_STORAGE_LOCATION,note:x.Z.Messages.CLIPS_SETTINGS_STORAGE_LOCATION_HELP,value:e,editable:!1,onClick:Q((function(){var e;return $(this,(function(t){switch(t.label){case 0:return[4,q.Z.fileManager.showOpenDialog({properties:["openDirectory"]})];case 1:(e=t.sent()).length>0&&b.T1(e[0]);return[2]}}))})),onChange:B.VqG})})}var ee=n(796631),te=n.n(ee);function ne(){var e=(0,E.Z)().AnalyticsLocationProvider;return(0,r.jsx)(e,{children:(0,r.jsxs)(c.y5t,{component:(0,r.jsx)(c.X6q,{variant:"heading-lg/extrabold",children:x.Z.Messages.CLIPS_CLIPPING}),children:[(0,r.jsx)(c.xvT,{className:te().subHeader,variant:"text-sm/medium",color:"header-secondary",
children:x.Z.Messages.CLIPS_SETTINGS_TOP_SUBHEADER}),(0,r.jsxs)("form",{className:te().form,onSubmit:function(e){return e.preventDefault()},children:[(0,r.jsx)(K,{}),(0,r.jsx)(c.$i$,{className:Y().formItem}),(0,r.jsx)(D,{}),(0,r.jsx)(c.$i$,{className:Y().formItem}),(0,r.jsx)(J,{})]})]})})}var re=n(630631),oe=n(917019),ie=n(473419),ae=n(107364),se=n(190186),ce=n(98265),le=n(256764),ue=n(518280),fe=n.n(ue);function de(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return de(e,t)
;var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return de(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function he(e){var t=e.contents,n=e.content,o=e.onChange,i=(0,le.jl)(t,a.z$[n]);return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(c.j7V,{value:i,onChange:function(){o(n);i?(0,oe.w9)(a.z$[n]):(0,oe.nm)(a.z$[n])},children:(0,r.jsx)(c.R94,{size:ce.Z.Sizes.SIZE_16,className:fe().marginTop4,children:"".concat(n.toLowerCase()," (").concat(a.z$[n],")")})})})}function Ee(e){var t=e.items,n=e.dismissedContents,o=e.handleChange;return(0,r.jsx)(r.Fragment,{children:t.filter((function(e){return isNaN(Number(e))})).map((function(e){return(0,r.jsx)(he,{contents:n,content:e,onChange:o},e)}))
})}function ye(){var e,t=pe(o.useState(""),2),n=t[0],i=t[1],s=null!==(e=(0,y.e7)([ie.Z],(function(){var e;return null===(e=ie.Z.settings.userContent)||void 0===e?void 0:e.dismissedContents})))&&void 0!==e?e:new Uint8Array,l=pe(function(e,t){var n=pe(o.useState((function(){var n=re.Z.get(e);return null!=n?n:t})),2),r=n[0],i=n[1];o.useEffect((function(){re.Z.set(e,r)}),[e,r]);return[r,i]}("RecentDismissibleOverrides",[]),2),u=l[0],f=l[1],d=function(e){f((function(t){var n=new Set(t);n.delete(e);var r=Array.from(n).slice(0,4);r.unshift(e);return r}))},p=u.filter((function(e){return e.toLowerCase().includes(n.toLowerCase())})),h=Object.keys(a.z$).filter((function(e){return!u.includes(e)})).filter((function(e){return e.toLowerCase().includes(n.toLowerCase())})).sort((function(e,t){return e.localeCompare(t)}));return(0,r.jsxs)(c.hjN,{title:"Dismissible Contents",tag:c.RB0.H1,children:[(0,r.jsx)(se.Z,{className:fe().marginBottom20,size:se.Z.Sizes.LARGE,query:n,onChange:i,onClear:function(){
return i("")}}),p.length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:fe().marginBottom20,children:(0,r.jsx)(c.vwX,{children:"Recent Overrides"})}),(0,r.jsx)(Ee,{items:p,dismissedContents:s,handleChange:d})]}):null,(0,r.jsx)(ae.Z,{className:v()(fe().marginBottom20,fe().marginTop20),children:(0,r.jsx)(c.vwX,{children:"Available Dismissible Contents"})}),(0,r.jsx)(Ee,{items:h,dismissedContents:s,handleChange:d}),(0,r.jsx)(c.zxk,{look:c.zxk.Looks.LINK,onClick:oe.sr,children:"Clear All Dismissed Contents"})]})}var me=n(270946),be=n(482139),ge=n(825781),Oe=n(785085),ve=n(496486),_e=n.n(ve),Ie=n(513328),Se=n(735885),Te=n(316878),Ne=n(776009),Ae=n(270307),Ce=n(136317),Pe=n(382518),je=n(930948),Re=n(716118),xe=n(998330),Me=n(494425),we=n(214142),De=n(533293),Ze=n(677483),Le=n(72580),Ue=n(896971),ke=n(730381),Ge=n.n(ke),Be=n(70145),He=n(17229),Ve=n(807891),Fe=n.n(Ve);function Ye(e){var t=e.achievementId,n=e.dateUnlocked,o=(0,Me.oX)(t);if(null==o)return null
;var i=null!=n,a=o.name,s=o.description,l=o.hideDescriptionUntilUnlock,u=o.onAction,f=l&&!i,d=i?"header-primary":"text-muted",p=i?"header-secondary":"text-muted",h=Ge()(n),E=null!=u&&i,y=E?c.P3F:"div";return(0,r.jsxs)(y,{className:v()(Fe().container,E&&Fe().actionable),onClick:function(){E&&u()},children:[(0,r.jsx)("div",{className:Fe().iconContainer,children:(0,r.jsx)(He.Z,{achievementId:t,size:He.Z.Sizes.SIZE_40,unlocked:i})}),(0,r.jsxs)("div",{className:Fe().nameContainer,children:[null!=n&&(0,r.jsx)(c.xvT,{variant:"text-xxs/semibold",color:"text-muted",className:Fe().unlocked,children:(0,Be.Y4)(h)}),(0,r.jsx)(c.xvT,{variant:"text-md/medium",color:d,children:a()}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:p,children:f?"?????":s()})]})]})}var ze=n(184671),We=n.n(ze);function Ke(e){var t=e.onBackClick,n=(0,y.e7)([Ue.Z],(function(){return Ue.Z.getAllUnlockedAchievements()})),i=o.useMemo((function(){return Object.values(n).sort((function(e,t){return t.dateUnlocked-e.dateUnlocked
}))}),[n]),a=o.useMemo((function(){return Object.values(Me.LG).filter(Le.lm).filter((function(e){return null==n[e.id]})).sort((function(e,t){return e.rarity-t.rarity}))}),[n]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.hjN,{children:(0,r.jsxs)(c.P3F,{onClick:t,className:We().backContainer,children:[(0,r.jsx)(Ze.Z,{direction:Ze.Z.Directions.LEFT,className:We().icon}),(0,r.jsx)(c.xvT,{variant:"text-lg/normal",color:"text-normal",children:x.Z.Messages.BACK})]})}),(0,r.jsxs)("div",{className:We().headerContainer,children:[(0,r.jsxs)("div",{className:We().headerTextContainer,children:[(0,r.jsx)(c.X6q,{variant:"heading-lg/extrabold",color:"header-primary",children:x.Z.Messages.POGGERMODE_ACHIEVEMENT_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"header-secondary",children:x.Z.Messages.POGGERMODE_ACHIEVEMENT_DESCRIPTION})]}),(0,r.jsx)("div",{className:We().headerIcon,children:(0,r.jsx)(Pe.Z,{color:s.Z.unsafe_rawColors.ORANGE_345.css,width:40,height:40})})]}),i.length>0&&(0,
r.jsx)(c.hjN,{className:We().divider,children:(0,r.jsx)("div",{className:We().achievementGrid,children:i.map((function(e){var t=e.achievementId,n=e.dateUnlocked;return(0,r.jsx)(Ye,{achievementId:t,dateUnlocked:n},t)}))})}),a.length>0&&(0,r.jsxs)(c.hjN,{className:We().divider,children:[(0,r.jsx)("div",{className:We().headerTextContainer,children:(0,r.jsx)(c.xvT,{variant:"text-md/bold",color:"header-secondary",children:x.Z.Messages.POGGERMODE_ACHIEVEMENT_LOCKED_TITLE})}),(0,r.jsx)("div",{className:We().achievementGrid,children:a.map((function(e){return(0,r.jsx)(Ye,{achievementId:e.id},e.id)}))})]}),(0,r.jsx)(c.hjN,{className:We().divider,children:(0,r.jsx)("div",{className:We().bottomPadding})})]})}var qe=n(991789),Xe=n(69540),Qe=n(631696),$e=n.n(Qe);function Je(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function et(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}
function tt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){et(e,t,n[t])}))}return e}function nt(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function rt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{
for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Je(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Je(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ot,it,at={enabled:!0,combosEnabled:!0,screenshakeEnabled:!1,confettiEnabled:!1},st=(0,ve.range)(0,11),ct=(0,ve.range)(0,2.25,.25),lt=(0,ve.range)(1,11),ut=(0,ve.range)(1,26);!function(e){e[e.CONFETTI=0]="CONFETTI";e[e.SHAKE=1]="SHAKE"}(ot||(ot={}));!function(e){e[e.USER_SETTINGS=0]="USER_SETTINGS"
;e[e.ACHIEVEMENT_LIST=1]="ACHIEVEMENT_LIST"}(it||(it={}));function ft(e){var t=e.disabled,n=e.locations,o=e.settingsLocations,i=e.onChange,a=n.map((function(e){return(0,r.jsx)(c.j7V,{disabled:t,value:o[e.location],note:e.description,onChange:function(t){return i(nt(tt({},o),et({},e.location,t)))},children:e.title},e.location)}));return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.vwX,{children:x.Z.Messages.POGGERMODE_LOCATIONS}),a]})}function dt(e){var t=e.children;return(0,r.jsx)(c.xvT,{className:$e().sliderDescription,variant:"text-sm/normal",color:"header-secondary",children:t})}function pt(e){var t=e.settings,n=t.enabled,o=t.warningSeen,i=e.updateSettings,a=(0,y.e7)([Te.Z],(function(){return Te.Z.useReducedMotion}));return(0,r.jsx)(c.j7V,{value:n,note:x.Z.Messages.POGGERMODE_ENABLE_DESCRIPTION,onChange:function(e){e||(0,xe.T)(Me.hn.DISABLE_POGGERMODE);!e||o&&!a?i({enabled:e}):(0,c.h7j)((function(e){return(0,r.jsx)(c.sm4,nt(tt({
header:a?x.Z.Messages.POGGERMODE_WARNING_TITLE_REDUCED_MOTION:x.Z.Messages.POGGERMODE_WARNING_TITLE,confirmText:x.Z.Messages.ENABLE,cancelText:x.Z.Messages.CANCEL,onConfirm:function(){return i(a?at:{enabled:!0,warningSeen:!0})}},e),{children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:a?x.Z.Messages.POGGERMODE_WARNING_BODY_REDUCED_MOTION:x.Z.Messages.POGGERMODE_WARNING_BODY})}))}))},children:x.Z.Messages.POGGERMODE_ENABLE})}function ht(e){var t=e.settings,n=t.enabled,o=t.confettiEnabled,i=t.confettiCount,a=t.confettiSize,s=t.confettiEnabledLocations,l=e.updateSettings,u=!n||!o;return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.POGGERMODE_CONFETTI_CUSTOMIZATION,children:[(0,r.jsx)(c.j7V,{disabled:!n,value:o,note:x.Z.Messages.POGGERMODE_CONFETTI_ENABLED_DESCRIPTION,onChange:function(e){return l({confettiEnabled:e},ot.CONFETTI)},children:x.Z.Messages.POGGERMODE_CONFETTI_ENABLED}),(0,r.jsxs)(c.xJW,{disabled:u,title:x.Z.Messages.POGGERMODE_CONFETTI_COUNT,className:$e().formItem,
children:[(0,r.jsx)(dt,{children:x.Z.Messages.POGGERMODE_CONFETTI_COUNT_DESCRIPTION}),(0,r.jsx)(c.iRW,{disabled:u,markers:lt,stickToMarkers:!0,minValue:lt[0],maxValue:lt[lt.length-1],initialValue:i,onValueChange:function(e){return l({confettiCount:e},ot.CONFETTI)},onValueRender:function(e){return"".concat(e)}})]}),(0,r.jsxs)(c.xJW,{disabled:u,title:x.Z.Messages.POGGERMODE_CONFETTI_SIZE,className:$e().formItem,children:[(0,r.jsx)(dt,{children:x.Z.Messages.POGGERMODE_CONFETTI_SIZE_DESCRIPTION}),(0,r.jsx)(c.iRW,{disabled:u,markers:ut,stickToMarkers:!0,minValue:ut[0],maxValue:ut[ut.length-1],initialValue:a,onValueChange:function(e){return l({confettiSize:e},ot.CONFETTI)},onValueRender:function(e){return"".concat(e)}})]}),(0,r.jsx)(ft,{disabled:u,locations:[{location:Xe.Hn.CHAT_INPUT,title:x.Z.Messages.POGGERMODE_CONFETTI_LOCATION_CHAT_INPUT_ENABLED,description:x.Z.Messages.POGGERMODE_CONFETTI_LOCATION_CHAT_INPUT_ENABLED_DESCRIPTION},{location:Xe.Hn.REACTION,
title:x.Z.Messages.POGGERMODE_CONFETTI_LOCATION_REACTION_ENABLED,description:x.Z.Messages.POGGERMODE_CONFETTI_LOCATION_REACTION_ENABLED_DESCRIPTION},{location:Xe.Hn.MEMBER_USER,title:x.Z.Messages.POGGERMODE_CONFETTI_LOCATION_MEMBER_USER_ENABLED,description:x.Z.Messages.POGGERMODE_CONFETTI_LOCATION_MEMBER_USER_ENABLED_DESCRIPTION},{location:Xe.Hn.CALL_TILE,title:x.Z.Messages.POGGERMODE_CONFETTI_LOCATION_CALL_TILE_ENABLED,description:x.Z.Messages.POGGERMODE_CONFETTI_LOCATION_CALL_TILE_ENABLED_DESCRIPTION}],settingsLocations:s,onChange:function(e){return l({confettiEnabledLocations:e},ot.CONFETTI)}})]})}function Et(e){var t=e.settings,n=t.enabled,o=t.combosEnabled,i=t.comboSoundsEnabled,a=t.combosRequiredCount,s=e.updateSettings,l=!n||!o;return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.POGGERMODE_COMBOS_CUSTOMIZATION,children:[(0,r.jsx)(c.j7V,{disabled:!n,value:o,note:x.Z.Messages.POGGERMODE_COMBOS_ENABLED_DESCRIPTION,onChange:function(e){return s({combosEnabled:e})},
children:x.Z.Messages.POGGERMODE_COMBOS_ENABLED}),(0,r.jsx)(c.j7V,{disabled:!n,value:i,note:x.Z.Messages.POGGERMODE_COMBO_SOUNDS_ENABLED_DESCRIPTION,onChange:function(e){return s({comboSoundsEnabled:e})},children:x.Z.Messages.POGGERMODE_COMBO_SOUNDS_ENABLED}),(0,r.jsxs)(c.xJW,{disabled:l,title:x.Z.Messages.POGGERMODE_COMBOS_REQUIRED,className:$e().formItem,children:[(0,r.jsx)(dt,{children:x.Z.Messages.POGGERMODE_COMBOS_REQUIRED_DESCRIPTION}),(0,r.jsx)(c.iRW,{disabled:l,markers:st,stickToMarkers:!0,minValue:st[0],maxValue:st[st.length-1],initialValue:a,onValueChange:function(e){return s({combosRequiredCount:e})},onValueRender:function(e){return"".concat(e)}})]}),(0,r.jsx)(c.$i$,{className:$e().divider})]})}function yt(e){var t=e.settings,n=t.enabled,o=t.screenshakeEnabled,i=t.shakeIntensity,a=t.screenshakeEnabledLocations,s=e.updateSettings,l=(0,y.e7)([Te.Z],(function(){return Te.Z.useReducedMotion})),u=!n||!o||l;return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,
title:x.Z.Messages.POGGERMODE_SCREENSHAKE_CUSTOMIZATION,children:[(0,r.jsx)(c.j7V,{disabled:!n||l,tooltipNote:l?x.Z.Messages.POGGERMODE_SCREENSHAKE_DISABLED_REDUCED_MOTION:null,value:o&&!l,note:x.Z.Messages.POGGERMODE_SCREENSHAKE_ENABLED_DESCRIPTION,onChange:function(e){return s({screenshakeEnabled:e},ot.SHAKE)},children:x.Z.Messages.POGGERMODE_SCREENSHAKE_ENABLED}),(0,r.jsxs)(c.xJW,{disabled:u,title:x.Z.Messages.POGGERMODE_SCREENSHAKE,className:$e().formItem,children:[(0,r.jsx)(dt,{children:x.Z.Messages.POGGERMODE_SCREENSHAKE_DESCRIPTION}),(0,r.jsx)(c.iRW,{disabled:u,markers:ct,equidistant:!0,stickToMarkers:!0,minValue:ct[0],maxValue:ct[ct.length-1],initialValue:i,onValueChange:function(e){return function(e,t){null!=e.shakeIntensity&&e.shakeIntensity>i&&(0,xe.T)(Me.hn.MORE);s(e,t)}({shakeIntensity:e},ot.SHAKE)},onMarkerRender:function(e){return e===ct[ct.length-1]?x.Z.Messages.POGGERMODE_SCREENSHAKE_MAX:"".concat(100*e,"%")}})]}),(0,r.jsx)(ft,{disabled:u,locations:[{
location:Xe.oZ.CHAT_INPUT,title:x.Z.Messages.POGGERMODE_SCREENSHAKE_LOCATION_CHAT_INPUT_ENABLED,description:x.Z.Messages.POGGERMODE_SCREENSHAKE_LOCATION_CHAT_INPUT_ENABLED_DESCRIPTION},{location:Xe.oZ.VOICE_USER,title:x.Z.Messages.POGGERMODE_SCREENSHAKE_LOCATION_VOICE_USER_ENABLED,description:x.Z.Messages.POGGERMODE_SCREENSHAKE_LOCATION_VOICE_USER_ENABLED_DESCRIPTION},{location:Xe.oZ.MENTION,title:x.Z.Messages.POGGERMODE_SCREENSHAKE_LOCATION_MENTION_ENABLED,description:x.Z.Messages.POGGERMODE_SCREENSHAKE_LOCATION_MENTION_ENABLED_DESCRIPTION}],settingsLocations:a,onChange:function(e){return s({screenshakeEnabledLocations:e},ot.SHAKE)}})]})}function mt(e){var t=e.updateSettings;return(0,r.jsx)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.POGGERMODE_SETTINGS_CUSTOMIZATION,children:(0,r.jsxs)(c.xJW,{className:$e().formItem,children:[(0,r.jsx)(c.R94,{className:$e().formItem,children:x.Z.Messages.POGGERMODE_HIDE_SETTINGS_DESCRIPTION}),(0,r.jsx)(c.zxk,{className:$e().hideButton,
size:c.zxk.Sizes.SMALL,onClick:function(){t({enabled:!1,settingsVisible:!1});(0,Se.xf)()},children:x.Z.Messages.POGGERMODE_HIDE_SETTINGS})]})})}function bt(e){var t=e.onChangePage;return(0,r.jsxs)(c.hjN,{children:[(0,r.jsxs)(c.P3F,{onClick:function(){return t(it.ACHIEVEMENT_LIST)},className:$e().achievementContainer,children:[(0,r.jsx)("div",{className:$e().achievementIconContainer,children:(0,r.jsx)(Pe.Z,{color:s.Z.unsafe_rawColors.ORANGE_345.css})}),(0,r.jsxs)("div",{className:$e().achievementTextContainer,children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",color:"header-primary",children:x.Z.Messages.POGGERMODE_ACHIEVEMENT_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"header-secondary",children:x.Z.Messages.POGGERMODE_ACHIEVEMENT_DESCRIPTION})]}),(0,r.jsx)(Ce.Z,{width:16,className:$e().rightCaretIcon})]}),(0,r.jsx)(c.$i$,{className:$e().divider})]})}var gt=function(){return n.e(37948).then(n.t.bind(n,394198,19)).then((function(e){return e.default}))};function Ot(e){
var t=e.onChangePage,n=e.setShowEnableAnimation,i=function(e,t,n,r){return(null!=t?t:e)&&(null!=r?r:n)},a=(0,y.cj)([Oe.Z],(function(){return Oe.Z.getState()})),s=o.useRef(new Ie.V7),l=rt(o.useState(!1),2),u=l[0],f=l[1],d=rt(o.useState({x:0,y:0}),2),p=d[0],h=d[1],E=function(e,t){!function(e){if(e.enabled&&!1===a.enabled){n(!0);(0,Re.GN)("poggermode_enabled");var t;je.S.dispatch(B.CkL.SHAKE_APP,{duration:2e3,intensity:null!==(t=e.shakeIntensity)&&void 0!==t?t:a.shakeIntensity})}}(e);(0,we.AI)(e);if(null!=t){var r=t===ot.CONFETTI,o=i(a.confettiEnabled,e.confettiEnabled,a.enabled,e.enabled);if(r&&o){f(!0);s.current.start(2*qe.z,(function(){f(!0);s.current.start(2*qe.z,(function(){return f(!1)}))}))}var c=t===ot.SHAKE,l=i(a.screenshakeEnabled,e.screenshakeEnabled,a.enabled,e.enabled);if(c&&l){var u;je.S.dispatch(B.CkL.SHAKE_APP,{duration:1e3,intensity:null!==(u=e.shakeIntensity)&&void 0!==u?u:a.shakeIntensity})}}},m=function(e){h({x:e.clientX,y:e.clientY})};o.useEffect((function(){
var e=s.current;window.addEventListener("mousemove",m);return function(){e.stop();window.removeEventListener("mousemove",m)}}),[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.X6q,{variant:"heading-lg/semibold",className:$e().title,children:x.Z.Messages.POGGERMODE}),(0,r.jsx)(pt,{settings:a,updateSettings:E}),(0,r.jsx)(bt,{onChangePage:t}),(0,r.jsx)(Et,{settings:a,updateSettings:E}),(0,r.jsx)(yt,{settings:a,updateSettings:E}),(0,r.jsx)(ht,{settings:a,updateSettings:E}),(0,r.jsx)(mt,{updateSettings:E}),(0,r.jsx)(De.Z,{firing:u,position:p})]})}var vt=function(e,t,n){var o=function(e){return function(){t(e)}};switch(e){case it.USER_SETTINGS:return(0,r.jsx)(Ot,{onChangePage:o(it.ACHIEVEMENT_LIST),setShowEnableAnimation:n});case it.ACHIEVEMENT_LIST:return(0,r.jsx)(Ke,{onBackClick:o(it.USER_SETTINGS)});default:return null}},_t=function(e){return e===it.USER_SETTINGS?Ae.n.LEFT:Ae.n.RIGHT};function It(){
var e=rt(o.useState(it.USER_SETTINGS),2),t=e[0],n=e[1],i=rt(o.useState(_t(t)),2),a=i[0],s=i[1],c=rt(o.useState(!1),2),l=c[0],u=c[1],f=(0,y.e7)([Te.Z],(function(){return Te.Z.useReducedMotion})),d=l&&!f;o.useEffect((function(){var e=setTimeout((function(){s(_t(t))}),500);return function(){return clearTimeout(e)}}),[t]);o.useEffect((function(){Math.random()>.99&&(0,xe.T)(Me.hn.VISITOR_100)}),[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ae.Z,{className:$e().slideAnimator,step:t,direction:a,children:vt(t,n,u)}),(0,r.jsx)("div",{className:d?$e().enableAnimationOverlayVisible:$e().enableAnimationOverlayHidden,children:(0,r.jsx)(Ne.Z,{className:$e().enableAnimation,importData:gt,shouldAnimate:d,autoplay:!1,resetOnPlay:!0,loop:!1,onComplete:function(){return u(!1)}})})]})}var St=n(874259),Tt=n(673679),Nt=n(653224),At=n(595138),Ct=n(810978),Pt=n(256204),jt=n(392649),Rt=n(536392),xt=n(223430),Mt=n(655674),wt=n.n(Mt),Dt=n(349263),Zt=n.n(Dt),Lt=n(50682),Ut=n.n(Lt);function kt(e){
var t=e.onClickManageSubscription,n=(0,y.e7)([Rt.Z],(function(){return Rt.Z.getSubscriptions()})),i=o.useMemo((function(){return Object.values(null!=n?n:{}).filter((function(e){return e.type===B.NYc.APPLICATION&&e.status!==B.O0b.ENDED}))}),[n]);return 0===i.length?null:(0,r.jsxs)("div",{className:wt().container,children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",className:wt().sectionTitle,children:x.Z.Messages.APPLICATION_USER_SUBSCRIPTIONS_TITLE}),(0,r.jsx)(xt.Z,{size:4}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:wt().sectionDescription,children:x.Z.Messages.APPLICATION_USER_SUBSCRIPTIONS_DESCRIPTION}),(0,r.jsx)(xt.Z,{size:24}),(0,r.jsxs)("div",{className:v()(Zt().guildBoostingSubscriptionRow,wt().card),children:[(0,r.jsx)("img",{src:Ut(),alt:"",className:wt().bannerImage}),(0,r.jsxs)("div",{className:wt().textContainer,children:[(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:wt().header,children:x.Z.Messages.APPLICATION_USER_SUBSCRIPTIONS_TITLE}),(0,
r.jsx)(c.xvT,{variant:"text-md/normal",className:wt().description,children:x.Z.Messages.APPLICATION_ACTIVE_USER_SUBSCRIPTIONS_DESCRIPTION.format({numSubscriptions:i.length})})]}),(0,r.jsx)(jt.Z,{color:c.zxk.Colors.BRAND,onClick:t,children:x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTIONS_BUTTON})]})]})}var Gt=n(177001),Bt=n(301443),Ht=n(311846),Vt=n(407817),Ft=n(196142),Yt=n(100749),zt=n(666800),Wt=n(711531),Kt=n(124251),qt=n(377463),Xt=n(755556),Qt=n.n(Xt);const $t=function(e){var t=e.label,n=e.onClick,o=e.submitting;return(0,r.jsx)(c.P3F,{onClick:o?void 0:n,className:Qt().button,children:(0,r.jsxs)("div",{className:Qt().contentContainer,children:[o?(0,r.jsx)(c.$jN,{type:c.$jN.Type.PULSING_ELLIPSIS,className:Qt().spinner}):(0,r.jsx)(c.xvT,{variant:"text-md/medium",className:Qt().label,children:t}),(0,r.jsx)(qt.Z,{className:Qt().arrow})]})})};var Jt=n(443812),en=n(386991),tn=n(531441),nn=n(243763),rn=n(199722),on=n(333398),an=n(567403),sn=n(151367),cn=n(249052),ln=n(266909)
;function un(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return un(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return un(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dn(e){
var t=(0,nn.bZ)(e),n=(0,y.e7)([ln.Z],(function(){return ln.Z.getSubscriptionListingForPlan(t)}),[t]),r=(0,y.e7)([ln.Z],(function(){return null!=n?ln.Z.getSubscriptionGroupListingForSubscriptionListing(n.id):null}),[n]),i=(0,y.e7)([sn.Z],(function(){var t=sn.Z.getForSubscription(e.id);if(null!=t){return fn(Array.from(t),1)[0]}return null}),[e]),a=(0,y.e7)([on.Z],(function(){if(null!=i){var e=on.Z.getApplication(i.applicationId);if(null!=e)return e}}),[i]),s=(0,y.e7)([an.Z],(function(){if(null!=i)return an.Z.getGuild(i.guildId)}),[i]),c=fn(o.useState(!1),2),l=c[0],u=c[1],f=null==n?void 0:function(e){var t=e.listing,n=e.subscription,r=n.currentPeriodEnd,o=t.subscription_plans[0],i=(0,cn.T4)(o.price,o.currency),a=n.createdAt,s=n.status===B.O0b.CANCELED,c=n.status===B.O0b.PAST_DUE;return{subscribedSinceDate:a,currentPeriodEndDate:r,
currentPeriodEndLabel:Ge()().isAfter(n.currentPeriodEnd)?x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_INFO_SUBSCRIPTION_ENDED:x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_INFO_SUBSCRIPTION_ENDS,subscriptionPlanPrice:i,isCancelled:s,isPastDue:c}}({listing:n,subscription:e});return{application:a,guild:s,expanded:l,handleToggleExpanded:function(){return u((function(e){return!e}))},listing:n,groupListing:r,subscriptionInfo:f}}var pn=n(395283),hn=n.n(pn);function En(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yn(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function mn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){yn(i,r,o,a,s,"next",e)}function s(e){yn(i,r,o,a,s,"throw",e)}a(void 0)}))}}function bn(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}
function gn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){bn(e,t,n[t])}))}return e}function On(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function vn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{
for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return En(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return En(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var _n=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){
if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},In=function(e){var t=e.label,n=e.value,o=e.showInfoIcon,i=e.infoIconTooltipText;return(0,r.jsxs)("div",{className:hn().infoCard,children:[(0,r.jsxs)("div",{className:hn().infoCardLabelContainer,children:[(0,
r.jsx)(c.X6q,{variant:"heading-deprecated-12/semibold",className:hn().infoCardLabel,children:t}),o&&(0,r.jsx)(c.ua7,{text:i,children:function(e){return(0,r.jsx)(en.Z,On(gn({},e),{className:hn().infoCardIcon}))}})]}),(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:hn().infoCardValue,children:n})]})},Sn=function(e){var t=e.subscription,n=vn((0,Yt.ED)({subscriptionId:t.id,renewal:!0}),1)[0],o=(0,y.e7)([Wt.Z],(function(){return Wt.Z.hasFetchedPaymentSources}));return null!=n&&o?(0,r.jsx)(zt.Z,{subscription:t,currentInvoicePreview:n,dropdownClassName:hn().paymentSourceDropdown}):(0,r.jsx)(c.$jN,{})},Tn=function(e){var t=e.isCancelled,n=e.onCancelSubscriptionClick;return t?null:(0,r.jsxs)("div",{children:[(0,r.jsx)(c.vwX,{children:x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_MANAGE_OPTIONS_LABEL}),(0,r.jsx)("div",{className:hn().rowButtons,children:(0,r.jsx)($t,{label:x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_MANAGE_OPTIONS_CANCEL,onClick:n})})]})};const Nn=function(e){
var t=e.subscription,o=dn(t),i=o.listing,a=o.groupListing,s=o.guild,l=o.expanded,u=o.handleToggleExpanded,f=o.subscriptionInfo,d=o.application,p=(0,Jt.Dt)();if(null==a||null==i||null==f)return null;var h=function(){null!=d&&(0,c.ZDy)(mn((function(){var e,o;return _n(this,(function(a){switch(a.label){case 0:return[4,Promise.all([n.e(40532),n.e(9582)]).then(n.bind(n,509582))];case 1:e=a.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,gn({application:d,listing:i,subscription:t,guild:s},e))}]}}))})))},E=f.isCancelled,y=f.isPastDue,m=f.subscriptionPlanPrice,b=f.subscribedSinceDate,g=f.currentPeriodEndDate,O=f.currentPeriodEndLabel,_=(0,nn.KW)(i.sku_flags),I=(0,nn.KK)(i.sku_flags),S=i.soft_deleted||null==d||(!I||null==s)&&!_,T=null;if(I){var N;T=(0,r.jsxs)(c.xvT,{variant:"text-sm/normal",className:hn().tierName,children:[x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_CARD_IN_GUILD.format({
guildName:null!==(N=null==s?void 0:s.name)&&void 0!==N?N:x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_CARD_GUILD_NAME_UNAVAILABLE}),null!=s&&(0,r.jsx)(Kt.Z,{guild:s,size:Kt.Z.Sizes.MINI,className:hn().guildIcon})]})}else _&&(T=(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:hn().tierName,children:x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_CARD_PERSONAL_SUBSCRIPTION}));return(0,r.jsxs)("div",{className:hn().container,children:[(0,r.jsx)(Vt.Z,{onClick:u,className:hn().headerContainer,children:function(e){var t=e.areaRef,n=e.handleStopPropagation;return(0,r.jsxs)(r.Fragment,{children:[null!=d&&(0,r.jsx)(rn.Z,{size:rn.H.SMALL,className:hn().applicationIcon,application:d}),(0,r.jsxs)("div",{className:hn().headerTextContainer,children:[(0,r.jsx)(c.xvT,{variant:"text-md/medium",className:hn().applicationName,children:null!=d?d.name:x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_CARD_APPLICATION_NAME_UNAVAILABLE}),(0,r.jsxs)("div",{className:hn().headerSubtitleContainer,children:[T,E?(0,
r.jsx)(tn.IG,{text:x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_CANCELED}):y?(0,r.jsx)(c.ua7,{text:x.Z.Messages.APPLICATION_SUBSCRIPTION_USER_SUBSCRIPTION_PAST_DUE_WARNING,children:function(e){return(0,r.jsx)("div",On(gn({},e),{children:(0,r.jsx)(tn.IG,{className:hn().paymentDueBadge,text:x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_PAST_DUE,color:Ht.Z.YELLOW_300})}))}}):null]})]}),(0,r.jsx)(c.P3F,{onClick:n(u),"aria-label":x.Z.Messages.APPLICATION_SUBSCRIPTION_TOGGLE_SECTION_LABEL,"aria-controls":p,"aria-expanded":l,focusProps:{ringTarget:t},children:(0,r.jsx)(qt.Z,{className:v()(hn().arrowIcon,bn({},hn().arrowIconExpanded,l))})})]})}}),l?(0,r.jsxs)("div",{id:p,children:[(0,r.jsx)("div",{className:hn().divider}),(0,r.jsx)(Ft.Z,{groupListingId:a.id,subscription:t,className:hn().changePlanNotice}),(0,r.jsxs)("div",{className:hn().subscriptionInfoCards,children:[(0,r.jsx)(In,{label:O,value:x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_INFO_CURRENT_PERIOD_END_DATE.format({
timestamp:g.getTime()})}),(0,r.jsx)(In,{label:x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_INFO_PRICE,value:m}),(0,r.jsx)(In,{label:x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_INFO_SUBSCRIBED_SINCE,value:x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_INFO_SUBSCRIBED_SINCE_DATE.format({timestamp:b.getTime()})})]}),(0,r.jsx)(xt.Z,{size:16}),!E&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.vwX,{children:x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_PAYMENT_METHOD_LABEL}),(0,r.jsx)(Sn,{subscription:t})]}),!S&&(0,r.jsx)(Tn,{isCancelled:E,onCancelSubscriptionClick:h})]}):null]})};var An=n(414611),Cn=n.n(An);const Pn=function(e){var t,n=e.onGoBack,o=(0,y.e7)([Rt.Z],(function(){return null!==(t=Rt.Z.getActiveApplicationSubscriptions())&&void 0!==t?t:[]})),i=(0,Bt.sp)(o).loading,a=(0,Bt.qz)().loadState;return i||a!==Bt.jd.LOADED?(0,r.jsx)(c.$jN,{}):0===o.length?null:(0,r.jsxs)("div",{className:Cn().container,children:[(0,r.jsxs)(c.zxk,{look:c.zxk.Looks.BLANK,
innerClassName:Cn().backButtonContents,onClick:n,children:[(0,r.jsx)(Gt.Z,{className:Cn().arrowIcon}),x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_PAGE_BACK_CTA]}),(0,r.jsx)(xt.Z,{size:10}),(0,r.jsx)(c.vwX,{tag:"h1",children:x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_PAGE_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:Cn().pageDescription,children:x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTION_PAGE_DESCRIPTION}),(0,r.jsx)("div",{className:Cn().subscriptionsContainer,children:o.map((function(e){return(0,r.jsx)(Nn,{subscription:e},e.id)}))})]})};var jn=n(266472),Rn=n(349575),xn=n.n(Rn),Mn=n(709804),wn=n.n(Mn);function Dn(e){var t=e.onClickManageSubscription,n=(0,y.e7)([Rt.Z],(function(){return Rt.Z.getSubscriptions()})),i=o.useMemo((function(){return Object.values(null!=n?n:{}).filter((function(e){return e.type===B.NYc.GUILD})).filter((function(e){return e.status!==B.O0b.ENDED}))}),[n]);return 0===i.length?null:(0,r.jsxs)("div",{className:xn().container,children:[(0,
r.jsx)(c.X6q,{variant:"heading-md/semibold",className:xn().sectionTitle,children:x.Z.Messages.GUILD_ROLE_SUBSCRIPTIONS_USER_SUBSCRIPTIONS_TITLE}),(0,r.jsx)(xt.Z,{size:4}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:xn().sectionDescription,children:x.Z.Messages.GUILD_ROLE_SUBSCRIPTIONS_USER_SUBSCRIPTIONS_DESCRIPTION}),(0,r.jsx)(xt.Z,{size:24}),(0,r.jsxs)("div",{className:v()(Zt().guildBoostingSubscriptionRow,xn().card),children:[(0,r.jsx)("img",{src:wn(),alt:"",className:xn().handImage}),(0,r.jsxs)("div",{className:xn().textContainer,children:[(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:xn().header,children:x.Z.Messages.GUILD_ROLE_SUBSCRIPTIONS_USER_SUBSCRIPTIONS_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",className:xn().description,children:x.Z.Messages.GUILD_ROLE_SUBSCRIPTIONS_ACTIVE_USER_SUBSCRIPTIONS_DESCRIPTION.format({numSubscriptions:i.length})})]}),(0,r.jsx)(jt.Z,{color:c.zxk.Colors.BRAND,onClick:t,
children:x.Z.Messages.GUILD_ROLE_SUBSCRIPTIONS_MANAGE_SUBSCRIPTIONS_BUTTON})]})]})}var Zn=n(289283),Ln=n(710965),Un=n(547721),kn=n(11879),Gn=n(856744);function Bn(){var e=(0,y.e7)([kn.Z],(function(){return kn.Z.getGuildIdsWithPurchasableRoles()}));return(0,y.e7)([kn.Z],(function(){var t=!0,n=!1,r=void 0;try{for(var o,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;if(kn.Z.getUserSubscriptionRoles(a).size>0)return!0}}catch(e){n=!0;r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return!1}),[e])?Gn.PY.SUBSCRIBED:0===e.size?Gn.PY.NONE:Gn.PY.IN_SUBSCRIPTION_SERVER}var Hn=[];function Vn(e){var t,n=e.ensureFresh,r=e.hasFetched,o=e.hasRoleSubscriptions,i=Rt.Z.getActiveGuildSubscriptions();return!(0!==(null!==(t=null==i?void 0:i.length)&&void 0!==t?t:0)||!o)||(!(!n||r)||!r&&!Rt.Z.hasFetchedSubscriptions())}var Fn=n(216421),Yn=n(198895),zn=n(784426),Wn=n(840249),Kn=n(633440);function qn(e,t){(null==t||t>e.length)&&(t=e.length)
;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Xn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qn(e){var t=(0,Kn.W)(e),n=(0,y.e7)([Wn.Z],(function(){
return Wn.Z.getSubscriptionListingForPlan(t)})),r=(0,y.e7)([Wn.Z],(function(){return null!=n?Wn.Z.getSubscriptionGroupListingForSubscriptionListing(n.id):null})),i=(0,y.e7)([an.Z],(function(){return an.Z.getGuild(null==r?void 0:r.guild_id)})),a=Xn(o.useState(!1),2),s=a[0],c=a[1],l=(0,Un.JH)().fetchSubscriptionsSettings;o.useEffect((function(){s&&null!=i&&l(i.id)}),[s,i,l]);var u=null==n?void 0:function(e){var t=e.listing,n=e.subscription,r=Ge()(n.currentPeriodEnd).format("M/D/YY"),o=t.subscription_plans[0],i=(0,cn.T4)(o.price,o.currency),a=Ge()(n.createdAt).format("M/D/YY"),s=n.status===B.O0b.CANCELED,c=n.status===B.O0b.PAST_DUE,l=null!=n.trialId;return{memberSince:a,nextRenewalDate:r,nextRenewalLabel:s?x.Z.Messages.GUILD_ROLE_MANAGE_SUBSCRIPTION_INFO_MEMBERSHIP_ENDS:x.Z.Messages.GUILD_ROLE_MANAGE_SUBSCRIPTION_INFO_NEXT_RENEWAL,subscriptionPlanPrice:i,isCancelled:s,isPastDue:c,isTrial:l}}({listing:n,subscription:e});return{guild:i,expanded:s,handleToggleExpanded:function(){
return c((function(e){return!e}))},listing:n,groupListing:r,subscriptionInfo:u}}var $n=n(153686),Jn=n(534681),er=n(340562),tr=n(741312),nr=n.n(tr);function rr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function or(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function ir(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){or(i,r,o,a,s,"next",e)}function s(e){or(i,r,o,a,s,"throw",e)}a(void 0)}))}}function ar(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function sr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e
}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return rr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var cr=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),
0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},lr=function(e){var t,n,i=e.transitionState,a=e.groupListing,s=e.guildId,l=e.listing,u=e.subscription,f=e.onClose,d=(0,Jt.Dt)(),p=(0,Un.YB)(s),h=null!=(null==p||null===(t=p.cover_image_asset)||void 0===t?void 0:t.application_id)?(0,Jn._W)(p.cover_image_asset.application_id,p.cover_image_asset,440):void 0,y=function(e){
var t,n=sr(o.useState(!1),2),r=n[0],i=n[1],a=sr(o.useState(null),2),s=a[0],c=a[1],l=(t=ir((function(t){var n;return cr(this,(function(r){switch(r.label){case 0:r.trys.push([0,2,3,4]);i(!0);return[4,Tt.EO(t,e)];case 1:r.sent();return[2,!0];case 2:n=r.sent();c(n);return[3,4];case 3:i(!1);return[7];case 4:return[2]}}))})),function(e){return t.apply(this,arguments)});return{cancelSubscription:l,error:s,submitting:r}}((0,E.Z)($n.Z.GUILD_ROLE_SUBSCRIPTION_CANCELLATION_MODAL).analyticsLocations),m=y.cancelSubscription,b=y.error,g=y.submitting,O=(n=ir((function(){return cr(this,(function(e){switch(e.label){case 0:return[4,m(u.id)];case 1:e.sent()&&f();return[2]}}))})),function(){return n.apply(this,arguments)}),v=l.role_benefits.benefits.filter((function(e){return e.ref_type===Gn.Qs.CHANNEL})),_=l.role_benefits.benefits.filter((function(e){return e.ref_type===Gn.Qs.INTANGIBLE
})),I=Ge()(u.currentPeriodEnd).format("MMMM Do, YYYY"),S=x.Z.Messages.GUILD_ROLE_CANCEL_SUBSCRIPTION_MODAL_DESCRIPTION.format({numChannels:v.length,numAdditionalBenefits:_.length,subscriptionEndDate:I});return(0,r.jsxs)(c.Y0X,{transitionState:i,className:nr().modal,"aria-labelledby":d,children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("img",{src:h,alt:"",className:nr().headerImage}),(0,r.jsx)(c.olH,{withCircleBackground:!0,className:nr().closeButton,onClick:f})]}),null!=b?(0,r.jsx)(c.kzN,{children:b.message}):null,(0,r.jsxs)(c.hzk,{className:nr().content,children:[(0,r.jsx)(c.X6q,{id:d,variant:"text-md/medium",className:nr().title,children:x.Z.Messages.GUILD_ROLE_CANCEL_SUBSCRIPTION_MODAL_TITLE}),(0,r.jsx)(c.xvT,{className:nr().description,variant:"text-sm/normal",children:S}),(0,r.jsx)(er.c,{listingId:l.id,guildId:a.guild_id,className:nr().benefits})]}),(0,r.jsxs)(c.mzw,{className:nr().footer,children:[(0,r.jsx)(c.zxk,{color:c.zxk.Colors.RED,onClick:O,submitting:g,
children:x.Z.Messages.GUILD_ROLE_CANCEL_SUBSCRIPTION_MODAL_CANCEL_CTA}),(0,r.jsx)(c.zxk,{look:c.zxk.Looks.LINK,color:c.zxk.Colors.WHITE,className:nr().goBackButton,onClick:f,children:x.Z.Messages.GUILD_ROLE_CANCEL_SUBSCRIPTION_MODAL_NEVERMIND_CTA})]})]})},ur=function(e){(0,c.h7j)((function(t){return(0,r.jsx)(lr,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){ar(e,t,n[t])}))}return e}({},t,e))}))};var fr=n(263166),dr=n(124296),pr=n(897196),hr=n(131559),Er=n(165606),yr=n.n(Er);function mr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function br(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function gr(e,t,n){
t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Or(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){gr(e,t,n[t])}))}return e}function vr(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function _r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){
var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return mr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ir=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},
"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Sr=function(e){var t=e.label,n=e.value,o=e.showInfoIcon,i=e.infoIconTooltipText
;return(0,r.jsxs)("div",{className:yr().infoCard,children:[(0,r.jsxs)("div",{className:yr().infoCardLabelContainer,children:[(0,r.jsx)(c.X6q,{variant:"heading-deprecated-12/semibold",className:yr().infoCardLabel,children:t}),o&&(0,r.jsx)(c.ua7,{clickableOnMobile:!0,text:i,children:function(e){return(0,r.jsx)(en.Z,vr(Or({},e),{className:yr().infoCardIcon}))}})]}),(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:yr().infoCardValue,children:n})]})},Tr=function(e){var t=e.subscription,n=_r((0,Yt.ED)({subscriptionId:t.id,renewal:!0}),1)[0],o=(0,y.e7)([Wt.Z],(function(){return Wt.Z.hasFetchedPaymentSources}));return null!=n&&o?(0,r.jsx)(zt.Z,{subscription:t,currentInvoicePreview:n,dropdownClassName:yr().paymentSourceDropdown}):(0,r.jsx)(c.$jN,{})},Nr=function(e){var t=e.isTrial,n=e.isCancelled,o=e.isResubscribing,i=e.shouldHideRoleSubscriptionEntryPoints,a=e.onCancelSubscriptionClick,s=e.onResubscribeClick,l=e.onChangePlanClick;return n&&(t||i)?null:(0,r.jsxs)("div",{children:[(0,
r.jsx)(c.vwX,{children:x.Z.Messages.GUILD_ROLE_MANAGE_SUBSCRIPTION_MANAGE_OPTIONS_LABEL}),(0,r.jsx)("div",{className:yr().rowButtons,children:n?(0,r.jsx)(c.zxk,{onClick:s,submitting:o,children:x.Z.Messages.GUILD_ROLE_MANAGE_SUBSCRIPTION_MANAGE_OPTIONS_RESTART_SUBSCRIPTION}):(0,r.jsxs)(r.Fragment,{children:[!t&&!i&&(0,r.jsx)($t,{label:x.Z.Messages.GUILD_ROLE_MANAGE_SUBSCRIPTION_MANAGE_OPTIONS_CHANGE_TIER,onClick:l}),(0,r.jsx)($t,{label:x.Z.Messages.GUILD_ROLE_MANAGE_SUBSCRIPTION_MANAGE_OPTIONS_CANCEL,onClick:a})]})})]})};const Ar=function(e){var t=e.subscription,n=Qn(t),i=n.listing,a=n.groupListing,s=n.guild,l=n.expanded,u=n.handleToggleExpanded,f=n.subscriptionInfo,p=_r(o.useState(!1),2),h=p[0],y=p[1],m=(0,Jt.Dt)(),b=(0,E.Z)().analyticsLocations,g=(0,Yn.VV)(null==s?void 0:s.id).shouldHideRoleSubscriptionPurchaseEntryPoints;if(null==a||null==i||null==f)return null;var O,_,I=function(){if(null!=s){(0,zn.uL)(B.Z5c.CHANNEL(s.id,pr.oC.ROLE_SUBSCRIPTIONS));(0,Se.xf)()
;Fn.Z.show(B.kVF.BACK_TO_PREVIOUS_SCREEN,void 0,x.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PURCHASE_BACK_TO_SUBSCRIPTION_USER_SETTING_CTA,(function(){return d.Z.open(B.oAB.SUBSCRIPTIONS,hr.cP)}))}},S=function(){null!=s&&ur({guildId:s.id,groupListing:a,listing:i,subscription:t})},T=(_=(O=function(){return Ir(this,(function(e){switch(e.label){case 0:e.trys.push([0,,2,3]);y(!0);return[4,Tt.pl(t,b)];case 1:e.sent();(0,fr.B)({title:x.Z.Messages.GUILD_ROLE_SUBSCRIPTION_RESTARTED_TITLE,body:x.Z.Messages.GUILD_ROLE_SUBSCRIPTION_RESTARTED_DESCRIPTION,Icon:dr.Z});return[3,3];case 2:y(!1);return[7];case 3:return[2]}}))},function(){var e=this,t=arguments;return new Promise((function(n,r){var o=O.apply(e,t);function i(e){br(o,n,r,i,a,"next",e)}function a(e){br(o,n,r,i,a,"throw",e)}i(void 0)}))}),function(){return _.apply(this,arguments)}),N=f.isCancelled,A=f.isPastDue,C=f.subscriptionPlanPrice,P=f.memberSince,j=f.nextRenewalDate,R=f.nextRenewalLabel,M=f.isTrial,w=i.soft_deleted||null==s;return(0,
r.jsxs)("div",{className:yr().container,children:[(0,r.jsx)(Vt.Z,{onClick:u,className:yr().headerContainer,children:function(e){var t=e.areaRef,n=e.handleStopPropagation;return(0,r.jsxs)(r.Fragment,{children:[null!=s&&(0,r.jsx)(Kt.Z,{guild:s,active:!0,size:Kt.Z.Sizes.MEDIUM}),(0,r.jsxs)("div",{className:yr().headerTextContainer,children:[(0,r.jsx)(c.xvT,{variant:"text-md/medium",className:yr().guildName,children:null!=s?s.name:x.Z.Messages.GUILD_ROLE_SUBSCRIPTION_SERVER_NAME_UNAVAILABLE}),(0,r.jsxs)("div",{className:yr().headerSubtitleContainer,children:[(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:yr().tierName,children:i.name}),N?(0,r.jsx)(tn.IG,{text:x.Z.Messages.GUILD_ROLE_MANAGE_SUBSCRIPTION_CANCELLED}):M?(0,r.jsx)(tn.IG,{text:x.Z.Messages.GUILD_ROLE_SUBSCRIPTION_SETUP_FREE_TRIAL_TITLE,color:Ht.Z.BRAND_500}):A?(0,r.jsx)(c.ua7,{text:x.Z.Messages.GUILD_ROLE_SUBSCRIPTION_USER_SUBSCRIPTION_PAST_DUE_WARNING,children:function(e){return(0,r.jsx)("div",vr(Or({},e),{children:(0,
r.jsx)(tn.IG,{className:yr().paymentDueBadge,text:x.Z.Messages.GUILD_ROLE_MANAGE_SUBSCRIPTION_PAST_DUE,color:Ht.Z.YELLOW_300})}))}}):null]})]}),(0,r.jsx)(c.P3F,{onClick:n(u),"aria-label":x.Z.Messages.GUILD_ROLE_SUBSCRIPTIONS_TOGGLE_SECTION_LABEL,"aria-controls":m,"aria-expanded":l,focusProps:{ringTarget:t},children:(0,r.jsx)(qt.Z,{className:v()(yr().arrowIcon,gr({},yr().arrowIconExpanded,l))})})]})}}),l?(0,r.jsxs)("div",{id:m,children:[(0,r.jsx)("div",{className:yr().divider}),(0,r.jsx)(Ft.Z,{groupListingId:a.id,subscription:t,className:yr().changePlanNotice}),(0,r.jsxs)("div",{className:yr().subscriptionInfoCards,children:[(0,r.jsx)(Sr,{label:R,value:j}),(0,r.jsx)(Sr,{label:x.Z.Messages.GUILD_ROLE_MANAGE_SUBSCRIPTION_INFO_PRICE,value:C,showInfoIcon:M,infoIconTooltipText:M?x.Z.Messages.GUILD_ROLE_SUBSCRIPTION_MANAGE_SUBSCRIPTION_PAGE_TRIAL_PRICE_INFO:void 0}),(0,r.jsx)(Sr,{label:x.Z.Messages.GUILD_ROLE_MANAGE_SUBSCRIPTION_INFO_MEMBER_SINCE,value:P})]}),(0,r.jsx)(xt.Z,{size:16}),!N&&(0,
r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.vwX,{children:x.Z.Messages.GUILD_ROLE_MANAGE_SUBSCRIPTION_PAYMENT_METHOD_LABEL}),(0,r.jsx)(Tr,{subscription:t})]}),!w&&(0,r.jsx)(Nr,{isTrial:M,isCancelled:N,isResubscribing:h,shouldHideRoleSubscriptionEntryPoints:g,onCancelSubscriptionClick:S,onChangePlanClick:I,onResubscribeClick:T})]}):null]})};var Cr=n(228572),Pr=n.n(Cr);const jr=function(e){var t=e.onGoBack,n=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).ensureFresh,t=void 0!==e&&e,n=Bn()===Gn.PY.SUBSCRIBED,r=(0,y.e7)([Rt.Z],(function(){return Rt.Z.getActiveGuildSubscriptions()})),i=o.useRef(!1);o.useEffect((function(){if(Vn({ensureFresh:t,hasRoleSubscriptions:n,hasFetched:i.current})){i.current=!0;Tt.jg()}}),[t,n]);return null!=r?r:Hn}(),i=(0,Un.sp)(n).loading;(0,Ln.Z)(Zn.tq?"role-subscriptions-user-setting":void 0);return i?(0,r.jsx)(c.$jN,{}):0===n.length?null:(0,r.jsxs)("div",{className:Pr().container,children:[(0,r.jsxs)(c.zxk,{look:c.zxk.Looks.BLANK,
innerClassName:Pr().backButtonContents,onClick:t,children:[(0,r.jsx)(Gt.Z,{className:Pr().arrowIcon}),x.Z.Messages.GUILD_ROLE_SUBSCRIPTIONS_MANAGE_SUBSCRIPTIONS_PAGE_BACK_BUTTON_CTA]}),(0,r.jsx)(xt.Z,{size:10}),(0,r.jsx)(c.vwX,{tag:"h1",children:x.Z.Messages.GUILD_ROLE_MANAGE_SUBSCRIPTION_PAGE_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:Pr().pageDescription,children:x.Z.Messages.GUILD_ROLE_MANAGE_SUBSCRIPTION_PAGE_DESCRIPTION}),(0,r.jsx)("div",{className:Pr().subscriptionsContainer,children:n.map((function(e){return(0,r.jsx)(Ar,{subscription:e},e.id)}))})]})};var Rr=n(793461),xr=n(223219),Mr=n(615796),wr=n(641277),Dr=n(652591),Zr=n(850841),Lr=n(473903),Ur=n(551778),kr=n(95891),Gr=n(250740),Br=n(203600),Hr=n(866051),Vr=n.n(Hr);function Fr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Yr(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function zr(e,t){
return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Fr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wr(e){var t=e.user,n=e.planId,o=e.count,i=e.userPremiumSubscription,a=zr((0,y.Wu)([Ur.Z],(function(){
return[Ur.Z.get(n),null!=i?Ur.Z.get(i.planId):null]})),2),s=a[0],l=a[1];if(null==s||Zr.ZP.getInterval(n).intervalType!==Br.rV.MONTH)return null;var u,f=null!=l?l.skuId:null,d=s.skuId===f,p=Zr.ZP.getDisplayName(n);return(0,r.jsxs)("div",{className:Vr().accountCreditRow,children:[(0,r.jsx)("div",{className:v()((u={},Yr(u,Vr().iconBackgroundTier0,s.skuId===Br.Si.TIER_0),Yr(u,Vr().iconBackgroundTier1,s.skuId===Br.Si.TIER_1),Yr(u,Vr().iconBackgroundTier2,s.skuId===Br.Si.TIER_2),u)),children:(0,r.jsx)(kr.Z,{className:Vr().icon})}),(0,r.jsxs)("div",{className:Vr().rowDetails,children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:x.Z.Messages.PREMIUM_SUBSCRIPTION_CREDIT.format({planName:p})}),t.hasFreePremium()?null:(0,r.jsx)(c.X6q,{className:Vr().rowApplied,variant:"heading-sm/semibold",color:"header-secondary",children:d&&null!=i?x.Z.Messages.PREMIUM_SUBSCRIPTION_CREDIT_APPLIED_ON.format({date:i.currentPeriodEnd
}):x.Z.Messages.PREMIUM_SUBSCRIPTION_CREDIT_APPLIED_MISMATCHED_PLAN.format({planName:p})})]}),(0,r.jsx)(c.xvT,{className:Vr().rowCreditCount,variant:"text-md/semibold",children:x.Z.Messages.PREMIUM_SUBSCRIPTION_CREDIT_COUNT_MONTHS.format({count:o})})]})}const Kr=function(e){var t=e.className,n=e.entitlements,o=_e()(Array.from(n)).filter((function(e){var t=e.subscriptionPlanId,n=e.parentId,r=e.consumed;return null!=t&&null!=n&&!r})).groupBy((function(e){return e.subscriptionPlanId})).value(),i=(0,y.e7)([Rt.Z],(function(){return Rt.Z.getPremiumSubscription()})),a=(0,y.e7)([Rt.Z],(function(){return null==Rt.Z.getPremiumTypeSubscription()})),s=Object.keys(o).some((function(e){return e===Br.Xh.PREMIUM_MONTH_TIER_1}))&&a,l=(0,y.e7)([Lr.default],(function(){return Lr.default.getCurrentUser()}));return null==l?null:(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:v()(t,Vr().premiumSubscriptionAccountCredit),children:Object.keys(o).map((function(e){return(0,r.jsx)(Wr,{planId:e,
count:o[e].length,userPremiumSubscription:i,user:l},e)}))}),s&&(0,r.jsxs)("div",{children:[(0,r.jsx)(c.xvT,{className:Vr().tier1AccountCreditHeader,variant:"text-md/normal",children:x.Z.Messages.PREMIUM_TIER_1_ACCOUNT_CREDIT_HEADER}),(0,r.jsx)(Gr.R,{})]})]})};var qr=n(839799),Xr=n.n(qr);function Qr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Qr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n)
;if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jr(e){var t=e.subscription,n=e.withOverheadSeparator,o=$r((0,Yt.ED)({subscriptionId:t.id,renewal:!0}),1)[0];if(null==o)return null;var i=n?Xr().finePrintWithOverheadSeparator:Xr().finePrint,a=o.invoiceItems.find((function(e){var t=e.subscriptionPlanId;return(0,Zr.uZ)(t)}));if(null==a)return null;var s=a.subscriptionPlanId,l=Ur.Z.get(s);L()(null!=l,"Missing plan");var u=(0,cn.T4)(o.total,o.currency),f="";l.interval===Br.rV.YEAR?f=x.Z.Messages.BILLING_PAYMENT_PREMIUM_TERMS_LEGALESE_YEARLY.format({price:u,termsUrl:B.EYA.TERMS,paidURL:B.EYA.PAID_TERMS,privacyUrl:B.EYA.PRIVACY}):l.interval===Br.rV.MONTH&&(f=1===l.intervalCount?x.Z.Messages.BILLING_PAYMENT_PREMIUM_TERMS_LEGALESE_MONTHLY.format({price:u,
termsUrl:B.EYA.TERMS,paidURL:B.EYA.PAID_TERMS,privacyUrl:B.EYA.PRIVACY}):x.Z.Messages.BILLING_PAYMENT_PREMIUM_TERMS_LEGALESE_MULTI_MONTH.format({price:u,termsUrl:B.EYA.TERMS,paidURL:B.EYA.PAID_TERMS,privacyUrl:B.EYA.PRIVACY,intervalCount:l.intervalCount}));return(0,r.jsx)(c.xvT,{color:"text-muted",className:i,variant:"text-xs/normal",children:f})}function eo(e){var t=e.subscription,n=e.withOverheadSeparator;return t.status===B.O0b.CANCELED||t.isPurchasedExternally?null:(0,r.jsx)(Jr,{subscription:t,withOverheadSeparator:n})}var to=n(798564),no=n(752151),ro=n.n(no);function oo(){return(0,r.jsx)(c.Zbd,{className:ro().noItemsCard,type:c.Zbd.Types.CUSTOM,children:(0,r.jsxs)(ae.Z,{align:ae.Z.Align.CENTER,children:[(0,r.jsx)(wr.Z,{game:null,size:wr.Z.Sizes.SMALL,className:ro().noItemsIcon}),(0,r.jsx)("span",{className:ro().cardText,children:x.Z.Messages.USER_SETTINGS_NO_SUBSCRIPTION_CREDIT})]})})}function io(){var e=(0,y.e7)([sn.Z],(function(){return sn.Z.getForApplication(Br.RQ)}))
;o.useEffect((function(){(0,At.yD)(Br.RQ)}),[]);return(0,r.jsxs)("section",{className:ro().sectionAccountCredit,children:[(0,r.jsx)(c.vwX,{className:ro().accountCreditTitle,tag:c.RB0.H1,children:x.Z.Messages.BILLING_SUBSCRIPTION_CREDIT}),(0,r.jsx)("p",{className:ro().accountCreditDescription,children:x.Z.Messages.BILLING_ACCOUNT_CREDIT_DESCRIPTION}),null!=e&&Zr.ZP.hasAccountCredit(e)?(0,r.jsx)(Kr,{className:ro().accountCredit,entitlements:e}):(0,r.jsx)(oo,{})]})}const ao=function(){var e=(0,y.e7)([Rt.Z],(function(){return Rt.Z.getPremiumTypeSubscription()})),t=(0,y.e7)([Wt.Z],(function(){return null!=e&&null!=e.paymentSourceId?Wt.Z.getPaymentSource(e.paymentSourceId):null}),[e]),n=(0,y.e7)([Rt.Z],(function(){return Rt.Z.hasFetchedSubscriptions()})),i=(0,y.e7)([Mr.Z],(function(){return Mr.Z.isBusy})),a=(0,jn.V)(),s=(0,y.e7)([xr.Z],(function(){return xr.Z.getSubsection()}));o.useEffect((function(){l.Z.wait((function(){(0,Ct.Y2)();Tt.jg();(0,Nt.X8)();Tt.tZ()}));return function(){
d.Z.clearSubsection()}}),[]);return Rr.Z.enabled?(0,r.jsx)(Pt.Z,{}):n&&a?s===hr.cP?(0,r.jsx)(jr,{onGoBack:function(){return d.Z.clearSubsection()}}):s===hr.XZ?(0,r.jsx)(Pn,{onGoBack:function(){return d.Z.clearSubsection()}}):(0,r.jsx)("div",{className:ro().container,children:(0,r.jsxs)("div",{className:ro().content,children:[null!=e?(0,r.jsx)(to.ZP,{className:ro().subscriptionDetails,subscription:e,paymentSource:t,busy:i}):(0,r.jsx)(to.MM,{className:ro().subscriptionDetails}),(0,r.jsx)(Dn,{onClickManageSubscription:function(){return d.Z.setSection(B.oAB.SUBSCRIPTIONS,hr.cP)}}),(0,r.jsx)(kt,{onClickManageSubscription:function(){d.Z.setSection(B.oAB.SUBSCRIPTIONS,hr.XZ);Dr.default.track(B.rMx.PREMIUM_APPLICATION_SUBSCRIPTION_MANAGE_CTA_CLICKED)}}),(0,r.jsx)(io,{}),null!=e?(0,r.jsx)(eo,{subscription:e,withOverheadSeparator:!1}):null]})}):(0,r.jsx)("div",{className:v()(ro().container,ro().loading),children:(0,r.jsx)(c.$jN,{})})};var so=n(294882);function co(e){var t={}
;void 0!==e.pendingBanner&&(t.banner=e.pendingBanner);null!=e.pendingBio&&(t.bio=e.pendingBio);null!=e.pendingPronouns&&(t.pronouns=e.pendingPronouns);void 0!==e.pendingAccentColor&&(t.accent_color=e.pendingAccentColor);void 0!==e.pendingThemeColors&&(t.theme_colors=e.pendingThemeColors);return t}var lo=n(408379);function uo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fo(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function po(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){fo(i,r,o,a,s,"next",e)}function s(e){fo(i,r,o,a,s,"throw",e)}a(void 0)}))}}function ho(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){
i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return uo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uo(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Eo=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,
r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function yo(){var e,t=(0,y.e7)([ge.Z],(function(){return ge.Z.getIsDisableSubmit()})),n=(0,y.e7)([ge.Z],(function(){return ge.Z.getGuild()})),i=(0,y.e7)([ge.Z],(function(){return ge.Z.getErrors()})),a=ho(o.useState(!1),2),s=a[0],c=a[1],l=o.useCallback(po((function(){var e,t,r,o,i,a,s,l
;return Eo(this,(function(u){switch(u.label){case 0:c(!0);e=ge.Z.getAllPending();t=function(e){var t={};void 0!==e.pendingAvatar&&(t.avatar=e.pendingAvatar);if(void 0!==e.pendingNickname){var n;t.nick=null!==(n=e.pendingNickname)&&void 0!==n?n:""}return t}(e);r=co(e);o=!0;return Object.keys(t).length>0?[4,(0,be.iq)(null==n?void 0:n.id,t)]:[3,2];case 1:i=u.sent();o=o&&null!==(a=null==i?void 0:i.ok)&&void 0!==a&&a;(null==i?void 0:i.ok)&&(0,be.IO)();u.label=2;case 2:return Object.keys(r).length>0?[4,(0,lo.Z)(r,null==n?void 0:n.id)]:[3,4];case 3:s=u.sent();o=o&&null!==(l=null==s?void 0:s.ok)&&void 0!==l&&l;(null==s?void 0:s.ok)&&(0,be.pG)();u.label=4;case 4:o&&(0,be.b9)();c(!1);return[2]}}))})),[null==n?void 0:n.id]),u=o.useCallback((function(){(0,be.W3)()}),[]);return(0,r.jsx)(so.Z,{submitting:s,onSave:l,onReset:u,disabled:t,errorMessage:null!==(e=null==i?void 0:i.message)&&void 0!==e?e:void 0})}var mo=n(450383),bo=n(973646);function go(e,t){(null==t||t>e.length)&&(t=e.length)
;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Oo(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function vo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Oo(i,r,o,a,s,"next",e)}function s(e){Oo(i,r,o,a,s,"throw",e)}a(void 0)}))}}function _o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return go(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n)
;if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return go(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Io=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,
o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function So(){var e=(0,y.e7)([mo.Z],(function(){return mo.Z.getIsDisableSubmit()})),t=_o(o.useState(!1),2),n=t[0],i=t[1],a=o.useCallback(vo((function(){var e,t,n,r,o,a,s,c,l;return Io(this,(function(u){switch(u.label){case 0:i(!0);e=mo.Z.getAllPending();t=function(e){var t={};void 0!==e.pendingGlobalName&&(t.globalName=e.pendingGlobalName);void 0!==e.pendingAvatar&&(t.avatar=e.pendingAvatar);void 0!==e.pendingAvatarDecoration&&(t.avatarDecoration=e.pendingAvatarDecoration);return t}(e);n=co(e);r=!0;return Object.keys(t).length>0?[4,(0,f.Mn)(t)]:[3,2];case 1:a=u.sent()
;r=r&&null!==(s=null==a?void 0:a.ok)&&void 0!==s&&s;(null==a?void 0:a.ok)?(0,f.si)():null!=(null==a||null===(o=a.body)||void 0===o?void 0:o.username)&&(0,bo.P)();u.label=2;case 2:return Object.keys(n).length>0?[4,(0,lo.Z)(n)]:[3,4];case 3:c=u.sent();r=r&&null!==(l=null==c?void 0:c.ok)&&void 0!==l&&l;(null==c?void 0:c.ok)&&(0,lo.pG)();u.label=4;case 4:r&&(0,f.b9)();i(!1);return[2]}}))})),[]),s=o.useCallback((function(){(0,f.W3)()}),[]);return(0,r.jsx)(so.Z,{submitting:n,onSave:a,onReset:s,disabled:e})}function To(){return(0,y.e7)([ge.Z],(function(){return ge.Z.showNotice()}))?(0,r.jsx)(yo,{}):(0,r.jsx)(So,{})}var No=n(19292),Ao=n(396043),Co=n(981054),Po=n.n(Co),jo=n(524268),Ro=n.n(jo),xo=n(950737),Mo=n.n(xo);function wo(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var Do,Zo;!function(e){e[e.WUMPUS=0]="WUMPUS";e[e.PHIBI=1]="PHIBI"}(Do||(Do={}));wo(Zo={},Do.WUMPUS,Po().activityCharacterWumpus),
wo(Zo,Do.PHIBI,Po().activityCharacterPhibi);var Lo=n(547308),Uo=n(74535),ko=n(109206),Go=n(80317),Bo=n(795470),Ho=n(807947),Vo=n(888291),Fo=n(23260),Yo=n(436817),zo=n(185041),Wo=n(362658),Ko=n(735100),qo=n(777532),Xo=n(754828),Qo=n(546789),$o=n(259317),Jo=n(905464),ei=n(470442),ti=n(784686),ni=n(769321),ri=n(21372),oi=n(491260),ii=n(901654),ai=n(258441),si=n(775173),ci=n(749565),li=n(248088),ui=n(104738);function fi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function di(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function pi(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){di(i,r,o,a,s,"next",e)}function s(e){di(i,r,o,a,s,"throw",e)}a(void 0)}))}}function hi(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Ei(e,t){return function(e){
if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fi(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var yi,mi,bi=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},
"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(e){e[e.WUMPUS=0]="WUMPUS";e[e.PHIBI=1]="PHIBI"}(yi||(yi={}))
;var gi=(hi(mi={},yi.WUMPUS,Po().activityCharacterWumpus),hi(mi,yi.PHIBI,Po().activityCharacterPhibi),mi);const Oi=o.memo((function(e){var t=e.activityName,n=e.activityCharacter,i=void 0===n?yi.WUMPUS:n,a=e.showExampleButton,s=void 0!==a&&a,l=Ei(o.useState(0),2),u=l[0],f=l[1],d=Ei((0,li.useSpring)((function(){return{from:{rotate:"0deg"},config:{tension:1e3,friction:5}}})),2),p=d[0],h=d[1],E=o.useRef({seconds:u,jitter:pi((function(){var e;return bi(this,(function(t){switch(t.label){case 0:0;e=function(e){if(Te.Z.useReducedMotion)return 0;e-=5399;return Math.min(10,e/300*10)}(E.current.seconds);h({rotate:"-".concat(e,"deg")});return[4,new Promise((function(e){return setTimeout(e,80)}))];case 1:t.sent();h({rotate:"".concat(e,"deg")});return[4,new Promise((function(e){return setTimeout(e,80)}))];case 2:t.sent();return[3,0];case 3:return[2]}}))}))});o.useEffect((function(){E.current.seconds=u}));o.useEffect((function(){var e=setInterval((function(){f((function(e){
5399===e&&E.current.jitter();return++e}))}),1e3);return function(){return clearInterval(e)}}),[]);var y=i===yi.WUMPUS?Mo():Ro();return(0,r.jsxs)(ui.Z,{lastSection:!0,"aria-hidden":!0,children:[(0,r.jsx)(c.X6q,{className:Po().fakeActivityTitle,variant:"eyebrow",children:x.Z.Messages.USER_SETTINGS_CUSTOMIZE_PROFILE_TITLE}),(0,r.jsxs)("div",{className:Po().fakeActivityLayout,children:[(0,r.jsx)("div",{className:v()(Po().fakeActivityIcon,gi[i]),children:(0,r.jsx)(li.animated.img,{className:Po().fakeActivityPencil,src:y,style:p})}),(0,r.jsxs)("div",{className:Po().fakeActivityContent,children:[(0,r.jsx)(c.xvT,{variant:"text-sm/semibold",children:null!=t?t:x.Z.Messages.USER_SETTINGS_USER_PROFILE}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",children:x.Z.Messages.PROFILE_CUSTOMIZATION_ACTIVITY_TIME.format({renderTimeHook:function(e,t){var n=u%60,o=(u-n)/60;return(0,r.jsxs)("span",{className:Po().fakeActivityTimeValues,children:[o.toString().padStart(2,"0"),":",n.toString().padStart(2,"0")]},t)}
})})]})]}),s&&(0,r.jsx)(c.zxk,{className:Po().button,color:Po().buttonColor,size:c.zxk.Sizes.SMALL,fullWidth:!0,children:x.Z.Messages.USER_SETTINGS_CUSTOMIZE_PROFILE_EXAMPLE_BUTTON})]})}));var vi=n(339822),_i=n(766959),Ii=n(921431),Si=n(448898),Ti=n(412938),Ni=n.n(Ti);function Ai(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ci(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Pi(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ci(i,r,o,a,s,"next",e)}function s(e){Ci(i,r,o,a,s,"throw",e)}a(void 0)}))}}function ji(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Ri(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){ji(e,t,n[t])}))}return e}function xi(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Mi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{
try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ai(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ai(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var wi=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),
0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Di(e){
var t,i,a,l,u,f,d,p,h,E=e.user,m=e.guild,b=e.canUsePremiumCustomization,g=e.onUpsellClick,O=e.onAvatarChange,_=e.onBannerChange,I=e.pendingAccentColor,S=e.pendingBanner,T=e.pendingBio,N=e.pendingPronouns,A=e.pendingAvatar,C=e.pendingAvatarDecoration,P=e.pendingNickname,j=e.pendingGlobalName,R=e.pendingThemeColors,M=e.avatarClassName,w=e.openPremiumSettings,D=e.activityName,Z=e.activityCharacter,L=e.overrideDiscriminator,U=e.sampleBadgeList,k=e.isTryItOutFlow,G=void 0!==k&&k,H=e.disabledInputs,V=void 0!==H&&H,F=e.hideExampleButton,Y=void 0!==F&&F,z=e.hideFakeActivity,W=void 0!==z&&z,K=o.useRef(null),q=Mi(o.useState(!1),2),X=q[0],Q=q[1],$=ni.QK.getSetting(),J=(0,Go.U)().canUseAvatarDecorations?(0,vi.Jy)({pendingAvatarDecoration:C,user:E}):null,ee=(0,Yo.Z)(E.id,null==m?void 0:m.id),te=(0,y.e7)([Te.Z],(function(){return Te.Z.syncProfileThemeWithUserTheme})),ne=(0,Uo.ZP)(),re=(0,y.e7)([ri.ZP],(function(){return null==m?null:ri.ZP.getMember(m.id,E.id)
})),oe=void 0===A?E.getAvatarURL(void 0,80):A,ie=(0,ko.ZP)(oe,(0,c.dQu)(s.Z.unsafe_rawColors.PRIMARY_530).hsl(),!1),ae=null==ee?void 0:ee.getPreviewThemeColors(R),se=null!==(t=null==ae?void 0:ae[0])&&void 0!==t?t:null==ee?void 0:ee.primaryColor,ce=te?ne:(0,Fo.V3)(se),le=(0,Ho.Z)(null!==(i=null!=I?I:se)&&void 0!==i?i:(0,Lo._i)(ie)).hsl,ue=(0,y.e7)([ii.Z],(function(){return ii.Z.isFocused()})),fe=(0,ti.rW)(),de=$?ue:X,pe=null==ee?void 0:ee.getPreviewBanner(S,de),he=null!==(a=(0,vi.gh)(P,null==re?void 0:re.nick))&&void 0!==a?a:(0,vi.zJ)(j,fe?ci.ZP.getName(E):ci.ZP.getGlobalName(E)),Ee=Mi((0,y.Wu)([oi.Z],(function(){return[oi.Z.findActivity(E.id,(function(e){return e.type===B.IIU.CUSTOM_STATUS})),oi.Z.getStatus(E.id)]})),2),ye=Ee[0],me=Ee[1],be=(0,y.e7)([Rr.Z],(function(){return Rr.Z.hidePersonalInformation})),ge=(null==ee?void 0:ee.canUsePremiumProfileCustomization)||b,Oe=o.useCallback((function(){var e,t
;null===(t=null===(e=K.current)||void 0===e?void 0:e.inputRef.current)||void 0===t||t.activateUploadDialogue()}),[]),ve=o.useCallback((function(e,t){null==e||null==t?O(null):"image/gif"!==t.type||Zr.ZP.canUseAnimatedAvatar(E)?(0,c.ZDy)(Pi((function(){var o,i;return wi(this,(function(a){switch(a.label){case 0:return[4,Promise.all([n.e(40532),n.e(17363),n.e(38479)]).then(n.bind(n,17363))];case 1:o=a.sent(),i=o.default;return[2,function(n){return(0,r.jsx)(i,Ri({onCrop:O,file:t,imgURI:e,allowSkip:!0},n))}]}}))}))):(0,c.ZDy)(Pi((function(){var t,o;return wi(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(83409)]).then(n.bind(n,383409))];case 1:t=i.sent(),o=t.default;return[2,function(t){return(0,r.jsx)(o,xi(Ri({},t),{imgURI:e,onChangeAvatar:function(){t.onClose();Oe()}}))}]}}))})))}),[E,Oe,O]),_e=function(e,t){if(null==e||null==t)return _(null);(0,c.ZDy)(Pi((function(){var o,i;return wi(this,(function(a){switch(a.label){case 0:
return[4,Promise.all([n.e(40532),n.e(17363),n.e(38479)]).then(n.bind(n,17363))];case 1:o=a.sent(),i=o.default;return[2,function(n){return(0,r.jsx)(i,Ri({onCrop:_,uploadType:Ii.pC.BANNER_V2,file:t,imgURI:e,allowSkip:!0},n))}]}}))})))};o.useEffect((function(){if(!$){var e=null==ee?void 0:ee.getBannerURL({canAnimate:!0,size:480});if(si.F8(e)){(new Image).src=null!=e?e:""}}}),[ee,$]);return(0,r.jsx)(Wo.Z,{forceShowPremium:b,user:E,guildId:null==m?void 0:m.id,profileType:Si.y0.POPOUT,pendingThemeColors:R,className:ge?Ni().profileCustomizationPreviewWithTheme:Ni().profileCustomizationPreviewWithoutTheme,children:(0,r.jsxs)(c.y5t,{children:[(0,r.jsx)(zo.Z,{user:E,profileType:Si.y0.POPOUT,hasBannerImage:null!=pe,isPremium:b,hasThemeColors:ge,overrideAvatarDecorationURL:J,children:b?(0,r.jsxs)("div",{onMouseMove:function(){return Q(!0)},onMouseLeave:function(){return Q(!1)},children:[(0,r.jsx)(Vo.Z,{className:Ni().bannerUploader,showRemoveButton:!1,disabled:!b||V,image:pe,makeURL:function(){
return pe},onChange:_e,imageStyle:{backgroundColor:le},imageClassName:null!=pe?Ni().bannerUploaderInnerSquare:Ni().bannerUploaderInnerSquareEmpty,hint:x.Z.Messages.CHANGE_BANNER,onOpenImageSelectModal:function(){return(0,vi.$r)(Ii.pC.BANNER_V2,null==re?void 0:re.guildId,G)},hideSize:!0,maxFileSizeBytes:_i.B,onFileSizeError:vi.Wf}),!$&&si.F8(pe)?(0,r.jsx)(ai.Z,{className:Ni().gifTag}):null]}):(0,r.jsx)("div",{className:Ni().bannerNormal,style:{backgroundColor:le},children:(0,r.jsx)(c.P3F,{onClick:function(){return null==g?void 0:g({object:B.qAy.EDIT_PROFILE_BANNER})},className:Ni().bannerNitroUpsell,children:(0,r.jsx)(c.X6q,{className:Ni().bannerNitroUpsellText,variant:"eyebrow",children:x.Z.Messages.USER_SETTINGS_UNLOCK_BANNER})})})}),(f=(0,vi.SG)(A,re,E),d=null!=re&&!b,p=null!=ce?(0,c.QFD)(ce):null,h=(0,r.jsxs)("div",{className:(l=b,u=null!=pe,l&&u?Ni().avatarUploaderPremium:l?Ni().avatarUploaderPremiumNoBanner:Ni().avatarUploaderNormal),children:[(0,r.jsx)(Vo.Z,{disabled:V,ref:K,
showIcon:null==J,hint:d?x.Z.Messages.UNLOCK_GUILD_MEMBER_AVATAR:x.Z.Messages.CHANGE_AVATAR,showRemoveButton:!1,imageClassName:v()(M,Ni().avatarUploaderInner),image:f,onChange:ve,makeURL:function(){return f},maxFileSizeBytes:_i.B,onFileSizeError:vi.Wf,onOpenImageSelectModal:function(){return(0,vi.$r)(Ii.pC.AVATAR,null==re?void 0:re.guildId,G)}}),null!=J&&(0,r.jsx)("img",{className:Ni().avatarDecoration,src:J,alt:" ","aria-hidden":!0}),(0,r.jsxs)("div",{className:Ni().status,children:[null!=p&&(null==ee?void 0:ee.canUsePremiumProfileCustomization)&&(0,r.jsx)("div",{className:Ni().statusDotBackground,style:{backgroundColor:p,opacity:(0,c.lme)(me,p)}}),(0,r.jsx)("svg",{className:Ni().statusDot,children:(0,r.jsx)("rect",{height:"100%",width:"100%",fill:(0,Bo.Lq)((0,c.z2c)(me)),mask:"url(#".concat((0,c.rsb)(me,!1),")")})})]})]}),d?(0,r.jsx)(c.P3F,{onClickCapture:function(e){e.stopPropagation();null==g||g({object:B.qAy.AVATAR})},children:h}):h),(0,r.jsx)(qo.Cb,{user:E,
guildId:null==m?void 0:m.id,onOpenPremiumSettings:w,sampleBadgeList:U}),function(){var e,t=null==ee?void 0:ee.getPreviewBio(T);return(0,r.jsxs)(Wo.Z.Inner,{className:Ni().body,children:[(0,r.jsx)(ei.Z,{overrideDiscriminator:L,user:E,nickname:he,usernameIcon:(0,vi.$y)(A,re)&&(0,r.jsx)(Xo.Z,{user:E,nickname:he})}),(0,r.jsx)($o.Z,{customStatusActivity:ye}),(0,r.jsx)(Ko.Z,{}),(0,r.jsx)(Jo.Z,{pendingPronouns:N,currentPronouns:null!==(e=null==ee?void 0:ee.pronouns)&&void 0!==e?e:"",hidePersonalInformation:be}),(0,r.jsx)(Qo.Z,{isUsingGuildBio:null==t?void 0:t.isUsingGuildValue,guild:m,bio:null==t?void 0:t.value,hidePersonalInformation:be,lastSection:W}),!W&&(0,r.jsx)(Oi,{activityName:D,activityCharacter:Z,showExampleButton:null==m&&!Y})]})}()]})})}var Zi,Li,Ui=n(921098),ki=n(275374),Gi=n(102007),Bi=n(483913),Hi=n.n(Bi);function Vi(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}!function(e){e.PREMIUM="premium";e.LIMITED="limited"
}(Zi||(Zi={}));var Fi=(Vi(Li={},Zi.PREMIUM,{border:Hi().premiumFeatureBorder,background:Hi().premiumBackground}),Vi(Li,Zi.LIMITED,{border:Hi().limitedFeatureBorder,background:Hi().limitedBackground}),Li);const Yi=o.forwardRef((function(e,t){var n=e.children,o=e.type,i=void 0===o?Zi.PREMIUM:o,a=e.isShown,s=e.hasBackground,c=void 0!==s&&s,l=e.className,u=e.backgroundClassName;if(!a)return(0,r.jsx)(r.Fragment,{children:n});var f=Fi[i],d=f.border,p=f.background;return(0,r.jsx)("div",{ref:t,className:v()(d,l),children:(0,r.jsx)("div",{className:v()(c?p:Hi().background,u),children:n})})}));var zi=n(165667),Wi=n.n(zi);function Ki(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function qi(e){var t=e.errors;return(0,r.jsx)(r.Fragment,{children:t.map((function(e,t){return(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"text-danger",className:Wi().errorMessage,children:(n=e,n.replace(/[0-9.,]+ ?kb/g,(function(e){
var t=1024*parseInt(e,10);return isNaN(t)?e:(0,ki.Ng)(t)})))},t);var n}))})}function Xi(e){var t,n=e.title,o=e.titleIcon,i=e.titleId,a=e.description,s=e.children,l=e.className,u=e.errors,f=e.disabled,d=void 0!==f&&f,p=e.hideDivider,h=void 0!==p&&p,E=e.showBorder,y=void 0!==E&&E,m=e.borderType,b=e.hasBackground,g=void 0!==b&&b,O=e.forcedDivider,_=void 0!==O&&O,I=e.showPremiumIcon,S=void 0!==I&&I;return(0,r.jsx)("div",{className:v()(Wi().customizationSection,l,(t={},Ki(t,Wi().disabled,d),Ki(t,Wi().hideDivider,h),Ki(t,Wi().showBorder,y),Ki(t,Wi().withDivider,_),t)),children:(0,r.jsxs)(Yi,{className:Wi().customizationSectionBorder,isShown:y,type:m,hasBackground:g,children:[(0,r.jsxs)(c.vwX,{className:Wi().title,id:i,children:[n,S&&(0,r.jsx)(Gi.Z,{}),o]}),null!=a?(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:Wi().sectionDescription,children:a}):null,s,null!=u&&(0,r.jsx)(qi,{errors:u})]})})}var Qi=n(779674),$i=n.n(Qi);function Ji(e){
var t=e.children,n=e.className,o=e.layoutClassName,i=e.profilePreview,a=e.previewTitle,s=(0,Ui.Z)().canViewThemes,l=function(){return(0,r.jsx)(Xi,{title:null!=a?a:x.Z.Messages.PROFILE_CUSTOMIZATION_PREVIEW,className:s?$i().previewProfileThemes:$i().preview,children:i})};return(0,r.jsx)("div",{className:n,children:(0,r.jsxs)(c.hjN,{className:$i().profileCustomizationSection,children:[Zn.tq&&l(),(0,r.jsxs)("div",{className:v()(s?$i().baseLayoutProfileThemes:$i().baseLayout,o),children:[t,!Zn.tq&&l()]})]})})}var ea=n(924308),ta=n(348592),na=n(345445),ra=n.n(na),oa=n(970298),ia=n.n(oa);function aa(){return(0,r.jsxs)("div",{className:ra().emptyState,children:[(0,r.jsx)("img",{src:ia(),alt:"",className:ra().image}),(0,r.jsx)(c.X6q,{className:ra().topSpacing,variant:"heading-lg/extrabold",children:x.Z.Messages.GUILD_IDENTITY_SETTINGS_EMPTY_STATE_TITLE}),(0,r.jsx)(c.xvT,{className:ra().topSpacing,variant:"text-md/normal",children:x.Z.Messages.GUILD_IDENTITY_SETTINGS_EMPTY_STATE_DESCRIPTION
}),(0,r.jsx)(c.zxk,{className:ra().topSpacing,onClick:function(){(0,zn.uL)(B.Z5c.GUILD_DISCOVERY);Se.xf()},children:x.Z.Messages.GUILD_IDENTITY_SETTINGS_EMPTY_STATE_CTA})]})}var sa=n(260561);const ca=(0,sa.B)({kind:"user",id:"2022-07_premium_upsell_overlay",label:"Premium upsell overlay",defaultConfig:{showPremiumUpsellOverlay:!1},treatments:[{id:1,label:"Premium upsell overlay enabled",config:{showPremiumUpsellOverlay:!0}}]});var la=n(357920),ua=n(281808),fa=n(855483),da=n(889025),pa=n(382060),ha=n(551173),Ea=n.n(ha);function ya(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ma(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{
if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ya(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ya(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ba=(0,Jt.hQ)(),ga=(0,pa.kt)({id:"1",type:B.d4z.DM}),Oa=(0,Jt.hQ)();function va(e){var t=e.sectionTitle,n=e.errors,i=e.onBioChange,a=e.pendingBio,s=e.placeholder,l=e.currentBio,u=e.disabled,f=void 0!==u&&u,d=ma(o.useState(null!=a?a:l),2),p=d[0],h=d[1],E=ma(o.useState((0,fa.JM)(p)),2),y=E[0],m=E[1],b=o.useRef(!1);o.useEffect((function(){if(void 0===a){var e=(0,fa.JM)(l);h(l);m(e)}}),[a,l]);return(0,r.jsxs)(Xi,{title:t,titleId:ba,
description:x.Z.Messages.USER_SETTINGS_ABOUT_ME_DETAILS,errors:n,disabled:f,children:[(0,r.jsx)(da.Z,{"aria-describedby":Oa,"aria-labelledby":ba,innerClassName:Ea().bioTextArea,maxCharacterCount:B.tPV,onChange:function(e,t,n){if(t!==p){h(t);m(n);i(t)}},placeholder:s,channel:ga,textValue:p,richValue:y,type:ua.I.PROFILE_BIO_INPUT,onBlur:function(){b.current=!1},onFocus:function(){b.current=!0},focused:b.current,onSubmit:function(){return new Promise((function(e){e({shouldClear:!1,shouldRefocus:!0})}))}}),(0,r.jsx)(c.nn4,{id:Oa,children:x.Z.Messages.MAXIMUM_LENGTH.format({maxLength:B.tPV})})]})}var _a=n(709189),Ia=n(221260),Sa=n.n(Ia);function Ta(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var Na=[{name:"gif",extensions:["gif"]}];function Aa(e){
var t=e.showRemoveAvatarButton,n=e.errors,o=e.onAvatarChange,i=e.sectionTitle,a=e.changeAvatarButtonText,s=e.guildId,l=e.className,u=e.disabled,f=void 0!==u&&u,d=e.isTryItOutFlow,p=void 0!==d&&d,h=e.forcedDivider,E=e.withHighlight,y=void 0!==E&&E,m=y?_a.C:c.zxk;return(0,r.jsx)(Xi,{className:l,title:i,errors:n,disabled:f,forcedDivider:h,children:(0,r.jsxs)("div",{className:Sa().buttonsContainer,children:[(0,r.jsx)(m,{className:v()(Ta({},Sa().buttonHighlighted,y)),size:c.zxk.Sizes.SMALL,onClick:function(){return(0,vi.$r)(Ii.pC.AVATAR,s,p,p?Na:void 0)},children:null!=a?a:x.Z.Messages.USER_SETTINGS_CHANGE_AVATAR}),t&&(0,r.jsx)(c.zxk,{className:Sa().removeButton,color:c.zxk.Colors.PRIMARY,look:c.zxk.Looks.LINK,size:c.zxk.Sizes.SMALL,onClick:function(){return o(null)},children:null!=s?x.Z.Messages.USER_SETTINGS_RESET_AVATAR:x.Z.Messages.USER_SETTINGS_REMOVE_AVATAR})]})})}var Ca=n(34598),Pa=n.n(Ca);function ja(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,
writable:!0}):e[t]=n;return e}function Ra(e){var t=e.canUsePremiumCustomization,n=e.showRemoveBannerButton,o=e.errors,i=e.upsellButton,a=e.onBannerChange,s=e.guildId,l=e.className,u=e.disabled,f=void 0!==u&&u,d=e.showPremiumIcon,p=void 0===d||d,h=e.isTryItOutFlow,E=void 0!==h&&h,y=e.forcedDivider,m=e.withHighlight,b=void 0!==m&&m,g=(0,Ui.Z)(!0).canViewThemes,O=g?Ii.pC.BANNER_V2:Ii.pC.BANNER,_=b?_a.C:c.zxk;return(0,r.jsx)(Xi,{className:l,title:x.Z.Messages.USER_SETTINGS_PROFILE_BANNER,showPremiumIcon:p,errors:o,description:g?void 0:x.Z.Messages.USER_SETTINGS_BANNER_SPECS,disabled:f,forcedDivider:y,children:t||f?(0,r.jsxs)("div",{className:Pa().buttonsContainer,children:[(0,r.jsx)(_,{className:v()(ja({},Pa().buttonHighlighted,b)),size:c.zxk.Sizes.SMALL,onClick:function(){return(0,vi.$r)(O,s,E)},children:x.Z.Messages.CHANGE_BANNER}),n&&(0,r.jsx)(c.zxk,{className:Pa().removeButton,color:c.zxk.Colors.PRIMARY,look:c.zxk.Looks.LINK,size:c.zxk.Sizes.SMALL,onClick:function(){return a(null)},
children:null!=s?x.Z.Messages.USER_SETTINGS_RESET_BANNER:x.Z.Messages.USER_SETTINGS_REMOVE_BANNER})]}):i})}var xa=n(618446),Ma=n.n(xa),wa=n(531835),Da=n(468811),Za=n.n(Da),La=n(502526),Ua=n(577939),ka=n(912250),Ga=n(799324),Ba=n.n(Ga);function Ha(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Va(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Fa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Va(e,t,n[t])}))}return e}function Ya(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){
var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function za(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function Wa(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{
if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ha(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ha(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ka(e){var t=e.onChange,n=e.onClose,i=e.color,a=e.suggestedColors,l=e.disabled,u=e.label,f=e.colorPickerMiddle,d=e.colorPickerFooter,p=e.showEyeDropper,h=o.useRef(null),E=(0,c.dQu)(s.Z.colors.BACKGROUND_PRIMARY).hex(),y=s.Z.colors.BACKGROUND_ACCENT.css,m=(0,vi.DP)(i),b=(0,Lo.Rf)(i),g=b===E?y:b,O=(0,Bo.Lq)(m?B.Ilk.WHITE_500:B.Ilk.PRIMARY_530),_=(0,La.Z)(f),I=(0,La.Z)(d),S=Wa(o.useState(Za().v4()),2),T=S[0],N=S[1];o.useEffect((function(){_===f&&I===d||N(Za().v4())}),[d,f,I,_])
;return(0,r.jsx)(c.yRy,{positionKey:T,renderPopout:function(e){return(0,r.jsx)(Ua.Z$,Ya(Fa({},e),{value:i,onChange:t,suggestedColors:a,middle:f,footer:d,showEyeDropper:p}))},onRequestClose:n,children:function(e){var t=e.onClick,n=za(e,["onClick"]);return(0,r.jsxs)("div",{ref:h,className:v()(Ba().colorSwatch,Va({},Ba().disabled,l)),children:[(0,r.jsx)(c.P3F,Ya(Fa({},n),{tabIndex:l?-1:0,onClick:l?B.dG4:t,style:{backgroundColor:b,borderColor:g},className:Ba().swatch,"aria-label":x.Z.Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR,focusProps:{ringTarget:h},children:(0,r.jsx)(ka.Z,{className:Ba().editPencilIcon,width:14,height:14,color:O})})),u]})}})}var qa=n(791431),Xa=n.n(qa);function Qa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{
for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Qa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qa(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ja(e){var t=e.user,n=e.pendingAvatar,o=e.pendingColors,i=e.onThemeColorsChange,a=e.preventDisabled,l=e.guildId,u=e.className,f=e.showPremiumIcon,d=void 0===f||f,p=e.showResetThemeButton,h=void 0!==p&&p,E=e.forcedDivider,y=(0,Yo.Z)(t.id,l),m=$a((0,wa.Z)(t,y,{pendingThemeColors:o,isPreview:!0
}),2),b=m[0],g=m[1],O=Zr.ZP.canUsePremiumProfileCustomization(t),_=null!=n?n:t.getAvatarURL(l,80),I=(0,c.dQu)(s.Z.unsafe_rawColors.PRIMARY_530).hex(),S=(0,ko.Cf)(_,I,!1);if(null==b||null==g)return null;var T=function(e){var t=Ma()(e,null==y?void 0:y.themeColors);i(t?void 0:e)};return(0,r.jsx)(Xi,{title:x.Z.Messages.USER_SETTINGS_PROFILE_THEME,disabled:!O&&!a,className:v()(Xa().profileThemesSection,u),showPremiumIcon:d,forcedDivider:E,children:(0,r.jsxs)("div",{className:Xa().sectionContainer,children:[(0,r.jsx)("div",{className:Xa().sparkleContainer,children:(0,r.jsx)(Ka,{onChange:function(e){return T([e,g])},color:b,suggestedColors:S,showEyeDropper:!0,label:(0,r.jsx)(c.xvT,{className:Xa().colorSwatchLabel,color:"header-secondary",variant:"text-xs/normal","aria-hidden":!0,children:x.Z.Messages.USER_SETTINGS_PROFILE_THEME_PRIMARY})})}),(0,r.jsx)("div",{className:Xa().sparkleContainer,children:(0,r.jsx)(Ka,{onChange:function(e){return T([b,e])},color:g,suggestedColors:S,
showEyeDropper:!0,label:(0,r.jsx)(c.xvT,{className:Xa().colorSwatchLabel,color:"header-secondary",variant:"text-xs/normal","aria-hidden":!0,children:x.Z.Messages.USER_SETTINGS_PROFILE_THEME_ACCENT})})}),h&&null!=l&&(0,r.jsx)(c.zxk,{className:Xa().resetButton,color:c.zxk.Colors.PRIMARY,look:c.zxk.Looks.LINK,size:c.zxk.Sizes.SMALL,onClick:function(){return T([null,null])},children:x.Z.Messages.USER_SETTINGS_RESET_PROFILE_THEME})]})})}var es=n(411592);function ts(e){var t=e.sectionTitle,n=e.errors,o=e.onPronounsChange,i=e.pendingPronouns,a=e.placeholder,s=e.currentPronouns,l=e.disabled,u=void 0!==l&&l;return es.Z.useExperiment({}).showPronouns?(0,r.jsx)(Xi,{title:t,errors:n,disabled:u,children:(0,r.jsx)(c.oil,{placeholder:null!=a?a:x.Z.Messages.PROFILE_CUSTOMIZATION_PRONOUNS_PLACEHOLDER,maxLength:40,value:null!=i?i:s,onChange:function(e){o(e===s?void 0:e)},disabled:u})}):null}var ns=n(682776),rs=n(10577),os=n.n(rs);function is(e){
var t=e.errors,n=e.pendingNick,o=e.currentNick,i=e.username,a=e.guild,s=null!=n?n:o,l=(0,y.e7)([ns.Z],(function(){return ns.Z.can(B.Plq.CHANGE_NICKNAME,a)||ns.Z.can(B.Plq.MANAGE_NICKNAMES,a)}));return(0,r.jsxs)(Xi,{title:x.Z.Messages.SERVER_NICKNAME,errors:t,children:[(0,r.jsx)(c.oil,{value:null!=s?s:"",placeholder:i,maxLength:B.l$U,onChange:function(e){t=e,n=o,(0,be.sr)(t===n||""===t&&null===n?void 0:t);var t,n},disabled:!l}),!l&&(0,r.jsx)(c.R94,{className:os().nicknameDisabled,type:c.R94.Types.DESCRIPTION,children:x.Z.Messages.CHANGE_IDENTITY_NICKNAME_PERMISSIONS_DISABLED})]})}var as=n(455706),ss=n(902322),cs=n.n(ss),ls=n(652951),us=n.n(ls),fs=n(207357),ds=n.n(fs);function ps(e){switch(e){case B.BRd.DARK:return us();case B.BRd.LIGHT:return ds()}}function hs(e){var t=e.user,n=e.showOverlay,i=e.children,a=(0,Uo.ZP)(),s=(0,Ui.Z)(!0).canEditThemes,l=(0,E.Z)($n.Z.PREMIUM_UPSELL_OVERLAY).analyticsLocations;o.useEffect((function(){n&&Dr.default.track(B.rMx.PREMIUM_UPSELL_VIEWED,{
location_stack:l,type:Br.cd.PREMIUM_GUILD_MEMBER_PROFILE_UPSELL_INLINE})}),[n,l]);return n?(0,r.jsxs)("div",{className:cs().upsellOverlayContainer,children:[(0,r.jsx)("div",{children:i}),(0,r.jsxs)("div",{className:cs().upsellOverlay,children:[(0,r.jsx)("img",{className:cs().upsellImage,alt:x.Z.Messages.GUILD_IDENTITY_UPSELL_OVERLAY_IMAGE_ALT,src:ps(a)}),(0,r.jsxs)("div",{className:cs().upsellTextContainer,children:[(0,r.jsx)(c.xvT,{variant:"text-lg/semibold",color:"always-white",children:x.Z.Messages.GUILD_IDENTITY_UPSELL_OVERLAY_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"always-white",children:s?x.Z.Messages.GUILD_IDENTITY_UPSELL_OVERLAY_DESCRIPTION_THEMES:x.Z.Messages.GUILD_IDENTITY_UPSELL_OVERLAY_DESCRIPTION})]}),(0,r.jsx)(as.Z,{size:c.zxk.Sizes.LARGE,color:c.zxk.Colors.GREEN,buttonText:Zr.ZP.isPremium(t)?x.Z.Messages.USER_SETTINGS_PROFILE_THEMES_UPSELL_UPGRADE:x.Z.Messages.CHANGE_IDENTITY_UPSELL,subscriptionTier:Br.Si.TIER_2})]})]}):(0,r.jsx)(r.Fragment,{children:i})
}var Es=n(850297),ys=n.n(Es);function ms(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function bs(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ms(i,r,o,a,s,"next",e)}function s(e){ms(i,r,o,a,s,"throw",e)}a(void 0)}))}}function gs(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Os(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){gs(e,t,n[t])}))}return e}function vs(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){
var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var _s=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0
;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Is(e){var t=e.user,n=e.onUpsellClick,i=(0,E.Z)().analyticsLocations;o.useEffect((function(){Dr.default.track(B.rMx.PREMIUM_UPSELL_VIEWED,{type:Br.cd.PREMIUM_GUILD_MEMBER_PROFILE_UPSELL_INLINE,location:{page:B.ZY5.GUILD_CHANNEL,section:B.jXE.PREMIUM_GUILD_MEMBER_PROFILE},location_stack:i})}),[i]);return(0,r.jsxs)("div",{className:ys().upsellContainer,children:[(0,r.jsx)(c.xvT,{variant:"text-sm/normal",children:x.Z.Messages.GUILD_IDENTITY_SETTINGS_UPSELL_NO_LINK}),(0,r.jsxs)(_a.C,{size:c.zxk.Sizes.SMALL,onClick:n,color:c.zxk.Colors.GREEN,className:ys().upsellButton,innerClassName:ys().upsellButtonInner,children:[(0,r.jsx)(kr.Z,{
className:ys().premiumIconButton}),Zr.ZP.isPremium(t)?x.Z.Messages.USER_SETTINGS_PROFILE_THEMES_UPSELL_UPGRADE:x.Z.Messages.CHANGE_IDENTITY_UPSELL]})]})}function Ss(e){var t=e.guild,o=(0,y.e7)([Lr.default],(function(){var e=Lr.default.getCurrentUser();L()(null!=e,"GuildIdentitySettingsPage: user cannot be undefined");return e})),i=(0,y.cj)([ge.Z],(function(){var e=ge.Z.getAllPending(),t=e.pendingAvatar,n=e.pendingNickname,r=e.pendingBio,o=e.pendingPronouns;return{pendingAvatar:t,pendingNickname:n,pendingBanner:e.pendingBanner,pendingBio:r,pendingPronouns:o,pendingThemeColors:e.pendingThemeColors,errors:ge.Z.getErrors(),guild:ge.Z.getGuild()}})),a=i.pendingAvatar,s=i.pendingNickname,l=i.pendingBanner,u=i.pendingBio,f=i.pendingPronouns,d=i.pendingThemeColors,p=i.errors,h=i.guild,E=null!=t?t:h;L()(null!=E,"guild should not be null");var m,b,g=(0,y.e7)([ri.ZP],(function(){return null==E.id?null:ri.ZP.getMember(E.id,o.id)})),O=(0,y.e7)([ea.Z],(function(){
return ea.Z.getGuildMemberProfile(o.id,E.id)})),v=Zr.ZP.canUsePremiumProfileCustomization(o),_=(0,la.gd)(a,null==g?void 0:g.avatar),I=(0,la.f$)(l,null==O?void 0:O.banner),S=function(e,t){return void 0===e?null!=t:null!=(null==e?void 0:e[0])&&null!=(null==e?void 0:e[1])}(d,null==O?void 0:O.themeColors),T=null!==(m=null==O?void 0:O.bio)&&void 0!==m?m:"",N=null!==(b=null==O?void 0:O.pronouns)&&void 0!==b?b:"",A=(0,Ui.Z)(!0).canEditThemes,C=ca.useExperiment({},{autoTrackExposure:!v}).showPremiumUpsellOverlay,P=function(e,t,n){n(null!=e?e:null!=t?null:void 0)};return(0,r.jsxs)("div",{className:ys().sectionsContainer,children:[(0,r.jsx)(is,{username:ci.ZP.getName(o),pendingNick:s,currentNick:null==g?void 0:g.nick,guild:E},"nick"),C||v?null:(0,r.jsx)(Is,{user:o,onUpsellClick:function(){return e={object:B.qAy.BUTTON_CTA},void(0,c.ZDy)(bs((function(){var t,o;return _s(this,(function(i){switch(i.label){case 0:return[4,n.e(47114).then(n.bind(n,247114))];case 1:t=i.sent(),o=t.default
;return[2,function(t){return(0,r.jsx)(o,Os({source:vs(Os({},e),{page:B.ZY5.GUILD_MEMBER_PROFILE_SETTINGS})},t))}]}}))})));var e}}),(0,r.jsxs)(hs,{user:o,showOverlay:C&&!v,children:[(0,r.jsx)(Aa,{sectionTitle:(0,r.jsxs)(r.Fragment,{children:[x.Z.Messages.USER_SETTINGS_AVATAR,(0,r.jsx)(c.ua7,{text:x.Z.Messages.PROFILE_CUSTOMIZATION_NITRO_ICON_TOOLTIP,children:function(e){return(0,r.jsx)(kr.Z,vs(Os({},e),{className:ys().nitroWheel}))}})]}),showRemoveAvatarButton:_,onAvatarChange:function(e){return P(e,null==g?void 0:g.avatar,be.I5)},errors:null==p?void 0:p.avatar,guildId:E.id,disabled:!v},"avatar"),(0,r.jsx)(Ra,{canUsePremiumCustomization:v,showRemoveBannerButton:I,errors:null==p?void 0:p.banner,upsellButton:null,onBannerChange:function(e){return P(e,null==O?void 0:O.banner,be.g_)},guildId:null==E?void 0:E.id,disabled:!v},"banner"),A&&(0,r.jsx)(Ja,{user:o,pendingAvatar:a,pendingColors:d,onThemeColorsChange:function(e){!function(e,t){
var n=null==(null==e?void 0:e[0])||null==(null==e?void 0:e[1]);(0,be.z5)(n&&null==t?void 0:e)}(e,null==O?void 0:O.themeColors)},guildId:null==E?void 0:E.id,showResetThemeButton:S}),(0,r.jsx)(ts,{sectionTitle:x.Z.Messages.USER_SETTINGS_PRONOUNS,errors:null==p?void 0:p.pronouns,onPronounsChange:function(e){!function(e,t){(0,be.ID)(e===t?void 0:e)}(e,N)},pendingPronouns:f,currentPronouns:N},"pronouns"),(0,r.jsx)(va,{placeholder:x.Z.Messages.CHANGE_IDENTITY_BIO_PLACEHOLDER,sectionTitle:(0,r.jsxs)(r.Fragment,{children:[x.Z.Messages.USER_PROFILE_ABOUT_ME,(0,r.jsx)(c.ua7,{text:x.Z.Messages.PROFILE_CUSTOMIZATION_NITRO_ICON_TOOLTIP,children:function(e){return(0,r.jsx)(kr.Z,vs(Os({},e),{className:ys().nitroWheel}))}})]}),onBioChange:function(e){!function(e,t){(0,be.Cf)(e===t?void 0:e)}(e,T);(0,be._V)(null!=e&&e.length>B.tPV)},errors:null==p?void 0:p.bio,pendingBio:u,currentBio:T,disabled:!v},"about")]})]})}var Ts=n(455469),Ns=n(552889),As=n(281728),Cs=n.n(As);function Ps(e){
var t=e.guildId,n=e.navigateToUserProfileSettings,i=(0,y.e7)([Ns.Z],(function(){return Ns.Z.getFlattenedGuildIds()})),a=(0,y.e7)([an.Z],(function(){return an.Z.getGuilds()})),s=(0,y.e7)([ge.Z],(function(){return ge.Z.showNotice()})),l=o.useMemo((function(){return i.map((function(e){var t=a[e];L()(null!=t,"guild should not be null");return{label:t.name,value:t.id}}))}),[i,a]),u=o.useCallback((function(e){return null==e?null:(0,r.jsx)(Kt.Z,{className:Cs().guildSelectOptionIcon,guild:a[e.value],size:Kt.Z.Sizes.SMOL,active:!0})}),[a]),f=function(e){var t=a[e];null!=t&&(0,be.HP)(t)};return(0,r.jsx)(Ts.$,{substeps:[Br.H6.PROFILE_CUSTOMIZATION_GUILD_PROFILES],onBack:function(){return n()},children:function(){return(0,r.jsx)(Xi,{className:Cs().section,title:x.Z.Messages.PROFILE_CUSTOMIZATION_GUILD_SELECT_TITLE,forcedDivider:!0,children:(0,r.jsx)(c.VcW,{isDisabled:s,onChange:f,value:t,options:l,renderOptionPrefix:u,placeholder:x.Z.Messages.PROFILE_CUSTOMIZATION_GUILD_SELECT_PLACEHOLDER})})}})}
function js(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Rs(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){js(i,r,o,a,s,"next",e)}function s(e){js(i,r,o,a,s,"throw",e)}a(void 0)}))}}function xs(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Ms(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){xs(e,t,n[t])}))}return e}function ws(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e)
;t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var Ds=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}
if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Zs(){Dr.default.track(B.rMx.PREMIUM_PROMOTION_OPENED,{location_page:B.ZY5.GUILD_MEMBER_PROFILE_SETTINGS,location_object:B.qAy.BADGE});(0,be.jR)();d.Z.open(B.oAB.PREMIUM)}function Ls(e){(0,c.ZDy)(Rs((function(){var t,o;return Ds(this,(function(i){switch(i.label){case 0:return[4,n.e(47114).then(n.bind(n,247114))];case 1:t=i.sent(),o=t.default;return[2,function(t){return(0,r.jsx)(o,Ms({source:ws(Ms({},e),{page:B.ZY5.GUILD_MEMBER_PROFILE_SETTINGS})},t))}]}}))})))}function Us(e){var t=e.selectedGuild,n=e.navigateToUserProfileSettings,i=(0,E.Z)($n.Z.GUILD_PROFILE).AnalyticsLocationProvider,a=(0,y.e7)([Lr.default],(function(){var e=Lr.default.getCurrentUser()
;L()(null!=e,"GuildIdentitySettingsPage: user cannot be undefined");return e})),s=(0,y.e7)([ea.Z],(function(){return!ea.Z.isFetchingProfile(a.id)})),u=(0,y.e7)([Rr.Z],(function(){return Rr.Z.hidePersonalInformation})),f=(0,y.cj)([ge.Z],(function(){var e=ge.Z.getAllPending(),t=e.pendingAvatar,n=e.pendingNickname,r=e.pendingBio,o=e.pendingPronouns;return{pendingAvatar:t,pendingNickname:n,pendingBanner:e.pendingBanner,pendingBio:r,pendingPronouns:o,pendingThemeColors:e.pendingThemeColors,source:ge.Z.getSource()}})),d=f.pendingAvatar,p=f.pendingNickname,h=f.pendingBanner,m=f.pendingBio,b=f.pendingPronouns,g=f.pendingThemeColors,O=f.source;o.useEffect((function(){return function(){return l.Z.wait(be.W3)}}),[]);o.useEffect((function(){null!=O&&Ao.ZP.trackWithMetadata(B.rMx.SETTINGS_PANE_VIEWED,{settings_type:"guild",destination_pane:B.jXE.SETTINGS_CUSTOMIZE_PROFILE,source:O})}),[O]);if(u)return(0,r.jsx)(Pt.Z,{});if(!s)return(0,r.jsx)(c.$jN,{})
;var v=Zr.ZP.canUsePremiumProfileCustomization(a),_={user:a,guild:t,canUsePremiumCustomization:v,onAvatarChange:be.I5,onBannerChange:be.g_,onUpsellClick:Ls,pendingAvatar:d,pendingBanner:h,pendingBio:m,pendingPronouns:b,pendingNickname:p,activityName:x.Z.Messages.CHANGE_IDENTITY_SERVER_PROFILE,activityCharacter:Do.PHIBI,openPremiumSettings:Zs};return(0,r.jsxs)(i,{children:[(0,r.jsx)(c.xvT,{variant:"text-sm/normal",children:x.Z.Messages.PROFILE_CUSTOMIZATION_GUILD_HINT.format({helpCenterLink:ta.Z.getArticleURL(B.BhN.GUILD_PROFILES)})}),null!=t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ps,{guildId:t.id,navigateToUserProfileSettings:n}),(0,r.jsx)(Ji,{previewTitle:x.Z.Messages.CHANGE_IDENTITY_PREVIEW_WITH_GUILD_NAME.format({guildName:null==t?void 0:t.name}),profilePreview:(0,r.jsx)(Di,ws(Ms({},_),{pendingThemeColors:g})),children:(0,r.jsx)(Ss,{})})]}):(0,r.jsx)(aa,{})]})}var ks,Gs=n(964262),Bs=n(725691),Hs=n(896490),Vs=n(30027),Fs=n(859853);function Ys(e,t,n){
t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var zs=Object.freeze((Ys(ks={},hr.KQ.ProfileCustomizationScrollPositions.TRY_IT_OUT,B.oAB.PROFILE_CUSTOMIZATION),Ys(ks,hr.KQ.AccessibilityScrollPositions.REDUCED_MOTION,B.oAB.ACCESSIBILITY),Ys(ks,hr.KQ.AccessibilityScrollPositions.SYNC_PROFILE_THEME_WITH_USER_THEME,B.oAB.ACCESSIBILITY),ks));const Ws=function(e,t){var n=(0,y.e7)([Te.Z],(function(){return Te.Z.useReducedMotion})),r=(0,y.e7)([xr.Z],(function(){return xr.Z.getScrollPosition()}));(0,o.useEffect)((function(){var o=e.current;if(null!=o&&t===r){var i=requestAnimationFrame((function(){o.scrollIntoView({behavior:n?"auto":"smooth"});d.Z.clearScrollPosition(zs[t])}));return function(){return cancelAnimationFrame(i)}}}),[e,t,r,n])};var Ks=n(173808),qs=n(474655),Xs=n.n(qs);function Qs(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function $s(e,t){t=null!=t?t:{}
;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Js(){Dr.default.track(B.rMx.PREMIUM_PROMOTION_OPENED,{location_page:B.ZY5.USER_SETTINGS,location_section:B.jXE.SETTINGS_ACCOUNT,location_object:B.qAy.BADGE});d.Z.setSection(B.oAB.PREMIUM)}function ec(e){var t=e.user,i=(0,Ui.Z)().canTryItOut,a=o.useContext(Fs.S).reducedMotion,s=Zr.ZP.isPremium(t),l=s?void 0:[{tooltip:x.Z.Messages.PREMIUM_BADGE_TOOLTIP.format({date:new Date}),onClick:Js,key:Si.Bm.PREMIUM}],u=(0,y.cj)([mo.Z],(function(){var e=mo.Z.getAllPending(),t=mo.Z.getErrors();return $s(function(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Qs(e,t,n[t])}))}return e}({},e,mo.Z.getAllTryItOut()),{errors:t})})),d=u.pendingAvatar,p=u.pendingBanner,h=u.pendingThemeColors,m=u.pendingPronouns,b=u.pendingBio,g=u.tryItOutThemeColors,O=u.tryItOutAvatar,v=u.tryItOutBanner,_=o.useRef(null);Ws(_,hr.Y_.TRY_IT_OUT);var I,S=(0,Yo.Z)(t.id),T=null==S?void 0:S.getPreviewBio(b),N=(0,E.Z)($n.Z.USER_SETTINGS_TRY_OUT_PREMIUM),A=N.AnalyticsLocationProvider,C=N.sourceAnalyticsLocations;o.useEffect((function(){Dr.default.track(B.rMx.PREMIUM_UPSELL_VIEWED,{type:Br.cd.PREMIUM_PROFILE_TRY_IT_OUT,location:{page:B.ZY5.USER_SETTINGS},location_stack:C})}),[C,t]);return(0,r.jsx)(A,{children:(0,r.jsx)(Yi,{ref:_,className:Xs().tryItOutSection,type:Zi.PREMIUM,isShown:!0,hasBackground:!0,children:(0,
r.jsx)(Ji,{layoutClassName:Xs().tryItOutLayout,previewTitle:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(kr.Z,{className:Xs().premiumIcon}),x.Z.Messages.USER_SETTINGS_TRY_OUT_PREMIUM_PREVIEW]}),profilePreview:(0,r.jsx)(Di,{user:t,onAvatarChange:lo.c_,onBannerChange:lo.f4,pendingPronouns:m,pendingBio:b,pendingBanner:null!==(I=null!=v?v:p)&&void 0!==I?I:n(276727),pendingAvatar:null!=O?O:d,pendingThemeColors:null!=g?g:h,avatarClassName:null!=O||null!=d||a.enabled?void 0:Xs().spinningAvatar,openPremiumSettings:Js,canUsePremiumCustomization:!0,isTryItOutFlow:!0,disabledInputs:!i,overrideDiscriminator:"0001",sampleBadgeList:l,hideExampleButton:!0,hideFakeActivity:Boolean(null==T?void 0:T.value)}),children:(0,r.jsxs)("div",{className:Xs().editor,children:[(0,r.jsx)(tc,{}),(0,r.jsx)(Ja,{className:Xs().customizationSection,user:t,pendingAvatar:null!=O?O:d,pendingColors:null!=g?g:h,onThemeColorsChange:lo.rf,showPremiumIcon:!1,preventDisabled:i}),(0,r.jsx)(Ra,{className:Xs().customizationSection,
disabled:!i,canUsePremiumCustomization:!0,isTryItOutFlow:!0,showRemoveBannerButton:null!=v,upsellButton:null,onBannerChange:lo.f4,showPremiumIcon:!1}),(0,r.jsx)(Aa,{className:Xs().customizationSection,disabled:!i,isTryItOutFlow:!0,onAvatarChange:lo.c_,showRemoveAvatarButton:!1,changeAvatarButtonText:x.Z.Messages.USER_SETTINGS_ADD_ANIMATED_AVATAR,sectionTitle:x.Z.Messages.PREMIUM_TIER_0_FEATURE_AVATAR}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:Xs().premiumPerksListTitle,children:x.Z.Messages.USER_SETTINGS_TRY_OUT_PREMIUM_ALSO_INCLUDES}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",children:(0,r.jsxs)("ul",{className:Xs().premiumPerksList,children:[(0,r.jsx)("li",{children:x.Z.Messages.USER_SETTINGS_TRY_OUT_PREMIUM_CUSTOM_TAG}),(0,r.jsx)("li",{children:x.Z.Messages.USER_SETTINGS_TRY_OUT_PREMIUM_EXCLUSIVE_BADGE})]})}),(0,r.jsx)(as.Z,{onSubscribeModalClose:function(e){if(e){(0,f.I5)(O);(0,lo.g_)(v);(0,lo.z5)(g)}},subscriptionTier:Br.Si.TIER_2,className:Xs().premiumSubscribeButton,
size:c.zxk.Sizes.MEDIUM,buttonText:s?x.Z.Messages.USER_SETTINGS_PROFILE_THEMES_UPSELL_UPGRADE:x.Z.Messages.PREMIUM_UPSELL_GET_NITRO})]})})})})}var tc=function(){return(0,Ui.Z)().canTryItOut?(0,r.jsxs)("div",{children:[(0,r.jsx)(c.X6q,{variant:"heading-xl/extrabold",children:x.Z.Messages.USER_SETTINGS_TRY_OUT_PREMIUM_HEADER}),(0,r.jsx)(c.xvT,{className:Xs().description,variant:"text-sm/normal",children:x.Z.Messages.USER_SETTINGS_TRY_OUT_PREMIUM_DESCRIPTION})]}):(0,r.jsxs)("div",{className:Xs().titleContainer,children:[(0,r.jsx)(Ks.Z,{className:Xs().titleIcon}),(0,r.jsx)(c.X6q,{variant:"heading-md/extrabold",children:x.Z.Messages.PREMIUM_FEATURES_PROFILE_CUSTOMIZATION_MENU_ITEM_TITLE})]})};n(698544);function nc(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function rc(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){nc(i,r,o,a,s,"next",e)}function s(e){
nc(i,r,o,a,s,"throw",e)}a(void 0)}))}}function oc(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function ic(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){oc(e,t,n[t])}))}return e}function ac(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var sc=function(e,t){var n,r,o,i,a={label:0,
sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{
value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function cc(){(0,c.ZDy)(rc((function(){var e,t;return sc(this,(function(o){switch(o.label){case 0:return[4,n.e(92189).then(n.bind(n,92189))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,ac(ic({},e),{source:{page:B.ZY5.USER_SETTINGS,section:B.jXE.SETTINGS_CUSTOMIZE_PROFILE,object:B.qAy.BUTTON_CTA,type:B.Qqv.BUY}}))}]}}))})))}var lc=n(699260),uc=n.n(lc);function fc(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function dc(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){fc(i,r,o,a,s,"next",e)}function s(e){fc(i,r,o,a,s,"throw",e)}a(void 0)}))}}function pc(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var hc=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),
return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Ec(e){(0,c.ZDy)(dc((function(){var t,o
;return hc(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(25812)]).then(n.bind(n,825812))];case 1:t=i.sent(),o=t.default;return[2,function(t){return(0,r.jsx)(o,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){pc(e,t,n[t])}))}return e}({analyticsLocations:e},t))}]}}))})))}function yc(e){var t=e.user,n=(0,Go.U)().canUseAvatarDecorations,i=(0,y.e7)([mo.Z],(function(){return mo.Z.getPendingAvatarDecoration()})),a=(0,y.e7)([mo.Z],(function(){return mo.Z.getErrors()})).avatarDecoration,s=(0,E.Z)().analyticsLocations,l=Zr.ZP.canUsePremiumProfileCustomization(t);o.useEffect((function(){n&&!l&&Dr.default.track(B.rMx.PREMIUM_UPSELL_VIEWED,{type:Br.cd.AVATAR_DECORATIONS_INLINE_SETTINGS,location_stack:s})}),[n,l,s])
;if(!n)return null;var u=void 0===i?null!=t.avatarDecoration:null!=i;return(0,r.jsx)(Xi,{showBorder:!0,borderType:Zi.PREMIUM,hasBackground:!0,title:x.Z.Messages.USER_SETTINGS_AVATAR_DECORATION,description:l?x.Z.Messages.AVATAR_DECORATION_SPRING_2023_SETTINGS_DESCRIPTION:x.Z.Messages.AVATAR_DECORATIONS_SPRING_2023_SETTINGS_DESCRIPTION_NON_PREMIUM,showPremiumIcon:!0,titleIcon:(0,r.jsx)(tn.F8,{}),errors:a,children:(0,r.jsxs)("div",{className:uc().buttonsContainer,children:[(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,onClick:function(){return Ec(s)},children:x.Z.Messages.USER_SETTINGS_CHANGE_AVATAR_DECORATION}),u&&(0,r.jsx)(c.zxk,{className:uc().removeButton,color:c.zxk.Colors.PRIMARY,look:c.zxk.Looks.LINK,size:c.zxk.Sizes.SMALL,onClick:function(){(0,la.PO)(null,t.avatarDecoration)},children:x.Z.Messages.USER_SETTINGS_REMOVE_AVATAR_DECORATION})]})})}function mc(e){var t,n;return(0,r.jsx)(Xi,{errors:e.errors,disabled:e.disabled,title:x.Z.Messages.USER_SETTINGS_DISPLAY_NAME_TITLE,children:(0,
r.jsx)("div",{children:(0,r.jsx)(c.oil,{placeholder:e.placeholder,maxLength:B.JuI,onChange:e.onGlobalNameChange,value:null!==(n=null!==(t=e.pendingGlobalName)&&void 0!==t?t:e.currentGlobalName)&&void 0!==n?n:""})})})}function bc(e){var t,n=e.user,o=e.savedUserColor,i=e.pendingColor,a=e.setPendingAccentColor,l=n.getAvatarURL(null,80),u=(0,c.dQu)(s.Z.unsafe_rawColors.PRIMARY_530).hex(),f=(0,ko.Cf)(l,u,!1),d=(0,Lo._i)(f[0]);return(0,r.jsx)(Xi,{title:x.Z.Messages.USER_SETTINGS_BANNER_COLOR_TITLE,children:(0,r.jsx)(Ka,{onChange:function(e){return a(e)},color:null!==(t=null!=i?i:o)&&void 0!==t?t:d,suggestedColors:f,showEyeDropper:!0})})}var gc=n(943705),Oc=n.n(gc);function vc(e){var t=e.user,n=e.children,i=(0,Ui.Z)(!0),a=i.canEditThemes,s=i.canViewTryItOut,l=Zr.ZP.canUsePremiumProfileCustomization(t),u=(0,E.Z)($n.Z.PROFILE_THEME_UPSELL_INLINE),f=u.AnalyticsLocationProvider,d=u.sourceAnalyticsLocations;o.useEffect((function(){l||!a||s||Dr.default.track(B.rMx.PREMIUM_UPSELL_VIEWED,{
type:Br.cd.PROFILE_THEME_UPSELL_INLINE,location_stack:d})}),[d,l,a,s]);return!a||l||s?(0,r.jsx)(r.Fragment,{children:n}):(0,r.jsxs)(f,{children:[(0,r.jsxs)(Yi,{className:Oc().upsellBorder,isShown:!0,type:Zi.PREMIUM,children:[(0,r.jsxs)("div",{className:Oc().inlineUpsell,children:[(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,children:x.Z.Messages.USER_SETTINGS_PROFILE_THEMES_INLINE_UPSELL}),(0,r.jsx)(as.Z,{subscriptionTier:Br.Si.TIER_2,className:Oc().premiumSubscribeButton,size:c.zxk.Sizes.SMALL,buttonText:Zr.ZP.isPremium(t)?x.Z.Messages.USER_SETTINGS_PROFILE_THEMES_UPSELL_UPGRADE:x.Z.Messages.USER_SETTINGS_CUSTOMIZATION_UPSELL})]}),n]}),(0,r.jsx)("div",{className:Oc().divider})]})}var _c=n(788176),Ic=n.n(_c);function Sc(e){var t=e.user,n=(0,E.Z)().analyticsLocations,i=Zr.ZP.isPremium(t)?x.Z.Messages.USER_SETTINGS_CUSTOMIZATION_UPGRADE_UPSELL:x.Z.Messages.USER_SETTINGS_CUSTOMIZATION_UPSELL;o.useEffect((function(){Dr.default.track(B.rMx.PREMIUM_UPSELL_VIEWED,{
type:Br.cd.CUSTOM_PROFILE_SETTINGS_BANNER_BUTTON,location:{page:B.ZY5.USER_SETTINGS,section:B.jXE.SETTINGS_CUSTOMIZE_PROFILE,object:B.qAy.BUTTON_CTA},location_stack:n})}),[n]);return(0,r.jsxs)(_a.C,{color:c.zxk.Colors.GREEN,onClick:cc,innerClassName:Ic().premiumUpsellButtonInner,children:[(0,r.jsx)(kr.Z,{className:Ic().premiumUpsellButtonWheel}),i]})}var Tc=n(142771),Nc=n.n(Tc);function Ac(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Cc(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Pc(e){var t,n,o=(0,
y.e7)([Lr.default],(function(){var e=Lr.default.getCurrentUser();L()(null!=e,"DefaultCustomizationSections: user cannot be undefined");return e})),i=(0,y.e7)([ea.Z],(function(){return ea.Z.getUserProfile(o.id)})),a=(0,y.cj)([mo.Z],(function(){var e=mo.Z.getAllPending(),t=mo.Z.getErrors();return Cc(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Ac(e,t,n[t])}))}return e}({},e),{errors:t})})),s=a.pendingAvatar,c=a.pendingGlobalName,l=a.pendingBanner,u=a.pendingBio,d=a.pendingPronouns,p=a.pendingAccentColor,h=a.pendingThemeColors,E=a.errors,m=Zr.ZP.canUsePremiumProfileCustomization(o),b=(0,la.gd)(s,o.avatar),g=(0,la.f$)(l,null==i?void 0:i.banner),O=(0,Ui.Z)(!0),v=O.canEditThemes,_=!O.canViewTryItOut||m,I=(0,ti.rW)();return(0,
r.jsxs)("div",{className:Nc().sectionsContainer,children:[I&&(0,r.jsx)(mc,{placeholder:o.username,errors:E.global_name,currentGlobalName:o.globalName,pendingGlobalName:c,onGlobalNameChange:f.UZ}),(0,r.jsx)(Ts.$,{substeps:[Br.H6.PROFILE_CUSTOMIZATION_AVATAR],children:function(e){return(0,r.jsx)(Aa,{onAvatarChange:f.I5,showRemoveAvatarButton:b,errors:E.avatar,sectionTitle:x.Z.Messages.USER_SETTINGS_AVATAR,forcedDivider:!0,withHighlight:e},"avatar")}}),(0,r.jsx)(yc,{user:o},"decoration"),(0,r.jsxs)(vc,{user:o,children:[_&&(0,r.jsx)(Ts.$,{substeps:[Br.H6.PROFILE_CUSTOMIZATION_BANNER],children:function(e){return(0,r.jsx)(Ra,{canUsePremiumCustomization:m,showRemoveBannerButton:g,errors:E.banner,upsellButton:(0,r.jsx)(Sc,{user:o}),onBannerChange:lo.g_,disabled:!m&&v,forcedDivider:!0,withHighlight:e},"banner")}}),v&&_&&(0,r.jsx)(Ts.$,{substeps:[Br.H6.PROFILE_CUSTOMIZATION_THEME],onNext:function(){return e.navigateToGuildIdentitySettings()},children:function(){return(0,r.jsx)(Ja,{user:o,
pendingAvatar:s,pendingColors:h,onThemeColorsChange:lo.z5,forcedDivider:!0})}})]}),(!m||!v)&&(0,r.jsx)(bc,{user:o,savedUserColor:null==i?void 0:i.accentColor,pendingColor:p,setPendingAccentColor:lo.CM},"color"),(0,r.jsx)(ts,{sectionTitle:x.Z.Messages.USER_SETTINGS_PRONOUNS,errors:E.pronouns,onPronounsChange:lo.ID,pendingPronouns:d,currentPronouns:null!==(t=null==i?void 0:i.pronouns)&&void 0!==t?t:""},"pronouns"),(0,r.jsx)(va,{sectionTitle:x.Z.Messages.USER_SETTINGS_ABOUT_ME,errors:E.bio,onBioChange:function(e){(0,la.xQ)(e,null==i?void 0:i.bio);(0,f._V)(null!=e&&e.length>B.tPV)},pendingBio:u,currentBio:null!==(n=null==i?void 0:i.bio)&&void 0!==n?n:""},"bio")]})}var jc=n(458947);function Rc(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function xc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Rc(e,t,n[t])}))}return e}function Mc(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function wc(){Dr.default.track(B.rMx.PREMIUM_PROMOTION_OPENED,{location_page:B.ZY5.USER_SETTINGS,location_section:B.jXE.SETTINGS_ACCOUNT,location_object:B.qAy.BADGE});d.Z.setSection(B.oAB.PREMIUM)}function Dc(e){var t,n,i=(0,y.e7)([Lr.default],(function(){var e=Lr.default.getCurrentUser()
;L()(null!=e,"UserSettingsProfileCustomization: user cannot be undefined");return e})),s=(0,y.e7)([Rr.Z],(function(){return Rr.Z.hidePersonalInformation})),c=(0,y.cj)([mo.Z],(function(){var e=mo.Z.getAllPending(),t=mo.Z.getErrors();return Mc(xc({},e),{errors:t})})),u=c.pendingAvatar,d=c.pendingBanner,p=c.pendingBio,h=c.pendingPronouns,m=c.pendingGlobalName,b=c.pendingAccentColor,g=c.pendingAvatarDecoration,O=c.pendingThemeColors,v=ni.dN.useSetting()&&null!=p?Vs.ZP.parse(void 0,p).content:p,_=Zr.ZP.canUsePremiumProfileCustomization(i);t=(0,Go.U)().canUseAvatarDecorations,n=(0,Hs.wE)(a.z$.AVATAR_DECORATIONS_SPRING_2023_SETTINGS_NEW_BADGE),o.useEffect((function(){t&&!n&&(0,Hs.EW)(a.z$.AVATAR_DECORATIONS_SPRING_2023_SETTINGS_NEW_BADGE,{dismissAction:jc.L.AUTO,forceTrack:!0})}),[t,n]);var I=(0,E.Z)($n.Z.PROFILE).AnalyticsLocationProvider,S={user:i,canUsePremiumCustomization:_,onUpsellClick:cc,onAvatarChange:f.I5,onBannerChange:lo.g_,pendingBanner:d,pendingBio:v,pendingPronouns:h,
pendingAvatar:u,pendingGlobalName:m,pendingAvatarDecoration:g,openPremiumSettings:wc};o.useEffect((function(){return function(){return l.Z.wait(f.W3)}}),[]);return s?(0,r.jsx)(Pt.Z,{}):(0,r.jsx)(I,{children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ji,{profilePreview:(0,r.jsx)(Di,Mc(xc({},S),{pendingThemeColors:O,pendingAccentColor:b})),children:(0,r.jsx)(Pc,{navigateToGuildIdentitySettings:e.navigateToGuildIdentitySettings})}),!Zr.ZP.canUsePremiumProfileCustomization(i)&&(0,r.jsx)(ec,{user:i})]})})}var Zc=n(464187),Lc=n(441694),Uc=n.n(Lc);function kc(){var e=function(e){if(f!==e)if(s){je.S.dispatch(B.CkL.SHAKE_APP,{duration:300,intensity:No.$x});je.S.dispatch(B.CkL.EMPHASIZE_NOTICE)}else{e===hr.NB.GUILD&&null==n&&null!=l&&(0,be.Fq)(l,m);d.Z.setSection(B.oAB.PROFILE_CUSTOMIZATION,e)}},t=(0,y.e7)([Ns.Z],(function(){return Ns.Z.getFlattenedGuildIds()})),n=(0,y.e7)([ge.Z],(function(){return ge.Z.getGuild()})),i=(0,y.e7)([Zc.Z],(function(){return Zc.Z.getGuildId()})),a=(0,
y.e7)([an.Z],(function(){return an.Z.getGuild(null!=i?i:t[0])})),s=(0,y.e7)([ge.Z,mo.Z],(function(){return ge.Z.showNotice()||mo.Z.showNotice()})),l=null!=n?n:a,u=(0,y.e7)([Lr.default],(function(){return Lr.default.getCurrentUser()})),f=(0,y.e7)([xr.Z],(function(){var e;return null!==(e=xr.Z.getSubsection())&&void 0!==e?e:hr.NB.USER_PROFILE})),p=(0,E.Z)(),h=p.AnalyticsLocationProvider,m=p.analyticsLocations;o.useEffect((function(){null!=u&&(0,Bs.Z)(u.id,u.getAvatarURL(null==l?void 0:l.id,80),{guildId:null==l?void 0:l.id})}),[null==l?void 0:l.id,u]);o.useEffect((function(){return function(){(0,Gs.RI)(Br.QD.PROFILE_CUSTOMIZATION)}}),[]);return(0,r.jsx)(h,{children:(0,r.jsxs)(c.y5t,{component:(0,r.jsx)(c.X6q,{variant:"heading-lg/semibold",children:x.Z.Messages.USER_SETTINGS_PROFILES}),children:[(0,r.jsxs)(c.njP,{className:Uc().tabBar,type:"top",look:"brand",selectedItem:f,onItemSelect:e,children:[(0,r.jsx)(c.njP.Item,{className:Uc().tabBarItem,id:hr.NB.USER_PROFILE,
children:x.Z.Messages.EDIT_PROFILE_CATEGORY_USER_PROFILE},hr.NB.USER_PROFILE),(0,r.jsx)(c.njP.Item,{className:Uc().tabBarItem,id:hr.NB.GUILD,children:x.Z.Messages.EDIT_PROFILE_CATEGORY_GUILD_IDENTITY},hr.NB.GUILD)]}),function(){switch(f){case hr.NB.GUILD:return(0,r.jsx)(Us,{selectedGuild:l,navigateToUserProfileSettings:function(){return e(hr.NB.USER_PROFILE)}});case hr.NB.USER_PROFILE:default:return(0,r.jsx)(Dc,{navigateToGuildIdentitySettings:function(){return e(hr.NB.GUILD)}})}}()]})})}var Gc=n(440031),Bc=n(736097),Hc=n(304275),Vc=n(633531),Fc=n(265367),Yc=n(120415);const zc=(0,sa.B)({kind:"user",id:"2022-06_auth_sessions_user_settings",label:"Auth Sessions User Settings",defaultConfig:{showSettings:!1},treatments:[{id:1,label:"Show settings",config:{showSettings:!0}}]});var Wc=n(131795),Kc=n.n(Wc),qc=n(92246),Xc=n.n(qc);function Qc(){
var e,t,n,o=window.GLOBAL_ENV.RELEASE_CHANNEL,i=null===(e="1a94d36828074e475cae00d483d7680c6c96e345")?void 0:e.substring(0,7),a=null===q.Z||void 0===q.Z?void 0:q.Z.remoteApp.getVersion(),s=null===(t=null===q.Z||void 0===q.Z?void 0:q.Z.remoteApp.getBuildNumber)||void 0===t?void 0:t(),l=null===Kc()||void 0===Kc()||null===(n=Kc().os)||void 0===n?void 0:n.toString(),u=null!=q.Z?"(".concat(q.Z.os.release,")"):null;return(0,r.jsxs)("div",{className:Xc().info,children:[(0,r.jsxs)(c.xvT,{tag:"span",className:Xc().line,variant:"text-xs/normal",color:"text-muted",children:[o," ","184344"," ",(0,r.jsxs)("span",{className:Xc().versionHash,children:["(",i,")"]})]})," ",null!=a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(c.xvT,{tag:"span",className:Xc().line,variant:"text-xs/normal",color:"text-muted",children:["Host ",a," ",null!=s?(0,r.jsxs)("span",{children:["(",s,")"]}):null]})," "]}):null,null!=l?(0,r.jsxs)(c.xvT,{tag:"span",className:Xc().line,variant:"text-xs/normal",color:"text-muted",
children:[l," ",u]}):null]})}var $c=n(422513),Jc=n(621329),el=n(189865),tl=n(145187),nl=n.n(tl);function rl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ol(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return rl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rl(e,t)}(e,t)||function(){
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function il(e){var t=e.hotspotLocation,n=ol((0,y.Wu)([$c.qc],(function(){return[$c.qc.hasHotspot(t,!0),$c.qc.getHotspotOverride(t)]})),2),o=n[0],i=n[1];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(c.xJW,{title:t,className:nl().hotspotSwitch,children:[o?(0,r.jsx)(c.DY3,{className:nl().iconContainer,element:"span",text:"Active",children:(0,r.jsx)(Jc.Z,{className:nl().checkmark})}):(0,r.jsx)(c.DY3,{className:nl().iconContainer,element:"span",text:"Inactive",children:(0,r.jsx)(el.Z,{className:nl().xmark})}),(0,r.jsx)(c.q4e,{className:nl().overrideSelect,value:i,options:[{value:void 0,label:"No Override"},{value:!0,label:"Force Active"},{value:!1,label:"Force Inactive"}],onChange:function(e){return null!=e?(0,$c.hv)(t,e):(0,$c.Po)(t)}})]}),(0,r.jsx)(c.$i$,{})]})}function al(e){var t=e.className;return(0,r.jsxs)(c.hjN,{
title:"Hotspots",tag:c.RB0.H1,className:t,children:[(0,r.jsx)(c.xvT,{className:nl().helpText,tag:"p",variant:"text-sm/normal",children:'All the "hotspots" in app, and their current status. Use the select menu to override them on or off.'}),Object.keys($c.v6).sort((function(e,t){return e.localeCompare(t)})).map((function(e){return(0,r.jsx)(il,{hotspotLocation:e},e)}))]})}var sl=n(817673),cl=n(594302),ll=n(604160),ul=n(436145),fl=n(799990),dl=n.n(fl);function pl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hl(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function El(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){hl(e,t,n[t])
}))}return e}function yl(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function ml(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return pl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1)
;"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pl(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const bl=function(){var e=ml(o.useState(Br.Si.TIER_2),2),t=e[0],n=e[1],i=ml((0,y.Wu)([an.Z],(function(){return[an.Z.getGuilds()]})),1)[0],s=ml((0,y.Wu)([Rt.Z],(function(){return[Rt.Z.getPremiumSubscription()]})),1)[0],l=Object.values(i).map((function(e){return{value:e,label:e.name}})),u=ml(o.useState(l.length>0?l[0].value:null),2),f=u[0],d=u[1],p=ml(o.useState(""),2),h=p[0],m=p[1],b=ml(o.useState({plan_id:Br.Xh.PREMIUM_MONTH_TIER_2,gift:"true"}),2),g=b[0],O=b[1],v="true"!==g.gift&&null!=s,_=ml(o.useState(l.length>0?l[0].value:null),2),I=_[0],S=_[1],T=(0,
E.Z)($n.Z.PAYMENT_FLOW_TEST_PAGE),N=T.AnalyticsLocationProvider,A=T.analyticsLocations;(0,Un.tT)(null==I?void 0:I.id);var C=(0,Un.GG)(null==I?void 0:I.id),P=o.useMemo((function(){return null==I?[]:C.filter((function(e){return null!=e.subscription_listings&&e.subscription_listings.map((function(e){return e.published})).includes(!0)}))}),[C,I]);return(0,r.jsx)(N,{children:(0,r.jsxs)(c.hjN,{title:"Payment Flow Modals",tag:c.RB0.H1,children:[(0,r.jsx)(c.vwX,{children:"Gift"}),(0,r.jsxs)(c.xJW,{className:dl().formItem,children:[(0,r.jsx)(c.q4e,{value:t,options:[{value:Br.Si.TIER_2,label:"Nitro"},{value:Br.Si.TIER_1,label:"Nitro Classic"},{value:Br.Si.TIER_0,label:"Nitro Basic"}],onChange:function(e){return n(e)}}),(0,r.jsx)(as.Z,{subscriptionTier:t,isGift:!0,premiumModalAnalyticsLocation:{}})]}),(0,r.jsx)(c.$i$,{className:dl().formDivider}),(0,r.jsx)(c.vwX,{children:"Premium Select Plan"}),(0,r.jsx)(c.xJW,{className:dl().formItem,children:(0,r.jsx)(c.zxk,{onClick:function(){return(0,ll.Z)({
analyticsLocations:A})},children:"Select Plan"})}),(0,r.jsx)(c.$i$,{className:dl().formDivider}),(0,r.jsx)(c.vwX,{children:"Boost"}),(0,r.jsxs)(c.xJW,{className:dl().formItem,children:[(0,r.jsx)(c.q4e,{value:f,options:l,onChange:function(e){return d(e)}}),null!=f?(0,r.jsx)(cl.Z,{guild:f,analyticsLocation:{}}):(0,r.jsx)("div",{children:"No Guild to boost"})]}),(0,r.jsx)(c.$i$,{className:dl().formDivider}),(0,r.jsxs)(c.vwX,{children:[(0,r.jsx)("div",{children:"Standalone: Trial Promotion Redemption"}),(0,r.jsx)(c.eee,{href:"https://i.dis.gd/createPromo",children:"How to create promotion"})]}),(0,r.jsxs)(c.xJW,{className:dl().formItem,children:[(0,r.jsx)(c.oil,{placeholder:"Promotion Code",value:h,onChange:function(e){return m(e)}}),(0,r.jsx)(c.ua7,{text:"Need Promotion Code",shouldShow:h.length<1,children:function(e){var t=e.onMouseEnter,n=e.onMouseLeave;return(0,r.jsx)(c.zxk,{disabled:h.length<1,onMouseEnter:t,onMouseLeave:n,onClick:function(){
window.open(B.Z5c.BILLING_PROMOTION_REDEMPTION(h))},children:"Open Link"})}})]}),(0,r.jsx)(c.$i$,{className:dl().formDivider}),(0,r.jsx)(c.vwX,{children:"Standalone: Gift/Subscription Purchase"}),(0,r.jsxs)(c.xJW,{className:dl().formItem,children:[(0,r.jsx)(c.q4e,{value:g.plan_id,options:[{value:Br.Xh.PREMIUM_MONTH_TIER_2,label:"Nitro"},{value:Br.Xh.PREMIUM_MONTH_TIER_1,label:"Nitro Classic"},{value:Br.Xh.PREMIUM_MONTH_TIER_0,label:"Nitro Basic"}],onChange:function(e){return O((function(t){return yl(El({},t),{plan_id:e})}))}}),(0,r.jsx)(c.q4e,{value:g.gift,options:[{value:"true",label:"Gift"},{value:"false",label:"Not Gift"}],onChange:function(e){return O((function(t){return yl(El({},t),{gift:e})}))}}),(0,r.jsx)(c.ua7,{text:"Already subscribed",shouldShow:v,children:function(e){var t=e.onMouseEnter,n=e.onMouseLeave;return(0,r.jsx)(c.zxk,{onMouseLeave:n,onMouseEnter:t,disabled:v,onClick:function(){window.open(B.Z5c.BILLING_PREMIUM_SUBSCRIBE+"?"+sl.stringify(El({},g)))},
children:"Open Link"})}})]}),(0,r.jsx)(c.$i$,{className:dl().formDivider}),(0,r.jsx)(c.vwX,{children:"Creator Revenue"}),(0,r.jsxs)(c.xJW,{className:dl().formItem,children:[(0,r.jsx)(c.xvT,{className:dl().guildServerDescription,variant:"text-sm/normal",children:"Premium Server Subscription For"}),(0,r.jsx)(c.q4e,{value:I,options:l,onChange:function(e){return S(e)}})]}),null!=I?(0,r.jsx)("div",{className:dl().formItem,children:P.map((function(e){return e.subscription_listings_ids.map((function(t){return(0,r.jsx)(er.Z,{guildId:I.id,groupListingId:e.id,listingId:t},t)}))}))}):null,(0,r.jsx)(c.$i$,{className:dl().formDivider}),(0,r.jsx)(c.vwX,{children:"Helpers"}),(0,r.jsxs)(c.xJW,{className:dl().formItem,children:[(0,r.jsx)(c.zxk,{onClick:function(){return(0,Ct.mE)()},children:"Reset SubscriptionPlanStore"}),(0,r.jsx)(c.zxk,{onClick:function(){return(0,Tt.GM)()},children:"Reset SubscriptionStore"})]}),(0,r.jsx)(c.$i$,{className:dl().formDivider}),(0,r.jsx)(c.vwX,{
children:"Premium Tutorial"}),(0,r.jsxs)(c.xJW,{className:dl().formItem,children:[(0,r.jsx)(c.zxk,{onClick:function(){return(0,ul.Rr)()},children:"Reset PremiumTutorialStore"}),(0,r.jsx)(c.zxk,{onClick:function(){(0,oe.w9)(Br.QD.CUSTOM_EMOJI);(0,oe.w9)(Br.QD.BOOSTING);(0,oe.w9)(Br.QD.PROFILE_CUSTOMIZATION);(0,oe.w9)(a.z$.PREMIUM_TUTORIAL_FILE_UPLOAD_COMPOSER_TOOLTIP);(0,oe.w9)(a.z$.PREMIUM_TUTORIAL_STICKER_PICKER_COMPOSER_TOOLTIP);(0,oe.w9)(a.z$.PREMIUM_TUTORIAL_EMOJI_PICKER_COMPOSER_TOOLTIP);(0,oe.w9)(a.z$.PREMIUM_TUTORIAL_SERVER_MENU_TOOLTIP)},children:"Reset all tutorials"}),(0,r.jsx)(c.zxk,{onClick:function(){(0,Se.xf)();(0,zn.uL)(B.Z5c.APPLICATION_STORE);(0,ul.HY)(!0);(0,ul.Dd)(!0);je.S.dispatch(B.CkL.PREMIUM_SUBSCRIPTION_CREATED)},children:"Toggle Wow Moment"})]})]})})};var gl=n(112184),Ol=n(319463),vl=n(750349),_l=n(313197),Il=n(474816),Sl=n.n(Il),Tl={offset:{top:-8}};function Nl(){return(0,r.jsxs)("div",{className:Sl().socialLinks,children:[(0,r.jsx)(c.eee,{target:"_blank",
tabIndex:-1,rel:"author",title:"Twitter",href:(0,gl.Z)(B.RK.TWITTER),className:Sl().link,focusProps:Tl,children:(0,r.jsx)(_l.Z,{foreground:Sl().foreground,"aria-hidden":!0})}),(0,r.jsx)(c.eee,{target:"_blank",rel:"author",title:"Facebook",tabIndex:-1,href:B.fK7.FACEBOOK_URL,className:Sl().link,focusProps:Tl,children:(0,r.jsx)(Ol.Z,{foreground:Sl().foreground,"aria-hidden":!0})}),(0,r.jsx)(c.eee,{target:"_blank",rel:"author",title:"Instagram",tabIndex:-1,href:B.fK7.INSTAGRAM_URL,className:Sl().link,focusProps:Tl,children:(0,r.jsx)(vl.Z,{foreground:Sl().foreground,"aria-hidden":!0})})]})}var Al=n(710432);function Cl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Pl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value)
;if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Cl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cl(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jl(){var e=Pl(o.useState(""),2),t=e[0],n=e[1];return(0,r.jsxs)(c.hjN,{title:"Text components",tag:c.RB0.H1,children:[(0,r.jsx)(c.oil,{placeholder:"Enter custom text...",onChange:function(e){return n(e)}}),(0,r.jsx)(c.$i$,{style:{margin:"10px 0"}}),Al.O.map((function(e){return"code"===e?null:(0,r.jsx)(c.xvT,{variant:e,children:""!==t?"".concat(t," (").concat(e,")"):e},e)}))]})}
var Rl=(0,sa.B)({kind:"user",id:"2023-03_text_playground_settings_pane",label:"Text Playground",defaultConfig:{showSetting:!1},treatments:[{id:1,label:"Enable settings pane",config:{showSetting:!0}}]});function xl(){return Rl.getCurrentConfig({},{autoTrackExposure:!0}).showSetting}var Ml=n(145800),wl=n(770272),Dl=n(863715),Zl=n(945235),Ll=n(649536),Ul=n(358624),kl=n(550131),Gl=n(219369),Bl=n(247530);function Hl(e){switch(e){case Bl.mX.REDUCED_MOTION:return x.Z.Messages.ACCESSIBILITY_REDUCED_MOTION_SETTINGS_OVERRIDE.format();case Bl.mX.REDUCED_MOTION_STICKERS:return x.Z.Messages.STICKERS_AUTO_PLAY_HELP_DISABLED;default:return}}var Vl=n(307648),Fl=n(813216),Yl=n(222641),zl=n(701190),Wl=n(63011),Kl=n(851114),ql=n(719833),Xl=n(938058),Ql=n(356775),$l=n.n(Ql),Jl=n(603008),eu=n.n(Jl);function tu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nu(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0
}):e[t]=n;return e}function ru(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){nu(e,t,n[t])}))}return e}function ou(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function iu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){
var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return tu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var au=(0,Jt.hQ)(),su=(0,Jt.hQ)(),cu=(0,Jt.hQ)(),lu=_e().debounce((function(e){(0,wl.o2)(e)}),250),uu=_e().debounce((function(e){(0,Vl.Ct)(e)}),250);function fu(e){var t=Dl.Z.useExperiment({},{autoTrackExposure:!0}).allowRoleStyles,n=(0,Ui.Z)().canViewThemes;return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,
title:x.Z.Messages.ACCESSIBILITY,children:[(0,r.jsx)(du,{}),(0,r.jsx)(pu,{}),(0,r.jsx)(c.$i$,{}),(0,r.jsx)(hu,{}),t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Eu,{}),(0,r.jsx)(c.$i$,{className:fe().marginTop20})]}):null,n?(0,r.jsx)(yu,{}):null,(0,Zl.b)()?(0,r.jsx)(mu,{}):null,(0,r.jsx)(bu,{}),(0,r.jsx)(gu,{}),(0,r.jsx)(Ou,{}),(0,r.jsx)(vu,{}),(0,r.jsx)(c.$i$,{className:fe().marginBottom20}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:x.Z.Messages.ACCESSIBILITY_SETTINGS_APPEARANCE_LINK.format({onAppearanceClick:function(){d.Z.open(B.oAB.APPEARANCE)}})})]})}function du(){var e=ni.jU.useSetting(),t=iu(o.useState((function(){var e=(0,Ll.e5)(ou(ru({},(0,Ul.ZP)({channelId:"1337",content:x.Z.Messages.ACCESSIBILITY_SETTINGS_SATURATION_LINK_PREVIEW_MESSAGE.format({previewLink:"https://discord.com/accessibility"})})),{state:B.yb.SENT,id:"".concat(0)}));e.colorString="green";return e})),1)[0];return(0,r.jsx)(c.Rny,{children:(0,r.jsxs)(c.Zbd,{className:$l().preview,"aria-hidden":!0,
children:[(0,r.jsxs)("div",{className:$l().previewHeader,children:[(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,color:c.zxk.Colors.BRAND,children:x.Z.Messages.ACCESSIBILITY_EXAMPLE_BUTTON_LABEL}),(0,r.jsx)("div",{className:$l().previewAvatars,children:[B.Skl.ONLINE,B.Skl.DND,B.Skl.IDLE].map((function(e){return(0,r.jsx)(c.Xo$,{"aria-label":x.Z.Messages.USER_SETTINGS_AVATAR,src:eu(),size:c.EFr.SIZE_32,status:e},e)}))})]}),(0,r.jsx)("div",{className:$l().previewMessage,children:(0,r.jsx)(Gl.Z,{compact:e,author:ou(ru({},(0,kl.ZH)(t)),{colorString:"#DD80F4"}),message:t})})]})})}function pu(){var e=(0,y.cj)([Te.Z],(function(){return{saturation:Te.Z.saturation,desaturateUserColors:Te.Z.desaturateUserColors}})),t=e.saturation,n=e.desaturateUserColors;return(0,r.jsxs)(c.hjN,{className:fe().marginTop20,children:[(0,r.jsx)(c.vwX,{id:au,className:fe().marginBottom8,children:x.Z.Messages.ACCESSIBILITY_SETTINGS_SATURATION_TITLE}),(0,r.jsx)(c.R94,{id:su,type:c.R94.Types.DESCRIPTION,
className:fe().marginBottom20,children:x.Z.Messages.ACCESSIBILITY_SETTINGS_SATURATION_DESCRIPTION}),(0,r.jsx)(c.iRW,{"aria-labelledby":au,"aria-describedby":su,markers:B.yqN.SATURATION_INCREMENTS,equidistant:!0,stickToMarkers:!0,maxValue:1,minValue:0,initialValue:t,onValueChange:lu,onMarkerRender:function(e){return 100*e%2==0?"".concat(100*e,"%"):void 0}}),(0,r.jsx)(c.j7V,{hideBorder:!0,className:v()(fe().marginTop8,fe().marginBottom20),value:n,onChange:wl.f1,note:x.Z.Messages.ACCESSIBILITY_SETTINGS_SATURATION_CUSTOM_COLORS_DESCRIPTION,children:x.Z.Messages.ACCESSIBILITY_SETTINGS_SATURATION_CUSTOM_COLORS_LABEL})]})}function hu(){var e=(0,y.e7)([Te.Z],(function(){return Te.Z.alwaysShowLinkDecorations}));return(0,r.jsx)(c.xJW,{className:fe().marginTop20,children:(0,r.jsx)(c.j7V,{note:x.Z.Messages.ACCESSIBILITY_SETTINGS_ALWAYS_SHOW_LINK_DECORATIONS_NOTE,value:e,onChange:function(){(0,wl.gs)(!e)},children:x.Z.Messages.ACCESSIBILITY_SETTINGS_ALWAYS_SHOW_LINK_DECORATIONS_LABEL})})}
function Eu(){var e=(0,y.e7)([Te.Z],(function(){return Te.Z.roleStyle}));return(0,r.jsxs)(c.xJW,{title:x.Z.Messages.ACCESSIBILITY_SETTINGS_ROLE_STYLE_TITLE,className:fe().marginTop20,children:[(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:fe().marginBottom8,children:x.Z.Messages.ACCESSIBILITY_SETTINGS_ROLE_STYLE_DESCRIPTION}),(0,r.jsx)(c.Eep,{options:[{name:x.Z.Messages.ACCESSIBILITY_SETTINGS_ROLE_STYLE_USERNAME_LABEL,value:"username"},{name:x.Z.Messages.ACCESSIBILITY_SETTINGS_ROLE_STYLE_DOT_LABEL,value:"dot"},{name:x.Z.Messages.ACCESSIBILITY_SETTINGS_ROLE_STYLE_HIDDEN_LABEL,value:"hidden"}],onChange:function(e){(0,wl.u1)(e.value)},value:e})]})}function yu(){var e=(0,y.e7)([Te.Z],(function(){return Te.Z.syncProfileThemeWithUserTheme})),t=o.useRef(null);Ws(t,hr.rP.SYNC_PROFILE_THEME_WITH_USER_THEME);return(0,r.jsx)(c.xJW,{ref:t,title:x.Z.Messages.ACCESSIBILITY_SETTINGS_PROFILE_COLORS_TITLE,className:v()(fe().marginTop20,$l().syncProfileThemeWithUserTheme),children:(0,
r.jsx)(c.j7V,{note:x.Z.Messages.ACCESSIBILITY_SETTINGS_PROFILE_THEMES_NOTE.format({onThemeClick:function(){d.Z.open(B.oAB.APPEARANCE)}}),className:fe().marginTop20,value:e,onChange:wl.Uv,children:x.Z.Messages.ACCESSIBILITY_SETTINGS_PROFILE_THEMES_DESCRIPTION})})}function mu(){var e=iu((0,y.Wu)([Te.Z],(function(){return[Te.Z.syncForcedColors,Te.Z.systemForcedColors]})),2),t=e[0],n=e[1],i=iu(o.useState(t),2),a=i[0],s=i[1];o.useEffect((function(){s(t)}),[t]);var l=o.useRef(null);o.useEffect((function(){if(null!=l.current){clearTimeout(l.current);l.current=null}a!==t&&(l.current=setTimeout((function(){return(0,wl.qz)(a)}),150))}),[a,t]);var u="active"===n?x.Z.Messages.ACCESSIBILITY_SETTINGS_SYNC_FORCED_COLORS_DESCRIPTION_WITH_FEEDBACK.format({learnMoreLink:ta.Z.getArticleURL(B.BhN.FORCED_COLORS),shareFeedbackLink:Kl.Ee}):x.Z.Messages.ACCESSIBILITY_SETTINGS_SYNC_FORCED_COLORS_DESCRIPTION.format({learnMoreLink:ta.Z.getArticleURL(B.BhN.FORCED_COLORS)});return(0,r.jsx)(c.xJW,{
title:x.Z.Messages.ACCESSIBILITY_SETTINGS_CONTRAST,className:fe().marginTop20,children:(0,r.jsx)(c.j7V,{value:a,note:u,onChange:s,children:x.Z.Messages.ACCESSIBILITY_SETTINGS_SYNC_FORCED_COLORS_LABEL})})}function bu(){var e=ni.QK.useSetting(),t=ni.Yk.useSetting(),n=(0,y.cj)([Te.Z,Wl.Z],(function(){return{systemPrefersReducedMotion:Te.Z.systemPrefersReducedMotion,rawPrefersReducedMotion:Te.Z.rawPrefersReducedMotion,useReducedMotion:Te.Z.useReducedMotion,gifAutoPlayOverrideReason:Wl.Z.getAppliedOverrideReasonKey("gifAutoPlay"),animateEmojiOverrideReason:Wl.Z.getAppliedOverrideReasonKey("animateEmoji")}})),i=n.useReducedMotion,a=n.rawPrefersReducedMotion,s=n.systemPrefersReducedMotion,l=n.gifAutoPlayOverrideReason,u=n.animateEmojiOverrideReason,f="auto"===a,d=o.useRef(null);Ws(d,hr.rP.REDUCED_MOTION);var p=o.useCallback((function(e,t){(0,wl.Zt)(t?"auto":s)}),[s]),h=o.useCallback((function(e){(0,wl.Zt)(e?"reduce":"no-preference")}),[]);return(0,r.jsxs)(c.xJW,{ref:d,
title:x.Z.Messages.ACCESSIBILITY_PREFERS_REDUCED_MOTION,className:v()(fe().marginTop20,$l().reducedMotion),children:[(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:fe().marginBottom8,children:x.Z.Messages.ACCESSIBILITY_PREFERS_REDUCED_MOTION_DESCRIPTION.format({helpdeskArticle:ta.Z.getArticleURL(B.BhN.REDUCED_MOTION)})}),(0,r.jsx)(c.XZJ,{className:fe().marginTop20,value:f,shape:c.XZJ.Shapes.BOX,type:c.XZJ.Types.INVERTED,onChange:p,children:(0,r.jsx)(c.xvT,{variant:"text-sm/normal",children:x.Z.Messages.ACCESSIBILITY_PREFERS_REDUCED_MOTION_AUTO})}),(0,r.jsx)(c.j7V,{className:fe().marginTop20,value:i,onChange:h,children:x.Z.Messages.ACCESSIBILITY_PREFERS_REDUCED_MOTION_ENABLE}),(0,r.jsx)(c.j7V,{className:fe().marginBottom40,value:e,note:null!=l?Hl(l):void 0,onChange:ni.QK.updateSetting,children:x.Z.Messages.GIF_AUTO_PLAY_LABEL}),(0,r.jsx)(c.j7V,{className:v()(fe().marginTop8,fe().marginBottom20),value:t,note:null!=u?Hl(u):void 0,onChange:ni.Yk.updateSetting,
children:x.Z.Messages.ANIMATE_EMOJI})]})}function gu(){var e=ni.Wp.useSetting(),t=(0,y.e7)([Wl.Z],(function(){return Wl.Z.getAppliedOverrideReasonKey("animateStickers")})),n=o.useCallback((function(e){ni.Wp.updateSetting(e.value)}),[]);return(0,r.jsxs)(c.xJW,{className:fe().marginBottom40,title:x.Z.Messages.STICKERS_AUTO_PLAY_HEADING,children:[(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:fe().marginBottom8,children:null!=t?Hl(t):x.Z.Messages.STICKERS_AUTO_PLAY_HELP}),(0,r.jsx)(c.Eep,{options:[{name:x.Z.Messages.STICKERS_ALWAYS_ANIMATE,value:ql.yr.ALWAYS_ANIMATE},{name:x.Z.Messages.STICKERS_ANIMATE_ON_INTERACTION,desc:x.Z.Messages.STICKERS_ANIMATE_ON_INTERACTION_DESCRIPTION,value:ql.yr.ANIMATE_ON_INTERACTION},{name:x.Z.Messages.STICKERS_NEVER_ANIMATE,value:ql.yr.NEVER_ANIMATE}],onChange:n,value:e})]})}function Ou(){var e=(0,y.e7)([Te.Z],(function(){return Te.Z.isSubmitButtonEnabled})),t=ni.dN.useSetting();return(0,r.jsxs)(c.xJW,{children:[(0,r.jsx)(c.vwX,{
className:fe().marginBottom8,children:x.Z.Messages.FORM_LABEL_ACCESSIBILITY_CHAT_INPUT}),(0,r.jsx)(c.j7V,{className:fe().marginTop20,value:e,onChange:wl.eN,children:x.Z.Messages.DISPLAY_SUBMIT_BUTTON}),(0,r.jsx)(c.j7V,{className:fe().marginTop8,value:t,note:x.Z.Messages.LEGACY_CHAT_INPUT_DESCRIPTION,onChange:function(e){Dr.default.track(B.rMx.LEGACY_CHAT_INPUT_TOGGLED,{enabled:e,location:{section:B.jXE.SETTINGS_ACCESSIBILITY}});ni.dN.updateSetting(e)},children:x.Z.Messages.LEGACY_CHAT_INPUT})]})}function vu(){var e=ni.OW.useSetting(),t=(0,y.e7)([Fl.Z],(function(){return Fl.Z.speechRate})),n=iu(o.useState(!1),2),i=n[0],a=n[1];if(!Ml.Zh)return null;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(c.xJW,{children:[(0,r.jsx)(c.vwX,{className:fe().marginBottom8,children:x.Z.Messages.FORM_LABEL_TTS}),(0,r.jsx)(c.j7V,{className:fe().marginTop20,value:e,onChange:ni.OW.updateSetting,children:x.Z.Messages.ALLOW_TTS_COMMAND})]}),(0,r.jsxs)(c.xJW,{className:fe().marginBottom20,children:[(0,
r.jsx)(c.vwX,{id:cu,className:fe().marginBottom20,children:x.Z.Messages.ACCESSIBILITY_SETTINGS_TTS_RATE_LABEL}),(0,r.jsx)("div",{className:$l().ttsPreviewWrapper,children:(0,r.jsx)(c.zxk,{color:c.Ttl.BRAND_NEW,onClick:function(){if(i){(0,Vl.NB)();a(!1)}else{(0,Vl.cP)(x.Z.Messages.ACCESSIBILITY_SETTINGS_TTS_RATE_TEST,!0,void 0,(function(){return a(!0)}),(function(){return a(!1)}));a(!0)}},children:(0,r.jsxs)(ae.Z,{align:ae.Z.Align.CENTER,children:[i?(0,r.jsx)(Yl.Z,{width:24,height:24}):(0,r.jsx)(zl.Z,{width:24,height:24}),(0,r.jsx)("span",{children:x.Z.Messages.ACCESSIBILITY_SETTINGS_TTS_RATE_PREVIEW}),(0,r.jsx)(c.nn4,{children:x.Z.Messages.ACCESSIBILITY_SETTINGS_TTS_RATE_LABEL})]})})}),(0,r.jsx)(c.iRW,{markers:Xl.q,initialValue:t,defaultValue:1,stickToMarkers:!0,onValueChange:uu,onValueRender:function(e){return"x".concat(e.toFixed(2))},onMarkerRender:function(e){return 0===e?(0,r.jsx)("span",{className:$l().ttsSliderMarker,children:x.Z.Messages.ACCESSIBILITY_SETTINGS_TTS_RATE_SLOWER
}):10===e?(0,r.jsx)("span",{className:$l().ttsSliderMarker,children:x.Z.Messages.ACCESSIBILITY_SETTINGS_TTS_RATE_FASTER}):1===e?(0,r.jsx)("span",{children:"x1.0"}):e%1==0?"":void 0},"aria-labelledby":cu})]})]})}var _u=n(130671),Iu=n(975651),Su=(n(561210),n(488462));function Tu(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Nu(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Tu(i,r,o,a,s,"next",e)}function s(e){Tu(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Au(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Cu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))))
;r.forEach((function(t){Au(e,t,n[t])}))}return e}var Pu=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}
i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};const ju=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;(0,c.ZDy)(Nu((function(){var t,o;return Pu(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(73284)]).then(n.bind(n,854104))];case 1:t=i.sent(),o=t.default;return[2,function(t){return(0,r.jsx)(o,Cu({claimRequired:e},t))}]}}))})),{onCloseRequest:e?Su.dG:null,onCloseCallback:t})};var Ru=n(694444),xu=n(64234),Mu=n(265508),wu=n(322837),Du=n(919244),Zu=n(411177),Lu=n(426797),Uu=n(970112),ku=n(971402),Gu=n(693622),Bu=n(651034),Hu=n(281110);function Vu(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Fu(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Vu(i,r,o,a,s,"next",e)}function s(e){
Vu(i,r,o,a,s,"throw",e)}a(void 0)}))}}var Yu=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)
}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function zu(){return(zu=Fu((function(){var e,t,n,r;return Yu(this,(function(o){switch(o.label){case 0:return[4,Hu.Z.post({url:B.ANM.MFA_WEBAUTHN_CREDENTIALS,body:{}})];case 1:e=o.sent(),t=e.body,n=t.ticket,r=t.challenge;return[2,{ticket:n,challenge:r}]}}))}))).apply(this,arguments)}function Wu(){return(Wu=Fu((function(e,t,n){var r;return Yu(this,(function(o){switch(o.label){case 0:return[4,Hu.Z.post({url:B.ANM.MFA_WEBAUTHN_CREDENTIALS,body:{name:e,ticket:t,credential:n}})];case 1:r=o.sent();l.Z.dispatch({type:"MFA_WEBAUTHN_CREDENTIAL_CREATE",credential:r.body});return[2]}}))}))).apply(this,arguments)}const Ku=(0,sa.B)({id:"2022-08_webauthn",label:"WebAuthn",kind:"user",defaultConfig:{enabled:!1},treatments:[{id:0,label:"Control",config:{enabled:!1}},{id:1,label:"Enabled",config:{enabled:!0}}]});function qu(e,t){(null==t||t>e.length)&&(t=e.length)
;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Xu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qu(e){Qu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Qu(e)}function $u(e,t){return!t||"object"!==tf(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ju(e,t){Ju=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Ju(e,t)}function ef(e){return function(e){if(Array.isArray(e))return qu(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return qu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n)
;if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qu(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var tf=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function nf(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Qu(e);if(t){var o=Qu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return $u(this,n)}}var rf=!1,of=[];var af=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{
constructor:{value:e,writable:!0,configurable:!0}});t&&Ju(e,t)}(n,e);var t=nf(n);function n(){Xu(this,n);return t.apply(this,arguments)}var r=n.prototype;r.hasFetchedCredentials=function(){return rf};r.getCredentials=function(){return of};r.__getLocalVars=function(){return{fetchedCredentials:rf,credentials:of}};return n}(y.ZP.Store);af.displayName="WebAuthnStore";const sf=new af(l.Z,{LOGOUT:function(){of=[]},MFA_WEBAUTHN_CREDENTIALS_LOADING:function(){rf=!0;return!0},MFA_WEBAUTHN_CREDENTIALS_LOADED:function(e){of=e.credentials;return!0},MFA_WEBAUTHN_CREDENTIAL_CREATE:function(e){var t=e.credential;of=ef(of).concat([t]);return!0},MFA_WEBAUTHN_CREDENTIAL_DELETE:function(e){var t=e.credentialId;of=of.filter((function(e){return e.id!==t}));return!0}});var cf,lf=n(441984),uf=n.n(lf);function ff(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function df(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0
}):e[t]=n;return e}function pf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){df(e,t,n[t])}))}return e}function hf(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Ef(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){
var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ff(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ff(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}!function(e){e.INIT="INIT";e.REGISTER="REGISTER";e.NAME="NAME"}(cf||(cf={}));function yf(e){var t=e.transitionState,i=e.onClose,a=e.ticket,s=e.challenge,l=(0,
Jt.Dt)(),u=Ef(o.useState(""),2),f=u[0],d=u[1],p=Ef(o.useState(cf.INIT),2),h=p[0],E=p[1],y=Ef(o.useState(""),2),m=y[0],b=y[1],g=Ef(o.useState(null),2),O=g[0],v=g[1];return(0,r.jsxs)(c.Y0X,{transitionState:t,"aria-labelledby":l,children:[(0,r.jsxs)(c.xBx,{className:uf().header,separator:!1,children:[(0,r.jsxs)(c.X6q,{id:l,variant:"heading-lg/semibold",children:[h===cf.INIT&&x.Z.Messages.TWO_FA_WEBAUTHN_REGISTER,h===cf.REGISTER&&x.Z.Messages.TWO_FA_WEBAUTHN_INTERACT,h===cf.NAME&&x.Z.Messages.TWO_FA_WEBAUTHN_NAME]}),(0,r.jsx)(c.olH,{onClick:i,className:uf().modalCloseButton})]}),(0,r.jsxs)(c.MyZ,{activeSlide:h,width:440,children:[(0,r.jsxs)(c.Mi4,{id:cf.INIT,children:[(0,r.jsxs)(c.hzk,{className:uf().content,children:[(0,r.jsx)("div",{className:uf().icon,children:(0,r.jsx)("img",{alt:"",src:n(761434)})}),(0,r.jsx)("div",{children:null!=O&&(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"status-danger",children:O})}),(0,r.jsx)("div",{children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",
children:x.Z.Messages.TWO_FA_WEBAUTHN_REGISTER_INSTRUCTIONS})})]}),(0,r.jsx)(c.mzw,{children:(0,r.jsx)(c.zxk,{onClick:function(){E(cf.REGISTER);Uu.Ue(JSON.parse(s)).then((function(e){b(JSON.stringify(e));E(cf.NAME)})).catch((function(e){v(e.message);E(cf.INIT)}))},children:x.Z.Messages.TWO_FA_WEBAUTHN_REGISTER_CONFIRM})})]}),(0,r.jsxs)(c.Mi4,{id:cf.REGISTER,children:[(0,r.jsxs)(c.hzk,{className:uf().content,children:[(0,r.jsx)("div",{className:uf().icon,children:(0,r.jsx)("img",{alt:"",src:n(761434)})}),(0,r.jsx)("div",{children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:x.Z.Messages.TWO_FA_WEBAUTHN_INTERACT_INSTRUCTIONS})})]}),(0,r.jsx)(c.mzw,{children:(0,r.jsx)(c.zxk,{submitting:!0})})]}),(0,r.jsx)(c.Mi4,{id:cf.NAME,children:(0,r.jsxs)("form",{onSubmit:function(e){e.preventDefault();(function(e,t,n){return Wu.apply(this,arguments)})(f,a,m).then((function(){return i()})).catch((function(e){v(e.message);E(cf.REGISTER)}))},children:[(0,r.jsxs)(c.hzk,{className:uf().content,
children:[(0,r.jsx)("div",{className:uf().icon,children:(0,r.jsx)("img",{alt:"",src:n(88094)})}),(0,r.jsxs)("div",{children:[(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:x.Z.Messages.TWO_FA_WEBAUTHN_NAME_INSTRUCTIONS}),(0,r.jsx)(c.oil,{className:uf().input,value:f,onChange:d})]})]}),(0,r.jsx)(c.mzw,{children:(0,r.jsx)(c.zxk,{type:"submit",children:x.Z.Messages.TWO_FA_WEBAUTHN_REGISTER_FINISH})})]})})]})]})}function mf(e){var t=e.onSelect,n=e.credentialId;return(0,r.jsx)(c.v2r,{navId:"webauthn-credential-actions",onClose:ku.Zy,"aria-label":x.Z.Messages.TWO_FA_WEBAUTHN_CREDENTIAL_OPTIONS,onSelect:t,children:(0,r.jsx)(c.sNh,{id:"webauthn-delete-credential",label:x.Z.Messages.TWO_FA_WEBAUTHN_DELETE_CREDENTIAL,action:function(){!function(e){Hu.Z.delete(B.ANM.MFA_WEBAUTHN_CREDENTIAL(e)).then((function(){l.Z.dispatch({type:"MFA_WEBAUTHN_CREDENTIAL_DELETE",credentialId:e})}))}(n)}})})}function bf(){var e=(0,y.cj)([sf],(function(){return{hasFetchedCredentials:sf.hasFetchedCredentials(),
credentials:sf.getCredentials()}})),t=e.credentials,n=e.hasFetchedCredentials,i=Ku.getCurrentConfig({}).enabled;o.useEffect((function(){i&&!n&&function(){l.Z.dispatch({type:"MFA_WEBAUTHN_CREDENTIALS_LOADING"});Hu.Z.get(B.ANM.MFA_WEBAUTHN_CREDENTIALS).then((function(e){l.Z.dispatch({type:"MFA_WEBAUTHN_CREDENTIALS_LOADED",credentials:e.body})}))}()}),[i,n]);var a=Ef(o.useState(!1),2),s=a[0],u=a[1];return i?(0,r.jsxs)(c.hjN,{title:x.Z.Messages.TWO_FA_WEBAUTHN_TITLE,className:uf().settings,children:[(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:uf().description,children:x.Z.Messages.TWO_FA_WEBAUTHN_DESCRIPTION}),t.length>0&&(0,r.jsx)("div",{className:uf().credentialList,children:t.map((function(e){return(0,r.jsx)(Bu.Z,{avatar:null,name:e.name,className:uf().credentialItem,onContextMenu:function(t){(0,ku.vq)(t,(function(t){return(0,r.jsx)(mf,hf(pf({},t),{credentialId:e.id}))}))},children:(0,r.jsx)(c.zxk,{look:c.zxk.Looks.BLANK,color:c.zxk.Colors.TRANSPARENT,size:c.zxk.Sizes.ICON,
onClick:function(t){(0,ku.vq)(t,(function(t){return(0,r.jsx)(mf,hf(pf({},t),{credentialId:e.id}))}))},"aria-label":x.Z.Messages.TWO_FA_WEBAUTHN_CREDENTIAL_OPTIONS,innerClassName:uf().credentialOptions,children:(0,r.jsx)(Gu.Z,{className:uf().overflowIcon,foreground:uf().overflowIconFg,"aria-hidden":!0})})},e.id)}))}),(0,r.jsx)("div",{children:(0,r.jsx)(c.zxk,{onClick:function(){u(!0);(function(){return zu.apply(this,arguments)})().then((function(e){var t=e.ticket,n=e.challenge;(0,c.h7j)((function(e){return(0,r.jsx)(yf,hf(pf({},e),{ticket:t,challenge:n}))}))})).finally((function(){u(!1)}))},submitting:s,size:c.zxk.Sizes.SMALL,children:x.Z.Messages.TWO_FA_WEBAUTHN_REGISTER})})]}):null}var gf=n(691797),Of=n(178176);var vf=n(751388),_f=n(58118),If=n(841391),Sf=n.n(If);function Tf(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Nf(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n)
;function a(e){Tf(i,r,o,a,s,"next",e)}function s(e){Tf(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Af(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cf(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Pf(e){Pf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Pf(e)}function jf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Cf(e,t,n[t])}))}return e}function Rf(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){
var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function xf(e,t){return!t||"object"!==wf(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Mf(e,t){Mf=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Mf(e,t)}var wf=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Df(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Pf(e);if(t){var o=Pf(this).constructor
;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return xf(this,n)}}var Zf=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}
o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Lf(e){var t=e.code,n=t.code,i=t.consumed,a="".concat(n.substr(0,4),"-").concat(n.substr(4)),s=o.useRef(null),l=o.useCallback((function(e){if("c"===e.key&&e.metaKey&&gf.wS){var t;e.preventDefault();e.stopPropagation();(0,gf.JG)(a);null==s||null===(t=s.current)||void 0===t||t.focus()}}),[a]);return(0,r.jsx)("li",{className:fe().marginBottom20,children:(0,r.jsx)(c.P3F,{innerRef:s,className:Sf().backupCode,onKeyDown:l,children:(0,r.jsx)(c.XZJ,{displayOnly:!0,readOnly:!0,className:Sf().codeCheckbox,value:i,children:(0,r.jsx)("span",{className:Sf().code,children:a})})})})}var Uf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Mf(e,t)}(o,e)
;var t=Df(o);function o(){Af(this,o);var e;(e=t.apply(this,arguments)).state={revealed:!1,password:""};e.togglePhoneNumberVisibility=function(t){t.preventDefault();e.setState({revealed:!e.state.revealed})};e.handleDisableMFA=function(){_u.Z.disable()};e.generateBackupCodes=Nf((function(){var e;return Zf(this,(function(t){switch(t.label){case 0:e=Ru.Z.getVerificationKey();return[4,_u.Z.confirmViewBackupCodes(e,!0)];case 1:t.sent();return[2]}}))}));e.sendMFABackupCodesVerificationKeyEmail=function(){(0,c.h7j)((function(t){return(0,r.jsx)(Iu.default,Rf(jf({},t),{handleSubmit:function(t){return _u.Z.sendMFABackupCodesVerificationKeyEmail(t).then((function(){e.viewBackupCodes(t)}))},title:x.Z.Messages.TWO_FA_VIEW_BACKUP_CODES_ENTER_PASSWORD,actionText:x.Z.Messages.TWO_FA_BACKUP_CODES_NEXT_ACTION}))}))};e.viewBackupCodes=function(e){(0,c.h7j)((function(t){return(0,r.jsx)(Du.Z,Rf(jf({},t),{handleSubmit:function(e){return _u.Z.confirmViewBackupCodes(e,!1).then((function(){return t.onClose()}))
},maxLength:8,title:x.Z.Messages.TWO_FA_CONFIRM_VIEW_BACKUP_CODES_LABEL,label:x.Z.Messages.TWO_FA_CONFIRM_VIEW_BACKUP_CODES_INPUT_LABEL,forceNoPlaceholder:!0,retryPrompt:x.Z.Messages.TWO_FA_CONFIRM_VIEW_RESEND_EMAIL_PROMPT,retrySuccessMessage:x.Z.Messages.TWO_FA_CONFIRM_VIEW_RESEND_EMAIL_SUCCESS,onRetry:function(){return _u.Z.sendMFABackupCodesVerificationKeyEmail(e)},actionText:x.Z.Messages.TWO_FA_VIEW_CODES_SUBMIT,helpMessage:x.Z.Messages.TWO_FA_CONFIRM_VIEW_BACKUP_CODES_BODY}))}))};e.getDownloadFileContents=function(){var t=e.props.backupCodes.map((function(e){var t=e.consumed,n=e.code;return"* ".concat(n.substr(0,4),"-").concat(n.substr(4)," ").concat(t?"(used)":"")})).join("\r\n"),n=x.Z.Messages.TWO_FA_DISCORD_BACKUP_CODES.format({email:e.props.currentUser.email});return"".concat(n,"\r\n\r\n").concat(t)};e.handleChangePhoneNumber=function(){e.openPhoneVerificationModal()};e.handleEnableSMS=function(){var t=function(){(0,c.h7j)((function(e){return(0,r.jsx)(Iu.default,Rf(jf({},e),{
handleSubmit:_u.Z.enableSMS,title:x.Z.Messages.MFA_SMS_ENABLE}))}))};null==e.props.currentUser.phone?e.openPhoneVerificationModal({onAddedPhone:t}):t()};e.handleDisableSMS=function(){(0,c.h7j)((function(e){return(0,r.jsx)(Iu.default,Rf(jf({},e),{handleSubmit:_u.Z.disableSMS,title:x.Z.Messages.MFA_SMS_REMOVE,children:x.Z.Messages._MFA_SMS_CONFIRM_REMOVE_BODY}))}))};return e}var i=o.prototype;i.maskPhoneNumber=function(e){return null==e?"":"".concat("*".repeat(e.length-4)).concat(e.slice(-4))};i.renderMFASMS=function(){var e,t,n=this.state.revealed,o=this.props,i=o.currentUser,a=o.togglingSMS,s=null!=i.phone,l=i.hasFlag(B.xW$.MFA_SMS);if(s||l){var u=n?i.phone:this.maskPhoneNumber(i.phone);t=(0,r.jsxs)(c.R94,{type:c.R94.Types.DESCRIPTION,className:fe().marginBottom8,children:[x.Z.Messages.MFA_SMS_AUTH_CURRENT_PHONE.format({phoneNumber:u}),(0,r.jsx)(c.eee,{onClick:this.togglePhoneNumberVisibility,className:Sf().phoneRevealer,
children:n?x.Z.Messages.MFA_SMS_PHONE_NUMBER_HIDE:x.Z.Messages.MFA_SMS_PHONE_NUMBER_REVEAL})]})}if(l)e=(0,r.jsx)(ae.Z,{className:s?"":fe().marginTop8,children:(0,r.jsx)(c.zxk,{color:c.zxk.Colors.RED,look:c.zxk.Looks.OUTLINED,size:c.zxk.Sizes.SMALL,submitting:a,onClick:this.handleDisableSMS,children:x.Z.Messages.MFA_SMS_REMOVE})});else{var f=function(e){return e.hasAnyStaffLevel()||e.hasFlag(B.xW$.PARTNER)?x.Z.Messages.MFA_SMS_DISABLED_PARTNER:null==e.email?x.Z.Messages.MFA_SMS_DISABLED_NO_EMAIL:null}(i);e=(0,r.jsxs)(ae.Z,{className:s?"":fe().marginTop8,children:[(0,r.jsx)(c.zxk,{onClick:this.handleEnableSMS,size:c.zxk.Sizes.SMALL,submitting:a,disabled:null!=f,children:null!=f?f:x.Z.Messages.MFA_SMS_ENABLE}),s?(0,r.jsx)(c.zxk,{onClick:this.handleChangePhoneNumber,color:c.zxk.Colors.PRIMARY,size:c.zxk.Sizes.SMALL,look:c.zxk.Looks.LINK,children:x.Z.Messages.CHANGE_PHONE_NUMBER}):null]})}return(0,r.jsxs)(c.hjN,{className:fe().marginTop40,title:x.Z.Messages.MFA_SMS_AUTH,children:[(0,
r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,children:x.Z.Messages.MFA_SMS_AUTH_SALES_PITCH}),t,e]})};i.renderEnabled=function(){var e,t=this,o=this.props,i=o.isRoleSubscriptionGuildAdmin,a=o.backupCodes,s=(0,r.jsx)(c.zxk,{onClick:this.sendMFABackupCodesVerificationKeyEmail,size:c.zxk.Sizes.SMALL,children:x.Z.Messages.TWO_FA_VIEW_BACKUP_CODES});if(a.length>0){s=(0,r.jsx)(wu.Z,{fileContents:this.getDownloadFileContents,contentType:"text/plain",fileName:"discord_backup_codes.txt",children:(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,children:x.Z.Messages.TWO_FA_DOWNLOAD_CODES})});var l=function(e){return e.map((function(e){return(0,r.jsx)(Lf,{code:e},e.code)}))};e=(0,r.jsxs)(c.hjN,{title:x.Z.Messages.TWO_FA_BACKUP_CODES_LABEL,children:[(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:fe().marginBottom20,children:x.Z.Messages.TWO_FA_BACKUP_CODES_BODY.format()}),(0,r.jsxs)(ae.Z,{children:[(0,r.jsx)(ae.Z.Child,{children:(0,r.jsx)("ul",{className:Sf().checkboxGroup,
children:l(a.slice(0,a.length/2))})}),(0,r.jsx)(ae.Z.Child,{children:(0,r.jsx)("ul",{className:Sf().checkboxGroup,children:l(a.slice(a.length/2))})})]}),(0,r.jsx)("div",{children:(0,r.jsx)(c.zxk,{onClick:this.generateBackupCodes,look:c.iLD.LINK,size:c.PhG.MIN,children:x.Z.Messages.TWO_FA_GENERATE_CODES})}),(0,r.jsx)(c.$i$,{className:fe().marginTop20})]})}return(0,r.jsxs)(c.hjN,{children:[(0,r.jsxs)(c.vwX,{className:v()(Sf().isEnabled,fe().marginTop4,fe().marginBottom8),children:[(0,r.jsx)("img",{alt:"",className:v()(Sf().lockIcon),src:n(392544)}),x.Z.Messages.TWO_FA_ENABLED]}),(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:fe().marginBottom20,children:x.Z.Messages.TWO_FA_DESCRIPTION}),(0,r.jsxs)(ae.Z,{justify:ae.Z.Justify.START,className:fe().marginBottom20,children:[(0,r.jsx)(ae.Z.Child,{wrap:!0,grow:0,children:s}),(0,r.jsx)(ae.Z.Child,{wrap:!0,children:(0,r.jsx)(c.ua7,{text:x.Z.Messages.TWO_FA_DISABLED_FOR_SERVER_SUBSCRIPTION_MOD,hide:!i,children:function(e){return(0,
r.jsx)(c.zxk,Rf(jf({},e),{onClick:t.handleDisableMFA,size:c.zxk.Sizes.SMALL,color:c.Ttl.RED,look:c.iLD.OUTLINED,disabled:i,children:x.Z.Messages.TWO_FA_REMOVE}))}})})]}),e,this.renderMFASMS(),Of.Ae&&(0,r.jsx)(bf,{})]})};i.renderDisabled=function(){return(0,r.jsxs)(c.hjN,{title:x.Z.Messages.TWO_FA,children:[(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:fe().marginBottom20,children:x.Z.Messages.TWO_FA_SALES_PITCH}),(0,r.jsx)(c.xJW,{children:(0,r.jsx)(c.zxk,{onClick:vf.Z.enableMFA,size:c.PhG.SMALL,children:x.Z.Messages.TWO_FA_ENABLE})})]})};i.render=function(){var e=this.props.currentUser;return Of.uZ?e.verified?e.mfaEnabled?this.renderEnabled():this.renderDisabled():(0,r.jsx)(c.hjN,{title:x.Z.Messages.TWO_FA,children:(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,children:x.Z.Messages.TWO_FA_NOT_VERIFIED})}):(0,r.jsx)(c.hjN,{title:x.Z.Messages.TWO_FA,children:(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,children:x.Z.Messages.TWO_FA_USE_DESKTOP_APP})})}
;i.openPhoneVerificationModal=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,c.h7j)((function(t){return(0,r.jsx)(Zu.default,jf({reason:Lu.L.USER_SETTINGS_UPDATE},t,e))}),{modalKey:_f.M})};return o}(o.PureComponent);const kf=y.ZP.connectStores([Lr.default,Ru.Z,an.Z,ns.Z],(function(){var e=Lr.default.getCurrentUser(),t=an.Z.getGuilds(),n=Object.values(t).some((function(e){return e.hasFeature(B.oNc.ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE)&&ns.Z.can(B.Plq.ADMINISTRATOR,e)}));L()(null!=e,"TwoFactorAuth: currentUser cannot be undefined");return{currentUser:e,isRoleSubscriptionGuildAdmin:n,togglingSMS:Ru.Z.togglingSMS}}))(Uf);var Gf=n(153837),Bf=n.n(Gf);function Hf(e){var t=e.className,n=e.currentUser,o=e.handleDisableAccount,i=e.handleDeleteAccount,a=n.isClaimed();return(0,r.jsxs)(c.hjN,{className:t,title:x.Z.Messages.USER_SETTINGS_ACCOUNT_REMOVAL_SECTION,children:[(0,r.jsx)(c.R94,{className:Bf().description,type:c.R94.Types.DESCRIPTION,
children:a?x.Z.Messages.USER_SETTINGS_ACCOUNT_REMOVAL_DESCRIPTION:x.Z.Messages.USER_SETTINGS_ACCOUNT_REMOVAL_DESCRIPTION_UNCLAIMED}),(0,r.jsxs)("div",{className:Bf().buttonContainer,children:[a?(0,r.jsx)(c.zxk,{className:Bf().disableButton,look:c.iLD.FILLED,color:c.Ttl.RED,size:c.PhG.SMALL,onClick:o,children:x.Z.Messages.DISABLE_ACCOUNT}):null,(0,r.jsx)(c.zxk,{look:c.iLD.OUTLINED,color:c.Ttl.RED,size:c.PhG.SMALL,onClick:i,children:x.Z.Messages.DELETE_ACCOUNT})]})]})}var Vf=n(334835),Ff=n(995141),Yf=n(112897),zf=n(253567),Wf=n(351619),Kf=n(186440),qf=n(310126);function Xf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Qf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{
a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xf(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $f(e){return"".concat("*".repeat(e.length-4)).concat(e.slice(-4))}function Jf(e){var t=Qf(e.split("@"),2),n=t[0],r=t[1];return"".concat("*".repeat(n.length),"@").concat(r)}var ed=n(295489),td=n.n(ed);function nd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rd(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function od(e){
return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){rd(i,r,o,a,s,"next",e)}function s(e){rd(i,r,o,a,s,"throw",e)}a(void 0)}))}}function id(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function ad(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){id(e,t,n[t])}))}return e}function sd(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n
}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function cd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}
var ld=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}
if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ud=qf.default.getEnableHardwareAcceleration()?c.Xo$:c.qEK;function fd(e){var t=e.className,i=e.user,a=o.useRef(null),s=null!=a.current&&a.current.scrollWidth>a.current.clientWidth;return(0,r.jsxs)("div",{className:v()(td().field,t),children:[(0,r.jsx)("div",{className:td().constrainedRow,children:(0,r.jsxs)("div",{className:td().usernameRow,children:[(0,r.jsx)(c.vwX,{className:td().fieldTitle,children:x.Z.Messages.USER_SETTINGS_LABEL_USERNAME}),(0,r.jsxs)("div",{className:td().usernameInnerRow,ref:a,children:[(0,r.jsx)(c.xvT,{tag:"span",color:"header-primary",variant:"text-md/normal",children:i.isPomelo()?i.pomeloTag:i.username}),!i.isPomelo()&&(0,r.jsxs)(c.xvT,{tag:"span",color:"header-secondary",variant:"text-md/normal",children:["#",i.discriminator]})]})]})}),(0,r.jsx)(c.zxk,{className:td().fieldButton,size:c.zxk.Sizes.SMALL,color:c.zxk.Colors.PRIMARY,
"aria-label":x.Z.Messages.USER_SETTINGS_ACCOUNT_EDIT_USERNAME_A11Y_LABEL,onClick:function(){return(0,c.ZDy)(od((function(){var e,t;return ld(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(25934)]).then(n.bind(n,425934))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,ad({},e))}]}}))})))},children:s?x.Z.Messages.DISAPPROVAL:x.Z.Messages.EDIT})]})}function dd(e){var t=e.text,n=e.censor,i=e.revealLabel,a=e.hideLabel,s=cd(o.useState(!1),2),l=s[0],u=s[1],f=l?t:n(t);return(0,r.jsxs)(r.Fragment,{children:[f,(0,r.jsx)(c.zxk,{look:c.zxk.Looks.LINK,size:c.zxk.Sizes.MIN,color:c.zxk.Colors.LINK,"aria-label":l?a:i,onClick:function(){return u(!l)},children:l?x.Z.Messages.HIDE:x.Z.Messages.REVEAL})]})}function pd(e){var t,o=e.className,i=e.user;if(i.isClaimed())if(null==i.email)t={buttonText:x.Z.Messages.ADD,buttonAriaLabel:x.Z.Messages.USER_SETTINGS_ACCOUNT_ADD_EMAIL_A11Y_LABEL,buttonColor:c.zxk.Colors.PRIMARY,
valueMessage:x.Z.Messages.USER_SETTINGS_NO_EMAIL_PLACEHOLDER,handleClick:function(){return(0,c.ZDy)(od((function(){var e,t;return ld(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(71379)]).then(n.bind(n,171379))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,ad({},e))}]}}))})))}};else{var a=i.email;t={buttonText:x.Z.Messages.EDIT,buttonAriaLabel:x.Z.Messages.USER_SETTINGS_ACCOUNT_EDIT_EMAIL_A11Y_LABEL,buttonColor:c.zxk.Colors.PRIMARY,valueMessage:(0,r.jsx)(dd,{text:a,censor:Jf,revealLabel:x.Z.Messages.USER_SETTINGS_ACCOUNT_REVEAL_EMAIL_A11Y_LABEL,hideLabel:x.Z.Messages.USER_SETTINGS_ACCOUNT_HIDE_EMAIL_A11Y_LABEL}),handleClick:function(){return(0,c.ZDy)(od((function(){var e,t;return ld(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(71379)]).then(n.bind(n,171379))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,ad({},e))}]}}))})))}}}else t={
buttonText:x.Z.Messages.CLAIM_ACCOUNT_SHORT,buttonAriaLabel:x.Z.Messages.CLAIM_ACCOUNT_SHORT,buttonColor:c.zxk.Colors.BRAND,valueMessage:x.Z.Messages.USER_SETTINGS_ADD_EMAIL_CLAIM,handleClick:function(){return ju()}};return(0,r.jsxs)("div",{className:v()(td().field,o),children:[(0,r.jsx)("div",{className:td().constrainedRow,children:(0,r.jsxs)("div",{children:[(0,r.jsx)(c.vwX,{className:td().fieldTitle,children:x.Z.Messages.USER_SETTINGS_LABEL_EMAIL}),(0,r.jsx)("div",{children:(0,r.jsx)(c.xvT,{tag:"span",color:"header-primary",variant:"text-md/normal",children:t.valueMessage})})]})}),(0,r.jsx)(c.zxk,{className:td().fieldButton,size:c.zxk.Sizes.SMALL,color:c.zxk.Colors.PRIMARY,"aria-label":t.buttonAriaLabel,onClick:t.handleClick,children:t.buttonText})]})}function hd(e){var t=e.className,o=e.user;if(!o.isClaimed())return null;var i,a=o.phone,s=null!=a,l=null!=o.email;i=s?(0,r.jsx)(dd,{text:a,censor:$f,revealLabel:x.Z.Messages.USER_SETTINGS_ACCOUNT_REVEAL_PHONE_A11Y_LABEL,
hideLabel:x.Z.Messages.USER_SETTINGS_ACCOUNT_HIDE_PHONE_A11Y_LABEL}):x.Z.Messages.USER_SETTINGS_NO_PHONE_PLACEHOLDER;return(0,r.jsxs)("div",{className:v()(td().field,t),children:[(0,r.jsx)("div",{className:td().constrainedRow,children:(0,r.jsxs)("div",{children:[(0,r.jsx)(c.vwX,{className:td().fieldTitle,children:x.Z.Messages.USER_SETTINGS_LABEL_PHONE_NUMBER}),(0,r.jsx)("div",{children:(0,r.jsx)(c.xvT,{tag:"span",color:"header-primary",variant:"text-md/normal",children:i})})]})}),(0,r.jsxs)("div",{className:td().fieldButtonList,children:[s&&l?(0,r.jsx)(c.zxk,{className:v()(td().fieldButton,td().removeButton),size:c.zxk.Sizes.SMALL,look:c.zxk.Looks.LINK,color:c.zxk.Colors.PRIMARY,"aria-label":x.Z.Messages.USER_SETTINGS_ACCOUNT_REMOVE_PHONE_A11Y_LABEL,onClick:function(){(0,c.h7j)((function(e){return(0,r.jsx)(Iu.default,sd(ad({},e),{title:x.Z.Messages.USER_SETTINGS_ACCOUNT_REMOVE_PHONE_NUMBER_TITLE,
children:o.hasFlag(B.xW$.MFA_SMS)?x.Z.Messages.USER_SETTINGS_ACCOUNT_REMOVE_PHONE_SMS_BACKUP_WARNING:void 0,actionText:x.Z.Messages.REMOVE,handleSubmit:function(e){return Lu.Z.removePhone(e,Lu.L.USER_SETTINGS_UPDATE)}}))}))},children:x.Z.Messages.REMOVE}):null,(0,r.jsx)(c.zxk,{className:td().fieldButton,size:c.zxk.Sizes.SMALL,color:c.zxk.Colors.PRIMARY,"aria-label":s?x.Z.Messages.USER_SETTINGS_ACCOUNT_EDIT_PHONE_A11Y_LABEL:x.Z.Messages.USER_SETTINGS_ACCOUNT_ADD_PHONE_A11Y_LABEL,onClick:function(){(0,c.ZDy)(od((function(){var e,t;return ld(this,(function(o){switch(o.label){case 0:return[4,Promise.resolve().then(n.bind(n,411177))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,ad({reason:Lu.L.USER_SETTINGS_UPDATE},e))}]}}))})),{modalKey:_f.M})},children:s?x.Z.Messages.EDIT:x.Z.Messages.ADD})]})]})}function Ed(e){var t=e.user,n=(0,Yf.Z)(t.id);return ni.Sb.useSetting()&&gf.wS?(0,r.jsx)(c.yRy,{renderPopout:function(e){var t=e.closePopout;return(0,r.jsx)(c.v2r,{
onClose:t,onSelect:void 0,navId:"copy-id","aria-label":x.Z.Messages.USER_MORE_ACTIONS_MENU_LABEL,children:n})},children:function(e){return(0,r.jsx)(c.P3F,sd(ad({},e),{className:td().overflowMenuButton,"aria-label":x.Z.Messages.ACTIONS,children:(0,r.jsx)(Kf.Z,{className:td().overflowMenuIcon,height:24,width:24})}))}}):null}function yd(){d.Z.setSection(B.oAB.PROFILE_CUSTOMIZATION)}function md(){Dr.default.track(B.rMx.PREMIUM_PROMOTION_OPENED,{location_page:B.ZY5.USER_SETTINGS,location_section:B.jXE.SETTINGS_ACCOUNT,location_object:B.qAy.TOOLTIP});d.Z.setSection(B.oAB.PREMIUM)}function bd(){var e,t=(0,y.e7)([Lr.default],(function(){var e=Lr.default.getCurrentUser();L()(null!=e,"UserSettingsAccountProfileCard: currentUser cannot be undefined");return e})),n=(0,Yo.Z)(t.id),o=(0,Go.U)().canUseAvatarDecorations,i=ni.co.useSetting(),a=(0,y.e7)([mo.Z],(function(){return mo.Z.getErrors()})),s=null==a||null===(e=a.avatar)||void 0===e?void 0:e[0],l=o?(0,si.NZ)({userId:t.id,
avatarDecoration:t.avatarDecoration,size:(0,Ff.y)(c.EFr.SIZE_80),canAnimate:!0}):null;return(0,r.jsxs)("div",{className:td().accountProfileCard,children:[(0,r.jsx)(zf.Z,{displayProfile:n,user:t,allowEdit:!1,guildId:void 0,profileType:Si.y0.SETTINGS}),(0,r.jsxs)("div",{className:td().userInfo,children:[(0,r.jsx)(ud,{className:td().avatar,src:t.getAvatarURL(void 0,80,!0),avatarDecoration:l,status:i,size:c.EFr.SIZE_80,"aria-label":t.username}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:td().profileCardUsernameRow,children:[(0,r.jsx)(Vf.Z,{user:t,className:td().userTag,discriminatorClass:td().discriminator}),(0,r.jsx)(Ed,{user:t})]}),(0,r.jsx)(Wf.Z,{className:td().badgeList,user:t,premiumSince:null==n?void 0:n.premiumSince,premiumGuildSince:null==n?void 0:n.premiumGuildSince,size:Wf.V.SIZE_22,openPremiumSettings:md})]}),(0,r.jsx)(c.zxk,{onClick:yd,size:c.zxk.Sizes.SMALL,children:x.Z.Messages.USER_SETTINGS_EDIT_USER_PROFILE})]}),(0,r.jsxs)("div",{className:td().background,
children:[null!=s?(0,r.jsx)(c.xvT,{className:td().avatarError,variant:"text-xs/normal",color:"text-danger",children:s}):null,(0,r.jsxs)("div",{className:td().fieldList,children:[(0,r.jsx)(fd,{user:t}),(0,r.jsx)(pd,{className:td().fieldSpacer,user:t}),(0,r.jsx)(hd,{className:td().fieldSpacer,user:t})]})]})]})}var gd=n(528562);function Od(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function vd(e){vd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return vd(e)}function _d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Od(e,t,n[t])}))}return e}function Id(e,t){t=null!=t?t:{}
;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Sd(e,t){return!t||"object"!==Nd(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Td(e,t){Td=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Td(e,t)}var Nd=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Ad(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{
Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=vd(e);if(t){var o=vd(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Sd(this,n)}}var Cd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Td(e,t)}(o,e);var t=Ad(o);function o(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var n;(n=t.call(this,e)).state={disableAccountErrorMessage:null,shouldRenderOwnedGuildsModal:!1,shouldRenderDeleteAccountConfirmModal:!1,shouldRenderDisableAccountErrorModal:!1};return n}var i=o.prototype;i.componentDidMount=function(){var e=this.props.currentUser;(0,Bs.Z)(e.id,e.getAvatarURL(void 0,80))};i.componentWillUnmount=function(){
_u.Z.clearBackupCodes();(0,f.Zy)()};i.renderAccountWarning=function(){var e=this.props.currentUser;if(!e.isClaimed()){var t=(0,r.jsxs)("section",{children:[(0,r.jsx)("div",{className:Sf().accountWarningBodyText,children:x.Z.Messages.UNCLAIMED_ACCOUNT_BODY_2}),(0,r.jsx)(c.zxk,{look:c.iLD.INVERTED,size:c.PhG.SMALL,color:c.zxk.Colors.RED,onClick:function(){return ju()},children:x.Z.Messages.CLAIM_ACCOUNT_LONG})]});return(0,r.jsx)(c.ToO,{type:c.ToO.Types.DANGER,className:fe().marginBottom20,imageData:{src:n(350672),width:60,height:60},title:x.Z.Messages.UNCLAIMED_ACCOUNT_TITLE,body:t})}if(null==e.email)return null;if(!e.verified){var o=(0,r.jsxs)("section",{children:[(0,r.jsx)("div",{className:Sf().accountWarningBodyText,children:x.Z.Messages.USER_SETTINGS_UNVERIFIED_EMAIL_BODY}),(0,r.jsx)(Mu.Z,{size:c.PhG.SMALL,color:c.zxk.Colors.PRIMARY})]});return(0,r.jsx)(c.ToO,{type:c.ToO.Types.PRIMARY,className:fe().marginBottom20,imageData:{src:n(24264),width:60,height:60},
title:x.Z.Messages.UNVERIFIED_EMAIL_TITLE,body:o})}};i.renderAccountSettings=function(){return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.USER_SETTINGS_MY_ACCOUNT,className:Sf().userSettingsAccount,children:[this.renderAccountWarning(),(0,r.jsx)(bd,{})]})};i.renderSecuritySettings=function(){var e=this.props,t=e.backupCodes,o=e.currentUser,i=e.theme===B.BRd.DARK?n(273361):n(129428);return(0,r.jsxs)(c.hjN,{className:v()(Sf().userSettingsSecurity,fe().marginTop40),title:x.Z.Messages.USER_SETTINGS_ACCOUNT_PASSWORD_AND_AUTHENTICATION,tag:"h1",children:[(0,r.jsx)("div",{children:(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,className:Sf().changePasswordButton,onClick:function(){return(0,c.h7j)((function(e){return(0,r.jsx)(gd.default,Id(_d({},e),{onSuccess:e.onClose}))}))},children:x.Z.Messages.CHANGE_PASSWORD})}),(0,r.jsxs)(ae.Z,{align:ae.Z.Align.STRETCH,children:[(0,r.jsx)(ae.Z.Child,{wrap:!0,children:(0,r.jsx)(kf,{backupCodes:t})}),o.mfaEnabled?null:(0,r.jsx)(ae.Z,{
align:ae.Z.Align.CENTER,basis:"323px",grow:0,children:(0,r.jsx)("img",{src:i,className:Sf().userSettingsSecurityImage,alt:""})})]})]})};i.renderConfirmModals=function(){var e=this,t=this.state,n=t.shouldRenderOwnedGuildsModal,o=t.shouldRenderDeleteAccountConfirmModal,i=t.shouldRenderDisableAccountErrorModal,a=t.disableAccountErrorMessage;if(n){var s=function(){return e.setState({shouldRenderOwnedGuildsModal:!1})};return(0,r.jsx)(c.sYh,{dismissable:!0,header:x.Z.Messages.DELETE_ACCOUNT_TRANSFER_OWNERSHIP,confirmText:x.Z.Messages.OKAY,confirmButtonColor:c.Ttl.BRAND,onCancel:s,onConfirm:s,children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:x.Z.Messages.DELETE_ACCOUNT_TRANSFER_OWNERSHIP_BODY})})}if(o){var l=function(){return e.setState({shouldRenderDeleteAccountConfirmModal:!1})};return(0,r.jsx)(c.sYh,{dismissable:!0,header:x.Z.Messages.DELETE_ACCOUNT,confirmText:x.Z.Messages.DELETE_ACCOUNT,cancelText:x.Z.Messages.CANCEL,onCancel:l,onConfirm:function(){return(0,f.ss)("",!0).then(l)
},children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:x.Z.Messages.DELETE_ACCOUNT_BODY})})}if(i){var u=function(){return e.setState({shouldRenderDisableAccountErrorModal:!1,disableAccountErrorMessage:null})};return(0,r.jsx)(c.sYh,{dismissable:!0,header:x.Z.Messages.DELETE_ACCOUNT_ERROR,confirmText:x.Z.Messages.OKAY,confirmButtonColor:c.Ttl.BRAND,onCancel:u,onConfirm:u,children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:a})})}};i.render=function(){var e=this;if(this.props.hide)return(0,r.jsx)(Pt.Z,{});var t=this.props.currentUser;return(0,r.jsxs)("div",{children:[this.renderConfirmModals(),this.renderAccountSettings(),t.isClaimed()?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.$i$,{className:fe().marginTop40}),this.renderSecuritySettings(),(0,r.jsx)(c.$i$,{className:fe().marginTop40})]}):null,(0,r.jsx)(Hf,{className:fe().marginTop40,currentUser:t,handleDisableAccount:function(){return e.handleDisableAccount(!1)},handleDeleteAccount:function(){
return e.handleDisableAccount(!0)}})]})};i.handleDisableAccountError=function(e){if(e.body.code===B.evJ.INVALID_PASSWORD)throw e;this.setState({shouldRenderDisableAccountErrorModal:!0,disableAccountErrorMessage:e.body.message})};i.handleSubmitDisableAccount=function(e,t){return(0,f.ss)(e,t).then(B.dG4,this.handleDisableAccountError)};i.handleDisableAccount=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this,n=this.props.currentUser,o=an.Z.getGuilds(),i=Object.keys(o).filter((function(e){return o[e].ownerId===n.id}));i.length>0?this.setState({shouldRenderOwnedGuildsModal:!0}):n.isClaimed()?(0,c.h7j)((function(n){return(0,r.jsx)(Iu.default,Id(_d({},n),{handleSubmit:function(n){return t.handleSubmitDisableAccount(n,e)},title:e?x.Z.Messages.DELETE_ACCOUNT:x.Z.Messages.DISABLE_ACCOUNT,actionText:e?x.Z.Messages.DELETE_ACCOUNT:x.Z.Messages.DISABLE_ACCOUNT,children:e?x.Z.Messages.DELETE_ACCOUNT_BODY:x.Z.Messages.DISABLE_ACCOUNT_BODY}))})):this.setState({
shouldRenderDeleteAccountConfirmModal:!0})};return o}(o.PureComponent);const Pd=function(){var e=(0,y.e7)([Lr.default],(function(){var e=Lr.default.getCurrentUser();L()(null!=e,"ConnectedUserAccountSettings: currentUser cannot be undefined");return e})),t=(0,y.e7)([Ru.Z],(function(){return Ru.Z.getBackupCodes()})),n=(0,y.e7)([Rr.Z],(function(){return Rr.Z.hidePersonalInformation})),o=(0,y.e7)([xu.Z],(function(){return xu.Z.theme}));return(0,r.jsx)(Cd,{currentUser:e,backupCodes:t,hide:n,theme:o})};function jd(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Rd(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n
}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function xd(e){var t=function(){ni.SE.updateSetting(e?Object.keys(an.Z.getGuilds()):[])};(0,c.h7j)((function(e){return(0,r.jsx)(c.sm4,Rd(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){jd(e,t,n[t])}))}return e}({header:x.Z.Messages.USER_DM_SETTINGS_TITLE,confirmText:x.Z.Messages.NO_TEXT,cancelText:x.Z.Messages.YES_TEXT,onCancel:t,confirmButtonColor:c.zxk.Colors.BRAND},e),{children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:x.Z.Messages.ACTIVITY_RESTRICTION_MODAL_DESC})}))}))}function Md(){
var e=ni.G6.useSetting(),t=ni.Wz.useSetting(),n=Yc.FB?x.Z.Messages.SHOW_CURRENT_ACTIVITY_DESC_EMBEDDED:x.Z.Messages.SHOW_CURRENT_ACTIVITY_DESC;return(0,r.jsxs)(c.hjN,{className:fe().marginBottom40,children:[(0,r.jsx)(c.vwX,{tag:c.RB0.H5,className:fe().marginBottom8,children:x.Z.Messages.ACTIVITY_STATUS}),(0,r.jsx)(c.j7V,{value:e,onChange:function(e){return ni.G6.updateSetting(e)},note:n,children:x.Z.Messages.SHOW_CURRENT_ACTIVITY}),(0,r.jsx)(c.j7V,{value:!t,note:x.Z.Messages.ACTIVITY_RESTRICTION_DEFAULT_NOTE.format({helpdeskArticle:ta.Z.getArticleURL(B.BhN.ACTIVITY_STATUS_SETTINGS)}),onChange:function(e){return function(e){ni.Wz.updateSetting(e);xd(e)}(!e)},children:x.Z.Messages.ACTIVITY_RESTRICTION_DEFAULT})]})}function wd(){var e=ni.cP.useSetting(),t=ni.Ou.useSetting();return(0,r.jsxs)(c.hjN,{className:fe().marginBottom40,children:[(0,r.jsx)(c.vwX,{tag:c.RB0.H5,className:fe().marginBottom8,children:x.Z.Messages.ACTIVITY_PARTY_PRIVACY}),(0,r.jsx)(c.j7V,{value:e,
note:x.Z.Messages.ACTIVITY_PARTY_PRIVACY_FRIENDS_HELP,onChange:function(e){return ni.cP.updateSetting(e)},children:x.Z.Messages.ACTIVITY_PARTY_PRIVACY_FRIENDS}),(0,r.jsx)(c.j7V,{value:t,note:x.Z.Messages.ACTIVITY_PARTY_PRIVACY_VOICE_CHANNEL_HELP,onChange:function(e){return ni.Ou.updateSetting(e)},children:x.Z.Messages.ACTIVITY_PARTY_PRIVACY_VOICE_CHANNEL})]})}function Dd(){return(0,r.jsx)(c.hjN,{className:fe().marginBottom40,children:(0,r.jsx)(c.ToO,{type:c.ToO.Types.PRIMARY,body:x.Z.Messages.USER_SETTINGS_PRIVACY_TERMS.format({termsLink:B.EYA.TERMS,privacyLink:B.EYA.PRIVACY})})})}function Zd(){return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.ACTIVITY_PRIVACY,children:[(0,r.jsx)(Md,{}),(0,r.jsx)(wd,{}),(0,r.jsx)(Dd,{})]})}var Ld=n(517716),Ud=n(122012),kd=n(560213),Gd=n(761814),Bd=n(325213),Hd=n(84894),Vd=n(513499),Fd=n.n(Vd);function Yd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zd(e,t,n,r,o,i,a){try{
var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Wd(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){zd(i,r,o,a,s,"next",e)}function s(e){zd(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Kd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yd(e,t)}(e,t)||function(){
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var qd,Xd=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}
if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(e){e.LOCALHOST="localhost";e.PROXY="proxy"}(qd||(qd={}));function Qd(e,t,n){if(null==e)return null;switch(e){case qd.LOCALHOST:return"https://localhost:".concat(t);case qd.PROXY:return(0,Hd.Z)(n)}}function $d(e){var t=e.onClose,n=e.transitionState,i=(0,y.cj)([Bd.Z],(function(){return{authorizedApplicationId:Bd.Z.testModeApplicationId,authorizationError:Bd.Z.error,authorizing:Bd.Z.isFetchingAuthorization}})),a=i.authorizedApplicationId,s=i.authorizationError,u=i.authorizing,f=Kd(o.useState(null!=a?a:""),2),d=f[0],p=f[1],h=Kd(o.useState("8080"),2),E=h[0],m=h[1],b=Kd(o.useState(qd.LOCALHOST),2),g=b[0],O=b[1],v=(0,Jt.Dt)(),_=B.jns.test(d);o.useEffect((function(){return function(){return l.Z.wait((function(){return Ld.q$()
}))}}),[]);function I(){return(I=Wd((function(){var e;return Xd(this,(function(n){switch(n.label){case 0:Ld.q$();e=Qd(g,E,d);return[4,Ld.Wt(d,e)];case 1:null!=n.sent()&&t();return[2]}}))}))).apply(this,arguments)}var S=null!=a&&a===d,T=S?function(){Ld.mc();p("");O(null)}:function(){return I.apply(this,arguments)};return(0,r.jsxs)(c.Y0X,{"aria-labelledby":v,transitionState:n,children:[(0,r.jsxs)(c.xBx,{justify:ae.Z.Justify.BETWEEN,separator:!1,children:[(0,r.jsx)(c.vwX,{id:v,tag:"h1",className:fe().marginReset,children:x.Z.Messages.DEVELOPER_APPLICATION_TEST_MODE_MODAL_HEADER}),(0,r.jsx)(c.olH,{onClick:t})]}),(0,r.jsxs)(c.hzk,{className:Fd().modalContent,children:[(0,r.jsx)(c.R94,{className:fe().marginBottom20,type:c.R94.Types.DESCRIPTION,children:x.Z.Messages.DEVELOPER_APPLICATION_TEST_MODE_MODAL_BODY}),null==s?null:(0,r.jsx)(c.kzN,{className:fe().marginBottom20,children:s}),(0,r.jsx)("form",{onSubmit:function(e){e.preventDefault();T()},children:(0,r.jsxs)(ae.Z,{
direction:ae.Z.Direction.VERTICAL,align:ae.Z.Align.START,children:[(0,r.jsx)(c.xJW,{className:Fd().inputWrapper,title:x.Z.Messages.DEVELOPER_APPLICATION_TEST_MODE_PLACEHOLDER,required:!0,children:(0,r.jsx)(c.oil,{value:d,maxLength:19,error:_?null:x.Z.Messages.DEVELOPER_APPLICATION_TEST_MODE_INVALID,onChange:function(e){p(e)},disabled:u})}),(0,r.jsx)(c.xJW,{className:Fd().inputWrapper,title:x.Z.Messages.DEVELOPER_APPLICATION_TEST_MODE_ORIGIN_LABEL,children:(0,r.jsx)(c.q4e,{isDisabled:!_||""===d,value:g,options:[{value:qd.LOCALHOST,label:x.Z.Messages.DEVELOPER_APPLICATION_TEST_MODE_LOCALHOST_OPTION,key:"localhost"},{value:qd.PROXY,label:x.Z.Messages.DEVELOPER_APPLICATION_TEST_MODE_PROXY_OPTION,key:"proxy"}],onChange:function(e){O(e)},placeholder:"URL Origin Type"})}),g!==qd.LOCALHOST?null:(0,r.jsx)(c.xJW,{className:Fd().inputWrapper,title:x.Z.Messages.DEVELOPER_APPLICATION_TEST_MODE_PORT_NUMBER_LABEL,required:!0,children:(0,r.jsx)(c.oil,{value:E,maxLength:5,onChange:function(e){
return m(e)},disabled:u})}),(0,r.jsx)(c.zxk,{submitting:u,type:"submit",disabled:!_||0===d.length||g===qd.LOCALHOST&&0===E.length,color:S?c.zxk.Colors.RED:c.zxk.Colors.GREEN,children:S?x.Z.Messages.DEVELOPER_APPLICATION_TEST_MODE_CLEAR:x.Z.Messages.DEVELOPER_APPLICATION_TEST_MODE_ACTIVATE})]})})]})]})}var Jd=n(867761),ep=n.n(Jd);function tp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function np(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function rp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){np(e,t,n[t])}))}return e}function op(e,t){t=null!=t?t:{}
;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function ip(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return tp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name)
;if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ap(){var e=(0,y.e7)([kd.Z],(function(){return kd.Z.getIsEnabled()}),[]),t=ip(o.useState((function(){return qf.default.getEnableHardwareAcceleration()})),1)[0],n=ni.bm.useSetting(),i=ni.Sb.useSetting(),a=ni.xU.useSetting(),l=(0,y.cj)([Bd.Z,Gd.Z],(function(){return{hasLibraryApplication:Gd.Z.hasLibraryApplication(),testModeApplicationId:Bd.Z.testModeApplicationId}})),u=l.hasLibraryApplication,f=l.testModeApplicationId,d=o.useCallback((function(e){ni.bm.updateSetting(!e)}),[]),p=o.useCallback((function(e){e?(0,c.h7j)((function(e){return(0,r.jsx)($d,rp({},e))})):Ld.mc()}),[]),h=o.useCallback((function(e){(0,c.h7j)((function(t){return(0,r.jsx)(c.sm4,op(rp({
header:x.Z.Messages.SWITCH_HARDWARE_ACCELERATION,confirmText:x.Z.Messages.OKAY,cancelText:x.Z.Messages.CANCEL,onConfirm:function(){return qf.default.setEnableHardwareAcceleration(e)}},t),{children:(0,r.jsx)(c.xvT,{variant:"text-sm/normal",children:x.Z.Messages.SWITCH_HARDWARE_ACCELERATION_BODY})}))}))}),[]),E=o.useCallback((function(e){ni.xU.updateSetting(!e)}),[]);return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.SETTINGS_ADVANCED,children:[gf.wS&&(0,r.jsx)(c.j7V,{value:i,onChange:ni.Sb.updateSetting,note:x.Z.Messages.DEVELOPER_MODE_HELP_TEXT.format({apiDocsUrl:B.EYA.API_DOCS}),children:x.Z.Messages.DEVELOPER_MODE}),Yc.FB&&(0,r.jsx)(c.j7V,{value:t,onChange:h,note:x.Z.Messages.HARDWARE_ACCELERATION_HELP_TEXT,children:x.Z.Messages.HARDWARE_ACCELERATION}),u&&(0,r.jsx)(c.j7V,{value:!n,onChange:d,note:x.Z.Messages.USER_SETTINGS_SHOW_LIBRARY_NOTE,children:x.Z.Messages.USER_SETTINGS_SHOW_LIBRARY}),i&&(0,r.jsx)(c.j7V,{value:null!=f,note:x.Z.Messages.DEVELOPER_APPLICATION_TEST_MODE_NOTE,
onChange:p,children:x.Z.Messages.DEVELOPER_APPLICATION_TEST_MODE}),i&&(0,r.jsx)(c.j7V,{value:e,note:x.Z.Messages.DEVELOPER_ACTIVITY_SHELF_NOTE,onChange:Ud.d,children:x.Z.Messages.DEVELOPER_ACTIVITY_SHELF}),(0,r.jsx)(c.j7V,{value:!a,note:x.Z.Messages.USER_SETTINGS_HOME_AUTO_NAV_HELP_TEXT.format({helpCenterLink:ta.Z.getArticleURL(B.BhN.GUILD_HOME)}),onChange:E,children:(0,r.jsxs)("div",{className:ep().badgedItem,children:[x.Z.Messages.USER_SETTINGS_HOME_AUTO_NAV,(0,r.jsx)(tn.IG,{text:x.Z.Messages.BETA,color:s.Z.unsafe_rawColors.BRAND_500.css,className:ep().betaTag})]})})]})}var sp=n(944010),cp=n(241166),lp=n(908259),up=n(846531),fp=n(111603),dp=n(379991),pp=n(72725),hp=n(900659),Ep=n(777350),yp=n.n(Ep),mp=function(){(0,Hs.EW)(a.z$.CLIENT_THEMES_SPARKLE_PREVIEW,{dismissAction:jc.L.PRIMARY,forceTrack:!0});(0,pp.bM)();(0,Se.xf)()},bp=function(){var e=(0,E.Z)($n.Z.USER_SETTINGS).analyticsLocations,t=(0,y.e7)([lp.Z],(function(){return lp.Z.isPreview}));o.useEffect((function(){
t&&Dr.default.track(B.rMx.PREMIUM_UPSELL_VIEWED,{type:Br.cd.PREMIUM_CLIENT_THEME_TRY_IT_OUT,location_stack:e})}),[t,e]);return(0,r.jsxs)("div",{children:[(0,r.jsxs)(hp.ZP,{type:hp.yH.SETTINGS,children:[(0,r.jsx)(hp.ZP.Basic,{className:yp().basicThemeSelectors}),(0,r.jsx)(Yi,{className:yp().featureBorder,isShown:t,type:Zi.PREMIUM,children:(0,r.jsx)(hp.ZP.Gradient,{disabled:t,renderCTAButtons:function(){return t?(0,r.jsxs)("div",{className:yp().tryItOutButtons,children:[(0,r.jsx)(c.zxk,{color:c.zxk.Colors.PRIMARY,onClick:function(){return mp()},children:x.Z.Messages.USER_SETTINGS_APPEARANCE_PREVIEW_THEME_TITLE}),(0,r.jsx)(as.Z,{subscriptionTier:Br.Si.TIER_2,buttonText:x.Z.Messages.USER_SETTINGS_CUSTOMIZATION_UPSELL,className:yp().premiumCta})]}):null}})})]}),(0,r.jsx)(c.$i$,{className:fe().marginTop20})]})},gp=function(){var e=(0,up.Z)().hasSidebarEditor,t=(0,y.e7)([lp.Z],(function(){return lp.Z.isPreview}));return!e||t?null:(0,r.jsx)(c.zxk,{size:c.PhG.SMALL,onClick:function(){
return mp()},children:x.Z.Messages.USER_SETTINGS_APPEARANCE_PREVIEW_THEMES_TITLE})},Op=n(446879),vp=n(493254),_p=n(57373),Ip=n(450331),Sp=n.n(Ip);function Tp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Np(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Ap(e){Ap=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Ap(e)}function Cp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Np(e,t,n[t])}))}return e}function Pp(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e)
;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function jp(e,t){return!t||"object"!==xp(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Rp(e,t){Rp=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Rp(e,t)}var xp=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Mp(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Ap(e);if(t){
var o=Ap(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return jp(this,n)}}var wp="cozy",Dp="compact",Zp=(0,Jt.hQ)(),Lp=(0,Jt.hQ)(),Up=(0,Jt.hQ)(),kp=(0,Jt.hQ)(),Gp="1337",Bp=function(e){var t=0;return[(0,Ll.e5)(Pp(Cp({},(0,Ul.ZP)({channelId:Gp,content:x.Z.Messages.USER_SETTINGS_APPEARANCE_PREVIEW_MESSAGE_1})),{state:B.yb.SENT,id:"".concat(t++)})),(0,Ll.e5)(Pp(Cp({},(0,Ul.ZP)({channelId:Gp,content:e===B.BRd.DARK?x.Z.Messages.USER_SETTINGS_APPEARANCE_PREVIEW_MESSAGE_2_DARK:x.Z.Messages.USER_SETTINGS_APPEARANCE_PREVIEW_MESSAGE_2_LIGHT})),{state:B.yb.SENT,id:"".concat(t++)})),(0,Ll.e5)(Pp(Cp({},(0,Ul.ZP)({channelId:Gp,content:x.Z.Messages.USER_SETTINGS_APPEARANCE_PREVIEW_MESSAGE_3})),{state:B.yb.SENT,id:"".concat(t++)})),(0,Ll.e5)(Pp(Cp({},(0,Ul.ZP)({channelId:Gp,content:x.Z.Messages.USER_SETTINGS_APPEARANCE_PREVIEW_MESSAGE_4})),{state:B.yb.SENT,id:"".concat(t++)})),(0,Ll.e5)(Pp(Cp({},(0,Ul.ZP)({channelId:Gp,
content:x.Z.Messages.USER_SETTINGS_APPEARANCE_PREVIEW_MESSAGE_5})),{state:B.yb.SENT,id:"".concat(4)}))]},Hp=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Rp(e,t)}(n,e);var t=Mp(n);function n(){Tp(this,n);var e;(e=t.apply(this,arguments)).darkMessages=Bp(B.BRd.DARK);e.lightMessages=Bp(B.BRd.LIGHT);e.state={isUsingCustomTheme:Object.values(e.props.clientTheme).some((function(e){return null!=e}))};e.handleThemeChange=function(t){var n=t.value;"system"!==n&&"custom"!==n&&sp.ZP.updateTheme(n);e.setState({isUsingCustomTheme:"custom"===n});sp.ZP.updatedUnsyncedSettings({useSystemTheme:"system"===n?Op.K.ON:Op.K.OFF})};e.handleDisplayCompactAvatarsChanged=function(e){sp.ZP.updatedUnsyncedSettings({displayCompactAvatars:e})};e.handleMessageDisplayModeChange=function(e){var t=e.value;ni.jU.updateSetting(t===Dp)
;(0,wl.ZZ)()};return e}var o=n.prototype;o.getPreviewMessage=function(e){return e===B.BRd.DARK?x.Z.Messages.USER_SETTINGS_APPEARANCE_PREVIEW_MESSAGE_2_DARK:x.Z.Messages.USER_SETTINGS_APPEARANCE_PREVIEW_MESSAGE_2_LIGHT};o.renderZoomSlider=function(){return Yc.FB?(0,r.jsxs)(c.xJW,{className:fe().marginTop20,children:[(0,r.jsx)(c.vwX,{id:Lp,tag:c.RB0.H5,className:fe().marginBottom8,children:x.Z.Messages.ACCESSIBILITY_ZOOM_LEVEL_LABEL}),(0,r.jsx)(c.iRW,{className:v()(fe().marginTop20,fe().marginBottom4),initialValue:this.props.zoom,defaultValue:B.yqN.ZOOM_DEFAULT,markers:B.yqN.ZOOM_SCALES,stickToMarkers:!0,onValueChange:this.handleZoomChange,onValueRender:this.handleSliderRender,"aria-labelledby":Lp}),(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,children:x.Z.Messages.USER_SETTINGS_APPEARANCE_ZOOM_TIP.format({modKey:cp.Z.modKey})})]}):null};o.renderFontScaleSlider=function(){return(0,r.jsxs)(c.xJW,{className:fe().marginTop20,children:[(0,r.jsx)(c.vwX,{id:Up,tag:c.RB0.H5,
className:fe().marginBottom8,children:x.Z.Messages.ACCESSIBILITY_FONT_SCALING_LABEL}),(0,r.jsx)(ae.Z,{align:ae.Z.Align.CENTER,children:(0,r.jsx)(c.iRW,{className:v()(fe().marginTop20,fe().marginBottom4),initialValue:this.props.fontSize,defaultValue:B.yqN.FONT_SIZE_DEFAULT,markers:B.yqN.FONT_SIZES,stickToMarkers:!0,onValueChange:this.handleFontSizeChange,onValueRender:this.handleSliderRenderPX,onMarkerRender:this.handleSliderRenderPX,getAriaValueText:this.handleSliderValueText,"aria-labelledby":Up})})]})};o.renderMessageGroupSpacingSlider=function(){var e=this.props,t=e.messageDisplayCompact,n=e.messageGroupSpacing;return(0,r.jsxs)(c.xJW,{className:fe().marginTop20,children:[(0,r.jsx)(c.vwX,{id:kp,tag:c.RB0.H5,className:fe().marginBottom8,children:x.Z.Messages.ACCESSIBILITY_MESSAGE_GROUP_SPACING}),(0,r.jsx)(c.iRW,{className:v()(fe().marginTop20,fe().marginBottom4),initialValue:n,defaultValue:t?vp.c8:vp.pq,markers:vp.fP,stickToMarkers:!0,onValueChange:this.handleMessageSpacingChange,
onValueRender:this.handleSliderRenderPX,onMarkerRender:this.handleSliderRenderPX,getAriaValueText:this.handleSliderValueText,"aria-labelledby":kp})]})};o.renderPreview=function(){var e=this.props,t=e.messageDisplayCompact,n=e.theme,o=e.messageGroupSpacing,i=e.hideSimpleEmbedContent,a=n===B.BRd.DARK?this.darkMessages:this.lightMessages;return(0,r.jsx)(c.Rny,{children:(0,r.jsx)(c.Zbd,{className:v()(Sp().preview,fe().marginBottom40,t?Sp().compactPreview:void 0,"group-spacing-".concat(null!=o?o:t?vp.c8:vp.pq)),outline:!0,"aria-hidden":!0,children:a.map((function(e,n){return(0,r.jsx)(Gl.Z,{author:(0,kl.ZH)(e),message:e,compact:t,isGroupStart:n%2==0,className:0===n?Sp().firstMessage:void 0,hideSimpleEmbedContent:i},e.id)}))})})};o.getThemeOptions=function(){var e=[{name:x.Z.Messages.THEME_DARK,value:B.BRd.DARK},{name:x.Z.Messages.THEME_LIGHT,value:B.BRd.LIGHT},{name:x.Z.Messages.THEME_SYSTEM,value:"system"}];this.props.hasClientThemes&&e.push({name:x.Z.Messages.THEME_CUSTOM,value:"custom"})
;return e};o.getThemeValue=function(){var e=this.props,t=e.theme,n=e.useSystemTheme,r=e.useAMOLEDTheme,o=e.useForcedColors;return e.hasClientThemes&&this.state.isUsingCustomTheme?"custom":n===Op.K.ON||o?"system":r===_p.W.ON?B.BRd.DARK:t};o.renderTheme=function(){var e=this.props,t=e.theme,n=e.useForcedColors,o=e.useAMOLEDTheme,i=e.darkSidebar,a=e.hasSidebarEditor,s=e.gradientPreset,l=fp.Z.getCurrentConfig({}).enabledAMOLEDThemeOption,u=this.getThemeValue();return(0,r.jsxs)(c.xJW,{className:fe().marginTop8,title:(0,r.jsxs)("div",{className:Sp().themeTitle,children:[(0,r.jsx)("div",{className:Sp().title,children:x.Z.Messages.THEME}),(0,r.jsx)(gp,{})]}),children:[n&&(0,r.jsx)(c.R94,{type:c.R94.Types.DEFAULT,className:Sp().forcedColorsWarning,children:(0,Zl.b)()?x.Z.Messages.THEME_DISABLED_FOR_CONTRAST_SYNC.format({onClick:function(){d.Z.open(B.oAB.ACCESSIBILITY)}}):x.Z.Messages.THEME_DISABLED_FOR_FORCED_COLORS}),a?(0,r.jsx)(bp,{}):(0,r.jsx)(c.Eep,{options:this.getThemeOptions(),
onChange:this.handleThemeChange,value:u,disabled:o===_p.W.ON,"aria-labelledby":Zp}),l&&(0,r.jsx)(c.j7V,{value:o===_p.W.ON,onChange:this.handleAMOLEDThemeChange,className:fe().marginTop20,note:x.Z.Messages.EXPERIMENTAL_AMOLED_MODE_NOTE,children:"AMOLED Mode (Staff Only)"}),(0,r.jsx)(c.j7V,{value:i&&t===B.BRd.LIGHT&&!n,disabled:t!==B.BRd.LIGHT||n||null!=s,onChange:this.handleDarkSidebarChecked,className:fe().marginTop20,children:x.Z.Messages.ACCESSIBILITY_DARK_SIDEBAR})]})};o.renderDisplayMode=function(){return(0,r.jsxs)(c.xJW,{title:x.Z.Messages.MESSAGE_DISPLAY_MODE_LABEL,className:fe().marginTop8,children:[(0,r.jsx)(c.Eep,{options:[{name:x.Z.Messages.COZY_MODE,value:wp},{name:x.Z.Messages.COMPACT_MODE,value:Dp}],onChange:this.handleMessageDisplayModeChange,value:this.props.messageDisplayCompact?Dp:wp}),(0,r.jsx)(c.j7V,{value:this.props.messageDisplayCompact&&this.props.displayCompactAvatars,disabled:!this.props.messageDisplayCompact,onChange:this.handleDisplayCompactAvatarsChanged,
className:fe().marginTop20,children:x.Z.Messages.DISPLAY_COMPACT_AVATARS})]})};o.handleDarkSidebarChecked=function(){(0,wl.lq)()};o.handleAMOLEDThemeChange=function(e){l.Z.dispatch({type:"UNSYNCED_USER_SETTINGS_UPDATE",settings:{useAMOLEDTheme:e?_p.W.ON:_p.W.OFF}})};o.renderScalingAndSpacing=function(){return(0,r.jsxs)(r.Fragment,{children:[this.renderFontScaleSlider(),this.renderMessageGroupSpacingSlider(),this.renderZoomSlider(),(0,r.jsx)(c.$i$,{className:fe().marginTop20})]})};o.render=function(){return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.APPEARANCE,children:[this.renderPreview(),this.renderTheme(),this.renderDisplayMode(),this.renderScalingAndSpacing(),(0,r.jsx)(c.xvT,{variant:"text-md/normal",className:fe().marginTop20,children:x.Z.Messages.APPEARANCE_SETTINGS_ACCESSIBILITY_LINK.format({onAccessibilityClick:function(){d.Z.open(B.oAB.ACCESSIBILITY)}})})]})};o.handleSliderRender=function(e){return"".concat(e.toFixed(0),"%")};o.handleSliderRenderPX=function(e){
return"".concat(e.toFixed(0),"px")};o.handleSliderValueText=function(e){return x.Z.Messages.PIXEL_VALUE_A11Y_TEXT.format({value:e})};o.handleFontSizeChange=function(e){(0,wl.oL)(e)};o.handleMessageSpacingChange=function(e){switch(e){case 0:case 4:case 8:case 16:case 24:(0,wl.ZZ)(e)}};o.handleZoomChange=function(e){(0,wl.cq)(e)};return n}(o.Component);function Vp(){var e,t=ni.jU.useSetting(),n=ni.RS.useSetting(),i=ni.NA.useSetting(),s=(0,up.Z)(),c=s.hasClientThemes,l=s.hasSidebarEditor,u=ni.L1.useSetting();o.useEffect((function(){(0,Hs.EW)(a.z$.CLIENT_THEMES_SETTINGS_BADGE,{dismissAction:jc.L.AUTO,forceTrack:!0})}),[]);var f=(0,y.cj)([xu.Z,dp.ZP,Te.Z,Lr.default,lp.Z],(function(){var t;return{theme:xu.Z.theme,useForcedColors:Te.Z.useForcedColors,useSystemTheme:dp.ZP.useSystemTheme,useAMOLEDTheme:dp.ZP.useAMOLEDTheme,darkSidebar:xu.Z.darkSidebar,fontSize:Te.Z.fontSize,zoom:Te.Z.zoom,messageGroupSpacing:Te.Z.messageGroupSpacing,displayCompactAvatars:dp.ZP.displayCompactAvatars,
isStaff:null!==(e=null===(t=Lr.default.getCurrentUser())||void 0===t?void 0:t.isStaff)&&void 0!==e&&e,gradientPreset:lp.Z.getGradientPreset()}}));return(0,r.jsx)(Hp,Cp({messageDisplayCompact:t,hideSimpleEmbedContent:n&&i,hasClientThemes:c,hasSidebarEditor:l,clientTheme:u},f))}const Fp={fetch:function(){Hu.Z.get({url:B.ANM.OAUTH2_TOKENS,oldFormErrors:!0}).then((function(e){return l.Z.dispatch({type:"USER_AUTHORIZED_APPS_UPDATE",apps:e.body})}),(function(){return l.Z.dispatch({type:"USER_AUTHORIZED_APPS_UPDATE",apps:[]})}))},delete:function(e){var t=this;Hu.Z.delete({url:B.ANM.OAUTH2_TOKEN(e),oldFormErrors:!0}).then((function(){t.fetch()}))}};var Yp=n(895303),zp=n(582762),Wp=n(258104);const Kp=function(e){Hu.Z.put({url:B.ANM.USER_CLYDE_CONSENT,body:{consent:e}}).then((function(){l.Z.dispatch({type:"CLYDE_CONSENT_UPDATED",consent:e})})).catch((function(){}))},qp=function(){Hu.Z.get({url:B.ANM.USER_CLYDE_CONSENT}).then((function(e){l.Z.dispatch({type:"CLYDE_CONSENT_UPDATED",
consent:1===e.body.consent_status})})).catch((function(){}))};function Xp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qp(e){Qp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Qp(e)}function $p(e,t){return!t||"object"!==eh(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Jp(e,t){Jp=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Jp(e,t)}var eh=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function th(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Qp(e);if(t){
var o=Qp(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return $p(this,n)}}var nh=null;var rh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Jp(e,t)}(n,e);var t=th(n);function n(){Xp(this,n);return t.apply(this,arguments)}var r=n.prototype;r.getConsentStatus=function(){return nh};r.__getLocalVars=function(){return{consent:nh}};return n}(y.ZP.Store);rh.displayName="ClydeConsentStore";const oh=new rh(l.Z,{CLYDE_CONSENT_UPDATED:function(e){var t=e.consent;nh=t}});var ih=n(234831),ah=n(13066),sh=n(609853),ch=n(327860),lh=n(895724),uh=n(254758);function fh(e){return uh.t.XBOX_APPLICATION_ID===e||uh.M.PLAYSTATION_APPLICATION_IDS.has(e)}var dh=n(517672),ph=n(185313),hh=n.n(ph),Eh=n(468516),yh=n.n(Eh);function mh(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,
configurable:!0,writable:!0}):e[t]=n;return e}function bh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){mh(e,t,n[t])}))}return e}var gh=y.ZP.connectStores([xu.Z],(function(){return{theme:xu.Z.theme}}))(ch.ZP);function Oh(e){var t=e.application;return(0,r.jsxs)("div",{className:hh().twoWayWarning,children:[(0,r.jsx)(lh.Z,{className:hh().twoWayWarningIcon}),(0,r.jsx)(c.xvT,{color:"text-normal",variant:"text-sm/medium",children:x.Z.Messages.AUTHORIZED_APP_IS_CONNECTED_ACCOUNT.format({applicationName:t.name,onConnectionPress:function(){return d.Z.setSection(B.jXE.SETTINGS_CONNECTIONS)}})})]})}var vh=function(e){var t,n,o=e.scopes,i=e.application,a=e.onDelete,s=function(){var e=x.Z.Messages.DELETE_APP_CONFIRM_MSG;fh(i.id)&&(e=(0,
r.jsxs)(r.Fragment,{children:[e,(0,r.jsx)(dh.Z,{className:hh().infoBox,children:x.Z.Messages.AUTHORIZED_APP_IS_CONNECTED_ACCOUNT_DISCONNECT_WARNING.format({applicationName:i.name})})]}));return(0,c.h7j)((function(t){return(0,r.jsx)(Yp.default,bh({title:x.Z.Messages.DEAUTHORIZE_APP,body:e,confirmText:x.Z.Messages.DEAUTHORIZE,cancelText:x.Z.Messages.CANCEL,onConfirm:a},t))}))},l=fh(i.id);return(0,r.jsx)(c.Zbd,{className:v()(hh().authedApp,fe().marginBottom8),outline:!0,children:(0,r.jsxs)(c.y5t,{component:(t=si.ZP.getApplicationIconURL({id:i.id,icon:i.icon}),n=null!=t?(0,r.jsx)(ae.Z.Child,{className:hh().appAvatar,grow:0,children:(0,r.jsx)("img",{src:t,alt:""})}):null,(0,r.jsxs)(ae.Z,{className:v()(hh().header,fe().marginBottom20),children:[(0,r.jsxs)(ae.Z,{className:hh().headerInfo,children:[n,(0,r.jsx)(ae.Z.Child,{children:(0,r.jsx)(c.X6q,{variant:"text-sm/semibold",children:i.name})})]}),(0,r.jsx)(ae.Z.Child,{wrap:!0,grow:0,children:(0,r.jsx)(c.zxk,{className:hh().deleteApp,
color:c.Ttl.RED,look:c.iLD.OUTLINED,size:c.PhG.SMALL,onClick:s,children:x.Z.Messages.DEAUTHORIZE})})]})),children:[function(){if(null!=i.description&&""!==i.description)return(0,r.jsx)(c.xJW,{faded:!0,title:x.Z.Messages.ABOUT_THIS_APP,children:(0,r.jsx)(c.R94,{children:i.description})})}(),function(){var e=o.map((function(e){return(0,r.jsxs)("li",{className:v()(hh().permission,fe().marginTop8),children:[(0,r.jsx)("i",{className:hh().permissionCheckmark}),(0,r.jsx)(c.R94,{children:(0,ih.jW)(e,o)})]},e)}));if(e.length>0)return(0,r.jsx)(c.xJW,{faded:!0,title:x.Z.Messages.PERMISSIONS,className:fe().marginTop20,children:(0,r.jsx)("ul",{children:e})})}(),l&&(0,r.jsx)(Oh,{application:i})]})})},_h=function(){var e=(0,r.jsxs)(ae.Z,{className:v()(hh().header,fe().marginBottom20),children:[(0,r.jsxs)(ae.Z,{className:hh().headerInfo,children:[(0,r.jsx)(ae.Z.Child,{className:hh().appAvatar,grow:0,children:(0,r.jsx)("img",{src:yh(),alt:""})}),(0,r.jsx)(ae.Z.Child,{children:(0,r.jsxs)(c.X6q,{
variant:"text-sm/semibold",children:[x.Z.Messages.CLYDE_NAME,(0,r.jsx)(sh.Z,{className:hh().botTag,type:sh.H.AI})]})})]}),(0,r.jsx)(ae.Z.Child,{wrap:!0,grow:0,children:(0,r.jsx)(c.zxk,{color:c.Ttl.RED,look:c.iLD.OUTLINED,size:c.PhG.SMALL,onClick:function(){return Kp(!1)},children:x.Z.Messages.DISABLE})})]});return(0,r.jsx)(c.Zbd,{className:v()(hh().authedApp,fe().marginBottom8),outline:!0,children:(0,r.jsx)(c.y5t,{component:e,children:(0,r.jsx)(c.xJW,{faded:!0,title:x.Z.Messages.CLYDE_AUTHORIZE_HEADING,children:(0,r.jsx)(c.R94,{children:x.Z.Messages.CLYDE_AUTHORIZE_DETAILS.format({learnMoreURL:ta.Z.getArticleURL(B.BhN.CLYDE_AI)})})})})})};const Ih=function(){var e=(0,y.e7)([Rr.Z],(function(){return Rr.Z.hidePersonalInformation})),t=(0,y.e7)([ah.Z],(function(){return ah.Z.getApps()})),i=(0,y.e7)([Wp.ZP],(function(){return Wp.ZP.getSelfEmbeddedActivities()})),a=(0,y.e7)([oh],(function(){return oh.getConsentStatus()}));o.useEffect((function(){Fp.fetch();qp()}),[]);return e?(0,
r.jsx)(Pt.Z,{}):(0,r.jsx)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.AUTHORIZED_APPS,children:(0,r.jsxs)(c.y5t,{component:(0,r.jsx)(c.ToO,{className:fe().marginBottom40,type:c.sje.PRIMARY,title:x.Z.Messages.APPLICATIONS_AND_CONNECTIONS,body:x.Z.Messages.APPLICATIONS_AND_CONNECTIONS_BODY}),children:[a?(0,r.jsx)(_h,{}):null,null==t?(0,r.jsx)(c.$jN,{className:fe().marginTop20,type:c.$jN.Type.SPINNING_CIRCLE}):0===t.length?(0,r.jsxs)(gh,{className:hh().marginTop20,children:[(0,r.jsx)(ch.ox,{darkSrc:n(3874),lightSrc:n(302255),width:380,height:282}),(0,r.jsx)(ch.OZ,{note:x.Z.Messages.NO_AUTHORIZED_APPS_NOTE,children:x.Z.Messages.NO_AUTHORIZED_APPS})]}):t.map((function(e){return(0,r.jsx)(vh,bh({onDelete:function(){return function(e){var t=e.id,n=e.application;Fp.delete(t);var r=i.get(n.id);null!=r&&(0,zp.mW)({channelId:r.channelId,applicationId:n.id})}(e)}},e),e.id)}))]})})};var Sh=n(487683),Th=n(842227),Nh=n(933599),Ah=n(633878);function Ch(e,t,n){t in e?Object.defineProperty(e,t,{value:n,
enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Ph(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function jh(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function Rh(e){
var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=jh(e,["width","height","color","foreground"]);return(0,r.jsx)("svg",Ph(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Ch(e,t,n[t])}))}return e}({},(0,Ah.Z)(l)),{width:n,height:i,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{className:c,fill:s,id:"a",d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM8.9 6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2H8.9V6zM16 16h-3v3h-2v-3H8v-2h3v-3h2v3h3v2z"})}))}var xh=n(447246),Mh=n(370521),wh=n(658025),Dh=n(799105),Zh=/[^0-9/]/g;function Lh(e){var t=e.replace(Zh,"").split("/"),n=t[0],r=t[1],o=[]
;parseInt(n,10)>12&&(n=n.substring(0,1));o.push(n);(parseInt(n,10)>1||2===n.length||null!=r&&""!==r)&&o.push("/");null!=r&&""!==r&&parseInt(r,10)>99&&(r=(r+"").substring(0,2));o.push(r);return o.join("")}function Uh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kh(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Gh(e){Gh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Gh(e)}function Bh(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))
;return e}function Hh(e,t){return!t||"object"!==Fh(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Vh(e,t){Vh=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Vh(e,t)}var Fh=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Yh(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Gh(e);if(t){var o=Gh(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Hh(this,n)}}var zh=/[^0-9]/g,Wh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
;e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Vh(e,t)}(n,e);var t=Yh(n);function n(){Uh(this,n);var e;(e=t.apply(this,arguments)).selectionStart=0;e.setRef=function(t){var n=e.props.inputRef;e._inputRef=t;null!=n&&n(t)};e.handleChange=function(t,n){var r=e.props,o=r.value,i=r.onChange,a=e._inputRef;if(t!==o&&null!=a&&null!=o){var s=Lh(t),c=a.selectionStart;s===o&&s.length<=3&&o.includes("/")&&!t.includes("/")?s=s.replace(zh,""):s===o&&t.includes("/")&&!o.includes("/")&&(s+="/");s.length>t.length&&(c+=s.length-t.length);e.selectionStart=c;null!=i&&i(s,n)}};return e}var o=n.prototype;o.componentDidUpdate=function(e){var t=this._inputRef;e.value!==this.props.value&&null!=t&&t.setSelectionRange(this.selectionStart,this.selectionStart)};o.render=function(){return(0,r.jsx)(c.oil,Bh(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){kh(e,t,n[t])}))}return e}({},this.props),{inputMode:"numeric",onChange:this.handleChange,inputRef:this.setRef}))};return n}(o.PureComponent);const Kh=Wh;var qh,Xh=n(260843),Qh=n(566108),$h=n.n(Qh);function Jh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eE(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function tE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}
return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Jh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}!function(e){e.EXPIRATION_DATE="expirationDate"}(qh||(qh={}));var nE=eE({},qh.EXPIRATION_DATE,{name:qh.EXPIRATION_DATE,id:(0,Jt.hQ)(),title:function(){return x.Z.Messages.CREDIT_CARD_EXPIRATION_DATE},autoComplete:"cc-exp",placeholder:function(){return x.Z.Messages.PAYMENT_SOURCE_EXPIRATION_DATE_PLACEHOLDER},pattern:"\\d*",getClassNameForLayout:function(){return $h().width50},renderInput:function(e){return(0,r.jsx)(Kh,function(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){eE(e,t,n[t])}))}return e}({},e))}}),rE=[{fields:[nE[qh.EXPIRATION_DATE]]}];const oE=function(e){var t=e.onCardInfoChange,n=e.className,i=e.expirationDate,a=e.error,s=tE(o.useState(!1),2),c=s[0],l=s[1],u=tE(o.useState(null),2),f=u[0],d=u[1],p=tE(o.useState(i),2),h=p[0],E=p[1];o.useEffect((function(){t({expirationDate:h},null===f)}),[h,t,f]);return(0,r.jsx)(Xh.Z,{className:n,form:rE,values:{expirationDate:h},errors:null!=f?{expirationDate:f}:{},formError:a,onFieldChange:function(e){c||""===e||l(!0);c&&""===e||!(0,Dh.eH)(e)?d(x.Z.Messages.CREDIT_CARD_ERROR_EXPIRATION):d(null);E(e)}})};var iE=n(794249),aE=n(371944),sE=n.n(aE);function cE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}
function lE(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function uE(e){uE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return uE(e)}function fE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){lE(e,t,n[t])}))}return e}function dE(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function pE(e,t){return!t||"object"!==yE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function hE(e,t){hE=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return hE(e,t)}function EE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return cE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n)
;if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var yE=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function mE(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=uE(e);if(t){var o=uE(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return pE(this,n)}}var bE="isDefault",gE=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{
constructor:{value:e,writable:!0,configurable:!0}});t&&hE(e,t)}(n,e);var t=mE(n);function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var r;(r=t.call(this,e)).handleSubmit=function(e){e.preventDefault();e.stopPropagation();if(0===Object.values(r.state.dirtyFields).filter(Le.lm).length)r.props.onCancel();else{var t=r.state,n=t.billingAddress,o=t.isDefault,i=t.expiresMonth,a=t.expiresYear;r.props.onSubmit(r.props.paymentSource.id,{billingAddress:n,expiresMonth:i,expiresYear:a,isDefault:o})}};r.handleCancel=function(){r.props.onCancel()};r.handleDelete=function(){var e=r.props;(0,e.onDelete)(e.paymentSource.id)};r.handleAddressUpdate=function(e,t,n){r.setState({billingAddress:e,billingAddressValid:t,dirtyFields:dE(fE({},r.state.dirtyFields),{billingAddress:n})})};r.handleExpirationDateUpdate=function(e,t){var n=e.expirationDate;r.setState({expirationValid:t});if(null!=n&&""!==n){var o=EE(n.split("/"),2),i=o[0],a=o[1]
;r.handleFieldChange(Number(i),"expiresMonth");r.handleFieldChange(Number("".concat((new Date).getFullYear().toString().slice(0,2)).concat(a)),"expiresYear")}};r.handleFieldChange=function(e,t){if(null!=t){var n;r.setState((lE(n={},t,e),lE(n,"dirtyFields",dE(fE({},r.state.dirtyFields),lE({},t,!0))),n))}};var o,i,a,s,c,l,u,f=e.paymentSource,d=e.isDefault,p=f.billingAddress;r.state={billingAddress:{name:null!==(o=p.name)&&void 0!==o?o:"",line1:null!==(i=p.line1)&&void 0!==i?i:"",line2:null!==(a=p.line2)&&void 0!==a?a:"",country:null!==(s=p.country)&&void 0!==s?s:"",state:null!==(c=p.state)&&void 0!==c?c:"",city:null!==(l=p.city)&&void 0!==l?l:"",postalCode:null!==(u=p.postalCode)&&void 0!==u?u:""},expiresMonth:f instanceof Mh.dm?f.expiresMonth:void 0,expiresYear:f instanceof Mh.dm?f.expiresYear:void 0,billingAddressValid:!1,isDefault:d,expirationValid:!0,dirtyFields:{}};return r}var o=n.prototype;o.componentWillUnmount=function(){l.Z.wait((function(){(0,Tt._H)();(0,Tt.w7)()}))}
;o.renderError=function(){var e=this.props,t=e.updateError,n=e.removeError;return null==t||t.hasCardError()||t.hasAddressError()?null!=n?(0,r.jsx)(c.kzN,{className:sE().formError,children:n.message}):null:(0,r.jsx)(c.kzN,{className:sE().formError,children:t.message})};o.renderBillingAddressSection=function(){var e=this.state.billingAddress,t=this.props,n=t.updateError,o=function(e){return[B.HeQ.CARD,B.HeQ.VENMO].includes(e.type)&&"US"===e.country?Zn.tq?wh.Z.Layouts.SETTINGS_US_MOBILE:wh.Z.Layouts.SETTINGS_US:e.type===B.HeQ.CARD&&"US"!==e.country?Zn.tq?wh.Z.Layouts.SETTINGS_INTL_MOBILE:wh.Z.Layouts.SETTINGS_INTL:Zn.tq?wh.Z.Layouts.SETTINGS_INTL_NO_NAME_MOBILE:wh.Z.Layouts.SETTINGS_INTL_NO_NAME}(t.paymentSource);return(0,r.jsxs)("div",{className:sE().addressSection,children:[(0,r.jsx)(c.xvT,{className:sE().sectionHeader,variant:"text-sm/normal",children:x.Z.Messages.BILLING_ADDRESS}),(0,r.jsx)(wh.Z,dE(fE({},e),{mode:wh.Z.Modes.EDIT,layout:o,
onBillingAddressChange:this.handleAddressUpdate,error:n}))]})};o.renderCardExpirationSection=function(){var e=this.state,t=e.expiresMonth,n=e.expiresYear;if(null==t||null==n)return null;var o="".concat(t.toString().padStart(2,"0"),"/").concat(n.toString().padStart(2,"0").slice(-2));return(0,r.jsxs)("div",{className:sE().addressSection,children:[(0,r.jsx)(c.xvT,{className:sE().sectionHeader,variant:"text-sm/normal",children:x.Z.Messages.BILLING_STEP_CREDIT_CARD_INFORMATION}),(0,r.jsx)(oE,{expirationDate:o,onCardInfoChange:this.handleExpirationDateUpdate,error:this.props.updateError})]})};o.renderActions=function(){var e=this.props,t=e.submitting,n=e.removing,o=e.isForSubscription,i=this.state,a=i.billingAddressValid,s=i.expirationValid;return(0,r.jsxs)("div",{className:sE().formActions,children:[(0,r.jsx)("div",{className:sE().leftAlignedButtons,children:(0,r.jsxs)("div",{className:sE().disabledTooltipWrapper,children:[o?(0,r.jsx)(c.ua7,{
text:x.Z.Messages.PAYMENT_SOURCE_DELETE_DISABLED_TOOLTIP,children:function(e){return(0,r.jsx)("div",fE({"aria-hidden":!0,className:sE().disabledTooltipTarget},e))}}):null,(0,r.jsx)(c.zxk,{type:"button",disabled:o||t,submitting:n,onClick:this.handleDelete,look:c.zxk.Looks.OUTLINED,color:c.zxk.Colors.RED,size:Zn.tq?c.PhG.SMALL:c.PhG.MEDIUM,children:Zn.tq?x.Z.Messages.DELETE:x.Z.Messages.PAYMENT_SOURCE_DELETE})]})}),(0,r.jsxs)("div",{className:sE().rightAlignedButtons,children:[(0,r.jsx)(c.zxk,{type:"button",disabled:t||n,onClick:this.handleCancel,look:c.zxk.Looks.LINK,color:c.zxk.Colors.PRIMARY,size:Zn.tq?c.PhG.SMALL:c.PhG.MEDIUM,children:x.Z.Messages.CANCEL}),(0,r.jsx)(c.zxk,{submitting:t,disabled:!a||n||!s,type:"submit",color:c.zxk.Colors.GREEN,size:Zn.tq?c.PhG.SMALL:c.PhG.MEDIUM,children:x.Z.Messages.SAVE})]})]})};o.render=function(){var e=this,t=this.props,n=t.paymentSource,o=t.isDefault,i=t.locale,a=t.className,s=t.isForSubscription,l=this.state.isDefault,u=n instanceof Mh.qo
;return(0,r.jsx)(c.Zbd,{editable:!0,className:v()(sE().card,a),children:(0,r.jsxs)("form",{onSubmit:this.handleSubmit,noValidate:!0,children:[this.renderError(),(0,r.jsxs)("div",{className:sE().paymentSection,children:[(0,r.jsx)(iE.Z,{paymentSource:n,isDefault:o,isForSubscription:s,locale:i}),n.invalid?(0,r.jsx)("div",{className:sE().errorSubText,children:x.Z.Messages.PAYMENT_SOURCE_INVALID_HELP}):null,(0,r.jsx)("div",{className:sE().subText,children:u?x.Z.Messages.PAYMENT_SOURCE_EDIT_HELP_PAYPAL.format({paypalURL:B.yfF}):x.Z.Messages.PAYMENT_SOURCE_EDIT_HELP_CARD})]}),this.renderCardExpirationSection(),this.renderBillingAddressSection(),(0,r.jsx)(c.XZJ,{name:bE,value:l,onChange:function(t,n){return e.handleFieldChange(n,bE)},type:c.XZJ.Types.INVERTED,className:sE().defaultSection,children:(0,r.jsx)(c.xvT,{className:sE().defaultCheckboxLabel,variant:"text-sm/normal",children:x.Z.Messages.PAYMENT_SOURCE_MAKE_DEFAULT})}),(0,r.jsx)(c.$i$,{}),this.renderActions()]})})};return n
}(o.PureComponent);gE.defaultProps={onDelete:function(){},onSubmit:function(){},onCancel:function(){}};const OE=y.ZP.connectStores([Mr.Z],(function(){return{updateError:Mr.Z.editSourceError,removeError:Mr.Z.removeSourceError}}))(gE);var vE=n(215276),_E=n.n(vE);function IE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function SE(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function TE(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){SE(i,r,o,a,s,"next",e)}function s(e){SE(i,r,o,a,s,"throw",e)}a(void 0)}))}}function NE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AE(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function CE(e){CE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){
return e.__proto__||Object.getPrototypeOf(e)};return CE(e)}function PE(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&ME(e,t)}function jE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){AE(e,t,n[t])}))}return e}function RE(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){
Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function xE(e,t){return!t||"object"!==wE(t)&&"function"!=typeof t?IE(e):t}function ME(e,t){ME=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return ME(e,t)}var wE=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function DE(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=CE(e);if(t){var o=CE(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return xE(this,n)}}var ZE=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i
;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},LE=function(e){PE(n,e);var t=DE(n);function n(){NE(this,n);var e;(e=t.apply(this,arguments)).handleEditClick=function(){
e.props.onEditClick(e.props.paymentSource.id)};return e}n.prototype.render=function(){var e=this.props,t=e.paymentSource,n=e.isDefault,o=e.isEditing,i=e.index,a=e.hideDivider,s=e.isForSubscription,l=e.locale,u=e.removing,f=e.submitting,d=e.onSubmit,p=e.onCancel,h=e.onDelete;return o?(0,r.jsx)(OE,{paymentSource:t,isDefault:n,removing:u,submitting:f,locale:l,isForSubscription:s,onSubmit:d,onCancel:p,onDelete:h}):(0,r.jsxs)("div",{className:_E().paymentSourceItem,children:[i>0&&!a?(0,r.jsx)(c.$i$,{className:_E().sourceDivider}):null,(0,r.jsxs)(ae.Z,{align:ae.Z.Align.CENTER,justify:ae.Z.Justify.BETWEEN,className:_E().paymentSourceRow,children:[(0,r.jsx)(iE.Z,{paymentSource:t,isDefault:n,isForSubscription:s,locale:l,showSubtext:!0}),o?null:(0,r.jsx)(c.zxk,{color:c.zxk.Colors.PRIMARY,onClick:this.handleEditClick,size:c.zxk.Sizes.SMALL,children:x.Z.Messages.EDIT})]})]})};return n}(o.PureComponent);LE.defaultProps={isEditing:!1,hideDivider:!1,onEditClick:function(){}};var UE=function(e){
PE(o,e);var t=DE(o);function o(){NE(this,o);var e;(e=t.apply(this,arguments)).state={editingPayment:null};e.handleEditClick=function(t){e.setState({editingPayment:t})};e.handleCancel=function(){e.setState({editingPayment:null})};var i,a=IE(e);e.handleDelete=(i=TE((function(e){return ZE(this,(function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,Tt.xt(e)];case 1:t.sent();a.setState({editingPayment:null});return[3,3];case 2:t.sent();return[3,3];case 3:return[2]}}))})),function(e){return i.apply(this,arguments)});var s=IE(e);e.handleSubmit=function(){var e=TE((function(e,t){return ZE(this,(function(n){switch(n.label){case 0:if(null==e)return[3,4];n.label=1;case 1:n.trys.push([1,3,,4]);return[4,Tt.LI(e,t)];case 2:n.sent();s.setState({editingPayment:null});return[3,4];case 3:n.sent();return[3,4];case 4:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}();e.handlePaymentSourceAdded=function(){var e=TE((function(e){return ZE(this,(function(t){switch(t.label){
case 0:return[4,(0,xh.i1)(e.id)];case 1:t.sent();return[2]}}))}));return function(t){return e.apply(this,arguments)}}();e.handleAddPaymentMethod=function(){var t=IE(e);(0,c.ZDy)(TE((function(){var e,o;return ZE(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(38039),n.e(27059),n.e(84501)]).then(n.bind(n,184501))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,RE(jE({},e),{onAddPaymentSource:t.handlePaymentSourceAdded}))}]}}))})),{onCloseCallback:function(){(0,Nh.fw)()}})};return e}var i=o.prototype;i.renderFooter=function(){var e=this.props.paymentSources;return(0,r.jsxs)(ae.Z,{justify:ae.Z.Justify.END,className:_E().footer,children:[0===Object.keys(e).length?(0,r.jsxs)(ae.Z.Child,{children:[(0,r.jsx)(c.xvT,{variant:"text-sm/normal",children:x.Z.Messages.BILLING_NO_PAYMENT_METHOD}),(0,r.jsx)("div",{className:_E().subText,children:x.Z.Messages.BILLING_NO_PAYMENT_METHOD_DESCRIPTION})]}):null,(0,r.jsx)(c.zxk,{
onClick:this.handleAddPaymentMethod,children:x.Z.Messages.BILLING_ADD_PAYMENT_METHOD})]})};i.render=function(){var e=this,t=this.props,n=t.defaultPaymentSourceId,o=t.paymentSources,i=t.locale,a=t.removing,s=t.submitting,l=t.premiumSubscriptionPaymentSourceId,u=_e().values(o).sort((function(e,t){return e.id===n?-1:t.id===n?1:Th.default.compare(e.id,t.id)})),f=this.state.editingPayment,d=u.findIndex((function(e){return e.id===f})),p=u.map((function(t,o){return(0,r.jsx)(LE,{locale:i,paymentSource:t,isDefault:n===t.id,onCancel:e.handleCancel,onDelete:e.handleDelete,isForSubscription:t.id===l,hideDivider:d===o-1,onSubmit:e.handleSubmit,index:o,submitting:s,removing:a,isEditing:f===t.id,onEditClick:e.handleEditClick},t.id)}));return(0,r.jsxs)("div",{children:[(0,r.jsx)(c.vwX,{tag:"h1",children:(0,r.jsxs)(ae.Z,{align:ae.Z.Align.CENTER,children:[(0,r.jsx)(c.ua7,{position:"left",text:x.Z.Messages.BILLING_SECURE_TOOLTIP,children:function(e){return(0,r.jsx)(Rh,jE({className:_E().lockIcon},e))}
}),x.Z.Messages.BILLING_PAYMENT_SOURCES]})}),p,d!==u.length-1?(0,r.jsx)(c.$i$,{className:_E().sourceDivider}):null,this.renderFooter()]})};return o}(o.PureComponent);const kE=UE;var GE=n(123435),BE=n(569851),HE=n.n(BE);function VE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FE(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function YE(e){YE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return YE(e)}function zE(e,t){return!t||"object"!==KE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function WE(e,t){WE=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return WE(e,t)}var KE=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function qE(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=YE(e);if(t){var o=YE(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return zE(this,n)}}var XE=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&WE(e,t)}(n,e);var t=qE(n);function n(){VE(this,n);return t.apply(this,arguments)}var o=n.prototype;o.componentDidMount=function(){l.Z.wait((function(){Tt.tZ();Tt.jg()}))};o.handleRedemptionRedirect=function(){d.Z.setSection(B.oAB.INVENTORY)};o.render=function(){
var e=this.props,t=e.syncing,n=e.hide,o=e.paymentSources,i=e.defaultPaymentSourceId,a=e.locale,s=e.premiumSubscription,l=e.isRemovingPaymentSource,u=e.isUpdatingPaymentSource;return n?(0,r.jsx)(Pt.Z,{}):(0,r.jsxs)("div",{className:HE().userSettingsBilling,children:[t&&0===Object.keys(o).length?(0,r.jsx)("div",{className:HE().syncing,children:(0,r.jsx)(c.$jN,{})}):(0,r.jsx)(kE,{paymentSources:o,defaultPaymentSourceId:i,premiumSubscriptionPaymentSourceId:null!=s&&s.status!==B.O0b.CANCELED?s.paymentSourceId:null,locale:a,removing:l,submitting:u}),(0,r.jsx)("div",{className:HE().paymentHistory,children:(0,r.jsxs)(c.y5t,{component:(0,r.jsx)(c.vwX,{tag:"h1",children:x.Z.Messages.BILLING_PAYMENT_HISTORY}),children:[(0,r.jsx)(GE.oQ,{}),(0,r.jsx)(Sh.Z,{locale:a})]})}),(0,r.jsx)(c.Zbd,{className:HE().codeRedemptionRedirect,type:c.Zbd.Types.CUSTOM,children:x.Z.Messages.BILLING_CODE_REDEMPTION_REDIRECT.format({onClick:this.handleRedemptionRedirect})})]})};return n}(o.PureComponent);function QE(){
var e=(0,y.cj)([m.default,Mr.Z,Wt.Z,Lr.default,Rr.Z,Rt.Z],(function(){var e=Rt.Z.getPremiumTypeSubscription(),t=Lr.default.getCurrentUser();L()(null!=t,"UserSettingsBilling: currentUser cannot be undefined");return{locale:m.default.locale,hide:Rr.Z.enabled,isClaimed:t.isClaimed(),isVerified:t.verified,premiumSubscription:e,defaultPaymentSourceId:Wt.Z.defaultPaymentSourceId,paymentSources:Wt.Z.paymentSources,syncing:Mr.Z.isSyncing,isRemovingPaymentSource:Mr.Z.isRemovingPaymentSource,isUpdatingPaymentSource:Mr.Z.isUpdatingPaymentSource}}));return(0,r.jsx)(XE,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){FE(e,t,n[t])}))}return e}({},e))}
var $E=n(579344),JE=n(176785),ey=n(265688),ty=n(53645),ny=n(120434),ry=n(419087),oy=n(130962),iy=n(629223),ay=n(859917),sy=n(128181),cy=new Set([B.ABu.XBOX,B.ABu.PLAYSTATION,B.ABu.PLAYSTATION_STAGING,B.ABu.CRUNCHYROLL]);var ly=n(489655),uy=n(627342),fy=n(559805),dy=n.n(fy),py=function(e){var t=e.markAsDismissed;o.useEffect((function(){return t}),[t]);return(0,r.jsx)(tn.IG,{className:dy().newBadge,text:x.Z.Messages.NEW})},hy=function(e){var t=e.title,n=e.body,o=e.img,i=e.newIndicatorDismissibleContent,a=e.onClick;return(0,r.jsxs)("div",{className:dy().container,children:[o,(0,r.jsxs)("div",{className:dy().textContainer,children:[(0,r.jsxs)("div",{className:dy().headerText,children:[(0,r.jsx)(uy.Z,{contentTypes:[i],children:function(e){var t=e.visibleContent,n=e.markAsDismissed;return t===i?(0,r.jsx)(py,{markAsDismissed:n}):null}}),(0,r.jsx)(c.xvT,{variant:"text-md/semibold",children:t})]}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",children:n})]}),(0,r.jsx)(c.zxk,{size:c.PhG.MEDIUM,
onClick:a,className:dy().reconnectButton,children:x.Z.Messages.RECONNECT})]})},Ey=n(761869),yy=n.n(Ey),my=function(){var e=ta.Z.getArticleURL(B.BhN.PS_CONNECTION);return(0,r.jsx)(hy,{title:x.Z.Messages.PS_TWO_WAY_UPSELL_TITLE,body:x.Z.Messages.PS_TWO_WAY_UPSELL_BODY.format({help_article:e}),img:(0,r.jsx)("img",{src:yy(),width:"82",height:"auto",alt:""}),newIndicatorDismissibleContent:a.z$.PS_ONE_WAY_RECONNECT,onClick:function(){return(0,ry.Z)(B.ABu.PLAYSTATION,"PS two way upsell")}})},by=n(884217),gy=n.n(by),Oy=function(){var e=ta.Z.getArticleURL(B.BhN.XBOX_CONNECTION);return(0,r.jsx)(hy,{title:x.Z.Messages.XBOX_TWO_WAY_UPSELL_TITLE,body:x.Z.Messages.XBOX_TWO_WAY_UPSELL_BODY.format({help_article:e}),img:(0,r.jsx)("img",{src:gy(),width:"auto",height:"45",alt:""}),newIndicatorDismissibleContent:a.z$.XBOX_ONE_WAY_RECONNECT,onClick:function(){return(0,ry.Z)(B.ABu.XBOX,"Xbox two way upsell")}})},vy=n(678005),_y=n(370708),Iy=n.n(_y);function Sy(e,t){(null==t||t>e.length)&&(t=e.length)
;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ty(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Ny(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Ty(e,t,n[t])}))}return e}function Ay(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Cy(e,t){return function(e){
if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Sy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sy(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Py=function(e){var t,n,o,i=e.integration,a=(0,y.e7)([iy.Z],(function(){return iy.Z.isJoining(i.id)}),[i.id]);null!=(0,y.e7)([an.Z],(function(){
return an.Z.getGuild(i.guild.id)}),[i.guild.id])||(o=(0,r.jsx)(c.zxk,{size:c.PhG.SMALL,onClick:function(){$E.Z.joinServer(i.id,(function(){}))},disabled:a,children:(0,r.jsx)("span",{children:a?x.Z.Messages.JOINING_GUILD:x.Z.Messages.JOIN_GUILD})}));return(0,r.jsxs)("div",{className:Iy().integration,children:[(0,r.jsx)(Kt.Z,{size:Kt.Z.Sizes.SMALL,guild:i.guild,className:Iy().guildIcon}),(0,r.jsxs)("div",{className:Iy().integrationInner,children:[(0,r.jsx)(c.xvT,{variant:"text-md/semibold",color:"header-primary",children:i.guild.toString()}),(0,r.jsx)(c.eee,{href:null===(t=ey.Z.get(i.type))||void 0===t||null===(n=t.getPlatformUserUrl)||void 0===n?void 0:n.call(t,i.account),children:(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"header-secondary",children:i.account.name})})]}),o]})};function jy(e){var t=e.onDisconnect,n=e.account,i=e.theme,a=function(){(0,ry.Z)(n.type,"User Settings")},l=function(){var e=ey.Z.get(n.type),o=x.Z.Messages.DISCONNECT_ACCOUNT_BODY;(function(e){
return cy.has(e.type)&&e.twoWayLink})(n)&&(o=(0,r.jsxs)(r.Fragment,{children:[o,(0,r.jsx)(dh.Z,{className:Iy().infoBox,children:x.Z.Messages.CONNECTED_ACCOUNT_IS_AUTHORIZED_APP_DISCONNECT_WARNING.format({platformName:e.name})})]}));(0,c.h7j)((function(n){return(0,r.jsx)(Yp.default,Ny({title:x.Z.Messages.DISCONNECT_ACCOUNT_TITLE.format({name:e.name}),body:o,confirmText:x.Z.Messages.DISCONNECT_ACCOUNT,cancelText:x.Z.Messages.CANCEL,onConfirm:t},n))}))},u=function(e){var t=n.verified,r=e?1:0;if(!e||t){g(r);$E.Z.setVisibility(n.type,n.id,r)}else{C(r);(0,ry.Z)(n.type,"User Settings")}},f=function(e){var t=n.verified,r=e?1:0;if(!e||t){_(r);$E.Z.setMetadataVisibility(n.type,n.id,r)}else{R(r);(0,ry.Z)(n.type,"User Settings")}},d=function(e){y(e);$E.Z.setFriendSync(n.type,n.id,e)},p=function(e){T(e);$E.Z.setShowActivity(n.type,n.id,e)
},h=Cy(o.useState(n.friendSync),2),E=h[0],y=h[1],m=Cy(o.useState(n.visibility),2),b=m[0],g=m[1],O=Cy(o.useState(n.metadataVisibility),2),v=O[0],_=O[1],I=Cy(o.useState(n.showActivity),2),S=I[0],T=I[1],N=Cy(o.useState(null),2),A=N[0],C=N[1],P=Cy(o.useState(null),2),j=P[0],R=P[1],M=Cy(o.useState(!1),2),w=M[0],D=M[1],Z=Cy(o.useState([]),2),L=Z[0],U=Z[1],k=ey.Z.get(n.type);o.useEffect((function(){y(n.friendSync);g(n.visibility);_(n.metadataVisibility);T(n.showActivity)}),[n]);o.useEffect((function(){if(!1!==n.verified){if(null!=A){g(A);$E.Z.setVisibility(n.type,n.id,A);C(null)}if(null!=j){_(j);$E.Z.setMetadataVisibility(n.type,n.id,j);R(null)}}}),[n]);return(0,r.jsxs)("div",{className:Iy().connection,children:[function(e){var t,n=ey.Z.get(e.type),o="1"===(null!==(t=e.metadata)&&void 0!==t?t:{})[vy.PC.TWITTER_VERIFIED],a=null;n.type===B.ABu.TWITTER&&o&&(a=(0,r.jsx)(c.ua7,{text:x.Z.Messages.CONNECTION_VERIFIED_ON_TWITTER,children:function(e){return(0,r.jsx)(ay.Z,Ay(Ny({},e),{
className:Iy().connectionAccountLabelVerified,color:s.Z.unsafe_rawColors.TWITTER.css,children:(0,r.jsx)(sy.Z,{color:s.Z.unsafe_rawColors.WHITE_500.css})}))}}));return(0,r.jsxs)("div",{className:Iy().connectionHeader,children:[(0,r.jsx)("img",{alt:n.name,className:Iy().connectionIcon,src:i===B.BRd.DARK?n.icon.darkSVG:n.icon.lightSVG}),(0,r.jsxs)("div",{children:[(0,r.jsx)(c.xvT,{color:"header-primary",variant:"text-md/semibold",className:Iy().connectionAccountValue,children:(0,r.jsxs)("div",{className:Iy().connectionAccountLabelContainer,children:[e.name,a]})}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"header-secondary",className:Iy().connectionAccountLabel,children:ey.Z.get(e.type).name})]}),(0,r.jsx)(c.P3F,{className:Iy().connectionDelete,onClick:l,"aria-label":x.Z.Messages.SERVICE_CONNECTIONS_DISCONNECT,focusProps:{offset:{top:-4,left:-4,right:-4}},children:(0,r.jsx)(el.Z,{width:16,height:16})})]})}(n),function(e){return e.twoWayLink?null:e.type===B.ABu.XBOX?(0,r.jsx)("div",{
className:Iy().upsellWrapper,children:(0,r.jsx)(Oy,{})}):e.type===B.ABu.PLAYSTATION?(0,r.jsx)("div",{className:Iy().upsellWrapper,children:(0,r.jsx)(my,{})}):null}(n),function(e){var t,n=null!==(t=e.metadata)&&void 0!==t?t:{},o=null,i=(0,ny.FI)(n[vy.PC.CREATED_AT]);switch(e.type){case B.ABu.REDDIT:o=(0,ny.oP)(n,Iy().metadataItem);break;case B.ABu.STEAM:o=(0,ny.Dq)(n,Iy().metadataItem);break;case B.ABu.TWITTER:o=(0,ny.rJ)(n,Iy().metadataItem);break;case B.ABu.EBAY:o=(0,ny.ul)(n,Iy().metadataItem);break;case B.ABu.PAYPAL:o=(0,ny.li)(n,Iy().metadataItem);break;case B.ABu.TIKTOK:o=(0,ny.hf)(n,Iy().metadataItem)}if(null!==i){null==o&&(o=[]);null==o||o.push((0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"interactive-active",className:Iy().connectedAccountVanityMetadataCreatedAt,children:x.Z.Messages.CONNECTIONS_PROFILE_MEMBER_SINCE.format({date:i})},"member-since"))}var a=L.includes(e.id),s=x.Z.Messages.REFRESH;if(null==o||0===o.length){if(!0!==ey.Z.get(e.type).hasMetadata)return null
;o=[(0,r.jsx)(tn.IG,{className:Iy().connectionMetadataUpsellTag,text:x.Z.Messages.NEW},"badge"),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",className:Iy().connectionMetadataUpsellDescription,children:x.Z.Messages.CONNECTED_ACCOUNT_ADD_DETAILS_DESCRIPTION.format({helpdeskUrl:ta.Z.getArticleURL(B.BhN.CONNECTION_DETAILS)})},"label")];s=x.Z.Messages.CONNECTED_ACCOUNT_ADD_DETAILS}a&&(s=x.Z.Messages.DONE);o.push((0,r.jsx)(c.zxk,{className:Iy().metadataRefreshButton,color:a?c.zxk.Colors.GREEN:c.zxk.Colors.BRAND,size:c.zxk.Sizes.SMALL,submitting:w,disabled:a,onClick:a?void 0:function(){D(!0);$E.Z.refresh(e.type,e.id).finally((function(){setTimeout((function(){L.push(e.id);U(L);D(!1)}),2e3)}))},children:s},"refresh-button"));return(0,r.jsx)("div",{className:Iy().metadataContainer,children:o})}(n),function(e){var t,o,i,a;B.BFP.has(n.type)&&(o=(0,r.jsx)(c.j7V,{className:Iy().connectionOptionSwitch,hideBorder:!0,value:E,onChange:d,children:(0,r.jsx)(c.xvT,{variant:"text-sm/semibold",
children:x.Z.Messages.SYNC_FRIENDS})}));B.vbS.has(n.type)&&(i=(0,r.jsx)(c.j7V,{className:Iy().connectionOptionSwitch,hideBorder:!0,value:S,onChange:p,children:(0,r.jsx)(c.xvT,{variant:"text-sm/semibold",children:x.Z.Messages.DISPLAY_ACTIVITY.format({platform:e.name})})}));!0===(null===(t=ey.Z.get(n.type))||void 0===t?void 0:t.hasMetadata)&&(a=(0,r.jsx)(c.j7V,{className:Iy().connectionOptionSwitch,hideBorder:!0,value:1===v,onChange:f,disabled:1!==b||null==n.metadata,children:(0,r.jsx)(c.xvT,{variant:"text-sm/semibold",children:x.Z.Messages.DISPLAY_DETAILS_ON_PROFILE})}));return(0,r.jsx)("div",{className:Iy().connectionOptionsWrapper,children:(0,r.jsxs)("div",{className:Iy().connectionOptions,children:[(0,r.jsx)(c.j7V,{className:Iy().connectionOptionSwitch,hideBorder:!0,value:1===b,onChange:u,children:(0,r.jsx)(c.xvT,{variant:"text-sm/semibold",children:x.Z.Messages.DISPLAY_ON_PROFILE})}),a,i,o]})})}(k),function(){if(n.revoked||n.integrations.length>0)return(0,r.jsx)(c.$i$,{
className:Iy().connectedAccountSeparator})}(),n.revoked?(0,r.jsx)(c.xJW,{className:Iy().integrationsWrapper,children:(0,r.jsx)(c.R94,{className:Iy().integrationRevoked,children:x.Z.Messages.CONNECTED_ACCOUNT_REVOKED.format({onReconnect:a})})}):n.integrations.length>0?(0,r.jsxs)(c.xJW,{className:Iy().integrationsWrapper,children:[(0,r.jsx)(c.vwX,{tag:c.RB0.H5,children:(0,r.jsx)(c.xvT,{variant:"text-xs/semibold",children:x.Z.Messages.SUB_ENABLED_SERVERS})}),(0,r.jsx)("div",{children:n.integrations.map((function(e){return(0,r.jsx)(Py,{integration:e},e.id)}))})]}):void 0]})}function Ry(e){var t=e.alreadyConnectedPlatforms,n=e.excludedPlatformTypes,i=e.includedDisabledPlatformTypes;o.useEffect((function(){return function(){(0,Hs.EW)(a.z$.NEW_CRUNCHYROLL_CONNECTION,{dismissAction:jc.L.AUTO})}}),[]);return(0,r.jsxs)("div",{className:Iy().connectContainer,children:[(0,r.jsx)(c.X6q,{variant:"heading-md/bold",color:"interactive-active",className:Iy().connectHeader,
children:x.Z.Messages.CONNECTIONS_USER_SETTINGS_CONNECT_ACCOUNTS_HEADER}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"header-secondary",children:x.Z.Messages.CONNECTIONS_USER_SETTINGS_CONNECT_ACCOUNTS_DESCRIPTION.format({privacyPolicyUrl:B.EYA.PRIVACY})}),(0,r.jsx)(xy,{alreadyConnectedPlatforms:t,excludedPlatformTypes:n,includedDisabledPlatformTypes:i})]})}function xy(e){var t=e.alreadyConnectedPlatforms,n=e.excludedPlatformTypes,o=e.includedDisabledPlatformTypes,i=function(e){var t=ey.Z.get(e);(0,ry.Z)(t.type);Dr.default.track(B.rMx.ACCOUNT_LINK_STEP,{previous_step:"desktop connections",current_step:"desktop oauth",platform_type:t.type})};return(0,r.jsxs)("div",{className:Iy().connectionsContainer,children:[(0,ty.AK)(o,n,t).slice(0,10).map((function(e){return(0,r.jsx)(JE.Z,{type:e.type,className:Iy().accountButton,innerClassName:Iy().accountButtonInner},e.type)})),(0,r.jsx)(c.ua7,{text:x.Z.Messages.CONNECTIONS_VIEW_MORE,children:function(e){var t=e.onMouseEnter,a=e.onMouseLeave
;return(0,r.jsx)("div",{className:v()(Iy().accountAddWrapper,Iy().accountButton),children:(0,r.jsx)(c.tEY,{children:(0,r.jsx)("button",{onMouseEnter:t,onMouseLeave:a,className:v()(Iy().accountAddInner,Iy().accountButtonInner),type:"button",onClick:function(){return function(e){l.Z.dispatch({type:"CONNECTIONS_GRID_MODAL_SHOW",onComplete:i,excludedPlatformTypes:e,includedDisabledPlatformTypes:o})}(n)},"aria-label":x.Z.Messages.ADD_NEW_CONNECTION,children:(0,r.jsx)(Ce.Z,{height:18,width:18,"aria-label":x.Z.Messages.CONNECTIONS_VIEW_MORE})})})})}})]})}function My(e){var t,o=e.fetching,i=e.accounts,a=e.theme;t=o?(0,r.jsx)(c.$jN,{className:fe().marginTop20,type:c.$jN.Type.SPINNING_CIRCLE}):0===i.length?(0,r.jsxs)(ch.ZP,{className:fe().marginTop40,theme:a,children:[(0,r.jsx)(ch.ox,{darkSrc:n(117399),lightSrc:n(408056),width:230,height:220}),(0,r.jsx)(ch.OZ,{note:x.Z.Messages.CONNECTED_ACCOUNTS_NONE,children:x.Z.Messages.CONNECTED_ACCOUNTS_NONE_TITLE})]}):i.filter((function(e){
return ey.Z.isSupported(e.type)})).map((function(e,t){return(0,r.jsx)(jy,{theme:a,account:e,onDisconnect:function(){return function(e){var t=e.type,n=e.id;$E.Z.disconnect(t,n)}(e)}},t)}));return(0,r.jsx)(c.xJW,{className:Iy().connectionList,children:t})}const wy=function(){var e=(0,y.e7)([Rr.Z],(function(){return Rr.Z.hidePersonalInformation})),t=(0,y.e7)([iy.Z],(function(){return iy.Z.isFetching()})),n=(0,y.e7)([iy.Z],(function(){return iy.Z.getAccounts()})),i=(0,y.e7)([Lr.default],(function(){return Lr.default.getCurrentUser()})),a=(0,Uo.ZP)(),s=oy.c.useExperiment({}).allowPlayStationStaging,l=o.useMemo((function(){var e,t,n=new Set;s&&n.add(B.ABu.PLAYSTATION_STAGING);(null===(e=ty.bO[B.ABu.INSTAGRAM])||void 0===e?void 0:e.includes(null!==(t=null==i?void 0:i.id)&&void 0!==t?t:""))&&n.add(B.ABu.INSTAGRAM);return n}),[s,null==i?void 0:i.id]),u=((0,y.e7)([Ns.Z],(function(){return Ns.Z.getFlattenedGuildIds()})),(0,ly.X)()),f=o.useMemo((function(){return new Set(ey.Z.filter((function(e){
return!u(e)})).map((function(e){return e.type})))}),[u]),d=o.useMemo((function(){var e=new Set;n.forEach((function(t){return e.add(t.type)}));return e}),[n]);o.useEffect((function(){$E.Z.fetch()}),[]);return e?(0,r.jsx)(Pt.Z,{}):(0,r.jsxs)(c.hjN,{className:Iy().connections,tag:c.RB0.H1,title:x.Z.Messages.CONNECTIONS,children:[(0,r.jsx)(Ry,{alreadyConnectedPlatforms:d,excludedPlatformTypes:f,includedDisabledPlatformTypes:l}),(0,r.jsx)(My,{fetching:t,accounts:n,theme:a})]})};var Dy=n(402391),Zy=n(414523),Ly=n(762572),Uy=n(285991),ky=n(441394),Gy=n(498442),By=n(998137),Hy=n(940007),Vy=n(734620),Fy=n(91174),Yy=n(762308),zy=n(84841),Wy=n(8489),Ky=n(118044),qy=n(532548),Xy=n(688013),Qy=n(948582),$y=n(212098),Jy=n.n($y),em=n(768864),tm=n.n(em),nm=n(333286),rm=n.n(nm);function om(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function im(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
;return e}function am(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function sm(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){am(i,r,o,a,s,"next",e)}function s(e){am(i,r,o,a,s,"throw",e)}a(void 0)}))}}function cm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lm(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function um(e){um=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return um(e)}function fm(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Em(e,t)}function dm(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){lm(e,t,n[t])}))}return e}function pm(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function hm(e,t){return!t||"object"!==bm(t)&&"function"!=typeof t?im(e):t}function Em(e,t){Em=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Em(e,t)}function ym(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){
var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||gm(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mm(e){return function(e){if(Array.isArray(e))return om(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||gm(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var bm=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function gm(e,t){if(e){
if("string"==typeof e)return om(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);return"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?om(e,t):void 0}}function Om(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=um(e);if(t){var o=um(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return hm(this,n)}}var vm=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){
if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},_m=["discord_web","discord_marketing","discord_ios","discord_android"],Im=[{value:"branch",label:"Branch Name"},{value:"id",label:"Build ID"}];function Sm(e){return"discord_ios"in e||"discord_android"in e}
function Tm(e){return new Promise((function(t){(0,c.h7j)((function(n){var o=function(e){n.onClose();t(e)};return(0,r.jsxs)(c.Y0X,pm(dm({},n),{"aria-label":"Choose A Project to Override",children:[(0,r.jsx)(c.xBx,{separator:!1,children:(0,r.jsx)(c.X6q,{variant:"heading-lg/semibold",children:"Choose A Project to Override"})}),(0,r.jsx)(c.hzk,{children:(0,r.jsx)("div",{className:Jy().buildOverrideList,children:e.map((function(e){return(0,r.jsx)(c.zxk,{value:e,color:c.zxk.Colors.GREEN,onClick:function(){return o(e)},children:e},e)}))})}),(0,r.jsx)(c.mzw,{children:(0,r.jsx)(c.zxk,{color:c.zxk.Colors.PRIMARY,look:c.zxk.Looks.LINK,onClick:function(){return o(null)},children:"Nevermind"})})]}))}))}))}var Nm=function(e){fm(n,e);var t=Om(n);function n(){cm(this,n);var e;(e=t.apply(this,arguments)).handleRemoveBuildOverride=function(){e.props.onBuildOverrideRemoved(e.props.project)};e.handleOverrideIdChanged=function(t){e.props.onBuildOverrideUpdated(e.props.project,{id:t})}
;e.handleOverrideTypeChanged=function(t){e.props.onBuildOverrideUpdated(e.props.project,{type:t,id:""})};return e}n.prototype.render=function(){var e=this.props,t=e.project,n=e.overrideType,o=e.overrideId,i=e.disabled,a=e.error,l="branch"===n?"Branch Name":"Build ID";return(0,r.jsxs)(ae.Z,{direction:ae.Z.Direction.VERTICAL,className:v()(Jy().buildOverrideGroup,fe().marginBottom20,tm().card,Jy().row),children:[(0,r.jsx)(ky.Z,{className:v()(Jy().removeBuildOverride,lm({},Jy().removeBuildOverrideDisabled,i)),onClick:i?void 0:this.handleRemoveBuildOverride}),(0,r.jsxs)(ae.Z,{className:fe().marginBottom8,children:[(0,r.jsx)(ae.Z.Child,{basis:"50%",children:(0,r.jsx)(c.xJW,{title:"Override Type",className:Jy().item,children:(0,r.jsx)(c.q4e,{options:Im,onChange:this.handleOverrideTypeChanged,value:n,isDisabled:i})})}),(0,r.jsx)(ae.Z.Child,{basis:"50%",children:(0,r.jsx)(c.xJW,{title:l,className:Jy().item,children:(0,r.jsx)(c.oil,{value:o,onChange:this.handleOverrideIdChanged,disabled:i})})})]
}),(0,r.jsxs)(ae.Z.Child,{children:[null!=a&&""!==a&&(0,r.jsx)(c.R94,{className:Jy().item,style:{color:s.Z.unsafe_rawColors.RED_400.css},type:c.R94.Types.DESCRIPTION,children:a}),(0,r.jsxs)(c.R94,{className:Jy().item,type:c.R94.Types.DESCRIPTION,children:["This controls the build that will be served for the ",(0,r.jsx)("code",{children:t})," project."]})]})]})};return n}(o.Component),Am=function(e){fm(o,e);var t=Om(o);function o(){cm(this,o);var e;(e=t.apply(this,arguments)).state={loading:!0,buildOverrides:{},loadedBuildOverrides:{},errors:{},saving:!1,didSave:!1};var n=im(e);e.handleAddBuildOverride=sm((function(){var e,t;return vm(this,(function(r){switch(r.label){case 0:return[4,Tm(n.getAvailableProjects())];case 1:if(null==(e=r.sent()))return[2];t=pm(dm({},n.state.buildOverrides),lm({},e,{type:"branch",id:""}));n.setState({buildOverrides:t});return[2]}}))}));e.handleBuildOverrideUpdated=function(t,n){
var r=e.state.buildOverrides,o=dm({},null!=r?r[t]:{},n),i=pm(dm({},e.state.buildOverrides),lm({},t,o));e.setState({buildOverrides:i})};e.handleBuildOverrideRemoved=function(t){var n=dm({},e.state.buildOverrides);delete n[t];e.setState({buildOverrides:n})};e.handleDiscardChanges=function(){e.setState({buildOverrides:_e().cloneDeep(e.state.loadedBuildOverrides),errors:{},didSave:!1})};var i=im(e);e.handleSaveChanges=sm((function(){var e,t,n,r;return vm(this,(function(o){switch(o.label){case 0:if(null==(e=i.state.buildOverrides))return[2];i.setState({saving:!0});return[4,(0,By.aD)(e)];case 1:if(200===(t=o.sent()).status){n=t.body;i.setState({buildOverrides:n,loadedBuildOverrides:_e().cloneDeep(n),errors:{},didSave:!0,saving:!1})}else if(400===t.status){r=t.body;i.setState({errors:r,saving:!1,didSave:!1})}else i.setState({saving:!1,didSave:!1});return[2]}}))}));e.handleLinkGeneration=function(){var t=e.state.buildOverrides;(0,c.h7j)((function(e){return(0,r.jsx)(Cm,pm(dm({},e),{
buildOverrides:t}))}))};return e}var i=o.prototype;i.refreshBuildOverrides=function(){var e=this;return sm((function(){var t;return vm(this,(function(n){switch(n.label){case 0:e.setState({loading:!0});return[4,(0,Hy.Ce)()];case 1:t=n.sent();e.setState({loading:!1,buildOverrides:t,loadedBuildOverrides:_e().cloneDeep(t),errors:{}});return[2]}}))}))()};i.isDirty=function(){var e=this.state,t=e.buildOverrides,n=e.loadedBuildOverrides;return!_e().isEqual(t,n)};i.componentDidMount=function(){this.refreshBuildOverrides()};i.getAvailableProjects=function(){var e,t=this.state.buildOverrides;if(null==t)return[];var n=Object.keys(t);return(e=_e()).without.apply(e,[_m].concat(mm(n)))};i.renderEmpty=function(){return(0,r.jsxs)(ch.ZP,{theme:xu.Z.theme,className:v()(fe().marginTop40,fe().marginBottom20),children:[(0,r.jsx)(ch.ox,{darkSrc:n(921912),lightSrc:n(964766),width:294,height:192}),(0,r.jsx)(ch.OZ,{children:"You have no build overrides configured."})]})};i.renderItems=function(){
var e=this,t=this.state,n=t.buildOverrides,o=t.saving,i=t.errors;return null==n?null:_e().map(n,(function(t,n){return(0,r.jsx)(Nm,{project:n,overrideType:t.type,overrideId:t.id,disabled:o,error:i[n],onBuildOverrideUpdated:e.handleBuildOverrideUpdated,onBuildOverrideRemoved:e.handleBuildOverrideRemoved},n)}))};i.renderRefreshButton=function(){return!this.state.didSave||this.isDirty()?null:(0,r.jsx)(ae.Z,{grow:0,direction:ae.Z.Direction.HORIZONTAL_REVERSE,children:(0,r.jsx)(ae.Z.Child,{grow:0,children:(0,r.jsx)(c.zxk,{onClick:function(){return location.reload()},color:c.zxk.Colors.PRIMARY,children:"Reload App"})})})};i.renderLinkButton=function(){var e=this.state.buildOverrides;return null==e||0===Object.keys(e).length?null:(0,r.jsx)(ae.Z,{grow:0,direction:ae.Z.Direction.HORIZONTAL_REVERSE,children:(0,r.jsx)(ae.Z.Child,{grow:0,children:(0,r.jsx)(c.zxk,{onClick:this.handleLinkGeneration,color:c.zxk.Colors.BRAND,children:"Generate Public Link"})})})};i.renderSaveButton=function(){
if(!this.isDirty())return null;var e=this.state,t=e.saving,n=e.buildOverrides;return(0,r.jsxs)(ae.Z,{grow:0,direction:ae.Z.Direction.HORIZONTAL_REVERSE,children:[(0,r.jsx)(ae.Z.Child,{grow:0,children:(0,r.jsx)(c.zxk,{disabled:Sm(null!=n?n:{}),onClick:this.handleSaveChanges,submitting:t,color:c.zxk.Colors.GREEN,children:"Save Build Overrides"})}),(0,r.jsx)(ae.Z.Child,{grow:0,children:(0,r.jsx)(c.zxk,{onClick:this.handleDiscardChanges,disabled:t,color:c.zxk.Colors.RED,children:"Discard Changes"})})]})};i.render=function(){var e,t=this.state,n=t.loading,o=t.saving,i=t.buildOverrides;e=n?(0,r.jsx)(c.$jN,{className:fe().marginTop20}):null!=i&&0===Object.keys(i).length?this.renderEmpty():this.renderItems();var a=!o&&!n&&this.getAvailableProjects().length>0,s=Sm(null!=i?i:{})&&"stable"!==window.GLOBAL_ENV.RELEASE_CHANNEL?(0,r.jsx)(c.xvT,{color:"text-danger",variant:"text-md/normal",children:"Mobile build overrides must be generated using the desktop/web stable client for now!"}):null
;return(0,r.jsxs)(c.hjN,{className:fe().marginTop60,children:[(0,r.jsxs)(ae.Z,{className:fe().marginBottom20,children:[(0,r.jsx)(ae.Z.Child,{children:(0,r.jsx)(c.vwX,{tag:c.RB0.H1,children:"Build Overrides"})}),(0,r.jsx)(ae.Z.Child,{grow:0,children:(0,r.jsx)(c.zxk,{size:c.PhG.SMALL,onClick:this.handleAddBuildOverride,disabled:!a,children:"Add Build Override"})})]}),(0,r.jsx)(c.$i$,{}),(0,r.jsxs)(ae.Z,{direction:ae.Z.Direction.VERTICAL,children:[s,e,(0,r.jsxs)(ae.Z,{grow:0,direction:ae.Z.Direction.HORIZONTAL_REVERSE,children:[this.renderRefreshButton(),this.renderSaveButton(),this.renderLinkButton()]})]})]})};return o}(o.Component),Cm=function(e){fm(o,e);var t=Om(o);function o(){cm(this,o);var e;(e=t.apply(this,arguments)).state={ttlSeconds:3600,releaseChannel:"all",userIds:new Set,userIdEntry:"",userIdEntryError:null,allowedVersions:[],allowedVersionEntry:"",allowedVersionEntryError:null,publicLink:" ",statusText:null,statusTextColor:ce.Z.Colors.STATUS_RED,allowLoggedOut:!1}
;e.setUserEntryError=function(t){e.setState({userIdEntryError:t})};e.setStatusMessage=function(t,n){e.setState({statusText:t,statusTextColor:null!=n?n:ce.Z.Colors.STATUS_RED})};e.handleUserIDEntry=function(t){if(!/^[\d\s,]*$/.test(t))return e.setUserEntryError("User IDs are numbers!");var n=new Set(t.split(/[,\s]+/).filter(Boolean));e.setState({userIdEntry:t,userIds:n})};e.setAllowedVersionError=function(t){e.setState({allowedVersionEntryError:t})};e.handleAllowedVersionEntry=function(t){e.setState({allowedVersionEntry:t})};e.handleAllowedVersionEnter=function(t){t.charCode===B.yXg.ENTER&&e.handleAddAllowedVersion()};e.handleAddAllowedVersion=function(){var t=e.state,n=t.allowedVersions,r=t.allowedVersionEntry;if(0===(r=r.trim()).length)return e.setAllowedVersionError("Enter a valid version number!");if(n.indexOf(r)>=0)return e.setAllowedVersionError("You already added that version!");e.setState({allowedVersions:mm(n).concat([r]),allowedVersionEntry:"",allowedVersionEntryError:""})}
;e.handleRemoveAllowedVersion=function(t){var n=e.state.allowedVersions;n=n.filter((function(e){return e!==t}));e.setState({allowedVersions:n})};e.handleAllowLoggedOut=function(t){e.setState({allowLoggedOut:t})};e.handleExpirationChange=function(t){e.setState({ttlSeconds:t})};e.handleReleaseChannelChange=function(t){e.setState({releaseChannel:t})};e.handleExperiments=function(t){if(0!==t.trim().length){try{var n=JSON.parse(t);for(var r in n){if(null==r.match(/^[0-9]{4}\-[0-9]{2}_[a-z0-9_]+$/)){e.setState({experimentsError:"".concat(r," is an invalid experiment name")});return}if("number"!=typeof n[r]){e.setState({experimentsError:"".concat(r," has an invalid bucket override")});return}}}catch(t){e.setState({experimentsError:"Unable to parse experiments ".concat(t.message)});return}e.setState({experiments:t,experimentsError:void 0})}else e.setState({experimentsError:void 0})};e.generatePayload=function(){return{overrides:e.props.buildOverrides,meta:{
release_channel:"all"===e.state.releaseChannel?null:e.state.releaseChannel,ttl_seconds:e.state.ttlSeconds,user_ids:Array.from(e.state.userIds),allowed_versions:e.isMobile()?e.state.allowedVersions:void 0,allow_logged_out:e.state.allowLoggedOut,experiments:null==e.state.experiments?null:JSON.parse(e.state.experiments)}}};var n=im(e);e.handleGenerateLink=sm((function(){var e,t;return vm(this,(function(r){switch(r.label){case 0:if(n.isMobile()&&0===n.state.allowedVersions.length){n.setAllowedVersionError("You must add at least one allowed version for iOS");return[2]}n.setStatusMessage(null);e=n.generatePayload();return[4,(0,By.M3)(e)];case 1:if(!1!==(t=r.sent()).error)n.setStatusMessage(JSON.stringify(t.error),ce.Z.Colors.STATUS_RED);else{n.setState({publicLink:t.url.toString()});0===e.meta.user_ids.length&&n.setStatusMessage("Warning! No users added to the whitelist! This link could be used by anyone to override their build.",ce.Z.Colors.STATUS_YELLOW)}return[2]}}))}));return e}
var i=o.prototype;i.isMobile=function(){var e;return Sm(null!==(e=this.props.buildOverrides)&&void 0!==e?e:{})};i.renderSettingsForm=function(){var e=this,t=this.state,n=t.ttlSeconds,o=t.releaseChannel,i=t.userIdEntry,a=t.userIdEntryError,s=t.allowedVersions,l=t.allowedVersionEntry,u=t.allowedVersionEntryError,f=t.allowLoggedOut,d=t.experiments,p=t.experimentsError,h=Qy.S6.find((function(e){return e.value===n})),E=s.map((function(e){return{label:e,value:e}}));return(0,r.jsxs)(ae.Z.Child,{basis:"70%",children:[(0,r.jsx)(c.xJW,{title:"Expire After",className:fe().marginBottom20,children:(0,r.jsx)(c.q4e,{value:null!=h?h.value:null,options:Qy.S6,onChange:this.handleExpirationChange})}),this.isMobile()?null:(0,r.jsx)(c.xJW,{title:"Release Channel",className:fe().marginBottom20,children:(0,r.jsx)(c.q4e,{value:o,options:Qy.F$,onChange:this.handleReleaseChannelChange})}),this.isMobile()?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xJW,{title:"Add allowed app version (required)",
className:fe().marginBottom20,children:(0,r.jsxs)(ae.Z,{direction:ae.Z.Direction.HORIZONTAL,children:[(0,r.jsx)(ae.Z.Child,{wrap:!0,basis:"90%",children:(0,r.jsx)(c.oil,{autoFocus:!0,value:l,onKeyPress:this.handleAllowedVersionEnter,error:u,onChange:this.handleAllowedVersionEntry,placeholder:"Example: 34"})}),(0,r.jsx)(c.zxk,{onClick:this.handleAddAllowedVersion,children:"Add"})]})}),(0,r.jsx)(c.xJW,{title:"Remove allowed app version",className:fe().marginBottom20,children:(0,r.jsx)(c.q4e,{value:null,options:E,onChange:this.handleRemoveAllowedVersion,isDisabled:0===s.length})})]}):null,this.isMobile()?null:(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(c.xJW,{title:"Limit to User IDs (optional)",className:fe().marginBottom20,children:[(0,r.jsx)(ae.Z,{direction:ae.Z.Direction.HORIZONTAL,children:(0,r.jsx)(ae.Z.Child,{wrap:!0,basis:"90%",children:(0,r.jsx)(c.Kx8,{value:i,error:a,onBlur:function(){return e.setUserEntryError("")},onChange:this.handleUserIDEntry})})}),(0,r.jsx)(c.xvT,{
variant:"text-sm/normal",color:"text-muted",className:fe().marginTop8,children:"User IDs can be separated by whitespace or commas."})]})}),(0,r.jsxs)(c.xJW,{title:"Client Experiment Override",className:fe().marginBottom20,children:[(0,r.jsx)(ae.Z,{direction:ae.Z.Direction.HORIZONTAL,children:(0,r.jsx)(ae.Z.Child,{wrap:!0,basis:"90%",children:(0,r.jsx)(c.Kx8,{value:d,error:p,onChange:this.handleExperiments,placeholder:'{"2022-01_threads":1}'})})}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"text-muted",className:fe().marginTop8,children:"Locally override the given experiments to the given bucket. This ONLY applies locally and WILL NOT affect the server. When the user clears build override, the experiment override is removed as well."})]}),(0,r.jsx)(c.j7V,{onChange:this.handleAllowLoggedOut,value:f,children:"Allow logged out users"})]})};i.renderPayloadBlock=function(){var e=JSON.stringify(this.generatePayload(),null,2),t=function(){return e},o=(0,r.jsx)(Fy.GI,{
createPromise:function(){return Promise.resolve().then(n.bind(n,455049))},webpackId:455049,renderFallback:t,render:function(n){var o=n.highlight("json",e,!0);return null==o?t():(0,r.jsx)("code",{className:"hljs scroller ".concat(o.language," ").concat(rm().scrollbarGhost," ").concat(Jy().codebox),dangerouslySetInnerHTML:{__html:o.value}})}});return(0,r.jsx)(ae.Z.Child,{children:(0,r.jsx)(c.Zbd,{children:(0,r.jsx)("pre",{children:o})})})};i.renderLinkForm=function(){var e=this.state,t=e.statusTextColor,n=e.statusText,o=e.publicLink;return(0,r.jsxs)("div",{children:[(0,r.jsx)(c.xJW,{title:"Signed Link",children:(0,r.jsxs)(ae.Z,{children:[(0,r.jsx)(ae.Z.Child,{wrap:!0,basis:"75%",children:(0,r.jsx)(Gy.Z,{value:o})}),(0,r.jsx)(c.zxk,{onClick:this.handleGenerateLink,children:"Generate Link"})]})}),(0,r.jsx)(ce.Z,{color:t,className:"".concat(fe().marginBottom8," ").concat(fe().marginTop8),children:n})]})};i.render=function(){var e=this.props,t=e.onClose,n=e.transitionState;return(0,
r.jsxs)(c.Y0X,{size:c.CgR.LARGE,transitionState:n,"aria-label":"Generate Public Build Override Link",children:[(0,r.jsxs)(c.xBx,{justify:ae.Z.Justify.BETWEEN,separator:!1,children:[(0,r.jsx)(c.X6q,{variant:"heading-lg/semibold",children:"Generate Public Build Override Link"}),(0,r.jsx)(c.olH,{onClick:t})]}),(0,r.jsxs)(c.hzk,{children:[(0,r.jsxs)(ae.Z,{children:[this.renderSettingsForm(),this.renderPayloadBlock()]}),this.renderLinkForm()]})]})};return o}(o.Component);function Pm(){throw new Error("Send help")}function jm(){var e=ym(o.useState(!1),2),t=e[0],n=e[1],i=ym(o.useState(""),2),a=i[0],s=i[1];o.useEffect((function(){sm((function(){var e;return vm(this,(function(t){switch(t.label){case 0:return[4,(0,Hc.Y)()];case 1:e=t.sent();s(e);return[2]}}))}))()}),[]);return t?{}:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:[Jy().buttonsContainer,fe().marginBottom20].join(" "),children:[(0,r.jsx)(c.zxk,{onClick:function(){return window.open(a,"_blank")},disabled:""===a,
children:"Open Overlay"}),(0,r.jsx)(c.zxk,{onClick:function(){qy.Z.getSocket().close();qy.Z.getSocket().connect()},children:"Reset Socket"}),Wy.q&&(0,r.jsx)(c.zxk,{onClick:function(){l.Z.dispatch({type:"CLEAR_CACHES"})},children:"Clear Caches"})]}),(0,r.jsx)(c.hjN,{title:"Crashes",tag:c.RB0.H1,children:(0,r.jsxs)("div",{className:Jy().buttonsContainer,children:[(0,r.jsx)(c.zxk,{onClick:function(){return qf.default.crash(0)},children:"libdiscord Abort"}),(0,r.jsx)(c.zxk,{onClick:function(){return qf.default.crash(1)},children:"libdiscord SIGSEGV"}),(0,r.jsx)(c.zxk,{onClick:function(){return qf.default.crash(2)},children:"libdiscord EXCEPTION_ACCESS_VIOLATION"}),(0,r.jsx)(c.zxk,{onClick:function(){return n(!0)},children:"React Crash"}),(0,r.jsx)(c.zxk,{onClick:Pm,children:"onClick Throw"})]})})]})}var Rm=y.ZP.connectStores([Ky.default,zy.Z],(function(){return{isTracingRequests:Ky.default.isTracingRequests,isForcedCanary:Ky.default.isForcedCanary,
isLoggingGatewayEvents:Ky.default.isLoggingGatewayEvents,isLoggingOverlayEvents:Ky.default.isLoggingOverlayEvents,isLoggingAnalyticsEvents:Ky.default.isLoggingAnalyticsEvents,isAxeEnabled:Ky.default.isAxeEnabled,isSourceMapsEnabled:Ky.default.sourceMapsEnabled,isAnalyticsDebuggerEnabled:Ky.default.isAnalyticsDebuggerEnabled,isIdleStatusIndicatorEnabled:Ky.default.isIdleStatusIndicatorEnabled,appDirectoryIncludesInactiveCollections:Ky.default.appDirectoryIncludesInactiveCollections,isDevToolsEnabled:zy.Z.devToolsEnabled}}))((function(e){var t=e.isTracingRequests,n=e.isForcedCanary,o=e.isLoggingGatewayEvents,i=e.isLoggingOverlayEvents,a=e.isLoggingAnalyticsEvents,s=(e.isAxeEnabled,e.isSourceMapsEnabled),l=e.isAnalyticsDebuggerEnabled,u=e.isIdleStatusIndicatorEnabled,f=e.appDirectoryIncludesInactiveCollections,d=e.isDevToolsEnabled,p=(0,y.e7)([Lr.default],(function(){return Lr.default.getCurrentUser()}));return(0,r.jsxs)(c.hjN,{title:"Developer Flags",tag:c.RB0.H1,
children:[Gc.Z.isDeveloper&&(0,r.jsx)(c.j7V,{value:d,note:(0,r.jsxs)(r.Fragment,{children:["Enable client DevTools (open via Help menu in top right or with"," ",(0,r.jsx)("kbd",{className:Jy().key,children:cp.Z.modKey})," + ",(0,r.jsx)("kbd",{className:Jy().key,children:cp.Z.altKey})," ","+ ",(0,r.jsx)("kbd",{className:Jy().key,children:"O"}),")."]}),onChange:function(e){return(0,Yy.Qh)({devToolsEnabled:e})},children:"Enable DevTools"}),(0,r.jsx)(c.j7V,{value:t,note:"Force trace all client requests with APM",onChange:function(e){return(0,Zy.y)({trace:e})},children:"Enable Tracing Requests"}),(0,r.jsx)(c.j7V,{value:n,note:"Force all API requests to canary instances",onChange:function(e){return(0,Zy.y)({canary:e})},children:"Enable Forced Canary"}),(0,r.jsx)(c.j7V,{value:o,note:"Logs all incoming and outgoing gateway events to the developer console, enable verbose logging in the developer console to see!",onChange:function(e){return(0,Zy.y)({logGatewayEvents:e})},
children:"Enable Logging of Gateway Events to Console"}),(0,r.jsx)(c.j7V,{value:i,note:"Logs all overlay related RPC events. Super noisy if an overlay is connected",onChange:function(e){return(0,Zy.y)({logOverlayEvents:e})},children:"Enable Logging of Overlay RPC Events & Commands"}),(0,r.jsx)(c.j7V,{value:a,note:"Logs all analytics events to the developer console",onChange:function(e){return(0,Zy.y)({logAnalyticsEvents:e})},children:"Enable Logging of Analytics Events"}),(0,r.jsx)(c.j7V,{value:s,note:"Only enable on devices you trust.",onChange:function(e){return(0,Zy.y)({sourceMapsEnabled:e})},children:"Enable source maps to be loaded on this client"}),(0,r.jsx)(c.j7V,{value:l,note:"Displays a floating debugger with viewed impressions",onChange:function(e){return(0,Zy.y)({analyticsDebuggerEnabled:e})},children:"Enable standard analytics debugger view"}),(null==p?void 0:p.isStaff())?(0,r.jsx)(c.j7V,{value:u,note:"Displays a floating idle status indicator",onChange:function(e){
return(0,Zy.y)({idleStatusIndicatorEnabled:e})},children:"Enable idle status indicator"}):null,null,(null==p?void 0:p.isStaff())?(0,r.jsx)(c.j7V,{value:null==p?void 0:p.hasDisabledPremium(),note:"Force non premium user experience locally",onChange:function(e){return Uy.mB(B.xW$.DISABLE_PREMIUM,e)},children:"Enable force non nitro experience locally"}):null,(null==p?void 0:p.isStaff())?(0,r.jsx)(c.j7V,{value:f,note:"In App Directory, include inactive collections on the homepage. Use this to preview changes to collections before publishing them.",onChange:function(e){return(0,Zy.y)({appDirectoryIncludesInactiveCollections:e})},children:"Preview Unpublished Collections on App Directory Homepage"}):null]})}));function xm(){var e=(0,y.e7)([Xy.Z],(function(){return Xy.Z.getSurveyOverride()})),t=ym(o.useState(null!=e?e:""),2),n=t[0],i=t[1];return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:"Survey Override",className:fe().marginTop60,children:[(0,r.jsx)(c.vwX,{
children:"Copy the ID of the Survey you want to test:"}),(0,r.jsxs)("form",{className:Jy().surveyOverride,onSubmit:function(e){e.preventDefault();n.length>0?Ly.Xq(n):Ly.Xq(null)},children:[(0,r.jsx)(c.oil,{className:Jy().surveyOverrideInput,value:n,onChange:i}),(0,r.jsx)(c.zxk,{type:"submit",children:"Save Override"})]})]})}function Mm(){var e,t=(0,y.e7)([Vy.Z],(function(){return Vy.Z.overrideId()})),n=ym(o.useState(null!==(e=Vy.Z.overrideId())&&void 0!==e?e:""),2),i=n[0],a=n[1];return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:"Changelog Override",className:fe().marginTop60,children:[(0,r.jsx)(c.vwX,{children:"Enter the ID of the changelog you want to test"}),(0,r.jsxs)("div",{className:Jy().surveyOverride,children:[(0,r.jsx)(c.oil,{className:Jy().surveyOverrideInput,value:i,onChange:a}),(0,r.jsx)(c.zxk,{onClick:function(){""===i?Dy.Z.setChangelogOverride(null):Dy.Z.setChangelogOverride(i)},disabled:t===i,children:"Update Changelog"})]})]})}var wm=function(e){fm(n,e);var t=Om(n)
;function n(){cm(this,n);return t.apply(this,arguments)}n.prototype.render=function(){return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(Rm,{}),(0,r.jsx)(jm,{}),(0,r.jsx)(xm,{}),(0,r.jsx)(Mm,{}),(0,r.jsx)(Am,{})]})};return n}(o.PureComponent);const Dm=wm;var Zm=n(661123),Lm=n(987594);function Um(){var e=ni.xq.useSetting(),t=o.useMemo((function(){return(0,Lm.bL)(e)}),[e]);return(0,r.jsx)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.FRIEND_REQUESTS,children:(0,r.jsxs)(c.hjN,{title:x.Z.Messages.FRIEND_PERMITTED_SOURCE,className:fe().marginBottom40,children:[(0,r.jsx)(c.j7V,{className:v()(fe().marginTop8,fe().marginBottom20),value:t.all,onChange:function(e){return ni.xq.updateSetting(e?B.HGf:B.HGf&~B.SOq.NO_RELATION)},children:x.Z.Messages.FRIEND_PERMITTED_SOURCE_ALL}),(0,r.jsx)(c.j7V,{value:t.all||t.mutualFriends,onChange:function(t){return ni.xq.updateSetting(t?Zm.pj(e,B.SOq.MUTUAL_FRIENDS):Zm.M1(e,B.SOq.MUTUAL_FRIENDS,B.SOq.NO_RELATION))},
children:x.Z.Messages.FRIEND_PERMITTED_SOURCE_MUTUAL_FRIENDS}),(0,r.jsx)(c.j7V,{value:t.all||t.mutualGuilds,onChange:function(t){return ni.xq.updateSetting(t?Zm.pj(e,B.SOq.MUTUAL_GUILDS):Zm.M1(e,B.SOq.MUTUAL_GUILDS,B.SOq.NO_RELATION))},children:x.Z.Messages.FRIEND_PERMITTED_SOURCE_MUTUAL_GUILDS})]})})}var km=n(875700),Gm=n(959207),Bm=n(671723),Hm=n(108106),Vm=n(425454),Fm=n(416044),Ym=n(295652),zm=n(496320),Wm=n.n(zm),Km=n(637678),qm=n.n(Km),Xm=n(913957),Qm=n.n(Xm);function $m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Jm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eb(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function tb(e){tb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return tb(e)}function nb(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){eb(e,t,n[t])}))}return e}function rb(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function ob(e,t){return!t||"object"!==cb(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ib(e,t){ib=Object.setPrototypeOf||function(e,t){e.__proto__=t
;return e};return ib(e,t)}function ab(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||lb(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sb(e){return function(e){if(Array.isArray(e))return $m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||lb(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var cb=function(e){
return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function lb(e,t){if(e){if("string"==typeof e)return $m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);return"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$m(e,t):void 0}}function ub(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=tb(e);if(t){var o=tb(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ob(this,n)}}var fb=y.ZP.connectStores([xu.Z],(function(){return{theme:xu.Z.theme}}))(ch.ZP),db=(0,Yc.ED)();function pb(e){var t=e.onClose,n=(0,y.e7)([Bm.ZP],(function(){return Bm.ZP.getCandidateGames()
})),i=ab(o.useState(null),2),a=i[0],s=i[1],l=n.map((function(e){return{value:e.pid,label:null!=e.name?e.name:""}}));return(0,r.jsxs)(c.VqE,{className:v()(Wm().addGamePopout,qm().elevationBorderHigh),"aria-label":x.Z.Messages.SETTINGS_GAMES_ADD_NEW_GAME,children:[(0,r.jsx)(c.VcW,{placeholder:x.Z.Messages.SELECT,value:a,options:l,onChange:function(e){s(e)}}),(0,r.jsx)(c.$i$,{className:v()(fe().marginTop8,fe().marginBottom8)}),(0,r.jsxs)("div",{className:v()(Wm().actions,Qm().horizontal),children:[(0,r.jsx)(c.zxk,{className:Wm().cancelButton,look:c.iLD.LINK,color:c.Ttl.PRIMARY,onClick:t,children:x.Z.Messages.CANCEL}),(0,r.jsx)(c.zxk,{disabled:null==a,onClick:function(){if(null!=a){km.Z.addGame(a);t()}},children:x.Z.Messages.SETTINGS_GAMES_ADD_NEW_GAME})]})]})}function hb(e){var t,n,i=e.rawGame,a=e.nowPlaying,l=void 0!==a&&a,u=e.isOverride,f=function(){null!=E&&km.Z.deleteEntry(E)},d=function(){null!=E&&E.name!==b&&km.Z.editName(E,b)},p=function(e){if(13===e.keyCode){e.currentTarget.blur()
;e.preventDefault()}},h=function(){null!=E&&km.Z.toggleOverlay(E)},E=(0,y.e7)([Gm.Z,Gd.Z],(function(){return null!=i?(0,Bm.FZ)(i):null})),m=ab(o.useState(l&&null!==(t=null==E?void 0:E.name)&&void 0!==t?t:""),2),b=m[0],g=m[1],O=v()(Qm().flexCenter,(eb(n={},Wm().game,!l),eb(n,Wm().activeGame,l),eb(n,tm().card,!l),eb(n,Wm().nowPlaying,null!=E&&l),eb(n,Wm().notDetected,null==E&&l),n));return(0,r.jsxs)("div",{className:O,children:[(0,r.jsxs)("div",{className:v()(Wm().gameNameLastPlayed,Qm().vertical),children:[null==E?(0,r.jsx)("div",{className:Wm().gameName,children:x.Z.Messages.SETTINGS_GAMES_NO_GAME_DETECTED}):E.verified&&!u?(0,r.jsxs)("div",{className:Wm().detectedApplication,children:[(0,r.jsx)("div",{className:Wm().gameName,children:E.name}),(0,r.jsx)(c.ua7,{text:x.Z.Messages.SETTINGS_GAMES_VERIFIED_ICON,children:function(e){return(0,r.jsx)(ay.Z,rb(nb({className:Wm().gameVerifiedIcon,size:18,color:s.Z.unsafe_rawColors.BRAND_500.css},e),{children:(0,r.jsx)(sy.Z,{width:18,height:18,
color:s.Z.unsafe_rawColors.WHITE_500.css})}))}})]}):(0,r.jsx)("input",{className:v()(Wm().gameName,Wm().gameNameInput),type:"text",maxLength:128,value:b,onBlur:d,onKeyDown:p,onChange:function(e){return g(e.target.value)}}),function(){if(null==E)return(0,r.jsx)("div",{className:Wm().lastPlayed,children:x.Z.Messages.SETTINGS_GAMES_NOT_PLAYING});var e,t=E.played,n=E.exePath;l?e=x.Z.Messages.SETTINGS_GAMES_NOW_PLAYING_STATE:null!=t&&""!==t&&(e=x.Z.Messages.SETTINGS_GAMES_LAST_PLAYED.format({when:t}));return(0,r.jsx)("div",{className:Wm().lastPlayed,children:(0,r.jsx)(Hm.Z,{hoverText:null!=n&&""!==n?n.toUpperCase():"",children:e})})}()]}),function(){if(!db||null==E)return null;var e=E.overlay,t=E.overlayWarn,n=e?x.Z.Messages.SETTINGS_GAMES_OVERLAY_ON:x.Z.Messages.SETTINGS_GAMES_OVERLAY_OFF,o=e?(0,r.jsx)(Vm.Z,{className:Wm().overlayToggleIconOn,foreground:Wm().fill}):(0,r.jsx)(Fm.Z,{className:Wm().overlayToggleIconOff,foreground:Wm().fill}),i=t?(0,r.jsx)(c.ua7,{
text:x.Z.Messages.SETTINGS_GAMES_OVERLAY_WARNING,children:function(e){return(0,r.jsx)("i",nb({className:Wm().overlayWarningIcon},e))}}):null;return(0,r.jsxs)("div",{className:v()(Qm().flexCenter,Qm().noWrap,Qm().justifyBetween),children:[i,(0,r.jsx)("div",{className:Wm().overlayStatusText,children:n}),(0,r.jsx)(c.ua7,{text:x.Z.Messages.SETTINGS_GAMES_TOGGLE_OVERLAY,children:function(e){var t=e.onMouseEnter,n=e.onMouseLeave;return(0,r.jsx)(c.P3F,{"aria-label":x.Z.Messages.SETTINGS_GAMES_TOGGLE_OVERLAY,className:Wm().overlayToggleIcon,onClick:h,onMouseEnter:t,onMouseLeave:n,children:o})}})]})}(),null==E||l&&!u?null:(0,r.jsx)(ky.Z,{className:Wm().removeGame,onClick:f})]})}function Eb(e){var t=e.children;return(0,r.jsxs)(fb,{className:fe().marginTop40,children:[(0,r.jsx)(ch.ox,{darkSrc:n(498913),lightSrc:n(598150),width:430,height:250}),t]})}var yb=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
;e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&ib(e,t)}(n,e);var t=ub(n);function n(){Jm(this,n);return t.apply(this,arguments)}var i=n.prototype;i.componentDidMount=function(){Bm.ZP.watchCandidateGames(!0)};i.componentWillUnmount=function(){Bm.ZP.watchCandidateGames(!1)};i.renderPopout=function(e){var t=e.closePopout;return(0,r.jsx)(pb,{onClose:t})};i.renderGameList=function(){var e=this.props,t=e.gameHistory,n=e.overrideExePaths;return 0===t.length?(0,r.jsx)(Eb,{children:(0,r.jsx)(ch.OZ,{children:x.Z.Messages.SETTINGS_GAMES_NO_GAMES_HEADER})}):(0,r.jsxs)(c.hjN,{className:fe().marginTop40,children:[(0,r.jsx)(c.vwX,{className:fe().marginBottom4,children:x.Z.Messages.SETTINGS_GAMES_ADDED_GAMES_LABEL}),t.map((function(e){return(0,r.jsx)(hb,{rawGame:e,isOverride:n.has(e.exePath)},e.exePath)}))]})};i.renderGameDetails=function(){if(!Yc.FB)return(0,r.jsx)(Eb,{});var e=this.props,t=e.runningGame,n=e.overrideExePaths;return(0,
r.jsxs)(r.Fragment,{children:[(0,r.jsx)(hb,{rawGame:t,isOverride:null!=t&&n.has(t.exePath),nowPlaying:!0}),(0,r.jsxs)("div",{className:v()(Wm().nowPlayingAdd,fe().marginReset,fe().marginTop8,fe().marginBottom20),children:[(0,r.jsx)("span",{children:x.Z.Messages.SETTINGS_GAMES_NOT_SEEING_GAME}),(0,r.jsx)(c.yRy,{renderPopout:this.renderPopout,align:"center",position:"bottom",children:function(e){return(0,r.jsx)(c.zxk,rb(nb({},e),{look:c.iLD.LINK,size:c.PhG.MIN,color:c.Ttl.LINK,children:x.Z.Messages.SETTINGS_GAMES_ADD_GAME}))}})]}),this.renderGameList()]})};i.render=function(){return(0,r.jsx)(o.Fragment,{children:(0,r.jsx)(c.hjN,{tag:"h1",title:x.Z.Messages.REGISTERED_GAMES,children:this.renderGameDetails()})})};return n}(o.PureComponent),mb=(0,Ym.oH)((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Set(t.map((function(e){return e.exePath})))}));function bb(){var e=(0,y.Wu)([Bm.ZP],(function(){return Bm.ZP.getGamesSeen(!0)})),t=(0,
y.cj)([Bm.ZP],(function(){return{runningGame:Bm.ZP.getVisibleGame(),overrideExePaths:mb.apply(void 0,sb(Bm.ZP.getOverrides()))}}));return(0,r.jsx)(yb,nb({gameHistory:e},t))}var gb=n(108379),Ob=n.n(gb);function vb(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function _b(e){var t=e.features;return(0,r.jsx)(r.Fragment,{children:t.map((function(e,t){return(0,r.jsxs)(ae.Z,{align:ae.Z.Align.CENTER,className:v()(fe().marginTop20,Ob().feature,vb({},Ob().featureBorder,0!==t)),children:[null!=e.icon?(0,r.jsx)("div",{className:v()(Ob().icon,e.icon)}):null,(0,r.jsxs)("div",{children:[null!=e.title?(0,r.jsx)("div",{className:v()(fe().marginBottom8,Ob().title),children:e.title}):null,(0,r.jsx)("div",{className:Ob().description,children:e.description})]})]},t)}))})}var Ib=n(993137),Sb=n(759702),Tb=n.n(Sb);function Nb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ab(e){
Ab=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Ab(e)}function Cb(e,t){return!t||"object"!==jb(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Pb(e,t){Pb=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Pb(e,t)}var jb=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Rb(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Ab(e);if(t){var o=Ab(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Cb(this,n)}}var xb=function(e){!function(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Pb(e,t)}(n,e);var t=Rb(n);function n(){Nb(this,n);return t.apply(this,arguments)}n.prototype.render=function(){var e=this.props,t=e.className,n=e.videoID,o=e.videoClassName;return(0,r.jsx)(Ib.Z,{aspectRatio:16/9,className:v()(t,Tb().videoWrapper),children:(0,r.jsx)("iframe",{className:v()(o,Tb().video),src:"https://www.youtube.com/embed/".concat(n,"?rel=0&showinfo=0&controls=1&origin=https://").concat(B.$R1),allowFullScreen:!0,sandbox:"allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"})})};return n}(o.Component),Mb=n(547026),wb=n.n(Mb);function Db(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zb(e){Zb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){
return e.__proto__||Object.getPrototypeOf(e)};return Zb(e)}function Lb(e,t){return!t||"object"!==kb(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ub(e,t){Ub=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Ub(e,t)}var kb=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Gb(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Zb(e);if(t){var o=Zb(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Lb(this,n)}}const Bb=function(e){!function(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Ub(e,t)}(n,e);var t=Gb(n);function n(){Db(this,n);return t.apply(this,arguments)}n.prototype.render=function(){return(0,r.jsxs)("div",{className:wb().features,children:[(0,r.jsx)(xb,{className:wb().video,videoID:"SWzB1mx2o5k"}),(0,r.jsx)(c.X6q,{className:wb().perksHeading,variant:"heading-sm/semibold",children:x.Z.Messages.HYPESQUAD_PERKS_HEADING}),(0,r.jsx)(_b,{features:[{icon:wb().perkNewsletter,title:x.Z.Messages.HYPESQUAD_PERK_TITLE_NEWSLETTER,description:x.Z.Messages.HYPESQUAD_PERK_DESCRIPTION_NEWSLETTER},{icon:wb().perkBadge,title:x.Z.Messages.HYPESQUAD_PERK_TITLE_PROFILE_BADGE,description:x.Z.Messages.HYPESQUAD_PERK_DESCRIPTION_PROFILE_BADGE},{icon:wb().perkChallenges,title:x.Z.Messages.HYPESQUAD_PERK_TITLE_SQUAD_CHALLENGES,
description:x.Z.Messages.HYPESQUAD_PERK_DESCRIPTION_SQUAD_CHALLENGES}]})]})};return n}(o.Component);var Hb=n(635535),Vb=n(653163),Fb=n.n(Vb);function Yb(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function zb(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Yb(i,r,o,a,s,"next",e)}function s(e){Yb(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Wb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kb(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function qb(e){qb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return qb(e)}function Xb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Kb(e,t,n[t])}))}return e}function Qb(e,t){return!t||"object"!==Jb(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function $b(e,t){$b=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return $b(e,t)}var Jb=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function eg(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=qb(e);if(t){var o=qb(this).constructor;n=Reflect.construct(r,arguments,o)
}else n=r.apply(this,arguments);return Qb(this,n)}}var tg,ng,rg,og=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop()
;continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ig=(Kb(tg={},B.gkr.HOUSE_1,Fb().membershipDialogHouse1),Kb(tg,B.gkr.HOUSE_2,Fb().membershipDialogHouse2),Kb(tg,B.gkr.HOUSE_3,Fb().membershipDialogHouse3),tg),ag=(Kb(ng={},B.gkr.HOUSE_1,Fb().houseLogoHouse1),Kb(ng,B.gkr.HOUSE_2,Fb().houseLogoHouse2),Kb(ng,B.gkr.HOUSE_3,Fb().houseLogoHouse3),ng),sg=(Kb(rg={},B.gkr.HOUSE_1,n(903049)),Kb(rg,B.gkr.HOUSE_2,n(188374)),Kb(rg,B.gkr.HOUSE_3,n(789621)),rg),cg=function(e){var t;return(Kb(t={},B.gkr.HOUSE_1,x.Z.Messages.HYPESQUAD_DESCRIPTION_HOUSE_1),Kb(t,B.gkr.HOUSE_2,x.Z.Messages.HYPESQUAD_DESCRIPTION_HOUSE_2),Kb(t,B.gkr.HOUSE_3,x.Z.Messages.HYPESQUAD_DESCRIPTION_HOUSE_3),t)[e]},lg=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&$b(e,t)
}(o,e);var t=eg(o);function o(){Wb(this,o);var e;(e=t.apply(this,arguments)).handleJoinHypeSquadClick=function(){(0,c.ZDy)(zb((function(){var e,t;return og(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(47935)]).then(n.bind(n,347935))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Xb({},e))}]}}))})))};return e}o.prototype.render=function(){var e=this.props,t=e.houseMembership,n=e.isClaimed,o=e.isVerified;if(!n||!o)return null;if(null!=t){var i=x.Z.Messages.HYPESQUAD_MEMBERSHIP_HEADING.format({houseName:(0,Hb.X8)(t)});return(0,r.jsx)("div",{className:v()(Fb().membershipDialog,ig[t]),children:(0,r.jsxs)("div",{className:Fb().membershipDialogContent,children:[(0,r.jsxs)(ae.Z,{children:[(0,r.jsxs)(ae.Z.Child,{grow:1,shrink:1,children:[(0,r.jsx)(c.xvT,{className:Fb().membershipDialogHeading,variant:"text-xs/bold",children:x.Z.Messages.HYPESQUAD_YOUR_HOUSE}),(0,r.jsx)(c.X6q,{className:Fb().membershipDialogHouseName,
variant:"heading-sm/semibold",children:i}),(0,r.jsx)(c.xvT,{className:Fb().membershipDialogHouseDescription,variant:"text-md/normal",children:cg(t)})]}),(0,r.jsx)(ae.Z.Child,{className:Fb().houseLogoWrapper,grow:0,shrink:0,wrap:!0,children:(0,r.jsx)("img",{className:v()(Fb().houseLogo,ag[t]),src:sg[t],alt:i})})]}),(0,r.jsxs)(c.xvT,{className:Fb().membershipDialogSwitchHouses,variant:"text-md/normal",children:[x.Z.Messages.HYPESQUAD_SWITCH_HOUSES_PROMPT,(0,r.jsx)(c.P3F,{className:Fb().membershipDialogSwitchHousesAction,onClick:this.handleJoinHypeSquadClick,tag:"span",children:x.Z.Messages.HYPESQUAD_SWITCH_HOUSES_ACTION})]})]})})}return(0,r.jsxs)("div",{className:Fb().joinCTAWrapper,children:[(0,r.jsxs)(ae.Z,{className:Fb().joinCTA,align:ae.Z.Align.CENTER,justify:ae.Z.Justify.CENTER,direction:ae.Z.Direction.HORIZONTAL,children:[(0,r.jsx)(ae.Z.Child,{grow:0,shrink:0,children:(0,r.jsx)(c.xvT,{variant:"text-sm/normal",children:x.Z.Messages.HYPESQUAD_READY_TO_REP})}),(0,r.jsx)(ae.Z.Child,{
grow:0,shrink:0,children:(0,r.jsx)(c.zxk,{onClick:this.handleJoinHypeSquadClick,children:x.Z.Messages.HYPESQUAD_JOIN})})]}),(0,r.jsx)(c.xvT,{className:Fb().newsletterWarning,variant:"text-sm/normal",children:x.Z.Messages.HYPESQUAD_NEWSLETTER_WARNING})]})};return o}(o.Component),ug=n(908594),fg=n(127858),dg=n.n(fg);function pg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hg(e){hg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return hg(e)}function Eg(e,t){return!t||"object"!==mg(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function yg(e,t){yg=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return yg(e,t)}var mg=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function bg(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=hg(e);if(t){var o=hg(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Eg(this,n)}}var gg=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&yg(e,t)}(n,e);var t=bg(n);function n(){pg(this,n);var e;(e=t.apply(this,arguments)).state={isRequestPending:!1,hasError:!1};e.handleLeaveHypeSquadError=function(){e.setState({hasError:!0})};e.handleLeaveHypeSquadClick=function(){e.setState({isRequestPending:!0},(function(){ug.Z.leaveHypeSquadOnline().then((function(){e.setState({isRequestPending:!1})
})).catch((function(){e.setState({hasError:!0,isRequestPending:!1})}))}))};return e}var o=n.prototype;o.renderErrorMessage=function(){return this.state.hasError?(0,r.jsx)("div",{className:dg().error,children:x.Z.Messages.HYPESQUAD_LEAVE_ERROR}):null};o.render=function(){var e=this.state.isRequestPending;return this.props.isHypeSquadOnlineMember?(0,r.jsxs)("div",{className:dg().leaveActionWrapper,children:[this.renderErrorMessage(),(0,r.jsxs)(c.xvT,{variant:"text-sm/normal",children:[x.Z.Messages.HYPESQUAD_LEAVE_PROMPT,(0,r.jsx)(c.zxk,{className:dg().leaveButton,color:c.zxk.Colors.LINK,look:c.zxk.Looks.LINK,onClick:this.handleLeaveHypeSquadClick,size:c.zxk.Sizes.NONE,submitting:e,children:x.Z.Messages.HYPESQUAD_LEAVE_ACTION})]})]}):null};return n}(o.PureComponent),Og=n(470758),vg=n(177248),_g=n.n(vg);function Ig(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Sg(e){return function(){var t=this,n=arguments
;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ig(i,r,o,a,s,"next",e)}function s(e){Ig(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Tg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ng(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Ag(e){Ag=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Ag(e)}function Cg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Ng(e,t,n[t])}))}return e}function Pg(e,t){return!t||"object"!==Rg(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
;return e}(e):t}function jg(e,t){jg=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return jg(e,t)}var Rg=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function xg(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Ag(e);if(t){var o=Ag(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Pg(this,n)}}var Mg=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,
r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},wg=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&jg(e,t)}(o,e);var t=xg(o);function o(){Tg(this,o)
;return t.apply(this,arguments)}var i=o.prototype;i.renderNotice=function(){var e=this.props,t=e.isClaimed,n=e.unclaimedNotice,r=e.unverifiedNotice;return t?null!=r?r:x.Z.Messages.NOTICE_UNVERIFIED_ACCOUNT:null!=n?n:x.Z.Messages.NOTICE_UNCLAIMED_ACCOUNT};i.renderPrimaryAction=function(){return this.props.isClaimed?this.props.hasEmail?(0,r.jsx)(ae.Z.Child,{grow:0,shrink:0,children:(0,r.jsx)(Mu.Z,{})}):(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.MEDIUM,color:c.zxk.Colors.BRAND,onClick:this.openChangeEmailModal,children:x.Z.Messages.ADD_EMAIL_SHORT}):(0,r.jsx)(ae.Z.Child,{grow:0,shrink:0,children:(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.MEDIUM,color:c.zxk.Colors.BRAND,onClick:this.openClaimAccountModal,children:x.Z.Messages.CLAIM_ACCOUNT})})};i.renderSecondaryAction=function(){return this.props.isClaimed&&this.props.hasEmail?(0,r.jsx)(ae.Z.Child,{grow:0,shrink:0,children:(0,r.jsx)(c.zxk,{color:c.zxk.Colors.PRIMARY,look:c.zxk.Looks.LINK,onClick:this.openChangeEmailModal,
children:x.Z.Messages.CHANGE_EMAIL_SHORT})}):null};i.openClaimAccountModal=function(){(0,c.ZDy)(Sg((function(){var e,t;return Mg(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(73284)]).then(n.bind(n,854104))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Cg({},e))}]}}))})))};i.openChangeEmailModal=function(){(0,c.ZDy)(Sg((function(){var e,t;return Mg(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(71379)]).then(n.bind(n,171379))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Cg({},e))}]}}))})))};i.render=function(){var e=this.props,t=e.className,n=e.isClaimed,o=e.isVerified;return n&&o?null:(0,r.jsx)(c.Zbd,{className:v()(_g().wrapper,t),children:(0,r.jsxs)(ae.Z,{align:ae.Z.Align.CENTER,children:[(0,r.jsx)(ae.Z.Child,{className:_g().image,grow:0,shrink:0}),(0,r.jsxs)(ae.Z.Child,{children:[(0,r.jsx)(c.xvT,{variant:"text-sm/normal",children:this.renderNotice()}),(0,r.jsxs)(ae.Z,{
justify:ae.Z.Justify.CENTER,className:_g().content,children:[this.renderPrimaryAction(),this.renderSecondaryAction()]})]})]})})};return o}(o.Component);const Dg=y.ZP.connectStores([Lr.default],(function(){var e=Lr.default.getCurrentUser();L()(null!=e,"EmailNotice: currentUser cannot be undefined");return{isClaimed:e.isClaimed(),isVerified:e.verified,hasEmail:null!=e.email}}))(wg);var Zg=n(125518),Lg=n.n(Zg);function Ug(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kg(e){kg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return kg(e)}function Gg(e,t){return!t||"object"!==Hg(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Bg(e,t){Bg=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Bg(e,t)}var Hg=function(e){
return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Vg(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=kg(e);if(t){var o=kg(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Gg(this,n)}}var Fg=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Bg(e,t)}(n,e);var t=Vg(n);function n(){Ug(this,n);return t.apply(this,arguments)}var o=n.prototype;o.renderIntroHeader=function(){return null==this.props.houseMembership?x.Z.Messages.HYPESQUAD_HEADING:x.Z.Messages.HYPESQUAD_HEADING_EXISTING_MEMBER}
;o.render=function(){var e=this.props,t=e.houseMembership,n=e.isClaimed,o=e.isVerified;return(0,r.jsxs)(c.y5t,{component:(0,r.jsxs)("div",{className:Lg().intro,children:[(0,r.jsx)(c.X6q,{variant:"heading-xxl/semibold",className:Lg().introHeader,children:this.renderIntroHeader()}),(0,r.jsx)(c.xvT,{variant:"text-lg/normal",children:x.Z.Messages.HYPESQUAD_SUBHEADING})]}),children:[(0,r.jsx)(Dg,{className:Lg().verificationNotice,unclaimedNotice:x.Z.Messages.HYPESQUAD_UNCLAIMED_ACCOUNT_NOTICE,unverifiedNotice:x.Z.Messages.HYPESQUAD_UNVERIFIED_EMAIL_NOTICE}),(0,r.jsx)(lg,{houseMembership:t,isClaimed:n,isVerified:o}),(0,r.jsx)(Bb,{}),(0,r.jsx)(gg,{isHypeSquadOnlineMember:null!=t}),(0,r.jsx)(c.Zbd,{className:Lg().attendeeCTA,children:x.Z.Messages.HYPESQUAD_ATTENDEE_CTA.format({url:B.EYA.HYPESQUAD})})]})};return n}(o.PureComponent);const Yg=y.ZP.connectStores([Lr.default,Og.Z],(function(){var e=Lr.default.getCurrentUser();L()(null!=e,"UserSettingsHypeSquad: currentUser cannot be undefined")
;return{houseMembership:Og.Z.getHouseMembership(),isClaimed:e.isClaimed(),isVerified:e.verified}}))(Fg);var zg=n(213276),Wg=n(387099),Kg=n(563726),qg=n(639235),Xg=n(644144),Qg=n(822723),$g=n.n(Qg);function Jg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eO(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function tO(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){eO(i,r,o,a,s,"next",e)}function s(e){eO(i,r,o,a,s,"throw",e)}a(void 0)}))}}function nO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1;r.configurable=!0;"value"in r&&(r.writable=!0);Object.defineProperty(e,r.key,r)}}function oO(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0
}):e[t]=n;return e}function iO(e){iO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return iO(e)}function aO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){oO(e,t,n[t])}))}return e}function sO(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function cO(e,t){
return!t||"object"!==uO(t)&&"function"!=typeof t?Jg(e):t}function lO(e,t){lO=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return lO(e,t)}var uO=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function fO(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=iO(e);if(t){var o=iO(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return cO(this,n)}}var dO=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){
if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},pO=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,
writable:!0,configurable:!0}});t&&lO(e,t)}(n,e);var t=fO(n);function n(){nO(this,n);var e;(e=t.apply(this,arguments)).state={codeInput:"",submitting:!1,hasError:!1,isPromoCode:!1};e.handleChange=function(t){e.setState({codeInput:t,hasError:!1})};var r,o=Jg(e);e.handleSubmit=(r=tO((function(e){var t,n,r;return dO(this,(function(i){switch(i.label){case 0:e.preventDefault();if(""===(t=o.state.codeInput))return[2];if(null==(n=(0,Xg.JT)(t))){o.setState({hasError:!0});return[2]}o.setState({submitting:!0});i.label=1;case 1:i.trys.push([1,3,4,5]);return[4,Kg.Z.resolveGiftCode(n)];case 2:if(null!=(r=i.sent())&&null!=r.giftCode.promotion){o.setState({isPromoCode:!0});throw new Error("Cannnot redeem promotion code as gift")}Dr.default.track(B.rMx.OPEN_MODAL,{type:"gift_accept",location:sO(aO({},o.analyticsLocation),{object:B.qAy.BUTTON_CTA})});(0,qg.V)({processedCode:n});o.setState({codeInput:""});return[3,5];case 3:i.sent();o.setState({hasError:!0});return[3,5];case 4:o.setState({submitting:!1})
;return[7];case 5:return[2]}}))})),function(e){return r.apply(this,arguments)});return e}n.prototype.render=function(){var e=this.props.obscureInput,t=this.state,n=t.codeInput,o=t.submitting,i=t.hasError,a=t.isPromoCode;return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.GIFT_INVENTORY_REDEEM_CODES,children:[(0,r.jsx)(c.vwX,{children:x.Z.Messages.APPLICATION_ENTITLEMENT_CODE_REDEMPTION_PROMPT}),(0,r.jsx)("form",{onSubmit:this.handleSubmit,children:(0,r.jsxs)(ae.Z,{children:[(0,r.jsx)(c.oil,{type:e?"password":"text",value:n,onChange:this.handleChange,placeholder:B.RJY,error:!a&&i?x.Z.Messages.APPLICATION_ENTITLEMENT_CODE_REDEMPTION_INVALID:null,className:$g().codeRedemptionInput}),(0,r.jsx)(c.zxk,{type:"submit",submitting:o,children:x.Z.Messages.APPLICATION_ENTITLEMENT_CODE_REDEMPTION_REDEEM})]})}),a?(0,r.jsx)(c.xvT,{className:$g().errorMessage,variant:"text-sm/normal",children:x.Z.Messages.APPLICATION_ENTITLEMENT_CODE_REDEMPTION_PROMOTION.format({
promoLink:"https://discord.com/billing/promotions/".concat(n)})}):null]})};!function(e,t,n){t&&rO(e.prototype,t);n&&rO(e,n)}(n,[{key:"analyticsLocation",get:function(){return sO(aO({},this.props.analyticsContext.location),{object:B.qAy.BUTTON_CTA})}}]);return n}(o.Component);function hO(){var e=o.useContext(Dr.AnalyticsContext),t=(0,y.e7)([Rr.Z],(function(){return Rr.Z.enabled}));return(0,r.jsx)(pO,{analyticsContext:e,obscureInput:t})}var EO=n(618887),yO=n(516659),mO=n(99827),bO=n(293078),gO=n(520330),OO=n(883064),vO=n(803548),_O=n(83435),IO=n(984985),SO=n.n(IO);function TO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{
a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return TO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return TO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const AO=function(e){var t=e.onClose,n=e.onClaim,i=e.code,a=e.outboundPromotion,s=e.transitionState,l=NO(o.useState(null),2),u=l[0],f=l[1],d=(0,Jt.Dt)();o.useEffect((function(){null==i&&(0,vO.A2)(a.id).then((function(e){return n(e)})).catch((function(e){var t;return f(null==e||null===(t=e.body)||void 0===t?void 0:t.code)}))}),[i,a.id,n]);return(0,r.jsx)(c.Y0X,{transitionState:s,"aria-labelledby":d,children:null!=u?(0,r.jsx)(gO.L1,{onClose:t,
errorCode:u}):null==i?(0,r.jsx)(c.hzk,{children:(0,r.jsx)(c.$jN,{className:SO().loading})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(c.xBx,{separator:!1,className:SO().headerContainer,children:[(0,r.jsx)("div",{className:SO().art}),(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",children:x.Z.Messages.OUTBOUND_PROMOTION_REDEMPTION_MODAL_TITLE})]}),(0,r.jsxs)(c.hzk,{children:[(0,r.jsx)(c.xvT,{variant:"text-md/normal",className:SO().bodyText,children:a.outboundRedemptionModalBody}),(0,r.jsx)(c.$i$,{className:SO().formDivider}),(0,r.jsxs)(c.hjN,{title:x.Z.Messages.REDEMPTION_CODE,className:SO().formSection,children:[(0,r.jsx)(Gy.Z,{value:i,buttonColor:c.zxk.Colors.BRAND,buttonLook:c.zxk.Looks.FILLED,delay:1e3,inputClassName:SO().textInput}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"header-secondary",className:SO().confirmationText,children:x.Z.Messages.OUTBOUND_PROMOTION_CODE_CONFIRMATION_EMAIL})]})]}),(0,r.jsxs)(c.mzw,{children:[(0,r.jsx)(c.zxk,{color:c.zxk.Colors.BRAND,
onClick:function(){var e=(0,vO.BU)(i,a);window.open(e,"_blank")},children:x.Z.Messages.REDEEM}),(0,r.jsx)(c.zxk,{onClick:t,look:c.zxk.Looks.LINK,color:SO().maybeLaterButton,children:x.Z.Messages.MAYBE_LATER})]})]})})};var CO=n(770050),PO=n(736818),jO=n(70321),RO=n(746974),xO=n(475953),MO=n.n(xO);function wO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DO(e){DO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return DO(e)}function ZO(e,t){return!t||"object"!==UO(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function LO(e,t){LO=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return LO(e,t)}var UO=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function kO(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=DO(e);if(t){var o=DO(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ZO(this,n)}}var GO=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&LO(e,t)}(n,e);var t=kO(n);function n(){wO(this,n);return t.apply(this,arguments)}n.prototype.render=function(){var e=this.props,t=e.children,n=e.className,o=e.onMouseEnter,i=e.onMouseLeave;return(0,r.jsx)("div",{className:v()(MO().card,n),onMouseEnter:o,onMouseLeave:i,children:t})};return n}(o.PureComponent);GO.Header=function(e){
var t=e.children,n=e.className,o=e.splashArtURL;return(0,r.jsxs)(ae.Z,{className:v()(MO().header,n),align:ae.Z.Align.CENTER,children:[(0,r.jsx)("div",{className:MO().splashArt,style:null!=o?{backgroundImage:"url(".concat(o,")")}:void 0}),t]})};GO.Body=function(e){var t=e.children,n=e.className;return(0,r.jsx)("div",{className:v()(MO().body,n),children:t})};const BO=GO;var HO=n(459940),VO=n(718831),FO=n(530562),YO=n(601633),zO=n.n(YO);function WO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KO(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function qO(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){KO(i,r,o,a,s,"next",e)}function s(e){KO(i,r,o,a,s,"throw",e)}a(void 0)}))}}function XO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function QO(e,t){
for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1;r.configurable=!0;"value"in r&&(r.writable=!0);Object.defineProperty(e,r.key,r)}}function $O(e){$O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return $O(e)}function JO(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&tv(e,t)}function ev(e,t){return!t||"object"!==nv(t)&&"function"!=typeof t?WO(e):t}function tv(e,t){tv=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return tv(e,t)}var nv=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function rv(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{
Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=$O(e);if(t){var o=$O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ev(this,n)}}var ov=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0
;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function iv(e){var t=e.giftStyle,n=e.shouldAnimate;return(0,r.jsx)(CO.Z,{giftStyle:t,className:zO().seasonalGiftBox,shouldAnimate:n})}var av=function(e){JO(n,e);var t=rv(n);function n(){XO(this,n);var e;(e=t.apply(this,arguments))._copyModeTimeout=new Ie.V7;e.state={copyMode:HO.u.DEFAULT};e.handleCopy=function(t){var n=e.props,r=n.giftCode,o=n.sku;(0,Xg.dM)(r,o);try{(0,gf.JG)(t);e.setState({copyMode:HO.u.SUCCESS})}catch(t){e.setState({copyMode:HO.u.ERROR})}e._copyModeTimeout.start(1e3,(function(){e.setState({copyMode:HO.u.DEFAULT})}))};return e}var i=n.prototype;i.componentWillUnmount=function(){this._copyModeTimeout.stop()};i.handleRevoke=function(e){
Kg.Z.revokeGiftCode(e)};i.render=function(){var e=this,t=this.props,n=t.hideCode,i=t.giftCode,a=this.state.copyMode;return(0,r.jsxs)(ae.Z,{direction:ae.Z.Direction.VERTICAL,className:zO().giftCodeRow,children:[(0,r.jsx)(HO.Z,{className:zO().codeText,value:(0,Xg.Nz)(i.code),text:this.copyButtonText,mode:a,supportsCopy:gf.wS,hideMessage:n?x.Z.Messages.GIFT_INVENTORY_HIDDEN:null,onCopy:this.handleCopy,buttonColor:HO.Z.ButtonColors.BRAND,buttonLook:HO.Z.ButtonLooks.FILLED}),(0,r.jsxs)("div",{className:zO().subTextRow,children:[null!=i.expiresAt?(0,r.jsxs)(o.Fragment,{children:[x.Z.Messages.GIFT_INVENTORY_EXPIRES_IN.format({hours:i.expiresAt.diff(Ge()(),"h")})," ","— "]}):null,(0,r.jsx)(c.P3F,{tag:"a",onClick:function(){return e.handleRevoke(i.code)},children:x.Z.Messages.REVOKE})]})]})};!function(e,t,n){t&&QO(e.prototype,t);n&&QO(e,n)}(n,[{key:"copyButtonText",get:function(){switch(this.state.copyMode){case HO.u.SUCCESS:return x.Z.Messages.BILLING_GIFT_COPIED;case HO.u.ERROR:
return x.Z.Messages.FAILED;default:return x.Z.Messages.COPY}}}]);return n}(o.PureComponent),sv=function(e){JO(n,e);var t=rv(n);function n(){XO(this,n);var e;(e=t.apply(this,arguments))._loadedAt=null;e.state={isOpen:!1,isCreating:!1,isHovered:!1};var r,o=WO(e);e.handleGenerateGiftCode=(r=qO((function(e){var t,n,r,i;return ov(this,(function(a){switch(a.label){case 0:e.stopPropagation();t=o.props,n=t.skuId,r=t.subscriptionPlanId,i=t.giftStyle;o.setState({isCreating:!0});return[4,Kg.Z.createGiftCode(n,r,i)];case 1:a.sent();o.setState({isCreating:!1,isOpen:!0});return[2]}}))})),function(e){return r.apply(this,arguments)});e.handleToggleOpen=function(){var t=e.props,n=t.skuId,r=t.subscriptionPlanId,o=t.loadedAt,i=!e.state.isOpen;(null==o||null==e._loadedAt||o<e._loadedAt)&&i&&Kg.Z.fetchUserGiftCodesForSKU(n,r);e.setState({isOpen:!e.state.isOpen})};return e}var i=n.prototype;i.componentDidMount=function(){this._loadedAt=Date.now()};i.renderTitle=function(){
var e,t=this.props,n=t.sku,o=t.subscriptionPlan,i=t.giftCodeBatchId;e=i===Br.m8?x.Z.Messages.BLACK_FRIDAY_PROMOTION_GIFT_INVENTORY_TITLE:i===Br.rX&&null!=o?(o.interval===Br.rV.MONTH?x.Z.Messages.STICKERS_GIFT_INVENTORY_TITLE_MONTH:x.Z.Messages.STICKERS_GIFT_INVENTORY_TITLE_YEAR).format({skuName:n.name,intervalCount:o.intervalCount}):null==o?n.name:(o.interval===Br.rV.MONTH?x.Z.Messages.GIFT_INVENTORY_SUBSCRIPTION_MONTHS:x.Z.Messages.GIFT_INVENTORY_SUBSCRIPTION_YEARS).format({skuName:n.name,intervalCount:o.intervalCount});return(0,r.jsx)("div",{className:zO().gameName,children:e})};i.renderGenerateGiftCodeRow=function(){return(0,r.jsxs)(ae.Z,{justify:ae.Z.Justify.BETWEEN,align:ae.Z.Align.CENTER,className:zO().generateCodeRow,children:[(0,r.jsx)("div",{className:zO().codeText,children:x.Z.Messages.GIFT_INVENTORY_GENERATE_HELP}),(0,r.jsx)(c.zxk,{submitting:this.state.isCreating,size:c.zxk.Sizes.SMALL,color:c.zxk.Colors.BRAND,onClick:this.handleGenerateGiftCode,
children:x.Z.Messages.GIFT_INVENTORY_GENERATE_LINK})]})};i.setIsHovered=function(e){this.setState({isHovered:e})};i.render=function(){var e=this,t=this.props,n=t.entitlements,i=t.application,a=t.giftCodes,s=t.className,l=t.sku,u=t.isFetching,f=t.hideCodes,d=t.giftStyle,p=this.state.isOpen;return(0,r.jsxs)(BO,{className:s,children:[(0,r.jsx)(c.P3F,{onClick:this.handleToggleOpen,className:zO().card,onMouseEnter:function(){return e.setIsHovered(!0)},onMouseLeave:function(){return e.setIsHovered(!1)},children:(0,r.jsx)(BO.Header,{splashArtURL:i.getSplashURL(512),children:(0,r.jsxs)("div",{className:zO().cardHeader,children:[(0,r.jsxs)(ae.Z,{align:ae.Z.Align.CENTER,children:[null!=d?(0,r.jsx)(iv,{giftStyle:d,shouldAnimate:this.state.isHovered}):(0,r.jsx)(wr.Z,{game:i,size:wr.Z.Sizes.MEDIUM,skuId:l.id}),(0,r.jsxs)("div",{className:zO().headerText,children:[this.renderTitle(),(0,r.jsx)("div",{className:zO().subTextHeader,children:x.Z.Messages.GIFT_INVENTORY_COPIES.format({copies:n.length})})]
})]}),(0,r.jsx)(VO.Z,{direction:p?VO.Z.Directions.UP:VO.Z.Directions.DOWN,className:zO().expandIcon})]})})}),p?(0,r.jsx)(BO.Body,{children:u?(0,r.jsx)(c.$jN,{className:zO().spinner}):(0,r.jsxs)(o.Fragment,{children:[a.length<n.length?this.renderGenerateGiftCodeRow():null,a.map((function(e){return(0,r.jsx)(av,{giftCode:e,sku:l,hideCode:f},e.code)}))]})}):null]})};return n}(o.PureComponent);const cv=y.ZP.connectStores([RO.Z,Rr.Z,jO.Z,Gm.Z,Ur.Z,PO.default],(function(e){var t=e.skuId,n=e.subscriptionPlanId,r=e.giftStyle,o=RO.Z.get(t);if(null==o)throw new Error("SKU was unavailable while rendering gift.");var i=jO.Z.getForGifterSKUAndPlan(PO.default.getId(),t,n).filter((function(e){return!e.isClaimed})).filter((function(e){return e.giftStyle===r}));return{sku:o,hideCodes:Rr.Z.enabled,isFetching:jO.Z.getUserGiftCodesFetchingForSKUAndPlan(t,n),loadedAt:jO.Z.getUserGiftCodesLoadedAtForSKUAndPlan(t,n),application:Gm.Z.getGame(o.applicationId),subscriptionPlan:null!=n?(0,FO.oE)(n):null,
giftCodes:i}}))(sv);var lv=n(483255),uv=n(321941),fv=n.n(uv);function dv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pv(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function hv(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){pv(i,r,o,a,s,"next",e)}function s(e){pv(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Ev(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function yv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Ev(e,t,n[t])}))}return e}function mv(e,t){t=null!=t?t:{}
;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function bv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return dv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name)
;if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var gv=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,
o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Ov="YYYY-MM-DD HH:mm";function vv(e){var t=e.drop,n=e.streamLengthRequirement,o=e.enrolled,i=e.completed,a=t.title,s=t.endDate,u=t.dropsQuestId,f=t.assets,d=t.articleUrl,p=(0,bO.EW)(u);if(null==p)return null;var h=function(){(0,EO.RJ)(u).then((function(){l.Z.wait(hv((function(){return gv(this,(function(e){switch(e.label){case 0:return[4,(0,EO.R5)()];case 1:e.sent();return[2]}}))})))}))};return(0,r.jsxs)("div",{className:fv().dropContainer,children:[(0,r.jsx)("div",{className:fv().dropCard,children:(0,r.jsxs)("div",{className:fv().mainPromotionCardContainer,children:[(0,r.jsxs)("div",{
className:fv().promotionCardLeftContainer,children:[(0,r.jsx)("div",{className:fv().promotionIcon,children:(0,r.jsx)("img",{alt:"",src:f.iconSrc,className:fv().promotionIconImage})}),(0,r.jsxs)("div",{children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:a}),(0,r.jsx)(c.xvT,{variant:"text-xs/medium",color:"text-normal",className:fv().availableUntil,children:x.Z.Messages.DROPS_CARD_REDEEM_UNTIL.format({endDate:Ge()(s,"YYYY-MM-DD HH:mm").format("MMMM Do, YYYY")})})]})]}),(0,r.jsx)(c.ua7,{text:o&&!i?x.Z.Messages.DROPS_GIFT_INVENTORY_REDEMPTION_TOOLTIP:null,tooltipContentClassName:fv().redeemTooltipContent,children:function(e){return(0,r.jsx)(c.zxk,mv(yv({className:fv().promotionCardButton,color:c.zxk.Colors.BRAND,size:c.zxk.Sizes.SMALL,onClick:h,disabled:o&&!i},e),{children:o?x.Z.Messages.REDEEM:x.Z.Messages.DROPS_GIFT_INVENTORY_ENROLL}))}})]})}),(0,r.jsxs)("div",{className:fv().dropCriteria,children:[(0,r.jsx)("img",{alt:"",src:f.rewardSrc,className:fv().dropRewardImage}),(0,
r.jsx)(c.xvT,{color:"text-muted",variant:"text-sm/normal",className:fv().dropCriteriaText,children:p.messages.giftInfo(n)}),(0,r.jsx)(c.xvT,{color:"text-muted",variant:"text-sm/normal",className:fv().dropLearnMore,children:x.Z.Messages.DROPS_LEARN_MORE.format({faqUrl:d})})]})]})}function _v(e){var t,n=e.outboundPromotion,i=e.code,a=e.addClaimedOutboundPromotionCode,s=bv(o.useState(!1),2),l=s[0],u=s[1],f=bv(o.useState(!1),2),d=f[0],p=f[1],h=function(){return u((function(e){return!e}))},E=(0,Uo.ZP)(),y=(0,vO.Pz)(n.id,E),m=null!=i,b=m?(0,Be.vc)(Ge()(n.endDate).add(Br.aT),"LL"):(0,Be.vc)(Ge()(n.endDate),"LL");m&&l?t=x.Z.Messages.OUTBOUND_PROMOTION_CARD_CLAIMED_EXPANDED_BODY.format({endDate:b,onClickDetails:h}):m&&!l?t=x.Z.Messages.OUTBOUND_PROMOTION_CARD_CLAIMED_UNEXPANDED_BODY.format({endDate:b,onClickDetails:h}):!m&&l?t=x.Z.Messages.OUTBOUND_PROMOTION_CARD_UNCLAIMED_EXPANDED_BODY.format({endDate:b,onClickDetails:h
}):m||l||(t=x.Z.Messages.OUTBOUND_PROMOTION_CARD_UNCLAIMED_UNEXPANDED_BODY.format({endDate:b,onClickDetails:h}));var g=m?x.Z.Messages.OUTBOUND_PROMOTION_SEE_CODE:x.Z.Messages.PROMOTION_CARD_ACTION_CLAIM,O=o.useCallback((function(){return p(!1)}),[]),_=n.outboundTitle,I=n.outboundTermsAndConditions;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:v()(fv().skuCard,fv().promotionCard),children:[(0,r.jsxs)("div",{className:fv().mainPromotionCardContainer,children:[(0,r.jsxs)("div",{className:fv().promotionCardLeftContainer,children:[(0,r.jsx)("div",{className:fv().promotionIcon,children:(0,r.jsx)("img",{alt:"",src:y,className:fv().promotionIconImage})}),(0,r.jsxs)("div",{children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:_}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"text-normal",className:fv().promotionText,children:t})]})]}),(0,r.jsx)(c.zxk,{className:fv().promotionCardButton,color:c.zxk.Colors.BRAND,size:c.zxk.Sizes.SMALL,onClick:function(){
return p(!0)},children:g})]}),l&&(0,r.jsx)(c.xvT,{className:fv().promotionLegalese,variant:"text-xs/normal",color:"header-secondary",children:OO.Z.parse(I,!1,{allowLinks:!0})})]}),d&&(0,r.jsx)(c.u_l,{renderModal:function(e){return(0,r.jsx)(AO,mv(yv({},e),{onClose:O,onClaim:a,code:i,outboundPromotion:n}))},onCloseRequest:O})]})}function Iv(e){var t=e.drop,n=e.code,i=e.platform,a=bv(o.useState(!1),2),s=a[0],l=a[1],u=void 0!==n,f=(0,Be.vc)(Ge()(t.endDate),"LL"),d=x.Z.Messages.DROPS_CARD_REDEEM_UNTIL.format({endDate:f}),p=u?x.Z.Messages.OUTBOUND_PROMOTION_SEE_CODE:x.Z.Messages.PROMOTION_CARD_ACTION_CLAIM,h=o.useCallback((function(){return l(!1)}),[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:v()(fv().skuCard,fv().promotionCard),children:(0,r.jsxs)("div",{className:fv().mainPromotionCardContainer,children:[(0,r.jsxs)("div",{className:fv().promotionCardLeftContainer,children:[(0,r.jsx)("div",{className:fv().promotionIcon,children:(0,r.jsx)("img",{alt:"",
src:t.assets.iconSrc,className:fv().promotionIconImage})}),(0,r.jsxs)("div",{children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:t.title}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"text-normal",className:fv().promotionText,children:d})]})]}),(0,r.jsx)(c.zxk,{color:c.zxk.Colors.BRAND,size:c.zxk.Sizes.SMALL,onClick:function(){return l(!0)},children:p})]})}),s&&(0,r.jsx)(c.u_l,{renderModal:function(e){return(0,r.jsx)(gO.ZP,mv(yv({},e),{onClose:h,code:n,drop:t,platform:i}))},onCloseRequest:h})]})}const Sv=function(){var e=function(){d.Z.open(B.oAB.PREMIUM)},t=(0,y.e7)([Gm.Z],(function(){return Boolean(Gm.Z.lastFetched)})),n=(0,y.e7)([Lr.default],(function(){return Lr.default.getCurrentUser()})),i=(0,y.Wu)([sn.Z],(function(){return sn.Z.getGiftable()})),a=bv(_e().partition(i,(function(e){return null==e.giftCodeBatchId})),2),s=a[0],u=a[1],f=_e().groupBy(s,(function(e){return(0,Xg.Bg)(e.skuId,e.subscriptionPlanId,e.giftStyle)})),p=bv(o.useState(!1),2),h=p[0],E=p[1],m=(0,
y.e7)([mO.Z],(function(){return mO.Z.userStatus}));o.useEffect((function(){l.Z.wait((function(){(0,At.Qv)().then((function(){return E(!0)}))}))}),[]);var b=(0,yO.dy)();o.useEffect((function(){b&&l.Z.wait(hv((function(){return gv(this,(function(e){switch(e.label){case 0:return[4,(0,EO.R5)()];case 1:e.sent();return[2]}}))})))}),[b]);var g=ni.bh.useSetting(),O=(0,_O.l)(),v=O.promotionsLoaded,_=O.activeOutboundPromotions,I=O.claimedEndedOutboundPromotions,S=O.claimedOutboundPromotionCodeMap,T=O.addClaimedOutboundPromotionCode;return t&&h&&v?(0,r.jsxs)(r.Fragment,{children:[b&&function(){var e=[],t=[],o=!1,i=!0,a=!1,s=void 0;try{for(var l,u=Object.keys(m)[Symbol.iterator]();!(i=(l=u.next()).done);i=!0){var f,d=l.value,p=(0,bO.EW)(d);if(null!=p){var h=m[d],E=(0,bO.x8)(d);if(null!=E){var y=(0,bO.Xt)(E),b=h.eligible&&y,O=(0,bO.A5)(E);if(null!=O){b&&O.trackExposure({},{location:"ENTITLEMENT_GIFTS"})
;var v=Boolean((null===(f=Lr.default.getCurrentUser())||void 0===f?void 0:f.isStaff())&&O.getCurrentConfig({}).showUnenroll);if(O.getCurrentConfig({}).dropsEnabled){o=!0;var _=Ge()(p.endDate,Ov),I=Ge()();if(b&&null==h.completed_at||null!=h.enrolled_at&&null==h.completed_at&&h.eligible)I<_&&e.push({dropsQuestId:d,dropsStatus:h,showUnenroll:v,experiment:O});else if(null!=h.code||null!=h.completed_at){I<Ge()(p.finalClaimDate,Ov)&&t.push({dropsQuestId:d,dropsStatus:h,showUnenroll:v,experiment:O})}}}}}}}catch(e){a=!0;s=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw s}}var S,T=(0,r.jsxs)("div",{className:fv().dropsHeaderContainer,children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:x.Z.Messages.DROPS_GIFT_INVENTORY_TITLE}),(0,r.jsx)(me.Z,{className:fv().betaTagIcon})]});return o&&0===e.length&&0===t.length&&g?(0,r.jsxs)(c.hjN,{children:[T,(0,r.jsx)(c.$i$,{className:fv().divider}),(0,r.jsx)("div",{className:fv().dropsHelpText,
children:x.Z.Messages.DROPS_READ_BLOG_TO_ENABLE.format({blogURL:lv.n4})})]}):0===e.length&&0===t.length?null:(0,r.jsxs)(c.hjN,{children:[T,(0,r.jsx)(c.$i$,{className:fv().divider}),e.map((function(e){var t=(0,bO.EW)(e.dropsQuestId),n=null!=e.dropsStatus.enrolled_at,o=null!=e.dropsStatus.completed_at,i=e.experiment.getCurrentConfig({});return null!=t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(vv,{drop:yv({},t),streamLengthRequirement:i.streamLengthRequirement,enrolled:n,completed:o},t.dropsQuestId),e.showUnenroll&&(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,onClick:function(){return(0,EO.VT)(e.dropsQuestId)},children:"UNENROLL"})]}):null})),t.map((function(e){var t,n,o=(0,bO.EW)(e.dropsQuestId);return null!=o?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Iv,{drop:o,code:null!==(t=e.dropsStatus.code)&&void 0!==t?t:void 0,platform:null!==(n=e.dropsStatus.platform)&&void 0!==n?n:void 0},e.dropsQuestId),e.showUnenroll&&(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,onClick:function(){return(0,
EO.VT)(e.dropsQuestId)},children:"UNENROLL"})]}):null})),"string"==typeof(null==n?void 0:n.id)&&t.length>0?(0,r.jsx)("div",{className:fv().feedback,children:x.Z.Messages.DROPS_REQUEST_FEEDBACK_SUCCESS.format({feedbackURL:"https://survey.alchemer.com/s3/7043098/Discord-Drops-CSAT?user_id=".concat(null!==(S=null==n?void 0:n.id)&&void 0!==S?S:"")})}):null]})}(),function(){var e,t=u.find((function(e){return e.giftCodeBatchId===Br.m8&&!e.consumed})),n=null!==(e=u.filter((function(e){return e.giftCodeBatchId===Br.rX&&!e.consumed})))&&void 0!==e?e:[],o=bv(_e().partition(n,(function(e){return e.subscriptionPlanId===Br.Xh.PREMIUM_YEAR_TIER_2})),2),i=o[0],a=o[1],s=_.length+I.length>0;return(0,r.jsx)(c.hjN,{children:(0,r.jsxs)(c.y5t,{component:(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:s?x.Z.Messages.GIFT_INVENTORY_YOUR_GIFTS:void 0}),children:[s?(0,r.jsx)(c.$i$,{className:fv().divider}):null,I.map((function(e){var t=e.code,n=e.promotion;return(0,r.jsx)(_v,{outboundPromotion:n,
code:t,addClaimedOutboundPromotionCode:T},n.id)})),_.map((function(e){return(0,r.jsx)(_v,{outboundPromotion:e,code:S[e.id],addClaimedOutboundPromotionCode:T},e.id)})),null!=t?(0,r.jsx)(cv,{className:fv().skuCard,skuId:t.skuId,subscriptionPlanId:t.subscriptionPlanId,entitlements:[t],giftCodeBatchId:Br.m8},(0,Xg.Bg)(t.skuId,t.subscriptionPlanId)):null,i.length>0?(0,r.jsx)(cv,{className:fv().skuCard,skuId:i[0].skuId,subscriptionPlanId:i[0].subscriptionPlanId,entitlements:i,giftCodeBatchId:Br.rX},(0,Xg.Bg)(i[0].skuId,i[0].subscriptionPlanId)):null,a.length>0?(0,r.jsx)(cv,{className:fv().skuCard,skuId:a[0].skuId,subscriptionPlanId:a[0].subscriptionPlanId,entitlements:a,giftCodeBatchId:Br.rX},(0,Xg.Bg)(a[0].skuId,a[0].subscriptionPlanId)):null]})})}(),(0,r.jsx)(c.hjN,{children:(0,r.jsxs)(c.y5t,{component:(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:x.Z.Messages.GIFT_INVENTORY_GIFTS_YOU_PURCHASED}),children:[(0,r.jsx)(c.$i$,{className:fv().divider}),0===Object.keys(f).length?(0,
r.jsxs)("div",{className:fv().emptyState,children:[(0,r.jsx)("div",{className:fv().emptyStateImage}),(0,r.jsx)(c.H,{className:fv().emptyStateHeader,children:x.Z.Messages.GIFT_INVENTORY_NO_GIFTS}),(0,r.jsx)("p",{className:fv().emptyStateSubtext,children:x.Z.Messages.GIFT_INVENTORY_NO_GIFTS_SUBTEXT.format({onClick:e})})]}):_e().keys(f).map((function(e){var t=(0,Xg.Z0)(e),n=t.skuId,o=t.subscriptionPlanId,i=t.giftStyle;return(0,r.jsx)(cv,{className:fv().skuCard,skuId:n,subscriptionPlanId:o,entitlements:f[e],giftStyle:i},e)}))]})})]}):(0,r.jsx)(c.$jN,{className:fv().loading})};var Tv=n(607810),Nv=n.n(Tv);function Av(){return(0,Wg.Q)()?(0,r.jsx)(GE.c8,{}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(zg.Z,{section:B.jXE.LIBRARY_INVENTORY_CODE_REDEMPTION,children:(0,r.jsx)(hO,{})}),(0,r.jsx)(c.$i$,{className:Nv().divider}),(0,r.jsx)(zg.Z,{section:B.jXE.LIBRARY_INVENTORY_GIFTS_LIST,children:(0,r.jsx)(Sv,{})})]})}
var Cv=n(452006),Pv=n(344524),jv=n(228667),Rv=n(866926),xv=n(255088),Mv=n(229400),wv=n(613677),Dv=n(79251),Zv=n(668785),Lv=n(714163),Uv=n.n(Lv);function kv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1;r.configurable=!0;"value"in r&&(r.writable=!0);Object.defineProperty(e,r.key,r)}}function Bv(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Hv(e){Hv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Hv(e)}function Vv(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Wv(e,t)}function Fv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Bv(e,t,n[t])}))}return e}function Yv(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function zv(e,t){return!t||"object"!==Kv(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Wv(e,t){Wv=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Wv(e,t)}var Kv=function(e){
return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function qv(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Hv(e);if(t){var o=Hv(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return zv(this,n)}}function Xv(e){return(0,e.children)([Pv.Q2.MESSAGE,Pv.Q2.NAVIGATION,Pv.Q2.DND,Pv.Q2.CHAT,Pv.Q2.VOICE_AND_VIDEO,Pv.Q2.MISCELLANEOUS])}var Qv=_e()((0,Pv.Rv)()).filter((function(e){return e.description!==x.Z.Messages.KEYBIND_DESCRIPTION_MODAL_EASTER_EGG})).groupBy((function(e){return e.group})).value(),$v=y.ZP.connectStores([xu.Z],(function(){return{theme:xu.Z.theme}}))(ch.ZP),Jv=function(e){Vv(n,e);var t=qv(n);function n(){kv(this,n);var e
;(e=t.apply(this,arguments)).handleActionChanged=function(t){U.Z.setKeybind(Yv(Fv({},e.props.keybind),{action:t}))};e.handleShortcutChange=function(t){U.Z.setKeybind(Yv(Fv({},e.props.keybind),{shortcut:t}))};e.handleDeleteKeybind=function(){U.Z.deleteKeybind(e.props.keybind.id)};return e}var o=n.prototype;o.renderMessage=function(){var e=this.props.keybind,t=Dv.BB(e.shortcut);return cp.Z.hasBind(t)?(0,r.jsx)(c.R94,{className:Uv().keybindMessage,type:c.geA.DESCRIPTION,style:{color:s.Z.unsafe_rawColors.RED_400.css},children:x.Z.Messages.KEYBIND_CONFLICT}):Zv.Sp.has(t)?(0,r.jsx)(c.R94,{className:Uv().keybindMessage,type:c.geA.DESCRIPTION,style:{color:s.Z.unsafe_rawColors.RED_400.css},children:x.Z.Messages.KEYBIND_NAVIGATION_CONFLICT.format({keyboardNavArticle:ta.Z.getArticleURL(B.BhN.KEYBOARD_NAVIGATION)})}):(0,r.jsx)(c.R94,{className:Uv().keybindMessage,type:c.geA.DESCRIPTION,children:this.props.keybindDescriptions[e.action]})};o.render=function(){var e=this.props.keybind.managed
;return(0,r.jsxs)(ae.Z,{direction:ae.Z.Direction.VERTICAL,className:v()(Uv().keybindGroup,tm().card),children:[!e&&(0,r.jsx)(ky.Z,{"aria-label":x.Z.Messages.REMOVE_KEYBIND,className:Uv().removeKeybind,onClick:this.handleDeleteKeybind,look:ky.Z.Looks.FILLED}),(0,r.jsxs)(ae.Z,{className:fe().marginBottom8,children:[(0,r.jsx)(ae.Z.Child,{basis:"50%",children:(0,r.jsx)(c.xJW,{title:x.Z.Messages.USER_SETTINGS_KEYBINDS_ACTION,className:Uv().item,children:(0,r.jsx)(c.q4e,{value:this.props.keybind.action,options:this.props.keybindActionTypes,onChange:this.handleActionChanged,isDisabled:e})})}),(0,r.jsx)(ae.Z.Child,{basis:"50%",children:(0,r.jsx)(c.xJW,{title:x.Z.Messages.USER_SETTINGS_KEYBINDS_KEYBIND,className:Uv().item,children:(0,r.jsx)(k.Z,{defaultValue:this.props.keybind.shortcut,onChange:this.handleShortcutChange})})})]}),(0,r.jsx)(ae.Z.Child,{children:this.renderMessage()})]})};return n}(o.PureComponent),e_=function(e){Vv(i,e);var t=qv(i);function i(){kv(this,i);var e
;(e=t.apply(this,arguments)).handleAddKeybind=function(){U.Z.addKeybind()};return e}var a=i.prototype;a.componentDidMount=function(){U.Z.enableAll(!1)};a.componentWillUnmount=function(){U.Z.enableAll(!0)};a.renderKeybinds=function(e){var t=this;return e.map((function(e){return(0,r.jsx)("div",{className:Uv().row,children:(0,r.jsx)(Jv,{keybind:e,keybindDescriptions:t.keybindDescriptions,keybindActionTypes:t.keybindActionTypes},e.id)},e.id)}))};a.renderEmpty=function(e){if(0===e.length)return(0,r.jsx)($v,{className:fe().marginTop60,children:(0,r.jsx)(ch.ox,{darkSrc:n(656470),lightSrc:n(789885),width:320,height:170})})};a.render=function(){var e=this,t=_e()(this.props.keybinds).reject((function(e){return e.managed&&e.action!==B.kg4.OVERLAY_ACTIVATE_REGION_TEXT_WIDGET})).reject((function(t){return!e.props.allowSoundboard&&(t.action===B.kg4.SOUNDBOARD||t.action===B.kg4.SOUNDBOARD_HOLD)})).sortBy((function(e){return e.id})).sortBy((function(e){return!0===e.managed?-1:0})).value();return(0,
r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.KEYBINDS,children:Yc.FB?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(ae.Z,{justify:ae.Z.Justify.BETWEEN,className:fe().marginBottom20,children:[(0,r.jsx)(ae.Z.Child,{grow:0,children:(0,r.jsx)(wv.Z,{messageType:wv.Q.WARNING,children:x.Z.Messages.ADD_KEYBIND_WARNING})}),(0,r.jsx)(ae.Z.Child,{wrap:!0,grow:0,children:(0,r.jsx)(c.zxk,{size:c.PhG.LARGE,onClick:this.handleAddKeybind,children:x.Z.Messages.ADD_KEYBIND})})]}),(0,r.jsx)(c.$i$,{}),(0,r.jsxs)(c.hjN,{children:[this.renderKeybinds(t),this.renderEmpty(t)]})]}):(0,r.jsx)(wv.Z,{messageType:wv.Q.INFO,textVariant:"text-lg/medium",className:Uv().browserNotice,children:x.Z.Messages.KEYBIND_IN_BROSWER_NOTICE.format({downloadLink:B.EYA.DOWNLOAD})})}),(0,r.jsx)(c.$i$,{}),(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.USER_SETTINGS_KEYBINDS_DEFAULT_KEYBINDS_TITLE,className:fe().marginTop60,children:[(0,r.jsxs)("div",{className:Uv().defaultKeybind,children:[(0,
r.jsx)(c.xvT,{variant:"text-md/normal",children:x.Z.Messages.USER_SETTINGS_KEYBINDS_SHOW_LIST_TITLE}),(0,r.jsx)("div",{className:Uv().defaultKeybindShortcutGroup,children:(0,r.jsx)(c.M2$,{shortcut:Cv._.binds[0],className:Uv().defaultKeybindShortcut})})]}),(0,r.jsx)(c.$i$,{}),(0,r.jsx)(Xv,{children:function(e){return(0,r.jsx)(r.Fragment,{children:e.map((function(e,t){var n=(0,Pv.UD)(e),i=(0,Pv.U6)(e),a=Qv[e];return(0,r.jsxs)("div",{className:Uv().defaultKeybindGroup,children:[(0,r.jsx)(c.X6q,{variant:"heading-deprecated-12/semibold",className:v()(Uv().defaultKeybindGroupHeader,Bv({},Uv().defaultKeybindGroupWithDescription,null!=i)),children:n}),null!=i&&(0,r.jsx)(c.xvT,{color:"header-secondary",className:Uv().defaultKeybindGroupDescription,variant:"text-sm/normal",children:i}),(0,r.jsx)(c.$i$,{}),a.map((function(e){return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsxs)("div",{className:Uv().defaultKeybind,children:[(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:e.description}),(0,
r.jsx)("div",{className:Uv().defaultKeybindShortcutGroup,children:e.binds.map((function(e){return(0,r.jsx)(c.M2$,{shortcut:e},e)}))})]}),(0,r.jsx)(c.$i$,{})]},e.description)}))]},t)}))})}})]})]})};!function(e,t,n){t&&Gv(e.prototype,t);n&&Gv(e,n)}(i,[{key:"keybindActionTypes",get:function(){var e=this.props,t=e.overlaySupported,n=e.canGoLive,r=e.allowSoundboard,o=e.enableClips,i=[{value:B.kg4.UNASSIGNED,label:x.Z.Messages.KEYBIND_UNASSIGNED},{value:B.kg4.PUSH_TO_TALK,label:x.Z.Messages.KEYBIND_PUSH_TO_TALK},{value:B.kg4.PUSH_TO_TALK_PRIORITY,label:x.Z.Messages.KEYBIND_PUSH_TO_TALK_PRIORITY},{value:B.kg4.PUSH_TO_MUTE,label:x.Z.Messages.KEYBIND_PUSH_TO_MUTE},{value:B.kg4.TOGGLE_MUTE,label:x.Z.Messages.KEYBIND_TOGGLE_MUTE},{value:B.kg4.TOGGLE_DEAFEN,label:x.Z.Messages.KEYBIND_TOGGLE_DEAFEN},{value:B.kg4.TOGGLE_VOICE_MODE,label:x.Z.Messages.KEYBIND_TOGGLE_VOICE_MODE},{value:B.kg4.TOGGLE_STREAMER_MODE,label:x.Z.Messages.KEYBIND_TOGGLE_STREAM_MODE}];if(t){i.push({value:B.kg4.TOGGLE_OVERLAY,
label:x.Z.Messages.KEYBIND_TOGGLE_OVERLAY});i.push({value:B.kg4.TOGGLE_OVERLAY_INPUT_LOCK,label:x.Z.Messages.KEYBIND_TOGGLE_OVERLAY_INPUT_LOCK});i.push({value:B.kg4.OVERLAY_ACTIVATE_REGION_TEXT_WIDGET,label:x.Z.Messages.KEYBIND_ACTIVATE_OVERLAY_CHAT})}n&&(0,Yc.ED)()&&i.push({value:B.kg4.TOGGLE_GO_LIVE_STREAMING,label:x.Z.Messages.KEYBIND_TOGGLE_GO_LIVE_STREAMING});if((0,Yc.nI)()){i.push({value:B.kg4.NAVIGATE_BACK,label:x.Z.Messages.KEYBIND_NAVIGATE_BACK},{value:B.kg4.NAVIGATE_FORWARD,label:x.Z.Messages.KEYBIND_NAVIGATE_FORWARD});r&&(0,Mv.O)()&&i.push({value:B.kg4.SOUNDBOARD,label:x.Z.Messages.KEYBIND_SOUNDBOARD},{value:B.kg4.SOUNDBOARD_HOLD,label:x.Z.Messages.KEYBIND_SOUNDBOARD_HOLD});o&&i.push({value:B.kg4.SAVE_CLIP,label:x.Z.Messages.CLIPS_SAVE})}return i}},{key:"keybindDescriptions",get:function(){var e,t=this.props,n=t.overlaySupported,r=t.canGoLive,o=t.enableClips,i=(Bv(e={},B.kg4.UNASSIGNED,x.Z.Messages.KEYBIND_DESCRIPTION_UNASSIGNED),
Bv(e,B.kg4.PUSH_TO_MUTE,x.Z.Messages.KEYBIND_DESCRIPTION_PUSH_TO_MUTE),Bv(e,B.kg4.PUSH_TO_TALK,x.Z.Messages.KEYBIND_DESCRIPTION_PUSH_TO_TALK),Bv(e,B.kg4.PUSH_TO_TALK_PRIORITY,x.Z.Messages.KEYBIND_DESCRIPTION_PUSH_TO_TALK_PRIORITY),Bv(e,B.kg4.TOGGLE_MUTE,x.Z.Messages.KEYBIND_DESCRIPTION_TOGGLE_MUTE),Bv(e,B.kg4.TOGGLE_DEAFEN,x.Z.Messages.KEYBIND_DESCRIPTION_TOGGLE_DEAFEN),Bv(e,B.kg4.TOGGLE_VOICE_MODE,x.Z.Messages.KEYBIND_DESCRIPTION_TOGGLE_VOICE_MODE),Bv(e,B.kg4.TOGGLE_STREAMER_MODE,x.Z.Messages.KEYBIND_DESCRIPTION_TOGGLE_STREAMER_MODE),e);if(n){i[B.kg4.TOGGLE_OVERLAY]=x.Z.Messages.KEYBIND_DESCRIPTION_TOGGLE_OVERLAY;i[B.kg4.TOGGLE_OVERLAY_INPUT_LOCK]=x.Z.Messages.KEYBIND_DESCRIPTION_TOGGLE_OVERLAY_INPUT_LOCK}r&&(0,Yc.ED)()&&(i[B.kg4.TOGGLE_GO_LIVE_STREAMING]=x.Z.Messages.KEYBIND_DESCRIPTION_TOGGLE_GO_LIVE_STREAMING);if((0,Yc.nI)()){i[B.kg4.NAVIGATE_BACK]=x.Z.Messages.KEYBIND_DESCRIPTION_NAVIGATE_BACK;i[B.kg4.NAVIGATE_FORWARD]=x.Z.Messages.KEYBIND_DESCRIPTION_NAVIGATE_FORWARD
;i[B.kg4.SOUNDBOARD]=(0,Yc.ED)()?x.Z.Messages.KEYBIND_DESCRIPTION_SOUNDBOARD_NO_POPOUT_WHEEL_SUPPORT:x.Z.Messages.KEYBIND_DESCRIPTION_SOUNDBOARD;i[B.kg4.SOUNDBOARD_HOLD]=(0,Yc.ED)()?x.Z.Messages.KEYBIND_DESCRIPTION_SOUNDBOARD_HOLD_NO_POPOUT_WHEEL_SUPPORT:x.Z.Messages.KEYBIND_DESCRIPTION_SOUNDBOARD_HOLD;o&&(i[B.kg4.SAVE_CLIP]=x.Z.Messages.CLIPS_KEYBIND_DESCRIPTION)}return i}}]);return i}(o.PureComponent);function t_(){var e=(0,y.e7)([G.Z],(function(){return G.Z.getState()})),t=(0,y.e7)([Bc.Z],(function(){return(0,Rv.Z)(Bc.Z)})),n=(0,y.e7)([Hc.Z],(function(){return Hc.Z.isSupported()})),o=(0,xv.YD)().allowSoundboard,i=(0,jv.G)();return(0,r.jsx)(e_,{keybinds:e,canGoLive:t,overlaySupported:n,allowSoundboard:o&&(0,Yc.ED)(),enableClips:i})}var n_=n(488217),r_=n.n(n_),o_=n(734155);function i_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a_(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0
}):e[t]=n;return e}function s_(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function c_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1)
;"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i_(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const l_=y.ZP.connectStores([m.default],(function(){return{currentLocale:m.default.locale}}))((function(e){var t=c_(o.useState(e.currentLocale),2),i=t[0],a=t[1],s=c_(o.useState((function(){return x.Z.getAvailableLocales().map((function(e){var t;try{t=n(357605)("./".concat(e.value,".png"))}catch(e){t=n(223693)}return s_(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){
a_(e,t,n[t])}))}return e}({},e),{name:(0,r.jsxs)("div",{className:r_().option,children:[(0,r.jsx)("span",{className:r_().localeName,children:e.name}),(0,r.jsx)("span",{className:r_().localizedName,children:e.localizedName}),(0,r.jsx)("div",{className:r_().flag,"aria-hidden":!0,children:(0,r.jsx)("img",{alt:"",src:t,className:r_().flagImage})})]})})}))})),1),l=s[0],u=o.useCallback((function(e){var t=e.value;a(t);o_.nextTick((function(){return sp.ZP.updateLocale(t)}))}),[]);return(0,r.jsx)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.LANGUAGE,children:(0,r.jsx)(c.hjN,{children:(0,r.jsx)(c.xJW,{title:x.Z.Messages.LANGUAGE_SELECT,children:(0,r.jsx)(c.Eep,{onChange:u,options:l,value:i})})})})}));var u_=n(32162),f_=n(633253),d_=n(669754);var p_=n(292832);function h_(e){var t=e.className,n=(0,y.e7)([d_.Z],(function(){return d_.Z.getSoundpack()})),o=f_.Z.useExperiment({}).allowSoundpacks;if(!o)return null;var i=o?(0,p_.hB)():[];return(0,r.jsx)(c.q4e,{className:t,onChange:function(e){
return function(e){Dr.default.track(B.rMx.SOUNDPACK_UPDATED,{soundpack:e,previous_soundpack:d_.Z.getSoundpack()});l.Z.dispatch({type:"SET_SOUNDPACK",soundpack:e})}(e)},value:n,options:i})}var E_=n(288263),y_=n(796938),m_=n(374092),b_=n(165695),g_=n(801809),O_=n(42261);function v_(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function __(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){v_(i,r,o,a,s,"next",e)}function s(e){v_(i,r,o,a,s,"throw",e)}a(void 0)}))}}function I_(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function S_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))))
;r.forEach((function(t){I_(e,t,n[t])}))}return e}function T_(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var N_=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,
o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function A_(){return(A_=__((function(){var e;return N_(this,(function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,g_.Z.get({url:B.ANM.EMAIL_SETTINGS,trackedActionData:{event:i.a9.EMAIL_SETTINGS_FETCH,properties:function(e){var t,n=null==e||null===(t=e.body)||void 0===t?void 0:t.initialized;return(0,b_.iG)({initialized:n})}}})];case 1:e=t.sent();l.Z.dispatch({
type:"EMAIL_SETTINGS_FETCH_SUCCESS",settings:e.body});return[3,3];case 2:t.sent();l.Z.dispatch({type:"EMAIL_SETTINGS_FETCH_FAILURE"});return[3,3];case 3:return[2]}}))}))).apply(this,arguments)}function C_(){return(C_=__((function(e,t){var n;return N_(this,(function(r){switch(r.label){case 0:l.Z.dispatch({type:"EMAIL_SETTINGS_UPDATE",updates:I_({},e,t)});r.label=1;case 1:r.trys.push([1,3,,4]);return[4,g_.Z.patch({url:B.ANM.EMAIL_SETTINGS,body:{settings:{categories:I_({},e,t)}},trackedActionData:{event:i.a9.EMAIL_SETTINGS_UPDATE,properties:{category:e,value:t}}})];case 2:n=r.sent();l.Z.dispatch({type:"EMAIL_SETTINGS_UPDATE_SUCCESS",settings:n.body});return[3,4];case 3:r.sent();l.Z.dispatch({type:"EMAIL_SETTINGS_UPDATE_FAILURE"});return[3,4];case 4:return[2]}}))}))).apply(this,arguments)}function P_(){return j_.apply(this,arguments)}function j_(){return(j_=__((function(){var e,t;return N_(this,(function(n){switch(n.label){case 0:e=O_.M0.reduce((function(e,t){
return T_(S_({},e),I_({},t,!1))}),{});l.Z.dispatch({type:"EMAIL_SETTINGS_UPDATE",updates:e});n.label=1;case 1:n.trys.push([1,3,,4]);return[4,g_.Z.patch({url:B.ANM.EMAIL_SETTINGS,body:{settings:{categories:e}},trackedActionData:{event:i.a9.EMAIL_SETTINGS_UPDATE,properties:{category:"marketing",value:!1}}})];case 2:t=n.sent();l.Z.dispatch({type:"EMAIL_SETTINGS_UPDATE_SUCCESS",settings:t.body});return[3,4];case 3:n.sent();l.Z.dispatch({type:"EMAIL_SETTINGS_UPDATE_FAILURE"});return[3,4];case 4:return[2]}}))}))).apply(this,arguments)}var R_=n(96483),x_=n(719799),M_=n.n(x_);function w_(e){var t=e.label,n=e.onChange,o=e.enabled,i=e.subLabel;return(0,r.jsx)(c.j7V,{value:!!o,onChange:n,note:i,children:t})}function D_(){var e=function(e,t){!function(e,t){C_.apply(this,arguments)}(e,t)},t=(0,y.e7)([xr.Z],(function(){return xr.Z.getSubsection()})),n=o.createRef(),i=(0,y.cj)([R_.Z],(function(){return R_.Z.getEmailSettings()})),a=i.categories,s=i.initialized;o.useEffect((function(){
if(null==s)!function(){A_.apply(this,arguments)}();else if(t===O_.vG.toUpperCase()){var e;null==n||null===(e=n.current)||void 0===e||e.scrollIntoView(!0)}}),[s,n,t]);var l=O_.M0.reduce((function(e,t){return e||!!a[t]}),!1);return s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{ref:n}),(0,r.jsxs)(c.hjN,{className:v()(fe().marginTop40),tag:c.RB0.H1,title:x.Z.Messages.USER_SETTINGS_EMAIL_NOTIFICATIONS,children:[O_.Od.map((function(t){var n=t.category,o=t.label,i=t.subLabel;return(0,r.jsx)(w_,{label:o(),subLabel:i(),enabled:a[n],onChange:function(t){return e(n,t)}},o())})),(0,r.jsx)(c.zxk,{className:M_().marketingUnsubscribeButton,disabled:!l,look:c.iLD.LINK,color:c.Ttl.LINK,onClick:P_,children:x.Z.Messages.USER_SETTINGS_EMAIL_NOTIFICATIONS_UNSUB_MARKETING}),(0,r.jsx)(c.R94,{type:c.geA.DESCRIPTION,children:x.Z.Messages.USER_SETTINGS_EMAIL_NOTIFICATIONS_UNSUB_MARKETING_DESCRIPTION}),(0,r.jsx)(c.$i$,{className:v()(fe().marginTop40,fe().marginBottom40)})]})]}):null}
var Z_=n(966378),L_=n.n(Z_);function U_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k_(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function G_(e){G_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return G_(e)}function B_(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function H_(e,t){return!t||"object"!==F_(t)&&"function"!=typeof t?function(e){
if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function V_(e,t){V_=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return V_(e,t)}var F_=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Y_(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=G_(e);if(t){var o=G_(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return H_(this,n)}}function z_(e){var t=e.label,n=e.enabled,o=e.disabled,i=e.onPreview,a=e.onChange;return(0,r.jsx)(c.j7V,{className:L_().soundRow,value:n,onChange:a,disabled:o,children:(0,r.jsxs)("div",{className:L_().notificationSound,children:[(0,r.jsx)("div",{
className:L_().soundName,children:t}),(0,r.jsx)(c.P3F,{className:L_().soundIcon,onClick:i,"aria-label":x.Z.Messages.USER_SETTINGS_NOTIFICATIONS_PREVIEW_SOUND,children:(0,r.jsx)(y_.Z,{width:16,height:16,className:L_().icon,"aria-hidden":!0})})]})})}function W_(e){var t=e.disabledSounds,n=e.disableAllSounds,i=e.notifyMessagesInSelectedChannel,a=f_.Z.useExperiment({}).allowSoundpacks;o.useEffect((function(){f_.Z.trackExposure({})}),[]);var s=o.useRef(),l=o.useCallback((function(e,t){t.stopPropagation();t.preventDefault();null!=s.current&&s.current.stop();s.current=Re.GN(e)}),[]),u=o.useCallback((function(e,n){var r=t.filter((function(t){return t!==e}));n||r.push(e);u_.default.setDisabledSounds(r)}),[t]);o.useEffect((function(){return function(){var e;null===(e=s.current)||void 0===e||e.stop()}}));var f=[{label:x.Z.Messages.SOUND_MESSAGE,sound:"message1"},{label:x.Z.Messages.SOUND_DEAFEN,sound:"deafen"},{label:x.Z.Messages.SOUND_UNDEAFEN,sound:"undeafen"},{label:x.Z.Messages.MUTE,
sound:"mute"},{label:x.Z.Messages.UNMUTE,sound:"unmute"},{label:x.Z.Messages.SOUND_VOICE_DISCONNECTED,sound:"disconnect"},{label:x.Z.Messages.SOUND_PTT_ACTIVATE,sound:"ptt_start"},{label:x.Z.Messages.SOUND_PTT_DEACTIVATE,sound:"ptt_stop"},{label:x.Z.Messages.SOUND_USER_JOIN,sound:"user_join"},{label:x.Z.Messages.SOUND_USER_LEAVE,sound:"user_leave"},{label:x.Z.Messages.SOUND_USER_MOVED,sound:"user_moved"},{label:x.Z.Messages.SOUND_OUTGOING_RING,sound:"call_calling"},{label:x.Z.Messages.SOUND_INCOMING_RING,sound:"call_ringing"},{label:x.Z.Messages.SOUND_STREAM_STARTED,sound:"stream_started"},{label:x.Z.Messages.SOUND_STREAM_STOPPED,sound:"stream_ended"},{label:x.Z.Messages.SOUND_VIEWER_JOIN,sound:"stream_user_joined"},{label:x.Z.Messages.SOUND_VIEWER_LEAVE,sound:"stream_user_left"},{label:x.Z.Messages.SOUND_INVITED_TO_SPEAK,sound:"reconnect"}];return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.SOUNDS,children:[a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.vwX,{
className:fe().marginBottom20,children:x.Z.Messages.SOUNDPACK_LABEL}),(0,r.jsx)(h_,{className:fe().marginBottom40})]}):null,(0,r.jsx)(c.j7V,{note:x.Z.Messages.USER_SETTINGS_NOTIFICATIONS_NOTIFY_MESSAGES_IN_SELECTED_CHANNEL_NOTE,value:i,onChange:u_.default.setNotifyMessagesInSelectedChannel,children:x.Z.Messages.USER_SETTINGS_NOTIFICATIONS_NOTIFY_MESSAGES_IN_SELECTED_CHANNEL_LABEL}),(0,r.jsx)(c.j7V,{note:x.Z.Messages.SOUND_DISABLE_ALL_NOTE,value:n,onChange:u_.default.toggleDisableAllSounds,children:x.Z.Messages.SOUND_DISABLE_ALL}),f.map((function(e){var o=e.label,i=e.sound;return(0,r.jsx)(z_,{label:o,disabled:n,onChange:function(e){return u(i,e)},onPreview:function(e){return l(i,e)},enabled:!n&&!t.includes(i)},i)}))]})}var K_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&V_(e,t)}(n,e);var t=Y_(n)
;function n(){U_(this,n);var e;(e=t.apply(this,arguments)).handleToggleShowUnreadBadge=function(){u_.default.setDisableUnreadBadge(!e.props.disableUnreadBadge)};e.handleToggleShowFlash=function(){u_.default.setTaskbarFlash(!e.props.taskbarFlash)};e.renderTTS=function(){if(!Ml.Zh)return null;var t=[{name:x.Z.Messages.TTS_ALLS,value:B.PrB.ALL_CHANNELS},{name:x.Z.Messages.TTS_CURRENT,value:B.PrB.SELECTED_CHANNEL},{name:x.Z.Messages.TTS_NEVER,value:B.PrB.NEVER}];return(0,r.jsxs)(c.xJW,{title:x.Z.Messages.FORM_LABEL_TTS_NOTIFICATIONS,children:[(0,r.jsx)(c.R94,{type:c.geA.DESCRIPTION,className:fe().marginBottom8,children:x.Z.Messages.FORM_DESCRIPTION_TTS}),(0,r.jsx)(c.Eep,{options:t,onChange:e.handleTTSChange,value:e.props.ttsType})]})};return e}var o=n.prototype;o.handleDesktopChange=function(e){var t,n=e?B.qrD.ALL:B.qrD.NEVER;n!==B.qrD.NEVER?(t="UserSettingsModal",m_.Z.requestPermission((function(e){var n=e?B.$Ab.ENABLED:B.$Ab.BLOCKED;u_.default.setPermissionsState(n,t)
}))):u_.default.setDesktopType(n)};o.handleTTSChange=function(e){var t=e.value;u_.default.setTTSType(t)};o.render=function(){var e=this.props,t=e.desktopType,n=e.afkTimeout,o=e.disableUnreadBadge,i=e.taskbarFlash,a=e.disabledSounds,s=e.disableAllSounds,l=e.notifyMessagesInSelectedChannel,u=Yc.FB&&(0,Yc.ED)(),f=_e().range(1,11).map((function(e){return{value:60*e,label:x.Z.Messages.DURATION_MINUTES.format({minutes:e})}}));return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.NOTIFICATIONS,children:[(0,r.jsx)(c.j7V,{className:fe().marginBottom20,value:t!==B.qrD.NEVER,onChange:this.handleDesktopChange,note:x.Z.Messages.DESKTOP_NOTIFICATIONS_ENABLE_BODY,children:x.Z.Messages.DESKTOP_NOTIFICATIONS_ENABLE}),(0,r.jsx)(c.j7V,{className:u?fe().marginBottom20:fe().marginBottom40,value:!o,note:x.Z.Messages.USER_SETTINGS_NOTIFICATIONS_SHOW_BADGE_BODY,onChange:this.handleToggleShowUnreadBadge,children:x.Z.Messages.USER_SETTINGS_NOTIFICATIONS_SHOW_BADGE_LABEL}),u?(0,r.jsx)(c.j7V,{
className:fe().marginBottom40,value:i,note:x.Z.Messages.USER_SETTINGS_NOTIFICATIONS_SHOW_FLASH_BODY,onChange:this.handleToggleShowFlash,children:x.Z.Messages.USER_SETTINGS_NOTIFICATIONS_SHOW_FLASH_LABEL}):null,(0,r.jsxs)(c.xJW,{title:x.Z.Messages.FORM_LABEL_PUSH_AFK_TIMEOUT,children:[(0,r.jsx)(c.q4e,{value:n,onChange:ni.CM.updateSetting,options:f}),(0,r.jsx)(c.R94,{type:c.geA.DESCRIPTION,className:fe().marginTop8,children:x.Z.Messages.FORM_DESCRIPTION_PUSH_AFK_TIMEOUT}),(0,r.jsx)(c.$i$,{className:v()(fe().marginTop40,fe().marginBottom40)})]}),this.renderTTS(),(0,r.jsx)(c.$i$,{className:v()(fe().marginTop40,fe().marginBottom40)}),(0,r.jsx)(c.xJW,{children:(0,r.jsx)(W_,{disabledSounds:a,disableAllSounds:s,notifyMessagesInSelectedChannel:l})}),(0,r.jsx)(D_,{})]})};return n}(o.PureComponent);function q_(){var e=(0,y.cj)([E_.Z],(function(){return{disableUnreadBadge:E_.Z.getDisableUnreadBadge(),taskbarFlash:E_.Z.taskbarFlash,disabledSounds:E_.Z.getDisabledSounds(),
disableAllSounds:E_.Z.getDisableAllSounds(),desktopType:E_.Z.getDesktopType(),ttsType:E_.Z.getTTSType(),notifyMessagesInSelectedChannel:E_.Z.getNotifyMessagesInSelectedChannel()}}));return(0,r.jsx)(K_,B_(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){k_(e,t,n[t])}))}return e}({},e),{afkTimeout:ni.CM.useSetting()}))}var X_=n(993754),Q_=n(928927),$_=n(674482),J_=n(630395),eI=n(725547),tI=n.n(eI);function nI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rI(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function oI(e){oI=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return oI(e)
}function iI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){rI(e,t,n[t])}))}return e}function aI(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function sI(e,t){return!t||"object"!==lI(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function cI(e,t){
cI=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return cI(e,t)}var lI=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function uI(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=oI(e);if(t){var o=oI(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return sI(this,n)}}function fI(){var e=$_.Z.getNotificationPositionMode(),t=e!==B._vf.DISABLED,n=G.Z.getOverlayKeybind(),r=G.Z.getOverlayChatKeybind();Dr.default.track(B.rMx.OVERLAY_SETTINGS_UPDATED,{enabled:Hc.Z.enabled,notifications_enabled:t,notifications_position:t?e:null,text_notifications_mode:$_.Z.getTextChatNotificationMode(),hotkey:null!=n?(0,Dv.BB)(n.shortcut):null,text_activation_hotkey:null!=r?(0,
Dv.BB)(r.shortcut):null,text_opacity_slider:$_.Z.getTextWidgetOpacity()})}var dI=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&cI(e,t)}(n,e);var t=uI(n);function n(){nI(this,n);var e;(e=t.apply(this,arguments)).handleChangeEnabled=function(e){X_.Z.setEnabled(e);fI();Dr.default.track(B.rMx.OVERLAY_TOGGLED,{enabled:e,setting_type:"overlay toggled - global"})};e.handleChangeDisplayNameMode=function(e){var t=e.value;X_.Z.setDisplayNameMode(t)};e.handleChangeAvatarSizeMode=function(e){var t=e.value;X_.Z.setAvatarSizeMode(t)};e.handleChangeDisplayUserMode=function(e){var t=e.value;X_.Z.setDisplayUserMode(t)};e.handleChangeTextNotificationMode=function(){var t=B.Ypu.ENABLED,n=B.Ypu.DISABLED,r=e.props.textChatNotificationMode===t?n:t;X_.Z.setTextChatNotificationMode(r);fI()}
;e.handleChangeNotificationPositionMode=function(e,t){X_.Z.setNotificationPositionMode(t);fI()};e.handleInputLockShortcutChange=function(t){U.Z.setKeybind(aI(iI({},e.props.inputLockKeybind),{shortcut:t}));fI()};return e}var i=n.prototype;i.renderExplanation=function(){return null};i.renderOverlayToggle=function(){var e=this.props,t=e.enabled,n=e.inputLockKeybind,o=(0,Q_.$1)();return(0,r.jsxs)(ae.Z,{className:fe().marginBottom20,children:[(0,r.jsx)(ae.Z.Child,{basis:"50%",children:(0,r.jsxs)(c.xJW,{children:[(0,r.jsx)(c.vwX,{tag:c.RB0.H5,children:x.Z.Messages.SETTINGS_GAMES_ENABLE_OVERLAY_LABEL}),(0,r.jsx)(c.j7V,{className:fe().marginBottom20,style:{marginTop:16},value:t,disabled:o,note:o?x.Z.Messages.OVERLAY_DISABLED_OLD_CLIENT:null,hideBorder:!0,onChange:this.handleChangeEnabled,children:x.Z.Messages.ENABLE_INGAME_OVERLAY})]})}),(0,r.jsx)(ae.Z.Child,{basis:"50%",children:(0,r.jsx)(c.xJW,{title:x.Z.Messages.KEYBIND_TOGGLE_OVERLAY_INPUT_LOCK,children:(0,r.jsx)(k.Z,{disabled:!t,
defaultValue:null!=n?n.shortcut:[],onChange:this.handleInputLockShortcutChange})})})]})};i.renderAvatarSize=function(){return(0,r.jsx)(ae.Z,{className:fe().marginBottom20,children:(0,r.jsx)(ae.Z.Child,{children:(0,r.jsx)(c.xJW,{title:x.Z.Messages.FORM_LABEL_AVATAR_SIZE,children:(0,r.jsx)(c.Eep,{options:[{name:x.Z.Messages.AVATAR_SIZE_OPTION_LARGE,value:B.ipw.LARGE},{name:x.Z.Messages.AVATAR_SIZE_OPTION_SMALL,value:B.ipw.SMALL}],onChange:this.handleChangeAvatarSizeMode,value:this.props.avatarSizeMode})})})})};i.renderDisplayNames=function(){return(0,r.jsx)(ae.Z,{className:fe().marginBottom20,children:(0,r.jsx)(ae.Z.Child,{children:(0,r.jsx)(c.xJW,{title:x.Z.Messages.FORM_LABEL_DISPLAY_NAMES,children:(0,r.jsx)(c.Eep,{options:[{name:x.Z.Messages.DISPLAY_OPTION_ALWAYS,value:B.wC$.ALWAYS},{name:x.Z.Messages.DISPLAY_OPTION_ONLY_WHILE_SPEAKING,value:B.wC$.ONLY_WHILE_SPEAKING},{name:x.Z.Messages.DISPLAY_OPTION_NEVER,value:B.wC$.NEVER}],onChange:this.handleChangeDisplayNameMode,
value:this.props.displayNameMode})})})})};i.renderDisplayUsers=function(){return(0,r.jsx)(ae.Z,{className:fe().marginBottom20,children:(0,r.jsx)(ae.Z.Child,{children:(0,r.jsx)(c.xJW,{title:x.Z.Messages.FORM_LABEL_DISPLAY_USERS,children:(0,r.jsx)(c.Eep,{options:[{name:x.Z.Messages.DISPLAY_OPTION_ALWAYS,value:B.OYC.ALWAYS},{name:x.Z.Messages.DISPLAY_OPTION_ONLY_WHILE_SPEAKING,value:B.OYC.ONLY_WHILE_SPEAKING}],onChange:this.handleChangeDisplayUserMode,value:this.props.displayUserMode})})})})};i.renderTextNotificationMode=function(){var e=this.props.notificationPositionMode!==B._vf.DISABLED,t=e&&this.props.textChatNotificationMode===B.Ypu.ENABLED;return(0,r.jsx)(ae.Z,{className:fe().marginBottom20,children:(0,r.jsx)(ae.Z.Child,{children:(0,r.jsx)(c.xJW,{children:(0,r.jsx)(c.j7V,{value:t,disabled:!e,onChange:this.handleChangeTextNotificationMode,hideBorder:!0,children:x.Z.Messages.FORM_LABEL_OVERLAY_TEXT_CHAT_NOTIFICATIONS})})})})};i.renderNotificationPosition=function(){return(0,
r.jsx)(ae.Z,{className:fe().marginBottom20,children:(0,r.jsx)(ae.Z.Child,{children:(0,r.jsx)(c.xJW,{title:x.Z.Messages.FORM_LABEL_NOTIFICATION_POSITION,children:(0,r.jsx)("div",{className:tI().notificationSettings,children:(0,r.jsx)(J_.Z,{position:this.props.notificationPositionMode,onChange:this.handleChangeNotificationPositionMode})})})})})};i.render=function(){return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.OVERLAY,children:[this.renderExplanation(),this.renderOverlayToggle(),this.renderAvatarSize(),this.renderDisplayNames(),this.renderDisplayUsers()]}),(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.OVERLAY_NOTIFICATIONS_SETTINGS,className:fe().marginTop40,children:[this.renderNotificationPosition(),this.renderTextNotificationMode()]})]})};return n}(o.PureComponent);const pI=y.ZP.connectStores([Hc.Z,$_.Z,G.Z],(function(){return{enabled:Hc.Z.enabled,avatarSizeMode:$_.Z.getAvatarSizeMode(),displayNameMode:$_.Z.getDisplayNameMode(),
displayUserMode:$_.Z.getDisplayUserMode(),notificationPositionMode:$_.Z.getNotificationPositionMode(),textChatNotificationMode:$_.Z.getTextChatNotificationMode(),inputLockKeybind:G.Z.getOverlayKeybind()}}))(dI);var hI=n(326786),EI=n(723636),yI=n(73407),mI=n(934870),bI=n(775506),gI=n(930865),OI=n(301041),vI=n(414357),_I=n(81708),II=n.n(_I);function SI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TI(e){TI=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return TI(e)}function NI(e,t){return!t||"object"!==CI(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function AI(e,t){AI=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return AI(e,t)}var CI=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function PI(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=TI(e);if(t){var o=TI(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return NI(this,n)}}const jI=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&AI(e,t)}(n,e);var t=PI(n);function n(){SI(this,n);return t.apply(this,arguments)}var o=n.prototype;o.renderIcon=function(e){return e===B.Eu4.NONE?(0,r.jsx)(vI.Z,{tier:B.Eu4.TIER_1,className:II().gemWithoutLabel}):(0,r.jsx)(vI.Z,{tier:e,className:II().gemWithLabel})};o.render=function(){var e=this.props,t=e.className,n=e.guildId,o=e.subscriberCount,i=(0,
gI.rF)(o,n),a=(0,gI.Fd)(o,n),s=null!=a?(0,gI.vn)(n)[a]:null,c=null!=s&&s>0?o/s*100:100;return(0,r.jsx)(OI.Z,{background:II().progressBackground,percent:c,strokeSize:OI.Z.StrokeSizes.SMALL,className:v()(II().gemIndicatorProgressCircle,t),children:(0,r.jsxs)("div",{className:II().gemIndicatorContainer,children:[this.renderIcon(i),(0,r.jsx)("div",{className:II().tierLabel,children:(0,gI.nW)(i)})]})})};return n}(o.Component);var RI=n(217674),xI=n(102921);function MI(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function wI(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){MI(i,r,o,a,s,"next",e)}function s(e){MI(i,r,o,a,s,"throw",e)}a(void 0)}))}}function DI(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function ZI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){DI(e,t,n[t])}))}return e}function LI(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var UI=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){
if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function kI(e){var t=e.guildBoostSlot,o=e.onClose,i=e.hasCancelableGuildBoostSlot,a=e.premiumSubscription,s=e.onSelect,l=a.status===B.O0b.PAST_DUE;return(0,r.jsxs)(c.v2r,{onSelect:s,navId:"subscription-context",
variant:"fixed","aria-label":x.Z.Messages.GENERIC_ACTIONS_MENU_LABEL,onClose:o,children:[(0,r.jsx)(c.sNh,{id:"apply",label:null!=t.premiumGuildSubscription?x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_TRANSFER_BUTTON:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_SELECT_SERVER_BUTTON,subtext:t.isOnCooldown()?x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_TRANSFER_BUTTON_DISABLED_TOOLTIP:null,action:function(){(0,c.ZDy)(wI((function(){var e,o;return UI(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(67550),n.e(19863),n.e(47311)]).then(n.bind(n,947311))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,LI(ZI({},e),{guildBoostSlots:[t],locationSection:B.jXE.SETTINGS_PREMIUM}))}]}}))})))},disabled:t.isOnCooldown()}),t.canceled?(0,r.jsx)(c.sNh,{id:"uncancel",label:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_SLOT_UNCANCEL_BUTTON,subtext:l?x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_CANCEL_BUTTON_DISABLED_PAST_DUE_TOOLTIP:null,action:function(){(0,c.ZDy)(wI((function(){
var e,o;return UI(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(46903)]).then(n.bind(n,546903))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,LI(ZI({},e),{guildBoostSlotId:t.id}))}]}}))})))},disabled:l}):(0,r.jsx)(c.sNh,{id:"cancel",label:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_SLOT_CANCEL_BUTTON,subtext:i?l?x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_CANCEL_BUTTON_DISABLED_PAST_DUE_TOOLTIP:null:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_CANCEL_BUTTON_DISABLED_TOOLTIP,action:function(){(0,c.ZDy)(wI((function(){var e,o;return UI(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(64991)]).then(n.bind(n,464991))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,LI(ZI({},e),{guildBoostSlot:t}))}]}}))})))},disabled:!i||l,color:"danger"})]})}var GI=n(658308),BI=n(832169),HI=n.n(BI);function VI(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n
;return e}function FI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){VI(e,t,n[t])}))}return e}function YI(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var zI="0";function WI(e){var t=e.deadline,n=(0,yI.Z)(t,1e3),o=n.days,i=n.hours,a=n.minutes;return(0,r.jsx)(r.Fragment,{children:x.Z.Messages.PREMIUM_GUILD_COOLDOWN_AVAILABLE_COUNTDOWN.format({days:o,
hours:i,minutes:a})})}function KI(e){var t=e.guild,n=e.guildBoostSlots,i=e.availableGuildBoostSlots,a=o.useContext(Dr.AnalyticsContext),s=(0,E.Z)().analyticsLocations,l=t.premiumSubscriberCount,u=n.sort((function(e,t){return Number(null!=e.premiumGuildSubscription?e.premiumGuildSubscription.id:0)-Number(null!=t.premiumGuildSubscription?t.premiumGuildSubscription.id:0)}))[0];if(null==u)return null;var f=null!=u.premiumGuildSubscription?xI.Z.extractTimestamp(u.premiumGuildSubscription.id):0,d=(0,gI.xf)(f),p=null!=t.banner?si.ZP.getGuildBannerURL(t):null;return(0,r.jsxs)("div",{className:HI().guildHeader,children:[(0,r.jsx)("div",{className:HI().guildHeaderBackground,style:{backgroundImage:null!=p?"url(".concat(p,")"):void 0}}),(0,r.jsx)(Kt.Z,{guild:t,className:HI().guildIcon}),(0,r.jsxs)("div",{className:HI().guildHeaderContent,children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",className:HI().guildName,children:t.name}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",
className:HI().guildSubscriptionDuration,children:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_DURATION.format({months:d,date:new Date(f)})}),(0,r.jsxs)(c.xvT,{variant:"text-xs/normal",className:HI().guildSubscriberCount,children:[(0,r.jsx)(RI.Z,{className:HI().guildSubscriberCountIcon}),(0,r.jsx)("div",{children:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_SUBSCRIBER_COUNT_TOOLTIP.format({subscriberCount:n.length})}),0!==i.length?(0,r.jsx)(c.eee,{onClick:function(){if(0!==i.length){var e=YI(FI({},a.location),{section:B.jXE.SETTINGS_PREMIUM});(0,GI.u)({analyticsLocations:s,analyticsLocation:e,guild:t})}},className:HI().guildSubscribeButton,children:x.Z.Messages.PREMIUM_GUILD_PERKS_MODAL_BUTTON_SUBSCRIBE_THIS_SERVER}):null]})]}),(0,r.jsx)("div",{className:HI().guildGemIndicatorContainer,children:(0,r.jsx)(c.P3F,{onClick:function(){(0,mI.X)(t.id);(0,Se.xf)()},children:(0,r.jsx)(jI,{className:HI().gemIndicator,subscriberCount:l,guildId:t.id})})})]})}function qI(e){
var t=e.guildBoostSlot,n=e.premiumSubscription,o=e.hasCancelableGuildBoostSlot,i=null!=t.cooldownEndsAt?new Date(t.cooldownEndsAt):null,a=null!=i&&i>new Date,s=null!=t.premiumGuildSubscription?new Date(xI.Z.extractTimestamp(t.premiumGuildSubscription.id)):null,l=t.canceled,u=l?Fc.Z:RI.Z;return(0,r.jsxs)("div",{className:HI().guildSubscriptionSlot,children:[(0,r.jsx)(u,{className:v()(HI().guildSubscriptionSlotIcon,VI({},HI().guildSubscriptionSlotIconCanceled,l))}),(0,r.jsxs)("div",{className:HI().guildSubscriptionSlotContent,children:[(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:HI().guildSubscriptionCreationDate,children:null!=s?x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_CREATION_DATE.format({date:s}):x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_UNUSED_SLOT_DESCRIPTION}),(0,r.jsxs)(c.xvT,{variant:"text-xs/normal",color:"text-muted",children:[a&&null!=i?(0,r.jsx)(WI,{deadline:i.getTime()}):null,a&&l?" • ":null,l?x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_PENDING_CANCELATION.format({
date:n.currentPeriodEnd}):null]})]}),(0,r.jsx)(c.yRy,{renderPopout:function(e){var i=e.closePopout;return(0,r.jsx)(kI,{onClose:i,guildBoostSlot:t,premiumSubscription:n,hasCancelableGuildBoostSlot:o})},position:"right",align:"center",children:function(e){return(0,r.jsx)(c.P3F,YI(FI({},e),{"aria-label":x.Z.Messages.MORE_OPTIONS,className:HI().guildSubscriptionSlotMenuIcon,children:(0,r.jsx)(Gu.Z,{})}))}})]})}function XI(e){var t=e.guildId,n=e.guildBoostSlots,o=e.premiumSubscription,i=e.availableGuildBoostSlots,a=e.hasCancelableGuildBoostSlot,s=(0,y.e7)([an.Z],(function(){return t!==zI?an.Z.getGuild(t):null}));return null==s&&t!==zI?null:(0,r.jsxs)("div",{className:HI().guild,children:[null!=s?(0,r.jsx)(KI,{guild:s,guildBoostSlots:n,availableGuildBoostSlots:i}):null,(0,r.jsx)("div",{className:HI().guildSubscriptionSlots,children:n.map((function(e){return(0,r.jsx)(qI,{guildBoostSlot:e,premiumSubscription:o,hasCancelableGuildBoostSlot:a},e.id)}))})]})}function QI(){var e=(0,
y.e7)([Rt.Z],(function(){return Rt.Z.getPremiumTypeSubscription()})),t=(0,y.e7)([bI.Z],(function(){return bI.Z.boostSlots})),n=_e()(t).filter((function(e){return e.isAvailable()})).value(),o=_e()(t).groupBy((function(e){var t=e.premiumGuildSubscription;return null!=t?t.guildId:zI})).value(),i=o[0],a=Object.keys(o).filter((function(e){return e!==zI}));if(0===a.length&&null==i||null==e)return null;var s=_e()(t).filter((function(e){return!e.canceled})).value().length>Zr.ZP.getNumIncludedPremiumGuildSubscriptionSlots(e.planId);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:HI().blurb,children:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_SUBTITLE.format({helpdeskArticle:ta.Z.getArticleURL(B.BhN.GUILD_SUBSCRIPTIONS)})}),null!=i?(0,r.jsx)(XI,{guildId:zI,guildBoostSlots:i,premiumSubscription:e,availableGuildBoostSlots:n,hasCancelableGuildBoostSlot:s}):null,a.length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.X6q,{
variant:"heading-deprecated-12/semibold",className:HI().subSectionHeader,children:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_ACTIVE_TITLE}),a.map((function(t){return(0,r.jsx)(XI,{guildId:t,guildBoostSlots:o[t],premiumSubscription:e,availableGuildBoostSlots:n,hasCancelableGuildBoostSlot:s},t)}))]}):null]})}var $I=n(726544),JI=n.n($I);function eS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tS(e){tS=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return tS(e)}function nS(e,t){return!t||"object"!==oS(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function rS(e,t){rS=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return rS(e,t)}var oS=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function iS(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=tS(e);if(t){var o=tS(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return nS(this,n)}}const aS=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&rS(e,t)}(n,e);var t=iS(n);function n(){eS(this,n);var e;(e=t.apply(this,arguments)).renderFeature=function(t,n){return(0,r.jsxs)("div",{className:JI().feature,children:[e.renderIcon(t),(0,r.jsxs)("div",{children:[null!=t.title?(0,r.jsx)("div",{className:JI().title,children:t.title}):null,(0,r.jsx)("div",{
className:null==t.title?JI().descriptionStandalone:JI().description,children:t.description})]})]},n)};return e}var o=n.prototype;o.renderIcon=function(e){if(null!=e.overrideIcon)return e.overrideIcon(JI().icon);if(null!=e.icon&&null!=e.iconClass){var t=e.icon;return(0,r.jsx)(t,{className:v()(JI().icon,e.iconClass)})}throw new Error("Missing overrideIcon or iconName and iconClass")};o.render=function(){return(0,r.jsx)("div",{className:JI().features,style:{gridTemplateColumns:Array(this.props.columns).fill("1fr").join(" ")},children:this.props.features.map(this.renderFeature)})};return n}(o.Component);var sS=n(399370),cS=n(781453),lS=n(841070),uS=n(23727),fS=n(855595),dS=n(71236);function pS(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function hS(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e)
;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function ES(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function yS(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=ES(e,["width","height","color"]);return(0,r.jsxs)("svg",hS(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
;"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){pS(e,t,n[t])}))}return e}({width:n,height:i},(0,Ah.Z)(c)),{viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M13.8003 3.59643V7.86267C13.8003 9.15683 14.8448 10.2011 16.1393 10.2011H20.4067C20.9334 10.2011 21.2012 9.56739 20.8263 9.19253L14.8091 3.17694C14.4341 2.80208 13.8003 3.06092 13.8003 3.59643Z",fill:s}),(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",
d:"M11.9727 7.88073C11.9727 10.1692 13.8304 12.0269 16.1189 12.0269H20.9471V19.2064C20.9471 20.1936 20.1394 21.0013 19.1523 21.0013H4.79318C3.80599 21.0013 2.99829 20.1936 2.99829 19.2064V4.84737C2.99829 3.86019 3.80599 3.05249 4.79318 3.05249H11.9727V7.88073ZM13.8 14C13.8 14.9941 12.9941 15.8 12 15.8C11.0059 15.8 10.2 14.9941 10.2 14H9C9 15.6569 10.3431 17 12 17C13.6569 17 15 15.6569 15 14H13.8ZM7 15C7 15.5523 6.55228 16 6 16C5.44772 16 5 15.5523 5 15C5 14.4477 5.44772 14 6 14C6.55228 14 7 14.4477 7 15ZM18 16C18.5523 16 19 15.5523 19 15C19 14.4477 18.5523 14 18 14C17.4477 14 17 14.4477 17 15C17 15.5523 17.4477 16 18 16Z",fill:s})]}))}var mS=n(890592),bS=n(84670),gS=n(86124),OS=n.n(gS);function vS(e){var t=e.guild;return(0,r.jsx)(c.P3F,{onClick:function(){(0,mI.X)(t.id,{state:{shouldShowSubscribeTooltip:!0}});(0,Se.xf)()},className:OS().cardWrapper,children:(0,r.jsxs)(sS.Z,{className:OS().card,children:[(0,r.jsx)(Kt.Z,{guild:t,size:Kt.Z.Sizes.LARGE,"aria-hidden":!0}),(0,r.jsxs)("div",{
className:OS().guildInfo,children:[(0,r.jsx)(c.xvT,{variant:"text-md/normal",className:OS().guildName,children:t.name}),(0,r.jsxs)("div",{className:OS().subscriptionInfo,children:[(0,r.jsx)(RI.Z,{className:OS().guildBoostingIcon}),(0,r.jsx)(c.xvT,{className:OS().subscriberCount,variant:"text-sm/normal",children:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_SUBSCRIBER_COUNT_TOOLTIP.format({subscriberCount:t.premiumSubscriberCount})})]})]}),(0,r.jsx)(jI,{guildId:t.id,subscriberCount:t.premiumSubscriberCount})]})})}function _S(){var e=(0,y.e7)([Ns.Z],(function(){return Ns.Z.getFlattenedGuilds()})).slice(0,B.MsY),t=(0,jn.V)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:OS().divider}),(0,r.jsxs)("div",{className:OS().marketingLogo,children:[(0,r.jsx)(lS.Z,{className:OS().marketingLogoIcon}),(0,r.jsx)("div",{className:OS().marketingLogoImage})]}),(0,r.jsx)(c.xvT,{tag:"p",className:OS().marketingHeader,variant:"heading-lg/semibold",
children:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_MARKETING_HEADER}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_MARKETING_BLURB}),(0,r.jsx)(c.X6q,{className:OS().featureHeaderTop,variant:"heading-lg/semibold",color:"header-secondary",children:x.Z.Messages.PREMIUM_GUILD_USER_FEATURES_HEADER}),(0,r.jsx)(aS,{features:[{description:x.Z.Messages.PREMIUM_GUILD_USER_FEATURE_MEMBER_BADGE,icon:RI.Z,iconClass:OS().memberBadgeIcon},{description:x.Z.Messages.PREMIUM_GUILD_USER_FEATURE_PROFILE_BADGE,overrideIcon:function(e){return(0,r.jsx)("div",{className:v()(e,OS().profileBadgeIcon)})}},{description:x.Z.Messages.PREMIUM_GUILD_USER_FEATURE_ROLE,icon:fS.Z,iconClass:OS().roleIcon}],columns:3}),(0,r.jsx)(c.X6q,{className:OS().featureHeader,variant:"heading-lg/semibold",color:"header-secondary",children:x.Z.Messages.PREMIUM_GUILD_GUILD_FEATURES_HEADER}),(0,r.jsx)(aS,{features:[{description:x.Z.Messages.PREMIUM_GUILD_GUILD_FEATURE_EMOJI,icon:cS.Z,
iconClass:OS().emojiIcon},{description:x.Z.Messages.PREMIUM_GUILD_GUILD_FEATURE_STICKERS,icon:yS,iconClass:OS().stickerIcon},{description:x.Z.Messages.PREMIUM_GUILD_GUILD_FEATURE_AUDIO_QUALITY,icon:uS.Z,iconClass:OS().audioQualityIcon},{description:x.Z.Messages.PREMIUM_GUILD_GUILD_FEATURE_UPLOAD_SIZE,icon:bS.Z,iconClass:OS().uploadSizeIcon},{description:x.Z.Messages.PREMIUM_GUILD_GUILD_FEATURE_CUSTOMIZATION,icon:dS.Z,iconClass:OS().customizationIcon},{description:x.Z.Messages.PREMIUM_GUILD_GUILD_FEATURE_THREADS,icon:mS.Z,iconClass:OS().threadIcon}].filter(Le.lm),columns:3}),(0,r.jsx)(c.xvT,{className:OS().guildFullFeatures,variant:"text-md/normal",children:x.Z.Messages.PREMIUM_GUILD_FULL_FEATURE_LIST.format({helpdeskArticle:ta.Z.getArticleURL(B.BhN.GUILD_SUBSCRIPTIONS)})}),(0,r.jsxs)("section",{className:OS().guildsSection,children:[t?(0,r.jsx)(EI.Z,{className:OS().guildSubscriptionHeading}):null,null==e||0===e.length?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{
className:OS().emptyGuilds}),(0,r.jsx)(c.xvT,{variant:"text-lg/bold",className:OS().emptyGuildsTitle,children:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_MARKETING_GUILDS_EMPTY_DESCRIPTION_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",className:OS().emptyGuildsText,children:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_MARKETING_GUILDS_EMPTY_DESCRIPTION_TEXT})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xvT,{variant:"text-md/normal",className:OS().guildsBlurb,children:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_MARKETING_GUILDS_BLURB}),(0,r.jsx)("div",{className:OS().guilds,children:e.map((function(e){return(0,r.jsx)(vS,{guild:e},e.id)}))})]})]}),(0,r.jsx)(hI.Z,{onOpenPremiumClick:function(){Dr.default.track(B.rMx.PREMIUM_PROMOTION_OPENED,{location:{page:B.ZY5.USER_SETTINGS,section:B.jXE.NITRO_CROSS_PROMO_FROM_BOOSTING,object:B.qAy.BUTTON_CTA}})}})]})}function IS(){o.useEffect((function(){l.Z.wait((function(){Tt.jg();Tt.tZ();(0,Nt.X8)();(0,Ct.Y2)(null,null,B.JjL.DISCOVERY)}))}),[]);var e=(0,
y.e7)([Rt.Z],(function(){return Rt.Z.hasFetchedSubscriptions()})),t=(0,jn.V)(),n=(0,y.e7)([Wt.Z],(function(){return Wt.Z.hasFetchedPaymentSources})),i=(0,y.e7)([bI.Z],(function(){return bI.Z.boostSlots}));return e&&t&&n?(0,r.jsxs)("div",{className:OS().container,children:[(0,r.jsx)("div",{className:OS().background}),(0,r.jsx)("div",{className:OS().content,children:(0,r.jsx)(c.y5t,{component:Object.keys(i).length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.vwX,{tag:"h1",children:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_TITLE}),(0,r.jsx)(GE.oQ,{}),(0,r.jsx)(QI,{})]}):null,children:(0,r.jsx)(_S,{})})})]}):(0,r.jsx)("div",{className:v()(OS().container,OS().loading),children:(0,r.jsx)(c.$jN,{})})}var SS=n(105783),TS=n(546274),NS=n(540825),AS=n(652119),CS=n(31914),PS=n(294303),jS=n(665640),RS=n.n(jS);function xS(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function MS(e){
MS=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return MS(e)}function wS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){xS(e,t,n[t])}))}return e}function DS(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function ZS(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{}
;var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function LS(e,t){return!t||"object"!==kS(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function US(e,t){US=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return US(e,t)}var kS=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function GS(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=MS(e);if(t){
var o=MS(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return LS(this,n)}}function BS(e){var t=e.body,n=ZS(e,["body"]);(0,c.h7j)((function(e){return(0,r.jsx)(c.sm4,DS(wS({},e,n),{children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:t})}))}))}function HS(e){var t=e.message;BS({header:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_FAILURE_TITLE,confirmText:x.Z.Messages.OKAY,body:t})}var VS=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&US(e,t)}(n,e);var t=GS(n);function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var r;(r=t.call(this,e)).handleChangeDefaultGuildsRestricted=function(e){r.setState({defaultGuildsRestricted:!e},(function(){return r.showGuildRestrictionModal(!e)}))}
;r.handleChangeDropsOptedOut=function(){r.props.personalization&&ni.bh.updateSetting(!r.props.dropsOptedOut)};r.handleChangeDefaultMessageRequestRestricted=function(e){r.setState({defaultMessageRequestRestricted:!e},(function(){return r.showMessageRequestRestrictionModal(!e)}))};r.handleUsageStatisticsChange=function(){!r.props.usageStatistics?(0,TS.g)([B.pjP.USAGE_STATISTICS],[]).catch(HS):BS({header:x.Z.Messages.USAGE_STATISTICS_DISABLE_MODAL_TITLE,body:x.Z.Messages.USAGE_STATISTICS_DISABLE_MODAL_BODY,confirmText:x.Z.Messages.USAGE_STATISTICS_DISABLE_MODAL_CONFIRM,cancelText:x.Z.Messages.USAGE_STATISTICS_DISABLE_MODAL_CANCEL,onConfirm:function(){return(0,TS.g)([],[B.pjP.USAGE_STATISTICS]).catch(HS)}})};r.handlePersonalizationChange=function(){!r.props.personalization?(0,TS.g)([B.pjP.PERSONALIZATION],[]).catch(HS):BS({header:x.Z.Messages.PERSONALIZATION_DISABLE_MODAL_TITLE,confirmText:x.Z.Messages.PERSONALIZATION_DISABLE_MODAL_CONFIRM,
cancelText:x.Z.Messages.PERSONALIZATION_DISABLE_MODAL_CANCEL,onConfirm:function(){(0,TS.g)([],[B.pjP.PERSONALIZATION]).catch(HS);ni.bh.updateSetting(!0)},body:x.Z.Messages.PERSONALIZATION_DISABLE_MODAL_BODY})};r.handleAccessibilityDetectionChange=function(){ni.dQ.updateSetting(!r.props.allowAccessibilityDetection)};r.handleDataDownloadRequest=function(){BS({header:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_MODAL_TITLE,body:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_MODAL_NOTE,confirmText:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_MODAL_CONFIRM,cancelText:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_MODAL_CANCEL,onConfirm:function(){r.setState({requestingHarvest:!0},(function(){(0,f.V3)().then((function(e){if(null!=e&&null!=e.body){r.setState({currentHarvestRequest:e.body});SS.Z.show({body:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_MODAL_SUCCESS})}else SS.Z.show({title:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_FAILURE_TITLE,
body:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_FAILURE_BODY})}),(function(){return SS.Z.show({title:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_FAILURE_TITLE,body:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_FAILURE_BODY})})).finally((function(){return r.setState({requestingHarvest:!1})}))}))}})};var o=e.defaultGuildsRestricted,i=e.defaultMessageRequestRestricted;r.state={defaultGuildsRestricted:o,defaultMessageRequestRestricted:i,currentHarvestRequest:null,requestingHarvest:!0};return r}var i=n.prototype;i.componentDidMount=function(){var e=this;(0,TS.I)();(0,f.ol)().then((function(t){var n={requestingHarvest:!1,currentHarvestRequest:t.body};e.setState(n)}),(function(){e.setState({requestingHarvest:!1})}))};i.componentDidUpdate=function(e){e.defaultGuildsRestricted!==this.props.defaultGuildsRestricted&&this.setState({defaultGuildsRestricted:this.props.defaultGuildsRestricted})};i.showGuildRestrictionModal=function(e){var t=this;BS({
header:x.Z.Messages.USER_DM_SETTINGS_TITLE,body:x.Z.Messages.USER_DM_SETTINGS_DESCRIPTION,confirmText:x.Z.Messages.NO_TEXT,cancelText:x.Z.Messages.YES_TEXT,confirmButtonColor:c.zxk.Colors.BRAND,onConfirm:function(){ni.iG.updateSetting(e);t.trackDefaultDmsUpdated(e,!1)},onCancel:function(){ni.iG.updateSetting(e);ni.h2.updateSetting(e?Object.keys(an.Z.getGuilds()):[]);t.trackDefaultDmsUpdated(e,!0)}})};i.trackDefaultDmsUpdated=function(e,t){Dr.default.track(B.rMx.GUILD_DEFAULT_DMS_UPDATED,{default_guilds_restricted:e,applied_to_existing_guilds:t})};i.showMessageRequestRestrictionModal=function(e){var t=this;BS({header:x.Z.Messages.MESSAGE_REQUESTS_SETTING_GENERAL_MODAL_HEADER,body:x.Z.Messages.MESSAGE_REQUESTS_SETTING_GENERAL_MODAL_DESCRIPTION,confirmText:x.Z.Messages.NO_TEXT,cancelText:x.Z.Messages.YES_TEXT,confirmButtonColor:c.zxk.Colors.BRAND,onConfirm:function(){ni.mX.updateSetting(e);t.trackDefaultMessageRequestUpdated(e,!1)},onCancel:function(){ni.mX.updateSetting(e)
;ni.zA.updateSetting(e?Object.keys(an.Z.getGuilds()):[]);t.trackDefaultMessageRequestUpdated(e,!0)}})};i.trackDefaultMessageRequestUpdated=function(e,t){Dr.default.track(B.rMx.GUILD_DEFAULT_MESSAGE_REQUEST_UPDATED,{default_guilds_restricted:e,applied_to_existing_guilds:t})};i.renderDMSafety=function(){var e=this.props.isComsUpdateEnabled;return(0,r.jsx)(c.hjN,{className:fe().marginBottom40,children:(0,r.jsxs)(c.xJW,{tag:c.RB0.H5,className:fe().marginBottom4,title:x.Z.Messages.USER_EXPLICIT_CONTENT_FILTER,children:[(0,r.jsx)(c.R94,{type:c.geA.DESCRIPTION,className:fe().marginBottom8,children:this.props.isComsUpdateEnabled?x.Z.Messages.USER_EXPLICIT_CONTENT_FILTER_HELP_V2:x.Z.Messages.USER_EXPLICIT_CONTENT_FILTER_HELP}),(0,r.jsx)(c.Eep,{value:this.props.explicitContentFilter,options:(0,PS.w9)(e),onChange:function(e){var t=e.value;return ni.UP.updateSetting(t)}})]})})};i.renderServerPrivacy=function(){
var e=this.props,t=e.viewNsfwGuilds,n=e.currentUser,o=e.isStricterMessageRequests,i=e.viewNsfwCommands,a=this.state,s=a.defaultGuildsRestricted,l=a.defaultMessageRequestRestricted,u=!0===n.nsfwAllowed;return(0,r.jsxs)(c.hjN,{className:fe().marginBottom40,children:[(0,r.jsx)(c.vwX,{tag:c.RB0.H5,className:fe().marginBottom8,children:x.Z.Messages.USER_DM_SETTINGS}),(0,r.jsx)(c.j7V,{value:!s,note:x.Z.Messages.USER_DM_SETTINGS_HELP,onChange:this.handleChangeDefaultGuildsRestricted,children:x.Z.Messages.NEW_GUILDS_DM_ALLOWED}),(0,r.jsx)(c.j7V,{value:!!u&&t,note:x.Z.Messages.NSFW_GUILDS_TOGGLE_CAPTION,disabled:!u,onChange:ni.DC.updateSetting,children:x.Z.Messages.NSFW_GUILDS_TOGGLE_HEADER}),!o&&(0,r.jsx)(c.j7V,{value:!l,note:x.Z.Messages.MESSAGE_REQUESTS_SETTING_GENERAL_CAPTION.format({helpdeskArticle:ta.Z.getArticleURL(B.BhN.MESSAGE_REQUESTS)}),disabled:s,onChange:this.handleChangeDefaultMessageRequestRestricted,children:x.Z.Messages.MESSAGE_REQUESTS_SETTING_GENERAL_HEADER}),(0,
r.jsx)(c.j7V,{value:!!u&&i,note:x.Z.Messages.NSFW_DM_COMMANDS_CAPTION,disabled:!u,onChange:ni.xM.updateSetting,children:x.Z.Messages.NSFW_DM_COMMANDS_HEADER})]})};i.renderDataPrivacy=function(){var e=this.props,t=e.usageStatistics,n=e.personalization,o=e.allowAccessibilityDetection,i=e.dropsOptedOut;return(0,r.jsxs)(c.hjN,{className:fe().marginBottom40,children:[(0,r.jsx)(c.vwX,{tag:c.RB0.H5,className:fe().marginBottom8,children:x.Z.Messages.DATA_PRIVACY_CONTROLS}),(0,r.jsx)(c.j7V,{value:t,note:x.Z.Messages.DATA_PRIVACY_CONTROLS_USAGE_STATISTICS_NOTE.format({helpdeskArticle:ta.Z.getArticleURL(B.BhN.DATA_PRIVACY_CONTROLS)}),onChange:this.handleUsageStatisticsChange,children:x.Z.Messages.DATA_PRIVACY_CONTROLS_USAGE_STATISTICS_TITLE}),(0,r.jsx)(c.j7V,{value:n,note:x.Z.Messages.DATA_PRIVACY_CONTROLS_PERSONALIZATION_NOTE_LEARN_MORE.format({helpdeskArticle:ta.Z.getArticleURL(B.BhN.DATA_PRIVACY_CONTROLS)}),hideBorder:!0,onChange:this.handlePersonalizationChange,
children:x.Z.Messages.DATA_PRIVACY_CONTROLS_PERSONALIZATION_TITLE}),(0,r.jsx)(c.j7V,{value:!i&&n,note:(0,r.jsxs)("div",{className:RS().dependentSetting,children:[x.Z.Messages.USER_DROPS_SETTINGS_DROPS_OPTED_OUT_NOTE,i?(0,r.jsx)("div",{className:v()(fe().marginTop8,RS().feedback),children:x.Z.Messages.DROPS_REQUEST_FEEDBACK_OPT_OUT.format({feedbackURL:"https://survey.alchemer.com/s3/7043738/Discord-Drops-Opt-Out-Survey?user_id=".concat(this.props.currentUser.id)})}):null]}),disabled:!n,onChange:this.handleChangeDropsOptedOut,children:(0,r.jsxs)("div",{className:v()(RS().betaTagContainer,RS().dependentSetting),children:[x.Z.Messages.USER_DROPS_SETTINGS_DROPS_OPTED_OUT,(0,r.jsx)(me.Z,{className:RS().betaTagIcon})]})}),(0,r.jsx)(c.j7V,{value:o,note:x.Z.Messages.DATA_PRIVACY_CONTROLS_ALLOW_ACCESSIBILITY_DETECTION_NOTE.format({helpdeskArticle:ta.Z.getArticleURL(B.BhN.ACCESSIBILITY_TRACKING)}),onChange:this.handleAccessibilityDetectionChange,
children:x.Z.Messages.DATA_PRIVACY_CONTROLS_ALLOW_ACCESSIBILITY_DETECTION_TITLE}),(0,r.jsx)(c.vwX,{tag:c.RB0.H3,className:v()(fe().marginTop20,fe().marginBottom8),children:x.Z.Messages.DATA_PRIVACY_CONTROLS_BASIC_SERVICE_TITLE}),(0,r.jsx)(c.R94,{type:c.geA.DESCRIPTION,className:fe().marginBottom20,children:x.Z.Messages.DATA_PRIVACY_CONTROLS_BASIC_SERVICE_NOTE.format({onClick:function(){d.Z.setSection(B.oAB.ACCOUNT)}})}),this.renderHarvestRequest()]})};i.renderHarvestRequest=function(){var e,t=this,n=this.props.currentUser,i=this.state,a=i.requestingHarvest,s=i.currentHarvestRequest,l=(0,Lm.$6)(s,n),u=(0,r.jsx)(c.ua7,{text:n.verified?null:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_TOOLTIP,children:function(e){var n=e.onMouseEnter,o=e.onMouseLeave;return(0,r.jsx)(c.zxk,{disabled:l,onClick:t.handleDataDownloadRequest,onMouseEnter:n,onMouseLeave:o,look:c.zxk.Looks.OUTLINED,color:c.zxk.Colors.BRAND,submitting:a,children:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_DOWNLOAD})}})
;if(l&&null!=s){e=(0,r.jsx)(c.Zbd,{className:RS().card,children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:x.Z.Messages.DATA_DOWNLOAD_REQUESTED_STATUS_NOTE.format({date:Ge()(s.created_at).add(B.eBq,"days").format("MMMM Do YYYY")})})});u=null}null!=u&&(u=(0,r.jsx)(ae.Z,{children:u}));return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(c.$i$,{className:fe().marginBottom20}),(0,r.jsx)(c.vwX,{tag:c.RB0.H3,children:x.Z.Messages.DATA_PRIVACY_CONTROLS_PERSONAL_DATA_TITLE}),(0,r.jsx)(c.R94,{type:c.geA.DESCRIPTION,className:fe().marginBottom20,children:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_NOTE.format({helpdeskArticle:ta.Z.getArticleURL(B.BhN.GDPR_REQUEST_DATA)})}),e,u]})};i.renderPrivacyAndTermsNote=function(){return(0,r.jsx)(c.hjN,{className:fe().marginBottom40,children:(0,r.jsx)(c.ToO,{type:c.ToO.Types.PRIMARY,body:x.Z.Messages.USER_SETTINGS_PRIVACY_TERMS.format({termsLink:B.EYA.TERMS,privacyLink:B.EYA.PRIVACY})})})};i.renderStaffOnlySettings=function(){
var e=this.props,t=e.currentUser,n=e.nonSpamRetrainingOptIn;return t.isStaff()?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.$i$,{className:fe().marginBottom20}),(0,r.jsxs)(c.hjN,{className:fe().marginBottom40,children:[(0,r.jsx)(c.vwX,{tag:c.RB0.H5,className:fe().marginBottom8,children:x.Z.Messages.PRIVACY_SETTINGS_STAFF_ONLY_HEADER}),(0,r.jsxs)(c.xJW,{tag:c.RB0.H5,className:fe().marginBottom4,children:[(0,r.jsx)(c.R94,{type:c.geA.DESCRIPTION,className:fe().marginBottom8,children:x.Z.Messages.PRIVACY_SETTINGS_STAFF_ONLY_DESC}),(0,r.jsx)(c.Eep,{options:(0,Lm.xH)(),value:null==n?Lm.g0.UNDECIDED:n?Lm.g0.OPTIN:Lm.g0.OPTOUT,onChange:function(e){var t=e.value;return ni.kJ.updateSetting(Lm.ac[t])}})]})]})]}):null};i.render=function(){var e=this.props.fetchedConsents;return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.PRIVACY_AND_SAFETY,children:[this.renderDMSafety(),this.renderServerPrivacy(),e?this.renderDataPrivacy():null,this.renderPrivacyAndTermsNote(),this.renderStaffOnlySettings()]
})};return n}(o.PureComponent);function FS(){var e=(0,NS.n)(),t=(0,y.e7)([Lr.default],(function(){var e=Lr.default.getCurrentUser();L()(null!=e,"ConnectedUserSettingsPrivacySafety: currentUser cannot be undefined");return e})),n=(0,y.cj)([CS.Z],(function(){return{fetchedConsents:CS.Z.fetchedConsents,usageStatistics:CS.Z.hasConsented(B.pjP.USAGE_STATISTICS),personalization:CS.Z.hasConsented(B.pjP.PERSONALIZATION)}}));return(0,r.jsx)(VS,wS({currentUser:t,defaultGuildsRestricted:ni.iG.useSetting(),defaultMessageRequestRestricted:ni.mX.useSetting(),nonSpamRetrainingOptIn:ni.kJ.useSetting(),isStricterMessageRequests:(0,AS.Z)(),isComsUpdateEnabled:e,viewNsfwGuilds:ni.DC.useSetting(),viewNsfwCommands:ni.xM.useSetting(),allowAccessibilityDetection:ni.dQ.useSetting(),explicitContentFilter:ni.UP.useSetting(),showCurrentGame:ni.G6.useSetting(),dropsOptedOut:ni.bh.useSetting()},n))}var YS=n(196810);function zS(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}
s.done?t(c):Promise.resolve(c).then(r,o)}function WS(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){zS(i,r,o,a,s,"next",e)}function s(e){zS(i,r,o,a,s,"throw",e)}a(void 0)}))}}function KS(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function qS(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function XS(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o
}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}var QS=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1]
;break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function $S(e,t){var o=e.title,i=e.actionText;return new Promise((function(e){(0,c.ZDy)(WS((function(){var a,s;return QS(this,(function(c){switch(c.label){case 0:return[4,Promise.resolve().then(n.bind(n,975651))];case 1:a=c.sent(),s=a.default;return[2,function(n){var a=n.onClose,c=XS(n,["onClose"]);return(0,r.jsx)(s,qS(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){KS(e,t,n[t])}))}return e}({},c),{title:o,actionText:i,handleSubmit:function(e){return t(e)},
onClose:function(t){a();e(t)}}))}]}}))})))}))}function JS(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function eT(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){JS(i,r,o,a,s,"next",e)}function s(e){JS(i,r,o,a,s,"throw",e)}a(void 0)}))}}var tT=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop()
;a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function nT(){return(nT=eT((function(){var e,t;return tT(this,(function(n){switch(n.label){case 0:return[4,Hu.Z.get({url:B.ANM.AUTH_SESSIONS})];case 1:(null==(t=n.sent())?void 0:t.ok)&&null!=(null===(e=t.body)||void 0===e?void 0:e.user_sessions)&&l.Z.dispatch({type:"FETCH_AUTH_SESSIONS_SUCCESS",sessions:t.body.user_sessions});return[2,t]}}))}))).apply(this,arguments)}function rT(e){return oT.apply(this,arguments)}function oT(){return(oT=eT((function(e){var t,n,r;return tT(this,(function(o){switch(o.label){case 0:if(Array.isArray(e)){if(0===e.length)return[2]
;t=x.Z.Messages.AUTH_SESSIONS_LOGOUT_MANY_PASSWORD_MODAL_TITLE.format({sessionCount:e.length});n=x.Z.Messages.AUTH_SESSIONS_LOGOUT_MANY_MFA_MODAL_TITLE.format({sessionCount:e.length})}else{t=x.Z.Messages.AUTH_SESSIONS_LOGOUT_PASSWORD_MODAL_TITLE;n=x.Z.Messages.AUTH_SESSIONS_LOGOUT_MFA_MODAL_TITLE;e=[e]}return[4,iT({passwordTitle:t,mfaTitle:n,request:function(t,n){return Hu.Z.post({url:B.ANM.AUTH_SESSIONS_LOGOUT,body:{session_id_hashes:e,password:t,code:n}})}})];case 1:(null==(r=o.sent())?void 0:r.ok)&&l.Z.dispatch({type:"LOGOUT_AUTH_SESSIONS_SUCCESS",sessionIdHashes:e});return[2,r]}}))}))).apply(this,arguments)}function iT(e){var t=e.passwordTitle,n=e.mfaTitle,r=e.request;return $S({title:t,actionText:x.Z.Messages.NEXT},(function(e){return(0,YS.Z)((function(t){var n=t.code;return r(e,n)}),{modalProps:{title:n,actionText:x.Z.Messages.NEXT,disallowBackupCodes:!0}})}))}function aT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}
function sT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cT(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function lT(e){lT=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return lT(e)}function uT(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function fT(e,t){return!t||"object"!==hT(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}
function dT(e,t){dT=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return dT(e,t)}function pT(e){return function(e){if(Array.isArray(e))return aT(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return aT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return aT(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var hT=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function ET(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=lT(e);if(t){var o=lT(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return fT(this,n)}}var yT=[];function mT(){yT=[]}var bT=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&dT(e,t)}(n,e);var t=ET(n);function n(){sT(this,n);return t.apply(this,arguments)}var r=n.prototype;r.getSessions=function(){return yT};r.__getLocalVars=function(){return{sessions:yT}};return n}(y.ZP.Store);bT.displayName="AuthSessionsStore";const gT=new bT(l.Z,{LOGOUT:mT,LOGIN_SUCCESS:mT,FETCH_AUTH_SESSIONS_SUCCESS:function(e){var t=e.sessions;yT=t.map((function(e){return uT(function(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){cT(e,t,n[t])}))}return e}({},e),{approx_last_used_time:new Date(e.approx_last_used_time)})}))},LOGOUT_AUTH_SESSIONS_SUCCESS:function(e){var t=e.sessionIdHashes,n=pT(yT),r=!1,o=!0,i=!1,a=void 0;try{for(var s,c=function(){var e=s.value,t=n.findIndex((function(t){return t.id_hash===e}));if(t>=0){n.splice(t,1);r=!0}},l=t[Symbol.iterator]();!(o=(s=l.next()).done);o=!0)c()}catch(e){i=!0;a=e}finally{try{o||null==l.return||l.return()}finally{if(i)throw a}}if(!r)return!1;yT=n}});function OT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vT(e){return function(e){if(Array.isArray(e))return OT(e)}(e)||function(e){
if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return OT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OT(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var _T=n(3219),IT=n(410068),ST=n(720197),TT=n.n(ST);function NT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function AT(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){
i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return NT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return NT(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function CT(){var e,t=(e=(0,y.cj)([gT],(function(){return gT.getSessions()})),o.useMemo((function(){var t=vT(e),n=null,r=PO.default.getAuthSessionIdHash();if(null!=r){var o=t.findIndex((function(e){return e.id_hash===r}));o>=0&&(n=t.splice(o,1)[0])}t.sort((function(e,t){return t.approx_last_used_time.valueOf()-e.approx_last_used_time.valueOf()}));return{currentSession:n,
otherSessions:t}}),[e])),n=t.currentSession,i=t.otherSessions,s=(0,y.e7)([Rr.Z],(function(){return Rr.Z.hidePersonalInformation})),u=(0,y.e7)([Lr.default],(function(){return Lr.default.getCurrentUser()})),f=AT(o.useState(!1),2),d=f[0],p=f[1];o.useEffect((function(){(0,Hs.EW)(a.z$.AUTH_SESSIONS_NEW,{dismissAction:jc.L.AUTO});!function(){nT.apply(this,arguments)}();var e=setTimeout((function(){return p(!0)}),500);return function(){clearTimeout(e);l.Z.dispatch({type:"FETCH_AUTH_SESSIONS_SUCCESS",sessions:[]})}}),[]);var h,E=function(){Hu.Z.post({url:B.ANM.AUTH_SESSION_NOTIFICATIONS_DEBUG})};if(s)return(0,r.jsx)(Pt.Z,{});h=null==n&&0===i.length?d?(0,r.jsx)("div",{className:TT().loading,children:(0,r.jsx)(c.$jN,{})}):null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:TT().sessions,children:[(0,r.jsx)(c.hjN,{tag:c.RB0.H5,title:x.Z.Messages.AUTH_SESSIONS_CURRENT,titleClassName:TT().groupTitle,children:null!=n?(0,r.jsx)(PT,{session:n,current:!0}):null
}),i.length>0||!(null==u?void 0:u.mfaEnabled)?(0,r.jsxs)(c.hjN,{tag:c.RB0.H5,title:x.Z.Messages.AUTH_SESSIONS_OTHERS,titleClassName:TT().groupTitle,className:TT().otherSessions,children:[i.map((function(e){return(0,r.jsx)(PT,{session:e},e.id_hash)})),(null==u?void 0:u.mfaEnabled)?null:(0,r.jsx)(jT,{})]}):null]}),i.length>0?(0,r.jsxs)(c.hjN,{tag:c.RB0.H5,title:x.Z.Messages.AUTH_SESSIONS_OTHERS_LOG_OUT_TITLE,children:[(0,r.jsx)(c.R94,{type:c.geA.DESCRIPTION,children:x.Z.Messages.AUTH_SESSIONS_OTHERS_LOG_OUT_DESCRIPTION}),(0,r.jsx)(c.zxk,{look:c.zxk.Looks.OUTLINED,color:c.zxk.Colors.RED,size:c.zxk.Sizes.SMALL,className:TT().logOutAllButton,onClick:function(){return rT(i.map((function(e){return e.id_hash})))},children:x.Z.Messages.AUTH_SESSIONS_OTHERS_LOG_OUT_ACTION})]}):null]});return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.AUTH_SESSIONS,children:[(0,r.jsx)(c.R94,{type:c.geA.DESCRIPTION,className:TT().description,children:x.Z.Messages.AUTH_SESSIONS_DESCRIPTION
}),(null==u?void 0:u.isStaff())?(0,r.jsxs)("div",{className:TT().tools,children:[(0,r.jsx)(c.xvT,{className:TT().toolsTitle,variant:"text-md/bold",children:"DEV TOOLS"}),(0,r.jsx)(c.xvT,{className:TT().toolsTitle,variant:"text-sm/normal",color:"text-danger",children:"These tools are only shown to staff users."}),(0,r.jsx)(c.ua7,{text:"Triggers mobile and email suspicious session notifications for the current user",children:function(e){var t=e.onMouseEnter,n=e.onMouseLeave;return(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,color:c.zxk.Colors.PRIMARY,onClick:E,onMouseEnter:t,onMouseLeave:n,children:"Trigger Suspicious Sessions Notification"})}})]}):null,h]})}function PT(e){var t,n,o,i,a,s,l=e.session,u=e.current,f=null!==(a=null===(t=l.client_info)||void 0===t?void 0:t.location)&&void 0!==a?a:null===(n=l.client_info)||void 0===n?void 0:n.ip,d=null===(o=l.client_info)||void 0===o?void 0:o.platform,p=function(e){switch(null==e?void 0:e.toLowerCase().trim()){case null:case void 0:case"":return{
text:x.Z.Messages.AUTH_SESSIONS_OS_UNKNOWN,icon:Vm.Z};case"ios":case"android":return{text:e,icon:IT.Z};default:return{text:e,icon:Vm.Z}}}(null===(i=l.client_info)||void 0===i?void 0:i.os),h=p.text,E=p.icon,y=u?null:(s=l.approx_last_used_time,(Date.now()-s.valueOf())/1e3/60/60<1?x.Z.Messages.AUTH_SESSIONS_ACTIVE_RECENTLY:Ge()(s).fromNow()),m=[h,d].filter(Le.lm),b=[f,y].filter(Le.lm);return(0,r.jsxs)("div",{className:v()(TT().session,u?TT().currentSession:null),children:[(0,r.jsx)("div",{className:TT().sessionIcon,children:(0,r.jsx)(E,{width:"32",height:"32"})}),(0,r.jsxs)("div",{className:TT().sessionInfo,children:[(0,r.jsxs)(c.xvT,{variant:"eyebrow",className:TT().sessionInfoRow,children:[(0,r.jsx)("span",{children:m[0]}),m.length>1&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{children:"·"}),(0,r.jsx)("span",{children:m[1]})]})]}),(0,r.jsxs)(c.xvT,{variant:"text-sm/medium",className:TT().sessionInfoRow,children:[(0,r.jsx)("span",{children:b[0]}),b.length>1&&(0,
r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{children:"·"}),(0,r.jsx)("span",{children:b[1]})]})]})]}),u?null:(0,r.jsx)(c.P3F,{className:TT().sessionMoreButton,onClick:function(){return rT(l.id_hash)},"aria-label":x.Z.Messages.AUTH_SESSIONS_SESSION_LOG_OUT,children:(0,r.jsx)(el.Z,{})})]},l.id_hash)}function jT(){return(0,r.jsxs)("div",{className:v()(TT().session,TT().legacySession),children:[(0,r.jsx)("div",{className:TT().sessionIcon,children:(0,r.jsx)(_T.Z,{width:"32",height:"32"})}),(0,r.jsxs)("div",{className:TT().sessionInfo,children:[(0,r.jsx)(c.xvT,{variant:"eyebrow",className:TT().sessionInfoRow,color:"text-muted",children:(0,r.jsx)("span",{children:x.Z.Messages.AUTH_SESSIONS_UNKNOWN_LEGACY})}),(0,r.jsx)(c.xvT,{variant:"text-sm/medium",className:TT().sessionInfoRow,color:"text-muted",children:(0,r.jsx)("span",{children:x.Z.Messages.AUTH_SESSIONS_UNKNOWN_LEGACY_LOG_OUT.format({onClick:function(){return d.Z.setSection(B.oAB.ACCOUNT)}})})})]})]})}
var RT=n(929370),xT=n(563145),MT=n.n(xT);function wT(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function DT(){var e=(0,y.cj)([Rr.Z],(function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){wT(e,t,n[t])}))}return e}({},Rr.Z.getSettings())})),t=e.enabled,o=e.autoToggle,i=e.hideInstantInvites,a=e.hidePersonalInformation,s=e.disableSounds,l=e.disableNotifications,u=function(e,t){RT.Z.update(wT({},e,t))};return(0,r.jsxs)(c.hjN,{className:MT().container,tag:c.RB0.H1,title:x.Z.Messages.STREAMER_MODE,children:[(0,r.jsx)(c.ToO,{className:fe().marginBottom40,iconClassName:MT().noticeIcon,type:c.Dd5.PRIMARY,imageData:{src:n(566300),width:184,height:110,position:c.SwA.RIGHT
},title:x.Z.Messages.USER_SETTINGS_STREAMER_NOTICE_TITLE,body:x.Z.Messages.USER_SETTINGS_STREAMER_NOTICE_BODY.format({streamkitURL:B.EYA.STREAMKIT})}),(0,r.jsx)(c.j7V,{value:t,onChange:function(e){return u("enabled",e)},note:x.Z.Messages.ENABLE_STREAMER_MODE_DESCRIPTION.format({onClick:function(){d.Z.setSection(B.oAB.KEYBINDS)}}),children:x.Z.Messages.ENABLE_STREAMER_MODE_LABEL}),function(){if(Yc.FB)return(0,r.jsx)(c.j7V,{value:o,onChange:function(e){return u("autoToggle",e)},note:x.Z.Messages.AUTO_TOGGLE_STREAMER_MODE_DESCRIPTION,children:x.Z.Messages.AUTO_TOGGLE_STREAMER_MODE_LABEL})}(),(0,r.jsx)(c.vwX,{className:v()(fe().marginTop40,fe().marginBottom8),children:x.Z.Messages.OPTIONS}),(0,r.jsx)(c.j7V,{value:a,onChange:function(e){return u("hidePersonalInformation",e)},note:x.Z.Messages.HIDE_PERSONAL_INFORMATION_DESCRIPTION,children:x.Z.Messages.HIDE_PERSONAL_INFORMATION_LABEL}),(0,r.jsx)(c.j7V,{value:i,onChange:function(e){return u("hideInstantInvites",e)},
note:x.Z.Messages.HIDE_INSTANT_INVITES_DESCRIPTION,children:x.Z.Messages.HIDE_INSTANT_INVITES_LABEL}),(0,r.jsx)(c.j7V,{value:s,onChange:function(e){return u("disableSounds",e)},note:x.Z.Messages.DISABLE_SOUNDS_DESCRIPTION,children:x.Z.Messages.DISABLE_SOUNDS_LABEL}),(0,r.jsx)(c.j7V,{value:l,onChange:function(e){return u("disableNotifications",e)},note:x.Z.Messages.DISABLE_NOTIFICATIONS_DESCRIPTION,children:x.Z.Messages.DISABLE_NOTIFICATIONS_LABEL})]})}function ZT(){var e=ni.up.useSetting(),t=ni.R$.useSetting(),n=ni.cC.useSetting(),o=ni.vF.useSetting(),i=ni.H1.useSetting(),a=ni.ev.useSetting(),s=ni.x4.useSetting(),l=ni.RS.useSetting(),u=ni.NA.useSetting(),f=ni.nc.useSetting(),d=(0,E.Z)($n.Z.TEXT_AND_IMAGES).analyticsLocations;return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.TEXT_AND_IMAGES,children:[(0,r.jsx)(c.vwX,{className:fe().marginBottom8,children:x.Z.Messages.INLINE_MEDIA_LABEL}),(0,r.jsx)(c.j7V,{className:v()(fe().marginTop8,fe().marginBottom20),value:l,
onChange:ni.RS.updateSetting,children:x.Z.Messages.INLINE_EMBED_MEDIA}),(0,r.jsx)(c.j7V,{className:v()(fe().marginTop8,fe().marginBottom20),value:s,note:x.Z.Messages.INLINE_ATTACHMENT_MEDIA_HELP.format({maxSize:10}),onChange:ni.x4.updateSetting,children:x.Z.Messages.INLINE_ATTACHMENT_MEDIA}),(0,r.jsx)(c.j7V,{className:v()(fe().marginTop8,fe().marginBottom20),value:i,note:x.Z.Messages.IMAGE_DESCRIPTION_HELP,onChange:ni.H1.updateSetting,children:x.Z.Messages.USER_SETTINGS_IMAGE_DESCRIPTIONS}),(0,r.jsx)(c.vwX,{className:fe().marginBottom8,children:x.Z.Messages.RENDER_EMBEDS_LABEL}),(0,r.jsx)(c.j7V,{className:v()(fe().marginTop8,fe().marginBottom40),value:u,onChange:ni.NA.updateSetting,children:x.Z.Messages.RENDER_EMBEDS}),(0,r.jsx)(c.vwX,{className:fe().marginBottom8,children:x.Z.Messages.EMOJI}),(0,r.jsx)(c.j7V,{className:v()(fe().marginTop8,fe().marginBottom20),value:f,onChange:ni.nc.updateSetting,children:x.Z.Messages.RENDER_REACTIONS}),(0,r.jsx)(c.j7V,{className:fe().marginBottom40,
value:a,note:OO.Z.parse(x.Z.Messages.CONVERT_EMOTICONS_HELP),onChange:ni.ev.updateSetting,children:x.Z.Messages.CONVERT_EMOTICONS}),(0,r.jsx)(c.xJW,{className:fe().marginBottom20,title:x.Z.Messages.STICKERS_AUTO_PLAY_HEADING,children:(0,r.jsx)(c.j7V,{className:v()(fe().marginTop20,fe().marginBottom20),value:e,note:x.Z.Messages.AUTO_SUGGEST_STICKERS_DESCRIPTION,onChange:function(t){Dr.default.track(B.rMx.STICKER_SUGGESTIONS_ENABLED_TOGGLED,{enabled:!e,location:{section:B.jXE.SETTINGS_TEXT_AND_IMAGES},location_stack:d});ni.up.updateSetting(!e)},children:x.Z.Messages.AUTO_SUGGEST_STICKERS})}),(0,r.jsxs)(c.hjN,{className:fe().marginBottom8,children:[(0,r.jsx)(c.vwX,{className:fe().marginBottom8,children:x.Z.Messages.FORM_LABEL_USE_RICH_CHAT_BOX}),(0,r.jsx)(c.j7V,{className:fe().marginTop8,value:t,onChange:function(e){Dr.default.track(B.rMx.PREVIEW_MARKDOWN_TOGGLED,{enabled:e,location:{section:B.jXE.SETTINGS_TEXT_AND_IMAGES}});ni.R$.updateSetting(e)},
children:x.Z.Messages.PREVIEW_MARKDOWN_DESCRIPTION})]}),(0,r.jsxs)(c.hjN,{className:fe().marginBottom40,children:[(0,r.jsx)(c.vwX,{className:fe().marginBottom8,children:x.Z.Messages.THREADS}),(0,r.jsx)(c.j7V,{className:fe().marginTop8,value:o,onChange:ni.vF.updateSetting,children:x.Z.Messages.USE_THREADS_SIDEBAR_DESCRIPTION})]}),(0,r.jsxs)(c.xJW,{title:x.Z.Messages.SHOW_SPOILER_CONTENT,children:[(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:fe().marginBottom8,children:x.Z.Messages.SHOW_SPOILER_CONTENT_HELP}),(0,r.jsx)(c.Eep,{options:[{name:x.Z.Messages.SHOW_SPOILER_ON_CLICK,value:B.A2N.ON_CLICK},{name:x.Z.Messages.SHOW_SPOILER_ON_SERVERS_I_MOD,value:B.A2N.IF_MODERATOR},{name:x.Z.Messages.SHOW_SPOILER_ALWAYS,value:B.A2N.ALWAYS}],onChange:function(e){return ni.cC.updateSetting(e.value)},value:n})]})]})}var LT=n(72831),UT=n(585730),kT=n(608682),GT=n.n(kT);function BT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}
function HT(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function VT(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return BT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return BT(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}
var FT=[{label:"Latin alphabet",value:"aBcDeFgHiJkLmNoPqRsTuVwXyZ"},{label:"Latin pangram",value:"The quick brown fox jumps over the lazy dog"},{label:"Greek alphabet",value:"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΆΈΉΊΌΎΏ"},{label:"Greek pangram",value:"ΤΑΧΊΣΤΗ ΑΛΏΠΗΞ ΒΑΦΉΣ ΨΗΜΈΝΗ ΓΗ, ΔΡΑΣΚΕΛΊΖΕΙ ΥΠΈΡ ΝΩΘΡΟΎ ΚΥΝΌΣ"},{label:"Cyrillic alphabet",value:"АБВГЃҐДЕЀЁЖЗИЙЍКЌЛМНОПРСТУЎФХЧЦШЩЏЬЪЫЉЊЅЄЭІЇЈЋЮЯЂѢѲѴ"},{label:"Cyrillic pangram",value:"В ЧАЩАХ ЮГА ЖИЛ БЫ ЦИТРУС? ДА, НО ФАЛЬШИВЫЙ ЭКЗЕМПЛЯР!"},{label:"Custom",value:"custom"}];function YT(e,t){var n=VT(o.useState((function(){var n=re.Z.get(e);return null!=n?n:t})),2),r=n[0],i=n[1];o.useEffect((function(){re.Z.set(e,r)}),[e,r]);return[r,i]}function zT(){var e=VT(o.useState(Math.round(window.outerWidth/window.innerWidth*100)),2),t=e[0],n=e[1],i=(0,y.cj)([xu.Z,Te.Z],(function(){return{theme:xu.Z.theme,platformZoom:Te.Z.zoom}
})),a=i.platformZoom,s=i.theme,l=["normal","medium","semibold","bold","extrabold"],u=new Map([["normal",400],["medium",500],["semibold",600],["bold",700],["extrabold",800]]);o.useEffect((function(){Yc.FB||window.addEventListener("resize",(function(){n(Math.round(window.outerWidth/window.innerWidth*100))}))}),[]);var f=Yc.FB?a:t,d=(0,y.e7)([UT.C],(function(){var e,t;return(0,Hy.fD)()?null===(e=UT.C.getCurrentBuildOverride())||void 0===e||null===(t=e.overrides)||void 0===t?void 0:t.discord_web:null})),p=VT(YT("playground-overrideText",null),2),h=p[0],E=p[1],m=VT(YT("playground-defaultText",FT[0].value),2),b=m[0],g=m[1],O=o.useCallback((function(e){var t=FT.find((function(t){return t.value===e}));if(""===e||null==e){g(FT[0].value);E(null)}else if(null!=t)g(t.value);else{g("custom");E(e)}}),[E,g]);return(0,r.jsx)("div",{className:GT().fullscreen,children:(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,children:[(0,r.jsxs)("div",{className:GT().toolbar,children:[(0,r.jsxs)("div",{children:[(0,
r.jsxs)(c.xvT,{tag:"div",variant:"heading-lg/bold",style:{display:"inline-block"},children:["Zoom: ",f,"%"]}),null!=d?(0,r.jsxs)(c.xvT,{tag:"div",variant:"heading-lg/bold",style:{display:"inline-block",marginLeft:"1em"},color:"header-secondary",children:["(",d.id,")"]}):null]}),(0,r.jsx)(c.xJW,{children:(0,r.jsx)(c.q4e,{className:GT().select,options:FT,onChange:function(e){return O(e)},value:b})}),(0,r.jsx)(c.xJW,{children:(0,r.jsx)("div",{className:GT().input,children:(0,r.jsx)(c.oil,{placeholder:"Enter custom input...",value:null!=h?h:"",onChange:O})})}),(0,r.jsx)(c.xJW,{children:(0,r.jsx)(c.Eep,{withTransparentBackground:!0,className:GT().theme,orientation:"horizontal",options:[{name:x.Z.Messages.THEME_DARK,value:B.BRd.DARK},{name:x.Z.Messages.THEME_LIGHT,value:B.BRd.LIGHT}],onChange:function(e){(0,sp.ZI)({theme:e.value})},value:s})}),(0,r.jsx)(LT.Z,{closeAction:Se.xf,keybind:"ESC"})]}),(0,r.jsxs)("div",{className:GT().textGrid,children:[(0,r.jsx)("div",{}),l.map((function(e){
return(0,r.jsx)("div",{className:GT().columnHeading,children:(0,r.jsx)(c.X6q,{variant:"eyebrow",children:e})},e)})),[10,12,14,15,16,18,20,24].map((function(e){return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsxs)("div",{className:GT().fontSize,children:[(0,r.jsxs)(c.X6q,{variant:"eyebrow",children:[e,"px"]}),100!==f?(0,r.jsxs)(c.X6q,{variant:"eyebrow",color:"text-muted",children:["(",e*f/100,")"]}):null]},e),l.map((function(t){var n,o=null!==(n="custom"===b?h:b)&&void 0!==n?n:"";return(0,r.jsx)("div",{children:(0,r.jsxs)("div",{title:"".concat(e,"px at ").concat(t),className:v()(GT().text,HT({},GT().breakAnywhere,!o.includes(" "))),style:{fontSize:e,fontWeight:u.get(t)},children:[(0,r.jsx)("p",{children:o}),(0,r.jsx)("p",{style:{textTransform:"lowercase"},children:o}),(0,r.jsx)("p",{style:{textTransform:"uppercase"},children:o})]})},"".concat(e,"-").concat(t))}))]},e)}))]})]})})}function WT(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}
s.done?t(c):Promise.resolve(c).then(r,o)}function KT(e){KT=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return KT(e)}function qT(e,t){return!t||"object"!==QT(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function XT(e,t){XT=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return XT(e,t)}var QT=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function $T(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=KT(e);if(t){var o=KT(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return qT(this,n)}}
var JT=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}
if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},eN=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&XT(e,t)}(n,e);var t=$T(n);function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var r;(r=t.call(this,e)).handleToggleOpenOnStartup=function(){var e=!r.state.openOnStartup;r.setState({openOnStartup:e});qf.default.send("TOGGLE_OPEN_ON_STARTUP",e)};r.handleToggleStartMinimized=function(){var e=!r.state.startMinimized;r.setState({startMinimized:e});qf.default.send("TOGGLE_START_MINIMIZED",e)};r.handleToggleMinimizeToTray=function(){var e=!r.state.minimizeToTray;r.setState({minimizeToTray:e});qf.default.send("TOGGLE_MINIMIZE_TO_TRAY",e)};r.state={openOnStartup:!0,startMinimized:!1,minimizeToTray:!0};return r}var o=n.prototype
;o.componentDidMount=function(){var e,t=this;return(e=function(){var e,n;return JT(this,(function(r){switch(r.label){case 0:e=t.setState;n={};return[4,qf.default.getSetting("OPEN_ON_STARTUP",!0)];case 1:n.openOnStartup=r.sent();return[4,qf.default.getSetting("START_MINIMIZED",!1)];case 2:n.startMinimized=r.sent();return[4,qf.default.getSetting("MINIMIZE_TO_TRAY",!0)];case 3:e.apply(t,[(n.minimizeToTray=r.sent(),n)]);return[2]}}))},function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){WT(i,r,o,a,s,"next",e)}function s(e){WT(i,r,o,a,s,"throw",e)}a(void 0)}))})()};o.render=function(){var e=this.state,t=e.openOnStartup,n=e.startMinimized,o=e.minimizeToTray,i=(0,Yc.IJ)()?x.Z.Messages.USER_SETTINGS_LINUX_SETTINGS:x.Z.Messages.USER_SETTINGS_WINDOWS_SETTINGS;return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:i,children:[(0,r.jsx)(c.vwX,{children:x.Z.Messages.USER_SETTINGS_STARTUP_BEHAVIOR}),(0,r.jsx)(c.j7V,{className:fe().marginBottom20,value:t,
note:x.Z.Messages.USER_SETTINGS_OPEN_ON_STARTUP_BODY,onChange:this.handleToggleOpenOnStartup,children:x.Z.Messages.USER_SETTINGS_OPEN_ON_STARTUP_LABEL}),(0,Yc.ED)()?(0,r.jsx)(c.j7V,{disabled:!t,className:v()(fe().marginTop8,fe().marginBottom20),value:!!t&&n,note:x.Z.Messages.USER_SETTINGS_START_MINIMIZED_BODY,onChange:this.handleToggleStartMinimized,children:x.Z.Messages.USER_SETTINGS_START_MINIMIZED_LABEL}):null,(0,r.jsx)(c.vwX,{className:v()(fe().marginTop20,fe().marginBottom8),children:x.Z.Messages.USER_SETTINGS_CLOSE_BUTTON}),(0,r.jsx)(c.j7V,{className:fe().marginBottom20,value:o,note:x.Z.Messages.USER_SETTINGS_MINIMIZE_TO_TRAY_BODY,onChange:this.handleToggleMinimizeToTray,children:x.Z.Messages.USER_SETTINGS_MINIMIZE_TO_TRAY_LABEL})]})};return n}(o.PureComponent);const tN=eN;var nN=n(113609),rN=n(821229),oN=n(555445),iN=n(385564),aN=n.n(iN);function sN(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cN(e,t){return function(e){
if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return sN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sN(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var lN=/^(\d{4}-\d{1,2})/;function uN(e){var t=lN.exec(e);return null!=t?t[1]:null}function fN(e,t){if(Array.isArray(e)){var n=!0,r=!1,o=void 0;try{
for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){if(fN(i.value,t))return!0}}catch(e){r=!0;o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}}else if("object"==typeof e&&null!==e){var s=!0,c=!1,l=void 0;try{for(var u,f=Object.values(e)[Symbol.iterator]();!(s=(u=f.next()).done);s=!0){if(fN(u.value,t))return!0}}catch(e){c=!0;l=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw l}}}else if("string"==typeof e&&e.toLowerCase().includes(t.toLowerCase()))return!0;return!1}var dN=n(978319),pN=n.n(dN);function hN(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function EN(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()
}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return hN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hN(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yN(e){var t,n,i=EN(o.useState(null!=e.descriptor),2),a=i[0],s=i[1],l=o.useCallback((function(){s((function(e){return!e}))}),[]),u=(t=e.experiment.description,Array.isArray(t)?t:[t]),f=uN(e.experimentId);return(0,r.jsxs)("div",{className:pN().group,children:[(0,r.jsxs)(c.hjN,{children:[(0,r.jsx)(c.P3F,{onClick:l,children:(0,r.jsxs)(c.vwX,{tag:c.RB0.H3,className:pN().title,children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{children:e.experiment.title}),(0,
r.jsx)(c.xvT,{color:"text-muted",variant:"text-sm/normal",children:e.experimentId})]}),(0,r.jsx)("span",{className:pN().experimentDate,children:f})]})}),a?(0,r.jsxs)("div",{children:[(0,r.jsx)(c.xJW,{title:"Bucket Override",children:(0,r.jsx)(c.q4e,{value:null!=e.descriptor?e.descriptor.bucket:null,clearable:null!=e.descriptor,options:(n=e.experiment.buckets,n.map((function(e){return{label:oN.Z.getExperimentBucketName(e),value:e}}))),onChange:function(t){(0,nN.rX)(e.experimentId,t)}})}),(0,r.jsx)("div",{className:pN().description,children:u.map((function(e,t){return(0,r.jsxs)(c.R94,{type:c.geA.DESCRIPTION,children:[e," "]},t)}))})]}):null]}),(0,r.jsx)(c.$i$,{className:pN().divider})]})}function mN(){var e=(0,y.cj)([rN.Z],(function(){return rN.Z.getExperimentOverrides()})),t=(0,y.cj)([rN.Z],(function(){return rN.Z.getRegisteredExperiments()})),n=EN(o.useState(""),2),i=n[0],a=n[1],s=function(e,t){var n=t.split(/\s+/g).filter((function(e){return""!==e}));if(0===n.length)return e
;var r=[],o=!0,i=!1,a=void 0;try{for(var s,c=e[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){var l=s.value,u=0,f=!0,d=!1,p=void 0;try{for(var h,E=n[Symbol.iterator]();!(f=(h=E.next()).done);f=!0)fN(l,h.value)&&(u+=1)}catch(e){d=!0;p=e}finally{try{f||null==E.return||E.return()}finally{if(d)throw p}}if(0!==u){null==r[u]&&(r[u]=[]);r[u].push(l)}}}catch(e){i=!0;a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}return aN()(r.filter((function(e){return void 0!==e})).reverse())}(function(e){return e.slice().sort((function(e,t){var n=uN(e.id),r=uN(t.id);if(null!=n&&null!=r){var o=r.localeCompare(n);if(0!==o)return o}return e.experiment.title.localeCompare(t.experiment.title)}))}(function(e){return Array.from(Object.entries(e)).map((function(e){var t=cN(e,2);return{id:t[0],experiment:t[1]}}))}(t)),i);return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:"Experiments",children:[(0,r.jsx)(se.Z,{size:se.Z.Sizes.LARGE,query:i,onChange:a,onClear:function(){return a("")}
}),s.length>0?s.map((function(t){return(0,r.jsx)(yN,{experiment:t.experiment,experimentId:t.id,descriptor:e[t.id]},t.id)})):(0,r.jsx)("div",{className:pN().emptyState,children:(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:"No Experiments Found"})})]})}var bN=n(656645),gN=n(36256),ON=n(396448),vN=n(680664);function _N(){var e=(0,y.cj)([Bc.Z],(function(){return{experimentalEncoders:Bc.Z.getExperimentalEncoders()}})).experimentalEncoders;return"stable"!==qf.default.releaseChannel&&Bc.Z.isExperimentalEncodersSupported()?(0,r.jsx)(c.j7V,{className:v()(fe().marginTop8,fe().marginBottom20),value:e,onChange:function(e){return bN.Z.setExperimentalEncoders(e)},disabled:!1,children:x.Z.Messages.EXPERIMENTAL_ENCODERS}):null}function IN(){var e=(0,y.e7)([xu.Z],(function(){return xu.Z.theme})),t=(0,y.cj)([Bc.Z],(function(){return{openH264:Bc.Z.getOpenH264(),hardwareH264:Bc.Z.getHardwareH264(),supportsOpenH264:Bc.Z.supports(gN.AN.OPEN_H264),av1Enabled:Bc.Z.getAv1Enabled()}
})),n=t.openH264,o=t.hardwareH264,i=t.supportsOpenH264,a=t.av1Enabled;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.hjN,{className:fe().marginBottom20,title:x.Z.Messages.USER_SETTINGS_VOICE_CODEC_TITLE,children:(0,r.jsx)(c.ToO,{className:fe().marginBottom20,type:c.Dd5.PRIMARY,imageData:{src:e===B.BRd.LIGHT?ON:vN,width:70,height:40},align:ae.Z.Align.CENTER,body:x.Z.Messages.USER_SETTINGS_VOICE_CODEC_DESCRIPTION})}),i&&(0,r.jsxs)(c.hjN,{className:fe().marginBottom20,title:x.Z.Messages.USER_SETTINGS_VOICE_VIDEO_CODEC_TITLE,children:[(0,r.jsx)(c.j7V,{className:v()(fe().marginTop8,fe().marginBottom20),value:n,onChange:function(e){bN.Z.setOpenH264(e);bN.Z.setHardwareH264(e)},disabled:!1,note:x.Z.Messages.FORM_HELP_OPEN_H264,children:x.Z.Messages.USER_SETTINGS_VOICE_OPEN_H264}),(0,r.jsx)(c.j7V,{className:v()(fe().marginTop8,fe().marginBottom20),value:o,onChange:function(e){bN.Z.setHardwareH264(e);bN.Z.setAV1Enabled(e&&a)},disabled:!n,note:x.Z.Messages.FORM_HELP_HARDWARE_H264,
children:x.Z.Messages.USER_SETTINGS_VOICE_HARDWARE_H264}),(0,r.jsx)(c.j7V,{className:v()(fe().marginTop8,fe().marginBottom20),value:a&&o,onChange:function(e){return function(e){bN.Z.setAV1Enabled(e);Dr.default.track(B.rMx.VOICE_SETTINGS_CHANGED,{av1_disabled:!e,av1_enabled:e})}(e&&o)},note:x.Z.Messages.FORM_HELP_HARDWARE_AV1,disabled:!o,children:x.Z.Messages.USER_SETTINGS_VOICE_AV1}),(0,r.jsx)(_N,{})]})]})}var SN=n(797364),TN=n(816251),NN=n(727785),AN=n(247162);function CN(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function PN(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function jN(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){PN(i,r,o,a,s,"next",e)}function s(e){PN(i,r,o,a,s,"throw",e)}a(void 0)}))}}function RN(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n
;return e}function xN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){RN(e,t,n[t])}))}return e}function MN(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function wN(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1
;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return CN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return CN(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var DN=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){
if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function ZN(){return LN.apply(this,arguments)}function LN(){return(LN=jN((function(){var e,t;return DN(this,(function(n){switch(n.label){case 0:return[4,q.Z.fileManager.getModulePath()];case 1:e=n.sent()
;t=q.Z.fileManager.join(e,"discord_voice");q.Z.fileManager.showItemInFolder(t);return[2]}}))}))).apply(this,arguments)}function UN(e){var t=null!=e,n=t?x.Z.Messages.UPLOAD_DEBUG_LOG_FAILURE_HEADER:x.Z.Messages.UPLOAD_DEBUG_LOG_SUCCESS_HEADER,o=t?e:x.Z.Messages.UPLOAD_DEBUG_LOG_SUCCESS;(0,c.h7j)((function(e){return(0,r.jsx)(c.sm4,MN(xN({header:n,confirmButtonColor:c.zxk.Colors.BRAND,confirmText:x.Z.Messages.OKAY},e),{children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:o})}))}))}function kN(e){(0,c.h7j)((function(t){return(0,r.jsx)(c.sm4,MN(xN({header:x.Z.Messages.SET_DEBUG_LOGGING,confirmText:x.Z.Messages.OKAY,cancelText:x.Z.Messages.CANCEL,onCancel:t.onClose,onConfirm:function(){return bN.Z.setDebugLogging(e)}},t),{children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:x.Z.Messages.SET_DEBUG_LOGGING_BODY})}))}))}function GN(){var e,t=wN(o.useState(!1),2),n=t[0],i=t[1],a=(0,y.cj)([Bc.Z],(function(){return{aecDumpSupported:Bc.Z.isAecDumpSupported(),
debugLogging:Bc.Z.getDebugLogging(),aecDumpEnabled:Bc.Z.getAecDump(),supportsConnectionReplay:Bc.Z.supports(gN.AN.CONNECTION_REPLAY)}})),s=a.aecDumpSupported,l=a.debugLogging,u=a.aecDumpEnabled,f=a.supportsConnectionReplay,d=(0,y.e7)([NN.ZP],(function(){return NN.ZP.shouldRecordNextConnection()})),p=(0,y.e7)([Lr.default],(function(){var t;return null!==(e=null===(t=Lr.default.getCurrentUser())||void 0===t?void 0:t.isStaff())&&void 0!==e&&e})),h=("canary"===qf.default.releaseChannel||"development"===qf.default.releaseChannel)&&p&&f;function E(){return(E=jN((function(){return DN(this,(function(e){switch(e.label){case 0:i(!0);e.label=1;case 1:e.trys.push([1,5,,6]);return[4,Bc.Z.getMediaEngine().writeAudioDebugState()];case 2:e.sent();return[4,AN.Z.submitLiveCrashReport({message:{message:"User Live Dump"}})];case 3:e.sent();return[4,(0,TN.E_)(B.GU0.RTC)];case 4:e.sent();UN();return[3,6];case 5:UN(e.sent().displayMessage);return[3,6];case 6:return[2]}}))}))).apply(this,arguments)}return(0,
r.jsxs)(c.hjN,{className:fe().marginBottom40,title:x.Z.Messages.FORM_LABEL_DEBUG,children:[s&&(0,r.jsx)(c.j7V,{value:u,onChange:function(e){return bN.Z.setAecDump(e)},note:x.Z.Messages.FORM_HELP_AEC_DUMP,children:x.Z.Messages.FORM_CHECKBOX_AEC_DUMP}),h&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.j7V,{hideBorder:!0,value:d,onChange:function(e){return SN.TC(e)},note:x.Z.Messages.FORM_HELP_CONNECTION_LOG,children:x.Z.Messages.FORM_CHECKBOX_CONNECTION_LOG}),(0,r.jsx)(c.xJW,{children:(0,r.jsx)(ae.Z,{className:fe().marginBottom20,children:(0,r.jsx)(ae.Z.Child,{grow:0,shrink:0,children:(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,onClick:function(){return SN.z4()},children:x.Z.Messages.OPEN_CONNECTION_REPLAY})})})})]}),(0,r.jsx)(c.j7V,{hideBorder:!0,value:l,onChange:kN,note:x.Z.Messages.FORM_HELP_DEBUG_LOGGING,children:x.Z.Messages.FORM_CHECKBOX_DEBUG_LOGGING}),(0,r.jsx)(c.xJW,{children:(0,r.jsxs)(ae.Z,{children:[(0,r.jsx)(ae.Z.Child,{grow:0,shrink:0,children:(0,r.jsx)(c.zxk,{disabled:n,
size:c.zxk.Sizes.SMALL,onClick:function(){return E.apply(this,arguments)},children:x.Z.Messages.UPLOAD})}),(0,r.jsx)(ae.Z.Child,{grow:0,shrink:0,children:(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,onClick:ZN,children:x.Z.Messages.SHOW_FOLDER})})]})})]})}var BN=n(912735);function HN(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function VN(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){HN(i,r,o,a,s,"next",e)}function s(e){HN(i,r,o,a,s,"throw",e)}a(void 0)}))}}function FN(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var YN=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){
if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function zN(e){(0,c.ZDy)(VN((function(){var t,o;return YN(this,(function(i){switch(i.label){case 0:return[4,Promise.resolve().then(n.bind(n,908056))];case 1:t=i.sent(),o=t.default;return[2,function(t){return(0,
r.jsx)(o,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){FN(e,t,n[t])}))}return e}({source:e},t))}]}}))})))}var WN=n(913223),KN=n.n(WN);function qN(){var e,t,o=function(e){var t,o=e.label,i=e.value;if(BN.Z.isCertified(i)){var s=a===B.BRd.LIGHT?n(956863):n(874638);t=(0,r.jsx)("img",{src:s,alt:"Certified",className:KN().deviceOptionCertified})}return(0,r.jsxs)("span",{className:KN().deviceOption,children:[(0,r.jsx)("span",{className:KN().deviceOptionLabel,children:BN.Z.getCertifiedDeviceName(i,o)}),t]},i)},i=function(e){return o(e[0])},a=(0,y.e7)([xu.Z],(function(){return xu.Z.theme})),s=(0,y.cj)([Bc.Z],(function(){return{canSetInputDevice:Bc.Z.supports(gN.AN.AUDIO_INPUT_DEVICE),canSetOutputDevice:Bc.Z.supports(gN.AN.AUDIO_OUTPUT_DEVICE),
inputDeviceId:Bc.Z.getInputDeviceId(),outputDeviceId:Bc.Z.getOutputDeviceId()}})),l=s.canSetInputDevice,u=s.canSetOutputDevice,f=s.inputDeviceId,d=s.outputDeviceId,p=(0,y.e7)([Bc.Z],(function(){return Bc.Z.getInputDevices()})),h=(0,y.e7)([Bc.Z],(function(){return Bc.Z.getOutputDevices()}));l||(e=(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:fe().marginTop8,children:x.Z.Messages.BROWSER_INPUT_DEVICE_WARNING.format({onDownloadClick:function(){return zN("Help Text Input Devices")}})}));u||(t=(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:fe().marginTop8,children:x.Z.Messages.BROWSER_OUTPUT_DEVICE_WARNING.format({onDownloadClick:function(){return zN("Help Text Output Devices")}})}));var E=_e()(p).values().first(),m=null!=E?E.disabled:null!=e,b=_e()(h).values().first(),g=null!=b?b.disabled:null!=t;return(0,r.jsxs)(ae.Z,{className:fe().marginBottom20,children:[(0,r.jsxs)(ae.Z.Child,{basis:"50%",children:[(0,r.jsx)(c.vwX,{tag:c.RB0.H5,className:fe().marginBottom8,
children:x.Z.Messages.FORM_LABEL_INPUT_DEVICE}),(0,r.jsx)(c.q4e,{value:f,onChange:function(e){return bN.Z.setInputDevice(e,"Settings")},options:_e().map(p,(function(e){return{value:e.id,label:e.name}})),isDisabled:m,renderOptionValue:i,renderOptionLabel:o}),e]}),(0,r.jsxs)(ae.Z.Child,{basis:"50%",children:[(0,r.jsx)(c.vwX,{tag:c.RB0.H5,className:fe().marginBottom8,children:x.Z.Messages.FORM_LABEL_OUTPUT_DEVICE}),(0,r.jsx)(c.q4e,{value:d,onChange:function(e){return bN.Z.setOutputDevice(e,"Settings")},options:_e().map(h,(function(e){return{value:e.id,label:e.name}})),isDisabled:g,renderOptionValue:i,renderOptionLabel:o}),t]})]})}var XN=n(741769),QN=n.n(XN);function $N(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function JN(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){$N(i,r,o,a,s,"next",e)}function s(e){$N(i,r,o,a,s,"throw",e)}a(void 0)}))}}function eA(e,t,n){
t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var tA=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2]
;a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},nA=!Yc.FB,rA=(0,Jt.hQ)();function oA(e){var t=e.value;t===B.pM4.PUSH_TO_TALK&&nA&&(0,c.ZDy)(JN((function(){var e,t;return tA(this,(function(o){switch(o.label){case 0:return[4,Promise.resolve().then(n.bind(n,895303))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){eA(e,t,n[t])}))}return e}({title:x.Z.Messages.PTT_LIMITED_TITLE,confirmText:x.Z.Messages.DOWNLOAD,cancelText:x.Z.Messages.OKAY,onConfirm:function(){return zN("PTT Limited Modal")},body:x.Z.Messages.PTT_LIMITED_BODY},e))}]}}))})))
;bN.Z.setMode(t)}function iA(e){return e>=1e3?"".concat((e/=1e3).toFixed(2),"s"):"".concat(e.toFixed(0)," ms")}function aA(e){var t,n=e.inputMode,o=(0,y.cj)([Bc.Z],(function(){return Bc.Z.getModeOptions()})),i=o.shortcut,a=o.delay;t=Yc.FB||n!==B.pM4.PUSH_TO_TALK?(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:v()(QN().pttToolsMessage,fe().marginBottom8),children:x.Z.Messages.USER_SETTINGS_VOICE_ADD_MULTIPLE.format({onClick:function(){return d.Z.setSection(B.oAB.KEYBINDS)}})}):(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:v()(QN().pttToolsMessage,QN().pttToolsWarning,fe().marginBottom8),children:x.Z.Messages.PTT_LIMITED_WARNING.format({onDownloadClick:function(){return zN("Help Text PTT")}})});return(0,r.jsxs)("div",{className:QN().pttTools,children:[(0,r.jsxs)(ae.Z,{children:[(0,r.jsx)(ae.Z.Child,{basis:"50%",children:(0,r.jsx)(c.xJW,{title:x.Z.Messages.FORM_LABEL_SHORTCUT,children:(0,r.jsx)(k.Z,{defaultValue:i,onChange:function(e){return bN.Z.setMode(n,{shortcut:e})}
})})}),(0,r.jsx)(ae.Z.Child,{basis:"50%",children:(0,r.jsxs)(c.xJW,{children:[(0,r.jsx)(c.vwX,{id:rA,tag:c.RB0.H5,className:fe().marginBottom8,children:x.Z.Messages.INPUT_MODE_PTT_RELEASE_DELAY}),(0,r.jsx)(c.iRW,{initialValue:a,onValueChange:function(e){return bN.Z.setMode(n,{delay:e})},onValueRender:iA,maxValue:B.qhL,"aria-labelledby":rA})]})})]}),t]})}function sA(){var e=(0,y.e7)([Bc.Z],(function(){return Bc.Z.getMode()})),t=[{value:B.pM4.VOICE_ACTIVITY,name:x.Z.Messages.INPUT_MODE_VAD},{value:B.pM4.PUSH_TO_TALK,name:nA?x.Z.Messages.INPUT_MODE_PTT_LIMITED:x.Z.Messages.INPUT_MODE_PTT}];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xJW,{title:x.Z.Messages.FORM_LABEL_INPUT_MODE,className:fe().marginBottom20,children:(0,r.jsx)(c.Eep,{onChange:oA,options:t,value:e})}),e===B.pM4.PUSH_TO_TALK&&(0,r.jsx)(aA,{inputMode:e})]})}var cA=n(318715),lA=n(946767),uA=n(959132),fA=n.n(uA);function dA(){return(0,cA.ZP)([Bc.Z],(function(){return Bc.Z.supports(gN.AN.LOOPBACK)}))?(0,r.jsx)("div",{
className:fA().micTest,children:(0,r.jsx)(lA.Z,{title:x.Z.Messages.USER_SETTINGS_VOICE_MIC_TEST_TITLE,description:x.Z.Messages.USER_SETTINGS_VOICE_MIC_TEST_DESCRIPTION,notchBackground:lA._.GRAY,captionVoice:x.Z.Messages.USER_SETTINGS_VOICE_MIC_TEST_VOICE_CAPTION,captionNoVoice:(0,r.jsxs)(r.Fragment,{children:[x.Z.Messages.USER_SETTINGS_VOICE_MIC_TEST_VOICE_NO_INPUT_NOTICE,(0,r.jsx)(c.eee,{className:fA().micTestHelpLink,href:ta.Z.getArticleURL(B.BhN.NO_INPUT_DETECTED),children:x.Z.Messages.NOTICE_NO_INPUT_DETECTED_HELP_LINK_TEXT})]}),buttonTest:x.Z.Messages.USER_SETTINGS_VOICE_MIC_TEST_BUTTON_INACTIVE,buttonStop:x.Z.Messages.USER_SETTINGS_VOICE_MIC_TEST_BUTTON_ACTIVE,buttonClassName:fA().micTestButton,buttonColor:c.zxk.Colors.BRAND,location:{page:B.ZY5.USER_SETTINGS,section:B.jXE.SETTINGS_VOICE_AND_VIDEO}})}):null}function pA(e){switch(e){case B.rtk.ENABLING:return x.Z.Messages.USER_SETTINGS_VOICE_SOUNDSHARE_ENABLING_LABEL;case B.rtk.ENABLED:
return x.Z.Messages.USER_SETTINGS_VOICE_SOUNDSHARE_ENABLED_LABEL;case B.rtk.FAILED_TO_ENABLE:return x.Z.Messages.USER_SETTINGS_VOICE_SOUNDSHARE_FAILED_TO_ENABLE_LABEL}return x.Z.Messages.USER_SETTINGS_VOICE_SOUNDSHARE_NOT_ENABLED_LABEL}function hA(){var e=(0,y.cj)([Bc.Z],(function(){return{videoHook:Bc.Z.getVideoHook(),experimentalSoundshare:Bc.Z.getExperimentalSoundshare(),soundshareEnabled:Bc.Z.getSoundshareEnabled(),supportsVideoHook:Bc.Z.supports(gN.AN.VIDEO_HOOK),supportsExperimentalSoundshare:Bc.Z.supportsExperimentalSoundshare(),supportsEnableSoundshare:Bc.Z.supportsEnableSoundshare()}})),t=e.videoHook,n=e.experimentalSoundshare,o=e.soundshareEnabled,i=e.supportsVideoHook,a=e.supportsExperimentalSoundshare,s=e.supportsEnableSoundshare;return i||a||s?(0,r.jsxs)(c.hjN,{className:fe().marginBottom20,title:x.Z.Messages.FORM_LABEL_SCREENSHARE,children:[i&&(0,r.jsx)(c.j7V,{value:t,onChange:function(e){return bN.Z.setVideoHook(e)},note:x.Z.Messages.FORM_HELP_VIDEO_HOOK,
children:x.Z.Messages.USER_SETTINGS_VOICE_VIDEO_HOOK_LABEL}),a&&(0,r.jsx)(c.j7V,{value:n,onChange:function(e){return bN.Z.setExperimentalSoundshare(e)},children:x.Z.Messages.USER_SETTINGS_VOICE_EXPERIMENTAL_SOUNDSHARE_LABEL}),s&&(0,r.jsxs)(c.xJW,{children:[(0,r.jsx)(c.R94,{className:fe().marginBottom20,children:pA(o).format({helpdeskArticle:ta.Z.getArticleURL(B.BhN.OSX_SOUNDSHARE)})}),(0,r.jsx)(ae.Z,{children:(0,r.jsx)(ae.Z.Child,{grow:0,shrink:0,children:(0,r.jsx)(c.zxk,{className:fe().marginBottom20,size:c.zxk.Sizes.SMALL,onClick:function(){return bN.Z.enableSoundshare()},disabled:o!==B.rtk.NOT_ENABLED,children:x.Z.Messages.USER_SETTINGS_VOICE_INSTALL_LABEL})})}),(0,r.jsx)(c.$i$,{className:fe().marginBottom20})]})]}):null}var EA=n(336177),yA=n(815378),mA=n(615457),bA=n(196028),gA=n.n(bA),OA=(0,Jt.hQ)();function vA(){var e=(0,yA.pI)();return(0,r.jsxs)("div",{className:v()(gA().soundboardRow),children:[(0,r.jsxs)("div",{className:v()(gA().soundboardColumn,gA().leftColumn),children:[(0,
r.jsx)(c.vwX,{tag:c.RB0.H5,className:gA().soundboardTitle,children:x.Z.Messages.USER_SETTINGS_SOUNDBOARD}),(0,r.jsx)(c.xvT,{color:"header-secondary",variant:"text-sm/normal",children:x.Z.Messages.USER_SETTINGS_SOUNDBOARD_VOLUME_DESCRIPTION_WITH_LINK.format({helpCenterArticle:ta.Z.getArticleURL(B.BhN.SOUNDBOARD)})})]}),(0,r.jsxs)("div",{className:v()(gA().soundboardColumn,gA().rightColumn),children:[(0,r.jsx)(c.vwX,{id:OA,tag:c.RB0.H5,className:gA().soundboardSubtitle,children:x.Z.Messages.USER_SETTINGS_SOUNDBOARD_VOLUME}),(0,r.jsx)(c.iRW,{initialValue:(0,mA.P)(e),maxValue:100,onValueRender:function(e){return"".concat(e.toFixed(0),"%")},asValueChanges:function(t){e=(0,mA.A)(t);(0,EA.xz)(e)},"aria-labelledby":OA})]})]})}var _A=n(579581),IA=n(535312),SA=n(597246),TA=n(359721),NA=n(761012),AA=n(785289),CA=n.n(AA);function PA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jA(e,t,n){t in e?Object.defineProperty(e,t,{value:n,
enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function RA(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function xA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return PA(e,t)
;var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PA(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var MA=387,wA=218;function DA(e){var t=e.previewEnabled,n=e.onEnablePreview,i=Bc.Z.getCameraComponent(),a=xA(o.useState((0,IA.P)(Lr.default.getCurrentUser())),2),s=a[0],u=a[1],f=o.useRef(!1),d=o.useRef(s),p=(0,_A.O)(),h=(0,y.e7)([Bc.Z],(function(){return Object.values(Bc.Z.getVideoDevices()).length>0}));o.useEffect((function(){return function(){f.current&&l.Z.wait((function(){return(0,SA.Up)(d.current)}))}}),[]);return(0,r.jsx)(NA.Z,{selectedBackgroundOption:s,onSelectBackgroundOption:function(e){f.current=!0;d.current=e;u(e);(0,TA.wG)(e,{location:p.location}).catch(B.dG4)},
renderCamera:function(e){return t?(0,r.jsx)("div",{className:CA().cameraWrapper,children:(0,r.jsxs)("div",{className:CA().camera,children:[(0,r.jsx)(i,{deviceId:e,width:MA,height:wA,disabled:!t}),(0,r.jsx)(NA.S,{})]})}):(0,r.jsxs)("div",{className:CA().cameraWrapper,children:[(0,r.jsx)("div",{className:CA().previewImage}),(0,r.jsx)(c.ua7,{text:h?null:x.Z.Messages.CAMERA_UNAVAILABLE,children:function(e){return(0,r.jsx)(c.zxk,RA(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){jA(e,t,n[t])}))}return e}({},e),{onClick:n,disabled:!h,children:x.Z.Messages.TEST_VIDEO}))}})]})}})}function ZA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function LA(e,t){return function(e){
if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ZA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ZA(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function UA(){return(0,r.jsx)(c.ToO,{type:c.sje.PRIMARY,title:x.Z.Messages.VIDEO_UNSUPPORTED_BROWSER_TITLE,body:x.Z.Messages.VIDEO_UNSUPPORTED_BROWSER_BODY,
button:(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,className:fe().marginTop20,onClick:function(){return zN("Video unsupported browser")},children:x.Z.Messages.DOWNLOAD_APP})})}function kA(){var e=(0,y.e7)([Bc.Z],(function(){return Bc.Z.supports(gN.AN.VIDEO)})),t=LA(o.useState(!1),2),n=t[0],i=t[1];return(0,r.jsxs)("div",{children:[(0,r.jsx)(c.y5t,{component:(0,r.jsx)(c.vwX,{tag:c.RB0.H1,className:fe().marginBottom20,children:x.Z.Messages.VIDEO_SETTINGS}),children:e?(0,r.jsx)(DA,{previewEnabled:n,onEnablePreview:function(){return i(!0)}}):(0,r.jsx)(UA,{})}),(0,r.jsx)(c.$i$,{className:v()(fe().marginBottom40,fe().marginTop40)})]})}var GA,BA=n(235920),HA=n(200824),VA=(0,Jt.hQ)();!function(e){e[e.NONE=0]="NONE";e[e.STANDARD=1]="STANDARD";e[e.KRISP=2]="KRISP"}(GA||(GA={}));var FA={page:B.ZY5.USER_SETTINGS,section:B.jXE.SETTINGS_VOICE_AND_VIDEO};function YA(e){var t=e.currentTarget;Dr.default.track(B.rMx.NOISE_CANCELLATION_LINK_CLICKED,{text:t.text,href:t.href,location:{page:B.ZY5.USER_SETTINGS,
section:B.jXE.SETTINGS_VOICE_AND_VIDEO}})}function zA(){var e=(0,y.e7)([xu.Z],(function(){return xu.Z.theme})),t=(0,y.cj)([Bc.Z],(function(){return{noiseCancellation:Bc.Z.getNoiseCancellation(),noiseSuppression:Bc.Z.getNoiseSuppression(),noiseSuppressionSupported:Bc.Z.isNoiseSuppressionSupported(),noiseCancellationSupported:Bc.Z.isNoiseCancellationSupported()}})),n=t.noiseCancellation,o=t.noiseSuppression,i=t.noiseSuppressionSupported,a=t.noiseCancellationSupported;if(!i&&!a)return null;var s=o?GA.STANDARD:GA.NONE,l=n?GA.KRISP:s,u=[];a&&u.push({name:x.Z.Messages.USER_SETTINGS_NOISE_CANCELLATION_KRISP,value:GA.KRISP});i&&u.push({name:x.Z.Messages.USER_SETTINGS_NOISE_CANCELLATION_STANDARD,value:GA.STANDARD});u.push({name:x.Z.Messages.USER_SETTINGS_NOISE_CANCELLATION_DISABLED,value:GA.NONE});return(0,r.jsxs)(c.hjN,{className:fe().marginBottom20,children:[(0,r.jsx)(c.vwX,{id:VA,tag:c.RB0.H3,className:fe().marginBottom8,children:x.Z.Messages.NOISE_SUPPRESSION}),(0,r.jsx)(c.R94,{
type:c.R94.Types.DESCRIPTION,className:fe().marginBottom8,children:x.Z.Messages.USER_SETTINGS_NOISE_CANCELLATION_DESCRIPTION}),(0,r.jsx)(c.Eep,{options:u,onChange:function(e){bN.Z.setNoiseCancellation(e.value===GA.KRISP,FA);bN.Z.setNoiseSuppression(e.value===GA.STANDARD,FA)},value:l}),a&&(0,r.jsx)(c.ToO,{className:fe().marginBottom8,type:c.Dd5.PRIMARY,imageData:{src:e===B.BRd.LIGHT?BA:HA,width:70,height:40},align:ae.Z.Align.CENTER,body:(0,r.jsx)(c.eee,{href:ta.Z.getArticleURL(B.BhN.NOISE_SUPPRESSION),onClick:YA,children:x.Z.Messages.LEARN_MORE})}),(0,r.jsx)(c.$i$,{})]})}function WA(){var e=(0,y.cj)([Bc.Z],(function(){return{inputMode:Bc.Z.getMode(),inputDeviceId:Bc.Z.getInputDeviceId(),echoCancellation:Bc.Z.getEchoCancellation(),automaticGainControl:Bc.Z.getAutomaticGainControl(),vadAutoThreshold:Bc.Z.getModeOptions().autoThreshold,vadUseKrisp:Bc.Z.getModeOptions().vadUseKrisp,advancedVoiceActivitySupported:Bc.Z.isAdvancedVoiceActivitySupported(),
automaticGainControlSupported:Bc.Z.isAutomaticGainControlSupported()}})),t=e.inputMode,n=e.inputDeviceId,o=e.echoCancellation,i=e.automaticGainControl,a=e.vadAutoThreshold,s=e.vadUseKrisp,l=e.advancedVoiceActivitySupported,u=e.automaticGainControlSupported,f=(0,y.cj)([BN.Z],(function(){return{hasEchoCancellation:BN.Z.hasEchoCancellation(n),hasNoiseSuppression:BN.Z.hasNoiseSuppression(n),hasAutomaticGainControl:BN.Z.hasAutomaticGainControl(n)}}),[n]),d=f.hasEchoCancellation,p=f.hasNoiseSuppression,h=f.hasAutomaticGainControl,E=d||p||h,m=t===B.pM4.VOICE_ACTIVITY&&a;return(0,r.jsxs)(c.hjN,{className:fe().marginBottom20,title:x.Z.Messages.FORM_LABEL_VOICE_PROCESSING,children:[E&&(0,r.jsx)(c.R94,{className:fe().marginBottom20,type:c.R94.Types.DESCRIPTION,children:x.Z.Messages.FORM_HELP_CERTIFIED_VOICE_PROCESSING}),(0,r.jsx)(c.j7V,{className:v()(fe().marginTop8,fe().marginBottom20),value:o,onChange:function(e){return bN.Z.setEchoCancellation(e,{page:B.ZY5.USER_SETTINGS,
section:B.jXE.SETTINGS_VOICE_AND_VIDEO})},disabled:d,children:x.Z.Messages.ECHO_CANCELLATION}),(0,r.jsx)(zA,{}),l&&(0,r.jsx)(c.j7V,{value:s,onChange:function(e){return bN.Z.setMode(t,{vadUseKrisp:e})},note:x.Z.Messages.USER_SETTINGS_DISABLE_ADVANCED_VOICE_ACTIVITY,disabled:!m,children:x.Z.Messages.ADVANCED_VOICE_ACTIVITY}),u&&(0,r.jsx)(c.j7V,{className:"",value:i,onChange:function(e){return bN.Z.setAutomaticGainControl(e,{page:B.ZY5.USER_SETTINGS,section:B.jXE.SETTINGS_VOICE_AND_VIDEO})},disabled:h,children:x.Z.Messages.AUTOMATIC_GAIN_CONTROL})]})}var KA=n(539519),qA=n(873985),XA=n.n(qA);function QA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $A(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function JA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]
;if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return QA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return QA(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var eC=(0,Jt.hQ)();function tC(){var e=function(e,t){a(e);f((t&gN.Dg.VOICE)===gN.Dg.VOICE)},t=function(e,t){bN.Z.setMode(m,{threshold:e,autoThreshold:t})},n=JA(o.useState(-100),2),i=n[0],a=n[1],l=JA(o.useState(!1),2),u=l[0],f=l[1],d=(0,y.cj)([Bc.Z],(function(){return Bc.Z.getModeOptions()
})),p=d.threshold,h=d.autoThreshold,E=(0,y.cj)([Bc.Z],(function(){return{inputMode:Bc.Z.getMode(),automaticVADSupported:Bc.Z.supports(gN.AN.AUTOMATIC_VAD),isEnabled:Bc.Z.isEnabled()}})),m=E.inputMode,b=E.automaticVADSupported,g=E.isEnabled;o.useEffect((function(){var t=new Ie.V7;t.start(1e3,(function(){Bc.Z.getMediaEngine().on(KA.aB.VoiceActivity,e);t.stop()}));return function(){Bc.Z.getMediaEngine().removeListener(KA.aB.VoiceActivity,e);t.stop()}}),[]);var O=(0,r.jsx)("section",{className:v()(XA().inputSensitivityToggle,XA().manual),children:(0,r.jsx)(c.iRW,{initialValue:p+100,onValueRender:function(e){return"".concat((-1*(100-e)).toFixed(0),"dB")},onValueChange:function(e){return t(-1*(100-e),h)},barStyles:{background:s.Z.unsafe_rawColors.GREEN_360.css},fillStyles:{background:s.Z.unsafe_rawColors.YELLOW_300.css},"aria-labelledby":eC,children:(0,r.jsxs)("div",{className:v()(XA().sliderBar,XA().microphone,XA().inputSensitivityBar),children:[(0,r.jsx)("div",{
className:v()(XA().fill,XA().inputSensitivityBarFill),style:{width:i+100+"%"}}),(0,r.jsx)("div",{className:"grow"})]})})});h&&(O=(0,r.jsxs)("section",{className:XA().inputSensitivityToggle,children:[(0,r.jsx)("div",{className:XA().inputSensitivitySlider,children:(0,r.jsx)("div",{className:v()(XA().inputSensitivityBar,XA().sliderBar,$A({},XA().speaking,u))})}),(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:fe().marginBottom8,children:x.Z.Messages.FORM_HELP_AUTOMATIC_VAD})]}));return(0,r.jsxs)(c.xJW,{className:XA().sensitivity,children:[(0,r.jsx)(c.vwX,{id:eC,tag:c.RB0.H5,className:fe().marginBottom8,children:x.Z.Messages.FORM_LABEL_INPUT_SENSITIVTY}),(0,r.jsxs)("div",{children:[b&&(0,r.jsx)(Jt.FG,{children:function(e){return(0,r.jsxs)("div",{className:v()(Qm().horizontal,fe().marginBottom4),children:[(0,r.jsx)(c.vwX,{tag:c.RB0.H3,className:fe().marginReset,children:(0,r.jsx)("label",{htmlFor:e,children:x.Z.Messages.FORM_LABEL_AUTOMATIC_VAD})}),(0,r.jsx)(c.rsf,{id:e,checked:h,
onChange:function(e){return t(p,e)}})]})}}),O]}),!g&&(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:v()(XA().inputDisabledWarning,fe().marginBottom8),children:x.Z.Messages.FORM_WARNING_INPUT_SENSITIVTY.format({onEnableClick:bN.Z.enable})})]})}var nC=(0,Jt.hQ)(),rC=(0,Jt.hQ)();function oC(){var e=(0,y.cj)([Bc.Z],(function(){return{inputVolume:Bc.Z.getInputVolume(),outputVolume:Bc.Z.getOutputVolume()}})),t=e.inputVolume,n=e.outputVolume;return(0,r.jsxs)(ae.Z,{className:"volume",children:[(0,r.jsxs)(ae.Z.Child,{basis:"50%",children:[(0,r.jsx)(c.vwX,{id:nC,tag:c.RB0.H5,className:fe().marginBottom4,children:x.Z.Messages.FORM_LABEL_INPUT_VOLUME}),(0,r.jsx)(c.iRW,{initialValue:(0,mA.P)(t),asValueChanges:function(e){return bN.Z.setInputVolume((0,mA.A)(e))},"aria-labelledby":nC})]}),(0,r.jsxs)(ae.Z.Child,{basis:"50%",children:[(0,r.jsx)(c.vwX,{id:rC,tag:c.RB0.H5,className:fe().marginBottom4,children:x.Z.Messages.FORM_LABEL_OUTPUT_VOLUME}),(0,r.jsx)(c.iRW,{initialValue:(0,mA.P)(n),
maxValue:200,onValueRender:function(e){return"".concat(e.toFixed(0),"%")},asValueChanges:function(e){return bN.Z.setOutputVolume((0,mA.A)(e))},"aria-labelledby":rC})]})]})}function iC(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function aC(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var sC=(0,Jt.hQ)(),cC="".concat(ta.Z.getArticleURL(B.BhN.VOICE_VIDEO_TROUBLESHOOTING),"?utm_source=discord&utm_medium=blog&utm_campaign=2020-06_help-voice-video&utm_content=--t%3Apm");function lC(e,t){var n=[{value:gN.iA.STANDARD,label:"Standard"}]
;e&&n.push({value:gN.iA.LEGACY,label:"Legacy"});t&&n.push({value:gN.iA.EXPERIMENTAL,label:"Experimental"});return n}function uC(e,t,n){(0,c.h7j)((function(o){return(0,r.jsx)(c.sm4,aC(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){iC(e,t,n[t])}))}return e}({header:e,confirmText:x.Z.Messages.OKAY,cancelText:x.Z.Messages.CANCEL,onConfirm:n},o),{children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:t})}))}))}function fC(){var e,t=(0,y.cj)([Bc.Z],(function(){return{inputMode:Bc.Z.getMode(),qosEnabled:Bc.Z.getQoS(),attenuation:Bc.Z.getAttenuation(),attenuateWhileSpeakingSelf:Bc.Z.getAttenuateWhileSpeakingSelf(),attenuateWhileSpeakingOthers:Bc.Z.getAttenuateWhileSpeakingOthers(),audioSubsystem:Bc.Z.getAudioSubsystem(),
silenceWarning:Bc.Z.getEnableSilenceWarning(),debugLoggingEnabled:Bc.Z.supports(gN.AN.DEBUG_LOGGING),legacyAudioSubsystemSupported:Bc.Z.supports(gN.AN.LEGACY_AUDIO_SUBSYSTEM),experimentalAudioSubsystemSupported:Bc.Z.supports(gN.AN.EXPERIMENTAL_AUDIO_SUBSYSTEM),qosSupported:Bc.Z.supports(gN.AN.QOS),attenuationSupported:Bc.Z.supports(gN.AN.ATTENUATION)}})),n=t.inputMode,o=t.qosEnabled,i=t.attenuation,a=t.attenuateWhileSpeakingSelf,s=t.attenuateWhileSpeakingOthers,l=t.audioSubsystem,u=t.silenceWarning,f=t.debugLoggingEnabled,d=t.legacyAudioSubsystemSupported,p=t.experimentalAudioSubsystemSupported,h=t.qosSupported,E=t.attenuationSupported,m=Yc.FB&&f&&null!=q.Z.fileManager.readLogFiles;return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.VOICE_SETTINGS,children:[(0,r.jsx)(qN,{}),(0,r.jsx)(oC,{}),(0,r.jsx)(dA,{}),(0,r.jsx)(c.R94,{className:fe().marginBottom20,type:c.R94.Types.DESCRIPTION,children:x.Z.Messages.FORM_HELP_VOICE_VIDEO_TROUBLESHOOTING_GUIDE.format({guideURL:cC})
}),!0===(null===(e=(0,xv.o3)())||void 0===e?void 0:e.allowSoundboard)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.$i$,{className:v()(fe().marginBottom20)}),(0,r.jsx)(vA,{})]}),(0,r.jsx)(c.$i$,{className:v()(fe().marginBottom40)}),(0,r.jsx)(sA,{}),n===gN.pM.VOICE_ACTIVITY&&(0,r.jsx)(tC,{}),(0,r.jsx)(c.$i$,{className:fe().marginBottom40}),(0,r.jsx)(kA,{}),(0,r.jsxs)(c.y5t,{component:(0,r.jsx)(c.vwX,{tag:c.RB0.H1,className:fe().marginBottom20,children:x.Z.Messages.SETTINGS_ADVANCED}),children:[(0,r.jsx)(IN,{}),(0,r.jsx)(WA,{}),h&&(0,r.jsx)(c.hjN,{className:fe().marginBottom20,title:x.Z.Messages.FORM_LABEL_QOS,children:(0,r.jsx)(c.j7V,{value:o,onChange:function(e){return bN.Z.setQoS(e)},note:x.Z.Messages.FORM_HELP_QOS,children:x.Z.Messages.FORM_CHECKBOX_QOS})}),E&&(0,r.jsxs)(c.hjN,{className:fe().marginBottom20,children:[(0,r.jsx)(c.vwX,{id:sC,tag:c.RB0.H5,className:fe().marginBottom8,children:x.Z.Messages.FORM_LABEL_ATTENUATION}),(0,r.jsx)(c.iRW,{initialValue:i,
onValueChange:function(e){bN.Z.setAttenuation(e,a,s)},"aria-labelledby":sC}),(0,r.jsx)(c.R94,{className:fe().marginBottom20,type:c.R94.Types.DESCRIPTION,children:x.Z.Messages.FORM_HELP_ATTENUATION}),(0,r.jsx)(c.$i$,{className:fe().marginBottom20}),(0,r.jsx)(c.j7V,{value:a,onChange:function(e){return bN.Z.setAttenuation(i,e,s)},children:x.Z.Messages.ATTENUATE_WHILE_SPEAKING_SELF}),(0,r.jsx)(c.j7V,{value:s,onChange:function(e){return bN.Z.setAttenuation(i,a,e)},children:x.Z.Messages.ATTENUATE_WHILE_SPEAKING_OTHERS})]}),(d||p)&&(0,r.jsxs)(c.hjN,{className:fe().marginBottom20,title:x.Z.Messages.FORM_LABEL_SUBSYSTEM,children:[(0,r.jsx)(c.q4e,{className:fe().marginBottom20,value:l,options:lC(d,p),onChange:function(e){uC(x.Z.Messages.SWITCH_SUBSYSTEM,x.Z.Messages.SWITCH_SUBSYSTEM_BODY,(function(){return bN.Z.setAudioSubsystem(e)}))}}),(0,r.jsx)(c.$i$,{className:fe().marginBottom20})]}),Yc.FB&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(hA,{}),(0,r.jsx)(c.hjN,{className:fe().marginBottom20,
title:x.Z.Messages.FORM_LABEL_VOICE_DIAGNOSTICS,children:(0,r.jsx)(c.j7V,{value:u,onChange:function(e){return bN.Z.setSilenceWarning(e)},children:x.Z.Messages.DISPLAY_SILENCE_WARNING})})]}),m&&(0,r.jsx)(GN,{}),(0,r.jsx)(c.xJW,{children:(0,r.jsx)(c.zxk,{look:c.zxk.Looks.OUTLINED,color:c.zxk.Colors.RED,onClick:function(){uC(x.Z.Messages.RESET_VOICE_SETTINGS,x.Z.Messages.RESET_VOICE_SETTINGS_BODY,bN.Z.reset)},size:c.zxk.Sizes.SMALL,children:x.Z.Messages.RESET_VOICE_SETTINGS})})]})]})}var dC=n(143307),pC=n.n(dC);function hC(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function EC(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n
}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var yC=tN;function mC(e){var t=e.unseenGiftCount,o=e.showPrepaidPaymentPastDueWarning,E=e.canUseAvatarDecorations,y=e.impressionSource,m=e.clipsEnabled,b=void 0!==m&&m,g=e.hasClientThemes,O=void 0!==g&&g,v=[{section:p.ID.HEADER,label:x.Z.Messages.USER_SETTINGS},{section:B.oAB.ACCOUNT,label:x.Z.Messages.USER_SETTINGS_MY_ACCOUNT,ariaLabel:x.Z.Messages.USER_SETTINGS_MY_ACCOUNT,element:Pd},{section:B.oAB.PROFILE_CUSTOMIZATION,type:p.bT.WIDE,label:x.Z.Messages.USER_SETTINGS_PROFILES,ariaLabel:x.Z.Messages.USER_SETTINGS_PROFILES,element:kc,notice:{stores:[mo.Z,ge.Z],element:To},onSettingsClose:function(){l.Z.wait((function(){(0,be.It)();(0,f.P6)();d.Z.clearSubsection(B.oAB.PROFILE_CUSTOMIZATION)}))},newIndicator:(0,r.jsx)(tn.F8,{text:x.Z.Messages.NEW}),newIndicatorDismissibleContentTypes:E?[a.z$.AVATAR_DECORATIONS_SPRING_2023_SETTINGS_NEW_BADGE]:null},{
section:B.oAB.PRIVACY_AND_SAFETY,label:x.Z.Messages.PRIVACY_AND_SAFETY,element:FS},{section:B.oAB.AUTHORIZED_APPS,label:x.Z.Messages.AUTHORIZED_APPS,element:Ih},{section:B.oAB.SESSIONS,label:x.Z.Messages.AUTH_SESSIONS,ariaLabel:x.Z.Messages.AUTH_SESSIONS,element:CT,newIndicatorDismissibleContentTypes:[a.z$.AUTH_SESSIONS_NEW],predicate:function(){return zc.getCurrentConfig({}).showSettings}},{section:B.oAB.CONNECTIONS,label:x.Z.Messages.CONNECTIONS,ariaLabel:x.Z.Messages.CONNECTIONS,element:wy,impressionName:i.zs.USER_SETTINGS_CONNECTIONS,impressionProperties:{source:y},newIndicatorDismissibleContentTypes:[a.z$.NEW_CRUNCHYROLL_CONNECTION]},{section:B.oAB.CLIPS,label:x.Z.Messages.CLIPS,ariaLabel:x.Z.Messages.CLIPS,icon:(0,r.jsx)(me.Z,{}),element:ne,predicate:function(){return b}},{section:B.oAB.FRIEND_REQUESTS,label:x.Z.Messages.FRIEND_REQUESTS,element:Um},{section:p.ID.DIVIDER},{section:p.ID.HEADER,label:x.Z.Messages.BILLING_SETTINGS},{section:B.oAB.PREMIUM,
ariaLabel:x.Z.Messages.PREMIUM,label:x.Z.Messages.PREMIUM,element:St.Z,className:pC().premiumTab},{section:B.oAB.GUILD_BOOSTING,label:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_TITLE,element:IS},{section:B.oAB.SUBSCRIPTIONS,ariaLabel:x.Z.Messages.SUBSCRIPTIONS_TITLE,label:x.Z.Messages.SUBSCRIPTIONS_TITLE,element:ao,icon:o?(0,r.jsx)(Fc.Z,{width:16,height:16,color:s.Z.unsafe_rawColors.YELLOW_300.css}):null},{section:B.oAB.INVENTORY,label:x.Z.Messages.GIFT_INVENTORY,element:Av,ariaLabel:x.Z.Messages.GIFT_INVENTORY,badgeCount:t,icon:(0,r.jsx)(me.Z,{})},{section:B.oAB.BILLING,label:x.Z.Messages.BILLING,element:QE},{section:p.ID.DIVIDER},{section:p.ID.HEADER,label:x.Z.Messages.APP_SETTINGS},{section:B.oAB.APPEARANCE,label:x.Z.Messages.APPEARANCE,ariaLabel:x.Z.Messages.APPEARANCE,element:Vp,newIndicatorDismissibleContentTypes:O?[a.z$.CLIENT_THEMES_SETTINGS_BADGE]:null},{section:B.oAB.ACCESSIBILITY,label:x.Z.Messages.ACCESSIBILITY,element:fu},{section:B.oAB.VOICE,
label:x.Z.Messages.VOICE_AND_VIDEO,element:fC,predicate:function(){return Bc.Z.isSupported()}},{section:B.oAB.POGGERMODE,label:x.Z.Messages.POGGERMODE,ariaLabel:x.Z.Messages.POGGERMODE,element:It,predicate:function(){return Oe.Z.settingsVisible},icon:(0,r.jsx)("img",{alt:"",src:n(20278),className:pC().poggermodeIcon})},{section:B.oAB.TEXT,label:x.Z.Messages.TEXT_AND_IMAGES,element:ZT},{section:B.oAB.NOTIFICATIONS,label:x.Z.Messages.NOTIFICATIONS,element:q_},{section:B.oAB.KEYBINDS,label:x.Z.Messages.KEYBINDS,element:t_},{section:B.oAB.LOCALE,label:x.Z.Messages.LANGUAGE,element:l_},{section:B.oAB.WINDOWS,label:x.Z.Messages.USER_SETTINGS_WINDOWS_SETTINGS,element:tN,predicate:function(){return Yc.FB&&(0,Yc.ED)()}},{section:B.oAB.LINUX,label:x.Z.Messages.USER_SETTINGS_LINUX_SETTINGS,element:yC,predicate:function(){return Yc.FB&&(0,Yc.IJ)()}},{section:B.oAB.STREAMER_MODE,label:x.Z.Messages.STREAMER_MODE,element:DT},{section:B.oAB.ADVANCED,label:x.Z.Messages.SETTINGS_ADVANCED,element:ap},{
section:p.ID.DIVIDER},{section:p.ID.HEADER,label:x.Z.Messages.ACTIVITY_SETTINGS},{section:B.oAB.ACTIVITY_PRIVACY,label:x.Z.Messages.ACTIVITY_PRIVACY,element:Zd},{section:B.oAB.REGISTERED_GAMES,label:x.Z.Messages.REGISTERED_GAMES,element:bb},{section:B.oAB.OVERLAY,label:x.Z.Messages.OVERLAY,element:pI,predicate:function(){return Hc.Z.isSupported()||!1}},{section:p.ID.DIVIDER},{section:"changelog",onClick:function(){return(0,h.Z)(!0)},label:x.Z.Messages.WHATS_NEW},{section:B.oAB.HYPESQUAD_ONLINE,label:x.Z.Messages.USER_SETTINGS_HYPESQUAD,element:Yg},{section:B.oAB.EXPERIMENTS,label:"Experiments",element:mN,predicate:function(){return Gc.Z.isDeveloper}},{section:B.oAB.DEVELOPER_OPTIONS,label:"Developer Options",element:Dm,predicate:function(){return Gc.Z.isDeveloper}},{section:B.oAB.HOTSPOT_OPTIONS,label:"Hotspot Options",element:al,predicate:function(){return Gc.Z.isDeveloper}},{section:B.oAB.DISMISSIBLE_CONTENT_OPTIONS,label:"Dismissible Contents",element:ye,predicate:function(){
return Gc.Z.isDeveloper}},{section:B.oAB.PAYMENT_FLOW_MODAL_TEST_PAGE,label:"Payment Flow Modals",element:bl,predicate:function(){return Gc.Z.isDeveloper}},{section:B.oAB.TEXT_PLAYGROUND,label:"Text Playground",element:zT,predicate:function(){return xl()||Gc.Z.isDeveloper}},{section:B.oAB.TEXT_COMPONENT,label:"Text Components",element:jl,predicate:function(){return xl()||Gc.Z.isDeveloper}},{section:p.ID.DIVIDER},{section:"logout",onClick:function(){(0,c.h7j)((function(e){return(0,r.jsx)(c.sm4,EC(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){hC(e,t,n[t])}))}return e}({header:x.Z.Messages.LOGOUT,confirmText:x.Z.Messages.LOGOUT,cancelText:x.Z.Messages.CANCEL,onCancel:e.onClose,onConfirm:function(){return u.Z.logout()}},e),{children:(0,
r.jsx)(c.xvT,{variant:"text-md/normal",children:x.Z.Messages.USER_SETTINGS_CONFIRM_LOGOUT})}))}))},label:x.Z.Messages.LOGOUT,ariaLabel:x.Z.Messages.LOGOUT,icon:(0,r.jsx)(Vc.Z,{width:16,height:16})},{section:p.ID.DIVIDER},{section:p.ID.CUSTOM,element:Nl},{section:p.ID.CUSTOM,element:Qc}];return v}},973646:(e,t,n)=>{"use strict";n.d(t,{P:()=>i});var r=n(707961),o=n(473708);function i(){(0,r.CFj)((0,r.Yz2)(o.Z.Messages.USER_SETTINGS_UPDATE_FAILURE,r.pCN.FAILURE))}},8489:(e,t,n)=>{"use strict";n.d(t,{q:()=>oe});var r=n(496486),o=n.n(r),i=n(17916),a=(n(887235),n(940060)),s=n(202351),c=n(630631),l=n(744564),u=n(296602),f=n(717225);function d(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}var p=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){
return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},h="CacheStore.Nonce",E=new u.Z("CacheStoreNonce"),y=function(){function e(){var t=this;!function(e,t){
if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);this.actions={CLEAR_CACHES:function(e,n){return t.handleClear(n)},CLEAR_GUILD_CACHE:function(e,n){return t.handleClear(n)}}}var t=e.prototype;t.getNonce=function(){return(e=function(){var e,t,n;return p(this,(function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,null===(e=f.Z.cache())||void 0===e?void 0:e.get(h)];case 1:return[2,null!==(t=r.sent())&&void 0!==t?t:null];case 2:n=r.sent();E.log("couldn't load nonce: ",n);return[2,null];case 3:return[2]}}))},function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){d(i,r,o,a,s,"next",e)}function s(e){d(i,r,o,a,s,"throw",e)}a(void 0)}))})();var e};t.writeNonce=function(e){var t;E.log("writing nonce (nonce: ".concat(e,")"));null===(t=f.Z.cache())||void 0===t||t.put(h,e)};t.handleClear=function(e){f.Z.cacheTransaction(e).delete(h)};return e}();const m=new y;var b=n(983622),g=n(996246);function O(e,t){
var n=e.split("\n"),r=null,o={version:"",nonce:"",guildChannels:{}},i=!0,a=!1,s=void 0;try{for(var c,l=n[Symbol.iterator]();!(i=(c=l.next()).done);i=!0){var u=c.value;if(""!==o.version)if(""!==o.nonce)if(null!=r){o.guildChannels[r]=u;r=null}else r=u;else o.nonce=u;else{if(u!==t)return null;o.version=u}}}catch(e){a=!0;s=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw s}}return o}var v=n(441143),_=n.n(v),I=n(61209),S=n(567403),T=n(682776);var N=n(358041),A=n(55609),C=n(130585),P=n(120415),j=n(22176);function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function x(e){return function(e){if(Array.isArray(e))return R(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name)
;if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var M=n(490989),w=n(532548),D=n(717091),Z=n(715107),L=n(464187),U=n(473903),k=n(796909),G=n(2590);function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function H(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function V(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){H(i,r,o,a,s,"next",e)}function s(e){H(i,r,o,a,s,"throw",e)}a(void 0)}))}}function F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Y(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,
configurable:!0,writable:!0}):e[t]=n;return e}function z(e){z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return z(e)}function W(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){Y(e,t,n[t])}))}return e}function K(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function q(e,t){
return!t||"object"!==J(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function X(e,t){X=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return X(e,t)}function Q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||ee(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e){return function(e){if(Array.isArray(e))return B(e)}(e)||function(e){
if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ee(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var J=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function ee(e,t){if(e){if("string"==typeof e)return B(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);return"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?B(e,t):void 0}}function te(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=z(e);if(t){
var o=z(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return q(this,n)}}var ne=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2]
;a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},re=new u.Z("CacheStore"),oe=!1,ie="stable-26",ae=!1,se="initializing",ce=9e5,le=0,ue=!1,fe=!1,de=!1;function pe(){re.log("Clearing cache store");le=Date.now();M.Z.clear();c.Z.remove(G.FsG);c.Z.remove(G.ihW);c.Z.remove(G.O42);se="no-cache"}function he(){(0,C.$8)()?ae?re.log("Not writing cache because caches cleared"):de?function(){re.log("Writing cache now");le=Date.now();var e=me(),t={version:ie,channels:me(),guilds:ye(),users:ve(e),readStates:ge()};ue=!0;c.Z.set(G.FsG,t);!function(e){var t=Q(function(){var e=S.Z.getGuilds(),t=[],n={};for(var r in e)if(I.Z.hasRestoredGuild(r)){var o=I.Z.getMutableGuildChannelsForGuild(r);for(var i in o){var a=o[i];t.push({id:a.id,type:a.type,guild_id:a.guild_id,parent_id:a.parent_id,computedPermissions:T.Z.computePermissions(a)})}n[r]=JSON.stringify(Object.values(o))}else{
var s=I.Z.getMutableBasicGuildChannelsForGuild(r);t=t.concat(Object.values(s));var c=I.Z.getCachedChannelJsonForGuild(r);_()(null!=c,"Non-restored guild cannot have missing JSON");n[r]=c}return[t,n]}(),2),n=t[0],r=t[1],o=Date.now().toString(),i={version:ie,nonce:o,saveableChannels:g.Z.toSnapshot(),privateChannelIds:Ee(),guilds:e,users:Oe(),basicGuildChannels:n,privateChannels:be()},a={version:ie,nonce:o,guildChannels:r};re.log("Writing lazy cache (nonce: ".concat(o,")"));c.Z.set(G.ihW,i);c.Z.setRaw(G.O42,function(e){var t=e.version+"\n";t+=e.nonce+"\n";for(var n in e.guildChannels){t+=n+"\n";t+=e.guildChannels[n]+"\n"}return t}(a));m.writeNonce(o);M.Z.persist(o)}(o().values(S.Z.getGuilds()));l.Z.dispatch({type:"WRITE_CACHES"})}():re.log("Not writing cache because never connected"):re.log("Not writing cache because not authenticated")}function Ee(){return k.Z.getPrivateChannelIds()}function ye(){var e=S.Z.getGuild(L.Z.getGuildId());return null!=e?[e]:[]}function me(){
var e=I.Z.getChannel(Z.Z.getChannelId());return null!=e?[e]:[]}function be(){var e=[];k.Z.getPrivateChannelIds().forEach((function(t){var n=I.Z.getChannel(t);null!=n&&e.push(n)}));return e}function ge(){return D.ZP.getAllReadStates(!1)}function Oe(){var e=new Set;k.Z.getPrivateChannelIds().forEach((function(t){var n=I.Z.getChannel(t);(null==n?void 0:n.isPrivate())&&n.recipients.forEach((function(t){var n=U.default.getUser(t);null!=n&&e.add(n)}))}));return Array.from(e)}function ve(e){var t=new Set;e.forEach((function(e){e.isPrivate()&&e.recipients.forEach((function(e){var n=U.default.getUser(e);null!=n&&t.add(n)}))}));var n=U.default.getCurrentUser();null!=n&&t.add(n);return Array.from(t)}function _e(e){if(null!=e.guilds){var t=!0,n=!1,r=void 0;try{for(var o,i=e.guilds[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var s=o.value.roles;if(null!=s)for(var c in s){var l=s[c];l.permissions=a.Z.deserialize(l.permissions)}}}catch(e){n=!0;r=e}finally{try{t||null==i.return||i.return()
}finally{if(n)throw r}}}"channels"in e&&null!=e.channels&&(0,N.Z)(e.channels);"privateChannels"in e&&null!=e.privateChannels&&(0,N.Z)(e.privateChannels);if("basicGuildChannels"in e&&null!=e.basicGuildChannels){var u=!0,f=!1,d=void 0;try{for(var p,h=e.basicGuildChannels[Symbol.iterator]();!(u=(p=h.next()).done);u=!0){var E=p.value;E.computedPermissions=a.Z.deserialize(E.computedPermissions)}}catch(e){f=!0;d=e}finally{try{u||null==h.return||h.return()}finally{if(f)throw d}}}}function Ie(){return Se.apply(this,arguments)}function Se(){return(Se=V((function(){var e,t,n,r,o,i,a;return ne(this,(function(s){switch(s.label){case 0:e=performance.now();n=null!==(t=L.Z.getGuildId())&&void 0!==t?t:null;return null==(r=Z.Z.getChannelId())?[3,2]:[4,b.Z.startupLoad(n,r,G.AQB)];case 1:o=s.sent();re.log("loaded ".concat(o.messages.length," messages from kv_storage (guild: ").concat(n,", channel: ").concat(r,")."));i={guildId:n,channelId:r,users:o.users,members:o.members,messages:o.messages}
;return[2,[performance.now()-e,i]];case 2:a={guildId:null,channelId:null,users:[],members:[],messages:[]};return[2,[performance.now()-e,a]];case 3:return[2]}}))}))).apply(this,arguments)}function Te(){return Ne.apply(this,arguments)}function Ne(){return(Ne=V((function(){var e,t;return ne(this,(function(n){switch(n.label){case 0:e=performance.now();return[4,new Promise((function(e){return c.Z.asyncGet(G.FsG,e)}))];case 1:if((null==(t=n.sent())?void 0:t.version)===ie){_e(t);return[2,[performance.now()-e,t]]}re.log("cache either did not exist, or contains an incompatible version (required: ".concat(ie,", loaded: ").concat(null==t?void 0:t.version,")."));return[2,[performance.now()-e,null]]}}))}))).apply(this,arguments)}function Ae(){return Ce.apply(this,arguments)}function Ce(){return(Ce=V((function(){var e,t,n,r,o,i,a,s,c;return ne(this,(function(u){switch(u.label){case 0:re.log("loading early cache");e=performance.now();t=A.Z.loadCachedMessages.measureAsyncWithoutNesting(Ie);0
;return[4,A.Z.loadMiniCache.measureAsyncWithoutNesting(Te)];case 1:n=Q.apply(void 0,[u.sent(),2]),r=n[0],o=n[1];return[4,t];case 2:i=Q.apply(void 0,[u.sent(),2]),a=i[0],s=i[1];re.log("cache loaded in ".concat(performance.now()-e,"ms (legacy ").concat(r,"ms, channel-history ").concat(a,"ms)"));if(null!=o&&null!=s){c=Object.fromEntries(s.members.map((function(e){return[e.userId,e]})));l.Z.dispatch(K(W({},o),{type:"CACHE_LOADED",users:$(o.users).concat($(s.users)),messages:null==s.channelId?{}:Y({},s.channelId,s.messages),guildMembers:null==s.guildId?{}:Y({},s.guildId,c)}));re.log("finished dispatching CACHE_LOADED");return[2,!0]}re.log("finished without dispatching CACHE_LOADED");return[2,!1]}}))}))).apply(this,arguments)}function Pe(){xe((function(){return l.Z.dispatch({type:"CACHE_LOADED_LAZY_NO_CACHE"})}));return Promise.resolve()}function je(){return Re.apply(this,arguments)}function Re(){return(Re=V((function(){var e,t,n,r,o;return ne(this,(function(a){switch(a.label){case 0:
re.log("loading late lazy cache");return[4,A.Z.fetchLazyCache.measureAsync((function(){return Promise.all([c.Z.asyncGetRaw(G.ihW),c.Z.asyncGetRaw(G.O42),i.Z.timeAsync("💾","CacheStore.getNonce",(function(){return m.getNonce()}))])}))];case 1:e=Q.apply(void 0,[a.sent(),3]),t=e[0],n=e[1],r=e[2];return[4,new Promise((function(e){return setTimeout(e,0)}))];case 2:a.sent();A.Z.loadLazyCache.recordStart();o=w.Z.getSocket();xe((function(){var e=performance.now();if(fe){re.log("Skipping lazy cache; already connected.");l.Z.dispatch({type:"CACHE_LOADED_LAZY_NO_CACHE"})}else if(null!=t){o.addAnalytics({hadCacheAtStartup:!0});var i=A.Z.parseLazyCache.measure((function(){return JSON.parse(t)}));if(i.version===ie){var a=M.Z.getSavedNonce();if(""===a||i.nonce===a)if(a===r){var s=A.Z.parseLazyChannelsCache.measure((function(){return null!=n?O(n,ie):null}));if(null!=s)if(i.nonce===s.nonce){A.Z.deserializeCache.measure((function(){return _e(i)}));A.Z.dispatchLazyCache.measure((function(){
l.Z.dispatch(K(W({type:"CACHE_LOADED_LAZY"},i),{guildChannelsJson:s.guildChannels}))}));re.log("Lazy cache has loaded, took ".concat(performance.now()-e," ms"));o.addAnalytics({usedCacheAtStartup:!0})}else{re.log("Caches have mismatched nonces.");l.Z.dispatch({type:"CACHE_LOADED_LAZY_NO_CACHE"})}else{re.log("Saved cached channels has mismatched version or missing.");l.Z.dispatch({type:"CACHE_LOADED_LAZY_NO_CACHE"})}}else{re.log("ClientStateStore and AppDatabase nonces do not match.");l.Z.dispatch({type:"CACHE_LOADED_LAZY_NO_CACHE"})}else{re.log("ClientStateStore has mismatched nonces with cache.");l.Z.dispatch({type:"CACHE_LOADED_LAZY_NO_CACHE"})}}else{re.log("Saved cached has mismatched version. Expected ".concat(ie,", got ").concat(i.version));l.Z.dispatch({type:"CACHE_LOADED_LAZY_NO_CACHE"})}}else{re.log("Lazy cache was missing");l.Z.dispatch({type:"CACHE_LOADED_LAZY_NO_CACHE"})}}));return[2]}}))}))).apply(this,arguments)}function xe(e){var t=w.Z.getSocket(),n=!1
;s.ZP.Emitter.batched((function(){try{e();if(t.hasQueuedDispatches()){n=!0;A.Z.loadLazyCache.recordEnd();t.processFirstQueuedDispatch();setTimeout((function(){t.processDispatchQueue()}),100)}else t.processDispatchQueue()}catch(e){j.Z.captureException(e);re.warn("Lazy cache has encountered error",e);pe();t.processDispatchQueue()}}));n||A.Z.loadLazyCache.recordEnd()}var Me=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&X(e,t)}(n,e);var t=te(n);function n(){F(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){if(!oe){w.Z.getSocket().processDispatchQueue()}};r.hasCache=function(){return!oe||ue};r.getLazyCacheStatus=function(){return oe?se:"no-cache"};r.loadCacheAsync=function(e){return V((function(){var t,n,r;return ne(this,(function(o){switch(o.label){case 0:t=function(e){
var t=void 0,n=!1;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];if(!n){n=!0;t=e.apply(void 0,x(o))}return t}}(e);o.label=1;case 1:o.trys.push([1,7,,8]);return[4,Ae()];case 2:if(!o.sent())return[3,4];t();return[4,je()];case 3:o.sent();return[3,6];case 4:t();return[4,Pe()];case 5:o.sent();o.label=6;case 6:return[3,8];case 7:n=o.sent();pe();re.error("clearing cache. exception encountered while loading cache.",n,n.stack);t();j.Z.captureException(n);null===(r=w.Z.getSocket())||void 0===r||r.processDispatchQueue();return[3,8];case 8:return[2]}}))}))()};r.__getLocalVars=function(){return{logger:re,CACHE_VERSION:ie,cacheCleared:ae,lazyCacheStatus:se,MIN_CACHE_WRITE_DELAY:ce,lastWriteTime:le,hasCache:ue,connected:fe,hasEverConnected:de,instance:we}};return n}(s.ZP.Store);Me.displayName="CacheStore";var we=new Me(l.Z,oe?{CONNECTION_OPEN:function(){fe=!0;de=!0;0;return!1},LOGOUT:function(){pe()},CONNECTION_CLOSED:function(){fe=!1;de=!0
;re.log("Writing cache on connection closed");he();return!1},APP_STATE_UPDATE:function(e){var t=e.state;((0,P.Dt)()?G.$7l.BACKGROUND:G.$7l.INACTIVE)===t&&fe&&he();return!1},CACHE_LOADED:function(){ue=!0},CACHE_LOADED_LAZY:function(){ue=!0;se="cache-loaded"},CACHE_LOADED_LAZY_NO_CACHE:function(){se="no-cache"},CLEAR_CACHES:function(){pe();ae=!0},WINDOW_FOCUS:function(e){if(!e.focused)if(Date.now()-le>ce){re.log("Writing cache from window unfocus");he()}else re.log("Not writing cache from window unfocus");return!1}}:{})},425187:(e,t,n)=>{"use strict";n.d(t,{Z:()=>k});var r=n(496486),o=n.n(r),i=n(202351),a=n(744564),s=n(823530),c=n(367891),l=n(567403),u=n(682776),f=n(170585),d=n(2590);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1;r.configurable=!0
;"value"in r&&(r.writable=!0);Object.defineProperty(e,r.key,r)}}function y(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function m(e){m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return m(e)}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){y(e,t,n[t])}))}return e}function g(e,t){return!t||"object"!==_(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function O(e,t){O=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return O(e,t)}function v(e){return function(e){if(Array.isArray(e))return p(e)
}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var _=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=m(e)
;if(t){var o=m(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}var S,T,N,A=[],C=null,P=!1,j=d.QZA.CLOSED,R={},x=!1,M=null;function w(){T=c.Z.getChannel();S=null!=T?l.Z.getGuild(T.guild_id):null;A=null!=T&&null!=S&&u.Z.can(d.Plq.MANAGE_WEBHOOKS,T)?f.Z.getWebhooksForChannel(S.id,T.id):[];if(null!=C){var e=Z(C.id);null!=e&&(C=e)}j=d.QZA.OPEN;R={};x=!1}var D=o().debounce((function(){if(x){(null==C||o().isEqual(C,Z(C.id)))&&(x=!1);x||U.emitChange()}}),500);function Z(e){return A.find((function(t){return t.id===e}))}var L=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&O(e,t)}(n,e);var t=I(n);function n(){h(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(c.Z,l.Z,f.Z,u.Z)};r.hasChanges=function(){return x}
;r.getWebhook=function(e){return Z(e)};r.showNotice=function(){return this.hasChanges()};r.getProps=function(){return{submitting:j===d.QZA.SUBMITTING,webhooks:A,editedWebhook:C,section:N,sectionId:M,hasChanges:this.hasChanges(),isFetching:P,errors:R}};r.__getLocalVars=function(){return{webhooks:A,editedWebhook:C,isFetchingWebhooks:P,guild:S,channel:T,formState:j,errors:R,hasChanges:x,section:N,sectionId:M,validateUpdate:D,storeInstance:U}};!function(e,t,n){t&&E(e.prototype,t);n&&E(e,n)}(n,[{key:"webhooks",get:function(){return A}},{key:"editedWebhook",get:function(){return C}},{key:"formState",get:function(){return j}}]);return n}(i.ZP.Store);L.displayName="ChannelSettingsIntegrationsStore";var U=new L(a.Z,__OVERLAY__?{}:{INTEGRATION_SETTINGS_INIT:w,INTEGRATION_SETTINGS_SAVE_SUCCESS:w,CHANNEL_SETTINGS_SET_SECTION:function(e){if(e.section!==d.CoT.INTEGRATIONS)return!1;N=d.b4C.OVERVIEW;if(null==S){var t=c.Z.getChannel(),n=null==t?void 0:t.getGuildId();if(null!=t&&null!=n){
s.Z.fetchForChannel(n,t.id);P=!0}w()}},INTEGRATION_SETTINGS_SET_SECTION:function(e){var t=e.section,n=e.sectionId;N=t;M=n},INTEGRATION_SETTINGS_START_EDITING_WEBHOOK:function(e){var t=Z(e.webhookId);if(null==t)return!1;C=t;R={};x=!1},INTEGRATION_SETTINGS_STOP_EDITING_WEBHOOK:function(){C=null;R={};x=!1},INTEGRATION_SETTINGS_UPDATE_WEBHOOK:function(e){var t=e.settings;if(null==C)return!1;C=b({},C);if(null!=t.name&&C.name!==t.name){C.name=t.name;x=!0}if(void 0!==t.avatar&&C.avatar!==t.avatar){C.avatar=t.avatar;x=!0}if(null!=t.channelId&&C.channel_id!==t.channelId){C.channel_id=t.channelId;x=!0}x&&D()},CHANNEL_SETTINGS_CLOSE:function(){T=null;S=null;A=[];C=null;j=d.QZA.CLOSED},WEBHOOKS_UPDATE:function(e){var t=function(e){var t=A[e];if(null!=r&&(null==t?void 0:t.channel_id)!==r)return"continue";var n=o.find((function(e){if(e.id===t.id)return!0}));if(null!=n){var i=b({},t,n);A[e]=i;x||(null==C?void 0:C.id)!==i.id||(C=i)}else{(null==C?void 0:C.id)===t.id&&(C=null);A.splice(e,1)}
},n=e.guildId,r=e.channelId,o=e.webhooks;if(null==S||n!==S.id||null==T||r!==T.id||null==o||j===d.QZA.SUBMITTING)return!1;P=!1;for(var i=A.length-1;i>=0;i--)t(i);var a=!0,s=!1,c=void 0;try{for(var l,u=function(){var e=l.value,t=A.find((function(t){if(t.id===e.id)return!0}));null==t&&A.push(e)},f=o[Symbol.iterator]();!(a=(l=f.next()).done);a=!0)u()}catch(e){s=!0;c=e}finally{try{a||null==f.return||f.return()}finally{if(s)throw c}}A=v(A);D()},INTEGRATION_SETTINGS_SUBMITTING:function(){j=d.QZA.SUBMITTING;R={}},INTEGRATION_SETTINGS_SAVE_FAILURE:function(e){if(j!==d.QZA.SUBMITTING)return!1;j=d.QZA.OPEN;var t;R=null!==(t=e.errors)&&void 0!==t?t:{}}});const k=U},502569:(e,t,n)=>{"use strict";n.d(t,{Z:()=>k});var r=n(496486),o=n.n(r),i=n(202351),a=n(630631),s=n(744564),c=n(563135),l=n(367891),u=n(61209),f=n(2590),d=n(449518);function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n]
;r.enumerable=r.enumerable||!1;r.configurable=!0;"value"in r&&(r.writable=!0);Object.defineProperty(e,r.key,r)}}function E(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function y(e){y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return y(e)}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){E(e,t,n[t])}))}return e}function b(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){
return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function g(e,t){return!t||"object"!==v(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function O(e,t){O=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return O(e,t)}var v=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function _(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}
var I,S,T=new Set,N=f.QZA.CLOSED,A=!1,C=null,P=null,j=null,R=null,x=null,M=null,w=a.Z.get(d.kf)||!1;function D(e){var t=e.getGuildId(),n=m({},e.permissionOverwrites);null!=t&&null==n[t]&&(n[t]=c.ZP.makeEveryoneOverwrite(t));return n}function Z(){j=l.Z.getChannel();R=l.Z.getCategory();if(null==j)return!1;var e=j.getGuildId();P=C=D(j);null==C[x]&&(x=e);S=null!=R;I=c.ZP.areChannelsLocked(j,R);M=null;A=!1;N=f.QZA.CLOSED;T.clear()}function L(e){if(null==j||j.id!==e)return!1;if(null==(j=u.Z.getChannel(e)))return!1;R=l.Z.getCategory();var t=j.getGuildId();if(null==t)return!1;P=D(j);var n={};T.forEach((function(e){null!=C&&(n[e]=C[e])}));null==n[t]&&null==j.permissionOverwrites[t]&&(n[t]=c.ZP.makeEveryoneOverwrite(t));if(null==(C=m({},j.permissionOverwrites,n))[x])x=t;else if(null!=M&&null!=C[M]){x=M;M=null}I=c.ZP.areChannelsLocked(j,R);return!0}var U=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
;e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&O(e,t)}(n,e);var t=_(n);function n(){p(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(l.Z,u.Z)};r.hasChanges=function(){return A};r.showNotice=function(){return this.hasChanges()};r.getPermissionOverwrite=function(e){return null==C?void 0:C[e]};r.__getLocalVars=function(){return{editedPermissions:T,formState:N,hasChanges:A,locked:I,isLockable:S,permissionOverwrites:C,originalPermissionOverwrites:P,channel:j,category:R,selectedOverwriteId:x,queuedSelectedOverwriteId:M,advancedMode:w}};!function(e,t,n){t&&h(e.prototype,t);n&&h(e,n)}(n,[{key:"editedPermissionIds",get:function(){return Array.from(T)}},{key:"permissionOverwrites",get:function(){return C}},{key:"selectedOverwriteId",get:function(){return x}},{key:"formState",get:function(){return N}},{key:"isLockable",get:function(){return S}},{key:"locked",get:function(){return I}},{key:"channel",
get:function(){return j}},{key:"category",get:function(){return R}},{key:"advancedMode",get:function(){return w}}]);return n}(i.ZP.Store);U.displayName="ChannelSettingsPermissionsStore";const k=new U(s.Z,{CHANNEL_SETTINGS_SET_SECTION:function(e){var t=e.section;if(null!=j||t!==f.CoT.PERMISSIONS)return!1;Z()},CHANNEL_SETTINGS_PERMISSIONS_INIT:Z,CHANNEL_SETTINGS_PERMISSIONS_UPDATE_PERMISSION:function(e){var t=e.id,n=e.allow,r=e.deny,i=null==C?void 0:C[t];if(null==i||null==j)return!1;i=b(m({},i),{allow:n,deny:r});C=b(m({},C),E({},t,i));T.add(t);N=f.QZA.OPEN;A=!o().isEqual(C,P);I=c.ZP.areChannelsLocked(j,R)},CHANNEL_SETTINGS_PERMISSIONS_SELECT_PERMISSION:function(e){var t=e.id;if(null!=C&&null!=C[t])x=t;else{if(null==j)return!1;M=t}},CHANNEL_SETTINGS_CLOSE:function(){N=f.QZA.CLOSED;C=null;P=null;j=null;R=null;A=!1;T.clear();x=null;M=null},CHANNEL_UPDATES:function(e){var t=e.updates;if(null==j)return!1;var n=!1,r=!0,o=!1,i=void 0;try{
for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){!1!==L(a.value.channel.id)&&(n=!0)}}catch(e){o=!0;i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n},CHANNEL_SETTINGS_PERMISSIONS_SUBMITTING:function(){N=f.QZA.SUBMITTING},CHANNEL_SETTINGS_PERMISSIONS_SAVE_SUCCESS:function(e){if(e.silent)N=f.QZA.OPEN;else{N=f.QZA.CLOSED;Z()}},CHANNEL_SETTINGS_PERMISSIONS_SET_ADVANCED_MODE:function(e){var t=e.advancedMode;w=t;a.Z.set(d.kf,t)}})},367891:(e,t,n)=>{"use strict";n.d(t,{Z:()=>z});var r=n(496486),o=n.n(r),i=n(730381),a=n.n(i),s=n(202351),c=n(281110),l=n(744564),u=n(382060),f=n(848285),d=n(424158),p=n(722406),h=n(61209),E=n(2590);function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function b(e){b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)}
;return b(e)}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){m(e,t,n[t])}))}return e}function O(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function v(e,t){return!t||"object"!==I(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}
function _(e,t){_=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return _(e,t)}var I=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var o=b(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return v(this,n)}}var T,N,A,C,P,j,R=E.QZA.CLOSED,x={},M={},w=!1,D=!1,Z=null,L=["name","type","topic_","bitrate_","userLimit_","nsfw_","flags_","rateLimitPerUser_","defaultThreadRateLimitPerUser","defaultAutoArchiveDuration","template","defaultReactionEmoji","rtcRegion","videoQualityMode","threadMetadata","banner","availableTags","defaultSortOrder","defaultForumLayout"];function U(e){
if(null==A||A.id!==e)return!1;if(A===C){var t=h.Z.getChannel(e);if(null==t)return!1;C=A=t;P=h.Z.getChannel(C.parent_id)}else{var n=h.Z.getChannel(e);if(null==n)return!1;A=n;if(null!=C){C=C.set("permissionOverwrites",A.permissionOverwrites);P=h.Z.getChannel(C.parent_id)}}return!0}function k(e){var t=h.Z.getChannel(e.channelId);if(null==t)return B();R=E.QZA.OPEN;C=A=t;Z="location"in e&&null!=e.location?e.location:null;N="subsection"in e?e.subsection:null;null!=C&&(C=C.set("nsfw",C.isNSFW()));P=h.Z.getChannel(C.parent_id);j=C.getGuildId();x={};G({type:"CHANNEL_SETTINGS_SET_SECTION",section:null!=T?T:E.CoT.OVERVIEW,subsection:N})}function G(e){T=e.section;N=e.subsection;if(null!=C&&T===E.CoT.INSTANT_INVITES){w=!0;c.Z.get({url:E.ANM.INSTANT_INVITES(C.id),oldFormErrors:!0}).then((function(e){w=!1;l.Z.dispatch({type:"CHANNEL_SETTINGS_LOADED_INVITES",invites:e.body})}),(function(){return w=!1}))}}function B(){D=!1;R=E.QZA.CLOSED;T=null;C=A=null;P=null;M={}}var H=o().debounce((function(){
if(null==C||null==A)return!1;var e=C.toJS(),t=A.toJS();if(L.every((function(n){return e[n]===t[n]}))&&C!==A){C=A;Y.emitChange()}}),500);function V(e){return new d.Z({code:e.code,temporary:e.temporary,revoked:e.revoked,inviter:null!=e.inviter?new p.Z(e.inviter):null,channel:(0,u.jD)(e.channel),guild:null!=e.guild?new f.Z(e.guild):null,uses:e.uses,maxUses:e.max_uses,maxAge:e.max_age,createdAt:a()(e.created_at),type:e.type})}var F=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&_(e,t)}(n,e);var t=S(n);function n(){y(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(h.Z)};r.hasChanges=function(){return C!==A};r.isOpen=function(){return D};r.getSection=function(){return T};r.getInvites=function(){return{invites:M,loading:w}};r.showNotice=function(){
return this.hasChanges()};r.getChannel=function(){return C};r.getFormState=function(){return R};r.getCategory=function(){return P};r.getProps=function(){return{submitting:R===E.QZA.SUBMITTING,errors:x,channel:C,section:T,subsection:N,invites:M,selectedOverwriteId:j,hasChanges:this.hasChanges(),analyticsLocation:Z}};r.__getLocalVars=function(){return{formState:R,section:T,subsection:N,originalChannel:A,channel:C,category:P,errors:x,invites:M,selectedOverwriteId:j,loadingInvites:w,open:D,analyticsLocation:Z,CHANNEL_PROPERTIES:L,validateUpdate:H,storeInstance:Y}};return n}(s.ZP.Store);F.displayName="ChannelSettingsStore";var Y=new F(l.Z,{CHANNEL_SETTINGS_INIT:k,CHANNEL_SETTINGS_OPEN:function(e){D=!0;k(e)},CHANNEL_SETTINGS_SUBMIT:function(){R=E.QZA.SUBMITTING;x={}},CHANNEL_SETTINGS_SUBMIT_SUCCESS:function(){A=C;R=E.QZA.OPEN},CHANNEL_SETTINGS_SUBMIT_FAILURE:function(e){R=E.QZA.OPEN;var t;x=Object.keys(null!==(t=e.errors)&&void 0!==t?t:{}).reduce((function(t,n){var o=e.errors[n];(0,
r.isArray)(o)?t[n]=o.join("\n"):t[n]=o;return t}),{})},CHANNEL_SETTINGS_CLOSE:B,CHANNEL_SETTINGS_OVERWRITE_SELECT:function(e){var t=e.overwriteId;j=t},CHANNEL_SETTINGS_UPDATE:function(e){var t=e.name,n=e.channelType,r=e.topic,o=e.bitrate,i=e.userLimit,a=e.nsfw,s=e.flags,c=e.rateLimitPerUser,l=e.defaultThreadRateLimitPerUser,u=e.autoArchiveDuration,f=e.locked,d=e.invitable,p=e.defaultAutoArchiveDuration,h=e.template,E=e.defaultReactionEmoji,y=e.rtcRegion,m=e.videoQualityMode,b=e.availableTags,v=e.defaultSortOrder,_=e.defaultForumLayout;if(null==C)return!1;null!=t&&(C=C.set("name",t));null!=r&&(C=C.set("topic",r));null!=o&&(C=C.set("bitrate",o));null!=i&&(C=C.set("userLimit",i));null!=a&&(C=C.set("nsfw",a));null!=s&&(C=C.set("flags",s));null!=c&&(C=C.set("rateLimitPerUser",c));null!=l&&(C=C.set("defaultThreadRateLimitPerUser",l));null!=u&&(C=C.set("threadMetadata",O(g({},C.threadMetadata),{autoArchiveDuration:u})));null!=f&&(C=C.set("threadMetadata",O(g({},C.threadMetadata),{locked:f})))
;null!=d&&(C=C.set("threadMetadata",O(g({},C.threadMetadata),{invitable:d})));null!=p&&(C=C.set("defaultAutoArchiveDuration",p));null!=h&&(C=C.set("template",h));null!=n&&(C=C.set("type",n));void 0!==y&&(C=C.set("rtcRegion",y));null!=m&&(C=C.set("videoQualityMode",m));void 0!==E&&(C=C.set("defaultReactionEmoji",E));null!=b&&(C=C.set("availableTags",b));null!=v&&(C=C.set("defaultSortOrder",v));null!=_&&(C=C.set("defaultForumLayout",_));H()},CHANNEL_SETTINGS_SET_SECTION:G,CHANNEL_SETTINGS_LOADED_INVITES:function(e){M={};e.invites.forEach((function(e){M[e.code]=V(e)}))},CHANNEL_UPDATES:function(e){var t=e.updates;if(null==C)return!1;var n=!1,r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){if(U(a.value.channel.id)&&null!=C){null!=j&&null==C.permissionOverwrites[j]&&(j=C.getGuildId());n=!0}}}catch(e){o=!0;i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n},CHANNEL_DELETE:function(e){var t=e.channel.id;if(null==C)return!1
;if(C.id!==t)return!1;R=E.QZA.CLOSED},INSTANT_INVITE_REVOKE_SUCCESS:function(e){delete(M=g({},M))[e.code]},INSTANT_INVITE_CREATE_SUCCESS:function(e){M=O(g({},M),m({},e.invite.code,V(e.invite)))}});const z=Y},470758:(e,t,n)=>{"use strict";n.d(t,{Z:()=>E});var r=n(202351),o=n(744564),i=n(473903),a=n(2590);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e){c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return c(e)}function l(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e,t){u=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return u(e,t)}var f=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var o=c(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}var p=null;var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&u(e,t)}(n,e);var t=d(n);function n(){s(this,n);return t.apply(this,arguments)}var r=n.prototype;r.getHouseMembership=function(){return p};r.__getLocalVars=function(){return{houseID:p}};return n}(r.ZP.Store);h.displayName="HypeSquadStore";const E=new h(o.Z,{CONNECTION_OPEN:function(){var e=i.default.getCurrentUser()
;null!=e&&(e.hasFlag(a.xW$.HYPESQUAD_ONLINE_HOUSE_1)?p=a.gkr.HOUSE_1:e.hasFlag(a.xW$.HYPESQUAD_ONLINE_HOUSE_2)?p=a.gkr.HOUSE_2:e.hasFlag(a.xW$.HYPESQUAD_ONLINE_HOUSE_3)&&(p=a.gkr.HOUSE_3))},HYPESQUAD_ONLINE_MEMBERSHIP_LEAVE_SUCCESS:function(){p=null},HYPESQUAD_ONLINE_MEMBERSHIP_JOIN_SUCCESS:function(e){p=e.houseID}})},517205:(e,t,n)=>{"use strict";n.d(t,{Z:()=>C});var r=n(496486),o=n.n(r),i=n(202351),a=n(744564),s=n(574169),c=n(736818),l=n(870614),u=n(736097),f=n(2590);function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function h(e){h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return h(e)}function E(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e)
;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function y(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function m(e,t){m=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return m(e,t)}var b,g=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function O(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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){
var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var v={};function _(e,t){if(null==b)throw new Error("Creating RTCConnection without session.");var n=l.Z.getLobby(e);if(null==n)throw new Error("Creating RTCConnection without lobby.");var r=n.application_id,o=new s.Z({userId:c.default.getId(),sessionId:b,guildId:e,channelId:t,context:r});o.on("state",(function(t,n,r){a.Z.dispatch(E(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){p(e,t,n[t])}))}return e}({type:"RTC_CONNECTION_STATE",state:t},n,r),{lobbyId:e}))}));o.on("ping",(function(t,n){a.Z.dispatch({type:"RTC_CONNECTION_PING",pings:t,quality:n,lobbyId:e})}));o.on("outboundlossrate",(function(t){a.Z.dispatch({
type:"RTC_CONNECTION_LOSS_RATE",lossRate:t,lobbyId:e})}));return o}function I(){o().forEach(v,(function(e,t){e.destroy();delete v[t]}))}function S(e,t,n){var r=v[e];return null!=r?t(r):n}function T(e){var t=e.lobbyId,n=v[t];if(null==n)return!1;n.destroy();delete v[t]}function N(){return!0}var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&m(e,t)}(n,e);var t=O(n);function n(){d(this,n);return t.apply(this,arguments)}var r=n.prototype;r.forEach=function(e){o().each(v,e)};r.getState=function(e){return S(e,(function(e){return e.state}),f.hes.DISCONNECTED)};r.isConnected=function(e){return this.getState(e)===f.hes.RTC_CONNECTED};r.isDisconnected=function(e){return this.getState(e)===f.hes.DISCONNECTED};r.getHostname=function(e){return S(e,(function(e){return e.hostname}),null)};r.getQuality=function(e){
return S(e,(function(e){return e.quality}),f.IE4.UNKNOWN)};r.getPings=function(e){return S(e,(function(e){return e.getPings()}),[])};r.getAveragePing=function(e){return S(e,(function(e){return e.getAveragePing()}),0)};r.getLastPing=function(e){return S(e,(function(e){return e.getLastPing()}),0)};r.getOutboundLossRate=function(e){return S(e,(function(e){return e.getOutboundLossRate()}),0)};r.getMediaSessionId=function(e){return S(e,(function(e){return e.getMediaSessionId()}),null)};r.getRTCConnectionId=function(e){return S(e,(function(e){return e.getRTCConnectionId()}),null)};r.getDuration=function(e){return S(e,(function(e){return e.getDuration()}),0)};r.__getLocalVars=function(){return{sessionId:b,rtcConnections:v}};return n}(i.ZP.Store);A.displayName="RTCConnectionStore";const C=new A(a.Z,u.Z.isSupported()?{CONNECTION_OPEN:function(e){b=e.sessionId;I()},CONNECTION_CLOSED:function(){b=null;I()},RTC_CONNECTION_STATE:N,RTC_CONNECTION_PING:N,RTC_CONNECTION_LOSS_RATE:N,
RTC_CONNECTION_UPDATE_ID:function(e){return o().some(v,(function(t){return t===e.connection}))},LOBBY_VOICE_STATE_UPDATE:function(e){if(c.default.getId()!==e.userId)return!1;if(e.sessionId!==b)return!1;var t=v[e.lobbyId];if(null!=t&&null==e.channelId){t.destroy();delete v[e.lobbyId]}else if(null!=t)t.channelId=e.channelId;else if(null!=e.channelId){t=_(e.lobbyId,e.channelId);v[e.lobbyId]=t}},LOBBY_VOICE_SERVER_UPDATE:function(e){var t=v[e.lobbyId];if(null==t)return!1;t.connect(e.endpoint,e.token)},LOBBY_DELETE:T,LOBBY_DISCONNECT:T}:{})},694444:(e,t,n)=>{"use strict";n.d(t,{Z:()=>O});var r=n(496486),o=n.n(r),i=n(541554),a=n(202351),s=n(744564);function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1;r.configurable=!0;"value"in r&&(r.writable=!0);Object.defineProperty(e,r.key,r)}}function u(e){u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){
return e.__proto__||Object.getPrototypeOf(e)};return u(e)}function f(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e,t){d=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return d(e,t)}var p=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};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{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return f(this,n)}}var E=!1,y=[],m="",b={viewNonce:"",regenerateNonce:""};var g=function(e){!function(e,t){
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&d(e,t)}(n,e);var t=h(n);function n(){c(this,n);return t.apply(this,arguments)}var r=n.prototype;r.getVerificationKey=function(){return m};r.getBackupCodes=function(){return y};r.getNonces=function(){return b};r.__getLocalVars=function(){return{togglingSMS:E,backupCodes:y,verificationKey:m,backupCodesNonces:b}};!function(e,t,n){t&&l(e.prototype,t);n&&l(e,n)}(n,[{key:"togglingSMS",get:function(){return E}}]);return n}(a.ZP.Store);g.displayName="MFAStore";const O=new g(s.Z,{MFA_ENABLE_SUCCESS:function(e){var t=e.token,n=e.codes;i.Z.setToken(t);y=n},MFA_DISABLE_SUCCESS:function(e){var t=e.token;i.Z.setToken(t)},MFA_SMS_TOGGLE:function(){E=!0},MFA_SMS_TOGGLE_COMPLETE:function(){E=!1},MFA_CLEAR_BACKUP_CODES:function(){y=[]},MFA_VIEW_BACKUP_CODES:function(e){var t=e.codes,n=e.key
;y=o().sortBy(t,"code");m=n},MFA_SEND_VERIFICATION_KEY:function(e){var t=e.nonces;b=t}})},108106:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(785893),o=n(667294),i=n(294184),a=n.n(i),s=n(693959),c=n.n(s);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function f(e){f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return f(e)}function d(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))
;return e}function p(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function h(e,t){return!t||"object"!==y(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function E(e,t){E=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return E(e,t)}var y=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};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{
Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=f(e);if(t){var o=f(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h(this,n)}}var b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&E(e,t)}(n,e);var t=m(n);function n(){l(this,n);return t.apply(this,arguments)}n.prototype.render=function(){var e,t=this.props,n=t.tag,o=t.children,i=t.hoverText,s=t.className,l=t.forceHover,f=p(t,["tag","children","hoverText","className","forceHover"]);return(0,r.jsxs)("div",d(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){
return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){u(e,t,n[t])}))}return e}({},f),{className:a()(s,c().hoverRoll,(e={},u(e,c().disabled,null==i),u(e,c().forceHover,l),e)),children:[(0,r.jsx)(n,{className:c().hovered,children:i}),(0,r.jsx)(n,{className:c().default,children:o})]}))};return n}(o.PureComponent);b.defaultProps={tag:"div",forceHover:!1};const g=b},399370:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(785893),o=(n(667294),n(294184)),i=n.n(o),a=n(707961),s=n(794921),c=n.n(s);function l(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){l(e,t,n[t])}))}return e}function f(e,t){t=null!=t?t:{}
;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function d(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function p(e){
var t,n=e.padded,o=void 0===n||n,s=e.inset,p=void 0!==s&&s,h=e.active,E=void 0!==h&&h,y=e.className,m=e.children,b=e.onClick,g=d(e,["padded","inset","active","className","children","onClick"]);if(null!=b){var O;return(0,r.jsx)(a.P3F,f(u({onClick:b,tabIndex:null!=b?0:-1,className:i()(y,(O={},l(O,c().outer,!p),l(O,c().inset,p),l(O,c().padded,o),l(O,c().active,E),l(O,c().interactive,null!=b),O))},g),{children:m}))}return(0,r.jsx)("div",f(u({className:i()(y,(t={},l(t,c().outer,!p),l(t,c().inset,p),l(t,c().padded,o),l(t,c().active,E),t))},g),{children:m}))}},912250:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(785893),o=(n(667294),n(633878));function i(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function a(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e)
;t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function c(e){var t=e.color,n=void 0===t?"currentColor":t,c=e.height,l=void 0===c?24:c,u=e.width,f=void 0===u?24:u,d=s(e,["color","height","width"]);return(0,r.jsx)("svg",a(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){
return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){i(e,t,n[t])}))}return e}({},(0,o.Z)(d)),{width:f,height:l,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.2929 9.8299L19.9409 9.18278C21.353 7.77064 21.353 5.47197 19.9409 4.05892C18.5287 2.64678 16.2292 2.64678 14.817 4.05892L14.1699 4.70694L19.2929 9.8299ZM12.8962 5.97688L5.18469 13.6906L10.3085 18.813L18.0201 11.0992L12.8962 5.97688ZM4.11851 20.9704L8.75906 19.8112L4.18692 15.239L3.02678 19.8796C2.95028 20.1856 3.04028 20.5105 3.26349 20.7337C3.48669 20.9569 3.8116 21.046 4.11851 20.9704Z",fill:n})}))}},319463:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(785893),o=(n(667294),n(633878));function i(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function a(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){
var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function c(e){var t=e.width,n=void 0===t?16:t,c=e.height,l=void 0===c?16:c,u=e.color,f=void 0===u?"currentColor":u,d=e.className,p=e.foreground,h=s(e,["width","height","color","className","foreground"]);return(0,r.jsx)("svg",a(function(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){i(e,t,n[t])}))}return e}({className:d,width:n,height:l,viewBox:"0 0 16 16"},(0,o.Z)(h)),{children:(0,r.jsxs)("g",{fill:"none",fillRule:"evenodd",children:[(0,r.jsx)("path",{className:p,fill:f,
d:"M0,1.99406028 C0,0.892771196 0.894513756,0 1.99406028,0 L14.0059397,0 C15.1072288,0 16,0.894513756 16,1.99406028 L16,14.0059397 C16,15.1072288 15.1054862,16 14.0059397,16 L1.99406028,16 C0.892771196,16 0,15.1054862 0,14.0059397 L0,1.99406028 Z M8.23182341,16 L10.3991764,16 L10.3991764,9.93141161 L12.5663127,9.93141161 L13,7.76405862 L10.3991764,7.76405862 L10.3246195,6.3468265 C10.3246195,5.66107601 10.5049432,5.17342158 11.4698488,5.17342158 L12.974642,5.17385505 L12.974642,3.12202197 C12.7618079,3.09319618 12.3142495,3 11.4644304,3 C9.69001851,3 8.18500859,4.20353112 8.18500859,6.23043964 L8.23182341,7.76405862 L6.06425368,7.76405862 L6.06425368,9.93141161 L8.23182341,9.93141161 L8.23182341,16 Z"}),(0,r.jsx)("rect",{width:"16",height:"16"})]})}))}},750349:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(785893),o=(n(667294),n(633878));function i(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function a(e,t){
t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function c(e){
var t=e.width,n=void 0===t?16:t,c=e.height,l=void 0===c?16:c,u=e.color,f=void 0===u?"currentColor":u,d=e.className,p=e.foreground,h=s(e,["width","height","color","className","foreground"]);return(0,r.jsx)("svg",a(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){i(e,t,n[t])}))}return e}({className:d,xmlns:"http://www.w3.org/2000/svg",width:n,height:l,viewBox:"0 0 16 16"},(0,o.Z)(h)),{children:(0,r.jsxs)("g",{fill:"none",fillRule:"evenodd",children:[(0,r.jsx)("path",{className:p,fill:f,
d:"M4.70012698,0.0531746 C3.84888888,0.092 3.2675238,0.22720635 2.7588254,0.42492063 C2.23292063,0.62926983 1.78692063,0.90273016 1.3422857,1.34733333 C0.89768254,1.79196825 0.62422222,2.23796825 0.41987302,2.76387303 C0.22215872,3.27257143 0.08695238,3.85393651 0.04812698,4.7051746 C0.00920635,5.55819048 0,5.83053968 0,8.00253968 C0,10.1745079 0.00920635,10.4468571 0.04812698,11.299873 C0.08695238,12.1511111 0.22215873,12.7324762 0.41987302,13.2411746 C0.62422222,13.7670794 0.89768254,14.2130794 1.34228572,14.6577143 C1.78692062,15.1023175 2.23292062,15.3757778 2.7588254,15.5801587 C3.2675238,15.7778413 3.8488889,15.9130476 4.70012698,15.951873 C5.55314286,15.9907937 5.82549206,16 7.99749206,16 C10.1694603,16 10.4418095,15.9907937 11.2948254,15.951873 C12.1460635,15.9130476 12.7274286,15.7778413 13.236127,15.5801587 C13.7620317,15.3757778 14.2080317,15.1023175 14.6526667,14.6577143 C15.0972698,14.2130794 15.3707302,13.7670794 15.5751111,13.2411746 C15.7727937,12.7324762 15.908,12.1511111 15.9468254,11.299873 C15.985746,10.4468571 15.9949524,10.1745079 15.9949524,8.00253968 C15.9949524,5.83053968 15.985746,5.55819048 15.9468254,4.7051746 C15.908,3.8539365 15.7727937,3.27257143 15.5751111,2.76387302 C15.3707302,2.23796825 15.0972698,1.79196825 14.6526667,1.34733332 C14.2080317,0.90273016 13.7620317,0.62926984 13.236127,0.42492064 C12.7274286,0.22720634 12.1460635,0.092 11.2948254,0.0531746 C10.4418095,0.01425397 10.1694603,0.00504762 7.99749206,0.00504762 C5.82549206,0.00504762 5.55314286,0.01425397 4.70012698,0.0531746 L4.70012698,0.0531746 Z M8.00001453,2.00504762 C9.95416635,2.00504762 10.185649,2.01251386 10.9573741,2.04772432 C11.6709381,2.08026206 12.0584565,2.19948958 12.3163471,2.29971739 C12.6579641,2.43248289 12.9017646,2.59107525 13.157854,2.84719363 C13.4139723,3.10328295 13.5725647,3.34708347 13.7053302,3.68870053 C13.805558,3.94659105 13.9247856,4.33410953 13.9573233,5.04767346 C13.9925338,5.8193986 14,6.05088127 14,8.00506213 C14,9.95921396 13.9925338,10.1906966 13.9573233,10.9624217 C13.9247856,11.6759857 13.805558,12.0635042 13.7053302,12.3213947 C13.5725647,12.6630117 13.4139723,12.9068123 13.157854,13.1629016 C12.9017646,13.41902 12.6579641,13.5776123 12.3163471,13.7103779 C12.0584565,13.8106057 11.6709381,13.9298332 10.9573741,13.9623709 C10.1857652,13.9975814 9.9543116,14.0050476 8.00001453,14.0050476 C6.04568839,14.0050476 5.81426383,13.9975814 5.04262587,13.9623709 C4.32906195,13.9298332 3.94154347,13.8106057 3.68365294,13.7103779 C3.34203588,13.5776123 3.09823536,13.41902 2.84214604,13.1629016 C2.58605671,12.9068123 2.42743531,12.6630117 2.29466977,12.3213947 C2.19444197,12.0635042 2.07521444,11.6759857 2.04267671,10.9624217 C2.00746628,10.1906966 2,9.95921395 2,8.00506212 C2,6.05088125 2.00746625,5.81939858 2.0426767,5.04767347 C2.07521444,4.33410953 2.19444196,3.94659104 2.29466977,3.68870052 C2.42743531,3.34708346 2.58602767,3.10328294 2.84214604,2.84719362 C3.09823536,2.59107524 3.34203588,2.43248288 3.68365294,2.29971735 C3.94154346,2.19948953 4.32906194,2.08026201 5.04262587,2.04772428 C5.81435097,2.01251381 6.04583365,2.00504758 8.00001453,2.00504758 L8.00001453,2.00504762 Z"
}),(0,r.jsx)("path",{className:p,fill:f,d:"M8.0000119,10 C6.89542535,10 6,9.10457466 6,8.0000119 C6,6.89542535 6.89542534,6 8.0000119,6 C9.10457467,6 10,6.89542534 10,8.0000119 C10,9.10457467 9.10457466,10 8.0000119,10 L8.0000119,10 Z M8.00001546,4 C5.7908468,4 4,5.7908468 4,8.00001546 C4,10.2091532 5.7908468,12 8.00001546,12 C10.2091532,12 12,10.2091532 12,8.00001546 C12,5.7908468 10.2091532,4 8.00001546,4 L8.00001546,4 Z M13,4.00001654 C13,4.55230644 12.5522734,5 11.9999835,5 C11.4477266,5 11,4.55230645 11,4.00001654 C11,3.44772664 11.4477266,3 11.9999835,3 C12.5522734,3 13,3.44772663 13,4.00001654 L13,4.00001654 Z"}),(0,r.jsx)("rect",{width:"16",height:"16"})]})}))}},416044:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(785893),o=(n(667294),n(633878));function i(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function a(e,t){t=null!=t?t:{}
;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function c(e){var t=e.width,n=void 0===t?24:t,c=e.height,l=void 0===c?24:c,u=e.color,f=void 0===u?"currentColor":u,d=e.foreground,p=s(e,["width","height","color","foreground"]);return(0,
r.jsx)("svg",a(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){i(e,t,n[t])}))}return e}({},(0,o.Z)(p)),{width:n,height:l,viewBox:"0 0 24 24",children:(0,r.jsxs)("g",{fill:"none",fillRule:"evenodd",children:[(0,r.jsx)("path",{className:d,fill:f,d:"M8.67872 19H11V21H7V23H17V21H13V19H20C21.103 19 22 18.104 22 17V6C22 5.89841 21.9924 5.79857 21.9777 5.70101L20 7.67872V15H12.6787L8.67872 19ZM13.1496 6H4V15H4.14961L2.00515 17.1445C2.00174 17.0967 2 17.0486 2 17V6C2 4.897 2.897 4 4 4H15.1496L13.1496 6Z"}),(0,r.jsx)("rect",{x:"2",y:"20",width:"26",height:"2",transform:"rotate(-45 2 20)",fill:"#ed4245"})]})}))}},382518:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(785893),o=(n(667294),n(633878));function i(e,t,n){
t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function a(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function c(e){
var t=e.width,n=void 0===t?24:t,c=e.height,l=void 0===c?24:c,u=e.color,f=void 0===u?"currentColor":u,d=e.className,p=e.foreground,h=s(e,["width","height","color","className","foreground"]);return(0,r.jsx)("svg",a(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){i(e,t,n[t])}))}return e}({},(0,o.Z)(h)),{className:d,width:n,height:l,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{className:p,fill:f,fillRule:"evenodd",clipRule:"evenodd",
d:"M17.722 3.00098H21C21.553 3.00098 22 3.44898 22 4.00098V8.00098C22 8.30498 21.861 8.59298 21.625 8.78198L16.696 12.724C15.794 13.86 14.49 14.659 13 14.911V16.001H15C15.553 16.001 16 16.449 16 17.001V19.001H8V17.001C8 16.449 8.447 16.001 9 16.001H11V14.911C9.51 14.659 8.206 13.86 7.304 12.724L2.375 8.78198C2.139 8.59298 2 8.30498 2 8.00098V4.00098C2 3.44898 2.447 3.00098 3 3.00098H6.278C6.625 2.40598 7.263 2.00098 8 2.00098H16C16.738 2.00098 17.375 2.40598 17.722 3.00098ZM4 5.00098V7.52098L6.006 9.12598C6.006 9.10435 6.00448 9.08348 6.00297 9.06274C6.00148 9.04224 6 9.02185 6 9.00098V5.00098H4ZM17.994 9.12698L20 7.52098V5.00098H18V9.00098C18 9.02173 17.9985 9.042 17.9971 9.0625C17.9955 9.08349 17.994 9.10472 17.994 9.12698ZM7 20.001H17V22.001H7V20.001Z"})}))}},313197:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(785893),o=(n(667294),n(633878));function i(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function a(e,t){
t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){n=i[r];t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function c(e){
var t=e.width,n=void 0===t?20:t,c=e.height,l=void 0===c?16:c,u=e.color,f=void 0===u?"currentColor":u,d=e.className,p=e.foreground,h=s(e,["width","height","color","className","foreground"]);return(0,r.jsx)("svg",a(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){i(e,t,n[t])}))}return e}({className:d,width:n,height:l,viewBox:"0 0 20 16"},(0,o.Z)(h)),{children:(0,r.jsxs)("g",{fill:"none",fillRule:"evenodd",children:[(0,r.jsx)("path",{className:p,fill:f,
d:"M1,14.1538462 L1.95,14.1538462 C3.73125,14.1538462 5.5125,13.5384615 6.81875,12.4307692 C5.15625,12.4307692 3.73125,11.2 3.1375,9.6 C3.375,9.6 3.6125,9.72307692 3.85,9.72307692 C4.20625,9.72307692 4.5625,9.72307692 4.91875,9.6 C3.1375,9.23076923 1.7125,7.63076923 1.7125,5.66153846 C2.1875,5.90769231 2.78125,6.15384615 3.49375,6.15384615 C2.425,5.41538462 1.83125,4.18461538 1.83125,2.70769231 C1.83125,1.96923077 2.06875,1.23076923 2.30625,0.615384615 C4.20625,3.07692308 7.05625,4.67692308 10.38125,4.8 C10.2625,4.67692308 10.2625,4.30769231 10.2625,4.06153846 C10.2625,1.84615385 12.04375,0 14.18125,0 C15.25,0 16.31875,0.492307692 17.03125,1.23076923 C17.8625,1.10769231 18.8125,0.738461538 19.525,0.246153846 C19.2875,1.23076923 18.575,1.96923077 17.8625,2.46153846 C18.575,2.46153846 19.2875,2.21538462 20,1.84615385 C19.525,2.70769231 18.8125,3.32307692 18.1,3.93846154 L18.1,4.43076923 C18.1,9.84615385 14.18125,16 6.9375,16 C4.68125,16 2.6625,15.3846154 1,14.1538462 Z"}),(0,
r.jsx)("rect",{width:"20",height:"16"})]})}))}},555445:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(496486),o=n.n(r),i=n(113609),a=n(821229),s=n(749106);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e,t)||function(){
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e){var t=!0,n=!1,r=void 0;try{for(var o,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var s=o.value,c=a.Z.getEligibleExperiment(s);if(null!=c)return[s,c]}}catch(e){n=!0;r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return null}const f={getFirstEligibleUserExperiment:u,isInExperimentBucket:function(e,t){return a.Z.getExperimentBucket(e)===t},experimentDescriptorEquals:function(e,t){if(null==e&&null==t)return!0;if(e===t)return!0;if(null==e&&null!=t)return!1;if(null!=e&&null==t)return!1;if(null!=e&&null!=t){if(e.type!==t.type)return!1;if(e.bucket!==t.bucket)return!1;if(e.revision!==t.revision)return!1;if(e.type===s.x.USER&&t.type===s.x.USER)return o().isEqual(e.context,t.context)}return!0},trackExposureToFirstEligibleUserExperiment:function(e){var t=u(e);if(null!=t){
var n=l(t,2),r=n[0],o=n[1];(0,i.W9)(r,o);return o}},getExperimentBucketName:function(e){return e===s.N.CONTROL?"Control":e===s.N.NOT_ELIGIBLE?"Not Eligible":"Treatment ".concat(e)}}},635535:(e,t,n)=>{"use strict";n.d(t,{uj:()=>c,tI:()=>l,X8:()=>u});var r=n(441143),o=n.n(r),i=n(2590),a=n(473708);function s(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var c=function(){var e=Object.keys(i.gkr);return e[Math.floor(Math.random()*e.length)]},l=function(){
var e=[i.gkr.HOUSE_1,i.gkr.HOUSE_2,i.gkr.HOUSE_3,i.jsM],t=[a.Z.Messages.HYPESQUAD_QUESTION_0_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_1_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_2_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_3_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_4_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_5_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_6_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_7_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_8_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_9_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_10_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_11_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_12_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_13_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_14_PROMPT],n=[[a.Z.Messages.HYPESQUAD_QUESTION_0_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_0_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_0_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_0_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_1_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_1_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_1_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_1_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_2_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_2_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_2_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_2_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_3_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_3_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_3_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_3_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_4_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_4_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_4_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_4_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_5_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_5_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_5_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_5_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_6_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_6_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_6_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_6_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_7_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_7_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_7_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_7_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_8_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_8_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_8_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_8_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_9_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_9_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_9_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_9_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_10_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_10_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_10_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_10_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_11_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_11_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_11_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_11_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_12_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_12_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_12_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_12_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_13_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_13_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_13_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_13_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_14_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_14_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_14_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_14_RESPONSE_D]]
;return function(){for(var e=[];e.length<5;){var t=Math.floor(15*Math.random());e.includes(t)||e.push(t)}return e}().map((function(r){var i=t[r],a=n[r];o()(null!=i&&null!=a,"Invalid HypeSquad quiz question index");return{prompt:i,options:a.map((function(t,n){var r=e[n];o()(null!==r,"Invalid HypeSquad quiz question option index");return{copy:t,house:r}}))}}))},u=function(e){var t;return(s(t={},i.gkr.HOUSE_1,a.Z.Messages.HYPESQUAD_HOUSE_1),s(t,i.gkr.HOUSE_2,a.Z.Messages.HYPESQUAD_HOUSE_2),s(t,i.gkr.HOUSE_3,a.Z.Messages.HYPESQUAD_HOUSE_3),t)[e]}},786502:(e,t,n)=>{"use strict";n.d(t,{bm:()=>O,an:()=>_,rh:()=>I,Sz:()=>S,Vg:()=>R,ZP:()=>x});var r,o=n(213192),i=n.n(o),a=n(258104),s=n(61209),c=n(21372),l=n(717091),u=n(840922),f=n(473903),d=n(796909),p=n(504275),h=n(2590),E=n(718634),y=n(473708);function m(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function b(e){for(var t=1;t<arguments.length;t++){
var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))));r.forEach((function(t){m(e,t,n[t])}))}return e}function g(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}r=n(218146);var O=i()({GROUP_DM:null,DM:null,FRIEND:null}),v=function(e,t){return null!=e&&c.ZP.isMember(e,t)};function _(e,t,n,r,o){var i=new Set,a=[],c={numFriends:0,numDms:0,numGroupDms:0,numGuildMembers:0};if(""===e){var E={omitUserIds:t,maxRowsWithoutQuery:r,
guildId:o,shownUserIds:i,rows:a,counts:c};!function(e){var t=e.omitUserIds,n=e.suggestedUserIds,r=e.maxRowsWithoutQuery,o=e.guildId,i=e.shownUserIds,a=e.rows,s=e.counts;if(null!=n){var c=!0,l=!1,u=void 0;try{for(var d,p=n[Symbol.iterator]();!(c=(d=p.next()).done);c=!0){var h=d.value;if(null!=r&&r>0&&a.length>=r)break;if(!t.has(h)){var E=f.default.getUser(h);if(null!=E&&!v(o,E.id)){i.add(E.id);a.push({type:O.FRIEND,item:E,isSuggested:!0});s.numFriends++}}}}catch(e){l=!0;u=e}finally{try{c||null==p.return||p.return()}finally{if(l)throw u}}}}(g(b({},E),{suggestedUserIds:n}));!function(e){var t=e.omitUserIds,n=e.maxRowsWithoutQuery,r=e.guildId,o=e.shownUserIds,i=e.rows,a=e.counts,c=e.includeGroupDms,u=!0,p=!1,E=void 0;try{for(var y,m=d.Z.getPrivateChannelIds()[Symbol.iterator]();!(u=(y=m.next()).done);u=!0){var b=y.value;if(null!=n&&n>0&&i.length>=n)break;var g=s.Z.getChannel(b);if(null!=g&&g.isPrivate())if(c&&g.type===h.d4z.GROUP_DM){i.push({type:O.GROUP_DM,item:g,isSuggested:!1})
;a.numGroupDms++}else if(null!=l.ZP.lastMessageId(g.id)){var _=g.getRecipientId();if(null!=_&&!t.has(_)&&!o.has(_)){var I=f.default.getUser(_);if(null==I||I.bot||v(r,I.id))continue;o.add(I.id);i.push({type:O.DM,item:I,isSuggested:!1});a.numDms++}}}}catch(e){p=!0;E=e}finally{try{u||null==m.return||m.return()}finally{if(p)throw E}}}(g(b({},E),{includeGroupDms:!0}));!function(e){var t=e.omitUserIds,n=e.maxRowsWithoutQuery,r=e.guildId,o=e.shownUserIds,i=e.rows,a=e.counts,s=!0,c=!1,l=void 0;try{for(var d,p=u.Z.getFriendIDs()[Symbol.iterator]();!(s=(d=p.next()).done);s=!0){var h=d.value;if(null!=n&&n>0&&i.length>=n)break;if(!t.has(h)&&!o.has(h)){var E=f.default.getUser(h);if(null!=E&&!v(r,E.id)){i.push({type:O.FRIEND,item:E,isSuggested:!1});a.numFriends++}}}}catch(e){c=!0;l=e}finally{try{s||null==p.return||p.return()}finally{if(c)throw l}}}(E)}else{var y={query:e,rows:a,counts:c};!function(e){var t=e.query,n=e.omitUserIds,r=e.shownUserIds,o=e.rows,i=e.counts;p.ZP.queryDMUsers({query:t,
limit:50}).forEach((function(e){var t=e.record;if(!n.has(t.id)){var a=s.Z.getDMFromUserId(t.id);if(null!=a&&null!=l.ZP.lastMessageId(a)){r.add(t.id);o.push({type:O.DM,item:t,isSuggested:!1});i.numDms++}}}))}(g(b({},y),{omitUserIds:t,shownUserIds:i}));!function(e){var t=e.query,n=e.rows,r=e.counts;p.ZP.queryGroupDMs({query:t,limit:50,fuzzy:!1}).forEach((function(e){var t=e.record;n.push({type:O.GROUP_DM,item:t,isSuggested:!1});r.numGroupDms++}))}(y);!function(e){var t=e.query,n=e.rows,r=e.counts,o=e.omitUserIds,i=e.shownUserIds;p.ZP.queryFriends({query:t,limit:500,_fuzzy:!1}).forEach((function(e){var t=e.record;if(!o.has(t.id)&&!i.has(t.id)){i.add(t.id);n.push({type:O.FRIEND,item:t,isSuggested:!1});r.numFriends++}}))}(g(b({},y),{omitUserIds:t,shownUserIds:i}))}return{rows:a,counts:c}}function I(e,t){var n=!0,r=!1,o=void 0;try{for(var i,a=d.Z.getPrivateChannelIds()[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var c=i.value,u=s.Z.getChannel(c)
;if(null!=u&&u.isDM()&&null!=l.ZP.lastMessageId(u.id)){var p=u.getRecipientId();if(null!=p&&!e.has(p)){var h=f.default.getUser(p);if(null==h||h.bot||v(t,h.id))continue;return h}}}}catch(e){r=!0;o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return null}function S(e){var t=e.channel,n=e.inviteTargetType,r=e.applicationId;if(n===E.Iq.EMBEDDED_APPLICATION)if(null!=t){var o=!0,i=!1,s=void 0;try{for(var c,l=a.ZP.getEmbeddedActivitiesForChannel(t.id)[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var u=c.value;if(u.application_id===r)return new Set(u.connections.keys())}}catch(e){i=!0;s=e}finally{try{o||null==l.return||l.return()}finally{if(i)throw s}}}return new Set}var T,N="minutes",A="hours",C="days",P="never",j=(m(T={},r.INVITE_OPTIONS_30_MINUTES.value,{value:30,type:N}),m(T,r.INVITE_OPTIONS_1_HOUR.value,{value:1,type:A}),m(T,r.INVITE_OPTIONS_6_HOURS.value,{value:6,type:A}),m(T,r.INVITE_OPTIONS_12_HOURS.value,{value:12,type:A}),m(T,r.INVITE_OPTIONS_1_DAY.value,{
value:1,type:C}),m(T,r.INVITE_OPTIONS_7_DAYS.value,{value:7,type:C}),m(T,r.INVITE_OPTIONS_FOREVER.value,{value:0,type:P}),T);function R(e,t){var n=parseInt(t,10),r=0===n,o=j[e].value;switch(j[e].type){case N:return r?y.Z.Messages.INVITE_EXPIRES_MINUTES:y.Z.Messages.INVITE_EXPIRES_MINUTES_OR_USES.format({numUses:n});case A:return r?y.Z.Messages.INVITE_EXPIRES_HOURS.format({numHours:o}):y.Z.Messages.INVITE_EXPIRES_HOURS_OR_USES.format({numHours:o,numUses:n});case C:return r?y.Z.Messages.INVITE_EXPIRES_DAYS_PLURAL.format({numDays:o}):y.Z.Messages.INVITE_EXPIRES_DAYS_OR_USES_PLURAL.format({numDays:o,numUses:n});case P:return r?y.Z.Messages.INVITE_EXPIRES_NEVER:y.Z.Messages.INVITE_EXPIRES_USES.format({numUses:n});default:return""}}const x={getMaxAgeOptions:r.MAX_AGE_OPTIONS,getMaxUsesOptions:r.MAX_USES_OPTIONS,INVITE_OPTIONS_FOREVER:r.INVITE_OPTIONS_FOREVER,INVITE_OPTIONS_1_DAY:r.INVITE_OPTIONS_1_DAY,INVITE_OPTIONS_7_DAYS:r.INVITE_OPTIONS_7_DAYS,
INVITE_OPTIONS_12_HOURS:r.INVITE_OPTIONS_12_HOURS,INVITE_OPTIONS_6_HOURS:r.INVITE_OPTIONS_6_HOURS,INVITE_OPTIONS_1_HOUR:r.INVITE_OPTIONS_1_HOUR,INVITE_OPTIONS_30_MINUTES:r.INVITE_OPTIONS_30_MINUTES,INVITE_OPTIONS_UNLIMITED:r.INVITE_OPTIONS_UNLIMITED,INVITE_OPTIONS_ONCE:r.INVITE_OPTIONS_ONCE,INVITE_OPTIONS_5_TIMES:r.INVITE_OPTIONS_5_TIMES,INVITE_OPTIONS_10_TIMES:r.INVITE_OPTIONS_10_TIMES,INVITE_OPTIONS_25_TIMES:r.INVITE_OPTIONS_25_TIMES,INVITE_OPTIONS_50_TIMES:r.INVITE_OPTIONS_50_TIMES,INVITE_OPTIONS_100_TIMES:r.INVITE_OPTIONS_100_TIMES}},987594:(e,t,n)=>{"use strict";n.d(t,{YK:()=>d,gl:()=>p,_o:()=>h,rr:()=>E,bL:()=>y,$6:()=>m,g0:()=>l,ac:()=>b,xH:()=>g});var r=n(769321),o=n(837067),i=n(567403),a=(n(652591),n(2590)),s=n(473708);function c(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var l,u,f=864e5*a.eBq;function d(){var e=r.h2.getSetting();0===o.Z.totalUnavailableGuilds&&(e=e.filter((function(e){
return null!=i.Z.getGuild(e)})));return e}function p(){var e=r.zA.getSetting();0===o.Z.totalUnavailableGuilds&&(e=e.filter((function(e){return null!=i.Z.getGuild(e)})));return e}function h(){var e=r.SE.getSetting();0===o.Z.totalUnavailableGuilds&&(e=e.filter((function(e){return null!=i.Z.getGuild(e)})));return e}function E(){var e=r.iH.getSetting();0===o.Z.totalUnavailableGuilds&&(e=e.filter((function(e){return null!=i.Z.getGuild(e)})));return e}function y(e){return(e&a.HGf)===a.HGf?{all:!0,mutualFriends:!0,mutualGuilds:!0}:{all:!1,mutualFriends:(e&a.SOq.MUTUAL_FRIENDS)===a.SOq.MUTUAL_FRIENDS,mutualGuilds:(e&a.SOq.MUTUAL_GUILDS)===a.SOq.MUTUAL_GUILDS}}function m(e,t){return!t.verified||null!=e&&f>Date.now()-new Date(e.created_at).getTime()}!function(e){e[e.UNDECIDED=0]="UNDECIDED";e[e.OPTIN=1]="OPTIN";e[e.OPTOUT=2]="OPTOUT"}(l||(l={}));var b=(c(u={},l.UNDECIDED,void 0),c(u,l.OPTIN,!0),c(u,l.OPTOUT,!1),u);function g(){return[{
name:s.Z.Messages.PRIVACY_SETTINGS_NON_SPAM_RETRAINING_SETTING_OPT_IN_HEADER,desc:s.Z.Messages.PRIVACY_SETTINGS_NON_SPAM_RETRAINING_SETTING_OPT_IN_DESC,value:l.OPTIN},{name:s.Z.Messages.PRIVACY_SETTINGS_NON_SPAM_RETRAINING_SETTING_OPT_OUT_HEADER,desc:s.Z.Messages.PRIVACY_SETTINGS_NON_SPAM_RETRAINING_SETTING_OPT_OUT_DESC,value:l.OPTOUT},{name:s.Z.Messages.PRIVACY_SETTINGS_NON_SPAM_RETRAINING_SETTING_UNSET_HEADER,desc:s.Z.Messages.PRIVACY_SETTINGS_NON_SPAM_RETRAINING_SETTING_UNSET_DESC,value:l.UNDECIDED}]}},218146:(e,t,n)=>{"use strict";n.r(t);n.d(t,{INVITE_OPTIONS_UNLIMITED:()=>i,INVITE_OPTIONS_ONCE:()=>a,INVITE_OPTIONS_5_TIMES:()=>s,INVITE_OPTIONS_10_TIMES:()=>c,INVITE_OPTIONS_25_TIMES:()=>l,INVITE_OPTIONS_50_TIMES:()=>u,INVITE_OPTIONS_100_TIMES:()=>f,MAX_USES_OPTIONS:()=>d,INVITE_OPTIONS_30_MINUTES:()=>p,INVITE_OPTIONS_1_HOUR:()=>h,INVITE_OPTIONS_6_HOURS:()=>E,INVITE_OPTIONS_12_HOURS:()=>y,INVITE_OPTIONS_1_DAY:()=>m,INVITE_OPTIONS_7_DAYS:()=>b,INVITE_OPTIONS_FOREVER:()=>g,
MAX_AGE_OPTIONS:()=>O});var r=n(473708);function o(e,t){return{value:e,get label(){return t()}}}var i=o(0,(function(){return r.Z.Messages.MAX_USES.format({maxUses:0})})),a=o(1,(function(){return r.Z.Messages.MAX_USES.format({maxUses:1})})),s=o(5,(function(){return r.Z.Messages.MAX_USES.format({maxUses:5})})),c=o(10,(function(){return r.Z.Messages.MAX_USES.format({maxUses:10})})),l=o(25,(function(){return r.Z.Messages.MAX_USES.format({maxUses:25})})),u=o(50,(function(){return r.Z.Messages.MAX_USES.format({maxUses:50})})),f=o(100,(function(){return r.Z.Messages.MAX_USES.format({maxUses:100})})),d=[i,a,s,c,l,u,f],p=o(1800,(function(){return r.Z.Messages.DURATION_MINUTES.format({minutes:30})})),h=o(3600,(function(){return r.Z.Messages.DURATION_HOURS.format({hours:1})})),E=o(21600,(function(){return r.Z.Messages.DURATION_HOURS.format({hours:6})})),y=o(43200,(function(){return r.Z.Messages.DURATION_HOURS.format({hours:12})})),m=o(86400,(function(){return r.Z.Messages.DURATION_DAYS.format({
days:1})})),b=o(604800,(function(){return r.Z.Messages.DURATION_DAYS.format({days:7})})),g=o(0,(function(){return r.Z.Messages.MAX_AGE_NEVER})),O=[p,h,E,y,m,b,g]}}]);
//# sourceMappingURL=ab1ce7821b551424c922.js.map