PageSourceSearch

https://pancakeswap.finance/_next/static/chunks/2269-7bd413f679e52353.js

js pancakeswap.finance collected 2026-09-24 08:43:35 UTC 29,366 bytes, 1 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ad87c542-c130-4127-b85e-07f51b580d9c",e._sentryDebugIdIdentifier="sentry-dbid-ad87c542-c130-4127-b85e-07f51b580d9c")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2269,7168],{115843:(e,t,n)=>{n.d(t,{A:()=>q});var l=n(350979),r=n(25963),i=n(48099),s=n(96278),o=n(735872),a=n(334804),d=n(680797),u=n(442828),c=n(179087),p=n(769932),x=n(311560),h=n(3197),g=n(857036),m=n(966983),v=n(282304),f=n(605641),j=n(995315),A=n(490233),I=n(38395),y=n(249452),b=n(129166),w=n(102342),C=n(830640),k=n(842807),S=n(796147),L=n(979332),T=n(962478),D=n(501823),E=n(399832),M=n(310085),N=n(557423),U=n(721745),_=n(862373),O=n(118708),R=n(954335),F=n(619749);let Y=function(e){let{tokens:t,handleCurrencySelect:n}=e,{t:i}=(0,p.A)(),[s,o]=(0,r.useState)(!1),[a]=(0,O.fp)(_.fk),{addUserToken:d}=(0,R.F)();return(0,l.jsxs)(S.mm,{gap:"lg",children:[(0,l.jsx)(w._,{}),t.map(e=>{let t=e.address?`${(0,U.A)(e.address)}`:null;return(0,l.jsxs)(j.A,{gap:"4px",flexDirection:"column",children:[(0,l.jsx)(L.A,{variant:"failure",outline:!0,scale:"sm",startIcon:(0,l.jsx)(T.A,{color:"failure"}),children:i("Unknown Source")}),(0,l.jsxs)(D.A,{alignItems:"center",children:[(0,l.jsx)(f.A,{mr:"8px",children:e.name||e.symbol}),(0,l.jsxs)(f.A,{children:["(",e.symbol,")"]})]}),(0,l.jsxs)(D.A,{justifyContent:"space-between",width:"100%",children:[(0,l.jsx)(f.A,{mr:"4px",children:t}),(0,l.jsx)(E.A,{href:`${a.host}/token/${e.address}`,children:i("View on %site%",{site:"Solana Explorer"})})]})]},e.address)}),(0,l.jsxs)(D.A,{justifyContent:"space-between",alignItems:"center",children:[(0,l.jsxs)(D.A,{alignItems:"center",onClick:()=>o(!s),children:[(0,l.jsx)(M.A,{scale:"sm",name:"confirmed",type:"checkbox",checked:s,onChange:()=>o(!s)}),(0,l.jsx)(f.A,{ml:"8px",style:{userSelect:"none"},children:i("I understand")})]}),(0,l.jsx)(N.A,{variant:"danger",disabled:!s,onClick:()=>{t.forEach(e=>{d((0,F.sI)(e))}),n&&n(t[0])},className:".token-dismiss-button",children:i("Import")})]})]})},B=(0,d.I4)(m.Bs).withConfig({componentId:"sc-7e443008-0"})(["width:100%;min-width:320px;min-height:calc(var(--vh,1vh) * 90);","{max-width:420px !important;min-height:auto;}"],e=>{let{theme:t}=e;return t.mediaQueries.sm}),K=(0,d.I4)(m.rQ).withConfig({componentId:"sc-7e443008-1"})(["border:none;"]),z=(0,d.I4)(m.cw).withConfig({componentId:"sc-7e443008-2"})(["padding:4px 24px 24px;max-height:calc(90vh);overflow-y:",";-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"],e=>{let{$allowScroll:t}=e;return t?"auto":"hidden"});function q(e){var t,n,d;let{supportCrossChain:S=!1,onDismiss:L=()=>null,onCurrencySelect:T,selectedCurrency:D,otherSelectedCurrency:E,commonBasesType:M,tokensToShow:N,modalTitle:U,showCommonBases:_=!0,showSearchInput:O,searchInputPlaceholder:R,showCurrencyInHeader:F=!1,showSearchHeader:q,mode:P,showNative:V=!0,showMultichainBalances:W=!1,enableMultichainSearch:Q=!1,currencyStatus
1Map:G,allowedChainIds:H,showNativeChainIds:Z,showNativeAfterTokens:$,nativeInsertIndex:X,onChainSelect:J,preserveChainOrder:ee}=e,[et,en]=(0,r.useState)(k.Yg.search),[el,er]=(0,r.useState)(null!=(d=null!=(n=null==D?void 0:D.chainId)?n:null==E?void 0:E.chainId)?d:null==H?void 0:H[0]),ei=(0,r.useCallback)(e=>{null==L||L(),null==T||T(e)},[L,T]),es=(0,c.Sz)(et),[eo,ea]=(0,r.useState)(),[ed,eu]=(0,r.useState)(),[ec,ep]=(0,r.useState)(),{t:ex}=(0,p.A)(),[,eh]=(0,a.pE)(),eg=(0,o.mC)(),em=!!(ec&&(null==(t=eg[ec])?void 0:t.loadingRequestId)),ev=(0,g.jU)(eh),[ef,ej]=(0,r.useState)(null),eA=(0,r.useCallback)(()=>{!em&&ec&&(ej(null),ev(ec).then(()=>{eh((0,g.c6)(ec)),en(k.Yg.manage)}).catch(e=>{ej(e.message),eh((0,g.tK)(ec))}))},[em,eh,ev,ec]),eI=(0,r.useMemo)(()=>({[k.Yg.search]:{title:ex("Select a Token"),onBack:void 0},[k.Yg.manage]:{title:ex("Manage Tokens"),onBack:()=>en(k.Yg.search)},[k.Yg.importToken]:{title:ex("Import Tokens"),onBack:()=>en(es&&es!==k.Yg.importToken?es:k.Yg.search)},[k.Yg.importList]:{title:ex("Import List"),onBack:()=>en(k.Yg.search)}}),[ex,es]),ey=(0,r.useRef)(null),[eb,ew]=(0,r.useState)(void 0);return(0,r.useEffect)(()=>{let e=ey.current;if(!e)return;let t=()=>ew(e.offsetHeight-300);t();let n="undefined"!=typeof ResizeObserver?new ResizeObserver(t):void 0;return null==n||n.observe(e),window.addEventListener("resize",t),window.addEventListener("orientationchange",t),()=>{null==n||n.disconnect(),window.removeEventListener("resize",t),window.removeEventListener("orientationchange",t)}},[]),(0,l.jsxs)(B,{dragConstraints:{top:0,bottom:600},dragElastic:{top:0},dragSnapToOrigin:!0,onDragStart:()=>{ey.current&&(ey.current.style.animation="none")},onDragEnd:(e,t)=>{t.velocity.y>v.G8&&L&&L()},ref:ey,children:[(!q||et!==k.Yg.search)&&(0,l.jsxs)(K,{children:[(0,l.jsxs)(m.wt,{children:[eI[et].onBack&&(0,l.jsx)(m.jR,{onBack:eI[et].onBack}),F&&D?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(I.Z,{size:"32px",showChainLogo:S,currency:D,style:{borderRadius:"50%"}}),(0,l.jsx)(f.A,{px:"8px",bold:!0,fontSize:"20px",children:(0,u.En)(D.wrapped.address,D.chainId,D.symbol)}),!D.isNative&&(0,l.jsxs)(j.A,{gap:"8px",alignItems:"center",children:[(0,l.jsx)(A.i,{"data-dd-action-name":"Copy token address",width:"16px",buttonColor:"textSubtle",text:D.wrapped.address,tooltipMessage:ex("Token address copied"),defaultTooltipMessage:ex("Copy token address"),tooltipPlacement:"top"}),(0,l.jsx)(s.k,{address:D.wrapped.address,chainId:D.chainId,type:"token",color:"textSubtle",width:"18px",tooltipPlacement:"top"}),(0,l.jsx)(i.A,{"data-dd-action-name":"Add to wallet",variant:"text",p:"0",height:"auto",width:"fit-content",tokenAddress:D.wrapped.address,tokenSymbol:D.symbol,tokenDecimals:D.decimals,tokenLogo:D.wrapped instanceof h.Xs?D.wrapped.logoURI:void 0,tooltipPlacement:"top"})]})]}):(0,l.jsx)(f.A,{fontSize:"18px",bold:!0,children:eI[et].title})]}),(0,l.jsx)(m.s_,{onDismiss:L})]}),(0,l.jsx)(z,{$allowScroll:et===k.Yg.importToken||et===k.Yg.manage,children:et===k.Yg.search?(0,l.jsx)(b.A,{onSettingsClick:()=>en(k.Yg.manage),supportCrossChain:S,onCurrencySelect:ei,selectedCurrency:D,otherSelectedCurrency:E,showCommonBases:_,commonBasesType:M,showSearchInput:O,searchInputPlaceholder:R,showImportView:()=>en(k.Yg.importToken),setImportToken:ea,height:eb,tokensToShow:N,showChainLogo:S,showSearchHeader:q,headerTitle:U,onDismiss:L,mode:P,setSelectedChainId:er,selectedChainId:el,showNative:V,showMultichainBalances:W,enableMultichainSearch:Q,currencyStatus
1Map:G,allowedChainIds:H,showNativeChainIds:Z,showNativeAfterTokens:$,nativeInsertIndex:X,onChainSelect:J,preserveChainOrder:ee}):et===k.Yg.importToken&&eo?eo instanceof x.xx?(0,l.jsx)(Y,{tokens:[eo],handleCurrencySelect:ei}):(0,l.jsx)(w.A,{tokens:[eo],handleCurrencySelect:ei}):et===k.Yg.importList&&ed&&ec?(0,l.jsx)(y.q,{onAddList:eA,addError:ef,listURL:ec,listLogoURI:null==ed?void 0:ed.logoURI,listName:null==ed?void 0:ed.name,listTokenLength:null==ed?void 0:ed.tokens.length}):et===k.Yg.manage?(0,l.jsx)(C.A,{setModalView:en,setImportToken:ea,setImportList:eu,setListUrl:ep,chainId:el}):null})]})}},157852:(e,t,n)=>{n.d(t,{Hq:()=>o,Qv:()=>s,UT:()=>r,aO:()=>i});var l=n(985148);let r=(0,l.eU)({bestOrder:void 0,tradeLoaded:!1,tradeError:void 0,refreshDisabled:!1,refreshOrder:()=>{},refreshTrade:()=>{},pauseQuoting:()=>{},resumeQuoting:()=>{}}),i=(0,l.eU)(!1),s=(0,l.eU)(!1),o=(0,l.eU)(e=>{let t=e(r),n=e(s);return{...t,tradeLoaded:!n&&t.tradeLoaded}})},286844:(e,t,n)=>{n.d(t,{G:()=>l.G});var l=n(289062)},361938:(e,t,n)=>{n.d(t,{U:()=>l.U});var l=n(712639)},547725:(e,t,n)=>{n.d(t,{A:()=>i});var l=n(350979);n(25963);var r=n(257057);let i=e=>(0,l.jsx)(r.A,{viewBox:"0 0 24 24",...e,children:(0,l.jsx)("path",{d:"M8.13107 21.6744L6.67407 19.2732L3.95382 18.6542C3.68865 18.5964 3.47849 18.4659 3.32332 18.2629C3.16799 18.0601 3.10699 17.8241 3.14032 17.5549L3.39032 14.7657L1.53932 12.6897C1.36532 12.4784 1.27832 12.2484 1.27832 11.9999C1.27832 11.7514 1.36532 11.5215 1.53932 11.3102L3.39032 9.23419L3.14032 6.44493C3.10699 6.17577 3.16799 5.93977 3.32332 5.73693C3.47849 5.53393 3.68865 5.40352 3.95382 5.34569L6.67407 4.72669L8.13107 2.32544C8.26374 2.11427 8.45115 1.96519 8.69332 1.87819C8.93549 1.79119 9.1809 1.79535 9.42957 1.89069L11.9996 3.00369L14.5696 1.89069C14.8182 1.79535 15.0637 1.79119 15.3058 1.87819C15.548 1.96519 15.7354 2.11427 15.8681 2.32544L17.3251 4.72669L20.0453 5.34569C20.3105 5.40352 20.5207 5.53393 20.6758 5.73693C20.8312 5.93977 20.8922 6.17577 20.8588 6.44493L20.6088 9.23419L22.4598 11.3102C22.6338 11.5215 22.7208 11.7514 22.7208 11.9999C22.7208 12.2484 22.6338 12.4784 22.4598 12.6897L20.6088 14.7657L20.8588 17.5549C20.8922 17.8241 20.8312 18.0601 20.6758 18.2629C20.5207 18.4659 20.3105 18.5964 20.0453 18.6542L17.3251 19.2732L15.8681 21.6744C15.7354 21.8856 15.548 22.0347 15.3058 22.1217C15.0637 22.2087 14.8182 22.2045 14.5696 22.1092L11.9996 20.9962L9.42957 22.1092C9.1809 22.2045 8.93549 22.2087 8.69332 22.1217C8.45115 22.0347 8.26374 21.8856 8.13107 21.6744ZM11.9996 17.0032C12.2974 17.0032 12.5507 16.8988 12.7596 16.6899C12.9684 16.4811 13.0728 16.2278 13.0728 15.9299C13.0728 15.6321 12.9684 15.3777 12.7596 15.1667C12.5507 14.9559 12.2974 14.8504 11.9996 14.8504C11.7017 14.8504 11.4484 14.9559 11.2396 15.1667C11.0307 15.3777 10.9263 15.6321 10.9263 15.9299C10.9263 16.2278 11.0307 16.4811 11.2396 16.6899C11.4484 16.8988 11.7017 17.0032 11.9996 17.0032ZM11.9996 13.2119C12.2854 13.2119 12.5298 13.1104 12.7328 12.9074C12.9357 12.7046 13.0371 12.4603 13.0371 12.1744V8.11194C13.0371 7.8261 12.9357 7.58169 12.7328 7.37869C12.5298 7.17585 12.2854 7.07443 11.9996 7.07443C11.7137 7.07443 11.4693 7.17585 11.2663 7.37869C11.0635 7.58169 10.9621 7.8261 10.9621 8.11194V12.1744C10.9621 12.4603 11.0635 12.7046 11.2663 12.9074C11.4693 13.1104 11.7137 13.2119 11.9996 13.2119Z",fill:"currentColor"})})},657168:(e,t,n)=>{n.d(t,{i1:()=>C,$E:()=>k,II:()=>S});var l=n(350979),r=n(769932),i=n(995315),s=n(557423),o=n(796898),a=n(501823),d=n(428089),u=n(727353),c=n(605641),p=n(226464),x=n(525033);n(862373);var h=n(25963),g=n(733775),m=n(286844);n(775517);var v=n(772763),f=n(680797);let j=(0,f.Ay)(s.A).attrs({variant:"tertiary"}).withConfig({componentId:"sc-bf492518-0"})(["border-radius:",";height:",";color:",";border:",";"],e=>{let{theme:t}=e;return t.radii["12px"]},e=>{let{$height:t}=e;return null!=t?t:"40px"},e=>{let{theme:t,variant:n}=e;return"text"===n?t.colors.primary60:"text"},e=>{let{theme:t,variant:n}=e;
1return"text"===n?`2px solid ${t.colors.primary}`:""}),A=(0,f.Ay)(i.A).attrs({flexWrap:"wrap",gap:"4px"}).withConfig({componentId:"sc-6e208a1d-0"})(["background-color:",";border-radius:",";padding:1px;width:fit-content;box-shadow:",";"],e=>{let{theme:t}=e;return t.colors.input},e=>{let{theme:t}=e;return t.radii.default},e=>{let{theme:t}=e;return t.shadows.inset}),I=(0,f.Ay)(s.A).withConfig({componentId:"sc-6e208a1d-1"})(["height:48px;padding:0 8px;","{height:52px;padding:0 16px;}"],e=>{let{theme:t}=e;return t.mediaQueries.md}),y=(0,f.Ay)(m.G).attrs(e=>{let{theme:t}=e;return{bg:t.colors.inputSecondary}}).withConfig({componentId:"sc-6e208a1d-2"})(["margin:0 4px;"]);var b=function(e){return e.InvalidInput="InvalidInput",e}(b||{});let w=RegExp("^\\d*(?:\\\\[.])?\\d*$"),C=50,k=e=>{let t,{slippageTolerance:n,setSlippageTolerance:s,isAutoSlippageEnabled:x,setIsAutoSlippageEnabled:m}=e,[v,f]=(0,h.useState)(""),{isMobile:j}=(0,o.A)(),{t:b}=(0,r.A)(),k=""===v||(n/100).toFixed(2)===Number.parseFloat(v).toFixed(2);t=""===v||k?k&&n<50?"RiskyLow":k&&n>2e3?"RiskyVeryHigh":k&&n>100?"RiskyHigh":void 0:"InvalidInput";let S=e=>{if(""===e||w.test((0,g.Nt)(e))){f(e);try{let t=Number.parseInt((100*Number.parseFloat(e)).toString());!Number.isNaN(t)&&t<5e3&&s(t)}catch(e){console.error(e)}}};return(0,l.jsx)(i.A,{flexDirection:"column",gap:"24px",children:(0,l.jsxs)(a.A,{flexDirection:"column",children:[(0,l.jsxs)(A,{style:{flexWrap:j?"nowrap":"wrap"},children:[void 0!==m&&void 0!==x&&(0,l.jsx)(I,{scale:"sm",onClick:()=>{f(""),null==m||m(!0)},variant:x?"subtle":"light",children:b("Auto")}),(0,l.jsx)(I,{scale:"sm",onClick:()=>{f(""),s(10),null==m||m(!1)},variant:10!==n||x?"light":"subtle",children:"0.1%"}),(0,l.jsx)(I,{scale:"sm",onClick:()=>{f(""),s(50),null==m||m(!1)},variant:50!==n||x?"light":"subtle",children:"0.5%"}),(0,l.jsx)(I,{scale:"sm",onClick:()=>{f(""),s(100),null==m||m(!1)},variant:100!==n||x?"light":"subtle",children:"1.0%"}),(0,l.jsx)(a.A,{ml:"8px",pr:"8px",alignItems:"center",children:(0,l.jsxs)(d.Ay,{position:"relative",width:"82px",children:[(0,l.jsx)(u.A,{scale:"md",inputMode:"decimal",pattern:"^[0-9]*[.,]?[0-9]{0,2}$",placeholder:x?"Auto":(n/100).toFixed(2),value:v,onBlur:()=>{S((n/100).toFixed(2))},onChange:e=>{x&&(null==m||m(!1)),e.currentTarget.validity.valid&&S(e.target.value.replace(/,/g,"."))},isWarning:!k,isSuccess:![10,50,100].includes(n),style:{paddingRight:"28px"}}),(0,l.jsxs)(a.A,{position:"absolute",right:"8px",top:"8px",alignItems:"center",children:[(0,l.jsx)(y,{}),(0,l.jsx)(c.A,{color:"textSubtle",children:" %"})]})]})})]}),!x&&!!t&&(0,l.jsx)(p.A,{mt:"8px",variant:"InvalidInput"===t?"primary":"RiskyLow"===t||"RiskyHigh"===t?"warning":"danger",children:(0,l.jsxs)(c.A,{children:[b("InvalidInput"===t?"Enter a valid slippage percentage":"RiskyLow"===t?"Your transaction may fail":"Your transaction may be frontrun"),".",(0,l.jsx)("br",{}),(0,l.jsx)(c.A,{as:"button",role:"button",onClick:()=>{f(""),s(C)},style:{textDecoration:"underline",cursor:"pointer",display:"inline-block",background:"none",border:"none",padding:0},bold:!0,children:b("Reset slippage settings")})," ",b("to avoid potential loss"),"."]})})]})})},S=()=>{let{t:e}=(0,r.A)(),[t,n]=(0,v.d)(),[i,s]=(0,h.useState)(),[o,p]=(0,h.useState)(""),g=""===o||void 0!==t&&(Number(t)/60).toString()===o,m=void 0!==n&&void 0!==t,f=e=>{try{let t=60*Number.parseInt(e);!Number.isNaN(t)&&t>60&&t<259200?null==n||n(t):s("InvalidInput")}catch(e){console.error(e)}};return(0,h.useEffect)(()=>{""===o||g?s(void 0):s("InvalidInput")},[o,g]),m&&(0,l.jsxs)(d.Ay,{children:[(0,l.jsxs)(a.A,{alignItems:"center",children:[(0,l.jsx)(c.A,{children:e("Tx deadline")}),(0,l.jsx)(x.PT,{text:e("Your transaction will revert if it is left confirming for longer than this time."),placement:"top",ml:"4px"})]}),(0,l.jsxs)(a.A,{alignItems:"center",children:[(0,l.jsxs)(d.Ay,{position:"relative",width:"128px",mt:"4px",children:[(0,l.jsx)(u.A,{scale:"md",inputMode:"numeric",pattern:"^[0-9]+$",isWarning:!!i,placeholder:(Number(t)/60).toString(),value:o,onChange:e=>{e.currentTarget.validity.valid&&p(e.target.value)},onBlur:e=>{e.currentTarget.validity.valid&&f(e.target.value)},style:{paddingRight:"48px"}}),(0,l.jsxs)(a.A,{position:"absolute",right:"8px",top:"8px",alignItems:"center",children:[(0,l.jsx)(y,{}),(0,l.jsx)(c.A,{color:"textSubtle",children:e("Mins")})]})]}),(0,l.jsx)(j,{ml:"8px",mt:"3px",variant:"text",scale:"sm",onClick:()=>{p(""),f("20")},children:e("Reset")})]})]})}},663936:(e,t,n)=>{n.d(t,{I:()=>a});var l=n(228876),r=n(760013),i=n.n(r),s=n(784027),o=n(18468);let a=i()(e=>{var t;return e?(0,s.R)((null==(t=o.Bt.find(t=>
1t.id===e))?void 0:t.name)||(0,l.hL)(e)):"Unknown Chain"})},724152:(e,t,n)=>{n.d(t,{A:()=>l});let l=n(421770).x},775517:(e,t,n)=>{n.d(t,{eF:()=>F,Nt:()=>_,Az:()=>O,jw:()=>R});var l=n(350979),r=n(987212),i=n(734658),s=n(862373),o=n(985148),a=n(118708),d=n(656862),u=n(863064),c=n(25963),p=n(387165),x=n(228876),h=n(311560),g=n(91168),m=n(899188),v=n(968349),f=n(662928),j=n(126294),A=n(518400),I=n(419041),y=n(630806);let b=new h.QE(50,1e4),w=new h.QE(10,1e4),C=e=>!!e&&m.e6.includes(e),k=e=>null!=e&&"gasUseEstimate"in e&&!("orderInfo"in e),S=(e,t)=>e&&"number"==typeof t?new g.g(e.toString()).multipliedBy(t):void 0,L=(e,t)=>e&&t?parseFloat(e.toFixed(0))/10**t.decimals:void 0,T=(e,t)=>new h.QE(Math.floor(e/t*1e4),1e4),D=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:500;return e.greaterThan(new h.QE(n,1e4))?new h.QE(n,1e4):e.lessThan(new h.QE(t,1e4))?new h.QE(t,1e4):e};function E(e){var t,n;let{chainId:l}=(0,v.ax)(),r=C(l),i=(0,A.YW)(),s=(0,I.Ay)(l),o=null==e?void 0:e.currency,a=(0,y.r0)(o,{enabled:!!(null==e?void 0:e.greaterThan(0))}),d=(0,c.useMemo)(()=>L(S(null==i?void 0:i.toString(),2e5),s),[i,s]),u=(0,y.h1)(s,d,{enabled:!!(null==e?void 0:e.greaterThan(0))}),{data:p}=(0,f.I)({queryKey:["input-based-auto-slippage",null==e||null==(t=e.wrapped)?void 0:t.toExact(),null==a||null==(n=a.wrapped)?void 0:n.toSignificant(),u],queryFn:()=>{if(!e||r)return{inputBasedSlippage:b,inputDollarValue:void 0};let t=null==e?void 0:e.toSignificant(6),n=t&&a?parseFloat(t)*parseFloat(a.toSignificant(6)):void 0;return n&&u?{inputBasedSlippage:D(T(u,n)),inputDollarValue:n}:{inputBasedSlippage:b,inputDollarValue:void 0}},placeholderData:j.rX,staleTime:1/0,gcTime:0});return null!=p?p:{inputBasedSlippage:b,inputDollarValue:void 0}}let M=(0,d.tG)("pcs:auto-slippage-enabled-2",!0),N=(0,o.eU)(50),U=()=>(0,a.fp)(N),_=()=>(0,a.fp)(M);function O(){let[e]=_(),[t]=(0,s.uZ)(),[n]=U();return(0,c.useMemo)(()=>e?{slippageTolerance:n,isAuto:!0}:{slippageTolerance:t,isAuto:!1},[e,n,t])}let R=e=>{let[t]=_(),[n]=(0,s.uZ)(),{inputBasedSlippage:l}=E((null==e?void 0:e.currency)&&i.xx.isSPLToken(e.currency)?void 0:e);return(0,c.useMemo)(()=>t&&e&&l?{slippageTolerance:Number(l.numerator),isAuto:!0}:{slippageTolerance:n,isAuto:!1},[t,e,l,n])},F=e=>{let{children:t}=e;return(0,l.jsxs)(l.Fragment,{children:[t,(0,l.jsx)(c.Suspense,{fallback:null,children:(0,l.jsx)(Y,{})})]})},Y=()=>{var e,t,n,l,i;let s=(0,u.Z)(),o=(0,c.useRef)(null==s||null==(e=s.bestOrder)?void 0:e.trade),a=(0,c.useMemo)(()=>{var e,t,n,l,r,i,a,d,u,c,x,h,g,m,v,f,j,A,I,y,b,w,C,k;return!(0,p.mI)(null==s?void 0:s.bestOrder)&&!!o.current&&!!(null==s||null==(e=s.bestOrder)?void 0:e.trade)&&(null==(a=o.current)||null==(i=a.inputAmount)||null==(r=i.currency)?void 0:r.equals(null==s||null==(l=s.bestOrder)||null==(n=l.trade)||null==(t=n.inputAmount)?void 0:t.currency))&&(null==(g=o.current)||null==(h=g.outputAmount)||null==(x=h.currency)?void 0:x.equals(null==s||null==(c=s.bestOrder)||null==(u=c.trade)||null==(d=u.outputAmount)?void 0:d.currency))&&(null==(m=o.current)?void 0:m.tradeType)===(null==s||null==(f=s.bestOrder)||null==(v=f.trade)?void 0:v.tradeType)&&(null==(y=o.current)||null==(I=y.inputAmount)?void 0:I.equalTo(null==s||null==(A=s.bestOrder)||null==(j=A.trade)?void 0:j.inputAmount))&&(null==(k=o.current)||null==(C=k.outputAmount)?void 0:C.equalTo(null==s||null==(w=s.bestOrder)||null==(b=w.trade)?void 0:b.outputAmount))},[null==s?void 0:s.bestOrder]),d=function(e){var t,n,l,r,i,s,o;let{chainId:a}=(0,v.ax)(),d=C(a),{inputBasedSlippage:u,inputDollarValue:p}=E(null==e?void 0:e.inputAmount),h=null==e||null==(t=e.outputAmount)?void 0:t.currency,g=(0,y.r0)(h,{enabled:!!(null==e||null==(n=e.outputAmount)?void 0:n.greaterThan(0))}),m=(0,A.YW)(),w=(0,I.Ay)(a),M=(0,c.useMemo)(()=>a&&!!a&&(a===x.nU.ETHEREUM||a===x.nU.BSC),[a]),N=2e5*!!e,U=k(e)&&(null==(l=e.gasUseEstimateBase)?void 0:l.greaterThan(0))?e.gasUseEstimateBase.currency:void 0,_=(0,y.r0)(U,{enabled:!!e}),O=(0,c.useMemo)(()=>L(S(null==m?void 0:m.toString(),N),w),[m,N,w]),R=(0,y.h1)(w,O,{enabled:!!(null==e||null==(r=e.outputAmount)?void 0:r.greaterThan(0))}),F=(0,c.useMemo)(()=>{let t=((e,t,n)=>{var l;if(!e||!t)return null;if(k(t)){let e=t.gasUseEstimateBase;return(null==e?void 0:e.greaterThan(0))&&n?parseFloat(e.toSignificant(6))*parseFloat(n.toSignificant(6)):null}return"orderInfo"in t?.5:"gasEstimateInUSD"in t?"string"==typeof t.gasEstimateInUSD?parseFloat(t.gasEstimateInUSD):Number(null==(l=t.gasEstimateInUSD)?void 0:l.toSignificant(6)):null})(!!M,e,_);return M&&t?t:R},[M,R,_,e]),{data:Y}=(0,f.I)({queryKey:["classic-auto-slippage",null==e||null==(s=e.outputAmount)||null==(i=s.wrapped)?void 0:i.toExact(),null==g||null==(o=g.wrapped)?void 0:o.toSignificant(),F],queryFn:()=>{var t;if(!e||d)return b;let n=null==e||null==(t=e.outputAmount)?void 0:t.toSignificant(6),l=n&&g?parseFloat(n)*parseFloat(g.toSignificant(6)):void 0;if(l&&F){let e=D(T(F,l));return p&&Math.abs(p-l)>.05*l&&e.lessThan(u)?u:e}return console.log("Auto Slippage: Using DEFAULT_AUTO_SLIPPAGE because missing outputDollarValue or dollarCostToUse"),b},placeholderData:j.rX,staleTime:1/0,gcTime:0});return null!=Y?Y:b}((null==s||null==(t=s.bestOrder)?void 0:t.type)===r.ZN.PCS_SVM||null==s||null==(n=s.bestOrder)?void 0:n.trade),h=(null==s||null==(l=s.bestOrder)?void 0:l.type)===r.ZN.DUTCH_LIMIT?w:d,[,g]=U(),m=(0,c.useCallback)(()=>{h&&g(Number(h.numerator))},[h,g]);return(0,c.useEffect)(()=>
1{if(!a){var e;o.current=null==s||null==(e=s.bestOrder)?void 0:e.trade,m()}},[a,m,null==s||null==(i=s.bestOrder)?void 0:i.trade]),null}},863064:(e,t,n)=>{n.d(t,{Z:()=>i});var l=n(118708),r=n(157852);let i=()=>(0,l.md)(r.Hq)},919443:(e,t,n)=>{n.d(t,{UP:()=>P,_J:()=>M,aR:()=>V});var l=n(350979),r=n(769932),i=n(311560),s=n(995315),o=n(430586),a=n(557423),d=n(547725),u=n(605641),c=n(428089),p=n(274584),x=n(312680),h=n(282304),g=n(530957),m=n(361938),v=n(25963),f=n(680797),j=n(862373),A=n(657168),I=n(968349),y=n(775517),b=n(228876),w=n(187012);let C=(0,f.i7)(["from{opacity:0;transform:translateY(5px);}to{opacity:1;transform:translateY(0px);}"]),k=(0,f.I4)(s.A).withConfig({componentId:"sc-1933e785-0"})(["opacity:0;border-radius:20px;border:1px solid ",";background-color:",";padding:12px;animation:"," 0.25s ease-in-out 0.5s forwards;"],e=>{let{theme:t}=e;return t.colors.cardBorder},e=>{let{theme:t}=e;return t.colors.card},C),S=f.I4.div.withConfig({componentId:"sc-1933e785-1"})(["display:flex;flex-direction:column;gap:8px;border-radius:16px;border:1px solid ",";background-color:",";padding:16px;"],e=>{let{theme:t}=e;return t.colors.cardBorder},e=>{let{theme:t}=e;return t.colors.background}),L=(0,f.I4)(o.A).attrs({color:"primary60"}).withConfig({componentId:"sc-1933e785-2"})(["font-weight:normal;"]),T=(0,f.I4)(a.A).attrs({variant:"text"}).withConfig({componentId:"sc-1933e785-3"})(["color:",";font-weight:normal;"],e=>{let{theme:t}=e;return t.colors.primary60}),D=(0,f.I4)(s.A).withConfig({componentId:"sc-1933e785-4"})(["width:fit-content;border-radius:12px;background:",";padding:1px 6px 1px 4px;"],e=>{let{theme:t}=e;return t.colors.warning10}),E=e=>{let{data:t,refetch:n}=(0,w.Wd)(e);(0,v.useEffect)(()=>{if(null==t?void 0:t.pollingInterval){let e=setTimeout(()=>n(),null==t?void 0:t.pollingInterval);return()=>clearTimeout(e)}},[null==t?void 0:t.pollingInterval,n]);let l=(0,v.useMemo)(()=>!t||(null==t?void 0:t.riskLevel)===w.K_.UNKNOWN&&!(null==t?void 0:t.hasResult),[t]);return{isDataLoading:l,riskLevel:(0,v.useMemo)(()=>{if(!(0,g.A)(null==t?void 0:t.riskLevel))return(null==t?void 0:t.riskLevel)?null==t?void 0:t.riskLevel:w.K_.UNKNOWN},[t]),tagColor:(0,v.useMemo)(()=>(null==t?void 0:t.riskLevel)?t.riskLevel>w.K_.MEDIUM?"destructive60":t.riskLevel>=w.K_.LOW&&t.riskLevel<=w.K_.MEDIUM?"yellow":t.riskLevel>=w.K_.VERY_LOW&&t.riskLevel<=w.K_.SOME_RISK?"primary":"textDisabled":"textDisabled",[null==t?void 0:t.riskLevel])}},M=e=>{let{token:t}=e,{isDataLoading:n,riskLevel:r,tagColor:i}=E(t);return!n&&r&&r<=w.K_.SIGNIFICANT&&r>=w.K_.MEDIUM?(0,l.jsxs)(D,{alignItems:"center",gap:"2px",mt:"4px",children:[(0,l.jsx)(d.A,{width:16,color:i}),(0,l.jsx)(u.A,{fontSize:"12px",lineHeight:"16px",color:i,children:w.zi[r]})]}):null},N=e=>{let{token:t,isInputToken:n}=e,{t:i}=(0,r.A)(),{isDataLoading:o,riskLevel:a,tagColor:p}=E(t);return!o&&a&&a<=w.K_.SIGNIFICANT&&a>=w.K_.MEDIUM&&a&&a>=w.K_.VERY_LOW&&(null==t?void 0:t.address)?(0,l.jsxs)(s.A,{alignItems:"flex-start",gap:"8px",children:[(0,l.jsx)(c.Ay,{children:(0,l.jsx)(d.A,{width:24,color:p})}),(0,l.jsx)(s.A,{justifyContent:"center",alignItems:"flex-start",flexDirection:"column",gap:"8px",children:(0,l.jsxs)(u.A,{fontSize:"16px",bold:!0,children:[w.zi[a]," ",i("detected for %tokenType% token:",{tokenType:i(n?"input":"output")})," ",null==t?void 0:t.symbol]})})]}):null},U=()=>{let{t:e}=(0,r.A)();return(0,l.jsxs)(s.A,{alignItems:"flex-start",gap:"8px",children:[(0,l.jsx)(c.Ay,{children:(0,l.jsx)(p.A,{width:24,color:"destructive60"})}),(0,l.jsx)(s.A,{justifyContent:"center",alignItems:"flex-start",flexDirection:"column",gap:"8px",children:(0,l.jsx)(u.A,{fontSize:"16px",bold:!0,children:e("Price impact too high. Proceed with caution.")})})]})},_=()=>{let{t:e}=(0,r.A)();return(0,l.jsxs)(s.A,{alignItems:"flex-start",gap:"8px",children:[(0,l.jsx)(c.Ay,{children:(0,l.jsx)(p.A,{width:24,color:"destructive60"})}),(0,l.jsx)(s.A,{justifyContent:"center",alignItems:"flex-start",flexDirection:"column",gap:"8px",children:(0,l.jsx)(u.A,{fontSize:"16px",bold:!0,children:e("Slippage settings too high. Proceed with caution.")})})]})},O=()=>{let{t:e}=(0,r.A)();
1return(0,l.jsxs)(s.A,{alignItems:"flex-start",gap:"8px",children:[(0,l.jsx)(c.Ay,{children:(0,l.jsx)(p.A,{width:24,color:"destructive60"})}),(0,l.jsx)(s.A,{justifyContent:"center",alignItems:"flex-start",flexDirection:"column",gap:"8px",children:(0,l.jsx)(u.A,{fontSize:"16px",bold:!0,children:e("ExactOut swap supports less liquidity venues and less routes.")})})]})},R=()=>{let{t:e}=(0,r.A)();return(0,l.jsx)(s.A,{alignItems:"flex-start",children:(0,l.jsx)(s.A,{justifyContent:"center",alignItems:"flex-start",flexDirection:"column",gap:"8px",children:(0,l.jsx)(u.A,{children:e("Final execution price may be differ from the market price due to trader size, available liquidity, and trading route. Please proceed with caution.")})})})},F=()=>{let{t:e}=(0,r.A)();return(0,l.jsx)(s.A,{alignItems:"flex-start",children:(0,l.jsx)(s.A,{justifyContent:"center",alignItems:"flex-start",flexDirection:"column",gap:"8px",children:(0,l.jsx)(u.A,{children:e("It might also offer a worse price. Slippage is only applied on input amount, not output amount.")})})})},Y=e=>{let{onClick:t}=e,{t:n}=(0,r.A)();return(0,l.jsx)(T,{onClick:t,scale:"sm",px:"0",children:n("Reset Slippage")})},B=()=>{let[,e]=(0,j.uZ)(),[,t]=(0,y.Nt)();return(0,l.jsx)(Y,{onClick:()=>{t(!1),e(A.i1)}})},K=()=>{let[,e]=(0,j.at)();return(0,l.jsx)(Y,{onClick:()=>{e(A.i1)}})},z=()=>{let{t:e}=(0,r.A)(),{chainId:t}=(0,I.ax)();return(0,l.jsx)(s.A,{alignItems:"flex-start",children:(0,l.jsxs)(s.A,{justifyContent:"center",alignItems:"flex-start",flexDirection:"column",gap:"8px",children:[(0,l.jsx)(u.A,{children:e("You may only get the amount of “Minimum received” with a high slippage setting. Reset your slippage to avoid potential losses.")}),(0,b.fT)(t)?(0,l.jsx)(K,{}):(0,l.jsx)(B,{})]})})},q=e=>{let{token:t,riskLevelDescription:n}=e,{t:o}=(0,r.A)(),{isDataLoading:a,riskLevel:d}=E(t);return!a&&d&&d<=w.K_.SIGNIFICANT&&d>=w.K_.MEDIUM&&d&&d>=w.K_.VERY_LOW&&(null==t?void 0:t.address)&&(null==t?void 0:t.chainId)?(0,l.jsx)(s.A,{alignItems:"flex-start",gap:"8px",children:(0,l.jsxs)(s.A,{justifyContent:"center",alignItems:"flex-start",flexDirection:"column",gap:"8px",children:[(0,l.jsx)(u.A,{children:n||o("The address contains risk factors that are possible to lead to partial loss of funds, or medium to lower chance of catastrophic losses.")}),(0,l.jsx)(L,{href:"https://www.hashdit.io",children:o("Result provided by HashDit")}),t.chainId===i.nU.BSC&&(0,l.jsx)(L,{external:!0,href:`https://dappbay.bnbchain.org/risk-scanner/${t.address}`,children:o("Get more details from RedAlarm")})]})}):null},P=(e,t)=>{let{isDataLoading:n,riskLevel:l}=E(e),{isDataLoading:r,riskLevel:i}=E(t);return(!n||!e)&&(!r||!t)&&(l&&l<=w.K_.SIGNIFICANT&&l>=w.K_.MEDIUM||i&&i<=w.K_.SIGNIFICANT&&i>=w.K_.MEDIUM)},V=e=>{let{token0:t,token1:n,token0RiskLevelDescription:r,token1RiskLevelDescription:i,isPriceImpactTooHigh:o,isSlippageTooHigh:a,isExactOutWarning:d}=e,[u,c]=(0,v.useState)(!1),[p,x]=(0,v.useState)(!1),h=P(t),g=P(n),f=(0,v.useMemo)(()=>{let e=0;return h&&e++,g&&e++,o&&e++,a&&e++,d&&e++,e>1},[h,g,o,a,d]);return(0,v.useEffect)(()=>{f&&c(!1)},[f]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(k,{width:"100%",flexDirection:"column",justifyContent:"center",alignItems:"center",children:(0,l.jsx)(m.U.SD,{isOpen:u,recalculateDep:f,onToggle:f?()=>x(!0):()=>c(!u),title:(0,l.jsxs)(s.A,{flexDirection:"column",children:[(0,l.jsx)(N,{token:t,isInputToken:!0}),(0,l.jsx)(N,{token:n,isInputToken:!1}),o&&(0,l.jsx)(U,{}),a&&(0,l.jsx)(_,{}),d&&(0,l.jsx)(O,{})]}),content:(0,l.jsxs)(s.A,{flexDirection:"column",pl:"32px",pr:"8px",children:[(0,l.jsx)(q,{token:t,riskLevelDescription:r}
1),(0,l.jsx)(q,{token:n,riskLevelDescription:i}),o&&(0,l.jsx)(R,{}),a&&(0,l.jsx)(z,{}),d&&(0,l.jsx)(F,{})]})})}),(0,l.jsx)(W,{isOpen:p,onDismiss:()=>x(!1),children:(0,l.jsxs)(s.A,{flexDirection:"column",gap:"16px",children:[h&&(0,l.jsxs)(S,{children:[(0,l.jsx)(N,{token:t,isInputToken:!0}),(0,l.jsx)(q,{token:t,riskLevelDescription:r})]}),g&&(0,l.jsxs)(S,{children:[(0,l.jsx)(N,{token:n,isInputToken:!1}),(0,l.jsx)(q,{token:n,riskLevelDescription:i})]}),o&&(0,l.jsxs)(S,{children:[(0,l.jsx)(U,{}),(0,l.jsx)(R,{})]}),a&&(0,l.jsxs)(S,{children:[(0,l.jsx)(_,{}),(0,l.jsx)(z,{})]}),d&&(0,l.jsxs)(S,{children:[(0,l.jsx)(O,{}),(0,l.jsx)(F,{})]})]})})]})},W=e=>{let{isOpen:t,onDismiss:n,children:i}=e,{t:s}=(0,r.A)();return(0,l.jsx)(x.aF,{isOpen:t,closeOnOverlayClick:!0,onDismiss:n,children:(0,l.jsx)(h.Ay,{title:s("Note for this swap"),maxWidth:[null,null,null,"480px"],children:i})})}}}]);

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.