(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":()=>m});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 f=__webpack_require__(264727);var v=__webpack_require__(731728);function m(){let a=(0,e.c)(18);(0,s.J)("PerpsLayout"),(0,c.U)();let o=(0,r.wA)();let{pathname:d,search:m}=(0,n.zy)();let S=(0,r.d4)(p);let E=(0,r.d4)(k,r.bN);let $=(0,r.d4)(f.mN);let _;let P;a[0]!==$?(_=()=>{(0,h.SB)().setUseTerminalApi($)},P=[$],a[0]=$,a[1]=_,a[2]=P):(_=a[1],P=a[2]),(0,t.useEffect)(_,P);let T;let C;a[3]!==E||a[4]!==S||a[5]!==$?(T=()=>{(0,h.SB)().hydrateFromControllerCache({...E,markets:$?undefined:E.markets},S)},C=[E,S,$],a[3]=E,a[4]=S,a[5]=$,a[6]=T,a[7]=C):(T=a[6],C=a[7]),(0,t.useLayoutEffect)(T,C);let L;let z;a[8]!==o||a[9]!==d||a[10]!==m?(L=()=>{let e=m?`${d}${m}`:d;Promise.resolve(o((0,u.GSC)(e))).catch(w)},z=[o,d,m],a[8]=o,a[9]=d,a[10]=m,a[11]=L,a[12]=z):(L=a[11],z=a[12]),(0,t.useEffect)(L,z);let D;let g;a[13]!==o?(D=()=>()=>{(0,v.sz)(),Promise.resolve(o((0,u.GSC)(null))).catch(b)},g=[o],a[13]=o,a[14]=D,a[15]=g):(D=a[14],g=a[15]),(0,t.useLayoutEffect)(D,g);let B;a[16]===Symbol.for("react.memo_cache_sentinel")?(B=[],a[16]=B):B=a[16],(0,t.useEffect)(y,B);let G;return a[17]===Symbol.for("react.memo_cache_sentinel")?(G=t.createElement(i.pP,null,t.createElement(l.zX,null,t.createElement(n.sv,null))),a[17]=G):G=a[17],G}function y(){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(S)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}function S(){}function b(){}function w(){}function k(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 p(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__}))()}}]);