1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="78cbcf6e-7fbf-474a-9d06-579de5cbf5c8",e._sentryDebugIdIdentifier="sentry-dbid-78cbcf6e-7fbf-474a-9d06-579de5cbf5c8")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3179],{49393:(e,n,l)=>{"use strict";l.d(n,{s:()=>g,EO:()=>w.EO});var t=l(350979),r=l(734658),i=l(312680),o=l(659918),s=l(91168),a=l(131619),d=l(25963),c=l(437862),u=l(810498),p=l(514546),x=l(659197),m=l(769932),h=l(475690),j=l(995315),y=l(506549),A=l(444429),f=l(427896);let b=e=>{let{isOpen:n,onDismiss:l,closeOnOverlayClick:r,...o}=e,{t:s}=(0,m.A)(),{additionalDetails:a,primaryMsg:c}=(0,d.useMemo)(()=>({primaryMsg:s("Calculated at the current rates with historical trading volume data, and subject to change based on various external variables."),additionalDetails:s("This figure is provided for your convenience only, and by no means represents guaranteed returns.")}),[s]),u=(0,A.g)(o);return(0,t.jsx)(f.L,{children:(0,t.jsx)(i.aF,{onDismiss:l,isOpen:n,closeOnOverlayClick:r,children:(0,t.jsx)(h.Ay,{width:["100%","100%","100%","520px"],title:s("APR Breakdown"),headerBorderColor:"transparent",children:(0,t.jsxs)(j.A,{gap:"24px",flexDirection:"column",children:[(0,t.jsx)(y.r.RewardCard,{rewards:u}),(0,t.jsx)(y.V,{primaryMsg:c,additionalDetails:a})]})})})})};var v=l(592322);let g=e=>{var n,l,m,h;let{pool:j,detailMode:y,aprInfo:A,showApyText:f,showApyButton:g,fontSize:w,color:k="secondary",clickable:I=!0}=e,C=(0,d.useMemo)(()=>`${j.chainId}:${j.lpAddress}`,[j.chainId,j.lpAddress]),S=!j.stableSwapAddress&&!A,T=(0,c.nY)(C,j,S,!A),{lpApr:F,lpAprUnavailableReason:$,cakeApr:R,merklApr:q,incentraApr:z}=null!=A?A:T,M=(0,d.useMemo)(()=>{var e;return new s.A(F).times(null!=(e=null==R?void 0:R.userTvlUsd)?e:o.AH)},[F,null==R?void 0:R.userTvlUsd]),P=(0,d.useMemo)(()=>{var e;return null!=(e=null==R?void 0:R.userTvlUsd)?e:o.AH},[null==R?void 0:R.userTvlUsd]),{chainId:B,token0:L,token1:O}=j,D=(0,a.G5)((0,r.eG)(L),B),E=(0,a.G5)((0,r.eG)(O),B),{totalApr:W,updateTotalApr:_}=(0,p.M)();(0,d.useEffect)(()=>{var e,n;y&&(j.protocol===x.Zs.V2||j.protocol===x.Zs.STABLE||j.protocol===x.Zs.InfinitySTABLE)&&((null==(e=W[C])?void 0:e.numerator)!==M||(null==(n=W[C])?void 0:n.denominator)!==P)&&_(C,M,P)},[P,y,C,M,j.protocol,F,R,q,z,W,_]);let U=(0,i.jN)();return(0,u.T)(j.protocol)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v.t,{pool:j,lpApr:parseFloat(F)||0,lpAprUnavailableReason:$,cakeApr:R,merklApr:null!=(m=parseFloat(q))?m:0,incentraApr:null!=(h=parseFloat(z))?h:0,onAPRTextClick:U.onOpen,showApyButton:!1,showApyText:f,fontSize:w,color:k,clickable:I}),U.isOpen?(0,t.jsx)(b,{currency0:D,currency1:E,poolId:j.poolId,lpApr:F,cakeApr:R,tvlUSD:j.tvlUsd,closeOnOverlayClick:!0,...U}):null]}):(0,t.jsx)(v.t,{pool:j,lpApr:parseFloat(F)||0,lpAprUnavailableReason:$,cakeApr:R,merklApr:null!=(n=parseFloat(q))?n:0,incentraApr:null!=(l=parseFloat(z))?l:0,showApyText:f,showApyButton:g,fontSize:w,color:k,clickable:I})};var w=l(139184)},132763:(e,n,l)=>{"use strict";l.r(n),l.d(n,{default:()=>eJ});var t=l(350979),r=l(228876),i=l(53670),o=l(87242),s=l.n(o),a=l(326848),d=l(25963),c=l(18468),u=l(397937),p=l(311560),x=l(807543),m=l(24153),h=l(605641),j=l(501823),y=l(498938),A=l(549333),f=l(557423),b=l(796898),v=l(876089),g=l(226464),w=l(428089),k=l(575058),I=l(979332),C=l(150591),S=l(779243),T=l(67002),F=l(294643),$=l(796259),R=l(796147),q=l(399832),z=l(550062),M=l(247153),P=l(769932),B=l(421770),L=l(673384),O=l(662928),D=l(841376),E=l(266283),W=l(927122),_=l(150103),U=l(609104),N=l(671449),Z=l(504304),V=l(573271),H=l(214885),Y=l(114041),G=l(450253),K=l.n(G),J=l(717713),Q=l(687287),X=l(810286),ee=l(131619),en=l(909114),el=l(555967),et=l(466020),er=l(988998),ei=l(740523),eo=l(529208),es=l(961862),ea=l(792118);let ed=(0,et.VD)(ea.Qr);var ec=l(427548),eu=l(419041),ep=l(155018),ex=l(314811),em=l(538192),eh=l(650176),ej=l(706172),ey=l(341050),eA=l(829715),ef=l(2828),eb=l(764289),ev=l.n(eb),eg=l(642984),ew=l(856870),ek=l(779597),eI=l(306411),eC=l(680797),eS=l(733775),eT=l(182063),eF=l(909725),e$=l(82850),eR=l(189346),eq=l(868491),ez=l(452301),eM=l(663257),eP=l(776484),eB=l(149160),eL=l(495964),eO=l(236088),eD=l(928768),eE=l(762971),eW=l(899188);let e_=(0,eC.I4)(x.A).withConfig({componentId:"sc-8728434c-0"})(["border-radius:24px;max-width:858px;width:100%;z-index:1;"]);function eU(e){let{priceUpper:n,currencyQuote:l,currencyBase:r,isMobile:i,priceLower:o,inverted:s,pool:a,tickAtLimit:c,setManuallyInverted:u,manuallyInverted:p}=e,{t:x,currentLanguage:{locale:A}}=(0,P.A)(),f=(0,d.useMemo)(()=>p?{[Y.zm.LOWER]:c[Y.zm.UPPER],[Y.zm.UPPER]:c[Y.zm.LOWER]}:c,[c,p]),b=a?s?a.token1Price:a.token0Price:void 0,v=(0,Q.xm)(o),g=(0,Q.xm)(n),w=(0,Q.xm)(b);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(m.eF,{justifyContent:"space-between",mb:"16px",mt:"24px",children:[(0,t.jsx)(h.A,{fontSize:"12px",color:"secondary",bold:!0,textTransform:"uppercase",children:x("Price Range")}),r&&l&&(0,t.jsx)(eB.A,{currencyA:r,handleRateToggle:()=>u(!p)})]}),(0,t.jsx)(m.eF,{mb:"8px",children:(0,t.jsxs)(j.A,{alignItems:"center",justifyContent:"space-between",width:"100%",flexWrap:["wrap","wrap","nowrap"],children:[(0,t.jsx)(Z.E,{mr:["0","0","16px"],mb:["8px","8px","0"],title:x("Min Price"),price:(0,eA.I)(v,f,Y.zm.LOWER,A),rawPrice:o,currency0:l,currency1:r}),i?null:(0,t.jsx)(y.A,{width:"24px",mx:"16px"}),(0,t.jsx)(Z.E,{ml:["0","0","16px"],title:x("Max Price"),price:(0,eA.I)(g,f,Y.zm.UPPER,A),rawPrice:n,currency0:l,currency1:r})]})}),a&&l&&r?(0,t.jsx)(Z.E,{title:x("Current Price"),currency0:l,currency1:r,price:(0,eF.$g)(w,6,A),rawPrice:b}):null]})}let eN=()=>{var e,n,l,r,o,s,c,x;let{t:y,currentLanguage:{locale:T}}=(0,P.A)(),[F,$]=(0,d.useState)(!1),[R,q]=(0,d.useState)(),[B,Z]=(0,d.useState)(null),[Y,G]=(0,d.useState)(!1),{data:K}=(0,eL.G)(),{sendTransactionAsync:J}=(0,eO.s)(),{account:et,chainId:eA}=(0,i.W7)(),{maxFeePerGas:eb,maxPriorityFeePerGas:ew}=(0,en.N)(eA),eC=(0,a.useRouter)(),{tokenId:eF}=eC.query,e$=Number.isInteger(Number(eF))?BigInt(eF):void 0,{loading:eB,position:eN}=(0,ey.Cq)(e$),{token0:eV,token1:eH,fee:eY,liquidity:eG,tickLower:eK,tickUpper:eJ,tokenId:eQ}=eN||{},eX=0n===eG,e0=(0,ee.rd)(eV),e1=(0,ee.rd)(eH),{data:e4}=function(e){let{currencyA:n,currencyB:l,feeAmount:t}=e,r=null==n?void 0:n.chainId,{farms:i}=(0,es.N)(r),o=(0,d.useMemo)(()=>
1{if(!r||!n||!l||!t||!i)return null;let e=L.bC.getAddress(n.wrapped,l.wrapped,t),o=i.find(n=>n.lpAddress===e);return null!=o?o:null},[r,n,l,i,t]);return(0,O.I)({queryKey:[r,null==o?void 0:o.token0.symbol,null==o?void 0:o.token1.symbol,null==o?void 0:o.feeAmount],queryFn:async()=>{if(!o||!r)throw Error("Invalid farm config");let e=ei.Ij[r].list||[];for(let n of[o.token,o.quoteToken])e.every(e=>e.address!==n.address)&&e.push(n);let n=await (0,er.S5)(e);try{let{farmsWithPrice:e,cakePerSecond:l,poolLength:t}=await ed.fetchFarms({chainId:r,farms:[o],commonPrice:n});return{farm:e[0],poolLength:t,cakePerSecond:l}}catch(e){return console.error(e),null}},enabled:!!(r&&o),refetchInterval:3*eo.fr,staleTime:eo.fr})}({currencyA:e0,currencyB:e1,feeAmount:eY}),e2=(0,d.useMemo)(()=>e4&&(0,u.me)(e4.farm,e4.poolLength),[e4]),e6=e0?(0,ez.U$)(e0):void 0,e9=e1?(0,ez.U$)(e1):void 0,[e8,e7]=(0,eh.Q2)(null!=e0?e0:void 0,null!=e1?e1:void 0,eY),e5=(0,d.useMemo)(()=>{if(e7&&"bigint"==typeof eG&&"number"==typeof eK&&"number"==typeof eJ)return new L.yX({pool:e7,liquidity:eG.toString(),tickLower:eK,tickUpper:eJ})},[eG,e7,eK,eJ]),e3=(0,d.useMemo)(()=>e7?L.bC.getAddress(e7.token0,e7.token1,e7.fee):void 0,[e7]),ne=(0,eg.qX)({poolAddress:e3,chainId:eA}),nn=(0,em.A)(eY,eK,eJ),[nl,nt]=(0,d.useState)(!1),{priceLower:nr,priceUpper:ni,base:no}=(e=>{let{priceLower:n,priceUpper:l,quote:t,base:r,invert:i}=e;return{priceUpper:i?null==n?void 0:n.invert():l,priceLower:i?null==l?void 0:l.invert():n,quote:i?r:t,base:i?t:r}})({priceLower:e5?(0,L.y1)(e5.pool.token0,e5.pool.token1,e5.tickLower):void 0,priceUpper:e5?(0,L.y1)(e5.pool.token0,e5.pool.token1,e5.tickUpper):void 0,quote:null==e5?void 0:e5.pool.token1,base:null==e5?void 0:e5.pool.token0,invert:nl}),ns=e1&&no?no.equals(e1):void 0,na=ns?e6:e9,nd=ns?e9:e6,nc=(0,Q.wG)(nd),nu=(0,Q.wG)(na),np=(0,Q.wG)(e6),nx=(0,Q.wG)(e9),[nm,nh]=(0,ej.R)(null!=e7?e7:void 0,null==eN?void 0:eN.tokenId,Y),nj=e7?Y?e7.token0:(0,ez.U$)(e7.token0):void 0,ny=e7?Y?e7.token1:(0,ez.U$)(e7.token1):void 0,nA=(0,eI.tp)(null!=B?B:void 0),nf=(0,d.useMemo)(()=>{var e;return!!((null==e5||null==(e=e5.amount0)?void 0:e.greaterThan(0))||(null==nm?void 0:nm.greaterThan(0)))},[e5,nm]),nb=(0,d.useMemo)(()=>{var e;return!!((null==e5||null==(e=e5.amount1)?void 0:e.greaterThan(0))||(null==nh?void 0:nh.greaterThan(0)))},[e5,nh]),nv=(0,ep.r0)(null!=e0?e0:void 0,{enabled:nf}),ng=(0,ep.r0)(null!=e1?e1:void 0,{enabled:nb}),nw=(0,d.useMemo)(()=>{let e=null==nm?void 0:nm.wrapped,n=null==nh?void 0:nh.wrapped,l=nv&&e?nv.quote(e):void 0,t=ng&&n?ng.quote(n):void 0;return l&&t?l.add(t):l||t||null},[nv,ng,nm,nh]),nk=(0,d.useMemo)(()=>{if(!e5)return null;let e=nv?nv.quote(e5.amount0):void 0,n=ng?ng.quote(e5.amount1):void 0;return e&&n?e.add(n):e||n||null},[nv,ng,e5]),nI=(0,eI.OQ)(),nC=(0,el.TA)(),nS=(0,el.rZ)(),nT=!!((null==nS?void 0:nS.address)&&(null==nS?void 0:nS.address)!=="0x"),{tokenIds:nF,loading:n$}=(0,ey.s2)(nT?null==nS?void 0:nS.address:void 0,et),nR=eQ&&!!nF.find(e=>e===eQ),nq=nR?nS:nC,nz=nR?L.SG:L.uy,nM=(0,d.useCallback)(()=>{q(void 0)},[]),nP=(0,d.useCallback)(()=>{var e,n;let l=null==nS?void 0:nS.address;if(l&&"0x"!==l&&n$||!nj||!ny||!eA||!nq||!et||!eQ)return;$(!0);let{calldata:t,value:r}=nz.collectCallParameters({tokenId:eQ.toString(),expectedCurrencyOwed0:null!=nm?nm:p.eF.fromRawAmount(nj,0),expectedCurrencyOwed1:null!=nh?nh:p.eF.fromRawAmount(ny,0),recipient:et}),i={to:nq.address,data:t,value:(0,eM.uU)(r),account:et,chain:null==K?void 0:K.chain};null==(n=(0,ea.Qr)({chainId:eA}))||null==(e=n.estimateGas(i).then(async e=>J({...i,gas:(0,eS.KL)(e),maxFeePerGas:eb,maxPriorityFeePerGas:ew}).then(e=>{var n,l,t,r,i,o;Z(e),$(!1);let s=null!=nm?nm:p.eF.fromRawAmount(nj,0),a=null!=nh?nh:p.eF.fromRawAmount(ny,0);nI({hash:e},{type:"collect-fee",summary:`Collect fee ${null!=(n=np(s,6))?n:"-"} ${nj.symbol} and ${null!=(l=nx(a,6))?l:"-"} ${ny.symbol}`,translatableSummary:{text:"Collect fee %amountA% %symbolA% and %amountB% %symbolB%",data:{amountA:null!=(t=np(s,6))?t:"-",symbolA:null!=(r=nj.symbol)?r:"",amountB:null!=(i=nx(a,6))?i:"-",symbolB:null!=(o=ny.symbol)?o:""}}})})))||e.catch(e=>{(0,eR.U)(e)?q(y("Transaction rejected")):q((0,eq.w)(e,y)),$(!1),console.error(e)})},[nS,n$,nj,ny,eA,nq,et,eQ,nz,nm,nh,K,J,eb,ew,nI,y,np,nx]),nB=(0,ek.DD)({contract:eQ&&nC?nC:void 0,functionName:"ownerOf",args:(0,d.useMemo)(()=>[eQ],[eQ])}).result,nL=(0,eS.ho)(nB,et)||(0,eS.ho)(null==eN?void 0:eN.operator,et),nO=ns?nm:nh,nD=ns?nh:nm,nE=ns?null==e5?void 0:e5.amount0:null==e5?void 0:e5.amount1,nW=ns?null==e5?void 0:e5.amount1:null==e5?void 0:e5.amount0,n_=ns?nv:ng,nU=ns?ng:nv,nN=(0,L.Qc)(e7,eK,eJ),nZ=(0,eu.Ay)().wrapped.symbol,nV=!!(nL&&((null==nm?void 0:nm.greaterThan(0))||(null==nh?void 0:nh.greaterThan(0)))&&e6&&e9&&(e6.isNative||e9.isNative)&&!B),nH=()=>{var e,n,l,r;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(E.k0,{mb:"16px",children:[(0,t.jsxs)(m.eF,{justifyContent:"space-between",mb:"8px",children:[(0,t.jsxs)(j.A,{children:[(0,t.jsx)(_.Zm,{currency:null==nO?void 0:nO.currency,size:"24px"}),(0,t.jsx)(h.A,{color:"textSubtle",ml:"4px",children:null==nO||null==(e=nO.currency)?void 0:e.symbol})]}),(0,t.jsx)(X.g3,{amount:nO,children:nO&&null!=(l=nu(nO,4))?l:"-"})]}),(0,t.jsxs)(m.eF,{justifyContent:"space-between",children:[(0,t.jsxs)(j.A,{children:[(0,t.jsx)(_.Zm,{currency:null==nD?void 0:nD.currency,size:"24px"}),(0,t.jsx)(h.A,{color:"textSubtle",ml:"4px",children:null==nD||null==(n=nD.currency)?void 0:n.symbol})]}),(0,t.jsx)(X.g3,{amount:nD,children:nD&&null!=(r=nc(nD,4))?r:"-"})]})]}),(0,t.jsx)(h.A,{mb:"16px",px:"16px",children:y("Collecting fees will withdraw currently available fees for you")})]})},[nY]=(0,A.A)((0,t.jsx)(H.A,{title:y("Claim fees"),attemptingTxn:F,customOnDismiss:nM,hash:null!=B?B:"",errorMessage:R,content:()=>(0,t.jsx)(z.Y,{topContent:nH,bottomContent:()=>(0,t.jsx)(f.A,{width:"100%",onClick:nP,children:y("Collect")})}),pendingText:y("Collecting fees")}),!0,!0,"TransactionConfirmationModalCollectFees"),nG=eB||eN&&!eY,nK=nG||e8===ex.S.LOADING||e8===ex.S.INVALID,{isMobile:nJ}=(0,b.A)(),nQ=nR||nL,{hasMerkl:nX}=(0,ec.VB)(e3);if(!nG&&!eN||e8===ex.S.NOT_EXISTS)return(0,t.jsx)(v.A,{LinkComp:ev(),children:(0,t.jsx)(ef.bV,{title:"404"})});let n0=nN&&nL&&e2&&!nR&&!nX?(0,t.jsx)(g.A,{variant:"primary",mb:"2em",children:(0,t.jsxs)(w.Ay,{children:[(0,t.jsx)(h.A,{display:"inline",bold:!0,mr:"0.25em",children:`${null==na?void 0:na.symbol}-${null==nd?void 0:nd.symbol}`}),(0,t.jsx)(h.A,{display:"inline",children:y("has an active PancakeSwap farm. Stake your position in the farm to start earning with the indicated APR with CAKE farming.")}),(0,t.jsx)(M.Y,{to:"/liquidity/pools",children:(0,t.jsxs)(h.A,{display:"inline",bold:!0,ml:"0.25em",style:{textDecoration:"underline"},children:[y("Go to Farms")," "," >>"]})})]})}):null;return"pools"===eF?(eC.replace("/liquidity/pools"),null):e$?(0,t.jsxs)(w.Ay,{mb:"40px",children:[!nK&&(0,t.jsx)(ef.bV,{title:`${null==na?void 0:na.symbol}-${null==nd?void 0:nd.symbol} V3 LP #${eF}`}),nK?(0,t.jsx)(W.A,{}):(0,t.jsx)(e_,{children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.j,{title:(0,t.jsxs)(w.Ay,{mb:["8px","8px",0],width:"100%",style:{flex:1}
1,minWidth:["auto","auto","max-content"],children:[(0,t.jsxs)(j.A,{alignItems:"center",children:[(0,t.jsx)(_.gz,{size:24,currency0:na,currency1:nd}),(0,t.jsxs)(k.A,{as:"h2",ml:"8px",children:[null==na?void 0:na.symbol,"-",null==nd?void 0:nd.symbol]}),!nJ&&(0,t.jsxs)(t.Fragment,{children:[nR&&(0,t.jsx)(I.A,{ml:"8px",outline:!0,variant:"warning",children:y("Farming")}),(0,t.jsx)(V.K,{ml:"8px",removed:eX,outOfRange:!nN,protocol:null==ne?void 0:ne.protocol})]}),(0,t.jsx)(N.yK,{poolAddress:e3}),(0,t.jsx)(eE.f0,{poolAddress:e3})]}),(0,t.jsxs)(m.JA,{gap:"16px",flexWrap:"nowrap",children:[(0,t.jsxs)(h.A,{fontSize:"14px",color:"textSubtle",style:{wordBreak:"break-word"},children:["V3 LP #",eF," / ",new p.QE(eY||0,1e6).toSignificant(),"%"," ",y("fee tier")]}),nJ&&(0,t.jsxs)(j.A,{children:[nR?(0,t.jsx)(I.A,{mr:"8px",outline:!0,variant:"warning",children:y("Farming")}):null,(0,t.jsx)(V.K,{removed:eX,outOfRange:!nN,protocol:null==ne?void 0:ne.protocol})]})]})]}),backTo:"/liquidity/positions",noConfig:!0,buttons:!nJ&&na&&nd&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Y,{to:`/increase/${(0,eT.A)(nd)}/${(0,eT.A)(na)}/${eY}/${eQ}${(null==ne?void 0:ne.chainId)?`?chain=${eW.RW[ne.chainId]}&${eo.hy}=1`:""}`,children:(0,t.jsx)(f.A,{disabled:!nQ||!!((null==ne?void 0:ne.chainId)&&eD.nn[null==ne?void 0:ne.chainId]),width:"100%",children:y("Add")})}),!eX&&(0,t.jsx)(M.Y,{to:`/remove/${eQ}${(null==ne?void 0:ne.chainId)?`?chain=${eW.RW[ne.chainId]}&${eo.hy}=1`:""}`,children:(0,t.jsx)(f.A,{disabled:!nQ,ml:"4px",variant:"secondary",width:"100%",children:y("Remove")})})]})}),(0,t.jsxs)(C.A,{children:[nJ&&na&&nd&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Y,{to:`/increase/${(0,eT.A)(nd)}/${(0,eT.A)(na)}/${eY}/${eQ}${(null==ne?void 0:ne.chainId)?`?chain=${eW.RW[ne.chainId]}&${eo.hy}=1`:""}`,children:(0,t.jsx)(f.A,{disabled:!nQ||!!((null==ne?void 0:ne.chainId)&&eD.nn[null==ne?void 0:ne.chainId]),width:"100%",mb:"8px",children:y("Add")})}),!eX&&(0,t.jsx)(M.Y,{to:`/remove/${eQ}${(null==ne?void 0:ne.chainId)?`?chain=${eW.RW[ne.chainId]}&${eo.hy}=1`:""}`,children:(0,t.jsx)(f.A,{disabled:!nQ,variant:"secondary",width:"100%",mb:"8px",children:y("Remove")})})]}),n0,(0,t.jsx)(m.eF,{children:(0,t.jsxs)(j.A,{alignItems:"center",justifyContent:"space-between",width:"100%",mb:"8px",style:{gap:"16px"},flexWrap:["wrap","wrap","nowrap"],children:[(0,t.jsxs)(w.Ay,{width:"100%",mb:["8px","8px",0],position:"relative",children:[(0,t.jsx)(j.A,{position:"absolute",right:0,children:(0,t.jsx)(eP.C,{tokenId:BigInt(null!=eQ?eQ:0),pool:ne})}),(0,t.jsx)(h.A,{fontSize:"12px",color:"secondary",bold:!0,textTransform:"uppercase",children:y("Liquidity")}),(0,t.jsxs)(h.A,{fontSize:"24px",fontWeight:600,mb:"8px",children:["$",(null==nk?void 0:nk.greaterThan(new p.fw(1,100)))?nk.toFixed(2,{groupSeparator:","}):"-"]}),(0,t.jsxs)(E.k0,{mr:"4px",style:{padding:"16px 8px"},children:[(0,t.jsxs)(m.eF,{justifyContent:"space-between",mb:"8px",children:[(0,t.jsxs)(j.A,{children:[(0,t.jsx)(_.Zm,{currency:na}),(0,t.jsx)(h.A,{small:!0,color:"textSubtle",id:"remove-liquidity-tokenb-symbol",ml:"4px",children:null==(e=(0,ez.U$)(null==nE?void 0:nE.currency))?void 0:e.symbol})]}),(0,t.jsx)(j.A,{justifyContent:"center",children:(0,t.jsx)(X.g3,{amount:nE,small:!0,mr:"4px",children:null!=(o=nu(nE,4))?o:"-"})}),(0,t.jsx)(m.JA,{justifyContent:"flex-end",children:(0,t.jsx)(h.A,{fontSize:"10px",color:"textSubtle",mr:"4px",children:nE&&n_?`~$${n_.quote(null==nE?void 0:nE.wrapped).toFixed(2,{groupSeparator:","})}`:""})})]}),(0,t.jsxs)(m.eF,{justifyContent:"space-between",children:[(0,t.jsxs)(j.A,{children:[(0,t.jsx)(_.Zm,{currency:nd}),(0,t.jsx)(h.A,{small:!0,color:"textSubtle",id:"remove-liquidity-tokenb-symbol",ml:"4px",children:null==(n=(0,ez.U$)(null==nW?void 0:nW.currency))?void 0:n.symbol})]}),(0,t.jsx)(j.A,{justifyContent:"center",children:(0,t.jsx)(X.g3,{amount:nW,small:!0,mr:"4px",children:null!=(s=nc(nW,4))?s:"-"})}),(0,t.jsx)(m.JA,{justifyContent:"flex-end",children:(0,t.jsx)(h.A,{fontSize:"10px",color:"textSubtle",mr:"4px",children:nW&&nU?`~$${nU.quote(null==nW?void 0:nW.wrapped).toFixed(2,{groupSeparator:","})}`:""})})]})]})]}),(0,t.jsxs)(w.Ay,{width:"100%",children:[(0,t.jsx)(h.A,{fontSize:"12px",color:"secondary",bold:!0,textTransform:"uppercase",children:y("Unclaimed Fees")}),(0,t.jsxs)(m.eF,{justifyContent:"space-between",mb:"8px",children:[(0,t.jsxs)(h.A,{fontSize:"24px",fontWeight:600,children:["$",(null==nw?void 0:nw.greaterThan(new p.fw(1,100)))?nw.toFixed(2,{groupSeparator:","}):"-"]}),(0,t.jsx)(f.A,{scale:"sm",disabled:!nQ||F||nA||!((null==nm?void 0:nm.greaterThan(0))||(null==nh?void 0:nh.greaterThan(0))||B),onClick:nY,children:B&&!nA?y("Collected"):nA||F?y("Collecting..."):y("Collect")})]}),(0,t.jsxs)(E.k0,{mr:"4px",style:{padding:"16px 8px"},children:[(0,t.jsxs)(m.eF,{justifyContent:"space-between",mb:"8px",children:[(0,t.jsxs)(j.A,{children:[(0,t.jsx)(_.Zm,{currency:null==nO?void 0:nO.currency}),(0,t.jsx)(h.A,{small:!0,color:"textSubtle",id:"remove-liquidity-tokenb-symbol",ml:"4px",children:null==nO||null==(l=nO.currency)?void 0:l.symbol})]}),(0,t.jsx)(j.A,{justifyContent:"center",children:(0,t.jsx)(X.g3,{amount:nO,small:!0,children:nO&&null!=(c=nu(nO,4))?c:"-"})}),(0,t.jsx)(m.JA,{justifyContent:"flex-end",children:(0,t.jsx)(h.A,{fontSize:"10px",color:"textSubtle",ml:"4px",children:nO&&n_?`~$${n_.quote(null==nO?void 0:nO.wrapped).toFixed(2,{groupSeparator:","})}`:""})})]}),(0,t.jsxs)(m.eF,{justifyContent:"space-between",children:[(0,t.jsxs)(j.A,{children:[(0,t.jsx)(_.Zm,{currency:null==nD?void 0:nD.currency}),(0,t.jsx)(h.A,{small:!0,color:"textSubtle",id:"remove-liquidity-tokenb-symbol",ml:"4px",children:null==nD||null==(r=nD.currency)?void 0:r.symbol})]}),(0,t.jsx)(j.A,{justifyContent:"center",children:(0,t.jsx)(X.g3,{amount:nD,small:!0,children:nD&&null!=(x=nc(nD,4))?x:"-"})}),(0,t.jsx)(m.JA,{justifyContent:"flex-end",children:(0,t.jsx)(h.A,{fontSize:"10px",color:"textSubtle",ml:"4px",children:nD&&nU?`~$${nU.quote(null==nD?void 0:nD.wrapped).toFixed(2,{groupSeparator:","})}`:""})})]})]})]})]})}),nV&&(0,t.jsx)(j.A,{mb:"8px",children:(0,t.jsxs)(j.A,{ml:"auto",alignItems:"center",children:[(0,t.jsxs)(h.A,{mr:"8px",children:[y("Collect as")," ",nZ]}),(0,t.jsx)(S.A,{id:"receive-as-wnative",scale:"sm",checked:Y,onChange:()=>G(e=>!e)})]})}),(0,t.jsxs)(j.A,{flexWrap:["wrap","wrap","wrap","nowrap"],children:[(0,t.jsx)(w.Ay,{width:"100%",children:(0,t.jsx)(eU,{manuallyInverted:nl,setManuallyInverted:nt,currencyQuote:na,currencyBase:nd,isMobile:nJ,priceLower:nr,inverted:ns,pool:e7,priceUpper:ni,tickAtLimit:nn})}),(0,t.jsx)(j.A,{ml:["0px","0px","16px","16px"],mt:"24px",children:(0,t.jsx)(U.l,{disabled:!nQ,outRange:!nN,notEnoughLiquidity:!!(nk&&nk.lessThan(new p.fw(BigInt(20)*nk.decimalScale*nk.denominator,null==nk?void 0:nk.denominator))),poolAddress:e3,poolProtocol:null==ne?void 0:ne.protocol,chainId:null==e7?void 0:e7.chainId})})]}),eN&&e6&&e9&&(0,t.jsx)(eZ,{tokenId:eN.tokenId.toString(),currency0:e6,currency1:e9})]})]})})]}):(eC.replace("/liquidity/positions"),null)},eZ=(0,d.memo)(function(e){let{tokenId:n,currency0:l,currency1:r}=e,{t:o}=(0,P.A)(),[s,a]=(0,d.useState)(!1),{chainId:c}=(0,i.ax)(),u=e$.Wv[c],{data:p,isPending:x}=(0,O.I)({queryKey:["positionHistory",c,n],queryFn:async()=>u?(await u.request((0,J.J1)` 2 query positionHistory($tokenId: String!) { 3 positionSnapshots(where: { position: $tokenId }, orderBy: timestamp, orderDirection: desc, first: 30) { 4 id 5 transaction { 6 mints(where: { or: [{ amount0_gt: "0" }, { amount1_gt: "0" }] }) { 7 id 8 timestamp 9 amount1 10 amount0 11 logIndex 12 } 13 burns(where: { or: [{ amount0_gt: "0" }, { amount1_gt: "0" }] }) { 14 id 15 timestamp 16 amount1 17 amount0 18 logIndex 19 } 20 collects(where: { or: [{ amount0_gt: "0" }, { amount1_gt: "0" }] }) { 21 id 22 timestamp 23 amount0 24 amount1 25 logIndex 26 } 27 } 28 } 29 } 30 `,{tokenId:n})).positionSnapshots.filter(e=>{let{transaction:n}=e;return n.mints.length>0||n.burns.length>0||n.collects.length>0}):[],enabled:!!(u&&n),refetchInterval:3e4,refetchOnReconnect:!1,refetchOnWindowFocus:!1});return!x&&(null==p?void 0:p.length)?(0,t.jsxs)(T.R,{textAlign:"center",pt:"16px",children:[(0,t.jsx)(F.d,{exp
30anded:s,onClick:()=>{a(!s)},children:o(s?"Hide":"History")}),s&&(0,t.jsxs)(T.R,{display:"grid",gap:"16px",children:[(0,t.jsxs)(T.R,{display:"grid",style:{gridTemplateColumns:"1fr 1fr 1fr"},alignItems:"center",children:[(0,t.jsx)($.y,{children:o("Timestamp")}),(0,t.jsx)($.y,{children:o("Action")}),(0,t.jsx)($.y,{children:o("Token Transferred")})]}),p.map(e=>(0,t.jsxs)(R.mm,{gap:"16px",children:[e.transaction.mints.map(e=>(0,t.jsx)(eH,{chainId:c,positionTx:e,type:"mint",currency0:l,currency1:r},e.id)),e.transaction.collects.map(n=>{let l=e.transaction.burns.find(e=>+n.amount0>=+e.amount0&&+n.amount1>=+e.amount1&&+e.logIndex<+n.logIndex);return l?l.amount0===n.amount0&&l.amount1===n.amount1?null:{...n,amount0:String(n.amount0-l.amount0),amount1:String(n.amount1-l.amount1)}:n}).filter(e=>!!e).map(e=>(0,t.jsx)(eH,{chainId:c,positionTx:e,type:"collect",currency0:l,currency1:r},e.id)),e.transaction.burns.map(e=>(0,t.jsx)(eH,{chainId:c,positionTx:e,type:"burn",currency0:l,currency1:r},e.id))]},e.id))]})]}):null}),eV={mint:(0,t.jsx)(B.x,{children:"Add Liquidity"}),burn:(0,t.jsx)(B.x,{children:"Remove Liquidity"}),collect:(0,t.jsx)(B.x,{children:"Collect fee"})};function eH(e){let{chainId:n,positionTx:l,type:r,currency0:i,currency1:o}=e,{isMobile:s}=(0,b.A)(),a="burn"!==r,c=(0,d.useMemo)(()=>K().unix(+l.timestamp),[l.timestamp]),u=(0,d.useMemo)(()=>s&&c.format("YYYY/MM/DD"),[s,c]),p=(0,d.useMemo)(()=>s&&c.format("HH:mm:ss"),[s,c]),x=(0,d.useMemo)(()=>!s&&c.toDate().toLocaleString(),[s,c]),y=(0,d.useMemo)(()=>{let e=+l.amount0;return e>0?e.toLocaleString(void 0,{maximumFractionDigits:6,maximumSignificantDigits:6}):null},[l.amount0]),A=(0,d.useMemo)(()=>{let e=+l.amount1;return e>0?e.toLocaleString(void 0,{maximumFractionDigits:6,maximumSignificantDigits:6}):null},[l.amount1]);return s?(0,t.jsxs)(w.Ay,{children:[(0,t.jsx)(m.eF,{children:(0,t.jsx)(q.A,{useBscCoinFallback:!!n&&ew.jc.includes(n),href:(0,eS.Bz)(l.id,"transaction",n),children:(0,t.jsxs)(j.A,{flexDirection:"column",alignItems:"center",children:[(0,t.jsx)(h.A,{ellipsis:!0,children:u}),(0,t.jsx)(h.A,{fontSize:"12px",children:p})]})})}),(0,t.jsx)(h.A,{children:eV[r]}),(0,t.jsxs)(R.mm,{gap:"4px",children:[+l.amount0>0&&(0,t.jsxs)(m.eF,{flexWrap:"nowrap",gap:"12px",justifyContent:"space-between",children:[(0,t.jsxs)(m.eF,{width:"auto",flexWrap:"nowrap",gap:"4px",children:[(0,t.jsx)(T.R,{minWidth:"24px",children:(0,t.jsx)(_.Zm,{currency:i})}),(0,t.jsx)(h.A,{display:["none","none","block"],children:i.symbol})]}),(0,t.jsxs)(h.A,{bold:!0,ellipsis:!0,title:l.amount0,children:[a?"+":"-"," ",y]})]}),+l.amount1>0&&(0,t.jsxs)(m.eF,{flexWrap:"nowrap",gap:"12px",justifyContent:"space-between",children:[(0,t.jsxs)(m.eF,{width:"auto",flexWrap:"nowrap",gap:"4px",children:[(0,t.jsx)(T.R,{minWidth:"24px",children:(0,t.jsx)(_.Zm,{currency:o})}),(0,t.jsx)(h.A,{display:["none","none","block"],children:o.symbol})]}),(0,t.jsxs)(h.A,{bold:!0,ellipsis:!0,title:l.amount1,children:[a?"+":"-"," ",A]})]})]})]}):(0,t.jsxs)(T.R,{display:"grid",style:{gridTemplateColumns:"1fr 1fr 1fr"},gap:"16px",alignItems:"center",borderTop:"1",p:"16px",children:[(0,t.jsx)(m.eF,{justifyContent:"center",children:(0,t.jsx)(q.A,{useBscCoinFallback:!!n&&ew.jc.includes(n),href:(0,eS.Bz)(l.id,"transaction",n),children:(0,t.jsx)(h.A,{ellipsis:!0,children:x})})}),(0,t.jsx)(h.A,{children:eV[r]}),(0,t.jsxs)(R.mm,{gap:"4px",children:[+l.amount0>0&&(0,t.jsxs)(m.eF,{flexWrap:"nowrap",justifyContent:"flex-end",gap:"12px",children:[(0,t.jsxs)(h.A,{bold:!0,ellipsis:!0,title:l.amount0,children:[a?"+":"-"," ",y]}),(0,t.jsxs)(m.eF,{width:"auto",flexWrap:"nowrap",gap:"4px",children:[(0,t.jsx)(T.R,{minWidth:"24px",children:(0,t.jsx)(_.Zm,{currency:i})}),(0,t.jsx)(h.A,{display:["none","none","block"],children:i.symbol})]})]}),+l.amount1>0&&(0,t.jsxs)(m.eF,{flexWrap:"nowrap",justifyContent:"flex-end",gap:"12px",children:[(0,t.jsxs)(h.A,{bold:!0,ellipsis:!0,title:l.amount1,children:[a?"+":"-"," ",A]}),(0,t.jsxs)(m.eF,{width:"auto",flexWrap:"nowrap",gap:"4px",children:[(0,t.jsx)(T.R,{minWidth:"24px",children:(0,t.jsx)(_.Zm,{currency:o})}),(0,t.jsx)(h.A,{display:["none","none","block"],children:o.symbol})]})]})]})]})}var eY=l(992615);let eG=()=>{let e=(0,a.useRouter)(),{tokenId:n}=e.query,{chainId:l}=(0,i.ax)();return((0,d.useEffect)(()=>{n&&"string"==typeof n&&!n.match(/^\d+$/)&&e.replace("/add")},[n,e]),e.isReady&&n&&l&&(0,r.F8)(l))?(0,t.jsx)(eN,{}):null},eK=s()(()=>Promise.resolve(eG),{ssr:!1});eK.chains=c.tx,eK.screen=!0,eK.Layout=eY._;let eJ=eK},139184:(e,n,l)=>{"use strict";l.d(n,{EO:()=>a,gI:()=>c,qP:()=>d});var t=l(350979),r=l(883927),i=l.n(r),o=l(698163),s=l(592322);let a=e=>{let{pool:n,inverted:l,showApyText:r,showApyButton:i,fontSize:a}=e,{lpApr:d,cakeApr:c,merklApr:u,incentraApr:p}=(0,o.L4)(n,l);return(0,t.jsx)(s.t,{pool:n,lpApr:d,cakeApr:c,merklApr:u,incentraApr:p,showApyText:r,showApyButton:i,fontSize:a})},d=e=>{let{pool:n,fontSize:l}=e,{lpApr:r,cakeApr:a,merklApr:d,incentraApr:c}=(0,o.tA)(n);return(0,t.jsx)(s.t,{showApyButton:!1,pool:n,lpApr:r,cakeApr:a,merklApr:d,incentraApr:c,onAPRTextClick:i(),fontSize:l})},c=e=>{let{pool:n,fontSize:l}=e,{lpApr:r,cakeApr:a,merklApr:d,incentraApr:c}=(0,o.Hi)(n);return(0,t.jsx)(s.t,{showApyButton:!1,pool:n,lpApr:r,cakeApr:a,merklApr:d,incentraApr:c,onAPRTextClick:i(),fontSize:l})}},149160:(e,n,l)=>{"use strict";l.d(n,{A:()=>c});var t=l(350979),r=l(769932),i=l(557423),o=l(501823),s=l(605641),a=l(498938);let d=(0,l(680797).I4)(i.A).withConfig({componentId:"sc-bb7aac7a-0"})(["border-radius:8px;padding-left:4px;padding-right:4px;"]);function c(e){let{currencyA:n,handleRateToggle:l}=e,{t:i}=(0,r.A)();return n?(0,t.jsxs)(o.A,{justifyContent:"center",alignItems:"center",children:[(0,t.jsx)(s.A,{mr:"4px",color:"textSubtle",children:i("View prices in")}),(0,t.jsx)(d,{variant:"secondary",scale:"sm",onClick:l,startIcon:(0,t.jsx)(a.A,{color:"primary"}),children:null==n?void 0:n.symbol})]}):null}},460379:(e,n,l)=>{"use strict";l.d(n,{A:()=>s,q:()=>o});var t=l(350979),r=l(680797),i=l(807543);let o=(0,r.I4)(i.A).withConfig({componentId:"sc-8dfcff2a-0"})(["border-radius:24px;max-width:436px;width:100%;z-index:1;"]);function s(e){let{children:n,...l}=e;return(0,t.jsx)(o,{...l,children:n})}},481675:(e,n,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/liquidity/[tokenId]",function(){return l(132763)}])},504304:(e,n,l)=>{"use strict";l.d(n,{E:()=>u});var t=l(350979),r=l(769932),i=l(579518),o=l(605641),s=l(575058),a=l(266283),d=l(810286);let c={textDecoration:"underline dotted",textUnderlineOffset:"0.1em",curs
30or:"help"},u=e=>{var n,l;let{title:u,currency0:p,currency1:x,price:m,rawPrice:h,...j}=e,{t:y}=(0,r.A)(),A=(0,d.$Y)({mode:"price",price:h}),{targetRef:f,tooltip:b,tooltipVisible:v}=(0,i.A)(A,{placement:"top"});return(0,t.jsxs)(a.k0,{...j,style:{paddingTop:"8px",paddingBottom:"8px",textAlign:"center"},children:[(0,t.jsx)(o.A,{fontSize:"12px",color:"secondary",bold:!0,textTransform:"uppercase",mb:"4px",children:u}),A?(0,t.jsxs)(t.Fragment,{children:[v&&b,(0,t.jsx)(s.A,{mb:"4px",ref:f,style:c,children:m})]}):(0,t.jsx)(s.A,{mb:"4px",children:m}),(0,t.jsx)(o.A,{fontSize:"12px",color:"textSubtle",children:y("%assetA% per %assetB%",{assetA:null!=(n=null==p?void 0:p.symbol)?n:"",assetB:null!=(l=null==x?void 0:x.symbol)?l:""})})]})}},592322:(e,n,l)=>{"use strict";l.d(n,{t:()=>C});var t=l(350979),r=l(659197),i=l(769932),o=l(312680),s=l(579518),a=l(605641),d=l(25963),c=l(303728),u=l(810498),p=l(427575),x=l(699710),m=l(302485),h=l(854951),j=l(531922),y=l(980134),A=l(427896),f=l(990296),b=l(995315),v=l(889948),g=l(694723);let w=(0,d.forwardRef)((e,n)=>{let{showApyButton:l=!0,showApyText:r=!0,loading:i,onClick:o,onAPRTextClick:s,baseApr:a,hasFarm:c,unavailableReason:u,fontSize:p="28px",color:x}=e,m=(0,d.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),o&&o()},[o]);return i?(0,t.jsx)(f.Ay,{height:24,width:80,style:{borderRadius:"12px"}}):(0,t.jsxs)(b.A,{alignItems:"center",children:[l&&(0,t.jsx)(g.X.RH,{variant:"text-and-button",handleClickButton:m}),r&&(0,t.jsx)(k,{hasFarm:c,baseApr:a,unavailableReason:u,fontSize:p,ref:n,onClick:s,color:x})]})}),k=(0,d.forwardRef)((e,n)=>{let{baseApr:l,hasFarm:r,unavailableReason:i,fontSize:o="28px",onClick:s,color:c}=e,u=(0,x.yv)(l,i),p=(0,d.useMemo)(()=>(0,t.jsx)(v.A,{ml:"4px",fontSize:o,color:"destructive",bold:!0,children:"0%"}),[o]),m=(0,d.useMemo)(()=>(0,t.jsxs)(b.A,{children:[r?(0,t.jsx)(a.A,{fontSize:o,color:c,bold:!0,children:"\uD83C\uDF3F"}):null,(0,t.jsx)(v.A,{ml:"4px",fontSize:o,color:c,bold:!0,children:"value"===u.kind?u.label:null})]}),[u,r,o,c]);return"hidden"===u.kind?null:"unavailable"===u.kind?(0,t.jsx)("span",{ref:n,onClick:s,"aria-hidden":!0,children:(0,t.jsx)(v.A,{ml:"4px",fontSize:o,color:"textSubtle",bold:!0,children:u.label})}):(0,t.jsx)("span",{ref:n,onClick:s,"aria-hidden":!0,children:"zero"===u.kind?p:m})});var I=l(863984);let C=e=>{var n,l,f;let{pool:b,lpApr:v,lpAprUnavailableReason:g,cakeApr:k,merklApr:C,incentraApr:S,userPosition:T,onAPRTextClick:F,showApyButton:$,showApyText:R,fontSize:q,color:z,clickable:M=!0}=e,{t:P}=(0,i.A)(),B=(0,d.useMemo)(()=>(0,m.h)(v,null==k?void 0:k.value,C,S),[v,null==k?void 0:k.value,C,S]),L=(0,x.b1)(g),O=b.protocol===r.Zs.V2||b.protocol===r.Zs.STABLE||b.protocol===r.Zs.InfinitySTABLE,D=(0,c.Y)({hasMerkl:!!C,chainId:b.chainId,lpAddress:b.lpAddress,poolProtocol:b.protocol}),E=(0,d.useMemo)(()=>{switch(b.protocol){case r.Zs.V2:return 4;case r.Zs.V3:return 3;case r.Zs.InfinityCLAMM:return 8;default:return}},[b.protocol]),W=(0,p.n)({hasIncentra:!!S,chainId:b.chainId,lpAddress:b.lpAddress,campaignType:E}),_=(0,o.jN)(),{tooltip:U,targetRef:N,tooltipVisible:Z}=(0,s.A)(L?(0,t.jsx)(a.A,{children:(0,x.Wx)(L,P)}):(0,t.jsx)(I.S,{combinedApr:B,cakeApr:k,lpFeeApr:null!=(n=Number(v))?n:0,merklApr:null!=(l=Number(C))?l:0,merklLink:D,incentraApr:null!=(f=Number(S))?f:0,incentraLink:W,showDesc:!0,children:O?(0,t.jsx)(I.v,{}):null}));return(0,t.jsxs)(A.L,{children:[(0,t.jsx)(w,{hasFarm:Number(null==k?void 0:k.value)>0,ref:N,baseApr:B,unavailableReason:L,onClick:M&&!L?_.onOpen:void 0,onAPRTextClick:M&&!L?null!=F?F:_.onOpen:void 0,showApyButton:!L&&$,showApyText:R,fontSize:q,color:z}),Z&&U,_.isOpen&&(0,t.jsx)(t.Fragment,{children:O?(0,t.jsx)(j.r,{modal:_,poolInfo:b,combinedApr:B,lpApr:Number(null!=v?v:0)}):b.protocol===r.Zs.V3?(0,t.jsx)(y.s,{modal:_,poolInfo:b,cakeApr:k,positionDetail:T}):(0,u.T)(b.protocol)?(0,t.jsx)(h.H,{modal:_,poolInfo:b,cakeApr:k,positionDetail:T}):null})]})}},609104:(e,n,l)=>{"use strict";l.d(n,{l:()=>v});var t=l(350979),r=l(769932),i=l(421770),o=l(579518),s=l(889948),a=l(673115),d=l(796147),c=l(24153),u=l(605641),p=l(557423),x=l(501823),m=l(226464),h=l(898719),j=l(266283),y=l(303728),A=l(427548);function f(e){let{tokenAmount:n}=e,{t:l}
30=(0,r.A)(),{tooltip:i,tooltipVisible:a,targetRef:d}=(0,o.A)(l("Combined number of rewards in %symbol% from ALL your positions which are eligible for Merkl rewards.",{symbol:n.currency.symbol}),{placement:"top",trigger:"hover"});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.A,{ref:d,small:!0,children:n.toSignificant(6)}),a&&i]})}let b=()=>{let{t:e}=(0,r.A)();return(0,t.jsx)(a.A,{color:"currentColor",fontSize:"md",external:!0,style:{display:"inline-flex"},href:"https://docs.merkl.xyz/",children:e("Learn more about Merkl")})};function v(e){let{poolAddress:n,poolProtocol:l,chainId:o,notEnoughLiquidity:s,outRange:v,disabled:g}=e,{t:w}=(0,r.A)(),{claimTokenReward:k,isClaiming:I,rewardsPerToken:C,hasMerkl:S}=(0,A.Ay)(n),T=(0,y.Y)({hasMerkl:S,chainId:o,lpAddress:n,poolProtocol:l});return!C.length||!S&&C.every(e=>e.equalTo("0"))?null:(0,t.jsxs)(d.VP,{justifyContent:"space-between",gap:"8px",width:"100%",children:[(0,t.jsxs)(c.eF,{justifyContent:"space-between",children:[(0,t.jsx)(u.A,{fontSize:"12px",color:"secondary",bold:!0,textTransform:"uppercase",children:w("Merkl Rewards")}),(0,t.jsx)(p.A,{disabled:g||I||C.every(e=>e.equalTo("0")),scale:"sm",onClick:k,children:w(I?"Claiming...":"Claim")})]}),(0,t.jsx)(j.k0,{mr:"4px",padding:"16px 8px",children:C.map(e=>(0,t.jsxs)(c.eF,{justifyContent:"space-between",children:[(0,t.jsxs)(x.A,{children:[(0,t.jsx)(h.Z,{currency:e.currency}),(0,t.jsx)(u.A,{small:!0,color:"textSubtle",id:"remove-liquidity-tokenb-symbol",ml:"4px",children:e.currency.symbol})]}),(0,t.jsx)(x.A,{justifyContent:"center",children:(0,t.jsx)(f,{tokenAmount:e})})]}))}),v?(0,t.jsx)(m.A,{variant:"warning",children:(0,t.jsxs)(m.J,{color:"textSubtle",children:[w("This Merkl campaign is NOT rewarding out-of-range liquidity. To earn rewards, adjust your position."),(0,t.jsx)("br",{}),(0,t.jsx)(b,{})]})}):S?(0,t.jsx)(m.A,{variant:s?"warning":"primary",children:(0,t.jsxs)(m.J,{color:s?"textSubtle":"",children:[(0,t.jsx)(i.x,{i18nKey:s?"This liquidity position will NOT earn any rewards on Merkl due to its total USD value being less than $20. Details <0>here</0>":"This liquidity position is currently earning rewards on Merkl. Details <0>here</0>",components:[(0,t.jsx)(a.A,{fontSize:"md",external:!0,color:"currentColor",style:{display:"inline-flex"},href:null!=T?T:"https://merkl.angle.money/?search=PancakeSwap&status=live%2Csoon"})]}),(0,t.jsx)("br",{}),(0,t.jsx)(b,{})]})}):null]})}},720584:(e,n,l)=>{"use strict";l.d(n,{_:()=>t._z});var t=l(40064)},776484:(e,n,l)=>{"use strict";l.d(n,{C:()=>y});var t=l(350979),r=l(659197),i=l(769932),o=l(796147),s=l(605641),a=l(990296),d=l(25963),c=l(437862),u=l(662928),p=l(529208),x=l(64751),m=l(70619),h=l(49393);let j=e=>{let{children:n,pool:l}=e,{t:r}=(0,i.A)(),a=(0,d.useMemo)(()=>`${l.chainId}:${l.lpAddress}`,[l.chainId,l.lpAddress]),{cakeApr:u}=(0,c.nY)(a,l),p=(null==u?void 0:u.value)!=="0";return(0,t.jsxs)(o.VP,{gap:"8px",alignItems:"flex-end",children:[(0,t.jsx)(s.A,{color:"textSubtle",fontSize:"12px",children:r(p?"APR (with farming)":"APR")}),n]})};function y(e){let{pool:n,tokenId:l,showTitle:r=!0,derived:i,inverted:o,showApyText:s,showApyButton:a,fontSize:d}=e;return i?(0,t.jsx)(f,{pool:n,showTitle:r,inverted:o,showApyText:s,showApyButton:a,fontSize:d}):l?(0,t.jsx)(b,{pool:n,tokenId:l,showTitle:r}):(0,t.jsx)(A,{pool:n,showTitle:r})}let A=e=>{let{pool:n,showTitle:l}=e;return n?l?(0,t.jsx)(j,{pool:n,children:(0,t.jsx)(m.rr,{pool:n})}):(0,t.jsx)(m.rr,{pool:n}):(0,t.jsx)(a.Ay,{height:"40px"})},f=e=>{let{pool:n,inverted:l,showTitle:i,showApyText:o,showApyButton:s,fontSize:d}=e;return n?n.protocol!==r.Zs.V3?(0,t.jsx)(A,{pool:n,showTitle:i}):i?(0,t.jsx)(j,{pool:n,children:(0,t.jsx)(h.EO,{pool:n,inverted:l,showApyText:o,showApyButton:s,fontSize:d})}):(0,t.jsx)(h.EO,{pool:n,inverted:l,showApyText:o,showApyButton:s,fontSize:d}):(0,t.jsx)(a.Ay,{height:"40px"})},b=e=>{let{pool:n,tokenId:l,showTitle:r}=e,{data:i}=((e,n)=>(0,u.I)({queryKey:["accountV3Position",e,null==n?void 0:n.toString()],queryFn:()=>(0,x.Pm)(e,[n]),select:(0,d.useCallback)(e=>e[0],[]),enabled:!!n&&!!e,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchInterval:p.IX,staleTime:p.IX}))(null==n?void 0:n.chainId,l);return n&&i&&n&&i?r?(0,t.jsx)(j,{pool:n,children:(0,t.jsx)(m._o,{userPosition:i,pool:n})}):(0,t.jsx)(m._o,{userPosition:i,pool:n}):(0,t.jsx)(a.Ay,{height:"40px"})}},841376:(e,n,l)=>{"use strict";l.d(n,{Q:()=>y.A,j:()=>j});var t=l(350979),r=l(680797),i=l(501823),o=l(24153),s=l(28192),a=l(821410),d=l(575058),c=l(525033),u=l(605641),p=l(764289),x=l.n(p);let m=(0,r.I4)(i.A).withConfig({componentId:"sc-aebf056a-0"})(["align-items:center;justify-content:space-between;padding:24px;width:100%;border-bottom:1px solid ",";",""],e=>{let{theme:n}=e;return n.colors.cardBorder},e=>{let{borderHidden:n}=e;return n&&(0,r.AH)(["border-bottom:1px solid transparent;"])}),h=(0,r.I4)(o.eF).withConfig({componentId:"sc-aebf056a-1"})(["padding-top:16px;margin-top:16px;border-top:1px solid ",";"],e=>{let{theme:n}=e;return n.colors.cardBorder}),j=e=>{let{title:n,subtitle:l,helper:r,backTo:o,noConfig:p=!1,IconSlot:j=null,buttons:y,filter:A,shouldCenter:f=!1,borderHidden:b=!1}=e;return(0,t.jsx)(m,{borderHidden:b,children:(0,t.jsxs)(i.A,{alignItems:"center",width:"100%",style:{gap:"16px"},children:[o&&("string"==typeof o?(0,t.jsx)(x(),{href:o,children:(0,t.jsx)(s.A,{as:"div",scale:"sm",children:(0,t.jsx)(a.A,{width:"32px"})})}):(0,t.jsx)(s.A,{scale:"sm",variant:"text",onClick:o,children:(0,t.jsx)(a.A,{width:"32px"})})),(0,t.jsxs)(i.A,{pr:o&&f?"48px":"",flexDirection:"column",width:"100%",marginTop:"4px",children:[(0,t.jsxs)(i.A,{mb:"8px",alignItems:"center",flexWrap:"wrap",justifyContent:"space-between",style:{gap:"16px"},children:[(0,t.jsxs)(i.A,{flex:1,justifyContent:f?"center":"",children:["string"==typeof n?(0,t.jsx)(d.A,{as:"h2",children:n}):n,r&&(0,t.jsx)(c.PT,{text:r,ml:"4px",placement:"top"})]}),p&&y&&(0,t.jsx)(i.A,{alignItems:"center",mr:"16px",children:y}),p&&j&&(0,t.jsx)(i.A,{alignItems:"center",children:j})]}),l&&(0,t.jsx)(i.A,{alignItems:"center",justifyContent:f?"center":"",children:(0,t.jsx)(u.A,{textAlign:f?"center":"inherit",color:"textSubtle",fontSize:"14px",children:l})}),A&&(0,t.jsx)(h,{justifyContent:"space-between",gap:"8px",children:A})]})]})})};var y=l(460379)},876089:(e,n,l)=>{"use strict";l.d(n,{A:()=>p});var t=l(350979),r=l(680797),i=l(25963),o=l(769932),s=l(178405),a=l(575058),d=l(605641),c=l(557423);let u=r.I4.div.withConfig({componentId:"sc-7851d89b-0"})(["align-items:center;display:flex;flex-direction:column;height:calc(100vh - 64px);justify-content:center;"]),p=e=>{let{statusCode:n=404,children:l,LinkComp:r}=e,{t:p}=(0,o.A)(),x=(0,i.createElement)(r,{href:"/",passHref:!0},(0,t.jsx)(c.A,{scale:"sm",children:p("Back Home")}));return(0,t.jsxs)(t.Fragment,{children:[l,(0,t.jsxs)(u,{children:[(0,t.jsx)(s.A,{width:"64px",mb:"8px"}),(0,t.jsx)(a.A,{scale:"xxl",children:n}),(0,t.jsx)(d.A,{mb:"16px",children:p("Oops, page not found.")}),x]})]})}},927122:(e,n,l)=>{"use strict";l.d(n,{A:()=>a});var t=l(350979),r=l(680797),i=l(554945),o=l(814795);let s=(0,r.I4)(o.A).withConfig({componentId:"sc-c1354ddc-0"})(["display:flex;justify-content:center;align-items:center;"]),a=()=>(0,t.jsx)(s,{children:(0,t.jsx)(i.A,{})})},961862:(e,n,l)=>{"use strict";l.d(n,{N:()=>a});var t=l(543337),r=l(659197),i=l(421479),o=l(662928),s=l(25963);let a=e=>{let{data:n}=(0,o.I)({queryKey:["fetch-v3-farm-api"],queryFn:async()=>
30{if(e){let n=await (0,t.v)(e,r.Zs.V3);return(0,i.b)(n)}return[]},enabled:!!e,refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1});return{farms:(0,s.useMemo)(()=>null!=n?n:[],[n])}}},992615:(e,n,l)=>{"use strict";l.d(n,{A:()=>c,_:()=>u});var t=l(350979),r=l(228876),i=l(769932),o=l(720584),s=l(529208),a=l(53670);let d=e=>{let{children:n,removePadding:l=!1,hideFooterOnDesktop:d=!1,noMinHeight:c=!1,helpUrl:u=s.Bq,showExternalLink:p=!0,showHelpLink:x=!0,...m}=e,{t:h}=(0,i.A)(),{chainId:j}=(0,a.ax)(),y=j===r.nU.BSC,A=y?h("Bridge assets to BNB Chain"):"";return(0,t.jsx)(o._.YW,{removePadding:l,noMinHeight:c,hideFooterOnDesktop:d,helpUrl:x?u:void 0,externalText:A,externalLinkUrl:p?y?"https://bridge.pancakeswap.finance/":"":void 0,...m,children:n})},c=d,u=d;u.defaultProps={showHelpLink:!1,showExternalLink:!1}}},e=>{e.O(0,[7964,3821,5139,7578,3732,4306,4374,3892,2845,7121,7061,9596,2141,3577,6341,8516,2806,6270,7881,143,2259,3387,6175,2299,7969,7618,2560,7212,1480,6335,4711,9818,7635,64,2775,8269,6283,5018,9508,4712,7287,4641,8686,8837,6010,4522,4586,2911,2269,3484,770,245,7094,7869,2457,1729,7207,6763,3189,604,636,6593,8792],()=>e(e.s=481675)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.