forked from ChrisEric1/assets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
00c252bf6f9cbebc8a5a.js
executable file
·10 lines (10 loc) · 8.35 KB
/
00c252bf6f9cbebc8a5a.js
1
2
3
4
5
6
7
8
9
10
"use strict";(this.webpackChunkdiscord_app=this.webpackChunkdiscord_app||[]).push([[38279],{38279:(e,r,t)=>{t.r(r);t.d(r,{default:()=>k});var n=t(785893),s=t(667294),a=t(331535),i=t(579220),o=t(565922),l=(0,t(553494).B)({kind:"user",id:"2023-02_guild_transfer_ownership_verification",label:"Safety Experience Guild Transfer Ownership Verification",defaultConfig:{enabled:!1},treatments:[{id:1,label:"Enabled",config:{enabled:!0}}]});var c=t(7046),u=t(817513),f=t(487502),d=t(67416),h=t(897576),p=t(766936),b=t(226300),R=t(917870),m=t(95467),E=t(570992),y=t(964199),N=t(461061),S=t(959797),O=t(559399),_=t.n(O);function x(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function g(e,r,t,n,s,a,i){try{var o=e[a](i),l=o.value}catch(e){t(e);return}o.done?r(l):Promise.resolve(l).then(n,s)}function v(e){return function(){var r=this,t=arguments;return new Promise((function(n,s){var a=e.apply(r,t);function i(e){g(a,n,s,i,o,"next",e)}function o(e){
g(a,n,s,i,o,"throw",e)}i(void 0)}))}}function j(e,r,t){r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t;return e}function I(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))));n.forEach((function(r){j(e,r,t[r])}))}return e}function T(e,r){r=null!=r?r:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})));t.push.apply(t,n)}return t}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}));return e}function P(e,r){return function(e){
if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,s,a=[],i=!0,o=!1;try{for(t=t.call(e);!(i=(n=t.next()).done);i=!0){a.push(n.value);if(r&&a.length===r)break}}catch(e){o=!0;s=e}finally{try{i||null==t.return||t.return()}finally{if(o)throw s}}return a}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return x(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return x(e,r)}(e,r)||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 w=function(e,r){var t,n,s,a,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},
"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;i;)try{if(t=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;(n=0,s)&&(a=[2&a[0],s.value]);switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:!1};case 5:i.label++;n=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(6===a[0]&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}s[2]&&i.ops.pop();i.trys.pop();continue}a=r.call(e,i)}catch(e){a=[6,e];n=0}finally{t=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,o])}}},A=function(){
var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.default.locale;return"https://".concat(N.xr4,"/hc/").concat(e.toLowerCase(),"/requests/new?ticket_form_id=360000168511")},Z=m.Z.getArticleURL(N.BhN.SERVER_SUBSCRIPTION_OWNERSHIP_TRANSFER);function k(e){var r=e.guild,u=e.toUser,m=e.fromUser,O=e.onClose,x=e.transitionState,g=l.useExperiment({},{autoTrackExposure:!0}).enabled,j=P(s.useState(!1),2),k=j[0],C=j[1],D=r.hasFeature(N.oNc.VERIFIED)||r.hasFeature(N.oNc.PARTNERED),F=D?S.Z.Messages.TRANSFER_OWNERSHIP_PROTECTED_GUILD:null,L=D?S.Z.Messages.TRANSFER_OWNERSHIP_PROTECTED_GUILD_LINK.format({ticketUrl:A()}):null;function M(e){return H.apply(this,arguments)}function H(){return(H=v((function(e){return w(this,(function(t){switch(t.label){case 0:return[4,c.Z.transferOwnership(r.id,u.id,e)];case 1:t.sent();return[2]}}))}))).apply(this,arguments)}function U(){return W.apply(this,arguments)}function W(){return(W=v((function(){return w(this,(function(e){switch(e.label){case 0:
return[4,c.Z.sendTransferOwnershipPincode(r.id)];case 1:e.sent();return[2]}}))}))).apply(this,arguments)}function z(){z=v((function(e){return w(this,(function(s){switch(s.label){case 0:e.preventDefault();O();s.label=1;case 1:s.trys.push([1,6,,7]);return!g||m.mfaEnabled||null==m.email?[3,3]:[4,U()];case 2:s.sent();(0,h.ZD)(v((function(){var e,r;return w(this,(function(s){switch(s.label){case 0:return[4,Promise.all([t.e(40532),t.e(7675)]).then(t.bind(t,807675))];case 1:e=s.sent(),r=e.default;return[2,function(e){return(0,n.jsx)(r,T(I({},e),{onFormSubmit:M,onResend:U,headerText:S.Z.Messages.TRANSFER_OWNERSHIP,confirmButtonText:S.Z.Messages.TRANSFER_OWNERSHIP}))}]}}))})));return[3,5];case 3:return[4,c.Z.transferOwnership(r.id,u.id)];case 4:s.sent();(0,i.xf)();s.label=5;case 5:return[3,7];case 6:s.sent().body.code===N.evJ.NEW_OWNER_INELIGIBLE_FOR_SERVER_SUBSCRIPTION&&(0,h.ZD)(v((function(){var e,r;return w(this,(function(s){switch(s.label){case 0:
return[4,Promise.resolve().then(t.bind(t,30741))];case 1:e=s.sent(),r=e.default;return[2,function(e){return(0,n.jsx)(r,T(I({},e),{header:S.Z.Messages.TRANSFER_OWNERSHIP_FAILURE_MODAL_TITLE,confirmText:S.Z.Messages.GOT_IT,confirmButtonColor:a.zx.Colors.BRAND,children:(0,n.jsx)(a.xv,{variant:"text-md/normal",children:S.Z.Messages.SERVER_SUBSCRIPTION_OWNERSHIP_TRANSFER_FAILURE_MODAL_BODY.format({server_subscription_owner_transfer_article:Z})})}))}]}}))})));return[3,7];case 7:return[2]}}))}));return z.apply(this,arguments)}var B=E.Z.getNickname(r.id,void 0,u),G=u.hasAvatarForGuild(r.id),V=function(){return(0,n.jsxs)("span",{className:_().guildTransfer,children:[null!=r.icon?(0,n.jsx)(p.ZP,{src:R.ZP.getGuildIconURL({id:r.id,icon:r.icon,size:16}),size:o.u.SIZE_16,className:_().miniGuildIcon,"aria-hidden":!0}):null,(0,n.jsx)(a.xv,{className:_().guildName,variant:"text-sm/bold",children:r.toString()})]})};return(0,n.jsx)(d.Y0,{transitionState:x,children:(0,n.jsxs)("form",{onSubmit:function(e){
return z.apply(this,arguments)},children:[(0,n.jsx)(d.xB,{separator:!1,children:(0,n.jsx)(a.X6,{variant:"heading-lg/semibold",className:_().header,children:S.Z.Messages.TRANSFER_OWNERSHIP})}),(0,n.jsxs)(d.hz,{children:[(0,n.jsx)(a.R9,{type:a.R9.Types.DESCRIPTION,className:_().subHeader,children:null!=B||G?S.Z.Messages.TRANSFER_OWNERSHIP_TO_USER_WITH_AKA_V2.format({GuildHook:V,user:u.tag,AKAHook:function(){return(0,n.jsxs)("span",{className:_().akaTransfer,children:[(0,n.jsx)(b.IG,{text:S.Z.Messages.AKA,disableColor:!0,className:_().akaBadge}),G?(0,n.jsx)(p.ZP,{src:u.getAvatarURL(r.id,16,!0),size:o.u.SIZE_16,className:_().miniAvatar,"aria-hidden":!0}):null,(0,n.jsx)(a.xv,{className:_().nickname,variant:"text-sm/normal",children:null!=B?B:y.ZP.getName(u)})]})}}):S.Z.Messages.TRANSFER_OWNERSHIP_TO_USER_V2.format({GuildHook:V,user:u.tag})}),(0,n.jsxs)(f.Z,{className:_().fromToWrapper,justify:f.Z.Justify.CENTER,children:[(0,n.jsx)("div",{className:_().from,children:(0,n.jsx)(o.Z,{user:m,
size:o.u.SIZE_80})}),(0,n.jsx)("div",{className:_().to,children:(0,n.jsx)(o.Z,{user:u,size:o.u.SIZE_80})})]}),(0,n.jsx)(a.j7,{disabled:D,tooltipNote:F,hideBorder:!0,value:k,onChange:function(e){C(e)},children:(0,n.jsx)(a.R9,{type:a.R9.Types.DESCRIPTION,children:S.Z.Messages.TRANSFER_OWNERSHIP_ACKNOWLEDGE.format({username:u.tag})})}),(0,n.jsx)(a.R9,{className:_().protectedText,type:a.R9.Types.DEFAULT,children:L})]}),(0,n.jsxs)(d.mz,{children:[(0,n.jsx)(a.zx,{type:"submit",disabled:!k,color:a.zx.Colors.RED,children:S.Z.Messages.TRANSFER_OWNERSHIP}),(0,n.jsx)(a.zx,{look:a.zx.Looks.LINK,color:a.zx.Colors.PRIMARY,onClick:O,children:S.Z.Messages.CANCEL})]})]})})}}}]);
//# sourceMappingURL=00c252bf6f9cbebc8a5a.js.map