(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[2203],{532203(__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":()=>y});var e=__webpack_require__(303280);__webpack_require__.n(e);var t=__webpack_require__(860012);var r=__webpack_require__(48084);var n=__webpack_require__(107495);var a=__webpack_require__(798777);var l=__webpack_require__(762550);var i=__webpack_require__(92807);var s=__webpack_require__(59293);var c=__webpack_require__(358623);var o=__webpack_require__(609654);var u=__webpack_require__(79222);var h=__webpack_require__(895462);var d=__webpack_require__(365337);var v=__webpack_require__(264727);var f=__webpack_require__(731728);var m=__webpack_require__(749201);function y(){let a=(0,e.c)(18);(0,s.J)("PerpsLayout"),(0,c.U)();let o=(0,m.w)();let{pathname:d,search:y}=(0,n.zy)();let b=(0,r.d4)(E);let $=(0,r.d4)(p,r.bN);let _=(0,r.d4)(v.mN);let P;let T;a[0]!==_?(P=()=>{(0,h.SB)().setUseTerminalApi(_)},T=[_],a[0]=_,a[1]=P,a[2]=T):(P=a[1],T=a[2]),(0,t.useEffect)(P,T);let C;let L;a[3]!==$||a[4]!==b||a[5]!==_?(C=()=>{(0,h.SB)().hydrateFromControllerCache({...$,markets:_?undefined:$.markets},b)},L=[$,b,_],a[3]=$,a[4]=b,a[5]=_,a[6]=C,a[7]=L):(C=a[6],L=a[7]),(0,t.useLayoutEffect)(C,L);let z;let D;a[8]!==o||a[9]!==d||a[10]!==y?(z=()=>{let e=y?`${d}${y}`:d;Promise.resolve(o((0,u.GSC)(e))).catch(k)},D=[o,d,y],a[8]=o,a[9]=d,a[10]=y,a[11]=z,a[12]=D):(z=a[11],D=a[12]),(0,t.useEffect)(z,D);let g;let B;a[13]!==o?(g=()=>()=>{(0,f.sz)(),Promise.resolve(o((0,u.GSC)(null))).catch(w)},B=[o],a[13]=o,a[14]=g,a[15]=B):(g=a[14],B=a[15]),(0,t.useLayoutEffect)(g,B);let G;a[16]===Symbol.for("react.memo_cache_sentinel")?(G=[],a[16]=G):G=a[16],(0,t.useEffect)(S,G);let H;return a[17]===Symbol.for("react.memo_cache_sentinel")?(H=t.createElement(i.pP,null,t.createElement(l.zX,null,t.createElement(n.sv,null))),a[17]=H):H=a[17],H}function S(){let e=null;let t=()=>{if(document.visibilityState==="hidden"){e=Date.now();return}let t=e;if(e=null,t!==null&&Date.now()-t<3e4)return;(0,o.Rb)("perpsCheckHealth").catch(b)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}function b(){}function w(){}function k(){}function p(e){let t=e.metamask;let r=t.activeProvider??a.x$.DefaultProvider;let n=`${r}:${t.isTestnet?"testnet":"mainnet"}`;let l=t.cachedMarketDataByProvider?.[n];let i=t.cachedUserDataByProvider?.[n];return{markets:l?.data,positions:i?.positions,orders:i?.orders,account:i?.accountState,address:i?.address}}function E(e){return(0,d._)(e)?.address??null}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()},762550(__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:()=>e.zX}),__webpack_require__(654352),__webpack_require__(93769),__webpack_require__(425462),__webpack_require__(650836),__webpack_require__(606760);var e=__webpack_require__(311441);__webpack_require__(918540),__webpack_require__(938685),__webpack_require__(791796),__webpack_require__(774153),__webpack_require__(663870),__webpack_require__(336795),__webpack_require__(454704),__webpack_require__(409823),__webpack_require__(22677),__webpack_require__(118670),__webpack_require__(227980),__webpack_require__(890194)}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);