(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[8886],{526497(__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__,{zX:()=>t.zX}),__webpack_require__(13133),__webpack_require__(807270),__webpack_require__(923171),__webpack_require__(460639),__webpack_require__(267555);var t=__webpack_require__(412710);__webpack_require__(800449),__webpack_require__(20926),__webpack_require__(641253),__webpack_require__(964634),__webpack_require__(566757),__webpack_require__(994824),__webpack_require__(620119),__webpack_require__(65686),__webpack_require__(575908),__webpack_require__(3073),__webpack_require__(895763),__webpack_require__(696681)}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()},798886(__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__,{"default":()=>v});var t=__webpack_require__(515863);__webpack_require__.n(t);var e=__webpack_require__(67659);var r=__webpack_require__(833081);var n=__webpack_require__(147928);var a=__webpack_require__(856296);var i=__webpack_require__(526497);var l=__webpack_require__(392272);var c=__webpack_require__(665232);var s=__webpack_require__(544089);var o=__webpack_require__(440869);var u=__webpack_require__(301819);var h=__webpack_require__(967500);var d=__webpack_require__(374027);function v(){let a=(0,t.c)(14);(0,l.J)("PerpsLayout"),(0,c.U)();let s=(0,r.wA)();let{pathname:h,search:v}=(0,n.zy)();let m=(0,r.d4)(S);let $=(0,r.d4)(w,r.bN);let _;let k;a[0]!==$||a[1]!==m?(_=()=>{(0,u.SB)().hydrateFromControllerCache($,m)},k=[$,m],a[0]=$,a[1]=m,a[2]=_,a[3]=k):(_=a[2],k=a[3]),(0,e.useLayoutEffect)(_,k);let p;let E;a[4]!==s||a[5]!==h||a[6]!==v?(p=()=>{let t=v?`${h}${v}`:h;Promise.resolve(s((0,o.GSC)(t))).catch(b)},E=[s,h,v],a[4]=s,a[5]=h,a[6]=v,a[7]=p,a[8]=E):(p=a[7],E=a[8]),(0,e.useEffect)(p,E);let C;let L;a[9]!==s?(C=()=>()=>{(0,d.sz)(),Promise.resolve(s((0,o.GSC)(null))).catch(y)},L=[s],a[9]=s,a[10]=C,a[11]=L):(C=a[10],L=a[11]),(0,e.useLayoutEffect)(C,L);let P;a[12]===Symbol.for("react.memo_cache_sentinel")?(P=[],a[12]=P):P=a[12],(0,e.useEffect)(f,P);let T;return a[13]===Symbol.for("react.memo_cache_sentinel")?(T=e.createElement(i.zX,null,e.createElement(n.sv,null)),a[13]=T):T=a[13],T}function f(){let t=null;let e=()=>{if(document.visibilityState==="hidden"){t=Date.now();return}let e=t;if(t=null,e!==null&&Date.now()-e<3e4)return;(0,s.Rb)("perpsCheckHealth").catch(m)};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)}function m(){}function y(){}function b(){}function w(t){let e=t.metamask;let r=e.activeProvider??a.x$.DefaultProvider;let n=`${r}:${e.isTestnet?"testnet":"mainnet"}`;let i=e.cachedMarketDataByProvider?.[n];let l=e.cachedUserDataByProvider?.[n];return{markets:i?.data,positions:l?.positions,orders:l?.orders,account:l?.accountState,address:l?.address}}function S(t){return(0,h._)(t)?.address??null}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);