forked from ChrisEric1/assets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
030acb8f488a2c9fca6c.js
executable file
·8 lines (8 loc) · 6.18 KB
/
030acb8f488a2c9fca6c.js
1
2
3
4
5
6
7
8
"use strict";(this.webpackChunkdiscord_app=this.webpackChunkdiscord_app||[]).push([[43895],{843895:(e,t,r)=>{r.r(t);r.d(t,{default:()=>g});var n=r(785893),a=r(667294),l=r(363010),s=r(331535),o=r(810574),i=r(859023),u=r(617781),c=r(272729),d=r(719455),f=r(67416),h=r(112712),I=r(911324),b=r(932847),m=r(570992),p=r(809096),_=r(461061),C=r(959797),N=r(943799),v=r.n(N);function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function A(e,t,r,n,a,l,s){try{var o=e[l](s),i=o.value}catch(e){r(e);return}o.done?t(i):Promise.resolve(i).then(n,a)}function U(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var l=e.apply(t,r);function s(e){A(l,n,a,s,o,"next",e)}function o(e){A(l,n,a,s,o,"throw",e)}s(void 0)}))}}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,l=[],s=!0,o=!1;try{
for(r=r.call(e);!(s=(n=r.next()).done);s=!0){l.push(n.value);if(t&&l.length===t)break}}catch(e){o=!0;a=e}finally{try{s||null==r.return||r.return()}finally{if(o)throw a}}return l}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return x(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))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 y=function(e,t){var r,n,a,l,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return l={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function o(l){return function(o){return function(l){
if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(a=2&l[0]?n.return:l[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,l[1])).done)return a;(n=0,a)&&(l=[2&l[0],a.value]);switch(l[0]){case 0:case 1:a=l;break;case 4:s.label++;return{value:l[1],done:!1};case 5:s.label++;n=l[1];l=[0];continue;case 7:l=s.ops.pop();s.trys.pop();continue;default:if(!(a=s.trys,a=a.length>0&&a[a.length-1])&&(6===l[0]||2===l[0])){s=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){s.label=l[1];break}if(6===l[0]&&s.label<a[1]){s.label=a[1];a=l;break}if(a&&s.label<a[2]){s.label=a[2];s.ops.push(l);break}a[2]&&s.ops.pop();s.trys.pop();continue}l=t.call(e,s)}catch(e){l=[6,e];n=0}finally{r=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,o])}}};function E(e){return{value:e,get label(){var t;return null===(t=(0,p.L9)(e))||void 0===t?void 0:t.toLocaleUpperCase()}}}
var O=[E(p.UK.DURATION_60_SEC),E(p.UK.DURATION_5_MIN),E(p.UK.DURATION_10_MIN),E(p.UK.DURATION_1_HOUR),E(p.UK.DURATION_1_DAY),E(p.UK.DURATION_1_WEEK)];function g(e){var t=e.guildId,r=e.userId,N=e.transitionState,x=e.onClose,A=(0,c.Dt)(),E=(0,l.e7)([i.default],(function(){return i.default.getUser(r)}),[r]),g=S(a.useState(p.UK.DURATION_60_SEC),2),D=g[0],M=g[1],L=S(a.useState(""),2),R=L[0],T=L[1],j=S(a.useState(!1),2),k=j[0],w=j[1],Z=a.useCallback(U((function(){return y(this,(function(e){switch(e.label){case 0:if(null==E)return[2];w(!0);e.label=1;case 1:e.trys.push([1,3,4,5]);return[4,o.Z.setCommunicationDisabledDuration(t,r,D,R)];case 2:e.sent();(0,I.CF)((0,h.Yz)(C.Z.Messages.GUILD_COMMUNICATION_DISABLED_SUCCESS.format({user:m.Z.getName(t,null,E)}),h.pC.SUCCESS));x();return[3,5];case 3:e.sent();(0,I.CF)((0,h.Yz)(C.Z.Messages.APPLICATION_STORE_LISTING_PURCHASE_GENERIC_ERROR,h.pC.FAILURE));return[3,5];case 4:w(!1);return[7];case 5:return[2]}}))})),[t,E,r,x,D,R]);a.useEffect((function(){
null!=E&&b.default.track(_.rMx.OPEN_MODAL,{type:p.Cl,guild_id:t,other_user_id:E.id})}),[]);a.useEffect((function(){null!=E&&null!=t||x()}),[t,E,x]);return null==E||null==t?null:(0,n.jsxs)(f.Y0,{transitionState:N,"aria-labelledby":A,children:[(0,n.jsxs)(f.xB,{className:v().header,separator:!1,children:[(0,n.jsx)(s.X6,{id:A,variant:"heading-lg/semibold",children:C.Z.Messages.DISABLE_GUILD_COMMUNICATION_FOR_USER.format({user:m.Z.getName(t,null,E)})}),(0,n.jsx)(s.P3,{onClick:x,className:v().closeButton,"aria-label":C.Z.Messages.CLOSE,children:(0,n.jsx)(d.Z,{className:v().closeIcon,width:16,height:16})})]}),(0,n.jsxs)(f.hz,{className:v().contentContainer,children:[(0,n.jsx)(s.xv,{variant:"text-md/normal",color:"interactive-normal",children:C.Z.Messages.DISABLE_GUILD_COMMUNICATION_BODY_HEADER.format({helpdeskArticle:p.cu})}),(0,n.jsx)(s.xv,{className:v().selectorHeader,variant:"text-xs/semibold",color:"interactive-normal",children:C.Z.Messages.GUILD_COMMUNICATION_DISABLED_DURATION}),(0,
n.jsx)(u.Z,{buttons:O.map((function(e){return function(e,t,r){var a=e.value,l=e.label;return{content:(0,n.jsx)(s.xv,{variant:"text-xs/normal",className:t?v().selectorTextSelected:v().selectorText,children:l}),className:t?v().selectorButtonSelected:v().selectorButton,onClick:function(){return r(a)}}}(e,e.value===D,M)}))}),(0,n.jsx)(s.xv,{className:v().selectorHeader,variant:"text-xs/semibold",color:"interactive-normal",children:C.Z.Messages.GUILD_COMMUNICATION_DISABLED_REASON}),(0,n.jsx)(s.Kx,{value:R,onChange:function(e){return T(e)},placeholder:C.Z.Messages.GUILD_COMMUNICATION_DISABLED_REASON_PLACEHOLDER,rows:2,maxLength:p.GN})]}),(0,n.jsxs)(f.mz,{children:[(0,n.jsx)(s.zx,{onClick:Z,color:s.zx.Colors.BRAND_NEW,submitting:k,children:C.Z.Messages.TIMEOUT_SUBMIT}),(0,n.jsx)(s.zx,{type:"button",look:s.zx.Looks.LINK,color:s.zx.Colors.PRIMARY,onClick:x,children:C.Z.Messages.CANCEL})]})]})}},617781:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(785893),a=(r(667294),
r(294184)),l=r.n(a),s=r(647446),o=r(237702),i=r.n(o),u=function(e){var t=e.data,r=e.disabled,a=t.content,o=t.className,u=t.onClick,c=t.disabled;return(0,n.jsx)(s.tE,{children:(0,n.jsx)("button",{type:"button",className:l()(i().item,o),onClick:u,disabled:r||c,children:a})})};const c=function(e){var t=e.buttons,r=e.disabled,a=e.className;return(0,n.jsx)("div",{role:"group",className:l()(i().group,a),children:t.map((function(e,t){return(0,n.jsx)(u,{data:e,disabled:r},t)}))})}}}]);
//# sourceMappingURL=030acb8f488a2c9fca6c.js.map