(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[4520],{174520(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{GatorPermissionsPage:()=>k});var e=__webpack_require__(303280);__webpack_require__.n(e);var t=__webpack_require__(860012);var a=__webpack_require__(994112);var r=__webpack_require__(107495);var n=__webpack_require__(48084);var l=__webpack_require__(556734);var i=__webpack_require__(305142);var s=__webpack_require__(848574);var o=__webpack_require__(706794);var c=__webpack_require__(126528);var m=__webpack_require__(219384);var u=__webpack_require__(805600);var d=__webpack_require__(68940);var f=__webpack_require__(697141);var g=__webpack_require__(917214);var v=__webpack_require__(423533);var h=__webpack_require__(593258);var p=__webpack_require__(409629);var E=__webpack_require__(182711);var b=__webpack_require__(709723);var C=__webpack_require__(22335);let k=()=>{let k=(0,e.c)(34);let N=(0,g.P)();let[T]=(0,a.ok)();let M=(0,r.Zp)();let y=(0,E.A)();let L=(0,n.d4)(w);let S=(0,n.d4)(p.F3);let{loading:$}=(0,h.v)();let I;k[0]!==T?(I=T.get("from")??v.Sg,k[0]=T,k[1]=I):I=k[1];let x=I;let R=!$&&S>0&&L===0;let G;let _;k[2]!==x||k[3]!==M||k[4]!==R?(G=()=>{R&&M(`${v.Jj}?from=${encodeURIComponent(x)}`,{replace:!0})},_=[R,M,x],k[2]=x,k[3]=M,k[4]=R,k[5]=G,k[6]=_):(G=k[5],_=k[6]),(0,t.useEffect)(G,_);let A;k[7]!==x||k[8]!==M||k[9]!==y?(A=()=>{x===v.Sg?y(()=>M(-1)):M(v.Sg)},k[7]=x,k[8]=M,k[9]=y,k[10]=A):A=k[10];let F=A;if(R)return null;let P=!$&&(L>0||S>0);let j;k[11]!==P||k[12]!==$||k[13]!==M||k[14]!==N||k[15]!==L||k[16]!==S?(j=()=>{return $?t.createElement(c.a,{"data-testid":"gator-permissions-loading",flexDirection:l.uV.Column,justifyContent:l.TE.Center,alignItems:l.RE.Center,padding:4,className:"h-full"},t.createElement(m.I,{name:i.$M.Loading,color:i.Li.IconMuted,size:i.lK.Lg,className:"animate-spin"})):(0,P)?t.createElement(c.a,{"data-testid":"permission-list",flexDirection:l.uV.Column,alignItems:l.RE.Baseline,paddingVertical:4,gap:4,className:"w-full bg-background-default"},S>0&&t.createElement(t.Fragment,null,t.createElement(d.E,{variant:s.J3.BodyMd,fontWeight:s.IT.Medium,color:s.r7.TextAlternative,className:"pl-4"},N("dapps")),t.createElement(C.Fu,{total:S,permissionGroupName:N("connections"),onClick:()=>(0,b.ni)(()=>M(v.Jj))})),S>0&&L>0&&t.createElement(c.a,{className:"w-full px-4"},t.createElement("hr",{className:"m-0 w-full border-0 border-t border-muted"})),L>0&&t.createElement(t.Fragment,null,t.createElement(d.E,{variant:s.J3.BodyMd,fontWeight:s.IT.Medium,color:s.r7.TextAlternative,className:"pl-4"},N("assets")),t.createElement(C.Fu,{total:L,permissionGroupName:N("tokenTransfer"),onClick:()=>(0,b.ni)(()=>M(v.u$))}))):(0,t.createElement(c.a,{"data-testid":"no-connections",flexDirection:l.uV.Column,justifyContent:l.TE.Center,padding:4,className:"h-full"},t.createElement(C.Rg,null)))},k[11]=P,k[12]=$,k[13]=M,k[14]=N,k[15]=L,k[16]=S,k[17]=j):j=k[17];let D=j;let J;k[18]!==N?(J=N("back"),k[18]=N,k[19]=J):J=k[19];let V;k[20]!==F||k[21]!==J?(V=t.createElement(u.a,{ariaLabel:J,iconName:i.$M.ArrowLeft,color:i.Li.IconDefault,onClick:F,size:o.f.Md}),k[20]=F,k[21]=J,k[22]=V):V=k[22];let B;k[23]===Symbol.for("react.memo_cache_sentinel")?(B={"data-testid":"gator-permissions-page-title"},k[23]=B):B=k[23];let W;k[24]!==N?(W=N("permissions"),k[24]=N,k[25]=W):W=k[25];let z;k[26]!==V||k[27]!==W?(z=t.createElement(f.Y9,{className:"bg-background-default",startAccessory:V,textProps:B},W),k[26]=V,k[27]=W,k[28]=z):z=k[28];let H;k[29]!==D?(H=t.createElement(f.UC,{padding:0},D()),k[29]=D,k[30]=H):H=k[30];let U;return k[31]!==H||k[32]!==z?(U=t.createElement(f.YW,{className:"main-container","data-testid":"gator-permissions-page"},z,H),k[31]=H,k[32]=z,k[33]=U):U=k[33],U};function w(e){return(0,p.qL)(e,"token-transfer")}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()},593258(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{v:()=>n});var e=__webpack_require__(860012);var t=__webpack_require__(48084);var a=__webpack_require__(433285);var r=__webpack_require__(749201);function n(l={}){let{refreshInBackground:i=!0}=l;let s=(0,r.w)();let o=(0,t.d4)(e=>e.metamask.grantedPermissions?.length>0);let[c,m]=(0,e.useState)(!o);let u=(0,e.useRef)(!1);return(0,e.useEffect)(()=>{let e=!1;let t=async()=>{try{!o&&m(!0),await (0,a.Gb)()}catch(e){}finally{!e&&m(!1)}};return o&&!i?m(!1):!u.current&&t().then(()=>{u.current=!0}).catch(()=>{}),()=>{e=!0}},[s,o,i]),{loading:c}}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);