dotfiles/.config/spicetify/Extracted/Themed/xpui/5043.js

2 lines
2.6 KiB
JavaScript
Raw Normal View History

2024-07-11 00:01:49 +05:30
"use strict";(("undefined"!=typeof self?self:global).webpackChunkopen=("undefined"!=typeof self?self:global).webpackChunkopen||[]).push([[5043],{15043:(e,t,a)=>{a.r(t),a.d(t,{SNACKBAR_ID:()=>A,default:()=>S});var i=a(59496),r=a(67526),n=a(3254),o=a(12505),s=a(3802),c=a(33103),l=a(38191),d=a(56162),u=a(79475);const f="dRD7dgAMZVRuTdelaf6B",g="sFr9SHK1H3ZYdz2_jWqY",m="AckhtqapSIpyTPpQGw7y";var h=a(4637);const p="dialog-robot";const b=()=>{const[e,t]=(0,i.useState)(!0);return e?(0,h.jsx)(l.l,{"data-testid":p,id:p,"aria-label":"Dialog robot",dialogTitle:s.ag.get("user-fraud-verification.dialog-alert.title"),colorSet:"invertedLight",className:f,body:(0,h.jsx)(d.D,{as:"p",children:(a=s.ag.get("user-fraud-verification.dialog-alert.describe"),r=e=>(0,h.jsx)(c.rU,{to:"/playlist/37i9dQZF1DWUcRrhkfhG22",className:g,children:e},e),a.split(/(\{0\}.*)\{1\}/).map((e=>e.startsWith("{0}")?r(e.split("{0}")[1]):e)))}),footer:(0,h.jsx)(u.D,{className:m,onClick:()=>t(!1),children:s.ag.get("user-fraud-verification.dialog-alert.ok")})}):null;var a,r};var v=a(9102),_=a(81460),I=a(25899),x=a(69898),k=a(30616),N=a(55760);var T=a(51385),y=a(86165);const A="snackbar-user-fraud-verification",S=({verificationId:e})=>{const t=(0,i.useRef)(Date.now()),[a,c]=(0,i.useState)(!1),[l,d]=(0,i.useState)(!1),[u,f]=(0,i.useState)(!1),g=(0,N.s4)(),m=(()=>{const e=(0,N.s4)(),{mutate:t}=(0,v.useMutation)({mutationFn:e=>{const t=I.b.getInstance();return(0,x.h)(t,e)},onError:(t,a)=>{e.send((0,_.b)({id:a,method:"IN_APP_VERIFICATION_V0",error_message:t instanceof k.m?t.message:null,http_method:"put",http_path:`/verification/${a}`}))}});return t})(),[p,S]=(0,y.L)(),j=(a,i)=>{const r=Date.now()-t.current,{type:n}=i;S(i),g.send((0,o.h)({id:e,method:"IN_APP_VERIFICATION_V0",action:a,interaction_details:{reaction_time:`${r}`,event_triggered:JSON.stringify({type:n,isTrusted:p.current})}})),e&&m(e)};return l?null:u?(0,h.jsx)(b,{}):a?(0,h.jsx)(r.A9,{"data-testid":A,className:(0,n.Mg)("announcement"),children:s.ag.get("user-fraud-verification.snackbar.message")}):(0,h.jsx)(T.Q,{"aria-label":s.ag.get("user-fraud-verification.confirm-dialog.title"),titleText:s.ag.get("user-fraud-verification.confirm-dialog.title"),descriptionText:s.ag.get("user-fraud-verification.confirm-dialog.description"),onConfirm:e=>{j("human",e),c(!0)},onClose:e=>{j("robot",e),f(!0)},onOutside:e=>{j("robot",e),d(!0)},confirmText:s.ag.get("user-fraud-verification.confirm-dialog.confirm"),confirmLabel:s.ag.get("user-fraud-verification.confirm-dialog.label"),cancelText:s.ag.get("user-fraud-verification.confirm-dialog.cancel")})}}}]);
//# sourceMappingURL=5043.js.map