@dodoex/widgets 3.0.2-bartio.19 → 3.0.2-bartio.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,7 +28,7 @@ import{Trans as e,I18nProvider as t,useLingui as n}from"@lingui/react";import{i1
28
28
  object-assign
29
29
  (c) Sindre Sorhus
30
30
  @license MIT
31
- */function Ox(){if(Ax)return bx;Ax=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return bx=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,i){for(var o,a,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),l=1;l<arguments.length;l++){for(var d in o=Object(arguments[l]))t.call(o,d)&&(s[d]=o[d]);if(e){a=e(o);for(var c=0;c<a.length;c++)n.call(o,a[c])&&(s[a[c]]=o[a[c]])}}return s},bx}function Bx(){if(kx)return wx;kx=1;return wx="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Px(){return jx?Cx:(jx=1,Cx=Function.call.bind(Object.prototype.hasOwnProperty))}if("production"!==process.env.NODE_ENV){var Dx=Mx;fx.exports=function(){if(Ix)return Sx;Ix=1;var e=Mx,t=Ox(),n=Bx(),r=Px(),i=function(){if(Ex)return Tx;Ex=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=Bx(),n={},r=Px();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function i(i,o,a,s,l){if("production"!==process.env.NODE_ENV)for(var d in i)if(r(i,d)){var c;try{if("function"!=typeof i[d]){var u=Error((s||"React class")+": "+a+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}c=i[d](o,d,s,a,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((s||"React class")+": type specification of "+a+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in n)){n[c.message]=!0;var p=l?l():"";e("Failed "+a+" type: "+c.message+(null!=p?p:""))}}}return i.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},Tx=i}(),o=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Sx=function(s,l){var d="function"==typeof Symbol&&Symbol.iterator,c="@@iterator",u="<<anonymous>>",p={array:g("array"),bigint:g("bigint"),bool:g("boolean"),func:g("function"),number:g("number"),object:g("object"),string:g("string"),symbol:g("symbol"),any:f(a),arrayOf:function(e){return f((function(t,r,i,o,a){if("function"!=typeof e)return new m("Property `"+a+"` of component `"+i+"` has invalid PropType notation inside arrayOf.");var s=t[r];if(!Array.isArray(s))return new m("Invalid "+o+" `"+a+"` of type `"+v(s)+"` supplied to `"+i+"`, expected an array.");for(var l=0;l<s.length;l++){var d=e(s,l,i,o,a+"["+l+"]",n);if(d instanceof Error)return d}return null}))},element:f((function(e,t,n,r,i){var o=e[t];return s(o)?null:new m("Invalid "+r+" `"+i+"` of type `"+v(o)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:f((function(t,n,r,i,o){var a=t[n];return e.isValidElementType(a)?null:new m("Invalid "+i+" `"+o+"` of type `"+v(a)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return f((function(t,n,r,i,o){if(!(t[n]instanceof e)){var a=e.name||u;return new m("Invalid "+i+" `"+o+"` of type `"+((s=t[n]).constructor&&s.constructor.name?s.constructor.name:u)+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}var s;return null}))},node:f((function(e,t,n,r,i){return x(e[t])?null:new m("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return f((function(t,i,o,a,s){if("function"!=typeof e)return new m("Property `"+s+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var l=t[i],d=v(l);if("object"!==d)return new m("Invalid "+a+" `"+s+"` of type `"+d+"` supplied to `"+o+"`, expected an object.");for(var c in l)if(r(l,c)){var u=e(l,c,o,a,s+"."+c,n);if(u instanceof Error)return u}return null}))},oneOf:function(e){return Array.isArray(e)?f((function(t,n,r,i,o){for(var a=t[n],s=0;s<e.length;s++)if(h(a,e[s]))return null;var l=JSON.stringify(e,(function(e,t){return"symbol"===b(t)?String(t):t}));return new m("Invalid "+i+" `"+o+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+l+".")})):("production"!==process.env.NODE_ENV&&o(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&o("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var t=0;t<e.length;t++){var i=e[t];if("function"!=typeof i)return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+A(i)+" at index "+t+"."),a}return f((function(t,i,o,a,s){for(var l=[],d=0;d<e.length;d++){var c=(0,e[d])(t,i,o,a,s,n);if(null==c)return null;c.data&&r(c.data,"expectedType")&&l.push(c.data.expectedType)}return new m("Invalid "+a+" `"+s+"` supplied to `"+o+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")}))},shape:function(e){return f((function(t,r,i,o,a){var s=t[r],l=v(s);if("object"!==l)return new m("Invalid "+o+" `"+a+"` of type `"+l+"` supplied to `"+i+"`, expected `object`.");for(var d in e){var c=e[d];if("function"!=typeof c)return y(i,o,a,d,b(c));var u=c(s,d,i,o,a+"."+d,n);if(u)return u}return null}))},exact:function(e){return f((function(i,o,a,s,l){var d=i[o],c=v(d);if("object"!==c)return new m("Invalid "+s+" `"+l+"` of type `"+c+"` supplied to `"+a+"`, expected `object`.");var u=t({},i[o],e);for(var p in u){var h=e[p];if(r(e,p)&&"function"!=typeof h)return y(a,s,l,p,b(h));if(!h)return new m("Invalid "+s+" `"+l+"` key `"+p+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(i[o],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var f=h(d,p,a,s,l+"."+p,n);if(f)return f}return null}))}};function h(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function m(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function f(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function i(i,a,s,d,c,p,h){if(d=d||u,p=p||s,h!==n){if(l){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var g=d+":"+s;!t[g]&&r<3&&(o("You are manually calling a React.PropTypes validation function for the `"+p+"` prop on `"+d+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[g]=!0,r++)}}return null==a[s]?i?null===a[s]?new m("The "+c+" `"+p+"` is marked as required in `"+d+"`, but its value is `null`."):new m("The "+c+" `"+p+"` is marked as required in `"+d+"`, but its value is `undefined`."):null:e(a,s,d,c,p)}var a=i.bind(null,!1);return a.isRequired=i.bind(null,!0),a}function g(e){return f((function(t,n,r,i,o,a){var s=t[n];return v(s)!==e?new m("Invalid "+i+" `"+o+"` of type `"+b(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function y(e,t,n,r,i){return new m((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}function x(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(x);if(null===e||s(e))return!0;var t=function(e){var t=e&&(d&&e[d]||e[c]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!x(n.value))return!1}else for(;!(n=r.next()).done;){var i=n.value;if(i&&!x(i[1]))return!1}return!0;default:return!1}}function v(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function b(e){if(null==e)return""+e;var t=v(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function A(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return m.prototype=Error.prototype,p.checkPropTypes=i,p.resetWarningCache=i.resetWarningCache,p.PropTypes=p,p},Sx}()(Dx.isElement,!0)}else fx.exports=function(){if(Lx)return Rx;Lx=1;var e=Bx();function t(){}function n(){}return n.resetWarningCache=t,Rx=function(){function r(t,n,r,i,o,a){if(a!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function i(){return r}r.isRequired=r;var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Rx}()();var Nx=vr(fx.exports);function Fx(e,t){return"production"===process.env.NODE_ENV?()=>null:function(...n){return e(...n)||t(...n)}}function Wx(e,t,n,r,i){const o=e[t],a=i||t;if(null==o||"undefined"==typeof window)return null;let s;const l=o.type;return"function"!=typeof l||function(e){const{prototype:t={}}=e;return Boolean(t.isReactComponent)}(l)||(s="Did you accidentally use a plain function component for an element instead?"),void 0!==s?new Error(`Invalid ${r} \`${a}\` supplied to \`${n}\`. Expected an element that can hold a ref. ${s} For more information see https://mui.com/r/caveat-with-refs-guide`):null}const Vx=Fx(Nx.element,Wx);Vx.isRequired=Fx(Nx.element.isRequired,Wx);const Ux="exact-prop: ​";function Hx(e){return e&&e.ownerDocument||document}const qx="undefined"!=typeof window?ot.useLayoutEffect:ot.useEffect;function Zx(e){const t=ot.useRef(e);return qx((()=>{t.current=e})),ot.useRef(((...e)=>(0,t.current)(...e))).current}function zx(...e){return ot.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{!function(e,t){"function"==typeof e?e(t):e&&(e.current=t)}(e,t)}))}),e)}const Qx={};const Gx=[];class Yx{static create(){return new Yx}currentId=null;start(e,t){this.clear(),this.currentId=setTimeout((()=>{this.currentId=null,t()}),e)}clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function Xx(){const e=function(e,t){const n=ot.useRef(Qx);return n.current===Qx&&(n.current=e(t)),n}(Yx.create).current;var t;return t=e.disposeEffect,ot.useEffect(t,Gx),e}const Jx={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Kx(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Kx(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _x(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Kx(e))&&(r&&(r+=" "),r+=t);return r}function $x(e,t=[]){if(void 0===e)return{};const n={};return Object.keys(e).filter((n=>n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n))).forEach((t=>{n[t]=e[t]})),n}function ev(e){if(void 0===e)return{};const t={};return Object.keys(e).filter((t=>!(t.match(/^on[A-Z]/)&&"function"==typeof e[t]))).forEach((n=>{t[n]=e[n]})),t}function tv(e){const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...o}=e,a=i?{}:function(e,t,n){return"function"==typeof e?e(t,n):e}(n,r),{props:s,internalRef:l}=function(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const e=_x(n?.className,o,i?.className,r?.className),t={...n?.style,...i?.style,...r?.style},a={...n,...i,...r};return e.length>0&&(a.className=e),Object.keys(t).length>0&&(a.style=t),{props:a,internalRef:void 0}}const a=$x({...i,...r}),s=ev(r),l=ev(i),d=t(a),c=_x(d?.className,n?.className,o,i?.className,r?.className),u={...d?.style,...n?.style,...i?.style,...r?.style},p={...d,...n,...l,...s};return c.length>0&&(p.className=c),Object.keys(u).length>0&&(p.style=u),{props:p,internalRef:d.ref}}({...o,externalSlotProps:a}),d=function(e,t,n){return void 0===e||"string"==typeof e?t:{...t,ownerState:{...t.ownerState,...n}}}(t,{...s,ref:zx(l,a?.ref,e.additionalProps?.ref)},r);return d}function nv(e){return e.substring(2).toLowerCase()}function rv(e){const{children:t,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:i,touchEvent:o="onTouchEnd"}=e,a=ot.useRef(!1),s=ot.useRef(null),l=ot.useRef(!1),d=ot.useRef(!1);ot.useEffect((()=>(setTimeout((()=>{l.current=!0}),0),()=>{l.current=!1})),[]);const c=zx((u=t)&&ot.isValidElement(u)?u.props.propertyIsEnumerable("ref")?u.props.ref:u.ref:null,s);var u;const p=Zx((e=>{const t=d.current;d.current=!1;const r=Hx(s.current);if(!l.current||!s.current||"clientX"in e&&function(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}(e,r))return;if(a.current)return void(a.current=!1);let o;o=e.composedPath?e.composedPath().indexOf(s.current)>-1:!r.documentElement.contains(e.target)||s.current.contains(e.target),o||!n&&t||i(e)})),h=e=>n=>{d.current=!0;const r=t.props[e];r&&r(n)},m={ref:c};return!1!==o&&(m[o]=h(o)),ot.useEffect((()=>{if(!1!==o){const e=nv(o),t=Hx(s.current),n=()=>{a.current=!0};return t.addEventListener(e,p),t.addEventListener("touchmove",n),()=>{t.removeEventListener(e,p),t.removeEventListener("touchmove",n)}}}),[p,o]),!1!==r&&(m[r]=h(r)),ot.useEffect((()=>{if(!1!==r){const e=nv(r),t=Hx(s.current);return t.addEventListener(e,p),()=>{t.removeEventListener(e,p)}}}),[p,r]),Os.jsx(ot.Fragment,{children:ot.cloneElement(t,m)})}"production"!==process.env.NODE_ENV&&(rv.propTypes={children:Vx.isRequired,disableReactTree:Nx.bool,mouseEvent:Nx.oneOf(["onClick","onMouseDown","onMouseUp","onPointerDown","onPointerUp",!1]),onClickAway:Nx.func.isRequired,touchEvent:Nx.oneOf(["onTouchEnd","onTouchStart",!1])}),"production"!==process.env.NODE_ENV&&(rv.propTypes=function(e){return"production"===process.env.NODE_ENV?e:{...e,[Ux]:t=>{const n=Object.keys(t).filter((t=>!e.hasOwnProperty(t)));return n.length>0?new Error(`The following props are not supported: ${n.map((e=>`\`${e}\``)).join(", ")}. Please remove them.`):null}}}(rv.propTypes));const iv="base";function ov(e,t){const n=Jx[t];return n?`${iv}--${n}`:function(e,t){return`${iv}-${e}-${t}`}(e,t)}const av="Snackbar";function sv(e){return ov(av,e)}!function(e,t){const n={};t.forEach((t=>{n[t]=ov(e,t)}))}(av,["root"]);const lv={disableDefaultClasses:!1},dv=ot.createContext(lv);"production"!==process.env.NODE_ENV&&(dv.displayName="ClassNameConfiguratorContext");const cv=()=>function(e,t,n){const r={};for(const i in e){const o=e[i];let a="";for(let e=0;e<o.length;e+=1){const r=o[e];r&&(a+=t(r)+" ",n&&n[r]&&(a+=n[r]+" "))}r[i]=a}return r}({root:["root"]},function(e){const{disableDefaultClasses:t}=ot.useContext(dv);return n=>t?"":e(n)}(sv)),uv=ot.forwardRef((function(e,t){const{autoHideDuration:n=null,children:r,disableWindowBlurListener:i=!1,exited:o=!0,onBlur:a,onClose:s,onFocus:l,onMouseEnter:d,onMouseLeave:c,open:u,resumeHideDuration:p,slotProps:h={},slots:m={},...f}=e,g=cv(),{getRootProps:y,onClickAway:x}=function(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=e,a=Xx();ot.useEffect((()=>{if(i)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){e.defaultPrevented||"Escape"===e.key&&r?.(e,"escapeKeyDown")}}),[i,r]);const s=Zx(((e,t)=>{r?.(e,t)})),l=Zx((e=>{r&&null!=e&&a.start(e,(()=>{s(null,"timeout")}))}));ot.useEffect((()=>(i&&l(t),a.clear)),[i,t,l,a]);const d=a.clear,c=ot.useCallback((()=>{null!=t&&l(null!=o?o:.5*t)}),[t,o,l]),u=e=>t=>{const n=e.onFocus;n?.(t),d()},p=e=>t=>{const n=e.onMouseEnter;n?.(t),d()},h=e=>t=>{const n=e.onMouseLeave;n?.(t),c()};return ot.useEffect((()=>{if(!n&&i)return window.addEventListener("focus",c),window.addEventListener("blur",d),()=>{window.removeEventListener("focus",c),window.removeEventListener("blur",d)}}),[n,i,c,d]),{getRootProps:(t={})=>{const n={...$x(e),...$x(t)};return{role:"presentation",...t,...n,onBlur:(r=n,e=>{const t=r.onBlur;t?.(e),c()}),onFocus:u(n),onMouseEnter:p(n),onMouseLeave:h(n)};var r},onClickAway:e=>{r?.(e,"clickaway")}}}({...e,autoHideDuration:n,disableWindowBlurListener:i,onClose:s,open:u,resumeHideDuration:p}),v=e,b=m.root||"div",A=tv({elementType:b,getSlotProps:y,externalForwardedProps:f,externalSlotProps:h.root,additionalProps:{ref:t},ownerState:v,className:g.root}),w=tv({elementType:rv,externalSlotProps:h.clickAwayListener,additionalProps:{onClickAway:x},ownerState:v});return delete w.ownerState,!u&&o?null:Os.jsx(rv,{...w,children:Os.jsx(b,{...A,children:r})})}));function pv({size:e,color:t,time:n,strokeWidth:r=2,sx:i}){const[o,a]=ct("0 1069"),s=e/2,l=s-1;return st((()=>{a(2*Math.PI*l+" 0")}),[]),Os.jsx(f,{width:e,height:e,component:"svg",sx:Object.assign({position:"absolute",top:`-${r}`,left:`-${r}`,transform:"rotate(-90deg)"},i),children:Os.jsx(f,{component:"circle",cx:s,cy:s,r:l,strokeWidth:r,stroke:t,fill:"none",strokeDasharray:o,sx:{transition:`stroke-dasharray ${n}`}})})}"production"!==process.env.NODE_ENV&&(uv.propTypes={autoHideDuration:Nx.number,children:Nx.node,disableWindowBlurListener:Nx.bool,exited:Nx.bool,onClose:Nx.func,open:Nx.bool,resumeHideDuration:Nx.number,slotProps:Nx.shape({clickAwayListener:Nx.oneOfType([Nx.func,Nx.shape({children:Nx.element.isRequired,disableReactTree:Nx.bool,mouseEvent:Nx.oneOf(["onClick","onMouseDown","onMouseUp","onPointerDown","onPointerUp",!1]),onClickAway:Nx.func,touchEvent:Nx.oneOf(["onTouchEnd","onTouchStart",!1])})]),root:Nx.oneOfType([Nx.func,Nx.object])}),slots:Nx.shape({root:Nx.elementType})});var hv=at.memo(pv);const mv=bt((e=>({notify:null,toast:t=>{e({notify:t})},close:()=>{e({notify:null})}}))),fv={entering:"translateX(0)",entered:"translateX(0)",exiting:"translateX(500px)",exited:"translateX(500px)",unmounted:"translateX(500px)"};function gv(){const e=g(),{notify:t,close:n}=mv(),[r,i]=at.useState(!0),o=at.useRef(null),a=null==t?void 0:t.timeout,s=!!t;let l=Os.jsxs("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Os.jsx("circle",{cx:"18",cy:"18",r:"16.5",stroke:"#2FBA90",strokeWidth:"3"}),Os.jsx("path",{d:"M25.1384 11.334L14.8873 21.5851L10.8584 17.5718L8.66504 19.7651L14.8873 25.9873L27.3317 13.5429L25.1384 11.334Z",fill:"#2FBA90"})]});switch(null==t?void 0:t.type){case"error":l=Os.jsxs("svg",{width:"36",height:"37",viewBox:"0 0 36 37",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Os.jsx("circle",{cx:"18",cy:"18.5",r:"16.5",stroke:"#FF6187",strokeWidth:"3"}),Os.jsx("path",{d:"M25.3331 13.0452L19.8782 18.5L25.3331 23.9548L23.5148 25.7731L18.06 20.3183L12.6051 25.7731L10.7869 23.9548L16.2417 18.5L10.7869 13.0452L12.6051 11.2269L18.06 16.6817L23.5148 11.2269L25.3331 13.0452Z",fill:"#FF6187"})]});break;case"warning":l=Os.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.4065 3.6189L9.62438 3.59576L3.39812 9.78928L3.37498 18.5714L9.5685 24.7976L18.3506 24.8208L24.5769 18.6273L24.6 9.84516L18.4065 3.6189ZM26.9359 8.88481L19.3791 1.28812L8.66403 1.25988L1.06734 8.81663L1.0391 19.5317L8.59585 27.1284L19.311 27.1567L26.9076 19.5999L26.9359 8.88481Z",fill:"#B15600"}),Os.jsx("path",{d:"M15.1664 7.58398H12.8331V16.9173H15.1664V7.58398Z",fill:"#B15600"}),Os.jsx("path",{d:"M13.9998 21.6395C14.8896 21.6395 15.6109 20.9181 15.6109 20.0283C15.6109 19.1386 14.8896 18.4172 13.9998 18.4172C13.11 18.4172 12.3887 19.1386 12.3887 20.0283C12.3887 20.9181 13.11 21.6395 13.9998 21.6395Z",fill:"#B15600"})]})}return Os.jsx(f,{component:uv,open:s,autoHideDuration:a,onClose:(e,t)=>{"clickaway"!==t&&n()},exited:r,sx:{position:"fixed",top:20,left:20,right:20,zIndex:1,[e.breakpoints.up("tablet")]:{left:"auto"}},children:Os.jsx(Vt,{timeout:{enter:400,exit:400},in:s,appear:!0,unmountOnExit:!0,onEnter:()=>{i(!1)},onExited:()=>{i(!0)},nodeRef:o,children:r=>Os.jsxs(f,{ref:o,sx:{display:"flex",justifyContent:"space-between",p:12,borderRadius:8,backgroundColor:"background.paper",color:"text.primary",border:"solid 1px",borderColor:"border.main",boxShadow:"0px 6px 12px 0px rgba(0, 0, 0, 0.10)",transform:fv[r],transition:"transform 300ms ease",[e.breakpoints.up("tablet")]:{p:20,width:"auto",maxWidth:328}},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",overflow:"hidden"},children:[Os.jsx(f,{sx:{mt:7,"& > svg":{width:28,height:28},[e.breakpoints.up("tablet")]:{"& > svg":{width:36,height:36}}},children:t?l:""}),Os.jsxs(f,{sx:{ml:20},children:[Os.jsx(f,{sx:{typography:"caption"},children:null==t?void 0:t.message}),(null==t?void 0:t.link)?Os.jsxs(f,{component:"a",target:"_blank",rel:"noopener noreferrer",href:t.link.outerLink,sx:{display:"inline-flex",alignItems:"center",typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},children:[t.link.text,Os.jsx(f,{component:"svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",sx:{ml:4,width:18,height:18},children:Os.jsx("path",{d:"M4.22703 13.2122L10.6811 6.75812L4.75206 6.75812L4.75736 5.25729H13.2426V13.7426H11.7471L11.7418 7.81878L5.28769 14.2729L4.22703 13.2122Z",fill:"currentColor"})})]}):"",(null==t?void 0:t.content)?Os.jsx(f,{sx:{mt:4,typography:"body2",color:"text.secondary"},children:t.content}):""]})]}),Os.jsxs(f,{sx:{position:"relative",top:10,ml:12,display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:12,borderStyle:"solid",borderWidth:a?"2.4px":0,borderColor:e.palette.border.main,backgroundColor:a?"transparent":e.palette.background.paperDarkContrast,cursor:"pointer",boxSizing:"border-box",flexShrink:0,[e.breakpoints.up("tablet")]:{ml:28}},onClick:n,children:[a?Os.jsx(hv,{size:24,strokeWidth:"2.4px",time:`${a}ms`,color:e.palette.text.disabled}):"",Os.jsx(f,{component:"svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:16,height:16,border:"none",color:e.palette.text.disabled},children:Os.jsx("g",{children:Os.jsx("path",{d:"M12.8897 4.36345L9.25313 8L12.8897 11.6365L11.6775 12.8487L8.04095 9.21218L4.4044 12.8487L3.19221 11.6365L6.82876 8L3.19221 4.36345L4.4044 3.15127L8.04095 6.78782L11.6775 3.15127L12.8897 4.36345Z",fill:"currentColor"})})})]})]})})})}var yv;function xv(){return xv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xv.apply(null,arguments)}const vv=e=>ot.createElement("svg",xv({width:"33px",height:"33px",viewBox:"0 0 33 33",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),yv||(yv=ot.createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},ot.createElement("g",{transform:"translate(-186.000000, -375.000000)",stroke:"currentColor",strokeWidth:4},ot.createElement("g",{transform:"translate(18.000000, 291.000000)"},ot.createElement("g",{transform:"translate(40.000000, 83.000000)"},ot.createElement("path",{d:"M159,32 C159,15.9837423 146.016258,3 130,3"}))))))),bv=6;function Av(){var e;const t=g();return Os.jsx(f,{sx:{mx:"auto",border:`${bv}px solid ${null===(e=t.palette)||void 0===e?void 0:e.background.input}`,borderRadius:"50%",width:"64px",height:"64px",position:"relative",animation:"loadingRotate 1.1s infinite linear","@keyframes loadingRotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(359deg)"}}},children:Os.jsx(f,{component:vv,sx:{position:"absolute",top:`-${bv}px`,right:`-${bv}px`,color:"primary.main"}})})}function wv({showingDone:e,errorMessage:t}){return g(),t?Os.jsx(f,{component:As.ErrorWarn,sx:{width:64,height:64,color:"error.main"}}):e?Os.jsx(f,{component:As.DoneBorder,sx:{width:64,height:64,color:"success.main"}}):Os.jsx(Av,{})}function kv({showingDone:e,showing:t}){return Os.jsxs(f,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:[Os.jsx(f,{sx:{mt:60},children:e?r._({id:"4xbbt/",message:"{0} confirmed",values:{0:null==t?void 0:t.brief}}):r._({id:"/nzjSF",message:"{0} pending",values:{0:null==t?void 0:t.brief}})}),(null==t?void 0:t.subtitle)?Os.jsx(f,{sx:{mt:20,typography:"body2"},children:null==t?void 0:t.subtitle}):""]})}function Cv({isStarted:t,isEnded:n,tx:r}){const[i,o]=ct(0),{chainId:a}=At(),s=lt((()=>`https://${Qr[a||1]}/tx/${r}`),[r,a]),l=lt((()=>{const e=Math.floor(i/60),t=i%60;return e?`${e}m ${t}s`:`${t}s`}),[i]),d=dt();return st((()=>(t&&(o(0),window.clearInterval(d.current),d.current=window.setInterval((()=>{o((e=>e+1))}),1e3)),()=>{window.clearInterval(d.current)})),[t]),st((()=>{n&&window.clearInterval(d.current)}),[n]),Os.jsxs(f,{sx:{mt:20,pt:20,display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2",color:"text.secondary",border:"solid 1px transparent",borderTopColor:"border.main"},children:[Os.jsxs(f,{children:[Os.jsx(e,{id:"+Jkdiu",message:"Transaction Time:"}),l]}),Os.jsxs(I,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},component:"a",href:s,target:"_blank",rel:"noopener noreferrer",children:[Os.jsx(e,{id:"S3piC2",message:"Tx"}),Os.jsx(f,{component:As.ArrowTopRightBorder,sx:{width:16,height:16,ml:6}})]})]})}function jv(t){var{children:n,executionStatus:i,showSubmitLoadingDialog:o}=t;const a=Ny(Nn(t,["children","executionStatus","showSubmitLoadingDialog"])),{ctxVal:s,showing:l,closeShowing:d,setShowing:c,showingDone:u,errorMessage:p,transactionTx:h}=Object.assign(Object.assign({},a),i),{isMobile:m}=wy(),g=pf((e=>e.noSubmissionDialog)),y=()=>{c((e=>{if(!e)return e;const t=Object.assign({},e);return delete t.submitState,t}))};return Os.jsxs(Uy.Provider,{value:s,children:[n,o&&Os.jsx(yy,{modal:!0,open:!!(null==l?void 0:l.submitState),onClose:y,children:!!l&&Os.jsxs(f,{sx:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:20,p:20,minHeight:208,width:m?"100%":340,textAlign:"center"},children:[Os.jsxs(f,{sx:{textAlign:"center",color:"text.secondary"},children:[l.brief,Os.jsx(f,{component:As.Error,sx:{position:"absolute",top:20,right:20,color:"text.secondary",cursor:"pointer"},onClick:y})]}),"submitted"===l.submitState?Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{component:As.ArrowSubmit,sx:{width:64,height:64}}),Os.jsxs("div",{children:[Os.jsx("div",{children:r._({id:"EcVqOR",message:"{0} Submitted",values:{0:l.brief}})}),l.subtitle&&Os.jsx(f,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:8,color:"text.secondary",typography:"body2"},children:l.subtitle})]}),Os.jsx(T,{variant:T.Variant.outlined,fullWidth:!0,onClick:y,sx:{mt:4},children:Os.jsx(e,{id:"zga9sT",message:"OK"})})]}):Os.jsxs(Os.Fragment,{children:[Os.jsx(Av,{}),Os.jsxs("div",{children:[Os.jsx(f,{children:Os.jsx(e,{id:"7y/8M6",message:"Please confirm in wallet"})}),l.subtitle&&Os.jsx(f,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:8,color:"text.secondary",typography:"body2"},children:l.subtitle})]})]})]})}),Os.jsx(yy,{open:!!l&&"loading"!==l.submitState&&!g,onClose:d,id:"submission",children:Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",px:20,pb:20,flex:1,overflowY:"auto"},children:[Os.jsxs(f,{children:[Os.jsx(f,{sx:{textAlign:"center",pt:60},children:Os.jsx(wv,{showingDone:u,errorMessage:p})}),p?Os.jsxs(f,{sx:{textAlign:"center",mt:60},children:[Os.jsx(f,{children:Os.jsx(e,{id:"kf83Ld",message:"Something went wrong."})}),Os.jsx(f,{sx:{color:"text.secondary",mt:12,typography:"body2",wordBreak:"break-all"},children:p})]}):Os.jsxs(Os.Fragment,{children:[Os.jsx(kv,{showingDone:u,showing:l}),Os.jsx(Cv,{isStarted:!!l,isEnded:u,tx:h})]})]}),Os.jsx(T,{fullWidth:!0,size:T.Size.big,onClick:()=>{xf(gf.Initial),d()},sx:{mt:20},children:p?Os.jsx(e,{id:"1QfxQT",message:"Dismiss"}):Os.jsx(e,{id:"yz7wBu",message:"Close"})})]})})]})}function Tv(e){const{getStaticJsonRpcProviderByChainId:t}=pf();return at.useMemo((()=>{const n=new nt({multiCallAddressList:je,getProvider:t,rpc:zr()});return e&&(Te(n),he(n)),n}),[t,e])}const Ev="dodo-widget-container";function Sv(e){return e.noLangProvider?Os.jsx(Os.Fragment,{children:e.children}):Os.jsx(tx,{locale:e.locale,children:Os.jsx(jv,{...e,children:e.children})})}function Iv(e){_c(e),wf(),Tv(!0);const{provider:t,connector:n,chainId:r,account:i}=At(),{autoConnectLoading:o}=yf();st((()=>{if(void 0===o)if(e.noAutoConnect)vf(!1);else{vf(!0);(()=>Fn(this,void 0,void 0,(function*(){const t=e.defaultChainId;try{(null==n?void 0:n.connectEagerly)?yield n.connectEagerly(t):yield n.activate(t)}finally{vf(!1)}})))()}}),[n,e.noAutoConnect]),st((()=>{e.setDisconnectConnectFC&&e.setDisconnectConnectFC((()=>{n.deactivate?n.deactivate():n.resetState()}))}),[e.setDisconnectConnectFC]),st((()=>{Ka.setGetConfigProvider((n=>{const i=r===n?t:null;if(i)return i;if(e.getStaticJsonRpcProviderByChainId){const t=e.getStaticJsonRpcProviderByChainId(n);if(t)return t}return null}))}),[t,e.getStaticJsonRpcProviderByChainId]),st((()=>{e.onAccountChanged&&e.onAccountChanged(i)}),[i]),st((()=>{e.onProviderChanged&&e.onProviderChanged(t);const r=null==t?void 0:t.provider,i=()=>Fn(this,void 0,void 0,(function*(){vf(!0);try{(null==n?void 0:n.connectEagerly)?yield n.connectEagerly():yield n.activate()}finally{vf(!1)}}));return(null==r?void 0:r.on)&&r.on("chainChanged",i),()=>{(null==r?void 0:r.removeListener)&&r.removeListener("chainChanged",i)}}),[t]);const a=e.width||375,s=e.height||494,{widgetRef:l}=pf();return e.noUI?Os.jsx(Sv,{...e,children:e.children}):Os.jsx(Sv,{...e,children:Os.jsxs(f,{sx:{width:a,height:s,overflow:"hidden",position:"relative",display:"flex",flexDirection:"column",minWidth:335,minHeight:494,borderRadius:16,backgroundColor:"background.paper"},className:Ev,ref:l,children:[Os.jsx(hx,{}),e.children]})})}function Rv(e){const{fromTokenChainId:t}=yf(),n=lt((()=>{var n;return null!==(n=null!=t?t:e.defaultChainId)&&void 0!==n?n:1}),[e.defaultChainId,t]),{connectors:r,key:i}=lf({provider:e.provider,jsonRpcUrlMap:e.jsonRpcUrlMap,defaultChainId:n});return Os.jsx(kt,{connectors:r,lookupENS:!1,children:Os.jsx(Iv,{...e})},i)}function Lv(e){var t;const n=dt(null);return e.jsonRpcUrlMap&&Ka.setRpc(zr(e.jsonRpcUrlMap)),Os.jsx(uf,{...Object.assign(Object.assign({},e),{widgetRef:null!==(t=e.widgetRef)&&void 0!==t?t:n}),children:Os.jsx(Rv,{...e})})}function Mv(e){const t=R({mode:e.colorMode,theme:e.theme,lang:e.locale||Gy});return e.apikey||e.apiServices||console.error("apikey and apiServices must have a."),Os.jsxs(L,{theme:t,children:[Os.jsx(M,{container:`.${Ev}, .${O}, .${B}`}),Os.jsx(Mt,{client:nx,children:Os.jsxs(Lv,{...e,children:[e.children,Os.jsx(gv,{})]})})]})}function Ov(e){var{sx:t}=e,n=Nn(e,["sx"]);const{width:r}=pf(),i=lt((()=>{let e="";return"number"==typeof r?e=`${r}px`:r&&(e=r),e?`calc(${e} - 40px)`:"auto"}),[r]);return Os.jsx(P,{container:document.querySelector(`.${Ev}`),maxWidth:i,sx:Object.assign({cursor:"help"},t),...n})}function Bv({onClick:e,disabled:t,plus:n,border:r}){const i=g(),o=t||n||!e;return Os.jsx(f,{sx:{width:"100%",position:"relative"},children:Os.jsx(f,{component:y,sx:Object.assign({width:36,height:36,borderRadius:"50%",backgroundColor:i.palette.background.input,border:r?`3px solid ${i.palette.text.primary}`:`4px solid ${i.palette.background.paper}`,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%) rotate(-90deg)",color:"text.secondary"},o?{cursor:"inherit"}:{"&:hover":{color:"text.primary"},"&:focus-visible":{"&::before":{content:'""',position:"absolute",display:"block",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"50%",width:28,height:28,border:"solid 1px",borderColor:"text.primary"}}}),disabled:o,onClick:()=>{o||e&&e()},children:n?Os.jsx(f,{component:As.Plus,sx:{width:18,height:18}}):Os.jsx(f,{component:As.ArrowBack,sx:{width:18,height:18}})})})}const Pv=15,Dv=.2,Nv=50,Fv=20,Wv=3e4,Vv=.5;function Uv({open:t,execute:n,onClose:r,toToken:o,fromToken:a,fromAmount:s,toAmount:l,priceImpact:d,clearFromAmt:c,clearToAmt:u,baseFeeAmount:p,curToFiatPrice:h,curFromFiatPrice:m,pricePerFromToken:x,additionalFeeAmount:v,loading:b,disabledFiatPrice:A,slippage:w}){var k,C;const j=g(),{contractStatus:E}=yf(),S=lt((()=>!A&&new i(d).gt(Pv)),[d,A]),[I,R]=ct(!1),[L,M]=ct(!1);return st((()=>{E!==gf.Pending&&r(),E===gf.TxSuccess&&(u(),c())}),[E]),st((()=>{R(!1)}),[h]),Os.jsx(yy,{open:t,onClose:()=>{xf(gf.Initial),r()},id:"swap-summary",title:Os.jsx(e,{id:"QR4/RH",message:"Swap summary"}),children:Os.jsxs(f,{sx:{margin:20,display:"flex",height:"100%",flexDirection:"column",borderTop:`1px solid ${j.palette.border.main}`},children:[Os.jsxs(f,{sx:{py:20,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexDirection:"column",borderBottom:`1px solid ${j.palette.border.main}`},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[Os.jsx(ey,{width:16,height:16,url:null==a?void 0:a.logoURI,address:null!==(k=null==a?void 0:a.address)&&void 0!==k?k:"",marginRight:6}),Os.jsx(f,{children:`${An({input:s,decimals:null==a?void 0:a.decimals})} ${null==a?void 0:a.symbol}`})]}),!A&&Os.jsx(f,{sx:{mt:4,typography:"h6",color:j.palette.text.secondary},children:m?`$${bn({input:m,showDecimals:1})}`:"-"})]}),Os.jsx(f,{sx:{width:16,mx:16},component:As.DoubleRight}),Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex"},children:[Os.jsx(ey,{width:16,height:16,marginRight:6,url:null==o?void 0:o.logoURI,address:null!==(C=null==o?void 0:o.address)&&void 0!==C?C:""}),Os.jsx(D,{loading:b,loadingProps:{width:30},children:`${An({input:l,decimals:null==o?void 0:o.decimals})} ${null==o?void 0:o.symbol}`})]}),!A&&Os.jsx(D,{loading:b,loadingProps:{width:30},sx:{typography:"h6",mt:4,color:j.palette.text.secondary},children:h?`$${bn({input:h,showDecimals:1})}(${d}%)`:"-"})]})]}),Os.jsxs(f,{sx:{mt:12,display:"flex",alignItems:"center",typography:"h6"},children:[`1 ${null==a?void 0:a.symbol} = `,Os.jsx(D,{loading:b,loadingProps:{width:30},children:An({input:new i(l).dividedBy(new i(s)),decimals:null==o?void 0:o.decimals})})," ",`${null==o?void 0:o.symbol}`]})]}),Os.jsxs(f,{sx:{py:15,typography:"body2",borderBottom:`1px solid ${j.palette.border.main}`},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",color:j.palette.text.secondary},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(f,{sx:{width:16,mr:7},component:As.DetailBorder}),Os.jsx(e,{id:"XeovX3",message:"Swap Detail"})]}),Os.jsx(f,{component:y,children:Os.jsx(f,{onClick:()=>M(!L),sx:{width:10,color:"text.secondary",transform:L?"rotateX(0deg)":"rotateX(180deg)"},component:As.CaretUp})})]}),Os.jsxs(f,{sx:{mt:16,display:L?"initial":"none"},children:[Os.jsxs(f,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(e,{id:"93m8jT",message:"Basic Fee"}),Os.jsx(Ov,{title:Os.jsx(e,{id:"8Z29ZO",message:"Estimated service provider fees"}),ml:5})]}),Os.jsx(D,{loading:b,loadingProps:{width:30},children:p?`${An({input:p,decimals:null==o?void 0:o.decimals})} ${null==o?void 0:o.symbol}`:"0"})]}),Os.jsxs(f,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(e,{id:"J39pAJ",message:"Additional Fee"}),Os.jsx(Ov,{title:Os.jsx(e,{id:"ZXvy7b",message:"Additional routing fees set by the Widget user"}),ml:5})]}),Os.jsx(D,{loading:b,loadingProps:{width:30},children:v?`${An({input:v,decimals:null==o?void 0:o.decimals})} ${null==o?void 0:o.symbol}`:"0"})]}),!A&&Os.jsxs(f,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(e,{id:"T+qgFw",message:"Price Impact"}),Os.jsx(Ov,{title:Os.jsx(e,{id:"4kY4C4",message:"Due to the market condition, market price and estimated price may have a slight difference"}),ml:5})]}),Os.jsx(f,{children:`${d}%`})]}),Os.jsxs(f,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(e,{id:"CMHmbm",message:"Slippage"}),Os.jsx(Ov,{title:Os.jsx(e,{id:"GAypnX",message:"High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:5})]}),Os.jsxs(f,{children:[w,"%"]})]})]})]}),Os.jsx(f,{sx:{flex:1}}),S&&Os.jsxs(f,{sx:{mb:14,display:"flex",cursor:"pointer",justifyContent:"center",alignItems:"center",typography:"h6"},onClick:()=>R(!I),children:[Os.jsx(f,{sx:{mr:4,width:18,height:18,alignItems:"center"},children:I?Os.jsx(f,{sx:{width:"100%",height:"100%",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"secondary.main"},children:Os.jsx(f,{component:As.Done,sx:{width:14,color:"secondary.contrastText"}})}):Os.jsx(f,{sx:{width:"100%",height:"100%",borderRadius:4,border:`1px solid ${j.palette.text.secondary}`}})}),Os.jsx(f,{children:Os.jsx(e,{components:{0:Os.jsx(f,{component:"span",sx:{color:"error.main"}})},values:{priceImpact:d},id:"Price impact reaches <0>{priceImpact}</0>%, accept the quote"})})]}),Os.jsx(T,{isLoading:E==gf.Pending,disabled:S&&!I,fullWidth:!0,onClick:()=>{n(),xf(gf.Pending)},children:E==gf.Pending?Os.jsx(e,{id:"P+K/3O",message:"Confirming"}):Os.jsx(e,{id:"lQ6r7x",message:"Confirm swap"})})]})})}function Hv(e){var{sx:t,maxVal:n,decimals:r=2,onInputChange:i}=e,a=Nn(e,["sx","maxVal","decimals","onInputChange"]);return Os.jsx(v,{...a,onChange:e=>{const t=0===e.target.value.length?null:Cn(e.target.value,r),a=n&&t&&new o(t).gt(n)?n.toString():t;i&&i(a)}})}function qv(e){const{bridgeSlippage:t,swapSlippage:n}=pf(),{autoSlippage:r}=yf();return{defaultSlippage:lt((()=>!(null==r?void 0:r.loading)&&(null==r?void 0:r.value)?r.value:e?null!=t?t:Vv:null!=n?n:Dv),[n,t,e,r]),loading:null==r?void 0:r.loading}}function Zv({open:t,onClose:n,isBridge:r}){const i=g(),{slippage:o}=yf(),a=lt((()=>Number(o)>=Nv),[o]),{defaultSlippage:s}=qv(r);return Os.jsx(yy,{open:t,onClose:n,id:"swap-settings",title:Os.jsx(e,{id:"Tz0i8g",message:"Settings"}),children:Os.jsx(f,{sx:{mx:20},children:Os.jsxs(f,{sx:{py:20,borderTop:`1px solid ${i.palette.border.main}`},children:[Os.jsxs(f,{sx:{mb:16,display:"flex",alignItems:"center"},children:[Os.jsx(e,{id:"lqTDfd",message:"Slippage Tolerance"}),Os.jsx(Ov,{title:Os.jsx(e,{id:"KAmxpM",message:"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:7})]}),Os.jsxs(f,{sx:{display:"flex",flexDirection:"column"},children:[Os.jsx(Hv,{fullWidth:!0,maxVal:100,value:null!=o?o:"",placeholder:s.toString(),onInputChange:e=>{!function(e,t){null===t?localStorage.removeItem(e?lx:sx):localStorage.setItem(e?lx:sx,String(t))}(!!r,e),Af(e)},suffix:Os.jsx(f,{sx:{color:"text.disabled"},children:"%"}),height:36,sx:{mt:12}}),a&&Os.jsx(f,{sx:{typography:"h6",mt:6,color:"error.main"},children:Os.jsx(e,{id:"Zm56FI",message:"Maximum slippage do not exceed 50%"})})]})]})})})}const zv=15e3;function Qv({refetch:e,interval:t}){let n;st((()=>(e(),clearTimeout(n),n=setInterval((()=>{e()}),null!=t?t:zv),()=>clearTimeout(n))),[e])}function Gv(e){const{apiServices:t}=pf();return lt((()=>function(e,t={}){var n,r,i,o,a;switch(e){case Ha.routePrice:return null!==(n=t.routePrice)&&void 0!==n?n:Qa;case Ha.fiatPrice:return null!==(r=t.fiatPrice)&&void 0!==r?r:Ga;case Ha.bridgeRoutePrice:return null!==(i=t.bridgeRoutePrice)&&void 0!==i?i:Ya;case Ha.bridgeEncode:return null!==(o=t.bridgeEncode)&&void 0!==o?o:Xa;case Ha.bridgeCreateRoute:return null!==(a=t.bridgeCreateRoute)&&void 0!==a?a:Ja;default:throw new Error(`Invalid key = ${e}`)}}(e,t)),[t,e])}function Yv({fromToken:e,toToken:t}){const[n,r]=ct(!0),[i,o]=ct(null),{apikey:a}=pf(),[s,l]=ct(""),[d,c]=ct(""),u=Gv(Ha.fiatPrice),p=ut((()=>{if(!e||!t)return;r(!0),o(null);const n=[e,t];Ut.post(u,{networks:n.map((e=>ys(e.chainId))),addresses:n.map((e=>e.address)),symbols:n.map((e=>e.symbol)),isCache:!0},a?{headers:{apikey:a}}:void 0).then((n=>{var i;r(!1);const o=null===(i=n.data)||void 0===i?void 0:i.data;o&&(l(o.find((t=>t.address===e.address)).price),c(o.find((e=>e.address===t.address)).price))})).catch((e=>{o(e),r(!1),console.error(e)}))}),[e,t,a,u]);return Qv({refetch:p}),{loading:n,isLoading:n,refetch:p,error:i,toFiatPrice:d,fromFiatPrice:s}}const Xv="0x0000000000000000000000000000000000000000",Jv="0x0000000000000000000000000000000000000000";function Kv(e,t){let n;try{n=e()}catch(e){return}const r={getItem:e=>{var t;const r=e=>null===e?null:JSON.parse(e,void 0),i=null!=(t=n.getItem(e))?t:null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,t)=>n.setItem(e,JSON.stringify(t,void 0)),removeItem:e=>n.removeItem(e)};return r}const _v=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>_v(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>_v(t)(e)}}},$v=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),((e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},a=!1;const s=new Set,l=new Set;let d;try{d=o.getStorage()}catch(e){}if(!d)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...e)}),r,i);const c=_v(o.serialize),u=()=>{const e=o.partialize({...r()});let t;const n=c({state:e,version:o.version}).then((e=>d.setItem(o.name,e))).catch((e=>{t=e}));if(t)throw t;return n},p=i.setState;i.setState=(e,t)=>{p(e,t),u()};const h=e(((...e)=>{n(...e),u()}),r,i);let m;const f=()=>{var e;if(!d)return;a=!1,s.forEach((e=>e(r())));const t=(null==(e=o.onRehydrateStorage)?void 0:e.call(o,r()))||void 0;return _v(d.getItem.bind(d))(o.name).then((e=>{if(e)return o.deserialize(e)})).then((e=>{if(e){if("number"!=typeof e.version||e.version===o.version)return e.state;if(o.migrate)return o.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((e=>{var t;return m=o.merge(e,null!=(t=r())?t:h),n(m,!0),u()})).then((()=>{null==t||t(m,void 0),a=!0,l.forEach((e=>e(m)))})).catch((e=>{null==t||t(void 0,e)}))};return i.persist={setOptions:e=>{o={...o,...e},e.getStorage&&(d=e.getStorage())},clearStorage:()=>{null==d||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>f(),hasHydrated:()=>a,onHydrate:e=>(s.add(e),()=>{s.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},f(),m||h})(e,t)):((e,t)=>(n,r,i)=>{let o={storage:Kv((()=>localStorage)),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},a=!1;const s=new Set,l=new Set;let d=o.storage;if(!d)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...e)}),r,i);const c=()=>{const e=o.partialize({...r()});return d.setItem(o.name,{state:e,version:o.version})},u=i.setState;i.setState=(e,t)=>{u(e,t),c()};const p=e(((...e)=>{n(...e),c()}),r,i);let h;i.getInitialState=()=>p;const m=()=>{var e,t;if(!d)return;a=!1,s.forEach((e=>{var t;return e(null!=(t=r())?t:p)}));const i=(null==(t=o.onRehydrateStorage)?void 0:t.call(o,null!=(e=r())?e:p))||void 0;return _v(d.getItem.bind(d))(o.name).then((e=>{if(e){if("number"!=typeof e.version||e.version===o.version)return[!1,e.state];if(o.migrate)return[!0,o.migrate(e.state,e.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]})).then((e=>{var t;const[i,a]=e;if(h=o.merge(a,null!=(t=r())?t:p),n(h,!0),i)return c()})).then((()=>{null==i||i(h,void 0),h=r(),a=!0,l.forEach((e=>e(h)))})).catch((e=>{null==i||i(void 0,e)}))};return i.persist={setOptions:e=>{o={...o,...e},e.storage&&(d=e.storage)},clearStorage:()=>{null==d||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>a,onHydrate:e=>(s.add(e),()=>{s.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},o.skipHydration||m(),h||p})(e,t),eb=bt($v((e=>({slippageAdvanced:!1,notRemindAgainSlippageHigher:!1,notRemindAgainSlippageLower:!1,customSwapPairSlippages:[],ddl:String(Fv),expertMode:!1,disableIndirectRouting:!1})),{name:"swap-setting-storage",storage:Kv((()=>localStorage))}));var tb,nb,rb,ib;function ob({toToken:e,fromToken:t,fromAmount:n,toAmount:i,marginAmount:o,estimateGas:a,isReverseRouting:s,slippage:l,slippageLoading:d}){const{account:c,chainId:u,provider:p}=At(),{defaultChainId:h,feeRate:m,rebateTo:f,apikey:g}=pf(),y=lt((()=>(null==t?void 0:t.chainId)||u||h),[u,t,h]),x=eb((e=>Number(e.ddl))),v=eb((e=>Number(e.disableIndirectRouting))),b=dt(0),[A,w]=ct(tb.Initial),[k,C]=ct(null),j=Gv(Ha.routePrice),T=ut((()=>{C(null)}),[k]);st((()=>{T()}),[t,e]);const E=ut((()=>Fn(this,void 0,void 0,(function*(){if(!y||!t||!e||t.chainId!==e.chainId||!s&&!n||s&&!i)return void w(tb.Initial);b.current=b.current+1;const r=b.current;w(tb.Loading);const o=Math.floor(Date.now()/1e3)+60*x,d={chainId:y,deadLine:o,apikey:g,slippage:l,source:v?"noMaxHops":"dodoV2AndMixWasm",toTokenAddress:e.address,fromTokenAddress:t.address,userAddr:c||Xv,estimateGas:a};s?d.toAmount=re(String(i||1),e.decimals).toString():d.fromAmount=re(String(n||1),t.decimals).toString(),f&&m&&(d.rebateTo=f,d.fee=m);try{const e=yield Ut.get(j,{params:d});if(r<b.current)return;const t=e.data.data;(null==t?void 0:t.resAmount)?(w(tb.Success),C(t)):(w(tb.Failed),C(null))}catch(e){w(tb.Failed),C(null),console.error(e)}}))),[x,c,y,e,m,l,f,t,p,n,i,g,s,j,a,v]);Qv({refetch:E});const S=lt((()=>{const e=s?i:n;return k&&A!==tb.Loading&&e?k:null}),[k,A,s,i,n]),I=function(){const{chainId:e,account:t}=At(),n=Hy(),i=ut((({to:e,data:i,useSource:o,duration:a,ddl:s,gasLimit:l,subtitle:d,value:c,mixpanelProps:u})=>{const p=60*s,h=c;o&&"weth"!==o.toLowerCase()&&l&&l.lt(Wv)&&console.debug("Warning: GasLimit less than the minimum!");const m={from:t,to:e,data:i,value:h,route:o,duration:a,ddlSecRel:p,gasLimit:l};n.execute(r._({id:"vH2C/2",message:"Swap"}),Object.assign({opcode:By.TX},m),{subtitle:d,metadata:{[Ey.swap]:!0},mixpanelProps:u})}),[t,n]);return i}(),R=ut((r=>{if(!S)return;const{resAmount:i,to:o,data:a,useSource:l,duration:d,value:u}=S,p=s?i:n,h=s?n:i;t&&p&&I({to:o,data:a,useSource:l,duration:d,ddl:x,value:u,subtitle:r,mixpanelProps:{from:c,fromTokenAddress:t.address,toTokenAddress:null==e?void 0:e.address,fromAmount:re(String(p||1),t.decimals).toString(),resAmount:h,resPricePerFromToken:s?S.resPricePerToToken:S.resPricePerFromToken,resPricePerToToken:s?S.resPricePerFromToken:S.resPricePerToToken,fromTokenSymbol:t.symbol,toTokenSymbol:null==e?void 0:e.symbol,fromTokenDecimals:t.decimals,toTokenDecimals:null==e?void 0:e.decimals}})}),[x,c,t,n,e,s,S]);return{status:A,rawBrief:S,refetch:E,executeSwap:R,reset:T}}function ab({toToken:t,fromToken:n,priceStatus:r,pricePerToToken:i,pricePerFromToken:o}){const[a,s]=ct("-"),[l,d]=ct(null),[c,u]=ct("-"),[p,h]=ct(null);st((()=>{s(null==n?void 0:n.symbol),u(null==t?void 0:t.symbol),d(i),h(o)}),[n,t,i,o]);const m=ut((()=>{s(c),u(a),d(p),h(l)}),[a,l,c,p]);return Os.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:{[tb.Initial]:"-",[tb.Loading]:Os.jsxs(Os.Fragment,{children:[Os.jsx(x,{sx:{mr:5}}),Os.jsx(e,{id:"JdNn1Y",message:"Fetching best price..."})]}),[tb.Failed]:Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{component:As.Warn,sx:{width:15,mr:5,color:"warning.main"}}),Os.jsx(e,{id:"NVAuTg",message:"Quote not available"})]}),[tb.Success]:Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{sx:{typography:"body2"},children:`1 ${a} = ${bn({input:p,showDecimals:4})} ${c}`}),Os.jsx(f,{component:y,sx:{width:18,height:18,ml:6,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},children:Os.jsx(f,{sx:{width:16,color:"text.secondary"},onClick:m,component:As.Switch})})]})}[r]})}function sb(t){var n,i,o,{chainId:a,includeButton:s}=t,l=Nn(t,["chainId","includeButton"]);const{account:d,chainId:c,connector:u}=At(),{onConnectWalletClick:p,onSwitchChain:h}=pf(),[m,f]=at.useState(!1),g=cx(a),y=void 0!==c&&void 0!==a&&c!==a;return!d||m||void 0===c||a&&a!==c?Os.jsx(Os.Fragment,{children:Os.jsx(T,{...l,isLoading:m,onClick:()=>Fn(this,void 0,void 0,(function*(){if(y)return h?(f(!0),yield h(),void f(!1)):g?(f(!0),yield g(),void f(!1)):void yf.setState({openConnectWalletInfo:{chainId:a}});if(p){f(!0);const e=yield p();if(f(!1),e)return}u.deactivate?u.deactivate():u.resetState(),yf.setState({openConnectWalletInfo:!0})})),children:m?Os.jsx(e,{id:"J28zul",message:"Connecting..."}):y&&a?r._({id:"1+P9RR",message:"Switch to {0}",values:{0:null!==(o=null===(i=_g.get(a))||void 0===i?void 0:i.name)&&void 0!==o?o:"unknown"}}):Os.jsx(e,{id:"r7ScnQ",message:"Connect to a wallet"})})}):s?Os.jsx(Os.Fragment,{children:null!==(n=l.children)&&void 0!==n?n:null}):Os.jsx(T,{...l})}function lb({needSwitchChain:e,border:t}){return Os.jsx(Os.Fragment,{children:Os.jsx(sb,{size:T.Size.middle,fullWidth:!0,"data-testid":ty,chainId:e,sx:t?{borderWidth:3,borderStyle:"solid",borderColor:"text.primary"}:void 0})})}function db(){return db=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},db.apply(null,arguments)}!function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}(tb||(tb={})),function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}(nb||(nb={}));var cb,ub;function pb(){return pb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pb.apply(null,arguments)}var hb,mb;function fb(){return fb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fb.apply(null,arguments)}var gb,yb,xb;function vb(){return vb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vb.apply(null,arguments)}var bb,Ab;function wb(){return wb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wb.apply(null,arguments)}var kb,Cb,jb,Tb;function Eb(){return Eb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Eb.apply(null,arguments)}var Sb,Ib,Rb;function Lb(){return Lb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lb.apply(null,arguments)}var Mb,Ob,Bb,Pb,Db,Nb;function Fb(){return Fb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fb.apply(null,arguments)}var Wb,Vb;function Ub(){return Ub=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ub.apply(null,arguments)}var Hb,qb,Zb,zb,Qb,Gb;function Yb(){return Yb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yb.apply(null,arguments)}var Xb,Jb,Kb;function _b(){return _b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_b.apply(null,arguments)}var $b,eA;function tA(){return tA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tA.apply(null,arguments)}var nA,rA;function iA(){return iA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iA.apply(null,arguments)}var oA,aA;function sA(){return sA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sA.apply(null,arguments)}var lA;function dA(){return dA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dA.apply(null,arguments)}var cA,uA;function pA(){return pA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pA.apply(null,arguments)}const hA=[{id:"cBridge",logoURI:e=>ot.createElement("svg",Lb({width:34,height:34,viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Sb||(Sb=ot.createElement("rect",{x:1,y:1,width:32,height:32,rx:8,fill:"white",stroke:"#33363F"})),Ib||(Ib=ot.createElement("g",{clipPath:"url(#clip0_37_1169)"},ot.createElement("path",{d:"M10.9221 22C13.0882 22 14.8442 21.2006 14.8442 20.2144C14.8442 19.2283 13.0882 18.4288 10.9221 18.4288C8.75599 18.4288 7 19.2283 7 20.2144C7 21.2006 8.75599 22 10.9221 22Z",fill:"#444444"}),ot.createElement("path",{d:"M23.5587 22C25.7248 22 27.4808 21.2006 27.4808 20.2144C27.4808 19.2283 25.7248 18.4288 23.5587 18.4288C21.3926 18.4288 19.6366 19.2283 19.6366 20.2144C19.6366 21.2006 21.3926 22 23.5587 22Z",fill:"#DDDDDD"}),ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.88456 20.2144C9.84901 20.2146 9.81379 20.2076 9.78098 20.1939C9.74818 20.1802 9.71844 20.1601 9.69353 20.1347C9.66862 20.1094 9.64903 20.0793 9.63593 20.0462C9.62283 20.0132 9.61648 19.9779 9.61725 19.9423C9.7509 15.5317 13.1124 12 17.2394 12C21.3663 12 24.7278 15.5317 24.8615 19.9423C24.8622 19.9779 24.8559 20.0132 24.8428 20.0462C24.8297 20.0793 24.8101 20.1094 24.7852 20.1347C24.7603 20.1601 24.7306 20.1802 24.6977 20.1939C24.6649 20.2076 24.6297 20.2146 24.5942 20.2144H22.0874C22.0152 20.2135 21.946 20.1848 21.8943 20.1344C21.8426 20.0839 21.8123 20.0155 21.8096 19.9433C21.6894 17.1106 19.6894 14.8567 17.2403 14.8567C14.7913 14.8567 12.7913 17.1106 12.6711 19.9433C12.6684 20.0155 12.638 20.0839 12.5863 20.1344C12.5346 20.1848 12.4655 20.2135 12.3932 20.2144H9.88456Z",fill:"#FF957E"}))),Rb||(Rb=ot.createElement("defs",null,ot.createElement("clipPath",{id:"clip0_37_1169"},ot.createElement("rect",{width:20.4808,height:10,fill:"white",transform:"translate(7 12)"}))))),name:"cBridge"},{id:"stargate",logoURI:e=>ot.createElement("svg",Yb({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Hb||(Hb=ot.createElement("path",{d:"M0.5 8C0.5 3.85786 3.85786 0.5 8 0.5H24C28.1421 0.5 31.5 3.85786 31.5 8V24C31.5 28.1421 28.1421 31.5 24 31.5H8C3.85786 31.5 0.5 28.1421 0.5 24V8Z",fill:"black",stroke:"black"})),qb||(qb=ot.createElement("path",{d:"M17.5867 8.63649L18.0125 9.63382C18.8482 11.592 20.4079 13.1518 22.3662 13.9875L23.3635 14.4133C23.6245 14.5246 23.8365 14.6842 24 14.8743C23.5033 11.3132 20.6868 8.49629 17.1257 8C17.3154 8.16317 17.4754 8.37546 17.5867 8.63649Z",fill:"#999999"})),Zb||(Zb=ot.createElement("path",{d:"M8.63649 14.4133L9.63382 13.9875C11.592 13.1518 13.1518 11.592 13.9879 9.63382L14.4133 8.63649C14.525 8.37546 14.6846 8.16317 14.8743 8C11.3132 8.49629 8.49667 11.3132 8 14.8743C8.16357 14.6842 8.37548 14.5246 8.63649 14.4133Z",fill:"#999999"})),zb||(zb=ot.createElement("path",{d:"M23.3635 17.5863L22.3662 18.0121C20.4079 18.8479 18.8482 20.408 18.0125 22.3662L17.5867 23.3632C17.4754 23.6242 17.3154 23.8365 17.1257 24C20.6868 23.5034 23.5033 20.6865 24 17.1253C23.8365 17.3154 23.6245 17.475 23.3635 17.5863Z",fill:"#999999"})),Qb||(Qb=ot.createElement("path",{d:"M14.4133 23.3632L13.9879 22.3662C13.1518 20.408 11.592 18.8479 9.63382 18.0121L8.63649 17.5863C8.37548 17.475 8.16357 17.3154 8 17.1253C8.49667 20.6865 11.3132 23.5034 14.8743 24C14.6846 23.8365 14.525 23.6242 14.4133 23.3632Z",fill:"#999999"})),Gb||(Gb=ot.createElement("path",{d:"M12.3715 15.2177L12.863 15.0078C13.8278 14.5959 14.5966 13.8275 15.0086 12.8626L15.2181 12.3711C15.512 11.6827 16.4879 11.6827 16.7818 12.3711L16.9913 12.8626C17.4032 13.8275 18.172 14.5959 19.1369 15.0078L19.6284 15.2177C20.3168 15.5116 20.3168 16.4872 19.6284 16.7811L19.1369 16.991C18.172 17.4029 17.4032 18.1713 16.9913 19.1366L16.7818 19.6276C16.4879 20.3161 15.512 20.3161 15.2181 19.6276L15.0086 19.1366C14.5966 18.1713 13.8278 17.4029 12.863 16.991L12.3715 16.7811C11.6831 16.4872 11.6831 15.5116 12.3715 15.2177Z",fill:"#F2F2F2"}))),name:"Stargate"},{id:"connext",logoURI:e=>ot.createElement("svg",Fb({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Mb||(Mb=ot.createElement("rect",{width:32,height:32,rx:8,fill:"black"})),Ob||(Ob=ot.createElement("path",{d:"M13.0566 9.12524C13.0566 9.12524 12.31 9.87191 11.4353 10.7466L7.90996 14.2399C6.46996 15.7066 7.0353 17.1999 8.03796 18.2026L10.918 21.0826C11.174 21.3386 12.1766 22.3946 12.9766 21.5732C13.4406 21.1092 13.3393 20.3892 13.078 20.1066L9.76063 16.8159C9.16863 16.2239 9.4513 15.6852 10.0433 15.1199L12.8753 12.2879L14.6513 14.0639C15.27 14.6826 16.038 14.9119 16.6833 14.2719C17.3286 13.6266 16.9393 13.0132 16.3206 12.3946L14.3633 10.4372L13.0566 9.12524Z",fill:"url(#paint0_linear_5431_181414)"})),Bb||(Bb=ot.createElement("path",{d:"M13.2112 9.25332C12.7472 8.78932 12.0805 8.53332 11.4352 9.17865C10.7898 9.82399 11.1258 10.544 11.5365 10.9547",fill:"url(#paint1_linear_5431_181414)"})),Pb||(Pb=ot.createElement("path",{d:"M18.9218 22.8638C18.9218 22.8638 19.6685 22.1171 20.5432 21.2424L24.0685 17.7171C25.5352 16.2504 24.9698 14.7571 23.9405 13.7544L21.0605 10.9011C20.8045 10.6451 19.8018 9.5891 19.0018 10.4104C18.5378 10.8744 18.6392 11.5944 18.9005 11.8771L22.2178 15.1678C22.8098 15.7598 22.5272 16.2984 21.9352 16.8638L19.1032 19.6958L17.3272 17.9198C16.7085 17.3011 15.9405 17.0718 15.2952 17.7118C14.6498 18.3518 15.0392 18.9704 15.6578 19.5891L17.6152 21.5464L18.9218 22.8638Z",fill:"url(#paint2_linear_5431_181414)"})),Db||(Db=ot.createElement("path",{d:"M18.7671 22.7306C19.2311 23.1946 19.8978 23.4772 20.5431 22.8319C21.1884 22.1866 20.8524 21.4666 20.4418 21.0559",fill:"url(#paint3_linear_5431_181414)"})),Nb||(Nb=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_5431_181414",x1:7.86029,y1:12.5047,x2:23.8117,y2:22.7959,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#29C1FC"}),ot.createElement("stop",{offset:.5022,stopColor:"#AB00FF"}),ot.createElement("stop",{offset:.5082,stopColor:"#AC03FC"}),ot.createElement("stop",{offset:.6406,stopColor:"#C840B8"}),ot.createElement("stop",{offset:.7601,stopColor:"#DE7082"}),ot.createElement("stop",{offset:.8629,stopColor:"#EE935B"}),ot.createElement("stop",{offset:.9448,stopColor:"#F7A844"}),ot.createElement("stop",{offset:.9956,stopColor:"#FBB03B"})),ot.createElement("linearGradient",{id:"paint1_linear_5431_181414",x1:10.2949,y1:8.73084,x2:26.2463,y2:19.0221,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#29C1FC"}),ot.createElement("stop",{offset:.5022,stopColor:"#AB00FF"}),ot.createElement("stop",{offset:.5082,stopColor:"#AC03FC"}),ot.createElement("stop",{offset:.6406,stopColor:"#C840B8"}),ot.createElement("stop",{offset:.7601,stopColor:"#DE7082"}),ot.createElement("stop",{offset:.8629,stopColor:"#EE935B"}),ot.createElement("stop",{offset:.9448,stopColor:"#F7A844"}),ot.createElement("stop",{offset:.9956,stopColor:"#FBB03B"})),ot.createElement("linearGradient",{id:"paint2_linear_5431_181414",x1:9.46092,y1:10.0213,x2:25.4123,y2:20.3125,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#29C1FC"}),ot.createElement("stop",{offset:.5022,stopColor:"#AB00FF"}),ot.createElement("stop",{offset:.5082,stopColor:"#AC03FC"}),ot.createElement("stop",{offset:.6406,stopColor:"#C840B8"}),ot.createElement("stop",{offset:.7601,stopColor:"#DE7082"}),ot.createElement("stop",{offset:.8629,stopColor:"#EE935B"}),ot.createElement("stop",{offset:.9448,stopColor:"#F7A844"}),ot.createElement("stop",{offset:.9956,stopColor:"#FBB03B"})),ot.createElement("linearGradient",{id:"paint3_linear_5431_181414",x1:7.01942,y1:13.8057,x2:22.9708,y2:24.0969,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#29C1FC"}),ot.createElement("stop",{offset:.5022,stopColor:"#AB00FF"}),ot.createElement("stop",{offset:.5082,stopColor:"#AC03FC"}),ot.createElement("stop",{offset:.6406,stopColor:"#C840B8"}),ot.createElement("stop",{offset:.7601,stopColor:"#DE7082"}),ot.createElement("stop",{offset:.8629,stopColor:"#EE935B"}),ot.createElement("stop",{offset:.9448,stopColor:"#F7A844"}),ot.createElement("stop",{offset:.9956,stopColor:"#FBB03B"}))))),name:"Connext"},{id:"synapse",logoURI:e=>ot.createElement("svg",_b({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ot.createElement("mask",{id:"mask0_419_48383",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:32,height:32},Xb||(Xb=ot.createElement("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H24C28.4183 0 32 3.58172 32 8V24C32 28.4183 28.4183 32 24 32H8C3.58172 32 0 28.4183 0 24V8Z",fill:"black"}))),Jb||(Jb=ot.createElement("g",{mask:"url(#mask0_419_48383)"},ot.createElement("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H24C28.4183 0 32 3.58172 32 8V24C32 28.4183 28.4183 32 24 32H8C3.58172 32 0 28.4183 0 24V8Z",fill:"#121826"}),ot.createElement("path",{d:"M15.9794 7C15.5251 7 15.1568 7.36058 15.1568 7.80538C15.1568 8.25017 15.5251 8.61075 15.9794 8.61075C16.4337 8.61075 16.802 8.25017 16.802 7.80538C16.802 7.36058 16.4337 7 15.9794 7Z",fill:"url(#paint0_radial_419_48383)"}),ot.createElement("path",{d:"M15.9794 7.44297C16.1839 7.44297 16.3496 7.60522 16.3496 7.80537C16.3496 8.00551 16.1839 8.16776 15.9794 8.16776C15.775 8.16776 15.6093 8.00551 15.6093 7.80537C15.6093 7.60522 15.775 7.44293 15.9794 7.44293V7.44297ZM12.4422 9.13423C11.9879 9.13423 11.6196 9.49481 11.6196 9.93961C11.6196 10.3844 11.9878 10.7449 12.4422 10.7449C12.8965 10.7449 13.2648 10.3844 13.2648 9.93961C13.2648 9.49481 12.8965 9.13423 12.4422 9.13423ZM19.599 9.17448C19.1446 9.17448 18.7764 9.53506 18.7764 9.97986C18.7764 10.4247 19.1446 10.7852 19.599 10.7852C20.0533 10.7852 20.4216 10.4247 20.4216 9.97986C20.4216 9.53506 20.0533 9.17448 19.599 9.17448V9.17448Z",fill:"url(#paint1_radial_419_48383)"}),ot.createElement("path",{d:"M12.4422 9.57715C12.6466 9.57715 12.8124 9.7394 12.8124 9.93958C12.8124 10.1397 12.6466 10.302 12.4422 10.302C12.2377 10.302 12.072 10.1397 12.072 9.93958C12.072 9.7394 12.2377 9.57715 12.4422 9.57715ZM19.599 9.6174C19.8034 9.6174 19.9691 9.77965 19.9691 9.97984C19.9691 10.18 19.8034 10.3422 19.599 10.3422C19.3945 10.3422 19.2288 10.18 19.2288 9.97984C19.2288 9.77969 19.3945 9.6174 19.599 9.6174V9.6174ZM15.9794 10.9866C15.457 10.9866 15.0334 11.4012 15.0334 11.9127C15.0334 12.4242 15.457 12.8389 15.9794 12.8389C16.5019 12.8389 16.9255 12.4242 16.9255 11.9127C16.9255 11.4012 16.5019 10.9866 15.9794 10.9866ZM8.8226 11.1074C8.3683 11.1074 8 11.4679 8 11.9127C8 12.3575 8.3683 12.7181 8.8226 12.7181C9.27695 12.7181 9.64525 12.3575 9.64525 11.9127C9.64525 11.4679 9.27695 11.1074 8.8226 11.1074ZM23.1774 11.1074C22.723 11.1074 22.3548 11.4679 22.3548 11.9127C22.3548 12.3575 22.723 12.7181 23.1774 12.7181C23.6317 12.7181 24 12.3575 24 11.9127C24 11.4679 23.6317 11.1074 23.1774 11.1074V11.1074Z",fill:"url(#paint2_radial_419_48383)"}),ot.createElement("path",{d:"M15.9794 11.4295C16.252 11.4295 16.473 11.6458 16.473 11.9127C16.473 12.1796 16.252 12.3959 15.9794 12.3959C15.7068 12.3959 15.4859 12.1796 15.4859 11.9127C15.4859 11.6458 15.7068 11.4295 15.9794 11.4295V11.4295ZM8.82261 11.5503C9.02706 11.5503 9.19281 11.7126 9.19281 11.9127C9.19281 12.1129 9.02706 12.2751 8.82261 12.2751C8.61817 12.2751 8.45245 12.1129 8.45245 11.9127C8.45245 11.7126 8.61817 11.5503 8.82261 11.5503V11.5503ZM23.1774 11.5503C23.3818 11.5503 23.5476 11.7126 23.5476 11.9127C23.5476 12.1129 23.3818 12.2751 23.1774 12.2751C22.973 12.2751 22.8072 12.1129 22.8072 11.9127C22.8072 11.7126 22.973 11.5503 23.1774 11.5503ZM12.3188 13C11.7963 13 11.3727 13.4146 11.3727 13.9261C11.3727 14.4377 11.7963 14.8523 12.3188 14.8523C12.8412 14.8523 13.2648 14.4377 13.2648 13.9261C13.2648 13.4146 12.8412 13 12.3188 13ZM19.599 13C19.0765 13 18.653 13.4146 18.653 13.9261C18.653 14.4377 19.0765 14.8523 19.599 14.8523C20.1214 14.8523 20.545 14.4377 20.545 13.9261C20.545 13.4146 20.1214 13 19.599 13Z",fill:"url(#paint3_radial_419_48383)"}),ot.createElement("path",{d:"M12.3187 13.443C12.5913 13.443 12.8123 13.6593 12.8123 13.9262C12.8123 14.1931 12.5913 14.4094 12.3187 14.4094C12.0461 14.4094 11.8252 14.1931 11.8252 13.9262C11.8252 13.6593 12.0461 13.443 12.3187 13.443ZM19.599 13.443C19.8715 13.443 20.0925 13.6593 20.0925 13.9262C20.0925 14.1931 19.8715 14.4094 19.599 14.4094C19.3264 14.4094 19.1054 14.1931 19.1054 13.9262C19.1054 13.6593 19.3264 13.443 19.599 13.443Z",fill:"url(#paint4_radial_419_48383)"}),ot.createElement("path",{d:"M8.8226 15.1745C8.3683 15.1745 8 15.5351 8 15.9799C8 16.4247 8.3683 16.7853 8.8226 16.7853C9.27695 16.7853 9.64525 16.4247 9.64525 15.9799C9.64525 15.5351 9.27695 15.1745 8.8226 15.1745ZM23.1774 15.1745C22.723 15.1745 22.3548 15.5351 22.3548 15.9799C22.3548 16.4247 22.723 16.7853 23.1774 16.7853C23.6317 16.7853 24 16.4247 24 15.9799C24 15.5351 23.6317 15.1745 23.1774 15.1745ZM16.0206 15.2953C16.4067 15.2953 16.7198 15.6018 16.7198 15.9799C16.7198 16.358 16.4067 16.6645 16.0206 16.6645C15.6344 16.6645 15.3214 16.358 15.3214 15.9799C15.3214 15.6018 15.6344 15.2953 16.0206 15.2953Z",fill:"url(#paint5_radial_419_48383)"}),ot.createElement("path",{d:"M8.82261 15.6174C9.02706 15.6174 9.19281 15.7797 9.19281 15.9798C9.19281 16.18 9.02706 16.3423 8.82261 16.3423C8.61817 16.3423 8.45245 16.18 8.45245 15.9798C8.45245 15.7797 8.61817 15.6174 8.82261 15.6174V15.6174ZM23.1774 15.6174C23.3818 15.6174 23.5476 15.7797 23.5476 15.9798C23.5476 16.18 23.3818 16.3423 23.1774 16.3423C22.973 16.3423 22.8072 16.18 22.8072 15.9798C22.8072 15.7797 22.973 15.6174 23.1774 15.6174ZM12.4422 17.0671C11.9197 17.0671 11.4961 17.4818 11.4961 17.9933C11.4961 18.5048 11.9197 18.9194 12.4422 18.9194C12.9646 18.9194 13.3882 18.5048 13.3882 17.9933C13.3882 17.4818 12.9646 17.0671 12.4422 17.0671V17.0671ZM19.599 17.0671C19.0765 17.0671 18.653 17.4818 18.653 17.9933C18.653 18.5048 19.0765 18.9194 19.599 18.9194C20.1214 18.9194 20.545 18.5048 20.545 17.9933C20.545 17.4818 20.1214 17.0671 19.599 17.0671V17.0671Z",fill:"url(#paint6_radial_419_48383)"}),ot.createElement("path",{d:"M12.4422 17.5101C12.7148 17.5101 12.9357 17.7264 12.9357 17.9933C12.9357 18.2602 12.7148 18.4765 12.4422 18.4765C12.1696 18.4765 11.9486 18.2602 11.9486 17.9933C11.9486 17.7264 12.1696 17.5101 12.4422 17.5101V17.5101ZM19.599 17.5101C19.8716 17.5101 20.0925 17.7264 20.0925 17.9933C20.0925 18.2602 19.8716 18.4765 19.599 18.4765C19.3264 18.4765 19.1054 18.2602 19.1054 17.9933C19.1054 17.7264 19.3264 17.5101 19.599 17.5101V17.5101ZM15.9794 19.0805C15.457 19.0805 15.0334 19.4952 15.0334 20.0067C15.0334 20.5182 15.457 20.9329 15.9794 20.9329C16.5019 20.9329 16.9255 20.5182 16.9255 20.0067C16.9255 19.4952 16.5019 19.0805 15.9794 19.0805ZM8.8226 19.2416C8.3683 19.2416 8 19.6022 8 20.047C8 20.4918 8.3683 20.8524 8.8226 20.8524C9.27695 20.8524 9.64525 20.4918 9.64525 20.047C9.64525 19.6022 9.27695 19.2416 8.8226 19.2416ZM23.1774 19.2416C22.723 19.2416 22.3548 19.6022 22.3548 20.047C22.3548 20.4918 22.723 20.8524 23.1774 20.8524C23.6317 20.8524 24 20.4918 24 20.047C24 19.6022 23.6317 19.2416 23.1774 19.2416Z",fill:"url(#paint7_radial_419_48383)"}),ot.createElement("path",{d:"M15.9794 19.5235C16.252 19.5235 16.473 19.7398 16.473 20.0067C16.473 20.2736 16.252 20.4899 15.9794 20.4899C15.7068 20.4899 15.4859 20.2736 15.4859 20.0067C15.4859 19.7398 15.7068 19.5235 15.9794 19.5235ZM8.82261 19.6845C9.02706 19.6845 9.19281 19.8468 9.19281 20.047C9.19281 20.2471 9.02706 20.4094 8.82261 20.4094C8.61817 20.4094 8.45245 20.2471 8.45245 20.047C8.45245 19.8468 8.61817 19.6845 8.82261 19.6845V19.6845ZM23.1774 19.6845C23.3818 19.6845 23.5476 19.8468 23.5476 20.047C23.5476 20.2471 23.3818 20.4094 23.1774 20.4094C22.973 20.4094 22.8072 20.2471 22.8072 20.047C22.8072 19.8468 22.973 19.6845 23.1774 19.6845ZM12.4422 21.255C11.9879 21.255 11.6196 21.6156 11.6196 22.0604C11.6196 22.5052 11.9878 22.8658 12.4422 22.8658C12.8965 22.8658 13.2648 22.5052 13.2648 22.0604C13.2648 21.6156 12.8965 21.255 12.4422 21.255ZM19.599 21.2953C19.1446 21.2953 18.7763 21.6559 18.7763 22.1007C18.7763 22.5455 19.1446 22.9061 19.599 22.9061C20.0533 22.9061 20.4216 22.5455 20.4216 22.1007C20.4216 21.6559 20.0533 21.2953 19.599 21.2953Z",fill:"url(#paint8_radial_419_48383)"}),ot.createElement("path",{d:"M12.4422 21.698C12.6466 21.698 12.8124 21.8602 12.8124 22.0604C12.8124 22.2606 12.6466 22.4228 12.4422 22.4228C12.2377 22.4228 12.072 22.2606 12.072 22.0604C12.072 21.8602 12.2377 21.698 12.4422 21.698ZM19.599 21.7383C19.8035 21.7383 19.9692 21.9005 19.9692 22.1007C19.9692 22.3008 19.8035 22.4631 19.599 22.4631C19.3946 22.4631 19.2288 22.3008 19.2288 22.1007C19.2288 21.9005 19.3946 21.7383 19.599 21.7383ZM15.9795 23.3893C15.5251 23.3893 15.1568 23.7498 15.1568 24.1946C15.1568 24.6394 15.5251 25 15.9795 25C16.4338 25 16.8021 24.6394 16.8021 24.1946C16.8021 23.7498 16.4338 23.3893 15.9795 23.3893V23.3893Z",fill:"url(#paint9_radial_419_48383)"}),ot.createElement("path",{d:"M15.9794 23.8322C16.1838 23.8322 16.3496 23.9945 16.3496 24.1946C16.3496 24.3948 16.1838 24.5571 15.9794 24.5571C15.775 24.5571 15.6092 24.3948 15.6092 24.1946C15.6092 23.9945 15.775 23.8322 15.9794 23.8322ZM19.2699 13.7972L16.3496 15.5288L16.5848 15.9075L19.5051 14.176L19.2699 13.7972V13.7972ZM12.6761 13.7576L12.4331 14.1313L15.3945 15.9837L15.6375 15.6099L12.6761 13.7576V13.7576ZM11.8843 13.9551L9.16962 15.6061L9.40873 15.9824L12.1234 14.3314L11.8843 13.9551ZM22.9113 15.8855L19.9909 17.617L20.2262 17.9958L23.1465 16.2643L22.9113 15.8855ZM15.5077 16.0466L12.5874 17.7781L12.8226 18.1569L15.7429 16.4254L15.5077 16.0466V16.0466ZM16.5437 15.9944L16.3007 16.3681L19.2622 18.2205L19.5051 17.8467L16.5437 15.9944V15.9944Z",fill:"url(#paint10_radial_419_48383)"}),ot.createElement("path",{d:"M20.0758 13.8205L19.8328 14.1942L22.7943 16.0466L23.0373 15.6728L20.0758 13.8205ZM9.16191 15.9308L8.91895 16.3045L11.8804 18.1569L12.1234 17.7832L9.16191 15.9308V15.9308Z",fill:"url(#paint11_radial_419_48383)"}))),Kb||(Kb=ot.createElement("defs",null,ot.createElement("radialGradient",{id:"paint0_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(15.9999 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint1_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint2_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint3_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint4_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(15.9999 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint5_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint6_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint7_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint8_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint9_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint10_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(15.9999 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint11_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(15.9999 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"}))))),name:"Synapse"},{id:"swft",logoURI:e=>ot.createElement("svg",Eb({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),kb||(kb=ot.createElement("path",{d:"M14.0802 2.71222C14.0802 2.71222 12.9826 1.61464 11.6884 1.51537C10.3941 1.4161 9.89405 1.81505 9.99332 2.214C10.0926 2.61295 10.5421 2.66165 11.1396 2.2627C11.7371 1.86375 13.0332 1.96489 14.0802 2.71222Z",fill:"#0999FF"})),Cb||(Cb=ot.createElement("path",{d:"M13.5408 2.87517C13.5408 2.87517 12.668 2.33013 11.8176 2.45936C10.9673 2.5886 10.6938 2.92012 10.8268 3.16174C10.9598 3.40336 11.2482 3.36964 11.576 3.02314C11.9038 2.67663 12.7523 2.54927 13.5408 2.87517Z",fill:"#0999FF"})),jb||(jb=ot.createElement("path",{d:"M12.2597 2.99879C12.6341 2.88498 13.0346 2.89022 13.4059 3.01377C12.8628 2.91825 12.3439 3.13364 12.1866 3.39399C12.0293 3.65434 11.8476 3.71615 11.7352 3.58129C11.6228 3.44644 11.7408 3.1992 12.2597 2.99879Z",fill:"#0999FF"})),Tb||(Tb=ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.7592 6.10048C17.8075 5.65096 17.1089 5.82703 16.1218 6.25033C15.425 6.5575 15.6236 7.84238 16.0225 8.93996C16.4215 10.0375 17.2194 13.8248 15.425 15.8176C13.9914 17.4099 12.8137 17.6032 10.5679 17.972C10.0027 18.0648 9.36998 18.1687 8.6485 18.3087C5.05982 19.0055 4.86128 21.697 4.86128 21.697C3.17126 12.5314 7.83234 10.1212 10.1284 8.93399C10.4049 8.79097 10.6472 8.6657 10.8399 8.5485C11.9352 7.87375 12.0384 6.61486 12.0958 5.91511C12.1082 5.7641 12.1184 5.63913 12.136 5.55169C12.1467 5.49883 12.1573 5.4355 12.1694 5.36375C12.2698 4.76704 12.4681 3.58853 13.5783 3.01003C16.9703 1.41797 19.7592 6.10048 19.7592 6.10048ZM10.8009 15.8525C11.5854 15.8693 12.9238 15.898 13.6045 14.5964C14.3724 13.1261 13.5221 11.8075 12.3084 11.3917C11.0946 10.9759 9.25161 11.5509 8.04352 13.2366C6.83543 14.9223 6.68934 16.9826 6.68934 16.9826C6.7545 16.9197 6.81451 16.8522 6.87696 16.782C7.13404 16.4929 7.4325 16.1574 8.302 15.8982C8.96656 15.7001 9.67011 15.7718 10.1431 15.82C10.3006 15.836 10.4326 15.8495 10.529 15.8495C10.6088 15.8484 10.7003 15.8504 10.8009 15.8525ZM18.5642 5.503C18.5642 5.503 16.62 5.24639 15.8727 5.9956C15.8727 5.9956 16.472 4.30989 18.5642 5.503Z",fill:"#0999FF"}))),name:"Swft"},{id:"hyphen",logoURI:e=>ot.createElement("svg",fb({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),hb||(hb=ot.createElement("path",{d:"M10.2675 16.7858V15.0715C10.2675 14.5915 10.6618 14.2143 11.1247 14.2143H12.839C13.319 14.2143 13.6961 14.5915 13.6961 15.0715V20.2143C13.6961 20.6943 13.319 21.0715 12.839 21.0715H4.26755C3.78755 21.0715 3.4104 20.6943 3.4104 20.2143V8.21433C3.4104 7.73433 3.03326 7.35719 2.55326 7.35719H2.05612C1.30183 7.35719 0.907546 6.43148 1.45612 5.90005L4.52469 2.81433C4.60378 2.73295 4.69838 2.66825 4.80291 2.62407C4.90745 2.57989 5.01978 2.55713 5.13326 2.55713C5.24674 2.55713 5.35908 2.57989 5.46361 2.62407C5.56814 2.66825 5.66275 2.73295 5.74183 2.81433L8.79326 5.90005C9.34183 6.43148 8.96469 7.35719 8.19326 7.35719H7.69612C7.21612 7.35719 6.83897 7.73433 6.83897 8.21433V16.7858C6.83897 17.2658 7.21612 17.6429 7.69612 17.6429H9.4104C9.8904 17.6429 10.2675 17.2658 10.2675 16.7858Z",fill:"#615CCD"})),mb||(mb=ot.createElement("path",{d:"M20.5533 16.7858C20.5533 17.2658 20.9304 17.6429 21.4104 17.6429H21.9247C22.679 17.6429 23.0561 18.5686 22.5247 19.1001L19.4561 22.1686C19.1133 22.5115 18.5818 22.5115 18.239 22.1686L15.1704 19.1001C14.6218 18.5686 14.999 17.6429 15.7704 17.6429H16.2676C16.7476 17.6429 17.1247 17.2658 17.1247 16.7858V8.21436C17.1247 7.73436 16.7476 7.35721 16.2676 7.35721H14.5533C14.0733 7.35721 13.6961 7.73436 13.6961 8.21436V9.92864C13.6961 10.4086 13.319 10.7858 12.839 10.7858H11.1247C10.6447 10.7858 10.2676 10.4086 10.2676 9.92864V4.78578C10.2676 4.30578 10.6447 3.92864 11.1247 3.92864H19.6961C20.1761 3.92864 20.5533 4.30578 20.5533 4.78578V16.7858Z",fill:"#615CCD"}))),name:"Hyphen"},{id:"lifi",logoURI:e=>ot.createElement("svg",vb({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),gb||(gb=ot.createElement("rect",{y:.5,width:24,height:24,rx:4,fill:"white"})),yb||(yb=ot.createElement("rect",{x:7.5,y:6.5,width:8.72727,height:12,fill:"url(#pattern0)"})),xb||(xb=ot.createElement("defs",null,ot.createElement("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:1,height:1},ot.createElement("use",{xlinkHref:"#image0_1105_25179",transform:"translate(-0.958333 -0.393939) scale(0.0208333 0.0151515)"})),ot.createElement("image",{id:"image0_1105_25179",width:252,height:124,xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPwAAAB8CAYAAABNG92/AAAMbGlDQ1BJQ0MgUHJvZmlsZQAASImVlwdcU0kTwPeVJCQkBAhEQEroTRDpRUoILYKAVMFGSAIJJcaEIGJHj1Pw7CKKFT0V8dDTE5BDRezlUOz9sKCinId6KIrKtymg533l901++94/s7Mzs/P2lQWA3seTSvNQXQDyJQWyhMhQ1vi0dBbpCSACBP7owIPHl0vZ8fExAMrg+e/y9jq0hHLFRenrn/3/VfQFQjkfAGQi5EyBnJ8PuQUAfANfKisAgKjUW08vkCp5HmQDGUwQ8molZ6t5l5Iz1dyssklK4EC+BIAWlceTZQOgcxfqWYX8bOhH5yNkN4lALAGAPgJyEF/EE0BW5j4iP3+qkishO0B7KWSYD/DN/Mpn9t/8Zw755/Gyh1g9L5VohYnl0jzejP+zNP9b8vMUgzHsYKOKZFEJyvnDGt7MnRqtZCrkbklmbJyy1pD7xAJ13QFAKSJFVLLaHjXlyzmwfoAJ2U3AC4uGbAo5QpIXG6PRZ2aJI7iQ4WpBi8QF3CTIRpAXCeXhiRqbLbKpCZpYaH2WjMPW6M/wZKq4ylj3FbnJbI3/1yIhV+Mf0ykWJaVCpkC2KRSnxELWgewqz02M1tiMLhZxYgdtZIoEZf42kBOEkshQtX+sMEsWkaCxL8uXD84X2yISc2M1vL9AlBSlrg92gs9T5Q/ngl0SStjJg36E8vExg3MRCMPC1XPHngklyYkaP33SgtAE9VicIs2L19jjVsK8SKXeCrKnvDBRMxZPKYCLU+0fz5IWxCep88SLc3hj4tX54MtBDOCAMMACCtgywVSQA8Rt3Q3d8J+6JwLwgAxkAyFw0WgGR6SqeiTwmAiKwR+QhEA+NC5U1SsEhVD/aUirPrqALFVvoWpELngCOR9Egzz4X6EaJRmKlgIeQ434H9F5sPFhvnmwKfv/vX5Q+0XDhpoYjUYxGJFFH7QkhhPDiFHECKIjboIH4QF4DDyGwOaO++J+g/P4Yk94QmgnPCRcI3QQbk0Rl8i+yXIs6ID+IzS1yPy6Frgd9OmFh+KB0Dv0jDNxE+CCe8I4bDwYRvaCWo4mb2VVWN/4/tsMvroaGjuyGxklDyOHkB2+HanjpOM15EVZ66/ro841c6jenKGeb+Nzvqq+AJ6jv7XEFmEHsNPYMews1ow1ABZ2FGvELmCHlTy0uh6rVtdgtARVPrnQj/gf8QavrLKScrdaty63j+q+AmFRgfLG40yVzpCJs0UFLDZ8OwhZXAnfdQTL3c3dHQDlu0b9+HrDVL1DEOa5L7oSOgCj3w8MDDR/0cXYAvBLKbz9n3zROVTDx8R8AM6U8xWyQrUOVx4I8ClBh3eaMTAH1sABzscdeIMAEALCwRgQB5JAGpgMsxfBdS4D08EsMB+UgnKwHKwB68FmsA3sAj+B/aABNINj4BQ4Dy6Ba+AOXD2d4AXoAW9BP4IgJISGMBBjxAKxRZwRd8QXCULCkRgkAUlDMpBsRIIokFnIAqQcWYmsR7YiNcjPyCHkGHIWaUduIQ+QLuQ18gHFUCpqgJqhduhI1Bdlo9FoEjoJzUanocXoQnQpWolWo3vQevQYeh69hnagL9BeDGDaGBOzxFwwX4yDxWHpWBYmw+ZgZVgFVo3VYU3wOl/BOrBu7D1OxBk4C3eBKzgKT8b5+DR8Dr4EX4/vwuvxE/gV/AHeg38m0AimBGeCP4FLGE/IJkwnlBIqCDsIBwkn4b3USXhLJBKZRHuiD7wX04g5xJnEJcSNxL3EFmI78RGxl0QiGZOcSYGkOBKPVEAqJa0j7SEdJV0mdZL6tLS1LLTctSK00rUkWiVaFVq7tY5oXdZ6qtVP1iXbkv3JcWQBeQZ5GXk7uYl8kdxJ7qfoUewpgZQkSg5lPqWSUkc5SblLeaOtrW2l7ac9TlusPU+7Unuf9hntB9rvqfpUJyqHOpGqoC6l7qS2UG9R39BoNDtaCC2dVkBbSquhHafdp/XpMHRcdbg6Ap25OlU69TqXdV7SyXRbOps+mV5Mr6AfoF+kd+uSde10Obo83Tm6VbqHdG/o9uox9Ebpxenl6y3R2613Vu+ZPknfTj9cX6C/UH+b/nH9RwyMYc3gMPiMBYztjJOMTgOigb0B1yDHoNzgJ4M2gx5DfUNPwxTDIsMqw8OGHUyMacfkMvOYy5j7mdeZH4aZDWMPEw5bPKxu2OVh74yGG4UYCY3KjPYaXTP6YMwyDjfONV5h3GB8zwQ3cTIZZzLdZJPJSZPu4QbDA4bzh5cN3z/8tilq6mSaYDrTdJvpBdNeM3OzSDOp2Tqz42bd5kzzEPMc89XmR8y7LBgWQRZii9UWRy2eswxZbFYeq5J1gtVjaWoZZamw3GrZZtlvZW+VbFVitdfqnjXF2tc6y3q1dat1j42FzVibWTa1Nrdtyba+tiLbtbanbd/Z2dul2n1v12D3zN7InmtfbF9rf9eB5hDsMM2h2uGqI9HR1zHXcaPjJSfUyctJ5FTldNEZdfZ2FjtvdG4fQRjhN0IyonrEDReqC9ul0KXW5YEr0zXGtcS1wfXlSJuR6SNXjDw98rObl1ue23a3O6P0R40ZVTKqadRrdyd3vnuV+1UPmkeEx1yPRo9Xns6eQs9Nnje9GF5jvb73avX65O3jLfOu8+7ysfHJ8Nngc8PXwDfed4nvGT+CX6jfXL9mv/f+3v4F/vv9/wxwCcgN2B3wbLT9aOHo7aMfBVoF8gK3BnYEsYIygrYEdQRbBvOCq4MfhliHCEJ2hDxlO7Jz2HvYL0PdQmWhB0Pfcfw5szktYVhYZFhZWFu4fnhy+Prw+xFWEdkRtRE9kV6RMyNboghR0VErom5wzbh8bg23Z4zPmNljTkRToxOj10c/jHGKkcU0jUXHjhm7auzdWNtYSWxDHIjjxq2KuxdvHz8t/tdxxHHx46rGPUkYlTAr4XQiI3FK4u7Et0mhScuS7iQ7JCuSW1PoKRNTalLepYalrkztGD9y/Ozx59NM0sRpjemk9JT0Hem9E8InrJnQOdFrYunE65PsJxVNOjvZZHLe5MNT6FN4Uw5kEDJSM3ZnfOTF8ap5vZnczA2ZPXwOfy3/hSBEsFrQJQwUrhQ+zQrMWpn1LDswe1V2lyhYVCHqFnPE68WvcqJyNue8y43L3Zk7kJeatzdfKz8j/5BEX5IrOTHVfGrR1Haps7RU2jHNf9qaaT2yaNkOOSKfJG8sMIAf9RcUDorvFA8KgwqrCvump0w/UKRXJCm6MMNpxuIZT4sjin+cic/kz2ydZTlr/qwHs9mzt85B5mTOaZ1rPXfh3M55kfN2zafMz53/W4lbycqSvxakLmhaaLZw3sJH30V+V1uqUyorvfF9wPebF+GLxIvaFnssXrf4c5mg7Fy5W3lF+ccl/CXnfhj1Q+UPA0uzlrYt8162aTlxuWT59RXBK3at1FtZvPLRqrGr6lezVpet/mvNlDVnKzwrNq+lrFWs7aiMqWxcZ7Nu+bqP60Xrr1WFVu3dYLph8YZ3GwUbL28K2VS32Wxz+eYPW8Rbbm6N3FpfbVddsY24rXDbk+0p20//6PtjzQ6THeU7Pu2U7OzYlbDrRI1PTc1u093LatFaRW3Xnol7Lv0U9lNjnUvd1r3MveX7wD7Fvuc/Z/x8fX/0/tYDvgfqfrH9ZcNBxsGyeqR+Rn1Pg6ihozGtsf3QmEOtTQFNB391/XVns2Vz1WHDw8uOUI4sPDJwtPhob4u0pftY9rFHrVNa7xwff/zqiXEn2k5GnzxzKuLU8dPs00fPBJ5pPut/9tA533MN573P11/wunDwN6/fDrZ5t9Vf9LnYeMnvUlP76PYjl4MvH7sSduXUVe7V89dir7VfT75+88bEGx03BTef3cq79ep24e3+O/PuEu6W3dO9V3Hf9H71746/7+3w7jj8IOzBhYeJD+884j968Vj++GPnwie0JxVPLZ7WPHN/1twV0XXp+YTnnS+kL/q7S//Q+2PDS4eXv/wZ8ueFnvE9na9krwZeL3lj/GbnX55/tfbG995/m/+2/11Zn3Hfrve+709/SP3wtH/6R9LHyk+On5o+R3++O5A/MCDlyXiqTwEMNjQrC4DXOwGgpQHAgPs2ygT1XlAliHr/qiLwn1i9X1SJNwB18KT8jOe0ALAPNnvItHkAKD/hk0IA6uEx1DQiz/JwV/uiwp0QoW9g4I0ZAKQmAD7JBgb6Nw4MfNoOk70FQMs09R5UKUS4Z9jiqaTLzKJ54BtR70+/muO3Z6DMQDX8b+d/AU/6jzXPsPu0AAAAbGVYSWZNTQAqAAAACAAEARoABQAAAAEAAAA+ARsABQAAAAEAAABGASgAAwAAAAEAAgAAh2kABAAAAAEAAABOAAAAAAAAAJAAAAABAAAAkAAAAAEAAqACAAQAAAABAAAA/KADAAQAAAABAAAAfAAAAABezPYPAAAACXBIWXMAABYlAAAWJQFJUiTwAAAH8UlEQVR4Ae2d0U3cQBRFTYT4hQ7gi19IBUkqIFQQ6AAaIKQCoAPSQVJBkg6ggkAH8IOEhJRwEZOMVsZrrz3GM/eMZO2ud3bsd967+7zjmdmlP4+lokAAAhYE3lhYiZEQgMATAQRPIEDAiACCN3I2pkIAwRMDEDAigOCNnI2pEEDwxAAEjAggeCNnYyoEEDwxAAEjAgjeyNmYCgEETwxAwIgAgjdyNqZCAMETAxAwIoDgjZyNqRBA8MQABIwIIHgjZ2MqBBA8MQABIwII3sjZmAoBBE8MQMCIAII3cjamQgDBEwMQMCKA4I2cjakQQPDEAASMCCB4I2djKgQQPDEAASMCCN7I2ZgKAQSfMAaurq6qr1+/Vvv7+9Xbt2+rpaWl6vz8POERaRoCzQSW+KupZkBd3r24uKguLy+rnz9/Pm0S/GzZ2Niofv/+Pbub1xAYhQCC74FZAv/169c/gd/c3LRqjb/za4WJSgkILCdos9gmY3FL7G0FXiwQDMuOAIJvcFkscF2mUyCQOwEE/+xBZetY4MrgFAiURsBW8OpQk8AlbGVvBF5aaGNPHQEbwQeBS9za6nrQ6wCxDwIlESha8LoH/u3btyeB08FWUthiy6IEihW8BrhowAsFAhD4T6DYkXZra2v/reQZBCDwRKDogTca1XZ9fT05VzPwZnIusTmhYjO8PHh8fGzjSAyFQBsCRWd4AZhilifDtwlN6qQgUHSGF7C9vb0U3BZuc3V1deHP8kEI9CVQvOAPDg6qKYlsal9AfQOIz+dFoHjBq7deon/N8u7du+rz58/Vjx8/qtPT06Snojn3L20acDR02dzcfPF4R0dHgxxOfTEv2TTE/rq+Ho3haGp7EMNeoZFi78PHLCV4Ce329jbeneS5ribev39fbW9vPz3qOQUCUyFgIfiQ5b98+TI49yBwCVubhE6BwFQJWAhe8IfK8uvr60/CDgLXXQAKBHIhYCP4RbP81tbWv8wtkSPwXEKb86wjYCN4Gf/x48dq3mV9EHjI4EMM0Q1z7TUF99OnT3xp1EUi+0YhYCX4OqLqQQ/i1uMQJZ6KK5HHc+01qYdFLIeg/L8N3QHpU4bye59zGOuzNoKX6OLZc8q06rkfIoOr7Xgxjaa59k3vjeX00o5Td1utNBuHsqdYwQcR6t6ztng+vMTeZ334WNyzbQ/lGNqBQAoCRQheYo7Xg5cIm0rXjBCvdTev7abj8h4EXptA1oKX0HWZrlVtupSmnvbQwSZha4t/f3c5BnUhMEUCWQte99a7ir3OCRK2hlJK3Ai8jhD7SiGQteAl0r5FXxi7u7t9m+HzEMiCQNaCH4Jw6sksQ5wjbTQT+PDhQ3OFhndPTk6shkPbC15j39UpR8mXgH6SLVriuzeLtpHT597kdLIpzvW1p86msIk2IfASAXvBq8de9+UpEHAgYC94ObnrfXmHwMDGMgkg+Ee/Ksvv7OyU6WGsgkBEwL7TLrDQb/nv37+Hl8kep7S+XjIjR264z+SZpkFYI5sxyuEQ/DNmzZjSzLnUPfaaoksZlgA/ydrztLukb8qwqQMnzNBr7x5qQmBYAnYZvmnu89BZPsViGsO6n9bcCFgJXuvRzRtZpyy/6MiteDENDegZYq69W0Bib1oCWQteGVTTYptKLMKm7B7aUB1d9s9b0lp14qWo27QdjuH+eHd39yKC5eXlamVl5cX3eaMfgawFr0UsJLQgTmXwWIR6vkjRHxDMFglcxwrbom3Ptjvm68PDw15XHUONOxfLh4eHWtPv7+9r97NzGAJZC16i01hojaXW7RVtfYu+ROLx1bo/r8v8HAU+y6Lv1N+Yy2zbvM6DQNaCD4iVdfuUsGSVpsrqyyMU/WQYYr59aI9HCLw2gSIE3wWislTb5bC4Z96FLHVzIFC84MOS0bqcVfbuclkbZ/scnMk5QmAegeIEL0GHRSf1vM+y0GpHnx+ib2CeI3gfAmMQyF7wQdzKxikysjrs+ixpPYYTOQYE2hJY+vNY2laeWj1NeDk7O0t+WvqnGLJ8cswcYAQCWQu+7n55CmZ9/7gixTnRJgQWIYDgW1Ijy7cERbVJE3gz6bOb0MnptzwFArkTIMN38CBZvgMsqk6SABm+g1vmzbTr0BRVIfAqBMjwHbBruquyPNNeO0Cj6qQIkOE7uEPDcsnyHYBRdXIEEHxHl6QY3NPxFKgOgYUJIPgO6DR7jgzfARhVJ0cg+6G1KYnGq+VoPjy/3VPSpu0xCCD4Z8olrGgzRsBwjLwJ2Apel+fK2mHJKsbK5x3InH07AjaCD5fnQeRcnrcLEGqVRSBrwesyPCxgGbslvjwPAo/f5zkEXAlkPfBGPeZaiZXLc9fwxe6uBLIWfFdjqQ8BdwLch3ePAOy3IoDgrdyNse4EELx7BGC/FQEEb+VujHUngODdIwD7rQggeCt3Y6w7AQTvHgHYb0UAwVu5G2PdCSB49wjAfisCCN7K3RjrTgDBu0cA9lsRQPBW7sZYdwII3j0CsN+KAIK3cjfGuhNA8O4RgP1WBBC8lbsx1p0AgnePAOy3IoDgrdyNse4EELx7BGC/FQEEb+VujHUngODdIwD7rQggeCt3Y6w7AQTvHgHYb0UAwVu5G2PdCSB49wjAfisCCN7K3RjrTgDBu0cA9lsRQPBW7sZYdwII3j0CsN+KAIK3cjfGuhNA8O4RgP1WBBC8lbsx1p0AgnePAOy3IvAXd0VRjJTy4H0AAAAASUVORK5CYII="})))),name:"LIFI"},{id:"nabox",logoURI:e=>ot.createElement("svg",wb({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),bb||(bb=ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 7.23999V18.418L4.73651 20.2838V12.2876L7.96146 14.1503V22.1412L11.199 24.007V12.8279L1.5 7.23999Z",fill:"#2AC98B"})),Ab||(Ab=ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.85179 6.21724L12.0946 4.31675L16.1237 6.67449L12.883 8.56657L8.85179 6.21724ZM12.0988 0.5L2.32306 6.21934L12.8651 12.4001V24.5L16.0627 22.6374V10.3966L19.294 8.50455V20.7348L22.5389 18.8248V6.60827L12.0988 0.5Z",fill:"#2AC98B"}))),name:"Nabox"},{id:"bungee",logoURI:e=>ot.createElement("svg",pb({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),cb||(cb=ot.createElement("g",{clipPath:"url(#clip0_1106_26400)"},ot.createElement("path",{d:"M24 4.5C24 2.29086 22.2091 0.5 20 0.5H4C1.79086 0.5 0 2.29086 0 4.5V20.5C0 22.7091 1.79086 24.5 4 24.5H20C22.2091 24.5 24 22.7091 24 20.5V4.5Z",fill:"#FEA700"}),ot.createElement("path",{d:"M3.26157 14.6479C4.44801 14.6479 5.40958 13.6862 5.40958 12.4999C5.40958 11.3137 4.44779 10.3519 3.26157 10.3519C2.07824 10.3519 1.1189 11.3088 1.11401 12.491V12.509C1.1189 13.691 2.07824 14.6479 3.26157 14.6479Z",fill:"#ED1E7F"}),ot.createElement("path",{d:"M20.7367 14.6477C21.923 14.6477 22.8847 13.686 22.8847 12.4997C22.8847 11.3134 21.923 10.3517 20.7367 10.3517C19.5504 10.3517 18.5887 11.3134 18.5887 12.4997C18.5887 13.686 19.5504 14.6477 20.7367 14.6477Z",fill:"#4CB85D"}),ot.createElement("path",{d:"M9.59911 15.9941C10.2391 15.9941 10.8329 15.7967 11.3251 15.4612V15.9438H12.672V12.9378C12.672 12.9314 12.6726 12.9252 12.6726 12.9187V12.0794C12.6726 11.1272 13.4471 10.3527 14.3993 10.3527C15.3535 10.3527 16.126 11.1272 16.126 12.0794V15.9438H17.4747V12.0794C17.4747 10.3825 16.0982 9.00586 14.3993 9.00586C13.7591 9.00586 13.1646 9.20338 12.6722 9.53919V9.05539H11.3253V12.9307C11.3189 13.8792 10.5475 14.6454 9.5993 14.6454C8.6453 14.6454 7.87264 13.873 7.87264 12.9187V9.05607H6.52399V12.9187C6.52375 14.6176 7.90019 15.9941 9.59911 15.9941Z",fill:"black"}))),ub||(ub=ot.createElement("defs",null,ot.createElement("clipPath",{id:"clip0_1106_26400"},ot.createElement("rect",{width:24,height:24,fill:"white",transform:"translate(0 0.5)"}))))),name:"Bungee"},{id:"squid",logoURI:e=>ot.createElement("svg",Ub({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Wb||(Wb=ot.createElement("g",{clipPath:"url(#clip0_6759_209574)"},ot.createElement("path",{d:"M23.7182 11.278C23.2776 12.8519 22.2417 14.5477 20.9174 15.1962C16.7933 17.2151 14.6496 12.8533 14.9088 9.67381C15.0643 7.76437 15.6835 6.24613 15.2064 4.69333C15.0542 4.19797 14.7307 3.73957 14.2008 3.49141C12.7469 2.81029 11.3241 3.74677 10.6627 4.73893C9.94895 5.80885 9.61391 7.14757 9.70463 8.37109C9.79151 9.54997 10.1995 10.3228 10.8149 11.3783C11.6371 12.7885 12.5126 13.7044 12.8477 14.7872C13.0637 15.4852 13.1865 16.6117 12.1944 16.7063C11.1465 16.8066 11.1993 15.4328 11.1845 14.7436C11.1398 12.6488 9.80927 11.8943 8.80751 9.48133C8.22239 8.07205 7.99439 6.58165 8.33663 5.11045C8.81807 3.04021 9.99119 1.37125 12.1061 0.793809C13.7971 0.332049 15.7555 0.710769 16.8259 2.19157C18.0984 3.95221 17.8502 6.02917 17.3328 7.87477C16.3752 11.289 17.2305 12.9167 18.0288 13.3424C19.5403 14.1484 21.1262 13.2354 21.8299 12.2677C22.5921 11.2194 23.0467 9.30709 22.9747 8.08309C22.9473 7.61557 22.9061 7.21333 22.8432 6.85237",fill:"white"}),ot.createElement("path",{d:"M0 12.0001C0 12.8756 0.09456 13.7291 0.27264 14.5513C0.2544 13.9316 0.31536 13.3182 0.47568 12.746C0.91632 11.1721 1.95216 9.47627 3.27648 8.82779C7.40064 6.80891 9.54432 11.1707 9.28512 14.3502C9.1296 16.2596 8.5104 17.7779 8.98752 19.3307C9.13968 19.826 9.4632 20.2844 9.99312 20.5326C11.447 21.2137 12.8698 20.2772 13.5312 19.2851C14.245 18.2151 14.58 16.8764 14.4893 15.6529C14.4024 14.474 13.9944 13.7012 13.3795 12.6457C12.5573 11.2355 11.6818 10.3196 11.3467 9.23675C11.1307 8.53883 11.0078 7.41227 12 7.31771C13.0478 7.21739 12.995 8.59115 13.0099 9.28043C13.0546 11.3751 14.3851 12.1297 15.3869 14.5427C15.972 15.9519 16.2 17.4423 15.8578 18.9135C15.3763 20.9838 14.2032 22.6527 12.0883 23.2302C10.3973 23.6919 8.43888 23.3132 7.36848 21.8324C6.096 20.0718 6.34416 17.9948 6.8616 16.1492C7.8192 12.735 6.96384 11.1073 6.1656 10.6815C4.65408 9.87611 3.06816 10.7886 2.36448 11.7563C1.60224 12.8046 1.14768 14.7169 1.21968 15.9409C1.26432 16.7003 1.34592 17.2878 1.49664 17.8062",fill:"white"}),ot.createElement("path",{d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z",fill:"#E6FA36"}),ot.createElement("path",{d:"M15.8578 18.914C16.2 17.4428 15.972 15.9524 15.3869 14.5432C14.3851 12.1302 13.0541 11.3752 13.0099 9.28092C12.9955 8.59164 13.0479 7.21788 12 7.3182C11.0079 7.41324 11.1307 8.5398 11.3467 9.23772C11.6818 10.3206 12.5578 11.2364 13.3795 12.6467C13.9949 13.7022 14.4024 14.475 14.4893 15.6539C14.5795 16.8774 14.245 18.2161 13.5312 19.286C12.8693 20.2782 11.4471 21.2147 9.99313 20.5336C9.46321 20.2854 9.13969 19.8265 8.98753 19.3316C8.51089 17.7784 9.12961 16.2606 9.28513 14.3512C9.54433 11.1716 7.40017 6.80988 3.27649 8.82876C1.95217 9.47724 0.916332 11.1726 0.475692 12.747C0.315372 13.3196 0.254412 13.9326 0.272652 14.5523C0.523212 15.7081 0.939852 16.802 1.49665 17.8076C1.34593 17.2888 1.26433 16.7017 1.21969 15.9424C1.14769 14.7188 1.60273 12.806 2.36449 11.7577C3.06769 10.79 4.65409 9.87708 6.16561 10.683C6.96385 11.1088 7.81921 12.7364 6.86161 16.1507C6.34369 17.9968 6.09553 20.0732 7.36849 21.8339C8.43889 23.3147 10.3973 23.6934 12.0883 23.2316C14.2032 22.6532 15.3768 20.9843 15.8578 18.914Z",fill:"black"}),ot.createElement("path",{d:"M23.7182 11.2782C23.8008 10.984 23.8565 10.6787 23.8891 10.3676C23.8891 10.3691 23.8896 10.37 23.8896 10.371C23.7206 9.12732 23.3616 7.94412 22.8422 6.85164C22.9051 7.21308 22.9464 7.61484 22.9737 8.08236C23.0457 9.30588 22.5907 11.2187 21.8289 12.267C21.1257 13.2347 19.5393 14.1476 18.0278 13.3417C17.2296 12.916 16.3742 11.2883 17.3318 7.87404C17.8497 6.02796 18.0979 3.95148 16.8249 2.19084C15.7545 0.710036 13.7961 0.331317 12.1051 0.793076C9.99021 1.37052 8.81661 3.03948 8.33565 5.10972C7.99341 6.58092 8.22141 8.07132 8.80653 9.4806C9.80829 11.8936 11.1393 12.6486 11.1835 14.7428C11.1979 15.4321 11.1456 16.8059 12.1934 16.7056C13.1856 16.6105 13.0627 15.484 12.8467 14.7865C12.5117 13.7036 11.6356 12.7878 10.8139 11.3776C10.1985 10.322 9.79101 9.54924 9.70365 8.37036C9.61341 7.14684 9.94797 5.80812 10.6617 4.7382C11.3236 3.74604 12.7459 2.80956 14.1998 3.49068C14.7297 3.73884 15.0532 4.19772 15.2054 4.6926C15.682 6.24588 15.0633 7.76364 14.9078 9.67308C14.6486 12.8526 16.7928 17.2144 20.9165 15.1955C22.2413 14.548 23.2776 12.8521 23.7182 11.2782Z",fill:"black"}))),Vb||(Vb=ot.createElement("defs",null,ot.createElement("clipPath",{id:"clip0_6759_209574"},ot.createElement("rect",{width:24,height:24,fill:"white"}))))),name:"Squid"},{id:"across",logoURI:e=>ot.createElement("svg",db({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),rb||(rb=ot.createElement("rect",{width:32,height:32,rx:16,fill:"#6CF9D8"})),ib||(ib=ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.95021 8.41988L8.50949 6.8606L14.7408 13.0919C14.3626 13.253 14.0083 13.4879 13.6998 13.7964C13.4609 14.0353 13.2662 14.3017 13.1157 14.5853L6.95021 8.41988ZM12.9982 17.4399L6.85803 23.5801L8.41732 25.1394L14.495 19.0617C14.209 18.9107 13.9405 18.7149 13.6998 18.4742C13.3932 18.1675 13.1593 17.8156 12.9982 17.4399ZM17.5887 19.0584L23.5826 25.0522L25.1418 23.493L19.0822 17.4333C18.921 17.8114 18.6862 18.1657 18.3777 18.4742C18.1388 18.7131 17.8724 18.9079 17.5887 19.0584ZM18.9652 14.5916L25.0497 8.50706L23.4904 6.94778L17.3434 13.0947C17.7191 13.2558 18.071 13.4897 18.3777 13.7964C18.6184 14.037 18.8142 14.3055 18.9652 14.5916Z",fill:"#2D2E33"}))),name:"Across"},{id:"layerswap",logoURI:e=>ot.createElement("svg",tA({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),$b||($b=ot.createElement("g",{clipPath:"url(#clip0_8229_671)"},ot.createElement("path",{opacity:.3,d:"M11.4062 12.7691C11.4062 12.0165 12.0163 11.4065 12.7688 11.4065H24.5209C25.2735 11.4065 25.8835 12.0165 25.8835 12.7691V24.5213C25.8835 25.2738 25.2735 25.8837 24.5209 25.8837H12.7688C12.0163 25.8837 11.4062 25.2738 11.4062 24.5213V12.7691Z",fill:"#FF0093"}),ot.createElement("path",{opacity:.5,d:"M23.2097 21.847C23.2097 22.5995 22.5996 23.2094 21.8471 23.2094H10.095C9.34246 23.2094 8.73242 22.5995 8.73242 21.847V10.0947C8.73242 9.34222 9.34246 8.73218 10.095 8.73218H21.8471C22.5996 8.73218 23.2097 9.34222 23.2097 10.0947V21.847Z",fill:"#FF0093"}),ot.createElement("path",{opacity:.9,d:"M20.5349 19.1718C20.5349 19.9244 19.9249 20.5344 19.1723 20.5344H7.42018C6.66766 20.5344 6.05762 19.9244 6.05762 19.1718V7.4197C6.05762 6.66717 6.66766 6.05713 7.42018 6.05713H19.1723C19.9249 6.05713 20.5349 6.66717 20.5349 7.4197V19.1718Z",fill:"#FF0093"}))),eA||(eA=ot.createElement("defs",null,ot.createElement("clipPath",{id:"clip0_8229_671"},ot.createElement("rect",{width:20,height:20,fill:"white",transform:"translate(6 6)"}))))),name:"Layerswap"},{id:"okx",logoURI:e=>ot.createElement("svg",iA({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),nA||(nA=ot.createElement("g",{clipPath:"url(#clip0_1443_44689)"},ot.createElement("path",{d:"M21 0H11C4.92487 0 0 4.92487 0 11V21C0 27.0751 4.92487 32 11 32H21C27.0751 32 32 27.0751 32 21V11C32 4.92487 27.0751 0 21 0Z",fill:"black"}),ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.6063 6.99255H7.39351C7.17207 6.99255 6.99255 7.17207 6.99255 7.39351V12.6063C6.99255 12.8278 7.17207 13.0073 7.39351 13.0073H12.6063C12.8278 13.0073 13.0073 12.8278 13.0073 12.6063V7.39351C13.0073 7.17207 12.8278 6.99255 12.6063 6.99255ZM18.6237 13.0073H13.4109C13.1895 13.0073 13.0099 13.1869 13.0099 13.4083V18.6211C13.0099 18.8426 13.1895 19.0221 13.4109 19.0221H18.6237C18.8452 19.0221 19.0247 18.8426 19.0247 18.6211V13.4083C19.0247 13.1869 18.8452 13.0073 18.6237 13.0073ZM19.4231 6.99255H24.6359C24.8574 6.99255 25.0369 7.17207 25.0369 7.39351V12.6063C25.0369 12.8278 24.8574 13.0073 24.6359 13.0073H19.4231C19.2016 13.0073 19.0221 12.8278 19.0221 12.6063V7.39351C19.0221 7.17207 19.2016 6.99255 19.4231 6.99255ZM12.6063 19.0221H7.39351C7.17207 19.0221 6.99255 19.2016 6.99255 19.4231V24.6359C6.99255 24.8574 7.17207 25.0369 7.39351 25.0369H12.6063C12.8278 25.0369 13.0073 24.8574 13.0073 24.6359V19.4231C13.0073 19.2016 12.8278 19.0221 12.6063 19.0221ZM19.4231 19.0221H24.6359C24.8574 19.0221 25.0369 19.2016 25.0369 19.4231V24.6359C25.0369 24.8574 24.8574 25.0369 24.6359 25.0369H19.4231C19.2016 25.0369 19.0221 24.8574 19.0221 24.6359V19.4231C19.0221 19.2016 19.2016 19.0221 19.4231 19.0221Z",fill:"white"}))),rA||(rA=ot.createElement("defs",null,ot.createElement("clipPath",{id:"clip0_1443_44689"},ot.createElement("rect",{width:32,height:32,fill:"white"}))))),name:"okx"},{id:"symbiosis",logoURI:e=>ot.createElement("svg",sA({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),oA||(oA=ot.createElement("g",{clipPath:"url(#clip0_8229_679)"},ot.createElement("path",{d:"M13.8614 16.7844L14.4243 16.2215V14.2548L13.8614 13.6919H13.0938L12.5601 14.2548V16.2215L13.0938 16.7844H13.8614Z",fill:"#75FB6E"}),ot.createElement("path",{d:"M18.9063 16.7625L19.44 16.1995V14.2548L18.9063 13.6919H18.1313L17.5757 14.2548V16.1995L18.1313 16.7625H18.9063Z",fill:"#75FB6E"}),ot.createElement("path",{d:"M31.5175 12.332L30.7425 12.2296L27.9717 14.3571L27.862 15.1321L27.7377 15.2417H26.9847L26.4217 15.7973V16.5431L26.9335 17.0548V17.318L26.3998 17.881L26.4217 21.3683L26.9847 21.902L27.0139 22.1725L27.0286 22.1871L26.5022 22.7062V23.4812L26.2609 23.7151H22.3422L22.1083 23.4812V23.079V19.5552L21.9986 19.4528L21.5454 18.9995V18.729L21.5015 18.6925L22.0498 18.1442V17.3984L22.0133 17.3546L22.1083 17.3473L22.2618 17.1572L23.0368 17.0768L24.9011 14.6788L24.828 13.9331L25.0107 13.743L25.0034 13.6699L25.0107 13.6626L24.9888 13.4505L24.9815 13.3994L25.5444 12.8364L25.4933 8.36212L24.9303 7.82842V7.76993L24.9596 7.53598L24.7475 7.26548L24.8207 6.49052L22.9344 4.09253L22.1595 4.01211L22.0425 3.85858L22.0498 3.85127V3.10555L21.5161 2.54261H20.8289H20.7704L20.5072 2.33059V1.56294L19.915 1H16.0548H15.9452H12.0777L11.4928 1.56294V2.33059L11.2296 2.54261H11.1711H10.4766L9.94288 3.10555V3.85127L9.95019 3.85858L9.84053 4.01211L9.06557 4.09253L7.17204 6.49052L7.25246 7.26548L7.04044 7.53598L7.06968 7.76993V7.82842L6.50674 8.36212L6.45556 12.8364L7.01119 13.3994L6.98926 13.743L7.19397 13.955L7.12086 14.6788L8.98515 17.0768L9.76011 17.1572L9.92095 17.3473L9.98675 17.3546L9.94288 17.3984V18.1442L10.4766 18.7071L10.4546 18.729V18.9995L10.0014 19.4528L9.89171 19.5552V23.079V23.4812L9.65045 23.7151H5.73178L5.49052 23.4812V22.7062L4.95682 22.1725L4.98606 21.902L5.54901 21.3683L5.57094 17.881L5.03724 17.318L5.06648 17.0548L5.57094 16.5431V15.7973L5.01531 15.2417H4.25497L4.13068 15.1321L4.02833 14.3571L1.25017 12.2296L0.482522 12.332L0 12.9461L0.109664 13.721L2.88051 15.8485L3.65547 15.7462L3.71396 15.79L3.70665 15.7973V16.5431L4.24035 17.106H4.26959V17.2668L3.70665 17.8225L3.65547 21.3171L4.18917 21.8801V22.1432H4.15993L3.62623 22.7062V23.4812L4.15993 24.0148H4.93489L5.17615 24.2488V25.0238L5.70985 25.5575H9.62851L10.1841 25.0238V24.2488L10.4254 24.0148H11.2296L11.756 23.4812V23.2106V19.5552L11.2808 18.9995L11.2515 18.7071L11.8145 18.1442V17.3984L11.2515 16.8355H10.4985L10.3742 16.6747L10.4546 15.907L8.56111 13.509L7.78615 13.4286V13.4213V13.3994L8.3491 12.8657L8.37103 8.4133L7.83733 7.85035L7.84464 7.76993L7.86657 7.748L8.64153 7.66758L10.5058 5.26959L10.4254 4.49463L10.4912 4.41421H11.2515L11.8145 3.85127V3.15673V3.10555L12.0777 2.89353H15.9452H16.0548H19.915L20.1855 3.10555V3.15673V3.85127L20.7485 4.41421H21.5088L21.5746 4.49463L21.4942 5.26959L23.3585 7.66758L24.1334 7.748L24.148 7.76993L24.1554 7.85035L23.6217 8.4133L23.6509 12.8657L24.2138 13.3994V13.4286L23.4681 13.509L21.5746 15.907L21.6477 16.6747L21.5088 16.8574L21.4942 16.8355H20.7192L20.1855 17.3984V18.1442L20.7192 18.7071H20.7485L20.7192 18.9995L20.2659 19.5552V23.2106V23.4812L20.7996 24.0148H21.5746L21.8085 24.2488V25.0238L22.3715 25.5575H26.2902L26.8239 25.0238V24.2488L27.0651 24.0148H27.8401L28.3738 23.4812V22.7062L27.8401 22.1432H27.7816V21.8801L28.3153 21.3171L28.2641 17.8225L27.7012 17.2668V17.106H27.7597L28.2934 16.5431V15.7973L28.286 15.79L28.3445 15.7462L29.1195 15.8485L31.8903 13.721L32 12.9461L31.5175 12.332Z",fill:"#75FB6E"}),ot.createElement("path",{d:"M13.5693 23.854L13.0137 24.4096V25.1846L12.7724 25.4259H11.9975L8.2689 29.074V29.827L8.02764 30.061H4.10897L3.86771 29.827V29.0521L3.30477 28.4891H2.53712L2.00342 29.0521V29.827L2.53712 30.3607H3.30477L3.54603 30.5947V31.3697L4.07973 31.9034H7.99839L8.56133 31.3697V30.5947L8.79528 30.3607L8.82453 30.3827H9.59949L13.3354 26.7345V25.9596L13.5474 25.7183H14.2931L14.9072 25.1846V24.4096L14.3443 23.854H13.5693Z",fill:"#75FB6E"}),ot.createElement("path",{d:"M28.7465 28.4891L28.1836 29.0521V29.827L27.9423 30.061H24.0236L23.7824 29.827V29.074L20.0538 25.4259H19.2788L19.0376 25.1846V24.4096L18.4819 23.854H17.707L17.144 24.4096V25.1846L17.7582 25.7183H18.5039L18.7159 25.9596V26.7345L22.4518 30.3827H23.2267L23.2487 30.3607L23.4899 30.5947V31.3697L24.0529 31.9034H27.9716L28.5052 31.3697V30.5947L28.7465 30.3607H29.5142L30.0479 29.827V29.0521L29.5142 28.4891H28.7465Z",fill:"#75FB6E"}))),aA||(aA=ot.createElement("defs",null,ot.createElement("clipPath",{id:"clip0_8229_679"},ot.createElement("rect",{width:32,height:30.9034,fill:"white",transform:"translate(0 1)"}))))),name:"symbiosis"},{id:"scroll",logoURI:yg,name:"Scroll"},{id:"manta",logoURI:Ag,name:"Manta"},{id:"orbiter",logoURI:e=>ot.createElement("svg",dA({xmlns:"http://www.w3.org/2000/svg",width:"32.000000pt",height:"32.000000pt",viewBox:"0 0 32.000000 32.000000",preserveAspectRatio:"xMidYMid meet"},e),lA||(lA=ot.createElement("g",{transform:"translate(0.000000,32.000000) scale(0.100000,-0.100000)",fill:"#000000",stroke:"none"},ot.createElement("path",{d:"M91 285 c-32 -28 -56 -85 -48 -115 3 -11 -5 -27 -19 -41 -32 -30 -30 -39 7 -39 32 0 34 -5 14 -53 -14 -33 11 -17 28 18 14 29 22 35 47 35 28 0 30 -2 30 -40 0 -51 18 -53 22 -2 3 32 7 37 31 40 23 3 30 -2 42 -32 9 -20 20 -36 26 -36 7 0 8 7 4 18 -20 47 -18 52 14 52 36 0 39 10 11 35 -13 11 -20 31 -20 53 0 107 -112 171 -189 107z m112 4 c12 -6 30 -21 39 -33 22 -26 24 -96 4 -96 -29 0 -46 13 -46 35 0 30 -26 56 -48 48 -22 -8 -32 -23 -32 -49 0 -21 -17 -34 -46 -34 -10 0 -14 12 -14 38 1 75 78 124 143 91z m-25 -82 c2 -10 -3 -17 -12 -17 -18 0 -29 16 -21 31 9 14 29 6 33 -14z m-88 -92 c0 -8 -4 -15 -9 -15 -13 0 -22 16 -14 24 11 11 23 6 23 -9z m80 0 c0 -8 -4 -15 -10 -15 -5 0 -10 7 -10 15 0 8 5 15 10 15 6 0 10 -7 10 -15z m82 0 c0 -5 -5 -11 -11 -13 -6 -2 -11 4 -11 13 0 9 5 15 11 13 6 -2 11 -8 11 -13z"})))),name:"Orbiter"},{id:"dodo",logoURI:e=>ot.createElement("svg",pA({xmlns:"http://www.w3.org/2000/svg",width:32,height:32,fill:"none",viewBox:"0 0 32 32"},e),cA||(cA=ot.createElement("g",{clipPath:"url(#a)"},ot.createElement("rect",{width:32,height:32,fill:"#FFE804",rx:8}),ot.createElement("path",{fill:"#fff",d:"m16.444 4.444-1.51.89-1.245 1.421-.978 2.49-.356 2.577-2.577.356-3.823 2.933L4.445 20l.622 3.555.8-.622.622 1.6 1.244-1.244.445 1.51.444.534 1.422-2.4 2.311-.178v1.6l-.888.89v1.244l2.222.178.71-.89v-2.844l.268-.355 1.688.355.178.89v1.51l-.889 1.334.89.622 1.955-.445.266-4.977.623-.356 1.777.622 1.156 3.378 1.511-2.311.889 1.422 1.422-1.422 1.067.267.178-4.445-1.423-4.622-2.666-1.956L21.422 12l-1.067-.445-.977-4.977-1.6-1.778-1.334-.267v-.089Z"}),ot.createElement("path",{fill:"#000",d:"M27.911 20.622v-.267l-.089-.178c0-.088-.178-.444 0-.533 0-.178 0-.266-.178-.444.178-.09 0-.267 0-.445v-.266l.178-.09c-.178 0 0-.266-.178-.266 0-.178-.177-.267 0-.267l-.088-.355v-.089a3.555 3.555 0 0 1-.178-1.067c-.178 0-.178-.089-.178-.178v-.266c-.089 0-.178-.178-.089-.267-.178 0-.089-.089-.178-.178v-.355l-.177-.356c0-.178-.178-.178-.178-.266v-.09H26.4v-.266l-.178-.089a2.654 2.654 0 0 0-.267-.355v.088c-.088 0 0-.088 0-.177h-.177v-.178H25.6v-.178h-.267l-.355-.267V12.8c-.09 0 0 0 0-.09h-.445L24 12.445c0-.089-.178 0-.178-.178-.089 0 0 .178-.089 0-.089 0-.178 0-.266-.177 0 .177-.09 0-.267 0a.71.71 0 0 1-.356-.267s-.266-.089-.355 0l-.089-.178s0 .09-.089 0h-.978c-.177-.089-.266-.178-.355 0H20.8l-.089-.267v-1.244c.089-.089.089-.355 0-.355v-.356l-.089-.178c-.089 0-.089 0 0 0l-.178-.355v-.267c0 .089 0 .089 0 0v-.356c-.177-.177-.088-.266 0-.444h-.177v-.178l-.09-.178-.088-.177L20 6.933s0-.267-.178-.267l-.089-.177h-.089v-.09l-.088-.088v-.089l-.178-.444v.088l-.09-.088H19.2s-.178-.09 0-.267h-.267l-.266-.533c-.178-.09-.356-.178-.356-.356-.267 0-.355-.178-.533-.356l-.267.09c-.178-.267-.622-.267-.889-.267 0 .089 0 .089 0 0h-.178c-.177 0-.088.177-.177.177v-.088l-.445.088-.266.178s-.356 0-.267.09c0-.09 0-.09 0 0v.088l-.089-.089c0 .178-.267.178-.356.356l-.266.177-.445.445c-.177 0-.266.089-.266.178l-.09.177-.266.356c0 .089 0 .178-.089 0l-.089.267-.178.355v.09H12.8l-.622.088c-.534 0-1.156-.267-1.6 0-.178-.178-.445 0-.534-.089 0 .089-.177.089-.088 0H9.6v.178c-.089 0-.089 0 0 .089h.178c.089.089 0 0 0 .089.178 0 .178 0 0 0l.355.089h.445c.178.177.444.266.622.177-.178.178.178 0 .356.09l.444.177h.533V8l.267.089c0 .089-.178.089-.089.177v.267s0 .178-.178.178v.178c-.178 0 0 .266-.178.355v.622s0 .178-.177.09v1.777H12c-.356-.178-.622 0-.889-.089h-.444l-.445.178-.8.267h-.178l-.533.355-.178.178-.177.089-.178.178-.356.266-.089.178c-.089 0-.177 0-.266.178L7.2 13.6l-.178.089-.444.444-.178.356-.178.088-.178.178-.088.178-.178.267v.089l-.09.088v.267H5.6L5.333 16v.266l-.089.09c-.177.088-.177.177-.177.355 0 0 0 .178-.09.089 0 .089-.177.266 0 .355H4.89a.889.889 0 0 0-.178.445l-.178.533c0 .178 0 .356-.177.445v.977l-.09.445c0 .089-.177.177-.088.266-.178 0 0 .09 0 .178h-.09v1.067l.09.533c.178.09.178.267.178.356-.09.178 0 .71 0 .71h.088l.09.623c0 .178 0 .178.177.267.178.177 0 .444.267.355 0 .356.444.09.533-.089V24c.178-.356.178-.356 0 0 .178-.178.356-.267.356-.445v.267l.177.355c0 .267.178.445.356.534h.356c.177 0 .266-.178.355-.356L7.378 24l.178-.267h.177c0 .178 0 .267.178.356-.267.088 0 .444 0 .622v.889c.178.089.178.089 0 0l.445.355s.533-.266.355-.355H8.8c.178 0 .267-.267.356-.445l.177-.266v-.09l.09-.355c0-.089 0-.089 0 0 .177 0 .177-.178.266-.267-.089-.088 0-.088 0-.177v-.09l.178-.177.177-.267v-.088c0-.09.267 0 .356-.178 0-.178.178-.178.355-.267.09 0 .09 0 0 0h1.423v.089c0 .178-.267.356-.09.622-.088.09 0 .178 0 .356v.533c-.444 0-.532.444-.888.711l-.178.445v.533l.09.355.177.356.267.178c.088.089.177.089.355 0h.267l.177-.178-.444.178c0-.089 0-.089 0 0l.444-.178.445.089.267-.089h.444l.445-.089.444-.355.178-.445v-.533c.178-.445 0-.8 0-1.156.178-.266 0-.444 0-.533v-1.067c.178 0 .355.178.444.09l.356.088H16c0-.089 0-.089 0 0h-.622l.533.089h.267v.711c-.178 0 0 .356 0 .444v.623l.177.089c-.177.177-.177.355-.088.533-.178 0-.356.089-.356.267-.178 0-.267.177-.355.266l-.178.623v.177l.089.267s.088 0 0 .089c.177 0 .355.267.533.355.267.09.267.09 0 0l.267.09h.355c0 .177.178.088.267.088-.089.09 0 0 .178.09h.266c.267.177.534 0 .711 0l.534-.534.178-.267c0 .267-.623.533-.89.622 0 .178-.266.09-.533.178.267 0 .445 0 .623-.178.177-.089.8-.355.8-.622V25.6c.177-.178 0-.445.088-.623v-.888c.178-.356 0-.623.178-1.067-.089 0-.178-.267-.089-.356-.089 0-.089 0 0 0v-.088c.09-.356-.177-.623.356-.712h.8c-.178-.177-.178-.177 0 0l.355.178c.178 0 .178.267.267.267l.178.178c0 .177 0 .266.178.444l.088.178.178.355v.178s.178 0 0 .09l.178.088v.355c0 .267 0 .356.178.534v.533h.089c0-.178 0-.178 0 0v.445c0 .177 0 0 .178 0 0 .088 0 .088 0 0-.09 0-.178.177-.178 0-.09.177.089.088.178.088l-.09.267v.356c.356.355.623 0 .712-.356l.178-.089v-.444l.088-.356h.09l.444-.71.444-.534.09.355c.088.178 0 .356.177.356v.178c0-.267 0-.534-.267-.711.178.177.267.444.267.71v.178l.178.267c0 .178.266.356.444.356h.089c.089 0 .178-.09.089-.178l.267-.178c0-.178 0-.355.177-.444 0-.267 0-.267 0 0l.267-.623c0-.177.178-.266.267-.444v-.178l.355.356-.267-.356v.178h.09l.177.267c0 .177.356.177.445.266 0-.088.177 0 .355 0l.267-.177.266-.178v-.267s.09-.266 0-.178v-.177c.178 0 0 0 0-.09.09 0 0-.088 0-.088l.09-.356c0-.177.177-.266 0-.444.266 0 .177-.267.177-.356v-1.333h.09Zm-3.467 4.622.09.178-.09-.089v-.089Zm.178.178c0-.178 0 0-.089 0h.267-.178Zm2.49-3.645c-.09 0 0 .09 0 .178l-.09.534c-.178 0 0 .177-.089.355.178 0 0 .178 0 .178l-.177.178-.09-.178-.177-.267H26.4l-.089-.089h-.267c-.177 0-.266.178-.444.356h-.267l-.089.267v.177l-.355.178v.178L24.71 24c0-.178 0-.534-.178-.445l-.178-.444v.089c.09-.267-.177-.356-.177-.534l-.267.09h-.089v.088l-.355.178v.089c-.178.089-.267.355-.267.444-.178.267-.267.622-.533.8-.178.09 0 .445-.267.445v-.978c-.089 0-.178-.267-.089-.444-.178 0-.267-.267-.267-.356l-.266-.444v-.09l-.178-.355c-.089-.089-.178 0-.178-.178l-.267-.177h-.088l-.267-.356h-.356l-.355-.089h-.445l-.088-.089-.178.09h-.356c-.266 0-.355 0-.444.177l-.178.444v.356l-.089.622h-.089v3.556l-.267.088-.177.09c-.267 0-.356 0-.445.177h-.622c-.267 0-.533 0-.622-.355 0 0 0-.178.178-.267l.266-.267s.178-.177 0-.266c.267 0 .178-.178.267-.356V24.8c-.178 0-.089 0 0 0v-.89l-.089-.266c0-.178 0-.444-.178-.622v-.089l-.089-.178s.09 0 0-.089c.178-.088 0-.266 0-.355 0 0-.177 0-.177-.178-.09 0 0 0 0-.089-.178.178-.356 0-.445 0-.266 0-.355.178-.533 0H15.2l-.178-.089-.178.09v.088h-.177c-.178 0-.267 0-.267.178h-.089l-.089.267v.444c-.089.178-.178.356-.089.622-.177 0 0 .356-.089.445v.355l-.088.445.088.266v.445l-.177.533-.445.178H12.8l-.356.089h-.177l-.178-.09h-.178l-.178-.088c-.178-.267-.089-.445 0-.711 0-.178.267-.267.267-.534-.356 0-.356 0 0 0l.355-.355c.09 0 .09-.178.267-.178v-1.066c0 .088 0 .088 0 0 0-.178 0-.267-.178-.267l.09-.178v-.267l-.09-.088c-.266-.267-.533-.356-.889-.445h-.533s-.178 0-.178.178c-.177-.178-.533 0-.71 0-.09 0-.178.267-.445.267v.088c0 .178-.089 0-.178.09 0 .088-.178.177 0 .266-.267 0-.267.267-.444.356l-.09.177-.177.09-.178.621v.09l-.266.177v.267-.356l-.178-.178c0-.355-.178-.8-.356-.977l-.178-.445H7.29c0 .178-.267.178-.178.356l-.178.089v.088a.536.536 0 0 0-.355.445V24l-.267-.534-.089-.355c-.089-.178 0-.267 0-.356l-.178-.177c-.177 0-.177.088-.355 0v.177l-.089.09c-.267 0-.178.266-.178.355l-.178-.178v-.267c-.177-.266-.177-.622-.266-.889v-1.6c0 .356 0 .356 0 0v-.444c0-.178.178-.356 0-.444l.266-.178c-.088-.445 0-.89.178-1.245-.089 0-.089-.177 0-.177v-.356c0-.178.178-.267.356-.445l.089-.355c.177 0 .177-.267.177-.356L6.222 16v-.09l.267-.444.267-.355.266-.267c0-.089 0-.178.178-.266.089 0 .267-.09.267-.267l.177-.089.178-.178v-.178l.534-.355.355-.267H8.8v-.089h.267c0-.178.089-.178.177-.266-.088 0-.177.177-.266.088 0 .09 0 .09 0 0 .089.09.178 0 .266-.088l.09-.09.444-.177.355-.089c.267-.178.623-.267.89-.178l.71-.089H12s.089 0 0-.088c.267 0 .267.177.444 0V12c.09 0 0-.178 0-.178v-.267l.09-.089c.088-.177.177-.266 0-.444.177 0 .177-.267.177-.444h-.089c0-.445.09-.445 0 0l.178-.267c-.089-.178 0-.267 0-.356v-.177c0-.178 0-.356.178-.534.089 0 0-.178.178-.266-.09 0 0-.09 0-.178v-.356c.177 0 .266-.178.266-.355 0-.178 0-.356.178-.445l.267-.355c0-.09 0-.09 0 0V7.11s.088-.089 0-.178c.355-.089.355-.533.622-.711l.266-.267c0-.177.267-.355.356-.444l.356-.089s.266 0 .177-.178l.267-.089.178-.177h.089l.71-.178h.356c.178 0 .09.089.178.178l.445.177v.09c.266.266.355.266 0 0l.355.355c.178.178.267.533.534.71-.178.179.266.445.266.623v.178c.178 0 0 .178.178.267v.088l.178.267.089.533.088.267v.533l.09.267v.711l.177.622v.89c.178.177.178.177 0 0v-.534.444L20 12h.089c.089.089.267.266.355.178h.623l.355.088h.267s0 .178.178.09l.71.088.356.178c.267.178.711.267.89.533H24v.178c.267 0 .355.267.533.267.267 0 .356.266.534.355l.444.356c.089.178 0 .444.356.355l.177.623c.267.266.267.266 0 0v.177l.178.356c0 .178.178.267.267.444h-.178v.267l.178.178v.267l.178.266c0 .178 0 .356.177.356-.266 0 0 .355 0 .355 0 .267 0 .356 0 0v.267c-.177.178.09.355 0 .533v.178c0-.089 0-.089 0 0v.622c.09 0 .09 0 0 .09v.444l.178.355v.356s-.089.089 0 .177v.09c0 .177 0 .177 0 0h-.089l.09.177v.534h.088Z"}),ot.createElement("path",{fill:"#000",d:"M17.334 6.222h-.178l-.267.09-.178.355.09.266h.177l.356.09.266-.268V6.4c-.178 0-.178-.178-.266-.178Zm-1.6 0h-.356c-.267.09-.267.267-.267.445v.177l.445.178h.089l.177-.089v-.178c.09-.088.178-.177.09-.355l-.09-.178h-.088Z"}))),uA||(uA=ot.createElement("defs",null,ot.createElement("clipPath",{id:"a"},ot.createElement("path",{fill:"#fff",d:"M0 0h32v32H0z"}))))),name:"Omni-Trade"}];function mA({routeTagList:t}){const n=g(),r={typography:"h6",borderRadius:4,px:8,py:4,ml:8};return Os.jsx(Os.Fragment,{children:t.map((t=>"no-approve"===t.type?Os.jsxs(f,{sx:Object.assign(Object.assign({},r),{color:n.palette.text.primary,backgroundColor:n.palette.background.paperContrast,display:"flex",alignItems:"center"}),children:[Os.jsx(As.Lock,{style:{color:n.palette.text.primary,width:14,height:14}}),Os.jsx("span",{style:{marginLeft:4},children:Os.jsx(e,{id:"F+sxb9",message:"Unapproved"})})]},t.type):"best-price"===t.type?Os.jsx(f,{sx:Object.assign(Object.assign({},r),{color:n.palette.success.main,backgroundColor:C(n.palette.success.main,.1)}),children:Os.jsx(e,{id:"OgKD6h",message:"Best offer"})},t.type):null))})}function fA(e,t){let n=r._({id:"B0/2ea",message:"s"});return t||(n=e>=2?r._({id:"V+rJKF",message:"Seconds"}):r._({id:"ku//5b",message:"Second"})),n}function gA(e,t){let n="";return n=e>=2?t?r._({id:"TFOxRM",message:"Mins"}):r._({id:"agRWc1",message:"Minutes"}):t?r._({id:"eTUF28",message:"Min"}):r._({id:"6UYTy8",message:"Minute"}),n}function yA(e){return e>=2?r._({id:"yY8wAv",message:"Hours"}):r._({id:"6XgEPi",message:"Hour"})}function xA({start:e,end:t,showSecondUnit:n}){if(!e||!t)return null;const i=t-e,o=1e3,a=6e4,s=36e5,l=24*s;let d="",c="";if(i<a){const e=i/o;d=`${En(e)} ${fA(e,n)}`}else if(i<s){const e=i/a;d=`${En(e)} ${gA(e,n)}`;const t=i%a/o;c=`${En(t)} ${fA(t,n)}`}else if(i<l){const e=i/s;d=`${En(e)} ${yA(e)}`;const t=i%s/a;c=`${En(t)} ${gA(t)}`}else{const e=i/l;d=`${En(e)} ${function(e){return e>=2?r._({id:"HuVZMK",message:"Days"}):r._({id:"H7OUPr",message:"Day"})}(e)}`;const t=i%l/s;c=`${En(t)} ${yA(t)}`}return n?`${d}${c}`.replaceAll(" ","").toLowerCase():d}function vA(e){const t=String(e);return 1===t.length?`0${t}`:t}function bA(e,t="/",{noYear:n}={}){const r=e.getFullYear(),i=e.getMonth()+1,o=e.getDate(),a=e.getHours(),s=e.getMinutes();let l=`${vA(i)}${t}${vA(o)} ${vA(a)}:${vA(s)}`;return n||(l=`${r}${t}${l}`),l}function AA({chainId:t,token:n,amount:r}){var i;const o=g(),a=lt((()=>_g.get(t)),[t]);return Os.jsxs(f,{sx:{display:"flex",flexDirection:"column"},children:[Os.jsxs(f,{sx:{mb:8,display:"flex",alignItems:"flex-end",alignSelf:"center"},children:[Os.jsx(ey,{address:null!==(i=null==n?void 0:n.address)&&void 0!==i?i:"",marginRight:0,width:28,height:28,url:null==n?void 0:n.logoURI}),a?Os.jsx(f,{component:a.logo,sx:{width:12,height:12,position:"relative",left:-6}}):""]}),Os.jsxs(f,{sx:{color:o.palette.text.primary,typography:"body1",fontWeight:600,width:"100%",wordBreak:"break-word",textAlign:"center"},children:[An({input:r,decimals:null==n?void 0:n.decimals})," ",null==n?void 0:n.symbol]}),Os.jsxs(f,{sx:{color:o.palette.text.secondary,typography:"h6",alignSelf:"center"},children:[Os.jsx(e,{id:"Fdp03t",message:"on"})," ",null==a?void 0:a.name]})]})}function wA({children:e}){const t=g();return Os.jsxs(f,{sx:{position:"relative",width:"calc(100% - 16px)",mx:"auto"},children:[Os.jsx(f,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",borderTopColor:t.palette.text.primary,borderTopWidth:1,borderTopStyle:"dashed","&:before":{content:'""',position:"absolute",left:0,top:-.5,backgroundColor:t.palette.text.primary,width:6,height:6,borderRadius:"50%",transform:"translate(-50%, -50%)"},"&:after":{display:{tablet:"block"},content:'""',position:"absolute",right:-1,top:-.5,width:0,height:0,transform:"translate(0, -50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderLeft:`6px solid ${t.palette.text.primary}`}}}),Os.jsx(f,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},children:e})]})}function kA({size:e="medium",toolDetails:t,nameMarginLeft:n=4,logoMarginLeft:r=0,nameSx:i}){const o=g();if(!t||!t.logoURI||!t.name)return null;const{logoURI:a,name:s}=t;return Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{component:"img",src:a,alt:s,sx:{marginLeft:r,width:"large"===e?24:16,height:"large"===e?24:16}}),Os.jsx(f,{sx:Object.assign({color:o.palette.text.primary,fontWeight:600,marginLeft:n,typography:{mobile:"small"===e?"h6":"medium"===e?"body2":"caption",tablet:"small"===e||"medium"===e?"body2":"caption"}},i),children:s})]})}var CA,jA,TA;function EA(e,{amount:t,contractAddress:r,offset:o,overrideBalance:a,skipQuery:s}={}){var l,d,c;const{account:u}=hf(),[p,h]=at.useMemo((()=>e?[e.chainId,null!=r?r:me[e.chainId].DODO_APPROVE]:[void 0,r]),[e,r]),m=Rt(),f=It(Object.assign(Object.assign({},$a.getFetchTokenQuery(s?void 0:p,null==e?void 0:e.address,u,h)),{refetchInterval:p===oe.NEOX?3e3:void 0})),{runningRequests:g}=Vy(),{updateBlockNumber:y}=wf(),{i18n:x}=n(),v=at.useMemo((()=>{var e;return p?null===(e=ue[p])||void 0===e?void 0:e.address:null}),[p]),b=at.useCallback((()=>{var n,r;if(!e)return jA.Loading;const s=g.some((t=>{var n,r,i;return(null===(n=t.spec)||void 0===n?void 0:n.opcode)===By.Approval&&(null===(r=t.spec)||void 0===r?void 0:r.token.address)===(null==e?void 0:e.address)&&(null===(i=t.spec)||void 0===i?void 0:i.contract)===h})),l=null!=a?a:null===(n=f.data)||void 0===n?void 0:n.balance,d=null===(r=f.data)||void 0===r?void 0:r.allowance,c=new i(t||0);if(!u)return jA.Unchecked;if(!l||c.minus(null!=o?o:0).gt(l))return jA.Unchecked;if(c.isZero())return jA.Unchecked;return e.address===v?jA.Sufficient:s?jA.Approving:d?c.minus(null!=o?o:0).gt(d)?jA.Insufficient:jA.Sufficient:jA.Loading}),[g,u,o,v,f.data,e,a,t,h]),{isApproving:A,isGetApproveLoading:w,needApprove:k,needReset:C}=at.useMemo((()=>{var t;const n=b(),r=function(e,t){var n;return("USDT"===(null==e?void 0:e.symbol)||(null===(n=null==e?void 0:e.address)||void 0===n?void 0:n.toLowerCase())==="0x6426e6017968377529487E0ef0aA4E7759724e05".toLowerCase())&&t&&t.gt(0)}(e,null===(t=f.data)||void 0===t?void 0:t.allowance);return{isApproving:n===jA.Approving,isGetApproveLoading:n===jA.Loading||f.isLoading,needApprove:n===jA.Insufficient&&!r,needReset:n===jA.Insufficient&&r}}),[b,e,null===(l=f.data)||void 0===l?void 0:l.allowance,f.isLoading]),j=Hy(),T=at.useMemo((()=>{if(!e)return"";return`${C?x._({id:"OfhWJH",message:"Reset"}):x._({id:"Z7ZXbT",message:"Approve"})} ${xs(e)}`}),[e,C,x._]),E=Ot({mutationFn:()=>Fn(this,void 0,void 0,(function*(){if(console.log("dev gonghe",h,u,e),!h||!u||!e)return;const t=C?new i(0):void 0;(yield j.execute(T,{opcode:By.Approval,token:e,contract:h,amt:t},{metadata:{[Ey.approve]:!0}}))===Sy.Success&&(yield y(),m.invalidateQueries({queryKey:$a.getFetchTokenQuery(p,null==e?void 0:e.address,u,h).queryKey,refetchType:"all"}))}))}),S=at.useCallback((()=>Fn(this,void 0,void 0,(function*(){E.mutate()}))),[E]),I=at.useCallback((()=>{var t;const n=new i(0);if(!e)return n.toString();const r=null!=a?a:null===(t=f.data)||void 0===t?void 0:t.balance;if(!r)return n.toString();return r.toString()}),[p,null===(d=f.data)||void 0===d?void 0:d.balance,a,e]),R=at.useMemo((()=>{var e,n;if(!t)return!1;return(null!==(n=null!=a?a:null===(e=f.data)||void 0===e?void 0:e.balance)&&void 0!==n?n:new i(0)).lt(t)}),[null===(c=f.data)||void 0===c?void 0:c.balance,a,t]),L=A||E.isPending;return{token:e,isApproving:L,isGetApproveLoading:w,needApprove:k,needReset:C,needShowTokenStatusButton:k||C||L||R,insufficientBalance:R,loading:f.isLoading,approveTitle:T,submitApprove:S,getMaxBalance:I}}function SA({fromToken:t,toToken:n,fromChainId:r,toChainId:i,fromAmount:o,toTokenAmount:a,toolDetails:s,product:l,executionDuration:d,feeUSD:c,selected:u,setSelected:p,spenderContractAddress:h,isBestPrice:m}){const y=g(),x=hA.find((e=>e.id===l)),{isApproving:v,needApprove:b}=EA(t,{amount:o,contractAddress:h}),w=lt((()=>{const e=[];return m&&e.push({type:"best-price"}),v||b?[...e,{type:"no-approve"}]:e}),[v,b,m]);return Os.jsxs(f,{sx:Object.assign({borderRadius:16,py:16,px:12,backgroundColor:y.palette.background.tag,cursor:"pointer","&:hover":{backgroundColor:"hover.default"},outline:0},u?{borderWidth:1,borderStyle:"solid",borderColor:y.palette.primary.main}:{}),onClick:p,children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap"},children:[Os.jsx(f,{component:null==x?void 0:x.logoURI,sx:{width:16,height:16}}),Os.jsx(f,{sx:{marginLeft:4},children:null==x?void 0:x.name}),Os.jsx(mA,{routeTagList:w})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",mt:8,pb:8,borderStyle:"dashed",borderWidth:y.spacing(0,0,1,0),borderColor:y.palette.border.main},children:[Os.jsx(A,{onlyHover:!0,placement:"top",title:Os.jsx(e,{id:"h5FVz1",message:"Estimated transaction time"}),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",px:8,py:4,border:`solid 1px ${y.palette.border.main}`,borderRadius:4,typography:"h6"},children:[Os.jsx(As.Time,{style:{color:y.palette.text.secondary,width:14,height:14}}),Os.jsx(f,{sx:{ml:4,lineHeight:1},children:null!==d?xA({start:Date.now(),end:Date.now()+1e3*d}):"-"})]})}),Os.jsx(A,{onlyHover:!0,placement:"top",title:Os.jsx(e,{id:"7IKPTP",message:"Fee includes: Cross Chain fees + Swap fees. Gas fee not included."}),children:Os.jsxs(f,{sx:{ml:8,display:"flex",alignItems:"center",px:8,py:4,border:`solid 1px ${y.palette.border.main}`,borderRadius:4,typography:"h6"},children:[Os.jsx(As.GasFee,{style:{color:y.palette.text.secondary,width:14,height:14}}),Os.jsx(f,{sx:{ml:4,lineHeight:1},children:null!==c?`$${An({input:c,decimals:6})}`:"-"})]})})]}),Os.jsxs(f,{sx:{display:"grid",gridTemplateColumns:"36% 28% 36%",mt:8},children:[Os.jsx(AA,{token:t,chainId:r,amount:o}),Os.jsx(wA,{children:Os.jsx(f,{sx:{display:"flex",px:3,py:3,backgroundColor:y.palette.background.paperContrast,border:`1px solid ${y.palette.border.main}`,borderRadius:"50%",alignItems:"center",width:24,height:24,overflow:"hidden"},children:Os.jsx(kA,{size:"medium",toolDetails:s,nameMarginLeft:8})})}),Os.jsx(AA,{token:n,chainId:i,amount:a})]})]})}function IA({open:t,onClose:n,selectedRouteId:r,setSelectRouteId:i,bridgeRouteList:o}){const a=g();return Os.jsx(yy,{open:t,onClose:n,id:"select-cross-chain",title:Os.jsx(e,{id:"K/PgcA",message:"Select Cross Chain"}),children:Os.jsx(f,{sx:{position:"relative",display:"flex",flexDirection:"column",gap:12,py:20,px:16,flex:1,overflowY:"auto",overflowX:"hidden","&::before":{content:'""',position:"absolute",top:0,width:1,height:"1px",backgroundColor:a.palette.border.main}},children:null==o?void 0:o.map(((e,t)=>Os.jsx(SA,{fromChainId:e.fromChainId,toChainId:e.toChainId,fromToken:e.fromToken,toToken:e.toToken,fromAmount:e.fromAmount,toTokenAmount:e.toTokenAmount,toolDetails:e.step.toolDetails,spenderContractAddress:e.spenderContractAddress,selected:r===e.id,setSelected:()=>{i(e.id),n()},isBestPrice:0===t,product:e.product,executionDuration:e.executionDuration,feeUSD:e.feeUSD},e.key)))})})}function RA({route:t,onClick:n}){var r,o;const a=g();if(!t)return null;const{product:s,executionDuration:l,feeUSD:d,fromAmount:c,fromToken:u,fromChainId:p,toTokenAmount:h,toToken:m,toChainId:y}=t,x=hA.find((e=>e.id===s));_g.get(p),_g.get(y);const[v,b]=at.useState(!1),w=v?m:u,k=v?u:m,C=v?y:p,j=v?p:y;return Os.jsxs(f,{sx:{px:16,py:8,width:"100%",backgroundColor:"background.tag",borderRadius:12,cursor:"pointer","&:hover":{backgroundColor:"hover.default"}},onClick:n,children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap"},children:[Os.jsx(f,{component:null==x?void 0:x.logoURI,sx:{width:16,height:16}}),Os.jsx(f,{sx:{mx:4,typography:"body2",fontWeight:600},children:null==x?void 0:x.name}),Os.jsx(A,{onlyHover:!0,placement:"top",title:Os.jsx(e,{id:"h5FVz1",message:"Estimated transaction time"}),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",px:8,py:4,border:`solid 1px ${a.palette.border.main}`,borderRadius:4,typography:"h6"},children:[Os.jsx(As.Time,{style:{color:a.palette.text.secondary,width:14,height:14}}),Os.jsx(f,{sx:{ml:4,lineHeight:1},children:null!==l?xA({start:Date.now(),end:Date.now()+1e3*l}):"-"})]})}),Os.jsx(A,{onlyHover:!0,placement:"top",title:Os.jsx(e,{id:"7IKPTP",message:"Fee includes: Cross Chain fees + Swap fees. Gas fee not included."}),children:Os.jsxs(f,{sx:{ml:8,display:"flex",alignItems:"center",px:8,py:4,border:`solid 1px ${a.palette.border.main}`,borderRadius:4,typography:"h6"},children:[Os.jsx(As.GasFee,{style:{color:a.palette.text.secondary,width:14,height:14}}),Os.jsx(f,{sx:{ml:4,lineHeight:1},children:null!==d?`$${An({input:d,decimals:6})}`:"-"})]})})]}),Os.jsx(f,{component:As.ArrowRight,sx:{width:18,height:18}})]}),Os.jsxs(f,{sx:{mt:8,display:"flex",alignItems:"center",typography:"body2",fontWeight:600,gap:4},children:[Os.jsxs("span",{children:["1 ",w.symbol]}),Os.jsx(ey,{address:null!==(r=null==w?void 0:w.address)&&void 0!==r?r:"",marginRight:0,width:20,height:20,url:null==w?void 0:w.logoURI,chainId:C,sx:{flexShrink:0}}),Os.jsx("span",{children:"="}),Os.jsxs("span",{children:[An({input:v?new i(c).div(h):h.div(c),decimals:null==k?void 0:k.decimals})," ",k.symbol]}),Os.jsx(ey,{address:null!==(o=null==k?void 0:k.address)&&void 0!==o?o:"",marginRight:0,width:20,height:20,url:null==k?void 0:k.logoURI,chainId:j,sx:{flexShrink:0}}),Os.jsx(I,{component:As.Switch,sx:{color:"text.secondary",position:"relative",left:-2},onClick:e=>{e.stopPropagation(),b((e=>!e))}})]})]})}function LA({route:e,bridgeOrderTxRequest:t}){const{chainId:n,account:i}=At(),o=Hy(),{apikey:a}=pf(),s=Gv(Ha.bridgeCreateRoute),l=ut((n=>{if(t&&e)try{const{fromToken:i,toToken:l,fromAmount:d,toTokenAmount:c,fromChainId:u,toChainId:p,toAddress:h,slippage:m,roundedRouteCostTime:g}=e,y=An({input:d,decimals:i.decimals}),x=An({input:c,decimals:l.decimals}),v=Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(ey,{token:i,sx:{width:16,height:16,mr:6},chainId:i.chainId}),`${y} ${null==i?void 0:i.symbol}`,Os.jsx(f,{component:As.DoubleRight,sx:{width:12,height:12,mx:16}}),Os.jsx(ey,{token:l,sx:{width:16,height:16,mr:6}}),`${x} ${null==l?void 0:l.symbol}`]}),b=(n,r)=>Fn(this,void 0,void 0,(function*(){const i=yield function(e){return Fn(this,arguments,void 0,(function*({apikey:e,tx:t,route:n,bridgeCreateRouteAPI:r,encodeId:i}){const{fromChainId:o,toChainId:a,fromAmount:s,fromToken:l,toToken:d,fromAddress:c,toAddress:u,slippage:p,product:h,step:m,sourceRoute:f,productParams:g}=n,{toAmount:y}=f,x={fromChainId:o,fromAmount:jn(s,l.decimals).toString(),fromTokenAddress:l.address,toChainId:a,toAmount:y,toTokenAddress:d.address,fromAddress:c,toAddress:u,slippage:p,hash:t,product:h,extend:{lifiBridge:m.tool,route:f,productParams:g,encodeId:i,source:"widget"}},v=(yield Ut.post(`${r}${e?`?apikey=${e}`:""}`,{data:x})).data.data;return null==v?void 0:v.id}))}({apikey:a,tx:n,route:e,bridgeCreateRouteAPI:s,encodeId:t.encodeId});r&&r(n,{orderId:i})})),A={fromChainId:u,toChainId:p,fromTokenAddress:i.address,toTokenAddress:l.address,fromTokenSymbol:i.symbol,toTokenSymbol:l.symbol,fromTokenAmount:d,toTokenAmount:c.toString(),slippage:m,sendAccount:h,roundedRouteCostTime:g};return o.execute(r._({id:"+uZnU3",message:"Cross Chain"}),Object.assign({opcode:By.TX},t),{subtitle:v,metadata:Object.assign({[Ey.crossChain]:!0},n),mixpanelProps:Object.assign(Object.assign(Object.assign({},t),{fromToken:i,toToken:l,pay:y,receive:x}),A),successBack:b})}catch(e){console.error(e)}}),[i,n,e,t,a,s]);return l}function MA({chainId:e,address:t,children:n}){const r=g();return Os.jsxs(f,{component:"a",href:ps(e,t,"tx"),target:"_blank",rel:"noopener noreferrer",sx:{color:r.palette.text.secondary,"&:hover":{color:r.palette.text.primary},display:"flex",alignItems:"center",typography:"body2"},children:[n,Os.jsx(f,{component:"svg",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",sx:{marginLeft:6,width:16,height:17},children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.33333 3.83333V13.1667H12.6667V8.5H14V13.1667C14 13.9 13.4 14.5 12.6667 14.5H3.33333C2.59333 14.5 2 13.9 2 13.1667V3.83333C2 3.1 2.59333 2.5 3.33333 2.5H8V3.83333H3.33333ZM9.33333 3.83333V2.5H14V7.16667H12.6667V4.77333L6.11333 11.3267L5.17333 10.3867L11.7267 3.83333H9.33333Z",fill:"currentColor"})})]})}function OA({fromChainId:t,toChainId:n,fromTokenAmount:r,toTokenAmount:i,fromTokenDecimals:o,fromTokenSymbol:a,toTokenDecimals:s,toTokenSymbol:l,fromHash:d,toHash:c,toolDetails:u}){const p=g(),[h,m]=lt((()=>[_g.get(t),_g.get(n)]),[t,n]);return Os.jsxs(f,{sx:{borderLeft:`1px dashed ${p.palette.text.primary}`,opacity:c?1:.5,pb:24},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"flex-start",flexWrap:"wrap"},children:[Os.jsx(f,{component:"img",src:u.logoURI,alt:u.name,sx:{width:20,height:20,marginLeft:-10.5,pt:1,backgroundColor:{mobile:p.palette.background.paper,tablet:p.palette.background.paper},alignSelf:"flex-start"}}),Os.jsx(f,{sx:{ml:8,typography:"body1"},children:u.name}),Os.jsxs(f,{sx:{typography:"body2",marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"flex-end",width:{mobile:"100%",tablet:"auto"},mt:{mobile:8,tablet:0}},children:[An({input:r,decimals:o})," ",a,Os.jsx("span",{style:{marginLeft:4,color:p.palette.text.secondary},children:Os.jsx(e,{id:"Z5HWHd",message:"On"})}),Os.jsx(f,{component:null==h?void 0:h.logo,sx:{marginLeft:4,width:18,height:18}}),Os.jsx("span",{style:{marginLeft:4,marginRight:4,color:p.palette.text.secondary},children:Os.jsx(e,{id:"/jQctM",message:"To"})}),An({input:i,decimals:s})," ",l,Os.jsx("span",{style:{marginLeft:4,color:p.palette.text.secondary},children:Os.jsx(e,{id:"Z5HWHd",message:"On"})}),Os.jsx(f,{component:null==m?void 0:m.logo,sx:{marginLeft:4,width:18,height:18}})]})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",mt:{mobile:8,tablet:5}},children:[Os.jsx(MA,{chainId:t,address:d,children:Os.jsx(e,{id:"wdxz7K",message:"Source"})}),Os.jsx(f,{sx:{width:16}}),Os.jsx(MA,{chainId:n,address:c,children:Os.jsx(e,{id:"Enslfm",message:"Destination"})})]})]})}function BA({chainId:t,fromTokenAmount:n,toTokenAmount:r,fromTokenDecimals:i,fromTokenSymbol:o,toTokenDecimals:a,toTokenSymbol:s,hash:l,toolDetails:d}){const c=g(),u=lt((()=>_g.get(t)),[t]);return Os.jsxs(f,{sx:{borderLeft:`1px dashed ${c.palette.text.primary}`,opacity:l?1:.5,pb:24},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"flex-start",flexWrap:"wrap"},children:[Os.jsx(f,{component:"img",src:d.logoURI,alt:d.name,sx:{width:20,height:20,marginLeft:-10.5,pt:1,backgroundColor:c.palette.background.paper,alignSelf:"flex-start"}}),Os.jsx(f,{sx:{ml:8,typography:"body1"},children:d.name}),Os.jsxs(f,{sx:{typography:"body2",marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"flex-end",width:{mobile:"100%",tablet:"auto"},mt:{mobile:8,tablet:0}},children:[An({input:n,decimals:i})," ",o,Os.jsx("span",{style:{marginLeft:4,marginRight:4,color:c.palette.text.secondary},children:Os.jsx(e,{id:"YHpbe1",message:"For"})}),An({input:r,decimals:a})," ",s,Os.jsxs(f,{sx:{alignItems:"center",display:{mobile:"none",tablet:"flex"}},children:[Os.jsx("span",{style:{marginLeft:4,color:c.palette.text.secondary},children:Os.jsx(e,{id:"Fdp03t",message:"on"})}),Os.jsx(f,{component:null==u?void 0:u.logo,sx:{marginLeft:4,width:18,height:18}}),Os.jsx(f,{component:"span",sx:{ml:4},children:null==u?void 0:u.name})]})]})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",typography:"body2",mt:{mobile:8,tablet:5}},children:[Os.jsxs(f,{sx:{alignItems:"center",display:{mobile:"flex",tablet:"none"}},children:[Os.jsx("span",{style:{color:c.palette.text.secondary},children:Os.jsx(e,{id:"Fdp03t",message:"on"})}),Os.jsx(f,{component:null==u?void 0:u.logo,sx:{marginLeft:4,width:18,height:18}}),Os.jsx(f,{component:"span",sx:{ml:4,mr:8},children:null==u?void 0:u.name})]}),Os.jsx(MA,{chainId:t,address:l,children:Os.jsx(e,{id:"S3piC2",message:"Tx"})})]})]})}function PA({marginTop:e=20,route:t}){const n=g(),{fromChainId:r,toChainId:i}=t,{step:{includedSteps:o}}=t,[a,s]=lt((()=>[_g.get(r),_g.get(i)]),[r,i]);return Os.jsxs(f,{sx:{mt:e,pl:10},children:[Os.jsx(f,{sx:{borderLeft:`1px dashed ${n.palette.text.primary}`,opacity:1,pb:24},children:Os.jsxs(f,{sx:{display:"flex",alignItems:"flex-start"},children:[Os.jsx(f,{component:null==a?void 0:a.logo,sx:{width:20,height:20,marginLeft:-10.5,pt:1,backgroundColor:n.palette.background.paper}}),Os.jsx(f,{sx:{ml:8,typography:"body1"},children:null==a?void 0:a.name})]})}),o.map(((e,t)=>{const{toolDetails:n,type:r,estimate:i}=e;return"swap"===r?Os.jsx(BA,{chainId:i.fromToken.chainId,fromTokenAmount:i.fromTokenAmount,toTokenAmount:i.toTokenAmount,fromTokenDecimals:i.fromToken.decimals,fromTokenSymbol:i.fromToken.symbol,toTokenDecimals:i.toToken.decimals,toTokenSymbol:i.toToken.symbol,hash:null,toolDetails:n},t):"cross"===r?Os.jsx(OA,{fromChainId:i.fromToken.chainId,toChainId:i.toToken.chainId,fromTokenAmount:i.fromTokenAmount,toTokenAmount:i.toTokenAmount,fromTokenDecimals:i.fromToken.decimals,fromTokenSymbol:i.fromToken.symbol,toTokenDecimals:i.toToken.decimals,toTokenSymbol:i.toToken.symbol,fromHash:null,toHash:null,toolDetails:n},t):null})),Os.jsx(f,{sx:{opacity:.5,pb:0},children:Os.jsxs(f,{sx:{display:"flex",alignItems:"flex-start"},children:[Os.jsx(f,{component:null==s?void 0:s.logo,sx:{width:20,height:20,marginLeft:-10.5,pt:1,backgroundColor:n.palette.background.paper}}),Os.jsx(f,{sx:{ml:8,typography:"body1"},children:null==s?void 0:s.name})]})})]})}function DA({route:t}){const n=g(),r=_g.get(t.fromChainId),i=lt((()=>ps(t.fromChainId,t.fromAddress,"address")),[t.fromAddress,t.fromChainId]);return Os.jsxs(f,{children:[Os.jsx(f,{sx:{py:12,borderStyle:"solid",borderWidth:n.spacing(1,0,0),borderColor:n.palette.border.main},children:Os.jsx(N,{children:Os.jsx(F,{initialEntered:!0,sx:{"& button.active svg":{transform:"rotate(0)"}},header:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body2"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(f,{component:As.DetailBorder,sx:{mr:6,width:18,height:18}}),Os.jsx(e,{id:"rRDi3Y",message:"Detail"})]}),Os.jsx(f,{component:As.CaretUp,sx:{width:12,height:12,color:"text.secondary",transform:"rotate(180deg)",transition:"transform 0.2s linear"}})]}),children:Os.jsxs(f,{sx:{mt:16},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsx(f,{sx:{typography:"body2",color:"text.secondary",flexShrink:0},children:Os.jsx(e,{id:"lt8yMa",message:"Send to:"})}),Os.jsxs(f,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center"},children:[r?Os.jsx(f,{component:r.logo,sx:{width:18,height:18}}):"",Os.jsx(f,{sx:{display:"inline-block",mx:6,width:"1px",height:12,backgroundColor:"border.main"}}),Os.jsx(f,{sx:{typography:"body2",fontWeight:600},children:us(t.fromAddress)}),Os.jsx(I,{component:"a",href:i,target:"_blank",rel:"noopener noreferrer",sx:{ml:6,width:18,height:18,color:"text.secondary"},children:Os.jsx(f,{component:As.ArrowTopRightBorder,sx:{width:18,height:18}})})]})]}),t.feeUSD?Os.jsxs(f,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",typography:"body2",color:"text.secondary",flexShrink:0},children:Os.jsx(e,{id:"PLUB/s",message:"Fee"})}),Os.jsxs(f,{sx:{typography:"body2"},children:["$",bn({input:t.feeUSD})]})]}):"",Os.jsxs(f,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",typography:"body2",color:"text.secondary",flexShrink:0},children:[Os.jsx(e,{id:"CMHmbm",message:"Slippage"}),Os.jsx(Ov,{onlyHover:!0,title:Os.jsx(e,{id:"KAmxpM",message:"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:6})]}),Os.jsxs(f,{sx:{typography:"body2"},children:[100*t.slippage,"%"]})]})]})})})}),Os.jsx(f,{sx:{py:12,borderStyle:"solid",borderWidth:n.spacing(1,0,0),borderColor:n.palette.border.main},children:Os.jsx(N,{children:Os.jsx(F,{initialEntered:!0,sx:{"& button.active svg":{transform:"rotate(0)"}},header:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body2"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(f,{component:As.DetailBorder,sx:{mr:6,width:18,height:18}}),Os.jsx(e,{id:"QNWt8A",message:"Estimated Time"})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[t.executionDuration?xA({start:Date.now(),end:Date.now()+1e3*t.executionDuration}):"-",Os.jsx(f,{component:As.CaretUp,sx:{ml:6,width:12,height:12,color:"text.secondary",transform:"rotate(180deg)",transition:"transform 0.2s linear"}})]})]}),children:Os.jsx(PA,{route:t})})})})]})}function NA({open:t,onClose:n,route:r,bridgeOrderTxRequest:i,clearToAmt:o,clearFromAmt:a}){const s=g(),{contractStatus:l}=yf(),d=LA({route:r,bridgeOrderTxRequest:i});return st((()=>{l!==gf.Pending&&n(),l===gf.TxSuccess&&(o(),a())}),[l]),Os.jsx(yy,{title:Os.jsx(e,{id:"tKE4Ak",message:"Cross Chain Summary"}),open:t,id:"cross-chain-summary",onClose:()=>{xf(gf.Initial),n()},children:Os.jsxs(Os.Fragment,{children:[r?Os.jsxs(f,{sx:{px:16,pb:20,flex:1,overflowY:"auto"},children:[Os.jsxs(f,{sx:{display:"grid",gridTemplateColumns:"36% 28% 36%",py:20,borderStyle:"solid",borderWidth:s.spacing(1,0,0),borderColor:s.palette.border.main},children:[Os.jsx(AA,{token:r.fromToken,chainId:r.fromChainId,amount:r.fromAmount}),Os.jsx(wA,{children:Os.jsx(f,{sx:{display:"flex",px:3,py:3,backgroundColor:s.palette.background.paperContrast,border:`1px solid ${s.palette.border.main}`,borderRadius:"50%",alignItems:"center",width:24,height:24,overflow:"hidden"},children:Os.jsx(kA,{size:"medium",toolDetails:r.step.toolDetails,nameMarginLeft:8})})}),Os.jsx(AA,{token:r.toToken,chainId:r.toChainId,amount:r.toTokenAmount})]}),Os.jsx(DA,{route:r})]}):"",Os.jsx(f,{sx:{px:16,py:20},children:Os.jsx(T,{fullWidth:!0,isLoading:l==gf.Pending,disabled:!r,onClick:()=>{d(),xf(gf.Pending)},children:l==gf.Pending?Os.jsx(e,{id:"P+K/3O",message:"Confirming"}):Os.jsx(e,{id:"PZqJog",message:"Confirm Cross Chain"})})})]})})}function FA({message:t,onClose:n}){return Os.jsx(yy,{open:!!t,onClose:n,id:"error-message",children:Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{flex:1,textAlign:"center"},children:[Os.jsx(f,{component:As.ErrorWarn,sx:{mt:60,width:64,height:64,color:"error.main"}}),t?Os.jsxs(f,{sx:{textAlign:"center",mt:60},children:[Os.jsx(f,{children:Os.jsx(e,{id:"kf83Ld",message:"Something went wrong."})}),Os.jsx(f,{sx:{color:"text.secondary",mt:12,typography:"body2",wordBreak:"break-all"},children:t})]}):""]}),Os.jsx(f,{sx:{px:16,py:20},children:Os.jsx(T,{onClick:n,fullWidth:!0,children:Os.jsx(e,{id:"1QfxQT",message:"Dismiss"})})})]})})}function WA(e){const t=dt(!1),[n,r]=ct(!1);return st((()=>{if(void 0===e)return;const n=function(e){const t=localStorage.getItem(e?lx:sx);return t?Number(t):null}(e);if(!t.current)return Af(n?n.toString():null),void(t.current=!0);Af(n?n.toString():null),r(!0);const i=setTimeout((()=>{r(!1)}),3e3);return()=>{clearTimeout(i)}}),[e]),n}function VA({side:e,defaultToken:t,tokenList:n,occupyToken:r,chainId:i}){var o,a;let s,l=null,d=n.filter((t=>!(t.side&&t.side!==e||i&&t.chainId!==i)));if(d.length||(d=n.filter((t=>!t.side||t.side===e))),d.length){let n=function(e){const t=localStorage.getItem("from"===e?ix:ox);if(!t)return null;try{return JSON.parse(t)}catch(e){return console.error(e),null}}(e);t&&(n=Object.assign({},t),s=t.amount),n&&(l=null!==(o=d.find((e=>e.address===(null==n?void 0:n.address)&&e.chainId===n.chainId)))&&void 0!==o?o:null),l||(r?l=null!==(a=d.find((e=>e.address!==r.address)))&&void 0!==a?a:null:[l]=d)}return{findToken:l,setDefaultAmount:s}}function UA({fromToken:e,toToken:t,setFromToken:n,setToToken:r,updateFromAmt:i,updateToAmt:o,setIsReverseRouting:a}){const{tokenList:s}=Jc(),{crossChain:l,defaultFromToken:d,defaultToToken:c,onlyChainId:u}=pf(),{autoConnectLoading:p}=yf(),{chainId:h,isActivating:m}=At();st((()=>{const f=setTimeout((()=>{m||(()=>{let m,f=null;if(!l&&p)return;const g=l?void 0:null!=u?u:h;if(!e){const e=VA({side:"from",defaultToken:d,tokenList:s,chainId:g});f=e.findToken,m=e.setDefaultAmount,f&&(n(f),void 0!==m&&(a(!1),i(m)))}if(!t){const{findToken:e,setDefaultAmount:t}=VA({side:"to",defaultToken:c,tokenList:s,occupyToken:f,chainId:g});e&&(r(e),void 0===m&&void 0!==t&&(a(!0),o(t)))}})()}),10);return()=>clearTimeout(f)}),[s,d,c,l,p,h,u,m])}!function(e){e.All="all"}(CA||(CA={})),function(e){e.Loading="Loading",e.Insufficient="ApprovalInsufficient",e.Approving="Approving",e.Sufficient="Sufficient",e.Unchecked="Unchecked"}(jA||(jA={})),function(e){e.Loading="Loading",e.Insufficient="BalanceInsufficient",e.Sufficient="Sufficient",e.Unchecked="Unchecked"}(TA||(TA={}));const HA=5,qA=e=>{const{defaultSlippage:t}=qv(void 0===e),n=yf((e=>e.slippage||t));return lt((()=>(void 0===e?Number(n):e)>HA),[n,e])};function ZA({fromToken:e,toToken:t,getAutoSlippage:n}){st((()=>{(()=>{Fn(this,void 0,void 0,(function*(){if(!n)return;const r=n({fromToken:e,toToken:t});if(void 0!==r&&"number"!=typeof r){var i;i=!0,yf.setState((e=>{var t,n;return{autoSlippage:{loading:i,value:null!==(n=null===(t=e.autoSlippage)||void 0===t?void 0:t.value)&&void 0!==n?n:null}}}));try{const e=yield r;bf({loading:!1,value:null!=e?e:null})}catch(e){console.error(e),bf({loading:!1,value:null})}}else bf({loading:!1,value:null})}))})()}),[e,t])}const zA=new fe({});function QA(){const{graphQLRequests:e}=pf();return null!=e?e:zA}function GA({fromToken:e,toToken:t}){var n,r,o,a;const{customSlippage:s,customSlippageNum:l,handleSlippageChange:d}=function({fromToken:e,toToken:t}){const{account:n}=At(),{customSwapPairSlippages:r}=eb(),i=at.useCallback((r=>{var i,o,a,s,l,d;const c=null!==(i=null==n?void 0:n.toLocaleLowerCase())&&void 0!==i?i:"",u=[r.from.toLocaleLowerCase(),r.to.toLocaleLowerCase()];return(null!==(a=null===(o=r.account)||void 0===o?void 0:o.toLocaleLowerCase())&&void 0!==a?a:"")===c&&r.chainId===(null==e?void 0:e.chainId)&&u.includes(null===(s=null==e?void 0:e.address)||void 0===s?void 0:s.toLocaleLowerCase())&&u.includes(null!==(d=null===(l=null==t?void 0:t.address)||void 0===l?void 0:l.toLocaleLowerCase())&&void 0!==d?d:"")}),[e,t,n]),o=e&&t?r.find(i):null,a=(null==o?void 0:o.disabled)?null:o,s=at.useCallback((r=>{eb.setState((o=>{var a,s,l;if(!e||!t)throw new Error("token is not valid.");const d=[...o.customSwapPairSlippages],c=Object.assign(Object.assign({},r),{account:null!==(a=null==n?void 0:n.toLowerCase())&&void 0!==a?a:"",from:e.address.toLowerCase(),to:t.address.toLowerCase(),fromSymbol:e.symbol,toSymbol:t.symbol,fromLogo:null!==(s=e.logoURI)&&void 0!==s?s:null,toLogo:null!==(l=t.logoURI)&&void 0!==l?l:null,chainId:e.chainId}),u=d.findIndex(i);return u>-1?d.splice(u,1,c):d.push(c),{customSwapPairSlippages:d}}))}),[n,e,t,i]),l=null==a?void 0:a.slippage;return{customSlippageNum:l?Number(l):0,customSlippage:l,handleSlippageChange:s}}({fromToken:e,toToken:t}),{defaultSlippage:c}=qv(!1),u=function({fromToken:e,toToken:t}){const n=QA().getQuery(se.graphql.fetchErc20ForecastSlippage,{where:{aToken:{address:null==e?void 0:e.address,chainId:null==e?void 0:e.chainId},bToken:{address:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}}}),r=It(Object.assign(Object.assign({},n),{enabled:!!e&&!!t})),i=at.useMemo((()=>{var e,t,n;if(!(null===(e=r.data)||void 0===e?void 0:e.erc20_extend_erc20ExtendV2))return{};const{erc20_extend_erc20ExtendV2:i}=r.data,o=(null===(t=i.forecastSlippageList)||void 0===t?void 0:t.length)?null===(n=[...i.forecastSlippageList])||void 0===n?void 0:n.map((e=>Object.assign(Object.assign({},e),{confidenceRatio:(null==e?void 0:e.confidenceRatio)?Number(e.confidenceRatio):0}))).sort(((e,t)=>(null==e?void 0:e.confidenceRatio)-(null==t?void 0:t.confidenceRatio))):[];return{recommendSlippage:o.length?o[o.length-1]:void 0,slippageList:o}}),[r.data]);return Object.assign({slippageData:i},r)}({fromToken:e,toToken:t}),p=null===(n=u.slippageData.recommendSlippage)||void 0===n?void 0:n.forecastSlippage,h=p?new i(p).times(100).toNumber():p;return{customSlippage:s,customSlippageNum:l,handleSlippageChange:d,forecastSlippage:h,forecastSlippageQuery:u,recommendSlippage:null!==(r=null!=h?h:c)&&void 0!==r?r:0,slippage:null!==(a=null!==(o=s?Number(s):void 0)&&void 0!==o?o:h)&&void 0!==a?a:c,slippageLoading:u.isLoading}}const YA="position-y-dot";function XA(){return Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:8},children:[Os.jsx(w,{width:"100%",height:12}),Os.jsx(w,{width:"100%",height:12})]})}function JA({data:e,loading:t}){var n,r;const i=g(),o=i.palette.primary.main,a=at.useRef(null),s=e.length;return Os.jsx(f,{sx:{height:105,flex:1,[`& .${YA}`]:{display:"none"}},ref:a,children:t?Os.jsx(XA,{}):Os.jsx(f,{component:Ht,sx:{typography:"h6","& .recharts-cartesian-axis text":{fill:i.palette.background.paperContrast}},children:Os.jsxs(qt,{data:e,margin:{top:0,right:0,left:0,bottom:0},children:[Os.jsx(Zt,{dataKey:"forecastSlippage",axisLine:!1,tickLine:!1,interval:"preserveStartEnd",tickFormatter:e=>Bn({input:e}),type:"number",domain:[s&&null!==(n=e[0].forecastSlippage)&&void 0!==n?n:0,s&&null!==(r=e[s-1].forecastSlippage)&&void 0!==r?r:"auto"]}),Os.jsx(zt,{dataKey:"confidenceRatio",axisLine:!1,tickLine:!1,hide:!0}),Os.jsx("defs",{children:Os.jsxs("linearGradient",{id:"count-linear",x1:"0",y1:"0",x2:"0",y2:"1",children:[Os.jsx("stop",{offset:"0",stopColor:o,stopOpacity:.3}),Os.jsx("stop",{offset:"100%",stopColor:o,stopOpacity:0})]})}),Os.jsx(Qt,{type:"monotone",dataKey:"confidenceRatio",stroke:o,strokeWidth:2,fill:"url(#count-linear)"}),e.map((e=>Os.jsx(Gt,{x:e.forecastSlippage,y:e.confidenceRatio,r:1,fill:i.palette.text.primary,stroke:"none",className:YA},e.confidenceRatio)))]})})})}var KA=at.memo(JA);const _A=W(V)((({theme:e})=>({height:2,padding:"15px 0",margin:0,"& .base-Slider-valueLabel":{fontSize:12,fontWeight:"normal",top:-6,backgroundColor:"unset",color:e.palette.text.primary,"&:before":{display:"none"},"& *":{background:"transparent",color:e.palette.text.primary}},"& .base-Slider-track":{display:"none"},"& .base-Slider-rail":{backgroundColor:e.palette.text.disabled,height:1,opacity:1},"& .base-Slider-mark":{display:"none",opacity:1,backgroundColor:e.palette.success.main,height:6,width:4,borderRadius:4},"& .base-Slider-markLabel":{display:"none",fontSize:"12px",lineHeight:"17px"}})));function $A(t){var{hidden:n,sx:r,value:i,color:o,min:a,max:s,formatValue:l,getSliderYPosition:d}=t,c=Nn(t,["hidden","sx","value","color","min","max","formatValue","getSliderYPosition"]);const{children:u}=c,p=Nn(c,["children"]),{isMobile:h}=U(),m=at.useRef(null),g=d(i),y=h?4:0,x=g?g-39-y:void 0,v=null!=o?o:"text.primary",b=i===a,A=i===s;return Os.jsxs(f,{...p,ref:m,sx:Object.assign({position:"absolute","&&&":{display:n?"none":"block",backgroundColor:"transparent",boxShadow:"none",bottom:8+y,width:"auto",height:"auto",top:"auto",marginLeft:0,transform:"none"}},r),children:[u,Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[x?Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{sx:{width:16,height:16,borderRadius:"50%",backgroundColor:v,borderStyle:"solid",borderWidth:2,borderColor:"background.paperContrast",flexShrink:1}}),Os.jsx(f,{sx:{height:x,width:"0",borderStyle:"dashed",borderWidth:1,borderColor:v}})]}):"",Os.jsx(f,{sx:{width:16,height:16,borderRadius:"50%",backgroundColor:v,borderStyle:"solid",borderWidth:2,borderColor:"background.paperContrast",flexShrink:1}}),Os.jsxs(f,{sx:Object.assign(Object.assign({typography:"h6",position:"absolute",bottom:-20,color:v,whiteSpace:"nowrap",backgroundColor:"background.paperContrast"},b?{left:0}:{}),A?{right:0}:{}),children:[A?Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{component:"span",sx:{color:"success.main"},children:Os.jsx(e,{id:"cOvZFM",message:"Dynamic"})}),Os.jsx("span",{children:" • "})]}):"",l(i)]})]})]})}function ew(e){var{hoverValue:t,formatValue:n,getSliderYPosition:r}=e,i=Nn(e,["hoverValue","formatValue","getSliderYPosition"]);const{isMobile:o}=U(),a=o?"primary.main":void 0,s=o?void 0:"primary.main";return Os.jsx(_A,{slots:{thumb:e=>{const l=i.value&&"number"==typeof i.value&&(i.min&&i.value<i.min||i.max&&i.value>i.max),d={value:i.value,min:i.min,max:i.max,hidden:!!l,color:a,formatValue:n,getSliderYPosition:r},c=Object.assign(Object.assign({},e),d);if(null!==t&&i.max&&i.min&&i.value!==t){const e=i.max-i.min,n=t-i.min,r=n?n/e*100:0;if(o){const e=!!t&&(!!i.min&&t<i.min||!!i.max&&t>i.max);return Os.jsxs(Os.Fragment,{children:[Os.jsx($A,{...d,value:t,color:s,hidden:e,sx:{left:r+"%"}}),Os.jsx($A,{...c})]})}return Os.jsxs(Os.Fragment,{children:[Os.jsx($A,{...c}),Os.jsx($A,{...d,value:t,hidden:!1,color:s,sx:{left:r+"%"}})]})}return Os.jsx($A,{...c})}},...i})}const tw=(e,{time:t=100,wrapper:n=document,retryCount:r=50}={})=>new Promise((i=>{n.querySelector(e)?i(!0):setTimeout((()=>Fn(void 0,void 0,void 0,(function*(){if(n.querySelector(e))i(!0);else if(r){const o=yield tw(e,{time:t,wrapper:n,retryCount:r-1});i(o)}else i(!1)}))),t)}));function nw({data:t,activeSlippage:n,loading:r,sx:o,handleChangeCustomSlippage:a}){const s=at.useMemo((()=>{var e;return null!==(e=null==t?void 0:t.length)&&void 0!==e?e:0}),[t]),{isMobile:l}=U(),[d,c]=at.useState([]),u=at.useRef(null);at.useEffect((()=>{(()=>{Fn(this,void 0,void 0,(function*(){var e;if(u.current&&s){const t=`.${YA}`;yield tw(t,{wrapper:u.current});const n=u.current.querySelectorAll(t),{y:r,height:i}=u.current.getBoundingClientRect(),o=null!==(e=null==n?void 0:n.length)&&void 0!==e?e:0,a=[];for(let e=0;e<o;e++){const t=n[e];const o=(t.children[0]?t.children[0].getBoundingClientRect().y:t.getBoundingClientRect().y)-r-.5;a.push(i-o)}c(a)}}))})()}),[s]);const p=(({activeSlippage:e,data:t,yPositions:n})=>{const[r,o]=at.useState(0),a=at.useMemo((()=>1e6),[]),[s,l]=at.useMemo((()=>{var e,n;const r=null==t?void 0:t.length;return r?[new i(null!==(e=t[0].forecastSlippage)&&void 0!==e?e:0).times(null!=a?a:0).dp(0,1).toNumber(),new i(null!==(n=t[r-1].forecastSlippage)&&void 0!==n?n:0).times(null!=a?a:0).dp(0,1).toNumber()]:[0,0]}),[t,a]),d=at.useCallback((e=>{if(void 0===e)return"";const n=new i(e);if((null==t?void 0:t.length)&&a){const e=t.find((e=>{var t;return new i(null!==(t=e.forecastSlippage)&&void 0!==t?t:0).times(a).dp(0,1).isEqualTo(n)}));if(null==e?void 0:e.forecastSlippage)return Bn({input:e.forecastSlippage,showDecimals:4})}return Bn({input:a?n.div(a):n,showDecimals:4})}),[a,t]),c=at.useCallback((e=>{let r=0;return e&&(null==t?void 0:t.length)&&a?(t.some(((o,s)=>{var l,d;const c=null!==(l=o.forecastSlippage)&&void 0!==l?l:0,u=new i(c).times(a).dp(0,1).toNumber();if(e===u)return r=n[s],!0;if(e<u){if(0===s)return r=0,!0;const o=c-(null!==(d=t[s-1].forecastSlippage)&&void 0!==d?d:0),l=n[s]-n[s-1],u=c-new i(e).div(a).toNumber();return r=n[s]-l/o*u,!0}})),r):r}),[n,t,a]),u=at.useCallback((e=>{o(e);const n=new i(e);let r,s=-1;if((null==t?void 0:t.length)&&a){s=t.findIndex((e=>{var t;return new i(null!==(t=e.forecastSlippage)&&void 0!==t?t:0).times(a).dp(0,1).isEqualTo(n)}));const e=-1!==s?t[s]:void 0;r=null==e?void 0:e.forecastSlippage}return r||(r=n.div(null!=a?a:0).toNumber()),r}),[t,a]);return at.useEffect((()=>{if(a&&e){const t=new i(e).times(a).dp(0,1);t.isEqualTo(r)||o(t.toNumber())}}),[e]),{min:s,max:l,value:r,decimalConversion:a,formatValue:d,getSliderYPosition:c,handleChangeValue:u}})({data:t,activeSlippage:n,yPositions:d}),{hoverValue:h,setHoverValue:m}=function(e,{slippageSlider:t}){const{isMobile:n}=U(),[r,o]=at.useState(null),a=at.useRef(!1);return at.useEffect((()=>{if(e.current&&t.max){const s=e.current;let{width:l,x:d}=s.getBoundingClientRect();const c=e=>{if(a.current)return;const n=e.pageX-d,s=t.max-t.min,c=new i(n/l*s).integerValue().plus(t.min).toNumber();c!==r&&o(c)},u=()=>{o(null)},p=()=>{a.current=!1},h=()=>{a.current=!0};return n||(s.addEventListener("mousemove",c),s.addEventListener("mouseleave",u),s.addEventListener("mouseup",p),s.addEventListener("mousedown",h)),()=>{n&&(s.removeEventListener("mousemove",c),s.removeEventListener("mouseleave",u),s.removeEventListener("mouseUp",p),s.removeEventListener("mouseDown",h))}}}),[e,n]),{hoverValue:r,setHoverValue:o}}(u,{slippageSlider:p}),{successRate:g,hoverSuccessRate:y}=function({data:e,activeSlippage:t,hoverValue:n,decimalConversion:r}){const o=at.useMemo((()=>{var n,r;let i="-";if(t&&(null==e?void 0:e.length)){const o=e.some(((n,r)=>{var o,a,s,l,d,c;const u=null!==(o=n.forecastSlippage)&&void 0!==o?o:0;if(t===u)return i=Bn({input:null!==(a=null==n?void 0:n.confidenceRatio)&&void 0!==a?a:0}),!0;if(t<u){if(0===r)i=`< ${Bn({input:null!==(s=null==n?void 0:n.confidenceRatio)&&void 0!==s?s:0})}`;else{const t=Bn({input:null!==(d=null===(l=e[r-1])||void 0===l?void 0:l.confidenceRatio)&&void 0!==d?d:0}),o=Bn({input:null!==(c=null==n?void 0:n.confidenceRatio)&&void 0!==c?c:0});i=`${t} - ${o}`}return!0}return!1}));o||(i=`> ${Bn({input:null!==(r=null===(n=e[e.length-1])||void 0===n?void 0:n.confidenceRatio)&&void 0!==r?r:0})}`)}return i}),[e,t]),a=at.useMemo((()=>{var t,o;let a="";if(n&&(null==e?void 0:e.length)&&r){const s=e.some(((t,o)=>{var s,l,d,c,u,p;const h=null!==(s=t.forecastSlippage)&&void 0!==s?s:0,m=new i(h).times(r).dp(0,1).toNumber();if(n===m)return a=Bn({input:null!==(l=null==t?void 0:t.confidenceRatio)&&void 0!==l?l:0}),!0;if(n<m){if(0===o)a=`< ${Bn({input:null!==(d=null==t?void 0:t.confidenceRatio)&&void 0!==d?d:0})}`;else{const n=Bn({input:null!==(u=null===(c=e[o-1])||void 0===c?void 0:c.confidenceRatio)&&void 0!==u?u:0}),r=Bn({input:null!==(p=null==t?void 0:t.confidenceRatio)&&void 0!==p?p:0});a=`${n} - ${r}`}return!0}return!1}));s||(a=`> ${Bn({input:null!==(o=null===(t=e[e.length-1])||void 0===t?void 0:t.confidenceRatio)&&void 0!==o?o:0})}`)}return a}),[n,r,e]);return{successRate:o,hoverSuccessRate:a}}({data:t,activeSlippage:n,hoverValue:h,decimalConversion:p.decimalConversion});return t?Os.jsxs(f,{sx:Object.assign({p:12,pb:28,borderRadius:12,backgroundColor:"background.paperContrast"},o),children:[Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{sx:{typography:"h6",fontWeight:600,color:"text.secondary"},children:Os.jsx(e,{id:"88dol0",message:"Success Rate"})}),Os.jsx(D,{loading:r,loadingProps:{width:100},sx:{mt:4,typography:"caption",color:y?"primary.main":"text.primary"},children:y||g})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"flex-end",pr:4},children:[Os.jsx(f,{sx:{pb:8,mr:16,typography:"h6",fontWeight:600},children:Os.jsx(e,{id:"CMHmbm",message:"Slippage"})}),Os.jsxs(f,{sx:{flex:1},ref:u,children:[Os.jsx(KA,{data:t,loading:r}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",color:"text.secondary"},children:!r&&s?Os.jsx(ew,{value:l?h||-1:p.value,min:p.min,max:p.max,disabled:!l,marks:[{value:p.max,label:p.max}],formatValue:p.formatValue,getSliderYPosition:p.getSliderYPosition,hoverValue:l?p.value:h,onChange:(e,t)=>{if("number"==typeof t){if(l)return void m(t);const e=p.handleChangeValue(t);a(e)}},onChangeCommitted:()=>{m(null)}}):""})]})]})]}):null}var rw,iw,ow=at.memo(nw);function aw({title:t,desc:n,doNotChecked:r,onChangeDoNotChecked:i}){const o=g();if(lt((()=>r),[]))return null;const a=o.palette.warning.main;return Os.jsxs(f,{sx:{backgroundColor:C(a,.1),borderRadius:8,padding:12},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,typography:"body2",color:a,fontWeight:700},children:[Os.jsx(As.Warn,{}),t]}),Os.jsx(f,{sx:{mt:8,typography:"body2",fontWeight:500,color:o.palette.text.secondary,textAlign:"center"},children:n}),!!i&&Os.jsxs(f,{sx:{width:"100%",mt:20,color:o.palette.text.secondary,typography:"h6",fontWeight:500,display:"flex",alignItems:"center",justifyContent:"center",gap:8,cursor:"pointer"},component:"label",children:[Os.jsx(S,{checked:r,size:16,onChange:e=>{const{checked:t}=e.target;i(t)}}),Os.jsx(e,{id:"3WdxUv",message:"Do not remind again"})]})]})}function sw({fromToken:t,toToken:n}){var o,a;const s=g(),{slippageAdvanced:l,notRemindAgainSlippageHigher:d,notRemindAgainSlippageLower:c}=eb(),{customSlippage:u,customSlippageNum:p,handleSlippageChange:h,forecastSlippage:m,forecastSlippageQuery:y,recommendSlippage:x}=GA({fromToken:t,toToken:n}),b=!!m,[w,k]=at.useState(!1),[j,T]=at.useState();!j&&t&&n&&T(u?rw.custom:rw.recommend);const E=j===rw.custom,I=at.useRef(null),R=at.useMemo((()=>j===rw.custom?p?new i(p).div(100).toNumber():void 0:new i(x).div(100).toNumber()),[j,x,p]),L=at.useCallback((e=>{E||T(rw.custom),h({slippage:new i(e).times(100).toString(),disabled:!1,deleted:!1,recommend:String(x)})}),[E,x,h]);return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{mt:24,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",fontWeight:600},children:[Os.jsx(e,{id:"x6GJ4a",message:"Max Slippage"}),Os.jsx(P,{title:Os.jsxs(Os.Fragment,{children:[Os.jsx(e,{id:"mFXnIs",message:"The dynamic slippage is provided by DODO team through analyzing historical transactions."}),Os.jsx("br",{}),Os.jsxs(f,{component:"a",href:r._({id:"zABfk1",message:"https://blog.dodoex.io/introducing-the-dodo-smart-slippage-3d32d13a4fef"}),target:"_blank",rel:"noopener noreferrer",sx:{color:"primary.main",textDecoration:"underline"},onClick:e=>{e.stopPropagation()},children:[Os.jsx(e,{id:"NgeSlx",message:"Learn More"}),">"]})]}),ml:7})]}),y.isLoading||(null===(o=y.slippageData.slippageList)||void 0===o?void 0:o.length)?Os.jsxs(D,{loading:y.isLoading,loadingProps:{width:100},component:"label",sx:{display:"flex",alignItems:"center",gap:8,typography:"body2",cursor:"pointer",color:"text.secondary"},children:[Os.jsx(e,{id:"sxkWRg",message:"Advanced"}),Os.jsx(S,{sx:{top:-1},size:16,checked:l,onChange:e=>{const{checked:t}=e.target;eb.setState({slippageAdvanced:t})}})]}):""]}),!!j&&Os.jsxs(H,{value:j,onChange:(e,t)=>{T(t),t===rw.custom&&k(!0)},children:[Os.jsxs(q,{variant:"inPaper",sx:{mt:16,'&:not(:hover) [aria-selected="true"] .weak':{color:C(s.palette.secondary.contrastText,.5)}},children:[Os.jsx(Z,{value:rw.recommend,variant:"inPaper",sx:{position:"relative"},children:Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{component:"span",sx:{position:"absolute",top:4,left:4,ml:4,typography:"h6",fontWeight:600,padding:s.spacing(0,8),borderRadius:4,backgroundColor:E?C(s.palette.purple.main,.1):"#FFF"},children:Os.jsx(f,{component:"span",sx:{background:E?`linear-gradient(90deg, ${s.palette.purple.main} -1.33%, ${"dark"===s.palette.mode?"#E6D9FF":"#BFAFF3"} 98.67%)`:`linear-gradient(90deg, ${s.palette.purple.main} -1.33%, #BFAFF3 98.67%)`,backgroundClip:"text",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:"New"})}),Os.jsxs(f,{sx:{textAlign:"center"},children:[b?Os.jsxs(f,{sx:{flexGrow:1,typography:"body2",fontWeight:600},children:[x.toString()||"-","%"]}):Os.jsx(A,{title:Os.jsx(e,{id:"wSpNR+",message:"This trading pair does not have enough historical data and has used the default dynamic slippage."}),sx:{ml:0,maxWidth:240},children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",typography:"body2",fontWeight:600,color:s.palette.warning.main,gap:4},children:[Os.jsx(f,{component:As.Alarm,sx:{position:"relative",top:-2,width:18,height:18}}),Os.jsxs("span",{children:[x.toString()||"-","%"]})]})}),Os.jsx(f,{sx:{typography:"h6",fontWeight:600},className:"weak",children:Os.jsx(e,{id:"cOvZFM",message:"Dynamic"})})]})]})}),Os.jsx(Z,{value:rw.custom,variant:"inPaper",sx:{position:"relative",p:0},children:Os.jsxs(f,{sx:{px:16,py:12,typography:"body2",fontWeight:600,textAlign:"center"},onClick:()=>{setTimeout((()=>{k(!0)}))},children:[w?Os.jsx(v,{ref:I,placeholder:"-",sx:{backgroundColor:"transparent",borderWidth:0,"& input":{textAlign:"center",typography:"body2",p:0,boxSizing:"border-box",height:19,color:E?s.palette.secondary.contrastText:s.palette.text.secondary,"&::placeholder":{color:"custom.input.placeholder",opacity:1}}},inputMode:"decimal",value:u||"",autoFocus:!0,onChange:e=>{const t=e.target.value;h({slippage:t,disabled:!1,recommend:String(x)})},onBlur:()=>{setTimeout((()=>{if(k(!1),!p)return void T(rw.recommend);const e=!p||p<0;e&&u&&h({slippage:u,disabled:e,deleted:e,recommend:String(x)})}),10)},onKeyDown:e=>{var t;"Enter"===e.code&&(e.preventDefault(),null===(t=I.current)||void 0===t||t.blur())}}):Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,color:u&&E?s.palette.warning.main:void 0},children:[u&&Os.jsx(f,{component:As.Alarm,sx:{position:"relative",top:-2,width:18,height:18}}),u||"-","%"]}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",typography:"h6",fontWeight:600},className:"weak",children:Os.jsx(e,{id:"8Tg/JR",message:"Custom"})})]})})]}),Os.jsx(z,{value:rw.recommend,children:(null===(a=y.slippageData.slippageList)||void 0===a?void 0:a.length)&&l?Os.jsx(ow,{data:y.slippageData.slippageList,activeSlippage:R,loading:y.isLoading,handleChangeCustomSlippage:L,sx:{mt:8}}):""}),Os.jsxs(z,{value:rw.custom,children:[Os.jsx(f,{sx:{mt:8}}),p>x&&Os.jsx(aw,{title:r._({id:"8XNsbx",message:"Higher than dynamic slippage"}),desc:r._({id:"iLj1a9",message:"Dynamic slippage is {recommendSlippage}%,the current slippage setting is higher than the dynamic slippage, which means you are willing to accept a worse final execution price.",values:{recommendSlippage:x}}),doNotChecked:d,onChangeDoNotChecked:e=>eb.setState({notRemindAgainSlippageHigher:e})}),!!p&&p<x&&Os.jsx(aw,{title:r._({id:"TTlkRL",message:"Lower than dynamic slippage"}),desc:r._({id:"yq+Q9s",message:"Dynamic slippage is {recommendSlippage}% , the current slippage setting may increase the failure rate of transactions.",values:{recommendSlippage:x}}),doNotChecked:c,onChangeDoNotChecked:e=>eb.setState({notRemindAgainSlippageLower:e})})]})]})]})}function lw({checked:t,onChange:n,sx:r,disabled:i}){const o=g();let a=o.palette.background.paper;return t&&(a=o.palette.secondary.main),Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",position:"relative",borderRadius:8,backgroundColor:o.palette.background.input,opacity:i?.5:1},r),component:y,disabled:i,onClick:()=>{i||n(!t)},children:[Os.jsx(f,{sx:{typography:"body2",fontWeight:600,pl:12,pr:13,pt:8,pb:9,width:"50%",zIndex:1,color:o.palette.text.primary,whiteSpace:"nowrap"},children:Os.jsx(e,{id:"az8lvo",message:"Off"})}),Os.jsx(f,{sx:{typography:"body2",fontWeight:600,pl:12,pr:13,pt:8,pb:9,width:"50%",zIndex:1,color:t?o.palette.secondary.contrastText:o.palette.text.primary,whiteSpace:"nowrap"},children:Os.jsx(e,{id:"Z5HWHd",message:"On"})}),Os.jsx(f,{sx:{borderRadius:6,backgroundColor:a,zIndex:0,position:"absolute",top:2,bottom:2,width:"calc(50% - 2px - 2px)",left:t?"calc(50% + 2px)":"2px",transition:"left 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, transform 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"}})]})}function dw({show:t,onClick:n}){const r=g();return Os.jsxs(I,{weak:!0,sx:{display:t?"flex":"none",alignItems:"center",position:"absolute",bottom:28,left:"50%",transform:"translateX(-50%)",p:r.spacing(8,20),fontWeight:600,borderRadius:20,border:`solid 1px ${r.palette.border.main}`,backgroundColor:"background.paperContrast",boxShadow:`0px 8px 16px 0px ${C("light"===r.palette.mode?"#FFF":"#000",.1)}`,cursor:"pointer",whiteSpace:"nowrap",gap:4},onClick:n,children:[Os.jsx(e,{id:"F8yRdq",message:"More trade settings"}),Os.jsx(f,{component:"svg",width:25,height:24,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",sx:{color:"text.secondary"},children:Os.jsx("path",{d:"M12.5 19L6.5 13L7.9 11.6L12.5 16.175L17.1 11.6L18.5 13L12.5 19ZM12.5 13L6.5 6.99998L7.9 5.59998L12.5 10.175L17.1 5.59998L18.5 6.99998L12.5 13Z",fill:"currentColor"})})]})}function cw({open:t,onClose:n,fromToken:r,toToken:i}){const o=g(),{ddl:a,expertMode:s,disableIndirectRouting:l}=eb(),c=at.useRef(null),[u,p]=at.useState(!1);return at.useEffect((()=>{const e=c.current,t=new ResizeObserver((()=>{e&&p(e.scrollHeight!==e.offsetHeight)})),n=d((()=>{if(!e)return;const t=e.scrollTop+e.clientHeight<e.scrollHeight-2;p(t)}),50);return e&&(p(e.scrollHeight!==e.clientHeight),t.observe(e),e.addEventListener("scroll",n)),()=>{e&&(t.unobserve(e),e.removeEventListener("scroll",n))}}),[null==c?void 0:c.current]),Os.jsx(yy,{open:t,onClose:n,id:"swap-settings",title:Os.jsx(e,{id:"Tz0i8g",message:"Settings"}),children:Os.jsxs(f,{sx:{px:20,pb:34,overflowY:"auto"},ref:c,children:[Os.jsx(sw,{fromToken:r,toToken:i}),Os.jsxs(f,{sx:{mt:24,pt:14,borderTop:`solid 1px ${o.palette.border.main}`},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",fontWeight:600},children:[Os.jsx(e,{id:"zSMRJ/",message:"Transaction Deadline"}),Os.jsx(Ov,{title:Os.jsx(e,{id:"wmCrk7",message:"You may modify the transaction deadline, the maximum time allowed for a trade to be processed on-chain. However, please note that this may lead to your trade executing at a subpar price, as the market price may change during that time."}),ml:7})]}),Os.jsxs(f,{sx:{mt:16,display:"flex",alignItems:"center",gap:8,typography:"body2"},children:[Os.jsx(v,{sx:{width:80,height:34,lineHeight:1,typography:"body2","& input":{px:16,py:6}},placeholder:String(Fv),value:a,onChange:e=>{eb.setState({ddl:e.target.value})}}),Os.jsx(e,{id:"H9HlDe",message:"minutes"})]})]}),Os.jsx(f,{sx:{display:"flex",flexDirection:"column",gap:12,mt:24,pt:14,borderTop:`solid 1px ${o.palette.border.main}`},children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsxs(f,{sx:{fontWeight:600},children:[Os.jsx(e,{id:"MXQodB",message:"Disable Indirect Routing"}),Os.jsx(Ov,{title:Os.jsx(e,{id:"Y0Knz4",message:"Checking this option means that the routing algorithm will only route to liquidity pools between the two tokens in the trading pair and will ignore routes with any intermediary tokens."}),ml:7})]}),Os.jsx(lw,{checked:l,onChange:e=>{eb.setState({disableIndirectRouting:e})}})]})}),Os.jsx(dw,{show:u,onClick:()=>{var e,t;null===(e=c.current)||void 0===e||e.scrollTo({top:null===(t=c.current)||void 0===t?void 0:t.scrollHeight,behavior:"smooth"})}})]})})}function uw({getAutoSlippage:t,onPayTokenChange:n,onReceiveTokenChange:o,disabledFiatPrice:a,border:s,powered:l}={}){var d,u,p;const h=g(),{isInflight:m}=Vy(),{chainId:v,account:b}=At(),{defaultChainId:w,noPowerBy:k,onlyChainId:C}=pf(),[j,E]=ct(!1),S=lt((()=>{var e;return null===(e=ue[null!=v?v:w])||void 0===e?void 0:e.address}),[v]),[I,R]=ct(""),[L,M]=ct(""),[O,B]=ct(""),[P,D]=ct(""),N=lt((()=>c((e=>B(e)),300)),[]),F=lt((()=>c((e=>D(e)),300)),[]),[W,V]=ct(null),[U,H]=ct(null),[q,Z]=ct(!1),[z,Q]=ct(!1),G=lt((()=>{if(W&&U)return!(!(null==W?void 0:W.chainId)||!(null==U?void 0:U.chainId)||W.chainId===U.chainId)}),[W,U]),{toFiatPrice:Y,fromFiatPrice:X}=Yv(a?{toToken:null,fromToken:null}:{toToken:U,fromToken:W}),{marginAmount:J}=function({token:e,fiatPrice:t}){return{marginAmount:lt((()=>{var n;const r=null!==(n=null==e?void 0:e.decimals)&&void 0!==n?n:6,o=null!=t?new i(500).div(t):new i(0),a=jn(o,r);return(a.lt(new i(1).times(new i(10).pow(r-3)))?new i(0):a).toString(10)}),[null==e?void 0:e.decimals,t])}}({token:j?U:W,fiatPrice:j?Y:X});ZA({fromToken:W,toToken:U,getAutoSlippage:t});const{slippage:K,slippageLoading:_}=GA({fromToken:W,toToken:U}),$=function(e){const{account:t,chainId:n}=hf(),{latestBlockNumber:r}=yf(),i=ue[null!=e?e:n],o=$a.getFetchTokenQuery(e,null==i?void 0:i.address,t);return It(Object.assign(Object.assign({},o),{queryKey:[...o.queryKey,r]}))}(null==W?void 0:W.chainId),{bridgeRouteList:ee,status:te}=function({toToken:e,fromToken:t,fromAmount:n}){const{account:r,provider:o}=At(),{defaultSlippage:a,loading:s}=qv(!0),l=yf((e=>e.slippage||a)),{apikey:d}=pf(),[c,u]=ct(nb.Initial),[p,h]=ct([]),m=Gv(Ha.bridgeRoutePrice),f=ut((()=>Fn(this,void 0,void 0,(function*(){var a;const c=null==t?void 0:t.chainId,p=null==e?void 0:e.chainId;if(!(c&&p&&c!==p&&t&&e&&n))return void u(nb.Initial);if(u(nb.Loading),s)return;const f=t.address,g=e.address,y=r||Xv,x=r||Xv,v=Number(l)/100,b={fromAddress:y,fromAmount:re(String(n||1),t.decimals).toString(),fromChainId:c,fromTokenAddress:f,toAddress:x,toChainId:p,toTokenAddress:g,options:{slippage:v},products:["lifi","hyphen","nabox","bungee","swft","stargate","connext","squid","across","layerswap","okx","symbiosis","scroll","manta","orbiter","dodo"]};try{const s=Date.now(),l=(yield Ut.post(`${m}${d?`?apikey=${d}`:""}`,{data:b})).data.data,f=[];if((null===(a=null==l?void 0:l.routes)||void 0===a?void 0:a.length)&&l.routes.forEach(((r,o)=>{if(r){const{toAmount:a,feeUSD:l,executionDuration:d,product:u,step:h,fee:m,encodeParams:g,productParams:b}=r;if(h&&null!==a){const r=new i(a);if(!r.isNaN()&&r.gt(0)){const{tool:A,toolDetails:w,type:k,includedSteps:C,approvalAddress:j}=h;if(C&&C.length>0&&A&&w&&w.name&&w.logoURI&&k&&j){const h=[];if(C.forEach((e=>{e&&e.id&&e.type&&e.tool&&e.toolDetails&&e.toolDetails.name&&e.toolDetails.logoURI&&e.estimate&&e.estimate.fromAmount&&e.estimate.fromToken&&e.estimate.fromToken.decimals&&e.estimate.toAmount&&e.estimate.toToken&&e.estimate.toToken.decimals&&h.push({id:e.id,tool:e.tool,toolDetails:{name:e.toolDetails.name,logoURI:e.toolDetails.logoURI},type:e.type,estimate:{fromToken:e.estimate.fromToken,toToken:e.estimate.toToken,fromTokenAmount:new i(e.estimate.fromAmount).div(`1e${e.estimate.fromToken.decimals}`),toTokenAmount:new i(e.estimate.toAmount).div(`1e${e.estimate.toToken.decimals}`)}})})),h.length>0){const i={key:`${u}-${a}-${l}-${o}`,id:u,fromChainId:c,toChainId:p,fromToken:t,toToken:e,fromAmount:n,toTokenAmount:r.div(`1e${e.decimals}`),fromAddress:y,toAddress:x,product:u,slippage:v,roundedRouteCostTime:(Date.now()-s)/1e3,spenderContractAddress:null!=j?j:"0x",feeUSD:l,executionDuration:d,step:{tool:A,toolDetails:{name:w.name,logoURI:w.logoURI},type:k,includedSteps:h},encodeParams:g,productParams:b,sourceRoute:{toAmount:a,feeUSD:l,executionDuration:d,step:{tool:A,toolDetails:w,type:k,approvalAddress:j,includedSteps:C},fee:m}};f.push(i)}}}}}})),h(f),f.length?u(nb.Success):u(nb.Failed),!r||!o)return}catch(e){u(nb.Failed),console.error(e)}}))),[r,e,l,t,o,n,d,m,s]);return Qv({refetch:f}),{status:c,refetch:f,bridgeRouteList:lt((()=>n?p:[]),[c,n,p])}}({toToken:U,fromToken:W,fromAmount:O}),[ne,ie]=ct(!1),[ae,se]=ct(""),le=lt((()=>!ae&&ee.length?ee[0].id:ae),[ae,ee]),de=lt((()=>ee.find((e=>e.id===le&&e.fromAddress===b))),[ee,le,b]);st((()=>{!de&&ae&&se("")}),[de]);const{isApproving:ce,isGetApproveLoading:pe,needApprove:he,insufficientBalance:me,submitApprove:fe,getMaxBalance:ge}=EA(W,{amount:O,contractAddress:null==de?void 0:de.spenderContractAddress}),ye=ut((()=>{Ne(ge())}),[ge]),xe=lt((()=>!(!b||me||ce||pe||he)),[b,me,ce,pe,he]),{status:ve,rawBrief:be,executeSwap:Ae,reset:we}=ob({toToken:U,fromToken:W,marginAmount:J,fromAmount:O,toAmount:P,estimateGas:xe,isReverseRouting:j,slippage:K,slippageLoading:_}),{resAmount:ke,priceImpact:Ce,baseFeeAmount:je,additionalFeeAmount:Te,resPricePerToToken:Ee,resPricePerFromToken:Se}=lt((()=>be||{resAmount:null,priceImpact:null,baseFeeAmount:null,additionalFeeAmount:null,resPricePerToToken:null,resPricePerFromToken:null}),[be]),{sendRouteLoading:Ie,sendRouteError:Re,setSendRouteError:Le,bridgeOrderTxRequest:Me,handleClickSend:Oe}=function(){const{provider:e}=At(),[t,n]=ct(),[i,o]=ct(!1),[a,s]=ct(""),{apikey:l}=pf(),d=Gv(Ha.bridgeEncode),c=ut((t=>Fn(this,[t],void 0,(function*({selectedRoute:t,fromEtherTokenBalance:i,goNext:a}){var c,u;if(!t||!e||!i)return;const{encodeParams:p}=t;if(p){if(p.fromAddress===Xv)throw new Error("fromAddress is not valid.");s(""),o(!0);try{const{fromToken:h,fromAmount:m,product:f}=t,g={product:f,encodeParams:p},y=(yield Ut.post(`${d}${l?`?apikey=${l}`:""}`,{data:g})).data.data,{data:x,to:v,value:b,from:A,chainId:w,encodeId:k}=y;if(!(x&&v&&b&&A&&w))throw new Error("cross_chain_swap_transactionEncode is null");const C=ue[w],j=Tn(b,18),T=C&&h.address.toLowerCase()===C.address.toLowerCase(),E=j.minus(T?m:0);if(!j.isNaN()&&j.gt(0)&&i.lt(j))return s(r._({id:"F9xwHA",message:"Insufficient cross-chain fees, need at least {0} {1}",values:{0:An({input:E,decimals:null!==(c=null==C?void 0:C.decimals)&&void 0!==c?c:18}),1:null!==(u=null==C?void 0:C.symbol)&&void 0!==u?u:"-"}})),void o(!1);if(!(yield Ly({from:A,to:v,value:b,data:x},e)))throw new Error("failed to estimate gas");n({data:x,to:v,value:b,from:A,chainId:w,encodeId:k}),a()}catch(e){console.error("[failed to construct transaction request]: ",e);const{message:t}=e;s(t)}o(!1)}}))),[n,o,e,d]);return{apikey:l,sendRouteLoading:i,sendRouteError:a,setSendRouteError:s,bridgeOrderTxRequest:t,handleClickSend:c}}(),[Be,Pe]=ct(!1),De=WA(G),Ne=ut((e=>{const t=e.toString();R(t),N(t),we()}),[R,N,we]),Fe=ut((e=>{const t=e.toString();M(t),F(t),we()}),[M,F,we]),We=ut((e=>V((t=>{var r;const i="function"==typeof e?e(t):e;return v||yf.setState({fromTokenChainId:null!==(r=null==i?void 0:i.chainId)&&void 0!==r?r:void 0}),n&&i&&i!==t&&n(i),i}))),[n,v]),Ve=ut((e=>H((t=>{const n="function"==typeof e?e(t):e;return o&&n&&n!==t&&o(n),n}))),[o]);UA({fromToken:W,toToken:U,setFromToken:We,setToToken:Ve,updateFromAmt:Ne,updateToAmt:Fe,setIsReverseRouting:E});const Ue=ut((()=>{Ne(""),Fe(""),We(U),Ve(W),ax("from",U),ax("to",W),se("")}),[We,U,Ve,W,Ne,Fe,se]),He=ut(((e,t)=>{if(t)return Ue();Ne(""),Fe(""),We(e),se(""),ax("from",e)}),[Ue,Ne,Fe,We,se,ax]),qe=ut(((e,t)=>{if(t)return Ue();Ne(""),Fe(""),Ve(e),se(""),ax("to",e)}),[Ue,Ne,Fe,We,se,ax]),Ze=ut((()=>{j&&Ne(""),E(!1)}),[j,Ne]),ze=ut((()=>{j||Fe(""),E(!0)}),[j,Fe]),Qe=qA(G?void 0:K),Ge=lt((()=>(100*Number(Ce)).toFixed(2)),[Ce]),Ye=lt((()=>{const e=j?ke:O;return e&&X?new i(X).multipliedBy(e):null}),[X,O,j,ke]),Xe=lt((()=>{var e;if(!Y||void 0===G)return null;if(G)return(null===(e=null==de?void 0:de.toTokenAmount)||void 0===e?void 0:e.gt(0))?de.toTokenAmount.multipliedBy(Y):null;const t=j?P:ke;return t?new i(Y).multipliedBy(t):null}),[Y,P,j,ke,de,G]),Je=lt((()=>Os.jsxs(f,{sx:{display:"flex",fontWeight:600,typography:"body2",alignItems:"center",justifyContent:"center"},children:[Os.jsx(Ov,{title:Os.jsx(e,{id:"4kY4C4",message:"Due to the market condition, market price and estimated price may have a slight difference"}),mr:8}),Os.jsxs(f,{sx:{display:"flex"},children:[Os.jsx(e,{id:"6+mYrD",message:"Current price impact"}),Os.jsxs(f,{sx:{color:h.palette.error.main,ml:4},children:[Ge,"%"]})]})]})),[Ge,h.palette.error.main]),Ke=lt((()=>Os.jsx(ab,{toToken:U,fromToken:W,priceStatus:ve,pricePerToToken:Ee,pricePerFromToken:Se})),[U,W,ve,Ee,Se]),_e=lt((()=>!oe[v||1]),[v]),$e=lt((()=>!!v&&!!(null==W?void 0:W.chainId)&&(null==W?void 0:W.chainId)!==v),[v,null==W?void 0:W.chainId]),et=function({fromToken:e,toToken:t}){const n=Jc(Kc);return lt((()=>!(!e||n.some((t=>t.chainId===e.chainId&&t.address===e.address&&(!t.side||"to"===t.side))))||!(!t||n.some((e=>e.chainId===t.chainId&&e.address===t.address&&(!e.side||"from"===e.side))))),[e,t,n])}({fromToken:W,toToken:U}),tt=lt((()=>Qe&&new i(j?P:O).gt(0)&&!me&&(G?te===tb.Success:ve===tb.Success)?Os.jsxs(f,{sx:{textAlign:"center",mb:8},children:[Os.jsx(f,{component:As.Warn,sx:{position:"relative",top:2,mr:6,width:16,height:16,color:"warning.main"}}),r._({id:"//95jS",message:"The current slippage protection coefficient set exceeds {maxSlippageWarning}%, which may result in losses.",values:{maxSlippageWarning:HA}})]}):null),[Qe,j,O,P,G,te,ve]),nt=lt((()=>$e?Os.jsxs(f,{sx:{textAlign:"center"},children:[Os.jsx(f,{component:As.Warn,sx:{position:"relative",top:2,mr:6,width:16,height:16,color:"warning.main"}}),Os.jsx(e,{id:"54ffaC",message:"The current network is inconsistent with the wallet - please switch in wallet"})]}):ve===tb.Loading||G&&te===tb.Loading?Os.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:Os.jsxs(Os.Fragment,{children:[Os.jsx(x,{sx:{mr:5}}),Os.jsx(e,{id:"JdNn1Y",message:"Fetching best price..."})]})}):_e?Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{component:As.Warn,sx:{mr:6,width:16,color:"warning.main"}}),Os.jsx(e,{id:"udsWDJ",message:"Unsupported network - switch to trade"})]}):!G&&I&&new i(Ge).gt(Pv)?Je:G&&ee.length?Os.jsxs(Os.Fragment,{children:[tt,Os.jsx(RA,{route:de,onClick:()=>ie(!0)})]}):G&&(te===tb.Success&&!ee.length||te===tb.Failed)&&I?Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{component:As.Warn,sx:{width:15,mr:5,color:"warning.main"}}),Os.jsx(e,{id:"NVAuTg",message:"Quote not available"})]}):Os.jsxs(Os.Fragment,{children:[tt,Ke]})),[ve,Ke,I,Je,Ge,_e,G,te,ee,de,$e,tt]),rt=lt((()=>j?new i(L).gt(0)?An({input:ke,decimals:null==W?void 0:W.decimals}):"-":I),[I,L,ke,W,j]),it=lt((()=>{var e;return j?L:G?(null===(e=null==de?void 0:de.toTokenAmount)||void 0===e?void 0:e.gt(0))&&te!==tb.Loading?An({input:de.toTokenAmount,decimals:null==U?void 0:U.decimals}):"-":new i(I).gt(0)?An({input:ke,decimals:null==U?void 0:U.decimals}):"-"}),[I,L,ke,U,j,de,G,te]),ot=lt((()=>{if(!b||(null==W?void 0:W.chainId)&&v!==W.chainId)return Os.jsx(lb,{needSwitchChain:null==W?void 0:W.chainId,border:s});if(m)return Os.jsx(T,{fullWidth:!0,isLoading:!0,disabled:!0,children:Os.jsx(e,{id:"FRBvjQ",message:"Transaction Pending"})});if(!W||!U)return Os.jsx(T,{fullWidth:!0,disabled:!0,"data-testid":ny,children:Os.jsx(e,{id:"KlvBGJ",message:"Select Tokens"})});if(he)return Os.jsx(T,{fullWidth:!0,disabled:ce,onClick:()=>fe(),children:ce?Os.jsx(e,{id:"j2Uisd",message:"Approving"}):Os.jsx(e,{id:"Z7ZXbT",message:"Approve"})});if(!new i(j?P:O).gt(0))return Os.jsx(T,{fullWidth:!0,disabled:!0,"data-testid":oy,children:Os.jsx(e,{id:"iPMIoT",message:"Enter an amount"})});if(G?te===tb.Loading||pe:ve===tb.Loading)return Os.jsx(T,{fullWidth:!0,disabled:!0,"data-testid":ay,children:Os.jsx(e,{id:"OauUE6",message:"Fetching Price..."})});let t=!1;return t=G?!ee.length||te===tb.Failed:!ke||ve===tb.Failed,t?Os.jsx(T,{fullWidth:!0,disabled:!0,children:Os.jsx(e,{id:"NVAuTg",message:"Quote not available"})}):me?Os.jsx(T,{fullWidth:!0,disabled:!0,"data-testid":sy,children:Os.jsx(e,{id:"znqB4T",message:"Insufficient balance"})}):G?Os.jsx(T,{fullWidth:!0,onClick:()=>{var e,t;return Oe({selectedRoute:de,fromEtherTokenBalance:null!==(t=null===(e=$.data)||void 0===e?void 0:e.balance)&&void 0!==t?t:null,goNext:()=>Pe(!0)})},"data-testid":ry,disabled:!de,isLoading:Ie,sx:s&&de?{borderWidth:3,borderStyle:"solid",borderColor:"text.primary"}:void 0,children:Os.jsx(e,{id:"SXnevP",message:"Review Cross Chain"})}):Os.jsx(T,{fullWidth:!0,onClick:()=>Z(!0),"data-testid":ry,sx:s?{borderWidth:3,borderStyle:"solid",borderColor:"text.primary"}:void 0,children:Os.jsx(e,{id:"K/Ay/d",message:"Review Swap"})})}),[b,P,O,U,ke,W,m,Ae,fe,ve,S,j,G,te,ee,Ie,null===(d=$.data)||void 0===d?void 0:d.balance,me,ce,pe,he,s]),at=lt((()=>W&&U?Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(ey,{token:W,width:16,height:16,marginRight:6,chainId:W.chainId,noShowChain:!!C}),`${An({input:j?ke:O,decimals:null==W?void 0:W.decimals})} ${null==W?void 0:W.symbol}`,Os.jsx(f,{component:As.DoubleRight,sx:{width:12,height:12,mx:16}}),Os.jsx(ey,{token:U,width:16,height:16,marginRight:6,chainId:U.chainId,noShowChain:!!C}),`${An({input:j?P:ke,decimals:null==U?void 0:U.decimals})} ${null==U?void 0:U.symbol}`]}):Os.jsx(f,{})),[W,U,O,P,ke,j,C]);return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",typography:"caption",margin:20},children:[Os.jsx(e,{id:"vH2C/2",message:"Swap"}),Os.jsx(A,{open:De,title:G?Os.jsx(e,{id:"qLkska",message:"The setting has been switched to cross chain mode"}):Os.jsx(e,{id:"NSCBTb",message:"The setting has been switched to swap mode"}),placement:"bottom-end",children:Os.jsx(f,{component:y,children:Os.jsx(f,{component:G?As.SettingCrossChain:As.Setting,onClick:()=>Q(!0),sx:{width:19,height:19,color:"text.primary",cursor:"pointer"}})})})]}),Os.jsxs(f,{sx:{flex:1,padding:"0 16px 12px",overflowY:"auto"},children:[Os.jsxs(f,{children:[Os.jsx(Qy,{sx:Object.assign({mb:4},s?{borderWidth:3,borderColor:"text.primary"}:{}),token:W,side:"from",amt:rt,defaultLoadBalance:!0,onMaxClick:ye,onInputChange:Ne,onInputFocus:Ze,showMaxBtn:!j&&!I,occupiedAddrs:[null!==(u=null==U?void 0:U.address)&&void 0!==u?u:""],occupiedChainId:null==U?void 0:U.chainId,fiatPriceTxt:a?void 0:Ye?`$${bn({input:Ye,showDecimals:1})}`:"-",onTokenChange:He,readOnly:j,showChainLogo:!C,showChainName:!C,notTokenPickerModal:!0}),Os.jsx(Bv,{onClick:Ue,disabled:et,border:s}),Os.jsx(Qy,{token:U,side:"to",sx:Object.assign({},s?{borderWidth:3,borderColor:"text.primary"}:{}),amt:it,onInputChange:Fe,onInputFocus:ze,occupiedAddrs:[null!==(p=null==W?void 0:W.address)&&void 0!==p?p:""],occupiedChainId:null==W?void 0:W.chainId,fiatPriceTxt:a?void 0:Xe?`$${bn({input:Xe,showDecimals:1})}(${Ge}%)`:"-",onTokenChange:qe,readOnly:G||!j,showChainLogo:!C,showChainName:!C,notTokenPickerModal:!0}),Os.jsx(f,{sx:{py:12,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexWrap:"wrap"},children:nt})]}),ot,l,k||l?"":Os.jsxs(f,{sx:{mt:13,display:"flex",typography:"h6",cursor:"pointer",justifyContent:"center",alignItems:"center",color:h.palette.text.disabled},onClick:()=>window.open(Za),children:[Os.jsx(f,{sx:{width:18,height:18,transform:"translate(1px, 2px)","& path":{fill:h.palette.text.disabled}},component:As.Dodo}),Os.jsx(e,{id:"7X+IbB",message:"Powered by DODO protocol"})]})]}),Os.jsx(Uv,{toToken:U,fromToken:W,fromAmount:j?ke:O,toAmount:j?P:ke,open:q,baseFeeAmount:je,priceImpact:Ge,additionalFeeAmount:Te,curToFiatPrice:Xe,execute:()=>Ae(at),clearFromAmt:()=>Ne(""),clearToAmt:()=>Fe(""),curFromFiatPrice:Ye,pricePerFromToken:Se,onClose:()=>Z(!1),loading:ve===tb.Loading,disabledFiatPrice:a,slippage:K}),G?Os.jsx(Zv,{open:z,onClose:()=>Q(!1),isBridge:!0}):Os.jsx(cw,{open:z,onClose:()=>Q(!1),fromToken:W,toToken:U}),Os.jsx(IA,{open:ne,onClose:()=>ie(!1),selectedRouteId:le,setSelectRouteId:se,bridgeRouteList:ee}),Os.jsx(NA,{open:Be,onClose:()=>Pe(!1),route:de,bridgeOrderTxRequest:Me,clearFromAmt:()=>Ne(""),clearToAmt:()=>Fe("")}),Os.jsx(FA,{message:Re,onClose:()=>Le("")})]})}!function(e){e.recommend="recommend",e.custom="custom"}(rw||(rw={}));var pw,hw=Pt;if("production"===process.env.NODE_ENV)iw=hw.createRoot,hw.hydrateRoot;else{var mw=hw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;iw=function(e,t){mw.usingClientEntryPoint=!0;try{return hw.createRoot(e,t)}finally{mw.usingClientEntryPoint=!1}}}!function(e){e.Pool="pool",e.PoolDetail="poolDetail",e.CreatePool="createPool",e.ModifyPool="modifyPool",e.MiningList="miningList",e.MiningDetail="miningDetail",e.createPoolAMMV2="createPoolAMMV2",e.createPoolAMMV3="createPoolAMMV3",e.createPoolAlgebra="createPoolAlgebra"}(pw||(pw={}));const fw=bt(((e,t)=>({page:void 0,historyList:[],push:t=>{e((e=>{var n;const r=[...e.historyList,null!==(n=e.page)&&void 0!==n?n:{type:pw.Pool}];return{page:t,historyList:r}}))},back:()=>{e((e=>{const t=e.historyList.length;if(!t)return"undefined"!=typeof window&&window.history&&history.back(),e;const n=[...e.historyList];return{page:n.splice(t-1,1)[0],historyList:n}}))}})));function gw({title:t,desc:n,linkTo:r,LeftImage:i,sx:o}){const a=g(),s="light"===a.palette.mode;return Os.jsxs(f,{sx:Object.assign({backgroundColor:a.palette.background.paper,borderRadius:16,padding:20},o),children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start"},children:[Os.jsx(f,{sx:{backgroundColor:C(a.palette.secondary.main,.3),color:s?"#EB8D27":a.palette.secondary.main,borderRadius:6,width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:Os.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.55558 0.888672C3.87558 0.888672 0.888916 3.87534 0.888916 7.55534C0.888916 11.2353 3.87558 14.222 7.55558 14.222C11.2356 14.222 14.2222 11.2353 14.2222 7.55534C14.2222 3.87534 11.2356 0.888672 7.55558 0.888672ZM8.22225 11.5553V10.222H6.88892V11.5553H8.22225ZM4.88892 6.22201C4.88892 4.74867 6.08225 3.55534 7.55558 3.55534C9.02892 3.55534 10.2222 4.74867 10.2222 6.22201C10.2222 7.07728 9.69557 7.53755 9.18276 7.9857C8.69626 8.41085 8.22225 8.82509 8.22225 9.55534H6.88892C6.88892 8.34116 7.51699 7.85973 8.06921 7.43646C8.50241 7.10441 8.88892 6.80815 8.88892 6.22201C8.88892 5.48867 8.28892 4.88867 7.55558 4.88867C6.82225 4.88867 6.22225 5.48867 6.22225 6.22201H4.88892Z",fill:"currentColor"})})}),Os.jsx(f,{sx:{color:a.palette.text.primary,typography:"body1",fontWeight:600,ml:4},children:Os.jsx(e,{id:"cmUrtC",message:"SEE HOW IT WORKS"})})]}),Os.jsxs(f,{sx:{mt:20,borderTopWidth:1,pt:20,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(f,{component:i,sx:{width:64,height:64,flexShrink:0}}),Os.jsxs(f,{sx:{ml:16,color:a.palette.text.primary,typography:"body1",fontWeight:600},children:[t,Os.jsx(f,{sx:{mt:4,color:a.palette.text.secondary,typography:"body2",fontWeight:500},children:n})]})]}),Os.jsx(f,{component:"a",href:r,target:"_blank",rel:"noopener noreferrer",sx:{pl:16,flexShrink:0},children:Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:Os.jsx("path",{d:"M7.23375 3.75L6 4.98375L10.0075 9L6 13.0162L7.23375 14.25L12.4838 9L7.23375 3.75Z",fill:a.palette.text.primary})})})]})]})}const yw="widget-module-container",xw=at.forwardRef((function(e,t){var{sx:n}=e,r=Nn(e,["sx"]);const{isMobile:i}=wy(),o=g();return Os.jsx(f,{className:yw,ref:t,sx:Object.assign(Object.assign({flex:1,overflowY:"auto",backgroundColor:"background.default"},i?{padding:0,height:"100%",width:"100%",overflowX:"hidden"}:{padding:o.spacing(28,20,40,40),height:"auto"}),n),...r})})),vw=[{value:0,label:"0%"},{value:25,label:"25%"},{value:50,label:"50%"},{value:75,label:"75%"},{value:100,label:"100%"}];function bw({disabled:e,value:t,onChange:n,sx:r}){return Os.jsxs(f,{sx:Object.assign({p:20,backgroundColor:"background.input",borderRadius:12},r),children:[Os.jsx(hy,{value:String(t),onChange:e=>n(+e),readOnly:!0,readonlyShowSuffix:!0,suffix:Os.jsx(f,{sx:{typography:"h2"},children:"%"}),sx:{mt:12,"& input":{pl:0,typography:"h1"}}}),Os.jsx(f,{sx:{mt:20},children:Os.jsx(V,{marks:vw,step:1,disabled:e,value:t,onChange:(e,t)=>n(t)})})]})}function Aw({active:t,sx:n,onClick:r}){const i=g(),o="light"===i.palette.mode;let a=i.palette.primary.main,s="transparent";return t&&(a=i.palette.primary.contrastText,s=C(i.palette.primary.main,.8)),Os.jsx(f,{component:y,sx:Object.assign({typography:"body2",p:t?i.spacing(8,20,9):i.spacing(7,19,8),minWidth:79,border:t?void 0:`1px solid ${a}`,color:a,backgroundColor:s,borderRadius:8,fontWeight:600,"&:hover":{color:t?i.palette.primary.contrastText:i.palette.primary.main,backgroundColor:t?i.palette.primary.main:o?"rgba(26, 26, 27, 0.04)":"rgba(241, 249, 2, 0.08)"}},n),onClick:r,children:Os.jsx(e,{id:"R9Khdg",message:"Auto"})})}const ww="auto",kw="0.1",Cw="0.5",jw="0.5",Tw=.01,Ew=({address:e,type:t})=>{const[n,r]=ct(ww),o=lt((()=>n===ww?"AMMV3"===t?new i(jw).div(100).toNumber():"AMMV2"===t?new i(Cw).div(100).toNumber():new i(kw).div(100).toNumber():n),[n,t]);return{slipper:n,setSlipper:r,slipperValue:o,resetSlipper:()=>{r(ww)}}};function Sw({type:t,disabled:n,value:r,onChange:o,sx:a}){const s=g(),l=r===ww,[d,c]=ct(l?"":new i(r).times(100).toNumber()),u="AMMV3"==t?jw:"AMMV2"==t?Cw:kw;return Os.jsx(A,{disabled:n,onlyClick:!0,title:Os.jsxs(f,{sx:{backgroundColor:s.palette.background.paper,padding:s.spacing(12,20),borderRadius:8,width:318,maxWidth:"90vw",boxSizing:"border-box"},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2"},children:[Os.jsx("span",{children:Os.jsx(e,{id:"lqTDfd",message:"Slippage Tolerance"})}),Os.jsxs("span",{children:[l?u:r&&new i(r).times(100).toNumber(),"%"]})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",margin:s.spacing(16,0,0,0)},children:[Os.jsx(Aw,{sx:{borderRadius:8,whiteSpace:"nowrap"},onClick:()=>{c(""),o(ww)},active:l}),Os.jsx(v,{placeholder:String(u),value:d,onChange:e=>{const{value:t}=e.target;c(t),o(t?new i(t).div(100).toNumber():ww)},onBlur:()=>{(!l&&new i(r).gt(.1)||new i(r).lte(0))&&(c(10),o(.1))},suffix:Os.jsx(f,{sx:{mr:16},children:"%"}),sx:{ml:8,"& input":{px:16,py:0,height:"39px"}}})]})]}),sx:{p:0},arrow:!1,placement:"bottom-end",children:Os.jsx(Q,{sx:Object.assign({width:"max-content",alignItems:"right",margin:s.spacing(0,0,0,"auto"),p:s.spacing(4,12),borderRadius:20,backgroundColor:"background.paperDarkContrast"},a),children:Os.jsx(f,{component:As.Setting,sx:{width:18,height:18,"& path:last-child":{fill:s.palette.text.primary}}})})})}const Iw=50;var Rw,Lw,Mw;!function(e){e[e.quantity=1]="quantity",e[e.percentage=2]="percentage"}(Rw||(Rw={})),function(e){e.CURRENCY_A="CURRENCY_A",e.CURRENCY_B="CURRENCY_B"}(Lw||(Lw={})),function(e){e.LOWER="LOWER",e.UPPER="UPPER"}(Mw||(Mw={}));const Ow={xs:"4px",sm:"8px",md:"12px",lg:"24px",xl:"32px"},Bw=({children:e,sx:t})=>(g(),Os.jsx(f,{sx:Object.assign({display:"flex",flexDirection:"column",gap:20,px:20,py:20,borderRadius:12},t),children:e})),Pw=({children:e,sx:t})=>{const n=g();return Os.jsx(Bw,{sx:Object.assign(Object.assign({},t),{backgroundColor:n.palette.background.paperContrast}),children:e})},Dw=({children:e})=>{const t=g();return Os.jsxs(f,{sx:{p:8,borderRadius:8,backgroundColor:C(t.palette.warning.main,.1),display:"flex",alignItems:"center",gap:8},children:[Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 16.125L9 1.875L17.25 16.125H0.75ZM14.6475 14.625L8.99998 4.86749L3.35247 14.625H14.6475ZM9.75004 12.375H8.25003V13.875H9.75004V12.375ZM8.25003 7.875H9.75004V10.875H8.25003V7.875Z",fill:t.palette.warning.main})}),Os.jsx(f,{sx:{typography:"h6",color:t.palette.warning.main,textAlign:"left"},children:e})]})};function Nw({gap:e,flex:t,children:n,style:r}){return Os.jsx(f,{sx:Object.assign(Object.assign(Object.assign({display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:e&&Ow[e]||e},t&&{flex:t}),{width:"100%",alignItems:"center"}),r),children:n})}function Fw({gap:e,justify:t,grow:n,children:r,style:i}){return Os.jsx(f,{sx:Object.assign({display:"grid",gridAutoRows:"auto",gridRowGap:e&&Ow[e]||e,justifyItems:t,flexGrow:n&&1},i),children:r})}function Ww({gap:e,children:t,sx:n}){return Os.jsx(f,{sx:Object.assign({width:"100%",display:"flex",padding:0,alignItems:"center",justifyContent:"flex-start",gap:e&&Ow[e]||e},n),children:t})}function Vw({children:e,style:t}){return Os.jsx(Ww,{sx:Object.assign({justifyContent:"space-between"},t),children:e})}function Uw({gap:e,justify:t,children:n,sx:r}){return Os.jsx(Ww,{sx:Object.assign({position:"relative",width:"fit-content",margin:`-${e}`},r),children:n})}function Hw({children:e,disabled:t,sx:n}){return Os.jsx(Ww,{sx:Object.assign({display:"flex",flexDirection:"column",alignItems:"stretch",gap:12,opacity:t?.2:1,pointerEvents:t?"none":"auto"},n),children:e})}const qw=({chainId:t,approvalA:n,approvalB:i,parsedAmounts:o,isValid:a,depositADisabled:s,depositBDisabled:l,errorMessage:d,setShowConfirm:c})=>{var u,p;const h=n.needApprove&&!!o[Lw.CURRENCY_A]||n.isApproving,m=i.needApprove&&!!o[Lw.CURRENCY_B]||i.isApproving;return Os.jsx(sb,{includeButton:!0,fullWidth:!0,chainId:t,children:Os.jsxs(Fw,{gap:"md",style:{width:"100%"},children:[(h||m)&&a&&Os.jsxs(f,{sx:{width:"100%",display:"flex",padding:0,alignItems:"center",justifyContent:"space-between",gap:8},children:[h&&Os.jsx(T,{size:T.Size.big,isLoading:n.isApproving,onClick:n.submitApprove,disabled:n.insufficientBalance,width:m?"50%":"100%",children:n.isApproving?Os.jsx(e,{id:"DTFrUE",message:"Approving {0}...",values:{0:null===(u=n.token)||void 0===u?void 0:u.symbol}}):n.approveTitle}),m&&Os.jsx(T,{size:T.Size.big,isLoading:i.isApproving,onClick:i.submitApprove,disabled:i.insufficientBalance,width:h?"50%":"100%",children:i.isApproving?Os.jsx(e,{id:"DTFrUE",message:"Approving {0}...",values:{0:null===(p=i.token)||void 0===p?void 0:p.symbol}}):i.approveTitle})]}),Os.jsx(T,{fullWidth:!0,size:T.Size.big,onClick:()=>{c(!0)},disabled:!a||n.needApprove&&!s||i.needApprove&&!l,danger:!a&&!!o[Lw.CURRENCY_A]&&!!o[Lw.CURRENCY_B],children:d||r._({id:"rdUucN",message:"Preview"})})]})})},Zw=({chainId:e,disabled:t,isLoading:n,onConfirm:i})=>Os.jsx(sb,{includeButton:!0,fullWidth:!0,chainId:e,children:Os.jsx(T,{fullWidth:!0,size:T.Size.big,onClick:i,disabled:t,isLoading:n,children:r._({id:"h5pjuM",message:"Collect fees"})})});function zw(e){const t=dt();return st((()=>{t.current=e})),t.current}const Qw=[.25,.5,.75,1];function Gw({currentValue:e,onClick:t,sx:n}){const r=g(),i="light"===r.palette.mode,{isMobile:o}=wy(),[a,s]=ct(null),l=dt(0);st((()=>{e?(l.current+=1,l.current>=2&&(s(null),l.current=0)):s(null)}),[e]);const d=zw(e);return st((()=>{d===e&&1===a&&(l.current=1)}),[e,d,a]),Os.jsx(f,{sx:Object.assign({display:"grid",gap:o?10:14,gridTemplateColumns:`repeat(${Qw.length}, 1fr)`},n),children:Qw.map((e=>{const n=e===a;return Os.jsxs(y,{sx:{typography:"h6",borderRadius:4,padding:r.spacing(4,0),width:"100%",color:"text.secondary",backgroundColor:"background.paperDarkContrast","&:hover":{color:r.palette.text.primary,backgroundColor:C(r.palette.text.primary,.2)},"&.selected, &:focus":{color:"#fff",backgroundColor:i?r.palette.primary.main:C(r.palette.text.primary,.4)}},onClick:()=>{n||(l.current=0,s(e),t(e))},className:n?"selected":void 0,children:[100*e,"%"]},e)}))})}const Yw=({value:t,onUserInput:n,maxAmount:i,balance:o,currency:a,locked:s})=>{var l,d;const c=g(),u=ut((e=>{if(!i||!a)return;const t=i.toExact().multipliedBy(e).dp(a.decimals).toString();n(t)}),[a,i,n]),p=lt((()=>o?An({input:o.toExact(),decimals:null==a?void 0:a.decimals}):"-"),[null==a?void 0:a.decimals,o]);return Os.jsxs(f,{sx:{pt:12,pb:20,px:20,borderWidth:1,borderStyle:"solid",borderColor:"border.main",borderRadius:12,backgroundColor:c.palette.background.input},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:4},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,color:c.palette.text.primary,typography:"h5"},children:[(null==a?void 0:a.address)&&Os.jsx(ey,{address:null!==(l=null==a?void 0:a.address)&&void 0!==l?l:"",chainId:null==a?void 0:a.chainId,noShowChain:!0,width:24,height:24,marginRight:0}),Os.jsx(f,{sx:{display:"flex",alignItems:"center"},children:(null==a?void 0:a.address)?Os.jsx(f,{children:null!==(d=null==a?void 0:a.symbol)&&void 0!==d?d:"-"}):Os.jsx(e,{id:"sIPJGT",message:"SELECT TOKEN"})})]}),Os.jsxs(f,{component:y,sx:{color:c.palette.text.secondary,"&:hover":{color:c.palette.text.primary},cursor:"pointer",display:"flex",flexWrap:"wrap",justifyContent:"flex-end",typography:"body2"},onClick:()=>{u(1)},children:[Os.jsxs(f,{sx:{wordBreak:"keep-all"},children:[r._({id:"fsBGk0",message:"Balance"}),": "]}),Os.jsx(f,{sx:{wordBreak:"break-all",textAlign:"right",display:"flex",alignItems:"center"},children:p})]})]}),Os.jsx(hy,{sx:{mt:4},suffix:void 0,value:t,onChange:n,readOnly:s,withClear:!s}),s?null:Os.jsx(Gw,{sx:{mt:20,mb:0},onClick:u,currentValue:t})]})},Xw={},Jw={};var Kw,_w;Object.values(oe).filter((e=>"number"==typeof e)).map((e=>{const t=Ee(e),n=Se(e);t&&(Xw[e]=t),n&&(Jw[e]=n)})),oe.MAINNET,oe.ARBITRUM_ONE,oe.SEPOLIA,oe.TAIKO,function(e){e[e.EXACT_INPUT=0]="EXACT_INPUT",e[e.EXACT_OUTPUT=1]="EXACT_OUTPUT"}(Kw||(Kw={})),function(e){e[e.ROUND_DOWN=0]="ROUND_DOWN",e[e.ROUND_HALF_UP=1]="ROUND_HALF_UP",e[e.ROUND_UP=2]="ROUND_UP"}(_w||(_w={}));const $w=tn.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),ek={[_w.ROUND_DOWN]:i.ROUND_DOWN,[_w.ROUND_HALF_UP]:i.ROUND_HALF_UP,[_w.ROUND_UP]:i.ROUND_UP},tk={[_w.ROUND_DOWN]:i.ROUND_DOWN,[_w.ROUND_HALF_UP]:i.ROUND_HALF_UP,[_w.ROUND_UP]:i.ROUND_UP};let nk=class e{constructor(e,t=tn.BigInt(1)){this.numerator=tn.BigInt(e),this.denominator=tn.BigInt(t)}static tryParseFraction(t){if(t instanceof tn||"number"==typeof t||"string"==typeof t)return new e(t);if("numerator"in t&&"denominator"in t)return t;throw new Error("Could not parse fraction")}get quotient(){return tn.divide(this.numerator,this.denominator)}get remainder(){return new e(tn.remainder(this.numerator,this.denominator),this.denominator)}invert(){return new e(this.denominator,this.numerator)}add(t){const n=e.tryParseFraction(t);return tn.equal(this.denominator,n.denominator)?new e(tn.add(this.numerator,n.numerator),this.denominator):new e(tn.add(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator)),tn.multiply(this.denominator,n.denominator))}subtract(t){const n=e.tryParseFraction(t);return tn.equal(this.denominator,n.denominator)?new e(tn.subtract(this.numerator,n.numerator),this.denominator):new e(tn.subtract(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator)),tn.multiply(this.denominator,n.denominator))}lessThan(t){const n=e.tryParseFraction(t);return tn.lessThan(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator))}equalTo(t){const n=e.tryParseFraction(t);return tn.equal(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator))}greaterThan(t){const n=e.tryParseFraction(t);return tn.greaterThan(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator))}multiply(t){const n=e.tryParseFraction(t);return new e(tn.multiply(this.numerator,n.numerator),tn.multiply(this.denominator,n.denominator))}divide(t){const n=e.tryParseFraction(t);return new e(tn.multiply(this.numerator,n.denominator),tn.multiply(this.denominator,n.numerator))}toSignificant(e,t={decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0},n=_w.ROUND_HALF_UP){nn(Number.isInteger(e),`${e} is not an integer.`),nn(e>0,`${e} is not positive.`);const r=ek[n],o=new i(this.numerator.toString()).div(this.denominator.toString()).precision(e,r);return o.toFormat(o.decimalPlaces(),r,t)}toFixed(e,t={decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0},n=_w.ROUND_HALF_UP){nn(Number.isInteger(e),`${e} is not an integer.`),nn(e>=0,`${e} is negative.`);const r=tk[n];return new i(this.numerator.toString()).decimalPlaces(e,r).div(this.denominator.toString()).toFormat(e,r,t)}get asFraction(){return new e(this.numerator,this.denominator)}};class rk extends nk{static fromRawAmount(e,t){return new rk(e,t)}static fromFractionalAmount(e,t,n){return new rk(e,t,n)}constructor(e,t,n){super(t,n),nn(tn.lessThanOrEqual(this.quotient,$w),"AMOUNT"),this.currency=e,this.decimalScale=tn.exponentiate(tn.BigInt(10),tn.BigInt(e.decimals))}add(e){nn(this.currency.equals(e.currency),"CURRENCY");const t=super.add(e);return rk.fromFractionalAmount(this.currency,t.numerator,t.denominator)}subtract(e){nn(this.currency.equals(e.currency),"CURRENCY");const t=super.subtract(e);return rk.fromFractionalAmount(this.currency,t.numerator,t.denominator)}multiply(e){const t=super.multiply(e);return rk.fromFractionalAmount(this.currency,t.numerator,t.denominator)}divide(e){const t=super.divide(e);return rk.fromFractionalAmount(this.currency,t.numerator,t.denominator)}toSignificant(e=6,t,n=_w.ROUND_DOWN){return super.divide(this.decimalScale).toSignificant(e,t,n)}toFixed(e=this.currency.decimals,t,n=_w.ROUND_DOWN){return nn(e<=this.currency.decimals,"DECIMALS"),super.divide(this.decimalScale).toFixed(e,t,n)}toExact(){return new i(this.quotient.toString()).div(this.decimalScale.toString())}get wrapped(){return this.currency.isToken?this:rk.fromFractionalAmount(this.currency.wrapped,this.numerator,this.denominator)}}const ik=new nk(tn.BigInt(100));function ok(e){return new ak(e.numerator,e.denominator)}let ak=class extends nk{constructor(){super(...arguments),this.isPercent=!0}add(e){return ok(super.add(e))}subtract(e){return ok(super.subtract(e))}multiply(e){return ok(super.multiply(e))}divide(e){return ok(super.divide(e))}toSignificant(e=5,t,n){return super.multiply(ik).toSignificant(e,t,n)}toFixed(e=2,t,n){return super.multiply(ik).toFixed(e,t,n)}},sk=class e extends nk{constructor(...e){let t,n,r,i;if(4===e.length)[t,n,r,i]=e;else{const o=e[0].quoteAmount.divide(e[0].baseAmount);[t,n,r,i]=[e[0].baseAmount.currency,e[0].quoteAmount.currency,o.denominator,o.numerator]}super(i,r),this.baseCurrency=t,this.quoteCurrency=n,this.scalar=new nk(tn.exponentiate(tn.BigInt(10),tn.BigInt(t.decimals)),tn.exponentiate(tn.BigInt(10),tn.BigInt(n.decimals)))}invert(){return new e(this.quoteCurrency,this.baseCurrency,this.numerator,this.denominator)}multiply(t){nn(this.quoteCurrency.equals(t.baseCurrency),"TOKEN");const n=super.multiply(t);return new e(this.baseCurrency,t.quoteCurrency,n.denominator,n.numerator)}quote(e){nn(e.currency.equals(this.baseCurrency),"TOKEN");const t=super.multiply(e);return rk.fromFractionalAmount(this.quoteCurrency,t.numerator,t.denominator)}get adjustedForDecimals(){return super.multiply(this.scalar)}toSignificant(e=6,t,n){return this.adjustedForDecimals.toSignificant(e,t,n)}toFixed(e=4,t,n){return this.adjustedForDecimals.toFixed(e,t,n)}},lk=class{constructor(e,t,n,r){nn(Number.isSafeInteger(e),"CHAIN_ID"),nn(t>=0&&t<255&&Number.isInteger(t),"DECIMALS"),this.chainId=e,this.decimals=t,this.symbol=n,this.name=r}};function dk(e){try{return Vr(e)}catch(t){throw new Error(`${e} is not a valid address.`)}}const ck=/^0x[0-9a-fA-F]{40}$/;let uk=class extends lk{constructor(e,t,n,r,i,o,a,s){super(e,n,r,i),this.isNative=!1,this.isToken=!0,this.address=o?function(e){if(ck.test(e))return e;throw new Error(`${e} is not a valid address.`)}(t):dk(t),a&&nn(a.gte(ne.from(0)),"NON-NEGATIVE FOT FEES"),s&&nn(s.gte(ne.from(0)),"NON-NEGATIVE FOT FEES"),this.buyFeeBps=a,this.sellFeeBps=s}equals(e){return e.isToken&&this.chainId===e.chainId&&this.address.toLowerCase()===e.address.toLowerCase()}sortsBefore(e){return nn(this.chainId===e.chainId,"CHAIN_IDS"),nn(this.address.toLowerCase()!==e.address.toLowerCase(),"ADDRESSES"),this.address.toLowerCase()<e.address.toLowerCase()}get wrapped(){return this}};const pk=tn.BigInt(Number.MAX_SAFE_INTEGER),hk=tn.BigInt(0),mk=tn.BigInt(1),fk=tn.BigInt(2);const gk=tn.BigInt(0),yk=1e4;new ak(tn.BigInt(1),yk),new ak(1,100),new ak(3,100),new ak(5,100),new ak(10,100),new ak(15,100);const xk=new ak(0);new ak(1);const vk="0x5ccd5621c1bb9e44ce98cef8b90d31eb2423dec3793b6239232cefae976936ea";var bk;!function(e){e[e.LOWEST=100]="LOWEST",e[e.LOW_200=200]="LOW_200",e[e.LOW_300=300]="LOW_300",e[e.LOW_400=400]="LOW_400",e[e.LOW=500]="LOW",e[e.MEDIUM=3e3]="MEDIUM",e[e.HIGH=1e4]="HIGH"}(bk||(bk={}));const Ak={[bk.LOWEST]:1,[bk.LOW_200]:4,[bk.LOW_300]:6,[bk.LOW_400]:8,[bk.LOW]:10,[bk.MEDIUM]:60,[bk.HIGH]:200},wk=tn.BigInt(-1),kk=tn.BigInt(0),Ck=tn.BigInt(1),jk=tn.exponentiate(tn.BigInt(2),tn.BigInt(96)),Tk=tn.exponentiate(jk,tn.BigInt(2)),Ek="abi/5.7.0",Sk=new Yn(Ek),Ik={};let Rk={calldata:!0,memory:!0,storage:!0},Lk={calldata:!0,memory:!0};function Mk(e,t){if("bytes"===e||"string"===e){if(Rk[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Lk[t])return!0;return(Rk[t]||"payable"===t)&&Sk.throwArgumentError("invalid modifier","name",t),!1}function Ok(e,t){for(let n in t)tu(e,n,t[n])}const Bk=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Pk=new RegExp(/^(.*)\[([0-9]*)\]$/);class Dk{constructor(e,t){e!==Ik&&Sk.throwError("use fromString",Yn.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Ok(this,t);let n=this.type.match(Pk);Ok(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:Dk.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=Bk.sighash),Bk[e]||Sk.throwArgumentError("invalid format type","format",e),e===Bk.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Bk.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Bk.full?", ":",")+")"):t+=this.type,e!==Bk.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Bk.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?Dk.fromString(e,t):Dk.fromObject(e)}static fromObject(e){return Dk.isParamType(e)?e:new Dk(Ik,{name:e.name||null,type:Gk(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(Dk.fromObject):null})}static fromString(e,t){return n=function(e,t){let n=e;function r(t){Sk.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let n={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(n.indexed=!1),n}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},a=o;for(let n=0;n<e.length;n++){let o=e[n];switch(o){case"(":a.state.allowType&&""===a.type?a.type="tuple":a.state.allowParams||r(n),a.state.allowType=!1,a.type=Gk(a.type),a.components=[i(a)],a=a.components[0];break;case")":delete a.state,"indexed"===a.name&&(t||r(n),a.indexed=!0,a.name=""),Mk(a.type,a.name)&&(a.name=""),a.type=Gk(a.type);let e=a;a=a.parent,a||r(n),delete e.parent,a.state.allowParams=!1,a.state.allowName=!0,a.state.allowArray=!0;break;case",":delete a.state,"indexed"===a.name&&(t||r(n),a.indexed=!0,a.name=""),Mk(a.type,a.name)&&(a.name=""),a.type=Gk(a.type);let s=i(a.parent);a.parent.components.push(s),delete a.parent,a=s;break;case" ":a.state.allowType&&""!==a.type&&(a.type=Gk(a.type),delete a.state.allowType,a.state.allowName=!0,a.state.allowParams=!0),a.state.allowName&&""!==a.name&&("indexed"===a.name?(t||r(n),a.indexed&&r(n),a.indexed=!0,a.name=""):Mk(a.type,a.name)?a.name="":a.state.allowName=!1);break;case"[":a.state.allowArray||r(n),a.type+=o,a.state.allowArray=!1,a.state.allowName=!1,a.state.readArray=!0;break;case"]":a.state.readArray||r(n),a.type+=o,a.state.readArray=!1,a.state.allowArray=!0,a.state.allowName=!0;break;default:a.state.allowType?(a.type+=o,a.state.allowParams=!0,a.state.allowArray=!0):a.state.allowName?(a.name+=o,delete a.state.allowArray):a.state.readArray?a.type+=o:r(n)}}return a.parent&&Sk.throwArgumentError("unexpected eof","param",e),delete o.state,"indexed"===a.name?(t||r(n.length-7),a.indexed&&r(n.length-7),a.indexed=!0,a.name=""):Mk(a.type,a.name)&&(a.name=""),o.type=Gk(o.type),o}(e,!!t),Dk.fromObject({name:n.name,type:n.type,indexed:n.indexed,components:n.components});var n}static isParamType(e){return!(null==e||!e._isParamType)}}function Nk(e,t){return function(e){e=e.trim();let t=[],n="",r=0;for(let i=0;i<e.length;i++){let o=e[i];","===o&&0===r?(t.push(n),n=""):(n+=o,"("===o?r++:")"===o&&(r--,-1===r&&Sk.throwArgumentError("unbalanced parenthesis","value",e)))}n&&t.push(n);return t}(e).map((e=>Dk.fromString(e,t)))}class Fk{constructor(e,t){e!==Ik&&Sk.throwError("use a static from method",Yn.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Ok(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return Fk.isFragment(e)?e:"string"==typeof e?Fk.fromString(e):Fk.fromObject(e)}static fromObject(e){if(Fk.isFragment(e))return e;switch(e.type){case"function":return Zk.fromObject(e);case"event":return Wk.fromObject(e);case"constructor":return qk.fromObject(e);case"error":return Qk.fromObject(e);case"fallback":case"receive":return null}return Sk.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Wk.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Zk.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?qk.fromString(e.trim()):"error"===e.split(" ")[0]?Qk.fromString(e.substring(5).trim()):Sk.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class Wk extends Fk{format(e){if(e||(e=Bk.sighash),Bk[e]||Sk.throwArgumentError("invalid format type","format",e),e===Bk.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Bk.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Bk.full?", ":",")+") ",e!==Bk.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?Wk.fromString(e):Wk.fromObject(e)}static fromObject(e){if(Wk.isEventFragment(e))return e;"event"!==e.type&&Sk.throwArgumentError("invalid event object","value",e);const t={name:Xk(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Dk.fromObject):[],type:"event"};return new Wk(Ik,t)}static fromString(e){let t=e.match(Jk);t||Sk.throwArgumentError("invalid event string","value",e);let n=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":n=!0;break;case"":break;default:Sk.warn("unknown modifier: "+e)}})),Wk.fromObject({name:t[1].trim(),anonymous:n,inputs:Nk(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function Vk(e,t){t.gas=null;let n=e.split("@");return 1!==n.length?(n.length>2&&Sk.throwArgumentError("invalid human-readable ABI signature","value",e),n[1].match(/^[0-9]+$/)||Sk.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=ne.from(n[1]),n[0]):e}function Uk(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function Hk(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&Sk.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&Sk.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||Sk.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&Sk.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&Sk.throwArgumentError("unable to determine stateMutability","value",e),t}class qk extends Fk{format(e){if(e||(e=Bk.sighash),Bk[e]||Sk.throwArgumentError("invalid format type","format",e),e===Bk.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===Bk.sighash&&Sk.throwError("cannot format a constructor for sighash",Yn.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Bk.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?qk.fromString(e):qk.fromObject(e)}static fromObject(e){if(qk.isConstructorFragment(e))return e;"constructor"!==e.type&&Sk.throwArgumentError("invalid constructor object","value",e);let t=Hk(e);t.constant&&Sk.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Dk.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?ne.from(e.gas):null};return new qk(Ik,n)}static fromString(e){let t={type:"constructor"},n=(e=Vk(e,t)).match(Jk);return n&&"constructor"===n[1].trim()||Sk.throwArgumentError("invalid constructor string","value",e),t.inputs=Nk(n[2].trim(),!1),Uk(n[3].trim(),t),qk.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Zk extends qk{format(e){if(e||(e=Bk.sighash),Bk[e]||Sk.throwArgumentError("invalid format type","format",e),e===Bk.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Bk.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Bk.full?", ":",")+") ",e!==Bk.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?Zk.fromString(e):Zk.fromObject(e)}static fromObject(e){if(Zk.isFunctionFragment(e))return e;"function"!==e.type&&Sk.throwArgumentError("invalid function object","value",e);let t=Hk(e);const n={type:e.type,name:Xk(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Dk.fromObject):[],outputs:e.outputs?e.outputs.map(Dk.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?ne.from(e.gas):null};return new Zk(Ik,n)}static fromString(e){let t={type:"function"},n=(e=Vk(e,t)).split(" returns ");n.length>2&&Sk.throwArgumentError("invalid function string","value",e);let r=n[0].match(Jk);if(r||Sk.throwArgumentError("invalid function signature","value",e),t.name=r[1].trim(),t.name&&Xk(t.name),t.inputs=Nk(r[2],!1),Uk(r[3].trim(),t),n.length>1){let r=n[1].match(Jk);""==r[1].trim()&&""==r[3].trim()||Sk.throwArgumentError("unexpected tokens","value",e),t.outputs=Nk(r[2],!1)}else t.outputs=[];return Zk.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function zk(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||Sk.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class Qk extends Fk{format(e){if(e||(e=Bk.sighash),Bk[e]||Sk.throwArgumentError("invalid format type","format",e),e===Bk.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Bk.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Bk.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?Qk.fromString(e):Qk.fromObject(e)}static fromObject(e){if(Qk.isErrorFragment(e))return e;"error"!==e.type&&Sk.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Xk(e.name),inputs:e.inputs?e.inputs.map(Dk.fromObject):[]};return zk(new Qk(Ik,t))}static fromString(e){let t={type:"error"},n=e.match(Jk);return n||Sk.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&Xk(t.name),t.inputs=Nk(n[2],!1),zk(Qk.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Gk(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Yk=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Xk(e){return e&&e.match(Yk)||Sk.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Jk=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Kk=new Yn(Ek);class _k{constructor(e,t,n,r){this.name=e,this.type=t,this.localName=n,this.dynamic=r}_throwError(e,t){Kk.throwArgumentError(e,this.localName,t)}}class $k{constructor(e){tu(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return ur(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(rr(e._data))}writeBytes(e){let t=nr(e);const n=t.length%this.wordSize;return n&&(t=rr([t,this._padding.slice(n)])),this._writeData(t)}_getValue(e){let t=nr(ne.from(e));return t.length>this.wordSize&&Kk.throwError("value out-of-bounds",Yn.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=rr([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class eC{constructor(e,t,n,r){tu(this,"_data",nr(e)),tu(this,"wordSize",t||32),tu(this,"_coerceFunc",n),tu(this,"allowLoose",r),this._offset=0}get data(){return lr(this._data)}get consumed(){return this._offset}static coerce(e,t){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):eC.coerce(e,t)}_peekBytes(e,t,n){let r=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+r>this._data.length&&(this.allowLoose&&n&&this._offset+t<=this._data.length?r=t:Kk.throwError("data out-of-bounds",Yn.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+r})),this._data.slice(this._offset,this._offset+r)}subReader(e){return new eC(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let n=this._peekBytes(0,e,!!t);return this._offset+=n.length,n.slice(0,e)}readValue(){return ne.from(this.readBytes(this.wordSize))}}class tC extends _k{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=Vr(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return Vr(mr(e.readValue().toHexString(),20))}}class nC extends _k{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const rC=new Yn(Ek);function iC(e,t,n){let r=null;if(Array.isArray(n))r=n;else if(n&&"object"==typeof n){let e={};r=t.map((t=>{const r=t.localName;return r||rC.throwError("cannot encode object for signature with missing names",Yn.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[r]&&rC.throwError("cannot encode object for signature with duplicate names",Yn.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[r]=!0,n[r]}))}else rC.throwArgumentError("invalid tuple value","tuple",n);t.length!==r.length&&rC.throwArgumentError("types/value length mismatch","tuple",n);let i=new $k(e.wordSize),o=new $k(e.wordSize),a=[];t.forEach(((e,t)=>{let n=r[t];if(e.dynamic){let t=o.length;e.encode(o,n);let r=i.writeUpdatableValue();a.push((e=>{r(e+t)}))}else e.encode(i,n)})),a.forEach((e=>{e(i.length)}));let s=e.appendWriter(i);return s+=e.appendWriter(o),s}function oC(e,t){let n=[],r=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let n=e.readValue(),o=r.subReader(n.toNumber());try{i=t.decode(o)}catch(e){if(e.code===Yn.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===Yn.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&n.push(i)}));const i=t.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});t.forEach(((e,t)=>{let r=e.localName;if(!r||1!==i[r])return;if("length"===r&&(r="_length"),null!=n[r])return;const o=n[t];o instanceof Error?Object.defineProperty(n,r,{enumerable:!0,get:()=>{throw o}}):n[r]=o}));for(let e=0;e<n.length;e++){const t=n[e];t instanceof Error&&Object.defineProperty(n,e,{enumerable:!0,get:()=>{throw t}})}return Object.freeze(n)}class aC extends _k{constructor(e,t,n){super("array",e.type+"["+(t>=0?t:"")+"]",n,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let n=0;n<this.length;n++)t.push(e);return t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let n=this.length;-1===n&&(n=t.length,e.writeValue(t.length)),rC.checkArgumentCount(t.length,n,"coder array"+(this.localName?" "+this.localName:""));let r=[];for(let e=0;e<t.length;e++)r.push(this.coder);return iC(e,r,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&rC.throwError("insufficient data length",Yn.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let n=[];for(let e=0;e<t;e++)n.push(new nC(this.coder));return e.coerce(this.name,oC(e,n))}}class sC extends _k{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){return e.writeValue(t?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class lC extends _k{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=nr(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class dC extends lC{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,lr(super.decode(e)))}}class cC extends _k{constructor(e,t){let n="bytes"+String(e);super(n,n,t,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let n=nr(t);return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)}decode(e){return e.coerce(this.name,lr(e.readBytes(this.size)))}}class uC extends _k{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}class pC extends _k{constructor(e,t,n){const r=(t?"int":"uint")+8*e;super(r,r,n,!1),this.size=e,this.signed=t}defaultValue(){return 0}encode(e,t){let n=ne.from(t),r=ca.mask(8*e.wordSize);if(this.signed){let e=r.mask(8*this.size-1);(n.gt(e)||n.lt(e.add(da).mul(sa)))&&this._throwError("value out-of-bounds",t)}else(n.lt(la)||n.gt(r.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return n=n.toTwos(8*this.size).mask(8*this.size),this.signed&&(n=n.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(n)}decode(e){let t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}class hC extends lC{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,xa(t))}decode(e){return Aa(super.decode(e))}}class mC extends _k{constructor(e,t){let n=!1;const r=[];e.forEach((e=>{e.dynamic&&(n=!0),r.push(e.type)}));super("tuple","tuple("+r.join(",")+")",t,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});return this.coders.forEach(((n,r)=>{let i=n.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[r]))})),Object.freeze(e)}encode(e,t){return iC(e,this.coders,t)}decode(e){return e.coerce(this.name,oC(e,this.coders))}}const fC=new Yn(Ek),gC=new RegExp(/^bytes([0-9]*)$/),yC=new RegExp(/^(u?int)([0-9]*)$/);class xC{constructor(e){tu(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new tC(e.name);case"bool":return new sC(e.name);case"string":return new hC(e.name);case"bytes":return new dC(e.name);case"array":return new aC(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new mC((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new uC(e.name)}let t=e.type.match(yC);if(t){let n=parseInt(t[2]||"256");return(0===n||n>256||n%8!=0)&&fC.throwArgumentError("invalid "+t[1]+" bit length","param",e),new pC(n/8,"int"===t[1],e.name)}if(t=e.type.match(gC),t){let n=parseInt(t[1]);return(0===n||n>32)&&fC.throwArgumentError("invalid bytes length","param",e),new cC(n,e.name)}return fC.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new eC(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new $k(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(Dk.from(e))));return new mC(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&fC.throwError("types/values length mismatch",Yn.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const n=e.map((e=>this._getCoder(Dk.from(e)))),r=new mC(n,"_"),i=this._getWriter();return r.encode(i,t),i.data}decode(e,t,n){const r=e.map((e=>this._getCoder(Dk.from(e))));return new mC(r,"_").decode(this._getReader(nr(t),n))}}const vC=new xC,bC=new Yn(Ek);class AC extends cu{}class wC extends cu{}class kC extends cu{}class CC extends cu{static isIndexed(e){return!(!e||!e._isIndexed)}}const jC={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function TC(e,t){const n=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return n.error=t,n}class EC{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,tu(this,"fragments",t.map((e=>Fk.from(e))).filter((e=>null!=e))),tu(this,"_abiCoder",nu(new.target,"getAbiCoder")()),tu(this,"functions",{}),tu(this,"errors",{}),tu(this,"events",{}),tu(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void bC.warn("duplicate definition - constructor"):void tu(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let n=e.format();t[n]?bC.warn("duplicate definition - "+n):t[n]=e})),this.deploy||tu(this,"deploy",qk.from({payable:!1,type:"constructor"})),tu(this,"_isInterface",!0)}format(e){e||(e=Bk.full),e===Bk.sighash&&bC.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Bk.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return vC}static getAddress(e){return Vr(e)}static getSighash(e){return cr(Ru(e.format()),0,4)}static getEventTopic(e){return Ru(e.format())}getFunction(e){if(ar(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];bC.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===n.length?bC.throwArgumentError("no matching function","name",t):n.length>1&&bC.throwArgumentError("multiple matching functions","name",t),this.functions[n[0]]}const t=this.functions[Zk.fromString(e).format()];return t||bC.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(ar(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];bC.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===n.length?bC.throwArgumentError("no matching event","name",t):n.length>1&&bC.throwArgumentError("multiple matching events","name",t),this.events[n[0]]}const t=this.events[Wk.fromString(e).format()];return t||bC.throwArgumentError("no matching event","signature",e),t}getError(e){if(ar(e)){const t=nu(this.constructor,"getSighash");for(const n in this.errors){if(e===t(this.errors[n]))return this.errors[n]}bC.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===n.length?bC.throwArgumentError("no matching error","name",t):n.length>1&&bC.throwArgumentError("multiple matching errors","name",t),this.errors[n[0]]}const t=this.errors[Zk.fromString(e).format()];return t||bC.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return nu(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),nu(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const n=nr(t);return lr(n.slice(0,4))!==this.getSighash(e)&&bC.throwArgumentError(`data signature does not match error ${e.name}.`,"data",lr(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),lr(rr([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const n=nr(t);return lr(n.slice(0,4))!==this.getSighash(e)&&bC.throwArgumentError(`data signature does not match function ${e.name}.`,"data",lr(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),lr(rr([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let n=nr(t),r=null,i="",o=null,a=null,s=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch(e){}break;case 4:{const e=lr(n.slice(0,4)),t=jC[e];if(t)o=this._abiCoder.decode(t.inputs,n.slice(4)),a=t.name,s=t.signature,t.reason&&(r=o[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const t=this.getError(e);o=this._abiCoder.decode(t.inputs,n.slice(4)),a=t.name,s=t.format()}catch(e){}break}}return bC.throwError("call revert exception"+i,Yn.errors.CALL_EXCEPTION,{method:e.format(),data:lr(t),errorArgs:o,errorName:a,errorSignature:s,reason:r})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),lr(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&bC.throwError("too many arguments for "+e.format(),Yn.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let n=[];e.anonymous||n.push(this.getEventTopic(e));const r=(e,t)=>"string"===e.type?Ru(t):"bytes"===e.type?Cr(lr(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=ne.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),mr(lr(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?n.push(null):"array"===o.baseType||"tuple"===o.baseType?bC.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?n.push(t.map((e=>r(o,e)))):n.push(r(o,t)):null!=t&&bC.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const n=[],r=[],i=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&bC.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const a=t[o];if(e.indexed)if("string"===e.type)n.push(Ru(a));else if("bytes"===e.type)n.push(Cr(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(this._abiCoder.encode([e.type],[a]))}else r.push(e),i.push(a)})),{data:this._abiCoder.encode(r,i),topics:n}}decodeEventLog(e,t,n){if("string"==typeof e&&(e=this.getEvent(e)),null!=n&&!e.anonymous){let t=this.getEventTopic(e);ar(n[0],32)&&n[0].toLowerCase()===t||bC.throwError("fragment/topic mismatch",Yn.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:n[0]}),n=n.slice(1)}let r=[],i=[],o=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(r.push(Dk.fromObject({type:"bytes32",name:e.name})),o.push(!0)):(r.push(e),o.push(!1)):(i.push(e),o.push(!1))}));let a=null!=n?this._abiCoder.decode(r,rr(n)):null,s=this._abiCoder.decode(i,t,!0),l=[],d=0,c=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)l[t]=new CC({_isIndexed:!0,hash:null});else if(o[t])l[t]=new CC({_isIndexed:!0,hash:a[c++]});else try{l[t]=a[c++]}catch(e){l[t]=e}else try{l[t]=s[d++]}catch(e){l[t]=e}if(e.name&&null==l[e.name]){const n=l[t];n instanceof Error?Object.defineProperty(l,e.name,{enumerable:!0,get:()=>{throw TC(`property ${JSON.stringify(e.name)}`,n)}}):l[e.name]=n}}));for(let e=0;e<l.length;e++){const t=l[e];t instanceof Error&&Object.defineProperty(l,e,{enumerable:!0,get:()=>{throw TC(`index ${e}`,t)}})}return Object.freeze(l)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new wC({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:ne.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new AC({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=lr(e);let n=this.getError(t.substring(0,10).toLowerCase());return n?new kC({args:this._abiCoder.decode(n.inputs,"0x"+t.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!(!e||!e._isInterface)}}var SC=Object.freeze({__proto__:null,AbiCoder:xC,ConstructorFragment:qk,ErrorFragment:Qk,EventFragment:Wk,FormatTypes:Bk,Fragment:Fk,FunctionFragment:Zk,Indexed:CC,Interface:EC,LogDescription:AC,ParamType:Dk,TransactionDescription:wC,checkResultErrors:function(e){const t=[],n=function(e,r){if(Array.isArray(r))for(let i in r){const o=e.slice();o.push(i);try{n(o,r[i])}catch(e){t.push({path:o,error:e})}}};return n([],e),t},defaultAbiCoder:vC});function IC({factoryAddress:e,tokenA:t,tokenB:n,fee:r,initCodeHashManualOverride:i,chainId:o}){const[a,s]=t.sortsBefore(n)?[t,n]:[n,t],l=Ua(["bytes"],[vC.encode(["address","address","uint24"],[a.address,s.address,r])]),d=null!=i?i:function(e){return e===oe.TAIKO?"0x5ccd5621c1bb9e44ce98cef8b90d31eb2423dec3793b6239232cefae976936ea":vk}(o);return Hr(e,l,d)}const RC=tn.BigInt(2),LC=[128,64,32,16,8,4,2,1].map((e=>[e,tn.exponentiate(RC,tn.BigInt(e))]));function MC(e,t){return tn.signedRightShift(tn.multiply(e,tn.BigInt(t)),tn.BigInt(128))}const OC=tn.exponentiate(tn.BigInt(2),tn.BigInt(32));let BC=class e{constructor(){}static getSqrtRatioAtTick(t){nn(t>=e.MIN_TICK&&t<=e.MAX_TICK&&Number.isInteger(t),"TICK");const n=t<0?-1*t:t;let r=1&n?tn.BigInt("0xfffcb933bd6fad37aa2d162d1a594001"):tn.BigInt("0x100000000000000000000000000000000");return 2&n&&(r=MC(r,"0xfff97272373d413259a46990580e213a")),4&n&&(r=MC(r,"0xfff2e50f5f656932ef12357cf3c7fdcc")),8&n&&(r=MC(r,"0xffe5caca7e10e4e61c3624eaa0941cd0")),16&n&&(r=MC(r,"0xffcb9843d60f6159c9db58835c926644")),32&n&&(r=MC(r,"0xff973b41fa98c081472e6896dfb254c0")),64&n&&(r=MC(r,"0xff2ea16466c96a3843ec78b326b52861")),128&n&&(r=MC(r,"0xfe5dee046a99a2a811c461f1969c3053")),256&n&&(r=MC(r,"0xfcbe86c7900a88aedcffc83b479aa3a4")),512&n&&(r=MC(r,"0xf987a7253ac413176f2b074cf7815e54")),1024&n&&(r=MC(r,"0xf3392b0822b70005940c7a398e4b70f3")),2048&n&&(r=MC(r,"0xe7159475a2c29b7443b29c7fa6e889d9")),4096&n&&(r=MC(r,"0xd097f3bdfd2022b8845ad8f792aa5825")),8192&n&&(r=MC(r,"0xa9f746462d870fdf8a65dc1f90e061e5")),16384&n&&(r=MC(r,"0x70d869a156d2a1b890bb3df62baf32f7")),32768&n&&(r=MC(r,"0x31be135f97d08fd981231505542fcfa6")),65536&n&&(r=MC(r,"0x9aa508b5b7a84e1c677de54f3e99bc9")),131072&n&&(r=MC(r,"0x5d6af8dedb81196699c329225ee604")),262144&n&&(r=MC(r,"0x2216e584f5fa1ea926041bedfe98")),524288&n&&(r=MC(r,"0x48a170391f7dc42444e8fa2")),t>0&&(r=tn.divide($w,r)),tn.greaterThan(tn.remainder(r,OC),kk)?tn.add(tn.divide(r,OC),Ck):tn.divide(r,OC)}static getTickAtSqrtRatio(t){nn(tn.greaterThanOrEqual(t,e.MIN_SQRT_RATIO)&&tn.lessThan(t,e.MAX_SQRT_RATIO),"SQRT_RATIO");const n=tn.leftShift(t,tn.BigInt(32)),r=function(e){nn(tn.greaterThan(e,kk),"ZERO"),nn(tn.lessThanOrEqual(e,$w),"MAX");let t=0;for(const[n,r]of LC)tn.greaterThanOrEqual(e,r)&&(e=tn.signedRightShift(e,tn.BigInt(n)),t+=n);return t}(n);let i;i=tn.greaterThanOrEqual(tn.BigInt(r),tn.BigInt(128))?tn.signedRightShift(n,tn.BigInt(r-127)):tn.leftShift(n,tn.BigInt(127-r));let o=tn.leftShift(tn.subtract(tn.BigInt(r),tn.BigInt(128)),tn.BigInt(64));for(let e=0;e<14;e++){i=tn.signedRightShift(tn.multiply(i,i),tn.BigInt(127));const t=tn.signedRightShift(i,tn.BigInt(128));o=tn.bitwiseOr(o,tn.leftShift(t,tn.BigInt(63-e))),i=tn.signedRightShift(i,t)}const a=tn.multiply(o,tn.BigInt("255738958999603826347141")),s=tn.toNumber(tn.signedRightShift(tn.subtract(a,tn.BigInt("3402992956809132418596140100660247210")),tn.BigInt(128))),l=tn.toNumber(tn.signedRightShift(tn.add(a,tn.BigInt("291339464771989622907027621153398088495")),tn.BigInt(128)));return s===l?s:tn.lessThanOrEqual(e.getSqrtRatioAtTick(l),t)?l:s}};BC.MIN_TICK=-887272,BC.MAX_TICK=-BC.MIN_TICK,BC.MIN_SQRT_RATIO=tn.BigInt("4295128739"),BC.MAX_SQRT_RATIO=tn.BigInt("1461446703485210103287273052203988822378723970342");let PC=class{constructor(){}static mulDivRoundingUp(e,t,n){const r=tn.multiply(e,t);let i=tn.divide(r,n);return tn.notEqual(tn.remainder(r,n),kk)&&(i=tn.add(i,Ck)),i}};const DC=tn.subtract(tn.exponentiate(tn.BigInt(2),tn.BigInt(160)),Ck);function NC(e,t){const n=tn.multiply(e,t);return tn.bitwiseAnd(n,$w)}let FC=class{constructor(){}static getAmount0Delta(e,t,n,r){tn.greaterThan(e,t)&&([e,t]=[t,e]);const i=tn.leftShift(n,tn.BigInt(96)),o=tn.subtract(t,e);return r?PC.mulDivRoundingUp(PC.mulDivRoundingUp(i,o,t),Ck,e):tn.divide(tn.divide(tn.multiply(i,o),t),e)}static getAmount1Delta(e,t,n,r){return tn.greaterThan(e,t)&&([e,t]=[t,e]),r?PC.mulDivRoundingUp(n,tn.subtract(t,e),jk):tn.divide(tn.multiply(n,tn.subtract(t,e)),jk)}static getNextSqrtPriceFromInput(e,t,n,r){return nn(tn.greaterThan(e,kk)),nn(tn.greaterThan(t,kk)),r?this.getNextSqrtPriceFromAmount0RoundingUp(e,t,n,!0):this.getNextSqrtPriceFromAmount1RoundingDown(e,t,n,!0)}static getNextSqrtPriceFromOutput(e,t,n,r){return nn(tn.greaterThan(e,kk)),nn(tn.greaterThan(t,kk)),r?this.getNextSqrtPriceFromAmount1RoundingDown(e,t,n,!1):this.getNextSqrtPriceFromAmount0RoundingUp(e,t,n,!1)}static getNextSqrtPriceFromAmount0RoundingUp(e,t,n,r){if(tn.equal(n,kk))return e;const i=tn.leftShift(t,tn.BigInt(96));if(r){let t=NC(n,e);if(tn.equal(tn.divide(t,n),e)){const n=function(e,t){const n=tn.add(e,t);return tn.bitwiseAnd(n,$w)}(i,t);if(tn.greaterThanOrEqual(n,i))return PC.mulDivRoundingUp(i,e,n)}return PC.mulDivRoundingUp(i,Ck,tn.add(tn.divide(i,e),n))}{let t=NC(n,e);nn(tn.equal(tn.divide(t,n),e)),nn(tn.greaterThan(i,t));const r=tn.subtract(i,t);return PC.mulDivRoundingUp(i,e,r)}}static getNextSqrtPriceFromAmount1RoundingDown(e,t,n,r){if(r){const r=tn.lessThanOrEqual(n,DC)?tn.divide(tn.leftShift(n,tn.BigInt(96)),t):tn.divide(tn.multiply(n,jk),t);return tn.add(e,r)}{const r=PC.mulDivRoundingUp(n,jk,t);return nn(tn.greaterThan(e,r)),tn.subtract(e,r)}}};const WC=tn.exponentiate(tn.BigInt(10),tn.BigInt(6));class VC{constructor(){}static computeSwapStep(e,t,n,r,i){const o={};i=tn.BigInt(i);const a=tn.greaterThanOrEqual(e,t),s=tn.greaterThanOrEqual(r,kk);if(s){const s=tn.divide(tn.multiply(r,tn.subtract(WC,i)),WC);o.amountIn=a?FC.getAmount0Delta(t,e,n,!0):FC.getAmount1Delta(e,t,n,!0),tn.greaterThanOrEqual(s,o.amountIn)?o.sqrtRatioNextX96=t:o.sqrtRatioNextX96=FC.getNextSqrtPriceFromInput(e,n,s,a)}else o.amountOut=a?FC.getAmount1Delta(t,e,n,!1):FC.getAmount0Delta(e,t,n,!1),tn.greaterThanOrEqual(tn.multiply(r,wk),o.amountOut)?o.sqrtRatioNextX96=t:o.sqrtRatioNextX96=FC.getNextSqrtPriceFromOutput(e,n,tn.multiply(r,wk),a);const l=tn.equal(t,o.sqrtRatioNextX96);return a?(o.amountIn=l&&s?o.amountIn:FC.getAmount0Delta(o.sqrtRatioNextX96,e,n,!0),o.amountOut=l&&!s?o.amountOut:FC.getAmount1Delta(o.sqrtRatioNextX96,e,n,!1)):(o.amountIn=l&&s?o.amountIn:FC.getAmount1Delta(e,o.sqrtRatioNextX96,n,!0),o.amountOut=l&&!s?o.amountOut:FC.getAmount0Delta(e,o.sqrtRatioNextX96,n,!1)),!s&&tn.greaterThan(o.amountOut,tn.multiply(r,wk))&&(o.amountOut=tn.multiply(r,wk)),s&&tn.notEqual(o.sqrtRatioNextX96,t)?o.feeAmount=tn.subtract(r,o.amountIn):o.feeAmount=PC.mulDivRoundingUp(o.amountIn,i,tn.subtract(WC,i)),[o.sqrtRatioNextX96,o.amountIn,o.amountOut,o.feeAmount]}}class UC{constructor(){}static addDelta(e,t){return tn.lessThan(t,kk)?tn.subtract(e,tn.multiply(t,wk)):tn.add(e,t)}}class HC{getTick(e){return Fn(this,void 0,void 0,(function*(){throw new Error(HC.ERROR_MESSAGE)}))}nextInitializedTickWithinOneWord(e,t,n){return Fn(this,void 0,void 0,(function*(){throw new Error(HC.ERROR_MESSAGE)}))}}function qC(e,t){return e.index-t.index}HC.ERROR_MESSAGE="No tick data provider was given";class ZC{constructor(){}static validateList(e,t){nn(t>0,"TICK_SPACING_NONZERO"),nn(e.every((({index:e})=>e%t==0)),"TICK_SPACING"),nn(tn.equal(e.reduce(((e,{liquidityNet:t})=>tn.add(e,t)),kk),kk),"ZERO_NET"),nn(function(e,t){for(let n=0;n<e.length-1;n++)if(t(e[n],e[n+1])>0)return!1;return!0}(e,qC),"SORTED")}static isBelowSmallest(e,t){return nn(e.length>0,"LENGTH"),t<e[0].index}static isAtOrAboveLargest(e,t){return nn(e.length>0,"LENGTH"),t>=e[e.length-1].index}static getTick(e,t){const n=e[this.binarySearch(e,t)];return nn(n.index===t,"NOT_CONTAINED"),n}static binarySearch(e,t){nn(!this.isBelowSmallest(e,t),"BELOW_SMALLEST");let n,r=0,i=e.length-1;for(;;){if(n=Math.floor((r+i)/2),e[n].index<=t&&(n===e.length-1||e[n+1].index>t))return n;e[n].index<t?r=n+1:i=n-1}}static nextInitializedTick(e,t,n){if(n){if(nn(!ZC.isBelowSmallest(e,t),"BELOW_SMALLEST"),ZC.isAtOrAboveLargest(e,t))return e[e.length-1];return e[this.binarySearch(e,t)]}if(nn(!this.isAtOrAboveLargest(e,t),"AT_OR_ABOVE_LARGEST"),this.isBelowSmallest(e,t))return e[0];return e[this.binarySearch(e,t)+1]}static nextInitializedTickWithinOneWord(e,t,n,r){const i=Math.floor(t/r);if(n){const o=(i>>8<<8)*r;if(ZC.isBelowSmallest(e,t))return[o,!1];const a=ZC.nextInitializedTick(e,t,n).index,s=Math.max(o,a);return[s,s===a]}{const o=(((i+1>>8)+1<<8)-1)*r;if(this.isAtOrAboveLargest(e,t))return[o,!1];const a=this.nextInitializedTick(e,t,n).index,s=Math.min(o,a);return[s,s===a]}}}function zC(e){let t=tn.BigInt(e).toString(16);return t.length%2!=0&&(t=`0${t}`),`0x${t}`}function QC(e,t){const n=tn.leftShift(tn.BigInt(e),tn.BigInt(192)),r=tn.BigInt(t);return function(e){if(nn(tn.greaterThanOrEqual(e,hk),"NEGATIVE"),tn.lessThan(e,pk))return tn.BigInt(Math.floor(Math.sqrt(tn.toNumber(e))));let t,n;for(t=e,n=tn.add(tn.divide(e,fk),mk);tn.lessThan(n,t);)t=n,n=tn.divide(tn.add(tn.divide(e,n),n),fk);return t}(tn.divide(n,r))}function GC(e,t,n){tn.greaterThan(e,t)&&([e,t]=[t,e]);const r=tn.divide(tn.multiply(e,t),jk);return tn.divide(tn.multiply(tn.BigInt(n),r),tn.subtract(t,e))}function YC(e,t,n){tn.greaterThan(e,t)&&([e,t]=[t,e]);const r=tn.multiply(tn.multiply(tn.BigInt(n),e),t),i=tn.multiply(jk,tn.subtract(t,e));return tn.divide(r,i)}function XC(e,t,n){return tn.greaterThan(e,t)&&([e,t]=[t,e]),tn.divide(tn.multiply(tn.BigInt(n),jk),tn.subtract(t,e))}function JC(e,t,n,r,i,o){tn.greaterThan(t,n)&&([t,n]=[n,t]);const a=o?YC:GC;if(tn.lessThanOrEqual(e,t))return a(t,n,r);if(tn.lessThan(e,n)){const o=a(e,n,r),s=XC(t,e,i);return tn.lessThan(o,s)?o:s}return XC(t,n,i)}function KC(e,t){nn(Number.isInteger(e)&&Number.isInteger(t),"INTEGERS"),nn(t>0,"TICK_SPACING"),nn(e>=BC.MIN_TICK&&e<=BC.MAX_TICK,"TICK_BOUND");const n=Math.round(e/t)*t;return n<BC.MIN_TICK?n+t:n>BC.MAX_TICK?n-t:n}function _C(e,t,n){const r=BC.getSqrtRatioAtTick(n),i=tn.multiply(r,r);return e.sortsBefore(t)?new sk(e,t,Tk,i):new sk(e,t,i,Tk)}function $C(e){const t=e.baseCurrency.sortsBefore(e.quoteCurrency),n=t?QC(e.numerator,e.denominator):QC(e.denominator,e.numerator);let r=BC.getTickAtSqrtRatio(n);const i=_C(e.baseCurrency,e.quoteCurrency,r+1);return t?e.lessThan(i)||r++:e.greaterThan(i)||r++,r}tn.exponentiate(tn.BigInt(2),tn.BigInt(128)),tn.exponentiate(tn.BigInt(2),tn.BigInt(256));class ej{constructor({index:e,liquidityGross:t,liquidityNet:n}){nn(e>=BC.MIN_TICK&&e<=BC.MAX_TICK,"TICK"),this.index=e,this.liquidityGross=tn.BigInt(t),this.liquidityNet=tn.BigInt(n)}}class tj{constructor(e,t){const n=e.map((e=>e instanceof ej?e:new ej(e)));ZC.validateList(n,t),this.ticks=n}getTick(e){return Fn(this,void 0,void 0,(function*(){return ZC.getTick(this.ticks,e)}))}nextInitializedTickWithinOneWord(e,t,n){return Fn(this,void 0,void 0,(function*(){return ZC.nextInitializedTickWithinOneWord(this.ticks,e,t,n)}))}}const nj=new HC;let rj=class e{static getAddress(e,t,n,r,i){return IC({factoryAddress:null!=i?i:"0x78172691DD3B8ADa7aEbd9bFfB487FB11D735DB2",fee:n,tokenA:e,tokenB:t,initCodeHashManualOverride:r})}constructor(e,t,n,r,i,o,a=nj){nn(Number.isInteger(n)&&n<1e6,"FEE");const s=BC.getSqrtRatioAtTick(o),l=BC.getSqrtRatioAtTick(o+1);nn(tn.greaterThanOrEqual(tn.BigInt(r),s)&&tn.lessThanOrEqual(tn.BigInt(r),l),"PRICE_BOUNDS"),[this.token0,this.token1]=e.sortsBefore(t)?[e,t]:[t,e],this.fee=n,this.sqrtRatioX96=tn.BigInt(r),this.liquidity=tn.BigInt(i),this.tickCurrent=o,this.tickDataProvider=Array.isArray(a)?new tj(a,Ak[n]):a}involvesToken(e){return e.equals(this.token0)||e.equals(this.token1)}get token0Price(){var e;return null!==(e=this._token0Price)&&void 0!==e?e:this._token0Price=new sk(this.token0,this.token1,Tk,tn.multiply(this.sqrtRatioX96,this.sqrtRatioX96))}get token1Price(){var e;return null!==(e=this._token1Price)&&void 0!==e?e:this._token1Price=new sk(this.token1,this.token0,tn.multiply(this.sqrtRatioX96,this.sqrtRatioX96),Tk)}priceOf(e){return nn(this.involvesToken(e),"TOKEN"),e.equals(this.token0)?this.token0Price:this.token1Price}get chainId(){return this.token0.chainId}getOutputAmount(t,n){return Fn(this,void 0,void 0,(function*(){nn(this.involvesToken(t.currency),"TOKEN");const r=t.currency.equals(this.token0),{amountCalculated:i,sqrtRatioX96:o,liquidity:a,tickCurrent:s}=yield this.swap(r,t.quotient,n),l=r?this.token1:this.token0;return[rk.fromRawAmount(l,tn.multiply(i,wk)),new e(this.token0,this.token1,this.fee,o,a,s,this.tickDataProvider)]}))}getInputAmount(t,n){return Fn(this,void 0,void 0,(function*(){nn(t.currency.isToken&&this.involvesToken(t.currency),"TOKEN");const r=t.currency.equals(this.token1),{amountCalculated:i,sqrtRatioX96:o,liquidity:a,tickCurrent:s}=yield this.swap(r,tn.multiply(t.quotient,wk),n),l=r?this.token0:this.token1;return[rk.fromRawAmount(l,i),new e(this.token0,this.token1,this.fee,o,a,s,this.tickDataProvider)]}))}swap(e,t,n){return Fn(this,void 0,void 0,(function*(){return function(e,t,n,r,i,o,a,s,l){return Fn(this,void 0,void 0,(function*(){l||(l=a?tn.add(BC.MIN_SQRT_RATIO,Ck):tn.subtract(BC.MAX_SQRT_RATIO,Ck)),a?(nn(tn.greaterThan(l,BC.MIN_SQRT_RATIO),"RATIO_MIN"),nn(tn.lessThan(l,t),"RATIO_CURRENT")):(nn(tn.lessThan(l,BC.MAX_SQRT_RATIO),"RATIO_MAX"),nn(tn.greaterThan(l,t),"RATIO_CURRENT"));const d=tn.greaterThanOrEqual(s,kk),c={amountSpecifiedRemaining:s,amountCalculated:kk,sqrtPriceX96:t,tick:n,liquidity:r};for(;tn.notEqual(c.amountSpecifiedRemaining,kk)&&c.sqrtPriceX96!==l;){let t={};if(t.sqrtPriceStartX96=c.sqrtPriceX96,[t.tickNext,t.initialized]=yield o.nextInitializedTickWithinOneWord(c.tick,a,i),t.tickNext<BC.MIN_TICK?t.tickNext=BC.MIN_TICK:t.tickNext>BC.MAX_TICK&&(t.tickNext=BC.MAX_TICK),t.sqrtPriceNextX96=BC.getSqrtRatioAtTick(t.tickNext),[c.sqrtPriceX96,t.amountIn,t.amountOut,t.feeAmount]=VC.computeSwapStep(c.sqrtPriceX96,(a?tn.lessThan(t.sqrtPriceNextX96,l):tn.greaterThan(t.sqrtPriceNextX96,l))?l:t.sqrtPriceNextX96,c.liquidity,c.amountSpecifiedRemaining,e),d?(c.amountSpecifiedRemaining=tn.subtract(c.amountSpecifiedRemaining,tn.add(t.amountIn,t.feeAmount)),c.amountCalculated=tn.subtract(c.amountCalculated,t.amountOut)):(c.amountSpecifiedRemaining=tn.add(c.amountSpecifiedRemaining,t.amountOut),c.amountCalculated=tn.add(c.amountCalculated,tn.add(t.amountIn,t.feeAmount))),tn.equal(c.sqrtPriceX96,t.sqrtPriceNextX96)){if(t.initialized){let e=tn.BigInt((yield o.getTick(t.tickNext)).liquidityNet);a&&(e=tn.multiply(e,wk)),c.liquidity=UC.addDelta(c.liquidity,e)}c.tick=a?t.tickNext-1:t.tickNext}else tn.notEqual(c.sqrtPriceX96,t.sqrtPriceStartX96)&&(c.tick=BC.getTickAtSqrtRatio(c.sqrtPriceX96))}return{amountCalculated:c.amountCalculated,sqrtRatioX96:c.sqrtPriceX96,liquidity:c.liquidity,tickCurrent:c.tick}}))}(tn.BigInt(this.fee),this.sqrtRatioX96,this.tickCurrent,this.liquidity,this.tickSpacing,this.tickDataProvider,e,t,n)}))}get tickSpacing(){return Ak[this.fee]}},ij=class e{constructor({pool:e,liquidity:t,tickLower:n,tickUpper:r}){this._token0Amount=null,this._token1Amount=null,this._mintAmounts=null,nn(n<r,"TICK_ORDER"),nn(n>=BC.MIN_TICK&&n%e.tickSpacing==0,"TICK_LOWER"),nn(r<=BC.MAX_TICK&&r%e.tickSpacing==0,"TICK_UPPER"),this.pool=e,this.tickLower=n,this.tickUpper=r,this.liquidity=tn.BigInt(t)}get token0PriceLower(){return _C(this.pool.token0,this.pool.token1,this.tickLower)}get token0PriceUpper(){return _C(this.pool.token0,this.pool.token1,this.tickUpper)}get amount0(){return null===this._token0Amount&&(this.pool.tickCurrent<this.tickLower?this._token0Amount=rk.fromRawAmount(this.pool.token0,FC.getAmount0Delta(BC.getSqrtRatioAtTick(this.tickLower),BC.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1)):this.pool.tickCurrent<this.tickUpper?this._token0Amount=rk.fromRawAmount(this.pool.token0,FC.getAmount0Delta(this.pool.sqrtRatioX96,BC.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1)):this._token0Amount=rk.fromRawAmount(this.pool.token0,kk)),this._token0Amount}get amount1(){return null===this._token1Amount&&(this.pool.tickCurrent<this.tickLower?this._token1Amount=rk.fromRawAmount(this.pool.token1,kk):this.pool.tickCurrent<this.tickUpper?this._token1Amount=rk.fromRawAmount(this.pool.token1,FC.getAmount1Delta(BC.getSqrtRatioAtTick(this.tickLower),this.pool.sqrtRatioX96,this.liquidity,!1)):this._token1Amount=rk.fromRawAmount(this.pool.token1,FC.getAmount1Delta(BC.getSqrtRatioAtTick(this.tickLower),BC.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1))),this._token1Amount}ratiosAfterSlippage(e){const t=this.pool.token0Price.asFraction.multiply(new ak(1).subtract(e)),n=this.pool.token0Price.asFraction.multiply(e.add(1));let r=QC(t.numerator,t.denominator);tn.lessThanOrEqual(r,BC.MIN_SQRT_RATIO)&&(r=tn.add(BC.MIN_SQRT_RATIO,tn.BigInt(1)));let i=QC(n.numerator,n.denominator);return tn.greaterThanOrEqual(i,BC.MAX_SQRT_RATIO)&&(i=tn.subtract(BC.MAX_SQRT_RATIO,tn.BigInt(1))),{sqrtRatioX96Lower:r,sqrtRatioX96Upper:i}}mintAmountsWithSlippage(t){const{sqrtRatioX96Upper:n,sqrtRatioX96Lower:r}=this.ratiosAfterSlippage(t),i=new rj(this.pool.token0,this.pool.token1,this.pool.fee,r,0,BC.getTickAtSqrtRatio(r)),o=new rj(this.pool.token0,this.pool.token1,this.pool.fee,n,0,BC.getTickAtSqrtRatio(n)),a=e.fromAmounts(Object.assign(Object.assign({pool:this.pool,tickLower:this.tickLower,tickUpper:this.tickUpper},this.mintAmounts),{useFullPrecision:!1})),{amount0:s}=new e({pool:o,liquidity:a.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).mintAmounts,{amount1:l}=new e({pool:i,liquidity:a.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).mintAmounts;return{amount0:s,amount1:l}}burnAmountsWithSlippage(t){const{sqrtRatioX96Upper:n,sqrtRatioX96Lower:r}=this.ratiosAfterSlippage(t),i=new rj(this.pool.token0,this.pool.token1,this.pool.fee,r,0,BC.getTickAtSqrtRatio(r)),o=new rj(this.pool.token0,this.pool.token1,this.pool.fee,n,0,BC.getTickAtSqrtRatio(n)),a=new e({pool:o,liquidity:this.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).amount0,s=new e({pool:i,liquidity:this.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).amount1;return{amount0:a.quotient,amount1:s.quotient}}get mintAmounts(){return null===this._mintAmounts?this.pool.tickCurrent<this.tickLower?{amount0:FC.getAmount0Delta(BC.getSqrtRatioAtTick(this.tickLower),BC.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!0),amount1:kk}:this.pool.tickCurrent<this.tickUpper?{amount0:FC.getAmount0Delta(this.pool.sqrtRatioX96,BC.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!0),amount1:FC.getAmount1Delta(BC.getSqrtRatioAtTick(this.tickLower),this.pool.sqrtRatioX96,this.liquidity,!0)}:{amount0:kk,amount1:FC.getAmount1Delta(BC.getSqrtRatioAtTick(this.tickLower),BC.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!0)}:this._mintAmounts}static fromAmounts({pool:t,tickLower:n,tickUpper:r,amount0:i,amount1:o,useFullPrecision:a}){const s=BC.getSqrtRatioAtTick(n),l=BC.getSqrtRatioAtTick(r);return new e({pool:t,tickLower:n,tickUpper:r,liquidity:JC(t.sqrtRatioX96,s,l,i,o,a)})}static fromAmount0({pool:t,tickLower:n,tickUpper:r,amount0:i,useFullPrecision:o}){return e.fromAmounts({pool:t,tickLower:n,tickUpper:r,amount0:i,amount1:$w,useFullPrecision:o})}static fromAmount1({pool:t,tickLower:n,tickUpper:r,amount1:i}){return e.fromAmounts({pool:t,tickLower:n,tickUpper:r,amount0:$w,amount1:i,useFullPrecision:!0})}};var oj=[{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"}];class aj{constructor(){}static encodeMulticall(e){return Array.isArray(e)||(e=[e]),1===e.length?e[0]:aj.INTERFACE.encodeFunctionData("multicall",[e])}static decodeMulticall(e){return aj.INTERFACE.decodeFunctionData("multicall",e).data}}aj.INTERFACE=new EC(oj);var sj=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH9",type:"address"},{internalType:"address",name:"_tokenDescriptor_",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Collect",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint128",name:"liquidity",type:"uint128"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"DecreaseLiquidity",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint128",name:"liquidity",type:"uint128"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"IncreaseLiquidity",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"WETH9",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"baseURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint128",name:"amount0Max",type:"uint128"},{internalType:"uint128",name:"amount1Max",type:"uint128"}],internalType:"struct INonfungiblePositionManager.CollectParams",name:"params",type:"tuple"}],name:"collect",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token0",type:"address"},{internalType:"address",name:"token1",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint160",name:"sqrtPriceX96",type:"uint160"}],name:"createAndInitializePoolIfNecessary",outputs:[{internalType:"address",name:"pool",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint128",name:"liquidity",type:"uint128"},{internalType:"uint256",name:"amount0Min",type:"uint256"},{internalType:"uint256",name:"amount1Min",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"}],internalType:"struct INonfungiblePositionManager.DecreaseLiquidityParams",name:"params",type:"tuple"}],name:"decreaseLiquidity",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"amount0Desired",type:"uint256"},{internalType:"uint256",name:"amount1Desired",type:"uint256"},{internalType:"uint256",name:"amount0Min",type:"uint256"},{internalType:"uint256",name:"amount1Min",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"}],internalType:"struct INonfungiblePositionManager.IncreaseLiquidityParams",name:"params",type:"tuple"}],name:"increaseLiquidity",outputs:[{internalType:"uint128",name:"liquidity",type:"uint128"},{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"token0",type:"address"},{internalType:"address",name:"token1",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"},{internalType:"uint256",name:"amount0Desired",type:"uint256"},{internalType:"uint256",name:"amount1Desired",type:"uint256"},{internalType:"uint256",name:"amount0Min",type:"uint256"},{internalType:"uint256",name:"amount1Min",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],internalType:"struct INonfungiblePositionManager.MintParams",name:"params",type:"tuple"}],name:"mint",outputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint128",name:"liquidity",type:"uint128"},{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"positions",outputs:[{internalType:"uint96",name:"nonce",type:"uint96"},{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"token0",type:"address"},{internalType:"address",name:"token1",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"},{internalType:"uint128",name:"liquidity",type:"uint128"},{internalType:"uint256",name:"feeGrowthInside0LastX128",type:"uint256"},{internalType:"uint256",name:"feeGrowthInside1LastX128",type:"uint256"},{internalType:"uint128",name:"tokensOwed0",type:"uint128"},{internalType:"uint128",name:"tokensOwed1",type:"uint128"}],stateMutability:"view",type:"function"},{inputs:[],name:"refundETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowed",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowedIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"sweepToken",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenOfOwnerByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount0Owed",type:"uint256"},{internalType:"uint256",name:"amount1Owed",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"uniswapV3MintCallback",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"unwrapWETH9",outputs:[],stateMutability:"payable",type:"function"},{stateMutability:"payable",type:"receive"}],lj=[{inputs:[],name:"refundETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"sweepToken",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"sweepTokenWithFee",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"unwrapWETH9",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"unwrapWETH9WithFee",outputs:[],stateMutability:"payable",type:"function"}];class dj{constructor(){}static encodeFeeBips(e){return zC(e.multiply(1e4).quotient)}static encodeUnwrapWETH9(e,t,n){if(t=dk(t),n){const r=this.encodeFeeBips(n.fee),i=dk(n.recipient);return dj.INTERFACE.encodeFunctionData("unwrapWETH9WithFee",[zC(e),t,r,i])}return dj.INTERFACE.encodeFunctionData("unwrapWETH9",[zC(e),t])}static encodeSweepToken(e,t,n,r){if(n=dk(n),r){const i=this.encodeFeeBips(r.fee),o=dk(r.recipient);return dj.INTERFACE.encodeFunctionData("sweepTokenWithFee",[e.address,zC(t),n,i,o])}return dj.INTERFACE.encodeFunctionData("sweepToken",[e.address,zC(t),n])}static encodeRefundETH(){return dj.INTERFACE.encodeFunctionData("refundETH")}}dj.INTERFACE=new EC(lj);var cj=[{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowed",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowedIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitIfNecessary",outputs:[],stateMutability:"payable",type:"function"}];class uj{constructor(){}static encodePermit(e,t){return"nonce"in t?uj.INTERFACE.encodeFunctionData("selfPermitAllowed",[e.address,zC(t.nonce),zC(t.expiry),t.v,t.r,t.s]):uj.INTERFACE.encodeFunctionData("selfPermit",[e.address,zC(t.amount),zC(t.deadline),t.v,t.r,t.s])}}uj.INTERFACE=new EC(cj);const pj=zC(tn.subtract(tn.exponentiate(tn.BigInt(2),tn.BigInt(128)),tn.BigInt(1)));function hj(e){return Object.keys(e).some((e=>"recipient"===e))}const mj={Permit:[{name:"spender",type:"address"},{name:"tokenId",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]};class fj{constructor(){}static encodeCreate(e){return fj.INTERFACE.encodeFunctionData("createAndInitializePoolIfNecessary",[e.token0.address,e.token1.address,e.fee,zC(e.sqrtRatioX96)])}static createCallParameters(e){return{calldata:this.encodeCreate(e),value:zC(0)}}static addCallParameters(e,t){nn(tn.greaterThan(e.liquidity,kk),"ZERO_LIQUIDITY");const n=[],{amount0:r,amount1:i}=e.mintAmounts,o=e.mintAmountsWithSlippage(t.slippageTolerance),a=zC(o.amount0),s=zC(o.amount1),l=zC(t.deadline);if(hj(t)&&t.createPool&&n.push(this.encodeCreate(e.pool)),t.token0Permit&&n.push(uj.encodePermit(e.pool.token0,t.token0Permit)),t.token1Permit&&n.push(uj.encodePermit(e.pool.token1,t.token1Permit)),hj(t)){const o=dk(t.recipient);n.push(fj.INTERFACE.encodeFunctionData("mint",[{token0:e.pool.token0.address,token1:e.pool.token1.address,fee:e.pool.fee,tickLower:e.tickLower,tickUpper:e.tickUpper,amount0Desired:zC(r),amount1Desired:zC(i),amount0Min:a,amount1Min:s,recipient:o,deadline:l}]))}else n.push(fj.INTERFACE.encodeFunctionData("increaseLiquidity",[{tokenId:zC(t.tokenId),amount0Desired:zC(r),amount1Desired:zC(i),amount0Min:a,amount1Min:s,deadline:l}]));let d=zC(0);if(t.useNative){const o=t.useNative.wrapped;nn(e.pool.token0.equals(o)||e.pool.token1.equals(o),"NO_WETH");const a=e.pool.token0.equals(o)?r:i;tn.greaterThan(a,kk)&&n.push(dj.encodeRefundETH()),d=zC(a)}return{calldata:aj.encodeMulticall(n),value:d}}static encodeCollect(e){const t=[],n=zC(e.tokenId),r=e.expectedCurrencyOwed0.currency.isNative||e.expectedCurrencyOwed1.currency.isNative,i=dk(e.recipient);if(t.push(fj.INTERFACE.encodeFunctionData("collect",[{tokenId:n,recipient:r?"0x0000000000000000000000000000000000000000":i,amount0Max:pj,amount1Max:pj}])),r){const n=e.expectedCurrencyOwed0.currency.isNative?e.expectedCurrencyOwed0.quotient:e.expectedCurrencyOwed1.quotient,r=e.expectedCurrencyOwed0.currency.isNative?e.expectedCurrencyOwed1.currency:e.expectedCurrencyOwed0.currency,o=e.expectedCurrencyOwed0.currency.isNative?e.expectedCurrencyOwed1.quotient:e.expectedCurrencyOwed0.quotient;t.push(dj.encodeUnwrapWETH9(n,i)),t.push(dj.encodeSweepToken(r,o,i))}return t}static collectCallParameters(e){const t=fj.encodeCollect(e);return{calldata:aj.encodeMulticall(t),value:zC(0)}}static removeCallParameters(e,t){const n=[],r=zC(t.deadline),i=zC(t.tokenId),o=new ij({pool:e.pool,liquidity:t.liquidityPercentage.multiply(e.liquidity).quotient,tickLower:e.tickLower,tickUpper:e.tickUpper});nn(tn.greaterThan(o.liquidity,kk),"ZERO_LIQUIDITY");const{amount0:a,amount1:s}=o.burnAmountsWithSlippage(t.slippageTolerance);t.permit&&n.push(fj.INTERFACE.encodeFunctionData("permit",[dk(t.permit.spender),i,zC(t.permit.deadline),t.permit.v,t.permit.r,t.permit.s])),n.push(fj.INTERFACE.encodeFunctionData("decreaseLiquidity",[{tokenId:i,liquidity:zC(o.liquidity),amount0Min:zC(a),amount1Min:zC(s),deadline:r}]));const l=t.collectOptions,{expectedCurrencyOwed0:d,expectedCurrencyOwed1:c}=l,u=Nn(l,["expectedCurrencyOwed0","expectedCurrencyOwed1"]);return n.push(...fj.encodeCollect(Object.assign({tokenId:zC(t.tokenId),expectedCurrencyOwed0:d.add(rk.fromRawAmount(d.currency,a)),expectedCurrencyOwed1:c.add(rk.fromRawAmount(c.currency,s))},u))),t.liquidityPercentage.equalTo(Ck)?t.burnToken&&n.push(fj.INTERFACE.encodeFunctionData("burn",[i])):nn(!0!==t.burnToken,"CANNOT_BURN"),{calldata:aj.encodeMulticall(n),value:zC(0)}}static safeTransferFromParameters(e){const t=dk(e.recipient),n=dk(e.sender);let r;return r=e.data?fj.INTERFACE.encodeFunctionData("safeTransferFrom(address,address,uint256,bytes)",[n,t,zC(e.tokenId),e.data]):fj.INTERFACE.encodeFunctionData("safeTransferFrom(address,address,uint256)",[n,t,zC(e.tokenId)]),{calldata:r,value:zC(0)}}static getPermitData(e,t,n){return{domain:{name:"Uniswap V3 Positions NFT-V1",chainId:n,version:"1",verifyingContract:t},types:mj,values:e}}}fj.INTERFACE=new EC(sj);var gj=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH9",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH9",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"uint256",name:"amountIn",type:"uint256"}],name:"quoteExactInput",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint160[]",name:"sqrtPriceX96AfterList",type:"uint160[]"},{internalType:"uint32[]",name:"initializedTicksCrossedList",type:"uint32[]"},{internalType:"uint256",name:"gasEstimate",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct IQuoterV2.QuoteExactInputSingleParams",name:"params",type:"tuple"}],name:"quoteExactInputSingle",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint160",name:"sqrtPriceX96After",type:"uint160"},{internalType:"uint32",name:"initializedTicksCrossed",type:"uint32"},{internalType:"uint256",name:"gasEstimate",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"uint256",name:"amountOut",type:"uint256"}],name:"quoteExactOutput",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint160[]",name:"sqrtPriceX96AfterList",type:"uint160[]"},{internalType:"uint32[]",name:"initializedTicksCrossedList",type:"uint32[]"},{internalType:"uint256",name:"gasEstimate",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct IQuoterV2.QuoteExactOutputSingleParams",name:"params",type:"tuple"}],name:"quoteExactOutputSingle",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint160",name:"sqrtPriceX96After",type:"uint160"},{internalType:"uint32",name:"initializedTicksCrossed",type:"uint32"},{internalType:"uint256",name:"gasEstimate",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"int256",name:"amount0Delta",type:"int256"},{internalType:"int256",name:"amount1Delta",type:"int256"},{internalType:"bytes",name:"path",type:"bytes"}],name:"uniswapV3SwapCallback",outputs:[],stateMutability:"view",type:"function"}];new EC([{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH9",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH9",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"uint256",name:"amountIn",type:"uint256"}],name:"quoteExactInput",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],name:"quoteExactInputSingle",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"uint256",name:"amountOut",type:"uint256"}],name:"quoteExactOutput",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],name:"quoteExactOutputSingle",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"int256",name:"amount0Delta",type:"int256"},{internalType:"int256",name:"amount1Delta",type:"int256"},{internalType:"bytes",name:"path",type:"bytes"}],name:"uniswapV3SwapCallback",outputs:[],stateMutability:"view",type:"function"}]),new EC(gj);new EC([{inputs:[{internalType:"contract IUniswapV3Factory",name:"_factory",type:"address"},{internalType:"contract INonfungiblePositionManager",name:"_nonfungiblePositionManager",type:"address"},{internalType:"uint256",name:"_maxIncentiveStartLeadTime",type:"uint256"},{internalType:"uint256",name:"_maxIncentiveDuration",type:"uint256"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"DepositTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{indexed:!0,internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{indexed:!1,internalType:"uint256",name:"startTime",type:"uint256"},{indexed:!1,internalType:"uint256",name:"endTime",type:"uint256"},{indexed:!1,internalType:"address",name:"refundee",type:"address"},{indexed:!1,internalType:"uint256",name:"reward",type:"uint256"}],name:"IncentiveCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"incentiveId",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"refund",type:"uint256"}],name:"IncentiveEnded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"reward",type:"uint256"}],name:"RewardClaimed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!0,internalType:"bytes32",name:"incentiveId",type:"bytes32"},{indexed:!1,internalType:"uint128",name:"liquidity",type:"uint128"}],name:"TokenStaked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!0,internalType:"bytes32",name:"incentiveId",type:"bytes32"}],name:"TokenUnstaked",type:"event"},{inputs:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amountRequested",type:"uint256"}],name:"claimReward",outputs:[{internalType:"uint256",name:"reward",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"},{internalType:"uint256",name:"reward",type:"uint256"}],name:"createIncentive",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"deposits",outputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint48",name:"numberOfStakes",type:"uint48"},{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"}],name:"endIncentive",outputs:[{internalType:"uint256",name:"refund",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"contract IUniswapV3Factory",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getRewardInfo",outputs:[{internalType:"uint256",name:"reward",type:"uint256"},{internalType:"uint160",name:"secondsInsideX128",type:"uint160"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"incentives",outputs:[{internalType:"uint256",name:"totalRewardUnclaimed",type:"uint256"},{internalType:"uint160",name:"totalSecondsClaimedX128",type:"uint160"},{internalType:"uint96",name:"numberOfStakes",type:"uint96"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxIncentiveDuration",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxIncentiveStartLeadTime",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"nonfungiblePositionManager",outputs:[{internalType:"contract INonfungiblePositionManager",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC20Minimal",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"rewards",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"stakeToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes32",name:"incentiveId",type:"bytes32"}],name:"stakes",outputs:[{internalType:"uint160",name:"secondsPerLiquidityInsideInitialX128",type:"uint160"},{internalType:"uint128",name:"liquidity",type:"uint128"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"to",type:"address"}],name:"transferDeposit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"unstakeToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"withdrawToken",outputs:[],stateMutability:"nonpayable",type:"function"}]);function yj({removed:e,inRange:t}){const n=g(),i={py:4,px:8,color:n.palette.success.main,borderRadius:4,backgroundColor:C(n.palette.success.main,.1),typography:"h6"};return e?Os.jsx(A,{title:r._({id:"MZPP7t",message:"Your position has 0 liquidity, and is not earning fees."}),maxWidth:240,children:Os.jsx(f,{sx:Object.assign(Object.assign({},i),{color:n.palette.warning.main,backgroundColor:C(n.palette.warning.main,.1)}),children:r._({id:"D87pha",message:"Closed"})})}):t?Os.jsx(A,{title:r._({id:"aIvv/z",message:"The price of this pool is within your selected range. Your position is currently earning fees."}),maxWidth:240,children:Os.jsx(f,{sx:i,children:r._({id:"vOyUlD",message:"In range"})})}):Os.jsx(A,{title:r._({id:"IwiTcw",message:"The price of this pool is outside of your selected range. Your position is not currently earning fees."}),maxWidth:240,children:Os.jsx(f,{sx:Object.assign(Object.assign({},i),{color:n.palette.error.main,backgroundColor:C(n.palette.error.main,.1)}),children:r._({id:"i3Z+/Z",message:"Out of range"})})})}new EC([{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH9",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH9",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMinimum",type:"uint256"}],internalType:"struct ISwapRouter.ExactInputParams",name:"params",type:"tuple"}],name:"exactInput",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMinimum",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct ISwapRouter.ExactInputSingleParams",name:"params",type:"tuple"}],name:"exactInputSingle",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMaximum",type:"uint256"}],internalType:"struct ISwapRouter.ExactOutputParams",name:"params",type:"tuple"}],name:"exactOutput",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMaximum",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct ISwapRouter.ExactOutputSingleParams",name:"params",type:"tuple"}],name:"exactOutputSingle",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"refundETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowed",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowedIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"sweepToken",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"sweepTokenWithFee",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"int256",name:"amount0Delta",type:"int256"},{internalType:"int256",name:"amount1Delta",type:"int256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"uniswapV3SwapCallback",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"unwrapWETH9",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"unwrapWETH9WithFee",outputs:[],stateMutability:"payable",type:"function"},{stateMutability:"payable",type:"receive"}]);const xj=({token:e,amount:t})=>{var n;const r=g();return Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4},children:[Os.jsx(ey,{address:null!==(n=null==e?void 0:e.address)&&void 0!==n?n:"",chainId:null==e?void 0:e.chainId,noShowChain:!0,width:18,height:18,marginRight:0}),Os.jsxs(f,{sx:{typography:"body1",color:r.palette.text.primary},children:[An({input:t.toSignificant(),decimals:null==e?void 0:e.decimals})," ",null==e?void 0:e.symbol]}),Os.jsx(y,{sx:{display:"flex",alignItems:"center",color:r.palette.text.secondary,"&:hover":{color:r.palette.text.primary}},onClick:()=>{window.open(ps(e.chainId,null==e?void 0:e.address,"address"))},children:Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:Os.jsx("path",{opacity:"0.5",fillRule:"evenodd",clipRule:"evenodd",d:"M3.33333 3.33333V12.6667H12.6667V8H14V12.6667C14 13.4 13.4 14 12.6667 14H3.33333C2.59333 14 2 13.4 2 12.6667V3.33333C2 2.6 2.59333 2 3.33333 2H8V3.33333H3.33333ZM9.33333 3.33333V2H14V6.66667H12.6667V4.27333L6.11333 10.8267L5.17333 9.88667L11.7267 3.33333H9.33333Z",fill:"currentColor"})})})]})},vj=({position:t,inRange:n})=>{var i;const o=g(),a=t.pool.token0,s=t.pool.token1,l=t.pool.chainId,d=(null==t?void 0:t.liquidity)&&tn.equal(null==t?void 0:t.liquidity,tn.BigInt(0)),c=lt((()=>rj.getAddress(t.pool.token0,t.pool.token1,t.pool.fee,void 0,l?Xw[l]:void 0)),[l,t.pool.fee,t.pool.token0,t.pool.token1]);return Os.jsxs(f,{sx:{border:"solid 1px",borderColor:"border.main",borderRadius:8},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:o.spacing(12,20),borderBottomStyle:"solid",borderBottomColor:"border.main",borderBottomWidth:1},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:4},children:[Os.jsxs(f,{sx:{typography:"body2",color:o.palette.text.primary},children:[r._({id:"PVa3KL",message:"Position on"})," ",null==a?void 0:a.symbol,"/",null==s?void 0:s.symbol]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4},children:[Os.jsx(yj,{removed:d,inRange:n}),Os.jsx(f,{sx:{py:4,px:8,color:o.palette.primary.main,borderRadius:4,backgroundColor:C(o.palette.primary.main,.1),typography:"h6"},children:Bn({input:(null===(i=null==t?void 0:t.pool)||void 0===i?void 0:i.fee)/1e6})})]})]}),Os.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:0,typography:"body2",color:o.palette.text.secondary,"&:hover":{color:o.palette.text.primary}},onClick:()=>{window.open(ps(l,c,"address"))},children:[r._({id:"URmyfc",message:"Details"}),Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:Os.jsx("path",{d:"M7.5 5L6.4425 6.0575L9.8775 9.5L6.4425 12.9425L7.5 14L12 9.5L7.5 5Z",fill:"currentColor"})})]})]}),Os.jsxs(f,{sx:{p:o.spacing(12,20)},children:[Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"YHc3B+",message:"My Liquidity"})}),Os.jsxs(f,{sx:{mt:12},children:[Os.jsx(xj,{token:a,amount:t.amount0}),Os.jsx(xj,{token:s,amount:t.amount1})]})]})]})};function bj({price:e,atLimit:t,direction:n}){return t[n]?n===Mw.LOWER?"0":"∞":"string"==typeof e&&"∞"===e?"∞":An({input:"string"==typeof e?e:null==e?void 0:e.toSignificant()})}const Aj=({baseToken:e,quoteToken:t,handleRateToggle:n,sx:r})=>{const i=g(),o=null==e?void 0:e.wrapped,a=null==t?void 0:t.wrapped,s=o&&a&&o.sortsBefore(a);return Os.jsx(f,{component:y,onClick:n,sx:Object.assign({display:"flex",alignItems:"center",p:1,borderRadius:8,backgroundColor:i.palette.border.main},r),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",width:"100%",[i.breakpoints.up("tablet")]:{width:"auto"}},children:[Os.jsx(f,{sx:Object.assign({flexGrow:1,flexShrink:1,flexBasis:"50%",px:12,py:4,borderRadius:7,textAlign:"center",typography:"h6",whiteSpace:"nowrap"},s?{color:i.palette.text.primary,backgroundColor:i.palette.background.paper}:{color:i.palette.text.secondary,backgroundColor:"transparent"}),children:s?e.symbol:null==t?void 0:t.symbol}),Os.jsx(f,{sx:Object.assign({flexGrow:1,flexShrink:1,flexBasis:"50%",px:12,py:4,borderRadius:7,textAlign:"center",typography:"h6",whiteSpace:"nowrap"},s?{color:i.palette.text.secondary,backgroundColor:"transparent"}:{color:i.palette.text.primary,backgroundColor:i.palette.background.paper}),children:s?t.symbol:null==e?void 0:e.symbol})]})})},wj=({position:t,title:n,baseCurrencyDefault:r,ticksAtLimit:i})=>{const o=t.pool.token0,a=t.pool.token1,s=g(),[l,d]=ct(r?r===o?o:r===a?a:o:o),c=l===o,u=c?a:o,p=c?t.pool.priceOf(t.pool.token0):t.pool.priceOf(t.pool.token1),h=c?t.token0PriceLower:t.token0PriceUpper.invert(),m=c?t.token0PriceUpper:t.token0PriceLower.invert(),y=ut((()=>{d(u)}),[u]);return Os.jsxs(Fw,{gap:"md",children:[Os.jsxs(Vw,{children:[n?Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:s.palette.text.secondary},children:n}):Os.jsx("div",{}),Os.jsx(Aj,{baseToken:c?o:a,quoteToken:c?a:o,handleRateToggle:y})]}),Os.jsxs(Vw,{children:[Os.jsxs(Pw,{sx:{width:"48%",py:12,gap:12},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:4},children:[Os.jsx(f,{sx:{color:s.palette.text.primary,typography:"body2"},children:Os.jsx(e,{id:"EQs1sJ",message:"Min price"})}),Os.jsx(f,{sx:{color:s.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"7Z4WfS",message:"{0} per {1}",values:{0:u.symbol,1:l.symbol}})})]}),Os.jsx(f,{sx:{color:s.palette.text.primary,typography:"caption"},children:bj({price:h,atLimit:i,direction:Mw.LOWER})}),Os.jsx(f,{sx:{color:s.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"WgTuci",message:"Your position will be 100% composed of {0} at this price",values:{0:null==l?void 0:l.symbol}})})]}),Os.jsxs(Pw,{sx:{width:"48%",py:12,gap:12},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:4},children:[Os.jsx(f,{sx:{color:s.palette.text.primary,typography:"body2"},children:Os.jsx(e,{id:"5etEUX",message:"Max price"})}),Os.jsx(f,{sx:{color:s.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"7Z4WfS",message:"{0} per {1}",values:{0:u.symbol,1:l.symbol}})})]}),Os.jsx(f,{sx:{color:s.palette.text.primary,typography:"caption"},children:bj({price:m,atLimit:i,direction:Mw.UPPER})}),Os.jsx(f,{sx:{color:s.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"WgTuci",message:"Your position will be 100% composed of {0} at this price",values:{0:null==u?void 0:u.symbol}})})]})]}),Os.jsxs(Pw,{sx:{py:12,flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[Os.jsxs(Fw,{gap:"4px",justify:"flex-start",children:[Os.jsx(f,{sx:{color:s.palette.text.primary,typography:"body2"},children:Os.jsx(e,{id:"DWd30U",message:"Current price"})}),Os.jsx(f,{sx:{color:s.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"7Z4WfS",message:"{0} per {1}",values:{0:u.symbol,1:l.symbol}})})]}),Os.jsx(f,{sx:{color:s.palette.text.primary,typography:"caption"},children:`${An({input:p.toSignificant()})} `})]})]})},kj=({chainId:e,disabled:t,removed:n,isLoading:i,error:o,onConfirm:a})=>Os.jsx(sb,{includeButton:!0,fullWidth:!0,chainId:e,children:Os.jsx(T,{fullWidth:!0,size:T.Size.big,onClick:a,disabled:t,isLoading:i,children:n?r._({id:"D87pha",message:"Closed"}):null!=o?o:r._({id:"t/YqKh",message:"Remove"})})});function Cj({tokens:e,width:t=24,height:n=24,gap:r=-4,cross:i,mr:o,chainId:a,showChainLogo:s,sx:l}){var d;const c=g(),{onlyChainId:u}=pf(),p=s&&!u,h=t/2;return!e||e.length<=0?Os.jsx(f,{sx:Object.assign({display:"inline-flex",alignItems:"center",mr:o,position:"relative",zIndex:0},l),children:Os.jsx(f,{component:"svg",xmlns:"http://www.w3.org/2000/svg",width:52,height:24,viewBox:"0 0 52 24",fill:"none",sx:{height:t,width:"auto",color:C(c.palette.text.primary,"light"===c.palette.mode?.11:.13),animation:"pulseKeyframe 2s ease-in-out 0.5s infinite","@keyframes pulseKeyframe":{"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}},children:Os.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M21.3746 4.50813C19.1755 1.76008 15.7933 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24C15.7933 24 19.1755 22.2399 21.3746 19.4919C19.8788 17.3743 19 14.7898 19 12C19 9.21023 19.8788 6.62571 21.3746 4.50813ZM22 5.36441C24.1498 2.13102 27.8261 0 32 0C38.3911 0 43.6152 4.99623 43.9797 11.296C41.0986 12.163 39 14.8364 39 18C39 19.1371 39.2711 20.2108 39.7523 21.1602C37.6611 22.9317 34.9553 24 32 24C27.8261 24 24.1498 21.869 22 18.6356C20.7363 16.735 20 14.4535 20 12C20 9.54653 20.7363 7.26502 22 5.36441ZM52 18C52 21.3137 49.3137 24 46 24C43.5588 24 41.458 22.542 40.5211 20.4493C40.5042 20.4116 40.4876 20.3736 40.4715 20.3355C40.1679 19.6176 40 18.8284 40 18C40 15.3894 41.6673 13.1682 43.9952 12.3431C44.6221 12.1209 45.2969 12 46 12C49.3137 12 52 14.6863 52 18Z",fill:"currentColor"})})}):Os.jsxs(f,{sx:Object.assign({display:"inline-flex",alignItems:"center",mr:o,position:"relative",zIndex:0},l),children:[e.map(((e,n)=>Os.jsx(f,{sx:{display:"inline-flex",width:t,height:t,ml:n>0?r:0,borderRadius:"50%",backgroundColor:c.palette.background.default},children:"object"==typeof e?Os.jsx(ey,{address:e.address,width:t,height:t,chainId:a,url:e.logoURI,cross:i,noShowChain:!0,noBorder:!0,marginRight:0}):Os.jsx(f,{component:"img",height:t,src:e})},n))),p&&_g.has(a)?Os.jsx(f,{component:null===(d=_g.get(a))||void 0===d?void 0:d.logo,sx:{position:"absolute",bottom:0,right:0,zIndex:e.length+1,transform:"translateX(50%)",width:h,height:h}}):""]})}const jj=({sx:e})=>{const t=g();return Os.jsx(f,{sx:Object.assign({py:4,px:8,color:t.palette.primary.main,borderRadius:4,backgroundColor:C(t.palette.primary.main,.1),typography:"h6"},e),children:r._({id:"m8r/Yx",message:"AMM V3"})})},Tj=({position:t,title:n,inRange:r,baseCurrencyDefault:i,ticksAtLimit:o})=>{var a,s,l;const d=t.pool.token0,c=t.pool.token1,u=(null==t?void 0:t.liquidity)&&tn.equal(null==t?void 0:t.liquidity,tn.BigInt(0));return Os.jsxs(Fw,{gap:"md",style:{marginTop:"0.5rem"},children:[Os.jsxs(Vw,{style:{gap:4},children:[Os.jsxs(Uw,{children:[Os.jsx(Cj,{tokens:[{address:d.address},{address:c.address}],mr:8}),Os.jsxs(f,{sx:{typography:"h5"},children:[null==d?void 0:d.symbol," / ",null==c?void 0:c.symbol]})]}),Os.jsx(jj,{sx:{ml:"auto"}}),Os.jsx(yj,{removed:u,inRange:r})]}),Os.jsxs(Pw,{children:[Os.jsxs(Fw,{gap:"md",children:[Os.jsxs(Vw,{children:[Os.jsxs(Uw,{children:[Os.jsx(ey,{address:null!==(a=null==d?void 0:d.address)&&void 0!==a?a:"",chainId:null==d?void 0:d.chainId,noShowChain:!0,width:32,height:32,marginRight:0}),Os.jsx(f,{sx:{ml:8},children:null==d?void 0:d.symbol})]}),Os.jsx(Uw,{children:Os.jsx(f,{sx:{mr:8},children:An({input:t.amount0.toSignificant(),decimals:null==d?void 0:d.decimals})})})]}),Os.jsxs(Vw,{children:[Os.jsxs(Uw,{children:[Os.jsx(ey,{address:null!==(s=null==c?void 0:c.address)&&void 0!==s?s:"",chainId:null==c?void 0:c.chainId,noShowChain:!0,width:32,height:32,marginRight:0}),Os.jsx(f,{ml:"8px",children:null==c?void 0:c.symbol})]}),Os.jsx(Uw,{children:Os.jsx(f,{mr:"8px",children:An({input:t.amount1.toSignificant(),decimals:null==c?void 0:c.decimals})})})]})]}),Os.jsxs(Vw,{children:[Os.jsx(f,{children:Os.jsx(e,{id:"EU3wU4",message:"Fee tier"})}),Os.jsx(f,{children:Bn({input:(null===(l=null==t?void 0:t.pool)||void 0===l?void 0:l.fee)/1e6})})]})]}),Os.jsx(wj,{position:t,title:n,baseCurrencyDefault:i,ticksAtLimit:o})]})},Ej=({on:e,onClose:t,position:n,outOfRange:i,ticksAtLimit:o,onConfirm:a,loading:s})=>{const{isMobile:l}=wy();return Os.jsx(yy,{open:e,onClose:t,modal:!0,title:r._({id:"E6MqGy",message:"Add liquidity"}),height:683,children:Os.jsxs(f,{sx:{flex:1,px:20,pb:24,display:"flex",flexDirection:"column",justifyContent:"space-between",width:l?void 0:420},children:[Os.jsx(f,{sx:{pt:0,px:0},children:n?Os.jsx(Tj,{position:n,inRange:!i,ticksAtLimit:o,title:r._({id:"3VUfrF",message:"Selected Range"})}):null}),Os.jsx(T,{size:T.Size.big,fullWidth:!0,isLoading:s,sx:{mt:20},onClick:a,children:r._({id:"m16xKo",message:"Add"})})]})})};class Sj{static getPoolAddress(e,t,n,r,i){this.addresses.length>this.MAX_ENTRIES&&(this.addresses=this.addresses.slice(0,this.MAX_ENTRIES/2));const{address:o}=t,{address:a}=n,s=`${e}:${o}:${a}:${r.toString()}`,l=this.addresses.find((e=>e.key===s));if(l)return l.address;const d={key:s,address:IC({factoryAddress:e,tokenA:t,tokenB:n,fee:r,chainId:i})};return this.addresses.unshift(d),d.address}static getPool(e,t,n,r,i,o){this.pools.length>this.MAX_ENTRIES&&(this.pools=this.pools.slice(0,this.MAX_ENTRIES/2));const a=this.pools.find((a=>a.token0===e&&a.token1===t&&a.fee===n&&tn.EQ(a.sqrtRatioX96,r)&&tn.EQ(a.liquidity,i)&&a.tickCurrent===o));if(a)return a;const s=new rj(e,t,n,r,i,o);return this.pools.unshift(s),s}}var Ij;function Rj(e,t,n){const r=lt((()=>[[e,t,n]]),[e,t,n]);return function(e,t){const n=lt((()=>e?t.map((([e,t,n])=>{if(e&&t&&n){const r=e.wrapped,i=t.wrapped;if(r.equals(i))return;return r.sortsBefore(i)?[r,i,n]:[i,r,n]}})):new Array(t.length)),[e,t]),r=lt((()=>{const t=e&&Xw[e];return t?n.map((n=>n&&Sj.getPoolAddress(t,...n,e))):new Array(n.length)}),[e,n]),{data:i}=St({queries:r.map((t=>ts.getV3PoolSlot0(e,t))),combine:e=>({data:e.map((e=>e.data))})}),{data:o}=St({queries:r.map((t=>ts.getV3PoolLiquidity(e,t))),combine:e=>({data:e.map((e=>e.data))})});return lt((()=>t.map(((e,t)=>{const r=n[t];if(!r)return[Ij.INVALID,null];const[a,s,l]=r;if(!i[t])return[Ij.NOT_EXISTS,null];const d=i[t];if(!o[t])return[Ij.NOT_EXISTS,null];const c=o[t];if(!d||!c)return[Ij.NOT_EXISTS,null];if(!d.sqrtPriceX96||d.sqrtPriceX96.eq(0))return[Ij.NOT_EXISTS,null];try{const e=Sj.getPool(a,s,l,d.sqrtPriceX96,c[0],d.tick);return[Ij.EXISTS,e]}catch(e){return console.error(e,{tags:{file:"usePools",function:"usePools"},extra:{token0:a.address,token1:s.address,chainId:a.chainId,fee:l}}),[Ij.NOT_EXISTS,null]}}))),[o,t,i,n])}(null==e?void 0:e.chainId,r)[0]}Sj.MAX_ENTRIES=128,Sj.pools=[],Sj.addresses=[],function(e){e[e.LOADING=0]="LOADING",e[e.NOT_EXISTS=1]="NOT_EXISTS",e[e.EXISTS=2]="EXISTS",e[e.INVALID=3]="INVALID"}(Ij||(Ij={}));let Lj=class e{constructor(e){const t=ue[e];this.chainId=e,this.decimals=t.decimals,this.name=t.name,this.symbol=t.symbol,this.isNative=!0,this.isToken=!1,this.address=Mj(this.chainId)}equals(e){return e.isNative&&e.chainId===this.chainId}get wrapped(){const e=ue[this.chainId];return new uk(this.chainId,e.wrappedTokenAddress,e.decimals,e.wrappedTokenSymbol,e.name)}static onChain(t){var n;return null!==(n=this._cachedNativeCurrency[t])&&void 0!==n?n:this._cachedNativeCurrency[t]=new e(t)}};function Mj(e){return ue[e].address}function Oj(e,t){const n=null==e?void 0:e.toLowerCase(),r=null==t?void 0:t.toLowerCase();return null!==n&&null!==r&&n===r}Lj._cachedNativeCurrency={};const Bj=(e,t)=>!t||Oj(t,Mj(e));function Pj(e){if(!e)return;const{name:t,chainId:n,address:r,decimals:i,symbol:o}=e;return function(e,t){return!Bj(e,t)}(n,r)?new uk(n,r,i,null!=o?o:void 0,null!=t?t:void 0):new Lj(n)}function Dj(e){var t,n;if(e)return{chainId:e.chainId,address:e.address,decimals:e.decimals,symbol:null!==(t=e.symbol)&&void 0!==t?t:"",name:null!==(n=e.name)&&void 0!==n?n:""}}function Nj(e,t,n){if(e&&t&&"number"==typeof n)return _C(e,t,n)}const Fj=new Yn("units/5.7.0"),Wj=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Vj(e,t){if("string"==typeof t){const e=Wj.indexOf(t);-1!==e&&(t=3*e)}return ie(e,null!=t?t:18)}function Uj(e,t){if("string"!=typeof e&&Fj.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=Wj.indexOf(t);-1!==e&&(t=3*e)}return re(e,null!=t?t:18)}var Hj,qj=Object.freeze({__proto__:null,commify:function(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&Fj.throwArgumentError("invalid value","value",e);let n=t[0],r="";for("-"===n.substring(0,1)&&(r="-",n=n.substring(1));"0"===n.substring(0,1);)n=n.substring(1);""===n&&(n="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const o=[];for(;n.length;){if(n.length<=3){o.unshift(n);break}{const e=n.length-3;o.unshift(n.substring(e)),n=n.substring(0,e)}}return r+o.join(",")+i},formatEther:function(e){return Vj(e,18)},formatUnits:Vj,parseEther:function(e){return Uj(e,18)},parseUnits:Uj});function Zj(e,t){if(e&&t&&!isNaN(parseFloat(e)))try{const n=Uj(function(e,t){const n=e.split(/[.,]/),r=e.includes(".")?".":",";return n.length>1&&n[1].length>t?n[0]+r+n[1].slice(0,t):e}(e,t.decimals),t.decimals).toString();if("0"!==n)return rk.fromRawAmount(t,tn.BigInt(n))}catch(t){console.error("tryParseCurrencyAmount","tryParseCurrencyAmount",`Failed to parse input amount: "${e}"`,t)}}function zj(e,t,n,r){if(!(e&&t&&n&&r))return;const i=function(e,t,n){var r;if(!e||!t||!n)return;if(!n.match(/^\d*\.?\d+$/))return;const[i,o]=n.split("."),a=null!==(r=null==o?void 0:o.length)&&void 0!==r?r:0,s=tn.BigInt((null!=i?i:"")+(null!=o?o:""));return new sk(e,t,tn.multiply(tn.BigInt(10**a),tn.BigInt(10**e.decimals)),tn.multiply(s,tn.BigInt(10**t.decimals)))}(e,t,r);if(!i)return;let o;const a=QC(i.numerator,i.denominator);return o=tn.greaterThanOrEqual(a,BC.MAX_SQRT_RATIO)?BC.MAX_TICK:tn.lessThanOrEqual(a,BC.MIN_SQRT_RATIO)?BC.MIN_TICK:$C(i),KC(o,Ak[n])}function Qj({state:e,existingPosition:t}){var n,i,o,a,s,l,d,c,u,p,h,m,f;const{account:g,chainId:y}=hf(),{feeAmount:x,independentField:v,typedValue:b,leftRangeTypedValue:A,rightRangeTypedValue:w,startPriceTypedValue:k}=e,C=null!==(n=e.baseToken)&&void 0!==n?n:void 0,j=null!==(i=e.baseToken)&&void 0!==i?i:void 0,T=null!==(o=e.quoteToken)&&void 0!==o?o:void 0,E=v===Lw.CURRENCY_A?Lw.CURRENCY_B:Lw.CURRENCY_A,S=lt((()=>({[Lw.CURRENCY_A]:C,[Lw.CURRENCY_B]:T})),[C,T]),[I,R,L]=lt((()=>[null==C?void 0:C.wrapped,null==T?void 0:T.wrapped,null==j?void 0:j.wrapped]),[C,T,j]),[M,O]=lt((()=>I&&R?I.sortsBefore(R)?[I,R]:[R,I]:[void 0,void 0]),[I,R]),B=It($a.getFetchTokenQuery(null===(a=S[Lw.CURRENCY_A])||void 0===a?void 0:a.chainId,null===(s=S[Lw.CURRENCY_A])||void 0===s?void 0:s.address,g)),P=It($a.getFetchTokenQuery(null===(l=S[Lw.CURRENCY_B])||void 0===l?void 0:l.chainId,null===(d=S[Lw.CURRENCY_B])||void 0===d?void 0:d.address,g)),D=lt((()=>{var e,t,n,r,i,o;return{[Lw.CURRENCY_A]:S[Lw.CURRENCY_A]?(null===(e=B.data)||void 0===e?void 0:e.balance)?rk.fromRawAmount(S[Lw.CURRENCY_A],tn.BigInt(null===(t=B.data)||void 0===t?void 0:t.balance.multipliedBy(Math.pow(10,null!==(n=S[Lw.CURRENCY_A].decimals)&&void 0!==n?n:18)).toString())):rk.fromRawAmount(S[Lw.CURRENCY_A],0):void 0,[Lw.CURRENCY_B]:S[Lw.CURRENCY_B]?(null===(r=P.data)||void 0===r?void 0:r.balance)?rk.fromRawAmount(S[Lw.CURRENCY_B],tn.BigInt(null===(i=P.data)||void 0===i?void 0:i.balance.multipliedBy(Math.pow(10,null!==(o=S[Lw.CURRENCY_B].decimals)&&void 0!==o?o:18)).toString())):rk.fromRawAmount(S[Lw.CURRENCY_B],0):void 0}}),[S,null===(c=B.data)||void 0===c?void 0:c.balance,null===(u=P.data)||void 0===u?void 0:u.balance]),[N,F]=Rj(S[Lw.CURRENCY_A],S[Lw.CURRENCY_B],x),W=N===Ij.NOT_EXISTS,V=Boolean(L&&M&&!L.equals(M)),U=lt((()=>{var e;if(!W)return F&&M?F.priceOf(M):void 0;{const t=Zj(k,V?M:O);if(t&&M&&O){const n=Zj("1",V?O:M),r=n&&t?new sk(n.currency,t.currency,n.quotient,t.quotient):void 0;return null!==(e=V?null==r?void 0:r.invert():r)&&void 0!==e?e:void 0}}}),[W,k,V,O,M,F]),H=lt((()=>{const e=U?QC(U.numerator,U.denominator):void 0;return U&&e&&!(tn.greaterThanOrEqual(e,BC.MIN_SQRT_RATIO)&&tn.lessThan(e,BC.MAX_SQRT_RATIO))}),[U]),q=lt((()=>{if(I&&R&&x&&U&&!H){const e=$C(U),t=BC.getSqrtRatioAtTick(e);return new rj(I,R,x,t,tn.BigInt(0),e,[])}}),[x,H,U,I,R]),Z=null!=F?F:q,z=lt((()=>({[Mw.LOWER]:x?KC(BC.MIN_TICK,Ak[x]):void 0,[Mw.UPPER]:x?KC(BC.MAX_TICK,Ak[x]):void 0})),[x]),Q=lt((()=>({[Mw.LOWER]:"number"==typeof(null==t?void 0:t.tickLower)?t.tickLower:V&&"boolean"==typeof w||!V&&"boolean"==typeof A?z[Mw.LOWER]:V?zj(O,M,x,w.toString()):zj(M,O,x,A.toString()),[Mw.UPPER]:"number"==typeof(null==t?void 0:t.tickUpper)?t.tickUpper:!V&&"boolean"==typeof w||V&&"boolean"==typeof A?z[Mw.UPPER]:V?zj(O,M,x,A.toString()):zj(M,O,x,w.toString())})),[t,x,V,A,w,z,M,O]),{[Mw.LOWER]:G,[Mw.UPPER]:Y}=Q||{},X=lt((()=>({[Mw.LOWER]:x&&G===z.LOWER,[Mw.UPPER]:x&&Y===z.UPPER})),[z,G,Y,x]),J=Boolean("number"==typeof G&&"number"==typeof Y&&G>=Y),K=lt((()=>({[Mw.LOWER]:Nj(M,O,z.LOWER),[Mw.UPPER]:Nj(M,O,z.UPPER)})),[M,O,z.LOWER,z.UPPER]),_=lt((()=>({[Mw.LOWER]:Nj(M,O,Q[Mw.LOWER]),[Mw.UPPER]:Nj(M,O,Q[Mw.UPPER])})),[M,O,Q]),{[Mw.LOWER]:$,[Mw.UPPER]:ee}=_,te=Boolean(!J&&U&&$&&ee&&(U.lessThan($)||U.greaterThan(ee))),ne=Zj(b,S[v]),re=lt((()=>{const e=null==ne?void 0:ne.wrapped,t=E===Lw.CURRENCY_B?T:C;if(ne&&e&&"number"==typeof G&&"number"==typeof Y&&Z){if(te||J)return;const n=e.currency.equals(Z.token0)?ij.fromAmount0({pool:Z,tickLower:G,tickUpper:Y,amount0:ne.quotient,useFullPrecision:!0}):ij.fromAmount1({pool:Z,tickLower:G,tickUpper:Y,amount1:ne.quotient}),r=e.currency.equals(Z.token0)?n.amount1:n.amount0;return t&&rk.fromRawAmount(t,r.quotient)}}),[ne,te,E,T,C,G,Y,Z,J]),ie=lt((()=>({[Lw.CURRENCY_A]:v===Lw.CURRENCY_A?ne:re,[Lw.CURRENCY_B]:v===Lw.CURRENCY_A?re:ne})),[re,ne,v]),oe=Boolean("number"==typeof Y&&Z&&Z.tickCurrent>=Y),ae=Boolean("number"==typeof G&&Z&&Z.tickCurrent<=G),se=J||Boolean(oe&&Z&&I&&Z.token0.equals(I)||ae&&Z&&I&&Z.token1.equals(I)),le=J||Boolean(oe&&Z&&R&&Z.token0.equals(R)||ae&&Z&&R&&Z.token1.equals(R)),{inputTax:de,outputTax:ce}=function(e,t,n){const[{inputTax:r,outputTax:i},o]=ct({inputTax:xk,outputTax:xk});return{inputTax:r,outputTax:i}}((null==C?void 0:C.isToken)&&C.address,(null==T?void 0:T.isToken)&&T.address),ue=lt((()=>{var e,t;if(!Z||!I||!R||"number"!=typeof G||"number"!=typeof Y||J)return;const n=oe?gk:null===(e=null==ie?void 0:ie[I.equals(Z.token0)?Lw.CURRENCY_A:Lw.CURRENCY_B])||void 0===e?void 0:e.quotient,r=ae?gk:null===(t=null==ie?void 0:ie[I.equals(Z.token0)?Lw.CURRENCY_B:Lw.CURRENCY_A])||void 0===t?void 0:t.quotient;return void 0!==n&&void 0!==r?ij.fromAmounts({pool:Z,tickLower:G,tickUpper:Y,amount0:n,amount1:r,useFullPrecision:!0}):void 0}),[ie,Z,I,R,oe,ae,J,G,Y]);let pe;g||(pe=r._({id:"r7ScnQ",message:"Connect to a wallet"})),N===Ij.INVALID&&(pe=null!=pe?pe:r._({id:"R7D79P",message:"Invalid pair"})),H&&(pe=null!=pe?pe:r._({id:"HXBqgG",message:"Invalid price input"})),(ie[Lw.CURRENCY_A]||se)&&(ie[Lw.CURRENCY_B]||le)||(pe=null!=pe?pe:r._({id:"iPMIoT",message:"Enter an amount"}));const{[Lw.CURRENCY_A]:he,[Lw.CURRENCY_B]:me}=ie;he&&(null===(p=null==D?void 0:D[Lw.CURRENCY_A])||void 0===p?void 0:p.lessThan(he))&&(pe=r._({id:"m6RmA/",message:"Insufficient {0} balance",values:{0:null===(h=S[Lw.CURRENCY_A])||void 0===h?void 0:h.symbol}})),me&&(null===(m=null==D?void 0:D[Lw.CURRENCY_B])||void 0===m?void 0:m.lessThan(me))&&(pe=r._({id:"m6RmA/",message:"Insufficient {0} balance",values:{0:null===(f=S[Lw.CURRENCY_B])||void 0===f?void 0:f.symbol}}));const fe=de.greaterThan(0)||ce.greaterThan(0),ge=N===Ij.INVALID||fe;return{dependentField:E,currencies:S,pool:F,poolState:N,currencyBalances:D,parsedAmounts:ie,ticks:Q,price:U,pricesAtTicks:_,pricesAtLimit:K,position:ue,noLiquidity:W,errorMessage:pe,invalidPool:ge,invalidRange:J,outOfRange:te,depositADisabled:se,depositBDisabled:le,invertPrice:V,ticksAtLimit:X,isTaxed:fe}}function Gj(e,t){switch(t.type){case Hj.UpdateBaseToken:{const n=t.payload;return Object.assign(Object.assign({},e),{baseToken:Pj(n)})}case Hj.UpdateDefaultBaseToken:{const n=t.payload;return e.baseToken?e:Object.assign(Object.assign({},e),{baseToken:Pj(n)})}case Hj.UpdateQuoteToken:{const n=t.payload;return Object.assign(Object.assign({},e),{quoteToken:Pj(n)})}case Hj.UpdateDefaultQuoteToken:{const n=t.payload;return e.quoteToken?e:Object.assign(Object.assign({},e),{quoteToken:Pj(n)})}case Hj.UpdateBaseTokenAndClearQuoteToken:{const n=t.payload;return Object.assign(Object.assign({},e),{baseToken:Pj(n),quoteToken:null})}case Hj.UpdateFeeAmount:return Object.assign(Object.assign({},e),{feeAmount:t.payload});case Hj.ToggleRate:{const{baseToken:t,quoteToken:n}=e;return Object.assign(Object.assign({},e),{baseToken:n,quoteToken:t})}case Hj.setFullRange:return Object.assign(Object.assign({},e),{leftRangeTypedValue:!0,rightRangeTypedValue:!0});case Hj.typeStartPriceInput:return Object.assign(Object.assign({},e),{startPriceTypedValue:t.payload.typedValue});case Hj.typeLeftRangeInput:return Object.assign(Object.assign({},e),{leftRangeTypedValue:t.payload.typedValue});case Hj.typeRightRangeInput:return Object.assign(Object.assign({},e),{rightRangeTypedValue:t.payload.typedValue});case Hj.typeInput:{const{payload:{field:n,typedValue:r,noLiquidity:i}}=t;return i?(e.independentField,Object.assign(Object.assign({},e),{independentField:n,typedValue:r})):Object.assign(Object.assign({},e),{independentField:n,typedValue:r})}default:throw Error("Unknown action: "+t.type)}}function Yj({noLiquidity:e,dispatch:t}){return{onFieldAInput:ut((n=>{t({type:Hj.typeInput,payload:{field:Lw.CURRENCY_A,typedValue:n,noLiquidity:!0===e}})}),[t,e]),onFieldBInput:ut((n=>{t({type:Hj.typeInput,payload:{field:Lw.CURRENCY_B,typedValue:n,noLiquidity:!0===e}})}),[t,e]),onLeftRangeInput:ut((e=>{t({type:Hj.typeLeftRangeInput,payload:{typedValue:e}})}),[t]),onRightRangeInput:ut((e=>{t({type:Hj.typeRightRangeInput,payload:{typedValue:e}})}),[t]),onStartPriceInput:ut((e=>{t({type:Hj.typeStartPriceInput,payload:{typedValue:e}})}),[t])}}function Xj(e){return e?Jw[e]:void 0}function Jj(e,t){const n=Xj(t),r=lt((()=>e?e.map((e=>[e])):[]),[e]),i=It(ts.getPositions(t,n,r)),o=i.isLoading,a=i.error,s=lt((()=>{var t;if(!o&&!a&&e)return null===(t=i.data)||void 0===t?void 0:t.map(((t,n)=>({tokenId:e[n],fee:t.fee,feeGrowthInside0LastX128:t.feeGrowthInside0LastX128.toString(),feeGrowthInside1LastX128:t.feeGrowthInside1LastX128.toString(),liquidity:t.liquidity.toString(),nonce:t.nonce.toString(),operator:t.operator,tickLower:t.tickLower,tickUpper:t.tickUpper,token0:t.token0,token1:t.token1,tokensOwed0:t.tokensOwed0.toString(),tokensOwed1:t.tokensOwed1.toString()})))}),[o,a,i,e]);return{loading:o,positions:null==s?void 0:s.map(((e,t)=>Object.assign(Object.assign({},e),{tokenId:r[t][0]})))}}!function(e){e[e.UpdateBaseToken=0]="UpdateBaseToken",e[e.UpdateDefaultBaseToken=1]="UpdateDefaultBaseToken",e[e.UpdateQuoteToken=2]="UpdateQuoteToken",e[e.UpdateDefaultQuoteToken=3]="UpdateDefaultQuoteToken",e[e.UpdateBaseTokenAndClearQuoteToken=4]="UpdateBaseTokenAndClearQuoteToken",e[e.UpdateFeeAmount=5]="UpdateFeeAmount",e[e.ToggleRate=6]="ToggleRate",e[e.setFullRange=7]="setFullRange",e[e.typeStartPriceInput=8]="typeStartPriceInput",e[e.typeLeftRangeInput=9]="typeLeftRangeInput",e[e.typeRightRangeInput=10]="typeRightRangeInput",e[e.typeInput=11]="typeInput"}(Hj||(Hj={}));const Kj=tn.exponentiate(tn.BigInt(10),tn.BigInt(16));function _j(e){if(e)return e.currency.isNative?tn.greaterThan(e.quotient,Kj)?rk.fromRawAmount(e.currency,tn.subtract(e.quotient,Kj)):rk.fromRawAmount(e.currency,tn.BigInt(0)):e}const $j=1e4,eT=100*$j;function tT(e){const t=Math.floor(Number(e)*$j);return new ak(t,eT)}const nT=({token:e,amount:t})=>{var n;const r=g();return Os.jsxs(f,{sx:{py:8,display:"flex",alignItems:"center",gap:6,typography:"h5",color:r.palette.text.primary},children:[Os.jsx(ey,{address:null!==(n=null==e?void 0:e.address)&&void 0!==n?n:"",chainId:null==e?void 0:e.chainId,noShowChain:!0,width:24,height:24,marginRight:0}),Os.jsx(f,{children:null==e?void 0:e.symbol}),Os.jsx(f,{sx:{ml:"auto"},children:An({input:null==t?void 0:t.toSignificant(),decimals:null==e?void 0:e.decimals})})]})},rT=({chainId:e,baseToken:t,quoteToken:n,feeAmount:o,tokenId:a,onClose:s})=>{var l,d;const{isMobile:c}=wy(),u=g(),p=Hy(),h=Rt(),{account:m}=hf(),{position:y,loading:x}=function(e,t){var n;const r=Jj(e?[e]:void 0,t);return{loading:r.loading,position:null===(n=r.positions)||void 0===n?void 0:n[0]}}(a,e),v=!!y&&!x,{position:b}=function(e,t,n){const r=lt((()=>t?Pj(t):void 0),[t]),i=lt((()=>n?Pj(n):void 0),[n]),[,o]=Rj(null!=r?r:void 0,null!=i?i:void 0,null==e?void 0:e.fee);let a;return o&&e&&(a=new ij({pool:o,liquidity:e.liquidity.toString(),tickLower:e.tickLower,tickUpper:e.tickUpper})),{position:a,pool:null!=o?o:void 0}}(y,t,n),[A,w]=ct("stake"),[k,C]=ct(!1),[j,T]=ct(Iw),[E,S]=ft(Gj,{baseToken:Pj(t),quoteToken:Pj(n),feeAmount:o,independentField:Lw.CURRENCY_A,typedValue:"",startPriceTypedValue:"",leftRangeTypedValue:"",rightRangeTypedValue:""}),{independentField:I,typedValue:R,startPriceTypedValue:L}=E,{pool:M,ticks:O,dependentField:B,price:P,pricesAtTicks:D,pricesAtLimit:N,parsedAmounts:F,currencyBalances:W,position:V,noLiquidity:U,currencies:q,errorMessage:Z,invalidPool:Q,invalidRange:Y,outOfRange:X,depositADisabled:J,depositBDisabled:K,invertPrice:_,ticksAtLimit:$,isTaxed:ee}=Qj({state:E,existingPosition:b}),{position:te,liquidityPercentage:re,liquidityValue0:ie,liquidityValue1:oe,feeValue0:ae,feeValue1:se,error:le}=function({percent:e,position:t,asWETH:n,baseToken:i,quoteToken:o}){const{account:a,chainId:s}=hf(),[l,d]=lt((()=>[null==i?void 0:i.wrapped,null==o?void 0:o.wrapped]),[i,o]),[c,u]=lt((()=>l&&d?l.sortsBefore(d)?[l,d]:[d,l]:[void 0,void 0]),[l,d]),[,p]=Rj(null!=c?c:void 0,null!=u?u:void 0,null==t?void 0:t.fee),h=lt((()=>p&&(null==t?void 0:t.liquidity)&&"number"==typeof(null==t?void 0:t.tickLower)&&"number"==typeof(null==t?void 0:t.tickUpper)?new ij({pool:p,liquidity:t.liquidity.toString(),tickLower:t.tickLower,tickUpper:t.tickUpper}):void 0),[p,t]),m=new ak(e,100),f=h?m.multiply(h.amount0.quotient).quotient:void 0,g=h?m.multiply(h.amount1.quotient).quotient:void 0,y=c&&f?rk.fromRawAmount(c,f):void 0,x=u&&g?rk.fromRawAmount(u,g):void 0,v=!(!p||!t)&&(p.tickCurrent<t.tickLower||p.tickCurrent>t.tickUpper);let b;return a||(b=r._({id:"r7ScnQ",message:"Connect to a wallet"})),0===e&&(b=null!=b?b:r._({id:"Sta9CR",message:"Enter a percent"})),{position:h,liquidityPercentage:m,liquidityValue0:y,liquidityValue1:x,feeValue0:void 0,feeValue1:void 0,outOfRange:v,error:b}}({position:y,asWETH:void 0,percent:j,baseToken:E.baseToken,quoteToken:E.quoteToken}),de="0"===(null==y?void 0:y.liquidity),[ce,ue]=function({chainId:e,pool:t,tokenId:n,asWETH:r}){var i;const o=Xj(e),a=null===(i=ne.from(n))||void 0===i?void 0:i.toHexString(),s=It(ts.getOwner(e,o,n)),l=It(ts.getCollect(e,o,a,s.data&&Array.isArray(s.data)?s.data[0]:void 0));return t&&l&&l.data&&l.data.amount0&&l.data.amount1?[rk.fromRawAmount(t.token0,l.data.amount0.toString()),rk.fromRawAmount(t.token1,l.data.amount1.toString())]:[void 0,void 0]}({pool:null!=M?M:void 0,tokenId:a,asWETH:!1,chainId:e}),he=ue,me=ce;lt((()=>{var e;return null===(e=_?null==P?void 0:P.invert():P)||void 0===e?void 0:e.toSignificant()}),[_,P]);const{onFieldAInput:fe,onFieldBInput:ge,onLeftRangeInput:ye,onRightRangeInput:xe,onStartPriceInput:ve}=Yj({noLiquidity:U,dispatch:S}),{slipper:be,setSlipper:Ae,slipperValue:we,resetSlipper:ke}=Ew({address:void 0,type:"AMMV3"}),Ce=!Z&&!Y,je=lt((()=>{var e,t;return{[I]:R,[B]:null!==(t=null===(e=F[B])||void 0===e?void 0:e.toSignificant(6))&&void 0!==t?t:""}}),[B,I,F,R]),Te=lt((()=>[Lw.CURRENCY_A,Lw.CURRENCY_B].reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:_j(W[t])})),{})),[W]),Ee=EA(Dj(null===(l=F[Lw.CURRENCY_A])||void 0===l?void 0:l.currency),{contractAddress:Jw[e],overrideBalance:W[Lw.CURRENCY_A]?new i(W[Lw.CURRENCY_A].toSignificant()):void 0,amount:F[Lw.CURRENCY_A]?new i(F[Lw.CURRENCY_A].toSignificant()):void 0}),Se=EA(Dj(null===(d=F[Lw.CURRENCY_B])||void 0===d?void 0:d.currency),{contractAddress:Jw[e],overrideBalance:W[Lw.CURRENCY_B]?new i(W[Lw.CURRENCY_B].toSignificant()):void 0,amount:F[Lw.CURRENCY_B]?new i(F[Lw.CURRENCY_B].toSignificant()):void 0}),{[Mw.LOWER]:Ie,[Mw.UPPER]:Re}=O,{[Mw.LOWER]:Le,[Mw.UPPER]:Me}=D,{deadLine:Oe}=pf(),Be=Ot({mutationFn:()=>Fn(void 0,void 0,void 0,(function*(){if(!m||!e||!V)return;if(!E.baseToken||!E.quoteToken)return;const t=Math.ceil(Date.now()/1e3)+(null!=Oe?Oe:600),n=E.baseToken.isNative?E.baseToken:E.quoteToken.isNative?E.quoteToken:void 0;try{const{calldata:i,value:o}=fj.addCallParameters(V,{tokenId:a,slippageTolerance:tT(100*we),deadline:t.toString(),useNative:n});let l={to:Jw[e],data:i,value:o};(yield p.execute(r._({id:"OBdohg",message:"Add Liquidity"}),Object.assign({opcode:By.TX},l),{early:!1,metadata:{[Ey.addAMMV3Pool]:"1"}}))===Sy.Success&&(C(!1),setTimeout((()=>{null==s||s()}),100)),h.invalidateQueries({queryKey:[pe,"ammv3"],refetchType:"all"})}catch(e){console.error("onAddMutation",e)}}))}),Pe=Ot({mutationFn:()=>Fn(void 0,void 0,void 0,(function*(){if(!(m&&e&&te&&re&&ie&&oe))return;const t=Math.ceil(Date.now()/1e3)+(null!=Oe?Oe:600);try{const{calldata:n,value:i}=fj.removeCallParameters(te,{tokenId:a.toString(),liquidityPercentage:re,slippageTolerance:tT(100*we),deadline:t.toString(),collectOptions:{expectedCurrencyOwed0:null!=ae?ae:rk.fromRawAmount(ie.currency,0),expectedCurrencyOwed1:null!=se?se:rk.fromRawAmount(oe.currency,0),recipient:m}});let o={to:Jw[e],data:n,value:i};(yield p.execute(r._({id:"3XBvkd",message:"Remove Liquidity"}),Object.assign({opcode:By.TX},o),{early:!1,metadata:{[Ey.removeAMMV3Pool]:"1"}}))===Sy.Success&&setTimeout((()=>{null==s||s()}),100),h.invalidateQueries({queryKey:[pe,"ammv3"],refetchType:"all"})}catch(e){console.error("onRemoveMutation",e)}}))}),De=Ot({mutationFn:()=>Fn(void 0,void 0,void 0,(function*(){if(m&&e&&M)try{const{calldata:t,value:n}=fj.collectCallParameters({tokenId:a.toString(),expectedCurrencyOwed0:null!=ce?ce:rk.fromRawAmount(M.token0,0),expectedCurrencyOwed1:null!=ue?ue:rk.fromRawAmount(M.token1,0),recipient:m});let i={to:Jw[e],data:t,value:n};(yield p.execute(r._({id:"zXCpR0",message:"Claim Rewards"}),Object.assign({opcode:By.TX},i),{early:!1,metadata:{[Ey.claimAMMV3Pool]:"1"}}))===Sy.Success&&setTimeout((()=>{null==s||s()}),100),h.invalidateQueries({queryKey:[pe,"ammv3"],refetchType:"all"})}catch(e){console.error("onClaimMutation",e)}}))}),Ne=lt((()=>{var t,n,i,o;const a=[{key:"stake",value:r._({id:"m16xKo",message:"Add"})},{key:"unstake",value:r._({id:"t/YqKh",message:"Remove"})},{key:"claim",value:r._({id:"hom7qf",message:"Claim"})}];return Os.jsxs(f,{sx:{borderRadius:16,backgroundColor:u.palette.background.paper},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:20,py:24,borderTopLeftRadius:16,borderTopRightRadius:16,backgroundColor:u.palette.background.paper},children:[Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:u.palette.text.primary},children:r._({id:"E6MqGy",message:"Add liquidity"})}),s?Os.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,borderRadius:"50%",borderWidth:1,color:"text.secondary",cursor:"pointer"},children:Os.jsx(f,{component:As.Error,sx:{width:16,height:16},onClick:()=>{s()}})}):void 0]}),v&&b&&Os.jsx(f,{sx:{mx:20,mb:16},children:Os.jsx(vj,{position:b,inRange:!X})}),Os.jsxs(H,{value:A,onChange:(e,t)=>{w(t)},children:[Os.jsx(G,{tabs:a,variant:"inPaper",tabsListSx:{mx:20}}),Os.jsxs(z,{value:"stake",children:[v&&b&&Os.jsx(f,{sx:{mt:16,mx:20},children:Os.jsx(wj,{position:b,title:r._({id:"3VUfrF",message:"Selected Range"}),ticksAtLimit:$})}),Os.jsxs(f,{sx:{mt:16,mx:20,display:"flex",flexDirection:"column",alignItems:"stretch",gap:12},children:[Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:u.palette.text.secondary,textAlign:"left"},children:r._({id:"BRi+RY",message:"Add more liquidity"})}),Os.jsxs(f,{children:[Os.jsx(Yw,{value:je[Lw.CURRENCY_A],onUserInput:fe,maxAmount:Te[Lw.CURRENCY_A],balance:W[Lw.CURRENCY_A],currency:null!==(t=q[Lw.CURRENCY_A])&&void 0!==t?t:null,locked:J}),Os.jsx(zy,{}),Os.jsx(Yw,{value:je[Lw.CURRENCY_B],onUserInput:ge,maxAmount:Te[Lw.CURRENCY_B],balance:W[Lw.CURRENCY_B],currency:null!==(n=q[Lw.CURRENCY_B])&&void 0!==n?n:null,locked:K})]}),Os.jsx(Sw,{value:be,onChange:Ae,disabled:!1,type:"AMMV3"})]}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",px:20,py:16,borderBottomLeftRadius:16,borderBottomRightRadius:16,backgroundColor:u.palette.background.paper},children:Os.jsx(qw,{chainId:e,approvalA:Ee,approvalB:Se,parsedAmounts:F,isValid:Ce,depositADisabled:J,depositBDisabled:K,errorMessage:Z,setShowConfirm:C})}),Os.jsx(Ej,{parsedAmounts:F,position:V,existingPosition:void 0,priceLower:Le,priceUpper:Me,outOfRange:X,ticksAtLimit:$,on:k,onClose:()=>{C(!1)},onConfirm:Be.mutate,loading:Be.isPending})]}),Os.jsxs(z,{value:"unstake",children:[Os.jsxs(f,{sx:{mt:16,mx:20,display:"flex",flexDirection:"column",alignItems:"stretch",gap:12},children:[Os.jsx(bw,{disabled:!1,value:j,onChange:e=>T(e)}),Os.jsx(Sw,{value:be,onChange:Ae,disabled:!1,type:"AMMV3"})]}),Os.jsxs(f,{sx:{mt:16,mx:20,display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[Os.jsx(f,{sx:{typography:"body2",color:u.palette.text.secondary},children:"Receive"}),Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4},children:[Os.jsxs(f,{sx:{typography:"body1",fontWeight:600,color:u.palette.text.primary},children:[Os.jsx(f,{component:"span",sx:{color:u.palette.primary.main},children:ie?An({input:ie.toExact(),decimals:ie.currency.decimals}):"-"})," ",null===(i=null==ie?void 0:ie.currency)||void 0===i?void 0:i.symbol]}),Os.jsxs(f,{sx:{typography:"body1",fontWeight:600,color:u.palette.text.primary},children:[Os.jsx(f,{component:"span",sx:{color:u.palette.primary.main},children:oe?An({input:oe.toExact(),decimals:oe.currency.decimals}):"-"})," ",null===(o=null==oe?void 0:oe.currency)||void 0===o?void 0:o.symbol]})]})]}),Os.jsx(f,{sx:{mt:20,display:"flex",alignItems:"center",px:20,py:16,borderBottomLeftRadius:16,borderBottomRightRadius:16,backgroundColor:u.palette.background.paper},children:Os.jsx(kj,{chainId:e,disabled:de||0===j||!ie,removed:de,error:le,onConfirm:Pe.mutate,isLoading:Pe.isPending})})]}),Os.jsxs(z,{value:"claim",children:[Os.jsxs(f,{sx:{mx:20,mt:16,borderRadius:12,borderWidth:1,borderStyle:"solid",borderColor:u.palette.border.main},children:[Os.jsx(f,{sx:{py:12,px:20,typography:"body1",color:u.palette.text.primary,borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:u.palette.border.main},children:r._({id:"tu/fxg",message:"Claim fees"})}),Os.jsxs(f,{sx:{p:20},children:[Os.jsx(nT,{token:null==he?void 0:he.currency,amount:he}),Os.jsx(nT,{token:null==me?void 0:me.currency,amount:me})]})]}),Os.jsx(f,{sx:{mx:20,mt:16,typography:"h6",color:u.palette.text.secondary},children:r._({id:"Joa5Dk",message:"*Collecting fees will withdraw currently available fees for you."})}),Os.jsx(f,{sx:{mt:20,display:"flex",alignItems:"center",px:20,py:16,borderBottomLeftRadius:16,borderBottomRightRadius:16,backgroundColor:u.palette.background.paper},children:Os.jsx(Zw,{chainId:e,disabled:De.isPending,onConfirm:De.mutate,isLoading:De.isPending})})]})]})]})}),[Ee,Se,e,q,W,J,K,le,Z,b,me,he,je,v,Ce,ie,oe,Te,Be.isPending,Be.mutate,De.isPending,De.mutate,s,fe,ge,Pe.isPending,Pe.mutate,A,X,F,V,Le,Me,de,Ae,k,j,be,u.palette.background.paper,u.palette.border.main,u.palette.primary.main,u.palette.text.primary,u.palette.text.secondary,$]);return c?Os.jsx(yy,{open:null!=t&&null!=n,onClose:s,scope:!c,modal:c,id:"pool-operate",children:Ne}):Ne};const iT=({outOfRange:e})=>{const t=g();return Os.jsx(A,{title:e?r._({id:"i3Z+/Z",message:"Out of range"}):r._({id:"vOyUlD",message:"In range"}),children:Os.jsx(f,{sx:{display:"flex",alignItems:"center"},children:e?Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.583252 12.5416L6.99992 1.45825L13.4166 12.5416H0.583252ZM11.3924 11.3749L6.9999 3.78575L2.6074 11.3749H11.3924ZM7.58328 9.62492H6.41661V10.7916H7.58328V9.62492ZM6.41661 6.12492H7.58328V8.45825H6.41661V6.12492Z",fill:t.palette.warning.main})}):Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",children:Os.jsx("circle",{cx:"4",cy:"4",r:"4",fill:t.palette.success.main})})})})},oT=({p:e,currency0:t,currency1:n,onClickManage:i})=>{const o=g(),[,a]=Rj(null!=t?t:void 0,null!=n?n:void 0,e.fee),s=lt((()=>{if(a)return new ij({pool:a,liquidity:e.liquidity.toString(),tickLower:e.tickLower,tickUpper:e.tickUpper})}),[e.liquidity,e.tickLower,e.tickUpper,a]),l=(d=e.fee,c=e.tickLower,u=e.tickUpper,lt((()=>({[Mw.LOWER]:d&&c?c===KC(BC.MIN_TICK,Ak[d]):void 0,[Mw.UPPER]:d&&u?u===KC(BC.MAX_TICK,Ak[d]):void 0})),[d,c,u]));var d,c,u;const p=null==s?void 0:s.token0PriceLower,h=null==s?void 0:s.token0PriceUpper,m=null==s?void 0:s.amount1.currency,y=null==s?void 0:s.amount0.currency,x=!!a&&(a.tickCurrent<e.tickLower||a.tickCurrent>=e.tickUpper),v=t==t?null==s?void 0:s.pool.priceOf(null==s?void 0:s.pool.token0):null==s?void 0:s.pool.priceOf(null==s?void 0:s.pool.token1);return Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:24,px:20,py:20,pb:12,borderRadius:12,backgroundColor:o.palette.background.paperContrast},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:4},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,typography:"h5",color:o.palette.text.primary},children:[Os.jsx(f,{children:Os.jsxs(Os.Fragment,{children:[Os.jsxs("span",{children:[bj({price:p,atLimit:l,direction:Mw.LOWER})," "]}),null==m?void 0:m.symbol]})}),Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:Os.jsx("path",{d:"M15.75 9.50293L12.75 12.5029L11.7 11.4529L12.8813 10.2529L5.11875 10.2529L6.3 11.4529L5.25 12.5029L2.25 9.50293L5.25 6.50293L6.31875 7.55293L5.11875 8.75293L12.8813 8.75293L11.7 7.55293L12.75 6.50293L15.75 9.50293Z",fill:"currentColor",fillOpacity:"0.5"})}),Os.jsx(f,{children:Os.jsxs(Os.Fragment,{children:[Os.jsxs("span",{children:[bj({price:h,atLimit:l,direction:Mw.UPPER})," "]}),null==m?void 0:m.symbol]})})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4},children:[Os.jsx(iT,{outOfRange:x}),Os.jsxs(f,{sx:{typography:"h6",color:o.palette.text.secondary},children:[r._({id:"DWd30U",message:"Current price"}),": ",`${An({input:null==v?void 0:v.toSignificant()})}`," ",null==m?void 0:m.symbol," per ",null==y?void 0:y.symbol]})]})]}),Os.jsx(T,{variant:T.Variant.outlined,size:T.Size.small,fullWidth:!0,onClick:i,children:r._({id:"wckWOP",message:"Manage"})})]})};function aT(e){const{EmptyDataIcon:t}=pf();return t?Os.jsx(t,{...e}):Os.jsx(Y,{...e})}function sT({sx:t,hasSearch:n,emptyText:r}){return Os.jsxs(f,{sx:Object.assign({display:"flex",flexDirection:"column",gap:12,justifyContent:"center",alignItems:"center",typography:"body2",fontWeight:500,color:"text.secondary",textAlign:"center"},t),children:[Os.jsx(aT,{hasSearch:n,sx:{width:60,height:60,borderRadius:12}}),Os.jsx(f,{children:null!=r?r:Os.jsx(e,{id:"AxPAXW",message:"No results found"})})]})}const lT=({chainId:e,baseToken:t,quoteToken:n,feeAmount:i,onClose:o,handleGoToAddLiquidityV3:a})=>{const{isMobile:s}=wy(),l=g(),{account:d}=hf(),{positions:c,loading:u}=function(e,t){const n=Xj(t),{isLoading:r,data:i}=It(ts.getBalanceOf(t,n,null!=e?e:void 0)),o=lt((()=>{if(e&&i&&i.isFinite()){const t=[];for(let n=0;n<i.toNumber();n++)t.push([e,n]);return t}return[]}),[e,i]),a=It(ts.getTokenOfOwnerByIndex(t,n,o)),s=a.isLoading,l=lt((()=>e&&a.data?a.data.map((e=>{if(Array.isArray(e)&&e.length>0)return e[0].toString()})):[]),[e,a]),{positions:d,loading:c}=Jj(l,t);return{loading:s||r||c,positions:d}}(d,e),p=lt((()=>t?Pj(t):void 0),[t]),h=lt((()=>n?Pj(n):void 0),[n]),[m,y]=lt((()=>[null==p?void 0:p.wrapped,null==h?void 0:h.wrapped]),[p,h]),[x,v]=lt((()=>m&&y?m.sortsBefore(y)?[m,y]:[y,m]:[void 0,void 0]),[m,y]),b=lt((()=>{if(void 0!==c)return c.filter((e=>Oj(null==x?void 0:x.address,e.token0)&&Oj(null==v?void 0:v.address,e.token1)&&e.fee===i))}),[i,c,null==x?void 0:x.address,null==v?void 0:v.address]),[A,w]=ct(null),k=lt((()=>{var e;return Os.jsxs(f,{sx:{p:20,display:"flex",flexDirection:"column",gap:16,borderRadius:16,backgroundColor:l.palette.background.paper,minHeight:480},children:[Os.jsxs(f,{sx:{pb:16,borderBottomColor:l.palette.border.main,borderBottomStyle:"solid",borderBottomWidth:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsxs(f,{sx:{typography:"body1",fontWeight:600,color:l.palette.text.primary},children:[r._({id:"Gs02OK",message:"My Positions"})," (",null!==(e=null==b?void 0:b.length)&&void 0!==e?e:0,")"]}),o?Os.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,borderRadius:"50%",borderWidth:1,color:"text.secondary",cursor:"pointer"},children:Os.jsx(f,{component:As.Error,sx:{width:16,height:16},onClick:()=>{o()}})}):void 0]}),b&&b.length>0?Os.jsxs(Os.Fragment,{children:[null==b?void 0:b.map((e=>Os.jsx(oT,{p:e,currency0:p,currency1:h,onClickManage:()=>{w(e)}},e.tokenId))),Os.jsxs(T,{size:T.Size.big,variant:T.Variant.second,onClick:()=>{a({from:t.address,to:n.address,fee:String(i)})},sx:{gap:8},children:[Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:Os.jsx("path",{d:"M19 13H13V19H11V13H5V11H11V5H13V11H19V13Z",fill:"currentColor"})}),r._({id:"FQ4aT9",message:"Add Position"})]})]}):Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{mt:100,display:"flex",flexDirection:"column",alignItems:"center",gap:12},children:[Os.jsx(aT,{sx:{width:60,height:60,borderRadius:24/105*60}}),Os.jsx(f,{sx:{typography:"body1",color:l.palette.text.secondary},children:r._({id:"/6L4mj",message:"Your position is empty"})})]}),Os.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:void 0!==b&&0===b.length?Os.jsx(T,{size:T.Size.small,onClick:()=>{a({from:t.address,to:n.address,fee:String(i)})},children:r._({id:"FQ4aT9",message:"Add Position"})}):Os.jsx(sb,{size:T.Size.small})})]})]})}),[l.palette.background.paper,l.palette.border.main,l.palette.text.primary,l.palette.text.secondary,b,o,p,h,a,t.address,n.address,i]);return null!==A?Os.jsx(rT,{baseToken:t,quoteToken:n,feeAmount:i,tokenId:A.tokenId,chainId:e,onClose:()=>{w(null)}}):s?Os.jsx(yy,{open:null!=t&&null!=n,onClose:o,scope:!s,modal:s,id:"pool-operate",children:k}):k};var dT,cT,uT;function pT(){return pT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pT.apply(null,arguments)}!function(e){e[e.Liquidity=1]="Liquidity",e[e.Mining=2]="Mining"}(dT||(dT={}));const hT=e=>ot.createElement("svg",pT({width:60,height:60,viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ot.createElement("g",{opacity:.5},ot.createElement("mask",{id:"mask0_3521_179418",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:60,height:60},cT||(cT=ot.createElement("rect",{width:60,height:60,rx:16,fill:"white"}))),uT||(uT=ot.createElement("g",{mask:"url(#mask0_3521_179418)"},ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 30.0352H60V16.0352C60 7.1986 52.8366 0.0351562 44 0.0351562H16C7.16344 0.0351562 0 7.1986 0 16.0352V30.0352Z",fill:"#727272",fillOpacity:.4}),ot.createElement("path",{d:"M29.4643 4H16C9.37258 4 4 9.37258 4 16V27H27.1154L31.7914 18.7271L23.1831 13.6634L29.4643 4Z",fill:"#727272",fillOpacity:.4}),ot.createElement("path",{d:"M31.7101 27H56V16C56 9.37258 50.6274 4 44 4H34.0384L34.1766 4.08987L28.8164 12.3364L37.2081 17.2727L31.7101 27Z",fill:"#727272",fillOpacity:.4}),ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 44C0 52.8366 7.16344 60 16 60H44C52.8366 60 60 52.8366 60 44V30H0V44Z",fill:"#ABABAB",fillOpacity:.4}),ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M59.4395 44.8861C59.4395 53.0965 52.7625 59.7526 44.5257 59.7526C36.2891 59.7526 29.6118 53.0965 29.6118 44.8861C29.6118 36.6756 36.2891 30.0195 44.5257 30.0195C52.7625 30.0195 59.4395 36.6756 59.4395 44.8861Z",fill:"#727272",fillOpacity:.4}),ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.8277 44.8665C29.8277 53.077 23.1507 59.7331 14.9139 59.7331C6.67727 59.7331 0 53.077 0 44.8665C0 36.6561 6.67727 30 14.9139 30C23.1507 30 29.8277 36.6561 29.8277 44.8665Z",fill:"#727272",fillOpacity:.4}),ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M51.9177 44.8883C51.9177 48.958 48.6082 52.257 44.5255 52.257C40.4431 52.257 37.1333 48.958 37.1333 44.8883C37.1333 40.8186 40.4431 37.5195 44.5255 37.5195C48.6082 37.5195 51.9177 40.8186 51.9177 44.8883Z",fill:"#444446"})))));function mT({sx:t,refresh:n}){return Os.jsxs(f,{sx:u({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},t),children:[Os.jsx(f,{component:hT,sx:{display:"inline-block",width:60,height:60,mb:12}}),Os.jsx(f,{sx:{typography:"body2",width:252,textAlign:"center"},children:Os.jsx(f,{component:"span",sx:{color:"text.secondary"},children:Os.jsx(e,{id:"Vmw6BM",message:"Something went wrong…<0>Refresh again</0>",components:{0:Os.jsx(I,{component:"span",color:"primary.main",weak:!0,sx:{cursor:"pointer"},onClick:()=>{n()}})}})})})]})}function fT(e,t,n,r){return"CLASSICAL"===r&&e&&t&&e.isEqualTo(t)?e.times(`1e${n}`).minus(1).div(`1e${n}`):e}function gT(e,t){return e.lte(0)?new o(0):t.div(e)}function yT(e,t,n,r,i,a,s){const l=i&&function(e){return-1!==["0x9D9793e1E18CDEe6cf63818315D55244f73EC006","0x0D04146B2Fe5d267629a7eb341Fb4388DcdBD22f","0x3D9d765b0fbAf594F90F07bc42889473e6613C7A","0x3854BdcB1a7cBA4b1A5f9a7C8719e247Df4c42c6","0xA46F5eC3219f956d14C6816Ef9cf6CaBf13bdD77","0xB16f2Ff8E8499E31B257d2A02D25e8956Ae6aFe7"].findIndex((t=>t.toLowerCase()===e.toLowerCase()))}(i);let d,c;const u="CLASSICAL"===a?r:n;if(e&&t&&u&&void 0!==s){if(c=gT(t,u),d=e.times(c),"CLASSICAL"===a&&l){if(!r)return[void 0,void 0];d.gt(r)&&n&&(c=gT(t,o.min(r,n)),d=d.times(c))}return[c,d.dp(Number(s),o.ROUND_DOWN)]}return[void 0,void 0]}function xT({account:e,pool:t}){var n,r;const{chainId:i,address:a,type:s,baseTokenDecimals:l,quoteTokenDecimals:d,baseLpTokenDecimals:c,quoteLpTokenDecimals:u}=null!=t?t:{},p=It(es.getTotalBaseLpQuery(i,a,s,c)),h=It(es.getTotalQuoteLpQuery(i,a,s,u)),m=It(es.getUserBaseLpQuery(i,a,s,c,e)),f=It(es.getUserQuoteLpQuery(i,a,s,u,e)),g=It(es.getReserveLpQuery(i,a,s,l,d)),y=It(es.getClassicalTargetQuery(i,a,s,l,d)),x=p.data,v=h.data,{baseReserve:b,quoteReserve:A}=g.data||{},w=null===(n=y.data)||void 0===n?void 0:n.baseTarget,k=null===(r=y.data)||void 0===r?void 0:r.quoteTarget,C="DPP"===s,j=C?b:fT(m.data,x,c,s),T=C?A:fT(f.data,v,u,s),[E,S]=C?[new o(1),b]:yT(j,x,b,w,a,s,l);let I,R;if(A){let e=h.data;e||h.isLoading||h.error||!x||(e=x);const t=f.isFetched&&!f.error&&null===T?j:T;C?(I=new o(1),R=A):f.isLoading||f.error||y.error||t?[I,R]=yT(t,e,A,k,a,s,d):R=new o(0)}const L=m.isLoading||f.isLoading,M=m.isError||f.isError,O=()=>{m.refetch(),f.refetch(),p.refetch(),h.refetch(),g.refetch(),y.refetch()},B=L||p.isLoading||h.isLoading||g.isLoading||y.isLoading,P=M||p.isError||h.isError||g.isError||y.isError,D="DVM"===(null==t?void 0:t.type)&&(!A||A.isZero());return{totalBaseLpBalance:x,totalQuoteLpBalance:v,baseReserve:b,quoteReserve:A,classicalBaseTarget:w,classicalQuoteTarget:k,userBaseLpBalance:j,userQuoteLpBalance:T,userBaseLpToTokenBalance:S,userQuoteLpToTokenBalance:R,baseLpToTokenProportion:E,quoteLpToTokenProportion:I,isSinglePool:D,userLpBalanceLoading:L,userLpToTokenBalanceLoading:B,userLpBalanceError:M,userLpToTokenBalanceError:P,userLpToTokenBalanceRefetch:O,error:P,loading:B,refetch:O}}function vT({pool:e,baseAmount:t,quoteAmount:n}){const[r,o,a,s,l,d]=at.useMemo((()=>{var t,n;const{baseToken:r,quoteToken:i}=e||{};let o=!1;if(!r||!i)return[void 0,void 0,void 0,void 0,void 0,o];const a=r.chainId,s=ue[a],l=(null===(t=s.address)||void 0===t?void 0:t.toLowerCase())===r.address.toLowerCase(),d=(null===(n=s.address)||void 0===n?void 0:n.toLowerCase())===i.address.toLowerCase(),c=l?s.wrappedTokenAddress:r.address,u=d?s.wrappedTokenAddress:i.address,p=new rn(r.chainId,c,r.decimals,r.symbol,r.name),h=new rn(i.chainId,u,i.decimals,i.symbol,i.name);o=!p.sortsBefore(h);const[m,f]=o?[h,p]:[p,h];return[a,null==e?void 0:e.type,null==e?void 0:e.address,m,f,o]}),[e]),c=es.getReserveLpQuery(r,a,o,null==s?void 0:s.decimals,null==l?void 0:l.decimals),u="AMMV2"===o,p=It(Object.assign(Object.assign({},c),{enabled:!!c.enabled&&u})),h=es.getTotalBaseLpQuery(r,a,o,18),m=It(Object.assign(Object.assign({},h),{enabled:!!h.enabled&&u})),{account:f}=hf(),g=es.getUserBaseLpQuery(r,a,o,18,f),y=It(Object.assign(Object.assign({},g),{enabled:!!g.enabled&&u})),x=at.useMemo((()=>p.isFetched&&!!p.data&&m.isFetched&&!!m.data),[p.isFetched,p.data,m.isFetched,m.data]),[v,b]=at.useMemo((()=>{var e;if(!s||!l||!1===x)return[null,null];const{baseReserve:t,quoteReserve:n}=null!==(e=p.data)&&void 0!==e?e:{baseReserve:0,quoteReserve:0},r=on.fromRawAmount(s,jn(t,s.decimals).toString()),i=on.fromRawAmount(l,jn(n,l.decimals).toString());let o=r,a=i;d&&(o=i,a=r);const c=new ln(o,a);if(o.equalTo(0)||a.equalTo(0))return[c,null];const u=a.divide(o);return[c,new an(o.currency,a.currency,u.denominator,u.numerator)]}),[s,l,p.data,d]),[A,w]=at.useMemo((()=>x?b?[new i(b.toSignificant()),new i(b.invert().toSignificant())]:[void 0,void 0]:t&&n?[new i(n).div(t),new i(t).div(n)]:[void 0,void 0]),[b,x,t,n]),k=m.data,C=x?m.data&&s?jn(m.data,18).toString():"":"0";let j,T;const E=d?l:s,S=d?s:l;if((null==v?void 0:v.liquidityToken)&&C&&k&&E&&S){const e=on.fromRawAmount(null==v?void 0:v.liquidityToken,C);if(void 0!==t&&void 0!==n){if(Number(t)&&Number(n)){const r=on.fromRawAmount(E,jn(t,E.decimals).toString()),i=on.fromRawAmount(S,jn(n,S.decimals).toString()),o=null==v?void 0:v.getLiquidityMinted(e,r,i);T=Tn(o.quotient.toString(),18),j=T.div(k.plus(T)).times(100)}}else T=y.data||void 0,T&&(j=T.div(k).times(100))}else x||(j=new i(100));let I="-";return(null==e?void 0:e.baseToken)&&e.quoteToken&&(I=j?`${bn({input:j,showDecimals:2,roundingMode:i.ROUND_HALF_UP})}%`:"0%"),{isRearTokenA:d,pair:v,price:A,invertedPrice:w,reserveQuery:p,totalBaseLpQuery:m,liquidityMinted:T,poolTokenPercentage:j,shareOfPool:I,isExists:x}}function bT({pool:e,maxBaseAmount:t,maxQuoteAmount:n,isRemove:r}){var o,a,s;const[l,d]=at.useState(""),[c,u]=at.useState(""),p=!e||"AMMV2"!==e.type&&"AMMV3"!==e.type,h=It(es.getPMMStateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(o=null==e?void 0:e.baseToken)||void 0===o?void 0:o.decimals,null===(a=null==e?void 0:e.quoteToken)||void 0===a?void 0:a.decimals)),m=()=>{d(""),u("")},f=null==e?void 0:e.type,g=vT({pool:e,baseAmount:l,quoteAmount:c});let y=null===(s=h.data)||void 0===s?void 0:s.midPrice,x=new i(NaN),v=!1,b=!1;const A=h.data;if(e)if(A){const t=A.pmmParamsBG.i,n=A.pmmParamsBG.b,r=A.pmmParamsBG.q;b=("DSP"===e.type||"GSP"===e.type)&&(r.eq(0)||n.eq(0)),v="DVM"===e.type&&new i(r).eq(0),x=b?t:v?i(1):r.div(n)}else"AMMV2"===f&&(y=g.isRearTokenA?g.invertedPrice:g.price,x=y||new i(1));const w=at.useRef(x);if(!e||x.isNaN())return{baseAmount:l,quoteAmount:c,handleChangeBaseAmount:()=>{},handleChangeQuoteAmount:()=>{},reset:m};const k=!v&&!le.utils.singleSideLp(e.type),C=e.baseToken.decimals,j=e.quoteToken.decimals,T=e=>{if(e){let i=x.multipliedBy(e).dp(j).toString();n&&r&&(n.lte(i)||(null==t?void 0:t.lte(0)))&&(i=n.toString()),u(i)}else u(e)};!k||w.current&&x.isEqualTo(w.current)||(w.current=x,T(l));let E=!1;E=!!e&&le.utils.singleSideLp(e.type)?!l&&!c:v?!l:!l||!c;const S=p?h:g.reserveQuery;return{baseAmount:l,quoteAmount:c,handleChangeBaseAmount:e=>{let t=Cn(e,C);null===t&&(t=l),d(t),k&&T(t)},handleChangeQuoteAmount:e=>{let o=Cn(e,j);null===o&&(o=c),u(o),k&&(e=>{if(e){let o=new i(e).div(x).dp(C).toString();t&&r&&(t.lte(o)||(null==n?void 0:n.lte(0)))&&(o=t.toString()),d(o)}else d(e)})(o)},reset:m,addPortion:x,amountLoading:S.isLoading,amountError:S.isError,amountRefetch:S.refetch,amountCheckedDisabled:E,midPrice:y,uniV2Pair:g}}function AT({pool:t,addPortion:n,midPrice:r,shareOfPool:o}){var a,s,l,d,c,u;const p=g(),[h,m]=ct(!1);let y="";if(n&&r){const e=new i(1).div(n.plus(1)),o=new i(n).div(n.plus(1)),l=e.times(r),d=l.plus(o);y=n?`${Bn({input:l.div(d)})} ${null===(a=null==t?void 0:t.baseToken)||void 0===a?void 0:a.symbol} + ${Bn({input:o.div(d)})} ${null===(s=null==t?void 0:t.quoteToken)||void 0===s?void 0:s.symbol}`:""}const x=h?null===(l=null==t?void 0:t.quoteToken)||void 0===l?void 0:l.symbol:null===(d=null==t?void 0:t.baseToken)||void 0===d?void 0:d.symbol,v=h&&r?new i(1).div(r):r,b=h?null===(c=null==t?void 0:t.baseToken)||void 0===c?void 0:c.symbol:null===(u=null==t?void 0:t.quoteToken)||void 0===u?void 0:u.symbol;return Os.jsxs(f,{sx:{mt:20,border:"solid 1px",borderColor:"border.main",borderRadius:8},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,height:36,typography:"body2"},children:[Os.jsx(f,{sx:{color:"text.secondary",whiteSpace:"nowrap"},children:Os.jsx(e,{id:"kNeEXg",message:"Current Price"})}),Os.jsxs(D,{sx:{display:"flex",alignItems:"center",fontWeight:600,ml:8,overflow:"hidden"},loading:!t,loadingProps:{width:50},children:[Os.jsx(A,{title:`1 ${x} = ${v?bn({input:v}):""} ${b}`,children:r?Os.jsx(f,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:`1 ${x} = ${v?bn({input:v}):""} ${b}`}):Os.jsxs(f,{children:[`1 ${x} = `,Os.jsx(D,{loading:!0,loadingProps:{width:30},component:"span",sx:{display:"inline-block"}}),` ${b}`]})}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",ml:4,width:18,height:18,cursor:"pointer",backgroundColor:"background.paperDarkContrast",borderRadius:"50%","&:hover":{backgroundColor:C(p.palette.text.primary,.04)}},onClick:()=>m((e=>!e)),children:Os.jsx(f,{component:As.Switch,sx:{width:18,height:18}})})]})]}),"AMMV2"===(null==t?void 0:t.type)?Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,minHeight:36,typography:"body2",borderStyle:"solid",borderWidth:p.spacing(1,0,0),borderColor:"border.main"},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",color:"text.secondary",whiteSpace:"nowrap"},children:Os.jsx(e,{id:"NEQTCn",message:"Share Of Pool"})}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",fontWeight:600,textAlign:"right",ml:8,overflow:"hidden"},children:o})]}):Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,minHeight:36,typography:"body2",borderStyle:"solid",borderWidth:p.spacing(1,0,0),borderColor:"border.main"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",color:"text.secondary",whiteSpace:"nowrap"},children:[Os.jsx(e,{id:"22Xs8M",message:"Deposit Ratio"}),Os.jsx(P,{ml:4,title:Os.jsx(e,{id:"I0yi1d",message:"Deposit ratio is determined by the current assets ratio in the pool. The ratio does not represent the exchange price"})})]}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",fontWeight:600,textAlign:"right",ml:8,overflow:"hidden"},children:t&&le.utils.singleSideLp(t.type)?Os.jsx(e,{id:"Kb3KaW",message:"Any Ratio"}):Os.jsx(Os.Fragment,{children:Os.jsx(A,{title:y,children:Os.jsx(f,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:y})})})})]})]})}function wT({lqAndDodoCompareText:t,baseToken:n,quoteToken:i,midPrice:o}){const a=o?bn({input:o}):"";return Os.jsxs(f,{sx:{p:10,mb:12,backgroundColor:"background.paperDarkContrast",borderRadius:12},children:[Os.jsxs(f,{sx:{typography:"body2",display:"flex",alignItems:"center",justifyContent:"center",color:"error.main",fontWeight:600,mb:10,textAlign:"center"},children:[Os.jsx(f,{component:As.Alarm,sx:{mr:4}}),r._({id:"YUyuNp",message:"{lqAndDodoCompareText} Price Difference",values:{lqAndDodoCompareText:t}})]}),Os.jsxs(f,{sx:{typography:"h6",color:"text.secondary",textAlign:"center"},children:[Os.jsx(e,{id:"ZhEBp4",message:"Current liquidity pool token price"}),` 1 ${null==n?void 0:n.symbol} = ${a} ${null==i?void 0:i.symbol} ${r._({id:"uaKP0s",message:"differs from the price quoted by DODO by {lqAndDodoCompareText}",values:{lqAndDodoCompareText:t}})}`]})]})}function kT({status:t,children:n,buttonProps:r}){return!t.needShowTokenStatusButton&&n?Os.jsx(Os.Fragment,{children:n}):t.insufficientBalance?Os.jsx(T,{fullWidth:!0,disabled:!0,...r,children:Os.jsx(e,{id:"znqB4T",message:"Insufficient balance"})}):Os.jsx(T,{fullWidth:!0,isLoading:t.isApproving,onClick:t.submitApprove,disabled:t.insufficientBalance,...r,children:t.isApproving?Os.jsx(e,{id:"j2Uisd",message:"Approving"}):t.approveTitle})}function CT({chainId:t,baseTokenStatus:n,quoteTokenStatus:r,children:i}){const{runningRequests:o}=Vy(),{account:a,chainId:s}=At();if(!a||t!==s)return Os.jsx(sb,{chainId:t,fullWidth:!0});const l=o.some((e=>{var t,n;return(null===(t=e.metadata)||void 0===t?void 0:t[Ey.addLiquidity])||(null===(n=e.metadata)||void 0===n?void 0:n[Ey.removeLiquidity])})),d=[];n.needShowTokenStatusButton&&d.push(Os.jsx(kT,{status:n})),r.needShowTokenStatusButton&&!n.isApproving&&d.push(Os.jsx(kT,{status:r}));const c=d.length;return 2===c?Os.jsx(f,{sx:{display:"flex","& > button":{flex:1,"&:last-child":{ml:8}}},children:d.map((e=>e))}):1===c?d[0]:l?Os.jsx(T,{fullWidth:!0,disabled:!0,isLoading:!0,children:Os.jsx(e,{id:"UbRKMZ",message:"Pending"})}):Os.jsx(Os.Fragment,{children:i})}function jT({baseToken:e,quoteToken:t}){const{toFiatPrice:n,fromFiatPrice:r}=Yv({fromToken:null!=e?e:null,toToken:null!=t?t:null});return function({fromToken:e,toToken:t,fromFiatPrice:n,toFiatPrice:r,reverse:i,showDecimals:o=1}){const a={comparePrice:null,comparePriceText:"",loading:!0};return e&&t&&n&&r?(i?(a.loading=!1,a.comparePrice=r.div(n),a.comparePriceText=`1 ${xs(t)} = ${bn({input:a.comparePrice,showDecimals:o})} ${xs(e)}`):(a.loading=!1,a.comparePrice=n.div(r),a.comparePriceText=`1 ${xs(e)} = ${bn({input:a.comparePrice,showDecimals:o})} ${xs(t)}`),a):a}({fromToken:e,toToken:t,fromFiatPrice:r?new i(r):void 0,toFiatPrice:n?new i(n):void 0})}const TT=(e,t,n)=>{const{comparePrice:r}=jT({baseToken:e,quoteToken:t}),o=lt((()=>{if(!(n&&r&&r.toNumber()&&n.toNumber()))return 0;const e=r.minus(n);return Math.abs(e.div(r).toNumber())}),[n,r]),a=lt((()=>`${Mn(new i(o).times(100))}%`),[o]);return{lqAndDodoCompare:o,lqAndDodoCompareText:a,midPrice:n,isShowCompare:o>.01,isWarnCompare:o>.03}};function ET(t){const{ConfirmComponent:n}=pf();if(n)return Os.jsx(n,{...t});const{open:r,onClose:i,title:o,children:a,singleBtn:s,danger:l,singleBtnText:d,cancelText:c,confirmText:u,disabledConfirm:p,confirmLoading:h,isManualClose:m,onConfirm:g,modal:y}=t;return Os.jsx(yy,{open:r,onClose:i,title:o,modal:y,children:Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1},children:[Os.jsx(f,{sx:{typography:"body2",color:o?"text.secondary":"text.primary",textAlign:"center",wordBreak:"break-all",mt:20,px:36},children:a}),s?Os.jsx(f,{sx:{px:20},children:Os.jsx(T,{fullWidth:!0,variant:T.Variant.outlined,danger:l,sx:{mt:32,mb:20},onClick:()=>{i()},children:d||Os.jsx(e,{id:"DPfwMq",message:"Done"})})}):Os.jsxs(f,{sx:{mt:24,mb:20,mx:20,display:"flex",alignItems:"center","& > button":{flex:1}},children:[Os.jsx(T,{variant:T.Variant.second,onClick:()=>{i()},children:c||Os.jsx(e,{id:"dEgA5A",message:"Cancel"})}),Os.jsx(T,{sx:{ml:8},variant:T.Variant.outlined,danger:l,disabled:p,isLoading:h,onClick:()=>{g&&g(),m||i()},children:u||Os.jsx(e,{id:"7VpPHA",message:"Confirm"})})]})]})})}function ST(e){if(!e&&"number"!=typeof e)return e;let t="";return t=i.isBigNumber(e)?e.toString(16):new i(e).toString(16),t.length%2?"0x0"+t:"0x"+t}function IT(e){return ST(jn(e,18))}function RT(e,t,n){const r=new i(e),o=new i(t),a=r.minus(o),s=r.gt(o),l=r.lt(o);return{now:o,target:r,isChange:s||l,change:a,changeText:(l?"":"+")+bn({input:a,showDecimals:n>6?6:4,showPrecisionDecimals:2}),isAdd:s,isRemove:l}}const LT=e=>Fn(void 0,[e],void 0,(function*({chainId:e,account:t,srcPool:n,baseToken:r,quoteToken:o,baseAmount:a,quoteAmount:s,feeRate:l,initPrice:d,slippageCoefficient:c,ddl:u,SLIPPAGE_PROTECTION:p}){const h=e?ue[e]:void 0,m=function({srcPool:e,newPool:t}){if(!e)return null;const{baseToken:n,quoteToken:r,baseAmount:o,quoteAmount:a}=t,{baseReserve:s,quoteReserve:l}=e;return{baseAmount:RT(o,s,n.decimals),quoteAmount:RT(a,l,r.decimals),feeRate:RT(new i(t.feeRate).div(100),e.feeRate,6),initPrice:RT(t.initPrice,e.i,10),slippageCoefficient:RT(t.slippageCoefficient||"1",e.k,4)}}({srcPool:n,newPool:{baseToken:r,quoteToken:o,baseAmount:a,quoteAmount:s,feeRate:l,initPrice:d,slippageCoefficient:c}});if(!(t&&e&&m&&n))return null;const f=Number(r.decimals),g=Number(o.decimals);let y;const x=m.slippageCoefficient.target;try{const t=r.symbol===(null==h?void 0:h.symbol),a=o.symbol===(null==h?void 0:h.symbol);if(m.baseAmount.isRemove&&m.quoteAmount.isRemove){const t=[yield es.getDPPOwnerProxyAddressQuery(e,n.address).queryFn(),m.feeRate.target.multipliedBy(1e4).toNumber(),m.initPrice.target.toNumber(),x.toNumber(),re(m.baseAmount.change.abs().dp(f,i.ROUND_FLOOR).toString(),f).toString(),re(m.quoteAmount.change.abs().dp(g,i.ROUND_FLOOR).toString(),g).toString(),re(m.baseAmount.now.multipliedBy(1-p).dp(f,i.ROUND_FLOOR).toString(),f).toString(),re(m.quoteAmount.now.multipliedBy(1-p).dp(g,i.ROUND_FLOOR).toString(),g).toString(),f,g];y=yield le.encode.removeDPPPoolABI(...t)}else{const t=[e,n.address,m.feeRate.target.multipliedBy(1e4).toNumber(),m.initPrice.target.toNumber(),x.toNumber(),m.baseAmount.isAdd?re(m.baseAmount.change.abs().dp(f,i.ROUND_FLOOR).toString(),f).toString():"0",m.quoteAmount.isAdd?re(m.quoteAmount.change.abs().dp(g,i.ROUND_FLOOR).toString(),g).toString():"0",m.baseAmount.isAdd?"0":re(m.baseAmount.change.abs().dp(f,i.ROUND_FLOOR).toString(),f).toString(),m.quoteAmount.isAdd?"0":re(m.quoteAmount.change.abs().dp(g,i.ROUND_FLOOR).toString(),g).toString(),re(m.baseAmount.now.multipliedBy(1-p).dp(f,i.ROUND_FLOOR).toString(),f).toString(),re(m.quoteAmount.now.multipliedBy(1-p).dp(g,i.ROUND_FLOOR).toString(),g).toString(),0,f,g,Math.ceil(Date.now()/1e3)+(null!=u?u:600)];y=yield le.encode.resetDPPPoolABI(...t)}return t&&m.baseAmount.isAdd&&(y.value=IT(m.baseAmount.change)),a&&m.quoteAmount.isAdd&&(y.value=IT(m.quoteAmount.change)),y}catch(e){throw console.error("2.0 resetDPPPool error",e),new Error(`2.0 resetDPPPool error;ERROR:${e}`)}})),MT=(e,t,n)=>t?e&&"0"!==e?n?t.minus(e).toString():t.plus(e).toString():t.toString():e;function OT({pool:e}){var t,n;const{account:r}=At(),o=Hy(),a=It(es.getPMMStateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(t=null==e?void 0:e.baseToken)||void 0===t?void 0:t.decimals,null===(n=null==e?void 0:e.quoteToken)||void 0===n?void 0:n.decimals)),s=It(es.getLPFeeRateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type)),{deadLine:l}=pf(),d=Ot({mutationFn:t=>Fn(this,[t],void 0,(function*({baseAmount:t,quoteAmount:n,isRemove:d=!1,feeRate:c,initPrice:u,slippageCoefficient:p,txTitle:h,submittedBack:m}){var f;if(!e)throw new Error("pool is undefined");const g=s.data;if(!g)throw new Error("lpFeeRate is undefined");if(!a.data)throw new Error("pmmStateQuery.data is undefined");const{pmmParamsBG:y,baseReserve:x,quoteReserve:v}=a.data,b=y.i.toNumber(),A=y.k.toNumber(),w=yield LT({account:r,chainId:null==e?void 0:e.chainId,SLIPPAGE_PROTECTION:Tw,srcPool:Object.assign(Object.assign({},e),{baseReserve:x,quoteReserve:v,i:b,k:A,feeRate:g.times(100).toString()}),baseToken:null==e?void 0:e.baseToken,quoteToken:null==e?void 0:e.quoteToken,baseAmount:MT(t,x?new i(x):void 0,d),quoteAmount:MT(n,v?new i(v):void 0,d),feeRate:null!=c?c:g.times(100).toString(),initPrice:null!=u?u:String(b),slippageCoefficient:null!=p?p:String(A),ddl:l});if(!w)throw new Error(`modify pool failed: ${e.address}`);return o.execute(h,Object.assign(Object.assign({opcode:By.TX},w),{value:null!==(f=w.value)&&void 0!==f?f:0}),{metadata:{[d?Ey.removeLiquidity:Ey.addLiquidity]:!0},submittedBack:m})}))});return{modifyDPPMutation:d}}const BT=e=>{const{account:t,chainId:n}=hf(),r=Hy(),o=Rt(),{deadLine:a}=pf(),{modifyDPPMutation:s}=OT({pool:e}),l=Ot({mutationFn:s=>Fn(void 0,void 0,void 0,(function*(){var l,d,c,u,p;if(!e||!t||!s.balanceInfo)return;const{isRemove:h,baseAmount:m,quoteAmount:f,slippageProtection:g,balanceInfo:y,SLIPPAGE_PROTECTION:x,submittedBack:v,successBack:b,txTitle:A,withdrawInfo:w}=s,k=!h,{address:C,type:j,baseToken:T,quoteToken:E}=e,S=T.address.toLowerCase(),I=E.address.toLowerCase(),R=ue[n].address.toLowerCase(),L=R===S,M=R===I,O="DSP"===j||"GSP"===j,B="CLASSICAL"===j,P=C.toLocaleLowerCase(),D=new i(m),N=new i(f),F=D.isNaN(),W=N.isNaN(),V=+T.decimals,U=+E.decimals,H=T.symbol,q=E.symbol,Z=g;let z,Q=F?"0":re(D.multipliedBy(1-Z).dp(V,i.ROUND_FLOOR).toString(),V).toString(),G=W?"0":re(N.multipliedBy(1-Z).dp(U,i.ROUND_FLOOR).toString(),U).toString();try{if(k)if(B){const e=!F&&(null==y?void 0:y.classicalBaseTarget)&&y.classicalBaseTarget.gt(0)&&y.totalBaseLpBalance?re(D.multipliedBy(y.totalBaseLpBalance).multipliedBy(1-x).div(y.classicalBaseTarget).dp(V,i.ROUND_FLOOR).toString(),V).toString():"0",t=!W&&(null==y?void 0:y.classicalBaseTarget)&&y.totalQuoteLpBalance&&y.classicalQuoteTarget&&y.classicalQuoteTarget.gt(0)?re(N.multipliedBy(y.totalQuoteLpBalance).multipliedBy(1-x).div(y.classicalQuoteTarget).dp(U,i.ROUND_FLOOR).toString(),U).toString():"0",r=[n,P,F?"0":re(D.dp(V,i.ROUND_FLOOR).toString(),V).toString(),W?"0":re(N.dp(U,i.ROUND_FLOOR).toString(),U).toString(),e,t,L?1:M?2:0,Math.ceil(Date.now()/1e3)+(null!=a?a:600)];z=yield le.encode.addClassicalLiquidityABI(...r)}else{const e=[n,P,F?"0":re(D.dp(V,i.ROUND_FLOOR).toString(),V).toString(),W?"0":re(N.dp(U,i.ROUND_FLOOR).toString(),U).toString(),Q,G,L?1:M?2:0,Math.ceil(Date.now()/1e3)+(null!=a?a:600)];z=O?yield le.encode.addDSPLiquidityABI(...e):yield le.encode.addDVMLiquidityABI(...e)}else if(B){if("base"===(F?"quote":"base")){const e=D.dp(V,i.ROUND_FLOOR).toString(),t=w&&w.receiveAmountBg?re(w.receiveAmountBg.multipliedBy(1-Z).dp(V,i.ROUND_FLOOR).toString(),V).toString():Q,r=[n,P,re(e,V).toString(),t];z=yield le.encode.removeClassicalBaseABI(...r)}else{const e=N.dp(U,i.ROUND_FLOOR).toString(),t=w&&w.receiveAmountBg?re(w.receiveAmountBg.multipliedBy(1-Z).dp(U,i.ROUND_FLOOR).toString(),U).toString():G,r=[n,P,re(e,U).toString(),t];z=yield le.encode.removeClassicalQuoteABI(...r)}}else{if(!((null==y?void 0:y.baseReserve)&&y.quoteReserve&&y.totalBaseLpBalance&&y.userBaseLpBalance&&y.userBaseLpToTokenBalance))return;let e=new i(0);if(null===(l=y.totalBaseLpBalance)||void 0===l?void 0:l.lte(0))e=y.userBaseLpBalance||new i(0);else if(y.baseReserve.gt(0)&&y.quoteReserve.eq(0)){let t=D;D.gte(y.userBaseLpToTokenBalance)&&(t=y.userBaseLpToTokenBalance),e=t.multipliedBy(y.totalBaseLpBalance).div(y.baseReserve)}else if(y.baseReserve.gt(0)&&y.quoteReserve.gt(0)){let t=D;D.gte(y.userBaseLpToTokenBalance)&&(t=y.userBaseLpToTokenBalance);let n,r=N;if(y.userQuoteLpToTokenBalance&&N.gte(y.userQuoteLpToTokenBalance)&&(r=y.userQuoteLpToTokenBalance),r.gt(0)&&(null===(d=y.userQuoteLpToTokenBalance)||void 0===d?void 0:d.gt(0))&&(n=r.div(y.userQuoteLpToTokenBalance)),t.gt(0)&&y.userBaseLpToTokenBalance.gt(0)&&(n=t.div(y.userBaseLpToTokenBalance)),(null==n?void 0:n.gte(1))&&(n=new i(1)),!n)return;e=n.multipliedBy(y.userBaseLpBalance);const o=e.dp(V,i.ROUND_FLOOR).div(y.totalBaseLpBalance);t=o.multipliedBy(y.baseReserve).dp(V,i.ROUND_FLOOR),r=o.multipliedBy(y.quoteReserve).dp(U,i.ROUND_FLOOR),Q=re(t.multipliedBy(1-Z).dp(V,i.ROUND_FLOOR).toString(),V).toString(),G=re(r.multipliedBy(1-Z).dp(U,i.ROUND_FLOOR).toString(),U).toString()}const r=L||M,o=[n,P,t,e.isNaN()?"0":re(e.dp(V,i.ROUND_FLOOR).toString(),V).toString(),Q,G,r,Math.ceil(Date.now()/1e3)+(null!=a?a:600)];z=O?yield le.encode.removeDSPLiquidityABI(...o):yield le.encode.removeDVMLiquidityABI(...o)}}catch(e){throw new Error(`v2 addDVMLiquidity or removeDVMLiquidity or removeDSPLiquidity error: ${e}`)}if(z&&z.data){const i={};if(m){const r=null===(c=o.getQueryData($a.getFetchTokenQuery(n,T.address,t).queryKey))||void 0===c?void 0:c.balance;r&&(i[T.address]=r.toString()),e.baseLpToken&&(null==y?void 0:y.userBaseLpBalance)&&(i[e.baseLpToken.id]=y.userBaseLpBalance.toString())}if(f){const r=null===(u=o.getQueryData($a.getFetchTokenQuery(n,E.address,t).queryKey))||void 0===u?void 0:u.balance;r&&(i[E.address]=r.toString()),e.quoteLpToken&&(null==y?void 0:y.userQuoteLpBalance)&&(i[e.quoteLpToken.id]=y.userQuoteLpBalance.toString())}try{let e;k&&L&&(z.value=IT(F?"0":D)),k&&M&&(z.value=IT(W?"0":N)),F||(e=`${D.toString()}${H}`),W||(e=F?`${N.toString()}${q}`:`${e} & ${N.toString()}${q}`);(yield r.execute(A,Object.assign(Object.assign({opcode:By.TX},z),{value:null!==(p=z.value)&&void 0!==p?p:0}),{subtitle:e,metadata:{[k?Ey.addLiquidity:Ey.removeLiquidity]:!0,logBalance:i},submittedBack:v}))===Sy.Success&&b&&b()}catch(e){throw Error(`v2 sendTransaction error: ${e}`)}}}))}),d="DPP"===(null==e?void 0:e.type)?s:l;return at.useEffect((()=>{d.reset()}),[e]),{operateLiquidityMutation:d}};function PT(e){var{sx:t,label:n,children:r}=e,i=Nn(e,["sx","label","children"]);return Os.jsxs(f,{sx:Object.assign({display:"flex",justifyContent:"space-between"},t),...i,children:[Os.jsx(f,{children:n}),Os.jsx(f,{sx:{textAlign:"right",fontWeight:600},children:r})]})}var DT=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}},NT={"text/plain":"Text","text/html":"Url",default:"Text"};var FT,WT,VT=function(e,t){var n,r,i,o,a,s,l=!1;t||(t={}),n=t.debug||!1;try{if(i=DT(),o=document.createRange(),a=document.getSelection(),(s=document.createElement("span")).textContent=e,s.ariaHidden="true",s.style.all="unset",s.style.position="fixed",s.style.top=0,s.style.clip="rect(0, 0, 0, 0)",s.style.whiteSpace="pre",s.style.webkitUserSelect="text",s.style.MozUserSelect="text",s.style.msUserSelect="text",s.style.userSelect="text",s.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=NT[t.format]||NT.default;window.clipboardData.setData(i,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(s),o.selectNodeContents(s),a.addRange(o),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!0}catch(i){n&&console.error("unable to copy using execCommand: ",i),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),l=!0}catch(i){n&&console.error("unable to copy using clipboardData: ",i),n&&console.error("falling back to prompt"),r=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(r,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(o):a.removeAllRanges()),s&&document.body.removeChild(s),i()}return l},UT=vr(VT);function HT({copyText:e,size:t,sx:n,componentProps:i,onClick:o,children:a}){var s;const[l,d]=at.useState(!1);return Os.jsx(j,{title:r._({id:"6V3Ea3",message:"Copied"}),open:l,onClose:()=>d(!1),arrow:!1,children:Os.jsxs(f,{...i,component:null!==(s=null==i?void 0:i.component)&&void 0!==s?s:y,onClick:t=>{if(null==i?void 0:i.onClick)return i.onClick(t);t.stopPropagation(),e&&(UT(e),d(!0)),o&&o()},sx:Object.assign({cursor:"pointer"},null==i?void 0:i.sx),children:[Os.jsx(f,{component:As.Copy,sx:Object.assign({width:t||"auto",height:t||"auto"},n)}),a]})})}function qT({truncate:e,address:t,disabledAddress:n,sx:r,handleOpen:i,addressHoverColor:o,addressHoverShowIcon:a}){return n?Os.jsx(f,{children:e?us(t):t}):Os.jsx(X,{lineSx:{bottom:-1},lineColor:null!=o?o:(null==r?void 0:r.color)||"",hoverSx:{color:"addressHoverColor","& svg":{display:"inline-block"}},className:"truncate-address-link",children:Os.jsxs(f,{onClick:e=>{null==i||i(e,"address")},sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[e?us(t):t,a?Os.jsx(f,{component:As.ArrowRight,sx:{display:"none",width:14,height:14}}):""]})})}function ZT({address:e,truncate:t,showCopy:n,size:r="medium",iconSize:i,iconSpace:o,sx:a,iconDarkHover:s,disabledAddress:l,addressHoverColor:d,addressHoverShowIcon:c,customChainId:u,handleOpen:p,onAddressClick:h,onShareClick:m}){const y=g(),x="medium"===r,v=s?Q:I,b=e=>{let t=e?12:8;return o&&(t=o),s&&(t-=3),t},A="big"===r?"h5":x?"body1":"body2",{chainId:w}=At(),k=null!=u?u:w,C=(t,n)=>{p?p(t,n):k&&(t.stopPropagation(),window.open(ps(k,e,"address")))},j=i||(x?16:14);return Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",typography:A,color:y.palette.text.primary,lineHeight:"normal"},a||{}),children:[Os.jsx(qT,{truncate:t,address:e,disabledAddress:l,sx:a,typography:A,handleOpen:null!=h?h:C,addressHoverColor:d,addressHoverShowIcon:c}),Os.jsx(v,{sx:{display:"inline-flex",ml:b(x),cursor:"pointer"},onClick:e=>{C(e,"icon")},children:Os.jsx(f,{component:As.ArrowTopRightBorder,sx:{width:j,height:j}})}),n?Os.jsx(HT,{size:j,copyText:e,componentProps:{component:v,sx:{ml:b(x)}}}):null,!!m&&Os.jsx(v,{sx:{display:"inline-flex",ml:b(x),cursor:"pointer"},onClick:e=>{m(e)},children:Os.jsx(f,{component:As.Share,sx:{width:j,height:j,ml:b(x)}})})]})}function zT({baseToken:e,quoteToken:t,midPrice:n,loading:r,disabled:o}){const a=g(),[s,l]=ct(!1),d=s?null==t?void 0:t.symbol:null==e?void 0:e.symbol,c=s&&n?new i(1).div(n):n,u=s?null==e?void 0:e.symbol:null==t?void 0:t.symbol;return Os.jsxs(D,{sx:{display:"flex",alignItems:"center",fontWeight:600,overflow:"hidden"},loading:r,loadingProps:{width:50},children:[e&&t?Os.jsx(A,{title:`1 ${d} = ${c?bn({input:c}):""} ${u}`,children:n?Os.jsx(f,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:`1 ${d} = ${c?bn({input:c}):""} ${u}`}):Os.jsxs(f,{children:[`1 ${d} = `,Os.jsx(D,{loading:r,loadingProps:{width:30},component:"span",sx:{display:"inline-block"},children:"-"}),` ${u}`]})}):"-",Os.jsx(f,{sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"center",ml:4,width:18,height:18,backgroundColor:"background.paperDarkContrast",borderRadius:"50%"},!o&&{cursor:"pointer","&:hover":{backgroundColor:C(a.palette.text.primary,.04)}}),onClick:()=>{o||l((e=>!e))},children:Os.jsx(f,{component:As.Switch,sx:{width:18,height:18}})})]})}function QT({baseToken:t,quoteToken:n,loading:r,midPrice:i,shareOfPool:o,sx:a}){const s=g(),l=!t||!n;return Os.jsxs(f,{sx:Object.assign({mt:20,border:"solid 1px",borderColor:"border.main",borderRadius:8},a),children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,height:36,typography:"body2"},children:[Os.jsx(f,{sx:{color:"text.secondary",whiteSpace:"nowrap"},children:Os.jsx(e,{id:"kNeEXg",message:"Current Price"})}),Os.jsx(zT,{baseToken:t,quoteToken:n,loading:r,disabled:l,midPrice:i})]}),Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,minHeight:36,typography:"body2",borderStyle:"solid",borderWidth:s.spacing(1,0,0),borderColor:"border.main"},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",color:"text.secondary",whiteSpace:"nowrap"},children:Os.jsx(e,{id:"SbBMxj",message:"Share of pool"})}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",fontWeight:600,textAlign:"right",ml:8,overflow:"hidden"},children:Os.jsx(D,{sx:{display:"flex",alignItems:"center",fontWeight:600,overflow:"hidden"},loading:r,loadingProps:{width:50},children:o||"-%"})})]})]})}function GT({open:t,onClose:n,slippage:r,baseToken:i,quoteToken:o,baseAmount:a,quoteAmount:s,lpAmount:l,fee:d,price:c,shareOfPool:u,pairAddress:p,createMutation:h}){const m=g(),{isMobile:y}=wy();return Os.jsx(yy,{modal:!0,open:t,onClose:n,title:l?Os.jsx(e,{id:"AeZIvT",message:"You will receive"}):Os.jsx(e,{id:"aM1tos",message:"You are creating a pool"}),children:Os.jsxs(f,{sx:{px:20,py:24,borderTopWidth:1,width:y?"100%":420},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,typography:"h3"},children:[Os.jsx(Cj,{width:24,height:24,tokens:i&&o?[i,o]:[],chainId:null==i?void 0:i.chainId}),l?An({input:l,decimals:18}):""]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,fontWeight:600},children:[Os.jsx(e,{id:"syToc5",message:"{0}/{1} Pool Tokens",values:{0:null==i?void 0:i.symbol,1:null==o?void 0:o.symbol}}),Os.jsx(f,{sx:{px:4,py:2,fontSize:10,lineHeight:1,backgroundColor:C(m.palette.purple.main,.1),color:m.palette.purple.main,borderRadius:4},children:Os.jsx(e,{id:"rbsyJM",message:"AMM V2"})})]})]}),Os.jsx(f,{sx:{mt:16,typography:"h6",color:"text.secondary",textAlign:"center"},children:Os.jsx(e,{id:"rQ9c+8",message:"Output is estimated. If the price changes by more than {0} your transaction will revert.",values:{0:Bn({input:r})}})}),Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:12,mt:20,p:20,typography:"body2",borderRadius:12,backgroundColor:m.palette.background.paperContrast},children:[Os.jsx(PT,{label:Os.jsx(e,{id:"YG004A",message:"{0} deposited",values:{0:null==i?void 0:i.symbol}}),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",lineHeight:1},children:[Os.jsx(ey,{width:18,height:18,marginRight:4,token:i}),An({input:a,decimals:null==i?void 0:i.decimals})]})}),Os.jsx(PT,{label:Os.jsx(e,{id:"YG004A",message:"{0} deposited",values:{0:null==o?void 0:o.symbol}}),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(ey,{width:18,height:18,marginRight:4,token:o}),An({input:s,decimals:null==o?void 0:o.decimals})]})}),Os.jsx(PT,{label:Os.jsx(e,{id:"EU3wU4",message:"Fee tier"}),children:Bn({input:d})}),Os.jsx(PT,{label:Os.jsx(e,{id:"fqDzSu",message:"Rate"}),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(ey,{width:18,height:18,marginRight:4,token:i}),Os.jsx(zT,{baseToken:i,quoteToken:o,midPrice:c})]})}),Os.jsx(PT,{label:Os.jsx(e,{id:"SbBMxj",message:"Share of pool"}),children:u}),Os.jsx(PT,{label:Os.jsx(e,{id:"ESQO1L",message:"Pool address"}),children:Os.jsx(ZT,{showCopy:!1,address:null!=p?p:"",customChainId:null==i?void 0:i.chainId,truncate:!0,iconSpace:4,sx:{typography:"body2"}})})]}),Os.jsx(T,{fullWidth:!0,size:T.Size.big,sx:{mt:20},isLoading:h.isPending,onClick:()=>{h.mutate()},children:h.isPending?Os.jsx(e,{id:"pwUZo2",message:"Confirming..."}):Os.jsx(e,{id:"7VpPHA",message:"Confirm"})})]})})}function YT({baseToken:e,quoteToken:t,baseAmount:o,quoteAmount:a,slippage:s,fee:l,isExists:d,successBack:c,submittedBack:u}){const p=Hy(),{account:h}=hf();n();const{deadLine:m}=pf();return Ot({mutationFn:()=>Fn(this,void 0,void 0,(function*(){var n,f;if(!e||!t)throw new Error("token is undefined");if(!h)throw new Error("account is undefined");if(!l)throw new Error("fee is undefined");const g=e.chainId,y=ue[g].address.toLowerCase(),x=Ce(g),v=Ie(g),b=!x,A=x||v;if(!A)throw new Error("AMMV2 contract address is not valid.");let w="",k="0x0";const C=e.address.toLowerCase()===y,j=t.address.toLowerCase()===y,T=jn(o,e.decimals),E=jn(a,t.decimals),S=T.times(1-s).dp(0,i.ROUND_FLOOR),I=E.times(1-s).dp(0,i.ROUND_FLOOR),R=jn(l,4).toString(),L=Math.ceil(Date.now()/1e3)+(null!=m?m:600);try{if(C){const e=t.address,r=E.toString(),i=I.toString(),o=S.toString();k=null!==(n=ST(T))&&void 0!==n?n:"",w=b?Re(e,r,i,o,h,L):Le(e,R,r,i,o,h,L)}else if(j){const t=e.address,n=T.toString(),r=S.toString(),i=I.toString();k=null!==(f=ST(E))&&void 0!==f?f:"",w=b?Re(t,n,r,i,h,L):Le(t,R,n,r,i,h,L)}else w=b?Me(e.address,t.address,T.toString(),E.toString(),S.toString(),I.toString(),h,L):Oe(e.address,t.address,R,T.toString(),E.toString(),S.toString(),I.toString(),h,L)}catch(e){throw console.error("encodeUniswapV2Router02AddLiquidity error",e),e}return yield p.execute(d?r._({id:"E6MqGy",message:"Add liquidity"}):r._({id:"L37FfW",message:"Create AMM V2 Position"}),{opcode:By.TX,to:A,data:w,value:k},{metadata:{[d?Ey.addLiquidityAMMV2Position:Ey.createAMMV2Position]:!0},successBack:c,submittedBack:u})}))})}function XT({submittedBack:e,onlyShowSide:t,pool:n,balanceInfo:i}){var o,a,s,l,d,c;const{account:u}=At(),{baseAmount:p,quoteAmount:h,handleChangeBaseAmount:m,handleChangeQuoteAmount:g,addPortion:y,midPrice:x,amountLoading:v,amountCheckedDisabled:b,uniV2Pair:A,reset:w}=bT({pool:n}),k=It(es.getFeeRateQuery(null==n?void 0:n.chainId,null==n?void 0:n.address,null==n?void 0:n.type,u)),C=null===(d=null===(a=null===(o=k.data)||void 0===o?void 0:o.mtFeeRate)||void 0===a?void 0:a.plus(null!==(l=null===(s=k.data)||void 0===s?void 0:s.lpFeeRate)&&void 0!==l?l:0))||void 0===d?void 0:d.toNumber(),j="AMMV2"===(null==n?void 0:n.type),[E,S]=at.useState(!1),{slipper:I,setSlipper:R,slipperValue:L,resetSlipper:M}=Ew({address:null==n?void 0:n.address,type:null==n?void 0:n.type}),O=zw(n);at.useEffect((()=>{(null==n?void 0:n.address)!==(null==O?void 0:O.address)&&(w(),M())}),[n]);const B=le.utils.canOperateLiquidity(null==n?void 0:n.type,void 0,null==n?void 0:n.creator,u),[P,N]=at.useState(!1),{isShowCompare:F,lqAndDodoCompareText:W,isWarnCompare:V}=TT(null==n?void 0:n.baseToken,null==n?void 0:n.quoteToken,x),U=j&&n.chainId?Ce(n.chainId)||Ie(n.chainId):void 0,H=EA(null==n?void 0:n.baseToken,{amount:p,contractAddress:U}),q=EA(null==n?void 0:n.quoteToken,{amount:h,contractAddress:U}),Z=H.insufficientBalance||q.insufficientBalance,{isSinglePool:z}=i,Q=!n||Z||!x||!!i.loading||!!i.error||b||k.isLoading;let G=j?r._({id:"bwSQI0",message:"Supply"}):r._({id:"m16xKo",message:"Add"});Z&&(G=r._({id:"znqB4T",message:"Insufficient balance"}));const Y=()=>{w(),M(),e&&e()},{operateLiquidityMutation:X}=BT(n),J=()=>{j?S(!0):X.mutate({txTitle:r._({id:"OBdohg",message:"Add Liquidity"}),isRemove:!1,baseAmount:p,quoteAmount:h,slippageProtection:L,balanceInfo:i,SLIPPAGE_PROTECTION:Tw,submittedBack:Y})},K=YT({baseToken:null==n?void 0:n.baseToken,quoteToken:null==n?void 0:n.quoteToken,baseAmount:p,quoteAmount:h,fee:C,isExists:!0,slippage:L,submittedBack:()=>{Y(),S(!1)}});return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{pt:20,pb:18,px:20},children:["quote"===t?"":Os.jsx(Qy,{amt:p,token:null==n?void 0:n.baseToken,canClickBalance:!0,showPercentage:!0,onInputChange:m,readOnly:i.loading||!B}),t?"":Os.jsx(Zy,{}),"base"===t?"":Os.jsx(Qy,{amt:h,token:null==n?void 0:n.quoteToken,canClickBalance:!0,showPercentage:!0,onInputChange:g,readOnly:i.loading||!B||z}),Os.jsxs(D,{loading:i.loading||v,sx:{mt:8},children:[Os.jsx(Sw,{value:I,onChange:R,disabled:!B,type:null==n?void 0:n.type}),Os.jsx(AT,{pool:n,addPortion:y,midPrice:x,shareOfPool:null==A?void 0:A.shareOfPool})]})]}),Os.jsxs(f,{sx:{px:20,py:16,position:"sticky",bottom:0,borderStyle:"solid",borderWidth:"1px 0 0",borderColor:"border.main",backgroundColor:"background.paper"},children:[F&&Os.jsx(wT,{baseToken:null==n?void 0:n.baseToken,quoteToken:null==n?void 0:n.quoteToken,lqAndDodoCompareText:W,midPrice:x}),n?Os.jsx(CT,{chainId:n.chainId,baseTokenStatus:H,quoteTokenStatus:q,children:Os.jsx(T,{fullWidth:!0,disabled:Q,danger:V,isLoading:X.isPending||K.isPending,onClick:()=>{Q||(V?N(!0):J())},children:G})}):Os.jsx(T,{fullWidth:!0,disabled:!0,children:G})]}),Os.jsx(ET,{open:P,onClose:()=>N(!1),title:r._({id:"bEsfUQ",message:"Confirm submission"}),onConfirm:J,modal:!0,children:Os.jsxs(f,{children:[Os.jsx(f,{children:r._({id:"JaeUyE",message:"Price discrepancy {lqAndDodoCompareText} between liquidity pool and the quote price on DODO.",values:{lqAndDodoCompareText:W}})}),Os.jsx(f,{children:r._({id:"vXvgFK",message:"There is risk of being arbitraged if adding this liquidity."})})]})}),Os.jsx(FA,{message:null===(c=X.error)||void 0===c?void 0:c.message,onClose:()=>X.reset()}),j&&!!n&&Os.jsx(GT,{open:E,onClose:()=>S(!1),slippage:L,baseToken:n.baseToken,baseAmount:p,quoteToken:n.quoteToken,quoteAmount:h,fee:C,price:null==A?void 0:A.price,lpAmount:null==A?void 0:A.liquidityMinted,shareOfPool:null==A?void 0:A.shareOfPool,pairAddress:n.address,createMutation:K})]})}function JT({chainId:e,address:t,token:n,quoteToken:r,lpBalance:i,lpBalanceLoading:o,balanceNeedUpdateLoading:a,tokenBalanceList:s}){var l;const d=r?`${null==n?void 0:n.symbol}/${r.symbol}`:null!==(l=null==n?void 0:n.symbol)&&void 0!==l?l:"";return Os.jsxs(f,{sx:{display:"flex"},children:[n?Os.jsx(f,{sx:{position:"relative",top:2},children:r?Os.jsx(Cj,{tokens:[n,r],chainId:e,width:18,mr:4}):Os.jsx(ey,{address:n.address,width:18,height:18,chainId:e,url:n.logoURI,marginRight:4,noShowChain:!0})}):Os.jsx(w,{width:32,height:32,sx:{mr:4}}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",wordBreak:"break-all"},children:[Os.jsx(D,{loading:o,loadingProps:{width:30},sx:{display:"flex",alignItems:"center",mr:2},children:a?Os.jsx(x,{}):bn({input:i||"-"})}),`${d} LP`,!!(null==s?void 0:s.length)&&Os.jsx(A,{title:Os.jsx(f,{sx:{display:"flex",flexDirection:"column",gap:8},children:s.map((e=>Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2",fontWeight:600,color:"text.primary"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(ey,{address:e.token.address,chainId:e.token.chainId,width:14,height:14,url:e.token.logoURI,marginRight:4,noShowChain:!0}),e.token.symbol]}),Os.jsxs(D,{loading:e.loading,children:[!e.balance||e.balance.isZero()||e.balance.isNaN()?"":"~",e.balance?bn({input:e.balance}):""]})]},e.token.address)))}),sx:{padding:20,width:256},children:Os.jsx(I,{component:As.DetailBorder,sx:{ml:4,width:16,height:16}})}),Os.jsx(f,{component:"a",target:"_blank",rel:"noopener noreferrer",href:e?ps(e,t,"address"):"",sx:{display:"inline-flex",height:14},children:Os.jsx(I,{component:As.ArrowTopRightBorder,sx:{ml:4,width:14,height:14}})})]})]},t)}function KT({loading:t,hidePoolInfo:n,pool:r,balanceInfo:o}){var a,s,l,d,c,u,p;const h=g(),m=t||!r,x=!!r&&le.utils.singleSideLp(r.type),{isTokenLoading:v}=qy(),{account:b}=hf(),w=It(es.getFeeRateQuery(null==r?void 0:r.chainId,null==r?void 0:r.address,null==r?void 0:r.type,b)),k=null===(s=null===(a=w.data)||void 0===a?void 0:a.lpFeeRate)||void 0===s?void 0:s.plus(null!==(d=null===(l=w.data)||void 0===l?void 0:l.mtFeeRate)&&void 0!==d?d:0);let C=!1,j=!1;r&&(o.userBaseLpBalance&&r.baseLpToken&&(C=v(r.baseLpToken.id,o.userBaseLpBalance)),o.userQuoteLpBalance&&r.quoteLpToken&&(j=v(r.quoteLpToken.id,o.userQuoteLpBalance)));const T="AMMV2"===(null==r?void 0:r.type);return Os.jsxs(f,{sx:{mt:16,mx:20,border:"solid 1px",borderColor:"border.main",borderRadius:12},children:[n?"":Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:h.spacing(12,20),borderStyle:"solid",borderColor:"border.main",borderWidth:h.spacing(0,0,1)},children:[Os.jsxs(f,{children:[Os.jsxs(D,{loading:m,loadingSx:{width:100,mb:4},sx:{display:"flex",alignItems:"center",gap:4,typography:"body2",fontWeight:600},children:[null===(c=null==r?void 0:r.baseToken)||void 0===c?void 0:c.symbol,"/",null===(u=null==r?void 0:r.quoteToken)||void 0===u?void 0:u.symbol,"AMMV2"===(null==r?void 0:r.type)&&Os.jsx(D,{loading:w.isLoading,loadingProps:{width:30},sx:{typography:"h6"},children:Os.jsx(A,{title:Os.jsxs(f,{sx:{typography:"h6","& > b":{fontWeight:600,color:"primary.main"}},children:["🌟",Os.jsx("b",{children:Os.jsx(e,{id:"e38JNU",message:"Tips:"})})," ",Os.jsx(e,{id:"1ABiXc",message:"By adding liquidity you’ll earn <0>{0}</0> of all trades on this pair proportional to your share of the pool. Fees are added to the pool, accrue in real time and can be claimed by withdrawing your liquidity.",values:{0:Bn({input:k})},components:{0:Os.jsx("b",{})}})]}),sx:{maxWidth:240},children:Os.jsx(f,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.disabled"},children:Bn({input:k})})})})]}),Os.jsx(D,{loading:m,children:Os.jsx(ZT,{address:null!==(p=null==r?void 0:r.address)&&void 0!==p?p:"",truncate:!0,iconSize:14,iconSpace:4,customChainId:null==r?void 0:r.chainId,sx:{typography:"h6",color:"text.secondary"}})})]}),(null==r?void 0:r.address)&&!T?Os.jsxs(f,{component:y,sx:{typography:"body2",display:"flex",alignItems:"center",color:"text.secondary"},onClick:()=>{fw.getState().push({type:pw.PoolDetail,params:{chainId:r.chainId,address:r.address}})},children:[Os.jsx(e,{id:"URmyfc",message:"Details"}),Os.jsx(f,{component:As.ArrowRight,sx:{ml:4,position:"relative",top:1.2,width:16,height:16}})]}):""]}),Os.jsxs(f,{sx:{p:h.spacing(12,20)},children:[Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"YHc3B+",message:"My Liquidity"})}),Os.jsx(f,{sx:{mt:12},children:Os.jsx(D,{loading:m,loadingSx:{width:100},children:x?Os.jsxs(Os.Fragment,{children:[Os.jsx(JT,{chainId:null==r?void 0:r.chainId,address:null==r?void 0:r.address,token:null==r?void 0:r.baseToken,lpBalance:null==o?void 0:o.userBaseLpBalance,lpBalanceLoading:o.userLpBalanceLoading,balanceNeedUpdateLoading:C,tokenBalanceList:r?[{token:r.baseToken,balance:null==o?void 0:o.userBaseLpToTokenBalance,loading:o.userLpToTokenBalanceLoading}]:void 0}),Os.jsx(JT,{chainId:null==r?void 0:r.chainId,address:null==r?void 0:r.address,token:null==r?void 0:r.quoteToken,lpBalance:null==o?void 0:o.userQuoteLpBalance,lpBalanceLoading:o.userLpBalanceLoading,balanceNeedUpdateLoading:j,tokenBalanceList:r?[{token:r.quoteToken,balance:null==o?void 0:o.userQuoteLpToTokenBalance,loading:o.userLpToTokenBalanceLoading}]:void 0})]}):Os.jsx(JT,{chainId:null==r?void 0:r.chainId,address:null==r?void 0:r.address,token:null==r?void 0:r.baseToken,quoteToken:null==r?void 0:r.quoteToken,lpBalance:o.userBaseLpBalance,lpBalanceLoading:o.userLpBalanceLoading,balanceNeedUpdateLoading:C,tokenBalanceList:r?[{token:r.baseToken,balance:o.userBaseLpToTokenBalance||new i(0),loading:o.userLpToTokenBalanceLoading},{token:r.quoteToken,balance:o.userQuoteLpToTokenBalance||new i(0),loading:o.userLpToTokenBalanceLoading}]:void 0})})})]})]})}!function(e){e[e.Add=1]="Add",e[e.Remove=2]="Remove"}(FT||(FT={})),function(e){e[e.base=1]="base",e[e.quote=2]="quote"}(WT||(WT={}));const _T=e=>{const[t,n]=at.useState(WT.base);let r,i;return e&&le.utils.singleSideLp(e.type)&&(r=t===WT.base,i=r?e.baseToken:e.quoteToken),{isBase:r,checkToken:i,checkTokenType:t,setCheckToken:n}},$T=({pool:e,isBase:t,baseAmount:n,quoteAmount:r})=>{var o,a;const s="CLASSICAL"===(null==e?void 0:e.type),l=t||void 0===t,d=null===(o=null==e?void 0:e.baseToken)||void 0===o?void 0:o.decimals,c=null===(a=null==e?void 0:e.quoteToken)||void 0===a?void 0:a.decimals,u=It(Object.assign(Object.assign({},es.getWithdrawBasePenaltyQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,n&&void 0!==d?re(new i(n).dp(d,i.ROUND_FLOOR).toString(),d).toString():"",d)),{enabled:!!e&&!!n&&s&&l})),p=It(Object.assign(Object.assign({},es.getWithdrawBasePenaltyQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,r&&void 0!==c?re(new i(r).dp(c,i.ROUND_FLOOR).toString(),c).toString():"",c)),{enabled:!!e&&!!r&&s&&!l}));let h,m="",f="",g="",y="",x="",v=!1,b=null;if(e){const t=vs(e.baseToken.decimals),o=vs(e.quoteToken.decimals);if(g=bn({input:n,showDecimals:t}),y=bn({input:r,showDecimals:o}),s)if(v=l?u.isLoading:p.isLoading,b=l?u.error:p.error,l){if(u.data){m=bn({input:u.data,showDecimals:t}),x=m;const e=new i(n).minus(u.data);g=e.gt(0)?bn({input:e,showDecimals:t}):"-",h=e}}else if(p.data){f=bn({input:p.data,showDecimals:o}),x=f;const e=new i(r).minus(p.data);g=e.gt(0)?bn({input:e,showDecimals:t}):"-",h=e}}let A=[];return e&&(s?t?A.push({amount:g||"0",symbol:e.baseToken.symbol}):A.push({amount:y||"0",symbol:e.quoteToken.symbol}):(A.push({amount:g||"0",symbol:e.baseToken.symbol}),A.push({amount:y||"0",symbol:e.quoteToken.symbol}))),{withdrawFee:x,baseWithdrawFee:m,quoteWithdrawFee:f,receiveBaseAmount:g,receiveQuoteAmount:y,receiveAmountBg:h,receiveList:A,loading:v,error:b}};function eE({token:e,pool:t,sx:n,value:r,onChange:i,selectedValue:o,lpBalance:a,balanceMax:s,balanceInfo:l,loading:d}){var c;const u=null==t?void 0:t.chainId;return Os.jsxs(f,{sx:n,children:[Os.jsxs(f,{sx:{typography:"h5",display:"flex",alignItems:"center",justifyContent:"space-between",fontWeight:600},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[e?Os.jsx(J,{checked:r===o,onChange:()=>i(r),sx:{mr:16}}):"",Os.jsx(f,{sx:{display:"flex",alignItems:"center"},children:e?Os.jsx(Os.Fragment,{children:Os.jsx(ey,{address:e.address,width:24,height:24,chainId:e.chainId||u,url:e.logoURI,noShowChain:!0})}):t&&Os.jsx(Cj,{tokens:[t.baseToken,t.quoteToken],chainId:(null===(c=t.baseToken)||void 0===c?void 0:c.chainId)||u,width:24,height:24})})]}),Os.jsxs(f,{sx:{textAlign:"right"},children:[e?`${e.symbol} LP `:t&&`${t.baseToken.symbol}\n ${t.quoteToken.symbol}\n LP `,d?Os.jsx(f,{component:x,sx:{ml:4,position:"relative",top:3}}):a&&bn({input:a})||""]})]}),Os.jsx(f,{sx:{typography:"body2",mt:5,color:"text.secondary",textAlign:"right"},children:e?Os.jsxs(Os.Fragment,{children:[d?Os.jsx(f,{component:x,sx:{ml:4,position:"relative",top:3}}):`≈ ${s&&bn({input:s})||""}`,` ${e.symbol}`]}):t&&l&&l.userBaseLpToTokenBalance&&l.userQuoteLpToTokenBalance?Os.jsxs(Os.Fragment,{children:[d?Os.jsx(f,{component:x,sx:{position:"relative",top:4}}):bn({input:l.userBaseLpToTokenBalance}),` ${null==t?void 0:t.baseToken.symbol} + `,d?Os.jsx(f,{component:x,sx:{position:"relative",top:4}}):bn({input:l.userQuoteLpToTokenBalance}),` ${null==t?void 0:t.quoteToken.symbol}`]}):""})]})}function tE({pool:e,checkTokenType:t,setCheckToken:n,balanceInfo:r,baseTokenBalanceUpdateLoading:i,quoteBalanceUpdateLoading:o}){if(!e)return null;const a=le.utils.singleSideLp(e.type);return Os.jsx(Os.Fragment,{children:a?Os.jsxs(Os.Fragment,{children:[Os.jsx(eE,{token:e.baseToken,selectedValue:t,onChange:n,value:WT.base,lpBalance:r&&r.userBaseLpBalance,balanceMax:r&&r.userBaseLpToTokenBalance,loading:i}),Os.jsx(eE,{selectedValue:t,onChange:n,sx:{mt:13},token:e.quoteToken,value:WT.quote,lpBalance:r&&r.userQuoteLpBalance,balanceMax:r&&r.userQuoteLpToTokenBalance,loading:o})]}):Os.jsx(eE,{pool:e,value:t,onChange:n,lpBalance:r&&r.userBaseLpBalance,balanceInfo:r,loading:i||o})})}function nE({submittedBack:t,onlyShowSide:o,pool:a,balanceInfo:s}){var l,d,c,u,p,h,m,g,y,x,v;const{account:b}=At(),A=s.userBaseLpToTokenBalance,w=s.userQuoteLpToTokenBalance,k=s.loading,{slipper:C,setSlipper:j,slipperValue:E,resetSlipper:S}=Ew({address:null==a?void 0:a.address}),{isBase:I,checkToken:R,checkTokenType:L,setCheckToken:M}=_T(a),{baseAmount:O,quoteAmount:B,handleChangeBaseAmount:P,handleChangeQuoteAmount:N,addPortion:F,midPrice:W,amountLoading:V,amountCheckedDisabled:U,uniV2Pair:H,reset:q}=bT({pool:a,maxBaseAmount:A,maxQuoteAmount:w}),[Z,z]=at.useState(""),[Q,G]=at.useState("");at.useEffect((()=>{const e=setTimeout((()=>{z(O)}),80);return()=>clearTimeout(e)}),[O]),at.useEffect((()=>{const e=setTimeout((()=>{G(B)}),80);return()=>clearTimeout(e)}),[B]);const Y=e=>{P(e)},X=e=>{N(e)},J="AMMV2"===(null==a?void 0:a.type),_=(null==a?void 0:a.chainId)?ue[a.chainId]:void 0,$=null===(l=null==_?void 0:_.address)||void 0===l?void 0:l.toLowerCase(),ee=null===(d=null==_?void 0:_.wrappedTokenAddress)||void 0===d?void 0:d.toLowerCase(),te=!!a&&[$,ee].includes(a.baseToken.address.toLowerCase()),ne=!!a&&[$,ee].includes(a.quoteToken.address.toLowerCase()),re=J&&a&&(te||ne),[ie,oe]=at.useState(!1),ae=re&&te&&!ie&&_?a?Object.assign(Object.assign({},a.baseToken),{symbol:_.symbol,address:_.address}):void 0:null==a?void 0:a.baseToken,se=re&&ne&&!ie&&_?a?Object.assign(Object.assign({},a.quoteToken),{symbol:_.symbol,address:_.address}):void 0:null==a?void 0:a.quoteToken,de=$T({pool:a?Object.assign(Object.assign({},a),{baseToken:ae,quoteToken:se}):a,isBase:I,baseAmount:Z,quoteAmount:Q}),{mode:ce,modeOptions:pe,handleChangeMode:he,sliderPercentage:fe,handleChangeSliderPercentage:ge,resetPercentage:ye}=function({isBase:e,pool:t,baseOverride:n,quoteOverride:i,resetAmount:o,handleChangeBaseAmount:a,handleChangeQuoteAmount:s}){const[l,d]=at.useState(Rw.percentage),[c,u]=at.useState(Iw),p=at.useRef(null),h=()=>{p.current&&clearTimeout(p.current)},m=()=>{h(),u(Iw)};return at.useEffect((()=>h),[]),{mode:l,modeOptions:[{key:Rw.quantity,value:r._({id:"PIYEqF",message:"Quantity model"})},{key:Rw.percentage,value:r._({id:"x4QVeW",message:"Percentage to remove"})}],handleChangeMode:e=>{d(e),o(),m()},sliderPercentage:c,handleChangeSliderPercentage:r=>{if(h(),r!==c&&u(r),!t)return;const o=100===r,l=()=>{if(t)if(e||void 0===e){if(n){let e=n.toString();o||(e=kn(n.times(r/100),t.baseToken.decimals)),a(e)}}else if(i){let e=i.toString();o||(e=kn(i.times(r/100),t.quoteToken.decimals)),s(e)}};o?l():p.current=setTimeout(l,100)},resetPercentage:m}}({isBase:I,pool:a,baseOverride:A,quoteOverride:w,resetAmount:q,handleChangeBaseAmount:Y,handleChangeQuoteAmount:X});at.useEffect((()=>{q(),ye()}),[L]);const xe=zw(a);at.useEffect((()=>{(null==a?void 0:a.address)!==(null==xe?void 0:xe.address)&&(q(),S(),he(Rw.percentage),ge(Iw))}),[a]),at.useEffect((()=>{ce===Rw.percentage&&ge(fe)}),[null==A?void 0:A.toString(),null==w?void 0:w.toString()]);const ve=le.utils.canOperateLiquidity(null==a?void 0:a.type,void 0,null==a?void 0:a.creator,b),[be,Ae]=at.useState(!1),{isShowCompare:we,lqAndDodoCompareText:ke,isWarnCompare:je}=TT(null==a?void 0:a.baseToken,null==a?void 0:a.quoteToken,W),Te=It(es.getFeeRateQuery(null==a?void 0:a.chainId,null==a?void 0:a.address,null==a?void 0:a.type,b)),Ee=null===(m=null===(u=null===(c=Te.data)||void 0===c?void 0:c.mtFeeRate)||void 0===u?void 0:u.plus(null!==(h=null===(p=Te.data)||void 0===p?void 0:p.lpFeeRate)&&void 0!==h?h:0))||void 0===m?void 0:m.toNumber(),{baseTokenStatus:Se,quoteTokenStatus:Re}=function({pool:e,baseAmount:t,quoteAmount:n,balanceInfo:r}){var o,a,s,l,d;const{chainId:c,baseToken:u,quoteToken:p}=null!=e?e:{};let h="";const m="AMMV2"===(null==e?void 0:e.type);c&&(h=null!==(o=me[c].DODO_V1_PAIR_PROXY)&&void 0!==o?o:"",m&&(h=Ce(c)||Ie(e.chainId)));const f=null!==(s=null===(a=null==e?void 0:e.baseLpToken)||void 0===a?void 0:a.id)&&void 0!==s?s:"",g=null!==(d=null===(l=null==e?void 0:e.quoteLpToken)||void 0===l?void 0:l.id)&&void 0!==d?d:"",y="CLASSICAL"===(null==e?void 0:e.type);return{baseTokenStatus:EA(u?Object.assign(Object.assign({},u),{symbol:y?u.symbol+" LP":`${u.symbol}/${null==p?void 0:p.symbol} LP`,address:f}):void 0,{amount:m&&r.userBaseLpToTokenBalance&&r.userBaseLpBalance?new i(t).div(r.userBaseLpToTokenBalance).times(r.userBaseLpBalance).toString():t,skipQuery:!h||!f||!y&&!m,contractAddress:h,overrideBalance:m?r.userBaseLpBalance:r.userBaseLpToTokenBalance}),quoteTokenStatus:EA(p?Object.assign(Object.assign({},p),{address:g}):void 0,{amount:n,skipQuery:!h||!g||!y,contractAddress:h,overrideBalance:r.userQuoteLpToTokenBalance})}}({pool:a,baseAmount:O,quoteAmount:B,balanceInfo:s}),Le=Se.insufficientBalance||Re.insufficientBalance,{isSinglePool:Me}=s,Oe=!a||Le||!W||!!s.loading||!!s.error||U||!!de.error||de.loading||!!(null===(g=de.receiveAmountBg)||void 0===g?void 0:g.lte(0))||Te.isLoading,Fe=Le?r._({id:"znqB4T",message:"Insufficient balance"}):r._({id:"t/YqKh",message:"Remove"}),We=()=>{q(),S(),t&&t()},Ve=null===(y=null==H?void 0:H.pair)||void 0===y?void 0:y.liquidityToken.decimals,Ue=null===(x=s.userBaseLpBalance)||void 0===x?void 0:x.times(fe/100),He=Ue&&void 0!==Ve?jn(Ue,Ve).toString():"",{operateLiquidityMutation:qe}=BT(a),Ze=function({baseToken:e,quoteToken:t,baseAmount:o,quoteAmount:a,liquidityAmount:s,slippage:l,fee:d,submittedBack:c}){const u=Hy(),{account:p}=hf();n();const{deadLine:h}=pf();return Ot({mutationFn:()=>Fn(this,void 0,void 0,(function*(){if(!e||!t)throw new Error("token is undefined");if(!p)throw new Error("account is undefined");if(!d)throw new Error("fee is undefined");const n=e.chainId,m=ue[n].address.toLowerCase(),f=Ce(n),g=Ie(n),y=!f,x=f||g;if(!x)throw new Error("AMMV2 contract address is not valid.");let v="";const b=e.address.toLowerCase()===m,A=t.address.toLowerCase()===m,w=jn(new i(o).times(1-l),e.decimals),k=jn(new i(a).times(1-l),t.decimals),C=jn(d,4).toString(),j=Math.ceil(Date.now()/1e3)+(null!=h?h:600);try{if(b){const e=t.address,n=k.toString(),r=w.toString();v=y?Be(e,s,n,r,p,j):Pe(e,C,s,n,r,p,j)}else if(A){const t=e.address,n=w.toString(),r=k.toString();v=y?Be(t,s,n,r,p,j):Pe(t,C,s,n,r,p,j)}else v=y?De(e.address,t.address,s,w.toString(),k.toString(),p,j):Ne(e.address,t.address,C,s,w.toString(),k.toString(),p,j)}catch(e){throw console.error("encodeUniswapV2Router02RemoveLiquidity error",e),e}return yield u.execute(r._({id:"cJtosk",message:"Remove liquidity"}),{opcode:By.TX,to:x,data:v,value:"0x0"},{metadata:{[Ey.removeLiqidityAMMV2Position]:!0},submittedBack:c})}))})}({baseToken:ae,quoteToken:se,baseAmount:O,quoteAmount:B,liquidityAmount:He,slippage:E,fee:Ee,submittedBack:We}),ze=()=>{if(J)return Ze.mutate();qe.mutate({txTitle:r._({id:"3XBvkd",message:"Remove Liquidity"}),isRemove:!0,baseAmount:O,quoteAmount:B,slippageProtection:E,balanceInfo:s,SLIPPAGE_PROTECTION:Tw,submittedBack:We})};return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{pb:18,px:20},children:[!J&&Os.jsxs(f,{sx:{mt:20,borderStyle:"solid",borderWidth:1,borderRadius:12},children:[Os.jsx(K,{value:ce,options:pe,onChange:(e,t)=>he(t),popupOffset:0,sx:{px:20,py:12,width:"100%",backgroundColor:"transparent",color:"text.primary"}}),!!a&&le.utils.singleSideLp(a.type)&&Os.jsx(f,{sx:{pt:20,pb:13,px:20,borderStyle:"solid",borderWidth:"1px 0 0"},children:Os.jsx(tE,{pool:a,balanceInfo:s,checkTokenType:L,setCheckToken:M,baseTokenBalanceUpdateLoading:!1,quoteBalanceUpdateLoading:!1})})]}),Os.jsx(f,{sx:{pt:20},children:ce===Rw.percentage?Os.jsx(bw,{disabled:s.loading||!ve,value:fe,onChange:ge}):R?Os.jsx(Qy,{amt:I?O:B,token:R,canClickBalance:!0,showPercentage:!0,onInputChange:I?Y:X,readOnly:s.loading||!ve,overrideBalance:I?A:w,overrideBalanceLoading:k}):Os.jsxs(Os.Fragment,{children:[Os.jsx(Qy,{amt:O,token:null==a?void 0:a.baseToken,canClickBalance:!0,showPercentage:!0,onInputChange:Y,readOnly:s.loading||!ve,overrideBalance:A,overrideBalanceLoading:k}),o?"":Os.jsx(Zy,{}),"base"===o?"":Os.jsx(Qy,{amt:B,token:null==a?void 0:a.quoteToken,canClickBalance:!0,showPercentage:!0,onInputChange:X,readOnly:s.loading||!ve||Me,overrideBalance:w,overrideBalanceLoading:k})]})}),Os.jsxs(D,{loading:s.loading||V,sx:{mt:8},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"flex-end",gap:8},children:[J&&re&&Os.jsx(f,{sx:{px:12,py:4,borderRadius:20,borderWidth:1,backgroundColor:"transparent",color:"primary.main",cursor:"pointer",typography:"body2","&:hover":{backgroundColor:"hover.default"}},component:"button",onClick:()=>oe((e=>!e)),children:Os.jsx(e,{id:"/k7Ttv",message:"Receive {0}",values:{0:ie?null==_?void 0:_.symbol:null==_?void 0:_.wrappedTokenSymbol}})}),Os.jsx(Sw,{value:C,onChange:j,disabled:!ve,type:null==a?void 0:a.type,sx:{margin:0}})]}),Os.jsx(AT,{pool:a,addPortion:F,midPrice:W,shareOfPool:null==H?void 0:H.shareOfPool})]}),!!a&&Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",mt:20,mb:14},children:[Os.jsx(f,{sx:{typography:"body2",color:"text.secondary",position:"relative",top:2},children:Os.jsx(e,{id:"lDgVWA",message:"Receive"})}),Os.jsx(f,{sx:{textAlign:"right"},children:de.receiveList.map(((e,t)=>Os.jsxs(f,{sx:{mt:t>0?4:0},children:[Os.jsxs(D,{component:"span",loading:de.loading,loadingSx:{mr:8,width:100},sx:{display:"inline-block",typography:"h5",fontWeight:600,color:de.receiveBaseAmount&&"0"!==de.receiveBaseAmount?"primary.main":"text.primary"},children:[e.amount," "]}),Os.jsx(f,{component:"span",sx:{typography:"body2"},children:e.symbol})]},e.symbol)))})]})]}),Os.jsxs(f,{sx:{px:20,py:16,position:"sticky",bottom:0,borderStyle:"solid",borderWidth:"1px 0 0",borderColor:"border.main",backgroundColor:"background.paper"},children:[we&&Os.jsx(wT,{baseToken:null==a?void 0:a.baseToken,quoteToken:null==a?void 0:a.quoteToken,lqAndDodoCompareText:ke,midPrice:W}),a?Os.jsx(CT,{chainId:a.chainId,baseTokenStatus:Se,quoteTokenStatus:Re,children:Os.jsx(T,{fullWidth:!0,disabled:Oe,danger:je,isLoading:qe.isPending||Ze.isPending,onClick:()=>{Oe||(je?Ae(!0):ze())},children:Fe})}):Os.jsx(T,{fullWidth:!0,disabled:!0,children:Fe})]}),Os.jsx(ET,{open:be,onClose:()=>Ae(!1),title:r._({id:"bEsfUQ",message:"Confirm submission"}),onConfirm:ze,modal:!0,children:Os.jsxs(f,{children:[Os.jsx(f,{children:r._({id:"JaeUyE",message:"Price discrepancy {lqAndDodoCompareText} between liquidity pool and the quote price on DODO.",values:{lqAndDodoCompareText:ke}})}),Os.jsx(f,{children:r._({id:"vXvgFK",message:"There is risk of being arbitraged if adding this liquidity."})})]})}),Os.jsx(FA,{message:null===(v=qe.error)||void 0===v?void 0:v.message,onClose:()=>qe.reset()})]})}function rE({pool:e,operate:t,hidePoolInfo:r,errorRefetch:i,submittedBack:o}){var a,s,l,d,c,u;const{operateTab:p,operateTabs:h,handleChangeTab:m}=function(e=FT.Add){const{i18n:t}=n(),[r,i]=at.useState(e),o=at.useMemo((()=>[{key:FT.Add,value:t._({id:"m16xKo",message:"Add"})},{key:FT.Remove,value:t._({id:"t/YqKh",message:"Remove"})}]),[t._]);return at.useEffect((()=>{i(e)}),[e]),{operateTab:r,operateTabs:o,handleChangeTab:e=>{i(e)}}}(t),{account:f}=At(),g=xT({account:f,pool:e?{chainId:e.chainId,address:e.address,type:e.type,baseTokenDecimals:e.baseToken.decimals,quoteTokenDecimals:e.quoteToken.decimals,baseLpTokenDecimals:null!==(s=null===(a=e.baseLpToken)||void 0===a?void 0:a.decimals)&&void 0!==s?s:18,quoteLpTokenDecimals:null!==(d=null===(l=e.quoteLpToken)||void 0===l?void 0:l.decimals)&&void 0!==d?d:18}:void 0}),y=It(es.getPMMStateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(c=null==e?void 0:e.baseToken)||void 0===c?void 0:c.decimals,null===(u=null==e?void 0:e.quoteToken)||void 0===u?void 0:u.decimals));return g.error||y.error||i?Os.jsx(mT,{refresh:()=>{g.error&&g.refetch(),y.error&&y.refetch(),i&&i()},sx:{my:40,height:"100%"}}):Os.jsxs(Os.Fragment,{children:[Os.jsx(KT,{pool:e,balanceInfo:g,hidePoolInfo:r}),Os.jsxs(H,{value:p,onChange:(e,t)=>{m(t)},children:[Os.jsx(G,{tabs:h,variant:"inPaper",tabsListSx:{mt:16,mx:20}}),Os.jsx(z,{value:FT.Add,children:Os.jsx(XT,{pool:e,balanceInfo:g,submittedBack:o})}),Os.jsx(z,{value:FT.Remove,children:Os.jsx(nE,{pool:e,balanceInfo:g,submittedBack:o})})]})]})}const iE=new ge({contractRequests:Ka});function oE({chainId:e,address:t,showName:n,size:r,offset:i,rightContent:o}){const a=Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:i},children:[Os.jsx(ey,{chainId:e,address:t,width:r,height:r,noShowChain:!0,marginRight:0}),n]});return o?Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a,o]}):a}function aE({miningItem:e}){var t,n;const{account:r}=At(),o=null!==(t=null==e?void 0:e.rewardTokenInfos)&&void 0!==t?t:[],a=[],s=[];if(e){const t=e.version,i=null!==(n=e.miningContractAddress)&&void 0!==n?n:"";o.forEach((n=>{var o,l,d,c,u,p,h,m,f;const g={address:null!==(o=null==n?void 0:n.address)&&void 0!==o?o:"",decimals:null==n?void 0:n.decimals,symbol:null!==(l=null==n?void 0:n.symbol)&&void 0!==l?l:"",usdPrice:null!==(d=null==n?void 0:n.price)&&void 0!==d?d:""};if("3"===t)a.push(g),s.push(iE.getPendingRewardQuery(e.chainId,i,r,g.address,g.decimals,t));else switch(e.type){case"classical":a.push(g),s.push(iE.getPendingRewardQuery(e.chainId,i,r,null!==(u=null===(c=e.baseLpToken)||void 0===c?void 0:c.address)&&void 0!==u?u:"",g.decimals,"2")),a.push(g),s.push(iE.getPendingRewardQuery(e.chainId,i,r,null!==(h=null===(p=e.quoteLpToken)||void 0===p?void 0:p.address)&&void 0!==h?h:"",g.decimals,"2"));break;case"vdodo":case"single":a.push(g),s.push(iE.getPendingRewardQuery(e.chainId,i,r,null!==(f=null===(m=e.baseToken)||void 0===m?void 0:m.address)&&void 0!==f?f:"",g.decimals,"2"));break;default:throw new Error(`type: ${e.type} is not valid.`)}}))}return St({queries:s,combine:e=>{let t=new i(0),n=new i(0);return{data:e.map(((e,r)=>{const i=a[r],o=e.data;if(o){t=o.plus(t);const e=null==i?void 0:i.usdPrice;e&&(n=n.plus(o.times(e)))}return Object.assign(Object.assign({},i),{amount:o})})),pending:e.some((e=>e.isPending)),error:e.some((e=>e.isError)),totalReward:t,totalRewardUSD:n,refetch:()=>{e.forEach((e=>e.refetch()))}}}})}function sE({value:e,label:t,tokenList:n,loading:r}){const i=g();return Os.jsxs(f,{sx:{flexGrow:0,flexShrink:1,width:"30%"},children:[Os.jsx(f,{sx:{typography:"h6",color:i.palette.text.secondary},children:t}),Os.jsxs(f,{sx:{mt:8,typography:"body1",fontWeight:600,color:i.palette.text.primary,display:"flex",alignItems:"center",gap:4},children:[Os.jsx(D,{loading:r,loadingProps:{width:30},children:e?`$${An({input:e,decimals:2})}`:"-"}),Os.jsx(A,{placement:"top",title:Os.jsx(f,{sx:{display:"flex",flexDirection:"column",gap:8,width:190,color:"text.primary",fontWeight:600},children:n.map((e=>{var t;return Os.jsx(oE,{chainId:e.chainId,address:e.address,showName:null!==(t=e.symbolEle)&&void 0!==t?t:e.symbol,rightContent:e.amount,size:20,offset:6},e.address+e.chainId)}))}),children:Os.jsx(f,{component:y,sx:{display:"flex",alignItems:"center",color:i.palette.text.secondary,width:16,height:16,"&:hover":{color:"text.primary"}},children:Os.jsx(As.DetailBorder,{})})})]})]})}function lE({chainId:t,loading:n,miningItem:i,miningContractAddress:o,stakedTokenUSD:a,stakedTokenUSDLoading:s,miningTitle:l,associatedMineSectionShort:d,stakedTokenList:c,isEnded:u}){var p,h;const m=g(),y=aE({miningItem:i});return Os.jsxs(f,{sx:{backgroundColor:m.palette.background.paper,borderRadius:8,borderColor:m.palette.border.main,borderStyle:"solid",borderWidth:1,mb:20},children:[d?null:Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{py:12,px:20,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(D,{loading:n,loadingProps:{width:100},children:Os.jsx(Cj,{width:24,tokens:c,gap:-6,chainId:t,mr:4,showChainLogo:!1})}),Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4},children:[Os.jsx(f,{sx:{color:m.palette.text.primary,typography:"body2",fontWeight:600,display:"flex",alignItems:"center"},children:null!=l?l:"-"}),u&&Os.jsx(f,{sx:{backgroundColor:m.palette.border.disabled,borderRadius:4,typography:"h6",fontWeight:500,px:8,color:m.palette.text.disabled},children:Os.jsx(e,{id:"237hSL",message:"Ended"})})]}),Os.jsx(ZT,{size:"small",truncate:!0,address:null!=o?o:"",iconSpace:4,sx:{color:m.palette.text.secondary,typography:"h6"},customChainId:t})]})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",color:m.palette.text.secondary,typography:"h6",cursor:"pointer"},onClick:()=>{fw.getState().push({type:pw.MiningDetail,params:{address:o,chainId:t}})},children:[Os.jsx(e,{id:"URmyfc",message:"Details"}),Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:Os.jsx("path",{d:"M7.5 4.5L6.4425 5.5575L9.8775 9L6.4425 12.4425L7.5 13.5L12 9L7.5 4.5Z",fill:"currentColor"})})]})]}),Os.jsx(f,{sx:{width:"100%",height:"1px",backgroundColor:m.palette.border.main}})]}),Os.jsxs(f,{sx:{py:12,px:20,display:"flex",alignItems:"center",gap:20},children:[Os.jsx(sE,{value:a,label:r._({id:"luOvdJ",message:"My Staked"}),tokenList:c,loading:n||s}),Os.jsx(f,{sx:{width:"1px",height:30,backgroundColor:m.palette.border.main,flexGrow:0,flexShrink:0}}),Os.jsx(sE,{value:y.totalRewardUSD,label:r._({id:"4cJ0hF",message:"Rewards"}),tokenList:null!==(h=null===(p=y.data)||void 0===p?void 0:p.map((e=>Object.assign(Object.assign({chainId:t},e),{name:e.symbol,amount:An({input:e.amount,decimals:e.decimals})}))))&&void 0!==h?h:[],loading:y.pending||n})]})]})}const dE=({miningItem:e,successBack:t})=>{const{account:n}=hf(),i=Hy();return Ot({mutationFn:()=>Fn(void 0,void 0,void 0,(function*(){const o=yield Fn(void 0,void 0,void 0,(function*(){if(!n||!(null==e?void 0:e.miningContractAddress))return null;let t="";const r=yield ge.encode.claimAllMining(e.miningContractAddress);if(r&&r.data)return r.value=0,r;throw t="invalid data",new Error(t)}));if(!o)return;return yield i.execute(r._({id:"hom7qf",message:"Claim"}),Object.assign({opcode:By.TX},o),{metadata:{[Ey.claimMining]:"1"},successBack:t})}))})};function cE({miningItem:t}){const n=aE({miningItem:t}),r=dE({miningItem:t,successBack:()=>{n.refetch()}});return Os.jsx(sb,{includeButton:!0,fullWidth:!0,chainId:null==t?void 0:t.chainId,children:Os.jsx(T,{fullWidth:!0,isLoading:r.isPending,disabled:n.totalReward.isZero(),onClick:()=>{r.mutate()},children:r.isPending?Os.jsx(e,{id:"KvG1xW",message:"Claiming"}):Os.jsx(e,{id:"dUdltF",message:"One-Click Claim"})})})}function uE({tokenSymbol:e,goLpLink:t}){const n=g();return Os.jsxs(X,{sx:{color:n.palette.text.secondary,typography:"h6",display:"flex",alignItems:"center"},component:y,onClick:t,children:[r._({id:"dJqd5x",message:"Get {tokenSymbol}",values:{tokenSymbol:e}}),Os.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{d:"M5.83324 3.88867L5.01074 4.71117L7.68241 7.38867L5.01074 10.0662L5.83324 10.8887L9.33324 7.38867L5.83324 3.88867Z",fill:"currentColor"})})]})}function pE({miningItem:t,loading:n,sx:r}){const o=g(),a=aE({miningItem:t});return Os.jsxs(f,{sx:Object.assign({borderWidth:1,borderRadius:12},r),children:[Os.jsxs(f,{sx:{typography:"body1",color:o.palette.text.secondary,display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:12},children:[Os.jsx(e,{id:"4cJ0hF",message:"Rewards"}),":",Os.jsx(D,{loading:n||a.pending,loadingProps:{width:100},sx:{color:o.palette.text.primary,fontWeight:600},children:a.pending||a.error?"-":`$${An({input:a.totalRewardUSD,decimals:2})}`})]}),Os.jsxs(f,{sx:{borderTopWidth:1,px:20,pt:4,pb:8},children:[(n||a.pending)&&Os.jsx(D,{loading:n,loadingProps:{width:150}}),!n&&!a.pending&&!!t&&a.data.map((e=>Os.jsxs(f,{sx:{mt:16,display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[e.address&&e.symbol&&Os.jsx(oE,{chainId:t.chainId,address:e.address,showName:e.symbol,size:24,offset:6}),Os.jsxs(f,{sx:{ml:"auto"},children:[Os.jsx(f,{sx:{typography:"h5",textAlign:"right"},children:An({input:e.amount,decimals:e.decimals})}),Os.jsx(f,{sx:{mt:2,typography:"body2",color:o.palette.text.secondary,textAlign:"right"},children:e.usdPrice&&e.amount?`≈ $${An({input:new i(e.amount).multipliedBy(e.usdPrice).dp(4,i.ROUND_DOWN),decimals:4})}`:"-"})]})]},e.address)))]})]})}const hE=({miningItem:e,amount:t,submittedBack:n,successBack:o,logBalance:a})=>{const{chainId:s,account:l}=hf(),d=Hy(),c=ue[s];return Ot({mutationFn:()=>Fn(void 0,void 0,void 0,(function*(){const s=yield Fn(void 0,void 0,void 0,(function*(){var n,r;if(!(l&&e&&e.baseToken&&e.miningContractAddress))return null;let o="";const a=new i(t),s=Number(e.baseToken.decimals),d=yield ge.encode.depositMining(e.miningContractAddress,a,s);if(!d||!d.data)throw o="invalid data",new Error(o);try{return t&&(null===(r=null===(n=e.baseLpToken)||void 0===n?void 0:n.address)||void 0===r?void 0:r.toLocaleLowerCase())===c.address.toLocaleLowerCase()?d.value=IT(a):d.value=0,d}catch(e){throw console.error("2.0 sendTransaction error",e),o=`2.0 sendTransaction error; ERROR: ${e}`,new Error(o)}}));if(!s)return;return yield d.execute(r._({id:"JYKRJS",message:"Stake"}),Object.assign({opcode:By.TX},s),{metadata:{[Ey.stakeMining]:"1",logBalance:a},submittedBack:n,successBack:o})}))})};function mE({goLpLink:t,amount:n,miningItem:i,balanceInfo:o,submittedBack:a,successBack:s,logBalance:l}){var d,c,u,p;const h=hE({miningItem:i,amount:n,submittedBack:a,successBack:s,logBalance:l}),m=i?`${null===(d=i.baseToken)||void 0===d?void 0:d.symbol}-${null===(c=i.quoteToken)||void 0===c?void 0:c.symbol} LP`:"",f=EA(i?bs(Object.assign(Object.assign({},i.baseLpToken),{symbol:m}),i.chainId):null,{contractAddress:null!==(u=null==i?void 0:i.miningContractAddress)&&void 0!==u?u:"",overrideBalance:o.userBaseLpBalance,amount:n});return t&&m&&(null===(p=o.userBaseLpBalance)||void 0===p?void 0:p.isZero())?Os.jsx(T,{fullWidth:!0,onClick:()=>t(),children:r._({id:"dJqd5x",message:"Get {tokenSymbol}",values:{tokenSymbol:m}})}):Os.jsx(sb,{includeButton:!0,fullWidth:!0,chainId:null==i?void 0:i.chainId,children:Os.jsx(kT,{status:f,children:Os.jsx(T,{fullWidth:!0,isLoading:h.isPending,disabled:!Number(n),onClick:()=>{h.mutate()},children:h.isPending?Os.jsx(e,{id:"KsqhWn",message:"Staking"}):Os.jsx(e,{id:"JYKRJS",message:"Stake"})})})})}const fE=({miningItem:e,amount:t,submittedBack:n,successBack:o,logBalance:a})=>{const{account:s}=hf(),l=Hy();return Ot({mutationFn:()=>Fn(void 0,void 0,void 0,(function*(){const d=yield Fn(void 0,void 0,void 0,(function*(){if(!(s&&e&&e.baseToken&&e.miningContractAddress))return null;let n="";const r=new i(t),o=Number(e.baseToken.decimals),a=yield ge.encode.withdrawMining(e.miningContractAddress,r,o);if(a&&a.data)return a.value=0,a;throw n="invalid data",new Error(n)}));if(!d)return;return yield l.execute(r._({id:"OFjZGo",message:"Unstake"}),Object.assign({opcode:By.TX},d),{metadata:{[Ey.unstakeMining]:"1",logBalance:a},submittedBack:n,successBack:o})}))})};function gE({amount:t,miningItem:n,overrideBalance:r,submittedBack:i,successBack:o,logBalance:a}){var s,l;const d=fE({miningItem:n,amount:t,submittedBack:i,successBack:o,logBalance:a}),c=n?`${null===(s=n.baseToken)||void 0===s?void 0:s.symbol}-${null===(l=n.quoteToken)||void 0===l?void 0:l.symbol} LP`:"",u=EA(n?bs(Object.assign(Object.assign({},n.baseLpToken),{symbol:c}),n.chainId):null,{overrideBalance:r,amount:t,skipQuery:!0});return Os.jsx(sb,{includeButton:!0,fullWidth:!0,chainId:null==n?void 0:n.chainId,children:Os.jsx(kT,{status:u,children:Os.jsx(T,{fullWidth:!0,isLoading:d.isPending,disabled:!Number(t),onClick:()=>{d.mutate()},children:d.isPending?Os.jsx(e,{id:"1gWStS",message:"Unstaking"}):Os.jsx(e,{id:"OFjZGo",message:"Unstake"})})})})}function yE(e){var{sx:t}=e,n=Nn(e,["sx"]);const r=g();return Os.jsx(f,{sx:Object.assign({paddingTop:20,backgroundColor:r.palette.background.paper,position:"sticky",bottom:0},t),...n})}function xE({chainId:e,poolAddress:t,status:n,loading:o,operateType:a,setOperateType:s,miningItem:l,associatedMineSectionVisible:d,goLpLink:c}){var u,p,h,m,y,x,v,b,A,w,k,C,j,T,E,S,I;const R=g(),{account:L}=At(),{miningContractAddress:M}=null!=l?l:{},O=bs(null==l?void 0:l.baseToken,e),B=bs(null==l?void 0:l.quoteToken,e),[P,D]=at.useState(""),[N,F]=at.useState(""),W=[{key:"stake",value:r._({id:"JYKRJS",message:"Stake"})},{key:"unstake",value:r._({id:"OFjZGo",message:"Unstake"})},{key:"claim",value:r._({id:"hom7qf",message:"Claim"})}],V=l&&O&&B&&["classical","lptoken"].includes(null!==(u=l.type)&&void 0!==u?u:"")?{chainId:e,address:t,type:"lptoken"===l.type?"DSP":"CLASSICAL",baseToken:O,quoteToken:B}:void 0,U=xT({account:L,pool:l&&O&&B&&l.baseLpToken&&l.quoteLpToken&&["classical","lptoken"].includes(null!==(p=l.type)&&void 0!==p?p:"")?{chainId:e,address:t,type:"lptoken"===l.type?"DSP":"CLASSICAL",baseTokenDecimals:O.decimals,quoteTokenDecimals:B.decimals,baseLpTokenDecimals:null!==(h=l.baseLpToken.decimals)&&void 0!==h?h:18,quoteLpTokenDecimals:null!==(m=l.quoteLpToken.decimals)&&void 0!==m?m:18}:void 0}),q=It(es.getPMMStateQuery(null==V?void 0:V.chainId,null==V?void 0:V.address,null==V?void 0:V.type,null===(y=null==V?void 0:V.baseToken)||void 0===y?void 0:y.decimals,null===(x=null==V?void 0:V.quoteToken)||void 0===x?void 0:x.decimals)),Z=It(iE.getLpStakedBalance(null==l?void 0:l.chainId,(null==l?void 0:l.miningContractAddress)||void 0,L,null!==(b=null===(v=null==l?void 0:l.baseLpToken)||void 0===v?void 0:v.address)&&void 0!==b?b:"",null===(A=null==l?void 0:l.baseToken)||void 0===A?void 0:A.decimals,null==l?void 0:l.version)),Q=Z.isLoading||q.isLoading;let Y,X,J;if(Z.data&&U.baseLpToTokenProportion&&U.quoteLpToTokenProportion&&!q.isLoading){const e=null===(w=null==l?void 0:l.baseToken)||void 0===w?void 0:w.price,t=null===(k=null==l?void 0:l.quoteToken)||void 0===k?void 0:k.price,n=null===(C=q.data)||void 0===C?void 0:C.midPrice;X=Z.data.times(U.baseLpToTokenProportion),J=Z.data.times(U.quoteLpToTokenProportion),n?t?Y=X.times(n).plus(J).times(t):e&&(Y=J.times(n).plus(X).times(e)):e&&t&&(Y=X.times(e).plus(J.times(t)))}const K=O&&B?[Object.assign(Object.assign({},O),{amount:An({input:X,decimals:O.decimals})}),Object.assign(Object.assign({},B),{amount:An({input:J,decimals:B.decimals})})]:[],_=O&&B?`${O.symbol}-${B.symbol} LP`:"- LP",$=n===ye.ended,ee=(null===(j=null==l?void 0:l.baseLpToken)||void 0===j?void 0:j.address)&&U.userBaseLpBalance?{[null===(T=null==l?void 0:l.baseLpToken)||void 0===T?void 0:T.address]:U.userBaseLpBalance.toString()}:{},te=()=>{U.refetch(),q.refetch(),Z.refetch()};return Os.jsx(Os.Fragment,{children:Os.jsxs(f,{sx:{paddingTop:20,borderTopLeftRadius:16,borderTopRightRadius:16,backgroundColor:R.palette.background.paper,px:20,paddingBottom:0,borderBottomLeftRadius:0,borderBottomRightRadius:0},children:[d&&Os.jsx(lE,{chainId:e,miningContractAddress:null!=M?M:"",loading:o,miningItem:l,stakedTokenUSD:Y,stakedTokenUSDLoading:Q,miningTitle:null!==(E=null==l?void 0:l.title)&&void 0!==E?E:"",stakedTokenList:K}),Os.jsxs(H,{value:a,onChange:(e,t)=>{s(t)},children:[Os.jsx(G,{tabs:W,variant:"inPaper",tabsListSx:{mt:16}}),Os.jsxs(z,{value:"stake",children:[Os.jsxs(f,{sx:{mt:20,borderColor:R.palette.border.main,borderWidth:1,borderStyle:"solid",borderRadius:12,display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:16},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(Cj,{width:K.length>1?20:28,tokens:K,chainId:e}),Os.jsx(f,{sx:{ml:8,typography:"body1",color:R.palette.text.primary,fontWeight:600},children:_})]}),!!c&&Os.jsx(uE,{tokenSymbol:_,goLpLink:c})]}),Os.jsx(Qy,{showPercentage:!0,hideToken:!0,inputTypography:"h1",balanceText:r._({id:"RxHSET",message:"LP Balance:"}),overrideBalance:U.userBaseLpBalance||new i("-"),overrideBalanceLoading:U.loading,amt:P,canClickBalance:!0,onInputChange:e=>{D(e)},readOnly:$||o,token:O,checkLogBalance:ee,occupiedChainId:e,chainId:e,sx:{mt:20,borderWidth:1}}),Os.jsx(yE,{children:Os.jsx(mE,{miningItem:l,balanceInfo:U,amount:P,goLpLink:c,submittedBack:()=>D(""),successBack:te,logBalance:ee})})]}),Os.jsxs(z,{value:"unstake",children:[Os.jsx(Qy,{showPercentage:!0,hideToken:!0,inputTypography:"h1",balanceText:r._({id:"RxHSET",message:"LP Balance:"}),overrideBalance:Z.data||new i("-"),overrideBalanceLoading:Z.isLoading,amt:$?null!==(I=null===(S=Z.data)||void 0===S?void 0:S.toString())&&void 0!==I?I:"":N,onInputChange:e=>{F(e)},canClickBalance:!0,readOnly:$||o,token:O,checkLogBalance:ee,occupiedChainId:e,chainId:e,sx:{mt:20,borderWidth:1}}),Os.jsx(yE,{children:Os.jsx(gE,{miningItem:l,overrideBalance:Z.data,amount:N,submittedBack:()=>F(""),successBack:te,logBalance:ee})})]}),Os.jsxs(z,{value:"claim",children:[Os.jsx(pE,{miningItem:l,loading:o,sx:{mt:20}}),Os.jsx(yE,{children:Os.jsx(cE,{miningItem:l})})]})]})]})})}function vE({chainId:e,account:t,poolAddress:n,goLpLink:r}){var i,o,a;const s=QA().getQuery(ge.graphql.fetchMiningList,{where:{chainIds:[e],user:t,filterState:{address:n}}}),l=It(Object.assign(Object.assign({},s),{enabled:!!n})),d=null===(a=null===(o=null===(i=l.data)||void 0===i?void 0:i.mining_list)||void 0===o?void 0:o.list)||void 0===a?void 0:a[0],{status:c}=function({miningItem:e}){var t,n;let r=ye.active,i=[];if(null==e?void 0:e.rewardTokenInfos)if("classical"!==e.type){const o=ge.utils.getMiningStatusByTimestamp({startTime:null!==(t=e.startTime)&&void 0!==t?t:"",endTime:null!==(n=e.endTime)&&void 0!==n?n:"",rewardTokenInfoList:e.rewardTokenInfos.map((e=>{var t,n;return{startTime:null!==(t=null==e?void 0:e.startTime)&&void 0!==t?t:"",endTime:null!==(n=null==e?void 0:e.endTime)&&void 0!==n?n:""}}))});r=o.status,i.push(o)}else if(e.rewardQuoteTokenInfos){i=[e.rewardTokenInfos,e.rewardQuoteTokenInfos].map((t=>{var n,r;return ge.utils.getMiningStatusByTimestamp({startTime:null!==(n=e.startTime)&&void 0!==n?n:"",endTime:null!==(r=e.endTime)&&void 0!==r?r:"",rewardTokenInfoList:t.map((e=>{var t,n;return{startTime:null!==(t=null==e?void 0:e.startTime)&&void 0!==t?t:"",endTime:null!==(n=null==e?void 0:e.endTime)&&void 0!==n?n:""}}))})}));const[{status:t},{status:n}]=i;ye.active,(t===ye.upcoming&&n===ye.upcoming||t===ye.upcoming&&n===ye.ended||t===ye.ended&&n===ye.upcoming)&&ye.upcoming,t===ye.ended&&n===ye.ended&&ye.ended}return{status:r,miningStatusList:i}}({miningItem:d}),[u,p]=at.useState(c===ye.ended?"unstake":"stake");return Os.jsx(xE,{chainId:e,loading:l.isLoading||l.isPending,operateType:u,setOperateType:p,associatedMineSectionVisible:!0,miningItem:d,status:c,goLpLink:r,poolAddress:n})}const bE=()=>{const t=g();return Os.jsx(A,{placement:"top-end",leaveDelay:100,title:Os.jsx(f,{sx:{maxWidth:240,color:t.palette.warning.main,typography:"h6",fontWeight:500,"&>a":{textDecoration:"underline",color:t.palette.warning.main},"&>a:hover":{color:C(t.palette.warning.main,.5)}},children:Os.jsx(e,{id:"QtgfjM",message:"The creator of the liquidity pool can adjust the liquidity distribution by modifying the market-making price parameters. <0>Learn more</0>",components:{0:Os.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://docs.dodoex.io/en/product/pmm-algorithm"})}})}),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:2,py:4,px:8,borderRadius:8,backgroundColor:C(t.palette.warning.main,.1),color:t.palette.warning.main,typography:"h6",fontWeight:500,lineHeight:"16px",cursor:"help"},children:[Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:Os.jsx("path",{d:"M8.00008 10.6666C8.18897 10.6666 8.3473 10.6027 8.47508 10.4749C8.60286 10.3471 8.66675 10.1888 8.66675 9.99992C8.66675 9.81103 8.60286 9.6527 8.47508 9.52492C8.3473 9.39714 8.18897 9.33325 8.00008 9.33325C7.81119 9.33325 7.65286 9.39714 7.52508 9.52492C7.3973 9.6527 7.33341 9.81103 7.33341 9.99992C7.33341 10.1888 7.3973 10.3471 7.52508 10.4749C7.65286 10.6027 7.81119 10.6666 8.00008 10.6666ZM7.33341 7.99992H8.66675V4.66659H7.33341V7.99992ZM8.00008 14.6666C6.45564 14.2777 5.18064 13.3916 4.17508 12.0083C3.16953 10.6249 2.66675 9.08881 2.66675 7.39992V3.33325L8.00008 1.33325L13.3334 3.33325V7.39992C13.3334 9.08881 12.8306 10.6249 11.8251 12.0083C10.8195 13.3916 9.54453 14.2777 8.00008 14.6666ZM8.00008 13.2666C9.15564 12.8999 10.1112 12.1666 10.8667 11.0666C11.6223 9.96659 12.0001 8.74436 12.0001 7.39992V4.24992L8.00008 2.74992L4.00008 4.24992V7.39992C4.00008 8.74436 4.37786 9.96659 5.13341 11.0666C5.88897 12.1666 6.84453 12.8999 8.00008 13.2666Z",fill:"currentColor"})}),Os.jsx(e,{id:"iDGO1l",message:"Disclaimer"})]})})};function AE({onClose:e,pool:t,address:i,operate:o,chainId:a,hasMining:s,hidePoolInfo:l,sx:d}){var c,u,p,h,m,g,y,x,v;const{account:b}=At(),A=a?Gr[a]:"",w=QA(),k=It(Object.assign(Object.assign({},w.getQuery(le.graphql.fetchPoolList,{where:{id:null!==(c=null==i?void 0:i.toLocaleLowerCase())&&void 0!==c?c:"",chain:A}})),{enabled:!!i&&!!a})),j=null===(p=null===(u=k.data)||void 0===u?void 0:u.pairs)||void 0===p?void 0:p[0],T=j&&a?function(e,t){var n,r,i,o,a,s;if(e)return{address:e.id,chainId:t,baseToken:ns(e.baseToken,t),quoteToken:ns(e.quoteToken,t),type:e.type,creator:e.creator,baseLpToken:{id:null===(n=e.baseLpToken)||void 0===n?void 0:n.id,decimals:Number(null!==(i=null===(r=e.baseLpToken)||void 0===r?void 0:r.decimals)&&void 0!==i?i:18)},quoteLpToken:{id:null===(o=e.quoteLpToken)||void 0===o?void 0:o.id,decimals:Number(null!==(s=null===(a=e.quoteLpToken)||void 0===a?void 0:a.decimals)&&void 0!==s?s:18)}}}(j,a):void 0,E=i&&a?T:t,S=k.error?k.refetch:void 0,{poolOrMiningTab:I,poolOrMiningTabs:R,handleChangeTab:L}=function({hasMining:e}){const{i18n:t}=n(),[r,i]=at.useState(dT.Liquidity);return{poolOrMiningTab:r,poolOrMiningTabs:at.useMemo((()=>{const n=[{key:dT.Liquidity,value:t._({id:"6y2TB3",message:"Liquidity"})},{key:dT.Mining,value:t._({id:"Sti4vy",message:"Mining"})}];return e?n:n.slice(0,1)}),[t._,e]),handleChangeTab:e=>{i(e)}}}({hasMining:s}),M=xT({account:b,pool:E?{chainId:E.chainId,address:E.address,type:E.type,baseTokenDecimals:E.baseToken.decimals,quoteTokenDecimals:E.quoteToken.decimals,baseLpTokenDecimals:null!==(m=null===(h=E.baseLpToken)||void 0===h?void 0:h.decimals)&&void 0!==m?m:18,quoteLpTokenDecimals:null!==(y=null===(g=E.quoteLpToken)||void 0===g?void 0:g.decimals)&&void 0!==y?y:18}:void 0}),O=!!(null===(x=M.userBaseLpBalance)||void 0===x?void 0:x.gt(0))||!!(null===(v=M.userQuoteLpBalance)||void 0===v?void 0:v.gt(0)),B=null!=a?a:null==E?void 0:E.chainId,P=null!=i?i:null==E?void 0:E.address;return Os.jsx(f,{sx:d,children:Os.jsxs(H,{value:I,onChange:(e,t)=>{L(t)},sx:{display:"flex",flexDirection:"column",overflow:"hidden",height:"100%"},children:[Os.jsx(_,{tabs:R,tabsListSx:Object.assign({mx:20,justifyContent:e?"space-between":"flex-start"},s&&O?{"& button:last-child":{position:"relative","&::before":{content:`"${r._({id:"TY5fM3",message:"LP Tokens"})}"`,position:"absolute",top:16,right:20,px:8,py:2,borderRadius:12,transform:"scale(0.66667) translateX(100%)",transformOrigin:"right top",backgroundColor:C("#DABB1B",.2),color:"#DABB1B"}}}:{}),rightSlot:Os.jsxs(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",gap:12},children:["GSP"===(null==E?void 0:E.type)&&Os.jsx(bE,{}),e?Os.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,borderRadius:"50%",borderWidth:1,color:"text.secondary",cursor:"pointer"},children:Os.jsx(f,{component:As.Error,sx:{width:16,height:16},onClick:()=>{e()}})}):void 0]})}),Os.jsx(z,{value:dT.Liquidity,sx:{flex:1,overflowY:"auto"},children:Os.jsx(rE,{pool:E,operate:o,hidePoolInfo:l,errorRefetch:S,submittedBack:()=>{s&&L(dT.Mining)}})}),Os.jsx(z,{value:dT.Mining,sx:{flex:1,overflowY:"auto"},children:B&&P?Os.jsx(vE,{chainId:B,account:b,poolAddress:P,goLpLink:()=>{L(dT.Liquidity)}}):""})]})})}function wE(e){var{modal:t}=e,n=Nn(e,["modal"]);const{isMobile:r}=wy();return Os.jsx(yy,{open:!!n.pool||!!n.address,onClose:n.onClose,scope:!r,modal:t,id:"pool-operate",children:Os.jsx(AE,{...n})})}function kE({chainId:t,baseToken:n,quoteToken:r,apy:o,hasQuote:a,hasMining:s,sx:l,children:d}){if(!n)return null;const c=a?[{token:n,transactionApy:null==o?void 0:o.transactionBaseApy,miningApy:null==o?void 0:o.miningBaseApy},{token:r,transactionApy:null==o?void 0:o.transactionQuoteApy,miningApy:null==o?void 0:o.miningQuoteApy}]:[{transactionApy:null==o?void 0:o.transactionBaseApy,miningApy:null==o?void 0:o.miningBaseApy,metromMiningApy:null==o?void 0:o.metromMiningApy}];return Os.jsx(A,{children:null!=d?d:Os.jsx(I,{component:As.QuestionBorder,sx:Object.assign({width:15,height:15},l)}),title:Os.jsx(f,{sx:{width:236},children:c.map(((o,a)=>{var l,d,c,u,p;return Os.jsxs(f,{sx:{mt:0===a?0:20},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body2",fontWeight:600,color:"text.primary"},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center"},children:o.token?Os.jsxs(Os.Fragment,{children:[Os.jsx(ey,{width:14,height:14,marginRight:4,address:o.token.address,url:o.token.logoURI,chainId:t,noShowChain:!0}),o.token.symbol]}):Os.jsxs(Os.Fragment,{children:[Os.jsx(Cj,{tokens:[n,r],width:14,mr:4,chainId:t}),n.symbol,"/",null==r?void 0:r.symbol]})}),Os.jsx(f,{children:Pn(new i(null!==(c=o.transactionApy)&&void 0!==c?c:0).plus(null!==(u=o.miningApy)&&void 0!==u?u:0).plus(null!==(p=o.metromMiningApy)&&void 0!==p?p:0))})]}),Os.jsxs(f,{sx:{mt:8,display:"flex",justifyContent:"space-between",typography:"h6",color:"text.secondary"},children:[Os.jsx("span",{children:Os.jsx(e,{id:"OnDEky",message:"LP Fee"})}),Os.jsx("span",{children:o.transactionApy?Pn(new i(o.transactionApy)):"-"})]}),s?Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",typography:"h6",color:"text.secondary"},children:[Os.jsx("span",{children:Os.jsx(e,{id:"pSQ1lM",message:"MT Fee"})}),Os.jsx("span",{children:o.miningApy?Pn(new i(o.miningApy)):"-"})]}):"",o.metromMiningApy&&Number(o.metromMiningApy)>0&&Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",typography:"h6",color:"text.secondary"},children:[Os.jsx("span",{children:Os.jsx(e,{id:"Sti4vy",message:"Mining"})}),Os.jsx("span",{children:o.metromMiningApy?Pn(new i(o.metromMiningApy)):"-"})]})]},null!==(d=null===(l=o.token)||void 0===l?void 0:l.address)&&void 0!==d?d:1)}))})})}function CE({children:e,sx:t,gap:n=20,repeatBaseForLargeScreen:r=3}){const{isMobile:i,minDevice:o}=wy();let a={};if(i)a={display:"flex",flexDirection:"column",gap:n};else{let e=2;[1418,1761,2104].some(((t,n)=>{if(o(t))return e=r+n,!0})),a={display:"grid",gap:n,gridTemplateColumns:`repeat(${e}, 1fr)`}}return Os.jsx(f,{sx:Object.assign(Object.assign({},a),t),children:e})}function jE({sx:t}){const{supportAMMV2:n,supportAMMV3:r}=pf(),i=n||r;return Os.jsxs(f,{sx:Object.assign({px:20,pt:20,pb:12,backgroundColor:"background.paper",borderRadius:16},t),children:[Os.jsx(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[Os.jsx(Cj,{width:24,tokens:[],mr:6,showChainLogo:!0}),Os.jsx(w,{variant:"rounded",height:20,width:88})]})}),Os.jsxs(f,{sx:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",rowGap:20,mt:44,"& > div:nth-child(odd)":{pr:20},"& > div:nth-child(even)":{position:"relative",pl:20,"&::before":{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",display:"inline-block",content:'""',height:24,width:"1px",backgroundColor:"border.main"}}},children:[i&&Os.jsxs(f,{children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",gap:4,whiteSpace:"nowrap"},children:Os.jsx(w,{variant:"rounded",height:24,width:100})}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"1Qz63U",message:"Pool Type"})})]}),Os.jsxs(f,{children:[Os.jsx(w,{variant:"rounded",height:24,width:100}),Os.jsx(f,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:Os.jsx(e,{id:"rSayea",message:"APY"})})]}),Os.jsxs(f,{children:[Os.jsx(w,{variant:"rounded",height:24,width:100}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"FHKsZF",message:"TVL"})})]}),i&&Os.jsxs(f,{children:[Os.jsx(w,{variant:"rounded",height:24,width:100}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"Q8W3SC",message:"Volume (1D)"})})]})]}),Os.jsx(w,{variant:"rounded",height:32,sx:{mt:20}})]})}function TE(e){var t;const[n,r]=at.useState(null!==(t=null==e?void 0:e.tokens)&&void 0!==t?t:[]),[i,o]=at.useState([]);at.useEffect((()=>{e&&(r(e.tokens),o(e.lqList))}),[e]);const[a,s]=at.useMemo((()=>{const[e,t]=n;return[null==e?void 0:e.symbol,null==t?void 0:t.symbol]}),[n]);return{filterTokens:n,filterASymbol:a,filterBSymbol:s,filterAddressLqList:i,handleDeleteToken:t=>{r((n=>{const r=[...n],i=r.indexOf(t);return-1!==i&&r.splice(i,1),e&&e.onChangeFilterTokens(r),r}))},handleChangeFilterTokens:t=>{o([]),r(t),e&&(e.onChangeFilterTokens(t),e.onChangeFilterAddressLqList([]))},handleChangeFilterAddress:t=>{o(t),r([]),e&&(e.onChangeFilterTokens([]),e.onChangeFilterAddressLqList(t))}}}var EE,SE;function IE(){return IE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IE.apply(null,arguments)}const RE=e=>ot.createElement("svg",IE({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),EE||(EE=ot.createElement("circle",{cx:16,cy:16,r:16,fill:"#FFE804"})),SE||(SE=ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 12.25H12.25V8.5H8.5V12.25ZM14.125 23.5H17.875V19.75H14.125V23.5ZM12.25 23.5H8.5V19.75H12.25V23.5ZM8.5 17.875H12.25V14.125H8.5V17.875ZM17.875 17.875H14.125V14.125H17.875V17.875ZM19.75 8.5V12.25H23.5V8.5H19.75ZM17.875 12.25H14.125V8.5H17.875V12.25ZM19.75 17.875H23.5V14.125H19.75V17.875ZM23.5 23.5H19.75V19.75H23.5V23.5Z",fill:"#1A1A1B"}))),LE="_default";function ME({value:e,onChange:t,placeholder:n,options:r,sx:i,readOnly:o,valueOnlyIcon:a}){const s=g();return Os.jsx(K,{value:null!=e?e:LE,onChange:(n,r)=>{const i="number"==typeof e&&r?Number(r):r;t(i===LE?void 0:i)},disabled:o,sx:u({padding:s.spacing(8,12),"& .MuiSelect-select.MuiSelect-select.MuiSelect-select":{display:"flex",alignItems:"center",gap:8,padding:s.spacing(8,12,8,12),minHeight:"auto",backgroundColor:"transparent",color:"text.primary",borderRadius:8,typography:"body2",fontWeight:600,borderStyle:"solid",borderWidth:1,borderColor:"divider","& svg, & img":{width:24,height:24},'&:hover, &[aria-expanded="true"]':{backgroundColor:"background.paper"},"&.Mui-readOnly":{color:"text.disabled"}},"& .MuiSelect-icon":{color:o?"text.disabled":"text.primary"},"& .MuiOutlinedInput-notchedOutline":{display:"none"}},i),renderValue:t=>{if(!(null==t?void 0:t.value)||t.value===LE)return Os.jsx(f,{sx:{color:"text.secondary"},children:null!=n?n:""});const i=r.find((t=>t.key===e));return i?Os.jsxs(Os.Fragment,{children:[i.logo,a?"":i.value]}):null},options:[...r]})}function OE({isMobileStyle:e,chain:t,isLastItem:n,logoWidth:r,mobileLogoWidth:i,sx:o}){const a=g();return e?Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",py:18,borderTop:`1px solid ${a.palette.border.main}`,borderBottom:n?`1px solid ${a.palette.border.main}`:"none"},o),children:[Os.jsx(f,{component:null==t?void 0:t.logo,sx:{width:i,height:i}}),Os.jsx(f,{component:"span",className:"name",sx:{marginLeft:8},children:null==t?void 0:t.name})]}):Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(f,{component:null==t?void 0:t.logo,sx:{width:r,height:r}}),Os.jsx(f,{component:"span",className:"name",sx:{marginLeft:8},children:null==t?void 0:t.name})]})}const BE=-1;function PE({chainId:t,setChainId:r,logoWidth:i=24,mobileLogoWidth:o=32,mainLogoWidth:a=24,mainMobileLogoWidth:s=18,notShowAllChain:l,valueOnlyIcon:d,sx:c}){const u=function(){const{chainId:e}=At(),t=lt((()=>{const t=new Map;let n;return _g.forEach(((r,i)=>{if(r.mainnet){if(e!==r.chainId)return;n=r.mainnet}t.set(i,Object.assign({},r))})),void 0!==n&&t.delete(n),Array.from(t.values())}),[e]);return t}(),[p,h]=at.useState(!1),{isMobile:m}=wy(),{i18n:g}=n(),x=at.useCallback((()=>{const e=void 0===t?u[0]:u.find((e=>e.chainId===t));if(d){if(void 0===t||!e)return"";const n=m?o:a;return Os.jsx(f,{component:null==e?void 0:e.logo,sx:{width:n,height:n}})}return void 0!==t||l?e?Os.jsx(OE,{isMobileStyle:m,chain:e,logoWidth:a,mobileLogoWidth:s}):null:Os.jsx(OE,{isMobileStyle:m,chain:{chainId:BE,logo:RE,name:g._({id:"pY/ok7",message:"All chains"})},logoWidth:a,mobileLogoWidth:s,sx:{border:"none"}})}),[t,u,l,d,m,g._]),v=at.useMemo((()=>{const e=[];return l||e.push({key:BE,value:Os.jsx(OE,{isMobileStyle:m,chain:{chainId:BE,logo:RE,name:g._({id:"pY/ok7",message:"All chains"})},logoWidth:i,mobileLogoWidth:o})}),u.forEach(((t,n)=>{e.push({key:t.chainId,value:Os.jsx(OE,{isLastItem:n===u.length-1,isMobileStyle:m,chain:t,logoWidth:i,mobileLogoWidth:o})})})),e}),[m,i,o,u,l]);return m?Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{component:y,onClick:()=>h(!0),sx:Object.assign({display:"flex",alignItems:"center",backgroundColor:"background.tag",color:"text.primary",borderRadius:8,border:"none",px:8,height:32,fontWeight:600,typography:"body2"},c),children:[Os.jsx(f,{sx:{pr:5},children:x()}),Os.jsx(f,{component:As.CaretUp,sx:{width:12,height:12,transform:"rotate(180deg)"}})]}),Os.jsx(yy,{open:p,title:Os.jsx(e,{id:"lJvbHq",message:"Select Network"}),onClose:()=>h(!1),id:"select-chain",modal:!0,children:Os.jsx(f,{sx:{mb:20},children:v.map((e=>Os.jsxs(f,{onClick:()=>{const t=e.key;r(t===BE?void 0:Number(t)),h(!1)},sx:{position:"relative",px:20,"&:active":{backgroundColor:"hover.default"},"&:hover":{backgroundColor:"hover.default"},cursor:"pointer"},children:[e.value,(t?e.key===t:e.key===BE)&&Os.jsx(f,{sx:{position:"absolute",left:0,top:24,height:20,width:2,backgroundColor:"text.primary"}})]},e.key)))})})]}):Os.jsx(ME,{value:null!=t?t:BE,onChange:e=>{v.some((t=>String(t.key)===String(e)))&&r(e===BE?void 0:e)},placeholder:g._({id:"lJvbHq",message:"Select Network"}),options:v,valueOnlyIcon:d,sx:Object.assign({px:8,height:32,fontWeight:600,typography:"body2",backgroundColor:"background.tag",color:"text.primary"},c)})}function DE({list:t,onClick:n}){return Os.jsx(Os.Fragment,{children:null==t?void 0:t.map((t=>{var r,o,a,s;if(!(null==t?void 0:t.pair))return null;const l=t.pair,d=ns(l.baseToken,l.chainId),c=ns(l.quoteToken,l.chainId),u=l.apy?Pn(new i(null===(r=l.apy)||void 0===r?void 0:r.transactionBaseApy).plus(null!==(a=null===(o=l.apy)||void 0===o?void 0:o.miningBaseApy)&&void 0!==a?a:0)):void 0,p=le.utils.singleSideLp(l.type)&&l.apy?Pn(new i(l.apy.transactionQuoteApy).plus(null!==(s=l.apy.miningQuoteApy)&&void 0!==s?s:0)):void 0;return d&&c?Os.jsxs(f,{onClick:n,sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:10,py:20,borderRadius:8,cursor:"pointer","&:hover":{backgroundColor:"custom.background.listHover"}},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(Cj,{tokens:[d,c],chainId:l.chainId,width:24,mr:10}),Os.jsxs(f,{sx:{typography:"h5"},children:[d.symbol,"/",c.symbol]})]}),Os.jsxs(f,{children:[Os.jsxs(f,{sx:{color:"custom.status.green.default",fontWeight:600},children:[u,p?`/${p}`:""]}),Os.jsx(f,{sx:{mt:2,typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"rSayea",message:"APY"})})]})]},l.id):null}))})}function NE({lqList:e,onDeleteTag:t,sx:n}){var r;if(!(null==e?void 0:e.length))return null;if(!(null===(r=e[0])||void 0===r?void 0:r.pair))return null;const{pair:i}=e[0],o=ns(i.baseToken,i.chainId),a=ns(i.quoteToken,i.chainId);return o&&a?Os.jsxs(f,{sx:Object.assign({typography:"body2",display:"inline-flex",alignItems:"center",px:8,mr:8,borderRadius:8,fontWeight:600,height:32,backgroundColor:"hover.default"},n),children:[Os.jsx(Cj,{tokens:[o,a],chainId:o.chainId,width:20,mr:8}),o.symbol,"+",a.symbol,Os.jsx(f,{component:As.Error,sx:{ml:4,width:16,height:16,cursor:"pointer",color:"text.secondary",position:"relative",top:1.5},onClick:()=>t()})]}):null}function FE({tags:e,onDeleteTag:t,sx:n}){return e.length?Os.jsx(f,{sx:Object.assign({display:"inline-flex",alignItems:"center"},n),children:e.map((e=>Os.jsxs(f,{sx:{typography:"body2",display:"flex",alignItems:"center",px:8,mr:8,borderRadius:8,fontWeight:600,height:32,backgroundColor:"hover.default"},children:[Os.jsx(ey,{address:e.address,width:20,height:20,chainId:e.chainId,url:e.logoURI,noShowChain:!0,marginRight:8}),e.symbol,Os.jsx(f,{component:As.Error,sx:{ml:4,width:16,height:16,cursor:"pointer",color:"text.secondary",position:"relative",top:1.5},onClick:()=>t(e)})]},e.address)))}):null}function WE({text:e,onClick:t}){const n=g();return Os.jsxs(f,{sx:{typography:"body2",display:"inline-flex",alignItems:"center",p:n.spacing(0,4,0,8),width:"max-content",height:32,backgroundColor:"hover.default",borderWidth:1,borderRadius:8,cursor:"pointer"},onClick:t,children:[e,Os.jsx(f,{component:As.ArrowBack,sx:{ml:2,width:16,height:16,transform:"rotate(180deg)"}})]})}function VE(t){var{sx:n,children:r,empty:i,loading:o,hasMore:a,loadMore:s,loadMoreLoading:l}=t,d=Nn(t,["sx","children","empty","loading","hasMore","loadMore","loadMoreLoading"]);const c=g();return Os.jsxs(f,{sx:Object.assign({position:"relative",flex:1,overflowY:"auto"},n),...d,children:[Os.jsx(f,{component:"table",sx:Object.assign({width:"100%",borderCollapse:"collapse","& th":{p:24,typography:"body1",textAlign:"left",color:"text.secondary"},"& td":{px:24,py:20},"& thead":{position:"sticky",top:0,zIndex:2,backgroundColor:"background.paper"}},!i&&!o&&{"& th:last-child, & td:last-child":{position:"sticky",right:0,zIndex:1,backgroundColor:"background.paper","&::before":{content:'""',position:"absolute",top:0,bottom:0,left:1,width:"1px",boxShadow:`${"dark"===c.palette.mode?"#1A1A1B":C("#1A1A1B",.1)} -2px 0px 4px 0px`}}}),children:r}),a&&Os.jsx(y,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:64,width:"100%",borderStyle:"solid",borderColor:"border.main",borderWidth:c.spacing(1,0,0,0),typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},onClick:s,children:l?Os.jsx(x,{}):Os.jsxs(Os.Fragment,{children:[Os.jsx(e,{id:"yQ2kGp",message:"Load more"}),Os.jsx(f,{component:As.ArrowRight,sx:{transform:"rotate(90deg)"}})]})})]})}const UE=e=>Object.keys(new Array(e+1).join(","));function HE(e){return null!=e&&""!==e}function qE({token:e,size:t="small",sx:n,children:i}){const[o,a]=ct(!1),{provider:s,chainId:l}=At(),d=cx(e.chainId);return Os.jsxs(f,{sx:u({margin:"0",border:"none",padding:"0",background:"none",cursor:"pointer","&:focus":{outline:"none"},"&:active":{outline:"none"}},n),onClick:t=>Fn(this,void 0,void 0,(function*(){if(t.stopPropagation(),void 0!==e.chainId&&e.chainId!==l&&d){if(!(yield d()))return}if(o)return;a(!0);const{result:n,failMsg:i}=yield function(e,t){return Fn(this,void 0,void 0,(function*(){if(!e)return{result:!1};try{return{result:yield e.send("wallet_watchAsset",{type:"ERC20",options:{address:t.address,symbol:t.symbol,decimals:t.decimals,image:t.logoURI}})}}catch(e){return console.error(e),{result:!1,failMsg:null==e?void 0:e.message}}}))}(s,e);n?mv.getState().toast({message:r._({id:"DupCvC",message:"Added successful"}),type:"success",timeout:3e3}):mv.getState().toast({message:`${r._({id:"v4wgrk",message:"Failed to add"})}${i?`: ${i}`:""}`,type:"error"}),a(!1)})),component:"button",children:[Os.jsx(f,{component:ef,sx:Object.assign({},"medium"===t?{width:16,height:16}:{width:14,height:14})}),i]})}var ZE;function zE(){return zE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zE.apply(null,arguments)}const QE=e=>ot.createElement("svg",zE({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ZE||(ZE=ot.createElement("path",{d:"M5.6036 4.12761C5.50037 4.20906 5.3708 4.24967 5.23958 4.24169C5.10836 4.23372 4.98466 4.17773 4.89203 4.08438C4.7994 3.99103 4.74433 3.86685 4.7373 3.73549C4.73026 3.60413 4.77177 3.47477 4.8539 3.37205L5.96239 2.25211C6.46737 1.76405 7.14372 1.494 7.84575 1.5001C8.54779 1.50621 9.21934 1.78798 9.71577 2.28474C10.2122 2.78151 10.4938 3.4535 10.4999 4.156C10.506 4.85851 10.2361 5.5353 9.74839 6.04062L8.60241 7.16592C8.55441 7.22201 8.49533 7.26757 8.4289 7.29974C8.36246 7.3319 8.29009 7.34997 8.21635 7.35282C8.1426 7.35567 8.06906 7.34324 8.00034 7.3163C7.93162 7.28936 7.86921 7.2485 7.81702 7.19627C7.76483 7.14405 7.724 7.0816 7.69707 7.01284C7.67015 6.94407 7.65772 6.87048 7.66057 6.79668C7.66342 6.72289 7.68148 6.65047 7.71363 6.58399C7.74577 6.51751 7.7913 6.4584 7.84736 6.41036L8.97191 5.28506C9.25568 4.98032 9.41017 4.57725 9.40283 4.16078C9.39549 3.74431 9.22689 3.34695 8.93255 3.05242C8.63821 2.75788 8.24111 2.58917 7.82491 2.58182C7.40872 2.57447 7.00592 2.72906 6.70138 3.01302L5.6036 4.12761ZM6.34259 7.93755C6.38819 7.87582 6.44652 7.82461 6.51361 7.7874C6.58071 7.75018 6.65501 7.72783 6.73149 7.72185C6.80798 7.71586 6.88485 7.7264 6.95691 7.75273C7.02897 7.77906 7.09453 7.82058 7.14917 7.87447C7.2038 7.92836 7.24622 7.99337 7.27356 8.06509C7.3009 8.13682 7.31252 8.21358 7.30764 8.29019C7.30275 8.3668 7.28148 8.44147 7.24525 8.50913C7.20902 8.5768 7.15869 8.63589 7.09765 8.68239L5.96774 9.81305C5.45894 10.2708 4.7943 10.5163 4.11029 10.4992C3.42627 10.482 2.77479 10.2034 2.2896 9.72061C1.80441 9.23784 1.52232 8.58752 1.50127 7.90316C1.48021 7.2188 1.72179 6.55234 2.17638 6.04062L3.30629 4.93139C3.3504 4.86735 3.4079 4.81369 3.47482 4.77413C3.54174 4.73456 3.61646 4.71005 3.69379 4.70229C3.77113 4.69453 3.84922 4.70371 3.92266 4.72919C3.99609 4.75466 4.0631 4.79583 4.11904 4.84983C4.17497 4.90384 4.21849 4.96937 4.24657 5.0419C4.27464 5.11442 4.28661 5.19219 4.28163 5.2698C4.27665 5.34742 4.25484 5.42302 4.21773 5.49135C4.18062 5.55969 4.12908 5.61912 4.06671 5.66552L2.93144 6.79618C2.64767 7.10092 2.49318 7.50398 2.50052 7.92045C2.50786 8.33692 2.67647 8.73428 2.97081 9.02882C3.26515 9.32335 3.66224 9.49207 4.07844 9.49942C4.49463 9.50676 4.89743 9.35217 5.20197 9.06821L6.34259 7.93755ZM5.00919 7.76072C4.96119 7.81681 4.90211 7.86237 4.83567 7.89454C4.76924 7.9267 4.69687 7.94477 4.62312 7.94763C4.54937 7.95048 4.47583 7.93804 4.40711 7.9111C4.33839 7.88416 4.27598 7.8433 4.2238 7.79108C4.17161 7.73885 4.13077 7.6764 4.10385 7.60764C4.07693 7.53887 4.0645 7.46528 4.06735 7.39149C4.0702 7.31769 4.08826 7.24528 4.1204 7.17879C4.15255 7.11231 4.19808 7.0532 4.25413 7.00516L6.90487 4.35267C7.00731 4.26488 7.13909 4.21901 7.27386 4.22422C7.40863 4.22943 7.53648 4.28533 7.63185 4.38077C7.72722 4.4762 7.78309 4.60413 7.7883 4.73899C7.7935 4.87385 7.74766 5.00572 7.65993 5.10823L5.00919 7.76072Z",fill:"currentColor"})));function GE({loading:e,empty:t,hasSearch:n,children:r,refetch:i}){return e?Os.jsx(f,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",gap:24,px:24,height:320},children:UE(4).map(((e,t)=>Os.jsx(w,{width:"100%",height:45},t)))}):i?Os.jsx(mT,{refresh:i,sx:{height:320}}):t?Os.jsx(sT,{hasSearch:n,sx:{height:320}}):Os.jsx(Os.Fragment,{children:r})}function YE({show:e,onClick:t}){const n=g();return Os.jsx(f,{component:y,sx:{padding:n.spacing(4,8),transform:e?"rotate(180deg)":"none",transition:"all 100ms"},onClick:t,children:Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.58398 11.376C8.78189 11.6728 9.21811 11.6728 9.41603 11.376L12.4818 6.77735C12.7033 6.44507 12.4651 6 12.0657 6H5.93426C5.53491 6 5.29672 6.44507 5.51823 6.77735L8.58398 11.376Z",fill:"currentColor"})})})}function XE({isMobile:e,statusText:t,statusColor:n,time:r,alphaColor:i,sx:o}){const a=g(),s=C(n,.1),l=i?C(n,i):n;return Os.jsxs(f,{sx:Object.assign({display:"flex",flexDirection:"column",alignItems:e?"center":"flex-start",gap:2,typography:"h6",color:"text.secondary"},o),children:[Os.jsx(f,{sx:{padding:a.spacing(4,8),borderRadius:4,backgroundColor:s,color:l,textAlign:"center"},children:t}),r]})}function JE({chainId:e}){const t=_g.get(e);return t?Os.jsx(f,{sx:{display:"flex",alignItems:"center",gap:8,px:8,py:4,borderRadius:4,backgroundColor:"background.paperDarkContrast",typography:"h6"},children:Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{component:t.logo,sx:{width:16,height:16}}),t.name]})}):null}function KE({token:e,amount:t,showChain:n,hideLogo:r,canAddMetamask:i,sx:o}){var a,s;let l="";n&&(l=null!==(s=null===(a=_g.get(e.chainId))||void 0===a?void 0:a.name)&&void 0!==s?s:"");const d=An({input:t,decimals:e.decimals});return Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",gap:4},o),children:[!r&&Os.jsx(ey,{address:e.address,chainId:e.chainId,width:20,height:20}),Os.jsxs(f,{sx:{fontWeight:600},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,wordBreak:"break-word"},children:[`${d} ${e.symbol}`,i&&Os.jsx(qE,{token:e})]}),!!l&&Os.jsxs(f,{sx:{display:"inline-flex",alignItems:"center",gap:2,typography:"h6",fontWeight:500,color:"text.secondary"},children:[l,Os.jsx(QE,{})]})]})]})}function _E({address:t,chainId:n,hideName:r,sx:i}){const o=g(),a=QA(),{onlyChainId:s}=pf(),l=It(Object.assign({},a.getQuery(xe.graphql.fetchLiquidityLpPartnerRewards,{where:{chainId:s||void 0}})));if(!t)return null;const d=[];return("string"==typeof t?[t]:Array.from(new Set(t)).filter((e=>!!e))).forEach((e=>{var t,r,i;e&&(null===(i=null===(r=null===(t=l.data)||void 0===t?void 0:t.liquidity_getLpPartnerRewards)||void 0===r?void 0:r.partnerRewards)||void 0===i||i.some((t=>{var r,i,o,a,s,c,u,p,h,m,f,g,y,x;if((null==t?void 0:t.chainId)===n&&(null===(r=null==t?void 0:t.pool)||void 0===r?void 0:r.toLocaleLowerCase())===e.toLocaleLowerCase()){const e=null===(a=null===(o=null===(i=l.data)||void 0===i?void 0:i.liquidity_getLpPartnerRewards)||void 0===o?void 0:o.partnerInfos)||void 0===a?void 0:a.find((e=>(null==e?void 0:e.partner)===t.partner));if(!e)return;d.push({partner:{name:null!==(s=null==e?void 0:e.partner)&&void 0!==s?s:"",logo:null!==(c=null==e?void 0:e.logo)&&void 0!==c?c:"",introduction:null!==(u=null==e?void 0:e.introduction)&&void 0!==u?u:"",link:null!==(p=null==e?void 0:e.link)&&void 0!==p?p:"",extra:null!==(h=null==e?void 0:e.extra)&&void 0!==h?h:{},background:(null===(m=null==e?void 0:e.theme)||void 0===m?void 0:m[0])||void 0,color:(null===(f=null==e?void 0:e.theme)||void 0===f?void 0:f[1])||void 0},reward:null!==(g=null==t?void 0:t.reward)&&void 0!==g?g:"",type:null!==(y=null==t?void 0:t.type)&&void 0!==y?y:"stakelp",sort:null!==(x=null==e?void 0:e.sort)&&void 0!==x?x:Number.MAX_SAFE_INTEGER})}})))})),(null==d?void 0:d.length)?(d.sort(((e,t)=>e.sort-t.sort)),Os.jsx(f,{sx:Object.assign({display:"flex",alignItems:"center",gap:4},i),children:d.map((t=>Os.jsx(A,{leaveDelay:100,title:Os.jsxs(f,{sx:{maxWidth:240,whiteSpace:"pre-wrap"},children:[t.partner.introduction,!!t.partner.link&&Os.jsxs(f,{component:"a",target:"_blank",href:t.partner.link,rel:"noopener noreferrer",sx:{display:"flex",alignItems:"center",gap:4,color:"primary.main","&:hover":{opacity:.5}},children:[Os.jsx(e,{id:"zwWKhA",message:"Learn more"})," ",Os.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.91667 2.91667V11.0833H11.0833V7H12.25V11.0833C12.25 11.725 11.725 12.25 11.0833 12.25H2.91667C2.26917 12.25 1.75 11.725 1.75 11.0833V2.91667C1.75 2.275 2.26917 1.75 2.91667 1.75H7V2.91667H2.91667ZM8.16667 2.91667V1.75H12.25V5.83333H11.0833V3.73917L5.34917 9.47333L4.52667 8.65083L10.2608 2.91667H8.16667Z",fill:"currentColor"})})]})]}),children:Os.jsxs(y,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,p:o.spacing(0,4),height:20,borderRadius:4,background:t.partner.background,color:t.partner.color,whiteSpace:"nowrap"},children:[Os.jsx(f,{component:"img",src:t.partner.logo,alt:t.partner.name,sx:{width:14,height:14,borderRadius:"50%"}}),!r&&!!t.reward&&Os.jsx(f,{sx:{fontSize:"10px",fontWeight:600},children:t.reward})]})},t.partner.name+t.reward)))})):null}function $E({chainId:e,address:t}){const{isMobile:n}=wy();return Os.jsx(f,{component:"button",onClick:n=>{n.stopPropagation(),fw.getState().push({type:pw.PoolDetail,params:{chainId:e,address:t}})},sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:8,cursor:"pointer",flexShrink:0,height:36,color:"text.primary","&:hover":{opacity:.5}},n?{width:64,backgroundColor:"background.tag"}:{width:40,backgroundColor:"transparent",borderWidth:1}),children:Os.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{d:"M5.83333 14.1667H7.5V8.33333H5.83333V14.1667ZM9.16667 14.1667H10.8333V5.83333H9.16667V14.1667ZM12.5 14.1667H14.1667V10.8333H12.5V14.1667ZM4.16667 17.5C3.70833 17.5 3.31597 17.3368 2.98958 17.0104C2.66319 16.684 2.5 16.2917 2.5 15.8333V4.16667C2.5 3.70833 2.66319 3.31597 2.98958 2.98958C3.31597 2.66319 3.70833 2.5 4.16667 2.5H15.8333C16.2917 2.5 16.684 2.66319 17.0104 2.98958C17.3368 3.31597 17.5 3.70833 17.5 4.16667V15.8333C17.5 16.2917 17.3368 16.684 17.0104 17.0104C16.684 17.3368 16.2917 17.5 15.8333 17.5H4.16667ZM4.16667 15.8333H15.8333V4.16667H4.16667V15.8333Z",fill:"currentColor"})})})}const eS={[bk.LOWEST]:{label:"0.01%"},[bk.LOW_200]:{label:"0.02%"},[bk.LOW_300]:{label:"0.03%"},[bk.LOW_400]:{label:"0.04%"},[bk.LOW]:{label:"0.05%"},[bk.MEDIUM]:{label:"0.30%"},[bk.HIGH]:{label:"1.00%"}},tS=({sx:t,isRightTop:n,isReverseColor:r})=>{const i=g();return Os.jsx(f,{sx:Object.assign(Object.assign(Object.assign({display:"inline-flex",padding:"2px 4px",alignItems:"center",gap:"4px",borderRadius:4,background:C(i.palette.warning.main,.1),color:i.palette.warning.main,fontSize:"10px",fontWeight:600,lineHeight:"14px"},n?{position:"absolute",top:-14,right:0,background:`linear-gradient(0deg, ${i.palette.warning.main}1A 0%, ${i.palette.warning.main}1A 100%), ${i.palette.background.paper}`}:void 0),r?{background:"light"===i.palette.mode?"linear-gradient(0deg, var(--label-warning, rgba(177, 86, 0, 0.10)) 0%, var(--label-warning, rgba(177, 86, 0, 0.10)) 100%), #FFF":"linear-gradient(0deg, #FFFFFF, #FFFFFF),linear-gradient(0deg, rgba(235, 141, 39, 0.1), rgba(235, 141, 39, 0.1))",zIndex:1}:void 0),t),children:Os.jsx(e,{id:"y5rS9U",message:"Migrate"})})};function nS({sx:t,value:n,onChange:i,searchAddress:o}){const[a,s]=at.useState(!1),{isMobile:l}=wy();return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{component:y,sx:Object.assign(Object.assign({typography:"body2",display:"flex",alignItems:"center",justifyContent:"flex-start",px:12,height:32,backgroundColor:"background.tag",color:"text.secondary",borderRadius:8,fontWeight:600},l?{}:{minWidth:220}),t),onClick:()=>s(!0),children:[Os.jsx(f,{component:As.Search,sx:{width:16,height:16,mr:8,flexShrink:0}}),Os.jsx(e,{id:"A1taO8",message:"Search"})]}),Os.jsx(ky,{value:n,open:a,multiple:!0,title:Os.jsx(e,{id:"o8aMNm",message:"Select a liquidity pool"}),searchPlaceholder:r._({id:"4nzwq3",message:"Search by token or pool address"}),onClose:()=>{s(!1)},onTokenChange:e=>{if(Array.isArray(e)){if(e.length>2){const t=[e[0],e[2]];i(t)}else i(e);s(!1)}},searchOtherAddress:e=>o(e,(()=>s(!1))),modal:!0})]})}function rS({lqList:t,setOperatePool:n,getMigrationPairAndMining:r,supportAMM:o}){const a=g(),{onSharePool:s}=pf();return Os.jsx(Os.Fragment,{children:null==t?void 0:t.map((t=>{var l,d,c,u,p,h,m,g,y,x;if(!(null==t?void 0:t.pair))return null;const v=t.pair,b=ns(v.baseToken,v.chainId),w=ns(v.quoteToken,v.chainId),k=v.apy?Pn(new i(null===(l=v.apy)||void 0===l?void 0:l.transactionBaseApy).plus(null!==(c=null===(d=v.apy)||void 0===d?void 0:d.miningBaseApy)&&void 0!==c?c:0)):void 0,j=le.utils.singleSideLp(v.type)&&v.apy?Pn(new i(v.apy.transactionQuoteApy).plus(null!==(u=v.apy.miningQuoteApy)&&void 0!==u?u:0)):void 0,E=!!(null===(p=v.miningAddress)||void 0===p?void 0:p[0]),S=!!(null===(h=v.apy)||void 0===h?void 0:h.metromMiningApy)&&Number(null===(m=v.apy)||void 0===m?void 0:m.metromMiningApy)>0,I=v.type,R=os(I),L="AMMV2"===I,M="AMMV3"===I,O=null==r?void 0:r({address:v.id,chainId:v.chainId});return Os.jsxs(f,{sx:{px:20,pt:20,pb:12,backgroundColor:"background.paper",borderRadius:16},className:"gradient-card-border",onClick:()=>{o||fw.getState().push({type:pw.PoolDetail,params:{chainId:v.chainId,address:v.id}})},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[b&&w?Os.jsx(Cj,{tokens:[b,w],width:24,mr:6,chainId:v.chainId,showChainLogo:!0}):"",Os.jsxs(f,{sx:{typography:"body2",fontWeight:600},children:[`${null==b?void 0:b.symbol}/${null==w?void 0:w.symbol}`,!!s&&Os.jsx(f,{component:As.Share,sx:{ml:2,width:12,height:12},onClick:()=>s({chainId:v.chainId,baseToken:b,quoteToken:w,poolId:v.id,apy:v.apy,isSingle:le.utils.singleSideLp(v.type)})}),Os.jsx(_E,{address:v.id,chainId:v.chainId})]}),!!O&&Os.jsx(tS,{})]}),E||S?Os.jsxs(f,{sx:{p:8,typography:"h6",fontWeight:"bold",background:`linear-gradient(180deg, ${C(a.palette.secondary.main,.3)} 0%, ${C(a.palette.purple.main,.3)} 100%)`,borderRadius:8,color:"purple.main",whiteSpace:"nowrap"},children:["✨ ",Os.jsx(e,{id:"Sti4vy",message:"Mining"})]}):""]}),Os.jsxs(f,{sx:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",rowGap:20,mt:44,"& > div:nth-child(odd)":{pr:20},"& > div:nth-child(even)":{position:"relative",pl:20,"&::before":{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",display:"inline-block",content:'""',height:24,width:"1px",backgroundColor:"border.main"}}},children:[o&&Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,whiteSpace:"nowrap"},children:[R,Os.jsx(A,{title:Os.jsx(e,{id:"O6RUgz",message:"Fee rate"}),children:Os.jsx(f,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary"},children:M?null!==(y=null===(g=eS[v.lpFeeRate])||void 0===g?void 0:g.label)&&void 0!==y?y:"-":Bn({input:new i(null!==(x=v.lpFeeRate)&&void 0!==x?x:0).plus(v.mtFeeRate?Tn(v.mtFeeRate,L?4:18):0)})})})]}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"1Qz63U",message:"Pool Type"})})]}),Os.jsxs(f,{children:[Os.jsxs(f,{sx:{typography:"h5",color:"success.main"},children:[k,j?`/${j}`:""]}),Os.jsxs(f,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:[Os.jsx(e,{id:"rSayea",message:"APY"}),Os.jsx(kE,{chainId:v.chainId,apy:v.apy,baseToken:b,quoteToken:w,hasQuote:!!j,hasMining:E,sx:{width:14,height:14}})]})]}),Os.jsxs(f,{children:[Os.jsxs(f,{sx:{typography:"h5"},children:["$",On(new i(v.tvl))]}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"FHKsZF",message:"TVL"})})]}),o&&Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4},children:["$",bn({input:v.volume24H||0})]}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"Q8W3SC",message:"Volume (1D)"})})]})]}),Os.jsxs(f,{sx:{mt:20,display:"flex",gap:"8px"},children:[Os.jsx(T,{fullWidth:!0,size:T.Size.small,onClick:e=>{e.stopPropagation(),n({pool:rs(t),hasMining:E})},children:Os.jsx(e,{id:"m16xKo",message:"Add"})}),o&&"PMM"===R&&Os.jsx($E,{chainId:v.chainId,address:v.id})]})]},v.id+v.chainId)}))})}function iS({lqList:t,loading:n,operatePool:o,setOperatePool:a,getMigrationPairAndMining:s,hasMore:l,loadMore:d,loadMoreLoading:c,supportAMM:u}){const p=g(),{onSharePool:h}=pf();return Os.jsxs(VE,{hasMore:l,loadMore:d,loadMoreLoading:c,empty:!(null==t?void 0:t.length),loading:n,children:[Os.jsx(f,{component:"thead",children:Os.jsxs(f,{component:"tr",children:[Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"AxdOHo",message:"Pair"})}),u&&Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"1Qz63U",message:"Pool Type"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"FHKsZF",message:"TVL"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"rSayea",message:"APY"})}),u&&Os.jsx("th",{children:Os.jsx(e,{id:"Q8W3SC",message:"Volume (1D)"})}),Os.jsx(f,{component:"th",sx:{width:80}})]})}),Os.jsx(f,{component:"tbody",children:null==t?void 0:t.map((t=>{var n,l,d,c,m,g,y,x,v,b,w,k,C;if(!(null==t?void 0:t.pair))return null;const j=t.pair,E=ns(j.baseToken,j.chainId),S=ns(j.quoteToken,j.chainId),I=j.apy?Pn(new i(null===(n=j.apy)||void 0===n?void 0:n.transactionBaseApy).plus(null!==(d=null===(l=j.apy)||void 0===l?void 0:l.miningBaseApy)&&void 0!==d?d:0).plus(null!==(m=null===(c=j.apy)||void 0===c?void 0:c.metromMiningApy)&&void 0!==m?m:0)):void 0,R=le.utils.singleSideLp(j.type)&&j.apy?Pn(new i(j.apy.transactionQuoteApy).plus(null!==(g=j.apy.miningQuoteApy)&&void 0!==g?g:0)):void 0;let L="";if((null===(y=null==o?void 0:o.pool)||void 0===y?void 0:y.address)===j.id||(null==o?void 0:o.address)===j.id)if(o.operate===FT.Remove)L=r._({id:"0+31GV",message:"Removing"});else L=r._({id:"1yHVE+",message:"Adding"});const M=!!(null===(x=j.miningAddress)||void 0===x?void 0:x[0]),O=!!(null===(v=j.apy)||void 0===v?void 0:v.metromMiningApy)&&Number(null===(b=j.apy)||void 0===b?void 0:b.metromMiningApy)>0,B=j.type,P=os(B),D="AMMV2"===B,N="AMMV3"===B,F=p.palette.background.tag,W=null==s?void 0:s({address:j.id,chainId:j.chainId});return Os.jsxs(f,{component:"tr",sx:{["&:hover td"+(L?", & td":"")]:{backgroundImage:`linear-gradient(${F}, ${F})`}},children:[Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[E&&S?Os.jsx(Cj,{tokens:[E,S],width:24,mr:10,chainId:j.chainId,showChainLogo:!0}):"",Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,typography:"body2",fontWeight:600},children:[`${null==E?void 0:E.symbol}/${null==S?void 0:S.symbol}`,Os.jsx(_E,{address:j.id,chainId:j.chainId}),!!W&&Os.jsx(tS,{})]}),Os.jsx(ZT,{address:j.id,customChainId:j.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:14,iconSpace:4,onShareClick:h?()=>h({chainId:j.chainId,baseToken:E,quoteToken:S,poolId:j.id,apy:j.apy,isSingle:le.utils.singleSideLp(j.type)}):void 0,sx:{typography:"h6",color:"text.secondary"},disabledAddress:u,onAddressClick:()=>{fw.getState().push({type:pw.PoolDetail,params:{chainId:j.chainId,address:j.id}})}})]})]})}),u&&Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4},children:[Os.jsx(f,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary",whiteSpace:"nowrap"},children:P}),Os.jsx(A,{title:Os.jsx(e,{id:"O6RUgz",message:"Fee rate"}),children:Os.jsx(f,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary"},children:N?null!==(k=null===(w=eS[j.lpFeeRate])||void 0===w?void 0:w.label)&&void 0!==k?k:"-":Bn({input:new i(null!==(C=j.lpFeeRate)&&void 0!==C?C:0).plus(j.mtFeeRate?Tn(j.mtFeeRate,D?4:18):0)})})})]})}),Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{typography:"body2"},title:j.tvl?`$${bn({input:j.tvl})}`:void 0,children:["$",On(new i(j.tvl))]})}),Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[M||O?Os.jsx(A,{title:r._({id:"Sti4vy",message:"Mining"}),children:Os.jsxs(f,{component:"span",sx:{typography:"body2",color:"success.main"},children:["✨"," "]})}):"",Os.jsx(kE,{chainId:j.chainId,apy:j.apy,baseToken:E,quoteToken:S,hasQuote:!!R,hasMining:M,children:Os.jsxs(f,{component:"span",sx:{typography:"body2",fontWeight:600,display:"flex",alignItems:"center",width:"max-content",color:"success.main",cursor:"auto"},children:[I,R?`/${R}`:""]})})]})}),u&&Os.jsxs(f,{component:"td",children:["$",bn({input:j.volume24H||0})]}),Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"8px"},children:[u&&"PMM"===P&&Os.jsx($E,{chainId:j.chainId,address:j.id}),L?Os.jsx(WE,{text:L,onClick:()=>a(null)}):Os.jsx(T,{size:T.Size.small,onClick:()=>{a({pool:rs(t),hasMining:M})},children:r._({id:"m16xKo",message:"Add"})})]})})]},j.id+j.chainId)}))})]})}function oS({scrollParentRef:e,filterChainIds:t,activeChainId:n,handleChangeActiveChainId:r,operatePool:i,setOperatePool:o,tokenAndPoolFilter:a,getMigrationPairAndMining:s}){var l,d;g();const{onlyChainId:u,supportAMMV2:p,supportAMMV3:h,notSupportPMM:m}=pf(),{minDevice:y,isMobile:x}=wy(),v=Rt(),{filterTokens:b,filterASymbol:A,filterBSymbol:w,filterAddressLqList:k,handleDeleteToken:C,handleChangeFilterTokens:j,handleChangeFilterAddress:T}=TE(a),E=m?[]:["CLASSICAL","DVM","DSP","GSP"];p&&E.push("AMMV2"),h&&E.push("AMMV3");const S={chainIds:t,pageSize:x?4:8,filterState:{viewOnlyOwn:!1,filterTypes:E}},I=QA(),R=I.getInfiniteQuery(le.graphql.fetchLiquidityList,"currentPage",{where:Object.assign(Object.assign({},S),{filterState:Object.assign({filterASymbol:A,filterBSymbol:w},S.filterState)})}),L=Bt(Object.assign(Object.assign({},R),{initialPageParam:1,getNextPageParam:e=>{var t;const{currentPage:n,totalCount:r,pageSize:i}=null!==(t=e.liquidity_list)&&void 0!==t?t:{};if(!n||!r||!i)return null;let o=Math.floor(r/i);return r%i&&(o+=1),n>=o?null:n+1}}));let M=[];const O=!!(null==k?void 0:k.length);O?M=[...k]:null===(l=L.data)||void 0===l||l.pages.forEach((e=>{var t,n;null===(n=null===(t=e.liquidity_list)||void 0===t?void 0:t.lqList)||void 0===n||n.forEach((e=>{null==M||M.push(e)}))}));const B=L.hasNextPage&&!O;return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:Object.assign(Object.assign({py:16,display:"flex",gap:8},y(475)?{}:{flexDirection:"column"}),x?{}:{px:20,borderBottomWidth:1}),children:[Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",gap:8},y(475)?{}:{"& > button":{flex:1}}),children:[!u&&Os.jsx(PE,{chainId:n,setChainId:r}),null!==(d=null==a?void 0:a.element)&&void 0!==d?d:Os.jsx(nS,{value:b,onChange:j,searchAddress:(e,t)=>Fn(this,void 0,void 0,(function*(){var n;const r=I.getInfiniteQuery(le.graphql.fetchLiquidityList,"currentPage",{where:Object.assign(Object.assign({},S),{filterState:Object.assign({address:e},S.filterState)})}),i=null===(n=(yield v.fetchQuery(r)).liquidity_list)||void 0===n?void 0:n.lqList;return(null==i?void 0:i.length)?Os.jsx(DE,{list:i,onClick:()=>{T(i),t()}}):null}))})]}),(O||!!b.length)&&Os.jsxs(f,{sx:{my:0},children:[O?Os.jsx(NE,{lqList:k,onDeleteTag:()=>T([])}):"",Os.jsx(FE,{tags:b,onDeleteTag:C})]})]}),x?Os.jsx(dn,{hasMore:B,threshold:300,loadMore:c((()=>{L.hasNextPage&&!L.isFetching&&L.fetchNextPage()}),500),useWindow:!1,getScrollParent:()=>e.current||null,loader:Os.jsx(jE,{sx:{mt:20}},"loader"),children:Os.jsxs(CE,{children:[L.isLoading?Os.jsx(jE,{}):"",!L.isLoading&&!(null==M?void 0:M.length)&&!L.error&&Os.jsx(sT,{sx:{mt:40},hasSearch:!!(n&&!u||A||w)}),!!L.error&&Os.jsx(mT,{refresh:L.refetch,sx:{mt:40}}),Os.jsx(rS,{lqList:M,setOperatePool:o,supportAMM:p||h,getMigrationPairAndMining:s})]})}):Os.jsxs(Os.Fragment,{children:[Os.jsx(iS,{lqList:M,loading:L.isLoading,operatePool:i,setOperatePool:o,hasMore:B,loadMoreLoading:L.isFetchingNextPage,loadMore:()=>{L.hasNextPage&&!L.isFetching&&L.fetchNextPage()},supportAMM:p||h,getMigrationPairAndMining:s}),Os.jsx(GE,{loading:L.isLoading,refetch:L.error?L.refetch:void 0,empty:!(null==M?void 0:M.length),hasSearch:!!(n&&!u||A||w)})]})]})}function aS({onClick:e,title:t,desc:n}){const r=g();return Os.jsx(f,{sx:{mx:20,px:0,py:14,borderTop:`1px solid ${r.palette.border.main}`,[r.breakpoints.up("tablet")]:{maxWidth:236,borderTop:"none",mx:0,px:16,py:8}},children:Os.jsxs(y,{onClick:e,sx:{width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:0,p:0,borderRadius:8,textAlign:"left","&:hover":{backgroundColor:r.palette.background.tag},[r.breakpoints.up("tablet")]:{p:8}},children:[Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:r.palette.text.primary},children:t}),Os.jsx(f,{sx:{typography:"h6",fontWeight:500,color:r.palette.text.secondary},children:n})]})})}const sS=t=>{const n=g(),{isMobile:r}=wy(),{account:i}=hf(),{supportAMMV2:o,supportAMMV3:a,notSupportPMM:s}=pf(),[l,d]=at.useState(!1),c={[pw.CreatePool]:!s,[pw.createPoolAMMV2]:!!o,[pw.createPoolAMMV3]:!!a},u=Object.entries(c).filter((([e,t])=>!0===t)),p=1===u.length?u[0][0]:void 0;if(!p){const t=Os.jsxs(Os.Fragment,{children:[!s&&Os.jsx(aS,{onClick:()=>{fw.getState().push({type:pw.CreatePool})},title:Os.jsx(e,{id:"Eif7f6",message:"PMM Pool"}),desc:Os.jsx(e,{id:"TmTsab",message:"Fexible customization, take full control of liquidity"})}),o&&Os.jsx(aS,{onClick:()=>{fw.getState().push({type:pw.createPoolAMMV2})},title:Os.jsx(e,{id:"lNYomJ",message:"AMM V2 Position"}),desc:Os.jsx(e,{id:"lLbR0m",message:"Simple, full-range liquidity"})}),a&&Os.jsx(aS,{onClick:()=>{fw.getState().push({type:pw.createPoolAMMV3})},title:Os.jsx(e,{id:"sVlqoo",message:"AMM V3 Position"}),desc:Os.jsx(e,{id:"EkAv3P",message:"Concentrated liquidity, higher efficiency"})})]});return r?Os.jsxs(Os.Fragment,{children:[Os.jsxs(T,{variant:T.Variant.outlined,fullWidth:r&&!!i,onClick:()=>{d(!0)},sx:{height:40},children:[Os.jsx(f,{component:As.Plus,sx:{mr:4}}),Os.jsx(e,{id:"p2jbcE",message:"Create Pool"})]}),Os.jsx(yy,{open:l,title:Os.jsx(e,{id:"p2jbcE",message:"Create Pool"}),onClose:()=>{d(!1)},modal:!0,children:Os.jsx(f,{sx:{mb:0},children:t})})]}):Os.jsx(A,{arrow:!1,leaveDelay:300,placement:r?"bottom":"bottom-end",sx:{p:0,backgroundColor:"background.paper"},title:Os.jsx(f,{children:t}),children:Os.jsxs(f,{sx:{width:r?"100%":"auto",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:10,pl:8,pr:16,py:7,borderRadius:8,borderWidth:1,borderColor:n.palette.primary.main,typography:"body1",fontWeight:600,color:n.palette.primary.main,cursor:"pointer","&:hover":{backgroundColor:C(n.palette.primary.main,.1)}},children:[Os.jsx(f,{component:As.Plus}),Os.jsx(e,{id:"p2jbcE",message:"Create Pool"})]})})}return Os.jsxs(T,{variant:T.Variant.outlined,fullWidth:r,onClick:()=>{fw.getState().push({type:p})},sx:{height:40},children:[Os.jsx(f,{component:As.Plus,sx:{mr:4}}),Os.jsx(e,{id:"p2jbcE",message:"Create Pool"})]})},lS="DODO_WIDGET_POOL_LIST_TAB",dS="DODO_WIDGET_POOLS_LIST_FILTER_CHAIN";var cS;!function(e){e.addLiquidity="add-liquidity",e.myLiquidity="my-liquidity",e.myCreated="my-created"}(cS||(cS={}));const uS=(e,t,n)=>{let i=r._({id:"TJBHlP",message:"Standard"}),o=n.palette.purple.main;switch(e){case"DSP":i=r._({id:"J7M/DA",message:"Pegged"}),o=n.palette.success.main;break;case"DPP":i=r._({id:"zwBp5t",message:"Private"}),o=n.palette.error.main}"DVM"===e&&(!t||t.isZero())&&(i=r._({id:"S8G1qk",message:"Single"}),o=n.palette.warning.main);return{typeLabel:i,typeColor:o,typeBgColor:C(o,.1)}};function pS({account:t,list:n,setOperatePool:r}){const o=g();return Os.jsx(Os.Fragment,{children:null==n?void 0:n.map((n=>{var a,s,l,d,c;if(!n)return null;const u=null!==(a=n.pairAddress)&&void 0!==a?a:"",p=n.chainId,h=n.poolType,m={chainId:p,address:null!==(s=n.baseAddress)&&void 0!==s?s:"",symbol:null!==(l=n.baseSymbol)&&void 0!==l?l:""},g={chainId:p,address:null!==(d=n.quoteAddress)&&void 0!==d?d:"",symbol:null!==(c=n.quoteSymbol)&&void 0!==c?c:""},{typeLabel:x,typeColor:v,typeBgColor:b}=uS(h,n.quoteReserve?new i(n.quoteReserve):null,o);return Os.jsxs(f,{sx:{px:20,pt:20,pb:12,backgroundColor:"background.paper",borderRadius:16},className:"gradient-card-border",onClick:()=>{fw.getState().push({type:pw.PoolDetail,params:{chainId:p,address:u}})},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[m&&g?Os.jsx(Cj,{tokens:[m,g],width:24,mr:8,chainId:p,showChainLogo:!0}):"",Os.jsx(f,{sx:{typography:"body2",fontWeight:600},children:us(u)}),"DPP"===h&&Os.jsx(Q,{sx:{ml:2},component:y,onClick:e=>{e.stopPropagation(),fw.getState().push({type:pw.ModifyPool,params:{chainId:p,address:u}})},children:Os.jsx(f,{component:As.Edit,sx:{width:12,height:12,cursor:"pointer"}})})]}),Os.jsx(f,{sx:{typography:"h6",width:"max-content",p:8,borderRadius:8,backgroundColor:b,color:v},children:x})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",mt:44},children:[Os.jsxs(f,{children:[Os.jsxs(f,{sx:{typography:"h5"},children:["$",n.tvl?On(new i(n.tvl)):"-"]}),Os.jsx(f,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:Os.jsx(e,{id:"FHKsZF",message:"TVL"})})]}),Os.jsx(f,{sx:{display:"inline-block",mx:20,height:24,width:"1px",backgroundColor:"custom.border.default"}}),Os.jsxs(f,{children:[Os.jsxs(f,{sx:{typography:"h5"},children:["$",n.totalFee?On(new i(n.totalFee)):"-"]}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"hCBYHP",message:"Total Fee Revenue"})})]})]}),Os.jsxs(f,{sx:{mt:20,display:"flex",gap:"8px"},children:[!!t&&Os.jsx(T,{fullWidth:!0,variant:T.Variant.outlined,size:T.Size.small,onClick:e=>{e.stopPropagation(),r({address:u,operate:FT.Remove,chainId:p})},children:Os.jsx(e,{id:"t/YqKh",message:"Remove"})}),Os.jsx(T,{fullWidth:!0,size:T.Size.small,onClick:e=>{e.stopPropagation(),r({address:u,operate:FT.Add,chainId:p})},children:Os.jsx(e,{id:"m16xKo",message:"Add"})})]})]},u+p)}))})}function hS({account:t,list:n,loading:o,operatePool:a,setOperatePool:s}){const l=g(),d=fw();return Os.jsxs(VE,{empty:!(null==n?void 0:n.length),loading:o,children:[Os.jsx(f,{component:"thead",children:Os.jsxs(f,{component:"tr",children:[Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"AxdOHo",message:"Pair"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"FHKsZF",message:"TVL"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"hCBYHP",message:"Total Fee Revenue"})}),Os.jsx(f,{component:"th",sx:{width:160}})]})}),Os.jsx(f,{component:"tbody",children:null==n?void 0:n.map((n=>{var o,c,u,p,h,m;if(!n)return null;const g="DPP"===n.poolType,y=null!==(o=n.pairAddress)&&void 0!==o?o:"",x=n.chainId,v=n.poolType,b={chainId:x,address:null!==(c=n.baseAddress)&&void 0!==c?c:"",symbol:null!==(u=n.baseSymbol)&&void 0!==u?u:""},A={chainId:x,address:null!==(p=n.quoteAddress)&&void 0!==p?p:"",symbol:null!==(h=n.quoteSymbol)&&void 0!==h?h:""},{typeLabel:w,typeColor:k,typeBgColor:j}=uS(v,n.quoteReserve?new i(n.quoteReserve):null,l);let E="";if((null===(m=null==a?void 0:a.pool)||void 0===m?void 0:m.address)===y||(null==a?void 0:a.address)===y)if((null==a?void 0:a.operate)===FT.Remove)E=r._({id:"0+31GV",message:"Removing"});else E=r._({id:"1yHVE+",message:"Adding"});const S=l.palette.background.tag;return Os.jsxs(f,{component:"tr",sx:{["&:hover td"+(E?", & td":"")]:{backgroundImage:`linear-gradient(${S}, ${S})`}},children:[Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[b&&A?Os.jsx(Cj,{tokens:[b,A],width:24,mr:10,chainId:x,showChainLogo:!0}):"",Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsxs(X,{lineSx:{bottom:-1},lineColor:"primary.main",hoverSx:{color:"primary.main","& svg":{display:"inline-block"}},className:"truncate-address-link",sx:{display:"flex",alignItems:"center"},children:[Os.jsx(f,{sx:{typography:"body2",fontWeight:600},onClick:()=>{d.push({type:pw.PoolDetail,params:{chainId:x,address:y}})},children:us(y)}),Os.jsx(f,{component:As.ArrowRight,sx:{display:"none",width:14,height:14}})]}),g?Os.jsx(f,{sx:{typography:"h6",px:8,py:2,ml:8,borderStyle:"solid",borderWidth:1,borderColor:"text.primary",borderRadius:4,whiteSpace:"nowrap",cursor:"pointer","&:hover":{backgroundColor:C(l.palette.text.primary,.1)}},onClick:()=>{d.push({type:pw.ModifyPool,params:{chainId:x,address:y}})},children:Os.jsx(e,{id:"ePK91l",message:"Edit"})}):""]}),Os.jsx(f,{sx:{typography:"h6",width:"max-content",mt:2,px:8,py:2,borderRadius:12,backgroundColor:j,color:k},children:w})]})]})}),Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{typography:"body2"},title:n.tvl?`$${bn({input:n.tvl})}`:void 0,children:["$",n.tvl?On(new i(n.tvl)):"-"]})}),Os.jsx(f,{component:"td",children:Os.jsxs(f,{title:n.totalFee?`$${bn({input:n.totalFee})}`:"",sx:{typography:"body2",fontWeight:600},children:["$",n.totalFee?On(new i(n.totalFee)):"-"]})}),Os.jsx(f,{component:"td",children:Os.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"8px"},children:E?Os.jsx(WE,{text:E,onClick:()=>s(null)}):Os.jsxs(Os.Fragment,{children:[!!t&&Os.jsx(T,{variant:T.Variant.outlined,size:T.Size.small,onClick:e=>{e.stopPropagation(),s({operate:FT.Remove,chainId:x,address:y})},children:Os.jsx(e,{id:"t/YqKh",message:"Remove"})}),Os.jsx(T,{size:T.Size.small,onClick:()=>{s({chainId:x,address:y})},children:r._({id:"m16xKo",message:"Add"})})]})})})]},y+x)}))})]})}function mS({account:t,filterChainIds:n,activeChainId:r,handleChangeActiveChainId:i,operatePool:o,setOperatePool:a}){var s,l,d,c,u,p;const{isMobile:h}=wy(),{onlyChainId:m}=pf(),g={limit:1e3,page:1,owner:t},y=QA().getQuery(le.graphql.fetchDashboardPairList,{where:g}),x=It(Object.assign({},y)),v=null!==(p=n?null===(d=null===(l=null===(s=x.data)||void 0===s?void 0:s.dashboard_pairs_list)||void 0===l?void 0:l.list)||void 0===d?void 0:d.filter((e=>{var t;return n.includes(null!==(t=null==e?void 0:e.chainId)&&void 0!==t?t:0)})):null===(u=null===(c=x.data)||void 0===c?void 0:c.dashboard_pairs_list)||void 0===u?void 0:u.list)&&void 0!==p?p:[],[b,A]=at.useState(!1),w=b?v.filter((e=>!!Number(null==e?void 0:e.tvl))):v;return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:Object.assign({py:16,display:"flex",justifyContent:"space-between",gap:8},h?{}:{px:20,borderBottomWidth:1}),children:[!m&&Os.jsx(PE,{chainId:r,setChainId:i}),Os.jsxs(f,{component:"label",sx:{display:"flex",alignItems:"center",gap:8,typography:"body2",cursor:"pointer",color:"text.secondary"},children:[Os.jsx(S,{sx:{top:-1},size:16,checked:b,onChange:e=>{const{checked:t}=e.target;A(t)}}),Os.jsx(e,{id:"eVZ7bY",message:"Hide TVL=0 pools"})]})]}),h?Os.jsxs(CE,{children:[x.isLoading?Os.jsx(jE,{}):"",!x.isLoading&&!(null==w?void 0:w.length)&&!x.error&&Os.jsx(sT,{sx:{mt:40},hasSearch:!!r&&!m}),!!x.error&&Os.jsx(mT,{refresh:x.refetch,sx:{mt:40}}),Os.jsx(pS,{account:t,list:w,setOperatePool:a})]}):Os.jsxs(Os.Fragment,{children:[Os.jsx(hS,{account:t,list:w,loading:x.isLoading,operatePool:o,setOperatePool:a}),Os.jsx(GE,{loading:x.isLoading,refetch:x.error?x.refetch:void 0,empty:!(null==w?void 0:w.length),hasSearch:!!r&&!m})]})]})}const fS=({onlyV3:e,setOnlyV3:t,sx:n})=>{const i=g(),{notSupportPMM:o}=pf();return Os.jsx(f,{component:y,onClick:()=>t(!e),sx:Object.assign({display:"flex",alignItems:"center",p:2,borderRadius:8,backgroundColor:i.palette.border.main},n),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",width:"100%",[i.breakpoints.up("tablet")]:{width:194}},children:[Os.jsx(f,{sx:Object.assign({flex:1,width:0,pt:4,pb:5,borderRadius:6,textAlign:"center",typography:"body2",whiteSpace:"nowrap"},e?{color:i.palette.text.primary,backgroundColor:i.palette.background.paper}:{color:i.palette.text.secondary,backgroundColor:"transparent"}),children:r._({id:"yoR+O6",message:"V3"})}),Os.jsx(f,{sx:Object.assign({flex:1,width:0,pt:4,pb:5,borderRadius:6,textAlign:"center",typography:"body2",whiteSpace:"nowrap"},e?{color:i.palette.text.secondary,backgroundColor:"transparent"}:{color:i.palette.text.primary,backgroundColor:i.palette.background.paper}),children:o?"V2":r._({id:"eK6I8d",message:"V2 & PMM"})})]})})};function gS({account:t,lqList:n,setOperatePool:r,getMigrationPairAndMining:o,supportAMM:a}){const s=g();return Os.jsx(Os.Fragment,{children:null==n?void 0:n.map((n=>{var l,d,c,u,p,h,m,g,y,x,v,b,w,k,j,E,S,I,R;if(!(null==n?void 0:n.pair))return null;const L=n.pair,M=ns(L.baseToken,L.chainId),O=ns(L.quoteToken,L.chainId),B=le.utils.singleSideLp(L.type),P=L.apy?Pn(new i(null===(l=L.apy)||void 0===l?void 0:l.transactionBaseApy).plus(null!==(c=null===(d=L.apy)||void 0===d?void 0:d.miningBaseApy)&&void 0!==c?c:0).plus(null!==(p=null===(u=L.apy)||void 0===u?void 0:u.metromMiningApy)&&void 0!==p?p:0)):"0%",D=B&&L.apy?Pn(new i(L.apy.transactionQuoteApy).plus(null!==(h=L.apy.miningQuoteApy)&&void 0!==h?h:0)):void 0;let N,F;(null===(m=n.liquidityPositions)||void 0===m?void 0:m.length)&&n.liquidityPositions.forEach((e=>{var t,n,r,o,a;if(null==e?void 0:e.liquidityTokenBalance){const s=null===(t=e.id)||void 0===t?void 0:t.split("-");if(2===(null==s?void 0:s.length)){const t=s[1].toLocaleLowerCase();if((null===(r=null===(n=null==L?void 0:L.baseLpToken)||void 0===n?void 0:n.id)||void 0===r?void 0:r.toLocaleLowerCase())===t)return void(N=new i(e.liquidityTokenBalance));(null===(a=null===(o=null==L?void 0:L.quoteLpToken)||void 0===o?void 0:o.id)||void 0===a?void 0:a.toLocaleLowerCase())===t&&(F=new i(e.liquidityTokenBalance))}}}));const W=!!(null===(g=L.miningAddress)||void 0===g?void 0:g[0]),V=!!(null===(y=L.apy)||void 0===y?void 0:y.metromMiningApy)&&Number(null===(x=L.apy)||void 0===x?void 0:x.metromMiningApy)>0,U=null===(v=n.liquidityPositions)||void 0===v?void 0:v[0],H=L.type,q=os(H),Z="AMMV2"===H,z="AMMV3"===H,Q=null==o?void 0:o({address:L.id,chainId:L.chainId});return Os.jsxs(f,{sx:{px:20,pt:20,pb:12,backgroundColor:"background.paper",borderRadius:16},className:"gradient-card-border",onClick:()=>{a||fw.getState().push({type:pw.PoolDetail,params:{chainId:L.chainId,address:L.id}})},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[M&&O?Os.jsx(Cj,{tokens:[M,O],width:24,mr:6,chainId:L.chainId,showChainLogo:!0}):"",Os.jsxs(f,{sx:{typography:"body2",fontWeight:600},children:[`${null==M?void 0:M.symbol}/${null==O?void 0:O.symbol}`,Os.jsx(_E,{address:L.id,chainId:L.chainId})]}),!!Q&&Os.jsx(tS,{})]}),W||V?Os.jsxs(f,{sx:{p:8,typography:"h6",fontWeight:"bold",background:`linear-gradient(180deg, ${C(s.palette.secondary.main,.3)} 0%, ${C(s.palette.purple.main,.3)} 100%)`,borderRadius:8,color:"purple.main",whiteSpace:"nowrap"},children:["✨ ",Os.jsx(e,{id:"Sti4vy",message:"Mining"})]}):""]}),Os.jsxs(f,{sx:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",rowGap:20,mt:44,"& > div:nth-child(odd)":{pr:20},"& > div:nth-child(even)":{position:"relative",pl:20,"&::before":{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",display:"inline-block",content:'""',height:24,width:"1px",backgroundColor:"border.main"}}},children:[a&&Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,whiteSpace:"nowrap"},children:[q,Os.jsx(A,{title:Os.jsx(e,{id:"O6RUgz",message:"Fee rate"}),children:Os.jsx(f,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary"},children:z?null!==(w=null===(b=eS[L.lpFeeRate])||void 0===b?void 0:b.label)&&void 0!==w?w:"-":Bn({input:new i(null!==(k=L.lpFeeRate)&&void 0!==k?k:0).plus(L.mtFeeRate?Tn(L.mtFeeRate,Z?4:18):0)})})})]}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"1Qz63U",message:"Pool Type"})})]}),z?null:Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{children:[Os.jsxs(f,{sx:{typography:"h5",color:"success.main"},children:[P,D?`/${D}`:""]}),Os.jsxs(f,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:[Os.jsx(e,{id:"rSayea",message:"APY"}),Os.jsx(kE,{chainId:L.chainId,apy:L.apy,baseToken:M,quoteToken:O,hasQuote:!!D,hasMining:W,sx:{width:14,height:14}})]})]}),Os.jsxs(f,{children:[Os.jsxs(f,{sx:{typography:"h5"},children:["$",On(new i(L.tvl||0))]}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"FHKsZF",message:"TVL"})})]})]}),"AMMV2"===H&&Os.jsxs(f,{children:[Os.jsx(f,{sx:{typography:"h5"},children:Bn({input:null===(E=null===(j=n.liquidityPositions)||void 0===j?void 0:j[0])||void 0===E?void 0:E.poolShare})}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"h3PbRN",message:"My Pool Share"})})]}),Os.jsxs(f,{children:[Os.jsx(f,{sx:{typography:"h5",display:"flex",alignItems:"center",fontWeight:"bold"},children:z?(null==U?void 0:U.liquidityUSD)?`$${An({input:U.liquidityUSD,decimals:2})}`:"-":Os.jsxs(Os.Fragment,{children:[B?Os.jsx(ey,{address:null==M?void 0:M.address,chainId:L.chainId,url:null==M?void 0:M.logoURI,width:18,height:18,sx:{mr:4}}):Os.jsx(Cj,{tokens:M&&O?[M,O]:[],width:18,mr:4,showChainLogo:!1,chainId:L.chainId}),N?bn({input:N}):"",B&&Os.jsxs(Os.Fragment,{children:[" / ",Os.jsx(ey,{address:null==O?void 0:O.address,chainId:L.chainId,url:null==O?void 0:O.logoURI,width:18,height:18,sx:{mx:4}}),F?bn({input:F}):"0"]})]})}),Os.jsx(f,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:Os.jsx(e,{id:"YHc3B+",message:"My Liquidity"})})]}),z&&Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,color:"text.primary"},children:[Os.jsx(iT,{outOfRange:null!==(S=null==U?void 0:U.outOfRange)&&void 0!==S&&S}),Os.jsx(f,{children:Os.jsxs(Os.Fragment,{children:[Os.jsxs("span",{children:[bj({price:null===(I=null==U?void 0:U.priceRange)||void 0===I?void 0:I.token0LowerPrice,atLimit:{},direction:Mw.LOWER})," "]}),null==M?void 0:M.symbol]})}),Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:Os.jsx("path",{d:"M15.75 9.50293L12.75 12.5029L11.7 11.4529L12.8813 10.2529L5.11875 10.2529L6.3 11.4529L5.25 12.5029L2.25 9.50293L5.25 6.50293L6.31875 7.55293L5.11875 8.75293L12.8813 8.75293L11.7 7.55293L12.75 6.50293L15.75 9.50293Z",fill:"currentColor",fillOpacity:"0.5"})}),Os.jsx(f,{children:Os.jsxs(Os.Fragment,{children:[Os.jsxs("span",{children:[bj({price:null===(R=null==U?void 0:U.priceRange)||void 0===R?void 0:R.token1LowerPrice,atLimit:{},direction:Mw.UPPER})," "]}),null==M?void 0:M.symbol]})})]}),Os.jsx(f,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:Os.jsx(e,{id:"YA4hwj",message:"Price Range"})})]})]}),Os.jsxs(f,{sx:{mt:20,display:"flex",gap:"8px"},children:[z?null:!!t&&Os.jsx(T,{fullWidth:!0,variant:T.Variant.outlined,size:T.Size.small,onClick:e=>{e.stopPropagation(),r({operate:FT.Remove,pool:is(n),hasMining:W})},children:Os.jsx(e,{id:"t/YqKh",message:"Remove"})}),Os.jsx(T,{fullWidth:!0,size:T.Size.small,onClick:e=>{e.stopPropagation(),r({operate:FT.Add,pool:is(n),hasMining:W})},children:Os.jsx(e,{id:"J/hVSQ",message:"{0}",values:{0:z?"Manage":"Add"}})}),a&&"PMM"===q&&Os.jsx($E,{chainId:L.chainId,address:L.id})]})]},z?null==U?void 0:U.id:L.id+L.chainId)}))})}function yS({account:t,lqList:n,loading:o,operatePool:a,setOperatePool:s,supportAMM:l,onlyV3:d,getMigrationPairAndMining:c}){const u=g();return Os.jsxs(VE,{empty:!(null==n?void 0:n.length),loading:o,children:[Os.jsx(f,{component:"thead",children:Os.jsxs(f,{component:"tr",children:[Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"AxdOHo",message:"Pair"})}),l&&Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"1Qz63U",message:"Pool Type"})}),d?null:Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"FHKsZF",message:"TVL"})}),d?null:Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"rSayea",message:"APY"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"YHc3B+",message:"My Liquidity"})}),d?Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"YA4hwj",message:"Price Range"})}):null,Os.jsx(f,{component:"th",sx:{width:210}})]})}),Os.jsx(f,{component:"tbody",children:null==n?void 0:n.map((n=>{var o,p,h,m,g,y,x,v,b,w,k,C,j,E,S,I,R,L,M,O,B;if(!(null==n?void 0:n.pair))return null;const P=n.pair,D=ns(P.baseToken,P.chainId),N=ns(P.quoteToken,P.chainId),F=le.utils.singleSideLp(P.type),W=P.apy?Pn(new i(null===(o=P.apy)||void 0===o?void 0:o.transactionBaseApy).plus(null!==(h=null===(p=P.apy)||void 0===p?void 0:p.miningBaseApy)&&void 0!==h?h:0)):void 0,V=F&&P.apy?Pn(new i(P.apy.transactionQuoteApy).plus(null!==(m=P.apy.miningQuoteApy)&&void 0!==m?m:0)):void 0;let U,H;(null===(g=n.liquidityPositions)||void 0===g?void 0:g.length)&&n.liquidityPositions.forEach((e=>{var t,n,r,o,a;if(null==e?void 0:e.liquidityTokenBalance){const s=null===(t=e.id)||void 0===t?void 0:t.split("-");if(2===(null==s?void 0:s.length)){const t=s[1].toLocaleLowerCase();if((null===(r=null===(n=null==P?void 0:P.baseLpToken)||void 0===n?void 0:n.id)||void 0===r?void 0:r.toLocaleLowerCase())===t)return void(U=new i(e.liquidityTokenBalance));(null===(a=null===(o=null==P?void 0:P.quoteLpToken)||void 0===o?void 0:o.id)||void 0===a?void 0:a.toLocaleLowerCase())===t&&(H=new i(e.liquidityTokenBalance))}}}));const q=null===(y=n.liquidityPositions)||void 0===y?void 0:y[0],Z=P.type,z=os(Z),Q="AMMV2"===Z,G="AMMV3"===Z;let Y="";if(G)(null===(b=null===(v=null===(x=null==a?void 0:a.pool)||void 0===x?void 0:x.liquidityPositions)||void 0===v?void 0:v[0])||void 0===b?void 0:b.id)===(null==q?void 0:q.id)&&(Y=r._({id:"p3607o",message:"Managing"}));else if((null===(w=null==a?void 0:a.pool)||void 0===w?void 0:w.address)===P.id||(null==a?void 0:a.address)===P.id)if(a.operate===FT.Remove)Y=r._({id:"0+31GV",message:"Removing"});else Y=r._({id:"1yHVE+",message:"Adding"});const X=!!(null===(k=P.miningAddress)||void 0===k?void 0:k[0]),J=!!(null===(C=P.apy)||void 0===C?void 0:C.metromMiningApy)&&Number(null===(j=P.apy)||void 0===j?void 0:j.metromMiningApy)>0,K=u.palette.background.tag,_=null==c?void 0:c({address:P.id,chainId:P.chainId});return Os.jsxs(f,{component:"tr",sx:{["&:hover td"+(Y?", & td":"")]:{backgroundImage:`linear-gradient(${K}, ${K})`}},children:[Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[D&&N?Os.jsx(Cj,{tokens:[D,N],width:24,mr:10,chainId:P.chainId,showChainLogo:!0}):"",Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,typography:"body2",fontWeight:600},children:[`${null==D?void 0:D.symbol}/${null==N?void 0:N.symbol}`,Os.jsx(_E,{address:P.id,chainId:P.chainId}),!!_&&Os.jsx(tS,{})]}),Os.jsx(ZT,{address:P.id,customChainId:P.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:14,iconSpace:4,disabledAddress:l,onAddressClick:()=>{fw.getState().push({type:pw.PoolDetail,params:{chainId:P.chainId,address:P.id}})},sx:{typography:"h6",color:"text.secondary"}})]})]})}),l&&Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4},children:[Os.jsx(f,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary",whiteSpace:"nowrap"},children:z}),Os.jsx(A,{title:Os.jsx(e,{id:"O6RUgz",message:"Fee rate"}),children:Os.jsx(f,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary"},children:G?null!==(S=null===(E=eS[P.lpFeeRate])||void 0===E?void 0:E.label)&&void 0!==S?S:"-":Bn({input:new i(null!==(I=P.lpFeeRate)&&void 0!==I?I:0).plus(P.mtFeeRate?Tn(P.mtFeeRate,Q?4:18):0)})})})]})}),G?null:Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{typography:"body2"},title:P.tvl?`$${bn({input:P.tvl||0})}`:void 0,children:["$",On(new i(P.tvl||0))]})}),G?null:Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[X||J?Os.jsx(A,{title:r._({id:"Sti4vy",message:"Mining"}),children:Os.jsxs(f,{component:"span",sx:{typography:"body2",color:"success.main"},children:["✨"," "]})}):"",Os.jsx(kE,{chainId:P.chainId,apy:P.apy,baseToken:D,quoteToken:N,hasQuote:!!V,hasMining:X,children:Os.jsxs(f,{component:"span",sx:{typography:"body2",fontWeight:600,display:"flex",alignItems:"center",width:"max-content",color:"success.main",cursor:"auto"},children:[W||"0%",V?`/${V}`:""]})})]})}),Os.jsx(f,{component:"td",children:Os.jsx(f,{sx:{display:"flex",alignItems:"center"},children:G?(null==q?void 0:q.liquidityUSD)?`$${An({input:q.liquidityUSD,decimals:2})}`:"-":Os.jsxs(Os.Fragment,{children:[F?Os.jsx(ey,{address:null==D?void 0:D.address,chainId:P.chainId,url:null==D?void 0:D.logoURI,width:24,height:24,noShowChain:!0,sx:{mr:4}}):Os.jsx(Cj,{tokens:D&&N?[D,N]:[],width:24,mr:4,showChainLogo:!1,chainId:P.chainId}),U?bn({input:U}):"-",F&&Os.jsxs(Os.Fragment,{children:[" / ",Os.jsx(ey,{address:null==N?void 0:N.address,chainId:P.chainId,url:null==N?void 0:N.logoURI,width:24,height:24,noShowChain:!0,sx:{mx:4}}),H?bn({input:H}):"0"]}),Q&&Os.jsx(A,{title:Os.jsx(e,{id:"NXZdrO",message:"My pool share"}),children:Os.jsx(f,{sx:{ml:4,px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary"},children:Bn({input:null===(L=null===(R=n.liquidityPositions)||void 0===R?void 0:R[0])||void 0===L?void 0:L.poolShare})})})]})})}),d?Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,color:"text.primary"},children:[Os.jsx(iT,{outOfRange:null!==(M=null==q?void 0:q.outOfRange)&&void 0!==M&&M}),Os.jsx(f,{children:Os.jsxs(Os.Fragment,{children:[Os.jsxs("span",{children:[bj({price:null===(O=null==q?void 0:q.priceRange)||void 0===O?void 0:O.token0LowerPrice,atLimit:{},direction:Mw.LOWER})," "]}),null==D?void 0:D.symbol]})}),Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:Os.jsx("path",{d:"M15.75 9.50293L12.75 12.5029L11.7 11.4529L12.8813 10.2529L5.11875 10.2529L6.3 11.4529L5.25 12.5029L2.25 9.50293L5.25 6.50293L6.31875 7.55293L5.11875 8.75293L12.8813 8.75293L11.7 7.55293L12.75 6.50293L15.75 9.50293Z",fill:"currentColor",fillOpacity:"0.5"})}),Os.jsx(f,{children:Os.jsxs(Os.Fragment,{children:[Os.jsxs("span",{children:[bj({price:null===(B=null==q?void 0:q.priceRange)||void 0===B?void 0:B.token0UpperPrice,atLimit:{},direction:Mw.UPPER})," "]}),null==D?void 0:D.symbol]})})]})}):null,Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"8px"},children:[l&&"PMM"===z&&Os.jsx($E,{chainId:P.chainId,address:P.id}),Y?Os.jsx(WE,{text:Y,onClick:()=>s(null)}):Os.jsxs(Os.Fragment,{children:[G?null:!!t&&Os.jsxs(T,{variant:T.Variant.outlined,size:T.Size.small,onClick:e=>{e.stopPropagation(),s({operate:FT.Remove,pool:is(n),hasMining:X})},children:[Os.jsx(e,{id:"t/YqKh",message:"Remove"}),!!_&&Os.jsx(tS,{isRightTop:!0})]}),Os.jsx(T,{size:T.Size.small,onClick:()=>{s({pool:is(n),hasMining:X})},children:G?r._({id:"wckWOP",message:"Manage"}):r._({id:"m16xKo",message:"Add"})})]})]})})]},G?null==q?void 0:q.id:P.id+P.chainId)}))})]})}function xS({account:e,filterChainIds:t,activeChainId:n,handleChangeActiveChainId:r,operatePool:i,setOperatePool:o,getMigrationPairAndMining:a,tokenAndPoolFilter:s}){var l,d,c,u,p,h,m,y;g();const{minDevice:x,isMobile:v}=wy(),b=Rt(),{onlyChainId:A,supportAMMV2:w,supportAMMV3:k,notSupportPMM:C}=pf(),[j,T]=at.useState(!1),{filterTokens:E,filterASymbol:S,filterBSymbol:I,filterAddressLqList:R,handleDeleteToken:L,handleChangeFilterTokens:M,handleChangeFilterAddress:O}=TE(s);let B=C?[]:["CLASSICAL","DVM","DSP","GSP","DPP"];w&&B.push("AMMV2"),k&&j&&(B=["AMMV3"]);const P={currentPage:1,pageSize:1e3,user:e,filterState:{viewOnlyOwn:!0,filterTypes:B}},D=QA(),N=D.getQuery(le.graphql.fetchMyLiquidityList,{where:Object.assign(Object.assign({},P),{filterState:Object.assign({filterASymbol:S,filterBSymbol:I},P.filterState)})}),F=It(Object.assign({},N));let W=null!==(c=null===(d=null===(l=F.data)||void 0===l?void 0:l.liquidity_list)||void 0===d?void 0:d.lqList)&&void 0!==c?c:[];const V=!!(null==R?void 0:R.length);V?W=[...R]:t&&(W=null!==(m=null===(h=null===(p=null===(u=F.data)||void 0===u?void 0:u.liquidity_list)||void 0===p?void 0:p.lqList)||void 0===h?void 0:h.filter((e=>{var n,r;return t.includes(null!==(r=null===(n=null==e?void 0:e.pair)||void 0===n?void 0:n.chainId)&&void 0!==r?r:0)})))&&void 0!==m?m:[]);return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:Object.assign(Object.assign({py:16,display:"flex",gap:8},x(475)?{}:{flexDirection:"column"}),v?{}:{px:20,borderBottomWidth:1}),children:[Os.jsxs(f,{sx:Object.assign(Object.assign({display:"flex",alignItems:"center",gap:8},x(475)?{}:{"& > button":{flex:1,flexBasis:"100%"}}),v?{flexWrap:"wrap"}:{}),children:[!A&&Os.jsx(PE,{chainId:n,setChainId:r,sx:{justifyContent:"space-between"}}),k&&Os.jsx(fS,{onlyV3:j,setOnlyV3:T,sx:v?{flexGrow:1,flexBasis:"100%"}:void 0}),null!==(y=null==s?void 0:s.element)&&void 0!==y?y:Os.jsx(nS,{value:E,onChange:M,searchAddress:(e,t)=>Fn(this,void 0,void 0,(function*(){var n;const r=D.getInfiniteQuery(le.graphql.fetchLiquidityList,"currentPage",{where:Object.assign(Object.assign({},P),{filterState:Object.assign({address:e},P.filterState)})}),i=null===(n=(yield b.fetchQuery(r)).liquidity_list)||void 0===n?void 0:n.lqList;return(null==i?void 0:i.length)?Os.jsx(DE,{list:i,onClick:()=>{O(i),t()}}):null}))})]}),(V||!!E.length)&&Os.jsxs(f,{sx:{my:0},children:[V?Os.jsx(NE,{lqList:R,onDeleteTag:()=>O([])}):"",Os.jsx(FE,{tags:E,onDeleteTag:L})]})]}),v?Os.jsxs(CE,{children:[F.isLoading?Os.jsx(jE,{}):"",!F.isLoading&&!(null==W?void 0:W.length)&&!F.error&&Os.jsx(sT,{sx:{mt:40},hasSearch:!!(n&&!A||S||I)}),!!F.error&&Os.jsx(mT,{refresh:F.refetch,sx:{mt:40}}),Os.jsx(gS,{account:e,lqList:W,setOperatePool:o,supportAMM:w||k,getMigrationPairAndMining:a})]}):Os.jsxs(Os.Fragment,{children:[Os.jsx(yS,{account:e,lqList:W,loading:F.isLoading,operatePool:i,setOperatePool:o,supportAMM:w||k,onlyV3:j,getMigrationPairAndMining:a}),Os.jsx(GE,{loading:F.isLoading,refetch:F.error?F.refetch:void 0,empty:!(null==W?void 0:W.length),hasSearch:!!(n&&!A||S||I)})]})]})}var vS,bS;function AS(){return AS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},AS.apply(null,arguments)}const wS=e=>ot.createElement("svg",AS({width:66,height:64,viewBox:"0 0 66 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),vS||(vS=ot.createElement("rect",{width:64,height:60.1342,fill:"url(#pattern0)"})),bS||(bS=ot.createElement("defs",null,ot.createElement("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:1,height:1},ot.createElement("use",{xlinkHref:"#image0_2465_53170",transform:"matrix(0.00671141 0 0 0.00714286 -0.503356 -0.9)"})),ot.createElement("image",{id:"image0_2465_53170",width:300,height:300,xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAADWuSURBVHgB7Z0JeFRVtu9XhYQwJRQzhulE5gYliPNEofc16rtXQvu10O1rCfdrW/F9V+Daer3dtyXwerDt9gLv2TYOLYFuVOhWwBm7NYUDICIEARkCphCCMicECAkk9fZ/n9qVk0pVxqqkEv6/79uc+dSpJOfPWmuvvbYIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGkrdJOCCFO5qs2UrUNQgghcc7JQCOEkLgmQzV/oHmExB0JQggxePCP2+0OrpP4goJFSBXjMzIyBE0xSUjcQcEipAoPxCozMxPrUC23EEJIHAKV8q9cudJfUFBg4ljZQgghcYalWoFlWX7DrFmzjGjNEkIIiQM8qi1Q7STECpaV4eTJk37lHhrRyhXb2vIIIYQ0E4hJzVRtpdi5Vn7VI+hXMatqYuVk8eLFfo/HY4QrVMAsIYSQGODMsfLDosrJydGWVH1AbCuMcM0UQgiJEVnisK7Q4PZlZWVFtLCys7O1FSY1rSuPkGbHJYQ0HktsN8sszb66gGAUq1bkaL7AsrmAxTVebOHJVBaX5ObmCpaGsWPHSl5eHla9qi1RbVUzPyMhpAFAhPBiZ4kdnF6s2hZxWCh1tQEp4k9Nrt+5gVYgthWDz4LL5Qk8QyyxJNBLaFxERy9hlpC4gRYWcWKJLRCwPDLEIRRKdKRre5Hv9BQZmCLSP1Vtq31KkILHsI31+nDgVGBZUrXEPrM8WFJ1LAAsG5g7a8W2ePIkutaOR7XcBQsWyLRp06Rbt27Yl6PadCFxQ6KQix2P2EmTGIpiYQdE57o0kev72eI0SonUgFSJKuZ+td33VJnI9mO2cO04Km617ll/SD/vnMApXrFFBSLmk6bhRVu1apVnzJgxZt8SIXEFBevixCO2SE1Tze0UqNvToy9OjQXPhWfSjKjav65Q5N2v9NKz43gw+O0VW7xWS+Mtr7Ver9fjiGN5hcQVdAkvLjxiWyceiMFtSpymKCEY3bP+rly8Aevri3YiT3+gfMT9epdPbKGZKw23ujxix88kcI8JQuIKCtbFgSV2EFsL1X2Xi/xkTOsVqVBcyk/ocZntPi54W/lxH+rdsLLQUTBXGgY6FNyB67KFxBUUrLYPetqyUxLF/ci1SqzGSJvEiFZiZ2VWHVVf+G9B4fKJbSn56nmrHLFdZVzjFRJXULDaNnD/sm/pI/LfN4v06S2tAlhKO45V9SQa4LqidxLLcLRTFmPPsbZ4gRwVip/7qhYwn9qcLHbPYl14xK7rPlZI3EHBartosXpwqAhatwEiCXHcxYJY1PNKTpbvtnsHawOpFAjGP3xVzQ6ClEtFOqdVbcPamvB/gqLVEEuLxCEUrLaJpVrBpP4iv1LxqqQOKl51icQtsKjuWiVSJsnyne98R/r37y+9evWS1NTqanT06FE5deqU7Nu3T7788kstXC/eUd3iat9VpPtl1e8P0Rr7mApqnWUgvbXDab7aJlmq3fZ/xymhShJJ7qJEq6PELTPeEzlSkSpTp06V4cOHS/fu3SU5uWaPQOfOnfWxwYMHa2HbkPelfFNSIZlDQ87rV33breJaZedVQGqnFvKFqp0T0iphieS2SUaaEqh+AZGKZ1cQpLZXglJWplt9gaUFUUOGvZN2HcKfn2FVrQpptTBx9CKg8oLENfNuUi7hyjJZtmyZdgdNgyA5LS24hGgHDx7UDS4h4lhOknsIacNQsNooh0pFPjsucpV6gS/EuQME4dl4rwq471Jt50FZv+FgrecjK/++G0WmjqiZS9ahe/hrVm4S0gagYLVhfv6FyOJrlGuo1iuUldUuzn/byLqfEhiCg0A8egvNAGi4fkhpGJgSOeG1y8DwLuHCd0SWrBXSBqBgtVFSVLC9RAWap39qi1bS0fjuKQwlUq5VJJCDBcEKBWI1a6ltxYVUfyCtEAbd2ygp6r+ixdfa6xCtv+4VKT0pbRKIVWgqQ9FZkdlLbbG67VIVJ7tRSBuAgtWGGZFqixZ6C/9LuYc3rhT5cJ+0KYxYGVcQQoXs9vR/E3nxA1uoFt/edsZNXuzQJWzjQKwgWqtUHPuZfBUjetd2jx6+2i4l05pfZKdYoVLD6k324GeIFgLzC2+Nn1I5JDpQsC4SMvvbDcL1lwLlKr0v8niyLVooM4OhLq1JvJDRXqTiXM+8JeL90m6pge9z9whHHS3SpqBgXWQY4dp1SuTPPpGP9tvpBAAvuSnkF481sjAYet0hkQ2H7YYhNwDPPDdCmgNpW1CwLlIQ38I4Q4B8rc9O2MunPrMbMNURRvWoWq8trSBaQJiKy+2KDTuUKO04XpXmAEzxwVmXt363ljQMChbRyaVoEhiTB+GCBQYRgxWDcsROIBBGuPQkFO3tdT0ZRUA8uravLiQQG4iQobjM3ncwzCQUTtDbCXG98xKRy/qITBjGuNTFDAWLiBvxKyUGJcrNOlukxEtsAftRetU5ELBDKphdWGo3ZNKXqPbRCTvfq6SRw3+M4PVRf4njlBD9S18RjIOESKWqfWmdqs7FIO4uFKuLGgoWkfOBoTu9Bldtl50WKS0WOaeWZWdsARlRD7GAqIUjUYlQF0cyaKiVdLxACKkTChaRM8fthrpZHVXvWxdlXSWq9V4OgcEA6vJz9vLUYbuBzj2qD64e3LVq/XxZ1ThGXZOridZRvFedILGHfwIkCCwrNCNGEIjkziIdutgClpRsL+GayWH7WL9Rtd9zz4dCSNSgYJGIwHKCW4gWDriKX220hSzS9YREEwpW2yRPBcWnFap4Ur9OElPg8jVX+ZqmuIQm10zqNxEFiVM4lrBtkqNaEcYPEjtVYoUtWDnS+FmhSRzAmu5tE9g8h5WVlQkr69a+0uKgFldySuTjpfWQEcTS2rWXBoGE03veUHG5cj1bznShYLVqKFhtF7g+rt0l4sH4QcxNiAkpWoqoCFZqw4oQPv+FPWbyqJ1qMUs1lvFr5VCw2jZe1faXXJDMv/jsHUjKbAnhioZg4fr6CNa6QqVOH4gs3a46Bir0Lp/Y1hVp5VCwWh7M4vKtxA5YWh7VLAy1+eCwnbWuM8mbUbiiYmF1VUHXWv5ijVBhLGRpck8ZOHCgHDt2DIdgXW0V0uqhYLUslmo7VUPiwAaJHftVyxo6dKi0T+0h63wnBBYXxgwCjNeLtXhFQ7A6KcFyhfzFQqSeV1L0wN9F/rzDFqqJEyfKfffdJ2+99ZacPXvWJ7Su2gxMa2hZzBx5k1RbILHDi7Z//37PlClT5IorrpBvvvlGtm/fLv/1xQl9wlXdA4Og1XJ4asvGuyLSrqrEzHolVO8U2AOoO3XqJAPTB8r/njxZRoywZ7H46KOPjHWVLaTNwKnqW5Yc1aaJ3XOVLrHtwbJUKxg7dqwWLMPp06dFCZn4fD759tsqzxSiBfHqFxiI3FQR00NzapkEI9xYQoxL3FliL+HO5p+tqubQoUMH/T0wA/S4ceO0aDl5+OGHIVg+sX+upI1AwWpZtliWlQGxUEwQ2xKKJQvat28/E1aWWtY4WF5eLsePH9fWF9rJkyerzcZsSr1gRh4TvHfOMI39qQ6b3Vlp4Swy/rpVbaPUjHMarz1f28J06kKgMkRp9Wfr27dvsMGKSktLkz59+kg4YF298MILWG2OnylpRihYLYelWsGCBQskOztbioqKFoodHI4lbnymimW5b7755npdYETsxIkTUlJSohussjNnzjRoavl6PZzbXaNBoLCEReVkwIABkpgYPqIRsK5WqdXJQtoUjGG1HB78M378eN1Wr14N1zDWggWXc2F+fv4cuIYpKeGj4AkJCXqKeAgSLLFLLrlEt3BAwCBqaEAFucXlcul7tGvXTi8hLFiiGSBCZgkxChWk2ujSpUtEsVq1apWJXc0W0uaghdVyFCh30CooKBCv1ysTJsB70S9ZLIPvQFtZSoDcd9xxR42DEBlYNUZcKisr5cKFC+L3+2uci2NGlEAkEakvuJ9T1CIRybqCUP3mN7/BMkfYM9gmYVpD8wPB+KNqHriDGRkZonRL1q5di8D3bYFzkDMUqyHFuG9H5dZ5YDWFWlkdO3aUzp07B7dhLUGUIBDOBgErLS3VYgahwXZFRYVeN9tm3TRzPwDrzVhm586d0w37cF1SUuToPqyrSJbhsmXLZNcuPWgQriCH4LRBKFjNA0TqftWeCLRr58+fLw888EDwhMzMTN1Lt3XrVo/afExsl3Gs2AJTJNEVMCSTPqBEqwNys5xAMCIJghNjWaHhGggX2vnz53UzYuRsOA5XE0CcIHDmXhBBuJ9oRtTCgUB7OCsM1lUg0J6j2hKJLeb3iV8gfkc+oUA2C3QJY4cldkxqvATyrWBJTZo0SWbNmqXXw4EewyVLlmg3Ec0BNqJpOeDZ5sMtDI1P9e/fv1bRqA1jXYVzIUPjWA0Fca5IsbTnn39ePv74Y6wijcEnDQciNFPs3xsSeRdEuA+O5ypLz7rhhht0B8Qnn3yC/dmqzRUSUxh0jx2ZYr8AGo/HI1lZWTrAHkmsAILQgwYN0udgXfUeVjss0ROsHNXmbNmyxR0qAgicO93ChtAUQaoLuIPhgHUVECsIhk8ajqVa7pgxYyzVZN++fRAhdIJMDnO/3IkTJ1oPPvhg8HmQAjJjxoxsdEBITesuW+zEYPzuvGLH1nxCGgUtrNiSEWiTAksLOyFeixcvriFcCxcuNCkO2MQ/6JpfG1g2Vag8Yovo+MBzuJ0HTW8gxHLYsGHayoo3IgXbEbt677338PMx7llDyRk8ePC05557LrjjmWeekVdffbXGieiQwOc5gUjv3r27motvGDJkiBhxw/3WrFnjCzwnXchGQAsrtuQFWk5gWwuYcvWQVmDl5ubqoDuYO3euFiux/xeeK9FLeJyjWpZqVkoXtwwfnKHaGL00lJwult37tqi2VT788EPd8FwQVpN+0NKY9IhwwCIUWwB80jgGYfyhk+9+97taYF566aXgvl/84hfSp29/Wbdhk1x/7ZXB/XCDA728Mm/ePC1Se/fulccff1z/XiFy4NFHH0Wc0lJxyiyJfW9wm4SC1bwYAfMqKyp39uzZWrQQtwqIVTSTHT2qLVbNunKMRx64d44WKYhWbRz61ifLXlsguetWi+nFjAfhiqWrqShCLMpJQYFPevW+RIqK7f1nS8+Ju0eanC69oHtHIwFLCh0DcBNNZn7ocQmxbkn9oWC1DD7VpitLKxeB9cDQHBCtZMf5qs1K62vJvEcWCwSrvuCaRx5cIPd8b5a8/l6OLFo6Vz/f1KlTa7x8zUmMBWvha6+9lonvh0A6rKOVq9+UTind5be/X6hPSEpKluuUVXX3XZOkUyc7yfXgwUKdBtKjR/dgJ4Ny+SQvL08H4wO9voK4GMA24mMKzsLYSBjDajl0AqfqMXQjeXT16tWwvMZK08A9V6rmued7M5VVlV3Dojp02Ceb8rxquT+4L6WzchWHjAlrgcHi+vFPJ+glUi+MC9vc1KOH0CdNG+iMXlPTS6iB0MAiQi/gLbf+D/n5zx7T+8+eLZU33/67vJ/7kUz70RTtHuLZMBBbqscb3er6TIigipGJEkWIVjR+zxcttLBaDvxR5ykLyxOwsPKkaUBpclXLmPfoYrnzu1nBAyWni5Sbt1ByP1ml4lS1fwyuu3PitKBVBotr+aIt8uOHJ+hhL6ClRCvGLAg0S7Ut06ZNc9977736ACyj+++/X1tLZ0vPy4pXV0v/fmny8KwHZNhQe7ps5JIFgEnmNRvK0spSVpepyLFVGLtqErSwWhadCxVYRw/eamk8sKwyQ8Xq9TU58rtnZkvJmSJtPd353WlKuFbD0spz9+w7u2vXnrmD+veS8rLSaiVmcA/EvSBYBojWpq1enZ5RW2pGLEDAHe4XXC6kMCDQjpIyKDGDtIZdu3b5JDqlZCzVCpTFWy2N4sknn5Td+T5JbN9Zjh0+KMntq786yM4/ePAgVtFhki0kJlCwWhZLquIZjU14BOgJzH7kwfk69gRgVUGoEIeCUMFFxDGs35TZDccXWiMyFiRKQsGY0UPF3dV+ORF72bx5s+Tn50taH8Sz5suEGzKD94Ro7S/cpbvwmzMQ/8UXX8i7774rSYnt5X/elikDB1iybXuevLVmlTnFJ9ERLHypk88++6zu7TP88te/kwOFR2TIP98oXaxeNS7qkZoqO99fJx8uWY7NLIl9tv1FCYfmtCxwE7LEftl+K43DUm2ViVkBIyzrNr0rE67PlBeeypUbrrpNWQUddCxq8Sv6o55VFpYvQVyz+vbuoWJEdn0s5GOlp6freuj5+3bJ6nfx3rm0i4jrcZ/X3v6TfP21r9lcQwSxV65cKSOGj5K3Xs2Ve6ZkyU3Xe+SfbrlNzpWVyabNuro0hAYZ6hhM2JRhTLjWs3PnTuuqq67SO15++WXZnLdDRmR6ZMT3bpHUS3rXaNaQwTLKc52cLPxGCnfme6Txv09SC5xIteVBz2BThnTkwm0zYgUgVohVwaWbP29ltUA6gu4BfJFuiLwiiBFcP1hRi5ZmK0vNNhhMzyPcxw0bYlmG3gZJtLCsYFFBrLAEzzy/UC67Kl3++Hy1kBDc65NiW62I5+EgzMOGKut01Zu36p577tFDqZYuXVp0wLdLWVa9I15wodIeFzn4Gl3NlWkLMYJB95ZnlTSeLNWsR2bMD4oS3EAjVk4RMyBJNECdmdYQK4hWTg7iYLOCCadwEWFxISUDwtaQWlYNBZ+BSg6wEhMq7e/42OOztVDBNXzwvplyo7K24B5+fdAnX2zfinVLrVvbduR5xDE8SuyODZ/YwW+vBDo+wnwszkE+nCVVw6GYihAHULBaN3MgHibGhAA7kj7t4HpW2AtKTp80q/UaGgLRQg7WokWLZPbjk+XtZfZ7C0GEJQcrC4mlsQDWFdxBfFbv7pYcK1R+7IsLtVj958Nz5LGfZgfPvWx0hm4QMUPxqSJbyA4oIduRp9a3ZigRy1D7cdIcx0flSPhxiGbbEhIX0CVsvWSpZiF2ZUCSp6JIxbCKICaIV0UDJFRClOBOBj5DW1hoECxYQLHAVKsw4ovv86elC2TksAx56CfZdV7fNdWtra8fqpjXE/MWyA+nZgX3z1CW2WMPZxuBwwEo8TRpJJWVfiGxh4LVepkG98zkS8G6CsSn0E04Vq37pjwwVudeRQMzPAcWHIL6AJYPxMqRqR9VUIwPYmVSK5BLhu/41OMr5fABpTA7RL7xqaDVEZGzp1QcqTzyvWBpPTgzS3UmWPLxP7Zoofp4vVfeerfazydHAqWrQ0lO7iSnC4/J8V2+sO2bHXulcFu+nNz/jSQmtRcSG+gStk4s0dnss4I7ApaPT6q60ycoYVk5e87kjHmP5uj8q4aAYnuhg41vu+02eeWVV7RwQKwglkh9gJVl5gOMFhBBiOGEGyYF90F89Wc6csPOnbGbASN42ndUAqPCau2S7CUmX/3hv07WAfuXXlwpy1YskSd+n63jX3AtwbLlOfLSCv2jw/jLatUUOnToYvW3hsnelR/JXvlI6mKgNVK+yudE07GAgtU60X7MlWPG641AIihWsx3nYAdKCOQ+/mRWRlqfQaFjCsccLfR1c3frJUePHpHSsyXVPgBVQ5GY6Rw/CFFCgB1WFgQL3DlRBeVXPKHFJZrBd2O1maoSu/fm6e8YriPBCSoxh4oYrE/EsX798xzZvdunxeqJefOVW1gl+HAdBylB+81Tcy2xrdRssQPuGefOnV58ofyU/Mejj0pd5G3dKjmLXxQSGyhYrZNJTksj95OVZv/akPNgJWjR0pbWI4u1dRRg1ZmSIkEr/Do/4geZnkKTJHrttdfq2BIy3u041nid9oAM+Whmv+N+6Dww33HTF/ZXw5jHhgLrE8J3x4Rpcsc96ZJ5e5ZM+ZdZ2o3slCpazJRQ6WUAqDFMUgsbGFOI0jD1Gfxd8NVeKTunqzngWp+QqELBap1kOOtZoRSM2N30vjDnQrQmK/dwixItt67GMGOBfvERxF7057l6Of2W+ZLeq7oYHCn2yYr183SZGfQUwsIyorRp69pg4B3CgnhTNAULFpvzO5oOBOe++mAss3n35miRxfpP7pkjxcdFtyMnfPL9H4+VisoLulKDqYvVp08fCwKFbHcMXK4vuAeG9Jw+fRq9IZxqLMpQsFofeGPdxh3ECxkIgq+t47oiJVZuDGQOJpKOsXv7UI3hrU0L5ff3fi6dO1TlPI4aMF6uHjpJHl9+ix74bGrRw/XDy28yAxDHCinl3GRwv/R+Vc+CsZD4nIZiLDNjCYbGwLL+bYJ07NRBMBQnUgnmhoB7YND0M888A7cSOV4cohNF2EvY+rDwj3npHGVittRyTTaue+H3udI52S0n9/rl2M5KOV9albl+5JRP3ty8sMaFOP8/Jr0mCf4Owcx2WB7Oqg/Dh2QEB01HCwhWtQz9RqZobNqaG3QtUVHV5KzZx2yLC+5eNMTKcNdddxlLLUcanmVPaoGC1fqw8I+xNhzCsb+Wa8bjRcVLe2CdLVSJHV1yaGOllJ7wB127HQfCG2m9u1oyYfS9QcFCPAtWnUlviIWFFYrTKmoIyOwPBu7VzwrZ+gZ0VkCoTIG9aII67gFXEgFGS0hUoGC1PrTZYawPx9jAvFrOtzAIuqTQL8kpLul9mUvclr2EtQUgaBCsM+fCC096rwwdV4IwmQA83DSAHkgQzQTScJUgzOc1BCOq4Th0uKBB8amGACFEfXdljVpij2vk+MIoQMFqfbgbGMvR5kVa30FSViLSoUfVgY7dXcrCstfNPc+Uh3/Brd62lQLXz4hJqJsW7Yx3p9jASsK2Q6AbdI9wwgXrK5Zln9PS0uSpp56CeFliW1qkiVCwWh+N/p+68nzkYylduuplJAurc4eu0pxASA4eLAg+s3Hl0MnQEIwlapZO4cJ3Dp18IpqgbDJK1Pzyl7/EpkeqijWSRkLBan34Guga+fAPXtTOvUXOHq4a8wYXsUN3ex0BadA71Qp7k6PF+ja6hzDW8SoAK+7Qt/t1nA0xN1NvPpDCUW/QIWAsQViR1WrZd+lmJoWICUePHtWjBTBlGGJaYiekNnq8IqFgtUqqWQmdgwaXFeF0n2pFyJvq3MelLZYj2yqlyIeeQr90H2IXnd291+5k/OnScfLbVd+TNz9fKNsPeKXgSJ62ugqO2oIGt8/0CJpAeMkZu2RNNDPdYWGdKSuSz79cq0VLirvqcYUYnlNbXCoUCB3cSFxzZYanWu/mlZeP198Fk4DA0kLZZXw/NAxNQl2wplBeXi7Hjx/XPxfU1goE97OENBoKVuvDh39MLMfRexbJVdQnoFQyXtq0qxN07OqCslr6XuHS67BAYLmgp/Daa8dLsX+/LM79d5mz/FYtYPc+3UMWf/Dv+mYYS4gkUf3ZgbgX7ouXMpqCZcYm7lCiiWc9ss0vw5Pu1J+FzPXzpfW7j3El0SM44fpJ1QQPHQ2w2v7whz9oYYFFdPjwYd0KCwvlwIEDsn//fr2OfTgO6xKCVl8xO3XqlD43NTXVpDp4hDQaJo62PvTbpl+6PuJMpkRUPDTA41FtpXop3eZFR432lH4u1apOQkIljiMfK2g1qW1YIyZ9AQFqxHzwgqNIoDNHCrNGR7u+O8QPSaqf5a+WKdfbCapIZP3ncTP1WMZupZfLhFHTJLGjSFJH0UukaiSphvWERHu/ycSHYM+fa8e9zeBt7MfP4/Enp+tcrB49ekjPnj31OVhiLKXZZ7ZBcbFtUaInsFu3bnXOmQihI9GBgtX60KK0e+9WscvLjDf7sZLjOE9PTIEYzvzslcFJUc3MORAmCNErbzwjW/ZslGlTHq2W64Tzwk3Aanrq7hyTFdyHWFMsJqSAlYXyyNsPrJXRA+zveff1j8vGvavl6Xf+VbuqELALQWvLH2hVQLj+edxD8vLaecFKrPg5oAoEfn5wM0f1Hy+LlyxQ931ddu/+BJcZn7Pal4JgDRgwQD/X8OHD9RJuH2Z6rk20YGFB+GI8GexFAX+CrQ+fICb1hVdvOIQlM3DcEjvvJxvF/ZDdDiEylhisqTunD5cH5/yL/K+Hb5J3PlohyR06St6eT2Vj4J61YeprGTEzllgspv0y5ZdXrKsqeY/M+7l3vy9W7zHabZ3x3GBZ/Om/yxs7npId33rl0Kk91e5ReUHk9stnSid13f97Vn33a2bKzVdP0tVSX19jj5pJrnRLr66W6SH1iV1eppvYs0phJh4MIJ+uYlwLd+/e7V29enURpv2CVYZZoo3FFQkE3jG5BwWr6XDWnNbJSCUUGffcNUtvoOdr01YvAkhwCxcpEbN++/OXBccx0w2YPWcyEi9hnV2XkNCuOLFjR5/fX+k7c7p4RPfubqnwV8jaT9+RXt3TJL3/8IgfvOjP2eI7sNt2LZVYrvtsjazxviI33nhj1K0svOho6ze/r4VqWNq1ej/GO04cc7/u0Tx25oCUuook/9insvXQ3+XT/a/JP/Y8L19+u1b2HN0gR0771Hc7r8Xik+2vii/fJ/ff/KKyjMrk6eWztbX10ru/lbyCNXK+QueRQR3fdTwGVMwntmWL/VA5zIizVgmYZ+PGje7rrrtOUlJSatQPM+CzcQwTsWJORWnapCMXNRSs1olbiU+mGcgL1yYwddcIuDy//fkrujvfgHpQgVlvfqBaXmVlhffksW9WF5048qkSrFnDhqTLqJHDpPz8ecld/45YSrD6hUlORXD+VwtnBGaHztL7Fr/yhBw+vl8X94sF/fv317WxvHnL9RCh9N5V3wvrnu/cKxfOXZB3NyxSwfDTq7p06fafyjA6fLr82LmjZ3zur45v7gAhO3G+UNzde8uRswWybu9fJWPIRLlt7APi8ifIkeL9TrF6op6P5lNt7fnz5x9AvhUsTEz0Gg70OKIXEtYYpr0XClajoY3aOoFfplMVgDPeBDFxBsRBoBqpVxxTqAfw4T4nTpxQFkA7GZLeX7p07ih/UFbUkePf1PhQuJP6MyZWpRLhGWI9CzRK2yDNAXErNKRaACxfzJ2t9+G7nD1dMn3fnrxV+3ZvnrV315YJe3du6XbhXKVy7SonuFyVs1yudgs7dursLU88U/Tmjv+Wv2x+TNblr5CzZUVmfshsaRh6Fp6vv/46ZnXtSXUYdG+d6OmpVG+Zx1T+tGex8crjv5uup8QymIoEUj0g7yRPCZYHKxCtUSMvlc/zdskf/jJH5s58LngSrCtYaWagNDB15P9p4r0SSxDHQhFBBOBz85ZI7o6wFVtQaqJGgpbPl4d9XgkR6/7WEE95WZm7rKzUJ5HHYdaHvGPHjlmwokjsoUvYetlfXn4uK61Punb/7F6/Yh1PSuubHqxQgC78bTs34KX9QYT7jFXuyrUul0sPJYFoIeaye99uGTX0SundI02fNOX+sXrwMcTQWHCIi0lChdxxxx2C62MJYkDolbvssst0OgGedejQodrdQq6TYobUc+oycKrohIrfnUJCWVPr4tyuYncZ119/fZ0xPMSwPvvsM6zSJWwkdAlbL14046YBWFkQLkx6aoaj2IX2arUg9CwPmzdvli1b7Gz3/mm9tHCtePtZvQ2X0q6nPieY+mCsK5RMjrVYOUGcaNy4cbohmRPJnWJbjz5pIZSFVa/zIFjSNGvuooeC1bqZC9Ewddph+SA5EqkGZl7CwFCUSNVI4U9at956q96AaL399ttSUlIifXp1F9/BPVqsIIqw4pwTQOicLtUzdvnll0tzAWvK7/cLYkZLly6VHTt2mEMtabHAJdTPVBtLliwxAfcFQhpN8/3XSGIFMtkzUfo4aP28l6OztzHOMDBQerrUjGHh5FwlVhZKH//sZz+Tbdu2SXJyspSVlcklaf2ltLRcik4e0fc1+VzAiFhmZqaMHj1akpKSpF27dtLYOA6uxT0wU09FRUXYcyBUe/bs0WkBsKrMc4otVtnScsAPRNAwA2MF0TmARFLDmTNndO9gwLpq6Wdt9VCwWh5L7D9605xxGJMDVFtsBtcUqJiVe/mzVVWSjWgFwP/qoRMi5Kg27YUXXtAv2JEjR+Shhx7SQ1C6d+8edA9Npnxw9hrlYsJ6GzVqlEyYMEGfj5gSrC1kdEO0IDqRxAvHSkvt1HSMr+vcuXPwGAQIPZZO0PuG6ep37typx/V17dpVfzasq+LiYpiPYyU+yBLbvbak5rhOPCfMYK+QJkHBal4ssf+oERH3SP1L5+peQdXw33RBYOl1HPeolouUhnmPLg7uhEuICSYC8Sz8ky1V7mHBD37wA/nhD38YPB+z47z//vvBbWTKww0MVjfF/ZRYlZw9Lnfffbf07t1bWzqwkJDJDSsJwXFsR0qihGBBHAF6/3CeETjj8mGAMQZYo6GaAkQLQ2IwIw2WmBAjPz8fP5Oxwqm0LiooWLEHbzsSlzIlMFIfLzp6u7CEdYMlLA1jbeCFxksKKwIWBwLNiJGgDApcjABGxJCTtTZw/zkQGJPqYID7hpQER4VQXOu+8sortcWCe8IdNPdG2oKZ2dlgxMpUiYB1hIqayMGCG4TWmGoNECeIklkiSdTU28K90TOIBjEEn3/+uXzwwQdYzRLOSHPRQcGKHRAqzE03C+vI2EY3POa5w4uO7brK8yI7etOmTfrFNcmZRlxMg4gF8AU+040p7DF0JhT07KGMjCMYr9GzyvSx9EBqlFwJHfSMKp96aI+yrBCgx3OhGYExQLDQtW+W+ofg6Oo3QoSlKdNiEi5xjRE+832xD1ZXIFalx+w995zODcsROy5HLjIoWLEB1g4Uw4Ibc80118jIkSP1AVMAz0ztbgb4RgJuEXqhMFYvFIgGrA0EqxHj+fTTT4PHIEDImaptthlYSwjMh2bGO0EPJNIkEKNCvhXiVbCuYJkZjIXkbEaMQjPAIWBOUUODSEXKYUJRPbiJAGKlRMsn9mBkn8Qvltg13CGqTGOIIhSs6AOhmoXeM8SH4PqFAy85eo8Qw6lNtHAeRAvuW+jceRAGBKRxPV54uJKwuv7xj3/I9u3b9TmIaznzp+oLguvoDcRy0KBBcvPNN+s4Feo/RXMOv9qAEKN8C0BKwLp167CaJfHvCuaIHQbwii2uJEpQsKIHTAT8r+oJDWZHAhYSBAcCANEJR6goOTl48KAWvXBiBvF66aWXgkF0e8DytLA1rgywuHI/Xq3cxlUm4VRbVkhfMOVREHOLFFCPJrCqYF0BhyuInrZZEt9YqhUkpaTK+RKdgQ/B8gqJChSs6AGxykROk0nErA9GdBBYDhfTqk2wanMXAdyx9957T5YvX26Gr2gwbAcWl7P3T7dAQB3WITLYER+D4CGNANsAwuXMM4oViFshfoXvgCTRgCuIXsF6D79pIXJUmzZx1fvywY8mQ7Rag8i2Gjj4OTqgWy7zxz/+cYPECiD4DtFB8Lqhc+RBzExJ33DgnnANIVZw6SBsEKGvvvpKjhbvlR35dnoBeilHjh4s466+TD/PLbfcoq9BjlZCQjvdWwm3EOP34KLB4nHGsKINrCuTxwU3MFAgD5ZKvIuVpdq09MlTpNvI0dLn6hvk4PvvwDXMlvh/9lYBBavpWKpl33nnnTJpkh6WF6x/hGZePLhsiFOFi/9AJCAszlmVDWbevNDrTOA+kmBBrF577TVZv369DpaPHTtWPwumnIp0DY5jOnqIxLJlyyQxqb30GzhMCr/eIx9++KFMmTJFnwdXLdaCBZDKgTQGsTPEfRL/ePDP6H97RG8My/oJBAu/0CzhkJyoQMFqOtmwUCBYEBC4eBCTSJneZnIFpzUF9wdWDEbyw4JB6gIG9gKTiImgc3p6ulx66aU6eRLDU3CvcOIDsUL8CmIFi2/GjBn62SCKaOFiXuazkHaBYTrHj5+QAekjJUmJVmrXHnLiWFV9rFiXUjGC5SBHWgdzel99vXTuN0BvmPUzhQfwPxkFKwpQsJqGpdo0BNjRo4WcKQAxMkNWTIDambtksriNBQEXDcD9SkpK1pZNQju78k/l2XKprER2+HFt/Rh69eold911lxY2Z0wpVKwQUwMmhQLPiJgYRCtcz+Sbb76pZ3m5pP+lWqxagjCC1RpAr4mV/r2p1XamT54q25/+nUdqDrsijYCC1TSQb6WzsBE4h0jBQgknBBAvNIjZihUrdINl1bFTivTs3V86p7jrJRBl50ql9GyJEr9iWbRokd4HYULPJGJhf/3rX7UIIg5lxMpgUiggWEa0nD1+b769RvK277Ofp4tbWopWKlj6bwFWlZPe16jtp/VqltDKajIUrKYxHu4gBv06s9Fr4+WXX9YWEISq38BBatmwnCbMcIOG+uTnz5drVw09eRisDNcR1tFNN92kY1awtkKfCWKKHkkIFo5DYM1zrfjr38QaPFrfuyVp6ozLLcR498hRQXfQAAELpDiMEdJkKFhNw0LWN156BM7rAtUGIFawXuBy1YnLXySVKtic4PJhTHC1Q+K3khKT3H0uGZTRLiFBTpw4qsci/vrXv9bJqnA5zbCZUNFCYB/Pi3gbLL433nhDPxficAMGDZE1f/cKaTAZ6BUMR6C30COkyVCwmoa7X79+tYoVAtQQBrSNGzfqfT371CJuECm/a6GyM7x7d+Z5pXY8YqdUeJA7BRfQxLPMVO8QLbh9oc8IEUM87fnnn9fDe+BW3nfffVJaek4+/HiDXrYUrdAltFRzdwqxrgyd+g8w55AmQsFqIrVlfSOmBEsHogWrRgfhk9pHjlW5ZNWFUv90n29LXcFZj9gxkWko74JewHD5XxAt9A5CtMznO58b4w+NWJl4V8eOHeTmG6+lldUI2ivXr479DLw3EQpW0yhylHupBkTCCAWsGSyPHz8uF1Tc6VTxcZ0qEMLcvTs3Z0tk8MeOwC4SET1w/xBYR0InWiRgeaFn0IxHNCBm9frrr1cTK8P4m66jYDUMLULlJafqdR5pPBSsprF227ZtNQYBwv0zmevGNQMQB4gE0hjQ0wfRQvBdOUA5+3bVECtL7K5yqFFmYN2NXCwMk0GSKkTLCCOsOOdnGcxsMwiywwXEMyGDffXq1TpmNX369GANKlNdQZd66dNTvj1cv8kVYk3ffoPHd0hJEd+uPJ/EJ7oybOE/3rGGT/tJjYNHNupB2z4hTYaC1TRWKQtrJiokmKoMJnkUFlU4AVm4cKE8+eSTOp5VWGyXA05IaBcs7hfAcl4DkYLQ3H777br3z4kJqJtYlen1c2LKuCD14k9/+pPO5/r+978vmJoqMHW6dhdN2Rfki40aOTRuBEv1iuYkSoIMGTHOC3GvkIq1cSheC5Uwzf/0sYdkmBItDM05f+qUbHv6d0awWGwwClCwmgZqHRUp98ptBAvCAdGKVH0Bca2rr75aJ30iBQHW1pEjR9wnT550o1QwcrlMJVIIFZYIQsNCijSdllO0IDjhOgE6deoky//2phwq/Fp+9KMfycCBA7Ww4lxcHxqLgyu5ZetOOXEynrwYv0f9BDwQr8EjrlDCVTk3joQLOVbugpXL56gWeswrnHwiKlCwmgbe5oXKwppjrCwzIDlSfSsIFo4NHjxYN1MFwVRtwHa4ayEqOG5EJtxxfLZxRZ0CBIsK9dqTO6ZK956XyIVKl3Yhw1WAcHLVlRlxG8tSwpWlhCsrzoQrW+xhRBiK0y2wzyssLxM1OC9h08H/rD7EhUwMqDYRgLsVbhyfGVuIOFM4IFIQQgiSGRAdinFBIWwAHQJ4rl/96ldS6U+QlECgf8eXe1Wg3qpzpuIhg9Ml3gkIV8GQEVfMkfjAJ3bdruxA8wqJGhSsplPUOcU9F67dH//4R72jtoqckQQLFhEExNQ9D0eoIIVi3EGIHjLfMW0XguvIXO83cGgwneJs6TkpKi6pcb2pP2UYMtiS7t3cOhWjOWlkpnv2kJFXzBfSpqFLGAUu6XephSEyyGmqLX5VF7CgIEbhyswA0+OHiguRXEOUMM7JydHjCU15mHDDf5AcetnokcHEVlOuxgBRxf0HK9E6HJiWK+7xy6yhI65w5+/azAkq2igUrCiB2BBALSm86AhshwNWUOjEDAa4hXD5TC9jOCBqOIbzQmNlSJnAEBu4gngeWFaoABGOwkPfamsP4mfcWDw3RBHbZm7A0rNntGWW2EKVGxqK6kXMGjL8iq17d2/mQOM2CAUrGrhU8N1fJVqoxOD1evW4vtBywrUJlhlCY3oaIwXuYWUhGRTnYR2DnyFUqOOOvK5Bg0fXWfkBQ2/Wrd8gqSldItbHQgdBWfkF2f5lvh5wjVpdKJHcXJgJKBoB4lkUrDYIY1hRwF/h8pl1iFbvSwbpdACUTEbvnCnGB0ycKlIRPGPlwLqJhCnct3LlSpk6dar+jJLTpdr9c8aq6qK83O4pjBRzw2eMHWu7twkJiTpTvznJz8+vfShTJFziHjq0kX45iWtoYUWBivIKb2LHBFhZ2o8zGeym9AsastzRUC0UIGYULgYFsYqUwgBXD1N4Yf5BpFEAu0zNsAaXqQGwzuqarbl3L7uiKUQDn4sZdJoD1HGHu5pScwhTvfC3k5Yr6EViBgUrCvh8eUWqWx1d2cGudbzgfZSlBYsLwrX2w4+0cGE4DSZzwMSq1113nd6G22imqQcInKOnDOKE8jWoTAqBOhIIficmJdcZowril9mudpVevz8h1wiqobS0VNZ+tF72feWTwsJvgxUaund3S7+0vjJ61AgdmAcQxMKv83VOl8kdixUobIiZfmBdGTe7obgqOG6vLcJpvqKEZWW4E5NdueJyRXRFzpQUq0B3kZSfK1Uv5VmpLxAlWFIQjfpWJvWL3+cS//S9u+wSNYNHXFHgilDiZED/NOnatYuKZ6Xo7aPHjqueweNy6lSJTmsw2e4QXjRM+4WhPbEA7jIGZsONbqzliO++b9eW+E8iIw2GghVFrBEZVqLftbI20TKgTjvKHVdWVEiFWr9wvix4DAKV0C5RkpM7SpKewLSd1JtAPa0L5yoXwPIzu5UFWKPI1NDBltw20SMdkpPD3mr7l7vlk/Wfa+EyGNFCLM7j8TQ6hSMUdDLAekMrLz8vfdIGNaFMc+UEI9SkbUHBigFDhmfM8rtcM13isqS5iCBUQAupJBQ49yUnt5eHHqw7XWnvXp+sfGNNtX0ozYypv1AqxwzyhnA1dF5FiJSZlANjJbENSxKdFk2YAGPu3l21lukhrRgKVgwZPCIjy+VKmIRBu0pMoh4Ehuuj7rva5apcVZtFEU6wQOadE7WVFYlzKpb07pq1kr+vIOxx1PUqKT6hS+UAXZZGiZapDoFtZ1DfDF2C2wehMiVtjMuLmFxjXMAgKl7H/Ku2DQWrmRgyIsPjcsmYysqEdJfLP0b5Z1a9LTBlPaGmu8vlyvNXyn5xVeZViHjrO+BXx9c6KsHy1+w5w/CboUMs6dWzhxIX2zUsLi6RAwe/kc1btmnRqgu4t6VnTqugfYl2c2GBOV1cJ6HuLtw+5Hg1yO0NAcKdkOCfnP9lXp6QNg0Fq4WBmEgHcSeGBMQvmIJvyiAJdfEaA9xUcSU061g7CBlK5hgwq09ThKkGepIO11xaVRcPFKyLCLiGSS6Z5Pe7MrW1VY/OgfjE71VW6qrzpbIkGmJOWg8UrIscY+FV26msOuxTtpBHua3T1J+JR1oavx8VDFfr2YTYA3jRQsEidQJRa9dePMql9CD+1iwCpgRK9bSqmFTl2opzsoqWFAEULNIohn4nI6Pyguo4SEjIUB0CblvIdLUES3UuuOvqFdWJrZgcNjBJrPpD3O+XShU8l7zzZzGumwJFCGkBEDsTQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIQ3l/wMvNv557ac0YgAAAABJRU5ErkJggg=="}))));function kS(e){var{sx:t}=e,n=Nn(e,["sx"]);return Os.jsx(z,{...n,sx:Object.assign(Object.assign({},t),{display:"flex",flexDirection:"column",overflow:"hidden"})})}function CS({params:t,scrollRef:i,tokenAndPoolFilter:o,operatePMMPoolElement:a,operatePool:s,onOperatePool:l,getMigrationPairAndMining:d}){var c,u,p;const{isMobile:h}=wy(),m=g(),y=pf((e=>e.noDocumentLink)),x=at.useRef(null),{account:v}=At(),{poolTab:b,tabs:A,handleChangePoolTab:w}=function({account:e,paramsTab:t}){const{i18n:r}=n(),[i,o]=at.useState(cS.addLiquidity),{supportAMMV2:a,supportAMMV3:s,notSupportPMM:l}=pf(),d=at.useMemo((()=>{const e=[{key:cS.addLiquidity,value:r._({id:"OBdohg",message:"Add Liquidity"})},{key:cS.myLiquidity,value:r._({id:"YHc3B+",message:"My Liquidity"})}];return l||e.push({key:cS.myCreated,value:a||s?r._({id:"zcVtwU",message:"My Pools (PMM)"}):r._({id:"fZFkP1",message:"My Pools"})}),e}),[r._,a,s,l]),c=at.useRef(!1);at.useEffect((()=>{const t=sessionStorage.getItem(lS);e&&t&&!c.current&&(c.current=!0,o(t))}),[e]);const u=e=>{o(e),sessionStorage.setItem(lS,e)};return at.useEffect((()=>{t&&u(t)}),[t]),{poolTab:i,tabs:d,handleChangePoolTab:u}}({account:v,paramsTab:null==t?void 0:t.tab}),{activeChainId:k,filterChainIds:j,handleChangeActiveChainId:T}=function(){const{chainId:e}=At(),{onlyChainId:t,defaultChainId:n}=pf(),[r,i]=at.useState(t),o=at.useMemo((()=>void 0!==r?[r]:$g(e)?void 0:Object.values(oe).filter((e=>!!Number(e)))),[e,r]);return at.useEffect((()=>{const e=Number(sessionStorage.getItem(dS));e&&i(e)}),[]),at.useEffect((()=>{!sessionStorage.getItem(dS)&&n&&i(n)}),[n]),{activeChainId:r,filterChainIds:o,handleChangeActiveChainId:e=>{void 0===e?sessionStorage.removeItem(dS):sessionStorage.setItem(dS,String(e)),i(e)}}}(),[E,S]=at.useState(s||null),I=e=>{if(l){if(l(e))return}S(e)};return at.useEffect((()=>{S(s||null)}),[s]),Os.jsxs(xw,{sx:Object.assign({},h?{p:20}:{display:"flex",gap:12,flex:1}),ref:x,children:[Os.jsxs(H,{value:b,onChange:(e,t)=>{w(t)},sx:h?{}:{display:"flex",flexDirection:"column",borderRadius:16,backgroundColor:"background.paper",flex:1,overflow:"hidden",height:"max-content",maxHeight:"100%"},className:h?void 0:"gradient-card-border",children:[Os.jsxs(f,{sx:Object.assign({},h?Object.assign({},!v&&{pb:20,display:"flex",justifyContent:"space-between",borderStyle:"solid",borderWidth:"0 0 1px"}):{display:"flex",justifyContent:"space-between",p:20,borderBottomWidth:1}),children:[v?Os.jsx(_,{tabs:A,variant:"rounded",tabsListSx:Object.assign({justifyContent:"space-between"},h?{mb:16}:{borderBottomWidth:0}),tabSx:h?void 0:{mb:0}}):Os.jsxs(f,{sx:{display:"flex",alignItems:"center",fontWeight:600},children:[h?"":Os.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,backgroundColor:C(m.palette.secondary.main,.3),borderRadius:6,mr:4,color:"warning.main"},children:Os.jsx(f,{component:As.Fee,sx:{width:16,height:16}})}),Os.jsx(e,{id:"OBdohg",message:"Add Liquidity"})]}),Os.jsx(sS,{})]}),Os.jsx(kS,{value:cS.addLiquidity,sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:Os.jsx(oS,{account:v,filterChainIds:j,scrollParentRef:null!=i?i:x,activeChainId:k,handleChangeActiveChainId:T,operatePool:E,setOperatePool:I,tokenAndPoolFilter:o,getMigrationPairAndMining:d})}),Os.jsx(kS,{value:cS.myLiquidity,children:Os.jsx(xS,{account:v,filterChainIds:j,activeChainId:k,handleChangeActiveChainId:T,operatePool:E,setOperatePool:I,tokenAndPoolFilter:o,getMigrationPairAndMining:d})}),Os.jsx(kS,{value:cS.myCreated,children:Os.jsx(mS,{account:v,filterChainIds:j,activeChainId:k,handleChangeActiveChainId:T,operatePool:E,setOperatePool:I})})]}),Os.jsxs(f,{sx:{position:"relative",width:h?"100%":y&&!E?"auto":375},children:[!y&&Os.jsx(gw,{title:r._({id:"6y2TB3",message:"Liquidity"}),desc:r._({id:"QNrpkx",message:"Classical AMM-like pool. Suitable for most assets."}),linkTo:"https://docs.dodoex.io/product/tutorial/how-to-provide-liquidity",LeftImage:wS,sx:Object.assign(Object.assign({},h&&{mt:20}),!!E&&{display:"none"})}),"AMMV3"===(null===(c=null==E?void 0:E.pool)||void 0===c?void 0:c.type)&&E.pool.chainId?b===cS.myLiquidity&&(null===(p=null===(u=E.pool.liquidityPositions)||void 0===u?void 0:u[0])||void 0===p?void 0:p.tokenId)?Os.jsx(rT,{baseToken:E.pool.baseToken,quoteToken:E.pool.quoteToken,feeAmount:Number(E.pool.lpFeeRate),tokenId:E.pool.liquidityPositions[0].tokenId,chainId:E.pool.chainId,onClose:()=>I(null)}):Os.jsx(lT,{chainId:E.pool.chainId,baseToken:E.pool.baseToken,quoteToken:E.pool.quoteToken,feeAmount:Number(E.pool.lpFeeRate),onClose:()=>I(null),handleGoToAddLiquidityV3:e=>{fw.getState().push({type:pw.createPoolAMMV3,params:e})}}):Os.jsx(Os.Fragment,{children:null!=a?a:Os.jsx(Os.Fragment,{children:h?Os.jsx(wE,{account:v,onClose:()=>I(null),modal:h,...E}):Os.jsx(f,{sx:{position:"absolute",top:E?0:"100%",height:E?"max-content":0,transition:`all ${my}ms`,zIndex:20,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",borderRadius:16,maxHeight:"max-content"},children:Os.jsx(AE,{account:v,onClose:()=>I(null),...E,sx:{width:375,height:"max-content",backgroundColor:"background.paper",borderRadius:16,overflow:"hidden"}})})})})]})]})}function jS({sx:t,onClick:n}){const r=g();return Os.jsxs(I,{onClick:()=>{n?n():fw.getState().back()},sx:u({display:"inline-flex",alignItems:"center",cursor:"pointer","& > svg":{mr:10}},t),children:[Os.jsx(f,{sx:{color:r.palette.text.secondary,width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",borderColor:r.palette.border.main,borderStyle:"solid",borderWidth:1,borderRadius:"50%",backgroundColor:r.palette.background.paper,mr:6},children:Os.jsx(As.ArrowBack,{})}),Os.jsx(e,{id:"CKyk7Q",message:"Go back"})]})}var TS,ES,SS,IS,RS,LS,MS,OS,BS,PS,DS,NS,FS;function WS(){return WS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},WS.apply(null,arguments)}const VS=e=>ot.createElement("svg",WS({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),TS||(TS=ot.createElement("rect",{x:28.5,y:214,width:40,height:6,fill:"url(#paint0_linear_5229_28889)"})),ES||(ES=ot.createElement("rect",{x:88.5,y:208,width:40,height:12,fill:"url(#paint1_linear_5229_28889)"})),SS||(SS=ot.createElement("rect",{x:148.5,y:201,width:40,height:19,fill:"url(#paint2_linear_5229_28889)"})),IS||(IS=ot.createElement("rect",{x:208.5,y:188,width:40,height:32,fill:"url(#paint3_linear_5229_28889)"})),RS||(RS=ot.createElement("rect",{x:268.5,y:170,width:40,height:50,fill:"url(#paint4_linear_5229_28889)"})),LS||(LS=ot.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint5_linear_5229_28889)"})),MS||(MS=ot.createElement("rect",{width:40,height:6,transform:"matrix(-1 0 0 1 708.5 214)",fill:"url(#paint6_linear_5229_28889)"})),OS||(OS=ot.createElement("rect",{width:40,height:12,transform:"matrix(-1 0 0 1 648.5 208)",fill:"url(#paint7_linear_5229_28889)"})),BS||(BS=ot.createElement("rect",{width:40,height:19,transform:"matrix(-1 0 0 1 588.5 201)",fill:"url(#paint8_linear_5229_28889)"})),PS||(PS=ot.createElement("rect",{width:40,height:32,transform:"matrix(-1 0 0 1 528.5 188)",fill:"url(#paint9_linear_5229_28889)"})),DS||(DS=ot.createElement("rect",{width:40,height:50,transform:"matrix(-1 0 0 1 468.5 170)",fill:"url(#paint10_linear_5229_28889)"})),NS||(NS=ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint11_linear_5229_28889)"})),FS||(FS=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_5229_28889",x1:48.5,y1:214,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint1_linear_5229_28889",x1:108.5,y1:208,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint2_linear_5229_28889",x1:168.5,y1:201,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint3_linear_5229_28889",x1:228.5,y1:188,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint4_linear_5229_28889",x1:288.5,y1:170,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint5_linear_5229_28889",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint6_linear_5229_28889",x1:20,y1:0,x2:20,y2:6,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint7_linear_5229_28889",x1:20,y1:0,x2:20,y2:12,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint8_linear_5229_28889",x1:20,y1:0,x2:20,y2:19,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint9_linear_5229_28889",x1:20,y1:0,x2:20,y2:32,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint10_linear_5229_28889",x1:20,y1:0,x2:20,y2:50,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint11_linear_5229_28889",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})))));var US,HS,qS,ZS,zS,QS,GS,YS,XS,JS,KS,_S,$S;function eI(){return eI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eI.apply(null,arguments)}const tI=e=>ot.createElement("svg",eI({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),US||(US=ot.createElement("rect",{x:28.5,y:214,width:40,height:6,fill:"url(#paint0_linear_3900_354238)"})),HS||(HS=ot.createElement("rect",{x:88.5,y:208,width:40,height:12,fill:"url(#paint1_linear_3900_354238)"})),qS||(qS=ot.createElement("rect",{x:148.5,y:201,width:40,height:19,fill:"url(#paint2_linear_3900_354238)"})),ZS||(ZS=ot.createElement("rect",{x:208.5,y:188,width:40,height:32,fill:"url(#paint3_linear_3900_354238)"})),zS||(zS=ot.createElement("rect",{x:268.5,y:170,width:40,height:50,fill:"url(#paint4_linear_3900_354238)"})),QS||(QS=ot.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint5_linear_3900_354238)"})),GS||(GS=ot.createElement("rect",{width:40,height:6,transform:"matrix(-1 0 0 1 708.5 214)",fill:"url(#paint6_linear_3900_354238)"})),YS||(YS=ot.createElement("rect",{width:40,height:12,transform:"matrix(-1 0 0 1 648.5 208)",fill:"url(#paint7_linear_3900_354238)"})),XS||(XS=ot.createElement("rect",{width:40,height:19,transform:"matrix(-1 0 0 1 588.5 201)",fill:"url(#paint8_linear_3900_354238)"})),JS||(JS=ot.createElement("rect",{width:40,height:32,transform:"matrix(-1 0 0 1 528.5 188)",fill:"url(#paint9_linear_3900_354238)"})),KS||(KS=ot.createElement("rect",{width:40,height:50,transform:"matrix(-1 0 0 1 468.5 170)",fill:"url(#paint10_linear_3900_354238)"})),_S||(_S=ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint11_linear_3900_354238)"})),$S||($S=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_3900_354238",x1:48.5,y1:214,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint1_linear_3900_354238",x1:108.5,y1:208,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint2_linear_3900_354238",x1:168.5,y1:201,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint3_linear_3900_354238",x1:228.5,y1:188,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint4_linear_3900_354238",x1:288.5,y1:170,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint5_linear_3900_354238",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint6_linear_3900_354238",x1:20,y1:0,x2:20,y2:6,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint7_linear_3900_354238",x1:20,y1:0,x2:20,y2:12,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint8_linear_3900_354238",x1:20,y1:0,x2:20,y2:19,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint9_linear_3900_354238",x1:20,y1:0,x2:20,y2:32,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint10_linear_3900_354238",x1:20,y1:0,x2:20,y2:50,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint11_linear_3900_354238",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})))));var nI,rI,iI,oI,aI,sI,lI,dI,cI,uI,pI,hI,mI,fI;function gI(){return gI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gI.apply(null,arguments)}const yI=e=>ot.createElement("svg",gI({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),nI||(nI=ot.createElement("g",{clipPath:"url(#clip0_5057_344879)"},ot.createElement("rect",{x:-10.5,y:160,width:40,height:60,fill:"url(#paint0_linear_5057_344879)"}),ot.createElement("rect",{x:49.5,y:120,width:40,height:100,fill:"url(#paint1_linear_5057_344879)"}),ot.createElement("rect",{x:109.5,y:60,width:40,height:160,fill:"url(#paint2_linear_5057_344879)"}),ot.createElement("rect",{x:169.5,width:40,height:220,fill:"url(#paint3_linear_5057_344879)"}),ot.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 549.5 200)",fill:"url(#paint4_linear_5057_344879)"}),ot.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 489.5 180)",fill:"url(#paint5_linear_5057_344879)"}),ot.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 429.5 160)",fill:"url(#paint6_linear_5057_344879)"}),ot.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 369.5 120)",fill:"url(#paint7_linear_5057_344879)"}),ot.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 309.5 60)",fill:"url(#paint8_linear_5057_344879)"}),ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 249.5 0)",fill:"url(#paint9_linear_5057_344879)"}))),rI||(rI=ot.createElement("rect",{x:28.5,y:200,width:40,height:20,fill:"url(#paint10_linear_5057_344879)"})),iI||(iI=ot.createElement("rect",{x:88.5,y:180,width:40,height:40,fill:"url(#paint11_linear_5057_344879)"})),oI||(oI=ot.createElement("rect",{x:148.5,y:160,width:40,height:60,fill:"url(#paint12_linear_5057_344879)"})),aI||(aI=ot.createElement("rect",{x:208.5,y:120,width:40,height:100,fill:"url(#paint13_linear_5057_344879)"})),sI||(sI=ot.createElement("rect",{x:268.5,y:60,width:40,height:160,fill:"url(#paint14_linear_5057_344879)"})),lI||(lI=ot.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint15_linear_5057_344879)"})),dI||(dI=ot.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint16_linear_5057_344879)"})),cI||(cI=ot.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint17_linear_5057_344879)"})),uI||(uI=ot.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint18_linear_5057_344879)"})),pI||(pI=ot.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint19_linear_5057_344879)"})),hI||(hI=ot.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint20_linear_5057_344879)"})),mI||(mI=ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint21_linear_5057_344879)"})),fI||(fI=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_5057_344879",x1:9.5,y1:160,x2:9.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint1_linear_5057_344879",x1:69.5,y1:120,x2:69.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint2_linear_5057_344879",x1:129.5,y1:60,x2:129.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint3_linear_5057_344879",x1:189.5,y1:0,x2:189.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint4_linear_5057_344879",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint5_linear_5057_344879",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint6_linear_5057_344879",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint7_linear_5057_344879",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint8_linear_5057_344879",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint9_linear_5057_344879",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint10_linear_5057_344879",x1:48.5,y1:200,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint11_linear_5057_344879",x1:108.5,y1:180,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint12_linear_5057_344879",x1:168.5,y1:160,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint13_linear_5057_344879",x1:228.5,y1:120,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint14_linear_5057_344879",x1:288.5,y1:60,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint15_linear_5057_344879",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint16_linear_5057_344879",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint17_linear_5057_344879",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint18_linear_5057_344879",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint19_linear_5057_344879",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint20_linear_5057_344879",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint21_linear_5057_344879",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("clipPath",{id:"clip0_5057_344879"},ot.createElement("rect",{width:737,height:220,fill:"white"})))));var xI,vI,bI,AI,wI,kI,CI,jI,TI,EI,SI,II,RI,LI;function MI(){return MI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MI.apply(null,arguments)}const OI=e=>ot.createElement("svg",MI({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),xI||(xI=ot.createElement("g",{clipPath:"url(#clip0_5057_344817)"},ot.createElement("rect",{x:-10.5,y:160,width:40,height:60,fill:"url(#paint0_linear_5057_344817)"}),ot.createElement("rect",{x:49.5,y:120,width:40,height:100,fill:"url(#paint1_linear_5057_344817)"}),ot.createElement("rect",{x:109.5,y:60,width:40,height:160,fill:"url(#paint2_linear_5057_344817)"}),ot.createElement("rect",{x:169.5,width:40,height:220,fill:"url(#paint3_linear_5057_344817)"}),ot.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 549.5 200)",fill:"url(#paint4_linear_5057_344817)"}),ot.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 489.5 180)",fill:"url(#paint5_linear_5057_344817)"}),ot.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 429.5 160)",fill:"url(#paint6_linear_5057_344817)"}),ot.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 369.5 120)",fill:"url(#paint7_linear_5057_344817)"}),ot.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 309.5 60)",fill:"url(#paint8_linear_5057_344817)"}),ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 249.5 0)",fill:"url(#paint9_linear_5057_344817)"}))),vI||(vI=ot.createElement("rect",{x:28.5,y:200,width:40,height:20,fill:"url(#paint10_linear_5057_344817)"})),bI||(bI=ot.createElement("rect",{x:88.5,y:180,width:40,height:40,fill:"url(#paint11_linear_5057_344817)"})),AI||(AI=ot.createElement("rect",{x:148.5,y:160,width:40,height:60,fill:"url(#paint12_linear_5057_344817)"})),wI||(wI=ot.createElement("rect",{x:208.5,y:120,width:40,height:100,fill:"url(#paint13_linear_5057_344817)"})),kI||(kI=ot.createElement("rect",{x:268.5,y:60,width:40,height:160,fill:"url(#paint14_linear_5057_344817)"})),CI||(CI=ot.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint15_linear_5057_344817)"})),jI||(jI=ot.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint16_linear_5057_344817)"})),TI||(TI=ot.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint17_linear_5057_344817)"})),EI||(EI=ot.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint18_linear_5057_344817)"})),SI||(SI=ot.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint19_linear_5057_344817)"})),II||(II=ot.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint20_linear_5057_344817)"})),RI||(RI=ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint21_linear_5057_344817)"})),LI||(LI=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_5057_344817",x1:9.5,y1:160,x2:9.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint1_linear_5057_344817",x1:69.5,y1:120,x2:69.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint2_linear_5057_344817",x1:129.5,y1:60,x2:129.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint3_linear_5057_344817",x1:189.5,y1:0,x2:189.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint4_linear_5057_344817",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint5_linear_5057_344817",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint6_linear_5057_344817",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint7_linear_5057_344817",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint8_linear_5057_344817",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint9_linear_5057_344817",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint10_linear_5057_344817",x1:48.5,y1:200,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint11_linear_5057_344817",x1:108.5,y1:180,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint12_linear_5057_344817",x1:168.5,y1:160,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint13_linear_5057_344817",x1:228.5,y1:120,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint14_linear_5057_344817",x1:288.5,y1:60,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint15_linear_5057_344817",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint16_linear_5057_344817",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint17_linear_5057_344817",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint18_linear_5057_344817",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint19_linear_5057_344817",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint20_linear_5057_344817",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint21_linear_5057_344817",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("clipPath",{id:"clip0_5057_344817"},ot.createElement("rect",{width:737,height:220,fill:"white"})))));var BI,PI,DI,NI,FI,WI,VI,UI,HI,qI,ZI,zI,QI;function GI(){return GI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},GI.apply(null,arguments)}const YI=e=>ot.createElement("svg",GI({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),BI||(BI=ot.createElement("rect",{x:28.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),PI||(PI=ot.createElement("rect",{x:88.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),DI||(DI=ot.createElement("rect",{x:148.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),NI||(NI=ot.createElement("rect",{x:208.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),FI||(FI=ot.createElement("rect",{x:268.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),WI||(WI=ot.createElement("rect",{x:328.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),VI||(VI=ot.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint0_linear_5229_28865)"})),UI||(UI=ot.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint1_linear_5229_28865)"})),HI||(HI=ot.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint2_linear_5229_28865)"})),qI||(qI=ot.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint3_linear_5229_28865)"})),ZI||(ZI=ot.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint4_linear_5229_28865)"})),zI||(zI=ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint5_linear_5229_28865)"})),QI||(QI=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_5229_28865",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint1_linear_5229_28865",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint2_linear_5229_28865",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint3_linear_5229_28865",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint4_linear_5229_28865",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint5_linear_5229_28865",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})))));var XI,JI,KI,_I,$I,eR,tR,nR,rR,iR,oR,aR,sR;function lR(){return lR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lR.apply(null,arguments)}const dR=e=>ot.createElement("svg",lR({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),XI||(XI=ot.createElement("rect",{x:28.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),JI||(JI=ot.createElement("rect",{x:88.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),KI||(KI=ot.createElement("rect",{x:148.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),_I||(_I=ot.createElement("rect",{x:208.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),$I||($I=ot.createElement("rect",{x:268.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),eR||(eR=ot.createElement("rect",{x:328.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),tR||(tR=ot.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint0_linear_3900_354262)"})),nR||(nR=ot.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint1_linear_3900_354262)"})),rR||(rR=ot.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint2_linear_3900_354262)"})),iR||(iR=ot.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint3_linear_3900_354262)"})),oR||(oR=ot.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint4_linear_3900_354262)"})),aR||(aR=ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint5_linear_3900_354262)"})),sR||(sR=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_3900_354262",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint1_linear_3900_354262",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint2_linear_3900_354262",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint3_linear_3900_354262",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint4_linear_3900_354262",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint5_linear_3900_354262",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})))));var cR,uR,pR,hR,mR,fR,gR,yR,xR,vR,bR,AR,wR;function kR(){return kR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kR.apply(null,arguments)}const CR=e=>ot.createElement("svg",kR({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),cR||(cR=ot.createElement("rect",{x:28.5,y:200,width:40,height:20,fill:"url(#paint0_linear_5229_28987)"})),uR||(uR=ot.createElement("rect",{x:88.5,y:180,width:40,height:40,fill:"url(#paint1_linear_5229_28987)"})),pR||(pR=ot.createElement("rect",{x:148.5,y:160,width:40,height:60,fill:"url(#paint2_linear_5229_28987)"})),hR||(hR=ot.createElement("rect",{x:208.5,y:120,width:40,height:100,fill:"url(#paint3_linear_5229_28987)"})),mR||(mR=ot.createElement("rect",{x:268.5,y:60,width:40,height:160,fill:"url(#paint4_linear_5229_28987)"})),fR||(fR=ot.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint5_linear_5229_28987)"})),gR||(gR=ot.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint6_linear_5229_28987)"})),yR||(yR=ot.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint7_linear_5229_28987)"})),xR||(xR=ot.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint8_linear_5229_28987)"})),vR||(vR=ot.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint9_linear_5229_28987)"})),bR||(bR=ot.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint10_linear_5229_28987)"})),AR||(AR=ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint11_linear_5229_28987)"})),wR||(wR=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_5229_28987",x1:48.5,y1:200,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint1_linear_5229_28987",x1:108.5,y1:180,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint2_linear_5229_28987",x1:168.5,y1:160,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint3_linear_5229_28987",x1:228.5,y1:120,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint4_linear_5229_28987",x1:288.5,y1:60,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint5_linear_5229_28987",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint6_linear_5229_28987",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint7_linear_5229_28987",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint8_linear_5229_28987",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint9_linear_5229_28987",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint10_linear_5229_28987",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint11_linear_5229_28987",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})))));var jR,TR,ER,SR,IR,RR,LR,MR,OR,BR,PR,DR,NR;function FR(){return FR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FR.apply(null,arguments)}const WR=e=>ot.createElement("svg",FR({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),jR||(jR=ot.createElement("rect",{x:28.5,y:200,width:40,height:20,fill:"url(#paint0_linear_4437_25449)"})),TR||(TR=ot.createElement("rect",{x:88.5,y:180,width:40,height:40,fill:"url(#paint1_linear_4437_25449)"})),ER||(ER=ot.createElement("rect",{x:148.5,y:160,width:40,height:60,fill:"url(#paint2_linear_4437_25449)"})),SR||(SR=ot.createElement("rect",{x:208.5,y:120,width:40,height:100,fill:"url(#paint3_linear_4437_25449)"})),IR||(IR=ot.createElement("rect",{x:268.5,y:60,width:40,height:160,fill:"url(#paint4_linear_4437_25449)"})),RR||(RR=ot.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint5_linear_4437_25449)"})),LR||(LR=ot.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint6_linear_4437_25449)"})),MR||(MR=ot.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint7_linear_4437_25449)"})),OR||(OR=ot.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint8_linear_4437_25449)"})),BR||(BR=ot.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint9_linear_4437_25449)"})),PR||(PR=ot.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint10_linear_4437_25449)"})),DR||(DR=ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint11_linear_4437_25449)"})),NR||(NR=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_4437_25449",x1:48.5,y1:200,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint1_linear_4437_25449",x1:108.5,y1:180,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint2_linear_4437_25449",x1:168.5,y1:160,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint3_linear_4437_25449",x1:228.5,y1:120,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint4_linear_4437_25449",x1:288.5,y1:60,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint5_linear_4437_25449",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint6_linear_4437_25449",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint7_linear_4437_25449",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint8_linear_4437_25449",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint9_linear_4437_25449",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint10_linear_4437_25449",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint11_linear_4437_25449",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})))));var VR,UR;function HR(){const e="https://docs.dodoex.io/product/tutorial/how-to-create-pools#learn-more-about-the-characteristics-of-different-pool-models",t=[{version:UR.standard,title:r._({id:"TJBHlP",message:"Standard"}),description:r._({id:"QNrpkx",message:"Classical AMM-like pool. Suitable for most assets."}),exampleImgUrl:WR,exampleDarkImgUrl:CR,docUrl:e,initPriceLabel:r._({id:"d2CZvA",message:"Initial Price"}),initPriceTips:r._({id:"5OKrbq",message:"Since this pool uses the PMM algorithm, which is different from the normal AMM pool mechanism, the initial price calculation is also different from AMM."}),initPriceTipsLink:"https://docs.dodoex.io/en/product/dodo-v2-pools/dodo-vending-machine/dvm-initial-price-formula-explanation"},{version:UR.pegged,title:r._({id:"J7M/DA",message:"Pegged"}),description:r._({id:"RvYEUJ",message:"Suitable for synthetic assets. The liquidity is super concentrated at some price like Curve Finance."}),exampleImgUrl:tI,exampleDarkImgUrl:VS,docUrl:e,initPriceLabel:r._({id:"4ogEAw",message:"Pegged Exchange Rate"}),initPriceTips:r._({id:"M9dIDb",message:"The pegged exchange rate refers to the exchange rate between two token assets where one's value is pegged/fixed by the other. For example, the pegged exchange rate between the US Dollar and USDT is 1."})},{version:UR.singleToken,title:r._({id:"34w3mT",message:"Single-Token"}),description:r._({id:"a1AzKr",message:"For those who are looking to sell tokens and only need ask-side liquidity."}),exampleImgUrl:dR,exampleDarkImgUrl:YI,docUrl:e,initPriceLabel:r._({id:"d2CZvA",message:"Initial Price"}),initPriceTips:r._({id:"HGf8fG",message:"You can set the minimum selling price for single-token pools."})},{version:UR.marketMakerPool,title:r._({id:"4vKwIV",message:"Private Pool"}),description:r._({id:"pKjCsP",message:"100% use your own funds and enjoy the maximum degree of flexibility."}),exampleImgUrl:OI,exampleDarkImgUrl:yI,docUrl:e,initPriceLabel:r._({id:"CeLrge",message:"Mid Price"}),initPriceTips:r._({id:"GGPOuT",message:"set current mid price"})}],n=t.reduce(((e,t)=>(e[t.version]=t,e)),{});return{versionList:t,versionMap:n,subPeggedVersionList:qR()}}function qR(){return[{version:VR.DSP,title:r._({id:"D1bhHv",message:"The pool’s market-making price is fixed"}),description:r._({id:"lgE483",message:"Once created, the price cannot be changed. This option applies to assets like ETH-WETH."})},{version:VR.GSP,title:r._({id:"LVzIav",message:"The pool’s market-making price can be adjusted"}),description:r._({id:"KkjUUb",message:"Once created, you can adjust the pool’s market-making price at any time. This option is suitable for assets with fluctuating pegged prices. Adjusting the pool’s market-making price allows for more competitive quotes."})}]}function ZR(){return qR().reduce(((e,t)=>(e[t.version]=t,e)),{})}!function(e){e.DSP="dsp",e.GSP="gsp"}(VR||(VR={})),function(e){e.standard="standard",e.singleToken="single-token",e.pegged="pagged",e.marketMakerPool="market-maker-pool"}(UR||(UR={}));const zR="0.3",QR=.01,GR=10,YR="1",XR="0.0000000000001",JR=1e8,KR="1",_R="0.0001",$R="0.1",eL=8;function tL({selectedVersion:e,quoteToken:t,initPrice:n,midPrice:r}){return e===UR.standard?!r||r.isZero()?null:An({input:r,decimals:t.decimals}):An({input:n,decimals:t.decimals})}function nL({initPrice:e}){const t=new i(e);if(!t.isFinite()||t.lte(0))return{base:null,quote:null};const n=new i(1),r=n.dividedBy(n.plus(t)).dp(eL,i.ROUND_DOWN);return{base:r,quote:n.minus(r).dp(eL,i.ROUND_DOWN)}}function rL({chainId:e,baseToken:t,quoteToken:n}){const r=ue[e];return!(!t||!n)&&(!(!ds(t.address,r.address)||!ds(n.address,r.wrappedTokenAddress))||!(!ds(t.address,r.wrappedTokenAddress)||!ds(n.address,r.address)))}function iL({title:e,children:t,isWaiting:n}){const r=g();return Os.jsxs(f,{sx:{padding:16,borderRadius:8,backgroundColor:r.palette.background.paper,flexGrow:1,flexBasis:"100%"},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",gap:8,typography:"h5"},children:n?"-":t}),Os.jsx(f,{sx:{typography:"h6",fontWeight:500,color:r.palette.text.secondary,mt:8},children:e})]})}function oL({status:t,selectedVersion:n,baseToken:r,quoteToken:i,initPrice:o,slippageCoefficient:a,midPrice:s,sx:l}){var d;const{versionMap:c}=HR(),u="waiting"===t,{initPriceLabel:p}=c[n];return r&&i?Os.jsx(Os.Fragment,{children:Os.jsxs(f,{sx:Object.assign({mt:0,display:"flex",alignItems:"stretch",gap:12,opacity:u?.5:1},l),children:[Os.jsxs(iL,{title:Os.jsx(e,{id:"fSFt4a",message:"Token Pair"}),isWaiting:u,children:[Os.jsx(Cj,{width:24,height:24,tokens:[r,i]}),r.symbol,"-",i.symbol]}),Os.jsx(iL,{title:Os.jsx(e,{id:"sjn3tj",message:"Slippage Coefficient"}),isWaiting:u,children:a}),Os.jsxs(iL,{title:p,isWaiting:u,children:["1 ",r.symbol," = ",null!==(d=tL({midPrice:s,quoteToken:i,selectedVersion:n,initPrice:o}))&&void 0!==d?d:"-"," ",i.symbol]})]})}):null}var aL,sL;function lL(){return lL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lL.apply(null,arguments)}const dL=e=>ot.createElement("svg",lL({width:54,height:32,viewBox:"0 0 54 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),aL||(aL=ot.createElement("g",{clipPath:"url(#clip0_5251_29079)"},ot.createElement("path",{d:"M41.2736 0.409826C33.3354 1.31458 28.4933 23.304 27.1777 32H54.0001V0.0303594C53.1946 0.0303459 46.2675 -0.159361 41.2736 0.409826Z",fill:"url(#paint0_linear_5251_29079)"}),ot.createElement("path",{d:"M27 31.7932C28.3204 23.1499 33.2469 1.97641 41.3084 0.583249C43.491 0.206055 53.1916 0.206014 54 0.206056",stroke:"#EC5A7D",strokeWidth:.206452,strokeLinecap:"square",strokeLinejoin:"round"}),ot.createElement("path",{d:"M12.7264 0.409826C20.6646 1.31458 25.5067 23.304 26.8223 32H-0.000102997V0.0303594C0.805374 0.0303459 7.73247 -0.159361 12.7264 0.409826Z",fill:"url(#paint1_linear_5251_29079)"}),ot.createElement("path",{d:"M27 31.7932C25.6796 23.1499 20.7531 1.97641 12.6916 0.583249C10.509 0.206055 0.808383 0.206014 2.38419e-07 0.206056",stroke:"#2FBA90",strokeWidth:.206452,strokeLinecap:"square",strokeLinejoin:"round"}))),sL||(sL=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_5251_29079",x1:54.0001,y1:5.72231,x2:54.0001,y2:31.0514,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EC5A7D",stopOpacity:.3}),ot.createElement("stop",{offset:1,stopColor:"#EC5A7D",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint1_linear_5251_29079",x1:-10303e-8,y1:5.72231,x2:-10372e-8,y2:31.0514,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#2FBA90",stopOpacity:.3}),ot.createElement("stop",{offset:1,stopColor:"#2FBA90",stopOpacity:0})),ot.createElement("clipPath",{id:"clip0_5251_29079"},ot.createElement("rect",{width:54,height:32,fill:"white"})))));var cL,uL;function pL(){return pL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pL.apply(null,arguments)}const hL=e=>ot.createElement("svg",pL({width:54,height:32,viewBox:"0 0 54 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),cL||(cL=ot.createElement("g",{clipPath:"url(#clip0_5251_28999)"},ot.createElement("path",{d:"M41.2736 0.409826C33.3354 1.31458 28.4933 23.304 27.1777 32H54.0001V0.0303594C53.1946 0.0303459 46.2675 -0.159361 41.2736 0.409826Z",fill:"url(#paint0_linear_5251_28999)"}),ot.createElement("path",{d:"M27 31.7932C28.3204 23.1499 33.2469 1.97641 41.3084 0.583249C43.491 0.206055 53.1916 0.206014 54 0.206056",stroke:"#FF6187",strokeWidth:.206452,strokeLinecap:"square",strokeLinejoin:"round"}),ot.createElement("path",{d:"M12.7264 0.409826C20.6646 1.31458 25.5067 23.304 26.8223 32H-0.000102997V0.0303594C0.805374 0.0303459 7.73247 -0.159361 12.7264 0.409826Z",fill:"url(#paint1_linear_5251_28999)"}),ot.createElement("path",{d:"M27 31.7932C25.6796 23.1499 20.7531 1.97641 12.6916 0.583249C10.509 0.206055 0.808383 0.206014 2.38419e-07 0.206056",stroke:"#55F9C7",strokeWidth:.206452,strokeLinecap:"square",strokeLinejoin:"round"}))),uL||(uL=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_5251_28999",x1:54.0001,y1:5.72231,x2:54.0001,y2:31.0514,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FF6187",stopOpacity:.3}),ot.createElement("stop",{offset:1,stopColor:"#FF6187",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint1_linear_5251_28999",x1:-10303e-8,y1:5.72231,x2:-10372e-8,y2:31.0514,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#55F9C7",stopOpacity:.3}),ot.createElement("stop",{offset:1,stopColor:"#55F9C7",stopOpacity:0})),ot.createElement("clipPath",{id:"clip0_5251_28999"},ot.createElement("rect",{width:54,height:32,fill:"white"})))));function mL({height:e,text:t}){return Os.jsx(sT,{sx:{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",height:e||261},emptyText:t||r._({id:"uiuMDr",message:"Enter parameters to view the yield curve"})})}const fL=at.lazy((()=>import("./index-DfepFCNX.js"))),gL=at.lazy((()=>import("./index-Dk-2R2C4.js")));var yL,xL;function vL({baseToken:t,quoteToken:n,pmmParams:i,pmmModel:o,midPrice:a}){var s,l;const d=g(),{isMobile:c}=wy(),[u,p]=at.useState(yL.depth),h=at.useRef(null),[m,y]=at.useState(0),x=null!==(s=null==t?void 0:t.symbol)&&void 0!==s?s:"",v=null!==(l=null==n?void 0:n.symbol)&&void 0!==l?l:"";at.useEffect((()=>{const e=()=>{h&&h.current&&y(h.current.offsetWidth)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[h,a]);const b=u===yL.depth;if(!a||a.isNaN())return Os.jsx(mL,{height:c?261:b?665:494});const A=d.palette.success.main,w=d.palette.error.main,k=[{key:yL.liquidity,value:r._({id:"6y2TB3",message:"Liquidity"})},{key:yL.depth,value:r._({id:"n25Lml",message:"Depth"})}];return Os.jsxs(f,{ref:h,sx:{mt:2,"& input":{backgroundColor:"background.input",borderStyle:"solid",borderWidth:"1px",borderColor:"border.main",borderRadius:8,color:"text.primary",overflow:"hidden"},"& .operate-btn-wrapper button":{backgroundColor:"background.paperContrast",color:"text.primary"}},children:[Os.jsxs(H,{value:u,onChange:(e,t)=>{p(t)},children:[Os.jsx(G,{tabs:k,variant:"tag",tabsListSx:{ml:"auto"}}),Os.jsx(f,{sx:Object.assign({typography:"h6",mt:8,mb:14,color:"text.secondary"},c?{transform:"scale(0.66667)",transformOrigin:"top left"}:{}),children:Os.jsx(e,{id:"tyGEMJ",message:"Amounts"})}),Os.jsx(z,{value:yL.depth,children:m&&Os.jsx(at.Suspense,{children:Os.jsx(fL,{width:m,height:c?261:364,chartId:"create-pool-depth-chart",baseTokenSymbol:x,quoteTokenSymbol:v,pmmModel:o,pmmParams:i,midPrice:a,colorMap:{grid:"light"===d.palette.mode?"#E4E4E4":void 0,midPriceLine:"light"===d.palette.mode?"#E4E4E4":void 0,leftBg:[0,C(A,.04),1,C(A,.3)],leftLine:A,rightBg:[0,C(w,.04),1,C(w,.3)],rightLine:w,tooltipBg:d.palette.background.paperContrast,tooltipColor:d.palette.text.primary},notShowAmountInput:c})})}),Os.jsx(z,{value:yL.liquidity,children:Os.jsx(at.Suspense,{children:Os.jsx(gL,{width:m,height:c?261:364,baseTokenSymbol:x,quoteTokenSymbol:v,pmmModel:o,pmmParams:i,midPrice:a,notShowTipText:!0,colorMap:{grid:"light"===d.palette.mode?"#E4E4E4":void 0,midPriceLine:"light"===d.palette.mode?"#E4E4E4":void 0,leftBg:[0,C(A,.04),1,C(A,.3)],leftLine:A,rightBg:[0,C(w,.04),1,C(w,.3)],rightLine:w,tooltipBg:d.palette.background.paperContrast,tooltipColor:d.palette.text.primary,textColor:d.palette.text.secondary}})})})]}),Os.jsx(f,{sx:Object.assign({typography:"h6",mt:6,color:"text.secondary"},c?{transform:"scale(0.66667)",transformOrigin:"top left"}:{}),children:Os.jsx(e,{id:"DZULmp",message:"Swap Rate"})}),b?"":Os.jsxs(f,{sx:{typography:"h6",mt:24,color:"text.secondary",textAlign:"center"},children:["* ",r._({id:"DuVAxN",message:"The area of the chart indicates the buy/sell volume of {baseSymbol} that can be carried by the market when the current price changes to the hover price.",values:{baseSymbol:x}})]})]})}!function(e){e[e.liquidity=1]="liquidity",e[e.depth=2]="depth"}(yL||(yL={})),function(e){e[e.standard=1]="standard",e[e.singleToken=2]="singleToken",e[e.pagged=3]="pagged",e[e.marketMaker=4]="marketMaker"}(xL||(xL={}));const bL=({selectedVersion:e,baseAmount:t,quoteAmount:n,initPrice:r,slippageCoefficient:i})=>{const o=lt((()=>{const o=[UR.standard,UR.singleToken].includes(e),a=e===UR.singleToken;if(!t||!a&&!n)return;const s=Number(r),l=Number(t),d=Number(n),c=Number(i);return{i:s,k:c,b:l,b0:l,q:d,q0:0!==c&&o?0:d,R:0!==c&&o?1:0}}),[t,r,n,e,i]),a=lt((()=>{if(o)return ve(o)}),[o]),s=lt((()=>{if(a)return a.getMidPrice()}),[a]);return{pmmParams:o,pmmModel:a,midPrice:s}};function AL({selectedVersion:e,baseToken:t,quoteToken:n,initPrice:i,slippageCoefficient:o,baseAmount:a,quoteAmount:s}){const l=g(),{isMobile:d}=wy(),[c,u]=at.useState(!1),{pmmParams:p,pmmModel:h,midPrice:m}=bL({selectedVersion:e,baseAmount:a,quoteAmount:s,initPrice:i,slippageCoefficient:o});if(!d)return null;const x=r._({id:"FQfStS",message:"Emulator"}),v=r._({id:"9D2g7k",message:"The liquidity of DODO is continuous, which is different from the discrete liquidity of UniV3. The ticks shown in the illustration are for demonstration purposes only."});return Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{sx:{mx:20,mb:8},children:Os.jsxs(f,{sx:{width:"100%",px:20,py:16,borderRadius:12,borderWidth:1,borderStyle:"solid",borderColor:l.palette.border.main,display:"flex",alignItems:"center",justifyContent:"space-between"},component:y,onClick:()=>u(!0),children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",color:l.palette.text.secondary,typography:"body1",fontWeight:600},children:[x,Os.jsx(P,{title:v,ml:4,sx:{width:14,height:14}})]}),!m||m.isNaN()?Os.jsx(f,{sx:{py:5,typography:"body1"},children:"-"}):"light"===l.palette.mode?Os.jsx(dL,{width:"52",height:"32"}):Os.jsx(hL,{width:"52",height:"32"})]})}),Os.jsx(yy,{open:c,onClose:()=>u(!1),modal:!0,title:Os.jsxs(f,{children:[x,Os.jsx(P,{title:v,ml:4})]}),children:Os.jsx(f,{sx:{px:28,pb:20,maxHeight:"calc(80vh - 134px)",overflowY:"auto",overflowX:"hidden"},children:Os.jsx(vL,{baseToken:t,quoteToken:n,pmmParams:p,pmmModel:h,midPrice:m})})})]})}function wL({color:e,backgroundColor:t,tagKey:n}){return Os.jsx(f,{sx:{ml:8,px:8,py:2,borderRadius:4,backgroundColor:t,color:e,typography:"h6",fontWeight:500},children:n})}function kL({isWaiting:t,feeRate:n}){const i=g();return Os.jsxs(f,{sx:{padding:16,borderRadius:8,backgroundColor:i.palette.background.paper,width:"50%",opacity:t?.5:1},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",typography:"h5",fontWeight:600},children:t?"-":Os.jsxs(Os.Fragment,{children:[n||"-","%",n===zR&&Os.jsx(wL,{tagKey:r._({id:"/+c6tU",message:"99% Default"}),color:i.palette.purple.main,backgroundColor:C(i.palette.purple.main,.1)})]})}),Os.jsx(f,{sx:{typography:"h6",fontWeight:500,color:i.palette.text.secondary,mt:8},children:Os.jsx(e,{id:"Y7rVy0",message:"Fee Rate"})})]})}function CL({isWaiting:t,selectedVersion:n,baseToken:r,quoteToken:i,initPrice:o,slippageCoefficient:a,baseAmount:s,quoteAmount:l,peggedBaseTokenRatio:d,peggedQuoteTokenRatio:c}){const u=g(),{pmmParams:p,pmmModel:h,midPrice:m}=bL({selectedVersion:n,baseAmount:s,quoteAmount:l,initPrice:o,slippageCoefficient:a});return Os.jsxs(Os.Fragment,{children:[!t&&Os.jsx(vL,{baseToken:r,quoteToken:i,pmmParams:p,pmmModel:h,midPrice:m}),Os.jsxs(f,{sx:{mt:t?0:20,padding:16,borderRadius:8,backgroundColor:u.palette.background.paper,width:"50%",opacity:t?.5:1},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",typography:"h5",fontWeight:600},children:t?"-":Os.jsxs(Os.Fragment,{children:[d,"% ",null==r?void 0:r.symbol," : ",c,"% ",null==i?void 0:i.symbol]})}),Os.jsx(f,{sx:{typography:"h6",fontWeight:500,color:u.palette.text.secondary,mt:8},children:Os.jsx(e,{id:"eK0eiF",message:"Initial asset ratio"})})]})]})}function jL({title:e,children:t,isWaiting:n}){const r=g();return Os.jsxs(f,{sx:{padding:16,borderRadius:8,backgroundColor:r.palette.background.paper,flexGrow:1,flexBasis:"100%"},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",gap:8,typography:"h5"},children:n?"-":t}),Os.jsx(f,{sx:{typography:"h6",fontWeight:500,color:r.palette.text.secondary,mt:8},children:e})]})}function TL({status:e,selectedVersion:t,baseToken:n,quoteToken:i,initPrice:o,slippageCoefficient:a,baseAmount:s,quoteAmount:l}){var d;const{pmmParams:c,pmmModel:u,midPrice:p}=bL({selectedVersion:t,baseAmount:s,quoteAmount:l,initPrice:o,slippageCoefficient:a}),{versionMap:h}=HR(),m="waiting"===e,{initPriceLabel:g}=h[t];return Os.jsxs(Os.Fragment,{children:["running"===e&&Os.jsx(vL,{baseToken:n,quoteToken:i,pmmParams:c,pmmModel:u,midPrice:p}),Os.jsxs(f,{sx:{mt:20,display:"flex",alignItems:"stretch",gap:12,opacity:m?.5:1},children:[Os.jsx(jL,{title:r._({id:"fSFt4a",message:"Token Pair"}),isWaiting:m,children:n&&i?Os.jsxs(Os.Fragment,{children:[Os.jsx(Cj,{width:24,tokens:[n,i],chainId:n.chainId}),n.symbol,"-",i.symbol]}):""}),Os.jsx(jL,{title:g,isWaiting:m,children:n&&i?Os.jsxs(Os.Fragment,{children:["1 ",n.symbol,"=",null!==(d=tL({midPrice:p,quoteToken:i,selectedVersion:t,initPrice:o}))&&void 0!==d?d:"-"," ",i.symbol]}):""}),Os.jsx(jL,{title:r._({id:"sjn3tj",message:"Slippage Coefficient"}),isWaiting:m,children:a})]})]})}function EL({isWaiting:t,selectedSubPeggedVersion:n}){var r,i;const o=g(),a=ZR();return Os.jsxs(f,{sx:{padding:16,borderRadius:8,backgroundColor:o.palette.background.paper,width:"50%",opacity:t?.5:1},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",typography:"h5",fontWeight:600},children:t?"-":n&&null!==(i=null===(r=a[n])||void 0===r?void 0:r.title)&&void 0!==i?i:"-"}),Os.jsx(f,{sx:{typography:"h6",fontWeight:500,color:o.palette.text.secondary,mt:8},children:Os.jsx(e,{id:"XPiFIY",message:"Can the pool price be adjusted?"})})]})}function SL({index:e,titleKey:t,status:n}){const r=g(),{isMobile:i}=wy();return Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{sx:Object.assign({mt:28,mb:28,borderTopColor:"divider",borderTopStyle:"solid",borderTopWidth:1},i?{mt:12,mb:12,display:1===e?"none":"block"}:{})}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",mb:20},children:[Os.jsx(f,{sx:{display:"flex",width:"20px",height:"20px",justifyContent:"center",alignItems:"center",flexShrink:0,borderRadius:"50%",backgroundColor:"waiting"===n?r.palette.background.paperDarkContrast:r.palette.secondary.main,typography:"h6",fontWeight:600,textAlign:"center",color:"waiting"===n?r.palette.text.disabled:r.palette.secondary.contrastText},children:"completed"===n?Os.jsx(Os.Fragment,{children:Os.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{d:"M12.7596 3.55566L5.92549 10.3897L3.23957 7.71418L1.77734 9.17641L5.92549 13.3246L14.2218 5.02826L12.7596 3.55566Z",fill:"currentColor"})})}):e}),Os.jsx(f,{sx:{ml:8,typography:"body1",fontWeight:600,color:"waiting"===n?r.palette.text.disabled:r.palette.text.primary},children:t})]})]})}function IL({currentStep:e,isPeggedVersion:t}){const n=g(),{isMobile:i}=wy();let o="",a="",s="";switch(e){case 0:o=r._({id:"hdIg7i",message:"Select Pool Version"}),s=r._({id:"AOhRo6",message:"DODO provides a variety of pool versions to suit your needs."});break;case 1:o=r._({id:"lsg9Mi",message:"Parameter Settings"});break;case 2:t?o=r._({id:"6lss/t",message:"Pricing Model"}):(o=r._({id:"Y7rVy0",message:"Fee Rate"}),a=r._({id:"2vjOqX",message:"Pools with lower transaction fees will attract more traders."}));break;case 3:if(!t)throw new Error("type is error");o=r._({id:"Y7rVy0",message:"Fee Rate"}),a=r._({id:"2vjOqX",message:"Pools with lower transaction fees will attract more traders."});break;case 4:if(!t)throw new Error("type is error");o=r._({id:"3ggd2j",message:"Asset ratio within the pool"});break;default:throw new Error(`Invalid Step ${e}`)}return Os.jsxs(f,{sx:Object.assign({position:"sticky",top:0,py:20,px:20,backgroundColor:n.palette.background.paper,zIndex:1},i?{}:{position:"static",borderTopLeftRadius:16,borderTopRightRadius:16}),children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(f,{sx:{typography:"h5",color:n.palette.text.primary,fontWeight:600},children:o}),a&&Os.jsx(P,{title:a,sx:{width:16,height:16}}),Os.jsx(f,{sx:{marginLeft:"auto",display:"flex",alignItems:"center",gap:12},children:(t?[0,1,2,3,4]:[0,1,2]).map((t=>Os.jsx(f,{sx:{width:12,height:12,borderRadius:12,background:e>=t?n.palette.secondary.main:C(n.palette.primary.main,.1)}},t)))})]}),s&&Os.jsx(f,{sx:{mt:8,typography:"body2",color:n.palette.text.secondary},children:s})]})}function RL({versionItem:t,status:n}){const r=g(),{noDocumentLink:i}=pf(),o="light"===r.palette.mode;return"completed"===n?Os.jsxs(f,{sx:{backgroundColor:r.palette.background.paper,borderRadius:8,width:"50%",padding:16},children:[Os.jsx(f,{sx:{typography:"h5",fontWeight:600,color:r.palette.text.primary},children:t.title}),Os.jsx(f,{sx:{typography:"h6",fontWeight:500,mt:8,color:r.palette.text.secondary},children:t.description})]}):Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(f,{sx:{typography:"h4",fontWeight:600},children:t.title}),!i&&Os.jsxs(f,{sx:{ml:8,display:"flex",padding:"2px 8px",justifyContent:"center",alignItems:"center",gap:"2px",color:r.palette.text.disabled,backgroundColor:r.palette.background.paperDarkContrast,borderRadius:4,typography:"h6"},component:"a",href:t.docUrl,target:"_blank",rel:"noreferrer",children:[Os.jsx(e,{id:"TGi+jm",message:"Doc"}),Os.jsx("svg",{width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.91667 3.41667V11.5833H11.0833V7.5H12.25V11.5833C12.25 12.225 11.725 12.75 11.0833 12.75H2.91667C2.26917 12.75 1.75 12.225 1.75 11.5833V3.41667C1.75 2.775 2.26917 2.25 2.91667 2.25H7V3.41667H2.91667ZM8.16667 3.41667V2.25H12.25V6.33333H11.0833V4.23917L5.34917 9.97333L4.52667 9.15083L10.2608 3.41667H8.16667Z",fill:"currentColor"})})]})]}),Os.jsx(f,{sx:{position:"relative",width:"100%",minHeight:220},children:Os.jsx(f,{component:o?t.exampleImgUrl:t.exampleDarkImgUrl,sx:{marginTop:20,width:"100%"}})})]})}function LL({side:e,tokenList:t,occupyToken:n,needFindToken:r,chainId:i}){var o,a;let s=null,l=null;const d=t.filter((t=>!(t.side&&t.side!==e||i&&t.chainId!==i)));return d.length&&(r&&(s=null!==(o=d.find((e=>e.address===(null==r?void 0:r.address)&&e.chainId===r.chainId)))&&void 0!==o?o:null,l=s),l||(n?l=null!==(a=d.find((e=>e.address!==n.address)))&&void 0!==a?a:null:[l]=d)),{findToken:s,defaultToken:l}}function ML(){const{account:e,chainId:t}=hf(),n=fw((e=>{var t;return null===(t=e.page)||void 0===t?void 0:t.params}));return function({chainId:e,account:t,defaultBaseToken:n,defaultQuoteToken:r,tokenListInclude:i}={}){const{autoConnectLoading:o}=yf(),{tokenList:a}=Jc(),s=LL({side:"from",needFindToken:n,tokenList:a,chainId:e}),l=It(Object.assign({},$a.getFetchTokenQuery(i?void 0:e,null==n?void 0:n.address,t))),d=It(Object.assign({},$a.getFetchTokenQuery(i?void 0:e,null==r?void 0:r.address,t)));let c=null,u=o;o||(c=s.defaultToken,l.data&&(c=l.data,u=l.isLoading));let p=null,h=o;o||(p=LL({side:"to",needFindToken:r,occupyToken:c,tokenList:a,chainId:e}).defaultToken,d.data&&(p=d.data,h=d.isLoading));return{defaultBaseToken:c,defaultQuoteToken:p,defaultBaseTokenLoading:u,defaultQuoteTokenLoading:h}}({chainId:t,account:e,defaultBaseToken:(null==n?void 0:n.fromAddress)?{address:null==n?void 0:n.fromAddress,chainId:t}:void 0,defaultQuoteToken:(null==n?void 0:n.toAddress)?{address:null==n?void 0:n.toAddress,chainId:t}:void 0})}function OL({tokens:e}){const{apikey:t}=pf(),n=Gv(Ha.fiatPrice);return It({enabled:!!e.length,queryKey:["fetch","fetchFiatPrice",e],queryFn:()=>Fn(this,void 0,void 0,(function*(){const r=yield Ut.post(n,{networks:e.map((e=>ys(e.chainId))),addresses:e.map((e=>e.address)),symbols:e.map((e=>e.symbol)),isCache:!0},t?{headers:{apikey:t}}:void 0),i=new Map;return r.data.data&&r.data.data.forEach((e=>{const t=Number(e.price);!Number.isNaN(t)&&t>0&&i.set(e.address,t)})),i}))})}const BL=({selectedVersion:e})=>e===UR.pegged?["0.0001","0.0005","0.002"]:["0.5","0.01","1"];var PL;function DL(e,t){return!e||null==t||e.isNaN()?"":e.dp(t,i.ROUND_DOWN).toString()}function NL({state:e,fixedRatioPrice:t}){const{selectedVersion:n,baseToken:r,quoteToken:o,baseAmount:a,isFixedRatio:s,leftTokenAddress:l}=e;if(!r||!o)throw new Error("token is required");const d=l===(null==r?void 0:r.address),c=n===UR.standard,u=n===UR.pegged,p=new i(t);let h=c?XR:d?t:!p.isNaN()&&p.gt(0)?new i(1).div(p).dp(d?o.decimals:r.decimals).toString():YR;if(c){const e=18-r.decimals+o.decimals;e<String(XR).split(".")[1].length&&(h=new i(1).div(10**e).toString())}if(u){const n=nL({initPrice:h}),r=n.base?n.base.multipliedBy(100).toString():"",i=n.quote?n.quote.multipliedBy(100).toString():"";return Object.assign(Object.assign({},e),{initPrice:h,fixedRatioPrice:t,peggedBaseTokenRatio:r,peggedQuoteTokenRatio:i})}if(c&&s){const n=new i(a);if(!n.isNaN()&&!p.isNaN()&&p.gt(0)){const i=d?n.multipliedBy(p):n.div(p);return Object.assign(Object.assign({},e),{initPrice:h,fixedRatioPrice:t,baseAmount:DL(n,r.decimals),quoteAmount:DL(i,o.decimals)})}}return Object.assign(Object.assign({},e),{initPrice:h,fixedRatioPrice:t})}function FL(e,t){var n;switch(t.type){case PL.SetCurrentStep:{const{payload:n}=t;return e.selectedVersion===UR.pegged?Object.assign(Object.assign({},e),{currentStep:n>=4?4:n<=0?0:n}):Object.assign(Object.assign({},e),{currentStep:n>=2?2:n<=0?0:n})}case PL.SelectNewVersion:{const{payload:r}=t;if(r===e.selectedVersion)return e;let i,o=KR;r===UR.pegged&&(o=_R,i=VR.DSP);let a=XR;r===UR.singleToken?a="":r!==UR.standard&&(a=YR);let s=!0;return r===UR.singleToken&&(s=!1),Object.assign(Object.assign({},e),{baseAmount:"",quoteAmount:"",isFixedRatio:s,initPrice:a,fixedRatioPrice:r===UR.singleToken?"":YR,slippageCoefficient:o,isSlippageCoefficientCustomized:!BL({selectedVersion:t.payload}).includes(o),selectedVersion:t.payload,selectedSubPeggedVersion:i,leftTokenAddress:null===(n=e.baseToken)||void 0===n?void 0:n.address})}case PL.SelectNewSubPeggedVersion:return Object.assign(Object.assign({},e),{selectedSubPeggedVersion:t.payload});case PL.UpdateBaseToken:{const n=t.payload;return Object.assign(Object.assign({},e),{baseToken:n,baseAmount:"",leftTokenAddress:null==n?void 0:n.address})}case PL.UpdateQuoteToken:{const{baseToken:n}=e;return Object.assign(Object.assign({},e),{quoteToken:t.payload,quoteAmount:"",leftTokenAddress:null==n?void 0:n.address})}case PL.SwitchTokens:{const{selectedVersion:t,baseToken:n,quoteToken:r,baseAmount:i,quoteAmount:o}=e;return t===UR.singleToken?Object.assign(Object.assign({},e),{baseToken:r,quoteToken:n,leftTokenAddress:null==r?void 0:r.address}):Object.assign(Object.assign({},e),{baseToken:r,quoteToken:n,baseAmount:o,quoteAmount:i,leftTokenAddress:null==r?void 0:r.address})}case PL.UpdateBaseAmount:{const n=t.payload,{selectedVersion:r,quoteToken:o,fixedRatioPrice:a,isFixedRatio:s,peggedBaseTokenRatio:l}=e;if(!o)throw new Error("token is required");const d=new i(n);if(r===UR.pegged){const t=new i(l).div(100).dp(eL,i.ROUND_DOWN);if(!t.isFinite()||t.lt(0))return Object.assign(Object.assign({},e),{baseAmount:n,quoteAmount:""});const r=d.div(t).minus(d);return Object.assign(Object.assign({},e),{baseAmount:n,quoteAmount:DL(r,o.decimals)})}if(r===UR.standard&&s&&a){if(!n)return Object.assign(Object.assign({},e),{baseAmount:n,quoteAmount:n});const t=function(e,t){const n=new be;return n.B=new i(e.baseAmount),n.i=new i(e.initPrice),n.k=new i(e.slippageCoefficient),n.RStatus=1,n.getQuoteByMidPrice(t)}(Object.assign(Object.assign({},e),{baseAmount:n}),new i(a));return Object.assign(Object.assign({},e),{baseAmount:n,quoteAmount:DL(t,o.decimals)})}return Object.assign(Object.assign({},e),{baseAmount:n})}case PL.UpdateQuoteAmount:{const n=t.payload,{selectedVersion:r,baseToken:o,fixedRatioPrice:a,isFixedRatio:s,leftTokenAddress:l,peggedQuoteTokenRatio:d}=e;if(!o)throw new Error("token is required");const c=l===(null==o?void 0:o.address),u=new i(n);if(r===UR.pegged){const t=new i(d).div(100).dp(eL,i.ROUND_DOWN);if(!t.isFinite()||t.lt(0))return Object.assign(Object.assign({},e),{baseAmount:"",quoteAmount:n});const r=u.div(t).minus(u);return Object.assign(Object.assign({},e),{baseAmount:DL(r,o.decimals),quoteAmount:n})}if(r===UR.standard&&s){const t=new i(a),r=t.gt(0)?c?u.div(t):u.multipliedBy(t):void 0;return Object.assign(Object.assign({},e),{baseAmount:DL(r,o.decimals),quoteAmount:n})}return Object.assign(Object.assign({},e),{quoteAmount:n})}case PL.UpdateIsFixedRatio:return Object.assign(Object.assign({},e),{isFixedRatio:t.payload});case PL.InitFixedRatioPrice:{const{leftTokenAddress:n,baseToken:r,quoteToken:o}=e;if(!r||!o)throw new Error("token is required");const a=n===(null==r?void 0:r.address),{baseTokenFiatPrice:s,quoteTokenFiatPrice:l}=t.payload,d=s&&l?new i(s).div(l):void 0,c=s&&l?new i(l).div(s):void 0,u=a?d:c,p=a?o.decimals:r.decimals;return u&&!u.isNaN()?NL({state:e,fixedRatioPrice:u.dp(p,i.ROUND_DOWN).toString()}):e}case PL.UpdateFixedRatioPrice:return NL({state:e,fixedRatioPrice:t.payload});case PL.ToggleLeftToken:{const{baseToken:t,quoteToken:n,fixedRatioPrice:r}=e;if(!t||!n)throw new Error("token is required");const o=e.leftTokenAddress===(null==t?void 0:t.address),a=o?null==n?void 0:n.address:null==t?void 0:t.address,s=new i(r);if(!s.isNaN()&&s.gt(0)){const r=new i(1).div(s).dp(o?t.decimals:n.decimals);return NL({state:Object.assign(Object.assign({},e),{leftTokenAddress:a}),fixedRatioPrice:r.toString()})}return Object.assign(Object.assign({},e),{leftTokenAddress:a})}case PL.UpdateSlippageCoefficient:return Object.assign(Object.assign({},e),{slippageCoefficient:t.payload});case PL.UpdateIsSlippageCoefficientCustomized:return Object.assign(Object.assign({},e),{isSlippageCoefficientCustomized:t.payload});case PL.UpdateFeeRate:return Object.assign(Object.assign({},e),{feeRate:t.payload});case PL.UpdateIsFeeRateCustomized:return Object.assign(Object.assign({},e),{isFeeRateCustomized:t.payload});case PL.InitEditParameters:return function(e,t){const{baseToken:n,quoteToken:r}=t;return n&&r?Object.assign(Object.assign({},e),{baseToken:n,quoteToken:r,leftTokenAddress:null==n?void 0:n.address,slippageCoefficient:"",initPrice:"",fixedRatioPrice:"",feeRate:"",isFixedRatio:!1}):e}(e,t.payload);case PL.UpdatePeggedBaseTokenRatio:{if(!e.quoteToken)throw new Error("token is required");const n=t.payload,r=new i(n).dp(eL-2,i.ROUND_DOWN);if(!r.isFinite()||r.lt(0))return Object.assign(Object.assign({},e),{peggedBaseTokenRatio:"",peggedQuoteTokenRatio:"",baseAmount:"",quoteAmount:""});const o=new i(100).minus(r).dp(eL-2,i.ROUND_DOWN),a=r.lte(0)?"0":e.baseAmount,s=new i(a),l=s.div(r.div(100)).minus(s);return Object.assign(Object.assign({},e),{peggedBaseTokenRatio:n,peggedQuoteTokenRatio:o.lt(0)?"0":o.toString(),baseAmount:a,quoteAmount:DL(l,e.quoteToken.decimals)})}case PL.UpdatePeggedQuoteTokenRatio:{if(!e.baseToken)throw new Error("token is required");const n=t.payload,r=new i(n).dp(eL-2,i.ROUND_DOWN);if(!r.isFinite()||r.lt(0))return Object.assign(Object.assign({},e),{peggedBaseTokenRatio:"",peggedQuoteTokenRatio:n,baseAmount:"",quoteAmount:""});const o=new i(100).minus(r).dp(eL-2,i.ROUND_DOWN),a=r.lte(0)?"0":e.quoteAmount,s=new i(a),l=s.div(r.div(100)).minus(s);return Object.assign(Object.assign({},e),{peggedBaseTokenRatio:o.lt(0)?"0":o.toString(),peggedQuoteTokenRatio:n,baseAmount:DL(l,e.baseToken.decimals),quoteAmount:a})}default:throw Error("Unknown action: "+t.type)}}function WL({isSingleTokenVersion:e,leftTokenAddress:t,baseToken:n,quoteToken:r,dispatch:o}){var a,s;const l=OL({tokens:lt((()=>n&&r?[n,r]:[]),[n,r])}),d=t===(null==n?void 0:n.address),c=n?null===(a=l.data)||void 0===a?void 0:a.get(n.address):void 0,u=r?null===(s=l.data)||void 0===s?void 0:s.get(r.address):void 0,p=lt((()=>{const e=c&&u?new i(c).div(u):void 0,t=c&&u?new i(u).div(c):void 0;return d?e:t}),[c,d,u]),h=!p||p.isNaN(),m=!l.isLoading&&!l.isPending&&h;return gt((()=>{m&&o({type:PL.UpdateIsFixedRatio,payload:!1})}),[o,m]),gt((()=>{e||c&&o({type:PL.InitFixedRatioPrice,payload:{baseTokenFiatPrice:c,quoteTokenFiatPrice:u}})}),[c,o,e,u]),{fiatPriceLoading:l.isLoading||l.isPending,currentPrice:p,isErrorPrice:m,isNullPrice:h}}function VL({label:e,value:t}){return Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",mb:16},children:[Os.jsx(f,{sx:{color:"text.secondary",mr:8},children:e}),Os.jsx(f,{sx:{textAlign:"right",wordBreak:"break-all"},children:t})]})}function UL({on:e,onClose:t,state:n,onConfirm:i,isModify:o,loading:a}){var s,l,d,c,u,p,h;const{chainId:m}=hf(),{versionMap:g}=HR(),{isMobile:y}=wy(),{title:x,initPriceLabel:v}=g[n.selectedVersion],{midPrice:b}=bL({selectedVersion:n.selectedVersion,baseAmount:n.baseAmount,quoteAmount:n.quoteAmount,initPrice:n.initPrice,slippageCoefficient:n.slippageCoefficient}),A=ZR(),w=n.selectedVersion===UR.pegged;return Os.jsx(yy,{open:e,onClose:t,modal:!0,title:o?r._({id:"dzV+zO",message:"Modify Confirmation"}):r._({id:"tnRI9r",message:"Pool Creation Confirmation"}),children:Os.jsxs(f,{sx:{flex:1,px:20,pb:20,display:"flex",flexDirection:"column",justifyContent:"space-between",width:y?void 0:420},children:[Os.jsxs(f,{sx:{pt:40,px:8},children:[Os.jsx(VL,{label:r._({id:"eE0JZ4",message:"Version"}),value:x}),Os.jsx(VL,{label:r._({id:"7m5+6j",message:"Initial Tokens"}),value:Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:[Os.jsx(ey,{address:null===(s=n.baseToken)||void 0===s?void 0:s.address,chainId:m,marginRight:8,width:18,height:18}),n.baseAmount||"-"," ",null===(l=n.baseToken)||void 0===l?void 0:l.symbol]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",mt:4},children:[Os.jsx(ey,{address:null===(d=n.quoteToken)||void 0===d?void 0:d.address,chainId:m,marginRight:8,width:18,height:18}),n.quoteAmount||"-"," ",null===(c=n.quoteToken)||void 0===c?void 0:c.symbol]})]})}),Os.jsx(VL,{label:r._({id:"sjn3tj",message:"Slippage Coefficient"}),value:n.slippageCoefficient}),Os.jsx(VL,{label:v,value:n.baseToken&&n.quoteToken?`1 ${n.baseToken.symbol} = ${tL({midPrice:b,quoteToken:n.quoteToken,selectedVersion:n.selectedVersion,initPrice:n.initPrice})} ${n.quoteToken.symbol}`:""}),w&&Os.jsx(VL,{label:r._({id:"6lss/t",message:"Pricing Model"}),value:n.selectedSubPeggedVersion?null===(u=A[n.selectedSubPeggedVersion])||void 0===u?void 0:u.title:"-"}),Os.jsx(VL,{label:r._({id:"Y7rVy0",message:"Fee Rate"}),value:`${n.feeRate}%`}),w&&Os.jsx(VL,{label:r._({id:"eK0eiF",message:"Initial asset ratio"}),value:Os.jsxs(Os.Fragment,{children:[n.peggedBaseTokenRatio,"% ",null===(p=n.baseToken)||void 0===p?void 0:p.symbol," : ",n.peggedQuoteTokenRatio,"% ",null===(h=n.quoteToken)||void 0===h?void 0:h.symbol]})})]}),Os.jsx(T,{fullWidth:!0,isLoading:a,sx:{mt:30},onClick:i,children:o?r._({id:"7VpPHA",message:"Confirm"}):r._({id:"hYgDIe",message:"Create"})})]})})}!function(e){e[e.SetCurrentStep=1]="SetCurrentStep",e[e.SelectNewVersion=2]="SelectNewVersion",e[e.SelectNewSubPeggedVersion=3]="SelectNewSubPeggedVersion",e[e.UpdateBaseToken=4]="UpdateBaseToken",e[e.UpdateQuoteToken=5]="UpdateQuoteToken",e[e.SwitchTokens=6]="SwitchTokens",e[e.UpdateBaseAmount=7]="UpdateBaseAmount",e[e.UpdateQuoteAmount=8]="UpdateQuoteAmount",e[e.UpdateIsFixedRatio=9]="UpdateIsFixedRatio",e[e.UpdateFixedRatioPrice=10]="UpdateFixedRatioPrice",e[e.InitFixedRatioPrice=11]="InitFixedRatioPrice",e[e.ToggleLeftToken=12]="ToggleLeftToken",e[e.UpdateSlippageCoefficient=13]="UpdateSlippageCoefficient",e[e.UpdateIsSlippageCoefficientCustomized=14]="UpdateIsSlippageCoefficientCustomized",e[e.UpdateFeeRate=15]="UpdateFeeRate",e[e.UpdateIsFeeRateCustomized=16]="UpdateIsFeeRateCustomized",e[e.InitEditParameters=17]="InitEditParameters",e[e.UpdatePeggedBaseTokenRatio=18]="UpdatePeggedBaseTokenRatio",e[e.UpdatePeggedQuoteTokenRatio=19]="UpdatePeggedQuoteTokenRatio"}(PL||(PL={}));const HL=({selectedVersion:e,selectedSubPeggedVersion:t,baseToken:n,quoteToken:r,baseAmount:o,quoteAmount:a,feeRate:s,initPrice:l,slippageCoefficient:d})=>{const{chainId:c,account:u}=hf(),{deadLine:p}=pf(),h=ue[c];return{getCreateParams:()=>Fn(void 0,void 0,void 0,(function*(){if(!u||!n||!r)return null;let m="";const f=Number(n.decimals),g=Number(r.decimals),y=new i(s),x=e===UR.marketMakerPool,v=e===UR.standard,b=e===UR.pegged,A=e===UR.pegged&&t===VR.GSP,w={decimals:f,address:n.address},k={decimals:g,address:r.address},C=re(o,f).toString(),j=re(a||"0",g).toString(),T=x?y.times(100).toNumber():y.times(80).toNumber();let E=x&&v?new i(a).div(o).dp(g,i.ROUND_DOWN).toString():new i(l).toString();if(v){const e=18-n.decimals+r.decimals;e<String(XR).split(".")[1].length&&(E=new i(1).div(10**e).toString())}const S=Number(d||(b?"0.1":"1")),I=Math.ceil(Date.now()/1e3)+(null!=p?p:3600);let R;const L=[c,w,k,C,j,T,E,S,I];try{e===UR.standard||e===UR.singleToken?R=yield le.encode.createDVMPoolABI(...L):x?R=yield le.encode.createDPPPoolABI(...L):b?R=yield le.encode.createDSPPoolABI(...L):A&&(R=yield le.encode.createGSPPoolABI(c,u,w,k,C,j,T,E,S,I))}catch(e){throw console.error("2.0 CreatePool createPrams error",L,e),m=`2.0 CreatePool createPrams error; ERROR: ${e}`,new Error(m)}if(!R||!R.data)throw m="invalid data",new Error(m);try{const e=h.address.toLocaleLowerCase();return o&&n.address.toLocaleUpperCase()===e?R.value=IT(o):a&&r.address===e?R.value=IT(a):R.value=0,R}catch(e){throw console.error("2.0 sendTransaction error",e),m=`2.0 sendTransaction error; ERROR: ${e}`,new Error(m)}}))}},qL=({chainId:t,baseToken:n,quoteToken:r})=>{const i=g();return rL({chainId:t,baseToken:n,quoteToken:r})?Os.jsx(f,{sx:{mb:12,py:8,px:12,borderRadius:8,backgroundColor:C(i.palette.error.main,.1),color:i.palette.error.main,textAlign:"center",typography:"h6",fontWeight:500},children:Os.jsx(e,{id:"peTryP",message:"{0}-{1} is not supported. Please select another pair.",values:{0:null==n?void 0:n.symbol,1:null==r?void 0:r.symbol}})}):null};function ZL({state:t,dispatch:n,openConfirm:o,isPeggedVersion:a,isStandardVersion:s,isSingleTokenVersion:l,fiatPriceLoading:d}){var c,u;const{currentStep:p,selectedVersion:h,baseToken:m,quoteToken:f,baseAmount:g,quoteAmount:y,initPrice:x,slippageCoefficient:v,feeRate:b}=t,A=new i(g||0),w=new i(y||0),k=EA(m,{amount:g}),C=EA(f,{amount:y}),j={variant:T.Variant.contained},E=rL({chainId:null!==(u=null===(c=t.baseToken)||void 0===c?void 0:c.chainId)&&void 0!==u?u:1,baseToken:m,quoteToken:f}),S=r._({id:"hXzOVo",message:"Next"}),I=Os.jsx(T,{fullWidth:!0,disabled:!0,...j,children:S}),R=Os.jsx(T,{variant:T.Variant.contained,fullWidth:!0,onClick:o,children:Os.jsx(e,{id:"hYgDIe",message:"Create"})});if(0===p)return Os.jsx(T,{fullWidth:!0,...j,onClick:()=>{n({type:PL.SetCurrentStep,payload:1})},children:S});const L=!m||A.isNaN()||A.lte(0),M=!f||w.isNaN()||w.lte(0);if(1===p){if(E)return I;if(a){if(!m||!f)return I}else{if(L)return I;if(k.needShowTokenStatusButton||k.insufficientBalance)return Os.jsx(kT,{status:k,buttonProps:j});if(!l){if(M)return I;if(C.needShowTokenStatusButton||C.insufficientBalance)return Os.jsx(kT,{status:C,buttonProps:j})}if(!s){if(!f)return I;const e=new i(x),t=Math.min(f.decimals,16);if(!x||e.isNaN()||e.lt(`1e-${t}`)||e.gt(JR))return I;const n=new i(v);if(!v||n.isNaN()||n.lt(0)||n.gt(h===UR.pegged?$R:KR))return I}if(d)return I;if(rL({chainId:m.chainId,baseToken:m,quoteToken:f}))return I}return Os.jsx(T,{fullWidth:!0,...j,onClick:()=>{n({type:PL.SetCurrentStep,payload:2})},children:S})}const O=new i(b),B=!b||O.isNaN()||O.lt(QR)||O.gt(GR);return 2===p?a?Os.jsx(T,{fullWidth:!0,...j,onClick:()=>{n({type:PL.SetCurrentStep,payload:3})},children:S}):B?I:R:3===p?B?I:Os.jsx(T,{fullWidth:!0,...j,onClick:()=>{n({type:PL.SetCurrentStep,payload:4})},children:S}):4===p?L||M?I:k.needShowTokenStatusButton||k.insufficientBalance?Os.jsx(kT,{status:k,buttonProps:j}):C.needShowTokenStatusButton||C.insufficientBalance?Os.jsx(kT,{status:C,buttonProps:j}):R:null}function zL({state:t,dispatch:n,isPeggedVersion:i,isStandardVersion:o,isSingleTokenVersion:a,fiatPriceLoading:s}){const{currentStep:l}=t,d=g(),{isMobile:c}=wy(),u=Hy(),{onlyChainId:p,chainId:h}=hf(),[m,y]=ct(!1),{getCreateParams:x}=HL(t),v=Ot({mutationFn:()=>Fn(this,void 0,void 0,(function*(){const e=yield x();if(!e)return;(yield u.execute(r._({id:"8OiU8L",message:"Pool Creation"}),Object.assign({opcode:By.TX,desc:"Create pool"},e),{early:!0,metadata:{[t.selectedVersion===UR.marketMakerPool?Ey.createDPPPool:t.selectedVersion===UR.pegged?t.selectedSubPeggedVersion===VR.DSP?Ey.createDSPPool:Ey.createGSPPool:Ey.createDVMPool]:"1"}}))===Sy.Submitted&&setTimeout((()=>{fw.getState().push({type:pw.Pool,params:{tab:cS.myCreated}})}),100)}))});return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:Object.assign({position:"sticky",left:0,right:0,bottom:0,backgroundColor:d.palette.background.paperContrast,px:20,py:20},c?{}:{position:"static",backgroundColor:"transparent",py:0}),children:[1==l&&Os.jsx(qL,{chainId:h,baseToken:t.baseToken,quoteToken:t.quoteToken}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[0===l&&c&&Os.jsx(T,{variant:T.Variant.second,fullWidth:!0,onClick:()=>{fw.getState().back()},children:Os.jsx(e,{id:"dEgA5A",message:"Cancel"})}),l>0&&Os.jsx(T,{variant:T.Variant.second,fullWidth:!0,onClick:()=>{n({type:PL.SetCurrentStep,payload:l-1})},children:Os.jsx(e,{id:"iH8pgl",message:"Back"})}),Os.jsx(sb,{chainId:p,variant:T.Variant.contained,fullWidth:!0,includeButton:!0,children:Os.jsx(ZL,{state:t,dispatch:n,openConfirm:()=>{y(!0)},isPeggedVersion:i,isStandardVersion:o,isSingleTokenVersion:a,fiatPriceLoading:s})})]})]}),Os.jsx(UL,{on:m,onClose:()=>y(!1),state:t,isModify:!1,onConfirm:v.mutate,loading:v.isPending})]})}function QL({selected:e}){const t=g();return Os.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{marginLeft:"auto",flexShrink:0},children:[Os.jsx("rect",{x:"0.5",y:"0.5",width:"17",height:"17",rx:"8.5",stroke:e?t.palette.success.main:t.palette.text.secondary}),e&&Os.jsx("rect",{x:"4.5",y:"4.5",width:"9",height:"9",rx:"4.5",fill:t.palette.success.main,stroke:t.palette.success.main})]})}function GL({title:e,subTitle:t,description:n,selected:r,onClick:i,children:o,sx:a,titleSx:s}){const l=g(),d="light"===l.palette.mode;return Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",p:20,backgroundColor:l.palette.background.tag,borderWidth:1,borderColor:r?l.palette.primary.main:"transparent",borderStyle:"solid",borderRadius:12,flexWrap:"wrap",justifyContent:"flex-start",textAlign:"left","&:hover":{borderColor:l.palette.primary.main}},a),component:y,onClick:i,children:[Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between",typography:"caption",pr:2,color:r?d?l.palette.text.primary:l.palette.primary.main:l.palette.text.primary},s),children:[e,t,Os.jsx(QL,{selected:r})]}),Os.jsx(f,{sx:{mt:8,typography:"body2",width:"100%",textAlign:"left",color:r?d?l.palette.text.primary:l.palette.primary.main:l.palette.text.secondary},children:n}),o]})}function YL({errorMsg:e,isCustomized:t,onClick:n,value:i,onChange:o}){const a=g(),s=lt((()=>!(!i||"0"===i||Number(i))),[i]);return Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{sx:{py:12,px:20,backgroundColor:a.palette.background.paper,borderColor:t&&e||s?a.palette.error.main:t?a.palette.primary.main:a.palette.border.main,borderWidth:1,borderStyle:"solid",borderRadius:12,display:"flex",alignItems:"center"},onClick:n,children:Os.jsx(hy,{value:t?i:"",onChange:o,suffix:Os.jsx(QL,{selected:t}),placeholder:r._({id:"8Tg/JR",message:"Custom"}),sx:{backgroundColor:"transparent","& input":{typography:"body1",height:36,lineHeight:"36px",p:a.spacing(0),color:a.palette.text.primary,"&::placeholder":{color:a.palette.text.disabled,fontWeight:600,typography:"body1",lineHeight:1,position:"relative"}}}})}),e&&Os.jsx(f,{sx:{typography:"h6",color:"error.main",mt:6},children:e})]})}const XL=()=>[{title:"0.01%",description:r._({id:"yzjPpo",message:"Fees will be the same as in most other pools."}),value:"0.01"},{title:"0.3%",description:r._({id:"OJOe+K",message:"Set the fee to the same as most other pools"}),value:zR,tag:"99% Default"},{title:"1%",description:"Most suitable for swapping exotic assets.",value:"1"}];function JL(){const e=g();return lt((()=>XL().map((t=>t.value===zR?Object.assign(Object.assign({},t),{tagBackgroundColor:C(e.palette.purple.main,.1),tagColor:e.palette.purple.main}):t))),[e.palette.purple.main])}const KL=e=>{if(!e)return"";const t=new i(e);return t.isNaN()||!t.lt(QR)&&!t.gt(GR)?"":r._({id:"GSt7YT",message:"The fee rate must be between 0.01% to 10%"})},_L=(e,t)=>{if(!e)return"";const n=new i(e);if(!n.isNaN()&&(n.lt(0)||n.gt(t===UR.pegged?$R:KR)))switch(t){case UR.standard:case UR.singleToken:case UR.marketMakerPool:return r._({id:"3U+Oti",message:"he slippage coefficient needs to be greater than or equal to 0, and less than or equal to 1."});case UR.pegged:return r._({id:"LDprZB",message:"The slippage coefficient needs to be greater than 0, and less than 0.1."})}return""};function $L({dispatch:t,feeRate:n,isFeeRateCustomized:r}){const i=g(),o=JL(),a=lt((()=>KL(n)||""),[n]);return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:12,px:20},children:[o.map((e=>{const o=!r&&n===e.value;return Os.jsx(GL,{title:e.title,description:e.description,onClick:()=>{t({type:PL.UpdateIsFeeRateCustomized,payload:!1}),t({type:PL.UpdateFeeRate,payload:e.value})},selected:o,subTitle:e.tag?Os.jsx(wL,{color:e.tagColor,backgroundColor:e.tagBackgroundColor,tagKey:e.tag}):void 0,sx:{backgroundColor:i.palette.background.paper,borderColor:o?i.palette.primary.main:i.palette.border.main}},e.value)})),Os.jsx(f,{sx:{mt:8},children:Os.jsx(YL,{errorMsg:a,isCustomized:r,onClick:()=>{t({type:PL.UpdateFeeRate,payload:""}),t({type:PL.UpdateIsFeeRateCustomized,payload:!0})},value:n,onChange:e=>{t({type:PL.UpdateFeeRate,payload:e})}})})]}),Os.jsx(f,{sx:{typography:"body2",mt:20,color:"text.secondary",px:20},children:Os.jsx(e,{id:"0b0AkA",message:"* Please note that the Fee Rate cannot be modified after the pool is created"})})]})}function eM({on:t,onClose:n,onConfirm:i}){return Os.jsx(ET,{open:t,onClose:n,onConfirm:i,title:r._({id:"t+LmjM",message:"Initial Price Alert"}),modal:!0,children:Os.jsx(e,{id:"yXm1vH",message:"The initial price is different from the current market price, which may cause your pool to be arbitraged"})})}const tM=({title:e,children:t,sx:n})=>{const r=g();return Os.jsxs(f,{sx:Object.assign({mx:20,display:"flex",flexDirection:"column",alignItems:"stretch",gap:12},n),children:[Os.jsx(f,{sx:{typography:"body2",color:r.palette.text.primary,fontWeight:500,display:"flex",alignItems:"center"},children:e}),t]})};function nM({selectedVersion:t,isStandardVersion:n,isSingleTokenVersion:o,isFixedRatio:a,leftTokenAddress:s,baseToken:l,quoteToken:d,fixedRatioPrice:c,dispatch:u,priceInfo:p}){const h=g(),[m,x]=ct(!1),{versionMap:v}=HR(),{initPriceLabel:b,initPriceTips:k,initPriceTipsLink:j}=v[t],T=s===(null==l?void 0:l.address),E=T?null==l?void 0:l.symbol:null==d?void 0:d.symbol,R=T?null==d?void 0:d.symbol:null==l?void 0:l.symbol,{currentPrice:L,isErrorPrice:M,isNullPrice:O,fiatPriceLoading:B}=p,D=T?null==d?void 0:d.decimals:null==l?void 0:l.decimals,N=lt((()=>{if(!d)return"";const e=function(e,t,n){if(!t)return"";const o=new i(t),a=Math.min(n,16),s=Number(`1e-${a}`);if(e!==UR.standard&&!o.isNaN()&&(o.lt(s)||o.gt(JR))){const t=s.toFixed(a);switch(e){case UR.pegged:case UR.singleToken:return r._({id:"P4iKEj",message:"The initial price needs to be greater than {min} and less than 100,000,000",values:{min:t}});case UR.marketMakerPool:return r._({id:"kdzjmC",message:"The mid price needs to be greater than {min} and less than 100,000,000",values:{min:t}})}}return""}(t,c,d.decimals);return e||""}),[c,d,t]),F=lt((()=>!(!c||"0"===c||Number(c))),[c]);return Os.jsxs(Os.Fragment,{children:[Os.jsx(tM,{title:Os.jsxs(Os.Fragment,{children:[b,k&&Os.jsx(P,{title:Os.jsxs(Os.Fragment,{children:[k,j?Os.jsxs(Os.Fragment,{children:["\n",Os.jsxs(f,{component:"a",href:j,target:"_blank",rel:"noopener noreferrer",sx:{color:"primary.main",textDecoration:"underline"},onClick:e=>{e.stopPropagation()},children:[Os.jsx(e,{id:"NgeSlx",message:"Learn More"}),">"]})]}):""]}),ml:4,sx:{width:14,height:14,alignItems:"center"}})]}),sx:{mt:20},children:Os.jsxs(f,{sx:{pt:n?11:19,px:19,pb:11,borderWidth:1,borderStyle:"solid",borderColor:N||F?"error.main":h.palette.background.input,borderRadius:8,backgroundColor:h.palette.background.input,display:"flex",flexDirection:"column",alignItems:"stretch",gap:20},children:[n?null:Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{typography:"body2",color:h.palette.text.primary,display:"flex",alignItems:"center"},children:[Os.jsxs(f,{sx:{fontWeight:600,color:h.palette.text.disabled,flexShrink:0},children:["1 ",null!=E?E:"-"," ="]}),Os.jsx(hy,{value:c,onChange:e=>{u({type:PL.UpdateFixedRatioPrice,payload:e})},readOnly:a,sx:{pl:0,pr:0,mt:0,flex:"1 1 auto","& input":{textAlign:"right",typography:"h5",height:25,py:0,px:8,color:h.palette.text.primary,"&::placeholder":{color:h.palette.text.disabled}}}}),Os.jsx(f,{sx:{typography:"body2",fontWeight:600,color:h.palette.text.disabled,flexShrink:0},children:null!=R?R:"-"}),Os.jsx(f,{sx:{display:"flex",alignItems:"center"},component:y,onClick:()=>{u({type:PL.ToggleLeftToken})},children:Os.jsx(I,{weak:!0,component:As.Switch,sx:{marginLeft:8,p:h.spacing(2),color:h.palette.text.primary,backgroundColor:C(h.palette.primary.main,.1),borderRadius:"50%"}})})]}),N&&Os.jsx(f,{sx:{typography:"h6",color:"error.main",mt:-14},children:N})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:n?"flex-start":"flex-end",typography:"h6",color:h.palette.text.primary,fontWeight:500},children:["=",Os.jsx(e,{id:"pdZiL7",message:"Current Market Price:"})," ",B?Os.jsx(w,{sx:{borderRadius:4},width:50,height:17}):O?Os.jsx(A,{title:Os.jsx(e,{id:"mObS+5",message:"Failed to get price of the token"}),children:Os.jsx(f,{component:As.Warn,sx:{width:14,height:14,color:h.palette.error.main,typography:"h6"}})}):An({input:L,decimals:D})," ",R,M||o?null:Os.jsx(S,{checked:a,onChange:e=>{if(e.target.checked){if(u({type:PL.UpdateIsFixedRatio,payload:!0}),!D)throw new Error("currentTokenDecimals is undefined");L&&!L.isNaN()&&u({type:PL.UpdateFixedRatioPrice,payload:L.dp(D,i.ROUND_DOWN).toString()})}else x(!0)},sx:{ml:8}})]})]})}),Os.jsx(eM,{on:m,onClose:()=>x(!1),onConfirm:()=>{u({type:PL.UpdateIsFixedRatio,payload:!1})}})]})}function rM({selectedVersion:e,selectedSubPeggedVersion:t,baseToken:n,quoteToken:r,initPrice:i,dispatch:o}){var a;const s=g(),{versionMap:l,subPeggedVersionList:d}=HR(),{initPriceLabel:c}=l[e];return n&&r?Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{mt:8,display:"flex",flexDirection:"column",alignItems:"center",gap:4},children:[Os.jsx(f,{sx:{typography:"body2",color:s.palette.text.secondary,fontWeight:500},children:c}),Os.jsxs(f,{sx:{typography:"h5",color:s.palette.text.primary,fontWeight:600},children:["1 ",null==n?void 0:n.symbol,"=",null!==(a=tL({midPrice:void 0,quoteToken:r,selectedVersion:e,initPrice:i}))&&void 0!==a?a:"-"," ",r.symbol]})]}),Os.jsx(f,{sx:{mt:20,display:"flex",flexDirection:"column",gap:12,px:20},children:d.map((e=>{const n=t===e.version;return Os.jsx(GL,{title:e.title,description:e.description,onClick:()=>{o({type:PL.SelectNewSubPeggedVersion,payload:e.version})},selected:n,subTitle:void 0,sx:{backgroundColor:s.palette.background.paper,borderColor:n?s.palette.primary.main:s.palette.border.main},titleSx:{typography:"body1",fontWeight:600}},e.version)}))})]}):null}function iM({title:e,value:t,onChange:n}){const r=g();return Os.jsxs(f,{sx:{flexGrow:1,flexShrink:1,flexBasis:"50%",display:"flex",alignItems:"center",px:15,py:7,borderWidth:1,borderStyle:"solid",borderColor:r.palette.border.main,borderRadius:8,backgroundColor:r.palette.background.input},children:[Os.jsx(f,{sx:{color:r.palette.text.primary,typography:"body1",fontWeight:500,flexShrink:0},children:e}),Os.jsx(hy,{value:t,onChange:n,suffix:"%",placeholder:"0",sx:{mt:0,display:"flex",alignItems:"center",width:"100%",typography:"h5",lineHeight:"32px",color:r.palette.text.disabled,"& input":{textAlign:"right",py:0,px:8,color:r.palette.text.primary,"&::placeholder":{opacity:1,color:r.palette.text.disabled,fontWeight:600,typography:"h5",lineHeight:1,position:"relative"}}}})]})}const oM=({baseToken:t,quoteToken:n,initPrice:r,peggedBaseTokenRatio:o,peggedQuoteTokenRatio:a,baseAmount:s,quoteAmount:l,dispatch:d})=>{var c,u;const p=g(),[h,m]=lt((()=>{const{base:e,quote:t}=nL({initPrice:r});return[e?e.multipliedBy(100).toString():null,t?t.multipliedBy(100).toString():null]}),[r]),y=""===o&&""===a,[x,v]=lt((()=>{var e,o;const a=null!==(e=null==t?void 0:t.decimals)&&void 0!==e?e:0,d=null!==(o=null==n?void 0:n.decimals)&&void 0!==o?o:0,c=new i(s).dp(a,i.ROUND_DOWN).multipliedBy(`1e${a}`),u=new i(l).dp(d,i.ROUND_DOWN).multipliedBy(`1e${d}`),p=new i(r).multipliedBy(`1e${18-a+d}`).dp(0,i.ROUND_DOWN),h=u.lt(c.multipliedBy(p).div(1e18))?u.multipliedBy(1e18).div(p):c,m=new i(1001);if(m.gt(h))return[new i(1),"100%"];const f=m.dividedBy(h);return[f,Bn({input:f})]}),[s,null==t?void 0:t.decimals,r,l,null==n?void 0:n.decimals]),b=lt((()=>!!x.lte("0.0000000001")||null!=h&&o===h&&null!=m&&a===m),[x,o,a,h,m]),A=`${null==t?void 0:t.symbol}:${null==n?void 0:n.symbol}=${h}%:${m}%`;return Os.jsxs(tM,{title:Os.jsx(e,{id:"OuSseo",message:"Ratio Settings"}),children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4},children:[Os.jsx(iM,{title:null!==(c=null==t?void 0:t.symbol)&&void 0!==c?c:"",value:o,onChange:e=>{d({type:PL.UpdatePeggedBaseTokenRatio,payload:e})}}),Os.jsx(f,{sx:{color:p.palette.text.primary,typography:"body2",fontWeight:500,width:14,flexShrink:0,flexGrow:0,textAlign:"center"},children:":"}),Os.jsx(iM,{title:null!==(u=null==n?void 0:n.symbol)&&void 0!==u?u:"",value:a,onChange:e=>{d({type:PL.UpdatePeggedQuoteTokenRatio,payload:e})}})]}),Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:20,px:19,pt:19,pb:11,borderRadius:16,borderWidth:1,borderColor:b||y?p.palette.border.main:"transparent",borderStyle:"solid",backgroundColor:b||y?p.palette.background.paper:C(p.palette.warning.main,.1)},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[y?null:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8,color:b?p.palette.text.primary:p.palette.warning.main,typography:"body1",fontWeight:600},children:[b?null:Os.jsx(As.Warn,{}),Os.jsx(e,{id:"x3muNy",message:"Liquidity Burn Ratio"}),": ",v]}),Os.jsx(f,{sx:{color:p.palette.text.secondary,typography:"h6",textAlign:"center","&>strong":{color:b?p.palette.text.primary:p.palette.warning.main}},children:y?Os.jsx(e,{id:"pQJBKk",message:"The closer the provided asset ratio is to the recommended ratio ({recommendRatioText}), the smaller the portion burned.",values:{recommendRatioText:A}}):Os.jsx(e,{id:"ZlQ83E",message:"<0>{lostRatio}</0> of the initial liquidity you provide will be burned. <1/>The closer the provided asset ratio is to the recommended ratio ({recommendRatioText}), the smaller the portion burned.",values:{lostRatio:v,recommendRatioText:A},components:{0:Os.jsx("strong",{}),1:Os.jsx("br",{})}})})]}),y||!b?Os.jsx(T,{variant:T.Variant.outlined,fullWidth:!0,size:T.Size.small,onClick:()=>{d({type:PL.UpdatePeggedBaseTokenRatio,payload:null!=h?h:""})},sx:{border:`solid 1px ${p.palette.text.primary}`,color:p.palette.text.primary,"&:hover":{background:C(p.palette.text.primary,.1)}},children:Os.jsx(e,{id:"NjdGps",message:"Use the recommended ratio"})}):null]})]})};function aM({open:e,onClose:t,afterClose:n,title:r,titleCenter:i,rightSlot:o,canBack:a=!0,children:s,width:l=420,height:d,testId:c}){const u=g(),{isMobile:p}=wy();return Os.jsx(E,{open:e,onClose:t,container:p?document.querySelector(`.${Ev}`):void 0,disableEnforceFocus:!0,children:Os.jsxs(f,{sx:Object.assign({backgroundColor:"background.paper",display:"flex",height:d,flexDirection:"column",justifyContent:"center",alignItems:"center",outline:0,overflow:"hidden","& > div":{width:"100%"}},p?{width:"100%",borderRadius:u.spacing(16,16,0,0)}:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:l,maxWidth:"95%",minHeight:200,maxHeight:"80%",borderRadius:16}),"data-testid":c,children:[r?Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:i?"center":"space-between",p:20,width:"100%",boxSizing:"border-box"},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",typography:"caption"},children:r}),o,!o&&a&&Os.jsx(f,{component:As.Error,sx:{color:"text.secondary",cursor:"pointer"},onClick:()=>{t&&t(),null==n||n()}})]}):"",s]})})}var sM;function lM(){return lM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lM.apply(null,arguments)}const dM=e=>ot.createElement("svg",lM({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),sM||(sM=ot.createElement("g",{id:"ICON/18px/arrow/\\xE6\\x94\\xB6\\xE8\\xB5\\xB7/Dark"},ot.createElement("path",{id:"\\xE4\\xB8\\x89\\xE8\\xA7\\x92\\xE5\\xBD\\xA2",fillRule:"evenodd",clipRule:"evenodd",d:"M6.58398 12.376C6.78189 12.6728 7.21811 12.6728 7.41603 12.376L10.4818 7.77735C10.7033 7.44507 10.4651 7 10.0657 7H3.93426C3.53491 7 3.29672 7.44507 3.51823 7.77735L6.58398 12.376Z",fill:"currentColor"}))));function cM({dispatch:t,slippageCoefficient:n,selectedVersion:i,isCustomized:o,isStandardVersion:a}){const s=g(),[l,d]=ct(!1),[c,u]=ct(n),p=function({selectedVersion:e}){const t=g();return lt((()=>{const n=t.palette.background.paperDarkContrast,i=t.palette.text.disabled,o=t.palette.purple.main,a=C(o,.1);return e===UR.pegged?[{tag:"",description:r._({id:"PPqGw9",message:"Applicable to pegged assets with a fixed price and no fluctuation"}),value:"0",title:"K=0",tagBackgroundColor:"transparent",tagColor:"transparent"},{tag:r._({id:"nTWWCZ",message:"Low"}),description:r._({id:"L4nQwl",message:"Suitable for stablecoins with price fluctuations within 0.5%"}),value:"0.0001",title:"K=0.0001",tagBackgroundColor:a,tagColor:o},{tag:r._({id:"agPptk",message:"Medium"}),description:r._({id:"FrP5tr",message:"Suitable for stablecoins with price fluctuations within 2%"}),value:"0.0005",title:"K=0.0005",tagBackgroundColor:n,tagColor:i},{tag:r._({id:"yx/fMc",message:"High"}),description:r._({id:"bC0iyq",message:"Suitable for stablecoins with price fluctuations within 10%"}),value:"0.002",title:"K=0.002",tagBackgroundColor:n,tagColor:i}]:[{tag:r._({id:"agPptk",message:"Medium"}),description:r._({id:"VXTSOE",message:"Suitable for most situations."}),value:"0.5",title:"K=0.5",tagBackgroundColor:n,tagColor:i},{tag:r._({id:"nTWWCZ",message:"Low"}),description:r._({id:"DPi/hO",message:"Results in a relatively fixed price."}),value:"0.01",title:"K=0.01",tagBackgroundColor:n,tagColor:i},{tag:r._({id:"yx/fMc",message:"High"}),description:r._({id:"fKYdE9",message:"Results in a more volatile price."}),value:"1",title:"K=1",tagBackgroundColor:a,tagColor:o}]}),[e,t.palette])}({selectedVersion:i}),[h,m]=ct(n);h!==n&&(m(n),u(n));const x=lt((()=>{const e=_L(c,i);return null!=e?e:""}),[i,c]),v=lt((()=>!(!c||"0"===c||Number(c))),[c]),b=Boolean(x)||v||o&&!c;return Os.jsxs(Os.Fragment,{children:[Os.jsx(tM,{title:Os.jsxs(Os.Fragment,{children:[Os.jsx(e,{id:"sjn3tj",message:"Slippage Coefficient"}),Os.jsx(P,{title:r._({id:"+/wf6Z",message:"The smaller the slippage coefficient, the lower the slippage for traders, and the deeper the market depth."}),ml:4,sx:{width:14,height:14}})]}),sx:{mt:20},children:Os.jsxs(f,{component:y,sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:20,py:8,color:s.palette.text.primary,borderRadius:8,backgroundColor:s.palette.background.input,"&:hover":{backgroundColor:s.palette.hover.default},"&[disabled]>svg":{color:s.palette.text.disabled}},disabled:a,onClick:a?void 0:()=>{d(!0)},children:[Os.jsx(f,{sx:{typography:"h5",fontWeight:600,lineHeight:"32px"},children:n}),Os.jsx(f,{component:dM,sx:{flexShrink:0,width:18,height:18}})]})}),Os.jsx(aM,{open:l,onClose:()=>d(!1),title:Os.jsxs(f,{children:[Os.jsx(e,{id:"sjn3tj",message:"Slippage Coefficient"}),Os.jsx(P,{title:r._({id:"+/wf6Z",message:"The smaller the slippage coefficient, the lower the slippage for traders, and the deeper the market depth."}),ml:8})]}),children:Os.jsxs(f,{sx:{flex:1,overflowY:"auto"},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:12,p:s.spacing(8,28,28)},children:[p.map((e=>{const n=!o&&c===e.value;return Os.jsx(GL,{title:e.title,description:e.description,onClick:()=>{t({type:PL.UpdateIsSlippageCoefficientCustomized,payload:!1}),u(e.value)},selected:n,subTitle:e.tag?Os.jsx(wL,{color:e.tagColor,backgroundColor:e.tagBackgroundColor,tagKey:e.tag}):void 0,sx:{backgroundColor:s.palette.background.paper,borderColor:n?s.palette.primary.main:s.palette.border.main},titleSx:{typography:"body1"}},e.value)})),Os.jsx(f,{sx:{mt:8},children:Os.jsx(YL,{errorMsg:x,isCustomized:o,onClick:()=>{o||u(""),t({type:PL.UpdateIsSlippageCoefficientCustomized,payload:!0})},value:c,onChange:e=>{u(e)}})})]}),Os.jsx(f,{sx:{position:"sticky",bottom:0,px:20,py:16,backgroundColor:"background.paperContrast"},children:Os.jsx(T,{fullWidth:!0,disabled:b,onClick:()=>{t({type:PL.UpdateSlippageCoefficient,payload:c}),d(!1)},children:Os.jsx(e,{id:"7VpPHA",message:"Confirm"})})})]})})]})}function uM({token:t,oppositeTokenAddress:n,dispatch:r,tokenSelectOnChange:i}){var o;const a=g(),{chainId:s,account:l}=At(),[d,c]=at.useState(!1),u=It(Object.assign({},$a.getFetchTokenQuery(s,null==t?void 0:t.address,l)));return t?Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{component:y,sx:{display:"flex",alignItems:"center",px:20,py:8,borderRadius:8,backgroundColor:a.palette.background.input,"&:hover":{backgroundColor:a.palette.hover.default}},onClick:()=>{c(!0)},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[Os.jsx(ey,{address:t.address,marginRight:0,width:24,height:24,chainId:t.chainId||s,noShowChain:!0,sx:{flexShrink:0}}),Os.jsx(f,{sx:{typography:"h5",color:a.palette.text.primary,fontWeight:600,lineHeight:"32px",flexShrink:0},children:t.symbol}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",typography:"h6",fontWeight:500,color:a.palette.text.secondary,wordBreak:"break-all"},children:["(",Os.jsx(e,{id:"fsBGk0",message:"Balance"}),": ",!t.address||u.isLoading?Os.jsx(x,{}):An({input:null===(o=u.data)||void 0===o?void 0:o.balance,decimals:t.decimals}),")"]})]}),Os.jsx(f,{component:dM,sx:{flexShrink:0,ml:"auto",width:18,height:18}})]}),Os.jsx(ky,{value:t,open:d,chainId:s,occupiedAddrs:[n],occupiedChainId:t.chainId,onClose:()=>{c(!1)},onTokenChange:(e,t)=>{if(!Array.isArray(e)){if(t)return r({type:PL.SwitchTokens}),void c(!1);i(e),c(!1)}},modal:!0})]}):null}const pM=({baseToken:t,quoteToken:n,dispatch:r})=>{var i,o;return Os.jsxs(tM,{title:Os.jsx(e,{id:"dmiCGN",message:"Select Token Pair"}),children:[Os.jsx(uM,{token:t,oppositeTokenAddress:null!==(i=null==n?void 0:n.address)&&void 0!==i?i:"",dispatch:r,tokenSelectOnChange:e=>{r({type:PL.UpdateBaseToken,payload:e})}}),Os.jsx(uM,{token:n,oppositeTokenAddress:null!==(o=null==t?void 0:t.address)&&void 0!==o?o:"",dispatch:r,tokenSelectOnChange:e=>{r({type:PL.UpdateQuoteToken,payload:e})}})]})};function hM({selectedVersion:e,dispatch:t}){const n=g(),{isMobile:r}=wy(),{versionList:i}=HR(),o="light"===n.palette.mode;return Os.jsx(f,{sx:{display:"flex",flexDirection:"column",gap:12,px:20},children:i.map((n=>{const i=e===n.version;return Os.jsx(GL,{title:n.title,description:n.description,onClick:()=>{t({type:PL.SelectNewVersion,payload:n.version})},selected:i,children:r&&i&&Os.jsx(f,{component:o?n.exampleImgUrl:n.exampleDarkImgUrl,sx:{mt:28,width:"100%",height:88.1}})},n.version)}))})}function mM(){const{defaultBaseToken:t,defaultQuoteToken:n}=ML(),{chainId:o}=hf(),[a,s]=at.useReducer(FL,{currentStep:0,selectedVersion:UR.standard,baseToken:t,quoteToken:n,baseAmount:"",quoteAmount:"",isFixedRatio:!0,initPrice:XR,fixedRatioPrice:YR,leftTokenAddress:null==t?void 0:t.address,feeRate:zR,isFeeRateCustomized:!1,slippageCoefficient:KR,isSlippageCoefficientCustomized:!1,peggedBaseTokenRatio:"",peggedQuoteTokenRatio:""});!t||a.baseToken&&a.baseToken.chainId===o||s({type:PL.UpdateBaseToken,payload:t}),!n||a.quoteToken&&a.quoteToken.chainId===o||s({type:PL.UpdateQuoteToken,payload:n});const{isMobile:l}=wy(),{versionMap:d}=HR(),c=d[a.selectedVersion],u=a.selectedVersion===UR.singleToken,p=a.selectedVersion===UR.standard,h=a.selectedVersion===UR.pegged,m=u?a.quoteToken:a.baseToken,g=u?a.baseToken:a.quoteToken,y=WL({isSingleTokenVersion:u,leftTokenAddress:a.leftTokenAddress,baseToken:a.baseToken,quoteToken:a.quoteToken,dispatch:s}),x=new i(a.peggedBaseTokenRatio).div(100).dp(eL,i.ROUND_DOWN),v=new i(a.peggedQuoteTokenRatio).div(100).dp(eL,i.ROUND_DOWN),b=h&&x.lte(0),A=h&&v.lte(0),w=Os.jsxs(f,{sx:{px:20},children:[Os.jsx(Qy,{canClickBalance:!0,showPercentage:!0,amt:u?a.quoteAmount:a.baseAmount,onInputChange:u?void 0:e=>{s({type:u?PL.UpdateQuoteAmount:PL.UpdateBaseAmount,payload:e})},readOnly:u||b,inputReadonlyTooltip:b?r._({id:"t3d3/V",message:"ratio is 0"}):void 0,token:m,occupiedAddrs:g?[g.address]:void 0,occupiedChainId:o,chainId:o,onTokenChange:h?void 0:(e,t)=>{s(t?{type:PL.SwitchTokens}:{type:u?PL.UpdateQuoteToken:PL.UpdateBaseToken,payload:e})}}),Os.jsx(zy,{}),Os.jsx(Qy,{canClickBalance:!0,showPercentage:!0,amt:u?a.baseAmount:a.quoteAmount,onInputChange:e=>{s({type:u?PL.UpdateBaseAmount:PL.UpdateQuoteAmount,payload:e})},readOnly:p&&a.isFixedRatio&&!!a.fixedRatioPrice||A,inputReadonlyTooltip:A?r._({id:"t3d3/V",message:"ratio is 0"}):r._({id:"5QDjef",message:"The token amount is calculated by initial price."}),token:g,occupiedAddrs:m?[m.address]:void 0,occupiedChainId:o,chainId:o,onTokenChange:(e,t)=>{s(t?{type:PL.SwitchTokens}:{type:u?PL.UpdateBaseToken:PL.UpdateQuoteToken,payload:e})}})]});return Os.jsx(xw,{children:Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"flex-start",height:"100%"},l?{}:{height:"auto",overflowX:"auto"}),children:[l?null:Os.jsxs(f,{sx:{mr:12,flexGrow:1,display:"block",overflow:"hidden"},children:[Os.jsx(jS,{}),Os.jsx(f,{sx:{mt:28,typography:"h4",fontWeight:600,color:"text.primary"},children:Os.jsx(e,{id:"pHQq+U",message:"Pool Setup"})}),Os.jsx(SL,{titleKey:r._({id:"hdIg7i",message:"Select Pool Version"}),index:1,status:0===a.currentStep?"running":"completed"}),Os.jsx(RL,{versionItem:c,status:0===a.currentStep?"running":"completed"},c.version),Os.jsx(SL,{titleKey:r._({id:"lsg9Mi",message:"Parameter Settings"}),index:2,status:0===a.currentStep?"waiting":1===a.currentStep?"running":"completed"}),h?Os.jsx(oL,{status:0===a.currentStep?"waiting":1===a.currentStep?"running":"completed",baseToken:a.baseToken,quoteToken:a.quoteToken,initPrice:a.initPrice,slippageCoefficient:a.slippageCoefficient,selectedVersion:a.selectedVersion,midPrice:void 0}):Os.jsx(TL,{status:0===a.currentStep?"waiting":1===a.currentStep?"running":"completed",baseToken:a.baseToken,quoteToken:a.quoteToken,initPrice:a.initPrice,slippageCoefficient:a.slippageCoefficient,selectedVersion:a.selectedVersion,baseAmount:a.baseAmount,quoteAmount:a.quoteAmount}),h&&Os.jsxs(Os.Fragment,{children:[Os.jsx(SL,{titleKey:r._({id:"6lss/t",message:"Pricing Model"}),index:3,status:a.currentStep>2?"completed":2===a.currentStep?"running":"waiting"}),Os.jsx(EL,{isWaiting:a.currentStep<2,selectedSubPeggedVersion:a.selectedSubPeggedVersion})]}),Os.jsx(SL,{titleKey:r._({id:"Y7rVy0",message:"Fee Rate"}),index:3,status:2===a.currentStep?"running":"waiting"}),Os.jsx(kL,{isWaiting:a.currentStep<(h?3:2),feeRate:a.feeRate}),h&&Os.jsxs(Os.Fragment,{children:[Os.jsx(SL,{titleKey:r._({id:"3ggd2j",message:"Asset ratio within the pool"}),index:5,status:a.currentStep>4?"completed":4===a.currentStep?"running":"waiting"}),Os.jsx(CL,{isWaiting:a.currentStep<4,baseToken:a.baseToken,quoteToken:a.quoteToken,initPrice:a.initPrice,slippageCoefficient:a.slippageCoefficient,selectedVersion:a.selectedVersion,baseAmount:a.baseAmount,quoteAmount:a.quoteAmount,peggedBaseTokenRatio:a.peggedBaseTokenRatio,peggedQuoteTokenRatio:a.peggedQuoteTokenRatio})]})]}),Os.jsxs(f,{sx:Object.assign({flexGrow:1,flexShrink:0,flexBasis:375,borderRadius:0,backgroundColor:"background.paper",minHeight:"100%"},l?{}:{pb:20,borderRadius:16,flexGrow:0,minHeight:"auto",height:"100%",position:"sticky",top:"28px",overflowY:"hidden"}),children:[Os.jsx(IL,{currentStep:a.currentStep,isPeggedVersion:h}),0===a.currentStep&&Os.jsx(hM,{selectedVersion:a.selectedVersion,dispatch:s}),1===a.currentStep&&Os.jsxs(Os.Fragment,{children:[h?Os.jsx(Os.Fragment,{children:Os.jsx(pM,{baseToken:a.baseToken,quoteToken:a.quoteToken,dispatch:s})}):Os.jsxs(Os.Fragment,{children:[Os.jsx(AL,{baseToken:a.baseToken,quoteToken:a.quoteToken,initPrice:a.initPrice,slippageCoefficient:a.slippageCoefficient,selectedVersion:a.selectedVersion,baseAmount:a.baseAmount,quoteAmount:a.quoteAmount}),w]}),Os.jsx(cM,{dispatch:s,slippageCoefficient:a.slippageCoefficient,selectedVersion:a.selectedVersion,isCustomized:a.isSlippageCoefficientCustomized,isStandardVersion:p}),Os.jsx(nM,{selectedVersion:a.selectedVersion,isFixedRatio:a.isFixedRatio,leftTokenAddress:a.leftTokenAddress,baseToken:a.baseToken,quoteToken:a.quoteToken,fixedRatioPrice:a.fixedRatioPrice,dispatch:s,isStandardVersion:p,isSingleTokenVersion:u,priceInfo:y})]}),h&&2===a.currentStep&&Os.jsx(rM,{selectedVersion:a.selectedVersion,selectedSubPeggedVersion:a.selectedSubPeggedVersion,baseToken:a.baseToken,quoteToken:a.quoteToken,initPrice:a.initPrice,dispatch:s}),a.currentStep===(h?3:2)&&Os.jsx($L,{dispatch:s,feeRate:a.feeRate,isFeeRateCustomized:a.isFeeRateCustomized}),h&&4===a.currentStep&&Os.jsxs(Os.Fragment,{children:[Os.jsx(AL,{baseToken:a.baseToken,quoteToken:a.quoteToken,initPrice:a.initPrice,slippageCoefficient:a.slippageCoefficient,selectedVersion:a.selectedVersion,baseAmount:a.baseAmount,quoteAmount:a.quoteAmount}),Os.jsx(oM,{dispatch:s,baseToken:a.baseToken,quoteToken:a.quoteToken,peggedBaseTokenRatio:a.peggedBaseTokenRatio,peggedQuoteTokenRatio:a.peggedQuoteTokenRatio,initPrice:a.initPrice,baseAmount:a.baseAmount,quoteAmount:a.quoteAmount}),Os.jsx(tM,{title:Os.jsx(e,{id:"E4LM3N",message:"Add Initial Liquidity"}),sx:{mt:20},children:Os.jsx(f,{sx:{mx:-20},children:w})})]}),Os.jsx(f,{sx:Object.assign({pb:160},l?{}:{pb:28})}),Os.jsx(zL,{state:a,dispatch:s,isPeggedVersion:h,isStandardVersion:p,isSingleTokenVersion:u,fiatPriceLoading:y.fiatPriceLoading})]})]})})}function fM({open:t,onClose:n,title:r,children:i,singleBtn:o,danger:a,singleBtnText:s,cancelText:l,confirmText:d,disabledConfirm:c,confirmLoading:u,isManualClose:p,onConfirm:h}){const m=aM;return Os.jsx(m,{open:t,onClose:n,title:Os.jsx(f,{sx:{textAlign:"center"},children:r}),canBack:!1,titleCenter:!0,children:Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,width:"100%"},children:[Os.jsx(f,{sx:{typography:"body2",color:r?"text.secondary":"text.primary",textAlign:"center",wordBreak:"break-all",mt:20,px:36},children:i}),o?Os.jsx(f,{sx:{px:20},children:Os.jsx(T,{fullWidth:!0,variant:T.Variant.outlined,danger:a,sx:{mt:32,mb:20},onClick:()=>{n()},children:s||Os.jsx(e,{id:"DPfwMq",message:"Done"})})}):Os.jsxs(f,{sx:{mt:24,mb:20,mx:20,display:"flex",alignItems:"center","& > button":{flex:1}},children:[Os.jsx(T,{variant:T.Variant.second,onClick:()=>{n()},children:l||Os.jsx(e,{id:"dEgA5A",message:"Cancel"})}),Os.jsx(T,{sx:{ml:8},variant:T.Variant.outlined,danger:a,disabled:c,isLoading:u,onClick:()=>{h&&h(),p||n()},children:d||Os.jsx(e,{id:"7VpPHA",message:"Confirm"})})]})]})})}function gM({open:t,onClose:n,alertContent:i,onConfirm:o}){const a=g(),[s,l]=at.useState(!1),d=r._({id:"LQU+Dm",message:"Risk Disclaimer"});return Os.jsx(aM,{open:t,onClose:n,title:d,canBack:!1,titleCenter:!0,children:Os.jsxs(f,{sx:{flex:1,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[Os.jsx(f,{sx:{mb:20,mx:20,maxHeight:275,overflowY:"auto",borderWidth:1,borderRadius:10,borderStyle:"solid",borderColor:"border.main",p:a.spacing(20),typography:"body2",backgroundColor:a.palette.background.input,color:a.palette.text.primary,textAlign:"left"},children:i}),Os.jsxs(f,{sx:{padding:20,pt:12,backgroundColor:a.palette.background.paperContrast},children:[Os.jsxs(f,{component:"label",sx:{display:"flex",alignItems:"center",gap:8,typography:"body2",cursor:"pointer",color:"text.secondary",textAlign:"left","& a":{fontWeight:600,color:"primary.main","&:hover":{textDecoration:"underline"}}},children:[Os.jsx(S,{sx:{top:-1},checked:s,onChange:e=>{const{checked:t}=e.target;l(t)}}),Os.jsx(f,{children:Os.jsx(e,{id:"dqWPbT",message:"I have read, understand, and agree to the <0>Terms of Service</0>.",components:{0:Os.jsx("a",{href:"https://docs.dodoex.io/home/terms-of-service",target:"_blank",rel:"noopener noreferrer"})}})})]}),Os.jsx(f,{sx:{mt:12,display:"flex",alignItems:"center"},children:Os.jsx(T,{sx:{},disabled:!s,fullWidth:!0,onClick:()=>{l(!1),null==o||o()},children:Os.jsx(e,{id:"7VpPHA",message:"Confirm"})})})]})]})})}function yM({id:e,chainId:t}){var n,r,o,a,s,l,d,c,u,p,h,m,f;const g=t?Gr[t]:"",y=QA().getQuery(le.graphql.fetchPool,{id:e||"",where:{refreshNow:!1,chain:g},liquidityWhere:{chain:g,refreshNow:!1,filterState:{address:e}}}),x=It(Object.assign(Object.assign({},y),{enabled:!!e})),{pair:v,liquidity_list:b}=null!==(n=x.data)&&void 0!==n?n:{},A=null===(o=null===(r=null==b?void 0:b.lqList)||void 0===r?void 0:r[0])||void 0===o?void 0:o.pair;return Object.assign(Object.assign({},x),{poolDetail:v&&t?Object.assign(Object.assign({},v),{address:v.id,type:v.type,chainId:t,baseToken:ns(v.baseToken,t),quoteToken:ns(v.quoteToken,t),miningAddress:null!==(s=null===(a=null==A?void 0:A.miningAddress)||void 0===a?void 0:a[0])&&void 0!==s?s:"",apy:null==A?void 0:A.apy,baseApy:(null==A?void 0:A.apy)?Pn(new i(null!==(l=A.apy.transactionBaseApy)&&void 0!==l?l:0).plus(null!==(d=A.apy.miningBaseApy)&&void 0!==d?d:0)):void 0,quoteApy:Number(null===(c=null==A?void 0:A.apy)||void 0===c?void 0:c.transactionQuoteApy)||Number(null===(u=null==A?void 0:A.apy)||void 0===u?void 0:u.miningQuoteApy)?Pn(new i(null!==(h=null===(p=null==A?void 0:A.apy)||void 0===p?void 0:p.transactionQuoteApy)&&void 0!==h?h:0).plus(null!==(f=null===(m=null==A?void 0:A.apy)||void 0===m?void 0:m.miningQuoteApy)&&void 0!==f?f:0)):void 0,isCpPool:!1,cpAddress:void 0,cpLiquidator:void 0,cpCreator:void 0,cpCreatedAtTimestamp:void 0}):null})}function xM({disabled:t,chainId:n,baseStatus:r,quoteStatus:i,onClick:o}){const{account:a}=At();return a?r.needShowTokenStatusButton||i.needShowTokenStatusButton?Os.jsx(kT,{status:r.needShowTokenStatusButton?r:i,buttonProps:{variant:T.Variant.contained,fullWidth:!0}}):Os.jsx(T,{variant:T.Variant.contained,fullWidth:!0,disabled:t,onClick:()=>o(),children:Os.jsx(e,{id:"7VpPHA",message:"Confirm"})}):Os.jsx(sb,{chainId:n,variant:T.Variant.contained,fullWidth:!0,includeButton:!0})}function vM({state:t,pool:n,loading:o}){var a,s;const{baseToken:l,quoteToken:d,baseAmount:c,quoteAmount:u,initPrice:p,slippageCoefficient:h,feeRate:m}=t,y=It(es.getPMMStateQuery(null==n?void 0:n.chainId,null==n?void 0:n.address,null==n?void 0:n.type,null===(a=null==n?void 0:n.baseToken)||void 0===a?void 0:a.decimals,null===(s=null==n?void 0:n.quoteToken)||void 0===s?void 0:s.decimals)),x=g(),{isMobile:v}=wy(),{account:b}=At(),A=fw(),[w,k]=at.useState(!1),C=y.data&&c?new i(c).minus(y.data.baseReserve):void 0,j=y.data&&u?new i(u).minus(y.data.quoteReserve):void 0,E=null==C?void 0:C.lt(0),S=EA(l,{amount:C}),I=EA(d,{amount:j});let R=!n||o||!c||Number(c)<0||!u||Number(u)<0;if(!R&&d){const e=new i(p),t=Math.min(d.decimals,16);(!p||e.isNaN()||e.lt(`1e-${t}`)||e.gt(JR))&&(R=!0);const n=new i(h);(!h||n.isNaN()||n.lt(0)||n.gt(KR))&&(R=!0);const r=new i(m);(!m||r.isNaN()||r.lt(0)||r.gt(GR))&&(R=!0)}const{modifyDPPMutation:L}=OT({pool:n||void 0});return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:Object.assign(Object.assign({position:"sticky",left:0,right:0,bottom:0,backgroundColor:x.palette.background.paperContrast,px:20,py:20},v?{}:{position:"static",backgroundColor:"transparent",py:0}),{display:"flex",alignItems:"center",gap:8}),children:[v&&!!b&&Os.jsx(T,{variant:T.Variant.second,fullWidth:!0,onClick:()=>{A.back()},children:Os.jsx(e,{id:"dEgA5A",message:"Cancel"})}),Os.jsx(xM,{disabled:R,chainId:null==n?void 0:n.chainId,baseStatus:S,quoteStatus:I,onClick:()=>k(!0)})]}),Os.jsx(UL,{on:w,onClose:()=>k(!1),state:t,isModify:!0,loading:L.isPending,onConfirm:()=>{var e,n;L.mutate({txTitle:r._({id:"KRnA5J",message:"Set pool parameters"}),baseAmount:null!==(e=null==C?void 0:C.toString())&&void 0!==e?e:"",quoteAmount:null!==(n=null==j?void 0:j.toString())&&void 0!==n?n:"",isRemove:E,feeRate:t.feeRate,initPrice:t.initPrice,slippageCoefficient:t.slippageCoefficient,submittedBack:()=>{k(!1),A.push({type:pw.Pool,params:{tab:cS.myCreated}})}})}})]})}function bM({dispatch:t,feeRate:n,isCustomized:i}){const o=g(),[a,s]=at.useState(!1),[l,d]=at.useState(n),c=JL();!l&&n&&d(n);const u=KL(l),p=!(!l||"0"===l||Number(l)),h=Boolean(u)||p||i&&!l;return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:20,px:20},children:[Os.jsxs(f,{sx:{fontWeight:500,display:"flex",alignItems:"center"},children:[Os.jsx(e,{id:"Y7rVy0",message:"Fee Rate"}),Os.jsx(P,{title:r._({id:"2vjOqX",message:"Pools with lower transaction fees will attract more traders."}),ml:8,size:16})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",ml:12},children:[n,"%",Os.jsx(T,{variant:T.Variant.tag,sx:{ml:12,fontSize:12},onClick:()=>s(!0),children:Os.jsx(e,{id:"ePK91l",message:"Edit"})})]})]}),Os.jsx(aM,{open:a,onClose:()=>s(!1),title:Os.jsxs(f,{children:[Os.jsx(e,{id:"Y7rVy0",message:"Fee Rate"}),Os.jsx(P,{title:r._({id:"2vjOqX",message:"Pools with lower transaction fees will attract more traders."}),ml:8})]}),children:Os.jsxs(f,{sx:{flex:1,overflowY:"auto"},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:12,p:o.spacing(8,28,28)},children:[c.map((e=>{const n=!i&&l===e.value;return Os.jsx(GL,{title:e.title,description:e.description,onClick:()=>{t({type:PL.UpdateIsFeeRateCustomized,payload:!1}),d(e.value)},selected:n,subTitle:e.tag?Os.jsx(wL,{color:e.tagColor,backgroundColor:e.tagBackgroundColor,tagKey:e.tag}):void 0,sx:{backgroundColor:o.palette.background.paper,borderColor:n?o.palette.primary.main:o.palette.border.main}},e.value)})),Os.jsx(f,{sx:{mt:8},children:Os.jsx(YL,{errorMsg:u,isCustomized:i,onClick:()=>{i||d(""),t({type:PL.UpdateIsFeeRateCustomized,payload:!0})},value:l,onChange:e=>{d(e)}})})]}),Os.jsx(f,{sx:{position:"sticky",bottom:0,px:20,py:16,backgroundColor:"background.paperContrast"},children:Os.jsx(T,{fullWidth:!0,disabled:h,onClick:()=>{t({type:PL.UpdateFeeRate,payload:l}),s(!1)},children:Os.jsx(e,{id:"7VpPHA",message:"Confirm"})})})]})})]})}function AM({titleKey:e}){const t=g();return Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{sx:{mt:28,mb:28,borderTopColor:"divider",borderTopStyle:"solid",borderTopWidth:1}}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",mb:20},children:Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:t.palette.text.primary},children:e})})]})}function wM({params:t}){var n,i,o,a;const s=g(),{isMobile:l}=wy(),{chainId:d}=hf(),[c,u]=at.useState(!1),[p,h]=at.useReducer(FL,{currentStep:0,selectedVersion:UR.marketMakerPool,baseToken:null,quoteToken:null,baseAmount:"",quoteAmount:"",isFixedRatio:!0,initPrice:YR,fixedRatioPrice:YR,leftTokenAddress:void 0,feeRate:zR,isFeeRateCustomized:!1,slippageCoefficient:KR,isSlippageCoefficientCustomized:!1,peggedBaseTokenRatio:"",peggedQuoteTokenRatio:""});at.useEffect((()=>{u(!window.localStorage.getItem(dx.PoolEditPage))}),[]);const[m,y]=at.useState("inital"),x=yM({id:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}),{poolDetail:v}=x,b=Nn(x,["poolDetail"]);b.isPending||b.error||v||"inital"!==m||y("open"),!p.baseToken&&(null==v?void 0:v.baseToken)&&h({type:PL.InitEditParameters,payload:v});const A=It(es.getPMMStateQuery(null==v?void 0:v.chainId,null==v?void 0:v.address,null==v?void 0:v.type,null===(n=null==v?void 0:v.baseToken)||void 0===n?void 0:n.decimals,null===(i=null==v?void 0:v.quoteToken)||void 0===i?void 0:i.decimals));if(!p.slippageCoefficient&&(null===(a=null===(o=A.data)||void 0===o?void 0:o.pmmParamsBG)||void 0===a?void 0:a.k)){const e=A.data.pmmParamsBG.k.toString(),t=!BL({selectedVersion:p.selectedVersion}).includes(e);h({type:PL.UpdateSlippageCoefficient,payload:e}),h({type:PL.UpdateIsSlippageCoefficientCustomized,payload:t})}!p.baseAmount&&A.data&&(h({type:PL.UpdateBaseAmount,payload:A.data.baseReserve.toString()}),h({type:PL.UpdateQuoteAmount,payload:A.data.quoteReserve.toString()})),!p.fixedRatioPrice&&A.data&&h({type:PL.UpdateFixedRatioPrice,payload:A.data.pmmParamsBG.i.toString()});const k=It(es.getLPFeeRateQuery(null==v?void 0:v.chainId,null==v?void 0:v.address,null==v?void 0:v.type));if(!p.feeRate&&k.data){const e=k.data.times(100).toString(),t=-1===XL().findIndex((t=>t.value===e));h({type:PL.UpdateFeeRate,payload:e}),h({type:PL.UpdateIsFeeRateCustomized,payload:t})}const C=p.selectedVersion===UR.singleToken,j=p.selectedVersion===UR.standard,T=WL({isSingleTokenVersion:C,leftTokenAddress:p.leftTokenAddress,baseToken:p.baseToken,quoteToken:p.quoteToken,dispatch:h}),{versionMap:E}=HR(),S=E[p.selectedVersion],I=!(null==v?void 0:v.baseToken),R=Os.jsx(w,{variant:"rounded",width:210,height:60,sx:{padding:16,borderRadius:8}}),L=Os.jsx(w,{variant:"rounded",height:167,sx:{mx:20,borderRadius:16}});return Os.jsxs(Os.Fragment,{children:[Os.jsx(xw,{children:Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"flex-start"},l?{height:"100%"}:{height:"auto"}),children:[l?null:Os.jsxs(f,{sx:{mr:12,flexGrow:1,display:"block"},children:[Os.jsx(jS,{}),Os.jsx(f,{sx:{mt:28,typography:"h5",fontWeight:600,color:"text.primary"},children:Os.jsx(e,{id:"pHQq+U",message:"Pool Setup"})}),Os.jsx(AM,{titleKey:r._({id:"hdIg7i",message:"Select Pool Version"})}),Os.jsx(RL,{versionItem:S,status:"completed"},S.version),Os.jsx(AM,{titleKey:r._({id:"lsg9Mi",message:"Parameter Settings"})}),I?R:Os.jsx(TL,{status:"running",baseToken:p.baseToken,quoteToken:p.quoteToken,initPrice:p.initPrice,slippageCoefficient:p.slippageCoefficient,selectedVersion:p.selectedVersion,baseAmount:p.baseAmount,quoteAmount:p.quoteAmount}),Os.jsx(AM,{titleKey:r._({id:"Y7rVy0",message:"Fee Rate"})}),I?R:Os.jsx(kL,{isWaiting:!1,feeRate:p.feeRate})]}),Os.jsxs(f,{sx:Object.assign({flexGrow:1,flexShrink:0,flexBasis:375,backgroundColor:"background.paper"},l?{width:"100%",borderRadius:0,minHeight:"100%"}:{pb:20,borderRadius:16,flexGrow:0,minHeight:"auto"}),children:[Os.jsx(f,{sx:Object.assign({top:0,py:20,px:20,backgroundColor:s.palette.background.paper,zIndex:1},l?{position:"sticky"}:{position:"static",borderTopLeftRadius:16,borderTopRightRadius:16}),children:Os.jsx(f,{sx:{display:"flex",alignItems:"center"},children:Os.jsx(f,{sx:{typography:"h5",color:s.palette.text.primary,fontWeight:600},children:Os.jsx(e,{id:"6XYkjc",message:"Edit Parameter Settings"})})})}),I?null:Os.jsx(AL,{baseToken:p.baseToken,quoteToken:p.quoteToken,initPrice:p.initPrice,slippageCoefficient:p.slippageCoefficient,selectedVersion:p.selectedVersion,baseAmount:p.baseAmount,quoteAmount:p.quoteAmount}),I?L:Os.jsxs(f,{sx:{px:20},children:[Os.jsx(Qy,{canClickBalance:!0,showPercentage:!0,amt:p.baseAmount,onInputChange:e=>{h({type:PL.UpdateBaseAmount,payload:e})},readOnly:C,token:p.baseToken,occupiedAddrs:p.quoteToken?[p.quoteToken.address]:void 0,occupiedChainId:d,chainId:d}),Os.jsx(zy,{}),Os.jsx(Qy,{canClickBalance:!0,showPercentage:!0,amt:p.quoteAmount,onInputChange:e=>{h({type:PL.UpdateQuoteAmount,payload:e})},token:p.quoteToken,occupiedAddrs:p.baseToken?[p.baseToken.address]:void 0,occupiedChainId:d,chainId:d})]}),I?null:Os.jsxs(Os.Fragment,{children:[p.selectedVersion!==UR.standard&&Os.jsx(cM,{dispatch:h,slippageCoefficient:p.slippageCoefficient,selectedVersion:p.selectedVersion,isCustomized:p.isSlippageCoefficientCustomized,isStandardVersion:j}),Os.jsx(nM,{selectedVersion:p.selectedVersion,isFixedRatio:p.isFixedRatio,leftTokenAddress:p.leftTokenAddress,baseToken:p.baseToken,quoteToken:p.quoteToken,fixedRatioPrice:p.fixedRatioPrice,dispatch:h,isStandardVersion:j,isSingleTokenVersion:C,priceInfo:T}),Os.jsx(bM,{dispatch:h,feeRate:p.feeRate,isCustomized:p.isFeeRateCustomized})]}),Os.jsx(f,{sx:{pb:160,[s.breakpoints.up("tablet")]:{pb:28}}}),Os.jsx(vM,{state:p,pool:v,loading:I})]})]})}),Os.jsx(fM,{singleBtn:!0,open:"open"===m,onClose:()=>y("close"),onConfirm:()=>y("close"),title:r._({id:"Da1+Da",message:"Pool not found. Please switch to another network and retry."})}),Os.jsx(gM,{open:c,onClose:()=>{u(!1)},onConfirm:()=>{window.localStorage.setItem(dx.PoolEditPage,"1"),u(!1)},alertContent:Os.jsx(e,{id:"Y9QDtD",message:"You are making changes to the liquidity of a private pool. This is a highly discretionary operation that may cause substantial inflows/outflows of funds and changes in market prices. Please make sure you are fully aware of the implications of each parameter modification."})})]})}function kM(e){return null==e?0:new i(e).dp(4,i.ROUND_DOWN).toNumber()}function CM({unit:t,data:n,masterKey:r,sumKey:o}){const a=g(),s=at.useRef(null),[l,d]=at.useState(null),[c,u]=at.useState(0);at.useEffect((()=>{const e=()=>{s&&s.current&&u(s.current.offsetWidth)};return setTimeout(e,100),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[s]);const p="light"===a.palette.mode?a.palette.secondary.main:a.palette.primary.main,h="#ff9553",m=n[n.length-2],y="date";let x=[];if(null==n?void 0:n.length){let e=n[0][r];n.forEach((t=>{t[r]>e&&(e=t[r])})),x=e?[0,Math.ceil(e/3),Math.ceil(e/3*2),e]:[0]}let v=0;x.forEach((e=>{const t=Mn(new i(e));let n=t.replace(".","").length;t.indexOf(".")>-1&&(n+=.11),n>v&&(v=n)}));const b=10*v+2;return Os.jsxs(f,{ref:s,sx:{position:"relative"},children:[Os.jsxs(f,{sx:{minHeight:62,mb:10},children:[Os.jsxs(f,{sx:{typography:"caption",mb:8},children:[t||Os.jsx("span",{children:" "}),bn({input:null==m?void 0:m[o]})]}),Os.jsx(f,{sx:{color:"text.secondary"},children:Wt(null==m?void 0:m[y]).format("LL")})]}),Os.jsxs(Yt,{width:c,height:364,data:n,margin:{top:5,right:10,left:0,bottom:5},children:[Os.jsx("defs",{children:n.map(((e,t)=>Os.jsxs("linearGradient",{id:`colorBar${e.date}`,x1:"0",x2:"0",y1:"0",y2:"1",children:[Os.jsx("stop",{offset:"0%",stopColor:t===n.length-1?h:p}),Os.jsx("stop",{offset:"100%",stopColor:C(t===n.length-1?h:p,.04)})]},e.date)))}),Os.jsx(Zt,{hide:!0,dataKey:y,axisLine:!1,tickFormatter:e=>Wt(e).format("MM-DD")}),Os.jsx(zt,{orientation:"right",axisLine:!1,ticks:x,width:b,tickFormatter:e=>Mn(new i(e))}),Os.jsx(Xt,{isAnimationActive:!1,content:({active:t,payload:n,label:r})=>{if(!(t&&n&&n.length))return null;const i=Wt(r).format("YYYY-MM-DD")===Wt().format("YYYY-MM-DD");return Os.jsxs(f,{sx:{px:10,py:12,maxWidth:240,borderRadius:8,backgroundColor:"background.paperContrast",typography:"h6",color:"text.secondary"},children:[Os.jsx(f,{sx:{mr:8},children:Wt(r).format("MM-DD HH:mm")}),Os.jsx(f,{children:n[0].value}),i?Os.jsx(f,{children:Os.jsx(e,{id:"ubzjDN",message:"Real Time"})}):""]})},cursor:!1,coordinate:{x:0,y:0}}),Os.jsx(Jt,{dataKey:r,onMouseMove:e=>{d(e[y])},onMouseLeave:()=>{d(null)},children:n.map((e=>Os.jsx(Kt,{fill:`url(#colorBar${e.date})`},e.date)))}),l&&Os.jsx(_t,{x:l,stroke:p,strokeDasharray:"3 3"})]})]})}var jM,TM;function EM({poolDetail:e,chart24hDataFirst:t}){var n,o,a,s,l,d,c,u;const[p,h]=at.useState(t?jM.volume:jM.depth),m={key:jM.depth,value:r._({id:"n25Lml",message:"Depth"})},g=[{key:jM.volume,value:r._({id:"/cF7Rs",message:"Volume"})},{key:jM.feeRevenue,value:r._({id:"9QjAGB",message:"FeeRevenue"})},{key:jM.traders,value:r._({id:"qDhDFK",message:"Traders"})}];t?g.push(m):g.splice(0,0,m);const y=function({address:e,chainId:t,day:n}){var r,o,a;const s=t?Gr[t]:"",l=QA().getQuery(le.graphql.fetchPoolDayData,{where:{pair_address:null!=e?e:"",chain:s,day:n}}),d=It(Object.assign(Object.assign({},l),{enabled:!!e&&!!t})),c=null!==(a=null===(o=null===(r=d.data)||void 0===r?void 0:r.dashboard_pairs_day_data)||void 0===o?void 0:o.map((e=>{var t,n;return{volume:kM(null==e?void 0:e.volumeUsd),fee:kM(new i(null!==(t=null==e?void 0:e.feeUsd)&&void 0!==t?t:0).plus(null!==(n=null==e?void 0:e.mtFeeUsd)&&void 0!==n?n:0).toString()),traders:(null==e?void 0:e.addresses)?Number(e.addresses):0,date:(null==e?void 0:e.timestamp)?1e3*(null==e?void 0:e.timestamp):0,tvl:kM(null==e?void 0:e.tvlUsd)}})))&&void 0!==a?a:[];return Object.assign(Object.assign({},d),{dayDataList:c})}({chainId:null==e?void 0:e.chainId,address:null==e?void 0:e.address,day:30}),x=It(es.getPMMStateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(n=null==e?void 0:e.baseToken)||void 0===n?void 0:n.decimals,null===(o=null==e?void 0:e.quoteToken)||void 0===o?void 0:o.decimals)),{pmmParamsBG:v}=null!==(a=x.data)&&void 0!==a?a:{},b=v?{i:v.i.toNumber(),k:v.k.toNumber(),b:v.b.toNumber(),b0:v.b0.toNumber(),q:v.q.toNumber(),q0:v.k.isEqualTo(0)?v.q.toNumber():v.q0.toNumber(),R:v.k.isEqualTo(0)?0:v.R}:void 0,A=b?ve(b):void 0,[w,k]=at.useState(!1),C=w&&(null===(s=x.data)||void 0===s?void 0:s.midPrice)?new i(1).div(null===(l=x.data)||void 0===l?void 0:l.midPrice):null===(d=x.data)||void 0===d?void 0:d.midPrice;return Os.jsx(f,{sx:{mt:{mobile:24,tablet:52}},children:Os.jsxs(H,{value:p,onChange:(e,t)=>h(t),children:[Os.jsx(_,{tabs:g,variant:"rounded",tabsListSx:{borderWidth:0}}),p===jM.depth&&(null==e?void 0:e.baseToken)&&(null==e?void 0:e.quoteToken)?Os.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:Os.jsx(SM,{baseToken:null==e?void 0:e.baseToken,quoteToken:null==e?void 0:e.quoteToken,midPrice:C,isSwitchMidPrice:w,setIsSwitchMidPrice:k,showMidPrice:p===jM.depth})}):"",Os.jsx(z,{value:jM.depth,children:Os.jsx(vL,{baseToken:null!==(c=null==e?void 0:e.baseToken)&&void 0!==c?c:null,quoteToken:null!==(u=null==e?void 0:e.quoteToken)&&void 0!==u?u:null,pmmParams:b,pmmModel:A,midPrice:C})}),Os.jsx(z,{value:jM.volume,children:Os.jsx(CM,{data:y.dayDataList,masterKey:"volume",sumKey:"volume",unit:"$"})}),Os.jsx(z,{value:jM.feeRevenue,children:Os.jsx(CM,{data:y.dayDataList,masterKey:"fee",sumKey:"fee",unit:"$"})}),Os.jsx(z,{value:jM.traders,children:Os.jsx(CM,{data:y.dayDataList,masterKey:"traders",sumKey:"traders",unit:""})})]})})}function SM({baseToken:e,quoteToken:t,midPrice:n,isSwitchMidPrice:r,setIsSwitchMidPrice:i,showMidPrice:o}){const a=null==e?void 0:e.symbol,s=null==t?void 0:t.symbol,l=r?s:a,d=r?a:s;return Os.jsx(f,{sx:{display:"flex",alignItems:"center"},children:o?Os.jsxs(f,{sx:{mt:4,typography:"body2",color:"text.secondary",wordBreak:"break-all",display:"flex"},children:[`1 ${l} = ${n?bn({input:n,showDecimals:16}):"-"} ${d}`,Os.jsx(I,{weak:!0,sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:14,height:14,position:"relative",top:1.5,ml:9,cursor:"pointer",borderRadius:"50%",backgroundColor:"background.paperDarkContrast",p:0},onClick:()=>i((e=>!e)),children:Os.jsx(f,{component:As.Switch})})]}):""})}function IM({poolDetail:t}){var n,r,o;const{isMobile:a}=wy(),s=g(),l=null==t?void 0:t.chainId;null===(o=It(es.getPMMStateQuery(null==t?void 0:t.chainId,null==t?void 0:t.address,null==t?void 0:t.type,null===(n=null==t?void 0:t.baseToken)||void 0===n?void 0:n.decimals,null===(r=null==t?void 0:t.quoteToken)||void 0===r?void 0:r.decimals)).data)||void 0===o||o.midPrice;const d=function({pool:e}){var t,n,r,o,a,s,l;const{chainId:d,address:c,type:u,baseToken:p,quoteToken:h}=e||{},m=null!=c?c:"",f=d?Gr[d]:"",g=null==p?void 0:p.decimals,y=null==h?void 0:h.decimals,x=It(es.getPMMStateQuery(d,c,u,null==p?void 0:p.decimals,null==h?void 0:h.decimals)),v=null===(t=x.data)||void 0===t?void 0:t.midPrice,b=It(es.getTotalBaseLpQuery(d,c,u,g)),A=It(es.getTotalQuoteLpQuery(d,c,u,y)),w=It(es.getReserveLpQuery(d,c,u,g,y)),k=It(es.getClassicalTargetQuery(d,c,u,g,y)),C=b.data;let j=A.data;j||A.isLoading||A.error||!C||(j=C);const{baseReserve:T,quoteReserve:E}=w.data||{},S=null===(n=k.data)||void 0===n?void 0:n.baseTarget,I=null===(r=k.data)||void 0===r?void 0:r.quoteTarget,R=OL({tokens:h?[h]:[]}),L=QA(),M=It(Object.assign(Object.assign({},L.getQuery(le.graphql.fetchLiquidityPositions,{id:m,where:{pair:m,liquidityTokenBalance_not:"0",chain:f,refreshNow:!0},miningWhere:{pair:m,liquidityTokenInMining_not:"0",chain:f},first:1e3,orderBy:"liquidityTokenBalance",orderDirection:"desc"})),{enabled:!!c})),{balance:O,mining:B,pair:P}=null!==(o=M.data)&&void 0!==o?o:{};let D=[];const N=h?null===(a=R.data)||void 0===a?void 0:a.get(h.address):void 0;if(O&&B&&P){const{baseLpToken:e,quoteLpToken:t}=P,n=new Map,r=(null==e?void 0:e.id)===(null==t?void 0:t.id);for(const o of O){const{id:a,liquidityTokenBalance:s}=o,l=new i(null!=s?s:0),[d,p]=a.split("-");let h={id:d,baseSupplied:new i(0),quoteSupplied:new i(0)};n.has(h.id)?h=n.get(h.id):n.set(h.id,h);const[,m]=yT(l,C,T,S,c,u,g);m&&(r||p===(null==e?void 0:e.id))&&(h.baseSupplied=m);const[,f]=yT(l,j,E,I,c,u,y);f&&(r||p===(null==t?void 0:t.id))&&(h.quoteSupplied=f)}for(const o of B){const{id:a,liquidityTokenInMining:s}=o,l=new i(null!=s?s:0),[d,p]=a.split("-"),[,h]=yT(l,C,T,S,c,u,g),[,m]=yT(l,j,E,I,c,u,y);if(n.has(d)){const i=n.get(d);h&&(r||p===(null==e?void 0:e.id))&&(i.baseSupplied=h.plus(i.baseSupplied)),m&&(r||p===(null==t?void 0:t.id))&&(i.quoteSupplied=m.plus(i.quoteSupplied))}else{const o={id:d,baseSupplied:new i(0),quoteSupplied:new i(0)};h&&(r||p===(null==e?void 0:e.id))&&(o.baseSupplied=h),m&&(r||p===(null==t?void 0:t.id))&&(o.quoteSupplied=m),n.set(o.id,o)}}const o=(null!==(s=null==p?void 0:p.decimals)&&void 0!==s?s:0)>6?6:4,a=(null!==(l=null==h?void 0:h.decimals)&&void 0!==l?l:0)>6?6:4,d=N;n.forEach((e=>{var t,n;D.push({userId:e.id,baseSupplied:e.baseSupplied?bn({input:e.baseSupplied,showDecimals:o}):"0",quoteSupplied:e.quoteSupplied?bn({input:e.quoteSupplied,showDecimals:a}):"0",baseTokenAddress:null!==(t=null==p?void 0:p.address)&&void 0!==t?t:"",quoteTokenAddress:null!==(n=null==h?void 0:h.address)&&void 0!==n?n:"",baseTokenSymbol:Dn(p),quoteTokenSymbol:Dn(h),sharePercentage:v&&T?bn({input:v.multipliedBy(e.baseSupplied||0).plus(e.quoteSupplied||0).div(v.multipliedBy(T).plus(null!=E?E:0)).multipliedBy(100),showDecimals:2}):"",dollarValue:null!=d&&v?`$${bn({input:v.multipliedBy(e.baseSupplied||0).plus(e.quoteSupplied||0).multipliedBy(d),showDecimals:2})}`:"-",dollarValueBN:v?v.multipliedBy(e.baseSupplied||0).plus(e.quoteSupplied||0):i(0)})})),D.sort(((e,t)=>t.dollarValueBN.gt(e.dollarValueBN)?1:-1))}const F=[x,b,A,k,w,R,M],W=function(e){const t=[];if(e.forEach((e=>{e.error&&t.push(e.refetch)})),t.length)return()=>{t.forEach((e=>e()))}}(F),V=F.some((e=>e.isLoading));return Object.assign(Object.assign({},M),{isLoading:V,errorRefetch:W,list:D})}({pool:t}),[c,u]=at.useState(1),p=c*(a?4:8),h=d.list,m=p<h.length,x=h.slice(0,p);return Os.jsx(f,{sx:{display:"flex",flexDirection:"column"},children:Os.jsx(GE,{refetch:d.error?d.refetch:void 0,loading:d.isLoading&&!(null==x?void 0:x.length),empty:!(null==x?void 0:x.length),children:!!(null==x?void 0:x.length)&&Os.jsxs(f,{children:[Os.jsx(f,{sx:{overflowX:"auto",minHeight:244},children:Os.jsxs(f,{component:"table",sx:{minWidth:"100%"},children:[Os.jsx(f,{component:"thead",sx:{position:"sticky",top:0},children:Os.jsxs(f,{component:"tr",sx:{"& th":{p:24,borderBottomWidth:1,typography:"body1",lineHeight:1,textAlign:"left",whiteSpace:"nowrap"}},children:[Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"JlIjZf",message:"Liquidity Provider"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"C1qIFl",message:"Liquidity Supplied"})}),Os.jsx(f,{component:"th",sx:{"&&":{textAlign:"right"}},children:Os.jsx(e,{id:"me2dmq",message:"Value (USD)"})}),Os.jsx(f,{component:"th",sx:{"&&":{textAlign:"right"}},children:Os.jsx(e,{id:"Z8lGw6",message:"Share"})})]})}),Os.jsx(f,{component:"tbody",children:null==x?void 0:x.map((e=>Os.jsxs(f,{component:"tr",sx:{"& td":{px:24,py:20,whiteSpace:"nowrap"}},children:[Os.jsx("td",{children:Os.jsx(f,{sx:{display:"flex",alignItems:"center"},children:Os.jsx(ZT,{address:e.userId,customChainId:l,truncate:!0})})}),Os.jsxs("td",{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[Os.jsx(ey,{address:e.baseTokenAddress,chainId:l,width:18,height:18}),`${e.baseSupplied} ${e.baseTokenSymbol}`]}),Os.jsxs(f,{sx:{mt:4,display:"flex",alignItems:"center",gap:8},children:[Os.jsx(ey,{address:e.quoteTokenAddress,chainId:l,width:18,height:18}),`${e.quoteSupplied} ${e.quoteTokenSymbol}`]})]}),Os.jsx(f,{component:"td",sx:{textAlign:"right"},children:e.dollarValue}),Os.jsx(f,{component:"td",sx:{textAlign:"right"},children:`${e.sharePercentage}%`})]},e.userId)))})]})}),m&&Os.jsxs(y,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:64,width:"100%",borderStyle:"solid",borderColor:"border.main",borderWidth:s.spacing(1,0,0,0),typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},onClick:()=>u((e=>e+1)),children:[Os.jsx(e,{id:"yQ2kGp",message:"Load more"}),Os.jsx(f,{component:As.ArrowRight,sx:{transform:"rotate(90deg)"}})]})]})})})}function RM({address:e,chainId:t}){var n;const r=QA(),i=t?Gr[t]:"",o=r.getQuery(le.graphql.fetchPoolDashboard,{where:{pair_address:null!=e?e:"",chain:i}}),a=It(Object.assign(Object.assign({},o),{enabled:!!e&&!!t})),s=null===(n=a.data)||void 0===n?void 0:n.dashboard_pairs_detail;return Object.assign(Object.assign({},a),{dashboard:s})}function LM(e,t){if(!e)return"";const n=Wt(e);return n.isValid()?n.format("YYYY/MM/DD HH:mm:ss"):""}function MM({chainId:e,address:t,symbol:n,amount:r,sx:i}){return Os.jsxs(f,{sx:u({display:"flex",justifyContent:"flex-end",alignItems:"center"},i),children:[t&&Os.jsx(f,{sx:{height:16,flexBasis:16,flexGrow:0,flexShrink:0,mr:4},children:Os.jsx(ey,{width:16,height:16,address:t,chainId:e})}),Os.jsxs(f,{sx:{textAlign:"right",display:"flex",alignItems:"center"},children:[r," ",Os.jsx(f,{sx:{display:"inline-block",maxWidth:"6em",minWidth:"auto",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"text-bottom"},title:n,children:n})]})]})}function OM({chainId:e,baseToken:t,quoteToken:n,baseAmount:r,quoteAmount:i,vertical:o}){const{isMobile:a}=wy();return Os.jsxs(f,{sx:{mt:4,display:"flex",justifyContent:"flex-end",flexDirection:o?"column":"row",alignItems:o?"flex-end":"center",flexWrap:"wrap",typography:a?"h6":"body1"},children:[t?Os.jsx(MM,{chainId:e,address:null==t?void 0:t.address,amount:r,symbol:null==t?void 0:t.symbol}):"-",o?"":Os.jsx(f,{sx:{mx:10},children:"/"}),n?Os.jsx(MM,{chainId:e,address:null==n?void 0:n.address,amount:i,symbol:null==n?void 0:n.symbol,sx:{mt:o?4:0}}):"-"]})}function BM({label:e,children:t,pairsStatLoading:n,poolDetailLoading:r}){const{isMobile:i}=wy();return Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between"},children:[Os.jsx(f,{sx:{color:"text.secondary",minWidth:"5em",typography:i?"h6":"body1"},children:e}),Os.jsx(f,{sx:u({textAlign:"right",overflow:"hidden","& .title":{typography:i?"body1":"caption",width:"100%"}},n&&!r||!n&&r?{ml:8,flex:1,display:"flex",flexDirection:"column",alignItems:"flex-end","& .title":{display:"flex",justifyContent:"flex-end"}}:{}),children:t})]})}function PM({sx:e}){return Os.jsx(w,{sx:Object.assign({width:"100%",maxWidth:237,height:22},e)})}function DM({detail:e,lpFeeRate:t,mtFeeRate:n}){const{isMobile:o}=wy();return"DPP"===(null==e?void 0:e.type)?null:e&&t&&n?Os.jsxs(f,{sx:{color:"text.secondary",typography:o?"h6":"body1"},children:[Os.jsx("span",{children:"LP "}),Os.jsx("span",{children:Bn({input:t,showDecimals:6})}),Os.jsxs("span",{children:[" / ",r._({id:"7C/BwI",message:"Community Treasury"})," "]}),Os.jsx("span",{children:Bn({input:new i(null!=n?n:0).toNumber(),showDecimals:6})})]}):Os.jsx(PM,{sx:{mt:4}})}function NM({detail:e}){var t,n,o,a,s,l,d,c,u,p,h,m,y,x,v,b,A,w,k,C,j,T,E,S,I,R,L;const M=g(),{isMobile:O}=wy(),{baseToken:B,quoteToken:P}=null!=e?e:{},D="DPP"===(null==e?void 0:e.type),N="DSP"===(null==e?void 0:e.type)||"GSP"===(null==e?void 0:e.type),F="CLASSICAL"===(null==e?void 0:e.type),W=RM({address:null==e?void 0:e.address,chainId:null==e?void 0:e.chainId}),V=W.dashboard,U=W.isLoading,H=It(es.getPMMStateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(t=null==e?void 0:e.baseToken)||void 0===t?void 0:t.decimals,null===(n=null==e?void 0:e.quoteToken)||void 0===n?void 0:n.decimals)),q=U?Os.jsx(PM,{}):null===(null==V?void 0:V.totalVolume)||void 0===(null==V?void 0:V.totalVolume)?"-":`$${bn({input:new i(null==V?void 0:V.totalVolume),showDecimals:2})}`,Z=U?Os.jsx(PM,{}):V&&(HE(V.totalFee)||HE(V.totalMtFee))?`$${bn({input:new i(V.totalFee||0).plus(V.totalMtFee||0),showDecimals:2})}`:"-",{account:z}=At(),Q=It(es.getFeeRateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,z)),G=null===(o=Q.data)||void 0===o?void 0:o.mtFeeRate,Y=null===(a=Q.data)||void 0===a?void 0:a.lpFeeRate,X=null==G?void 0:G.plus(null!=Y?Y:0),J=!e,K=It(es.getClassicalTargetQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(s=null==e?void 0:e.baseToken)||void 0===s?void 0:s.decimals,null===(l=null==e?void 0:e.quoteToken)||void 0===l?void 0:l.decimals));return Os.jsxs(f,{sx:Object.assign({pb:30,position:"relative",overflow:"hidden"},O?{backgroundColor:"background.paper",p:20}:{mt:32}),children:[Os.jsxs(f,{sx:{flex:"1 0 50%","& > div + div":{mt:10},"&::after":{content:'""',display:"block",my:20,width:"100%",height:"1px",backgroundColor:"border.main"}},children:[Os.jsx(BM,{label:r._({id:"l4Za6X",message:"Total Swap Volume"}),pairsStatLoading:U,children:Os.jsx("div",{className:"title",children:q})}),U||!e?Os.jsx(PM,{sx:{mt:4}}):Os.jsx(OM,{chainId:e.chainId,baseToken:e.baseToken,quoteToken:e.quoteToken,baseAmount:bn({input:null!==(d=null==V?void 0:V.baseVolumeCumulative)&&void 0!==d?d:0,showDecimals:2}),quoteAmount:bn({input:null!==(c=null==V?void 0:V.quoteVolumeCumulative)&&void 0!==c?c:0,showDecimals:2})}),Os.jsx(BM,{label:r._({id:"Z033WN",message:"Total Swap Fee"}),pairsStatLoading:U,children:Os.jsx("div",{className:"title",children:Z})}),U||!e?Os.jsx(PM,{sx:{mt:4}}):Os.jsx(OM,{chainId:e.chainId,baseToken:e.baseToken,quoteToken:e.quoteToken,baseAmount:bn({input:new i(null!==(u=null==V?void 0:V.baseFee)&&void 0!==u?u:0).plus(null!==(p=null==V?void 0:V.baseMtFee)&&void 0!==p?p:0),showDecimals:2}),quoteAmount:bn({input:new i(null!==(h=null==V?void 0:V.quoteFee)&&void 0!==h?h:0).plus(null!==(m=null==V?void 0:V.quoteMtFee)&&void 0!==m?m:0),showDecimals:2})}),Os.jsx(BM,{label:r._({id:"/BbUJ6",message:"Total Number of Traders"}),pairsStatLoading:U,children:U?Os.jsx(PM,{sx:{mt:4}}):bn({input:null!==(y=null==V?void 0:V.txUsers)&&void 0!==y?y:0,showDecimals:0})})]}),Os.jsxs(f,{sx:{flex:"1 0 50%",overflow:"hidden","& > div + div":{mt:10}},children:[Os.jsx(BM,{label:r._({id:"UE2beD",message:"Creator"}),poolDetailLoading:!e,children:e?e.isCpPool?Os.jsx(ZT,{address:null!==(x=e.cpCreator)&&void 0!==x?x:"",truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}}):Os.jsx(ZT,{address:null!==(v=e.creator)&&void 0!==v?v:"",truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}}):Os.jsx(PM,{})}),(null==e?void 0:e.isCpPool)||(null==e?void 0:e.owner)?Os.jsx(BM,{label:r._({id:"LtI9AS",message:"Owner"}),poolDetailLoading:J,children:J?Os.jsx(PM,{}):(null==e?void 0:e.isCpPool)?Os.jsx(ZT,{address:null==e?void 0:e.cpCreator,truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}}):Os.jsx(ZT,{address:null!==(b=e.owner)&&void 0!==b?b:"",truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}})}):"",Os.jsx(BM,{label:r._({id:"52uNwk",message:"Creation Time"}),poolDetailLoading:J,children:J?Os.jsx(PM,{}):LM(1e3*Number((null==e?void 0:e.isCpPool)?e.cpCreatedAtTimestamp||0:e.createdAtTimestamp||0))||"-"}),(null==e?void 0:e.isCpPool)?Os.jsxs(Os.Fragment,{children:[Os.jsx(BM,{label:r._({id:"cDWXuq",message:"Settler"}),poolDetailLoading:J,children:J?Os.jsx(PM,{}):Os.jsx(ZT,{address:(null==e?void 0:e.cpLiquidator)||"",truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}})}),Os.jsx(BM,{label:r._({id:"JuzN3b",message:"Related CrowdPooling"}),poolDetailLoading:J,children:J?Os.jsx(PM,{}):Os.jsx(ZT,{address:null==e?void 0:e.cpAddress,truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}})})]}):void 0,Os.jsxs(BM,{label:r._({id:"Y7rVy0",message:"Fee Rate"}),poolDetailLoading:J,children:[Os.jsx("div",{className:"detail-title",style:{textAlign:"right"},children:Bn({input:null==X?void 0:X.toNumber(),showDecimals:6})}),Os.jsx(DM,{detail:e,lpFeeRate:Y,mtFeeRate:G})]}),Os.jsx(BM,{label:r._({id:"sjn3tj",message:"Slippage Coefficient"}),poolDetailLoading:J,children:J?Os.jsx(PM,{}):null===(w=null===(A=H.data)||void 0===A?void 0:A.pmmParamsBG)||void 0===w?void 0:w.k.toString()}),Os.jsx(BM,{poolDetailLoading:J,label:F?r._({id:"d8YnVj",message:"Guide Price"}):D?r._({id:"CeLrge",message:"Mid Price"}):N?r._({id:"4ogEAw",message:"Pegged Exchange Rate"}):r._({id:"jjuKOj",message:"Min Price"}),children:J?Os.jsx(PM,{}):null!==B&&(N?`1 ${null==B?void 0:B.symbol} = ${null===(j=null===(C=null===(k=H.data)||void 0===k?void 0:k.pmmParamsBG)||void 0===C?void 0:C.i)||void 0===j?void 0:j.toString()} ${null==P?void 0:P.symbol}`:null===(S=null===(E=null===(T=H.data)||void 0===T?void 0:T.pmmParamsBG)||void 0===E?void 0:E.i)||void 0===S?void 0:S.toString())||"-"}),F&&Os.jsxs(Os.Fragment,{children:[Os.jsx(BM,{label:r._({id:"JR7wWw",message:"Equilibrium target"}),poolDetailLoading:J,children:J?Os.jsx(PM,{}):Os.jsx(Os.Fragment,{children:null===(L=null===(R=null===(I=H.data)||void 0===I?void 0:I.pmmParamsBG)||void 0===R?void 0:R.k)||void 0===L?void 0:L.toString()})}),K.data?Os.jsx(OM,{vertical:!0,chainId:e.chainId,baseToken:e.baseToken,quoteToken:e.quoteToken,baseAmount:bn({input:K.data.baseTarget,showDecimals:2}),quoteAmount:bn({input:K.data.quoteTarget,showDecimals:2})}):""]})]})]})}function FM(e,t){if(!e)return"";const n=Wt(e);return n.isValid()?n.format("YYYY/MM/DD HH:mm:ss"):""}function WM({amountOut:e,amountIn:t,fromTokenSymbol:n,toTokenSymbol:r}){const[i,o]=at.useState(!1),a=bn({input:t/e,showDecimals:2}),s=bn({input:e/t,showDecimals:2});return Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:["1 ",i?r:n," = ",i?a:s," ",i?n:r,Os.jsx(f,{sx:{ml:10,width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",backgroundColor:"background.paperContrast",borderRadius:"50%"},onClick:()=>o((e=>!e)),children:Os.jsx(f,{component:As.Switch})})]})}function VM({poolDetail:t}){var n,r,o;const{isMobile:a}=wy(),s=g(),{account:l,chainId:d}=At(),c=It(es.getFeeRateQuery(null==t?void 0:t.chainId,null==t?void 0:t.address,null==t?void 0:t.type,l)),u=null===(n=c.data)||void 0===n?void 0:n.mtFeeRate,p=null===(r=c.data)||void 0===r?void 0:r.lpFeeRate,h=null==u?void 0:u.plus(null!=p?p:0),m=function({chainId:e,address:t,first:n=50}){var r;const i=e?Gr[e]:"",o=QA().getQuery(le.graphql.fetchPoolSwapList,{first:n,orderBy:"timestamp",orderDirection:"desc",where:{pair:t,chain:i}}),a=It(Object.assign(Object.assign({},o),{enabled:!!t})),s=null===(r=a.data)||void 0===r?void 0:r.swaps;return Object.assign(Object.assign({},a),{swapList:s})}({address:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}),[x,v]=at.useState(1),b=x*(a?4:8),A=null!==(o=m.swapList)&&void 0!==o?o:[],w=b<A.length,k=A.slice(0,b);return Os.jsx(f,{sx:{display:"flex",flexDirection:"column"},children:Os.jsx(GE,{refetch:m.error?m.refetch:void 0,loading:m.isLoading,empty:!(null==k?void 0:k.length),children:!!(null==k?void 0:k.length)&&Os.jsxs(f,{children:[Os.jsx(f,{sx:{overflowX:"auto",minHeight:244},children:Os.jsxs(f,{component:"table",sx:{minWidth:"100%"},children:[Os.jsx(f,{component:"thead",sx:{position:"sticky",top:0},children:Os.jsxs(f,{component:"tr",sx:{"& th":{p:24,borderBottomWidth:1,typography:"body1",lineHeight:1,textAlign:"left",whiteSpace:"nowrap"}},children:[Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"LhMjLm",message:"Time"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"UPXmW+",message:"Trader"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"v4nCHK",message:"Paid"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"fZ5Vnu",message:"Received"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"a7u1N9",message:"Price"})}),Os.jsx(f,{component:"th",sx:{"&&":{textAlign:"right"}},children:Os.jsx(e,{id:"Y7rVy0",message:"Fee Rate"})}),Os.jsx(f,{component:"th",sx:{"&&":{textAlign:"right"}},children:Os.jsx(e,{id:"PLUB/s",message:"Fee"})})]})}),Os.jsx(f,{component:"tbody",children:null==k?void 0:k.map((e=>Os.jsxs(f,{component:"tr",sx:{"& td":{px:24,py:20,whiteSpace:"nowrap"}},children:[Os.jsx("td",{children:FM(1e3*e.timestamp)}),Os.jsx("td",{children:Os.jsx(ZT,{address:e.from,truncate:!0})}),Os.jsx("td",{children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[Os.jsx(ey,{address:e.fromToken.id,chainId:d,width:18,height:18}),`${bn({input:e.amountIn,showDecimals:2})} ${e.fromToken.symbol}`]})}),Os.jsx("td",{children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[Os.jsx(ey,{address:e.toToken.id,chainId:d,width:18,height:18}),`${bn({input:e.amountOut,showDecimals:2})} ${e.toToken.symbol}`]})}),Os.jsx("td",{children:Os.jsx(WM,{amountOut:e.amountOut,amountIn:e.amountIn,fromTokenSymbol:e.fromToken.symbol,toTokenSymbol:e.toToken.symbol})}),Os.jsx(f,{component:"td",sx:{textAlign:"right"},children:Bn({input:h})}),Os.jsx(f,{component:"td",sx:{textAlign:"right"},children:`${bn({input:new i(e.amountOut).times(null!=h?h:0)})} ${e.toToken.symbol}`})]},e.id)))})]})}),w&&Os.jsxs(y,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:64,width:"100%",borderStyle:"solid",borderColor:"border.main",borderWidth:s.spacing(1,0,0,0),typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},onClick:()=>v((e=>e+1)),children:[Os.jsx(e,{id:"yQ2kGp",message:"Load more"}),Os.jsx(f,{component:As.ArrowRight,sx:{transform:"rotate(90deg)"}})]})]})})})}function UM({poolDetail:e}){const{isMobile:t}=wy(),[n,i]=at.useState(TM.parameters),o=[{key:TM.parameters,value:r._({id:"F18WP3",message:"Parameters"})},{key:TM.swaps,value:r._({id:"EatqP4",message:"Swaps"})}];return e&&"DPP"!==(null==e?void 0:e.type)&&o.push({key:TM.liquidityProviders,value:r._({id:"juypHV",message:"Liquidity Providers"})}),Os.jsx(f,{sx:Object.assign({mt:24,backgroundColor:"background.paper",borderRadius:16,overflow:"hidden"},t?{}:{mt:32,px:20}),children:Os.jsxs(H,{value:n,onChange:(e,t)=>i(t),children:[Os.jsx(_,{tabs:o}),Os.jsx(z,{value:TM.parameters,children:Os.jsx(NM,{detail:e})}),Os.jsx(z,{value:TM.swaps,children:Os.jsx(VM,{poolDetail:e})}),Os.jsx(z,{value:TM.liquidityProviders,children:Os.jsx(IM,{poolDetail:e})})]})})}function HM(){return Os.jsx(w,{variant:"rounded",sx:{width:90}})}function qM({poolDetail:t}){var n,o;g();const{isMobile:a}=wy(),s=RM({address:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}),l=s.dashboard,d=[{description:r._({id:"Gr2anW",message:"Traders (24H)"}),text:s.isLoading?Os.jsx(HM,{}):null===(null==l?void 0:l.txUserNear24h)||void 0===(null==l?void 0:l.txUserNear24h)?"-":Mn(new i(null==l?void 0:l.txUserNear24h))},{description:r._({id:"sTnImq",message:"Total Liquidity"}),text:s.isLoading?Os.jsx(HM,{}):null===(null==l?void 0:l.tvl)||void 0===(null==l?void 0:l.tvl)?"-":`$${Mn(new i(null==l?void 0:l.tvl))}`},{description:r._({id:"p7/w10",message:"Volume (24H)"}),text:s.isLoading?Os.jsx(HM,{}):null===(null==l?void 0:l.volume)||void 0===(null==l?void 0:l.volume)?"-":`$${Mn(new i(null==l?void 0:l.volume))}`},{description:r._({id:"7X40pG",message:"Fees (24H)"}),text:s.isLoading?Os.jsx(HM,{}):null!==!(null==l?void 0:l.feeNear24h)||(null==l?void 0:l.mtFeeNear24h)?`$${Mn(new i(null!==(n=null==l?void 0:l.feeNear24h)&&void 0!==n?n:0).plus(null!==(o=null==l?void 0:l.mtFeeNear24h)&&void 0!==o?o:0))}`:"-",question:s.isLoading?void 0:Os.jsxs(f,{sx:{width:198},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsx(e,{id:"OnDEky",message:"LP Fee"}),Os.jsx(f,{children:(null==l?void 0:l.feeNear24h)?`$${Mn(new i(null==l?void 0:l.feeNear24h))}`:"-"})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsx(e,{id:"pSQ1lM",message:"MT Fee"}),Os.jsx(f,{children:(null==l?void 0:l.mtFeeNear24h)?`$${Mn(new i(null==l?void 0:l.mtFeeNear24h))}`:"-"})]})]})}];return Os.jsx(f,{sx:Object.assign({display:"grid",gap:12},a?{mt:24,gridTemplateColumns:"repeat(2, 1fr)"}:{mt:32,gridTemplateColumns:"repeat(4, 1fr)"}),children:d.map((e=>Os.jsxs(f,{sx:{borderRadius:8,p:16,backgroundColor:"background.paper"},children:[Os.jsx(f,{sx:{typography:"caption",fontWeight:600,lineHeight:1,mb:2},children:e.text}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",typography:"h6",color:"text.secondary",gap:4},children:[e.description,e.question?Os.jsx(Ov,{title:e.question}):""]})]},e.description)))})}function ZM({poolDetail:t,loading:n}){var i,o,a,s;const{address:l}=null!=t?t:{},d=g(),c=fw(),{account:u}=hf(),{isMobile:p}=wy(),h=u&&"DPP"===(null==t?void 0:t.type)&&(null===(i=null==t?void 0:t.owner)||void 0===i?void 0:i.toLocaleLowerCase())===u.toLocaleLowerCase(),{supportAMMV2:m,onSharePool:x}=pf();return Os.jsxs(f,{sx:Object.assign({},p?{pt:24}:{pt:20,display:"flex",alignItems:"center",justifyContent:"space-between"}),children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[(null==t?void 0:t.baseToken)?Os.jsx(Cj,{tokens:[t.baseToken,t.quoteToken],chainId:t.chainId,width:36,mr:8}):Os.jsx(w,{variant:"circular",sx:{width:36,height:36,mr:8}}),Os.jsxs(f,{children:[Os.jsxs(f,{sx:{typography:"h4"},children:[(null==t?void 0:t.baseToken)?`${null===(o=t.baseToken)||void 0===o?void 0:o.symbol} / ${null===(a=t.quoteToken)||void 0===a?void 0:a.symbol}`:"-",m&&Os.jsx(f,{component:"span",sx:{position:"relative",top:-4,ml:4,px:4,py:2,borderRadius:4,fontSize:10,lineHeight:1,fontWeight:600,backgroundColor:C(d.palette.purple.main,.1),color:d.palette.purple.main},children:"PMM"}),Os.jsx(_E,{address:l,chainId:null==t?void 0:t.chainId,hideName:p,sx:{display:"inline-flex",ml:8}}),h&&!p?Os.jsx(f,{component:y,sx:{typography:"h6",px:8,py:2,ml:8,borderStyle:"solid",borderWidth:1,borderRadius:4,borderColor:"primary.main",color:"primary.main",whiteSpace:"nowrap","&:hover":{backgroundColor:"primary.main",color:"primary.contrastText"}},onClick:()=>{c.push({type:pw.ModifyPool,params:{address:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}})},children:Os.jsx(e,{id:"ePK91l",message:"Edit"})}):""]}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",mr:12},children:Os.jsx(ZT,{address:null!=l?l:"",truncate:!0,showCopy:!0,iconDarkHover:!0,"data-key":"link",sx:{typography:"body2",color:"text.secondary"},iconSize:14,iconSpace:6,customChainId:null==t?void 0:t.chainId,onShareClick:x&&t?()=>x({chainId:t.chainId,baseToken:t.baseToken,quoteToken:t.quoteToken,poolId:l,apy:t.apy,isSingle:le.utils.singleSideLp(t.type)}):void 0})})]})]}),Os.jsxs(f,{sx:p?{display:"flex",alignItems:"center",mt:24}:{textAlign:"right"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",color:"success.main",typography:"h4"},children:[(null==t?void 0:t.miningAddress)?Os.jsx(A,{title:r._({id:"B3mhDR",message:"Add liquidity to obtain LP tokens for mining"}),children:Os.jsx("span",{children:"✨ "})}):"",Os.jsx(D,{loading:n,loadingSx:{width:100},children:null!==(s=null==t?void 0:t.baseApy)&&void 0!==s?s:"0%"}),(null==t?void 0:t.quoteApy)?`/${null==t?void 0:t.quoteApy}`:""]}),Os.jsx(f,{sx:Object.assign({typography:"body2"},p?{ml:4}:{}),children:Os.jsx(e,{id:"rSayea",message:"APY"})})]})]})}function zM({chainId:e,shortNumber:t,pieSize:n="default",baseReserve:r=new i(1),baseAmount:o=new i(1),quoteAmount:a=new i(0),baseTokenSymbol:s="-",quoteTokenSymbol:l="-",quoteTokenDecimals:d=18,baseTokenDecimals:c=18,baseTokenAddress:u,quoteTokenAddress:p,baseTvlRate:h,quoteTvlRate:m,disabledAmount:y,disabledRate:x,disabledPercentage:v,loading:b,sx:A,pieRadius:k}){const C=g(),j="small"===n,T=j?6:16,E=k||(j?23:30),S=c>6?6:c>4?4:2,I=d>6?6:d>4?4:2,R=t?Mn(new i(r)):bn({input:r,showDecimals:S}),L=t?Mn(new i(a)):bn({input:a,showDecimals:I});let M=o.plus(a);M=M.lte(0)?new i(1):M;const O=h||o.div(M).multipliedBy(100).toFixed(2),B=m||a.div(M).multipliedBy(100).toFixed(2),P=o.lte(0)&&a.lte(0),D=C.palette.purple.main,N=C.palette.secondary.main,F=[{name:"base",value:P?1:o.toNumber(),color:D},{name:"quote",value:P?1:a.toNumber(),color:N}];return Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",flexDirection:"column"},A||{}),children:[Os.jsx("div",{children:v?"":b?Os.jsx(w,{width:46,height:46,variant:"circular"}):Os.jsx($t,{width:2*E,height:2*E,children:Os.jsx(en,{isAnimationActive:!1,dataKey:"value",data:F,labelLine:!1,label:!1,outerRadius:E,fill:N,children:F.map(((e,t)=>Os.jsx(Kt,{fill:e.color,strokeWidth:0},`cell-${t}`)))})})}),Os.jsxs(f,{className:"symbol-wrapper",sx:{display:"flex",flexDirection:"column",justifyContent:"center",ml:0,mt:20,width:"100%","& > div":{paddingLeft:"16px",position:"relative","&::before":{content:'""',width:"6px",height:"6px",position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)",backgroundColor:C.palette.purple.main,borderRadius:"50%"},"&:last-child::before":{backgroundColor:N},"&> span.symbol":{display:"inline-block",maxWidth:"6em",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"text-bottom"}}},children:[b?Os.jsx(w,{width:237,sx:{borderRadius:4}}):Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsxs(f,{children:[Os.jsx("div",{className:"symbol",title:s,children:s}),u?Os.jsx(ZT,{address:u,customChainId:e,truncate:!0,showCopy:!0,size:"small",iconSpace:4,sx:{typography:"h6",color:"text.secondary"}}):""]}),Os.jsxs(f,{sx:{textAlign:"right"},children:[y?"":`${R} `,v||x?"":Os.jsxs(f,{sx:{color:"text.secondary",typography:"h6",fontWeight:600},children:[" ",`(${O}%)`]})]})]}),b?Os.jsx(w,{width:237,sx:{borderRadius:4,marginTop:`${T}px`}}):Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:`${T}px`},children:[Os.jsxs(f,{children:[Os.jsx("span",{className:"symbol",title:l,children:l}),p?Os.jsx(ZT,{address:p,customChainId:e,truncate:!0,showCopy:!0,size:"small",iconSpace:4,sx:{typography:"h6",color:"text.secondary"}}):""]}),Os.jsxs(f,{sx:{textAlign:"right"},children:[y?"":`${L} `,v||x?"":Os.jsxs(f,{sx:{color:"text.secondary",typography:"h6",fontWeight:600},children:[" ",`(${B}%)`]})]})]})]})]})}function QM({poolDetail:t}){var n,r,o,a,s,l,d,c,u;const p=g(),{isMobile:h}=wy(),m=It(es.getPMMStateQuery(null==t?void 0:t.chainId,null==t?void 0:t.address,null==t?void 0:t.type,null===(n=null==t?void 0:t.baseToken)||void 0===n?void 0:n.decimals,null===(r=null==t?void 0:t.quoteToken)||void 0===r?void 0:r.decimals)),y=null===(o=m.data)||void 0===o?void 0:o.midPrice,x=It(es.getReserveLpQuery(null==t?void 0:t.chainId,null==t?void 0:t.address,null==t?void 0:t.type,null===(a=null==t?void 0:t.baseToken)||void 0===a?void 0:a.decimals,null===(s=null==t?void 0:t.quoteToken)||void 0===s?void 0:s.decimals)),{baseReserve:v,quoteReserve:b}=x.data||{},A=v&&y?null==y?void 0:y.multipliedBy(v):void 0,k=b&&y?new i(b):void 0;let C=A&&k?null==A?void 0:A.plus(k):void 0;C=!C||C.lte(0)?new i(1):C;const j=A&&A.div(C).multipliedBy(100).toFixed(2),T=k&&k.div(C).multipliedBy(100).toFixed(2);return console.log("je",null==v?void 0:v.toString(),null==b?void 0:b.toString(),null==A?void 0:A.toString(),null==k?void 0:k.toString(),null==y?void 0:y.toString()),Os.jsxs(f,{sx:{mt:h?24:32},children:[Os.jsx(f,{sx:{fontWeight:600},children:Os.jsx(e,{id:"sTnImq",message:"Total Liquidity"})}),Os.jsxs(f,{sx:{display:"flex",mt:16,backgroundColor:"background.paper",borderRadius:16,overflowX:"auto"},children:[Os.jsx(f,{sx:{flex:h?1:void 0,padding:h?p.spacing(20,30,20,20):p.spacing(20,30,16)},children:Os.jsx(zM,{pieRadius:36,baseReserve:v,baseAmount:A,baseTokenDecimals:null===(l=null==t?void 0:t.baseToken)||void 0===l?void 0:l.decimals,quoteAmount:k,baseTvlRate:j,quoteTvlRate:T,chainId:null==t?void 0:t.chainId,quoteTokenDecimals:(null===(d=null==t?void 0:t.quoteToken)||void 0===d?void 0:d.decimals)||void 0,baseTokenSymbol:Dn(null==t?void 0:t.baseToken),quoteTokenSymbol:Dn(null==t?void 0:t.quoteToken),baseTokenAddress:h?null===(c=null==t?void 0:t.baseToken)||void 0===c?void 0:c.address:"",quoteTokenAddress:h?null===(u=null==t?void 0:t.quoteToken)||void 0===u?void 0:u.address:"",shortNumber:!0,disabledRate:!h,disabledAmount:!h,loading:m.isLoading||x.isLoading,sx:h?{typography:"body2",fontWeight:600}:{"& .symbol-wrapper":{display:"flex",alignItems:"center",flexDirection:"row","& > div, & > span":{mt:0,"&:last-child":{ml:16}},"& .MuiSkeleton-root":{width:"40px !important"}}}})}),h?"":Os.jsxs(f,{component:"table",sx:{flex:1,fontWeight:600,borderStyle:"solid",borderColor:"border.main",borderWidth:"0 0 0 1px","& thead":{typography:"h6",color:"text.secondary","& th":{textAlign:"right",px:20,py:16,borderStyle:"solid",borderColor:"border.main",borderWidth:"0 0 1px","&:first-child":{textAlign:"left"}}},"& tbody":{typography:"body2",textAlign:"right","& td":{px:20,py:0,"&:first-child":{textAlign:"left"}}}},children:[Os.jsx("thead",{children:Os.jsxs("tr",{children:[Os.jsx("th",{children:Os.jsx(e,{id:"bUUVED",message:"Asset"})}),Os.jsx("th",{children:Os.jsx(e,{id:"hcNa1G",message:"Token Amount"})}),Os.jsx("th",{children:Os.jsx(e,{id:"iaocTt",message:"Ratio"})})]})}),Os.jsxs("tbody",{children:[Os.jsxs("tr",{children:[Os.jsx("td",{children:t?Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(ey,{address:t.baseToken.address,width:24,height:24,marginRight:4,chainId:t.chainId}),Os.jsxs(f,{children:[t.baseToken.symbol,Os.jsx(ZT,{address:t.baseToken.address,truncate:!0,showCopy:!0,size:"small",iconSpace:4,customChainId:t.chainId,sx:{typography:"h6",color:"text.secondary"}})]})]}):Os.jsx(w,{width:100,height:24})}),Os.jsx("td",{children:t?Mn(new i(t.baseReserve)):Os.jsx(w,{width:50,height:24,sx:{display:"inline-block"}})}),Os.jsx("td",{children:m.isLoading?Os.jsx(w,{width:50,height:24,sx:{display:"inline-block"}}):`${null!=j?j:"-"}%`})]}),Os.jsxs("tr",{children:[Os.jsx("td",{children:t?Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(ey,{address:t.quoteToken.address,width:24,height:24,marginRight:4,chainId:t.chainId}),Os.jsxs(f,{children:[t.quoteToken.symbol,Os.jsx(ZT,{address:t.quoteToken.address,truncate:!0,showCopy:!0,size:"small",iconSpace:4,customChainId:t.chainId,sx:{typography:"h6",color:"text.secondary"}})]})]}):Os.jsx(w,{width:100,height:24})}),Os.jsx("td",{children:t?Mn(new i(t.quoteReserve)):Os.jsx(w,{width:50,height:24,sx:{display:"inline-block"}})}),Os.jsx("td",{children:m.isLoading?Os.jsx(w,{width:50,height:24,sx:{display:"inline-block"}}):`${null!=T?T:"-"}%`})]})]})]})]})]})}function GM({params:t}){var n,i,o,a,s,l,d;const c=fw(),{isMobile:u}=wy(),{account:p}=hf(),h=g(),m=yM({id:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}),{poolDetail:y}=m,x=Nn(m,["poolDetail"]),[v,b]=at.useState("inital");x.isPending||x.error||y||"inital"!==v||b("open");const A=y&&"DPP"===y.type&&p&&(null===(n=y.owner)||void 0===n?void 0:n.toLocaleLowerCase())===p.toLocaleLowerCase(),w=y&&"DPP"!==y.type||p&&(null==y?void 0:y.owner)&&y.owner.toLocaleLowerCase()===p.toLocaleLowerCase(),[k,C]=at.useState();y&&void 0===k&&!u&&C(FT.Add);const j=k&&y?Object.assign(Object.assign({},y),{baseLpToken:{id:null===(i=y.baseLpToken)||void 0===i?void 0:i.id,decimals:Number(null!==(a=null===(o=y.baseLpToken)||void 0===o?void 0:o.decimals)&&void 0!==a?a:18)},quoteLpToken:{id:null===(s=y.quoteLpToken)||void 0===s?void 0:s.id,decimals:Number(null!==(d=null===(l=y.quoteLpToken)||void 0===l?void 0:l.decimals)&&void 0!==d?d:18)}}):void 0,E=!!(null==y?void 0:y.miningAddress);return Os.jsxs(xw,{sx:u?{p:h.spacing(28,20,w?108:0)}:{p:h.spacing(28,40,40)},children:[Os.jsx(jS,{onClick:()=>{c.push({type:pw.Pool})}}),Os.jsxs(f,{sx:u?{}:{display:"flex",gap:12,overflow:"hidden"},children:[Os.jsxs(f,{sx:{flex:1,overflow:"hidden"},children:[Os.jsx(ZM,{poolDetail:y,loading:x.isPending}),Os.jsx(EM,{poolDetail:y,chart24hDataFirst:!0}),Os.jsx(qM,{poolDetail:y}),Os.jsx(QM,{poolDetail:y}),Os.jsx(UM,{poolDetail:y})]}),u?Os.jsx(wE,{account:p,pool:j,operate:k,hasMining:E,modal:!0,onClose:()=>{C(void 0)}}):Os.jsx(AE,{account:p,operate:k,hasMining:E,sx:{width:375,height:"max-content",backgroundColor:"background.paper",borderRadius:16,overflow:"hidden"},pool:j,hidePoolInfo:!0})]}),Os.jsx(fM,{singleBtn:!0,open:"open"===v,onClose:()=>b("close"),onConfirm:()=>b("close"),title:r._({id:"Da1+Da",message:"Pool not found. Please switch to another network and retry."})}),u&&w&&Os.jsx(Os.Fragment,{children:Os.jsxs(f,{sx:{position:"fixed",bottom:0,left:0,right:0,p:20,display:"grid",gap:"8px",gridTemplateColumns:A?"repeat(3, 1fr)":"repeat(2, 1fr)",backgroundColor:"background.paperContrast"},children:[A?Os.jsx(T,{variant:T.Variant.second,onClick:()=>{fw.getState().push({type:pw.ModifyPool,params:{chainId:y.chainId,address:y.address}})},children:Os.jsx(e,{id:"ePK91l",message:"Edit"})}):"",Os.jsx(T,{variant:T.Variant.second,onClick:()=>{C(FT.Remove)},children:Os.jsx(e,{id:"t/YqKh",message:"Remove"})}),Os.jsx(T,{onClick:()=>{C(FT.Add)},children:Os.jsx(e,{id:"m16xKo",message:"Add"})})]})})]})}function YM({title:e,disabled:t,children:n}){return Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:12,opacity:t?.3:void 0},children:[Os.jsx(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",fontWeight:600},children:e}),n]})}function XM({token:t,chainId:n,showChainLogo:r,readonly:i,showChainName:o,logoSize:a=24,chainLogoSize:s=12,side:l,occupiedToken:d,defaultLoadBalance:c,notTokenPickerModal:u,border:p,borderBold:h,px:m=20,py:x=8,highlightDefault:v,onTokenClick:b,onTokenChange:A}){var w,k;const{onlyChainId:C}=pf(),j=n||C,T=g(),[E,S]=at.useState(!1),I=(null==t?void 0:t.chainId)?_g.get(t.chainId):null,R=o&&!!I;return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{component:y,sx:Object.assign(Object.assign(Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,color:T.palette.text.primary,typography:R?"body2":"body1",fontWeight:600,px:m,py:x,"&:focus-visible":{opacity:.5}},!!p&&{border:`solid 1px ${T.palette.border.main}`,borderRadius:8,"&:hover":{backgroundColor:T.palette.hover.default}}),!!h&&{border:`solid 3px ${T.palette.text.primary}`,backgroundColor:"background.input"}),!(!v||t)&&{backgroundColor:T.palette.primary.main,color:T.palette.primary.contrastText,"&:hover":{opacity:.8}}),onClick:()=>{i||S(!0)},"data-testid":ly,children:[!!(null==t?void 0:t.address)&&Os.jsx(ey,{url:null==t?void 0:t.logoURI,address:null!==(w=null==t?void 0:t.address)&&void 0!==w?w:"",chainId:null==t?void 0:t.chainId,noShowChain:!r,width:a,height:a,chainSize:s,logoOffset:10,marginRight:0}),Os.jsxs(f,{sx:{flex:1},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(null==t?void 0:t.address)?Os.jsx(Os.Fragment,{children:Os.jsx(f,{children:null!==(k=null==t?void 0:t.symbol)&&void 0!==k?k:"-"})}):Os.jsx(e,{id:"sIPJGT",message:"SELECT TOKEN"}),!i&&Os.jsx(f,{component:"svg",width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",sx:{flexShrink:0},children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.58398 12.376C6.78189 12.6728 7.21811 12.6728 7.41603 12.376L10.4818 7.77735C10.7033 7.44507 10.4651 7 10.0657 7H3.93426C3.53491 7 3.29672 7.44507 3.51823 7.77735L6.58398 12.376Z",fill:"currentColor"})})]}),!!R&&Os.jsxs(f,{sx:{display:"flex",alignItems:"center",typography:"h6",color:"text.secondary"},children:[I.name,Os.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{d:"M5.6036 4.12761C5.50037 4.20906 5.3708 4.24967 5.23958 4.24169C5.10836 4.23372 4.98466 4.17773 4.89203 4.08438C4.7994 3.99103 4.74433 3.86685 4.7373 3.73549C4.73026 3.60413 4.77177 3.47477 4.8539 3.37205L5.96239 2.25211C6.46737 1.76405 7.14372 1.494 7.84575 1.5001C8.54779 1.50621 9.21934 1.78798 9.71577 2.28474C10.2122 2.78151 10.4938 3.4535 10.4999 4.156C10.506 4.85851 10.2361 5.5353 9.74839 6.04062L8.60241 7.16592C8.55441 7.22201 8.49533 7.26757 8.4289 7.29974C8.36246 7.3319 8.29009 7.34997 8.21635 7.35282C8.1426 7.35567 8.06906 7.34324 8.00034 7.3163C7.93162 7.28936 7.86921 7.2485 7.81702 7.19627C7.76483 7.14405 7.724 7.0816 7.69707 7.01284C7.67015 6.94407 7.65772 6.87048 7.66057 6.79668C7.66342 6.72289 7.68148 6.65047 7.71363 6.58399C7.74577 6.51751 7.7913 6.4584 7.84736 6.41036L8.97191 5.28506C9.25568 4.98032 9.41017 4.57725 9.40283 4.16078C9.39549 3.74431 9.22689 3.34695 8.93255 3.05242C8.63821 2.75788 8.24111 2.58917 7.82491 2.58182C7.40872 2.57447 7.00592 2.72906 6.70138 3.01302L5.6036 4.12761ZM6.34259 7.93755C6.38819 7.87582 6.44652 7.82461 6.51361 7.7874C6.58071 7.75018 6.65501 7.72783 6.73149 7.72185C6.80798 7.71586 6.88485 7.7264 6.95691 7.75273C7.02897 7.77906 7.09453 7.82058 7.14917 7.87447C7.2038 7.92836 7.24622 7.99337 7.27356 8.06509C7.3009 8.13682 7.31252 8.21358 7.30764 8.29019C7.30275 8.3668 7.28148 8.44147 7.24525 8.50913C7.20902 8.5768 7.15869 8.63589 7.09765 8.68239L5.96774 9.81305C5.45894 10.2708 4.7943 10.5163 4.11029 10.4992C3.42627 10.482 2.77479 10.2034 2.2896 9.72061C1.80441 9.23784 1.52232 8.58752 1.50127 7.90316C1.48021 7.2188 1.72179 6.55234 2.17638 6.04062L3.30629 4.93139C3.3504 4.86735 3.4079 4.81369 3.47482 4.77413C3.54174 4.73456 3.61646 4.71005 3.69379 4.70229C3.77113 4.69453 3.84922 4.70371 3.92266 4.72919C3.99609 4.75466 4.0631 4.79583 4.11904 4.84983C4.17497 4.90384 4.21849 4.96937 4.24657 5.0419C4.27464 5.11442 4.28661 5.19219 4.28163 5.2698C4.27665 5.34742 4.25484 5.42302 4.21773 5.49135C4.18062 5.55969 4.12908 5.61912 4.06671 5.66552L2.93144 6.79618C2.64767 7.10092 2.49318 7.50398 2.50052 7.92045C2.50786 8.33692 2.67647 8.73428 2.97081 9.02882C3.26515 9.32335 3.66224 9.49207 4.07844 9.49942C4.49463 9.50676 4.89743 9.35217 5.20197 9.06821L6.34259 7.93755ZM5.00919 7.76072C4.96119 7.81681 4.90211 7.86237 4.83567 7.89454C4.76924 7.9267 4.69687 7.94477 4.62312 7.94763C4.54937 7.95048 4.47583 7.93804 4.40711 7.9111C4.33839 7.88416 4.27598 7.8433 4.2238 7.79108C4.17161 7.73885 4.13077 7.6764 4.10385 7.60764C4.07693 7.53887 4.0645 7.46528 4.06735 7.39149C4.0702 7.31769 4.08826 7.24528 4.1204 7.17879C4.15255 7.11231 4.19808 7.0532 4.25413 7.00516L6.90487 4.35267C7.00731 4.26488 7.13909 4.21901 7.27386 4.22422C7.40863 4.22943 7.53648 4.28533 7.63185 4.38077C7.72722 4.4762 7.78309 4.60413 7.7883 4.73899C7.7935 4.87385 7.74766 5.00572 7.65993 5.10823L5.00919 7.76072Z",fill:"currentColor"})})]})]})]}),Os.jsx(ky,{value:t,open:E,side:l,chainId:j,occupiedAddrs:d?[d.address]:void 0,occupiedChainId:null==d?void 0:d.chainId,defaultLoadBalance:c,onClose:()=>{S(!1),b&&b()},onTokenChange:(e,t)=>{S(!1),setTimeout((()=>{!Array.isArray(e)&&A&&A(e,t)}),my)},modal:!u})]})}!function(e){e[e.depth=1]="depth",e[e.volume=2]="volume",e[e.feeRevenue=3]="feeRevenue",e[e.traders=4]="traders"}(jM||(jM={})),function(e){e[e.parameters=1]="parameters",e[e.swaps=2]="swaps",e[e.liquidityProviders=3]="liquidityProviders"}(TM||(TM={}));const JM=1e-4;function KM({disabled:t,fee:n,onChange:r,feeList:o,hasCustom:a}){const s=g(),[l,d]=at.useState(!1),[c,u]=at.useState(!1),[p,h]=at.useState(""),{isMobile:m}=wy(),x=!o.includes(n),b=x||c,A=!c&&x&&!!p&&new i(p).div(100).lt(JM),w=t||A;return Os.jsxs(f,{sx:{opacity:t?.3:void 0,fontWeight:600},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:20,py:12,borderWidth:1,borderRadius:12},children:[Os.jsx(e,{id:"tMMG40",message:"{0}% fee tier",values:{0:n?new i(n).times(100).toString():"-"}}),Os.jsx(y,{sx:{px:16,py:7,border:`solid 1px ${s.palette.text.primary}`,borderRadius:8,fontWeight:600,color:"text.primary",cursor:w?"default":"pointer",opacity:A?.3:1},disabled:w,onClick:()=>{w||d((e=>!e))},children:l?Os.jsx(e,{id:"vLyv1R",message:"Hide"}):Os.jsx(e,{id:"ePK91l",message:"Edit"})})]}),l&&Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:Object.assign({mt:12},m?{display:"grid",gap:8,gridTemplateColumns:"repeat(2, 1fr)"}:{display:"flex",alignItems:"center",gap:8,"& > label":{flex:1}}),children:[o.map((e=>{const t=n===e&&!b;return Os.jsxs(f,{component:"label",sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:12,borderWidth:1,borderRadius:12,cursor:"pointer"},t&&{borderColor:s.palette.primary.main}),children:[100*e,"%",Os.jsx(J,{size:18,checked:t,onChange:(t,n)=>{n&&r(e)}})]},e)})),a&&Os.jsxs(f,{component:"label",sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:12,borderWidth:1,borderRadius:12,cursor:"pointer",color:A?s.palette.error.main:"text.primary"},b&&{borderColor:s.palette.primary.main}),onClick:()=>{u(!0),h("")},children:[c?Os.jsx(v,{value:p,autoFocus:!0,onChange:e=>{const t=e.target.value;isNaN(Number(t))||h(t)},onBlur:()=>{const e=Number(p),t=e?new i(e).div(100).toNumber():e;t&&t<JM?r(0):p&&(e||0===e)&&r(t),u(!1)},sx:{p:0,flex:1,height:"100%",border:"none",backgroundColor:"none"},inputSx:{p:0}}):Os.jsx(Os.Fragment,{children:x?(new i(n).times(100).toNumber()||p)+"%":Os.jsx(e,{id:"8Tg/JR",message:"Custom"})}),Os.jsx(J,{size:18,checked:b,sx:{flexShrink:0}})]})]}),A&&Os.jsxs(f,{sx:{mt:12,display:"flex",alignItems:"center",gap:8,p:8,borderRadius:8,typography:"h6",backgroundColor:C(s.palette.error.main,.1),color:s.palette.error.main},children:[Os.jsx(f,{component:As.ErrorBorder,sx:{width:18,height:18}}),Os.jsx(e,{id:"LHxwaD",message:"The fee tier should greater than {0}%",values:{0:100*JM}})]})]})]})}function _M({sx:t,disabled:n,slippage:r,onChangeSlippage:o}){const a=g(),s=r===ww,[l,d]=ct(s?"":new i(r).times(100).toNumber());return Os.jsx(A,{disabled:n,onlyClick:!0,title:Os.jsxs(f,{sx:{backgroundColor:a.palette.background.paper,padding:a.spacing(16,20),borderRadius:16,width:375,maxWidth:"90vw",boxSizing:"border-box"},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2",color:"text.primary"},children:[Os.jsx("span",{children:Os.jsx(e,{id:"lqTDfd",message:"Slippage Tolerance"})}),Os.jsxs("span",{children:[s?Cw:r&&new i(r).times(100).toNumber(),"%"]})]}),Os.jsxs(f,{sx:{mt:16,display:"flex",alignItems:"center",margin:a.spacing(16,0,0,0)},children:[Os.jsx(Aw,{sx:{borderRadius:8,whiteSpace:"nowrap"},onClick:()=>{d(""),o(ww)},active:s}),Os.jsx(v,{placeholder:String(Cw),value:l,onChange:e=>{const{value:t}=e.target;d(t),o(t?new i(t).div(100).toNumber():ww)},onBlur:()=>{(!s&&new i(r).gt(.1)||new i(r).lte(0))&&(d(10),o(.1))},suffix:Os.jsx(f,{sx:{mr:16},children:"%"}),sx:{ml:8,"& input":{px:16,py:0,height:"39px"}}})]})]}),sx:{p:0},arrow:!1,placement:"bottom-end",children:Os.jsx(Q,{sx:Object.assign({width:"max-content",alignItems:"right",margin:a.spacing(0,0,0,"auto"),p:a.spacing(4,12),borderRadius:20,backgroundColor:"background.paperDarkContrast",cursor:"pointer"},t),children:Os.jsx(f,{component:As.Setting,sx:{width:18,height:18,"& path:last-child":{fill:a.palette.text.primary}}})})})}function $M({statuses:t,children:n,buttonProps:r}){var i;if(!t.find((e=>e.needShowTokenStatusButton))&&n)return Os.jsx(Os.Fragment,{children:n});const o=t.find((e=>e.insufficientBalance));if(o)return Os.jsx(T,{fullWidth:!0,disabled:!0,...r,children:Os.jsx(e,{id:"m6RmA/",message:"Insufficient {0} balance",values:{0:null===(i=o.token)||void 0===i?void 0:i.symbol}})});const a=t.some((e=>e.isApproving));return Os.jsx(f,{sx:{display:"flex",alignItems:"center",gap:4},children:t.map(((t,n)=>{var i,o;let s="";return t.isApproving?s=Os.jsx(e,{id:"j2Uisd",message:"Approving"}):(t.needReset||t.needApprove)&&(s=t.approveTitle),s?Os.jsx(T,{fullWidth:!0,isLoading:t.isApproving,onClick:t.submitApprove,disabled:t.insufficientBalance||a,...r,children:s},null!==(o=null===(i=t.token)||void 0===i?void 0:i.symbol)&&void 0!==o?o:n):null}))})}function eO({isExists:t,pair:n,pairAddress:r}){var o,a,s;const{isBalanceLoading:l,isDepositedLoading:d,balance:c,token0Deposited:u,token1Deposited:p,poolTokenPercentage:h}=function({pairAddress:e,pair:t}){var n;const{account:r}=hf(),o=null===(n=null==t?void 0:t.liquidityToken)||void 0===n?void 0:n.chainId,a=It(Object.assign(Object.assign({},We(o,e,r)),{retry:!1})),s=It(Object.assign(Object.assign({},Ve(o,e)),{retry:!1})),[l,d,c]=at.useMemo((()=>{if(!t||!a.data||!s.data||s.data<a.data)return[void 0,void 0,void 0];const e=on.fromRawAmount(t.liquidityToken,s.data.toString()),n=on.fromRawAmount(t.liquidityToken,a.data.toString());return[new sn(a.data.toString(),s.data.toString()),t.getLiquidityValue(t.token0,e,n,!1),t.getLiquidityValue(t.token1,e,n,!1)]}),[a.data,s.data,t]);return{isBalanceLoading:a.isLoading,isDepositedLoading:a.isLoading||s.isLoading,balance:a.data&&t?Tn(a.data.toString(),t.liquidityToken.decimals):void 0,poolTokenPercentage:l?new i(l.toSignificant(6)):void 0,token0Deposited:d?new i(d.toSignificant()):void 0,token1Deposited:c?new i(c.toSignificant()):void 0}}({pairAddress:r,pair:n}),m=h?`${bn({input:h,showDecimals:2,roundingMode:i.ROUND_HALF_UP})}%`:void 0;return t&&n?Os.jsxs(f,{sx:{px:20,py:12,borderWidth:1,borderRadius:8},children:[Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"YHc3B+",message:"My Liquidity"})}),Os.jsxs(f,{sx:{mt:12,display:"flex",alignItems:"center"},children:[Os.jsx(Cj,{width:18,height:18,tokens:[n.token0,n.token1],mr:4}),Os.jsx(D,{loading:l,loadingProps:{width:50},sx:{mr:4},children:An({input:c,decimals:null===(o=n.liquidityToken)||void 0===o?void 0:o.decimals})}),`${n.token0.symbol}/${n.token1.symbol} LP`,Os.jsx(A,{title:Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:10,typography:"body2",color:"text.primary"},children:[Os.jsx(oE,{address:n.token0.address,chainId:n.token0.chainId,showName:null!==(a=n.token0.symbol)&&void 0!==a?a:"",size:14,offset:4,rightContent:Os.jsx(D,{loading:d,loadingProps:{width:50},children:An({input:u,decimals:n.token0.decimals})})}),Os.jsx(oE,{address:n.token1.address,chainId:n.token1.chainId,showName:null!==(s=n.token1.symbol)&&void 0!==s?s:"",size:14,offset:4,rightContent:Os.jsx(D,{loading:d,loadingProps:{width:50},children:An({input:p,decimals:n.token1.decimals})})}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsx(e,{id:"c4miqE",message:"Pool share"}),Os.jsx(D,{loading:d,loadingProps:{width:50},children:m})]})]}),sx:{padding:20,width:256},children:Os.jsx(I,{component:As.DetailBorder,sx:{ml:4,width:16,height:16,cursor:"pointer"}})}),Os.jsx(f,{component:"a",target:"_blank",rel:"noopener noreferrer",href:ps(n.liquidityToken.chainId,n.liquidityToken.address,"address"),sx:{ml:4,display:"inline-flex",height:16},children:Os.jsx(I,{component:As.ArrowTopRightBorder,sx:{width:16,height:16}})})]})]}):null}function tO(){var t,n,r;const[o,a]=at.useState(.003),[s,l]=at.useState(),[d,c]=at.useState(),[u,p]=at.useState(""),[h,m]=at.useState(""),[g,y]=at.useState(ww),x=g===ww?new i(Cw).div(100).toNumber():g,{isMobile:v}=wy(),{onlyChainId:b}=pf(),A=at.useMemo((()=>b||(null==s?void 0:s.chainId)||(null==d?void 0:d.chainId)),[b,s,d]),{pairAddress:w,pair:k,price:C,isInvalidPair:j,invertedPrice:E,priceLoading:S,liquidityMinted:I,shareOfPool:R,isExists:L}=function({baseToken:e,quoteToken:t,baseAmount:n,quoteAmount:r,fee:i}){const[o,a,s]=at.useMemo((()=>{var n,r;if(!e||!t)return[null,null,!1];const i=ue[e.chainId],o=(null===(n=i.address)||void 0===n?void 0:n.toLowerCase())===e.address.toLowerCase(),a=(null===(r=i.address)||void 0===r?void 0:r.toLowerCase())===t.address.toLowerCase(),s=o?i.wrappedTokenAddress:e.address,l=a?i.wrappedTokenAddress:t.address,d=s.toLowerCase()===l.toLowerCase();return d?[null,null,!0]:[new rn(e.chainId,s,e.decimals,e.symbol,e.name),new rn(t.chainId,l,t.decimals,t.symbol,t.name),d]}),[e,t]),l=at.useMemo((()=>{if(!o||!a||void 0===i)return;const e=o.chainId,t=e?ke(e)||Fe(e):void 0;return t?fs({factoryAddress:t,tokenA:o,tokenB:a,fee:i}):void 0}),[o,a,i]),{pair:d,price:c,invertedPrice:u,reserveQuery:p,liquidityMinted:h,shareOfPool:m,isExists:f}=vT({pool:e&&t&&l?{baseToken:e,quoteToken:t,type:"AMMV2",address:l}:void 0,baseAmount:n,quoteAmount:r});return{pairAddress:l,pair:d,isInvalidPair:s,price:c,invertedPrice:u,priceLoading:p.isLoading,liquidityMinted:h,shareOfPool:m,isExists:f}}({baseToken:s,quoteToken:d,baseAmount:u,quoteAmount:h,fee:o}),M=zw(C);if(C&&u&&!C.isEqualTo(null!=M?M:0)&&L){const e=C.times(u).dp(null!==(t=null==d?void 0:d.decimals)&&void 0!==t?t:18);e.isEqualTo(h)||m(e.toString())}const O=A?Ce(A)||Ie(A):void 0,B=EA(s,{amount:u,contractAddress:O}),P=EA(d,{amount:h,contractAddress:O}),[D,N]=at.useState(!1),F=!s||!d,W=()=>{fw.getState().push({type:pw.Pool})},V=YT({baseToken:s,quoteToken:d,baseAmount:u,quoteAmount:h,fee:o,isExists:L,slippage:x,successBack:()=>{fw.getState().push({type:pw.Pool,params:{tab:cS.myLiquidity}})}});return Os.jsxs(xw,{children:[Os.jsxs(f,{sx:{mx:"auto",borderRadius:v?0:16,backgroundColor:"background.paper",width:v?"100%":600,position:"relative",overflow:"hidden"},children:[v?Os.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:20,pb:0},children:Os.jsx(jS,{onClick:W})}):Os.jsxs(f,{sx:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center",px:20,py:24,typography:"caption"},children:[Os.jsx(f,{component:As.ArrowBack,sx:{position:"absolute",left:20,cursor:"pointer"},onClick:W}),Os.jsx(e,{id:"E6MqGy",message:"Add liquidity"})]}),Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:20,pt:24,px:20,pb:20},children:[Os.jsx(eO,{pair:k,pairAddress:w,isExists:L}),Os.jsxs(YM,{title:Os.jsx(e,{id:"nxRg31",message:"Select pair"}),children:[Os.jsxs(f,{sx:{display:"grid",gridTemplateColumns:v?"repeat(1, 1fr)":"repeat(2, 1fr)",gap:12},children:[Os.jsx(XM,{border:!0,highlightDefault:!0,chainId:A,token:s,onTokenChange:(e,t)=>{t?(l(d),c(s),p(""),m("")):(l(e),p(""))},occupiedToken:d}),Os.jsx(XM,{border:!0,highlightDefault:!0,chainId:A,token:d,onTokenChange:(e,t)=>{t?(l(d),c(s)):(c(e),m(""))},occupiedToken:s})]}),(!A||as(A))&&Os.jsx(KM,{fee:o,onChange:a,feeList:[1e-4,5e-4,.003],hasCustom:!0,disabled:F})]}),Os.jsx(YM,{title:Os.jsx(e,{id:"MU9s7M",message:"Deposit amounts"}),disabled:F,children:Os.jsxs(f,{children:[Os.jsx(Qy,{sx:{mb:4,pb:28,minHeight:"auto"},token:s,amt:u,defaultLoadBalance:!0,onInputChange:e=>{var t;p(e);const n=Number(e);L&&C&&n&&m(C.times(e).dp(null!==(t=null==d?void 0:d.decimals)&&void 0!==t?t:18).toString())},showMaxBtn:!0,occupiedAddrs:[null!==(n=null==d?void 0:d.address)&&void 0!==n?n:""],occupiedChainId:null==d?void 0:d.chainId,notTokenPickerModal:!0,showPercentage:!0,readOnly:F}),Os.jsx(Bv,{plus:!0}),Os.jsx(Qy,{sx:{pb:20,minHeight:"auto"},token:d,amt:h,defaultLoadBalance:!0,onInputChange:e=>{var t;m(e);const n=Number(e);L&&E&&n&&p(E.times(e).dp(null!==(t=null==s?void 0:s.decimals)&&void 0!==t?t:18).toString())},showMaxBtn:!0,occupiedAddrs:[null!==(r=null==s?void 0:s.address)&&void 0!==r?r:""],occupiedChainId:null==s?void 0:s.chainId,notTokenPickerModal:!0,showPercentage:!0,readOnly:F}),Os.jsx(_M,{slippage:g,onChangeSlippage:y,disabled:F,sx:{mt:8}}),Os.jsx(QT,{baseToken:s,quoteToken:d,loading:S,midPrice:C,shareOfPool:R}),!!L&&Os.jsxs(f,{sx:{mt:20,p:20,borderRadius:16,backgroundColor:"background.paperContrast",typography:"h6",textAlign:"center","& > b":{fontWeight:600,color:"primary.main"}},children:["🌟",Os.jsx("b",{children:Os.jsx(e,{id:"e38JNU",message:"Tips:"})})," ",Os.jsx(e,{id:"1ABiXc",message:"By adding liquidity you’ll earn <0>{0}</0> of all trades on this pair proportional to your share of the pool. Fees are added to the pool, accrue in real time and can be claimed by withdrawing your liquidity.",values:{0:Bn({input:o})},components:{0:Os.jsx("b",{})}})]})]})})]}),Os.jsx(f,{sx:{py:16,px:20,borderTopWidth:1},children:Os.jsx(sb,{fullWidth:!0,includeButton:!0,size:T.Size.big,disabled:F,chainId:A,children:Os.jsx($M,{statuses:[B,P],buttonProps:{size:T.Size.big},children:Os.jsx(T,{fullWidth:!0,size:T.Size.big,disabled:!(s&&d&&u&&h&&!j&&o),onClick:()=>N(!0),children:j?Os.jsx(e,{id:"R7D79P",message:"Invalid pair"}):Os.jsx(e,{id:"bwSQI0",message:"Supply"})})})})})]}),Os.jsx(GT,{open:D,onClose:()=>N(!1),slippage:x,baseToken:s,baseAmount:u,quoteToken:d,quoteAmount:h,fee:o,price:C,lpAmount:I,shareOfPool:R,pairAddress:w,createMutation:V})]})}const nO=({disabled:e,feeAmount:t,dispatch:n})=>{const i=g(),{isMobile:o}=wy(),[a,s]=ct(!1);return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:12,borderWidth:1,borderStyle:"solid",borderColor:i.palette.border.main,borderRadius:12},e?{opacity:.3}:void 0),children:[Os.jsx(f,{sx:{typography:"h5",color:i.palette.text.primary},children:t?`${eS[t].label} ${r._({id:"fxRyGG",message:"fee tier"})}`:r._({id:"EU3wU4",message:"Fee tier"})}),Os.jsx(T,{size:T.Size.small,variant:T.Variant.outlined,disabled:e,onClick:()=>s((e=>!e)),sx:{color:i.palette.text.primary,border:`solid 1px ${i.palette.text.primary}`},children:a?r._({id:"vLyv1R",message:"Hide"}):r._({id:"ePK91l",message:"Edit"})})]}),a&&Os.jsx(f,{sx:Object.assign({},o?{display:"grid",gap:8,gridTemplateColumns:"repeat(2, 1fr)"}:{display:"flex",alignItems:"center",gap:8}),children:[bk.LOWEST,bk.LOW,bk.MEDIUM,bk.HIGH].map((r=>{const o=t===r;return Os.jsxs(T,{size:T.Size.middle,variant:T.Variant.outlined,disabled:e,onClick:()=>{n({type:Hj.UpdateFeeAmount,payload:r})},sx:{flexBasis:"50%",flexShrink:1,flexGrow:1,justifyContent:"space-between",px:20,color:i.palette.text.primary,borderRadius:12,borderColor:o?i.palette.primary.main:i.palette.border.main,[i.breakpoints.up("tablet")]:{flexBasis:"25%"}},children:[eS[r].label,o?Os.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[Os.jsx("rect",{x:"0.5",y:"0.5",width:"17",height:"17",rx:"8.5",stroke:i.palette.primary.main}),Os.jsx("rect",{x:"4.5",y:"4.5",width:"9",height:"9",rx:"4.5",fill:i.palette.primary.main,stroke:i.palette.primary.main})]}):Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:Os.jsx("rect",{x:"0.5",y:"0.5",width:"17",height:"17",rx:"8.5",stroke:i.palette.text.secondary})})]},r)}))})]})},rO={neutral1:"#222222",neutral2:"#7D7D7D",accent1:"#FC72FF",critical:"FF5F52",white:"#FFFFFF",surface3:"#22222212",opacity:{hover:.6,click:.4,disabled:.5,enabled:1}},iO=({series:e,xScale:t,yScale:n,xValue:r,yValue:i,fill:o})=>lt((()=>{var a;return Os.jsx(f,{component:"path",opacity:.5,stroke:null!=o?o:rO.accent1,fill:null!=o?o:rO.accent1,d:null!==(a=cn().curve(un).x((e=>t(r(e)))).y1((e=>n(i(e)))).y0(n(0))(e.filter((e=>{const n=t(r(e));return n>0&&n<=window.innerWidth}))))&&void 0!==a?a:void 0})}),[o,e,t,r,n,i]),oO=({axisGenerator:e})=>Os.jsx("g",{ref:t=>{t&&hn(t).call(e).call((e=>e.select(".domain").remove()))}}),aO=({xScale:e,innerHeight:t,offset:n=0})=>lt((()=>Os.jsx(f,{component:"g",transform:`translate(0, ${t+n})`,sx:{"& line":{display:"none"},"& text":{color:rO.neutral2,transform:"translateY(5px)"}},children:Os.jsx(oO,{axisGenerator:pn(e).ticks(6)})})),[t,n,e]),sO=e=>["M 0 0",`v ${e}`,"m 1 0","V 0","M 0 1","h 12","q 2 0, 2 2","v 22","q 0 2 -2 2","h -12","z"].join(" "),lO=()=>["m 5 7","v 14","M 0 0","m 9 7","v 14","z"].join(" "),dO=({color:e,size:t=10,margin:n=10})=>Os.jsx("polygon",{points:`0 0, ${t} ${t}, 0 ${t}`,transform:` translate(${t+n}, ${n}) rotate(45) `,fill:e,stroke:e,strokeWidth:"4",strokeLinejoin:"round"});const cO=({color:e,d:t})=>Os.jsx(f,{component:"path",cursor:"ew-resize",pointerEvents:"none",strokeWidth:3,stroke:e,fill:e,d:t}),uO=({d:e})=>Os.jsx(f,{component:"path",cursor:"ew-resize",pointerEvents:"none",stroke:rO.white,opacity:rO.opacity.hover,d:e}),pO=({visible:e,transform:t,children:n})=>Os.jsx(f,{component:"g",opacity:e?"1":"0",transform:t,sx:{transition:"opacity 300ms"},children:n}),hO=({y:e,x:t,height:n,width:r,rx:i})=>Os.jsx(f,{component:"rect",fill:rO.surface3,y:e,x:t,height:n,width:r,rx:i}),mO=({y:e,transform:t,dominantBaseline:n,children:r})=>Os.jsx(f,{component:"text",y:e,textAnchor:"middle",fontSize:"13px",fill:rO.neutral1,transform:t,dominantBaseline:n,children:r}),fO=(e,t,n)=>{const r=e.map((e=>n(e).toFixed(1))),i=t.map((e=>n(e).toFixed(1)));return r.every(((e,t)=>e===i[t]))},gO=({id:e,xScale:t,interactive:n,brushLabelValue:r,brushExtent:i,setBrushExtent:o,innerWidth:a,innerHeight:s,westHandleColor:l,eastHandleColor:d})=>{const c=dt(null),u=dt(null),[p,h]=ct(i),[m,f]=ct(!1),[g,y]=ct(!1),x=function(e){const t=dt();return st((()=>{t.current=e}),[e]),t.current}(i),v=ut((e=>{const{type:n,selection:r,mode:a}=e;if(!r)return void h(null);const s=r.map(t.invert);"end"!==n||fO(i,s,t)||o(s,a),h(s)}),[t,i,o]);st((()=>{h(i)}),[i]),st((()=>{c.current&&(u.current=mn().extent([[Math.max(2,t(0)),0],[a-2,s]]).handleSize(30).filter((()=>n)).on("brush end",v),u.current(hn(c.current)),x&&fO(i,x,t)&&hn(c.current).transition().call(u.current.move,i.map(t)),hn(c.current).selectAll(".selection").attr("stroke","none").attr("fill-opacity","0.1").attr("fill",`url(#${e}-gradient-selection)`))}),[i,v,e,s,a,n,x,t]),st((()=>{c.current&&u.current&&u.current.move(hn(c.current),i.map(t))}),[i,t]),st((()=>{f(!0);const e=setTimeout((()=>f(!1)),1500);return()=>clearTimeout(e)}),[p]);const b=p&&t(p[0])>20,A=p&&t(p[1])>a-20,w=p&&(t(p[0])<0||t(p[1])<0),k=p&&(t(p[0])>a||t(p[1])>a),C=p&&t(p[0])>=0&&t(p[0])<=a,j=p&&t(p[1])>=0&&t(p[1])<=a;return lt((()=>Os.jsxs(Os.Fragment,{children:[Os.jsxs("defs",{children:[Os.jsxs("linearGradient",{id:`${e}-gradient-selection`,x1:"0%",y1:"100%",x2:"100%",y2:"100%",children:[Os.jsx("stop",{stopColor:l}),Os.jsx("stop",{stopColor:d,offset:"1"})]}),Os.jsx("clipPath",{id:`${e}-brush-clip`,children:Os.jsx("rect",{x:"0",y:"0",width:a,height:s})})]}),Os.jsx("g",{ref:c,clipPath:`url(#${e}-brush-clip)`,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)}),p&&Os.jsxs(Os.Fragment,{children:[C?Os.jsxs("g",{transform:`translate(${Math.max(0,t(p[0]))}, 0), scale(${b?"-1":"1"}, 1)`,children:[Os.jsxs("g",{children:[Os.jsx(cO,{color:l,d:sO(s)}),Os.jsx(uO,{d:lO()})]}),Os.jsxs(pO,{transform:`translate(50,0), scale(${b?"1":"-1"}, 1)`,visible:m||g,children:[Os.jsx(hO,{y:"0",x:"-30",height:"30",width:"60",rx:"8"}),Os.jsx(mO,{transform:"scale(-1, 1)",y:"15",dominantBaseline:"middle",children:r("w",p[0])})]})]}):null,j?Os.jsxs("g",{transform:`translate(${t(p[1])}, 0), scale(${A?"-1":"1"}, 1)`,children:[Os.jsxs("g",{children:[Os.jsx(cO,{color:d,d:sO(s)}),Os.jsx(uO,{d:lO()})]}),Os.jsxs(pO,{transform:`translate(50,0), scale(${A?"-1":"1"}, 1)`,visible:m||g,children:[Os.jsx(hO,{y:"0",x:"-30",height:"30",width:"60",rx:"8"}),Os.jsx(mO,{y:"15",dominantBaseline:"middle",children:r("e",p[1])})]})]}):null,w&&Os.jsx(dO,{color:l}),k&&Os.jsx("g",{transform:`translate(${a}, 0) scale(-1, 1)`,children:Os.jsx(dO,{color:d})})]})]})),[r,d,j,A,b,g,e,s,a,p,k,m,w,l,C,t])},yO=({value:e,xScale:t,innerHeight:n})=>lt((()=>Os.jsx(f,{component:"line",x1:t(e),y1:"0",x2:t(e),y2:n,sx:{opacity:.5,strokeWidth:2,stroke:rO.neutral1,fill:"none"}})),[e,t,n]);function xO({svg:e,xScale:t,setZoom:n,width:r,height:i,resetBrush:o,showResetButton:a,zoomLevels:s}){const l=dt(),[d,c,u,p]=lt((()=>[()=>e&&l.current&&hn(e).transition().call(l.current.scaleBy,2),()=>e&&l.current&&hn(e).transition().call(l.current.scaleBy,.5),()=>e&&l.current&&hn(e).transition().call(l.current.scaleTo,.5),()=>e&&l.current&&hn(e).call(l.current.transform,fn.translate(0,0).scale(1)).transition().call(l.current.scaleTo,.5)]),[e]);return st((()=>{e&&(l.current=gn().scaleExtent([s.min,s.max]).extent([[0,0],[r,i]]).on("zoom",(({transform:e})=>n(e))),hn(e).call(l.current))}),[i,r,n,e,t,l,s,s.max,s.min]),st((()=>{u()}),[u,s]),Os.jsxs(f,{sx:{display:"grid",gridTemplateColumns:`repeat(${a?3:2}, 1fr)`,gridGap:"6px",position:"absolute",top:"-32px",right:0},children:[a&&Os.jsx(T,{size:T.Size.small,sx:{borderRadius:16},onClick:()=>{o(),p()},disabled:!1,children:Os.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Os.jsx("polyline",{points:"1 4 1 10 7 10"}),Os.jsx("polyline",{points:"23 20 23 14 17 14"}),Os.jsx("path",{d:"M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15"})]})}),Os.jsx(T,{size:T.Size.small,sx:{borderRadius:16},onClick:d,disabled:!1,children:Os.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Os.jsx("circle",{cx:"11",cy:"11",r:"8"}),Os.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),Os.jsx("line",{x1:"11",y1:"8",x2:"11",y2:"14"}),Os.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}),Os.jsx(T,{size:T.Size.small,sx:{borderRadius:16},onClick:c,disabled:!1,children:Os.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Os.jsx("circle",{cx:"11",cy:"11",r:"8"}),Os.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),Os.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})})]})}const vO=e=>e.price0,bO=e=>e.activeLiquidity;function AO({id:e="liquidityChartRangeInput",data:{series:t,current:n},ticksAtLimit:r,styles:i,dimensions:{width:o,height:a},margins:s,interactive:l=!0,brushDomain:d,brushLabels:c,onBrushDomainChange:u,zoomLevels:p}){const h=dt(null),[m,g]=ct(null),[y,x]=lt((()=>[a-s.top-s.bottom,o-s.left-s.right]),[o,a,s]),{xScale:v,yScale:b}=lt((()=>{const e={xScale:yn().domain([n*p.initialMin,n*p.initialMax]).range([0,x]),yScale:yn().domain([0,xn(t,bO)]).range([y,0])};if(m){const t=m.rescaleX(e.xScale);e.xScale.domain(t.domain())}return e}),[n,p.initialMin,p.initialMax,x,t,y,m]);return st((()=>{g(null)}),[p]),st((()=>{d||u(v.domain(),void 0)}),[d,u,v]),Os.jsxs(Os.Fragment,{children:[Os.jsx(xO,{svg:h.current,xScale:v,setZoom:g,width:x,height:a,resetBrush:()=>{u([n*p.initialMin,n*p.initialMax],"reset")},showResetButton:Boolean(r[Mw.LOWER]||r[Mw.UPPER]),zoomLevels:p}),Os.jsxs("svg",{width:"100%",height:"100%",viewBox:`0 0 ${o} ${a}`,style:{overflow:"visible"},children:[Os.jsxs("defs",{children:[Os.jsx("clipPath",{id:`${e}-chart-clip`,children:Os.jsx("rect",{x:"0",y:"0",width:x,height:a})}),d&&Os.jsx("mask",{id:`${e}-chart-area-mask`,children:Os.jsx("rect",{fill:"white",x:v(d[0]),y:"0",width:v(d[1])-v(d[0]),height:y})})]}),Os.jsxs("g",{transform:`translate(${s.left},${s.top})`,children:[Os.jsxs("g",{clipPath:`url(#${e}-chart-clip)`,children:[Os.jsx(iO,{series:t,xScale:v,yScale:b,xValue:vO,yValue:bO}),d&&Os.jsx("g",{mask:`url(#${e}-chart-area-mask)`,children:Os.jsx(iO,{series:t,xScale:v,yScale:b,xValue:vO,yValue:bO,fill:i.area.selection})}),Os.jsx(yO,{value:n,xScale:v,innerHeight:y}),Os.jsx(aO,{xScale:v,innerHeight:y})]}),Os.jsx(f,{component:"rect",width:x,height:a,ref:h,sx:{fill:"transparent",cursor:"grab","&:active":{cursor:"grabbing"}}}),Os.jsx(gO,{id:e,xScale:v,interactive:l,brushLabelValue:c,brushExtent:null!=d?d:v.domain(),innerWidth:x,innerHeight:y,setBrushExtent:u,westHandleColor:i.brush.handle.west,eastHandleColor:i.brush.handle.east})]})]})]})}const wO=8;function kO(e,t,n,r,i,o){var a,s,l,d,c;let u=Object.assign({},n),p=[];for(let n=i+(o?1:-1);o?n<r.length:n>=0;o?n++:n--){const i=Number(null===(a=r[n])||void 0===a?void 0:a.tickIdx),h=_C(e,t,i),m={liquidityActive:u.liquidityActive,tick:i,liquidityNet:tn.BigInt(null!==(l=null===(s=r[n])||void 0===s?void 0:s.liquidityNet)&&void 0!==l?l:""),price0:h.toFixed(wO),sdkPrice:h};o?m.liquidityActive=tn.add(u.liquidityActive,tn.BigInt(null!==(c=null===(d=r[n])||void 0===d?void 0:d.liquidityNet)&&void 0!==c?c:0)):!o&&tn.notEqual(u.liquidityNet,tn.BigInt(0))&&(m.liquidityActive=tn.subtract(u.liquidityActive,u.liquidityNet)),p.push(m),u=m}return o||(p=p.reverse()),p}const CO=8,jO=(e,t)=>e&&t?Math.floor(e/Ak[t])*Ak[t]:void 0,TO=1e3;function EO(e,t,n,r){const[i,o]=ct(0),[a,s]=ct([]),{data:l,error:d,isLoading:c}=function(e,t,n,r=0,i){var o;const a=QA(),s=e&&t&&n?rj.getAddress(null==e?void 0:e.wrapped,null==t?void 0:t.wrapped,n,void 0,i?Xw[i]:void 0):void 0,l=a.getQuery(de.graphql.AllV3TicksDocument,{skip:r,first:TO,where:{chain:i?Gr[i]:void 0,poolAddress:null!==(o=null==s?void 0:s.toLowerCase())&&void 0!==o?o:void 0,refreshNow:!0,schemaName:"ammv3"}});return It(Object.assign(Object.assign({},l),{enabled:!0}))}(e,t,n,i,r),u=null==l?void 0:l.ticks;return st((()=>{(null==u?void 0:u.length)&&(s((e=>[...e,...u])),(null==u?void 0:u.length)===TO&&o((e=>e+TO)))}),[u]),{isLoading:c||(null==u?void 0:u.length)===TO,error:d,ticks:a}}function SO({currencyA:e,currencyB:t,feeAmount:n}){const{isLoading:r,error:i,data:o}=function(e,t,n,r){var i,o,a;const{chainId:s}=hf(),l=Rj(e,t,n),d=null===(i=l[1])||void 0===i?void 0:i.liquidity,c=null===(o=l[1])||void 0===o?void 0:o.sqrtRatioX96,u=null===(a=l[1])||void 0===a?void 0:a.tickCurrent,p=lt((()=>jO(u,n)),[u,n]),{isLoading:h,error:m,ticks:f}=EO(e,t,n,s);return lt((()=>{var n,r,i,o,a;if(!e||!t||void 0===p||l[0]!==Ij.EXISTS||!f||0===f.length||h)return{isLoading:h||l[0]===Ij.LOADING,error:m,activeTick:p,data:void 0};const s=null==e?void 0:e.wrapped,g=null==t?void 0:t.wrapped,y=f.findIndex((e=>(null==e?void 0:e.tickIdx)&&e.tickIdx>p))-1;if(y<0)return console.log("usePoolTickData","usePoolActiveLiquidity","TickData pivot not found",{token0:s.address,token1:g.address,chainId:s.chainId}),{isLoading:h,error:m,activeTick:p,data:void 0};const x=_C(s,g,p),v={liquidityActive:tn.BigInt(null!==(r=null===(n=l[1])||void 0===n?void 0:n.liquidity)&&void 0!==r?r:0),tick:p,liquidityNet:Number(null===(i=f[y])||void 0===i?void 0:i.tickIdx)===p?tn.BigInt(null!==(a=null===(o=f[y])||void 0===o?void 0:o.liquidityNet)&&void 0!==a?a:0):tn.BigInt(0),price0:x.toFixed(CO),sdkPrice:x},b=kO(s,g,v,f,y,!0),A=kO(s,g,v,f,y,!1).concat(v).concat(b);return{isLoading:h,error:m,currentTick:u,activeTick:p,liquidity:d,sqrtPriceX96:c,data:A}}),[e,t,p,l,f,h,m,u,d,c])}(e,t,n),a=ut((()=>{if(!(null==o?void 0:o.length))return;const e=[];for(let t=0;t<o.length;t++){const n=o[t],r={activeLiquidity:parseFloat(n.liquidityActive.toString()),price0:parseFloat(n.price0)};r.activeLiquidity>0&&e.push(r)}return e}),[o]);return lt((()=>({isLoading:r,error:i,formattedData:r?void 0:a()})),[r,i,a])}const IO={initialMin:.999,initialMax:1.001,min:1e-5,max:1.5},RO={[bk.LOWEST]:IO,[bk.LOW_200]:IO,[bk.LOW_300]:IO,[bk.LOW_400]:IO,[bk.LOW]:IO,[bk.MEDIUM]:{initialMin:.5,initialMax:2,min:1e-5,max:20},[bk.HIGH]:{initialMin:.5,initialMax:2,min:1e-5,max:20}};function LO({message:e,icon:t}){return Os.jsxs(Nw,{style:{height:"100%",justifyContent:"center"},children:[t,e&&Os.jsx(f,{sx:{mt:20,p:10,typography:"caption",textAlign:"center"},children:e})]})}function MO(){return Os.jsx(D,{})}function OO({currencyA:t,currencyB:n,feeAmount:r,ticksAtLimit:i,price:o,priceLower:a,priceUpper:s,onLeftRangeInput:l,onRightRangeInput:d,interactive:c}){const u=t&&n&&(null==t?void 0:t.wrapped.sortsBefore(null==n?void 0:n.wrapped)),{isLoading:p,error:h,formattedData:m}=SO({currencyA:t,currencyB:n,feeAmount:r}),g=ut(((e,t)=>{let n=Number(e[0]);const r=Number(e[1]);n<=0&&(n=1/10**6),(!i[u?Mw.LOWER:Mw.UPPER]||"handle"===t||"reset"===t)&&n>0&&l(n.toFixed(6)),(!i[u?Mw.UPPER:Mw.LOWER]||"reset"===t)&&r>0&&r<1e35&&d(r.toFixed(6))}),[u,l,d,i]);c=c&&Boolean(null==m?void 0:m.length);const y=lt((()=>{const e=u?a:null==s?void 0:s.invert(),t=u?s:null==a?void 0:a.invert();return e&&t?[parseFloat(null==e?void 0:e.toSignificant(6)),parseFloat(null==t?void 0:t.toSignificant(6))]:void 0}),[u,a,s]),x=ut(((e,t)=>{if(!o)return"";if("w"===e&&i[u?Mw.LOWER:Mw.UPPER])return"0";if("e"===e&&i[u?Mw.UPPER:Mw.LOWER])return"∞";const n=(t<o?-1:1)*((Math.max(t,o)-Math.min(t,o))/o)*100;return o?`${An({input:n,decimals:2})}%`:""}),[u,o,i]),v=!t||!n||void 0===m&&!p&&!h;return Os.jsx(Fw,{gap:"md",style:{minHeight:"200px"},children:v?Os.jsx(LO,{message:Os.jsx(e,{id:"OZUH85",message:"Your position will appear here."}),icon:Os.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"56",height:"56",viewBox:"0 0 24 24",fill:"none",stroke:rO.neutral1,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Os.jsx("polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}),Os.jsx("path",{d:"M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"})]})}):p?Os.jsx(MO,{}):h?Os.jsx(LO,{message:Os.jsx(e,{id:"79D0qY",message:"Liquidity data not available."}),icon:Os.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"56",height:"56",viewBox:"0 0 24 24",fill:"none",stroke:rO.neutral2,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Os.jsx("path",{d:"M22.61 16.95A5 5 0 0 0 18 10h-1.26a8 8 0 0 0-7.05-6M5 5a8 8 0 0 0 4 15h9a5 5 0 0 0 1.7-.3"}),Os.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})}):m&&0!==m.length&&o?Os.jsx(f,{sx:{position:"relative",width:"100%",maxHeight:"200px",justifyContent:"center",alignContent:"center"},children:Os.jsx(AO,{data:{series:m,current:o},dimensions:{width:560,height:200},margins:{top:10,right:2,bottom:20,left:0},styles:{area:{selection:rO.accent1},brush:{handle:{west:rO.critical,east:rO.accent1}}},interactive:c,brushLabels:x,brushDomain:y,onBrushDomainChange:g,zoomLevels:RO[null!=r?r:bk.MEDIUM],ticksAtLimit:i})}):Os.jsx(LO,{message:Os.jsx(e,{id:"rH6vg9",message:"There is no liquidity data."}),icon:Os.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"56",height:"56",viewBox:"0 0 24 24",fill:"none",stroke:rO.neutral2,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Os.jsx("line",{x1:"18",y1:"20",x2:"18",y2:"10"}),Os.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"4"}),Os.jsx("line",{x1:"6",y1:"20",x2:"6",y2:"14"})]})})})}const BO=({value:t,decrement:n,increment:r,decrementDisabled:i=!1,incrementDisabled:o=!1,locked:a,onUserInput:s,title:l,tokenA:d,tokenB:c})=>{const u=g(),[p,h]=ct(!1),[m,y]=ct(""),[x,v]=ct(!1),[b,A]=ct(!1),w=ut((()=>{v(!1),h(!1),s(m)}),[m,s]),k=ut((()=>{v(!1),s(n())}),[n,s]),C=ut((()=>{v(!1),s(r())}),[r,s]);return st((()=>{m===t||x||setTimeout((()=>{y(t),A(!0),setTimeout((function(){A(!1)}),1800)}),0)}),[m,x,t]),Os.jsx(f,{onFocus:()=>{v(!0),h(!0)},onBlur:w,sx:{width:"100%",py:12,px:20,borderRadius:16,backgroundColor:u.palette.background.input},children:Os.jsxs(f,{sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:[Os.jsx(f,{sx:{typography:"body2",fontWeight:600,color:u.palette.text.primary},children:l}),Os.jsx(f,{sx:{mt:4,typography:"h6",fontWeight:500,color:u.palette.text.secondary},children:Os.jsx(e,{id:"1/LP4K",message:"{tokenB} per {tokenA}",values:{tokenB:c,tokenA:d}})}),Os.jsx(hy,{sx:{mt:12},value:m,onChange:e=>{y(e)},readOnly:a})]}),Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:8},children:[!a&&Os.jsx(T,{size:T.Size.small,onClick:C,disabled:o,sx:{px:4,backgroundColor:u.palette.background.paper,"&[disabled]":{cursor:"default"}},children:Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{d:"M14.25 9.75H9.75V14.25H8.25V9.75H3.75V8.25H8.25V3.75H9.75V8.25H14.25V9.75Z",fill:i?u.palette.text.disabled:u.palette.text.primary})})}),!a&&Os.jsx(T,{size:T.Size.small,onClick:k,disabled:i,sx:{px:4,backgroundColor:u.palette.background.paper,"&[disabled]":{cursor:"default"}},children:Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("rect",{x:"3.75",y:"8.25",width:"10.5",height:"1.5",fill:i?u.palette.text.disabled:u.palette.text.primary})})})]})]})})},PO=({priceLower:t,priceUpper:n,onLeftRangeInput:r,onRightRangeInput:i,getDecrementLower:o,getIncrementLower:a,getDecrementUpper:s,getIncrementUpper:l,currencyA:d,currencyB:c,feeAmount:u,ticksAtLimit:p})=>{var h,m,g,y;const x=null===(h=null!=d?d:void 0)||void 0===h?void 0:h.wrapped,v=null===(m=null!=c?c:void 0)||void 0===m?void 0:m.wrapped,b=x&&v&&x.sortsBefore(v),A=b?t:null==n?void 0:n.invert(),w=b?n:null==t?void 0:t.invert();return Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:8},children:[Os.jsx(BO,{value:p[b?Mw.LOWER:Mw.UPPER]?"0":null!==(g=null==A?void 0:A.toSignificant(8))&&void 0!==g?g:"",onUserInput:r,decrement:b?o:l,increment:b?a:s,decrementDisabled:void 0===A||p[b?Mw.LOWER:Mw.UPPER],incrementDisabled:void 0===A||p[b?Mw.LOWER:Mw.UPPER],feeAmount:u,label:A?`${null==c?void 0:c.symbol}`:"-",title:Os.jsx(e,{id:"uEoBVI",message:"Low price"}),tokenA:null==d?void 0:d.symbol,tokenB:null==c?void 0:c.symbol}),Os.jsx(BO,{value:p[b?Mw.UPPER:Mw.LOWER]?"∞":null!==(y=null==w?void 0:w.toSignificant(8))&&void 0!==y?y:"",onUserInput:i,decrement:b?s:a,increment:b?l:o,incrementDisabled:void 0===w||p[b?Mw.UPPER:Mw.LOWER],decrementDisabled:void 0===w||p[b?Mw.UPPER:Mw.LOWER],feeAmount:u,label:w?`${null==c?void 0:c.symbol}`:"-",tokenA:null==d?void 0:d.symbol,tokenB:null==c?void 0:c.symbol,title:Os.jsx(e,{id:"kAC8rT",message:"High price"})})]})};var DO;function NO(){return NO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NO.apply(null,arguments)}const FO=e=>ot.createElement("svg",NO({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),DO||(DO=ot.createElement("g",{id:"ICON/18px/arrow/\\xE6\\x94\\xB6\\xE8\\xB5\\xB7/Dark"},ot.createElement("path",{id:"\\xE4\\xB8\\x89\\xE8\\xA7\\x92\\xE5\\xBD\\xA2",fillRule:"evenodd",clipRule:"evenodd",d:"M6.58398 12.376C6.78189 12.6728 7.21811 12.6728 7.41603 12.376L10.4818 7.77735C10.7033 7.44507 10.4651 7 10.0657 7H3.93426C3.53491 7 3.29672 7.44507 3.51823 7.77735L6.58398 12.376Z",fill:"currentColor"}))));function WO({token:e,oppositeTokenAddress:t,dispatch:n,tokenSelectOnChange:i}){const o=g(),{chainId:a}=hf(),[s,l]=ct(!1);return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{component:y,sx:{flexBasis:"100%",flexGrow:1,flexShrink:1,display:"flex",alignItems:"center",px:20,py:8,borderRadius:12,borderWidth:1,borderStyle:"solid",borderColor:e?o.palette.border.main:o.palette.primary.main,color:e?o.palette.text.primary:o.palette.primary.contrastText,backgroundColor:e?"transparent":o.palette.primary.main,"&:hover":{borderColor:e?o.palette.border.main:o.palette.primary.main,opacity:.8},[o.breakpoints.up("tablet")]:{flexBasis:"50%"}},onClick:()=>{l(!0)},children:[e?Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[Os.jsx(ey,{address:e.address,marginRight:0,width:24,height:24,chainId:e.chainId||a,noShowChain:!0,sx:{flexShrink:0}}),Os.jsx(f,{sx:{typography:"h5",fontWeight:600,lineHeight:"32px",flexShrink:0},children:e.symbol})]}):Os.jsx(f,{sx:{typography:"h5",fontWeight:600,lineHeight:"32px",flexShrink:0},children:r._({id:"0RrIzN",message:"Select token"})}),Os.jsx(f,{component:FO,sx:{flexShrink:0,ml:"auto",width:18,height:18}})]}),Os.jsx(ky,{value:Dj(e),open:s,chainId:a,occupiedAddrs:[t],occupiedChainId:null==e?void 0:e.chainId,onClose:()=>{l(!1)},onTokenChange:(e,t)=>{if(!Array.isArray(e)){if(t)return n({type:Hj.UpdateBaseTokenAndClearQuoteToken,payload:e}),void l(!1);i(e),l(!1)}},modal:!0})]})}const VO=({baseToken:e,quoteToken:t,dispatch:n})=>{var r,i;const o=g();return Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap",[o.breakpoints.up("tablet")]:{flexWrap:"nowrap"}},children:[Os.jsx(WO,{token:e,oppositeTokenAddress:null!==(r=null==t?void 0:t.address)&&void 0!==r?r:"",dispatch:n,tokenSelectOnChange:e=>{n({type:Hj.UpdateBaseToken,payload:e})}}),Os.jsx(WO,{token:t,oppositeTokenAddress:null!==(i=null==e?void 0:e.address)&&void 0!==i?i:"",dispatch:n,tokenSelectOnChange:e=>{n({type:Hj.UpdateQuoteToken,payload:e})}})]})};function UO({params:e,handleGoBack:t,handleGoToPoolList:n}){var o,a,s,l,d,c,u,p,h,m;const{chainId:x,account:v}=hf(),b=g(),A=Hy(),{isMobile:w}=wy(),k=It(Object.assign({},$a.getFetchTokenQuery(x,null==e?void 0:e.from,v))),j=It(Object.assign({},$a.getFetchTokenQuery(x,null==e?void 0:e.to,v))),[E,S]=ft(Gj,{baseToken:null,quoteToken:null,feeAmount:(null==e?void 0:e.fee)?Number(null==e?void 0:e.fee):void 0,independentField:Lw.CURRENCY_A,typedValue:"",startPriceTypedValue:"",leftRangeTypedValue:"",rightRangeTypedValue:""});st((()=>{k.data&&S({type:Hj.UpdateDefaultBaseToken,payload:k.data})}),[k]),st((()=>{j.data&&S({type:Hj.UpdateDefaultQuoteToken,payload:j.data})}),[j]);const{independentField:I,typedValue:R,startPriceTypedValue:L}=E,{pool:M,ticks:O,dependentField:B,price:P,pricesAtTicks:D,pricesAtLimit:N,parsedAmounts:F,currencyBalances:W,position:V,noLiquidity:U,currencies:H,errorMessage:q,invalidPool:Z,invalidRange:z,outOfRange:Q,depositADisabled:G,depositBDisabled:Y,invertPrice:X,ticksAtLimit:J,isTaxed:K}=Qj({state:E}),_=lt((()=>{var e;return null===(e=X?null==P?void 0:P.invert():P)||void 0===e?void 0:e.toSignificant()}),[X,P]),{onFieldAInput:$,onFieldBInput:ee,onLeftRangeInput:te,onRightRangeInput:ne,onStartPriceInput:re}=Yj({noLiquidity:U,dispatch:S}),{slipper:ie,setSlipper:oe,slipperValue:ae,resetSlipper:se}=Ew({address:void 0,type:"AMMV3"}),le=!q&&!z,[de,ce]=ct(!1),ue={[I]:R,[B]:null!==(a=null===(o=F[B])||void 0===o?void 0:o.toSignificant(6))&&void 0!==a?a:""},pe=[Lw.CURRENCY_A,Lw.CURRENCY_B].reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:_j(W[t])})),{}),he=EA(Dj(null===(s=F[Lw.CURRENCY_A])||void 0===s?void 0:s.currency),{contractAddress:Jw[x],overrideBalance:W[Lw.CURRENCY_A]?new i(W[Lw.CURRENCY_A].toSignificant()):void 0,amount:F[Lw.CURRENCY_A]?new i(F[Lw.CURRENCY_A].toSignificant()):void 0}),me=EA(Dj(null===(l=F[Lw.CURRENCY_B])||void 0===l?void 0:l.currency),{contractAddress:Jw[x],overrideBalance:W[Lw.CURRENCY_B]?new i(W[Lw.CURRENCY_B].toSignificant()):void 0,amount:F[Lw.CURRENCY_B]?new i(F[Lw.CURRENCY_B].toSignificant()):void 0}),{[Mw.LOWER]:fe,[Mw.UPPER]:ge}=O,{[Mw.LOWER]:ye,[Mw.UPPER]:xe}=D,{getDecrementLower:ve,getIncrementLower:be,getDecrementUpper:Ae,getIncrementUpper:we,getSetFullRange:ke}=function({tickLower:e,tickUpper:t,pool:n,state:r,dispatch:i}){const{baseToken:o,quoteToken:a,feeAmount:s}=r,l=lt((()=>null==o?void 0:o.wrapped),[o]),d=lt((()=>null==a?void 0:a.wrapped),[a]);return{getDecrementLower:ut((()=>l&&d&&"number"==typeof e&&s?_C(l,d,e-Ak[s]).toSignificant(5,void 0,_w.ROUND_UP):"number"!=typeof e&&l&&d&&s&&n?_C(l,d,n.tickCurrent-Ak[s]).toSignificant(5,void 0,_w.ROUND_UP):""),[l,d,e,s,n]),getIncrementLower:ut((()=>l&&d&&"number"==typeof e&&s?_C(l,d,e+Ak[s]).toSignificant(5,void 0,_w.ROUND_UP):"number"!=typeof e&&l&&d&&s&&n?_C(l,d,n.tickCurrent+Ak[s]).toSignificant(5,void 0,_w.ROUND_UP):""),[l,d,e,s,n]),getDecrementUpper:ut((()=>l&&d&&"number"==typeof t&&s?_C(l,d,t-Ak[s]).toSignificant(5,void 0,_w.ROUND_UP):"number"!=typeof t&&l&&d&&s&&n?_C(l,d,n.tickCurrent-Ak[s]).toSignificant(5,void 0,_w.ROUND_UP):""),[l,d,t,s,n]),getIncrementUpper:ut((()=>l&&d&&"number"==typeof t&&s?_C(l,d,t+Ak[s]).toSignificant(5,void 0,_w.ROUND_UP):"number"!=typeof t&&l&&d&&s&&n?_C(l,d,n.tickCurrent+Ak[s]).toSignificant(5,void 0,_w.ROUND_UP):""),[l,d,t,s,n]),getSetFullRange:ut((()=>{i({type:Hj.setFullRange,payload:void 0})}),[i])}}({tickLower:fe,tickUpper:ge,pool:M,state:E,dispatch:S}),Ce=ut((()=>{ke();const e=N[Mw.LOWER];e&&te(e.toSignificant(5));const t=N[Mw.UPPER];t&&ne(t.toSignificant(5))}),[ke,te,ne,N]),{deadLine:je}=pf(),Te=Ot({mutationFn:()=>Fn(this,void 0,void 0,(function*(){if(!v||!x||!V)return;if(!E.baseToken||!E.quoteToken)return;const e=Math.ceil(Date.now()/1e3)+(null!=je?je:600),t=E.baseToken.isNative?E.baseToken:E.quoteToken.isNative?E.quoteToken:void 0;try{const{calldata:i,value:o}=fj.addCallParameters(V,{slippageTolerance:tT(100*ae),recipient:v,deadline:e.toString(),useNative:t,createPool:U});let a={to:Jw[x],data:i,value:o};(yield A.execute(r._({id:"8OiU8L",message:"Pool Creation"}),Object.assign({opcode:By.TX},a),{early:!1,metadata:{[Ey.createAMMV3Pool]:"1"}}))===Sy.Success&&setTimeout((()=>{n()}),100)}catch(e){console.error("onAddMutation",e)}}))});return Os.jsx(xw,{children:Os.jsxs(f,{sx:{mx:"auto",borderRadius:w?0:16,backgroundColor:"background.paper",width:w?"100%":600,display:"flex",flexDirection:"column",alignItems:"stretch"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",px:20,py:24,borderTopLeftRadius:16,borderTopRightRadius:16,backgroundColor:b.palette.background.paper},children:[Os.jsx(f,{component:y,onClick:t,sx:{flexGrow:0,flexShrink:0,display:"flex",alignItems:"center",color:b.palette.text.primary,width:24,height:24},children:Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",children:Os.jsx("path",{d:"M20 11.5H7.83L13.42 5.91L12 4.5L4 12.5L12 20.5L13.41 19.09L7.83 13.5H20V11.5Z",fill:"currentColor"})})}),Os.jsx(f,{sx:{flexGrow:1,textAlign:"center",typography:"caption",color:b.palette.text.primary},children:r._({id:"E6MqGy",message:"Add liquidity"})}),Os.jsx(f,{sx:{flexGrow:0,flexShrink:0,width:24,height:24}})]}),Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:20,p:20},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:12},children:[Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:b.palette.text.primary,textAlign:"left"},children:r._({id:"nxRg31",message:"Select pair"})}),Os.jsx(VO,{baseToken:E.baseToken,quoteToken:E.quoteToken,dispatch:S}),Os.jsx(nO,{disabled:!E.baseToken||!E.quoteToken,feeAmount:E.feeAmount,dispatch:S})]}),Os.jsxs(Hw,{disabled:!E.feeAmount||Z,children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:b.palette.text.primary,textAlign:"left"},children:r._({id:"5CZbyC",message:"Set price range"})}),Boolean(E.baseToken&&E.quoteToken)&&Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8,width:"100%",[b.breakpoints.up("tablet")]:{ml:"auto",width:"auto"}},children:[Os.jsx(T,{size:T.Size.small,variant:T.Variant.outlined,onClick:Ce,sx:Object.assign({py:4,px:12,height:26,typography:"h6",fontWeight:600},w?{flexGrow:0,flexShrink:1,flexBasis:"50%"}:void 0),children:r._({id:"5IHTSS",message:"Full range"})}),Os.jsx(Aj,{baseToken:E.baseToken,quoteToken:E.quoteToken,handleRateToggle:()=>{var e,t,n,r,i;J[Mw.LOWER]||J[Mw.UPPER]||(te(null!==(t=null===(e=X?ye:null==xe?void 0:xe.invert())||void 0===e?void 0:e.toSignificant(6))&&void 0!==t?t:""),ne(null!==(r=null===(n=X?xe:null==ye?void 0:ye.invert())||void 0===n?void 0:n.toSignificant(6))&&void 0!==r?r:""),$(null!==(i=ue[Lw.CURRENCY_B])&&void 0!==i?i:"")),S({type:Hj.ToggleRate,payload:void 0})},sx:w?{flexGrow:0,flexShrink:1,flexBasis:"50%"}:void 0})]})]}),Os.jsx(PO,{priceLower:ye,priceUpper:xe,getDecrementLower:ve,getIncrementLower:be,getDecrementUpper:Ae,getIncrementUpper:we,onLeftRangeInput:te,onRightRangeInput:ne,currencyA:E.baseToken,currencyB:E.quoteToken,feeAmount:E.feeAmount,ticksAtLimit:J}),Q&&Os.jsx(Dw,{children:r._({id:"b+KjnH",message:"Your position will not earn fees or be used in trades until the market price moves into your range."})}),z&&Os.jsx(Dw,{children:r._({id:"Jh223O",message:"Invalid range selected. The min price must be lower than the max price."})})]}),U?Os.jsxs(Hw,{children:[Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:b.palette.text.primary,textAlign:"left"},children:r._({id:"zeSosD",message:"Starting price"})}),Os.jsx(f,{sx:{p:8,borderRadius:8,backgroundColor:C(b.palette.primary.main,.1),typography:"h6",color:b.palette.primary.main},children:r._({id:"X6T02b",message:"This pool must be initialized before you can add liquidity. To initialize, select a starting price for the pool. Then, enter your liquidity price range and deposit amount. Gas fees will be higher than usual due to the initialization transaction."})}),Os.jsx(f,{sx:{px:16,py:12,borderRadius:8,borderWidth:1,borderColor:b.palette.border.main,borderStyle:"solid"},children:Os.jsx(hy,{sx:{backgroundColor:"transparent"},value:L,onChange:re})})]}):Os.jsxs(Hw,{disabled:!E.feeAmount||Z,children:[Os.jsxs(f,{sx:{typography:"body1",fontWeight:600,color:b.palette.text.primary,textAlign:"left"},children:[r._({id:"DWd30U",message:"Current price"}),Os.jsxs(f,{children:[_," ",r._({id:"b2jAb+",message:"per"})," ",null!==(c=null===(d=E.baseToken)||void 0===d?void 0:d.symbol)&&void 0!==c?c:""]})]}),Os.jsx(OO,{currencyA:null!==(u=E.baseToken)&&void 0!==u?u:void 0,currencyB:null!==(p=E.quoteToken)&&void 0!==p?p:void 0,feeAmount:E.feeAmount,ticksAtLimit:J,price:P?parseFloat((X?P.invert():P).toSignificant(8)):void 0,priceLower:ye,priceUpper:xe,onLeftRangeInput:te,onRightRangeInput:ne,interactive:!0})]}),Os.jsxs(Hw,{disabled:Z||z||U&&!L,children:[Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:b.palette.text.primary,textAlign:"left"},children:r._({id:"MU9s7M",message:"Deposit amounts"})}),Os.jsxs(f,{children:[Os.jsx(Yw,{value:ue[Lw.CURRENCY_A],onUserInput:$,maxAmount:pe[Lw.CURRENCY_A],balance:W[Lw.CURRENCY_A],currency:null!==(h=H[Lw.CURRENCY_A])&&void 0!==h?h:null,locked:G}),Os.jsx(zy,{}),Os.jsx(Yw,{value:ue[Lw.CURRENCY_B],onUserInput:ee,maxAmount:pe[Lw.CURRENCY_B],balance:W[Lw.CURRENCY_B],currency:null!==(m=H[Lw.CURRENCY_B])&&void 0!==m?m:null,locked:Y})]}),Os.jsx(Sw,{value:ie,onChange:oe,disabled:!1,type:"AMMV3"})]})]}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",px:20,py:16,borderBottomLeftRadius:16,borderBottomRightRadius:16,backgroundColor:b.palette.background.paper},children:Os.jsx(qw,{chainId:x,approvalA:he,approvalB:me,parsedAmounts:F,isValid:le,depositADisabled:G,depositBDisabled:Y,errorMessage:q,setShowConfirm:ce})}),Os.jsx(Ej,{parsedAmounts:F,position:V,existingPosition:void 0,priceLower:ye,priceUpper:xe,outOfRange:Q,ticksAtLimit:J,on:de,onClose:()=>{ce(!1)},onConfirm:Te.mutate,loading:Te.isPending})]})})}function HO({removed:e,inRange:t}){const n=g(),i={py:4,px:8,color:n.palette.success.main,borderRadius:4,backgroundColor:C(n.palette.success.main,.1),typography:"h6"};return e?Os.jsx(A,{title:r._({id:"MZPP7t",message:"Your position has 0 liquidity, and is not earning fees."}),children:Os.jsx(f,{sx:Object.assign(Object.assign({},i),{color:n.palette.warning.main,backgroundColor:C(n.palette.warning.main,.1)}),children:r._({id:"D87pha",message:"Closed"})})}):t?Os.jsx(A,{title:r._({id:"aIvv/z",message:"The price of this pool is within your selected range. Your position is currently earning fees."}),children:Os.jsx(f,{sx:i,children:r._({id:"vOyUlD",message:"In range"})})}):Os.jsx(A,{title:r._({id:"IwiTcw",message:"The price of this pool is outside of your selected range. Your position is not currently earning fees."}),children:Os.jsx(f,{sx:Object.assign(Object.assign({},i),{color:n.palette.error.main,backgroundColor:C(n.palette.error.main,.1)}),children:r._({id:"i3Z+/Z",message:"Out of range"})})})}function qO(e,t=3){if(void 0===e)return"";const n=Number(e),r=1/10**t;return 0===n||n<1e-7?"0":n<r?`< ${r}`:n<1?(Math.floor(n/r)*r).toFixed(t):n<100?(Math.floor(100*n)/100).toString():n<1e4?Math.floor(n).toString():n<1e15?String(Math.floor(100*n)/100):"∞"}const ZO=({baseToken:e,quoteToken:t,handleRateToggle:n,sx:r})=>{const i=g(),o=e&&t&&ms(e,t);return Os.jsx(f,{component:y,onClick:n,sx:Object.assign({display:"flex",alignItems:"center",p:1,borderRadius:8,backgroundColor:i.palette.border.main},r),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",width:"100%",[i.breakpoints.up("tablet")]:{width:"auto"}},children:[Os.jsx(f,{sx:Object.assign({flexGrow:1,flexShrink:1,flexBasis:"50%",px:12,py:4,borderRadius:7,textAlign:"center",typography:"h6",whiteSpace:"nowrap"},o?{color:i.palette.text.primary,backgroundColor:i.palette.background.paper}:{color:i.palette.text.secondary,backgroundColor:"transparent"}),children:o?e.symbol:null==t?void 0:t.symbol}),Os.jsx(f,{sx:Object.assign({flexGrow:1,flexShrink:1,flexBasis:"50%",px:12,py:4,borderRadius:7,textAlign:"center",typography:"h6",whiteSpace:"nowrap"},o?{color:i.palette.text.secondary,backgroundColor:"transparent"}:{color:i.palette.text.primary,backgroundColor:i.palette.background.paper}),children:o?t.symbol:null==e?void 0:e.symbol})]})})},zO={xs:"4px",sm:"8px",md:"12px",lg:"24px",xl:"32px"},QO=({children:e,sx:t})=>(g(),Os.jsx(f,{sx:Object.assign({display:"flex",flexDirection:"column",gap:20,px:20,py:20,borderRadius:12},t),children:e})),GO=({children:e,border:t,sx:n})=>{const r=g();return Os.jsx(QO,{sx:Object.assign(Object.assign({},n),t?{borderWidth:2,borderColor:r.palette.background.paperContrast}:{backgroundColor:r.palette.background.paperContrast}),children:e})},YO=({children:e})=>{const t=g();return Os.jsxs(f,{sx:{p:8,borderRadius:8,backgroundColor:C(t.palette.warning.main,.1),display:"flex",alignItems:"center",gap:8},children:[Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 16.125L9 1.875L17.25 16.125H0.75ZM14.6475 14.625L8.99998 4.86749L3.35247 14.625H14.6475ZM9.75004 12.375H8.25003V13.875H9.75004V12.375ZM8.25003 7.875H9.75004V10.875H8.25003V7.875Z",fill:t.palette.warning.main})}),Os.jsx(f,{sx:{typography:"h6",color:t.palette.warning.main,textAlign:"left"},children:e})]})};function XO({gap:e,flex:t,children:n,style:r}){return Os.jsx(f,{sx:Object.assign(Object.assign(Object.assign({display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:e&&zO[e]||e},t&&{flex:t}),{width:"100%",alignItems:"center"}),r),children:n})}function JO({gap:e,justify:t,grow:n,children:r,style:i}){return Os.jsx(f,{sx:Object.assign({display:"grid",gridAutoRows:"auto",gridRowGap:e&&zO[e]||e,justifyItems:t,flexGrow:n&&1},i),children:r})}function KO({gap:e,children:t,sx:n}){return Os.jsx(f,{sx:Object.assign({width:"100%",display:"flex",padding:0,alignItems:"center",justifyContent:"flex-start",gap:e&&zO[e]||e},n),children:t})}function _O({children:e,style:t}){return Os.jsx(KO,{sx:Object.assign({justifyContent:"space-between"},t),children:e})}function $O({gap:e,justify:t,children:n,sx:r}){return Os.jsx(KO,{sx:Object.assign({position:"relative",width:"fit-content",margin:`-${e}`},r),children:n})}function eB({children:e,disabled:t,sx:n}){return Os.jsx(KO,{sx:Object.assign({display:"flex",flexDirection:"column",alignItems:"stretch",gap:12,opacity:t?.2:1,pointerEvents:t?"none":"auto"},n),children:e})}const tB=tn.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),nB=tn.BigInt(0),rB=tn.BigInt(1),iB=tn.exponentiate(tn.BigInt(2),tn.BigInt(96)),oB=tn.exponentiate(iB,tn.BigInt(2)),aB=tn.BigInt(2),sB=[128,64,32,16,8,4,2,1].map((e=>[e,tn.exponentiate(aB,tn.BigInt(e))]));function lB(e,t){return tn.signedRightShift(tn.multiply(e,tn.BigInt(t)),tn.BigInt(128))}const dB=tn.exponentiate(tn.BigInt(2),tn.BigInt(32));class cB{constructor(){}static getSqrtRatioAtTick(e){nn(e>=cB.MIN_TICK&&e<=cB.MAX_TICK&&Number.isInteger(e),"TICK");const t=e<0?-1*e:e;let n=1&t?tn.BigInt("0xfffcb933bd6fad37aa2d162d1a594001"):tn.BigInt("0x100000000000000000000000000000000");return 2&t&&(n=lB(n,"0xfff97272373d413259a46990580e213a")),4&t&&(n=lB(n,"0xfff2e50f5f656932ef12357cf3c7fdcc")),8&t&&(n=lB(n,"0xffe5caca7e10e4e61c3624eaa0941cd0")),16&t&&(n=lB(n,"0xffcb9843d60f6159c9db58835c926644")),32&t&&(n=lB(n,"0xff973b41fa98c081472e6896dfb254c0")),64&t&&(n=lB(n,"0xff2ea16466c96a3843ec78b326b52861")),128&t&&(n=lB(n,"0xfe5dee046a99a2a811c461f1969c3053")),256&t&&(n=lB(n,"0xfcbe86c7900a88aedcffc83b479aa3a4")),512&t&&(n=lB(n,"0xf987a7253ac413176f2b074cf7815e54")),1024&t&&(n=lB(n,"0xf3392b0822b70005940c7a398e4b70f3")),2048&t&&(n=lB(n,"0xe7159475a2c29b7443b29c7fa6e889d9")),4096&t&&(n=lB(n,"0xd097f3bdfd2022b8845ad8f792aa5825")),8192&t&&(n=lB(n,"0xa9f746462d870fdf8a65dc1f90e061e5")),16384&t&&(n=lB(n,"0x70d869a156d2a1b890bb3df62baf32f7")),32768&t&&(n=lB(n,"0x31be135f97d08fd981231505542fcfa6")),65536&t&&(n=lB(n,"0x9aa508b5b7a84e1c677de54f3e99bc9")),131072&t&&(n=lB(n,"0x5d6af8dedb81196699c329225ee604")),262144&t&&(n=lB(n,"0x2216e584f5fa1ea926041bedfe98")),524288&t&&(n=lB(n,"0x48a170391f7dc42444e8fa2")),e>0&&(n=tn.divide(tB,n)),tn.greaterThan(tn.remainder(n,dB),nB)?tn.add(tn.divide(n,dB),rB):tn.divide(n,dB)}static getTickAtSqrtRatio(e){nn(tn.greaterThanOrEqual(e,cB.MIN_SQRT_RATIO)&&tn.lessThan(e,cB.MAX_SQRT_RATIO),"SQRT_RATIO");const t=tn.leftShift(e,tn.BigInt(32)),n=function(e){nn(tn.greaterThan(e,nB),"ZERO"),nn(tn.lessThanOrEqual(e,tB),"MAX");let t=0;for(const[n,r]of sB)tn.greaterThanOrEqual(e,r)&&(e=tn.signedRightShift(e,tn.BigInt(n)),t+=n);return t}(t);let r;r=tn.greaterThanOrEqual(tn.BigInt(n),tn.BigInt(128))?tn.signedRightShift(t,tn.BigInt(n-127)):tn.leftShift(t,tn.BigInt(127-n));let i=tn.leftShift(tn.subtract(tn.BigInt(n),tn.BigInt(128)),tn.BigInt(64));for(let e=0;e<14;e++){r=tn.signedRightShift(tn.multiply(r,r),tn.BigInt(127));const t=tn.signedRightShift(r,tn.BigInt(128));i=tn.bitwiseOr(i,tn.leftShift(t,tn.BigInt(63-e))),r=tn.signedRightShift(r,t)}const o=tn.multiply(i,tn.BigInt("255738958999603826347141")),a=tn.toNumber(tn.signedRightShift(tn.subtract(o,tn.BigInt("3402992956809132418596140100660247210")),tn.BigInt(128))),s=tn.toNumber(tn.signedRightShift(tn.add(o,tn.BigInt("291339464771989622907027621153398088495")),tn.BigInt(128)));return a===s?a:tn.lessThanOrEqual(cB.getSqrtRatioAtTick(s),e)?s:a}}cB.MIN_TICK=-887272,cB.MAX_TICK=-cB.MIN_TICK,cB.MIN_SQRT_RATIO=tn.BigInt("4295128739"),cB.MAX_SQRT_RATIO=tn.BigInt("1461446703485210103287273052203988822378723970342");const uB=tn.BigInt(Number.MAX_SAFE_INTEGER),pB=tn.BigInt(0),hB=tn.BigInt(1),mB=tn.BigInt(2);function fB(e,t){const n=tn.leftShift(tn.BigInt(e),tn.BigInt(192)),r=tn.BigInt(t);return function(e){if(nn(tn.greaterThanOrEqual(e,pB),"NEGATIVE"),tn.lessThan(e,uB))return tn.BigInt(Math.floor(Math.sqrt(tn.toNumber(e))));let t,n;for(t=e,n=tn.add(tn.divide(e,mB),hB);tn.lessThan(n,t);)t=n,n=tn.divide(tn.add(tn.divide(e,n),n),mB);return t}(tn.divide(n,r))}var gB;!function(e){e[e.ROUND_DOWN=0]="ROUND_DOWN",e[e.ROUND_HALF_UP=1]="ROUND_HALF_UP",e[e.ROUND_UP=2]="ROUND_UP"}(gB||(gB={}));const yB={[gB.ROUND_DOWN]:i.ROUND_DOWN,[gB.ROUND_HALF_UP]:i.ROUND_HALF_UP,[gB.ROUND_UP]:i.ROUND_UP},xB={[gB.ROUND_DOWN]:i.ROUND_DOWN,[gB.ROUND_HALF_UP]:i.ROUND_HALF_UP,[gB.ROUND_UP]:i.ROUND_UP};let vB=class e{constructor(e,t=tn.BigInt(1)){this.numerator=tn.BigInt(e),this.denominator=tn.BigInt(t)}static tryParseFraction(t){if(t instanceof tn||"number"==typeof t||"string"==typeof t)return new e(t);if("numerator"in t&&"denominator"in t)return t;throw new Error("Could not parse fraction")}get quotient(){return tn.divide(this.numerator,this.denominator)}get remainder(){return new e(tn.remainder(this.numerator,this.denominator),this.denominator)}invert(){return new e(this.denominator,this.numerator)}add(t){const n=e.tryParseFraction(t);return tn.equal(this.denominator,n.denominator)?new e(tn.add(this.numerator,n.numerator),this.denominator):new e(tn.add(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator)),tn.multiply(this.denominator,n.denominator))}subtract(t){const n=e.tryParseFraction(t);return tn.equal(this.denominator,n.denominator)?new e(tn.subtract(this.numerator,n.numerator),this.denominator):new e(tn.subtract(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator)),tn.multiply(this.denominator,n.denominator))}lessThan(t){const n=e.tryParseFraction(t);return tn.lessThan(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator))}equalTo(t){const n=e.tryParseFraction(t);return tn.equal(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator))}greaterThan(t){const n=e.tryParseFraction(t);return tn.greaterThan(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator))}multiply(t){const n=e.tryParseFraction(t);return new e(tn.multiply(this.numerator,n.numerator),tn.multiply(this.denominator,n.denominator))}divide(t){const n=e.tryParseFraction(t);return new e(tn.multiply(this.numerator,n.denominator),tn.multiply(this.denominator,n.numerator))}toSignificant(e,t={decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0},n=gB.ROUND_HALF_UP){nn(Number.isInteger(e),`${e} is not an integer.`),nn(e>0,`${e} is not positive.`);const r=yB[n],o=new i(this.numerator.toString()).div(this.denominator.toString()).precision(e,r);return o.toFormat(o.decimalPlaces(),r,t)}toFixed(e,t={decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0},n=gB.ROUND_HALF_UP){nn(Number.isInteger(e),`${e} is not an integer.`),nn(e>=0,`${e} is negative.`);const r=xB[n];return new i(this.numerator.toString()).decimalPlaces(e,r).div(this.denominator.toString()).toFormat(e,r,t)}get asFraction(){return new e(this.numerator,this.denominator)}};const bB=new vB(tn.BigInt(100));function AB(e){return new wB(e.numerator,e.denominator)}class wB extends vB{constructor(){super(...arguments),this.isPercent=!0}add(e){return AB(super.add(e))}subtract(e){return AB(super.subtract(e))}multiply(e){return AB(super.multiply(e))}divide(e){return AB(super.divide(e))}toSignificant(e=5,t,n){return super.multiply(bB).toSignificant(e,t,n)}toFixed(e=2,t,n){return super.multiply(bB).toFixed(e,t,n)}}class kB extends vB{constructor(...e){let t,n,r,i;[t,n,r,i]=e,super(i,r),this.baseCurrency=t,this.quoteCurrency=n,this.scalar=new vB(tn.exponentiate(tn.BigInt(10),tn.BigInt(t.decimals)),tn.exponentiate(tn.BigInt(10),tn.BigInt(n.decimals)))}invert(){return new kB(this.quoteCurrency,this.baseCurrency,this.numerator,this.denominator)}multiply(e){const t=super.multiply(e);return new kB(this.baseCurrency,e.quoteCurrency,t.denominator,t.numerator)}get adjustedForDecimals(){return super.multiply(this.scalar)}toSignificant(e=6,t,n){return this.adjustedForDecimals.toSignificant(e,t,n)}toFixed(e=4,t,n){return this.adjustedForDecimals.toFixed(e,t,n)}}function CB(e){const t=ms(e.baseCurrency,e.quoteCurrency),n=t?fB(e.numerator,e.denominator):fB(e.denominator,e.numerator);let r=cB.getTickAtSqrtRatio(n);const i=jB(e.baseCurrency,e.quoteCurrency,r+1);return t?e.lessThan(i)||r++:e.greaterThan(i)||r++,r}function jB(e,t,n){const r=cB.getSqrtRatioAtTick(Number(n)),i=tn.multiply(r,r);return ms(e,t)?new kB(e,t,oB,i):new kB(e,t,i,oB)}function TB(e,t,n){if(!e||!t||void 0===n)return;const r=cB.getSqrtRatioAtTick(Number(n)),o=tn.multiply(r,r),a=10**t.decimals/10**e.decimals;return ms(e,t)?new i(o.toString()).div(oB.toString()).div(a).toString():new i(oB.toString()).div(o.toString()).div(a).toString()}const EB=[oe.MAINNET,oe.ARBITRUM_ONE,oe.SEPOLIA,oe.TAIKO],SB={v3CoreFactoryAddress:"0x3d2A7Bac4E8439ABe86B58324695e921a5FC0987",nonfungiblePositionManagerAddress:"0x483E5c0f309577f79b0a19cE65E332DD388aD7A8"},IB=Object.assign({},SB),RB=Object.assign({},SB),LB={v3CoreFactoryAddress:"0x3d2A7Bac4E8439ABe86B58324695e921a5FC0987",nonfungiblePositionManagerAddress:"0x483E5c0f309577f79b0a19cE65E332DD388aD7A8"},MB={[oe.MAINNET]:IB,[oe.ARBITRUM_ONE]:RB,[oe.SEPOLIA]:LB,[oe.TAIKO]:LB};var OB,BB;Object.assign({},EB.reduce(((e,t)=>(e[t]=MB[t].v3CoreFactoryAddress,e)),{})),Object.assign({},EB.reduce(((e,t)=>{const n=MB[t].nonfungiblePositionManagerAddress;return n&&(e[t]=n),e}),{})),function(e){e[e.EXACT_INPUT=0]="EXACT_INPUT",e[e.EXACT_OUTPUT=1]="EXACT_OUTPUT"}(OB||(OB={})),function(e){e[e.ROUND_DOWN=0]="ROUND_DOWN",e[e.ROUND_HALF_UP=1]="ROUND_HALF_UP",e[e.ROUND_UP=2]="ROUND_UP"}(BB||(BB={})),tn.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const PB={[BB.ROUND_DOWN]:i.ROUND_DOWN,[BB.ROUND_HALF_UP]:i.ROUND_HALF_UP,[BB.ROUND_UP]:i.ROUND_UP},DB={[BB.ROUND_DOWN]:i.ROUND_DOWN,[BB.ROUND_HALF_UP]:i.ROUND_HALF_UP,[BB.ROUND_UP]:i.ROUND_UP};class NB{constructor(e,t=tn.BigInt(1)){this.numerator=tn.BigInt(e),this.denominator=tn.BigInt(t)}static tryParseFraction(e){if(e instanceof tn||"number"==typeof e||"string"==typeof e)return new NB(e);if("numerator"in e&&"denominator"in e)return e;throw new Error("Could not parse fraction")}get quotient(){return tn.divide(this.numerator,this.denominator)}get remainder(){return new NB(tn.remainder(this.numerator,this.denominator),this.denominator)}invert(){return new NB(this.denominator,this.numerator)}add(e){const t=NB.tryParseFraction(e);return tn.equal(this.denominator,t.denominator)?new NB(tn.add(this.numerator,t.numerator),this.denominator):new NB(tn.add(tn.multiply(this.numerator,t.denominator),tn.multiply(t.numerator,this.denominator)),tn.multiply(this.denominator,t.denominator))}subtract(e){const t=NB.tryParseFraction(e);return tn.equal(this.denominator,t.denominator)?new NB(tn.subtract(this.numerator,t.numerator),this.denominator):new NB(tn.subtract(tn.multiply(this.numerator,t.denominator),tn.multiply(t.numerator,this.denominator)),tn.multiply(this.denominator,t.denominator))}lessThan(e){const t=NB.tryParseFraction(e);return tn.lessThan(tn.multiply(this.numerator,t.denominator),tn.multiply(t.numerator,this.denominator))}equalTo(e){const t=NB.tryParseFraction(e);return tn.equal(tn.multiply(this.numerator,t.denominator),tn.multiply(t.numerator,this.denominator))}greaterThan(e){const t=NB.tryParseFraction(e);return tn.greaterThan(tn.multiply(this.numerator,t.denominator),tn.multiply(t.numerator,this.denominator))}multiply(e){const t=NB.tryParseFraction(e);return new NB(tn.multiply(this.numerator,t.numerator),tn.multiply(this.denominator,t.denominator))}divide(e){const t=NB.tryParseFraction(e);return new NB(tn.multiply(this.numerator,t.denominator),tn.multiply(this.denominator,t.numerator))}toSignificant(e,t={decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0},n=BB.ROUND_HALF_UP){nn(Number.isInteger(e),`${e} is not an integer.`),nn(e>0,`${e} is not positive.`);const r=PB[n],o=new i(this.numerator.toString()).div(this.denominator.toString()).precision(e,r);return o.toFormat(o.decimalPlaces(),r,t)}toFixed(e,t={decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0},n=BB.ROUND_HALF_UP){nn(Number.isInteger(e),`${e} is not an integer.`),nn(e>=0,`${e} is negative.`);const r=DB[n];return new i(this.numerator.toString()).decimalPlaces(e,r).div(this.denominator.toString()).toFormat(e,r,t)}get asFraction(){return new NB(this.numerator,this.denominator)}}new NB(tn.BigInt(100));class FB{constructor(e,t,n,r){nn(Number.isSafeInteger(e),"CHAIN_ID"),nn(t>=0&&t<255&&Number.isInteger(t),"DECIMALS"),this.chainId=e,this.decimals=t,this.symbol=n,this.name=r}}const WB=/^0x[0-9a-fA-F]{40}$/;class VB extends FB{constructor(e,t,n,r,i,o,a,s){super(e,n,r,i),this.isNative=!1,this.isToken=!0,this.address=o?function(e){if(WB.test(e))return e;throw new Error(`${e} is not a valid address.`)}(t):function(e){try{return Vr(e)}catch(t){throw new Error(`${e} is not a valid address.`)}}(t),a&&nn(a.gte(ne.from(0)),"NON-NEGATIVE FOT FEES"),s&&nn(s.gte(ne.from(0)),"NON-NEGATIVE FOT FEES"),this.buyFeeBps=a,this.sellFeeBps=s}equals(e){return e.isToken&&this.chainId===e.chainId&&this.address.toLowerCase()===e.address.toLowerCase()}sortsBefore(e){return nn(this.chainId===e.chainId,"CHAIN_IDS"),nn(this.address.toLowerCase()!==e.address.toLowerCase(),"ADDRESSES"),this.address.toLowerCase()<e.address.toLowerCase()}get wrapped(){return this}}tn.BigInt(Number.MAX_SAFE_INTEGER),tn.BigInt(0),tn.BigInt(1),tn.BigInt(2);class UB{constructor(e){const t=ue[e];this.chainId=e,this.decimals=t.decimals,this.name=t.name,this.symbol=t.symbol,this.isNative=!0,this.isToken=!1,this.address=HB(this.chainId)}equals(e){return e.isNative&&e.chainId===this.chainId}get wrapped(){const e=ue[this.chainId];return new VB(this.chainId,e.wrappedTokenAddress,e.decimals,e.wrappedTokenSymbol,e.name)}static onChain(e){var t;return null!==(t=this._cachedNativeCurrency[e])&&void 0!==t?t:this._cachedNativeCurrency[e]=new UB(e)}}function HB(e){return ue[e].address}UB._cachedNativeCurrency={};const qB=(e,t)=>!t||function(e,t){const n=null==e?void 0:e.toLowerCase(),r=null==t?void 0:t.toLowerCase();return null!==n&&null!==r&&n===r}(t,HB(e));function ZB(e){if(!e)return;const{name:t,chainId:n,address:r,decimals:i,symbol:o}=e;return function(e,t){return!qB(e,t)}(n,r)?new VB(n,r,i,null!=o?o:void 0,null!=t?t:void 0):new UB(n)}const zB=({token0:t,token1:n,token0Price:r,tickLower:o,tickUpper:a,title:s,border:l})=>{const d=g(),[c,u]=ct(t),p=c.address===t.address,h=p?n:t,m=ZB(t),y=ZB(n),x=r?p?r:new i(1).div(r).toString():void 0,v=TB(t,n,o),b=TB(t,n,a),A=void 0===o||void 0===a,w=ut((()=>{u(h)}),[h]);return Os.jsxs(JO,{gap:"md",children:[Os.jsxs(_O,{children:[s?Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:d.palette.text.secondary},children:s}):Os.jsx("div",{}),Os.jsx(ZO,{baseToken:p?m:y,quoteToken:p?y:m,handleRateToggle:w})]}),Os.jsxs(_O,{children:[Os.jsxs(GO,{sx:{width:"48%",py:12,gap:12},border:l,children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:4},children:[Os.jsx(f,{sx:{color:d.palette.text.primary,typography:"body2"},children:Os.jsx(e,{id:"EQs1sJ",message:"Min price"})}),Os.jsx(f,{sx:{color:d.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"7Z4WfS",message:"{0} per {1}",values:{0:h.symbol,1:c.symbol}})})]}),Os.jsx(D,{loading:A,loadingProps:{width:100},sx:{color:d.palette.text.primary,typography:"caption"},children:qO(v,6)}),Os.jsx(f,{sx:{color:d.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"WgTuci",message:"Your position will be 100% composed of {0} at this price",values:{0:null==c?void 0:c.symbol}})})]}),Os.jsxs(GO,{sx:{width:"48%",py:12,gap:12},border:l,children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:4},children:[Os.jsx(f,{sx:{color:d.palette.text.primary,typography:"body2"},children:Os.jsx(e,{id:"5etEUX",message:"Max price"})}),Os.jsx(f,{sx:{color:d.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"7Z4WfS",message:"{0} per {1}",values:{0:h.symbol,1:c.symbol}})})]}),Os.jsx(D,{loading:A,loadingProps:{width:100},sx:{color:d.palette.text.primary,typography:"caption"},children:qO(b,6)}),Os.jsx(f,{sx:{color:d.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"WgTuci",message:"Your position will be 100% composed of {0} at this price",values:{0:null==h?void 0:h.symbol}})})]})]}),Os.jsxs(GO,{sx:{py:12,flexDirection:"row",alignItems:"center",justifyContent:"space-between"},border:l,children:[Os.jsxs(JO,{gap:"4px",justify:"flex-start",children:[Os.jsx(f,{sx:{color:d.palette.text.primary,typography:"body2"},children:Os.jsx(e,{id:"DWd30U",message:"Current price"})}),Os.jsx(f,{sx:{color:d.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"7Z4WfS",message:"{0} per {1}",values:{0:h.symbol,1:c.symbol}})})]}),Os.jsx(D,{loading:!r,loadingProps:{width:100},sx:{color:d.palette.text.primary,typography:"caption"},children:`${An({input:x})} `})]})]})},QB=({token0:e,token1:t,liquidity:n,amount0:r,amount1:i,price:o,tickLower:a,tickUpper:s,title:l,inRange:d})=>{var c,u;const p=!!n&&0===n;return Os.jsxs(JO,{gap:"md",style:{marginTop:"0.5rem"},children:[Os.jsxs(_O,{style:{gap:4},children:[Os.jsxs($O,{children:[Os.jsx(Cj,{chainId:null==e?void 0:e.chainId,tokens:e&&t?[{address:e.address},{address:t.address}]:[],mr:8}),Os.jsxs(f,{sx:{typography:"h5"},children:[null==e?void 0:e.symbol," / ",null==t?void 0:t.symbol]})]}),Os.jsx(HO,{removed:p,inRange:d})]}),Os.jsx(GO,{children:Os.jsxs(JO,{gap:"md",children:[Os.jsxs(_O,{children:[Os.jsxs($O,{children:[Os.jsx(ey,{address:null!==(c=null==e?void 0:e.address)&&void 0!==c?c:"",chainId:null==e?void 0:e.chainId,noShowChain:!0,width:32,height:32,marginRight:0}),Os.jsx(f,{sx:{ml:8},children:null==e?void 0:e.symbol})]}),Os.jsx($O,{children:Os.jsx(f,{sx:{mr:8},children:An({input:r,decimals:null==e?void 0:e.decimals})})})]}),Os.jsxs(_O,{children:[Os.jsxs($O,{children:[Os.jsx(ey,{address:null!==(u=null==t?void 0:t.address)&&void 0!==u?u:"",chainId:null==t?void 0:t.chainId,noShowChain:!0,width:32,height:32,marginRight:0}),Os.jsx(f,{ml:"8px",children:null==t?void 0:t.symbol})]}),Os.jsx($O,{children:Os.jsx(f,{mr:"8px",children:An({input:i,decimals:null==t?void 0:t.decimals})})})]})]})}),!!e&&!!t&&!!o&&void 0!==a&&void 0!==s&&Os.jsx(zB,{title:l,token0:e,token1:t,token0Price:o,tickLower:a,tickUpper:s})]})},GB=({on:e,onClose:t,onConfirm:n,loading:i,token0:o,token1:a,liquidity:s,amount0:l,amount1:d,price:c,tickLower:u,tickUpper:p,title:h,inRange:m})=>{const{isMobile:g}=wy();return Os.jsx(yy,{open:e,onClose:t,modal:!0,title:null!=h?h:r._({id:"E6MqGy",message:"Add liquidity"}),height:683,children:Os.jsxs(f,{sx:{flex:1,px:20,pb:24,display:"flex",flexDirection:"column",justifyContent:"space-between",width:g?void 0:420},children:[Os.jsx(f,{sx:{pt:0,px:0},children:Os.jsx(QB,{token0:o,token1:a,price:c,tickLower:u,tickUpper:p,liquidity:s,amount0:l,amount1:d,inRange:m,title:r._({id:"3VUfrF",message:"Selected Range"})})}),Os.jsx(T,{size:T.Size.big,fullWidth:!0,isLoading:i,sx:{mt:20},onClick:n,children:r._({id:"7VpPHA",message:"Confirm"})})]})})};class YB{constructor(){}static mulDivRoundingUp(e,t,n){const r=tn.multiply(e,t);let i=tn.divide(r,n);return tn.notEqual(tn.remainder(r,n),nB)&&(i=tn.add(i,rB)),i}}const XB=tn.subtract(tn.exponentiate(tn.BigInt(2),tn.BigInt(160)),rB);function JB(e,t){const n=tn.multiply(e,t);return tn.bitwiseAnd(n,tB)}class KB{constructor(){}static getAmount0Delta(e,t,n,r){tn.greaterThan(e,t)&&([e,t]=[t,e]);const i=tn.leftShift(n,tn.BigInt(96)),o=tn.subtract(t,e);return r?YB.mulDivRoundingUp(YB.mulDivRoundingUp(i,o,t),rB,e):tn.divide(tn.divide(tn.multiply(i,o),t),e)}static getAmount1Delta(e,t,n,r){return tn.greaterThan(e,t)&&([e,t]=[t,e]),r?YB.mulDivRoundingUp(n,tn.subtract(t,e),iB):tn.divide(tn.multiply(n,tn.subtract(t,e)),iB)}static getNextSqrtPriceFromInput(e,t,n,r){return nn(tn.greaterThan(e,nB)),nn(tn.greaterThan(t,nB)),r?this.getNextSqrtPriceFromAmount0RoundingUp(e,t,n,!0):this.getNextSqrtPriceFromAmount1RoundingDown(e,t,n,!0)}static getNextSqrtPriceFromOutput(e,t,n,r){return nn(tn.greaterThan(e,nB)),nn(tn.greaterThan(t,nB)),r?this.getNextSqrtPriceFromAmount1RoundingDown(e,t,n,!1):this.getNextSqrtPriceFromAmount0RoundingUp(e,t,n,!1)}static getNextSqrtPriceFromAmount0RoundingUp(e,t,n,r){if(tn.equal(n,nB))return e;const i=tn.leftShift(t,tn.BigInt(96));if(r){const t=JB(n,e);if(tn.equal(tn.divide(t,n),e)){const n=function(e,t){const n=tn.add(e,t);return tn.bitwiseAnd(n,tB)}(i,t);if(tn.greaterThanOrEqual(n,i))return YB.mulDivRoundingUp(i,e,n)}return YB.mulDivRoundingUp(i,rB,tn.add(tn.divide(i,e),n))}{const t=JB(n,e);nn(tn.equal(tn.divide(t,n),e)),nn(tn.greaterThan(i,t));const r=tn.subtract(i,t);return YB.mulDivRoundingUp(i,e,r)}}static getNextSqrtPriceFromAmount1RoundingDown(e,t,n,r){if(r){const r=tn.lessThanOrEqual(n,XB)?tn.divide(tn.leftShift(n,tn.BigInt(96)),t):tn.divide(tn.multiply(n,iB),t);return tn.add(e,r)}{const r=YB.mulDivRoundingUp(n,iB,t);return nn(tn.greaterThan(e,r)),tn.subtract(e,r)}}}function _B(e,t,n){tn.greaterThan(e,t)&&([e,t]=[t,e]);const r=tn.divide(tn.multiply(e,t),iB);return tn.divide(tn.multiply(tn.BigInt(n),r),tn.subtract(t,e))}function $B(e,t,n){tn.greaterThan(e,t)&&([e,t]=[t,e]);const r=tn.multiply(tn.multiply(tn.BigInt(n),e),t),i=tn.multiply(iB,tn.subtract(t,e));return tn.divide(r,i)}function eP(e,t,n){return tn.greaterThan(e,t)&&([e,t]=[t,e]),tn.divide(tn.multiply(tn.BigInt(n),iB),tn.subtract(t,e))}function tP({sqrtRatioX96:e,tickLower:t,tickUpper:n,amount0:r,amount1:i,useFullPrecision:o}){return function(e,t,n,r,i,o){tn.greaterThan(t,n)&&([t,n]=[n,t]);const a=o?$B:_B;if(tn.lessThanOrEqual(e,t))return a(t,n,r);if(tn.lessThan(e,n)){const o=a(e,n,r),s=eP(t,e,i);return tn.lessThan(o,s)?o:s}return eP(t,n,i)}(e,cB.getSqrtRatioAtTick(t),cB.getSqrtRatioAtTick(n),r,i,o)}function nP({tickCurrent:e,tickLower:t,tickUpper:n,liquidity:r,roundUp:i}){const o=tn.BigInt(r.toString());if(e<t){return KB.getAmount0Delta(cB.getSqrtRatioAtTick(t),cB.getSqrtRatioAtTick(n),o,!!i)}if(e<n){const t=cB.getSqrtRatioAtTick(e);return KB.getAmount0Delta(t,cB.getSqrtRatioAtTick(n),o,!!i)}return nB}function rP({tickCurrent:e,tickLower:t,tickUpper:n,liquidity:r,roundUp:i}){const o=tn.BigInt(r.toString());if(e<t)return nB;if(e<n){const n=cB.getSqrtRatioAtTick(e);return KB.getAmount1Delta(cB.getSqrtRatioAtTick(t),n,o,!!i)}return KB.getAmount1Delta(cB.getSqrtRatioAtTick(t),cB.getSqrtRatioAtTick(n),o,!!i)}function iP({baseToken:e,quoteToken:t,sqrtRatioX96:n,tickCurrent:r,tickLower:i,tickUpper:o}){const[a,s]=at.useState(""),[l,d]=at.useState(""),c=!(!e||!t)&&ms(e,t),u=!e||!t||void 0===n||void 0===r||void 0===i||void 0===o,p=(a,s)=>{if(u)throw new Error("parma is undefined");const l=s?c:!c,d=c?e.decimals:t.decimals,p=c?t.decimals:e.decimals;if(l){const e=function({sqrtRatioX96:e,tickCurrent:t,tickLower:n,tickUpper:r,amount0:i,useFullPrecision:o}){const a=tP({sqrtRatioX96:e,tickLower:n,tickUpper:r,amount0:i,amount1:tB,useFullPrecision:o});return{amount0:nP({tickCurrent:t,tickLower:n,tickUpper:r,liquidity:a}),amount1:rP({tickCurrent:t,tickLower:n,tickUpper:r,liquidity:a})}}({sqrtRatioX96:n,tickCurrent:r,tickLower:i,tickUpper:o,amount0:rt(a,d).toString(),useFullPrecision:!0});return{amount0:Tn(e.amount0.toString(),d),amount1:Tn(e.amount1.toString(),p)}}{const e=function({sqrtRatioX96:e,tickCurrent:t,tickLower:n,tickUpper:r,amount1:i}){const o=tP({sqrtRatioX96:e,tickLower:n,tickUpper:r,amount0:tB,amount1:i,useFullPrecision:!0});return{amount0:nP({tickCurrent:t,tickLower:n,tickUpper:r,liquidity:o}),amount1:rP({tickCurrent:t,tickLower:n,tickUpper:r,liquidity:o})}}({sqrtRatioX96:n,tickCurrent:r,tickLower:i,tickUpper:o,amount1:rt(a,p).toString()});return{amount0:Tn(e.amount0.toString(),d),amount1:Tn(e.amount1.toString(),p)}}};return{readonly:u,baseAmount:a,quoteAmount:l,handleChangeBaseAmount:e=>{if(s(e),Number(e)){const t=p(e,!0);d(String(c?t.amount1:t.amount0))}},handleChangeQuoteAmount:e=>{if(d(e),Number(e)){const t=p(e,!1);s(String(c?t.amount0:t.amount1))}},handleBlurBaseAmount:e=>{if(Number(e)){const t=p(e,!0);s(String(c?t.amount0:t.amount1))}},handleBlurQuoteAmount:e=>{if(Number(e)){const t=p(e,!1);d(String(c?t.amount1:t.amount0))}},reset:()=>{s(""),d("")}}}function oP(e){let t=tn.BigInt(e).toString(16);return t.length%2!=0&&(t=`0${t}`),`0x${t}`}function aP(){const e=Hy();return Ot({mutationFn:t=>Fn(this,[t],void 0,(function*({createPool:t,recipient:n,deployer:i,pool:o,tokenId:a,amount0:s,amount1:l,tickLower:d,tickUpper:c,amount0Min:u,amount1Min:p,successBack:h}){if(!(null==o?void 0:o.token0Wrapped)||!o.token1Wrapped)return;const m=[],f=null!=i?i:Jv,g=Math.ceil(Date.now()/1e3)+600,y=t?r._({id:"8OiU8L",message:"Pool Creation"}):r._({id:"OBdohg",message:"Add Liquidity"});try{if(n&&t){if(!o.currentSqrt)throw new Error("currentSqrt is undefined");m.push(Ue(o.token0Wrapped.address,o.token1Wrapped.address,f,o.currentSqrt,"0x"))}if(n)m.push(He({token0:o.token0Wrapped.address,token1:o.token1Wrapped.address,deployer:f,tickLower:d,tickUpper:c,amount0Desired:oP(s),amount1Desired:oP(l),amount0Min:u,amount1Min:p,recipient:n,deadline:g}));else{if(!a)throw new Error("tokenId is undefined");m.push(qe({tokenId:oP(a),amount0Desired:oP(s),amount1Desired:oP(l),amount0Min:u,amount1Min:p,deadline:g}))}let r=oP(0);if(o.isBaseTokenNative||o.isQuoteTokenNative){let e=s;(o.isRearTokenA?o.isBaseTokenNative:o.isQuoteTokenNative)&&(e=l),Number(e)>0&&m.push(Ze()),r=oP(e)}return e.execute(y,{opcode:By.TX,to:ze(o.chainId),value:r,data:Qe(m)},{early:!1,metadata:{[t?Ey.createAlgebraPool:Ey.addAlgebraPool]:"1"},successBack:h})}catch(e){console.error(e),mv.getState().toast({message:`${y} error: ${e}`,type:"error"})}}))})}function sP({baseToken:e,quoteToken:t,startPriceTypedValue:n}){var r,i;const o=function({baseToken:e,quoteToken:t}){return at.useMemo((()=>{var n,r;let i=!1,o=!1,a=!1;if(!e||!t)return{chainId:void 0,isRearTokenA:!1,token0:void 0,token1:void 0,token0Wrapped:void 0,token1Wrapped:void 0,isBaseTokenNative:o,isQuoteTokenNative:a};const s=e.chainId,l=ue[s];o=(null===(n=l.address)||void 0===n?void 0:n.toLowerCase())===e.address.toLowerCase(),a=(null===(r=l.address)||void 0===r?void 0:r.toLowerCase())===t.address.toLowerCase();const d=o?Object.assign(Object.assign({},e),{address:l.wrappedTokenAddress,symbol:l.wrappedTokenSymbol}):e,c=a?Object.assign(Object.assign({},t),{address:l.wrappedTokenAddress,symbol:l.wrappedTokenSymbol}):t;i=!ms(d,c);const[u,p,h,m]=i?[t,e,c,d]:[e,t,d,c];return{chainId:s,isRearTokenA:i,token0:u,token1:p,token0Wrapped:h,token1Wrapped:m,isBaseTokenNative:o,isQuoteTokenNative:a}}),[e,t])}({baseToken:e,quoteToken:t});let a;o.token0&&o.token1&&o.token0Wrapped.address!==o.token1Wrapped.address&&(a=function({tokenA:e,tokenB:t,poolDeployer:n,initCodeHashManualOverride:r}){const[i,o]=ms(e,t)?[e,t]:[t,e];return Hr(n,Ua(["bytes"],[tt.encode(["address","address"],[i.address,o.address])]),r)}({tokenA:o.token0Wrapped,tokenB:o.token1Wrapped,poolDeployer:null!==(r=ss[o.chainId])&&void 0!==r?r:"",initCodeHashManualOverride:null!==(i=ls[o.chainId])&&void 0!==i?i:""}));const s=It(Ge(o.chainId,a)),l=It(Ye(o.chainId,a)),d=It(Xe(o.chainId,a)),c=!!s.data||!!l.data||void 0!==d.data;let u,p,h;const m=s.data?Number(s.data):60;if(l.data)u=Number(l.data.tick),p=cB.getSqrtRatioAtTick(u).toString(),h=l.data&&o.token0Wrapped&&o.token1Wrapped?jB(o.token0Wrapped,o.token1Wrapped,l.data.tick):void 0;else if(t&&e&&Number(n)){const r=jn(n,t.decimals).toString(),i=jn(1,e.decimals).toString();h=new kB(e,t,i,r),o.isRearTokenA&&(h=h.invert()),u=CB(h),p=cB.getSqrtRatioAtTick(u).toString()}return Object.assign({isExists:c,address:a,fetchTickSpacing:s,fetchGlobalState:l,fetchLiquidity:d,currentTick:u,currentSqrt:p,price:h,reversePrice:undefined,tickSpacing:m},o)}const lP=1e4,dP=100*lP;function cP(e){const t=Math.floor(Number(e)*lP);return new wB(t,dP)}function uP(e,t){const n=ms(e.baseCurrency,e.quoteCurrency)?e:e.invert(),r=n.asFraction.multiply(new wB(1).subtract(t)),i=n.asFraction.multiply(t.add(1));let o=fB(r.numerator,r.denominator);tn.lessThanOrEqual(o,cB.MIN_SQRT_RATIO)&&(o=tn.add(cB.MIN_SQRT_RATIO,tn.BigInt(1)));let a=fB(i.numerator,i.denominator);return tn.greaterThanOrEqual(a,cB.MAX_SQRT_RATIO)&&(a=tn.subtract(cB.MAX_SQRT_RATIO,tn.BigInt(1))),{sqrtRatioX96Lower:o,sqrtRatioX96Upper:a}}function pP(e,t,n,r,i,o,a,s){const l=cB.getSqrtRatioAtTick(Number(e)),d=jB(i,o,e),{sqrtRatioX96Upper:c,sqrtRatioX96Lower:u}=uP(d,t),p=tP({sqrtRatioX96:l,tickLower:n,tickUpper:r,amount0:a,amount1:s,useFullPrecision:!1});return{amount0:nP({tickCurrent:cB.getTickAtSqrtRatio(c),tickLower:n,tickUpper:r,liquidity:p,roundUp:!0}),amount1:rP({tickCurrent:cB.getTickAtSqrtRatio(u),tickLower:n,tickUpper:r,liquidity:p,roundUp:!0})}}var hP,mP;!function(e){e.CURRENCY_A="CURRENCY_A",e.CURRENCY_B="CURRENCY_B"}(hP||(hP={})),function(e){e.LOWER="LOWER",e.UPPER="UPPER"}(mP||(mP={}));const fP=({value:t,decrement:n,increment:r,decrementDisabled:i=!1,incrementDisabled:o=!1,locked:a,onUserInput:s,title:l,tokenA:d,tokenB:c,border:u})=>{const p=g(),[h,m]=ct(!1),[y,x]=ct(""),[v,b]=ct(!1),[A,w]=ct(!1),k=ut((()=>{b(!1),m(!1),s(y)}),[y,s]),C=ut((()=>{b(!1),s(n())}),[n,s]),j=ut((()=>{b(!1),s(r())}),[r,s]);return st((()=>{y===t||v||setTimeout((()=>{x(t),w(!0),setTimeout((function(){w(!1)}),1800)}),0)}),[y,v,t]),Os.jsx(f,{onFocus:()=>{b(!0),m(!0)},onBlur:k,sx:Object.assign({width:"100%",py:12,px:20,borderRadius:16,backgroundColor:p.palette.background.input},u&&{borderWidth:3,borderColor:"text.primary"}),children:Os.jsxs(f,{sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",flex:1},children:[Os.jsx(f,{sx:{typography:"body2",fontWeight:600,color:p.palette.text.primary},children:l}),Os.jsx(f,{sx:{mt:4,typography:"h6",fontWeight:500,color:p.palette.text.secondary},children:Os.jsx(e,{id:"1/LP4K",message:"{tokenB} per {tokenA}",values:{tokenB:c,tokenA:d}})}),Os.jsx(hy,{sx:{mt:12},value:y,onChange:e=>{x(e)},readOnly:a})]}),Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:8},children:[!a&&Os.jsx(T,{size:T.Size.small,onClick:j,disabled:o,sx:{px:4,backgroundColor:p.palette.background.paper,"&[disabled]":{cursor:"default"}},children:Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{d:"M14.25 9.75H9.75V14.25H8.25V9.75H3.75V8.25H8.25V3.75H9.75V8.25H14.25V9.75Z",fill:i?p.palette.text.disabled:p.palette.text.primary})})}),!a&&Os.jsx(T,{size:T.Size.small,onClick:C,disabled:i,sx:{px:4,backgroundColor:p.palette.background.paper,"&[disabled]":{cursor:"default"}},children:Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("rect",{x:"3.75",y:"8.25",width:"10.5",height:"1.5",fill:i?p.palette.text.disabled:p.palette.text.primary})})})]})]})})},gP=({priceLower:t,priceUpper:n,onLeftRangeInput:r,onRightRangeInput:i,getDecrementLower:o,getIncrementLower:a,getDecrementUpper:s,getIncrementUpper:l,tokenA:d,tokenB:c,ticksAtLimit:u,isSorted:p,border:h})=>{var m,g;const y=p?t:null==n?void 0:n.invert(),x=p?n:null==t?void 0:t.invert();return Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:8},children:[Os.jsx(fP,{value:u[p?mP.LOWER:mP.UPPER]?"0":null!==(m=null==y?void 0:y.toSignificant(8))&&void 0!==m?m:"",onUserInput:r,decrement:p?o:l,increment:p?a:s,decrementDisabled:void 0===y||u[p?mP.LOWER:mP.UPPER],incrementDisabled:void 0===y||u[p?mP.LOWER:mP.UPPER],label:y?`${null==c?void 0:c.symbol}`:"-",title:Os.jsx(e,{id:"uEoBVI",message:"Low price"}),tokenA:null==d?void 0:d.symbol,tokenB:null==c?void 0:c.symbol,border:h}),Os.jsx(fP,{value:u[p?mP.UPPER:mP.LOWER]?"∞":null!==(g=null==x?void 0:x.toSignificant(8))&&void 0!==g?g:"",onUserInput:i,decrement:p?s:a,increment:p?l:o,incrementDisabled:void 0===x||u[p?mP.UPPER:mP.LOWER],decrementDisabled:void 0===x||u[p?mP.UPPER:mP.LOWER],label:x?`${null==c?void 0:c.symbol}`:"-",tokenA:null==d?void 0:d.symbol,tokenB:null==c?void 0:c.symbol,title:Os.jsx(e,{id:"kAC8rT",message:"High price"}),border:h})]})};function yP(e,t){nn(Number.isInteger(e)&&Number.isInteger(t),"INTEGERS"),nn(t>0,"TICK_SPACING"),nn(e>=cB.MIN_TICK&&e<=cB.MAX_TICK,"TICK_BOUND");const n=Math.round(e/t)*t;return n<cB.MIN_TICK?n+t:n>cB.MAX_TICK?n-t:n}function xP(e,t,n,r){if(!e||!t||!n||void 0===r)return;const i=function(e,t,n){var r;if(!e||!t||!n)return;if(!n.match(/^\d*\.?\d+$/))return;const[i,o]=n.split("."),a=null!==(r=null==o?void 0:o.length)&&void 0!==r?r:0,s=tn.BigInt((null!=i?i:"")+(null!=o?o:""));return new kB(e,t,tn.multiply(tn.BigInt(10**a),tn.BigInt(10**e.decimals)),tn.multiply(s,tn.BigInt(10**t.decimals)))}(e,t,n);if(!i)return;let o;const a=fB(i.numerator,i.denominator);return o=tn.greaterThanOrEqual(a,cB.MAX_SQRT_RATIO)?cB.MAX_TICK:tn.lessThanOrEqual(a,cB.MIN_SQRT_RATIO)?cB.MIN_TICK:CB(i),yP(o,r)}var vP,bP={exports:{}},AP={};var wP,kP={};
31
+ */function Ox(){if(Ax)return bx;Ax=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return bx=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,i){for(var o,a,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),l=1;l<arguments.length;l++){for(var d in o=Object(arguments[l]))t.call(o,d)&&(s[d]=o[d]);if(e){a=e(o);for(var c=0;c<a.length;c++)n.call(o,a[c])&&(s[a[c]]=o[a[c]])}}return s},bx}function Bx(){if(kx)return wx;kx=1;return wx="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Px(){return jx?Cx:(jx=1,Cx=Function.call.bind(Object.prototype.hasOwnProperty))}if("production"!==process.env.NODE_ENV){var Dx=Mx;fx.exports=function(){if(Ix)return Sx;Ix=1;var e=Mx,t=Ox(),n=Bx(),r=Px(),i=function(){if(Ex)return Tx;Ex=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=Bx(),n={},r=Px();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function i(i,o,a,s,l){if("production"!==process.env.NODE_ENV)for(var d in i)if(r(i,d)){var c;try{if("function"!=typeof i[d]){var u=Error((s||"React class")+": "+a+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}c=i[d](o,d,s,a,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((s||"React class")+": type specification of "+a+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in n)){n[c.message]=!0;var p=l?l():"";e("Failed "+a+" type: "+c.message+(null!=p?p:""))}}}return i.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},Tx=i}(),o=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Sx=function(s,l){var d="function"==typeof Symbol&&Symbol.iterator,c="@@iterator",u="<<anonymous>>",p={array:g("array"),bigint:g("bigint"),bool:g("boolean"),func:g("function"),number:g("number"),object:g("object"),string:g("string"),symbol:g("symbol"),any:f(a),arrayOf:function(e){return f((function(t,r,i,o,a){if("function"!=typeof e)return new m("Property `"+a+"` of component `"+i+"` has invalid PropType notation inside arrayOf.");var s=t[r];if(!Array.isArray(s))return new m("Invalid "+o+" `"+a+"` of type `"+v(s)+"` supplied to `"+i+"`, expected an array.");for(var l=0;l<s.length;l++){var d=e(s,l,i,o,a+"["+l+"]",n);if(d instanceof Error)return d}return null}))},element:f((function(e,t,n,r,i){var o=e[t];return s(o)?null:new m("Invalid "+r+" `"+i+"` of type `"+v(o)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:f((function(t,n,r,i,o){var a=t[n];return e.isValidElementType(a)?null:new m("Invalid "+i+" `"+o+"` of type `"+v(a)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return f((function(t,n,r,i,o){if(!(t[n]instanceof e)){var a=e.name||u;return new m("Invalid "+i+" `"+o+"` of type `"+((s=t[n]).constructor&&s.constructor.name?s.constructor.name:u)+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}var s;return null}))},node:f((function(e,t,n,r,i){return x(e[t])?null:new m("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return f((function(t,i,o,a,s){if("function"!=typeof e)return new m("Property `"+s+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var l=t[i],d=v(l);if("object"!==d)return new m("Invalid "+a+" `"+s+"` of type `"+d+"` supplied to `"+o+"`, expected an object.");for(var c in l)if(r(l,c)){var u=e(l,c,o,a,s+"."+c,n);if(u instanceof Error)return u}return null}))},oneOf:function(e){return Array.isArray(e)?f((function(t,n,r,i,o){for(var a=t[n],s=0;s<e.length;s++)if(h(a,e[s]))return null;var l=JSON.stringify(e,(function(e,t){return"symbol"===b(t)?String(t):t}));return new m("Invalid "+i+" `"+o+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+l+".")})):("production"!==process.env.NODE_ENV&&o(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&o("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var t=0;t<e.length;t++){var i=e[t];if("function"!=typeof i)return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+A(i)+" at index "+t+"."),a}return f((function(t,i,o,a,s){for(var l=[],d=0;d<e.length;d++){var c=(0,e[d])(t,i,o,a,s,n);if(null==c)return null;c.data&&r(c.data,"expectedType")&&l.push(c.data.expectedType)}return new m("Invalid "+a+" `"+s+"` supplied to `"+o+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")}))},shape:function(e){return f((function(t,r,i,o,a){var s=t[r],l=v(s);if("object"!==l)return new m("Invalid "+o+" `"+a+"` of type `"+l+"` supplied to `"+i+"`, expected `object`.");for(var d in e){var c=e[d];if("function"!=typeof c)return y(i,o,a,d,b(c));var u=c(s,d,i,o,a+"."+d,n);if(u)return u}return null}))},exact:function(e){return f((function(i,o,a,s,l){var d=i[o],c=v(d);if("object"!==c)return new m("Invalid "+s+" `"+l+"` of type `"+c+"` supplied to `"+a+"`, expected `object`.");var u=t({},i[o],e);for(var p in u){var h=e[p];if(r(e,p)&&"function"!=typeof h)return y(a,s,l,p,b(h));if(!h)return new m("Invalid "+s+" `"+l+"` key `"+p+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(i[o],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var f=h(d,p,a,s,l+"."+p,n);if(f)return f}return null}))}};function h(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function m(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function f(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function i(i,a,s,d,c,p,h){if(d=d||u,p=p||s,h!==n){if(l){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var g=d+":"+s;!t[g]&&r<3&&(o("You are manually calling a React.PropTypes validation function for the `"+p+"` prop on `"+d+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[g]=!0,r++)}}return null==a[s]?i?null===a[s]?new m("The "+c+" `"+p+"` is marked as required in `"+d+"`, but its value is `null`."):new m("The "+c+" `"+p+"` is marked as required in `"+d+"`, but its value is `undefined`."):null:e(a,s,d,c,p)}var a=i.bind(null,!1);return a.isRequired=i.bind(null,!0),a}function g(e){return f((function(t,n,r,i,o,a){var s=t[n];return v(s)!==e?new m("Invalid "+i+" `"+o+"` of type `"+b(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function y(e,t,n,r,i){return new m((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}function x(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(x);if(null===e||s(e))return!0;var t=function(e){var t=e&&(d&&e[d]||e[c]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!x(n.value))return!1}else for(;!(n=r.next()).done;){var i=n.value;if(i&&!x(i[1]))return!1}return!0;default:return!1}}function v(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function b(e){if(null==e)return""+e;var t=v(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function A(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return m.prototype=Error.prototype,p.checkPropTypes=i,p.resetWarningCache=i.resetWarningCache,p.PropTypes=p,p},Sx}()(Dx.isElement,!0)}else fx.exports=function(){if(Lx)return Rx;Lx=1;var e=Bx();function t(){}function n(){}return n.resetWarningCache=t,Rx=function(){function r(t,n,r,i,o,a){if(a!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function i(){return r}r.isRequired=r;var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Rx}()();var Nx=vr(fx.exports);function Fx(e,t){return"production"===process.env.NODE_ENV?()=>null:function(...n){return e(...n)||t(...n)}}function Wx(e,t,n,r,i){const o=e[t],a=i||t;if(null==o||"undefined"==typeof window)return null;let s;const l=o.type;return"function"!=typeof l||function(e){const{prototype:t={}}=e;return Boolean(t.isReactComponent)}(l)||(s="Did you accidentally use a plain function component for an element instead?"),void 0!==s?new Error(`Invalid ${r} \`${a}\` supplied to \`${n}\`. Expected an element that can hold a ref. ${s} For more information see https://mui.com/r/caveat-with-refs-guide`):null}const Vx=Fx(Nx.element,Wx);Vx.isRequired=Fx(Nx.element.isRequired,Wx);const Ux="exact-prop: ​";function Hx(e){return e&&e.ownerDocument||document}const qx="undefined"!=typeof window?ot.useLayoutEffect:ot.useEffect;function Zx(e){const t=ot.useRef(e);return qx((()=>{t.current=e})),ot.useRef(((...e)=>(0,t.current)(...e))).current}function zx(...e){return ot.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{!function(e,t){"function"==typeof e?e(t):e&&(e.current=t)}(e,t)}))}),e)}const Qx={};const Gx=[];class Yx{static create(){return new Yx}currentId=null;start(e,t){this.clear(),this.currentId=setTimeout((()=>{this.currentId=null,t()}),e)}clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function Xx(){const e=function(e,t){const n=ot.useRef(Qx);return n.current===Qx&&(n.current=e(t)),n}(Yx.create).current;var t;return t=e.disposeEffect,ot.useEffect(t,Gx),e}const Jx={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Kx(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Kx(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _x(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Kx(e))&&(r&&(r+=" "),r+=t);return r}function $x(e,t=[]){if(void 0===e)return{};const n={};return Object.keys(e).filter((n=>n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n))).forEach((t=>{n[t]=e[t]})),n}function ev(e){if(void 0===e)return{};const t={};return Object.keys(e).filter((t=>!(t.match(/^on[A-Z]/)&&"function"==typeof e[t]))).forEach((n=>{t[n]=e[n]})),t}function tv(e){const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...o}=e,a=i?{}:function(e,t,n){return"function"==typeof e?e(t,n):e}(n,r),{props:s,internalRef:l}=function(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const e=_x(n?.className,o,i?.className,r?.className),t={...n?.style,...i?.style,...r?.style},a={...n,...i,...r};return e.length>0&&(a.className=e),Object.keys(t).length>0&&(a.style=t),{props:a,internalRef:void 0}}const a=$x({...i,...r}),s=ev(r),l=ev(i),d=t(a),c=_x(d?.className,n?.className,o,i?.className,r?.className),u={...d?.style,...n?.style,...i?.style,...r?.style},p={...d,...n,...l,...s};return c.length>0&&(p.className=c),Object.keys(u).length>0&&(p.style=u),{props:p,internalRef:d.ref}}({...o,externalSlotProps:a}),d=function(e,t,n){return void 0===e||"string"==typeof e?t:{...t,ownerState:{...t.ownerState,...n}}}(t,{...s,ref:zx(l,a?.ref,e.additionalProps?.ref)},r);return d}function nv(e){return e.substring(2).toLowerCase()}function rv(e){const{children:t,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:i,touchEvent:o="onTouchEnd"}=e,a=ot.useRef(!1),s=ot.useRef(null),l=ot.useRef(!1),d=ot.useRef(!1);ot.useEffect((()=>(setTimeout((()=>{l.current=!0}),0),()=>{l.current=!1})),[]);const c=zx((u=t)&&ot.isValidElement(u)?u.props.propertyIsEnumerable("ref")?u.props.ref:u.ref:null,s);var u;const p=Zx((e=>{const t=d.current;d.current=!1;const r=Hx(s.current);if(!l.current||!s.current||"clientX"in e&&function(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}(e,r))return;if(a.current)return void(a.current=!1);let o;o=e.composedPath?e.composedPath().indexOf(s.current)>-1:!r.documentElement.contains(e.target)||s.current.contains(e.target),o||!n&&t||i(e)})),h=e=>n=>{d.current=!0;const r=t.props[e];r&&r(n)},m={ref:c};return!1!==o&&(m[o]=h(o)),ot.useEffect((()=>{if(!1!==o){const e=nv(o),t=Hx(s.current),n=()=>{a.current=!0};return t.addEventListener(e,p),t.addEventListener("touchmove",n),()=>{t.removeEventListener(e,p),t.removeEventListener("touchmove",n)}}}),[p,o]),!1!==r&&(m[r]=h(r)),ot.useEffect((()=>{if(!1!==r){const e=nv(r),t=Hx(s.current);return t.addEventListener(e,p),()=>{t.removeEventListener(e,p)}}}),[p,r]),Os.jsx(ot.Fragment,{children:ot.cloneElement(t,m)})}"production"!==process.env.NODE_ENV&&(rv.propTypes={children:Vx.isRequired,disableReactTree:Nx.bool,mouseEvent:Nx.oneOf(["onClick","onMouseDown","onMouseUp","onPointerDown","onPointerUp",!1]),onClickAway:Nx.func.isRequired,touchEvent:Nx.oneOf(["onTouchEnd","onTouchStart",!1])}),"production"!==process.env.NODE_ENV&&(rv.propTypes=function(e){return"production"===process.env.NODE_ENV?e:{...e,[Ux]:t=>{const n=Object.keys(t).filter((t=>!e.hasOwnProperty(t)));return n.length>0?new Error(`The following props are not supported: ${n.map((e=>`\`${e}\``)).join(", ")}. Please remove them.`):null}}}(rv.propTypes));const iv="base";function ov(e,t){const n=Jx[t];return n?`${iv}--${n}`:function(e,t){return`${iv}-${e}-${t}`}(e,t)}const av="Snackbar";function sv(e){return ov(av,e)}!function(e,t){const n={};t.forEach((t=>{n[t]=ov(e,t)}))}(av,["root"]);const lv={disableDefaultClasses:!1},dv=ot.createContext(lv);"production"!==process.env.NODE_ENV&&(dv.displayName="ClassNameConfiguratorContext");const cv=()=>function(e,t,n){const r={};for(const i in e){const o=e[i];let a="";for(let e=0;e<o.length;e+=1){const r=o[e];r&&(a+=t(r)+" ",n&&n[r]&&(a+=n[r]+" "))}r[i]=a}return r}({root:["root"]},function(e){const{disableDefaultClasses:t}=ot.useContext(dv);return n=>t?"":e(n)}(sv)),uv=ot.forwardRef((function(e,t){const{autoHideDuration:n=null,children:r,disableWindowBlurListener:i=!1,exited:o=!0,onBlur:a,onClose:s,onFocus:l,onMouseEnter:d,onMouseLeave:c,open:u,resumeHideDuration:p,slotProps:h={},slots:m={},...f}=e,g=cv(),{getRootProps:y,onClickAway:x}=function(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=e,a=Xx();ot.useEffect((()=>{if(i)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){e.defaultPrevented||"Escape"===e.key&&r?.(e,"escapeKeyDown")}}),[i,r]);const s=Zx(((e,t)=>{r?.(e,t)})),l=Zx((e=>{r&&null!=e&&a.start(e,(()=>{s(null,"timeout")}))}));ot.useEffect((()=>(i&&l(t),a.clear)),[i,t,l,a]);const d=a.clear,c=ot.useCallback((()=>{null!=t&&l(null!=o?o:.5*t)}),[t,o,l]),u=e=>t=>{const n=e.onFocus;n?.(t),d()},p=e=>t=>{const n=e.onMouseEnter;n?.(t),d()},h=e=>t=>{const n=e.onMouseLeave;n?.(t),c()};return ot.useEffect((()=>{if(!n&&i)return window.addEventListener("focus",c),window.addEventListener("blur",d),()=>{window.removeEventListener("focus",c),window.removeEventListener("blur",d)}}),[n,i,c,d]),{getRootProps:(t={})=>{const n={...$x(e),...$x(t)};return{role:"presentation",...t,...n,onBlur:(r=n,e=>{const t=r.onBlur;t?.(e),c()}),onFocus:u(n),onMouseEnter:p(n),onMouseLeave:h(n)};var r},onClickAway:e=>{r?.(e,"clickaway")}}}({...e,autoHideDuration:n,disableWindowBlurListener:i,onClose:s,open:u,resumeHideDuration:p}),v=e,b=m.root||"div",A=tv({elementType:b,getSlotProps:y,externalForwardedProps:f,externalSlotProps:h.root,additionalProps:{ref:t},ownerState:v,className:g.root}),w=tv({elementType:rv,externalSlotProps:h.clickAwayListener,additionalProps:{onClickAway:x},ownerState:v});return delete w.ownerState,!u&&o?null:Os.jsx(rv,{...w,children:Os.jsx(b,{...A,children:r})})}));function pv({size:e,color:t,time:n,strokeWidth:r=2,sx:i}){const[o,a]=ct("0 1069"),s=e/2,l=s-1;return st((()=>{a(2*Math.PI*l+" 0")}),[]),Os.jsx(f,{width:e,height:e,component:"svg",sx:Object.assign({position:"absolute",top:`-${r}`,left:`-${r}`,transform:"rotate(-90deg)"},i),children:Os.jsx(f,{component:"circle",cx:s,cy:s,r:l,strokeWidth:r,stroke:t,fill:"none",strokeDasharray:o,sx:{transition:`stroke-dasharray ${n}`}})})}"production"!==process.env.NODE_ENV&&(uv.propTypes={autoHideDuration:Nx.number,children:Nx.node,disableWindowBlurListener:Nx.bool,exited:Nx.bool,onClose:Nx.func,open:Nx.bool,resumeHideDuration:Nx.number,slotProps:Nx.shape({clickAwayListener:Nx.oneOfType([Nx.func,Nx.shape({children:Nx.element.isRequired,disableReactTree:Nx.bool,mouseEvent:Nx.oneOf(["onClick","onMouseDown","onMouseUp","onPointerDown","onPointerUp",!1]),onClickAway:Nx.func,touchEvent:Nx.oneOf(["onTouchEnd","onTouchStart",!1])})]),root:Nx.oneOfType([Nx.func,Nx.object])}),slots:Nx.shape({root:Nx.elementType})});var hv=at.memo(pv);const mv=bt((e=>({notify:null,toast:t=>{e({notify:t})},close:()=>{e({notify:null})}}))),fv={entering:"translateX(0)",entered:"translateX(0)",exiting:"translateX(500px)",exited:"translateX(500px)",unmounted:"translateX(500px)"};function gv(){const e=g(),{notify:t,close:n}=mv(),[r,i]=at.useState(!0),o=at.useRef(null),a=null==t?void 0:t.timeout,s=!!t;let l=Os.jsxs("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Os.jsx("circle",{cx:"18",cy:"18",r:"16.5",stroke:"#2FBA90",strokeWidth:"3"}),Os.jsx("path",{d:"M25.1384 11.334L14.8873 21.5851L10.8584 17.5718L8.66504 19.7651L14.8873 25.9873L27.3317 13.5429L25.1384 11.334Z",fill:"#2FBA90"})]});switch(null==t?void 0:t.type){case"error":l=Os.jsxs("svg",{width:"36",height:"37",viewBox:"0 0 36 37",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Os.jsx("circle",{cx:"18",cy:"18.5",r:"16.5",stroke:"#FF6187",strokeWidth:"3"}),Os.jsx("path",{d:"M25.3331 13.0452L19.8782 18.5L25.3331 23.9548L23.5148 25.7731L18.06 20.3183L12.6051 25.7731L10.7869 23.9548L16.2417 18.5L10.7869 13.0452L12.6051 11.2269L18.06 16.6817L23.5148 11.2269L25.3331 13.0452Z",fill:"#FF6187"})]});break;case"warning":l=Os.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.4065 3.6189L9.62438 3.59576L3.39812 9.78928L3.37498 18.5714L9.5685 24.7976L18.3506 24.8208L24.5769 18.6273L24.6 9.84516L18.4065 3.6189ZM26.9359 8.88481L19.3791 1.28812L8.66403 1.25988L1.06734 8.81663L1.0391 19.5317L8.59585 27.1284L19.311 27.1567L26.9076 19.5999L26.9359 8.88481Z",fill:"#B15600"}),Os.jsx("path",{d:"M15.1664 7.58398H12.8331V16.9173H15.1664V7.58398Z",fill:"#B15600"}),Os.jsx("path",{d:"M13.9998 21.6395C14.8896 21.6395 15.6109 20.9181 15.6109 20.0283C15.6109 19.1386 14.8896 18.4172 13.9998 18.4172C13.11 18.4172 12.3887 19.1386 12.3887 20.0283C12.3887 20.9181 13.11 21.6395 13.9998 21.6395Z",fill:"#B15600"})]})}return Os.jsx(f,{component:uv,open:s,autoHideDuration:a,onClose:(e,t)=>{"clickaway"!==t&&n()},exited:r,sx:{position:"fixed",top:20,left:20,right:20,zIndex:1,[e.breakpoints.up("tablet")]:{left:"auto"}},children:Os.jsx(Vt,{timeout:{enter:400,exit:400},in:s,appear:!0,unmountOnExit:!0,onEnter:()=>{i(!1)},onExited:()=>{i(!0)},nodeRef:o,children:r=>Os.jsxs(f,{ref:o,sx:{display:"flex",justifyContent:"space-between",p:12,borderRadius:8,backgroundColor:"background.paper",color:"text.primary",border:"solid 1px",borderColor:"border.main",boxShadow:"0px 6px 12px 0px rgba(0, 0, 0, 0.10)",transform:fv[r],transition:"transform 300ms ease",[e.breakpoints.up("tablet")]:{p:20,width:"auto",maxWidth:328}},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",overflow:"hidden"},children:[Os.jsx(f,{sx:{mt:7,"& > svg":{width:28,height:28},[e.breakpoints.up("tablet")]:{"& > svg":{width:36,height:36}}},children:t?l:""}),Os.jsxs(f,{sx:{ml:20},children:[Os.jsx(f,{sx:{typography:"caption"},children:null==t?void 0:t.message}),(null==t?void 0:t.link)?Os.jsxs(f,{component:"a",target:"_blank",rel:"noopener noreferrer",href:t.link.outerLink,sx:{display:"inline-flex",alignItems:"center",typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},children:[t.link.text,Os.jsx(f,{component:"svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",sx:{ml:4,width:18,height:18},children:Os.jsx("path",{d:"M4.22703 13.2122L10.6811 6.75812L4.75206 6.75812L4.75736 5.25729H13.2426V13.7426H11.7471L11.7418 7.81878L5.28769 14.2729L4.22703 13.2122Z",fill:"currentColor"})})]}):"",(null==t?void 0:t.content)?Os.jsx(f,{sx:{mt:4,typography:"body2",color:"text.secondary"},children:t.content}):""]})]}),Os.jsxs(f,{sx:{position:"relative",top:10,ml:12,display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:12,borderStyle:"solid",borderWidth:a?"2.4px":0,borderColor:e.palette.border.main,backgroundColor:a?"transparent":e.palette.background.paperDarkContrast,cursor:"pointer",boxSizing:"border-box",flexShrink:0,[e.breakpoints.up("tablet")]:{ml:28}},onClick:n,children:[a?Os.jsx(hv,{size:24,strokeWidth:"2.4px",time:`${a}ms`,color:e.palette.text.disabled}):"",Os.jsx(f,{component:"svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:16,height:16,border:"none",color:e.palette.text.disabled},children:Os.jsx("g",{children:Os.jsx("path",{d:"M12.8897 4.36345L9.25313 8L12.8897 11.6365L11.6775 12.8487L8.04095 9.21218L4.4044 12.8487L3.19221 11.6365L6.82876 8L3.19221 4.36345L4.4044 3.15127L8.04095 6.78782L11.6775 3.15127L12.8897 4.36345Z",fill:"currentColor"})})})]})]})})})}var yv;function xv(){return xv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xv.apply(null,arguments)}const vv=e=>ot.createElement("svg",xv({width:"33px",height:"33px",viewBox:"0 0 33 33",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),yv||(yv=ot.createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},ot.createElement("g",{transform:"translate(-186.000000, -375.000000)",stroke:"currentColor",strokeWidth:4},ot.createElement("g",{transform:"translate(18.000000, 291.000000)"},ot.createElement("g",{transform:"translate(40.000000, 83.000000)"},ot.createElement("path",{d:"M159,32 C159,15.9837423 146.016258,3 130,3"}))))))),bv=6;function Av(){var e;const t=g();return Os.jsx(f,{sx:{mx:"auto",border:`${bv}px solid ${null===(e=t.palette)||void 0===e?void 0:e.background.input}`,borderRadius:"50%",width:"64px",height:"64px",position:"relative",animation:"loadingRotate 1.1s infinite linear","@keyframes loadingRotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(359deg)"}}},children:Os.jsx(f,{component:vv,sx:{position:"absolute",top:`-${bv}px`,right:`-${bv}px`,color:"primary.main"}})})}function wv({showingDone:e,errorMessage:t}){return g(),t?Os.jsx(f,{component:As.ErrorWarn,sx:{width:64,height:64,color:"error.main"}}):e?Os.jsx(f,{component:As.DoneBorder,sx:{width:64,height:64,color:"success.main"}}):Os.jsx(Av,{})}function kv({showingDone:e,showing:t}){return Os.jsxs(f,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:[Os.jsx(f,{sx:{mt:60},children:e?r._({id:"4xbbt/",message:"{0} confirmed",values:{0:null==t?void 0:t.brief}}):r._({id:"/nzjSF",message:"{0} pending",values:{0:null==t?void 0:t.brief}})}),(null==t?void 0:t.subtitle)?Os.jsx(f,{sx:{mt:20,typography:"body2"},children:null==t?void 0:t.subtitle}):""]})}function Cv({isStarted:t,isEnded:n,tx:r}){const[i,o]=ct(0),{chainId:a}=At(),s=lt((()=>`https://${Qr[a||1]}/tx/${r}`),[r,a]),l=lt((()=>{const e=Math.floor(i/60),t=i%60;return e?`${e}m ${t}s`:`${t}s`}),[i]),d=dt();return st((()=>(t&&(o(0),window.clearInterval(d.current),d.current=window.setInterval((()=>{o((e=>e+1))}),1e3)),()=>{window.clearInterval(d.current)})),[t]),st((()=>{n&&window.clearInterval(d.current)}),[n]),Os.jsxs(f,{sx:{mt:20,pt:20,display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2",color:"text.secondary",border:"solid 1px transparent",borderTopColor:"border.main"},children:[Os.jsxs(f,{children:[Os.jsx(e,{id:"+Jkdiu",message:"Transaction Time:"}),l]}),Os.jsxs(I,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},component:"a",href:s,target:"_blank",rel:"noopener noreferrer",children:[Os.jsx(e,{id:"S3piC2",message:"Tx"}),Os.jsx(f,{component:As.ArrowTopRightBorder,sx:{width:16,height:16,ml:6}})]})]})}function jv(t){var{children:n,executionStatus:i,showSubmitLoadingDialog:o}=t;const a=Ny(Nn(t,["children","executionStatus","showSubmitLoadingDialog"])),{ctxVal:s,showing:l,closeShowing:d,setShowing:c,showingDone:u,errorMessage:p,transactionTx:h}=Object.assign(Object.assign({},a),i),{isMobile:m}=wy(),g=pf((e=>e.noSubmissionDialog)),y=()=>{c((e=>{if(!e)return e;const t=Object.assign({},e);return delete t.submitState,t}))};return Os.jsxs(Uy.Provider,{value:s,children:[n,o&&Os.jsx(yy,{modal:!0,open:!!(null==l?void 0:l.submitState),onClose:y,children:!!l&&Os.jsxs(f,{sx:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:20,p:20,minHeight:208,width:m?"100%":340,textAlign:"center"},children:[Os.jsxs(f,{sx:{textAlign:"center",color:"text.secondary"},children:[l.brief,Os.jsx(f,{component:As.Error,sx:{position:"absolute",top:20,right:20,color:"text.secondary",cursor:"pointer"},onClick:y})]}),"submitted"===l.submitState?Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{component:As.ArrowSubmit,sx:{width:64,height:64}}),Os.jsxs("div",{children:[Os.jsx("div",{children:r._({id:"EcVqOR",message:"{0} Submitted",values:{0:l.brief}})}),l.subtitle&&Os.jsx(f,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:8,color:"text.secondary",typography:"body2"},children:l.subtitle})]}),Os.jsx(T,{variant:T.Variant.outlined,fullWidth:!0,onClick:y,sx:{mt:4},children:Os.jsx(e,{id:"zga9sT",message:"OK"})})]}):Os.jsxs(Os.Fragment,{children:[Os.jsx(Av,{}),Os.jsxs("div",{children:[Os.jsx(f,{children:Os.jsx(e,{id:"7y/8M6",message:"Please confirm in wallet"})}),l.subtitle&&Os.jsx(f,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:8,color:"text.secondary",typography:"body2"},children:l.subtitle})]})]})]})}),Os.jsx(yy,{open:!!l&&"loading"!==l.submitState&&!g,onClose:d,id:"submission",children:Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",px:20,pb:20,flex:1,overflowY:"auto"},children:[Os.jsxs(f,{children:[Os.jsx(f,{sx:{textAlign:"center",pt:60},children:Os.jsx(wv,{showingDone:u,errorMessage:p})}),p?Os.jsxs(f,{sx:{textAlign:"center",mt:60},children:[Os.jsx(f,{children:Os.jsx(e,{id:"kf83Ld",message:"Something went wrong."})}),Os.jsx(f,{sx:{color:"text.secondary",mt:12,typography:"body2",wordBreak:"break-all"},children:p})]}):Os.jsxs(Os.Fragment,{children:[Os.jsx(kv,{showingDone:u,showing:l}),Os.jsx(Cv,{isStarted:!!l,isEnded:u,tx:h})]})]}),Os.jsx(T,{fullWidth:!0,size:T.Size.big,onClick:()=>{xf(gf.Initial),d()},sx:{mt:20},children:p?Os.jsx(e,{id:"1QfxQT",message:"Dismiss"}):Os.jsx(e,{id:"yz7wBu",message:"Close"})})]})})]})}function Tv(e){const{getStaticJsonRpcProviderByChainId:t}=pf();return at.useMemo((()=>{const n=new nt({multiCallAddressList:je,getProvider:t,rpc:zr()});return e&&(Te(n),he(n)),n}),[t,e])}const Ev="dodo-widget-container";function Sv(e){return e.noLangProvider?Os.jsx(Os.Fragment,{children:e.children}):Os.jsx(tx,{locale:e.locale,children:Os.jsx(jv,{...e,children:e.children})})}function Iv(e){_c(e),wf(),Tv(!0);const{provider:t,connector:n,chainId:r,account:i}=At(),{autoConnectLoading:o}=yf();st((()=>{if(void 0===o)if(e.noAutoConnect)vf(!1);else{vf(!0);(()=>Fn(this,void 0,void 0,(function*(){const t=e.defaultChainId;try{(null==n?void 0:n.connectEagerly)?yield n.connectEagerly(t):yield n.activate(t)}finally{vf(!1)}})))()}}),[n,e.noAutoConnect]),st((()=>{e.setDisconnectConnectFC&&e.setDisconnectConnectFC((()=>{n.deactivate?n.deactivate():n.resetState()}))}),[e.setDisconnectConnectFC]),st((()=>{Ka.setGetConfigProvider((n=>{const i=r===n?t:null;if(i)return i;if(e.getStaticJsonRpcProviderByChainId){const t=e.getStaticJsonRpcProviderByChainId(n);if(t)return t}return null}))}),[t,e.getStaticJsonRpcProviderByChainId]),st((()=>{e.onAccountChanged&&e.onAccountChanged(i)}),[i]),st((()=>{e.onProviderChanged&&e.onProviderChanged(t);const r=null==t?void 0:t.provider,i=()=>Fn(this,void 0,void 0,(function*(){vf(!0);try{(null==n?void 0:n.connectEagerly)?yield n.connectEagerly():yield n.activate()}finally{vf(!1)}}));return(null==r?void 0:r.on)&&r.on("chainChanged",i),()=>{(null==r?void 0:r.removeListener)&&r.removeListener("chainChanged",i)}}),[t]);const a=e.width||375,s=e.height||494,{widgetRef:l}=pf();return e.noUI?Os.jsx(Sv,{...e,children:e.children}):Os.jsx(Sv,{...e,children:Os.jsxs(f,{sx:{width:a,height:s,overflow:"hidden",position:"relative",display:"flex",flexDirection:"column",minWidth:335,minHeight:494,borderRadius:16,backgroundColor:"background.paper"},className:Ev,ref:l,children:[Os.jsx(hx,{}),e.children]})})}function Rv(e){const{fromTokenChainId:t}=yf(),n=lt((()=>{var n;return null!==(n=null!=t?t:e.defaultChainId)&&void 0!==n?n:1}),[e.defaultChainId,t]),{connectors:r,key:i}=lf({provider:e.provider,jsonRpcUrlMap:e.jsonRpcUrlMap,defaultChainId:n});return Os.jsx(kt,{connectors:r,lookupENS:!1,children:Os.jsx(Iv,{...e})},i)}function Lv(e){var t;const n=dt(null);return e.jsonRpcUrlMap&&Ka.setRpc(zr(e.jsonRpcUrlMap)),Os.jsx(uf,{...Object.assign(Object.assign({},e),{widgetRef:null!==(t=e.widgetRef)&&void 0!==t?t:n}),children:Os.jsx(Rv,{...e})})}function Mv(e){const t=R({mode:e.colorMode,theme:e.theme,lang:e.locale||Gy});return e.apikey||e.apiServices||console.error("apikey and apiServices must have a."),Os.jsxs(L,{theme:t,children:[Os.jsx(M,{container:`.${Ev}, .${O}, .${B}`}),Os.jsx(Mt,{client:nx,children:Os.jsxs(Lv,{...e,children:[e.children,Os.jsx(gv,{})]})})]})}function Ov(e){var{sx:t}=e,n=Nn(e,["sx"]);const{width:r}=pf(),i=lt((()=>{let e="";return"number"==typeof r?e=`${r}px`:r&&(e=r),e?`calc(${e} - 40px)`:"auto"}),[r]);return Os.jsx(P,{container:document.querySelector(`.${Ev}`),maxWidth:i,sx:Object.assign({cursor:"help"},t),...n})}function Bv({onClick:e,disabled:t,plus:n,border:r}){const i=g(),o=t||n||!e;return Os.jsx(f,{sx:{width:"100%",position:"relative"},children:Os.jsx(f,{component:y,sx:Object.assign({width:36,height:36,borderRadius:"50%",backgroundColor:i.palette.background.input,border:r?`3px solid ${i.palette.text.primary}`:`4px solid ${i.palette.background.paper}`,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%) rotate(-90deg)",color:"text.secondary"},o?{cursor:"inherit"}:{"&:hover":{color:"text.primary"},"&:focus-visible":{"&::before":{content:'""',position:"absolute",display:"block",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"50%",width:28,height:28,border:"solid 1px",borderColor:"text.primary"}}}),disabled:o,onClick:()=>{o||e&&e()},children:n?Os.jsx(f,{component:As.Plus,sx:{width:18,height:18}}):Os.jsx(f,{component:As.ArrowBack,sx:{width:18,height:18}})})})}const Pv=15,Dv=.2,Nv=50,Fv=20,Wv=3e4,Vv=.5;function Uv({open:t,execute:n,onClose:r,toToken:o,fromToken:a,fromAmount:s,toAmount:l,priceImpact:d,clearFromAmt:c,clearToAmt:u,baseFeeAmount:p,curToFiatPrice:h,curFromFiatPrice:m,pricePerFromToken:x,additionalFeeAmount:v,loading:b,disabledFiatPrice:A,slippage:w}){var k,C;const j=g(),{contractStatus:E}=yf(),S=lt((()=>!A&&new i(d).gt(Pv)),[d,A]),[I,R]=ct(!1),[L,M]=ct(!1);return st((()=>{E!==gf.Pending&&r(),E===gf.TxSuccess&&(u(),c())}),[E]),st((()=>{R(!1)}),[h]),Os.jsx(yy,{open:t,onClose:()=>{xf(gf.Initial),r()},id:"swap-summary",title:Os.jsx(e,{id:"QR4/RH",message:"Swap summary"}),children:Os.jsxs(f,{sx:{margin:20,display:"flex",height:"100%",flexDirection:"column",borderTop:`1px solid ${j.palette.border.main}`},children:[Os.jsxs(f,{sx:{py:20,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexDirection:"column",borderBottom:`1px solid ${j.palette.border.main}`},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[Os.jsx(ey,{width:16,height:16,url:null==a?void 0:a.logoURI,address:null!==(k=null==a?void 0:a.address)&&void 0!==k?k:"",marginRight:6}),Os.jsx(f,{children:`${An({input:s,decimals:null==a?void 0:a.decimals})} ${null==a?void 0:a.symbol}`})]}),!A&&Os.jsx(f,{sx:{mt:4,typography:"h6",color:j.palette.text.secondary},children:m?`$${bn({input:m,showDecimals:1})}`:"-"})]}),Os.jsx(f,{sx:{width:16,mx:16},component:As.DoubleRight}),Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex"},children:[Os.jsx(ey,{width:16,height:16,marginRight:6,url:null==o?void 0:o.logoURI,address:null!==(C=null==o?void 0:o.address)&&void 0!==C?C:""}),Os.jsx(D,{loading:b,loadingProps:{width:30},children:`${An({input:l,decimals:null==o?void 0:o.decimals})} ${null==o?void 0:o.symbol}`})]}),!A&&Os.jsx(D,{loading:b,loadingProps:{width:30},sx:{typography:"h6",mt:4,color:j.palette.text.secondary},children:h?`$${bn({input:h,showDecimals:1})}(${d}%)`:"-"})]})]}),Os.jsxs(f,{sx:{mt:12,display:"flex",alignItems:"center",typography:"h6"},children:[`1 ${null==a?void 0:a.symbol} = `,Os.jsx(D,{loading:b,loadingProps:{width:30},children:An({input:new i(l).dividedBy(new i(s)),decimals:null==o?void 0:o.decimals})})," ",`${null==o?void 0:o.symbol}`]})]}),Os.jsxs(f,{sx:{py:15,typography:"body2",borderBottom:`1px solid ${j.palette.border.main}`},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",color:j.palette.text.secondary},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(f,{sx:{width:16,mr:7},component:As.DetailBorder}),Os.jsx(e,{id:"XeovX3",message:"Swap Detail"})]}),Os.jsx(f,{component:y,children:Os.jsx(f,{onClick:()=>M(!L),sx:{width:10,color:"text.secondary",transform:L?"rotateX(0deg)":"rotateX(180deg)"},component:As.CaretUp})})]}),Os.jsxs(f,{sx:{mt:16,display:L?"initial":"none"},children:[Os.jsxs(f,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(e,{id:"93m8jT",message:"Basic Fee"}),Os.jsx(Ov,{title:Os.jsx(e,{id:"8Z29ZO",message:"Estimated service provider fees"}),ml:5})]}),Os.jsx(D,{loading:b,loadingProps:{width:30},children:p?`${An({input:p,decimals:null==o?void 0:o.decimals})} ${null==o?void 0:o.symbol}`:"0"})]}),Os.jsxs(f,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(e,{id:"J39pAJ",message:"Additional Fee"}),Os.jsx(Ov,{title:Os.jsx(e,{id:"ZXvy7b",message:"Additional routing fees set by the Widget user"}),ml:5})]}),Os.jsx(D,{loading:b,loadingProps:{width:30},children:v?`${An({input:v,decimals:null==o?void 0:o.decimals})} ${null==o?void 0:o.symbol}`:"0"})]}),!A&&Os.jsxs(f,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(e,{id:"T+qgFw",message:"Price Impact"}),Os.jsx(Ov,{title:Os.jsx(e,{id:"4kY4C4",message:"Due to the market condition, market price and estimated price may have a slight difference"}),ml:5})]}),Os.jsx(f,{children:`${d}%`})]}),Os.jsxs(f,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(e,{id:"CMHmbm",message:"Slippage"}),Os.jsx(Ov,{title:Os.jsx(e,{id:"GAypnX",message:"High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:5})]}),Os.jsxs(f,{children:[w,"%"]})]})]})]}),Os.jsx(f,{sx:{flex:1}}),S&&Os.jsxs(f,{sx:{mb:14,display:"flex",cursor:"pointer",justifyContent:"center",alignItems:"center",typography:"h6"},onClick:()=>R(!I),children:[Os.jsx(f,{sx:{mr:4,width:18,height:18,alignItems:"center"},children:I?Os.jsx(f,{sx:{width:"100%",height:"100%",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"secondary.main"},children:Os.jsx(f,{component:As.Done,sx:{width:14,color:"secondary.contrastText"}})}):Os.jsx(f,{sx:{width:"100%",height:"100%",borderRadius:4,border:`1px solid ${j.palette.text.secondary}`}})}),Os.jsx(f,{children:Os.jsx(e,{components:{0:Os.jsx(f,{component:"span",sx:{color:"error.main"}})},values:{priceImpact:d},id:"Price impact reaches <0>{priceImpact}</0>%, accept the quote"})})]}),Os.jsx(T,{isLoading:E==gf.Pending,disabled:S&&!I,fullWidth:!0,onClick:()=>{n(),xf(gf.Pending)},children:E==gf.Pending?Os.jsx(e,{id:"P+K/3O",message:"Confirming"}):Os.jsx(e,{id:"lQ6r7x",message:"Confirm swap"})})]})})}function Hv(e){var{sx:t,maxVal:n,decimals:r=2,onInputChange:i}=e,a=Nn(e,["sx","maxVal","decimals","onInputChange"]);return Os.jsx(v,{...a,onChange:e=>{const t=0===e.target.value.length?null:Cn(e.target.value,r),a=n&&t&&new o(t).gt(n)?n.toString():t;i&&i(a)}})}function qv(e){const{bridgeSlippage:t,swapSlippage:n}=pf(),{autoSlippage:r}=yf();return{defaultSlippage:lt((()=>!(null==r?void 0:r.loading)&&(null==r?void 0:r.value)?r.value:e?null!=t?t:Vv:null!=n?n:Dv),[n,t,e,r]),loading:null==r?void 0:r.loading}}function Zv({open:t,onClose:n,isBridge:r}){const i=g(),{slippage:o}=yf(),a=lt((()=>Number(o)>=Nv),[o]),{defaultSlippage:s}=qv(r);return Os.jsx(yy,{open:t,onClose:n,id:"swap-settings",title:Os.jsx(e,{id:"Tz0i8g",message:"Settings"}),children:Os.jsx(f,{sx:{mx:20},children:Os.jsxs(f,{sx:{py:20,borderTop:`1px solid ${i.palette.border.main}`},children:[Os.jsxs(f,{sx:{mb:16,display:"flex",alignItems:"center"},children:[Os.jsx(e,{id:"lqTDfd",message:"Slippage Tolerance"}),Os.jsx(Ov,{title:Os.jsx(e,{id:"KAmxpM",message:"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:7})]}),Os.jsxs(f,{sx:{display:"flex",flexDirection:"column"},children:[Os.jsx(Hv,{fullWidth:!0,maxVal:100,value:null!=o?o:"",placeholder:s.toString(),onInputChange:e=>{!function(e,t){null===t?localStorage.removeItem(e?lx:sx):localStorage.setItem(e?lx:sx,String(t))}(!!r,e),Af(e)},suffix:Os.jsx(f,{sx:{color:"text.disabled"},children:"%"}),height:36,sx:{mt:12}}),a&&Os.jsx(f,{sx:{typography:"h6",mt:6,color:"error.main"},children:Os.jsx(e,{id:"Zm56FI",message:"Maximum slippage do not exceed 50%"})})]})]})})})}const zv=15e3;function Qv({refetch:e,interval:t}){let n;st((()=>(e(),clearTimeout(n),n=setInterval((()=>{e()}),null!=t?t:zv),()=>clearTimeout(n))),[e])}function Gv(e){const{apiServices:t}=pf();return lt((()=>function(e,t={}){var n,r,i,o,a;switch(e){case Ha.routePrice:return null!==(n=t.routePrice)&&void 0!==n?n:Qa;case Ha.fiatPrice:return null!==(r=t.fiatPrice)&&void 0!==r?r:Ga;case Ha.bridgeRoutePrice:return null!==(i=t.bridgeRoutePrice)&&void 0!==i?i:Ya;case Ha.bridgeEncode:return null!==(o=t.bridgeEncode)&&void 0!==o?o:Xa;case Ha.bridgeCreateRoute:return null!==(a=t.bridgeCreateRoute)&&void 0!==a?a:Ja;default:throw new Error(`Invalid key = ${e}`)}}(e,t)),[t,e])}function Yv({fromToken:e,toToken:t}){const[n,r]=ct(!0),[i,o]=ct(null),{apikey:a}=pf(),[s,l]=ct(""),[d,c]=ct(""),u=Gv(Ha.fiatPrice),p=ut((()=>{if(!e||!t)return;r(!0),o(null);const n=[e,t];Ut.post(u,{networks:n.map((e=>ys(e.chainId))),addresses:n.map((e=>e.address)),symbols:n.map((e=>e.symbol)),isCache:!0},a?{headers:{apikey:a}}:void 0).then((n=>{var i;r(!1);const o=null===(i=n.data)||void 0===i?void 0:i.data;o&&(l(o.find((t=>t.address===e.address)).price),c(o.find((e=>e.address===t.address)).price))})).catch((e=>{o(e),r(!1),console.error(e)}))}),[e,t,a,u]);return Qv({refetch:p}),{loading:n,isLoading:n,refetch:p,error:i,toFiatPrice:d,fromFiatPrice:s}}const Xv="0x0000000000000000000000000000000000000000",Jv="0x0000000000000000000000000000000000000000";function Kv(e,t){let n;try{n=e()}catch(e){return}const r={getItem:e=>{var t;const r=e=>null===e?null:JSON.parse(e,void 0),i=null!=(t=n.getItem(e))?t:null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,t)=>n.setItem(e,JSON.stringify(t,void 0)),removeItem:e=>n.removeItem(e)};return r}const _v=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>_v(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>_v(t)(e)}}},$v=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),((e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},a=!1;const s=new Set,l=new Set;let d;try{d=o.getStorage()}catch(e){}if(!d)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...e)}),r,i);const c=_v(o.serialize),u=()=>{const e=o.partialize({...r()});let t;const n=c({state:e,version:o.version}).then((e=>d.setItem(o.name,e))).catch((e=>{t=e}));if(t)throw t;return n},p=i.setState;i.setState=(e,t)=>{p(e,t),u()};const h=e(((...e)=>{n(...e),u()}),r,i);let m;const f=()=>{var e;if(!d)return;a=!1,s.forEach((e=>e(r())));const t=(null==(e=o.onRehydrateStorage)?void 0:e.call(o,r()))||void 0;return _v(d.getItem.bind(d))(o.name).then((e=>{if(e)return o.deserialize(e)})).then((e=>{if(e){if("number"!=typeof e.version||e.version===o.version)return e.state;if(o.migrate)return o.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((e=>{var t;return m=o.merge(e,null!=(t=r())?t:h),n(m,!0),u()})).then((()=>{null==t||t(m,void 0),a=!0,l.forEach((e=>e(m)))})).catch((e=>{null==t||t(void 0,e)}))};return i.persist={setOptions:e=>{o={...o,...e},e.getStorage&&(d=e.getStorage())},clearStorage:()=>{null==d||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>f(),hasHydrated:()=>a,onHydrate:e=>(s.add(e),()=>{s.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},f(),m||h})(e,t)):((e,t)=>(n,r,i)=>{let o={storage:Kv((()=>localStorage)),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},a=!1;const s=new Set,l=new Set;let d=o.storage;if(!d)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...e)}),r,i);const c=()=>{const e=o.partialize({...r()});return d.setItem(o.name,{state:e,version:o.version})},u=i.setState;i.setState=(e,t)=>{u(e,t),c()};const p=e(((...e)=>{n(...e),c()}),r,i);let h;i.getInitialState=()=>p;const m=()=>{var e,t;if(!d)return;a=!1,s.forEach((e=>{var t;return e(null!=(t=r())?t:p)}));const i=(null==(t=o.onRehydrateStorage)?void 0:t.call(o,null!=(e=r())?e:p))||void 0;return _v(d.getItem.bind(d))(o.name).then((e=>{if(e){if("number"!=typeof e.version||e.version===o.version)return[!1,e.state];if(o.migrate)return[!0,o.migrate(e.state,e.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]})).then((e=>{var t;const[i,a]=e;if(h=o.merge(a,null!=(t=r())?t:p),n(h,!0),i)return c()})).then((()=>{null==i||i(h,void 0),h=r(),a=!0,l.forEach((e=>e(h)))})).catch((e=>{null==i||i(void 0,e)}))};return i.persist={setOptions:e=>{o={...o,...e},e.storage&&(d=e.storage)},clearStorage:()=>{null==d||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>a,onHydrate:e=>(s.add(e),()=>{s.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},o.skipHydration||m(),h||p})(e,t),eb=bt($v((e=>({slippageAdvanced:!1,notRemindAgainSlippageHigher:!1,notRemindAgainSlippageLower:!1,customSwapPairSlippages:[],ddl:String(Fv),expertMode:!1,disableIndirectRouting:!1})),{name:"swap-setting-storage",storage:Kv((()=>localStorage))}));var tb,nb,rb,ib;function ob({toToken:e,fromToken:t,fromAmount:n,toAmount:i,marginAmount:o,estimateGas:a,isReverseRouting:s,slippage:l,slippageLoading:d}){const{account:c,chainId:u,provider:p}=At(),{defaultChainId:h,feeRate:m,rebateTo:f,apikey:g}=pf(),y=lt((()=>(null==t?void 0:t.chainId)||u||h),[u,t,h]),x=eb((e=>Number(e.ddl))),v=eb((e=>Number(e.disableIndirectRouting))),b=dt(0),[A,w]=ct(tb.Initial),[k,C]=ct(null),j=Gv(Ha.routePrice),T=ut((()=>{C(null)}),[k]);st((()=>{T()}),[t,e]);const E=ut((()=>Fn(this,void 0,void 0,(function*(){if(!y||!t||!e||t.chainId!==e.chainId||!s&&!n||s&&!i)return void w(tb.Initial);b.current=b.current+1;const r=b.current;w(tb.Loading);const o=Math.floor(Date.now()/1e3)+60*x,d={chainId:y,deadLine:o,apikey:g,slippage:l,source:v?"noMaxHops":"dodoV2AndMixWasm",toTokenAddress:e.address,fromTokenAddress:t.address,userAddr:c||Xv,estimateGas:a};s?d.toAmount=re(String(i||1),e.decimals).toString():d.fromAmount=re(String(n||1),t.decimals).toString(),f&&m&&(d.rebateTo=f,d.fee=m);try{const e=yield Ut.get(j,{params:d});if(r<b.current)return;const t=e.data.data;(null==t?void 0:t.resAmount)?(w(tb.Success),C(t)):(w(tb.Failed),C(null))}catch(e){w(tb.Failed),C(null),console.error(e)}}))),[x,c,y,e,m,l,f,t,p,n,i,g,s,j,a,v]);Qv({refetch:E});const S=lt((()=>{const e=s?i:n;return k&&A!==tb.Loading&&e?k:null}),[k,A,s,i,n]),I=function(){const{chainId:e,account:t}=At(),n=Hy(),i=ut((({to:e,data:i,useSource:o,duration:a,ddl:s,gasLimit:l,subtitle:d,value:c,mixpanelProps:u})=>{const p=60*s,h=c;o&&"weth"!==o.toLowerCase()&&l&&l.lt(Wv)&&console.debug("Warning: GasLimit less than the minimum!");const m={from:t,to:e,data:i,value:h,route:o,duration:a,ddlSecRel:p,gasLimit:l};n.execute(r._({id:"vH2C/2",message:"Swap"}),Object.assign({opcode:By.TX},m),{subtitle:d,metadata:{[Ey.swap]:!0},mixpanelProps:u})}),[t,n]);return i}(),R=ut((r=>{if(!S)return;const{resAmount:i,to:o,data:a,useSource:l,duration:d,value:u}=S,p=s?i:n,h=s?n:i;t&&p&&I({to:o,data:a,useSource:l,duration:d,ddl:x,value:u,subtitle:r,mixpanelProps:{from:c,fromTokenAddress:t.address,toTokenAddress:null==e?void 0:e.address,fromAmount:re(String(p||1),t.decimals).toString(),resAmount:h,resPricePerFromToken:s?S.resPricePerToToken:S.resPricePerFromToken,resPricePerToToken:s?S.resPricePerFromToken:S.resPricePerToToken,fromTokenSymbol:t.symbol,toTokenSymbol:null==e?void 0:e.symbol,fromTokenDecimals:t.decimals,toTokenDecimals:null==e?void 0:e.decimals}})}),[x,c,t,n,e,s,S]);return{status:A,rawBrief:S,refetch:E,executeSwap:R,reset:T}}function ab({toToken:t,fromToken:n,priceStatus:r,pricePerToToken:i,pricePerFromToken:o}){const[a,s]=ct("-"),[l,d]=ct(null),[c,u]=ct("-"),[p,h]=ct(null);st((()=>{s(null==n?void 0:n.symbol),u(null==t?void 0:t.symbol),d(i),h(o)}),[n,t,i,o]);const m=ut((()=>{s(c),u(a),d(p),h(l)}),[a,l,c,p]);return Os.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:{[tb.Initial]:"-",[tb.Loading]:Os.jsxs(Os.Fragment,{children:[Os.jsx(x,{sx:{mr:5}}),Os.jsx(e,{id:"JdNn1Y",message:"Fetching best price..."})]}),[tb.Failed]:Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{component:As.Warn,sx:{width:15,mr:5,color:"warning.main"}}),Os.jsx(e,{id:"NVAuTg",message:"Quote not available"})]}),[tb.Success]:Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{sx:{typography:"body2"},children:`1 ${a} = ${bn({input:p,showDecimals:4})} ${c}`}),Os.jsx(f,{component:y,sx:{width:18,height:18,ml:6,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},children:Os.jsx(f,{sx:{width:16,color:"text.secondary"},onClick:m,component:As.Switch})})]})}[r]})}function sb(t){var n,i,o,{chainId:a,includeButton:s}=t,l=Nn(t,["chainId","includeButton"]);const{account:d,chainId:c,connector:u}=At(),{onConnectWalletClick:p,onSwitchChain:h}=pf(),[m,f]=at.useState(!1),g=cx(a),y=void 0!==c&&void 0!==a&&c!==a;return!d||m||void 0===c||a&&a!==c?Os.jsx(Os.Fragment,{children:Os.jsx(T,{...l,isLoading:m,onClick:()=>Fn(this,void 0,void 0,(function*(){if(y)return h?(f(!0),yield h(),void f(!1)):g?(f(!0),yield g(),void f(!1)):void yf.setState({openConnectWalletInfo:{chainId:a}});if(p){f(!0);const e=yield p();if(f(!1),e)return}u.deactivate?u.deactivate():u.resetState(),yf.setState({openConnectWalletInfo:!0})})),children:m?Os.jsx(e,{id:"J28zul",message:"Connecting..."}):y&&a?r._({id:"1+P9RR",message:"Switch to {0}",values:{0:null!==(o=null===(i=_g.get(a))||void 0===i?void 0:i.name)&&void 0!==o?o:"unknown"}}):Os.jsx(e,{id:"r7ScnQ",message:"Connect to a wallet"})})}):s?Os.jsx(Os.Fragment,{children:null!==(n=l.children)&&void 0!==n?n:null}):Os.jsx(T,{...l})}function lb({needSwitchChain:e,border:t}){return Os.jsx(Os.Fragment,{children:Os.jsx(sb,{size:T.Size.middle,fullWidth:!0,"data-testid":ty,chainId:e,sx:t?{borderWidth:3,borderStyle:"solid",borderColor:"text.primary"}:void 0})})}function db(){return db=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},db.apply(null,arguments)}!function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}(tb||(tb={})),function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}(nb||(nb={}));var cb,ub;function pb(){return pb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pb.apply(null,arguments)}var hb,mb;function fb(){return fb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fb.apply(null,arguments)}var gb,yb,xb;function vb(){return vb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vb.apply(null,arguments)}var bb,Ab;function wb(){return wb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wb.apply(null,arguments)}var kb,Cb,jb,Tb;function Eb(){return Eb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Eb.apply(null,arguments)}var Sb,Ib,Rb;function Lb(){return Lb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lb.apply(null,arguments)}var Mb,Ob,Bb,Pb,Db,Nb;function Fb(){return Fb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fb.apply(null,arguments)}var Wb,Vb;function Ub(){return Ub=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ub.apply(null,arguments)}var Hb,qb,Zb,zb,Qb,Gb;function Yb(){return Yb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yb.apply(null,arguments)}var Xb,Jb,Kb;function _b(){return _b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_b.apply(null,arguments)}var $b,eA;function tA(){return tA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tA.apply(null,arguments)}var nA,rA;function iA(){return iA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iA.apply(null,arguments)}var oA,aA;function sA(){return sA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sA.apply(null,arguments)}var lA;function dA(){return dA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dA.apply(null,arguments)}var cA,uA;function pA(){return pA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pA.apply(null,arguments)}const hA=[{id:"cBridge",logoURI:e=>ot.createElement("svg",Lb({width:34,height:34,viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Sb||(Sb=ot.createElement("rect",{x:1,y:1,width:32,height:32,rx:8,fill:"white",stroke:"#33363F"})),Ib||(Ib=ot.createElement("g",{clipPath:"url(#clip0_37_1169)"},ot.createElement("path",{d:"M10.9221 22C13.0882 22 14.8442 21.2006 14.8442 20.2144C14.8442 19.2283 13.0882 18.4288 10.9221 18.4288C8.75599 18.4288 7 19.2283 7 20.2144C7 21.2006 8.75599 22 10.9221 22Z",fill:"#444444"}),ot.createElement("path",{d:"M23.5587 22C25.7248 22 27.4808 21.2006 27.4808 20.2144C27.4808 19.2283 25.7248 18.4288 23.5587 18.4288C21.3926 18.4288 19.6366 19.2283 19.6366 20.2144C19.6366 21.2006 21.3926 22 23.5587 22Z",fill:"#DDDDDD"}),ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.88456 20.2144C9.84901 20.2146 9.81379 20.2076 9.78098 20.1939C9.74818 20.1802 9.71844 20.1601 9.69353 20.1347C9.66862 20.1094 9.64903 20.0793 9.63593 20.0462C9.62283 20.0132 9.61648 19.9779 9.61725 19.9423C9.7509 15.5317 13.1124 12 17.2394 12C21.3663 12 24.7278 15.5317 24.8615 19.9423C24.8622 19.9779 24.8559 20.0132 24.8428 20.0462C24.8297 20.0793 24.8101 20.1094 24.7852 20.1347C24.7603 20.1601 24.7306 20.1802 24.6977 20.1939C24.6649 20.2076 24.6297 20.2146 24.5942 20.2144H22.0874C22.0152 20.2135 21.946 20.1848 21.8943 20.1344C21.8426 20.0839 21.8123 20.0155 21.8096 19.9433C21.6894 17.1106 19.6894 14.8567 17.2403 14.8567C14.7913 14.8567 12.7913 17.1106 12.6711 19.9433C12.6684 20.0155 12.638 20.0839 12.5863 20.1344C12.5346 20.1848 12.4655 20.2135 12.3932 20.2144H9.88456Z",fill:"#FF957E"}))),Rb||(Rb=ot.createElement("defs",null,ot.createElement("clipPath",{id:"clip0_37_1169"},ot.createElement("rect",{width:20.4808,height:10,fill:"white",transform:"translate(7 12)"}))))),name:"cBridge"},{id:"stargate",logoURI:e=>ot.createElement("svg",Yb({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Hb||(Hb=ot.createElement("path",{d:"M0.5 8C0.5 3.85786 3.85786 0.5 8 0.5H24C28.1421 0.5 31.5 3.85786 31.5 8V24C31.5 28.1421 28.1421 31.5 24 31.5H8C3.85786 31.5 0.5 28.1421 0.5 24V8Z",fill:"black",stroke:"black"})),qb||(qb=ot.createElement("path",{d:"M17.5867 8.63649L18.0125 9.63382C18.8482 11.592 20.4079 13.1518 22.3662 13.9875L23.3635 14.4133C23.6245 14.5246 23.8365 14.6842 24 14.8743C23.5033 11.3132 20.6868 8.49629 17.1257 8C17.3154 8.16317 17.4754 8.37546 17.5867 8.63649Z",fill:"#999999"})),Zb||(Zb=ot.createElement("path",{d:"M8.63649 14.4133L9.63382 13.9875C11.592 13.1518 13.1518 11.592 13.9879 9.63382L14.4133 8.63649C14.525 8.37546 14.6846 8.16317 14.8743 8C11.3132 8.49629 8.49667 11.3132 8 14.8743C8.16357 14.6842 8.37548 14.5246 8.63649 14.4133Z",fill:"#999999"})),zb||(zb=ot.createElement("path",{d:"M23.3635 17.5863L22.3662 18.0121C20.4079 18.8479 18.8482 20.408 18.0125 22.3662L17.5867 23.3632C17.4754 23.6242 17.3154 23.8365 17.1257 24C20.6868 23.5034 23.5033 20.6865 24 17.1253C23.8365 17.3154 23.6245 17.475 23.3635 17.5863Z",fill:"#999999"})),Qb||(Qb=ot.createElement("path",{d:"M14.4133 23.3632L13.9879 22.3662C13.1518 20.408 11.592 18.8479 9.63382 18.0121L8.63649 17.5863C8.37548 17.475 8.16357 17.3154 8 17.1253C8.49667 20.6865 11.3132 23.5034 14.8743 24C14.6846 23.8365 14.525 23.6242 14.4133 23.3632Z",fill:"#999999"})),Gb||(Gb=ot.createElement("path",{d:"M12.3715 15.2177L12.863 15.0078C13.8278 14.5959 14.5966 13.8275 15.0086 12.8626L15.2181 12.3711C15.512 11.6827 16.4879 11.6827 16.7818 12.3711L16.9913 12.8626C17.4032 13.8275 18.172 14.5959 19.1369 15.0078L19.6284 15.2177C20.3168 15.5116 20.3168 16.4872 19.6284 16.7811L19.1369 16.991C18.172 17.4029 17.4032 18.1713 16.9913 19.1366L16.7818 19.6276C16.4879 20.3161 15.512 20.3161 15.2181 19.6276L15.0086 19.1366C14.5966 18.1713 13.8278 17.4029 12.863 16.991L12.3715 16.7811C11.6831 16.4872 11.6831 15.5116 12.3715 15.2177Z",fill:"#F2F2F2"}))),name:"Stargate"},{id:"connext",logoURI:e=>ot.createElement("svg",Fb({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Mb||(Mb=ot.createElement("rect",{width:32,height:32,rx:8,fill:"black"})),Ob||(Ob=ot.createElement("path",{d:"M13.0566 9.12524C13.0566 9.12524 12.31 9.87191 11.4353 10.7466L7.90996 14.2399C6.46996 15.7066 7.0353 17.1999 8.03796 18.2026L10.918 21.0826C11.174 21.3386 12.1766 22.3946 12.9766 21.5732C13.4406 21.1092 13.3393 20.3892 13.078 20.1066L9.76063 16.8159C9.16863 16.2239 9.4513 15.6852 10.0433 15.1199L12.8753 12.2879L14.6513 14.0639C15.27 14.6826 16.038 14.9119 16.6833 14.2719C17.3286 13.6266 16.9393 13.0132 16.3206 12.3946L14.3633 10.4372L13.0566 9.12524Z",fill:"url(#paint0_linear_5431_181414)"})),Bb||(Bb=ot.createElement("path",{d:"M13.2112 9.25332C12.7472 8.78932 12.0805 8.53332 11.4352 9.17865C10.7898 9.82399 11.1258 10.544 11.5365 10.9547",fill:"url(#paint1_linear_5431_181414)"})),Pb||(Pb=ot.createElement("path",{d:"M18.9218 22.8638C18.9218 22.8638 19.6685 22.1171 20.5432 21.2424L24.0685 17.7171C25.5352 16.2504 24.9698 14.7571 23.9405 13.7544L21.0605 10.9011C20.8045 10.6451 19.8018 9.5891 19.0018 10.4104C18.5378 10.8744 18.6392 11.5944 18.9005 11.8771L22.2178 15.1678C22.8098 15.7598 22.5272 16.2984 21.9352 16.8638L19.1032 19.6958L17.3272 17.9198C16.7085 17.3011 15.9405 17.0718 15.2952 17.7118C14.6498 18.3518 15.0392 18.9704 15.6578 19.5891L17.6152 21.5464L18.9218 22.8638Z",fill:"url(#paint2_linear_5431_181414)"})),Db||(Db=ot.createElement("path",{d:"M18.7671 22.7306C19.2311 23.1946 19.8978 23.4772 20.5431 22.8319C21.1884 22.1866 20.8524 21.4666 20.4418 21.0559",fill:"url(#paint3_linear_5431_181414)"})),Nb||(Nb=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_5431_181414",x1:7.86029,y1:12.5047,x2:23.8117,y2:22.7959,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#29C1FC"}),ot.createElement("stop",{offset:.5022,stopColor:"#AB00FF"}),ot.createElement("stop",{offset:.5082,stopColor:"#AC03FC"}),ot.createElement("stop",{offset:.6406,stopColor:"#C840B8"}),ot.createElement("stop",{offset:.7601,stopColor:"#DE7082"}),ot.createElement("stop",{offset:.8629,stopColor:"#EE935B"}),ot.createElement("stop",{offset:.9448,stopColor:"#F7A844"}),ot.createElement("stop",{offset:.9956,stopColor:"#FBB03B"})),ot.createElement("linearGradient",{id:"paint1_linear_5431_181414",x1:10.2949,y1:8.73084,x2:26.2463,y2:19.0221,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#29C1FC"}),ot.createElement("stop",{offset:.5022,stopColor:"#AB00FF"}),ot.createElement("stop",{offset:.5082,stopColor:"#AC03FC"}),ot.createElement("stop",{offset:.6406,stopColor:"#C840B8"}),ot.createElement("stop",{offset:.7601,stopColor:"#DE7082"}),ot.createElement("stop",{offset:.8629,stopColor:"#EE935B"}),ot.createElement("stop",{offset:.9448,stopColor:"#F7A844"}),ot.createElement("stop",{offset:.9956,stopColor:"#FBB03B"})),ot.createElement("linearGradient",{id:"paint2_linear_5431_181414",x1:9.46092,y1:10.0213,x2:25.4123,y2:20.3125,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#29C1FC"}),ot.createElement("stop",{offset:.5022,stopColor:"#AB00FF"}),ot.createElement("stop",{offset:.5082,stopColor:"#AC03FC"}),ot.createElement("stop",{offset:.6406,stopColor:"#C840B8"}),ot.createElement("stop",{offset:.7601,stopColor:"#DE7082"}),ot.createElement("stop",{offset:.8629,stopColor:"#EE935B"}),ot.createElement("stop",{offset:.9448,stopColor:"#F7A844"}),ot.createElement("stop",{offset:.9956,stopColor:"#FBB03B"})),ot.createElement("linearGradient",{id:"paint3_linear_5431_181414",x1:7.01942,y1:13.8057,x2:22.9708,y2:24.0969,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#29C1FC"}),ot.createElement("stop",{offset:.5022,stopColor:"#AB00FF"}),ot.createElement("stop",{offset:.5082,stopColor:"#AC03FC"}),ot.createElement("stop",{offset:.6406,stopColor:"#C840B8"}),ot.createElement("stop",{offset:.7601,stopColor:"#DE7082"}),ot.createElement("stop",{offset:.8629,stopColor:"#EE935B"}),ot.createElement("stop",{offset:.9448,stopColor:"#F7A844"}),ot.createElement("stop",{offset:.9956,stopColor:"#FBB03B"}))))),name:"Connext"},{id:"synapse",logoURI:e=>ot.createElement("svg",_b({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ot.createElement("mask",{id:"mask0_419_48383",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:32,height:32},Xb||(Xb=ot.createElement("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H24C28.4183 0 32 3.58172 32 8V24C32 28.4183 28.4183 32 24 32H8C3.58172 32 0 28.4183 0 24V8Z",fill:"black"}))),Jb||(Jb=ot.createElement("g",{mask:"url(#mask0_419_48383)"},ot.createElement("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H24C28.4183 0 32 3.58172 32 8V24C32 28.4183 28.4183 32 24 32H8C3.58172 32 0 28.4183 0 24V8Z",fill:"#121826"}),ot.createElement("path",{d:"M15.9794 7C15.5251 7 15.1568 7.36058 15.1568 7.80538C15.1568 8.25017 15.5251 8.61075 15.9794 8.61075C16.4337 8.61075 16.802 8.25017 16.802 7.80538C16.802 7.36058 16.4337 7 15.9794 7Z",fill:"url(#paint0_radial_419_48383)"}),ot.createElement("path",{d:"M15.9794 7.44297C16.1839 7.44297 16.3496 7.60522 16.3496 7.80537C16.3496 8.00551 16.1839 8.16776 15.9794 8.16776C15.775 8.16776 15.6093 8.00551 15.6093 7.80537C15.6093 7.60522 15.775 7.44293 15.9794 7.44293V7.44297ZM12.4422 9.13423C11.9879 9.13423 11.6196 9.49481 11.6196 9.93961C11.6196 10.3844 11.9878 10.7449 12.4422 10.7449C12.8965 10.7449 13.2648 10.3844 13.2648 9.93961C13.2648 9.49481 12.8965 9.13423 12.4422 9.13423ZM19.599 9.17448C19.1446 9.17448 18.7764 9.53506 18.7764 9.97986C18.7764 10.4247 19.1446 10.7852 19.599 10.7852C20.0533 10.7852 20.4216 10.4247 20.4216 9.97986C20.4216 9.53506 20.0533 9.17448 19.599 9.17448V9.17448Z",fill:"url(#paint1_radial_419_48383)"}),ot.createElement("path",{d:"M12.4422 9.57715C12.6466 9.57715 12.8124 9.7394 12.8124 9.93958C12.8124 10.1397 12.6466 10.302 12.4422 10.302C12.2377 10.302 12.072 10.1397 12.072 9.93958C12.072 9.7394 12.2377 9.57715 12.4422 9.57715ZM19.599 9.6174C19.8034 9.6174 19.9691 9.77965 19.9691 9.97984C19.9691 10.18 19.8034 10.3422 19.599 10.3422C19.3945 10.3422 19.2288 10.18 19.2288 9.97984C19.2288 9.77969 19.3945 9.6174 19.599 9.6174V9.6174ZM15.9794 10.9866C15.457 10.9866 15.0334 11.4012 15.0334 11.9127C15.0334 12.4242 15.457 12.8389 15.9794 12.8389C16.5019 12.8389 16.9255 12.4242 16.9255 11.9127C16.9255 11.4012 16.5019 10.9866 15.9794 10.9866ZM8.8226 11.1074C8.3683 11.1074 8 11.4679 8 11.9127C8 12.3575 8.3683 12.7181 8.8226 12.7181C9.27695 12.7181 9.64525 12.3575 9.64525 11.9127C9.64525 11.4679 9.27695 11.1074 8.8226 11.1074ZM23.1774 11.1074C22.723 11.1074 22.3548 11.4679 22.3548 11.9127C22.3548 12.3575 22.723 12.7181 23.1774 12.7181C23.6317 12.7181 24 12.3575 24 11.9127C24 11.4679 23.6317 11.1074 23.1774 11.1074V11.1074Z",fill:"url(#paint2_radial_419_48383)"}),ot.createElement("path",{d:"M15.9794 11.4295C16.252 11.4295 16.473 11.6458 16.473 11.9127C16.473 12.1796 16.252 12.3959 15.9794 12.3959C15.7068 12.3959 15.4859 12.1796 15.4859 11.9127C15.4859 11.6458 15.7068 11.4295 15.9794 11.4295V11.4295ZM8.82261 11.5503C9.02706 11.5503 9.19281 11.7126 9.19281 11.9127C9.19281 12.1129 9.02706 12.2751 8.82261 12.2751C8.61817 12.2751 8.45245 12.1129 8.45245 11.9127C8.45245 11.7126 8.61817 11.5503 8.82261 11.5503V11.5503ZM23.1774 11.5503C23.3818 11.5503 23.5476 11.7126 23.5476 11.9127C23.5476 12.1129 23.3818 12.2751 23.1774 12.2751C22.973 12.2751 22.8072 12.1129 22.8072 11.9127C22.8072 11.7126 22.973 11.5503 23.1774 11.5503ZM12.3188 13C11.7963 13 11.3727 13.4146 11.3727 13.9261C11.3727 14.4377 11.7963 14.8523 12.3188 14.8523C12.8412 14.8523 13.2648 14.4377 13.2648 13.9261C13.2648 13.4146 12.8412 13 12.3188 13ZM19.599 13C19.0765 13 18.653 13.4146 18.653 13.9261C18.653 14.4377 19.0765 14.8523 19.599 14.8523C20.1214 14.8523 20.545 14.4377 20.545 13.9261C20.545 13.4146 20.1214 13 19.599 13Z",fill:"url(#paint3_radial_419_48383)"}),ot.createElement("path",{d:"M12.3187 13.443C12.5913 13.443 12.8123 13.6593 12.8123 13.9262C12.8123 14.1931 12.5913 14.4094 12.3187 14.4094C12.0461 14.4094 11.8252 14.1931 11.8252 13.9262C11.8252 13.6593 12.0461 13.443 12.3187 13.443ZM19.599 13.443C19.8715 13.443 20.0925 13.6593 20.0925 13.9262C20.0925 14.1931 19.8715 14.4094 19.599 14.4094C19.3264 14.4094 19.1054 14.1931 19.1054 13.9262C19.1054 13.6593 19.3264 13.443 19.599 13.443Z",fill:"url(#paint4_radial_419_48383)"}),ot.createElement("path",{d:"M8.8226 15.1745C8.3683 15.1745 8 15.5351 8 15.9799C8 16.4247 8.3683 16.7853 8.8226 16.7853C9.27695 16.7853 9.64525 16.4247 9.64525 15.9799C9.64525 15.5351 9.27695 15.1745 8.8226 15.1745ZM23.1774 15.1745C22.723 15.1745 22.3548 15.5351 22.3548 15.9799C22.3548 16.4247 22.723 16.7853 23.1774 16.7853C23.6317 16.7853 24 16.4247 24 15.9799C24 15.5351 23.6317 15.1745 23.1774 15.1745ZM16.0206 15.2953C16.4067 15.2953 16.7198 15.6018 16.7198 15.9799C16.7198 16.358 16.4067 16.6645 16.0206 16.6645C15.6344 16.6645 15.3214 16.358 15.3214 15.9799C15.3214 15.6018 15.6344 15.2953 16.0206 15.2953Z",fill:"url(#paint5_radial_419_48383)"}),ot.createElement("path",{d:"M8.82261 15.6174C9.02706 15.6174 9.19281 15.7797 9.19281 15.9798C9.19281 16.18 9.02706 16.3423 8.82261 16.3423C8.61817 16.3423 8.45245 16.18 8.45245 15.9798C8.45245 15.7797 8.61817 15.6174 8.82261 15.6174V15.6174ZM23.1774 15.6174C23.3818 15.6174 23.5476 15.7797 23.5476 15.9798C23.5476 16.18 23.3818 16.3423 23.1774 16.3423C22.973 16.3423 22.8072 16.18 22.8072 15.9798C22.8072 15.7797 22.973 15.6174 23.1774 15.6174ZM12.4422 17.0671C11.9197 17.0671 11.4961 17.4818 11.4961 17.9933C11.4961 18.5048 11.9197 18.9194 12.4422 18.9194C12.9646 18.9194 13.3882 18.5048 13.3882 17.9933C13.3882 17.4818 12.9646 17.0671 12.4422 17.0671V17.0671ZM19.599 17.0671C19.0765 17.0671 18.653 17.4818 18.653 17.9933C18.653 18.5048 19.0765 18.9194 19.599 18.9194C20.1214 18.9194 20.545 18.5048 20.545 17.9933C20.545 17.4818 20.1214 17.0671 19.599 17.0671V17.0671Z",fill:"url(#paint6_radial_419_48383)"}),ot.createElement("path",{d:"M12.4422 17.5101C12.7148 17.5101 12.9357 17.7264 12.9357 17.9933C12.9357 18.2602 12.7148 18.4765 12.4422 18.4765C12.1696 18.4765 11.9486 18.2602 11.9486 17.9933C11.9486 17.7264 12.1696 17.5101 12.4422 17.5101V17.5101ZM19.599 17.5101C19.8716 17.5101 20.0925 17.7264 20.0925 17.9933C20.0925 18.2602 19.8716 18.4765 19.599 18.4765C19.3264 18.4765 19.1054 18.2602 19.1054 17.9933C19.1054 17.7264 19.3264 17.5101 19.599 17.5101V17.5101ZM15.9794 19.0805C15.457 19.0805 15.0334 19.4952 15.0334 20.0067C15.0334 20.5182 15.457 20.9329 15.9794 20.9329C16.5019 20.9329 16.9255 20.5182 16.9255 20.0067C16.9255 19.4952 16.5019 19.0805 15.9794 19.0805ZM8.8226 19.2416C8.3683 19.2416 8 19.6022 8 20.047C8 20.4918 8.3683 20.8524 8.8226 20.8524C9.27695 20.8524 9.64525 20.4918 9.64525 20.047C9.64525 19.6022 9.27695 19.2416 8.8226 19.2416ZM23.1774 19.2416C22.723 19.2416 22.3548 19.6022 22.3548 20.047C22.3548 20.4918 22.723 20.8524 23.1774 20.8524C23.6317 20.8524 24 20.4918 24 20.047C24 19.6022 23.6317 19.2416 23.1774 19.2416Z",fill:"url(#paint7_radial_419_48383)"}),ot.createElement("path",{d:"M15.9794 19.5235C16.252 19.5235 16.473 19.7398 16.473 20.0067C16.473 20.2736 16.252 20.4899 15.9794 20.4899C15.7068 20.4899 15.4859 20.2736 15.4859 20.0067C15.4859 19.7398 15.7068 19.5235 15.9794 19.5235ZM8.82261 19.6845C9.02706 19.6845 9.19281 19.8468 9.19281 20.047C9.19281 20.2471 9.02706 20.4094 8.82261 20.4094C8.61817 20.4094 8.45245 20.2471 8.45245 20.047C8.45245 19.8468 8.61817 19.6845 8.82261 19.6845V19.6845ZM23.1774 19.6845C23.3818 19.6845 23.5476 19.8468 23.5476 20.047C23.5476 20.2471 23.3818 20.4094 23.1774 20.4094C22.973 20.4094 22.8072 20.2471 22.8072 20.047C22.8072 19.8468 22.973 19.6845 23.1774 19.6845ZM12.4422 21.255C11.9879 21.255 11.6196 21.6156 11.6196 22.0604C11.6196 22.5052 11.9878 22.8658 12.4422 22.8658C12.8965 22.8658 13.2648 22.5052 13.2648 22.0604C13.2648 21.6156 12.8965 21.255 12.4422 21.255ZM19.599 21.2953C19.1446 21.2953 18.7763 21.6559 18.7763 22.1007C18.7763 22.5455 19.1446 22.9061 19.599 22.9061C20.0533 22.9061 20.4216 22.5455 20.4216 22.1007C20.4216 21.6559 20.0533 21.2953 19.599 21.2953Z",fill:"url(#paint8_radial_419_48383)"}),ot.createElement("path",{d:"M12.4422 21.698C12.6466 21.698 12.8124 21.8602 12.8124 22.0604C12.8124 22.2606 12.6466 22.4228 12.4422 22.4228C12.2377 22.4228 12.072 22.2606 12.072 22.0604C12.072 21.8602 12.2377 21.698 12.4422 21.698ZM19.599 21.7383C19.8035 21.7383 19.9692 21.9005 19.9692 22.1007C19.9692 22.3008 19.8035 22.4631 19.599 22.4631C19.3946 22.4631 19.2288 22.3008 19.2288 22.1007C19.2288 21.9005 19.3946 21.7383 19.599 21.7383ZM15.9795 23.3893C15.5251 23.3893 15.1568 23.7498 15.1568 24.1946C15.1568 24.6394 15.5251 25 15.9795 25C16.4338 25 16.8021 24.6394 16.8021 24.1946C16.8021 23.7498 16.4338 23.3893 15.9795 23.3893V23.3893Z",fill:"url(#paint9_radial_419_48383)"}),ot.createElement("path",{d:"M15.9794 23.8322C16.1838 23.8322 16.3496 23.9945 16.3496 24.1946C16.3496 24.3948 16.1838 24.5571 15.9794 24.5571C15.775 24.5571 15.6092 24.3948 15.6092 24.1946C15.6092 23.9945 15.775 23.8322 15.9794 23.8322ZM19.2699 13.7972L16.3496 15.5288L16.5848 15.9075L19.5051 14.176L19.2699 13.7972V13.7972ZM12.6761 13.7576L12.4331 14.1313L15.3945 15.9837L15.6375 15.6099L12.6761 13.7576V13.7576ZM11.8843 13.9551L9.16962 15.6061L9.40873 15.9824L12.1234 14.3314L11.8843 13.9551ZM22.9113 15.8855L19.9909 17.617L20.2262 17.9958L23.1465 16.2643L22.9113 15.8855ZM15.5077 16.0466L12.5874 17.7781L12.8226 18.1569L15.7429 16.4254L15.5077 16.0466V16.0466ZM16.5437 15.9944L16.3007 16.3681L19.2622 18.2205L19.5051 17.8467L16.5437 15.9944V15.9944Z",fill:"url(#paint10_radial_419_48383)"}),ot.createElement("path",{d:"M20.0758 13.8205L19.8328 14.1942L22.7943 16.0466L23.0373 15.6728L20.0758 13.8205ZM9.16191 15.9308L8.91895 16.3045L11.8804 18.1569L12.1234 17.7832L9.16191 15.9308V15.9308Z",fill:"url(#paint11_radial_419_48383)"}))),Kb||(Kb=ot.createElement("defs",null,ot.createElement("radialGradient",{id:"paint0_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(15.9999 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint1_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint2_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint3_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint4_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(15.9999 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint5_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint6_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint7_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint8_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint9_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint10_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(15.9999 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"})),ot.createElement("radialGradient",{id:"paint11_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(15.9999 16.0001) scale(7.99998 7.83228)"},ot.createElement("stop",{stopColor:"#FF00FF"}),ot.createElement("stop",{offset:1,stopColor:"#734CE2"}))))),name:"Synapse"},{id:"swft",logoURI:e=>ot.createElement("svg",Eb({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),kb||(kb=ot.createElement("path",{d:"M14.0802 2.71222C14.0802 2.71222 12.9826 1.61464 11.6884 1.51537C10.3941 1.4161 9.89405 1.81505 9.99332 2.214C10.0926 2.61295 10.5421 2.66165 11.1396 2.2627C11.7371 1.86375 13.0332 1.96489 14.0802 2.71222Z",fill:"#0999FF"})),Cb||(Cb=ot.createElement("path",{d:"M13.5408 2.87517C13.5408 2.87517 12.668 2.33013 11.8176 2.45936C10.9673 2.5886 10.6938 2.92012 10.8268 3.16174C10.9598 3.40336 11.2482 3.36964 11.576 3.02314C11.9038 2.67663 12.7523 2.54927 13.5408 2.87517Z",fill:"#0999FF"})),jb||(jb=ot.createElement("path",{d:"M12.2597 2.99879C12.6341 2.88498 13.0346 2.89022 13.4059 3.01377C12.8628 2.91825 12.3439 3.13364 12.1866 3.39399C12.0293 3.65434 11.8476 3.71615 11.7352 3.58129C11.6228 3.44644 11.7408 3.1992 12.2597 2.99879Z",fill:"#0999FF"})),Tb||(Tb=ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.7592 6.10048C17.8075 5.65096 17.1089 5.82703 16.1218 6.25033C15.425 6.5575 15.6236 7.84238 16.0225 8.93996C16.4215 10.0375 17.2194 13.8248 15.425 15.8176C13.9914 17.4099 12.8137 17.6032 10.5679 17.972C10.0027 18.0648 9.36998 18.1687 8.6485 18.3087C5.05982 19.0055 4.86128 21.697 4.86128 21.697C3.17126 12.5314 7.83234 10.1212 10.1284 8.93399C10.4049 8.79097 10.6472 8.6657 10.8399 8.5485C11.9352 7.87375 12.0384 6.61486 12.0958 5.91511C12.1082 5.7641 12.1184 5.63913 12.136 5.55169C12.1467 5.49883 12.1573 5.4355 12.1694 5.36375C12.2698 4.76704 12.4681 3.58853 13.5783 3.01003C16.9703 1.41797 19.7592 6.10048 19.7592 6.10048ZM10.8009 15.8525C11.5854 15.8693 12.9238 15.898 13.6045 14.5964C14.3724 13.1261 13.5221 11.8075 12.3084 11.3917C11.0946 10.9759 9.25161 11.5509 8.04352 13.2366C6.83543 14.9223 6.68934 16.9826 6.68934 16.9826C6.7545 16.9197 6.81451 16.8522 6.87696 16.782C7.13404 16.4929 7.4325 16.1574 8.302 15.8982C8.96656 15.7001 9.67011 15.7718 10.1431 15.82C10.3006 15.836 10.4326 15.8495 10.529 15.8495C10.6088 15.8484 10.7003 15.8504 10.8009 15.8525ZM18.5642 5.503C18.5642 5.503 16.62 5.24639 15.8727 5.9956C15.8727 5.9956 16.472 4.30989 18.5642 5.503Z",fill:"#0999FF"}))),name:"Swft"},{id:"hyphen",logoURI:e=>ot.createElement("svg",fb({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),hb||(hb=ot.createElement("path",{d:"M10.2675 16.7858V15.0715C10.2675 14.5915 10.6618 14.2143 11.1247 14.2143H12.839C13.319 14.2143 13.6961 14.5915 13.6961 15.0715V20.2143C13.6961 20.6943 13.319 21.0715 12.839 21.0715H4.26755C3.78755 21.0715 3.4104 20.6943 3.4104 20.2143V8.21433C3.4104 7.73433 3.03326 7.35719 2.55326 7.35719H2.05612C1.30183 7.35719 0.907546 6.43148 1.45612 5.90005L4.52469 2.81433C4.60378 2.73295 4.69838 2.66825 4.80291 2.62407C4.90745 2.57989 5.01978 2.55713 5.13326 2.55713C5.24674 2.55713 5.35908 2.57989 5.46361 2.62407C5.56814 2.66825 5.66275 2.73295 5.74183 2.81433L8.79326 5.90005C9.34183 6.43148 8.96469 7.35719 8.19326 7.35719H7.69612C7.21612 7.35719 6.83897 7.73433 6.83897 8.21433V16.7858C6.83897 17.2658 7.21612 17.6429 7.69612 17.6429H9.4104C9.8904 17.6429 10.2675 17.2658 10.2675 16.7858Z",fill:"#615CCD"})),mb||(mb=ot.createElement("path",{d:"M20.5533 16.7858C20.5533 17.2658 20.9304 17.6429 21.4104 17.6429H21.9247C22.679 17.6429 23.0561 18.5686 22.5247 19.1001L19.4561 22.1686C19.1133 22.5115 18.5818 22.5115 18.239 22.1686L15.1704 19.1001C14.6218 18.5686 14.999 17.6429 15.7704 17.6429H16.2676C16.7476 17.6429 17.1247 17.2658 17.1247 16.7858V8.21436C17.1247 7.73436 16.7476 7.35721 16.2676 7.35721H14.5533C14.0733 7.35721 13.6961 7.73436 13.6961 8.21436V9.92864C13.6961 10.4086 13.319 10.7858 12.839 10.7858H11.1247C10.6447 10.7858 10.2676 10.4086 10.2676 9.92864V4.78578C10.2676 4.30578 10.6447 3.92864 11.1247 3.92864H19.6961C20.1761 3.92864 20.5533 4.30578 20.5533 4.78578V16.7858Z",fill:"#615CCD"}))),name:"Hyphen"},{id:"lifi",logoURI:e=>ot.createElement("svg",vb({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),gb||(gb=ot.createElement("rect",{y:.5,width:24,height:24,rx:4,fill:"white"})),yb||(yb=ot.createElement("rect",{x:7.5,y:6.5,width:8.72727,height:12,fill:"url(#pattern0)"})),xb||(xb=ot.createElement("defs",null,ot.createElement("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:1,height:1},ot.createElement("use",{xlinkHref:"#image0_1105_25179",transform:"translate(-0.958333 -0.393939) scale(0.0208333 0.0151515)"})),ot.createElement("image",{id:"image0_1105_25179",width:252,height:124,xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPwAAAB8CAYAAABNG92/AAAMbGlDQ1BJQ0MgUHJvZmlsZQAASImVlwdcU0kTwPeVJCQkBAhEQEroTRDpRUoILYKAVMFGSAIJJcaEIGJHj1Pw7CKKFT0V8dDTE5BDRezlUOz9sKCinId6KIrKtymg533l901++94/s7Mzs/P2lQWA3seTSvNQXQDyJQWyhMhQ1vi0dBbpCSACBP7owIPHl0vZ8fExAMrg+e/y9jq0hHLFRenrn/3/VfQFQjkfAGQi5EyBnJ8PuQUAfANfKisAgKjUW08vkCp5HmQDGUwQ8molZ6t5l5Iz1dyssklK4EC+BIAWlceTZQOgcxfqWYX8bOhH5yNkN4lALAGAPgJyEF/EE0BW5j4iP3+qkishO0B7KWSYD/DN/Mpn9t/8Zw755/Gyh1g9L5VohYnl0jzejP+zNP9b8vMUgzHsYKOKZFEJyvnDGt7MnRqtZCrkbklmbJyy1pD7xAJ13QFAKSJFVLLaHjXlyzmwfoAJ2U3AC4uGbAo5QpIXG6PRZ2aJI7iQ4WpBi8QF3CTIRpAXCeXhiRqbLbKpCZpYaH2WjMPW6M/wZKq4ylj3FbnJbI3/1yIhV+Mf0ykWJaVCpkC2KRSnxELWgewqz02M1tiMLhZxYgdtZIoEZf42kBOEkshQtX+sMEsWkaCxL8uXD84X2yISc2M1vL9AlBSlrg92gs9T5Q/ngl0SStjJg36E8vExg3MRCMPC1XPHngklyYkaP33SgtAE9VicIs2L19jjVsK8SKXeCrKnvDBRMxZPKYCLU+0fz5IWxCep88SLc3hj4tX54MtBDOCAMMACCtgywVSQA8Rt3Q3d8J+6JwLwgAxkAyFw0WgGR6SqeiTwmAiKwR+QhEA+NC5U1SsEhVD/aUirPrqALFVvoWpELngCOR9Egzz4X6EaJRmKlgIeQ434H9F5sPFhvnmwKfv/vX5Q+0XDhpoYjUYxGJFFH7QkhhPDiFHECKIjboIH4QF4DDyGwOaO++J+g/P4Yk94QmgnPCRcI3QQbk0Rl8i+yXIs6ID+IzS1yPy6Frgd9OmFh+KB0Dv0jDNxE+CCe8I4bDwYRvaCWo4mb2VVWN/4/tsMvroaGjuyGxklDyOHkB2+HanjpOM15EVZ66/ro841c6jenKGeb+Nzvqq+AJ6jv7XEFmEHsNPYMews1ow1ABZ2FGvELmCHlTy0uh6rVtdgtARVPrnQj/gf8QavrLKScrdaty63j+q+AmFRgfLG40yVzpCJs0UFLDZ8OwhZXAnfdQTL3c3dHQDlu0b9+HrDVL1DEOa5L7oSOgCj3w8MDDR/0cXYAvBLKbz9n3zROVTDx8R8AM6U8xWyQrUOVx4I8ClBh3eaMTAH1sABzscdeIMAEALCwRgQB5JAGpgMsxfBdS4D08EsMB+UgnKwHKwB68FmsA3sAj+B/aABNINj4BQ4Dy6Ba+AOXD2d4AXoAW9BP4IgJISGMBBjxAKxRZwRd8QXCULCkRgkAUlDMpBsRIIokFnIAqQcWYmsR7YiNcjPyCHkGHIWaUduIQ+QLuQ18gHFUCpqgJqhduhI1Bdlo9FoEjoJzUanocXoQnQpWolWo3vQevQYeh69hnagL9BeDGDaGBOzxFwwX4yDxWHpWBYmw+ZgZVgFVo3VYU3wOl/BOrBu7D1OxBk4C3eBKzgKT8b5+DR8Dr4EX4/vwuvxE/gV/AHeg38m0AimBGeCP4FLGE/IJkwnlBIqCDsIBwkn4b3USXhLJBKZRHuiD7wX04g5xJnEJcSNxL3EFmI78RGxl0QiGZOcSYGkOBKPVEAqJa0j7SEdJV0mdZL6tLS1LLTctSK00rUkWiVaFVq7tY5oXdZ6qtVP1iXbkv3JcWQBeQZ5GXk7uYl8kdxJ7qfoUewpgZQkSg5lPqWSUkc5SblLeaOtrW2l7ac9TlusPU+7Unuf9hntB9rvqfpUJyqHOpGqoC6l7qS2UG9R39BoNDtaCC2dVkBbSquhHafdp/XpMHRcdbg6Ap25OlU69TqXdV7SyXRbOps+mV5Mr6AfoF+kd+uSde10Obo83Tm6VbqHdG/o9uox9Ebpxenl6y3R2613Vu+ZPknfTj9cX6C/UH+b/nH9RwyMYc3gMPiMBYztjJOMTgOigb0B1yDHoNzgJ4M2gx5DfUNPwxTDIsMqw8OGHUyMacfkMvOYy5j7mdeZH4aZDWMPEw5bPKxu2OVh74yGG4UYCY3KjPYaXTP6YMwyDjfONV5h3GB8zwQ3cTIZZzLdZJPJSZPu4QbDA4bzh5cN3z/8tilq6mSaYDrTdJvpBdNeM3OzSDOp2Tqz42bd5kzzEPMc89XmR8y7LBgWQRZii9UWRy2eswxZbFYeq5J1gtVjaWoZZamw3GrZZtlvZW+VbFVitdfqnjXF2tc6y3q1dat1j42FzVibWTa1Nrdtyba+tiLbtbanbd/Z2dul2n1v12D3zN7InmtfbF9rf9eB5hDsMM2h2uGqI9HR1zHXcaPjJSfUyctJ5FTldNEZdfZ2FjtvdG4fQRjhN0IyonrEDReqC9ul0KXW5YEr0zXGtcS1wfXlSJuR6SNXjDw98rObl1ue23a3O6P0R40ZVTKqadRrdyd3vnuV+1UPmkeEx1yPRo9Xns6eQs9Nnje9GF5jvb73avX65O3jLfOu8+7ysfHJ8Nngc8PXwDfed4nvGT+CX6jfXL9mv/f+3v4F/vv9/wxwCcgN2B3wbLT9aOHo7aMfBVoF8gK3BnYEsYIygrYEdQRbBvOCq4MfhliHCEJ2hDxlO7Jz2HvYL0PdQmWhB0Pfcfw5szktYVhYZFhZWFu4fnhy+Prw+xFWEdkRtRE9kV6RMyNboghR0VErom5wzbh8bg23Z4zPmNljTkRToxOj10c/jHGKkcU0jUXHjhm7auzdWNtYSWxDHIjjxq2KuxdvHz8t/tdxxHHx46rGPUkYlTAr4XQiI3FK4u7Et0mhScuS7iQ7JCuSW1PoKRNTalLepYalrkztGD9y/Ozx59NM0sRpjemk9JT0Hem9E8InrJnQOdFrYunE65PsJxVNOjvZZHLe5MNT6FN4Uw5kEDJSM3ZnfOTF8ap5vZnczA2ZPXwOfy3/hSBEsFrQJQwUrhQ+zQrMWpn1LDswe1V2lyhYVCHqFnPE68WvcqJyNue8y43L3Zk7kJeatzdfKz8j/5BEX5IrOTHVfGrR1Haps7RU2jHNf9qaaT2yaNkOOSKfJG8sMIAf9RcUDorvFA8KgwqrCvump0w/UKRXJCm6MMNpxuIZT4sjin+cic/kz2ydZTlr/qwHs9mzt85B5mTOaZ1rPXfh3M55kfN2zafMz53/W4lbycqSvxakLmhaaLZw3sJH30V+V1uqUyorvfF9wPebF+GLxIvaFnssXrf4c5mg7Fy5W3lF+ccl/CXnfhj1Q+UPA0uzlrYt8162aTlxuWT59RXBK3at1FtZvPLRqrGr6lezVpet/mvNlDVnKzwrNq+lrFWs7aiMqWxcZ7Nu+bqP60Xrr1WFVu3dYLph8YZ3GwUbL28K2VS32Wxz+eYPW8Rbbm6N3FpfbVddsY24rXDbk+0p20//6PtjzQ6THeU7Pu2U7OzYlbDrRI1PTc1u093LatFaRW3Xnol7Lv0U9lNjnUvd1r3MveX7wD7Fvuc/Z/x8fX/0/tYDvgfqfrH9ZcNBxsGyeqR+Rn1Pg6ihozGtsf3QmEOtTQFNB391/XVns2Vz1WHDw8uOUI4sPDJwtPhob4u0pftY9rFHrVNa7xwff/zqiXEn2k5GnzxzKuLU8dPs00fPBJ5pPut/9tA533MN573P11/wunDwN6/fDrZ5t9Vf9LnYeMnvUlP76PYjl4MvH7sSduXUVe7V89dir7VfT75+88bEGx03BTef3cq79ep24e3+O/PuEu6W3dO9V3Hf9H71746/7+3w7jj8IOzBhYeJD+884j968Vj++GPnwie0JxVPLZ7WPHN/1twV0XXp+YTnnS+kL/q7S//Q+2PDS4eXv/wZ8ueFnvE9na9krwZeL3lj/GbnX55/tfbG995/m/+2/11Zn3Hfrve+709/SP3wtH/6R9LHyk+On5o+R3++O5A/MCDlyXiqTwEMNjQrC4DXOwGgpQHAgPs2ygT1XlAliHr/qiLwn1i9X1SJNwB18KT8jOe0ALAPNnvItHkAKD/hk0IA6uEx1DQiz/JwV/uiwp0QoW9g4I0ZAKQmAD7JBgb6Nw4MfNoOk70FQMs09R5UKUS4Z9jiqaTLzKJ54BtR70+/muO3Z6DMQDX8b+d/AU/6jzXPsPu0AAAAbGVYSWZNTQAqAAAACAAEARoABQAAAAEAAAA+ARsABQAAAAEAAABGASgAAwAAAAEAAgAAh2kABAAAAAEAAABOAAAAAAAAAJAAAAABAAAAkAAAAAEAAqACAAQAAAABAAAA/KADAAQAAAABAAAAfAAAAABezPYPAAAACXBIWXMAABYlAAAWJQFJUiTwAAAH8UlEQVR4Ae2d0U3cQBRFTYT4hQ7gi19IBUkqIFQQ6AAaIKQCoAPSQVJBkg6ggkAH8IOEhJRwEZOMVsZrrz3GM/eMZO2ud3bsd967+7zjmdmlP4+lokAAAhYE3lhYiZEQgMATAQRPIEDAiACCN3I2pkIAwRMDEDAigOCNnI2pEEDwxAAEjAggeCNnYyoEEDwxAAEjAgjeyNmYCgEETwxAwIgAgjdyNqZCAMETAxAwIoDgjZyNqRBA8MQABIwIIHgjZ2MqBBA8MQABIwII3sjZmAoBBE8MQMCIAII3cjamQgDBEwMQMCKA4I2cjakQQPDEAASMCCB4I2djKgQQPDEAASMCCN7I2ZgKAQSfMAaurq6qr1+/Vvv7+9Xbt2+rpaWl6vz8POERaRoCzQSW+KupZkBd3r24uKguLy+rnz9/Pm0S/GzZ2Niofv/+Pbub1xAYhQCC74FZAv/169c/gd/c3LRqjb/za4WJSgkILCdos9gmY3FL7G0FXiwQDMuOAIJvcFkscF2mUyCQOwEE/+xBZetY4MrgFAiURsBW8OpQk8AlbGVvBF5aaGNPHQEbwQeBS9za6nrQ6wCxDwIlESha8LoH/u3btyeB08FWUthiy6IEihW8BrhowAsFAhD4T6DYkXZra2v/reQZBCDwRKDogTca1XZ9fT05VzPwZnIusTmhYjO8PHh8fGzjSAyFQBsCRWd4AZhilifDtwlN6qQgUHSGF7C9vb0U3BZuc3V1deHP8kEI9CVQvOAPDg6qKYlsal9AfQOIz+dFoHjBq7deon/N8u7du+rz58/Vjx8/qtPT06Snojn3L20acDR02dzcfPF4R0dHgxxOfTEv2TTE/rq+Ho3haGp7EMNeoZFi78PHLCV4Ce329jbeneS5ribev39fbW9vPz3qOQUCUyFgIfiQ5b98+TI49yBwCVubhE6BwFQJWAhe8IfK8uvr60/CDgLXXQAKBHIhYCP4RbP81tbWv8wtkSPwXEKb86wjYCN4Gf/x48dq3mV9EHjI4EMM0Q1z7TUF99OnT3xp1EUi+0YhYCX4OqLqQQ/i1uMQJZ6KK5HHc+01qYdFLIeg/L8N3QHpU4bye59zGOuzNoKX6OLZc8q06rkfIoOr7Xgxjaa59k3vjeX00o5Td1utNBuHsqdYwQcR6t6ztng+vMTeZ334WNyzbQ/lGNqBQAoCRQheYo7Xg5cIm0rXjBCvdTev7abj8h4EXptA1oKX0HWZrlVtupSmnvbQwSZha4t/f3c5BnUhMEUCWQte99a7ir3OCRK2hlJK3Ai8jhD7SiGQteAl0r5FXxi7u7t9m+HzEMiCQNaCH4Jw6sksQ5wjbTQT+PDhQ3OFhndPTk6shkPbC15j39UpR8mXgH6SLVriuzeLtpHT597kdLIpzvW1p86msIk2IfASAXvBq8de9+UpEHAgYC94ObnrfXmHwMDGMgkg+Ee/Ksvv7OyU6WGsgkBEwL7TLrDQb/nv37+Hl8kep7S+XjIjR264z+SZpkFYI5sxyuEQ/DNmzZjSzLnUPfaaoksZlgA/ydrztLukb8qwqQMnzNBr7x5qQmBYAnYZvmnu89BZPsViGsO6n9bcCFgJXuvRzRtZpyy/6MiteDENDegZYq69W0Bib1oCWQteGVTTYptKLMKm7B7aUB1d9s9b0lp14qWo27QdjuH+eHd39yKC5eXlamVl5cX3eaMfgawFr0UsJLQgTmXwWIR6vkjRHxDMFglcxwrbom3Ptjvm68PDw15XHUONOxfLh4eHWtPv7+9r97NzGAJZC16i01hojaXW7RVtfYu+ROLx1bo/r8v8HAU+y6Lv1N+Yy2zbvM6DQNaCD4iVdfuUsGSVpsrqyyMU/WQYYr59aI9HCLw2gSIE3wWislTb5bC4Z96FLHVzIFC84MOS0bqcVfbuclkbZ/scnMk5QmAegeIEL0GHRSf1vM+y0GpHnx+ib2CeI3gfAmMQyF7wQdzKxikysjrs+ixpPYYTOQYE2hJY+vNY2laeWj1NeDk7O0t+WvqnGLJ8cswcYAQCWQu+7n55CmZ9/7gixTnRJgQWIYDgW1Ijy7cERbVJE3gz6bOb0MnptzwFArkTIMN38CBZvgMsqk6SABm+g1vmzbTr0BRVIfAqBMjwHbBruquyPNNeO0Cj6qQIkOE7uEPDcsnyHYBRdXIEEHxHl6QY3NPxFKgOgYUJIPgO6DR7jgzfARhVJ0cg+6G1KYnGq+VoPjy/3VPSpu0xCCD4Z8olrGgzRsBwjLwJ2Apel+fK2mHJKsbK5x3InH07AjaCD5fnQeRcnrcLEGqVRSBrwesyPCxgGbslvjwPAo/f5zkEXAlkPfBGPeZaiZXLc9fwxe6uBLIWfFdjqQ8BdwLch3ePAOy3IoDgrdyNse4EELx7BGC/FQEEb+VujHUngODdIwD7rQggeCt3Y6w7AQTvHgHYb0UAwVu5G2PdCSB49wjAfisCCN7K3RjrTgDBu0cA9lsRQPBW7sZYdwII3j0CsN+KAIK3cjfGuhNA8O4RgP1WBBC8lbsx1p0AgnePAOy3IoDgrdyNse4EELx7BGC/FQEEb+VujHUngODdIwD7rQggeCt3Y6w7AQTvHgHYb0UAwVu5G2PdCSB49wjAfisCCN7K3RjrTgDBu0cA9lsRQPBW7sZYdwII3j0CsN+KAIK3cjfGuhNA8O4RgP1WBBC8lbsx1p0AgnePAOy3IvAXd0VRjJTy4H0AAAAASUVORK5CYII="})))),name:"LIFI"},{id:"nabox",logoURI:e=>ot.createElement("svg",wb({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),bb||(bb=ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 7.23999V18.418L4.73651 20.2838V12.2876L7.96146 14.1503V22.1412L11.199 24.007V12.8279L1.5 7.23999Z",fill:"#2AC98B"})),Ab||(Ab=ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.85179 6.21724L12.0946 4.31675L16.1237 6.67449L12.883 8.56657L8.85179 6.21724ZM12.0988 0.5L2.32306 6.21934L12.8651 12.4001V24.5L16.0627 22.6374V10.3966L19.294 8.50455V20.7348L22.5389 18.8248V6.60827L12.0988 0.5Z",fill:"#2AC98B"}))),name:"Nabox"},{id:"bungee",logoURI:e=>ot.createElement("svg",pb({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),cb||(cb=ot.createElement("g",{clipPath:"url(#clip0_1106_26400)"},ot.createElement("path",{d:"M24 4.5C24 2.29086 22.2091 0.5 20 0.5H4C1.79086 0.5 0 2.29086 0 4.5V20.5C0 22.7091 1.79086 24.5 4 24.5H20C22.2091 24.5 24 22.7091 24 20.5V4.5Z",fill:"#FEA700"}),ot.createElement("path",{d:"M3.26157 14.6479C4.44801 14.6479 5.40958 13.6862 5.40958 12.4999C5.40958 11.3137 4.44779 10.3519 3.26157 10.3519C2.07824 10.3519 1.1189 11.3088 1.11401 12.491V12.509C1.1189 13.691 2.07824 14.6479 3.26157 14.6479Z",fill:"#ED1E7F"}),ot.createElement("path",{d:"M20.7367 14.6477C21.923 14.6477 22.8847 13.686 22.8847 12.4997C22.8847 11.3134 21.923 10.3517 20.7367 10.3517C19.5504 10.3517 18.5887 11.3134 18.5887 12.4997C18.5887 13.686 19.5504 14.6477 20.7367 14.6477Z",fill:"#4CB85D"}),ot.createElement("path",{d:"M9.59911 15.9941C10.2391 15.9941 10.8329 15.7967 11.3251 15.4612V15.9438H12.672V12.9378C12.672 12.9314 12.6726 12.9252 12.6726 12.9187V12.0794C12.6726 11.1272 13.4471 10.3527 14.3993 10.3527C15.3535 10.3527 16.126 11.1272 16.126 12.0794V15.9438H17.4747V12.0794C17.4747 10.3825 16.0982 9.00586 14.3993 9.00586C13.7591 9.00586 13.1646 9.20338 12.6722 9.53919V9.05539H11.3253V12.9307C11.3189 13.8792 10.5475 14.6454 9.5993 14.6454C8.6453 14.6454 7.87264 13.873 7.87264 12.9187V9.05607H6.52399V12.9187C6.52375 14.6176 7.90019 15.9941 9.59911 15.9941Z",fill:"black"}))),ub||(ub=ot.createElement("defs",null,ot.createElement("clipPath",{id:"clip0_1106_26400"},ot.createElement("rect",{width:24,height:24,fill:"white",transform:"translate(0 0.5)"}))))),name:"Bungee"},{id:"squid",logoURI:e=>ot.createElement("svg",Ub({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Wb||(Wb=ot.createElement("g",{clipPath:"url(#clip0_6759_209574)"},ot.createElement("path",{d:"M23.7182 11.278C23.2776 12.8519 22.2417 14.5477 20.9174 15.1962C16.7933 17.2151 14.6496 12.8533 14.9088 9.67381C15.0643 7.76437 15.6835 6.24613 15.2064 4.69333C15.0542 4.19797 14.7307 3.73957 14.2008 3.49141C12.7469 2.81029 11.3241 3.74677 10.6627 4.73893C9.94895 5.80885 9.61391 7.14757 9.70463 8.37109C9.79151 9.54997 10.1995 10.3228 10.8149 11.3783C11.6371 12.7885 12.5126 13.7044 12.8477 14.7872C13.0637 15.4852 13.1865 16.6117 12.1944 16.7063C11.1465 16.8066 11.1993 15.4328 11.1845 14.7436C11.1398 12.6488 9.80927 11.8943 8.80751 9.48133C8.22239 8.07205 7.99439 6.58165 8.33663 5.11045C8.81807 3.04021 9.99119 1.37125 12.1061 0.793809C13.7971 0.332049 15.7555 0.710769 16.8259 2.19157C18.0984 3.95221 17.8502 6.02917 17.3328 7.87477C16.3752 11.289 17.2305 12.9167 18.0288 13.3424C19.5403 14.1484 21.1262 13.2354 21.8299 12.2677C22.5921 11.2194 23.0467 9.30709 22.9747 8.08309C22.9473 7.61557 22.9061 7.21333 22.8432 6.85237",fill:"white"}),ot.createElement("path",{d:"M0 12.0001C0 12.8756 0.09456 13.7291 0.27264 14.5513C0.2544 13.9316 0.31536 13.3182 0.47568 12.746C0.91632 11.1721 1.95216 9.47627 3.27648 8.82779C7.40064 6.80891 9.54432 11.1707 9.28512 14.3502C9.1296 16.2596 8.5104 17.7779 8.98752 19.3307C9.13968 19.826 9.4632 20.2844 9.99312 20.5326C11.447 21.2137 12.8698 20.2772 13.5312 19.2851C14.245 18.2151 14.58 16.8764 14.4893 15.6529C14.4024 14.474 13.9944 13.7012 13.3795 12.6457C12.5573 11.2355 11.6818 10.3196 11.3467 9.23675C11.1307 8.53883 11.0078 7.41227 12 7.31771C13.0478 7.21739 12.995 8.59115 13.0099 9.28043C13.0546 11.3751 14.3851 12.1297 15.3869 14.5427C15.972 15.9519 16.2 17.4423 15.8578 18.9135C15.3763 20.9838 14.2032 22.6527 12.0883 23.2302C10.3973 23.6919 8.43888 23.3132 7.36848 21.8324C6.096 20.0718 6.34416 17.9948 6.8616 16.1492C7.8192 12.735 6.96384 11.1073 6.1656 10.6815C4.65408 9.87611 3.06816 10.7886 2.36448 11.7563C1.60224 12.8046 1.14768 14.7169 1.21968 15.9409C1.26432 16.7003 1.34592 17.2878 1.49664 17.8062",fill:"white"}),ot.createElement("path",{d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z",fill:"#E6FA36"}),ot.createElement("path",{d:"M15.8578 18.914C16.2 17.4428 15.972 15.9524 15.3869 14.5432C14.3851 12.1302 13.0541 11.3752 13.0099 9.28092C12.9955 8.59164 13.0479 7.21788 12 7.3182C11.0079 7.41324 11.1307 8.5398 11.3467 9.23772C11.6818 10.3206 12.5578 11.2364 13.3795 12.6467C13.9949 13.7022 14.4024 14.475 14.4893 15.6539C14.5795 16.8774 14.245 18.2161 13.5312 19.286C12.8693 20.2782 11.4471 21.2147 9.99313 20.5336C9.46321 20.2854 9.13969 19.8265 8.98753 19.3316C8.51089 17.7784 9.12961 16.2606 9.28513 14.3512C9.54433 11.1716 7.40017 6.80988 3.27649 8.82876C1.95217 9.47724 0.916332 11.1726 0.475692 12.747C0.315372 13.3196 0.254412 13.9326 0.272652 14.5523C0.523212 15.7081 0.939852 16.802 1.49665 17.8076C1.34593 17.2888 1.26433 16.7017 1.21969 15.9424C1.14769 14.7188 1.60273 12.806 2.36449 11.7577C3.06769 10.79 4.65409 9.87708 6.16561 10.683C6.96385 11.1088 7.81921 12.7364 6.86161 16.1507C6.34369 17.9968 6.09553 20.0732 7.36849 21.8339C8.43889 23.3147 10.3973 23.6934 12.0883 23.2316C14.2032 22.6532 15.3768 20.9843 15.8578 18.914Z",fill:"black"}),ot.createElement("path",{d:"M23.7182 11.2782C23.8008 10.984 23.8565 10.6787 23.8891 10.3676C23.8891 10.3691 23.8896 10.37 23.8896 10.371C23.7206 9.12732 23.3616 7.94412 22.8422 6.85164C22.9051 7.21308 22.9464 7.61484 22.9737 8.08236C23.0457 9.30588 22.5907 11.2187 21.8289 12.267C21.1257 13.2347 19.5393 14.1476 18.0278 13.3417C17.2296 12.916 16.3742 11.2883 17.3318 7.87404C17.8497 6.02796 18.0979 3.95148 16.8249 2.19084C15.7545 0.710036 13.7961 0.331317 12.1051 0.793076C9.99021 1.37052 8.81661 3.03948 8.33565 5.10972C7.99341 6.58092 8.22141 8.07132 8.80653 9.4806C9.80829 11.8936 11.1393 12.6486 11.1835 14.7428C11.1979 15.4321 11.1456 16.8059 12.1934 16.7056C13.1856 16.6105 13.0627 15.484 12.8467 14.7865C12.5117 13.7036 11.6356 12.7878 10.8139 11.3776C10.1985 10.322 9.79101 9.54924 9.70365 8.37036C9.61341 7.14684 9.94797 5.80812 10.6617 4.7382C11.3236 3.74604 12.7459 2.80956 14.1998 3.49068C14.7297 3.73884 15.0532 4.19772 15.2054 4.6926C15.682 6.24588 15.0633 7.76364 14.9078 9.67308C14.6486 12.8526 16.7928 17.2144 20.9165 15.1955C22.2413 14.548 23.2776 12.8521 23.7182 11.2782Z",fill:"black"}))),Vb||(Vb=ot.createElement("defs",null,ot.createElement("clipPath",{id:"clip0_6759_209574"},ot.createElement("rect",{width:24,height:24,fill:"white"}))))),name:"Squid"},{id:"across",logoURI:e=>ot.createElement("svg",db({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),rb||(rb=ot.createElement("rect",{width:32,height:32,rx:16,fill:"#6CF9D8"})),ib||(ib=ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.95021 8.41988L8.50949 6.8606L14.7408 13.0919C14.3626 13.253 14.0083 13.4879 13.6998 13.7964C13.4609 14.0353 13.2662 14.3017 13.1157 14.5853L6.95021 8.41988ZM12.9982 17.4399L6.85803 23.5801L8.41732 25.1394L14.495 19.0617C14.209 18.9107 13.9405 18.7149 13.6998 18.4742C13.3932 18.1675 13.1593 17.8156 12.9982 17.4399ZM17.5887 19.0584L23.5826 25.0522L25.1418 23.493L19.0822 17.4333C18.921 17.8114 18.6862 18.1657 18.3777 18.4742C18.1388 18.7131 17.8724 18.9079 17.5887 19.0584ZM18.9652 14.5916L25.0497 8.50706L23.4904 6.94778L17.3434 13.0947C17.7191 13.2558 18.071 13.4897 18.3777 13.7964C18.6184 14.037 18.8142 14.3055 18.9652 14.5916Z",fill:"#2D2E33"}))),name:"Across"},{id:"layerswap",logoURI:e=>ot.createElement("svg",tA({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),$b||($b=ot.createElement("g",{clipPath:"url(#clip0_8229_671)"},ot.createElement("path",{opacity:.3,d:"M11.4062 12.7691C11.4062 12.0165 12.0163 11.4065 12.7688 11.4065H24.5209C25.2735 11.4065 25.8835 12.0165 25.8835 12.7691V24.5213C25.8835 25.2738 25.2735 25.8837 24.5209 25.8837H12.7688C12.0163 25.8837 11.4062 25.2738 11.4062 24.5213V12.7691Z",fill:"#FF0093"}),ot.createElement("path",{opacity:.5,d:"M23.2097 21.847C23.2097 22.5995 22.5996 23.2094 21.8471 23.2094H10.095C9.34246 23.2094 8.73242 22.5995 8.73242 21.847V10.0947C8.73242 9.34222 9.34246 8.73218 10.095 8.73218H21.8471C22.5996 8.73218 23.2097 9.34222 23.2097 10.0947V21.847Z",fill:"#FF0093"}),ot.createElement("path",{opacity:.9,d:"M20.5349 19.1718C20.5349 19.9244 19.9249 20.5344 19.1723 20.5344H7.42018C6.66766 20.5344 6.05762 19.9244 6.05762 19.1718V7.4197C6.05762 6.66717 6.66766 6.05713 7.42018 6.05713H19.1723C19.9249 6.05713 20.5349 6.66717 20.5349 7.4197V19.1718Z",fill:"#FF0093"}))),eA||(eA=ot.createElement("defs",null,ot.createElement("clipPath",{id:"clip0_8229_671"},ot.createElement("rect",{width:20,height:20,fill:"white",transform:"translate(6 6)"}))))),name:"Layerswap"},{id:"okx",logoURI:e=>ot.createElement("svg",iA({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),nA||(nA=ot.createElement("g",{clipPath:"url(#clip0_1443_44689)"},ot.createElement("path",{d:"M21 0H11C4.92487 0 0 4.92487 0 11V21C0 27.0751 4.92487 32 11 32H21C27.0751 32 32 27.0751 32 21V11C32 4.92487 27.0751 0 21 0Z",fill:"black"}),ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.6063 6.99255H7.39351C7.17207 6.99255 6.99255 7.17207 6.99255 7.39351V12.6063C6.99255 12.8278 7.17207 13.0073 7.39351 13.0073H12.6063C12.8278 13.0073 13.0073 12.8278 13.0073 12.6063V7.39351C13.0073 7.17207 12.8278 6.99255 12.6063 6.99255ZM18.6237 13.0073H13.4109C13.1895 13.0073 13.0099 13.1869 13.0099 13.4083V18.6211C13.0099 18.8426 13.1895 19.0221 13.4109 19.0221H18.6237C18.8452 19.0221 19.0247 18.8426 19.0247 18.6211V13.4083C19.0247 13.1869 18.8452 13.0073 18.6237 13.0073ZM19.4231 6.99255H24.6359C24.8574 6.99255 25.0369 7.17207 25.0369 7.39351V12.6063C25.0369 12.8278 24.8574 13.0073 24.6359 13.0073H19.4231C19.2016 13.0073 19.0221 12.8278 19.0221 12.6063V7.39351C19.0221 7.17207 19.2016 6.99255 19.4231 6.99255ZM12.6063 19.0221H7.39351C7.17207 19.0221 6.99255 19.2016 6.99255 19.4231V24.6359C6.99255 24.8574 7.17207 25.0369 7.39351 25.0369H12.6063C12.8278 25.0369 13.0073 24.8574 13.0073 24.6359V19.4231C13.0073 19.2016 12.8278 19.0221 12.6063 19.0221ZM19.4231 19.0221H24.6359C24.8574 19.0221 25.0369 19.2016 25.0369 19.4231V24.6359C25.0369 24.8574 24.8574 25.0369 24.6359 25.0369H19.4231C19.2016 25.0369 19.0221 24.8574 19.0221 24.6359V19.4231C19.0221 19.2016 19.2016 19.0221 19.4231 19.0221Z",fill:"white"}))),rA||(rA=ot.createElement("defs",null,ot.createElement("clipPath",{id:"clip0_1443_44689"},ot.createElement("rect",{width:32,height:32,fill:"white"}))))),name:"okx"},{id:"symbiosis",logoURI:e=>ot.createElement("svg",sA({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),oA||(oA=ot.createElement("g",{clipPath:"url(#clip0_8229_679)"},ot.createElement("path",{d:"M13.8614 16.7844L14.4243 16.2215V14.2548L13.8614 13.6919H13.0938L12.5601 14.2548V16.2215L13.0938 16.7844H13.8614Z",fill:"#75FB6E"}),ot.createElement("path",{d:"M18.9063 16.7625L19.44 16.1995V14.2548L18.9063 13.6919H18.1313L17.5757 14.2548V16.1995L18.1313 16.7625H18.9063Z",fill:"#75FB6E"}),ot.createElement("path",{d:"M31.5175 12.332L30.7425 12.2296L27.9717 14.3571L27.862 15.1321L27.7377 15.2417H26.9847L26.4217 15.7973V16.5431L26.9335 17.0548V17.318L26.3998 17.881L26.4217 21.3683L26.9847 21.902L27.0139 22.1725L27.0286 22.1871L26.5022 22.7062V23.4812L26.2609 23.7151H22.3422L22.1083 23.4812V23.079V19.5552L21.9986 19.4528L21.5454 18.9995V18.729L21.5015 18.6925L22.0498 18.1442V17.3984L22.0133 17.3546L22.1083 17.3473L22.2618 17.1572L23.0368 17.0768L24.9011 14.6788L24.828 13.9331L25.0107 13.743L25.0034 13.6699L25.0107 13.6626L24.9888 13.4505L24.9815 13.3994L25.5444 12.8364L25.4933 8.36212L24.9303 7.82842V7.76993L24.9596 7.53598L24.7475 7.26548L24.8207 6.49052L22.9344 4.09253L22.1595 4.01211L22.0425 3.85858L22.0498 3.85127V3.10555L21.5161 2.54261H20.8289H20.7704L20.5072 2.33059V1.56294L19.915 1H16.0548H15.9452H12.0777L11.4928 1.56294V2.33059L11.2296 2.54261H11.1711H10.4766L9.94288 3.10555V3.85127L9.95019 3.85858L9.84053 4.01211L9.06557 4.09253L7.17204 6.49052L7.25246 7.26548L7.04044 7.53598L7.06968 7.76993V7.82842L6.50674 8.36212L6.45556 12.8364L7.01119 13.3994L6.98926 13.743L7.19397 13.955L7.12086 14.6788L8.98515 17.0768L9.76011 17.1572L9.92095 17.3473L9.98675 17.3546L9.94288 17.3984V18.1442L10.4766 18.7071L10.4546 18.729V18.9995L10.0014 19.4528L9.89171 19.5552V23.079V23.4812L9.65045 23.7151H5.73178L5.49052 23.4812V22.7062L4.95682 22.1725L4.98606 21.902L5.54901 21.3683L5.57094 17.881L5.03724 17.318L5.06648 17.0548L5.57094 16.5431V15.7973L5.01531 15.2417H4.25497L4.13068 15.1321L4.02833 14.3571L1.25017 12.2296L0.482522 12.332L0 12.9461L0.109664 13.721L2.88051 15.8485L3.65547 15.7462L3.71396 15.79L3.70665 15.7973V16.5431L4.24035 17.106H4.26959V17.2668L3.70665 17.8225L3.65547 21.3171L4.18917 21.8801V22.1432H4.15993L3.62623 22.7062V23.4812L4.15993 24.0148H4.93489L5.17615 24.2488V25.0238L5.70985 25.5575H9.62851L10.1841 25.0238V24.2488L10.4254 24.0148H11.2296L11.756 23.4812V23.2106V19.5552L11.2808 18.9995L11.2515 18.7071L11.8145 18.1442V17.3984L11.2515 16.8355H10.4985L10.3742 16.6747L10.4546 15.907L8.56111 13.509L7.78615 13.4286V13.4213V13.3994L8.3491 12.8657L8.37103 8.4133L7.83733 7.85035L7.84464 7.76993L7.86657 7.748L8.64153 7.66758L10.5058 5.26959L10.4254 4.49463L10.4912 4.41421H11.2515L11.8145 3.85127V3.15673V3.10555L12.0777 2.89353H15.9452H16.0548H19.915L20.1855 3.10555V3.15673V3.85127L20.7485 4.41421H21.5088L21.5746 4.49463L21.4942 5.26959L23.3585 7.66758L24.1334 7.748L24.148 7.76993L24.1554 7.85035L23.6217 8.4133L23.6509 12.8657L24.2138 13.3994V13.4286L23.4681 13.509L21.5746 15.907L21.6477 16.6747L21.5088 16.8574L21.4942 16.8355H20.7192L20.1855 17.3984V18.1442L20.7192 18.7071H20.7485L20.7192 18.9995L20.2659 19.5552V23.2106V23.4812L20.7996 24.0148H21.5746L21.8085 24.2488V25.0238L22.3715 25.5575H26.2902L26.8239 25.0238V24.2488L27.0651 24.0148H27.8401L28.3738 23.4812V22.7062L27.8401 22.1432H27.7816V21.8801L28.3153 21.3171L28.2641 17.8225L27.7012 17.2668V17.106H27.7597L28.2934 16.5431V15.7973L28.286 15.79L28.3445 15.7462L29.1195 15.8485L31.8903 13.721L32 12.9461L31.5175 12.332Z",fill:"#75FB6E"}),ot.createElement("path",{d:"M13.5693 23.854L13.0137 24.4096V25.1846L12.7724 25.4259H11.9975L8.2689 29.074V29.827L8.02764 30.061H4.10897L3.86771 29.827V29.0521L3.30477 28.4891H2.53712L2.00342 29.0521V29.827L2.53712 30.3607H3.30477L3.54603 30.5947V31.3697L4.07973 31.9034H7.99839L8.56133 31.3697V30.5947L8.79528 30.3607L8.82453 30.3827H9.59949L13.3354 26.7345V25.9596L13.5474 25.7183H14.2931L14.9072 25.1846V24.4096L14.3443 23.854H13.5693Z",fill:"#75FB6E"}),ot.createElement("path",{d:"M28.7465 28.4891L28.1836 29.0521V29.827L27.9423 30.061H24.0236L23.7824 29.827V29.074L20.0538 25.4259H19.2788L19.0376 25.1846V24.4096L18.4819 23.854H17.707L17.144 24.4096V25.1846L17.7582 25.7183H18.5039L18.7159 25.9596V26.7345L22.4518 30.3827H23.2267L23.2487 30.3607L23.4899 30.5947V31.3697L24.0529 31.9034H27.9716L28.5052 31.3697V30.5947L28.7465 30.3607H29.5142L30.0479 29.827V29.0521L29.5142 28.4891H28.7465Z",fill:"#75FB6E"}))),aA||(aA=ot.createElement("defs",null,ot.createElement("clipPath",{id:"clip0_8229_679"},ot.createElement("rect",{width:32,height:30.9034,fill:"white",transform:"translate(0 1)"}))))),name:"symbiosis"},{id:"scroll",logoURI:yg,name:"Scroll"},{id:"manta",logoURI:Ag,name:"Manta"},{id:"orbiter",logoURI:e=>ot.createElement("svg",dA({xmlns:"http://www.w3.org/2000/svg",width:"32.000000pt",height:"32.000000pt",viewBox:"0 0 32.000000 32.000000",preserveAspectRatio:"xMidYMid meet"},e),lA||(lA=ot.createElement("g",{transform:"translate(0.000000,32.000000) scale(0.100000,-0.100000)",fill:"#000000",stroke:"none"},ot.createElement("path",{d:"M91 285 c-32 -28 -56 -85 -48 -115 3 -11 -5 -27 -19 -41 -32 -30 -30 -39 7 -39 32 0 34 -5 14 -53 -14 -33 11 -17 28 18 14 29 22 35 47 35 28 0 30 -2 30 -40 0 -51 18 -53 22 -2 3 32 7 37 31 40 23 3 30 -2 42 -32 9 -20 20 -36 26 -36 7 0 8 7 4 18 -20 47 -18 52 14 52 36 0 39 10 11 35 -13 11 -20 31 -20 53 0 107 -112 171 -189 107z m112 4 c12 -6 30 -21 39 -33 22 -26 24 -96 4 -96 -29 0 -46 13 -46 35 0 30 -26 56 -48 48 -22 -8 -32 -23 -32 -49 0 -21 -17 -34 -46 -34 -10 0 -14 12 -14 38 1 75 78 124 143 91z m-25 -82 c2 -10 -3 -17 -12 -17 -18 0 -29 16 -21 31 9 14 29 6 33 -14z m-88 -92 c0 -8 -4 -15 -9 -15 -13 0 -22 16 -14 24 11 11 23 6 23 -9z m80 0 c0 -8 -4 -15 -10 -15 -5 0 -10 7 -10 15 0 8 5 15 10 15 6 0 10 -7 10 -15z m82 0 c0 -5 -5 -11 -11 -13 -6 -2 -11 4 -11 13 0 9 5 15 11 13 6 -2 11 -8 11 -13z"})))),name:"Orbiter"},{id:"dodo",logoURI:e=>ot.createElement("svg",pA({xmlns:"http://www.w3.org/2000/svg",width:32,height:32,fill:"none",viewBox:"0 0 32 32"},e),cA||(cA=ot.createElement("g",{clipPath:"url(#a)"},ot.createElement("rect",{width:32,height:32,fill:"#FFE804",rx:8}),ot.createElement("path",{fill:"#fff",d:"m16.444 4.444-1.51.89-1.245 1.421-.978 2.49-.356 2.577-2.577.356-3.823 2.933L4.445 20l.622 3.555.8-.622.622 1.6 1.244-1.244.445 1.51.444.534 1.422-2.4 2.311-.178v1.6l-.888.89v1.244l2.222.178.71-.89v-2.844l.268-.355 1.688.355.178.89v1.51l-.889 1.334.89.622 1.955-.445.266-4.977.623-.356 1.777.622 1.156 3.378 1.511-2.311.889 1.422 1.422-1.422 1.067.267.178-4.445-1.423-4.622-2.666-1.956L21.422 12l-1.067-.445-.977-4.977-1.6-1.778-1.334-.267v-.089Z"}),ot.createElement("path",{fill:"#000",d:"M27.911 20.622v-.267l-.089-.178c0-.088-.178-.444 0-.533 0-.178 0-.266-.178-.444.178-.09 0-.267 0-.445v-.266l.178-.09c-.178 0 0-.266-.178-.266 0-.178-.177-.267 0-.267l-.088-.355v-.089a3.555 3.555 0 0 1-.178-1.067c-.178 0-.178-.089-.178-.178v-.266c-.089 0-.178-.178-.089-.267-.178 0-.089-.089-.178-.178v-.355l-.177-.356c0-.178-.178-.178-.178-.266v-.09H26.4v-.266l-.178-.089a2.654 2.654 0 0 0-.267-.355v.088c-.088 0 0-.088 0-.177h-.177v-.178H25.6v-.178h-.267l-.355-.267V12.8c-.09 0 0 0 0-.09h-.445L24 12.445c0-.089-.178 0-.178-.178-.089 0 0 .178-.089 0-.089 0-.178 0-.266-.177 0 .177-.09 0-.267 0a.71.71 0 0 1-.356-.267s-.266-.089-.355 0l-.089-.178s0 .09-.089 0h-.978c-.177-.089-.266-.178-.355 0H20.8l-.089-.267v-1.244c.089-.089.089-.355 0-.355v-.356l-.089-.178c-.089 0-.089 0 0 0l-.178-.355v-.267c0 .089 0 .089 0 0v-.356c-.177-.177-.088-.266 0-.444h-.177v-.178l-.09-.178-.088-.177L20 6.933s0-.267-.178-.267l-.089-.177h-.089v-.09l-.088-.088v-.089l-.178-.444v.088l-.09-.088H19.2s-.178-.09 0-.267h-.267l-.266-.533c-.178-.09-.356-.178-.356-.356-.267 0-.355-.178-.533-.356l-.267.09c-.178-.267-.622-.267-.889-.267 0 .089 0 .089 0 0h-.178c-.177 0-.088.177-.177.177v-.088l-.445.088-.266.178s-.356 0-.267.09c0-.09 0-.09 0 0v.088l-.089-.089c0 .178-.267.178-.356.356l-.266.177-.445.445c-.177 0-.266.089-.266.178l-.09.177-.266.356c0 .089 0 .178-.089 0l-.089.267-.178.355v.09H12.8l-.622.088c-.534 0-1.156-.267-1.6 0-.178-.178-.445 0-.534-.089 0 .089-.177.089-.088 0H9.6v.178c-.089 0-.089 0 0 .089h.178c.089.089 0 0 0 .089.178 0 .178 0 0 0l.355.089h.445c.178.177.444.266.622.177-.178.178.178 0 .356.09l.444.177h.533V8l.267.089c0 .089-.178.089-.089.177v.267s0 .178-.178.178v.178c-.178 0 0 .266-.178.355v.622s0 .178-.177.09v1.777H12c-.356-.178-.622 0-.889-.089h-.444l-.445.178-.8.267h-.178l-.533.355-.178.178-.177.089-.178.178-.356.266-.089.178c-.089 0-.177 0-.266.178L7.2 13.6l-.178.089-.444.444-.178.356-.178.088-.178.178-.088.178-.178.267v.089l-.09.088v.267H5.6L5.333 16v.266l-.089.09c-.177.088-.177.177-.177.355 0 0 0 .178-.09.089 0 .089-.177.266 0 .355H4.89a.889.889 0 0 0-.178.445l-.178.533c0 .178 0 .356-.177.445v.977l-.09.445c0 .089-.177.177-.088.266-.178 0 0 .09 0 .178h-.09v1.067l.09.533c.178.09.178.267.178.356-.09.178 0 .71 0 .71h.088l.09.623c0 .178 0 .178.177.267.178.177 0 .444.267.355 0 .356.444.09.533-.089V24c.178-.356.178-.356 0 0 .178-.178.356-.267.356-.445v.267l.177.355c0 .267.178.445.356.534h.356c.177 0 .266-.178.355-.356L7.378 24l.178-.267h.177c0 .178 0 .267.178.356-.267.088 0 .444 0 .622v.889c.178.089.178.089 0 0l.445.355s.533-.266.355-.355H8.8c.178 0 .267-.267.356-.445l.177-.266v-.09l.09-.355c0-.089 0-.089 0 0 .177 0 .177-.178.266-.267-.089-.088 0-.088 0-.177v-.09l.178-.177.177-.267v-.088c0-.09.267 0 .356-.178 0-.178.178-.178.355-.267.09 0 .09 0 0 0h1.423v.089c0 .178-.267.356-.09.622-.088.09 0 .178 0 .356v.533c-.444 0-.532.444-.888.711l-.178.445v.533l.09.355.177.356.267.178c.088.089.177.089.355 0h.267l.177-.178-.444.178c0-.089 0-.089 0 0l.444-.178.445.089.267-.089h.444l.445-.089.444-.355.178-.445v-.533c.178-.445 0-.8 0-1.156.178-.266 0-.444 0-.533v-1.067c.178 0 .355.178.444.09l.356.088H16c0-.089 0-.089 0 0h-.622l.533.089h.267v.711c-.178 0 0 .356 0 .444v.623l.177.089c-.177.177-.177.355-.088.533-.178 0-.356.089-.356.267-.178 0-.267.177-.355.266l-.178.623v.177l.089.267s.088 0 0 .089c.177 0 .355.267.533.355.267.09.267.09 0 0l.267.09h.355c0 .177.178.088.267.088-.089.09 0 0 .178.09h.266c.267.177.534 0 .711 0l.534-.534.178-.267c0 .267-.623.533-.89.622 0 .178-.266.09-.533.178.267 0 .445 0 .623-.178.177-.089.8-.355.8-.622V25.6c.177-.178 0-.445.088-.623v-.888c.178-.356 0-.623.178-1.067-.089 0-.178-.267-.089-.356-.089 0-.089 0 0 0v-.088c.09-.356-.177-.623.356-.712h.8c-.178-.177-.178-.177 0 0l.355.178c.178 0 .178.267.267.267l.178.178c0 .177 0 .266.178.444l.088.178.178.355v.178s.178 0 0 .09l.178.088v.355c0 .267 0 .356.178.534v.533h.089c0-.178 0-.178 0 0v.445c0 .177 0 0 .178 0 0 .088 0 .088 0 0-.09 0-.178.177-.178 0-.09.177.089.088.178.088l-.09.267v.356c.356.355.623 0 .712-.356l.178-.089v-.444l.088-.356h.09l.444-.71.444-.534.09.355c.088.178 0 .356.177.356v.178c0-.267 0-.534-.267-.711.178.177.267.444.267.71v.178l.178.267c0 .178.266.356.444.356h.089c.089 0 .178-.09.089-.178l.267-.178c0-.178 0-.355.177-.444 0-.267 0-.267 0 0l.267-.623c0-.177.178-.266.267-.444v-.178l.355.356-.267-.356v.178h.09l.177.267c0 .177.356.177.445.266 0-.088.177 0 .355 0l.267-.177.266-.178v-.267s.09-.266 0-.178v-.177c.178 0 0 0 0-.09.09 0 0-.088 0-.088l.09-.356c0-.177.177-.266 0-.444.266 0 .177-.267.177-.356v-1.333h.09Zm-3.467 4.622.09.178-.09-.089v-.089Zm.178.178c0-.178 0 0-.089 0h.267-.178Zm2.49-3.645c-.09 0 0 .09 0 .178l-.09.534c-.178 0 0 .177-.089.355.178 0 0 .178 0 .178l-.177.178-.09-.178-.177-.267H26.4l-.089-.089h-.267c-.177 0-.266.178-.444.356h-.267l-.089.267v.177l-.355.178v.178L24.71 24c0-.178 0-.534-.178-.445l-.178-.444v.089c.09-.267-.177-.356-.177-.534l-.267.09h-.089v.088l-.355.178v.089c-.178.089-.267.355-.267.444-.178.267-.267.622-.533.8-.178.09 0 .445-.267.445v-.978c-.089 0-.178-.267-.089-.444-.178 0-.267-.267-.267-.356l-.266-.444v-.09l-.178-.355c-.089-.089-.178 0-.178-.178l-.267-.177h-.088l-.267-.356h-.356l-.355-.089h-.445l-.088-.089-.178.09h-.356c-.266 0-.355 0-.444.177l-.178.444v.356l-.089.622h-.089v3.556l-.267.088-.177.09c-.267 0-.356 0-.445.177h-.622c-.267 0-.533 0-.622-.355 0 0 0-.178.178-.267l.266-.267s.178-.177 0-.266c.267 0 .178-.178.267-.356V24.8c-.178 0-.089 0 0 0v-.89l-.089-.266c0-.178 0-.444-.178-.622v-.089l-.089-.178s.09 0 0-.089c.178-.088 0-.266 0-.355 0 0-.177 0-.177-.178-.09 0 0 0 0-.089-.178.178-.356 0-.445 0-.266 0-.355.178-.533 0H15.2l-.178-.089-.178.09v.088h-.177c-.178 0-.267 0-.267.178h-.089l-.089.267v.444c-.089.178-.178.356-.089.622-.177 0 0 .356-.089.445v.355l-.088.445.088.266v.445l-.177.533-.445.178H12.8l-.356.089h-.177l-.178-.09h-.178l-.178-.088c-.178-.267-.089-.445 0-.711 0-.178.267-.267.267-.534-.356 0-.356 0 0 0l.355-.355c.09 0 .09-.178.267-.178v-1.066c0 .088 0 .088 0 0 0-.178 0-.267-.178-.267l.09-.178v-.267l-.09-.088c-.266-.267-.533-.356-.889-.445h-.533s-.178 0-.178.178c-.177-.178-.533 0-.71 0-.09 0-.178.267-.445.267v.088c0 .178-.089 0-.178.09 0 .088-.178.177 0 .266-.267 0-.267.267-.444.356l-.09.177-.177.09-.178.621v.09l-.266.177v.267-.356l-.178-.178c0-.355-.178-.8-.356-.977l-.178-.445H7.29c0 .178-.267.178-.178.356l-.178.089v.088a.536.536 0 0 0-.355.445V24l-.267-.534-.089-.355c-.089-.178 0-.267 0-.356l-.178-.177c-.177 0-.177.088-.355 0v.177l-.089.09c-.267 0-.178.266-.178.355l-.178-.178v-.267c-.177-.266-.177-.622-.266-.889v-1.6c0 .356 0 .356 0 0v-.444c0-.178.178-.356 0-.444l.266-.178c-.088-.445 0-.89.178-1.245-.089 0-.089-.177 0-.177v-.356c0-.178.178-.267.356-.445l.089-.355c.177 0 .177-.267.177-.356L6.222 16v-.09l.267-.444.267-.355.266-.267c0-.089 0-.178.178-.266.089 0 .267-.09.267-.267l.177-.089.178-.178v-.178l.534-.355.355-.267H8.8v-.089h.267c0-.178.089-.178.177-.266-.088 0-.177.177-.266.088 0 .09 0 .09 0 0 .089.09.178 0 .266-.088l.09-.09.444-.177.355-.089c.267-.178.623-.267.89-.178l.71-.089H12s.089 0 0-.088c.267 0 .267.177.444 0V12c.09 0 0-.178 0-.178v-.267l.09-.089c.088-.177.177-.266 0-.444.177 0 .177-.267.177-.444h-.089c0-.445.09-.445 0 0l.178-.267c-.089-.178 0-.267 0-.356v-.177c0-.178 0-.356.178-.534.089 0 0-.178.178-.266-.09 0 0-.09 0-.178v-.356c.177 0 .266-.178.266-.355 0-.178 0-.356.178-.445l.267-.355c0-.09 0-.09 0 0V7.11s.088-.089 0-.178c.355-.089.355-.533.622-.711l.266-.267c0-.177.267-.355.356-.444l.356-.089s.266 0 .177-.178l.267-.089.178-.177h.089l.71-.178h.356c.178 0 .09.089.178.178l.445.177v.09c.266.266.355.266 0 0l.355.355c.178.178.267.533.534.71-.178.179.266.445.266.623v.178c.178 0 0 .178.178.267v.088l.178.267.089.533.088.267v.533l.09.267v.711l.177.622v.89c.178.177.178.177 0 0v-.534.444L20 12h.089c.089.089.267.266.355.178h.623l.355.088h.267s0 .178.178.09l.71.088.356.178c.267.178.711.267.89.533H24v.178c.267 0 .355.267.533.267.267 0 .356.266.534.355l.444.356c.089.178 0 .444.356.355l.177.623c.267.266.267.266 0 0v.177l.178.356c0 .178.178.267.267.444h-.178v.267l.178.178v.267l.178.266c0 .178 0 .356.177.356-.266 0 0 .355 0 .355 0 .267 0 .356 0 0v.267c-.177.178.09.355 0 .533v.178c0-.089 0-.089 0 0v.622c.09 0 .09 0 0 .09v.444l.178.355v.356s-.089.089 0 .177v.09c0 .177 0 .177 0 0h-.089l.09.177v.534h.088Z"}),ot.createElement("path",{fill:"#000",d:"M17.334 6.222h-.178l-.267.09-.178.355.09.266h.177l.356.09.266-.268V6.4c-.178 0-.178-.178-.266-.178Zm-1.6 0h-.356c-.267.09-.267.267-.267.445v.177l.445.178h.089l.177-.089v-.178c.09-.088.178-.177.09-.355l-.09-.178h-.088Z"}))),uA||(uA=ot.createElement("defs",null,ot.createElement("clipPath",{id:"a"},ot.createElement("path",{fill:"#fff",d:"M0 0h32v32H0z"}))))),name:"Omni-Trade"}];function mA({routeTagList:t}){const n=g(),r={typography:"h6",borderRadius:4,px:8,py:4,ml:8};return Os.jsx(Os.Fragment,{children:t.map((t=>"no-approve"===t.type?Os.jsxs(f,{sx:Object.assign(Object.assign({},r),{color:n.palette.text.primary,backgroundColor:n.palette.background.paperContrast,display:"flex",alignItems:"center"}),children:[Os.jsx(As.Lock,{style:{color:n.palette.text.primary,width:14,height:14}}),Os.jsx("span",{style:{marginLeft:4},children:Os.jsx(e,{id:"F+sxb9",message:"Unapproved"})})]},t.type):"best-price"===t.type?Os.jsx(f,{sx:Object.assign(Object.assign({},r),{color:n.palette.success.main,backgroundColor:C(n.palette.success.main,.1)}),children:Os.jsx(e,{id:"OgKD6h",message:"Best offer"})},t.type):null))})}function fA(e,t){let n=r._({id:"B0/2ea",message:"s"});return t||(n=e>=2?r._({id:"V+rJKF",message:"Seconds"}):r._({id:"ku//5b",message:"Second"})),n}function gA(e,t){let n="";return n=e>=2?t?r._({id:"TFOxRM",message:"Mins"}):r._({id:"agRWc1",message:"Minutes"}):t?r._({id:"eTUF28",message:"Min"}):r._({id:"6UYTy8",message:"Minute"}),n}function yA(e){return e>=2?r._({id:"yY8wAv",message:"Hours"}):r._({id:"6XgEPi",message:"Hour"})}function xA({start:e,end:t,showSecondUnit:n}){if(!e||!t)return null;const i=t-e,o=1e3,a=6e4,s=36e5,l=24*s;let d="",c="";if(i<a){const e=i/o;d=`${En(e)} ${fA(e,n)}`}else if(i<s){const e=i/a;d=`${En(e)} ${gA(e,n)}`;const t=i%a/o;c=`${En(t)} ${fA(t,n)}`}else if(i<l){const e=i/s;d=`${En(e)} ${yA(e)}`;const t=i%s/a;c=`${En(t)} ${gA(t)}`}else{const e=i/l;d=`${En(e)} ${function(e){return e>=2?r._({id:"HuVZMK",message:"Days"}):r._({id:"H7OUPr",message:"Day"})}(e)}`;const t=i%l/s;c=`${En(t)} ${yA(t)}`}return n?`${d}${c}`.replaceAll(" ","").toLowerCase():d}function vA(e){const t=String(e);return 1===t.length?`0${t}`:t}function bA(e,t="/",{noYear:n}={}){const r=e.getFullYear(),i=e.getMonth()+1,o=e.getDate(),a=e.getHours(),s=e.getMinutes();let l=`${vA(i)}${t}${vA(o)} ${vA(a)}:${vA(s)}`;return n||(l=`${r}${t}${l}`),l}function AA({chainId:t,token:n,amount:r}){var i;const o=g(),a=lt((()=>_g.get(t)),[t]);return Os.jsxs(f,{sx:{display:"flex",flexDirection:"column"},children:[Os.jsxs(f,{sx:{mb:8,display:"flex",alignItems:"flex-end",alignSelf:"center"},children:[Os.jsx(ey,{address:null!==(i=null==n?void 0:n.address)&&void 0!==i?i:"",marginRight:0,width:28,height:28,url:null==n?void 0:n.logoURI}),a?Os.jsx(f,{component:a.logo,sx:{width:12,height:12,position:"relative",left:-6}}):""]}),Os.jsxs(f,{sx:{color:o.palette.text.primary,typography:"body1",fontWeight:600,width:"100%",wordBreak:"break-word",textAlign:"center"},children:[An({input:r,decimals:null==n?void 0:n.decimals})," ",null==n?void 0:n.symbol]}),Os.jsxs(f,{sx:{color:o.palette.text.secondary,typography:"h6",alignSelf:"center"},children:[Os.jsx(e,{id:"Fdp03t",message:"on"})," ",null==a?void 0:a.name]})]})}function wA({children:e}){const t=g();return Os.jsxs(f,{sx:{position:"relative",width:"calc(100% - 16px)",mx:"auto"},children:[Os.jsx(f,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",borderTopColor:t.palette.text.primary,borderTopWidth:1,borderTopStyle:"dashed","&:before":{content:'""',position:"absolute",left:0,top:-.5,backgroundColor:t.palette.text.primary,width:6,height:6,borderRadius:"50%",transform:"translate(-50%, -50%)"},"&:after":{display:{tablet:"block"},content:'""',position:"absolute",right:-1,top:-.5,width:0,height:0,transform:"translate(0, -50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderLeft:`6px solid ${t.palette.text.primary}`}}}),Os.jsx(f,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},children:e})]})}function kA({size:e="medium",toolDetails:t,nameMarginLeft:n=4,logoMarginLeft:r=0,nameSx:i}){const o=g();if(!t||!t.logoURI||!t.name)return null;const{logoURI:a,name:s}=t;return Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{component:"img",src:a,alt:s,sx:{marginLeft:r,width:"large"===e?24:16,height:"large"===e?24:16}}),Os.jsx(f,{sx:Object.assign({color:o.palette.text.primary,fontWeight:600,marginLeft:n,typography:{mobile:"small"===e?"h6":"medium"===e?"body2":"caption",tablet:"small"===e||"medium"===e?"body2":"caption"}},i),children:s})]})}var CA,jA,TA;function EA(e,{amount:t,contractAddress:r,offset:o,overrideBalance:a,skipQuery:s}={}){var l,d,c;const{account:u}=hf(),[p,h]=at.useMemo((()=>e?[e.chainId,null!=r?r:me[e.chainId].DODO_APPROVE]:[void 0,r]),[e,r]),m=Rt(),f=It(Object.assign(Object.assign({},$a.getFetchTokenQuery(s?void 0:p,null==e?void 0:e.address,u,h)),{refetchInterval:p===oe.NEOX?3e3:void 0})),{runningRequests:g}=Vy(),{updateBlockNumber:y}=wf(),{i18n:x}=n(),v=at.useMemo((()=>{var e;return p?null===(e=ue[p])||void 0===e?void 0:e.address:null}),[p]),b=at.useCallback((()=>{var n,r;if(!e)return jA.Loading;const s=g.some((t=>{var n,r,i;return(null===(n=t.spec)||void 0===n?void 0:n.opcode)===By.Approval&&(null===(r=t.spec)||void 0===r?void 0:r.token.address)===(null==e?void 0:e.address)&&(null===(i=t.spec)||void 0===i?void 0:i.contract)===h})),l=null!=a?a:null===(n=f.data)||void 0===n?void 0:n.balance,d=null===(r=f.data)||void 0===r?void 0:r.allowance,c=new i(t||0);if(!u)return jA.Unchecked;if(!l||c.minus(null!=o?o:0).gt(l))return jA.Unchecked;if(c.isZero())return jA.Unchecked;return e.address===v?jA.Sufficient:s?jA.Approving:d?c.minus(null!=o?o:0).gt(d)?jA.Insufficient:jA.Sufficient:jA.Loading}),[g,u,o,v,f.data,e,a,t,h]),{isApproving:A,isGetApproveLoading:w,needApprove:k,needReset:C}=at.useMemo((()=>{var t;const n=b(),r=function(e,t){var n;return("USDT"===(null==e?void 0:e.symbol)||(null===(n=null==e?void 0:e.address)||void 0===n?void 0:n.toLowerCase())==="0x6426e6017968377529487E0ef0aA4E7759724e05".toLowerCase())&&t&&t.gt(0)}(e,null===(t=f.data)||void 0===t?void 0:t.allowance);return{isApproving:n===jA.Approving,isGetApproveLoading:n===jA.Loading||f.isLoading,needApprove:n===jA.Insufficient&&!r,needReset:n===jA.Insufficient&&r}}),[b,e,null===(l=f.data)||void 0===l?void 0:l.allowance,f.isLoading]),j=Hy(),T=at.useMemo((()=>{if(!e)return"";return`${C?x._({id:"OfhWJH",message:"Reset"}):x._({id:"Z7ZXbT",message:"Approve"})} ${xs(e)}`}),[e,C,x._]),E=Ot({mutationFn:()=>Fn(this,void 0,void 0,(function*(){if(console.log("dev gonghe",h,u,e),!h||!u||!e)return;const t=C?new i(0):void 0;console.log("dev gonghe",t);const n=yield j.execute(T,{opcode:By.Approval,token:e,contract:h,amt:t},{metadata:{[Ey.approve]:!0}});console.log("dev gonghe",n),n===Sy.Success&&(yield y(),m.invalidateQueries({queryKey:$a.getFetchTokenQuery(p,null==e?void 0:e.address,u,h).queryKey,refetchType:"all"}))}))}),S=at.useCallback((()=>Fn(this,void 0,void 0,(function*(){E.mutate()}))),[E]),I=at.useCallback((()=>{var t;const n=new i(0);if(!e)return n.toString();const r=null!=a?a:null===(t=f.data)||void 0===t?void 0:t.balance;if(!r)return n.toString();return r.toString()}),[p,null===(d=f.data)||void 0===d?void 0:d.balance,a,e]),R=at.useMemo((()=>{var e,n;if(!t)return!1;return(null!==(n=null!=a?a:null===(e=f.data)||void 0===e?void 0:e.balance)&&void 0!==n?n:new i(0)).lt(t)}),[null===(c=f.data)||void 0===c?void 0:c.balance,a,t]),L=A||E.isPending;return{token:e,isApproving:L,isGetApproveLoading:w,needApprove:k,needReset:C,needShowTokenStatusButton:k||C||L||R,insufficientBalance:R,loading:f.isLoading,approveTitle:T,submitApprove:S,getMaxBalance:I}}function SA({fromToken:t,toToken:n,fromChainId:r,toChainId:i,fromAmount:o,toTokenAmount:a,toolDetails:s,product:l,executionDuration:d,feeUSD:c,selected:u,setSelected:p,spenderContractAddress:h,isBestPrice:m}){const y=g(),x=hA.find((e=>e.id===l)),{isApproving:v,needApprove:b}=EA(t,{amount:o,contractAddress:h}),w=lt((()=>{const e=[];return m&&e.push({type:"best-price"}),v||b?[...e,{type:"no-approve"}]:e}),[v,b,m]);return Os.jsxs(f,{sx:Object.assign({borderRadius:16,py:16,px:12,backgroundColor:y.palette.background.tag,cursor:"pointer","&:hover":{backgroundColor:"hover.default"},outline:0},u?{borderWidth:1,borderStyle:"solid",borderColor:y.palette.primary.main}:{}),onClick:p,children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap"},children:[Os.jsx(f,{component:null==x?void 0:x.logoURI,sx:{width:16,height:16}}),Os.jsx(f,{sx:{marginLeft:4},children:null==x?void 0:x.name}),Os.jsx(mA,{routeTagList:w})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",mt:8,pb:8,borderStyle:"dashed",borderWidth:y.spacing(0,0,1,0),borderColor:y.palette.border.main},children:[Os.jsx(A,{onlyHover:!0,placement:"top",title:Os.jsx(e,{id:"h5FVz1",message:"Estimated transaction time"}),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",px:8,py:4,border:`solid 1px ${y.palette.border.main}`,borderRadius:4,typography:"h6"},children:[Os.jsx(As.Time,{style:{color:y.palette.text.secondary,width:14,height:14}}),Os.jsx(f,{sx:{ml:4,lineHeight:1},children:null!==d?xA({start:Date.now(),end:Date.now()+1e3*d}):"-"})]})}),Os.jsx(A,{onlyHover:!0,placement:"top",title:Os.jsx(e,{id:"7IKPTP",message:"Fee includes: Cross Chain fees + Swap fees. Gas fee not included."}),children:Os.jsxs(f,{sx:{ml:8,display:"flex",alignItems:"center",px:8,py:4,border:`solid 1px ${y.palette.border.main}`,borderRadius:4,typography:"h6"},children:[Os.jsx(As.GasFee,{style:{color:y.palette.text.secondary,width:14,height:14}}),Os.jsx(f,{sx:{ml:4,lineHeight:1},children:null!==c?`$${An({input:c,decimals:6})}`:"-"})]})})]}),Os.jsxs(f,{sx:{display:"grid",gridTemplateColumns:"36% 28% 36%",mt:8},children:[Os.jsx(AA,{token:t,chainId:r,amount:o}),Os.jsx(wA,{children:Os.jsx(f,{sx:{display:"flex",px:3,py:3,backgroundColor:y.palette.background.paperContrast,border:`1px solid ${y.palette.border.main}`,borderRadius:"50%",alignItems:"center",width:24,height:24,overflow:"hidden"},children:Os.jsx(kA,{size:"medium",toolDetails:s,nameMarginLeft:8})})}),Os.jsx(AA,{token:n,chainId:i,amount:a})]})]})}function IA({open:t,onClose:n,selectedRouteId:r,setSelectRouteId:i,bridgeRouteList:o}){const a=g();return Os.jsx(yy,{open:t,onClose:n,id:"select-cross-chain",title:Os.jsx(e,{id:"K/PgcA",message:"Select Cross Chain"}),children:Os.jsx(f,{sx:{position:"relative",display:"flex",flexDirection:"column",gap:12,py:20,px:16,flex:1,overflowY:"auto",overflowX:"hidden","&::before":{content:'""',position:"absolute",top:0,width:1,height:"1px",backgroundColor:a.palette.border.main}},children:null==o?void 0:o.map(((e,t)=>Os.jsx(SA,{fromChainId:e.fromChainId,toChainId:e.toChainId,fromToken:e.fromToken,toToken:e.toToken,fromAmount:e.fromAmount,toTokenAmount:e.toTokenAmount,toolDetails:e.step.toolDetails,spenderContractAddress:e.spenderContractAddress,selected:r===e.id,setSelected:()=>{i(e.id),n()},isBestPrice:0===t,product:e.product,executionDuration:e.executionDuration,feeUSD:e.feeUSD},e.key)))})})}function RA({route:t,onClick:n}){var r,o;const a=g();if(!t)return null;const{product:s,executionDuration:l,feeUSD:d,fromAmount:c,fromToken:u,fromChainId:p,toTokenAmount:h,toToken:m,toChainId:y}=t,x=hA.find((e=>e.id===s));_g.get(p),_g.get(y);const[v,b]=at.useState(!1),w=v?m:u,k=v?u:m,C=v?y:p,j=v?p:y;return Os.jsxs(f,{sx:{px:16,py:8,width:"100%",backgroundColor:"background.tag",borderRadius:12,cursor:"pointer","&:hover":{backgroundColor:"hover.default"}},onClick:n,children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap"},children:[Os.jsx(f,{component:null==x?void 0:x.logoURI,sx:{width:16,height:16}}),Os.jsx(f,{sx:{mx:4,typography:"body2",fontWeight:600},children:null==x?void 0:x.name}),Os.jsx(A,{onlyHover:!0,placement:"top",title:Os.jsx(e,{id:"h5FVz1",message:"Estimated transaction time"}),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",px:8,py:4,border:`solid 1px ${a.palette.border.main}`,borderRadius:4,typography:"h6"},children:[Os.jsx(As.Time,{style:{color:a.palette.text.secondary,width:14,height:14}}),Os.jsx(f,{sx:{ml:4,lineHeight:1},children:null!==l?xA({start:Date.now(),end:Date.now()+1e3*l}):"-"})]})}),Os.jsx(A,{onlyHover:!0,placement:"top",title:Os.jsx(e,{id:"7IKPTP",message:"Fee includes: Cross Chain fees + Swap fees. Gas fee not included."}),children:Os.jsxs(f,{sx:{ml:8,display:"flex",alignItems:"center",px:8,py:4,border:`solid 1px ${a.palette.border.main}`,borderRadius:4,typography:"h6"},children:[Os.jsx(As.GasFee,{style:{color:a.palette.text.secondary,width:14,height:14}}),Os.jsx(f,{sx:{ml:4,lineHeight:1},children:null!==d?`$${An({input:d,decimals:6})}`:"-"})]})})]}),Os.jsx(f,{component:As.ArrowRight,sx:{width:18,height:18}})]}),Os.jsxs(f,{sx:{mt:8,display:"flex",alignItems:"center",typography:"body2",fontWeight:600,gap:4},children:[Os.jsxs("span",{children:["1 ",w.symbol]}),Os.jsx(ey,{address:null!==(r=null==w?void 0:w.address)&&void 0!==r?r:"",marginRight:0,width:20,height:20,url:null==w?void 0:w.logoURI,chainId:C,sx:{flexShrink:0}}),Os.jsx("span",{children:"="}),Os.jsxs("span",{children:[An({input:v?new i(c).div(h):h.div(c),decimals:null==k?void 0:k.decimals})," ",k.symbol]}),Os.jsx(ey,{address:null!==(o=null==k?void 0:k.address)&&void 0!==o?o:"",marginRight:0,width:20,height:20,url:null==k?void 0:k.logoURI,chainId:j,sx:{flexShrink:0}}),Os.jsx(I,{component:As.Switch,sx:{color:"text.secondary",position:"relative",left:-2},onClick:e=>{e.stopPropagation(),b((e=>!e))}})]})]})}function LA({route:e,bridgeOrderTxRequest:t}){const{chainId:n,account:i}=At(),o=Hy(),{apikey:a}=pf(),s=Gv(Ha.bridgeCreateRoute),l=ut((n=>{if(t&&e)try{const{fromToken:i,toToken:l,fromAmount:d,toTokenAmount:c,fromChainId:u,toChainId:p,toAddress:h,slippage:m,roundedRouteCostTime:g}=e,y=An({input:d,decimals:i.decimals}),x=An({input:c,decimals:l.decimals}),v=Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(ey,{token:i,sx:{width:16,height:16,mr:6},chainId:i.chainId}),`${y} ${null==i?void 0:i.symbol}`,Os.jsx(f,{component:As.DoubleRight,sx:{width:12,height:12,mx:16}}),Os.jsx(ey,{token:l,sx:{width:16,height:16,mr:6}}),`${x} ${null==l?void 0:l.symbol}`]}),b=(n,r)=>Fn(this,void 0,void 0,(function*(){const i=yield function(e){return Fn(this,arguments,void 0,(function*({apikey:e,tx:t,route:n,bridgeCreateRouteAPI:r,encodeId:i}){const{fromChainId:o,toChainId:a,fromAmount:s,fromToken:l,toToken:d,fromAddress:c,toAddress:u,slippage:p,product:h,step:m,sourceRoute:f,productParams:g}=n,{toAmount:y}=f,x={fromChainId:o,fromAmount:jn(s,l.decimals).toString(),fromTokenAddress:l.address,toChainId:a,toAmount:y,toTokenAddress:d.address,fromAddress:c,toAddress:u,slippage:p,hash:t,product:h,extend:{lifiBridge:m.tool,route:f,productParams:g,encodeId:i,source:"widget"}},v=(yield Ut.post(`${r}${e?`?apikey=${e}`:""}`,{data:x})).data.data;return null==v?void 0:v.id}))}({apikey:a,tx:n,route:e,bridgeCreateRouteAPI:s,encodeId:t.encodeId});r&&r(n,{orderId:i})})),A={fromChainId:u,toChainId:p,fromTokenAddress:i.address,toTokenAddress:l.address,fromTokenSymbol:i.symbol,toTokenSymbol:l.symbol,fromTokenAmount:d,toTokenAmount:c.toString(),slippage:m,sendAccount:h,roundedRouteCostTime:g};return o.execute(r._({id:"+uZnU3",message:"Cross Chain"}),Object.assign({opcode:By.TX},t),{subtitle:v,metadata:Object.assign({[Ey.crossChain]:!0},n),mixpanelProps:Object.assign(Object.assign(Object.assign({},t),{fromToken:i,toToken:l,pay:y,receive:x}),A),successBack:b})}catch(e){console.error(e)}}),[i,n,e,t,a,s]);return l}function MA({chainId:e,address:t,children:n}){const r=g();return Os.jsxs(f,{component:"a",href:ps(e,t,"tx"),target:"_blank",rel:"noopener noreferrer",sx:{color:r.palette.text.secondary,"&:hover":{color:r.palette.text.primary},display:"flex",alignItems:"center",typography:"body2"},children:[n,Os.jsx(f,{component:"svg",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",sx:{marginLeft:6,width:16,height:17},children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.33333 3.83333V13.1667H12.6667V8.5H14V13.1667C14 13.9 13.4 14.5 12.6667 14.5H3.33333C2.59333 14.5 2 13.9 2 13.1667V3.83333C2 3.1 2.59333 2.5 3.33333 2.5H8V3.83333H3.33333ZM9.33333 3.83333V2.5H14V7.16667H12.6667V4.77333L6.11333 11.3267L5.17333 10.3867L11.7267 3.83333H9.33333Z",fill:"currentColor"})})]})}function OA({fromChainId:t,toChainId:n,fromTokenAmount:r,toTokenAmount:i,fromTokenDecimals:o,fromTokenSymbol:a,toTokenDecimals:s,toTokenSymbol:l,fromHash:d,toHash:c,toolDetails:u}){const p=g(),[h,m]=lt((()=>[_g.get(t),_g.get(n)]),[t,n]);return Os.jsxs(f,{sx:{borderLeft:`1px dashed ${p.palette.text.primary}`,opacity:c?1:.5,pb:24},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"flex-start",flexWrap:"wrap"},children:[Os.jsx(f,{component:"img",src:u.logoURI,alt:u.name,sx:{width:20,height:20,marginLeft:-10.5,pt:1,backgroundColor:{mobile:p.palette.background.paper,tablet:p.palette.background.paper},alignSelf:"flex-start"}}),Os.jsx(f,{sx:{ml:8,typography:"body1"},children:u.name}),Os.jsxs(f,{sx:{typography:"body2",marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"flex-end",width:{mobile:"100%",tablet:"auto"},mt:{mobile:8,tablet:0}},children:[An({input:r,decimals:o})," ",a,Os.jsx("span",{style:{marginLeft:4,color:p.palette.text.secondary},children:Os.jsx(e,{id:"Z5HWHd",message:"On"})}),Os.jsx(f,{component:null==h?void 0:h.logo,sx:{marginLeft:4,width:18,height:18}}),Os.jsx("span",{style:{marginLeft:4,marginRight:4,color:p.palette.text.secondary},children:Os.jsx(e,{id:"/jQctM",message:"To"})}),An({input:i,decimals:s})," ",l,Os.jsx("span",{style:{marginLeft:4,color:p.palette.text.secondary},children:Os.jsx(e,{id:"Z5HWHd",message:"On"})}),Os.jsx(f,{component:null==m?void 0:m.logo,sx:{marginLeft:4,width:18,height:18}})]})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",mt:{mobile:8,tablet:5}},children:[Os.jsx(MA,{chainId:t,address:d,children:Os.jsx(e,{id:"wdxz7K",message:"Source"})}),Os.jsx(f,{sx:{width:16}}),Os.jsx(MA,{chainId:n,address:c,children:Os.jsx(e,{id:"Enslfm",message:"Destination"})})]})]})}function BA({chainId:t,fromTokenAmount:n,toTokenAmount:r,fromTokenDecimals:i,fromTokenSymbol:o,toTokenDecimals:a,toTokenSymbol:s,hash:l,toolDetails:d}){const c=g(),u=lt((()=>_g.get(t)),[t]);return Os.jsxs(f,{sx:{borderLeft:`1px dashed ${c.palette.text.primary}`,opacity:l?1:.5,pb:24},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"flex-start",flexWrap:"wrap"},children:[Os.jsx(f,{component:"img",src:d.logoURI,alt:d.name,sx:{width:20,height:20,marginLeft:-10.5,pt:1,backgroundColor:c.palette.background.paper,alignSelf:"flex-start"}}),Os.jsx(f,{sx:{ml:8,typography:"body1"},children:d.name}),Os.jsxs(f,{sx:{typography:"body2",marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"flex-end",width:{mobile:"100%",tablet:"auto"},mt:{mobile:8,tablet:0}},children:[An({input:n,decimals:i})," ",o,Os.jsx("span",{style:{marginLeft:4,marginRight:4,color:c.palette.text.secondary},children:Os.jsx(e,{id:"YHpbe1",message:"For"})}),An({input:r,decimals:a})," ",s,Os.jsxs(f,{sx:{alignItems:"center",display:{mobile:"none",tablet:"flex"}},children:[Os.jsx("span",{style:{marginLeft:4,color:c.palette.text.secondary},children:Os.jsx(e,{id:"Fdp03t",message:"on"})}),Os.jsx(f,{component:null==u?void 0:u.logo,sx:{marginLeft:4,width:18,height:18}}),Os.jsx(f,{component:"span",sx:{ml:4},children:null==u?void 0:u.name})]})]})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",typography:"body2",mt:{mobile:8,tablet:5}},children:[Os.jsxs(f,{sx:{alignItems:"center",display:{mobile:"flex",tablet:"none"}},children:[Os.jsx("span",{style:{color:c.palette.text.secondary},children:Os.jsx(e,{id:"Fdp03t",message:"on"})}),Os.jsx(f,{component:null==u?void 0:u.logo,sx:{marginLeft:4,width:18,height:18}}),Os.jsx(f,{component:"span",sx:{ml:4,mr:8},children:null==u?void 0:u.name})]}),Os.jsx(MA,{chainId:t,address:l,children:Os.jsx(e,{id:"S3piC2",message:"Tx"})})]})]})}function PA({marginTop:e=20,route:t}){const n=g(),{fromChainId:r,toChainId:i}=t,{step:{includedSteps:o}}=t,[a,s]=lt((()=>[_g.get(r),_g.get(i)]),[r,i]);return Os.jsxs(f,{sx:{mt:e,pl:10},children:[Os.jsx(f,{sx:{borderLeft:`1px dashed ${n.palette.text.primary}`,opacity:1,pb:24},children:Os.jsxs(f,{sx:{display:"flex",alignItems:"flex-start"},children:[Os.jsx(f,{component:null==a?void 0:a.logo,sx:{width:20,height:20,marginLeft:-10.5,pt:1,backgroundColor:n.palette.background.paper}}),Os.jsx(f,{sx:{ml:8,typography:"body1"},children:null==a?void 0:a.name})]})}),o.map(((e,t)=>{const{toolDetails:n,type:r,estimate:i}=e;return"swap"===r?Os.jsx(BA,{chainId:i.fromToken.chainId,fromTokenAmount:i.fromTokenAmount,toTokenAmount:i.toTokenAmount,fromTokenDecimals:i.fromToken.decimals,fromTokenSymbol:i.fromToken.symbol,toTokenDecimals:i.toToken.decimals,toTokenSymbol:i.toToken.symbol,hash:null,toolDetails:n},t):"cross"===r?Os.jsx(OA,{fromChainId:i.fromToken.chainId,toChainId:i.toToken.chainId,fromTokenAmount:i.fromTokenAmount,toTokenAmount:i.toTokenAmount,fromTokenDecimals:i.fromToken.decimals,fromTokenSymbol:i.fromToken.symbol,toTokenDecimals:i.toToken.decimals,toTokenSymbol:i.toToken.symbol,fromHash:null,toHash:null,toolDetails:n},t):null})),Os.jsx(f,{sx:{opacity:.5,pb:0},children:Os.jsxs(f,{sx:{display:"flex",alignItems:"flex-start"},children:[Os.jsx(f,{component:null==s?void 0:s.logo,sx:{width:20,height:20,marginLeft:-10.5,pt:1,backgroundColor:n.palette.background.paper}}),Os.jsx(f,{sx:{ml:8,typography:"body1"},children:null==s?void 0:s.name})]})})]})}function DA({route:t}){const n=g(),r=_g.get(t.fromChainId),i=lt((()=>ps(t.fromChainId,t.fromAddress,"address")),[t.fromAddress,t.fromChainId]);return Os.jsxs(f,{children:[Os.jsx(f,{sx:{py:12,borderStyle:"solid",borderWidth:n.spacing(1,0,0),borderColor:n.palette.border.main},children:Os.jsx(N,{children:Os.jsx(F,{initialEntered:!0,sx:{"& button.active svg":{transform:"rotate(0)"}},header:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body2"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(f,{component:As.DetailBorder,sx:{mr:6,width:18,height:18}}),Os.jsx(e,{id:"rRDi3Y",message:"Detail"})]}),Os.jsx(f,{component:As.CaretUp,sx:{width:12,height:12,color:"text.secondary",transform:"rotate(180deg)",transition:"transform 0.2s linear"}})]}),children:Os.jsxs(f,{sx:{mt:16},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsx(f,{sx:{typography:"body2",color:"text.secondary",flexShrink:0},children:Os.jsx(e,{id:"lt8yMa",message:"Send to:"})}),Os.jsxs(f,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center"},children:[r?Os.jsx(f,{component:r.logo,sx:{width:18,height:18}}):"",Os.jsx(f,{sx:{display:"inline-block",mx:6,width:"1px",height:12,backgroundColor:"border.main"}}),Os.jsx(f,{sx:{typography:"body2",fontWeight:600},children:us(t.fromAddress)}),Os.jsx(I,{component:"a",href:i,target:"_blank",rel:"noopener noreferrer",sx:{ml:6,width:18,height:18,color:"text.secondary"},children:Os.jsx(f,{component:As.ArrowTopRightBorder,sx:{width:18,height:18}})})]})]}),t.feeUSD?Os.jsxs(f,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",typography:"body2",color:"text.secondary",flexShrink:0},children:Os.jsx(e,{id:"PLUB/s",message:"Fee"})}),Os.jsxs(f,{sx:{typography:"body2"},children:["$",bn({input:t.feeUSD})]})]}):"",Os.jsxs(f,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",typography:"body2",color:"text.secondary",flexShrink:0},children:[Os.jsx(e,{id:"CMHmbm",message:"Slippage"}),Os.jsx(Ov,{onlyHover:!0,title:Os.jsx(e,{id:"KAmxpM",message:"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:6})]}),Os.jsxs(f,{sx:{typography:"body2"},children:[100*t.slippage,"%"]})]})]})})})}),Os.jsx(f,{sx:{py:12,borderStyle:"solid",borderWidth:n.spacing(1,0,0),borderColor:n.palette.border.main},children:Os.jsx(N,{children:Os.jsx(F,{initialEntered:!0,sx:{"& button.active svg":{transform:"rotate(0)"}},header:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body2"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(f,{component:As.DetailBorder,sx:{mr:6,width:18,height:18}}),Os.jsx(e,{id:"QNWt8A",message:"Estimated Time"})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[t.executionDuration?xA({start:Date.now(),end:Date.now()+1e3*t.executionDuration}):"-",Os.jsx(f,{component:As.CaretUp,sx:{ml:6,width:12,height:12,color:"text.secondary",transform:"rotate(180deg)",transition:"transform 0.2s linear"}})]})]}),children:Os.jsx(PA,{route:t})})})})]})}function NA({open:t,onClose:n,route:r,bridgeOrderTxRequest:i,clearToAmt:o,clearFromAmt:a}){const s=g(),{contractStatus:l}=yf(),d=LA({route:r,bridgeOrderTxRequest:i});return st((()=>{l!==gf.Pending&&n(),l===gf.TxSuccess&&(o(),a())}),[l]),Os.jsx(yy,{title:Os.jsx(e,{id:"tKE4Ak",message:"Cross Chain Summary"}),open:t,id:"cross-chain-summary",onClose:()=>{xf(gf.Initial),n()},children:Os.jsxs(Os.Fragment,{children:[r?Os.jsxs(f,{sx:{px:16,pb:20,flex:1,overflowY:"auto"},children:[Os.jsxs(f,{sx:{display:"grid",gridTemplateColumns:"36% 28% 36%",py:20,borderStyle:"solid",borderWidth:s.spacing(1,0,0),borderColor:s.palette.border.main},children:[Os.jsx(AA,{token:r.fromToken,chainId:r.fromChainId,amount:r.fromAmount}),Os.jsx(wA,{children:Os.jsx(f,{sx:{display:"flex",px:3,py:3,backgroundColor:s.palette.background.paperContrast,border:`1px solid ${s.palette.border.main}`,borderRadius:"50%",alignItems:"center",width:24,height:24,overflow:"hidden"},children:Os.jsx(kA,{size:"medium",toolDetails:r.step.toolDetails,nameMarginLeft:8})})}),Os.jsx(AA,{token:r.toToken,chainId:r.toChainId,amount:r.toTokenAmount})]}),Os.jsx(DA,{route:r})]}):"",Os.jsx(f,{sx:{px:16,py:20},children:Os.jsx(T,{fullWidth:!0,isLoading:l==gf.Pending,disabled:!r,onClick:()=>{d(),xf(gf.Pending)},children:l==gf.Pending?Os.jsx(e,{id:"P+K/3O",message:"Confirming"}):Os.jsx(e,{id:"PZqJog",message:"Confirm Cross Chain"})})})]})})}function FA({message:t,onClose:n}){return Os.jsx(yy,{open:!!t,onClose:n,id:"error-message",children:Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{flex:1,textAlign:"center"},children:[Os.jsx(f,{component:As.ErrorWarn,sx:{mt:60,width:64,height:64,color:"error.main"}}),t?Os.jsxs(f,{sx:{textAlign:"center",mt:60},children:[Os.jsx(f,{children:Os.jsx(e,{id:"kf83Ld",message:"Something went wrong."})}),Os.jsx(f,{sx:{color:"text.secondary",mt:12,typography:"body2",wordBreak:"break-all"},children:t})]}):""]}),Os.jsx(f,{sx:{px:16,py:20},children:Os.jsx(T,{onClick:n,fullWidth:!0,children:Os.jsx(e,{id:"1QfxQT",message:"Dismiss"})})})]})})}function WA(e){const t=dt(!1),[n,r]=ct(!1);return st((()=>{if(void 0===e)return;const n=function(e){const t=localStorage.getItem(e?lx:sx);return t?Number(t):null}(e);if(!t.current)return Af(n?n.toString():null),void(t.current=!0);Af(n?n.toString():null),r(!0);const i=setTimeout((()=>{r(!1)}),3e3);return()=>{clearTimeout(i)}}),[e]),n}function VA({side:e,defaultToken:t,tokenList:n,occupyToken:r,chainId:i}){var o,a;let s,l=null,d=n.filter((t=>!(t.side&&t.side!==e||i&&t.chainId!==i)));if(d.length||(d=n.filter((t=>!t.side||t.side===e))),d.length){let n=function(e){const t=localStorage.getItem("from"===e?ix:ox);if(!t)return null;try{return JSON.parse(t)}catch(e){return console.error(e),null}}(e);t&&(n=Object.assign({},t),s=t.amount),n&&(l=null!==(o=d.find((e=>e.address===(null==n?void 0:n.address)&&e.chainId===n.chainId)))&&void 0!==o?o:null),l||(r?l=null!==(a=d.find((e=>e.address!==r.address)))&&void 0!==a?a:null:[l]=d)}return{findToken:l,setDefaultAmount:s}}function UA({fromToken:e,toToken:t,setFromToken:n,setToToken:r,updateFromAmt:i,updateToAmt:o,setIsReverseRouting:a}){const{tokenList:s}=Jc(),{crossChain:l,defaultFromToken:d,defaultToToken:c,onlyChainId:u}=pf(),{autoConnectLoading:p}=yf(),{chainId:h,isActivating:m}=At();st((()=>{const f=setTimeout((()=>{m||(()=>{let m,f=null;if(!l&&p)return;const g=l?void 0:null!=u?u:h;if(!e){const e=VA({side:"from",defaultToken:d,tokenList:s,chainId:g});f=e.findToken,m=e.setDefaultAmount,f&&(n(f),void 0!==m&&(a(!1),i(m)))}if(!t){const{findToken:e,setDefaultAmount:t}=VA({side:"to",defaultToken:c,tokenList:s,occupyToken:f,chainId:g});e&&(r(e),void 0===m&&void 0!==t&&(a(!0),o(t)))}})()}),10);return()=>clearTimeout(f)}),[s,d,c,l,p,h,u,m])}!function(e){e.All="all"}(CA||(CA={})),function(e){e.Loading="Loading",e.Insufficient="ApprovalInsufficient",e.Approving="Approving",e.Sufficient="Sufficient",e.Unchecked="Unchecked"}(jA||(jA={})),function(e){e.Loading="Loading",e.Insufficient="BalanceInsufficient",e.Sufficient="Sufficient",e.Unchecked="Unchecked"}(TA||(TA={}));const HA=5,qA=e=>{const{defaultSlippage:t}=qv(void 0===e),n=yf((e=>e.slippage||t));return lt((()=>(void 0===e?Number(n):e)>HA),[n,e])};function ZA({fromToken:e,toToken:t,getAutoSlippage:n}){st((()=>{(()=>{Fn(this,void 0,void 0,(function*(){if(!n)return;const r=n({fromToken:e,toToken:t});if(void 0!==r&&"number"!=typeof r){var i;i=!0,yf.setState((e=>{var t,n;return{autoSlippage:{loading:i,value:null!==(n=null===(t=e.autoSlippage)||void 0===t?void 0:t.value)&&void 0!==n?n:null}}}));try{const e=yield r;bf({loading:!1,value:null!=e?e:null})}catch(e){console.error(e),bf({loading:!1,value:null})}}else bf({loading:!1,value:null})}))})()}),[e,t])}const zA=new fe({});function QA(){const{graphQLRequests:e}=pf();return null!=e?e:zA}function GA({fromToken:e,toToken:t}){var n,r,o,a;const{customSlippage:s,customSlippageNum:l,handleSlippageChange:d}=function({fromToken:e,toToken:t}){const{account:n}=At(),{customSwapPairSlippages:r}=eb(),i=at.useCallback((r=>{var i,o,a,s,l,d;const c=null!==(i=null==n?void 0:n.toLocaleLowerCase())&&void 0!==i?i:"",u=[r.from.toLocaleLowerCase(),r.to.toLocaleLowerCase()];return(null!==(a=null===(o=r.account)||void 0===o?void 0:o.toLocaleLowerCase())&&void 0!==a?a:"")===c&&r.chainId===(null==e?void 0:e.chainId)&&u.includes(null===(s=null==e?void 0:e.address)||void 0===s?void 0:s.toLocaleLowerCase())&&u.includes(null!==(d=null===(l=null==t?void 0:t.address)||void 0===l?void 0:l.toLocaleLowerCase())&&void 0!==d?d:"")}),[e,t,n]),o=e&&t?r.find(i):null,a=(null==o?void 0:o.disabled)?null:o,s=at.useCallback((r=>{eb.setState((o=>{var a,s,l;if(!e||!t)throw new Error("token is not valid.");const d=[...o.customSwapPairSlippages],c=Object.assign(Object.assign({},r),{account:null!==(a=null==n?void 0:n.toLowerCase())&&void 0!==a?a:"",from:e.address.toLowerCase(),to:t.address.toLowerCase(),fromSymbol:e.symbol,toSymbol:t.symbol,fromLogo:null!==(s=e.logoURI)&&void 0!==s?s:null,toLogo:null!==(l=t.logoURI)&&void 0!==l?l:null,chainId:e.chainId}),u=d.findIndex(i);return u>-1?d.splice(u,1,c):d.push(c),{customSwapPairSlippages:d}}))}),[n,e,t,i]),l=null==a?void 0:a.slippage;return{customSlippageNum:l?Number(l):0,customSlippage:l,handleSlippageChange:s}}({fromToken:e,toToken:t}),{defaultSlippage:c}=qv(!1),u=function({fromToken:e,toToken:t}){const n=QA().getQuery(se.graphql.fetchErc20ForecastSlippage,{where:{aToken:{address:null==e?void 0:e.address,chainId:null==e?void 0:e.chainId},bToken:{address:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}}}),r=It(Object.assign(Object.assign({},n),{enabled:!!e&&!!t})),i=at.useMemo((()=>{var e,t,n;if(!(null===(e=r.data)||void 0===e?void 0:e.erc20_extend_erc20ExtendV2))return{};const{erc20_extend_erc20ExtendV2:i}=r.data,o=(null===(t=i.forecastSlippageList)||void 0===t?void 0:t.length)?null===(n=[...i.forecastSlippageList])||void 0===n?void 0:n.map((e=>Object.assign(Object.assign({},e),{confidenceRatio:(null==e?void 0:e.confidenceRatio)?Number(e.confidenceRatio):0}))).sort(((e,t)=>(null==e?void 0:e.confidenceRatio)-(null==t?void 0:t.confidenceRatio))):[];return{recommendSlippage:o.length?o[o.length-1]:void 0,slippageList:o}}),[r.data]);return Object.assign({slippageData:i},r)}({fromToken:e,toToken:t}),p=null===(n=u.slippageData.recommendSlippage)||void 0===n?void 0:n.forecastSlippage,h=p?new i(p).times(100).toNumber():p;return{customSlippage:s,customSlippageNum:l,handleSlippageChange:d,forecastSlippage:h,forecastSlippageQuery:u,recommendSlippage:null!==(r=null!=h?h:c)&&void 0!==r?r:0,slippage:null!==(a=null!==(o=s?Number(s):void 0)&&void 0!==o?o:h)&&void 0!==a?a:c,slippageLoading:u.isLoading}}const YA="position-y-dot";function XA(){return Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:8},children:[Os.jsx(w,{width:"100%",height:12}),Os.jsx(w,{width:"100%",height:12})]})}function JA({data:e,loading:t}){var n,r;const i=g(),o=i.palette.primary.main,a=at.useRef(null),s=e.length;return Os.jsx(f,{sx:{height:105,flex:1,[`& .${YA}`]:{display:"none"}},ref:a,children:t?Os.jsx(XA,{}):Os.jsx(f,{component:Ht,sx:{typography:"h6","& .recharts-cartesian-axis text":{fill:i.palette.background.paperContrast}},children:Os.jsxs(qt,{data:e,margin:{top:0,right:0,left:0,bottom:0},children:[Os.jsx(Zt,{dataKey:"forecastSlippage",axisLine:!1,tickLine:!1,interval:"preserveStartEnd",tickFormatter:e=>Bn({input:e}),type:"number",domain:[s&&null!==(n=e[0].forecastSlippage)&&void 0!==n?n:0,s&&null!==(r=e[s-1].forecastSlippage)&&void 0!==r?r:"auto"]}),Os.jsx(zt,{dataKey:"confidenceRatio",axisLine:!1,tickLine:!1,hide:!0}),Os.jsx("defs",{children:Os.jsxs("linearGradient",{id:"count-linear",x1:"0",y1:"0",x2:"0",y2:"1",children:[Os.jsx("stop",{offset:"0",stopColor:o,stopOpacity:.3}),Os.jsx("stop",{offset:"100%",stopColor:o,stopOpacity:0})]})}),Os.jsx(Qt,{type:"monotone",dataKey:"confidenceRatio",stroke:o,strokeWidth:2,fill:"url(#count-linear)"}),e.map((e=>Os.jsx(Gt,{x:e.forecastSlippage,y:e.confidenceRatio,r:1,fill:i.palette.text.primary,stroke:"none",className:YA},e.confidenceRatio)))]})})})}var KA=at.memo(JA);const _A=W(V)((({theme:e})=>({height:2,padding:"15px 0",margin:0,"& .base-Slider-valueLabel":{fontSize:12,fontWeight:"normal",top:-6,backgroundColor:"unset",color:e.palette.text.primary,"&:before":{display:"none"},"& *":{background:"transparent",color:e.palette.text.primary}},"& .base-Slider-track":{display:"none"},"& .base-Slider-rail":{backgroundColor:e.palette.text.disabled,height:1,opacity:1},"& .base-Slider-mark":{display:"none",opacity:1,backgroundColor:e.palette.success.main,height:6,width:4,borderRadius:4},"& .base-Slider-markLabel":{display:"none",fontSize:"12px",lineHeight:"17px"}})));function $A(t){var{hidden:n,sx:r,value:i,color:o,min:a,max:s,formatValue:l,getSliderYPosition:d}=t,c=Nn(t,["hidden","sx","value","color","min","max","formatValue","getSliderYPosition"]);const{children:u}=c,p=Nn(c,["children"]),{isMobile:h}=U(),m=at.useRef(null),g=d(i),y=h?4:0,x=g?g-39-y:void 0,v=null!=o?o:"text.primary",b=i===a,A=i===s;return Os.jsxs(f,{...p,ref:m,sx:Object.assign({position:"absolute","&&&":{display:n?"none":"block",backgroundColor:"transparent",boxShadow:"none",bottom:8+y,width:"auto",height:"auto",top:"auto",marginLeft:0,transform:"none"}},r),children:[u,Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[x?Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{sx:{width:16,height:16,borderRadius:"50%",backgroundColor:v,borderStyle:"solid",borderWidth:2,borderColor:"background.paperContrast",flexShrink:1}}),Os.jsx(f,{sx:{height:x,width:"0",borderStyle:"dashed",borderWidth:1,borderColor:v}})]}):"",Os.jsx(f,{sx:{width:16,height:16,borderRadius:"50%",backgroundColor:v,borderStyle:"solid",borderWidth:2,borderColor:"background.paperContrast",flexShrink:1}}),Os.jsxs(f,{sx:Object.assign(Object.assign({typography:"h6",position:"absolute",bottom:-20,color:v,whiteSpace:"nowrap",backgroundColor:"background.paperContrast"},b?{left:0}:{}),A?{right:0}:{}),children:[A?Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{component:"span",sx:{color:"success.main"},children:Os.jsx(e,{id:"cOvZFM",message:"Dynamic"})}),Os.jsx("span",{children:" • "})]}):"",l(i)]})]})]})}function ew(e){var{hoverValue:t,formatValue:n,getSliderYPosition:r}=e,i=Nn(e,["hoverValue","formatValue","getSliderYPosition"]);const{isMobile:o}=U(),a=o?"primary.main":void 0,s=o?void 0:"primary.main";return Os.jsx(_A,{slots:{thumb:e=>{const l=i.value&&"number"==typeof i.value&&(i.min&&i.value<i.min||i.max&&i.value>i.max),d={value:i.value,min:i.min,max:i.max,hidden:!!l,color:a,formatValue:n,getSliderYPosition:r},c=Object.assign(Object.assign({},e),d);if(null!==t&&i.max&&i.min&&i.value!==t){const e=i.max-i.min,n=t-i.min,r=n?n/e*100:0;if(o){const e=!!t&&(!!i.min&&t<i.min||!!i.max&&t>i.max);return Os.jsxs(Os.Fragment,{children:[Os.jsx($A,{...d,value:t,color:s,hidden:e,sx:{left:r+"%"}}),Os.jsx($A,{...c})]})}return Os.jsxs(Os.Fragment,{children:[Os.jsx($A,{...c}),Os.jsx($A,{...d,value:t,hidden:!1,color:s,sx:{left:r+"%"}})]})}return Os.jsx($A,{...c})}},...i})}const tw=(e,{time:t=100,wrapper:n=document,retryCount:r=50}={})=>new Promise((i=>{n.querySelector(e)?i(!0):setTimeout((()=>Fn(void 0,void 0,void 0,(function*(){if(n.querySelector(e))i(!0);else if(r){const o=yield tw(e,{time:t,wrapper:n,retryCount:r-1});i(o)}else i(!1)}))),t)}));function nw({data:t,activeSlippage:n,loading:r,sx:o,handleChangeCustomSlippage:a}){const s=at.useMemo((()=>{var e;return null!==(e=null==t?void 0:t.length)&&void 0!==e?e:0}),[t]),{isMobile:l}=U(),[d,c]=at.useState([]),u=at.useRef(null);at.useEffect((()=>{(()=>{Fn(this,void 0,void 0,(function*(){var e;if(u.current&&s){const t=`.${YA}`;yield tw(t,{wrapper:u.current});const n=u.current.querySelectorAll(t),{y:r,height:i}=u.current.getBoundingClientRect(),o=null!==(e=null==n?void 0:n.length)&&void 0!==e?e:0,a=[];for(let e=0;e<o;e++){const t=n[e];const o=(t.children[0]?t.children[0].getBoundingClientRect().y:t.getBoundingClientRect().y)-r-.5;a.push(i-o)}c(a)}}))})()}),[s]);const p=(({activeSlippage:e,data:t,yPositions:n})=>{const[r,o]=at.useState(0),a=at.useMemo((()=>1e6),[]),[s,l]=at.useMemo((()=>{var e,n;const r=null==t?void 0:t.length;return r?[new i(null!==(e=t[0].forecastSlippage)&&void 0!==e?e:0).times(null!=a?a:0).dp(0,1).toNumber(),new i(null!==(n=t[r-1].forecastSlippage)&&void 0!==n?n:0).times(null!=a?a:0).dp(0,1).toNumber()]:[0,0]}),[t,a]),d=at.useCallback((e=>{if(void 0===e)return"";const n=new i(e);if((null==t?void 0:t.length)&&a){const e=t.find((e=>{var t;return new i(null!==(t=e.forecastSlippage)&&void 0!==t?t:0).times(a).dp(0,1).isEqualTo(n)}));if(null==e?void 0:e.forecastSlippage)return Bn({input:e.forecastSlippage,showDecimals:4})}return Bn({input:a?n.div(a):n,showDecimals:4})}),[a,t]),c=at.useCallback((e=>{let r=0;return e&&(null==t?void 0:t.length)&&a?(t.some(((o,s)=>{var l,d;const c=null!==(l=o.forecastSlippage)&&void 0!==l?l:0,u=new i(c).times(a).dp(0,1).toNumber();if(e===u)return r=n[s],!0;if(e<u){if(0===s)return r=0,!0;const o=c-(null!==(d=t[s-1].forecastSlippage)&&void 0!==d?d:0),l=n[s]-n[s-1],u=c-new i(e).div(a).toNumber();return r=n[s]-l/o*u,!0}})),r):r}),[n,t,a]),u=at.useCallback((e=>{o(e);const n=new i(e);let r,s=-1;if((null==t?void 0:t.length)&&a){s=t.findIndex((e=>{var t;return new i(null!==(t=e.forecastSlippage)&&void 0!==t?t:0).times(a).dp(0,1).isEqualTo(n)}));const e=-1!==s?t[s]:void 0;r=null==e?void 0:e.forecastSlippage}return r||(r=n.div(null!=a?a:0).toNumber()),r}),[t,a]);return at.useEffect((()=>{if(a&&e){const t=new i(e).times(a).dp(0,1);t.isEqualTo(r)||o(t.toNumber())}}),[e]),{min:s,max:l,value:r,decimalConversion:a,formatValue:d,getSliderYPosition:c,handleChangeValue:u}})({data:t,activeSlippage:n,yPositions:d}),{hoverValue:h,setHoverValue:m}=function(e,{slippageSlider:t}){const{isMobile:n}=U(),[r,o]=at.useState(null),a=at.useRef(!1);return at.useEffect((()=>{if(e.current&&t.max){const s=e.current;let{width:l,x:d}=s.getBoundingClientRect();const c=e=>{if(a.current)return;const n=e.pageX-d,s=t.max-t.min,c=new i(n/l*s).integerValue().plus(t.min).toNumber();c!==r&&o(c)},u=()=>{o(null)},p=()=>{a.current=!1},h=()=>{a.current=!0};return n||(s.addEventListener("mousemove",c),s.addEventListener("mouseleave",u),s.addEventListener("mouseup",p),s.addEventListener("mousedown",h)),()=>{n&&(s.removeEventListener("mousemove",c),s.removeEventListener("mouseleave",u),s.removeEventListener("mouseUp",p),s.removeEventListener("mouseDown",h))}}}),[e,n]),{hoverValue:r,setHoverValue:o}}(u,{slippageSlider:p}),{successRate:g,hoverSuccessRate:y}=function({data:e,activeSlippage:t,hoverValue:n,decimalConversion:r}){const o=at.useMemo((()=>{var n,r;let i="-";if(t&&(null==e?void 0:e.length)){const o=e.some(((n,r)=>{var o,a,s,l,d,c;const u=null!==(o=n.forecastSlippage)&&void 0!==o?o:0;if(t===u)return i=Bn({input:null!==(a=null==n?void 0:n.confidenceRatio)&&void 0!==a?a:0}),!0;if(t<u){if(0===r)i=`< ${Bn({input:null!==(s=null==n?void 0:n.confidenceRatio)&&void 0!==s?s:0})}`;else{const t=Bn({input:null!==(d=null===(l=e[r-1])||void 0===l?void 0:l.confidenceRatio)&&void 0!==d?d:0}),o=Bn({input:null!==(c=null==n?void 0:n.confidenceRatio)&&void 0!==c?c:0});i=`${t} - ${o}`}return!0}return!1}));o||(i=`> ${Bn({input:null!==(r=null===(n=e[e.length-1])||void 0===n?void 0:n.confidenceRatio)&&void 0!==r?r:0})}`)}return i}),[e,t]),a=at.useMemo((()=>{var t,o;let a="";if(n&&(null==e?void 0:e.length)&&r){const s=e.some(((t,o)=>{var s,l,d,c,u,p;const h=null!==(s=t.forecastSlippage)&&void 0!==s?s:0,m=new i(h).times(r).dp(0,1).toNumber();if(n===m)return a=Bn({input:null!==(l=null==t?void 0:t.confidenceRatio)&&void 0!==l?l:0}),!0;if(n<m){if(0===o)a=`< ${Bn({input:null!==(d=null==t?void 0:t.confidenceRatio)&&void 0!==d?d:0})}`;else{const n=Bn({input:null!==(u=null===(c=e[o-1])||void 0===c?void 0:c.confidenceRatio)&&void 0!==u?u:0}),r=Bn({input:null!==(p=null==t?void 0:t.confidenceRatio)&&void 0!==p?p:0});a=`${n} - ${r}`}return!0}return!1}));s||(a=`> ${Bn({input:null!==(o=null===(t=e[e.length-1])||void 0===t?void 0:t.confidenceRatio)&&void 0!==o?o:0})}`)}return a}),[n,r,e]);return{successRate:o,hoverSuccessRate:a}}({data:t,activeSlippage:n,hoverValue:h,decimalConversion:p.decimalConversion});return t?Os.jsxs(f,{sx:Object.assign({p:12,pb:28,borderRadius:12,backgroundColor:"background.paperContrast"},o),children:[Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{sx:{typography:"h6",fontWeight:600,color:"text.secondary"},children:Os.jsx(e,{id:"88dol0",message:"Success Rate"})}),Os.jsx(D,{loading:r,loadingProps:{width:100},sx:{mt:4,typography:"caption",color:y?"primary.main":"text.primary"},children:y||g})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"flex-end",pr:4},children:[Os.jsx(f,{sx:{pb:8,mr:16,typography:"h6",fontWeight:600},children:Os.jsx(e,{id:"CMHmbm",message:"Slippage"})}),Os.jsxs(f,{sx:{flex:1},ref:u,children:[Os.jsx(KA,{data:t,loading:r}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",color:"text.secondary"},children:!r&&s?Os.jsx(ew,{value:l?h||-1:p.value,min:p.min,max:p.max,disabled:!l,marks:[{value:p.max,label:p.max}],formatValue:p.formatValue,getSliderYPosition:p.getSliderYPosition,hoverValue:l?p.value:h,onChange:(e,t)=>{if("number"==typeof t){if(l)return void m(t);const e=p.handleChangeValue(t);a(e)}},onChangeCommitted:()=>{m(null)}}):""})]})]})]}):null}var rw,iw,ow=at.memo(nw);function aw({title:t,desc:n,doNotChecked:r,onChangeDoNotChecked:i}){const o=g();if(lt((()=>r),[]))return null;const a=o.palette.warning.main;return Os.jsxs(f,{sx:{backgroundColor:C(a,.1),borderRadius:8,padding:12},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,typography:"body2",color:a,fontWeight:700},children:[Os.jsx(As.Warn,{}),t]}),Os.jsx(f,{sx:{mt:8,typography:"body2",fontWeight:500,color:o.palette.text.secondary,textAlign:"center"},children:n}),!!i&&Os.jsxs(f,{sx:{width:"100%",mt:20,color:o.palette.text.secondary,typography:"h6",fontWeight:500,display:"flex",alignItems:"center",justifyContent:"center",gap:8,cursor:"pointer"},component:"label",children:[Os.jsx(S,{checked:r,size:16,onChange:e=>{const{checked:t}=e.target;i(t)}}),Os.jsx(e,{id:"3WdxUv",message:"Do not remind again"})]})]})}function sw({fromToken:t,toToken:n}){var o,a;const s=g(),{slippageAdvanced:l,notRemindAgainSlippageHigher:d,notRemindAgainSlippageLower:c}=eb(),{customSlippage:u,customSlippageNum:p,handleSlippageChange:h,forecastSlippage:m,forecastSlippageQuery:y,recommendSlippage:x}=GA({fromToken:t,toToken:n}),b=!!m,[w,k]=at.useState(!1),[j,T]=at.useState();!j&&t&&n&&T(u?rw.custom:rw.recommend);const E=j===rw.custom,I=at.useRef(null),R=at.useMemo((()=>j===rw.custom?p?new i(p).div(100).toNumber():void 0:new i(x).div(100).toNumber()),[j,x,p]),L=at.useCallback((e=>{E||T(rw.custom),h({slippage:new i(e).times(100).toString(),disabled:!1,deleted:!1,recommend:String(x)})}),[E,x,h]);return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{mt:24,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",fontWeight:600},children:[Os.jsx(e,{id:"x6GJ4a",message:"Max Slippage"}),Os.jsx(P,{title:Os.jsxs(Os.Fragment,{children:[Os.jsx(e,{id:"mFXnIs",message:"The dynamic slippage is provided by DODO team through analyzing historical transactions."}),Os.jsx("br",{}),Os.jsxs(f,{component:"a",href:r._({id:"zABfk1",message:"https://blog.dodoex.io/introducing-the-dodo-smart-slippage-3d32d13a4fef"}),target:"_blank",rel:"noopener noreferrer",sx:{color:"primary.main",textDecoration:"underline"},onClick:e=>{e.stopPropagation()},children:[Os.jsx(e,{id:"NgeSlx",message:"Learn More"}),">"]})]}),ml:7})]}),y.isLoading||(null===(o=y.slippageData.slippageList)||void 0===o?void 0:o.length)?Os.jsxs(D,{loading:y.isLoading,loadingProps:{width:100},component:"label",sx:{display:"flex",alignItems:"center",gap:8,typography:"body2",cursor:"pointer",color:"text.secondary"},children:[Os.jsx(e,{id:"sxkWRg",message:"Advanced"}),Os.jsx(S,{sx:{top:-1},size:16,checked:l,onChange:e=>{const{checked:t}=e.target;eb.setState({slippageAdvanced:t})}})]}):""]}),!!j&&Os.jsxs(H,{value:j,onChange:(e,t)=>{T(t),t===rw.custom&&k(!0)},children:[Os.jsxs(q,{variant:"inPaper",sx:{mt:16,'&:not(:hover) [aria-selected="true"] .weak':{color:C(s.palette.secondary.contrastText,.5)}},children:[Os.jsx(Z,{value:rw.recommend,variant:"inPaper",sx:{position:"relative"},children:Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{component:"span",sx:{position:"absolute",top:4,left:4,ml:4,typography:"h6",fontWeight:600,padding:s.spacing(0,8),borderRadius:4,backgroundColor:E?C(s.palette.purple.main,.1):"#FFF"},children:Os.jsx(f,{component:"span",sx:{background:E?`linear-gradient(90deg, ${s.palette.purple.main} -1.33%, ${"dark"===s.palette.mode?"#E6D9FF":"#BFAFF3"} 98.67%)`:`linear-gradient(90deg, ${s.palette.purple.main} -1.33%, #BFAFF3 98.67%)`,backgroundClip:"text",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:"New"})}),Os.jsxs(f,{sx:{textAlign:"center"},children:[b?Os.jsxs(f,{sx:{flexGrow:1,typography:"body2",fontWeight:600},children:[x.toString()||"-","%"]}):Os.jsx(A,{title:Os.jsx(e,{id:"wSpNR+",message:"This trading pair does not have enough historical data and has used the default dynamic slippage."}),sx:{ml:0,maxWidth:240},children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",typography:"body2",fontWeight:600,color:s.palette.warning.main,gap:4},children:[Os.jsx(f,{component:As.Alarm,sx:{position:"relative",top:-2,width:18,height:18}}),Os.jsxs("span",{children:[x.toString()||"-","%"]})]})}),Os.jsx(f,{sx:{typography:"h6",fontWeight:600},className:"weak",children:Os.jsx(e,{id:"cOvZFM",message:"Dynamic"})})]})]})}),Os.jsx(Z,{value:rw.custom,variant:"inPaper",sx:{position:"relative",p:0},children:Os.jsxs(f,{sx:{px:16,py:12,typography:"body2",fontWeight:600,textAlign:"center"},onClick:()=>{setTimeout((()=>{k(!0)}))},children:[w?Os.jsx(v,{ref:I,placeholder:"-",sx:{backgroundColor:"transparent",borderWidth:0,"& input":{textAlign:"center",typography:"body2",p:0,boxSizing:"border-box",height:19,color:E?s.palette.secondary.contrastText:s.palette.text.secondary,"&::placeholder":{color:"custom.input.placeholder",opacity:1}}},inputMode:"decimal",value:u||"",autoFocus:!0,onChange:e=>{const t=e.target.value;h({slippage:t,disabled:!1,recommend:String(x)})},onBlur:()=>{setTimeout((()=>{if(k(!1),!p)return void T(rw.recommend);const e=!p||p<0;e&&u&&h({slippage:u,disabled:e,deleted:e,recommend:String(x)})}),10)},onKeyDown:e=>{var t;"Enter"===e.code&&(e.preventDefault(),null===(t=I.current)||void 0===t||t.blur())}}):Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,color:u&&E?s.palette.warning.main:void 0},children:[u&&Os.jsx(f,{component:As.Alarm,sx:{position:"relative",top:-2,width:18,height:18}}),u||"-","%"]}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",typography:"h6",fontWeight:600},className:"weak",children:Os.jsx(e,{id:"8Tg/JR",message:"Custom"})})]})})]}),Os.jsx(z,{value:rw.recommend,children:(null===(a=y.slippageData.slippageList)||void 0===a?void 0:a.length)&&l?Os.jsx(ow,{data:y.slippageData.slippageList,activeSlippage:R,loading:y.isLoading,handleChangeCustomSlippage:L,sx:{mt:8}}):""}),Os.jsxs(z,{value:rw.custom,children:[Os.jsx(f,{sx:{mt:8}}),p>x&&Os.jsx(aw,{title:r._({id:"8XNsbx",message:"Higher than dynamic slippage"}),desc:r._({id:"iLj1a9",message:"Dynamic slippage is {recommendSlippage}%,the current slippage setting is higher than the dynamic slippage, which means you are willing to accept a worse final execution price.",values:{recommendSlippage:x}}),doNotChecked:d,onChangeDoNotChecked:e=>eb.setState({notRemindAgainSlippageHigher:e})}),!!p&&p<x&&Os.jsx(aw,{title:r._({id:"TTlkRL",message:"Lower than dynamic slippage"}),desc:r._({id:"yq+Q9s",message:"Dynamic slippage is {recommendSlippage}% , the current slippage setting may increase the failure rate of transactions.",values:{recommendSlippage:x}}),doNotChecked:c,onChangeDoNotChecked:e=>eb.setState({notRemindAgainSlippageLower:e})})]})]})]})}function lw({checked:t,onChange:n,sx:r,disabled:i}){const o=g();let a=o.palette.background.paper;return t&&(a=o.palette.secondary.main),Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",position:"relative",borderRadius:8,backgroundColor:o.palette.background.input,opacity:i?.5:1},r),component:y,disabled:i,onClick:()=>{i||n(!t)},children:[Os.jsx(f,{sx:{typography:"body2",fontWeight:600,pl:12,pr:13,pt:8,pb:9,width:"50%",zIndex:1,color:o.palette.text.primary,whiteSpace:"nowrap"},children:Os.jsx(e,{id:"az8lvo",message:"Off"})}),Os.jsx(f,{sx:{typography:"body2",fontWeight:600,pl:12,pr:13,pt:8,pb:9,width:"50%",zIndex:1,color:t?o.palette.secondary.contrastText:o.palette.text.primary,whiteSpace:"nowrap"},children:Os.jsx(e,{id:"Z5HWHd",message:"On"})}),Os.jsx(f,{sx:{borderRadius:6,backgroundColor:a,zIndex:0,position:"absolute",top:2,bottom:2,width:"calc(50% - 2px - 2px)",left:t?"calc(50% + 2px)":"2px",transition:"left 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, transform 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"}})]})}function dw({show:t,onClick:n}){const r=g();return Os.jsxs(I,{weak:!0,sx:{display:t?"flex":"none",alignItems:"center",position:"absolute",bottom:28,left:"50%",transform:"translateX(-50%)",p:r.spacing(8,20),fontWeight:600,borderRadius:20,border:`solid 1px ${r.palette.border.main}`,backgroundColor:"background.paperContrast",boxShadow:`0px 8px 16px 0px ${C("light"===r.palette.mode?"#FFF":"#000",.1)}`,cursor:"pointer",whiteSpace:"nowrap",gap:4},onClick:n,children:[Os.jsx(e,{id:"F8yRdq",message:"More trade settings"}),Os.jsx(f,{component:"svg",width:25,height:24,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",sx:{color:"text.secondary"},children:Os.jsx("path",{d:"M12.5 19L6.5 13L7.9 11.6L12.5 16.175L17.1 11.6L18.5 13L12.5 19ZM12.5 13L6.5 6.99998L7.9 5.59998L12.5 10.175L17.1 5.59998L18.5 6.99998L12.5 13Z",fill:"currentColor"})})]})}function cw({open:t,onClose:n,fromToken:r,toToken:i}){const o=g(),{ddl:a,expertMode:s,disableIndirectRouting:l}=eb(),c=at.useRef(null),[u,p]=at.useState(!1);return at.useEffect((()=>{const e=c.current,t=new ResizeObserver((()=>{e&&p(e.scrollHeight!==e.offsetHeight)})),n=d((()=>{if(!e)return;const t=e.scrollTop+e.clientHeight<e.scrollHeight-2;p(t)}),50);return e&&(p(e.scrollHeight!==e.clientHeight),t.observe(e),e.addEventListener("scroll",n)),()=>{e&&(t.unobserve(e),e.removeEventListener("scroll",n))}}),[null==c?void 0:c.current]),Os.jsx(yy,{open:t,onClose:n,id:"swap-settings",title:Os.jsx(e,{id:"Tz0i8g",message:"Settings"}),children:Os.jsxs(f,{sx:{px:20,pb:34,overflowY:"auto"},ref:c,children:[Os.jsx(sw,{fromToken:r,toToken:i}),Os.jsxs(f,{sx:{mt:24,pt:14,borderTop:`solid 1px ${o.palette.border.main}`},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",fontWeight:600},children:[Os.jsx(e,{id:"zSMRJ/",message:"Transaction Deadline"}),Os.jsx(Ov,{title:Os.jsx(e,{id:"wmCrk7",message:"You may modify the transaction deadline, the maximum time allowed for a trade to be processed on-chain. However, please note that this may lead to your trade executing at a subpar price, as the market price may change during that time."}),ml:7})]}),Os.jsxs(f,{sx:{mt:16,display:"flex",alignItems:"center",gap:8,typography:"body2"},children:[Os.jsx(v,{sx:{width:80,height:34,lineHeight:1,typography:"body2","& input":{px:16,py:6}},placeholder:String(Fv),value:a,onChange:e=>{eb.setState({ddl:e.target.value})}}),Os.jsx(e,{id:"H9HlDe",message:"minutes"})]})]}),Os.jsx(f,{sx:{display:"flex",flexDirection:"column",gap:12,mt:24,pt:14,borderTop:`solid 1px ${o.palette.border.main}`},children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsxs(f,{sx:{fontWeight:600},children:[Os.jsx(e,{id:"MXQodB",message:"Disable Indirect Routing"}),Os.jsx(Ov,{title:Os.jsx(e,{id:"Y0Knz4",message:"Checking this option means that the routing algorithm will only route to liquidity pools between the two tokens in the trading pair and will ignore routes with any intermediary tokens."}),ml:7})]}),Os.jsx(lw,{checked:l,onChange:e=>{eb.setState({disableIndirectRouting:e})}})]})}),Os.jsx(dw,{show:u,onClick:()=>{var e,t;null===(e=c.current)||void 0===e||e.scrollTo({top:null===(t=c.current)||void 0===t?void 0:t.scrollHeight,behavior:"smooth"})}})]})})}function uw({getAutoSlippage:t,onPayTokenChange:n,onReceiveTokenChange:o,disabledFiatPrice:a,border:s,powered:l}={}){var d,u,p;const h=g(),{isInflight:m}=Vy(),{chainId:v,account:b}=At(),{defaultChainId:w,noPowerBy:k,onlyChainId:C}=pf(),[j,E]=ct(!1),S=lt((()=>{var e;return null===(e=ue[null!=v?v:w])||void 0===e?void 0:e.address}),[v]),[I,R]=ct(""),[L,M]=ct(""),[O,B]=ct(""),[P,D]=ct(""),N=lt((()=>c((e=>B(e)),300)),[]),F=lt((()=>c((e=>D(e)),300)),[]),[W,V]=ct(null),[U,H]=ct(null),[q,Z]=ct(!1),[z,Q]=ct(!1),G=lt((()=>{if(W&&U)return!(!(null==W?void 0:W.chainId)||!(null==U?void 0:U.chainId)||W.chainId===U.chainId)}),[W,U]),{toFiatPrice:Y,fromFiatPrice:X}=Yv(a?{toToken:null,fromToken:null}:{toToken:U,fromToken:W}),{marginAmount:J}=function({token:e,fiatPrice:t}){return{marginAmount:lt((()=>{var n;const r=null!==(n=null==e?void 0:e.decimals)&&void 0!==n?n:6,o=null!=t?new i(500).div(t):new i(0),a=jn(o,r);return(a.lt(new i(1).times(new i(10).pow(r-3)))?new i(0):a).toString(10)}),[null==e?void 0:e.decimals,t])}}({token:j?U:W,fiatPrice:j?Y:X});ZA({fromToken:W,toToken:U,getAutoSlippage:t});const{slippage:K,slippageLoading:_}=GA({fromToken:W,toToken:U}),$=function(e){const{account:t,chainId:n}=hf(),{latestBlockNumber:r}=yf(),i=ue[null!=e?e:n],o=$a.getFetchTokenQuery(e,null==i?void 0:i.address,t);return It(Object.assign(Object.assign({},o),{queryKey:[...o.queryKey,r]}))}(null==W?void 0:W.chainId),{bridgeRouteList:ee,status:te}=function({toToken:e,fromToken:t,fromAmount:n}){const{account:r,provider:o}=At(),{defaultSlippage:a,loading:s}=qv(!0),l=yf((e=>e.slippage||a)),{apikey:d}=pf(),[c,u]=ct(nb.Initial),[p,h]=ct([]),m=Gv(Ha.bridgeRoutePrice),f=ut((()=>Fn(this,void 0,void 0,(function*(){var a;const c=null==t?void 0:t.chainId,p=null==e?void 0:e.chainId;if(!(c&&p&&c!==p&&t&&e&&n))return void u(nb.Initial);if(u(nb.Loading),s)return;const f=t.address,g=e.address,y=r||Xv,x=r||Xv,v=Number(l)/100,b={fromAddress:y,fromAmount:re(String(n||1),t.decimals).toString(),fromChainId:c,fromTokenAddress:f,toAddress:x,toChainId:p,toTokenAddress:g,options:{slippage:v},products:["lifi","hyphen","nabox","bungee","swft","stargate","connext","squid","across","layerswap","okx","symbiosis","scroll","manta","orbiter","dodo"]};try{const s=Date.now(),l=(yield Ut.post(`${m}${d?`?apikey=${d}`:""}`,{data:b})).data.data,f=[];if((null===(a=null==l?void 0:l.routes)||void 0===a?void 0:a.length)&&l.routes.forEach(((r,o)=>{if(r){const{toAmount:a,feeUSD:l,executionDuration:d,product:u,step:h,fee:m,encodeParams:g,productParams:b}=r;if(h&&null!==a){const r=new i(a);if(!r.isNaN()&&r.gt(0)){const{tool:A,toolDetails:w,type:k,includedSteps:C,approvalAddress:j}=h;if(C&&C.length>0&&A&&w&&w.name&&w.logoURI&&k&&j){const h=[];if(C.forEach((e=>{e&&e.id&&e.type&&e.tool&&e.toolDetails&&e.toolDetails.name&&e.toolDetails.logoURI&&e.estimate&&e.estimate.fromAmount&&e.estimate.fromToken&&e.estimate.fromToken.decimals&&e.estimate.toAmount&&e.estimate.toToken&&e.estimate.toToken.decimals&&h.push({id:e.id,tool:e.tool,toolDetails:{name:e.toolDetails.name,logoURI:e.toolDetails.logoURI},type:e.type,estimate:{fromToken:e.estimate.fromToken,toToken:e.estimate.toToken,fromTokenAmount:new i(e.estimate.fromAmount).div(`1e${e.estimate.fromToken.decimals}`),toTokenAmount:new i(e.estimate.toAmount).div(`1e${e.estimate.toToken.decimals}`)}})})),h.length>0){const i={key:`${u}-${a}-${l}-${o}`,id:u,fromChainId:c,toChainId:p,fromToken:t,toToken:e,fromAmount:n,toTokenAmount:r.div(`1e${e.decimals}`),fromAddress:y,toAddress:x,product:u,slippage:v,roundedRouteCostTime:(Date.now()-s)/1e3,spenderContractAddress:null!=j?j:"0x",feeUSD:l,executionDuration:d,step:{tool:A,toolDetails:{name:w.name,logoURI:w.logoURI},type:k,includedSteps:h},encodeParams:g,productParams:b,sourceRoute:{toAmount:a,feeUSD:l,executionDuration:d,step:{tool:A,toolDetails:w,type:k,approvalAddress:j,includedSteps:C},fee:m}};f.push(i)}}}}}})),h(f),f.length?u(nb.Success):u(nb.Failed),!r||!o)return}catch(e){u(nb.Failed),console.error(e)}}))),[r,e,l,t,o,n,d,m,s]);return Qv({refetch:f}),{status:c,refetch:f,bridgeRouteList:lt((()=>n?p:[]),[c,n,p])}}({toToken:U,fromToken:W,fromAmount:O}),[ne,ie]=ct(!1),[ae,se]=ct(""),le=lt((()=>!ae&&ee.length?ee[0].id:ae),[ae,ee]),de=lt((()=>ee.find((e=>e.id===le&&e.fromAddress===b))),[ee,le,b]);st((()=>{!de&&ae&&se("")}),[de]);const{isApproving:ce,isGetApproveLoading:pe,needApprove:he,insufficientBalance:me,submitApprove:fe,getMaxBalance:ge}=EA(W,{amount:O,contractAddress:null==de?void 0:de.spenderContractAddress}),ye=ut((()=>{Ne(ge())}),[ge]),xe=lt((()=>!(!b||me||ce||pe||he)),[b,me,ce,pe,he]),{status:ve,rawBrief:be,executeSwap:Ae,reset:we}=ob({toToken:U,fromToken:W,marginAmount:J,fromAmount:O,toAmount:P,estimateGas:xe,isReverseRouting:j,slippage:K,slippageLoading:_}),{resAmount:ke,priceImpact:Ce,baseFeeAmount:je,additionalFeeAmount:Te,resPricePerToToken:Ee,resPricePerFromToken:Se}=lt((()=>be||{resAmount:null,priceImpact:null,baseFeeAmount:null,additionalFeeAmount:null,resPricePerToToken:null,resPricePerFromToken:null}),[be]),{sendRouteLoading:Ie,sendRouteError:Re,setSendRouteError:Le,bridgeOrderTxRequest:Me,handleClickSend:Oe}=function(){const{provider:e}=At(),[t,n]=ct(),[i,o]=ct(!1),[a,s]=ct(""),{apikey:l}=pf(),d=Gv(Ha.bridgeEncode),c=ut((t=>Fn(this,[t],void 0,(function*({selectedRoute:t,fromEtherTokenBalance:i,goNext:a}){var c,u;if(!t||!e||!i)return;const{encodeParams:p}=t;if(p){if(p.fromAddress===Xv)throw new Error("fromAddress is not valid.");s(""),o(!0);try{const{fromToken:h,fromAmount:m,product:f}=t,g={product:f,encodeParams:p},y=(yield Ut.post(`${d}${l?`?apikey=${l}`:""}`,{data:g})).data.data,{data:x,to:v,value:b,from:A,chainId:w,encodeId:k}=y;if(!(x&&v&&b&&A&&w))throw new Error("cross_chain_swap_transactionEncode is null");const C=ue[w],j=Tn(b,18),T=C&&h.address.toLowerCase()===C.address.toLowerCase(),E=j.minus(T?m:0);if(!j.isNaN()&&j.gt(0)&&i.lt(j))return s(r._({id:"F9xwHA",message:"Insufficient cross-chain fees, need at least {0} {1}",values:{0:An({input:E,decimals:null!==(c=null==C?void 0:C.decimals)&&void 0!==c?c:18}),1:null!==(u=null==C?void 0:C.symbol)&&void 0!==u?u:"-"}})),void o(!1);if(!(yield Ly({from:A,to:v,value:b,data:x},e)))throw new Error("failed to estimate gas");n({data:x,to:v,value:b,from:A,chainId:w,encodeId:k}),a()}catch(e){console.error("[failed to construct transaction request]: ",e);const{message:t}=e;s(t)}o(!1)}}))),[n,o,e,d]);return{apikey:l,sendRouteLoading:i,sendRouteError:a,setSendRouteError:s,bridgeOrderTxRequest:t,handleClickSend:c}}(),[Be,Pe]=ct(!1),De=WA(G),Ne=ut((e=>{const t=e.toString();R(t),N(t),we()}),[R,N,we]),Fe=ut((e=>{const t=e.toString();M(t),F(t),we()}),[M,F,we]),We=ut((e=>V((t=>{var r;const i="function"==typeof e?e(t):e;return v||yf.setState({fromTokenChainId:null!==(r=null==i?void 0:i.chainId)&&void 0!==r?r:void 0}),n&&i&&i!==t&&n(i),i}))),[n,v]),Ve=ut((e=>H((t=>{const n="function"==typeof e?e(t):e;return o&&n&&n!==t&&o(n),n}))),[o]);UA({fromToken:W,toToken:U,setFromToken:We,setToToken:Ve,updateFromAmt:Ne,updateToAmt:Fe,setIsReverseRouting:E});const Ue=ut((()=>{Ne(""),Fe(""),We(U),Ve(W),ax("from",U),ax("to",W),se("")}),[We,U,Ve,W,Ne,Fe,se]),He=ut(((e,t)=>{if(t)return Ue();Ne(""),Fe(""),We(e),se(""),ax("from",e)}),[Ue,Ne,Fe,We,se,ax]),qe=ut(((e,t)=>{if(t)return Ue();Ne(""),Fe(""),Ve(e),se(""),ax("to",e)}),[Ue,Ne,Fe,We,se,ax]),Ze=ut((()=>{j&&Ne(""),E(!1)}),[j,Ne]),ze=ut((()=>{j||Fe(""),E(!0)}),[j,Fe]),Qe=qA(G?void 0:K),Ge=lt((()=>(100*Number(Ce)).toFixed(2)),[Ce]),Ye=lt((()=>{const e=j?ke:O;return e&&X?new i(X).multipliedBy(e):null}),[X,O,j,ke]),Xe=lt((()=>{var e;if(!Y||void 0===G)return null;if(G)return(null===(e=null==de?void 0:de.toTokenAmount)||void 0===e?void 0:e.gt(0))?de.toTokenAmount.multipliedBy(Y):null;const t=j?P:ke;return t?new i(Y).multipliedBy(t):null}),[Y,P,j,ke,de,G]),Je=lt((()=>Os.jsxs(f,{sx:{display:"flex",fontWeight:600,typography:"body2",alignItems:"center",justifyContent:"center"},children:[Os.jsx(Ov,{title:Os.jsx(e,{id:"4kY4C4",message:"Due to the market condition, market price and estimated price may have a slight difference"}),mr:8}),Os.jsxs(f,{sx:{display:"flex"},children:[Os.jsx(e,{id:"6+mYrD",message:"Current price impact"}),Os.jsxs(f,{sx:{color:h.palette.error.main,ml:4},children:[Ge,"%"]})]})]})),[Ge,h.palette.error.main]),Ke=lt((()=>Os.jsx(ab,{toToken:U,fromToken:W,priceStatus:ve,pricePerToToken:Ee,pricePerFromToken:Se})),[U,W,ve,Ee,Se]),_e=lt((()=>!oe[v||1]),[v]),$e=lt((()=>!!v&&!!(null==W?void 0:W.chainId)&&(null==W?void 0:W.chainId)!==v),[v,null==W?void 0:W.chainId]),et=function({fromToken:e,toToken:t}){const n=Jc(Kc);return lt((()=>!(!e||n.some((t=>t.chainId===e.chainId&&t.address===e.address&&(!t.side||"to"===t.side))))||!(!t||n.some((e=>e.chainId===t.chainId&&e.address===t.address&&(!e.side||"from"===e.side))))),[e,t,n])}({fromToken:W,toToken:U}),tt=lt((()=>Qe&&new i(j?P:O).gt(0)&&!me&&(G?te===tb.Success:ve===tb.Success)?Os.jsxs(f,{sx:{textAlign:"center",mb:8},children:[Os.jsx(f,{component:As.Warn,sx:{position:"relative",top:2,mr:6,width:16,height:16,color:"warning.main"}}),r._({id:"//95jS",message:"The current slippage protection coefficient set exceeds {maxSlippageWarning}%, which may result in losses.",values:{maxSlippageWarning:HA}})]}):null),[Qe,j,O,P,G,te,ve]),nt=lt((()=>$e?Os.jsxs(f,{sx:{textAlign:"center"},children:[Os.jsx(f,{component:As.Warn,sx:{position:"relative",top:2,mr:6,width:16,height:16,color:"warning.main"}}),Os.jsx(e,{id:"54ffaC",message:"The current network is inconsistent with the wallet - please switch in wallet"})]}):ve===tb.Loading||G&&te===tb.Loading?Os.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:Os.jsxs(Os.Fragment,{children:[Os.jsx(x,{sx:{mr:5}}),Os.jsx(e,{id:"JdNn1Y",message:"Fetching best price..."})]})}):_e?Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{component:As.Warn,sx:{mr:6,width:16,color:"warning.main"}}),Os.jsx(e,{id:"udsWDJ",message:"Unsupported network - switch to trade"})]}):!G&&I&&new i(Ge).gt(Pv)?Je:G&&ee.length?Os.jsxs(Os.Fragment,{children:[tt,Os.jsx(RA,{route:de,onClick:()=>ie(!0)})]}):G&&(te===tb.Success&&!ee.length||te===tb.Failed)&&I?Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{component:As.Warn,sx:{width:15,mr:5,color:"warning.main"}}),Os.jsx(e,{id:"NVAuTg",message:"Quote not available"})]}):Os.jsxs(Os.Fragment,{children:[tt,Ke]})),[ve,Ke,I,Je,Ge,_e,G,te,ee,de,$e,tt]),rt=lt((()=>j?new i(L).gt(0)?An({input:ke,decimals:null==W?void 0:W.decimals}):"-":I),[I,L,ke,W,j]),it=lt((()=>{var e;return j?L:G?(null===(e=null==de?void 0:de.toTokenAmount)||void 0===e?void 0:e.gt(0))&&te!==tb.Loading?An({input:de.toTokenAmount,decimals:null==U?void 0:U.decimals}):"-":new i(I).gt(0)?An({input:ke,decimals:null==U?void 0:U.decimals}):"-"}),[I,L,ke,U,j,de,G,te]),ot=lt((()=>{if(!b||(null==W?void 0:W.chainId)&&v!==W.chainId)return Os.jsx(lb,{needSwitchChain:null==W?void 0:W.chainId,border:s});if(m)return Os.jsx(T,{fullWidth:!0,isLoading:!0,disabled:!0,children:Os.jsx(e,{id:"FRBvjQ",message:"Transaction Pending"})});if(!W||!U)return Os.jsx(T,{fullWidth:!0,disabled:!0,"data-testid":ny,children:Os.jsx(e,{id:"KlvBGJ",message:"Select Tokens"})});if(he)return Os.jsx(T,{fullWidth:!0,disabled:ce,onClick:()=>fe(),children:ce?Os.jsx(e,{id:"j2Uisd",message:"Approving"}):Os.jsx(e,{id:"Z7ZXbT",message:"Approve"})});if(!new i(j?P:O).gt(0))return Os.jsx(T,{fullWidth:!0,disabled:!0,"data-testid":oy,children:Os.jsx(e,{id:"iPMIoT",message:"Enter an amount"})});if(G?te===tb.Loading||pe:ve===tb.Loading)return Os.jsx(T,{fullWidth:!0,disabled:!0,"data-testid":ay,children:Os.jsx(e,{id:"OauUE6",message:"Fetching Price..."})});let t=!1;return t=G?!ee.length||te===tb.Failed:!ke||ve===tb.Failed,t?Os.jsx(T,{fullWidth:!0,disabled:!0,children:Os.jsx(e,{id:"NVAuTg",message:"Quote not available"})}):me?Os.jsx(T,{fullWidth:!0,disabled:!0,"data-testid":sy,children:Os.jsx(e,{id:"znqB4T",message:"Insufficient balance"})}):G?Os.jsx(T,{fullWidth:!0,onClick:()=>{var e,t;return Oe({selectedRoute:de,fromEtherTokenBalance:null!==(t=null===(e=$.data)||void 0===e?void 0:e.balance)&&void 0!==t?t:null,goNext:()=>Pe(!0)})},"data-testid":ry,disabled:!de,isLoading:Ie,sx:s&&de?{borderWidth:3,borderStyle:"solid",borderColor:"text.primary"}:void 0,children:Os.jsx(e,{id:"SXnevP",message:"Review Cross Chain"})}):Os.jsx(T,{fullWidth:!0,onClick:()=>Z(!0),"data-testid":ry,sx:s?{borderWidth:3,borderStyle:"solid",borderColor:"text.primary"}:void 0,children:Os.jsx(e,{id:"K/Ay/d",message:"Review Swap"})})}),[b,P,O,U,ke,W,m,Ae,fe,ve,S,j,G,te,ee,Ie,null===(d=$.data)||void 0===d?void 0:d.balance,me,ce,pe,he,s]),at=lt((()=>W&&U?Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(ey,{token:W,width:16,height:16,marginRight:6,chainId:W.chainId,noShowChain:!!C}),`${An({input:j?ke:O,decimals:null==W?void 0:W.decimals})} ${null==W?void 0:W.symbol}`,Os.jsx(f,{component:As.DoubleRight,sx:{width:12,height:12,mx:16}}),Os.jsx(ey,{token:U,width:16,height:16,marginRight:6,chainId:U.chainId,noShowChain:!!C}),`${An({input:j?P:ke,decimals:null==U?void 0:U.decimals})} ${null==U?void 0:U.symbol}`]}):Os.jsx(f,{})),[W,U,O,P,ke,j,C]);return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",typography:"caption",margin:20},children:[Os.jsx(e,{id:"vH2C/2",message:"Swap"}),Os.jsx(A,{open:De,title:G?Os.jsx(e,{id:"qLkska",message:"The setting has been switched to cross chain mode"}):Os.jsx(e,{id:"NSCBTb",message:"The setting has been switched to swap mode"}),placement:"bottom-end",children:Os.jsx(f,{component:y,children:Os.jsx(f,{component:G?As.SettingCrossChain:As.Setting,onClick:()=>Q(!0),sx:{width:19,height:19,color:"text.primary",cursor:"pointer"}})})})]}),Os.jsxs(f,{sx:{flex:1,padding:"0 16px 12px",overflowY:"auto"},children:[Os.jsxs(f,{children:[Os.jsx(Qy,{sx:Object.assign({mb:4},s?{borderWidth:3,borderColor:"text.primary"}:{}),token:W,side:"from",amt:rt,defaultLoadBalance:!0,onMaxClick:ye,onInputChange:Ne,onInputFocus:Ze,showMaxBtn:!j&&!I,occupiedAddrs:[null!==(u=null==U?void 0:U.address)&&void 0!==u?u:""],occupiedChainId:null==U?void 0:U.chainId,fiatPriceTxt:a?void 0:Ye?`$${bn({input:Ye,showDecimals:1})}`:"-",onTokenChange:He,readOnly:j,showChainLogo:!C,showChainName:!C,notTokenPickerModal:!0}),Os.jsx(Bv,{onClick:Ue,disabled:et,border:s}),Os.jsx(Qy,{token:U,side:"to",sx:Object.assign({},s?{borderWidth:3,borderColor:"text.primary"}:{}),amt:it,onInputChange:Fe,onInputFocus:ze,occupiedAddrs:[null!==(p=null==W?void 0:W.address)&&void 0!==p?p:""],occupiedChainId:null==W?void 0:W.chainId,fiatPriceTxt:a?void 0:Xe?`$${bn({input:Xe,showDecimals:1})}(${Ge}%)`:"-",onTokenChange:qe,readOnly:G||!j,showChainLogo:!C,showChainName:!C,notTokenPickerModal:!0}),Os.jsx(f,{sx:{py:12,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexWrap:"wrap"},children:nt})]}),ot,l,k||l?"":Os.jsxs(f,{sx:{mt:13,display:"flex",typography:"h6",cursor:"pointer",justifyContent:"center",alignItems:"center",color:h.palette.text.disabled},onClick:()=>window.open(Za),children:[Os.jsx(f,{sx:{width:18,height:18,transform:"translate(1px, 2px)","& path":{fill:h.palette.text.disabled}},component:As.Dodo}),Os.jsx(e,{id:"7X+IbB",message:"Powered by DODO protocol"})]})]}),Os.jsx(Uv,{toToken:U,fromToken:W,fromAmount:j?ke:O,toAmount:j?P:ke,open:q,baseFeeAmount:je,priceImpact:Ge,additionalFeeAmount:Te,curToFiatPrice:Xe,execute:()=>Ae(at),clearFromAmt:()=>Ne(""),clearToAmt:()=>Fe(""),curFromFiatPrice:Ye,pricePerFromToken:Se,onClose:()=>Z(!1),loading:ve===tb.Loading,disabledFiatPrice:a,slippage:K}),G?Os.jsx(Zv,{open:z,onClose:()=>Q(!1),isBridge:!0}):Os.jsx(cw,{open:z,onClose:()=>Q(!1),fromToken:W,toToken:U}),Os.jsx(IA,{open:ne,onClose:()=>ie(!1),selectedRouteId:le,setSelectRouteId:se,bridgeRouteList:ee}),Os.jsx(NA,{open:Be,onClose:()=>Pe(!1),route:de,bridgeOrderTxRequest:Me,clearFromAmt:()=>Ne(""),clearToAmt:()=>Fe("")}),Os.jsx(FA,{message:Re,onClose:()=>Le("")})]})}!function(e){e.recommend="recommend",e.custom="custom"}(rw||(rw={}));var pw,hw=Pt;if("production"===process.env.NODE_ENV)iw=hw.createRoot,hw.hydrateRoot;else{var mw=hw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;iw=function(e,t){mw.usingClientEntryPoint=!0;try{return hw.createRoot(e,t)}finally{mw.usingClientEntryPoint=!1}}}!function(e){e.Pool="pool",e.PoolDetail="poolDetail",e.CreatePool="createPool",e.ModifyPool="modifyPool",e.MiningList="miningList",e.MiningDetail="miningDetail",e.createPoolAMMV2="createPoolAMMV2",e.createPoolAMMV3="createPoolAMMV3",e.createPoolAlgebra="createPoolAlgebra"}(pw||(pw={}));const fw=bt(((e,t)=>({page:void 0,historyList:[],push:t=>{e((e=>{var n;const r=[...e.historyList,null!==(n=e.page)&&void 0!==n?n:{type:pw.Pool}];return{page:t,historyList:r}}))},back:()=>{e((e=>{const t=e.historyList.length;if(!t)return"undefined"!=typeof window&&window.history&&history.back(),e;const n=[...e.historyList];return{page:n.splice(t-1,1)[0],historyList:n}}))}})));function gw({title:t,desc:n,linkTo:r,LeftImage:i,sx:o}){const a=g(),s="light"===a.palette.mode;return Os.jsxs(f,{sx:Object.assign({backgroundColor:a.palette.background.paper,borderRadius:16,padding:20},o),children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start"},children:[Os.jsx(f,{sx:{backgroundColor:C(a.palette.secondary.main,.3),color:s?"#EB8D27":a.palette.secondary.main,borderRadius:6,width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:Os.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.55558 0.888672C3.87558 0.888672 0.888916 3.87534 0.888916 7.55534C0.888916 11.2353 3.87558 14.222 7.55558 14.222C11.2356 14.222 14.2222 11.2353 14.2222 7.55534C14.2222 3.87534 11.2356 0.888672 7.55558 0.888672ZM8.22225 11.5553V10.222H6.88892V11.5553H8.22225ZM4.88892 6.22201C4.88892 4.74867 6.08225 3.55534 7.55558 3.55534C9.02892 3.55534 10.2222 4.74867 10.2222 6.22201C10.2222 7.07728 9.69557 7.53755 9.18276 7.9857C8.69626 8.41085 8.22225 8.82509 8.22225 9.55534H6.88892C6.88892 8.34116 7.51699 7.85973 8.06921 7.43646C8.50241 7.10441 8.88892 6.80815 8.88892 6.22201C8.88892 5.48867 8.28892 4.88867 7.55558 4.88867C6.82225 4.88867 6.22225 5.48867 6.22225 6.22201H4.88892Z",fill:"currentColor"})})}),Os.jsx(f,{sx:{color:a.palette.text.primary,typography:"body1",fontWeight:600,ml:4},children:Os.jsx(e,{id:"cmUrtC",message:"SEE HOW IT WORKS"})})]}),Os.jsxs(f,{sx:{mt:20,borderTopWidth:1,pt:20,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(f,{component:i,sx:{width:64,height:64,flexShrink:0}}),Os.jsxs(f,{sx:{ml:16,color:a.palette.text.primary,typography:"body1",fontWeight:600},children:[t,Os.jsx(f,{sx:{mt:4,color:a.palette.text.secondary,typography:"body2",fontWeight:500},children:n})]})]}),Os.jsx(f,{component:"a",href:r,target:"_blank",rel:"noopener noreferrer",sx:{pl:16,flexShrink:0},children:Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:Os.jsx("path",{d:"M7.23375 3.75L6 4.98375L10.0075 9L6 13.0162L7.23375 14.25L12.4838 9L7.23375 3.75Z",fill:a.palette.text.primary})})})]})]})}const yw="widget-module-container",xw=at.forwardRef((function(e,t){var{sx:n}=e,r=Nn(e,["sx"]);const{isMobile:i}=wy(),o=g();return Os.jsx(f,{className:yw,ref:t,sx:Object.assign(Object.assign({flex:1,overflowY:"auto",backgroundColor:"background.default"},i?{padding:0,height:"100%",width:"100%",overflowX:"hidden"}:{padding:o.spacing(28,20,40,40),height:"auto"}),n),...r})})),vw=[{value:0,label:"0%"},{value:25,label:"25%"},{value:50,label:"50%"},{value:75,label:"75%"},{value:100,label:"100%"}];function bw({disabled:e,value:t,onChange:n,sx:r}){return Os.jsxs(f,{sx:Object.assign({p:20,backgroundColor:"background.input",borderRadius:12},r),children:[Os.jsx(hy,{value:String(t),onChange:e=>n(+e),readOnly:!0,readonlyShowSuffix:!0,suffix:Os.jsx(f,{sx:{typography:"h2"},children:"%"}),sx:{mt:12,"& input":{pl:0,typography:"h1"}}}),Os.jsx(f,{sx:{mt:20},children:Os.jsx(V,{marks:vw,step:1,disabled:e,value:t,onChange:(e,t)=>n(t)})})]})}function Aw({active:t,sx:n,onClick:r}){const i=g(),o="light"===i.palette.mode;let a=i.palette.primary.main,s="transparent";return t&&(a=i.palette.primary.contrastText,s=C(i.palette.primary.main,.8)),Os.jsx(f,{component:y,sx:Object.assign({typography:"body2",p:t?i.spacing(8,20,9):i.spacing(7,19,8),minWidth:79,border:t?void 0:`1px solid ${a}`,color:a,backgroundColor:s,borderRadius:8,fontWeight:600,"&:hover":{color:t?i.palette.primary.contrastText:i.palette.primary.main,backgroundColor:t?i.palette.primary.main:o?"rgba(26, 26, 27, 0.04)":"rgba(241, 249, 2, 0.08)"}},n),onClick:r,children:Os.jsx(e,{id:"R9Khdg",message:"Auto"})})}const ww="auto",kw="0.1",Cw="0.5",jw="0.5",Tw=.01,Ew=({address:e,type:t})=>{const[n,r]=ct(ww),o=lt((()=>n===ww?"AMMV3"===t?new i(jw).div(100).toNumber():"AMMV2"===t?new i(Cw).div(100).toNumber():new i(kw).div(100).toNumber():n),[n,t]);return{slipper:n,setSlipper:r,slipperValue:o,resetSlipper:()=>{r(ww)}}};function Sw({type:t,disabled:n,value:r,onChange:o,sx:a}){const s=g(),l=r===ww,[d,c]=ct(l?"":new i(r).times(100).toNumber()),u="AMMV3"==t?jw:"AMMV2"==t?Cw:kw;return Os.jsx(A,{disabled:n,onlyClick:!0,title:Os.jsxs(f,{sx:{backgroundColor:s.palette.background.paper,padding:s.spacing(12,20),borderRadius:8,width:318,maxWidth:"90vw",boxSizing:"border-box"},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2"},children:[Os.jsx("span",{children:Os.jsx(e,{id:"lqTDfd",message:"Slippage Tolerance"})}),Os.jsxs("span",{children:[l?u:r&&new i(r).times(100).toNumber(),"%"]})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",margin:s.spacing(16,0,0,0)},children:[Os.jsx(Aw,{sx:{borderRadius:8,whiteSpace:"nowrap"},onClick:()=>{c(""),o(ww)},active:l}),Os.jsx(v,{placeholder:String(u),value:d,onChange:e=>{const{value:t}=e.target;c(t),o(t?new i(t).div(100).toNumber():ww)},onBlur:()=>{(!l&&new i(r).gt(.1)||new i(r).lte(0))&&(c(10),o(.1))},suffix:Os.jsx(f,{sx:{mr:16},children:"%"}),sx:{ml:8,"& input":{px:16,py:0,height:"39px"}}})]})]}),sx:{p:0},arrow:!1,placement:"bottom-end",children:Os.jsx(Q,{sx:Object.assign({width:"max-content",alignItems:"right",margin:s.spacing(0,0,0,"auto"),p:s.spacing(4,12),borderRadius:20,backgroundColor:"background.paperDarkContrast"},a),children:Os.jsx(f,{component:As.Setting,sx:{width:18,height:18,"& path:last-child":{fill:s.palette.text.primary}}})})})}const Iw=50;var Rw,Lw,Mw;!function(e){e[e.quantity=1]="quantity",e[e.percentage=2]="percentage"}(Rw||(Rw={})),function(e){e.CURRENCY_A="CURRENCY_A",e.CURRENCY_B="CURRENCY_B"}(Lw||(Lw={})),function(e){e.LOWER="LOWER",e.UPPER="UPPER"}(Mw||(Mw={}));const Ow={xs:"4px",sm:"8px",md:"12px",lg:"24px",xl:"32px"},Bw=({children:e,sx:t})=>(g(),Os.jsx(f,{sx:Object.assign({display:"flex",flexDirection:"column",gap:20,px:20,py:20,borderRadius:12},t),children:e})),Pw=({children:e,sx:t})=>{const n=g();return Os.jsx(Bw,{sx:Object.assign(Object.assign({},t),{backgroundColor:n.palette.background.paperContrast}),children:e})},Dw=({children:e})=>{const t=g();return Os.jsxs(f,{sx:{p:8,borderRadius:8,backgroundColor:C(t.palette.warning.main,.1),display:"flex",alignItems:"center",gap:8},children:[Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 16.125L9 1.875L17.25 16.125H0.75ZM14.6475 14.625L8.99998 4.86749L3.35247 14.625H14.6475ZM9.75004 12.375H8.25003V13.875H9.75004V12.375ZM8.25003 7.875H9.75004V10.875H8.25003V7.875Z",fill:t.palette.warning.main})}),Os.jsx(f,{sx:{typography:"h6",color:t.palette.warning.main,textAlign:"left"},children:e})]})};function Nw({gap:e,flex:t,children:n,style:r}){return Os.jsx(f,{sx:Object.assign(Object.assign(Object.assign({display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:e&&Ow[e]||e},t&&{flex:t}),{width:"100%",alignItems:"center"}),r),children:n})}function Fw({gap:e,justify:t,grow:n,children:r,style:i}){return Os.jsx(f,{sx:Object.assign({display:"grid",gridAutoRows:"auto",gridRowGap:e&&Ow[e]||e,justifyItems:t,flexGrow:n&&1},i),children:r})}function Ww({gap:e,children:t,sx:n}){return Os.jsx(f,{sx:Object.assign({width:"100%",display:"flex",padding:0,alignItems:"center",justifyContent:"flex-start",gap:e&&Ow[e]||e},n),children:t})}function Vw({children:e,style:t}){return Os.jsx(Ww,{sx:Object.assign({justifyContent:"space-between"},t),children:e})}function Uw({gap:e,justify:t,children:n,sx:r}){return Os.jsx(Ww,{sx:Object.assign({position:"relative",width:"fit-content",margin:`-${e}`},r),children:n})}function Hw({children:e,disabled:t,sx:n}){return Os.jsx(Ww,{sx:Object.assign({display:"flex",flexDirection:"column",alignItems:"stretch",gap:12,opacity:t?.2:1,pointerEvents:t?"none":"auto"},n),children:e})}const qw=({chainId:t,approvalA:n,approvalB:i,parsedAmounts:o,isValid:a,depositADisabled:s,depositBDisabled:l,errorMessage:d,setShowConfirm:c})=>{var u,p;const h=n.needApprove&&!!o[Lw.CURRENCY_A]||n.isApproving,m=i.needApprove&&!!o[Lw.CURRENCY_B]||i.isApproving;return Os.jsx(sb,{includeButton:!0,fullWidth:!0,chainId:t,children:Os.jsxs(Fw,{gap:"md",style:{width:"100%"},children:[(h||m)&&a&&Os.jsxs(f,{sx:{width:"100%",display:"flex",padding:0,alignItems:"center",justifyContent:"space-between",gap:8},children:[h&&Os.jsx(T,{size:T.Size.big,isLoading:n.isApproving,onClick:n.submitApprove,disabled:n.insufficientBalance,width:m?"50%":"100%",children:n.isApproving?Os.jsx(e,{id:"DTFrUE",message:"Approving {0}...",values:{0:null===(u=n.token)||void 0===u?void 0:u.symbol}}):n.approveTitle}),m&&Os.jsx(T,{size:T.Size.big,isLoading:i.isApproving,onClick:i.submitApprove,disabled:i.insufficientBalance,width:h?"50%":"100%",children:i.isApproving?Os.jsx(e,{id:"DTFrUE",message:"Approving {0}...",values:{0:null===(p=i.token)||void 0===p?void 0:p.symbol}}):i.approveTitle})]}),Os.jsx(T,{fullWidth:!0,size:T.Size.big,onClick:()=>{c(!0)},disabled:!a||n.needApprove&&!s||i.needApprove&&!l,danger:!a&&!!o[Lw.CURRENCY_A]&&!!o[Lw.CURRENCY_B],children:d||r._({id:"rdUucN",message:"Preview"})})]})})},Zw=({chainId:e,disabled:t,isLoading:n,onConfirm:i})=>Os.jsx(sb,{includeButton:!0,fullWidth:!0,chainId:e,children:Os.jsx(T,{fullWidth:!0,size:T.Size.big,onClick:i,disabled:t,isLoading:n,children:r._({id:"h5pjuM",message:"Collect fees"})})});function zw(e){const t=dt();return st((()=>{t.current=e})),t.current}const Qw=[.25,.5,.75,1];function Gw({currentValue:e,onClick:t,sx:n}){const r=g(),i="light"===r.palette.mode,{isMobile:o}=wy(),[a,s]=ct(null),l=dt(0);st((()=>{e?(l.current+=1,l.current>=2&&(s(null),l.current=0)):s(null)}),[e]);const d=zw(e);return st((()=>{d===e&&1===a&&(l.current=1)}),[e,d,a]),Os.jsx(f,{sx:Object.assign({display:"grid",gap:o?10:14,gridTemplateColumns:`repeat(${Qw.length}, 1fr)`},n),children:Qw.map((e=>{const n=e===a;return Os.jsxs(y,{sx:{typography:"h6",borderRadius:4,padding:r.spacing(4,0),width:"100%",color:"text.secondary",backgroundColor:"background.paperDarkContrast","&:hover":{color:r.palette.text.primary,backgroundColor:C(r.palette.text.primary,.2)},"&.selected, &:focus":{color:"#fff",backgroundColor:i?r.palette.primary.main:C(r.palette.text.primary,.4)}},onClick:()=>{n||(l.current=0,s(e),t(e))},className:n?"selected":void 0,children:[100*e,"%"]},e)}))})}const Yw=({value:t,onUserInput:n,maxAmount:i,balance:o,currency:a,locked:s})=>{var l,d;const c=g(),u=ut((e=>{if(!i||!a)return;const t=i.toExact().multipliedBy(e).dp(a.decimals).toString();n(t)}),[a,i,n]),p=lt((()=>o?An({input:o.toExact(),decimals:null==a?void 0:a.decimals}):"-"),[null==a?void 0:a.decimals,o]);return Os.jsxs(f,{sx:{pt:12,pb:20,px:20,borderWidth:1,borderStyle:"solid",borderColor:"border.main",borderRadius:12,backgroundColor:c.palette.background.input},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:4},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,color:c.palette.text.primary,typography:"h5"},children:[(null==a?void 0:a.address)&&Os.jsx(ey,{address:null!==(l=null==a?void 0:a.address)&&void 0!==l?l:"",chainId:null==a?void 0:a.chainId,noShowChain:!0,width:24,height:24,marginRight:0}),Os.jsx(f,{sx:{display:"flex",alignItems:"center"},children:(null==a?void 0:a.address)?Os.jsx(f,{children:null!==(d=null==a?void 0:a.symbol)&&void 0!==d?d:"-"}):Os.jsx(e,{id:"sIPJGT",message:"SELECT TOKEN"})})]}),Os.jsxs(f,{component:y,sx:{color:c.palette.text.secondary,"&:hover":{color:c.palette.text.primary},cursor:"pointer",display:"flex",flexWrap:"wrap",justifyContent:"flex-end",typography:"body2"},onClick:()=>{u(1)},children:[Os.jsxs(f,{sx:{wordBreak:"keep-all"},children:[r._({id:"fsBGk0",message:"Balance"}),": "]}),Os.jsx(f,{sx:{wordBreak:"break-all",textAlign:"right",display:"flex",alignItems:"center"},children:p})]})]}),Os.jsx(hy,{sx:{mt:4},suffix:void 0,value:t,onChange:n,readOnly:s,withClear:!s}),s?null:Os.jsx(Gw,{sx:{mt:20,mb:0},onClick:u,currentValue:t})]})},Xw={},Jw={};var Kw,_w;Object.values(oe).filter((e=>"number"==typeof e)).map((e=>{const t=Ee(e),n=Se(e);t&&(Xw[e]=t),n&&(Jw[e]=n)})),oe.MAINNET,oe.ARBITRUM_ONE,oe.SEPOLIA,oe.TAIKO,function(e){e[e.EXACT_INPUT=0]="EXACT_INPUT",e[e.EXACT_OUTPUT=1]="EXACT_OUTPUT"}(Kw||(Kw={})),function(e){e[e.ROUND_DOWN=0]="ROUND_DOWN",e[e.ROUND_HALF_UP=1]="ROUND_HALF_UP",e[e.ROUND_UP=2]="ROUND_UP"}(_w||(_w={}));const $w=tn.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),ek={[_w.ROUND_DOWN]:i.ROUND_DOWN,[_w.ROUND_HALF_UP]:i.ROUND_HALF_UP,[_w.ROUND_UP]:i.ROUND_UP},tk={[_w.ROUND_DOWN]:i.ROUND_DOWN,[_w.ROUND_HALF_UP]:i.ROUND_HALF_UP,[_w.ROUND_UP]:i.ROUND_UP};let nk=class e{constructor(e,t=tn.BigInt(1)){this.numerator=tn.BigInt(e),this.denominator=tn.BigInt(t)}static tryParseFraction(t){if(t instanceof tn||"number"==typeof t||"string"==typeof t)return new e(t);if("numerator"in t&&"denominator"in t)return t;throw new Error("Could not parse fraction")}get quotient(){return tn.divide(this.numerator,this.denominator)}get remainder(){return new e(tn.remainder(this.numerator,this.denominator),this.denominator)}invert(){return new e(this.denominator,this.numerator)}add(t){const n=e.tryParseFraction(t);return tn.equal(this.denominator,n.denominator)?new e(tn.add(this.numerator,n.numerator),this.denominator):new e(tn.add(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator)),tn.multiply(this.denominator,n.denominator))}subtract(t){const n=e.tryParseFraction(t);return tn.equal(this.denominator,n.denominator)?new e(tn.subtract(this.numerator,n.numerator),this.denominator):new e(tn.subtract(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator)),tn.multiply(this.denominator,n.denominator))}lessThan(t){const n=e.tryParseFraction(t);return tn.lessThan(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator))}equalTo(t){const n=e.tryParseFraction(t);return tn.equal(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator))}greaterThan(t){const n=e.tryParseFraction(t);return tn.greaterThan(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator))}multiply(t){const n=e.tryParseFraction(t);return new e(tn.multiply(this.numerator,n.numerator),tn.multiply(this.denominator,n.denominator))}divide(t){const n=e.tryParseFraction(t);return new e(tn.multiply(this.numerator,n.denominator),tn.multiply(this.denominator,n.numerator))}toSignificant(e,t={decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0},n=_w.ROUND_HALF_UP){nn(Number.isInteger(e),`${e} is not an integer.`),nn(e>0,`${e} is not positive.`);const r=ek[n],o=new i(this.numerator.toString()).div(this.denominator.toString()).precision(e,r);return o.toFormat(o.decimalPlaces(),r,t)}toFixed(e,t={decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0},n=_w.ROUND_HALF_UP){nn(Number.isInteger(e),`${e} is not an integer.`),nn(e>=0,`${e} is negative.`);const r=tk[n];return new i(this.numerator.toString()).decimalPlaces(e,r).div(this.denominator.toString()).toFormat(e,r,t)}get asFraction(){return new e(this.numerator,this.denominator)}};class rk extends nk{static fromRawAmount(e,t){return new rk(e,t)}static fromFractionalAmount(e,t,n){return new rk(e,t,n)}constructor(e,t,n){super(t,n),nn(tn.lessThanOrEqual(this.quotient,$w),"AMOUNT"),this.currency=e,this.decimalScale=tn.exponentiate(tn.BigInt(10),tn.BigInt(e.decimals))}add(e){nn(this.currency.equals(e.currency),"CURRENCY");const t=super.add(e);return rk.fromFractionalAmount(this.currency,t.numerator,t.denominator)}subtract(e){nn(this.currency.equals(e.currency),"CURRENCY");const t=super.subtract(e);return rk.fromFractionalAmount(this.currency,t.numerator,t.denominator)}multiply(e){const t=super.multiply(e);return rk.fromFractionalAmount(this.currency,t.numerator,t.denominator)}divide(e){const t=super.divide(e);return rk.fromFractionalAmount(this.currency,t.numerator,t.denominator)}toSignificant(e=6,t,n=_w.ROUND_DOWN){return super.divide(this.decimalScale).toSignificant(e,t,n)}toFixed(e=this.currency.decimals,t,n=_w.ROUND_DOWN){return nn(e<=this.currency.decimals,"DECIMALS"),super.divide(this.decimalScale).toFixed(e,t,n)}toExact(){return new i(this.quotient.toString()).div(this.decimalScale.toString())}get wrapped(){return this.currency.isToken?this:rk.fromFractionalAmount(this.currency.wrapped,this.numerator,this.denominator)}}const ik=new nk(tn.BigInt(100));function ok(e){return new ak(e.numerator,e.denominator)}let ak=class extends nk{constructor(){super(...arguments),this.isPercent=!0}add(e){return ok(super.add(e))}subtract(e){return ok(super.subtract(e))}multiply(e){return ok(super.multiply(e))}divide(e){return ok(super.divide(e))}toSignificant(e=5,t,n){return super.multiply(ik).toSignificant(e,t,n)}toFixed(e=2,t,n){return super.multiply(ik).toFixed(e,t,n)}},sk=class e extends nk{constructor(...e){let t,n,r,i;if(4===e.length)[t,n,r,i]=e;else{const o=e[0].quoteAmount.divide(e[0].baseAmount);[t,n,r,i]=[e[0].baseAmount.currency,e[0].quoteAmount.currency,o.denominator,o.numerator]}super(i,r),this.baseCurrency=t,this.quoteCurrency=n,this.scalar=new nk(tn.exponentiate(tn.BigInt(10),tn.BigInt(t.decimals)),tn.exponentiate(tn.BigInt(10),tn.BigInt(n.decimals)))}invert(){return new e(this.quoteCurrency,this.baseCurrency,this.numerator,this.denominator)}multiply(t){nn(this.quoteCurrency.equals(t.baseCurrency),"TOKEN");const n=super.multiply(t);return new e(this.baseCurrency,t.quoteCurrency,n.denominator,n.numerator)}quote(e){nn(e.currency.equals(this.baseCurrency),"TOKEN");const t=super.multiply(e);return rk.fromFractionalAmount(this.quoteCurrency,t.numerator,t.denominator)}get adjustedForDecimals(){return super.multiply(this.scalar)}toSignificant(e=6,t,n){return this.adjustedForDecimals.toSignificant(e,t,n)}toFixed(e=4,t,n){return this.adjustedForDecimals.toFixed(e,t,n)}},lk=class{constructor(e,t,n,r){nn(Number.isSafeInteger(e),"CHAIN_ID"),nn(t>=0&&t<255&&Number.isInteger(t),"DECIMALS"),this.chainId=e,this.decimals=t,this.symbol=n,this.name=r}};function dk(e){try{return Vr(e)}catch(t){throw new Error(`${e} is not a valid address.`)}}const ck=/^0x[0-9a-fA-F]{40}$/;let uk=class extends lk{constructor(e,t,n,r,i,o,a,s){super(e,n,r,i),this.isNative=!1,this.isToken=!0,this.address=o?function(e){if(ck.test(e))return e;throw new Error(`${e} is not a valid address.`)}(t):dk(t),a&&nn(a.gte(ne.from(0)),"NON-NEGATIVE FOT FEES"),s&&nn(s.gte(ne.from(0)),"NON-NEGATIVE FOT FEES"),this.buyFeeBps=a,this.sellFeeBps=s}equals(e){return e.isToken&&this.chainId===e.chainId&&this.address.toLowerCase()===e.address.toLowerCase()}sortsBefore(e){return nn(this.chainId===e.chainId,"CHAIN_IDS"),nn(this.address.toLowerCase()!==e.address.toLowerCase(),"ADDRESSES"),this.address.toLowerCase()<e.address.toLowerCase()}get wrapped(){return this}};const pk=tn.BigInt(Number.MAX_SAFE_INTEGER),hk=tn.BigInt(0),mk=tn.BigInt(1),fk=tn.BigInt(2);const gk=tn.BigInt(0),yk=1e4;new ak(tn.BigInt(1),yk),new ak(1,100),new ak(3,100),new ak(5,100),new ak(10,100),new ak(15,100);const xk=new ak(0);new ak(1);const vk="0x5ccd5621c1bb9e44ce98cef8b90d31eb2423dec3793b6239232cefae976936ea";var bk;!function(e){e[e.LOWEST=100]="LOWEST",e[e.LOW_200=200]="LOW_200",e[e.LOW_300=300]="LOW_300",e[e.LOW_400=400]="LOW_400",e[e.LOW=500]="LOW",e[e.MEDIUM=3e3]="MEDIUM",e[e.HIGH=1e4]="HIGH"}(bk||(bk={}));const Ak={[bk.LOWEST]:1,[bk.LOW_200]:4,[bk.LOW_300]:6,[bk.LOW_400]:8,[bk.LOW]:10,[bk.MEDIUM]:60,[bk.HIGH]:200},wk=tn.BigInt(-1),kk=tn.BigInt(0),Ck=tn.BigInt(1),jk=tn.exponentiate(tn.BigInt(2),tn.BigInt(96)),Tk=tn.exponentiate(jk,tn.BigInt(2)),Ek="abi/5.7.0",Sk=new Yn(Ek),Ik={};let Rk={calldata:!0,memory:!0,storage:!0},Lk={calldata:!0,memory:!0};function Mk(e,t){if("bytes"===e||"string"===e){if(Rk[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Lk[t])return!0;return(Rk[t]||"payable"===t)&&Sk.throwArgumentError("invalid modifier","name",t),!1}function Ok(e,t){for(let n in t)tu(e,n,t[n])}const Bk=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Pk=new RegExp(/^(.*)\[([0-9]*)\]$/);class Dk{constructor(e,t){e!==Ik&&Sk.throwError("use fromString",Yn.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Ok(this,t);let n=this.type.match(Pk);Ok(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:Dk.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=Bk.sighash),Bk[e]||Sk.throwArgumentError("invalid format type","format",e),e===Bk.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Bk.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Bk.full?", ":",")+")"):t+=this.type,e!==Bk.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Bk.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?Dk.fromString(e,t):Dk.fromObject(e)}static fromObject(e){return Dk.isParamType(e)?e:new Dk(Ik,{name:e.name||null,type:Gk(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(Dk.fromObject):null})}static fromString(e,t){return n=function(e,t){let n=e;function r(t){Sk.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let n={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(n.indexed=!1),n}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},a=o;for(let n=0;n<e.length;n++){let o=e[n];switch(o){case"(":a.state.allowType&&""===a.type?a.type="tuple":a.state.allowParams||r(n),a.state.allowType=!1,a.type=Gk(a.type),a.components=[i(a)],a=a.components[0];break;case")":delete a.state,"indexed"===a.name&&(t||r(n),a.indexed=!0,a.name=""),Mk(a.type,a.name)&&(a.name=""),a.type=Gk(a.type);let e=a;a=a.parent,a||r(n),delete e.parent,a.state.allowParams=!1,a.state.allowName=!0,a.state.allowArray=!0;break;case",":delete a.state,"indexed"===a.name&&(t||r(n),a.indexed=!0,a.name=""),Mk(a.type,a.name)&&(a.name=""),a.type=Gk(a.type);let s=i(a.parent);a.parent.components.push(s),delete a.parent,a=s;break;case" ":a.state.allowType&&""!==a.type&&(a.type=Gk(a.type),delete a.state.allowType,a.state.allowName=!0,a.state.allowParams=!0),a.state.allowName&&""!==a.name&&("indexed"===a.name?(t||r(n),a.indexed&&r(n),a.indexed=!0,a.name=""):Mk(a.type,a.name)?a.name="":a.state.allowName=!1);break;case"[":a.state.allowArray||r(n),a.type+=o,a.state.allowArray=!1,a.state.allowName=!1,a.state.readArray=!0;break;case"]":a.state.readArray||r(n),a.type+=o,a.state.readArray=!1,a.state.allowArray=!0,a.state.allowName=!0;break;default:a.state.allowType?(a.type+=o,a.state.allowParams=!0,a.state.allowArray=!0):a.state.allowName?(a.name+=o,delete a.state.allowArray):a.state.readArray?a.type+=o:r(n)}}return a.parent&&Sk.throwArgumentError("unexpected eof","param",e),delete o.state,"indexed"===a.name?(t||r(n.length-7),a.indexed&&r(n.length-7),a.indexed=!0,a.name=""):Mk(a.type,a.name)&&(a.name=""),o.type=Gk(o.type),o}(e,!!t),Dk.fromObject({name:n.name,type:n.type,indexed:n.indexed,components:n.components});var n}static isParamType(e){return!(null==e||!e._isParamType)}}function Nk(e,t){return function(e){e=e.trim();let t=[],n="",r=0;for(let i=0;i<e.length;i++){let o=e[i];","===o&&0===r?(t.push(n),n=""):(n+=o,"("===o?r++:")"===o&&(r--,-1===r&&Sk.throwArgumentError("unbalanced parenthesis","value",e)))}n&&t.push(n);return t}(e).map((e=>Dk.fromString(e,t)))}class Fk{constructor(e,t){e!==Ik&&Sk.throwError("use a static from method",Yn.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Ok(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return Fk.isFragment(e)?e:"string"==typeof e?Fk.fromString(e):Fk.fromObject(e)}static fromObject(e){if(Fk.isFragment(e))return e;switch(e.type){case"function":return Zk.fromObject(e);case"event":return Wk.fromObject(e);case"constructor":return qk.fromObject(e);case"error":return Qk.fromObject(e);case"fallback":case"receive":return null}return Sk.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Wk.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Zk.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?qk.fromString(e.trim()):"error"===e.split(" ")[0]?Qk.fromString(e.substring(5).trim()):Sk.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class Wk extends Fk{format(e){if(e||(e=Bk.sighash),Bk[e]||Sk.throwArgumentError("invalid format type","format",e),e===Bk.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Bk.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Bk.full?", ":",")+") ",e!==Bk.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?Wk.fromString(e):Wk.fromObject(e)}static fromObject(e){if(Wk.isEventFragment(e))return e;"event"!==e.type&&Sk.throwArgumentError("invalid event object","value",e);const t={name:Xk(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Dk.fromObject):[],type:"event"};return new Wk(Ik,t)}static fromString(e){let t=e.match(Jk);t||Sk.throwArgumentError("invalid event string","value",e);let n=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":n=!0;break;case"":break;default:Sk.warn("unknown modifier: "+e)}})),Wk.fromObject({name:t[1].trim(),anonymous:n,inputs:Nk(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function Vk(e,t){t.gas=null;let n=e.split("@");return 1!==n.length?(n.length>2&&Sk.throwArgumentError("invalid human-readable ABI signature","value",e),n[1].match(/^[0-9]+$/)||Sk.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=ne.from(n[1]),n[0]):e}function Uk(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function Hk(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&Sk.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&Sk.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||Sk.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&Sk.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&Sk.throwArgumentError("unable to determine stateMutability","value",e),t}class qk extends Fk{format(e){if(e||(e=Bk.sighash),Bk[e]||Sk.throwArgumentError("invalid format type","format",e),e===Bk.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===Bk.sighash&&Sk.throwError("cannot format a constructor for sighash",Yn.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Bk.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?qk.fromString(e):qk.fromObject(e)}static fromObject(e){if(qk.isConstructorFragment(e))return e;"constructor"!==e.type&&Sk.throwArgumentError("invalid constructor object","value",e);let t=Hk(e);t.constant&&Sk.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Dk.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?ne.from(e.gas):null};return new qk(Ik,n)}static fromString(e){let t={type:"constructor"},n=(e=Vk(e,t)).match(Jk);return n&&"constructor"===n[1].trim()||Sk.throwArgumentError("invalid constructor string","value",e),t.inputs=Nk(n[2].trim(),!1),Uk(n[3].trim(),t),qk.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Zk extends qk{format(e){if(e||(e=Bk.sighash),Bk[e]||Sk.throwArgumentError("invalid format type","format",e),e===Bk.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Bk.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Bk.full?", ":",")+") ",e!==Bk.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?Zk.fromString(e):Zk.fromObject(e)}static fromObject(e){if(Zk.isFunctionFragment(e))return e;"function"!==e.type&&Sk.throwArgumentError("invalid function object","value",e);let t=Hk(e);const n={type:e.type,name:Xk(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Dk.fromObject):[],outputs:e.outputs?e.outputs.map(Dk.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?ne.from(e.gas):null};return new Zk(Ik,n)}static fromString(e){let t={type:"function"},n=(e=Vk(e,t)).split(" returns ");n.length>2&&Sk.throwArgumentError("invalid function string","value",e);let r=n[0].match(Jk);if(r||Sk.throwArgumentError("invalid function signature","value",e),t.name=r[1].trim(),t.name&&Xk(t.name),t.inputs=Nk(r[2],!1),Uk(r[3].trim(),t),n.length>1){let r=n[1].match(Jk);""==r[1].trim()&&""==r[3].trim()||Sk.throwArgumentError("unexpected tokens","value",e),t.outputs=Nk(r[2],!1)}else t.outputs=[];return Zk.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function zk(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||Sk.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class Qk extends Fk{format(e){if(e||(e=Bk.sighash),Bk[e]||Sk.throwArgumentError("invalid format type","format",e),e===Bk.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Bk.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Bk.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?Qk.fromString(e):Qk.fromObject(e)}static fromObject(e){if(Qk.isErrorFragment(e))return e;"error"!==e.type&&Sk.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Xk(e.name),inputs:e.inputs?e.inputs.map(Dk.fromObject):[]};return zk(new Qk(Ik,t))}static fromString(e){let t={type:"error"},n=e.match(Jk);return n||Sk.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&Xk(t.name),t.inputs=Nk(n[2],!1),zk(Qk.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Gk(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Yk=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Xk(e){return e&&e.match(Yk)||Sk.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Jk=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Kk=new Yn(Ek);class _k{constructor(e,t,n,r){this.name=e,this.type=t,this.localName=n,this.dynamic=r}_throwError(e,t){Kk.throwArgumentError(e,this.localName,t)}}class $k{constructor(e){tu(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return ur(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(rr(e._data))}writeBytes(e){let t=nr(e);const n=t.length%this.wordSize;return n&&(t=rr([t,this._padding.slice(n)])),this._writeData(t)}_getValue(e){let t=nr(ne.from(e));return t.length>this.wordSize&&Kk.throwError("value out-of-bounds",Yn.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=rr([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class eC{constructor(e,t,n,r){tu(this,"_data",nr(e)),tu(this,"wordSize",t||32),tu(this,"_coerceFunc",n),tu(this,"allowLoose",r),this._offset=0}get data(){return lr(this._data)}get consumed(){return this._offset}static coerce(e,t){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):eC.coerce(e,t)}_peekBytes(e,t,n){let r=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+r>this._data.length&&(this.allowLoose&&n&&this._offset+t<=this._data.length?r=t:Kk.throwError("data out-of-bounds",Yn.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+r})),this._data.slice(this._offset,this._offset+r)}subReader(e){return new eC(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let n=this._peekBytes(0,e,!!t);return this._offset+=n.length,n.slice(0,e)}readValue(){return ne.from(this.readBytes(this.wordSize))}}class tC extends _k{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=Vr(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return Vr(mr(e.readValue().toHexString(),20))}}class nC extends _k{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const rC=new Yn(Ek);function iC(e,t,n){let r=null;if(Array.isArray(n))r=n;else if(n&&"object"==typeof n){let e={};r=t.map((t=>{const r=t.localName;return r||rC.throwError("cannot encode object for signature with missing names",Yn.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[r]&&rC.throwError("cannot encode object for signature with duplicate names",Yn.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[r]=!0,n[r]}))}else rC.throwArgumentError("invalid tuple value","tuple",n);t.length!==r.length&&rC.throwArgumentError("types/value length mismatch","tuple",n);let i=new $k(e.wordSize),o=new $k(e.wordSize),a=[];t.forEach(((e,t)=>{let n=r[t];if(e.dynamic){let t=o.length;e.encode(o,n);let r=i.writeUpdatableValue();a.push((e=>{r(e+t)}))}else e.encode(i,n)})),a.forEach((e=>{e(i.length)}));let s=e.appendWriter(i);return s+=e.appendWriter(o),s}function oC(e,t){let n=[],r=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let n=e.readValue(),o=r.subReader(n.toNumber());try{i=t.decode(o)}catch(e){if(e.code===Yn.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===Yn.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&n.push(i)}));const i=t.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});t.forEach(((e,t)=>{let r=e.localName;if(!r||1!==i[r])return;if("length"===r&&(r="_length"),null!=n[r])return;const o=n[t];o instanceof Error?Object.defineProperty(n,r,{enumerable:!0,get:()=>{throw o}}):n[r]=o}));for(let e=0;e<n.length;e++){const t=n[e];t instanceof Error&&Object.defineProperty(n,e,{enumerable:!0,get:()=>{throw t}})}return Object.freeze(n)}class aC extends _k{constructor(e,t,n){super("array",e.type+"["+(t>=0?t:"")+"]",n,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let n=0;n<this.length;n++)t.push(e);return t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let n=this.length;-1===n&&(n=t.length,e.writeValue(t.length)),rC.checkArgumentCount(t.length,n,"coder array"+(this.localName?" "+this.localName:""));let r=[];for(let e=0;e<t.length;e++)r.push(this.coder);return iC(e,r,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&rC.throwError("insufficient data length",Yn.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let n=[];for(let e=0;e<t;e++)n.push(new nC(this.coder));return e.coerce(this.name,oC(e,n))}}class sC extends _k{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){return e.writeValue(t?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class lC extends _k{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=nr(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class dC extends lC{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,lr(super.decode(e)))}}class cC extends _k{constructor(e,t){let n="bytes"+String(e);super(n,n,t,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let n=nr(t);return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)}decode(e){return e.coerce(this.name,lr(e.readBytes(this.size)))}}class uC extends _k{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}class pC extends _k{constructor(e,t,n){const r=(t?"int":"uint")+8*e;super(r,r,n,!1),this.size=e,this.signed=t}defaultValue(){return 0}encode(e,t){let n=ne.from(t),r=ca.mask(8*e.wordSize);if(this.signed){let e=r.mask(8*this.size-1);(n.gt(e)||n.lt(e.add(da).mul(sa)))&&this._throwError("value out-of-bounds",t)}else(n.lt(la)||n.gt(r.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return n=n.toTwos(8*this.size).mask(8*this.size),this.signed&&(n=n.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(n)}decode(e){let t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}class hC extends lC{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,xa(t))}decode(e){return Aa(super.decode(e))}}class mC extends _k{constructor(e,t){let n=!1;const r=[];e.forEach((e=>{e.dynamic&&(n=!0),r.push(e.type)}));super("tuple","tuple("+r.join(",")+")",t,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});return this.coders.forEach(((n,r)=>{let i=n.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[r]))})),Object.freeze(e)}encode(e,t){return iC(e,this.coders,t)}decode(e){return e.coerce(this.name,oC(e,this.coders))}}const fC=new Yn(Ek),gC=new RegExp(/^bytes([0-9]*)$/),yC=new RegExp(/^(u?int)([0-9]*)$/);class xC{constructor(e){tu(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new tC(e.name);case"bool":return new sC(e.name);case"string":return new hC(e.name);case"bytes":return new dC(e.name);case"array":return new aC(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new mC((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new uC(e.name)}let t=e.type.match(yC);if(t){let n=parseInt(t[2]||"256");return(0===n||n>256||n%8!=0)&&fC.throwArgumentError("invalid "+t[1]+" bit length","param",e),new pC(n/8,"int"===t[1],e.name)}if(t=e.type.match(gC),t){let n=parseInt(t[1]);return(0===n||n>32)&&fC.throwArgumentError("invalid bytes length","param",e),new cC(n,e.name)}return fC.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new eC(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new $k(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(Dk.from(e))));return new mC(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&fC.throwError("types/values length mismatch",Yn.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const n=e.map((e=>this._getCoder(Dk.from(e)))),r=new mC(n,"_"),i=this._getWriter();return r.encode(i,t),i.data}decode(e,t,n){const r=e.map((e=>this._getCoder(Dk.from(e))));return new mC(r,"_").decode(this._getReader(nr(t),n))}}const vC=new xC,bC=new Yn(Ek);class AC extends cu{}class wC extends cu{}class kC extends cu{}class CC extends cu{static isIndexed(e){return!(!e||!e._isIndexed)}}const jC={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function TC(e,t){const n=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return n.error=t,n}class EC{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,tu(this,"fragments",t.map((e=>Fk.from(e))).filter((e=>null!=e))),tu(this,"_abiCoder",nu(new.target,"getAbiCoder")()),tu(this,"functions",{}),tu(this,"errors",{}),tu(this,"events",{}),tu(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void bC.warn("duplicate definition - constructor"):void tu(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let n=e.format();t[n]?bC.warn("duplicate definition - "+n):t[n]=e})),this.deploy||tu(this,"deploy",qk.from({payable:!1,type:"constructor"})),tu(this,"_isInterface",!0)}format(e){e||(e=Bk.full),e===Bk.sighash&&bC.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Bk.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return vC}static getAddress(e){return Vr(e)}static getSighash(e){return cr(Ru(e.format()),0,4)}static getEventTopic(e){return Ru(e.format())}getFunction(e){if(ar(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];bC.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===n.length?bC.throwArgumentError("no matching function","name",t):n.length>1&&bC.throwArgumentError("multiple matching functions","name",t),this.functions[n[0]]}const t=this.functions[Zk.fromString(e).format()];return t||bC.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(ar(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];bC.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===n.length?bC.throwArgumentError("no matching event","name",t):n.length>1&&bC.throwArgumentError("multiple matching events","name",t),this.events[n[0]]}const t=this.events[Wk.fromString(e).format()];return t||bC.throwArgumentError("no matching event","signature",e),t}getError(e){if(ar(e)){const t=nu(this.constructor,"getSighash");for(const n in this.errors){if(e===t(this.errors[n]))return this.errors[n]}bC.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===n.length?bC.throwArgumentError("no matching error","name",t):n.length>1&&bC.throwArgumentError("multiple matching errors","name",t),this.errors[n[0]]}const t=this.errors[Zk.fromString(e).format()];return t||bC.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return nu(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),nu(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const n=nr(t);return lr(n.slice(0,4))!==this.getSighash(e)&&bC.throwArgumentError(`data signature does not match error ${e.name}.`,"data",lr(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),lr(rr([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const n=nr(t);return lr(n.slice(0,4))!==this.getSighash(e)&&bC.throwArgumentError(`data signature does not match function ${e.name}.`,"data",lr(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),lr(rr([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let n=nr(t),r=null,i="",o=null,a=null,s=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch(e){}break;case 4:{const e=lr(n.slice(0,4)),t=jC[e];if(t)o=this._abiCoder.decode(t.inputs,n.slice(4)),a=t.name,s=t.signature,t.reason&&(r=o[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const t=this.getError(e);o=this._abiCoder.decode(t.inputs,n.slice(4)),a=t.name,s=t.format()}catch(e){}break}}return bC.throwError("call revert exception"+i,Yn.errors.CALL_EXCEPTION,{method:e.format(),data:lr(t),errorArgs:o,errorName:a,errorSignature:s,reason:r})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),lr(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&bC.throwError("too many arguments for "+e.format(),Yn.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let n=[];e.anonymous||n.push(this.getEventTopic(e));const r=(e,t)=>"string"===e.type?Ru(t):"bytes"===e.type?Cr(lr(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=ne.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),mr(lr(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?n.push(null):"array"===o.baseType||"tuple"===o.baseType?bC.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?n.push(t.map((e=>r(o,e)))):n.push(r(o,t)):null!=t&&bC.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const n=[],r=[],i=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&bC.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const a=t[o];if(e.indexed)if("string"===e.type)n.push(Ru(a));else if("bytes"===e.type)n.push(Cr(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(this._abiCoder.encode([e.type],[a]))}else r.push(e),i.push(a)})),{data:this._abiCoder.encode(r,i),topics:n}}decodeEventLog(e,t,n){if("string"==typeof e&&(e=this.getEvent(e)),null!=n&&!e.anonymous){let t=this.getEventTopic(e);ar(n[0],32)&&n[0].toLowerCase()===t||bC.throwError("fragment/topic mismatch",Yn.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:n[0]}),n=n.slice(1)}let r=[],i=[],o=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(r.push(Dk.fromObject({type:"bytes32",name:e.name})),o.push(!0)):(r.push(e),o.push(!1)):(i.push(e),o.push(!1))}));let a=null!=n?this._abiCoder.decode(r,rr(n)):null,s=this._abiCoder.decode(i,t,!0),l=[],d=0,c=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)l[t]=new CC({_isIndexed:!0,hash:null});else if(o[t])l[t]=new CC({_isIndexed:!0,hash:a[c++]});else try{l[t]=a[c++]}catch(e){l[t]=e}else try{l[t]=s[d++]}catch(e){l[t]=e}if(e.name&&null==l[e.name]){const n=l[t];n instanceof Error?Object.defineProperty(l,e.name,{enumerable:!0,get:()=>{throw TC(`property ${JSON.stringify(e.name)}`,n)}}):l[e.name]=n}}));for(let e=0;e<l.length;e++){const t=l[e];t instanceof Error&&Object.defineProperty(l,e,{enumerable:!0,get:()=>{throw TC(`index ${e}`,t)}})}return Object.freeze(l)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new wC({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:ne.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new AC({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=lr(e);let n=this.getError(t.substring(0,10).toLowerCase());return n?new kC({args:this._abiCoder.decode(n.inputs,"0x"+t.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!(!e||!e._isInterface)}}var SC=Object.freeze({__proto__:null,AbiCoder:xC,ConstructorFragment:qk,ErrorFragment:Qk,EventFragment:Wk,FormatTypes:Bk,Fragment:Fk,FunctionFragment:Zk,Indexed:CC,Interface:EC,LogDescription:AC,ParamType:Dk,TransactionDescription:wC,checkResultErrors:function(e){const t=[],n=function(e,r){if(Array.isArray(r))for(let i in r){const o=e.slice();o.push(i);try{n(o,r[i])}catch(e){t.push({path:o,error:e})}}};return n([],e),t},defaultAbiCoder:vC});function IC({factoryAddress:e,tokenA:t,tokenB:n,fee:r,initCodeHashManualOverride:i,chainId:o}){const[a,s]=t.sortsBefore(n)?[t,n]:[n,t],l=Ua(["bytes"],[vC.encode(["address","address","uint24"],[a.address,s.address,r])]),d=null!=i?i:function(e){return e===oe.TAIKO?"0x5ccd5621c1bb9e44ce98cef8b90d31eb2423dec3793b6239232cefae976936ea":vk}(o);return Hr(e,l,d)}const RC=tn.BigInt(2),LC=[128,64,32,16,8,4,2,1].map((e=>[e,tn.exponentiate(RC,tn.BigInt(e))]));function MC(e,t){return tn.signedRightShift(tn.multiply(e,tn.BigInt(t)),tn.BigInt(128))}const OC=tn.exponentiate(tn.BigInt(2),tn.BigInt(32));let BC=class e{constructor(){}static getSqrtRatioAtTick(t){nn(t>=e.MIN_TICK&&t<=e.MAX_TICK&&Number.isInteger(t),"TICK");const n=t<0?-1*t:t;let r=1&n?tn.BigInt("0xfffcb933bd6fad37aa2d162d1a594001"):tn.BigInt("0x100000000000000000000000000000000");return 2&n&&(r=MC(r,"0xfff97272373d413259a46990580e213a")),4&n&&(r=MC(r,"0xfff2e50f5f656932ef12357cf3c7fdcc")),8&n&&(r=MC(r,"0xffe5caca7e10e4e61c3624eaa0941cd0")),16&n&&(r=MC(r,"0xffcb9843d60f6159c9db58835c926644")),32&n&&(r=MC(r,"0xff973b41fa98c081472e6896dfb254c0")),64&n&&(r=MC(r,"0xff2ea16466c96a3843ec78b326b52861")),128&n&&(r=MC(r,"0xfe5dee046a99a2a811c461f1969c3053")),256&n&&(r=MC(r,"0xfcbe86c7900a88aedcffc83b479aa3a4")),512&n&&(r=MC(r,"0xf987a7253ac413176f2b074cf7815e54")),1024&n&&(r=MC(r,"0xf3392b0822b70005940c7a398e4b70f3")),2048&n&&(r=MC(r,"0xe7159475a2c29b7443b29c7fa6e889d9")),4096&n&&(r=MC(r,"0xd097f3bdfd2022b8845ad8f792aa5825")),8192&n&&(r=MC(r,"0xa9f746462d870fdf8a65dc1f90e061e5")),16384&n&&(r=MC(r,"0x70d869a156d2a1b890bb3df62baf32f7")),32768&n&&(r=MC(r,"0x31be135f97d08fd981231505542fcfa6")),65536&n&&(r=MC(r,"0x9aa508b5b7a84e1c677de54f3e99bc9")),131072&n&&(r=MC(r,"0x5d6af8dedb81196699c329225ee604")),262144&n&&(r=MC(r,"0x2216e584f5fa1ea926041bedfe98")),524288&n&&(r=MC(r,"0x48a170391f7dc42444e8fa2")),t>0&&(r=tn.divide($w,r)),tn.greaterThan(tn.remainder(r,OC),kk)?tn.add(tn.divide(r,OC),Ck):tn.divide(r,OC)}static getTickAtSqrtRatio(t){nn(tn.greaterThanOrEqual(t,e.MIN_SQRT_RATIO)&&tn.lessThan(t,e.MAX_SQRT_RATIO),"SQRT_RATIO");const n=tn.leftShift(t,tn.BigInt(32)),r=function(e){nn(tn.greaterThan(e,kk),"ZERO"),nn(tn.lessThanOrEqual(e,$w),"MAX");let t=0;for(const[n,r]of LC)tn.greaterThanOrEqual(e,r)&&(e=tn.signedRightShift(e,tn.BigInt(n)),t+=n);return t}(n);let i;i=tn.greaterThanOrEqual(tn.BigInt(r),tn.BigInt(128))?tn.signedRightShift(n,tn.BigInt(r-127)):tn.leftShift(n,tn.BigInt(127-r));let o=tn.leftShift(tn.subtract(tn.BigInt(r),tn.BigInt(128)),tn.BigInt(64));for(let e=0;e<14;e++){i=tn.signedRightShift(tn.multiply(i,i),tn.BigInt(127));const t=tn.signedRightShift(i,tn.BigInt(128));o=tn.bitwiseOr(o,tn.leftShift(t,tn.BigInt(63-e))),i=tn.signedRightShift(i,t)}const a=tn.multiply(o,tn.BigInt("255738958999603826347141")),s=tn.toNumber(tn.signedRightShift(tn.subtract(a,tn.BigInt("3402992956809132418596140100660247210")),tn.BigInt(128))),l=tn.toNumber(tn.signedRightShift(tn.add(a,tn.BigInt("291339464771989622907027621153398088495")),tn.BigInt(128)));return s===l?s:tn.lessThanOrEqual(e.getSqrtRatioAtTick(l),t)?l:s}};BC.MIN_TICK=-887272,BC.MAX_TICK=-BC.MIN_TICK,BC.MIN_SQRT_RATIO=tn.BigInt("4295128739"),BC.MAX_SQRT_RATIO=tn.BigInt("1461446703485210103287273052203988822378723970342");let PC=class{constructor(){}static mulDivRoundingUp(e,t,n){const r=tn.multiply(e,t);let i=tn.divide(r,n);return tn.notEqual(tn.remainder(r,n),kk)&&(i=tn.add(i,Ck)),i}};const DC=tn.subtract(tn.exponentiate(tn.BigInt(2),tn.BigInt(160)),Ck);function NC(e,t){const n=tn.multiply(e,t);return tn.bitwiseAnd(n,$w)}let FC=class{constructor(){}static getAmount0Delta(e,t,n,r){tn.greaterThan(e,t)&&([e,t]=[t,e]);const i=tn.leftShift(n,tn.BigInt(96)),o=tn.subtract(t,e);return r?PC.mulDivRoundingUp(PC.mulDivRoundingUp(i,o,t),Ck,e):tn.divide(tn.divide(tn.multiply(i,o),t),e)}static getAmount1Delta(e,t,n,r){return tn.greaterThan(e,t)&&([e,t]=[t,e]),r?PC.mulDivRoundingUp(n,tn.subtract(t,e),jk):tn.divide(tn.multiply(n,tn.subtract(t,e)),jk)}static getNextSqrtPriceFromInput(e,t,n,r){return nn(tn.greaterThan(e,kk)),nn(tn.greaterThan(t,kk)),r?this.getNextSqrtPriceFromAmount0RoundingUp(e,t,n,!0):this.getNextSqrtPriceFromAmount1RoundingDown(e,t,n,!0)}static getNextSqrtPriceFromOutput(e,t,n,r){return nn(tn.greaterThan(e,kk)),nn(tn.greaterThan(t,kk)),r?this.getNextSqrtPriceFromAmount1RoundingDown(e,t,n,!1):this.getNextSqrtPriceFromAmount0RoundingUp(e,t,n,!1)}static getNextSqrtPriceFromAmount0RoundingUp(e,t,n,r){if(tn.equal(n,kk))return e;const i=tn.leftShift(t,tn.BigInt(96));if(r){let t=NC(n,e);if(tn.equal(tn.divide(t,n),e)){const n=function(e,t){const n=tn.add(e,t);return tn.bitwiseAnd(n,$w)}(i,t);if(tn.greaterThanOrEqual(n,i))return PC.mulDivRoundingUp(i,e,n)}return PC.mulDivRoundingUp(i,Ck,tn.add(tn.divide(i,e),n))}{let t=NC(n,e);nn(tn.equal(tn.divide(t,n),e)),nn(tn.greaterThan(i,t));const r=tn.subtract(i,t);return PC.mulDivRoundingUp(i,e,r)}}static getNextSqrtPriceFromAmount1RoundingDown(e,t,n,r){if(r){const r=tn.lessThanOrEqual(n,DC)?tn.divide(tn.leftShift(n,tn.BigInt(96)),t):tn.divide(tn.multiply(n,jk),t);return tn.add(e,r)}{const r=PC.mulDivRoundingUp(n,jk,t);return nn(tn.greaterThan(e,r)),tn.subtract(e,r)}}};const WC=tn.exponentiate(tn.BigInt(10),tn.BigInt(6));class VC{constructor(){}static computeSwapStep(e,t,n,r,i){const o={};i=tn.BigInt(i);const a=tn.greaterThanOrEqual(e,t),s=tn.greaterThanOrEqual(r,kk);if(s){const s=tn.divide(tn.multiply(r,tn.subtract(WC,i)),WC);o.amountIn=a?FC.getAmount0Delta(t,e,n,!0):FC.getAmount1Delta(e,t,n,!0),tn.greaterThanOrEqual(s,o.amountIn)?o.sqrtRatioNextX96=t:o.sqrtRatioNextX96=FC.getNextSqrtPriceFromInput(e,n,s,a)}else o.amountOut=a?FC.getAmount1Delta(t,e,n,!1):FC.getAmount0Delta(e,t,n,!1),tn.greaterThanOrEqual(tn.multiply(r,wk),o.amountOut)?o.sqrtRatioNextX96=t:o.sqrtRatioNextX96=FC.getNextSqrtPriceFromOutput(e,n,tn.multiply(r,wk),a);const l=tn.equal(t,o.sqrtRatioNextX96);return a?(o.amountIn=l&&s?o.amountIn:FC.getAmount0Delta(o.sqrtRatioNextX96,e,n,!0),o.amountOut=l&&!s?o.amountOut:FC.getAmount1Delta(o.sqrtRatioNextX96,e,n,!1)):(o.amountIn=l&&s?o.amountIn:FC.getAmount1Delta(e,o.sqrtRatioNextX96,n,!0),o.amountOut=l&&!s?o.amountOut:FC.getAmount0Delta(e,o.sqrtRatioNextX96,n,!1)),!s&&tn.greaterThan(o.amountOut,tn.multiply(r,wk))&&(o.amountOut=tn.multiply(r,wk)),s&&tn.notEqual(o.sqrtRatioNextX96,t)?o.feeAmount=tn.subtract(r,o.amountIn):o.feeAmount=PC.mulDivRoundingUp(o.amountIn,i,tn.subtract(WC,i)),[o.sqrtRatioNextX96,o.amountIn,o.amountOut,o.feeAmount]}}class UC{constructor(){}static addDelta(e,t){return tn.lessThan(t,kk)?tn.subtract(e,tn.multiply(t,wk)):tn.add(e,t)}}class HC{getTick(e){return Fn(this,void 0,void 0,(function*(){throw new Error(HC.ERROR_MESSAGE)}))}nextInitializedTickWithinOneWord(e,t,n){return Fn(this,void 0,void 0,(function*(){throw new Error(HC.ERROR_MESSAGE)}))}}function qC(e,t){return e.index-t.index}HC.ERROR_MESSAGE="No tick data provider was given";class ZC{constructor(){}static validateList(e,t){nn(t>0,"TICK_SPACING_NONZERO"),nn(e.every((({index:e})=>e%t==0)),"TICK_SPACING"),nn(tn.equal(e.reduce(((e,{liquidityNet:t})=>tn.add(e,t)),kk),kk),"ZERO_NET"),nn(function(e,t){for(let n=0;n<e.length-1;n++)if(t(e[n],e[n+1])>0)return!1;return!0}(e,qC),"SORTED")}static isBelowSmallest(e,t){return nn(e.length>0,"LENGTH"),t<e[0].index}static isAtOrAboveLargest(e,t){return nn(e.length>0,"LENGTH"),t>=e[e.length-1].index}static getTick(e,t){const n=e[this.binarySearch(e,t)];return nn(n.index===t,"NOT_CONTAINED"),n}static binarySearch(e,t){nn(!this.isBelowSmallest(e,t),"BELOW_SMALLEST");let n,r=0,i=e.length-1;for(;;){if(n=Math.floor((r+i)/2),e[n].index<=t&&(n===e.length-1||e[n+1].index>t))return n;e[n].index<t?r=n+1:i=n-1}}static nextInitializedTick(e,t,n){if(n){if(nn(!ZC.isBelowSmallest(e,t),"BELOW_SMALLEST"),ZC.isAtOrAboveLargest(e,t))return e[e.length-1];return e[this.binarySearch(e,t)]}if(nn(!this.isAtOrAboveLargest(e,t),"AT_OR_ABOVE_LARGEST"),this.isBelowSmallest(e,t))return e[0];return e[this.binarySearch(e,t)+1]}static nextInitializedTickWithinOneWord(e,t,n,r){const i=Math.floor(t/r);if(n){const o=(i>>8<<8)*r;if(ZC.isBelowSmallest(e,t))return[o,!1];const a=ZC.nextInitializedTick(e,t,n).index,s=Math.max(o,a);return[s,s===a]}{const o=(((i+1>>8)+1<<8)-1)*r;if(this.isAtOrAboveLargest(e,t))return[o,!1];const a=this.nextInitializedTick(e,t,n).index,s=Math.min(o,a);return[s,s===a]}}}function zC(e){let t=tn.BigInt(e).toString(16);return t.length%2!=0&&(t=`0${t}`),`0x${t}`}function QC(e,t){const n=tn.leftShift(tn.BigInt(e),tn.BigInt(192)),r=tn.BigInt(t);return function(e){if(nn(tn.greaterThanOrEqual(e,hk),"NEGATIVE"),tn.lessThan(e,pk))return tn.BigInt(Math.floor(Math.sqrt(tn.toNumber(e))));let t,n;for(t=e,n=tn.add(tn.divide(e,fk),mk);tn.lessThan(n,t);)t=n,n=tn.divide(tn.add(tn.divide(e,n),n),fk);return t}(tn.divide(n,r))}function GC(e,t,n){tn.greaterThan(e,t)&&([e,t]=[t,e]);const r=tn.divide(tn.multiply(e,t),jk);return tn.divide(tn.multiply(tn.BigInt(n),r),tn.subtract(t,e))}function YC(e,t,n){tn.greaterThan(e,t)&&([e,t]=[t,e]);const r=tn.multiply(tn.multiply(tn.BigInt(n),e),t),i=tn.multiply(jk,tn.subtract(t,e));return tn.divide(r,i)}function XC(e,t,n){return tn.greaterThan(e,t)&&([e,t]=[t,e]),tn.divide(tn.multiply(tn.BigInt(n),jk),tn.subtract(t,e))}function JC(e,t,n,r,i,o){tn.greaterThan(t,n)&&([t,n]=[n,t]);const a=o?YC:GC;if(tn.lessThanOrEqual(e,t))return a(t,n,r);if(tn.lessThan(e,n)){const o=a(e,n,r),s=XC(t,e,i);return tn.lessThan(o,s)?o:s}return XC(t,n,i)}function KC(e,t){nn(Number.isInteger(e)&&Number.isInteger(t),"INTEGERS"),nn(t>0,"TICK_SPACING"),nn(e>=BC.MIN_TICK&&e<=BC.MAX_TICK,"TICK_BOUND");const n=Math.round(e/t)*t;return n<BC.MIN_TICK?n+t:n>BC.MAX_TICK?n-t:n}function _C(e,t,n){const r=BC.getSqrtRatioAtTick(n),i=tn.multiply(r,r);return e.sortsBefore(t)?new sk(e,t,Tk,i):new sk(e,t,i,Tk)}function $C(e){const t=e.baseCurrency.sortsBefore(e.quoteCurrency),n=t?QC(e.numerator,e.denominator):QC(e.denominator,e.numerator);let r=BC.getTickAtSqrtRatio(n);const i=_C(e.baseCurrency,e.quoteCurrency,r+1);return t?e.lessThan(i)||r++:e.greaterThan(i)||r++,r}tn.exponentiate(tn.BigInt(2),tn.BigInt(128)),tn.exponentiate(tn.BigInt(2),tn.BigInt(256));class ej{constructor({index:e,liquidityGross:t,liquidityNet:n}){nn(e>=BC.MIN_TICK&&e<=BC.MAX_TICK,"TICK"),this.index=e,this.liquidityGross=tn.BigInt(t),this.liquidityNet=tn.BigInt(n)}}class tj{constructor(e,t){const n=e.map((e=>e instanceof ej?e:new ej(e)));ZC.validateList(n,t),this.ticks=n}getTick(e){return Fn(this,void 0,void 0,(function*(){return ZC.getTick(this.ticks,e)}))}nextInitializedTickWithinOneWord(e,t,n){return Fn(this,void 0,void 0,(function*(){return ZC.nextInitializedTickWithinOneWord(this.ticks,e,t,n)}))}}const nj=new HC;let rj=class e{static getAddress(e,t,n,r,i){return IC({factoryAddress:null!=i?i:"0x78172691DD3B8ADa7aEbd9bFfB487FB11D735DB2",fee:n,tokenA:e,tokenB:t,initCodeHashManualOverride:r})}constructor(e,t,n,r,i,o,a=nj){nn(Number.isInteger(n)&&n<1e6,"FEE");const s=BC.getSqrtRatioAtTick(o),l=BC.getSqrtRatioAtTick(o+1);nn(tn.greaterThanOrEqual(tn.BigInt(r),s)&&tn.lessThanOrEqual(tn.BigInt(r),l),"PRICE_BOUNDS"),[this.token0,this.token1]=e.sortsBefore(t)?[e,t]:[t,e],this.fee=n,this.sqrtRatioX96=tn.BigInt(r),this.liquidity=tn.BigInt(i),this.tickCurrent=o,this.tickDataProvider=Array.isArray(a)?new tj(a,Ak[n]):a}involvesToken(e){return e.equals(this.token0)||e.equals(this.token1)}get token0Price(){var e;return null!==(e=this._token0Price)&&void 0!==e?e:this._token0Price=new sk(this.token0,this.token1,Tk,tn.multiply(this.sqrtRatioX96,this.sqrtRatioX96))}get token1Price(){var e;return null!==(e=this._token1Price)&&void 0!==e?e:this._token1Price=new sk(this.token1,this.token0,tn.multiply(this.sqrtRatioX96,this.sqrtRatioX96),Tk)}priceOf(e){return nn(this.involvesToken(e),"TOKEN"),e.equals(this.token0)?this.token0Price:this.token1Price}get chainId(){return this.token0.chainId}getOutputAmount(t,n){return Fn(this,void 0,void 0,(function*(){nn(this.involvesToken(t.currency),"TOKEN");const r=t.currency.equals(this.token0),{amountCalculated:i,sqrtRatioX96:o,liquidity:a,tickCurrent:s}=yield this.swap(r,t.quotient,n),l=r?this.token1:this.token0;return[rk.fromRawAmount(l,tn.multiply(i,wk)),new e(this.token0,this.token1,this.fee,o,a,s,this.tickDataProvider)]}))}getInputAmount(t,n){return Fn(this,void 0,void 0,(function*(){nn(t.currency.isToken&&this.involvesToken(t.currency),"TOKEN");const r=t.currency.equals(this.token1),{amountCalculated:i,sqrtRatioX96:o,liquidity:a,tickCurrent:s}=yield this.swap(r,tn.multiply(t.quotient,wk),n),l=r?this.token0:this.token1;return[rk.fromRawAmount(l,i),new e(this.token0,this.token1,this.fee,o,a,s,this.tickDataProvider)]}))}swap(e,t,n){return Fn(this,void 0,void 0,(function*(){return function(e,t,n,r,i,o,a,s,l){return Fn(this,void 0,void 0,(function*(){l||(l=a?tn.add(BC.MIN_SQRT_RATIO,Ck):tn.subtract(BC.MAX_SQRT_RATIO,Ck)),a?(nn(tn.greaterThan(l,BC.MIN_SQRT_RATIO),"RATIO_MIN"),nn(tn.lessThan(l,t),"RATIO_CURRENT")):(nn(tn.lessThan(l,BC.MAX_SQRT_RATIO),"RATIO_MAX"),nn(tn.greaterThan(l,t),"RATIO_CURRENT"));const d=tn.greaterThanOrEqual(s,kk),c={amountSpecifiedRemaining:s,amountCalculated:kk,sqrtPriceX96:t,tick:n,liquidity:r};for(;tn.notEqual(c.amountSpecifiedRemaining,kk)&&c.sqrtPriceX96!==l;){let t={};if(t.sqrtPriceStartX96=c.sqrtPriceX96,[t.tickNext,t.initialized]=yield o.nextInitializedTickWithinOneWord(c.tick,a,i),t.tickNext<BC.MIN_TICK?t.tickNext=BC.MIN_TICK:t.tickNext>BC.MAX_TICK&&(t.tickNext=BC.MAX_TICK),t.sqrtPriceNextX96=BC.getSqrtRatioAtTick(t.tickNext),[c.sqrtPriceX96,t.amountIn,t.amountOut,t.feeAmount]=VC.computeSwapStep(c.sqrtPriceX96,(a?tn.lessThan(t.sqrtPriceNextX96,l):tn.greaterThan(t.sqrtPriceNextX96,l))?l:t.sqrtPriceNextX96,c.liquidity,c.amountSpecifiedRemaining,e),d?(c.amountSpecifiedRemaining=tn.subtract(c.amountSpecifiedRemaining,tn.add(t.amountIn,t.feeAmount)),c.amountCalculated=tn.subtract(c.amountCalculated,t.amountOut)):(c.amountSpecifiedRemaining=tn.add(c.amountSpecifiedRemaining,t.amountOut),c.amountCalculated=tn.add(c.amountCalculated,tn.add(t.amountIn,t.feeAmount))),tn.equal(c.sqrtPriceX96,t.sqrtPriceNextX96)){if(t.initialized){let e=tn.BigInt((yield o.getTick(t.tickNext)).liquidityNet);a&&(e=tn.multiply(e,wk)),c.liquidity=UC.addDelta(c.liquidity,e)}c.tick=a?t.tickNext-1:t.tickNext}else tn.notEqual(c.sqrtPriceX96,t.sqrtPriceStartX96)&&(c.tick=BC.getTickAtSqrtRatio(c.sqrtPriceX96))}return{amountCalculated:c.amountCalculated,sqrtRatioX96:c.sqrtPriceX96,liquidity:c.liquidity,tickCurrent:c.tick}}))}(tn.BigInt(this.fee),this.sqrtRatioX96,this.tickCurrent,this.liquidity,this.tickSpacing,this.tickDataProvider,e,t,n)}))}get tickSpacing(){return Ak[this.fee]}},ij=class e{constructor({pool:e,liquidity:t,tickLower:n,tickUpper:r}){this._token0Amount=null,this._token1Amount=null,this._mintAmounts=null,nn(n<r,"TICK_ORDER"),nn(n>=BC.MIN_TICK&&n%e.tickSpacing==0,"TICK_LOWER"),nn(r<=BC.MAX_TICK&&r%e.tickSpacing==0,"TICK_UPPER"),this.pool=e,this.tickLower=n,this.tickUpper=r,this.liquidity=tn.BigInt(t)}get token0PriceLower(){return _C(this.pool.token0,this.pool.token1,this.tickLower)}get token0PriceUpper(){return _C(this.pool.token0,this.pool.token1,this.tickUpper)}get amount0(){return null===this._token0Amount&&(this.pool.tickCurrent<this.tickLower?this._token0Amount=rk.fromRawAmount(this.pool.token0,FC.getAmount0Delta(BC.getSqrtRatioAtTick(this.tickLower),BC.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1)):this.pool.tickCurrent<this.tickUpper?this._token0Amount=rk.fromRawAmount(this.pool.token0,FC.getAmount0Delta(this.pool.sqrtRatioX96,BC.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1)):this._token0Amount=rk.fromRawAmount(this.pool.token0,kk)),this._token0Amount}get amount1(){return null===this._token1Amount&&(this.pool.tickCurrent<this.tickLower?this._token1Amount=rk.fromRawAmount(this.pool.token1,kk):this.pool.tickCurrent<this.tickUpper?this._token1Amount=rk.fromRawAmount(this.pool.token1,FC.getAmount1Delta(BC.getSqrtRatioAtTick(this.tickLower),this.pool.sqrtRatioX96,this.liquidity,!1)):this._token1Amount=rk.fromRawAmount(this.pool.token1,FC.getAmount1Delta(BC.getSqrtRatioAtTick(this.tickLower),BC.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1))),this._token1Amount}ratiosAfterSlippage(e){const t=this.pool.token0Price.asFraction.multiply(new ak(1).subtract(e)),n=this.pool.token0Price.asFraction.multiply(e.add(1));let r=QC(t.numerator,t.denominator);tn.lessThanOrEqual(r,BC.MIN_SQRT_RATIO)&&(r=tn.add(BC.MIN_SQRT_RATIO,tn.BigInt(1)));let i=QC(n.numerator,n.denominator);return tn.greaterThanOrEqual(i,BC.MAX_SQRT_RATIO)&&(i=tn.subtract(BC.MAX_SQRT_RATIO,tn.BigInt(1))),{sqrtRatioX96Lower:r,sqrtRatioX96Upper:i}}mintAmountsWithSlippage(t){const{sqrtRatioX96Upper:n,sqrtRatioX96Lower:r}=this.ratiosAfterSlippage(t),i=new rj(this.pool.token0,this.pool.token1,this.pool.fee,r,0,BC.getTickAtSqrtRatio(r)),o=new rj(this.pool.token0,this.pool.token1,this.pool.fee,n,0,BC.getTickAtSqrtRatio(n)),a=e.fromAmounts(Object.assign(Object.assign({pool:this.pool,tickLower:this.tickLower,tickUpper:this.tickUpper},this.mintAmounts),{useFullPrecision:!1})),{amount0:s}=new e({pool:o,liquidity:a.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).mintAmounts,{amount1:l}=new e({pool:i,liquidity:a.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).mintAmounts;return{amount0:s,amount1:l}}burnAmountsWithSlippage(t){const{sqrtRatioX96Upper:n,sqrtRatioX96Lower:r}=this.ratiosAfterSlippage(t),i=new rj(this.pool.token0,this.pool.token1,this.pool.fee,r,0,BC.getTickAtSqrtRatio(r)),o=new rj(this.pool.token0,this.pool.token1,this.pool.fee,n,0,BC.getTickAtSqrtRatio(n)),a=new e({pool:o,liquidity:this.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).amount0,s=new e({pool:i,liquidity:this.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).amount1;return{amount0:a.quotient,amount1:s.quotient}}get mintAmounts(){return null===this._mintAmounts?this.pool.tickCurrent<this.tickLower?{amount0:FC.getAmount0Delta(BC.getSqrtRatioAtTick(this.tickLower),BC.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!0),amount1:kk}:this.pool.tickCurrent<this.tickUpper?{amount0:FC.getAmount0Delta(this.pool.sqrtRatioX96,BC.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!0),amount1:FC.getAmount1Delta(BC.getSqrtRatioAtTick(this.tickLower),this.pool.sqrtRatioX96,this.liquidity,!0)}:{amount0:kk,amount1:FC.getAmount1Delta(BC.getSqrtRatioAtTick(this.tickLower),BC.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!0)}:this._mintAmounts}static fromAmounts({pool:t,tickLower:n,tickUpper:r,amount0:i,amount1:o,useFullPrecision:a}){const s=BC.getSqrtRatioAtTick(n),l=BC.getSqrtRatioAtTick(r);return new e({pool:t,tickLower:n,tickUpper:r,liquidity:JC(t.sqrtRatioX96,s,l,i,o,a)})}static fromAmount0({pool:t,tickLower:n,tickUpper:r,amount0:i,useFullPrecision:o}){return e.fromAmounts({pool:t,tickLower:n,tickUpper:r,amount0:i,amount1:$w,useFullPrecision:o})}static fromAmount1({pool:t,tickLower:n,tickUpper:r,amount1:i}){return e.fromAmounts({pool:t,tickLower:n,tickUpper:r,amount0:$w,amount1:i,useFullPrecision:!0})}};var oj=[{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"}];class aj{constructor(){}static encodeMulticall(e){return Array.isArray(e)||(e=[e]),1===e.length?e[0]:aj.INTERFACE.encodeFunctionData("multicall",[e])}static decodeMulticall(e){return aj.INTERFACE.decodeFunctionData("multicall",e).data}}aj.INTERFACE=new EC(oj);var sj=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH9",type:"address"},{internalType:"address",name:"_tokenDescriptor_",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Collect",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint128",name:"liquidity",type:"uint128"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"DecreaseLiquidity",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint128",name:"liquidity",type:"uint128"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"IncreaseLiquidity",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"WETH9",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"baseURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint128",name:"amount0Max",type:"uint128"},{internalType:"uint128",name:"amount1Max",type:"uint128"}],internalType:"struct INonfungiblePositionManager.CollectParams",name:"params",type:"tuple"}],name:"collect",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token0",type:"address"},{internalType:"address",name:"token1",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint160",name:"sqrtPriceX96",type:"uint160"}],name:"createAndInitializePoolIfNecessary",outputs:[{internalType:"address",name:"pool",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint128",name:"liquidity",type:"uint128"},{internalType:"uint256",name:"amount0Min",type:"uint256"},{internalType:"uint256",name:"amount1Min",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"}],internalType:"struct INonfungiblePositionManager.DecreaseLiquidityParams",name:"params",type:"tuple"}],name:"decreaseLiquidity",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"amount0Desired",type:"uint256"},{internalType:"uint256",name:"amount1Desired",type:"uint256"},{internalType:"uint256",name:"amount0Min",type:"uint256"},{internalType:"uint256",name:"amount1Min",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"}],internalType:"struct INonfungiblePositionManager.IncreaseLiquidityParams",name:"params",type:"tuple"}],name:"increaseLiquidity",outputs:[{internalType:"uint128",name:"liquidity",type:"uint128"},{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"token0",type:"address"},{internalType:"address",name:"token1",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"},{internalType:"uint256",name:"amount0Desired",type:"uint256"},{internalType:"uint256",name:"amount1Desired",type:"uint256"},{internalType:"uint256",name:"amount0Min",type:"uint256"},{internalType:"uint256",name:"amount1Min",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],internalType:"struct INonfungiblePositionManager.MintParams",name:"params",type:"tuple"}],name:"mint",outputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint128",name:"liquidity",type:"uint128"},{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"positions",outputs:[{internalType:"uint96",name:"nonce",type:"uint96"},{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"token0",type:"address"},{internalType:"address",name:"token1",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"},{internalType:"uint128",name:"liquidity",type:"uint128"},{internalType:"uint256",name:"feeGrowthInside0LastX128",type:"uint256"},{internalType:"uint256",name:"feeGrowthInside1LastX128",type:"uint256"},{internalType:"uint128",name:"tokensOwed0",type:"uint128"},{internalType:"uint128",name:"tokensOwed1",type:"uint128"}],stateMutability:"view",type:"function"},{inputs:[],name:"refundETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowed",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowedIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"sweepToken",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenOfOwnerByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount0Owed",type:"uint256"},{internalType:"uint256",name:"amount1Owed",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"uniswapV3MintCallback",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"unwrapWETH9",outputs:[],stateMutability:"payable",type:"function"},{stateMutability:"payable",type:"receive"}],lj=[{inputs:[],name:"refundETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"sweepToken",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"sweepTokenWithFee",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"unwrapWETH9",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"unwrapWETH9WithFee",outputs:[],stateMutability:"payable",type:"function"}];class dj{constructor(){}static encodeFeeBips(e){return zC(e.multiply(1e4).quotient)}static encodeUnwrapWETH9(e,t,n){if(t=dk(t),n){const r=this.encodeFeeBips(n.fee),i=dk(n.recipient);return dj.INTERFACE.encodeFunctionData("unwrapWETH9WithFee",[zC(e),t,r,i])}return dj.INTERFACE.encodeFunctionData("unwrapWETH9",[zC(e),t])}static encodeSweepToken(e,t,n,r){if(n=dk(n),r){const i=this.encodeFeeBips(r.fee),o=dk(r.recipient);return dj.INTERFACE.encodeFunctionData("sweepTokenWithFee",[e.address,zC(t),n,i,o])}return dj.INTERFACE.encodeFunctionData("sweepToken",[e.address,zC(t),n])}static encodeRefundETH(){return dj.INTERFACE.encodeFunctionData("refundETH")}}dj.INTERFACE=new EC(lj);var cj=[{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowed",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowedIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitIfNecessary",outputs:[],stateMutability:"payable",type:"function"}];class uj{constructor(){}static encodePermit(e,t){return"nonce"in t?uj.INTERFACE.encodeFunctionData("selfPermitAllowed",[e.address,zC(t.nonce),zC(t.expiry),t.v,t.r,t.s]):uj.INTERFACE.encodeFunctionData("selfPermit",[e.address,zC(t.amount),zC(t.deadline),t.v,t.r,t.s])}}uj.INTERFACE=new EC(cj);const pj=zC(tn.subtract(tn.exponentiate(tn.BigInt(2),tn.BigInt(128)),tn.BigInt(1)));function hj(e){return Object.keys(e).some((e=>"recipient"===e))}const mj={Permit:[{name:"spender",type:"address"},{name:"tokenId",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]};class fj{constructor(){}static encodeCreate(e){return fj.INTERFACE.encodeFunctionData("createAndInitializePoolIfNecessary",[e.token0.address,e.token1.address,e.fee,zC(e.sqrtRatioX96)])}static createCallParameters(e){return{calldata:this.encodeCreate(e),value:zC(0)}}static addCallParameters(e,t){nn(tn.greaterThan(e.liquidity,kk),"ZERO_LIQUIDITY");const n=[],{amount0:r,amount1:i}=e.mintAmounts,o=e.mintAmountsWithSlippage(t.slippageTolerance),a=zC(o.amount0),s=zC(o.amount1),l=zC(t.deadline);if(hj(t)&&t.createPool&&n.push(this.encodeCreate(e.pool)),t.token0Permit&&n.push(uj.encodePermit(e.pool.token0,t.token0Permit)),t.token1Permit&&n.push(uj.encodePermit(e.pool.token1,t.token1Permit)),hj(t)){const o=dk(t.recipient);n.push(fj.INTERFACE.encodeFunctionData("mint",[{token0:e.pool.token0.address,token1:e.pool.token1.address,fee:e.pool.fee,tickLower:e.tickLower,tickUpper:e.tickUpper,amount0Desired:zC(r),amount1Desired:zC(i),amount0Min:a,amount1Min:s,recipient:o,deadline:l}]))}else n.push(fj.INTERFACE.encodeFunctionData("increaseLiquidity",[{tokenId:zC(t.tokenId),amount0Desired:zC(r),amount1Desired:zC(i),amount0Min:a,amount1Min:s,deadline:l}]));let d=zC(0);if(t.useNative){const o=t.useNative.wrapped;nn(e.pool.token0.equals(o)||e.pool.token1.equals(o),"NO_WETH");const a=e.pool.token0.equals(o)?r:i;tn.greaterThan(a,kk)&&n.push(dj.encodeRefundETH()),d=zC(a)}return{calldata:aj.encodeMulticall(n),value:d}}static encodeCollect(e){const t=[],n=zC(e.tokenId),r=e.expectedCurrencyOwed0.currency.isNative||e.expectedCurrencyOwed1.currency.isNative,i=dk(e.recipient);if(t.push(fj.INTERFACE.encodeFunctionData("collect",[{tokenId:n,recipient:r?"0x0000000000000000000000000000000000000000":i,amount0Max:pj,amount1Max:pj}])),r){const n=e.expectedCurrencyOwed0.currency.isNative?e.expectedCurrencyOwed0.quotient:e.expectedCurrencyOwed1.quotient,r=e.expectedCurrencyOwed0.currency.isNative?e.expectedCurrencyOwed1.currency:e.expectedCurrencyOwed0.currency,o=e.expectedCurrencyOwed0.currency.isNative?e.expectedCurrencyOwed1.quotient:e.expectedCurrencyOwed0.quotient;t.push(dj.encodeUnwrapWETH9(n,i)),t.push(dj.encodeSweepToken(r,o,i))}return t}static collectCallParameters(e){const t=fj.encodeCollect(e);return{calldata:aj.encodeMulticall(t),value:zC(0)}}static removeCallParameters(e,t){const n=[],r=zC(t.deadline),i=zC(t.tokenId),o=new ij({pool:e.pool,liquidity:t.liquidityPercentage.multiply(e.liquidity).quotient,tickLower:e.tickLower,tickUpper:e.tickUpper});nn(tn.greaterThan(o.liquidity,kk),"ZERO_LIQUIDITY");const{amount0:a,amount1:s}=o.burnAmountsWithSlippage(t.slippageTolerance);t.permit&&n.push(fj.INTERFACE.encodeFunctionData("permit",[dk(t.permit.spender),i,zC(t.permit.deadline),t.permit.v,t.permit.r,t.permit.s])),n.push(fj.INTERFACE.encodeFunctionData("decreaseLiquidity",[{tokenId:i,liquidity:zC(o.liquidity),amount0Min:zC(a),amount1Min:zC(s),deadline:r}]));const l=t.collectOptions,{expectedCurrencyOwed0:d,expectedCurrencyOwed1:c}=l,u=Nn(l,["expectedCurrencyOwed0","expectedCurrencyOwed1"]);return n.push(...fj.encodeCollect(Object.assign({tokenId:zC(t.tokenId),expectedCurrencyOwed0:d.add(rk.fromRawAmount(d.currency,a)),expectedCurrencyOwed1:c.add(rk.fromRawAmount(c.currency,s))},u))),t.liquidityPercentage.equalTo(Ck)?t.burnToken&&n.push(fj.INTERFACE.encodeFunctionData("burn",[i])):nn(!0!==t.burnToken,"CANNOT_BURN"),{calldata:aj.encodeMulticall(n),value:zC(0)}}static safeTransferFromParameters(e){const t=dk(e.recipient),n=dk(e.sender);let r;return r=e.data?fj.INTERFACE.encodeFunctionData("safeTransferFrom(address,address,uint256,bytes)",[n,t,zC(e.tokenId),e.data]):fj.INTERFACE.encodeFunctionData("safeTransferFrom(address,address,uint256)",[n,t,zC(e.tokenId)]),{calldata:r,value:zC(0)}}static getPermitData(e,t,n){return{domain:{name:"Uniswap V3 Positions NFT-V1",chainId:n,version:"1",verifyingContract:t},types:mj,values:e}}}fj.INTERFACE=new EC(sj);var gj=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH9",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH9",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"uint256",name:"amountIn",type:"uint256"}],name:"quoteExactInput",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint160[]",name:"sqrtPriceX96AfterList",type:"uint160[]"},{internalType:"uint32[]",name:"initializedTicksCrossedList",type:"uint32[]"},{internalType:"uint256",name:"gasEstimate",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct IQuoterV2.QuoteExactInputSingleParams",name:"params",type:"tuple"}],name:"quoteExactInputSingle",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint160",name:"sqrtPriceX96After",type:"uint160"},{internalType:"uint32",name:"initializedTicksCrossed",type:"uint32"},{internalType:"uint256",name:"gasEstimate",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"uint256",name:"amountOut",type:"uint256"}],name:"quoteExactOutput",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint160[]",name:"sqrtPriceX96AfterList",type:"uint160[]"},{internalType:"uint32[]",name:"initializedTicksCrossedList",type:"uint32[]"},{internalType:"uint256",name:"gasEstimate",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct IQuoterV2.QuoteExactOutputSingleParams",name:"params",type:"tuple"}],name:"quoteExactOutputSingle",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint160",name:"sqrtPriceX96After",type:"uint160"},{internalType:"uint32",name:"initializedTicksCrossed",type:"uint32"},{internalType:"uint256",name:"gasEstimate",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"int256",name:"amount0Delta",type:"int256"},{internalType:"int256",name:"amount1Delta",type:"int256"},{internalType:"bytes",name:"path",type:"bytes"}],name:"uniswapV3SwapCallback",outputs:[],stateMutability:"view",type:"function"}];new EC([{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH9",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH9",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"uint256",name:"amountIn",type:"uint256"}],name:"quoteExactInput",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],name:"quoteExactInputSingle",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"uint256",name:"amountOut",type:"uint256"}],name:"quoteExactOutput",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],name:"quoteExactOutputSingle",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"int256",name:"amount0Delta",type:"int256"},{internalType:"int256",name:"amount1Delta",type:"int256"},{internalType:"bytes",name:"path",type:"bytes"}],name:"uniswapV3SwapCallback",outputs:[],stateMutability:"view",type:"function"}]),new EC(gj);new EC([{inputs:[{internalType:"contract IUniswapV3Factory",name:"_factory",type:"address"},{internalType:"contract INonfungiblePositionManager",name:"_nonfungiblePositionManager",type:"address"},{internalType:"uint256",name:"_maxIncentiveStartLeadTime",type:"uint256"},{internalType:"uint256",name:"_maxIncentiveDuration",type:"uint256"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"DepositTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{indexed:!0,internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{indexed:!1,internalType:"uint256",name:"startTime",type:"uint256"},{indexed:!1,internalType:"uint256",name:"endTime",type:"uint256"},{indexed:!1,internalType:"address",name:"refundee",type:"address"},{indexed:!1,internalType:"uint256",name:"reward",type:"uint256"}],name:"IncentiveCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"incentiveId",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"refund",type:"uint256"}],name:"IncentiveEnded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"reward",type:"uint256"}],name:"RewardClaimed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!0,internalType:"bytes32",name:"incentiveId",type:"bytes32"},{indexed:!1,internalType:"uint128",name:"liquidity",type:"uint128"}],name:"TokenStaked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!0,internalType:"bytes32",name:"incentiveId",type:"bytes32"}],name:"TokenUnstaked",type:"event"},{inputs:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amountRequested",type:"uint256"}],name:"claimReward",outputs:[{internalType:"uint256",name:"reward",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"},{internalType:"uint256",name:"reward",type:"uint256"}],name:"createIncentive",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"deposits",outputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint48",name:"numberOfStakes",type:"uint48"},{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"}],name:"endIncentive",outputs:[{internalType:"uint256",name:"refund",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"contract IUniswapV3Factory",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getRewardInfo",outputs:[{internalType:"uint256",name:"reward",type:"uint256"},{internalType:"uint160",name:"secondsInsideX128",type:"uint160"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"incentives",outputs:[{internalType:"uint256",name:"totalRewardUnclaimed",type:"uint256"},{internalType:"uint160",name:"totalSecondsClaimedX128",type:"uint160"},{internalType:"uint96",name:"numberOfStakes",type:"uint96"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxIncentiveDuration",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxIncentiveStartLeadTime",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"nonfungiblePositionManager",outputs:[{internalType:"contract INonfungiblePositionManager",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC20Minimal",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"rewards",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"stakeToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes32",name:"incentiveId",type:"bytes32"}],name:"stakes",outputs:[{internalType:"uint160",name:"secondsPerLiquidityInsideInitialX128",type:"uint160"},{internalType:"uint128",name:"liquidity",type:"uint128"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"to",type:"address"}],name:"transferDeposit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"unstakeToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"withdrawToken",outputs:[],stateMutability:"nonpayable",type:"function"}]);function yj({removed:e,inRange:t}){const n=g(),i={py:4,px:8,color:n.palette.success.main,borderRadius:4,backgroundColor:C(n.palette.success.main,.1),typography:"h6"};return e?Os.jsx(A,{title:r._({id:"MZPP7t",message:"Your position has 0 liquidity, and is not earning fees."}),maxWidth:240,children:Os.jsx(f,{sx:Object.assign(Object.assign({},i),{color:n.palette.warning.main,backgroundColor:C(n.palette.warning.main,.1)}),children:r._({id:"D87pha",message:"Closed"})})}):t?Os.jsx(A,{title:r._({id:"aIvv/z",message:"The price of this pool is within your selected range. Your position is currently earning fees."}),maxWidth:240,children:Os.jsx(f,{sx:i,children:r._({id:"vOyUlD",message:"In range"})})}):Os.jsx(A,{title:r._({id:"IwiTcw",message:"The price of this pool is outside of your selected range. Your position is not currently earning fees."}),maxWidth:240,children:Os.jsx(f,{sx:Object.assign(Object.assign({},i),{color:n.palette.error.main,backgroundColor:C(n.palette.error.main,.1)}),children:r._({id:"i3Z+/Z",message:"Out of range"})})})}new EC([{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH9",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH9",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMinimum",type:"uint256"}],internalType:"struct ISwapRouter.ExactInputParams",name:"params",type:"tuple"}],name:"exactInput",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMinimum",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct ISwapRouter.ExactInputSingleParams",name:"params",type:"tuple"}],name:"exactInputSingle",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMaximum",type:"uint256"}],internalType:"struct ISwapRouter.ExactOutputParams",name:"params",type:"tuple"}],name:"exactOutput",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMaximum",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct ISwapRouter.ExactOutputSingleParams",name:"params",type:"tuple"}],name:"exactOutputSingle",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"refundETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowed",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowedIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"sweepToken",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"sweepTokenWithFee",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"int256",name:"amount0Delta",type:"int256"},{internalType:"int256",name:"amount1Delta",type:"int256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"uniswapV3SwapCallback",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"unwrapWETH9",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"unwrapWETH9WithFee",outputs:[],stateMutability:"payable",type:"function"},{stateMutability:"payable",type:"receive"}]);const xj=({token:e,amount:t})=>{var n;const r=g();return Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4},children:[Os.jsx(ey,{address:null!==(n=null==e?void 0:e.address)&&void 0!==n?n:"",chainId:null==e?void 0:e.chainId,noShowChain:!0,width:18,height:18,marginRight:0}),Os.jsxs(f,{sx:{typography:"body1",color:r.palette.text.primary},children:[An({input:t.toSignificant(),decimals:null==e?void 0:e.decimals})," ",null==e?void 0:e.symbol]}),Os.jsx(y,{sx:{display:"flex",alignItems:"center",color:r.palette.text.secondary,"&:hover":{color:r.palette.text.primary}},onClick:()=>{window.open(ps(e.chainId,null==e?void 0:e.address,"address"))},children:Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:Os.jsx("path",{opacity:"0.5",fillRule:"evenodd",clipRule:"evenodd",d:"M3.33333 3.33333V12.6667H12.6667V8H14V12.6667C14 13.4 13.4 14 12.6667 14H3.33333C2.59333 14 2 13.4 2 12.6667V3.33333C2 2.6 2.59333 2 3.33333 2H8V3.33333H3.33333ZM9.33333 3.33333V2H14V6.66667H12.6667V4.27333L6.11333 10.8267L5.17333 9.88667L11.7267 3.33333H9.33333Z",fill:"currentColor"})})})]})},vj=({position:t,inRange:n})=>{var i;const o=g(),a=t.pool.token0,s=t.pool.token1,l=t.pool.chainId,d=(null==t?void 0:t.liquidity)&&tn.equal(null==t?void 0:t.liquidity,tn.BigInt(0)),c=lt((()=>rj.getAddress(t.pool.token0,t.pool.token1,t.pool.fee,void 0,l?Xw[l]:void 0)),[l,t.pool.fee,t.pool.token0,t.pool.token1]);return Os.jsxs(f,{sx:{border:"solid 1px",borderColor:"border.main",borderRadius:8},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:o.spacing(12,20),borderBottomStyle:"solid",borderBottomColor:"border.main",borderBottomWidth:1},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:4},children:[Os.jsxs(f,{sx:{typography:"body2",color:o.palette.text.primary},children:[r._({id:"PVa3KL",message:"Position on"})," ",null==a?void 0:a.symbol,"/",null==s?void 0:s.symbol]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4},children:[Os.jsx(yj,{removed:d,inRange:n}),Os.jsx(f,{sx:{py:4,px:8,color:o.palette.primary.main,borderRadius:4,backgroundColor:C(o.palette.primary.main,.1),typography:"h6"},children:Bn({input:(null===(i=null==t?void 0:t.pool)||void 0===i?void 0:i.fee)/1e6})})]})]}),Os.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:0,typography:"body2",color:o.palette.text.secondary,"&:hover":{color:o.palette.text.primary}},onClick:()=>{window.open(ps(l,c,"address"))},children:[r._({id:"URmyfc",message:"Details"}),Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:Os.jsx("path",{d:"M7.5 5L6.4425 6.0575L9.8775 9.5L6.4425 12.9425L7.5 14L12 9.5L7.5 5Z",fill:"currentColor"})})]})]}),Os.jsxs(f,{sx:{p:o.spacing(12,20)},children:[Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"YHc3B+",message:"My Liquidity"})}),Os.jsxs(f,{sx:{mt:12},children:[Os.jsx(xj,{token:a,amount:t.amount0}),Os.jsx(xj,{token:s,amount:t.amount1})]})]})]})};function bj({price:e,atLimit:t,direction:n}){return t[n]?n===Mw.LOWER?"0":"∞":"string"==typeof e&&"∞"===e?"∞":An({input:"string"==typeof e?e:null==e?void 0:e.toSignificant()})}const Aj=({baseToken:e,quoteToken:t,handleRateToggle:n,sx:r})=>{const i=g(),o=null==e?void 0:e.wrapped,a=null==t?void 0:t.wrapped,s=o&&a&&o.sortsBefore(a);return Os.jsx(f,{component:y,onClick:n,sx:Object.assign({display:"flex",alignItems:"center",p:1,borderRadius:8,backgroundColor:i.palette.border.main},r),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",width:"100%",[i.breakpoints.up("tablet")]:{width:"auto"}},children:[Os.jsx(f,{sx:Object.assign({flexGrow:1,flexShrink:1,flexBasis:"50%",px:12,py:4,borderRadius:7,textAlign:"center",typography:"h6",whiteSpace:"nowrap"},s?{color:i.palette.text.primary,backgroundColor:i.palette.background.paper}:{color:i.palette.text.secondary,backgroundColor:"transparent"}),children:s?e.symbol:null==t?void 0:t.symbol}),Os.jsx(f,{sx:Object.assign({flexGrow:1,flexShrink:1,flexBasis:"50%",px:12,py:4,borderRadius:7,textAlign:"center",typography:"h6",whiteSpace:"nowrap"},s?{color:i.palette.text.secondary,backgroundColor:"transparent"}:{color:i.palette.text.primary,backgroundColor:i.palette.background.paper}),children:s?t.symbol:null==e?void 0:e.symbol})]})})},wj=({position:t,title:n,baseCurrencyDefault:r,ticksAtLimit:i})=>{const o=t.pool.token0,a=t.pool.token1,s=g(),[l,d]=ct(r?r===o?o:r===a?a:o:o),c=l===o,u=c?a:o,p=c?t.pool.priceOf(t.pool.token0):t.pool.priceOf(t.pool.token1),h=c?t.token0PriceLower:t.token0PriceUpper.invert(),m=c?t.token0PriceUpper:t.token0PriceLower.invert(),y=ut((()=>{d(u)}),[u]);return Os.jsxs(Fw,{gap:"md",children:[Os.jsxs(Vw,{children:[n?Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:s.palette.text.secondary},children:n}):Os.jsx("div",{}),Os.jsx(Aj,{baseToken:c?o:a,quoteToken:c?a:o,handleRateToggle:y})]}),Os.jsxs(Vw,{children:[Os.jsxs(Pw,{sx:{width:"48%",py:12,gap:12},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:4},children:[Os.jsx(f,{sx:{color:s.palette.text.primary,typography:"body2"},children:Os.jsx(e,{id:"EQs1sJ",message:"Min price"})}),Os.jsx(f,{sx:{color:s.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"7Z4WfS",message:"{0} per {1}",values:{0:u.symbol,1:l.symbol}})})]}),Os.jsx(f,{sx:{color:s.palette.text.primary,typography:"caption"},children:bj({price:h,atLimit:i,direction:Mw.LOWER})}),Os.jsx(f,{sx:{color:s.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"WgTuci",message:"Your position will be 100% composed of {0} at this price",values:{0:null==l?void 0:l.symbol}})})]}),Os.jsxs(Pw,{sx:{width:"48%",py:12,gap:12},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:4},children:[Os.jsx(f,{sx:{color:s.palette.text.primary,typography:"body2"},children:Os.jsx(e,{id:"5etEUX",message:"Max price"})}),Os.jsx(f,{sx:{color:s.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"7Z4WfS",message:"{0} per {1}",values:{0:u.symbol,1:l.symbol}})})]}),Os.jsx(f,{sx:{color:s.palette.text.primary,typography:"caption"},children:bj({price:m,atLimit:i,direction:Mw.UPPER})}),Os.jsx(f,{sx:{color:s.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"WgTuci",message:"Your position will be 100% composed of {0} at this price",values:{0:null==u?void 0:u.symbol}})})]})]}),Os.jsxs(Pw,{sx:{py:12,flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[Os.jsxs(Fw,{gap:"4px",justify:"flex-start",children:[Os.jsx(f,{sx:{color:s.palette.text.primary,typography:"body2"},children:Os.jsx(e,{id:"DWd30U",message:"Current price"})}),Os.jsx(f,{sx:{color:s.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"7Z4WfS",message:"{0} per {1}",values:{0:u.symbol,1:l.symbol}})})]}),Os.jsx(f,{sx:{color:s.palette.text.primary,typography:"caption"},children:`${An({input:p.toSignificant()})} `})]})]})},kj=({chainId:e,disabled:t,removed:n,isLoading:i,error:o,onConfirm:a})=>Os.jsx(sb,{includeButton:!0,fullWidth:!0,chainId:e,children:Os.jsx(T,{fullWidth:!0,size:T.Size.big,onClick:a,disabled:t,isLoading:i,children:n?r._({id:"D87pha",message:"Closed"}):null!=o?o:r._({id:"t/YqKh",message:"Remove"})})});function Cj({tokens:e,width:t=24,height:n=24,gap:r=-4,cross:i,mr:o,chainId:a,showChainLogo:s,sx:l}){var d;const c=g(),{onlyChainId:u}=pf(),p=s&&!u,h=t/2;return!e||e.length<=0?Os.jsx(f,{sx:Object.assign({display:"inline-flex",alignItems:"center",mr:o,position:"relative",zIndex:0},l),children:Os.jsx(f,{component:"svg",xmlns:"http://www.w3.org/2000/svg",width:52,height:24,viewBox:"0 0 52 24",fill:"none",sx:{height:t,width:"auto",color:C(c.palette.text.primary,"light"===c.palette.mode?.11:.13),animation:"pulseKeyframe 2s ease-in-out 0.5s infinite","@keyframes pulseKeyframe":{"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}},children:Os.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M21.3746 4.50813C19.1755 1.76008 15.7933 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24C15.7933 24 19.1755 22.2399 21.3746 19.4919C19.8788 17.3743 19 14.7898 19 12C19 9.21023 19.8788 6.62571 21.3746 4.50813ZM22 5.36441C24.1498 2.13102 27.8261 0 32 0C38.3911 0 43.6152 4.99623 43.9797 11.296C41.0986 12.163 39 14.8364 39 18C39 19.1371 39.2711 20.2108 39.7523 21.1602C37.6611 22.9317 34.9553 24 32 24C27.8261 24 24.1498 21.869 22 18.6356C20.7363 16.735 20 14.4535 20 12C20 9.54653 20.7363 7.26502 22 5.36441ZM52 18C52 21.3137 49.3137 24 46 24C43.5588 24 41.458 22.542 40.5211 20.4493C40.5042 20.4116 40.4876 20.3736 40.4715 20.3355C40.1679 19.6176 40 18.8284 40 18C40 15.3894 41.6673 13.1682 43.9952 12.3431C44.6221 12.1209 45.2969 12 46 12C49.3137 12 52 14.6863 52 18Z",fill:"currentColor"})})}):Os.jsxs(f,{sx:Object.assign({display:"inline-flex",alignItems:"center",mr:o,position:"relative",zIndex:0},l),children:[e.map(((e,n)=>Os.jsx(f,{sx:{display:"inline-flex",width:t,height:t,ml:n>0?r:0,borderRadius:"50%",backgroundColor:c.palette.background.default},children:"object"==typeof e?Os.jsx(ey,{address:e.address,width:t,height:t,chainId:a,url:e.logoURI,cross:i,noShowChain:!0,noBorder:!0,marginRight:0}):Os.jsx(f,{component:"img",height:t,src:e})},n))),p&&_g.has(a)?Os.jsx(f,{component:null===(d=_g.get(a))||void 0===d?void 0:d.logo,sx:{position:"absolute",bottom:0,right:0,zIndex:e.length+1,transform:"translateX(50%)",width:h,height:h}}):""]})}const jj=({sx:e})=>{const t=g();return Os.jsx(f,{sx:Object.assign({py:4,px:8,color:t.palette.primary.main,borderRadius:4,backgroundColor:C(t.palette.primary.main,.1),typography:"h6"},e),children:r._({id:"m8r/Yx",message:"AMM V3"})})},Tj=({position:t,title:n,inRange:r,baseCurrencyDefault:i,ticksAtLimit:o})=>{var a,s,l;const d=t.pool.token0,c=t.pool.token1,u=(null==t?void 0:t.liquidity)&&tn.equal(null==t?void 0:t.liquidity,tn.BigInt(0));return Os.jsxs(Fw,{gap:"md",style:{marginTop:"0.5rem"},children:[Os.jsxs(Vw,{style:{gap:4},children:[Os.jsxs(Uw,{children:[Os.jsx(Cj,{tokens:[{address:d.address},{address:c.address}],mr:8}),Os.jsxs(f,{sx:{typography:"h5"},children:[null==d?void 0:d.symbol," / ",null==c?void 0:c.symbol]})]}),Os.jsx(jj,{sx:{ml:"auto"}}),Os.jsx(yj,{removed:u,inRange:r})]}),Os.jsxs(Pw,{children:[Os.jsxs(Fw,{gap:"md",children:[Os.jsxs(Vw,{children:[Os.jsxs(Uw,{children:[Os.jsx(ey,{address:null!==(a=null==d?void 0:d.address)&&void 0!==a?a:"",chainId:null==d?void 0:d.chainId,noShowChain:!0,width:32,height:32,marginRight:0}),Os.jsx(f,{sx:{ml:8},children:null==d?void 0:d.symbol})]}),Os.jsx(Uw,{children:Os.jsx(f,{sx:{mr:8},children:An({input:t.amount0.toSignificant(),decimals:null==d?void 0:d.decimals})})})]}),Os.jsxs(Vw,{children:[Os.jsxs(Uw,{children:[Os.jsx(ey,{address:null!==(s=null==c?void 0:c.address)&&void 0!==s?s:"",chainId:null==c?void 0:c.chainId,noShowChain:!0,width:32,height:32,marginRight:0}),Os.jsx(f,{ml:"8px",children:null==c?void 0:c.symbol})]}),Os.jsx(Uw,{children:Os.jsx(f,{mr:"8px",children:An({input:t.amount1.toSignificant(),decimals:null==c?void 0:c.decimals})})})]})]}),Os.jsxs(Vw,{children:[Os.jsx(f,{children:Os.jsx(e,{id:"EU3wU4",message:"Fee tier"})}),Os.jsx(f,{children:Bn({input:(null===(l=null==t?void 0:t.pool)||void 0===l?void 0:l.fee)/1e6})})]})]}),Os.jsx(wj,{position:t,title:n,baseCurrencyDefault:i,ticksAtLimit:o})]})},Ej=({on:e,onClose:t,position:n,outOfRange:i,ticksAtLimit:o,onConfirm:a,loading:s})=>{const{isMobile:l}=wy();return Os.jsx(yy,{open:e,onClose:t,modal:!0,title:r._({id:"E6MqGy",message:"Add liquidity"}),height:683,children:Os.jsxs(f,{sx:{flex:1,px:20,pb:24,display:"flex",flexDirection:"column",justifyContent:"space-between",width:l?void 0:420},children:[Os.jsx(f,{sx:{pt:0,px:0},children:n?Os.jsx(Tj,{position:n,inRange:!i,ticksAtLimit:o,title:r._({id:"3VUfrF",message:"Selected Range"})}):null}),Os.jsx(T,{size:T.Size.big,fullWidth:!0,isLoading:s,sx:{mt:20},onClick:a,children:r._({id:"m16xKo",message:"Add"})})]})})};class Sj{static getPoolAddress(e,t,n,r,i){this.addresses.length>this.MAX_ENTRIES&&(this.addresses=this.addresses.slice(0,this.MAX_ENTRIES/2));const{address:o}=t,{address:a}=n,s=`${e}:${o}:${a}:${r.toString()}`,l=this.addresses.find((e=>e.key===s));if(l)return l.address;const d={key:s,address:IC({factoryAddress:e,tokenA:t,tokenB:n,fee:r,chainId:i})};return this.addresses.unshift(d),d.address}static getPool(e,t,n,r,i,o){this.pools.length>this.MAX_ENTRIES&&(this.pools=this.pools.slice(0,this.MAX_ENTRIES/2));const a=this.pools.find((a=>a.token0===e&&a.token1===t&&a.fee===n&&tn.EQ(a.sqrtRatioX96,r)&&tn.EQ(a.liquidity,i)&&a.tickCurrent===o));if(a)return a;const s=new rj(e,t,n,r,i,o);return this.pools.unshift(s),s}}var Ij;function Rj(e,t,n){const r=lt((()=>[[e,t,n]]),[e,t,n]);return function(e,t){const n=lt((()=>e?t.map((([e,t,n])=>{if(e&&t&&n){const r=e.wrapped,i=t.wrapped;if(r.equals(i))return;return r.sortsBefore(i)?[r,i,n]:[i,r,n]}})):new Array(t.length)),[e,t]),r=lt((()=>{const t=e&&Xw[e];return t?n.map((n=>n&&Sj.getPoolAddress(t,...n,e))):new Array(n.length)}),[e,n]),{data:i}=St({queries:r.map((t=>ts.getV3PoolSlot0(e,t))),combine:e=>({data:e.map((e=>e.data))})}),{data:o}=St({queries:r.map((t=>ts.getV3PoolLiquidity(e,t))),combine:e=>({data:e.map((e=>e.data))})});return lt((()=>t.map(((e,t)=>{const r=n[t];if(!r)return[Ij.INVALID,null];const[a,s,l]=r;if(!i[t])return[Ij.NOT_EXISTS,null];const d=i[t];if(!o[t])return[Ij.NOT_EXISTS,null];const c=o[t];if(!d||!c)return[Ij.NOT_EXISTS,null];if(!d.sqrtPriceX96||d.sqrtPriceX96.eq(0))return[Ij.NOT_EXISTS,null];try{const e=Sj.getPool(a,s,l,d.sqrtPriceX96,c[0],d.tick);return[Ij.EXISTS,e]}catch(e){return console.error(e,{tags:{file:"usePools",function:"usePools"},extra:{token0:a.address,token1:s.address,chainId:a.chainId,fee:l}}),[Ij.NOT_EXISTS,null]}}))),[o,t,i,n])}(null==e?void 0:e.chainId,r)[0]}Sj.MAX_ENTRIES=128,Sj.pools=[],Sj.addresses=[],function(e){e[e.LOADING=0]="LOADING",e[e.NOT_EXISTS=1]="NOT_EXISTS",e[e.EXISTS=2]="EXISTS",e[e.INVALID=3]="INVALID"}(Ij||(Ij={}));let Lj=class e{constructor(e){const t=ue[e];this.chainId=e,this.decimals=t.decimals,this.name=t.name,this.symbol=t.symbol,this.isNative=!0,this.isToken=!1,this.address=Mj(this.chainId)}equals(e){return e.isNative&&e.chainId===this.chainId}get wrapped(){const e=ue[this.chainId];return new uk(this.chainId,e.wrappedTokenAddress,e.decimals,e.wrappedTokenSymbol,e.name)}static onChain(t){var n;return null!==(n=this._cachedNativeCurrency[t])&&void 0!==n?n:this._cachedNativeCurrency[t]=new e(t)}};function Mj(e){return ue[e].address}function Oj(e,t){const n=null==e?void 0:e.toLowerCase(),r=null==t?void 0:t.toLowerCase();return null!==n&&null!==r&&n===r}Lj._cachedNativeCurrency={};const Bj=(e,t)=>!t||Oj(t,Mj(e));function Pj(e){if(!e)return;const{name:t,chainId:n,address:r,decimals:i,symbol:o}=e;return function(e,t){return!Bj(e,t)}(n,r)?new uk(n,r,i,null!=o?o:void 0,null!=t?t:void 0):new Lj(n)}function Dj(e){var t,n;if(e)return{chainId:e.chainId,address:e.address,decimals:e.decimals,symbol:null!==(t=e.symbol)&&void 0!==t?t:"",name:null!==(n=e.name)&&void 0!==n?n:""}}function Nj(e,t,n){if(e&&t&&"number"==typeof n)return _C(e,t,n)}const Fj=new Yn("units/5.7.0"),Wj=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Vj(e,t){if("string"==typeof t){const e=Wj.indexOf(t);-1!==e&&(t=3*e)}return ie(e,null!=t?t:18)}function Uj(e,t){if("string"!=typeof e&&Fj.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=Wj.indexOf(t);-1!==e&&(t=3*e)}return re(e,null!=t?t:18)}var Hj,qj=Object.freeze({__proto__:null,commify:function(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&Fj.throwArgumentError("invalid value","value",e);let n=t[0],r="";for("-"===n.substring(0,1)&&(r="-",n=n.substring(1));"0"===n.substring(0,1);)n=n.substring(1);""===n&&(n="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const o=[];for(;n.length;){if(n.length<=3){o.unshift(n);break}{const e=n.length-3;o.unshift(n.substring(e)),n=n.substring(0,e)}}return r+o.join(",")+i},formatEther:function(e){return Vj(e,18)},formatUnits:Vj,parseEther:function(e){return Uj(e,18)},parseUnits:Uj});function Zj(e,t){if(e&&t&&!isNaN(parseFloat(e)))try{const n=Uj(function(e,t){const n=e.split(/[.,]/),r=e.includes(".")?".":",";return n.length>1&&n[1].length>t?n[0]+r+n[1].slice(0,t):e}(e,t.decimals),t.decimals).toString();if("0"!==n)return rk.fromRawAmount(t,tn.BigInt(n))}catch(t){console.error("tryParseCurrencyAmount","tryParseCurrencyAmount",`Failed to parse input amount: "${e}"`,t)}}function zj(e,t,n,r){if(!(e&&t&&n&&r))return;const i=function(e,t,n){var r;if(!e||!t||!n)return;if(!n.match(/^\d*\.?\d+$/))return;const[i,o]=n.split("."),a=null!==(r=null==o?void 0:o.length)&&void 0!==r?r:0,s=tn.BigInt((null!=i?i:"")+(null!=o?o:""));return new sk(e,t,tn.multiply(tn.BigInt(10**a),tn.BigInt(10**e.decimals)),tn.multiply(s,tn.BigInt(10**t.decimals)))}(e,t,r);if(!i)return;let o;const a=QC(i.numerator,i.denominator);return o=tn.greaterThanOrEqual(a,BC.MAX_SQRT_RATIO)?BC.MAX_TICK:tn.lessThanOrEqual(a,BC.MIN_SQRT_RATIO)?BC.MIN_TICK:$C(i),KC(o,Ak[n])}function Qj({state:e,existingPosition:t}){var n,i,o,a,s,l,d,c,u,p,h,m,f;const{account:g,chainId:y}=hf(),{feeAmount:x,independentField:v,typedValue:b,leftRangeTypedValue:A,rightRangeTypedValue:w,startPriceTypedValue:k}=e,C=null!==(n=e.baseToken)&&void 0!==n?n:void 0,j=null!==(i=e.baseToken)&&void 0!==i?i:void 0,T=null!==(o=e.quoteToken)&&void 0!==o?o:void 0,E=v===Lw.CURRENCY_A?Lw.CURRENCY_B:Lw.CURRENCY_A,S=lt((()=>({[Lw.CURRENCY_A]:C,[Lw.CURRENCY_B]:T})),[C,T]),[I,R,L]=lt((()=>[null==C?void 0:C.wrapped,null==T?void 0:T.wrapped,null==j?void 0:j.wrapped]),[C,T,j]),[M,O]=lt((()=>I&&R?I.sortsBefore(R)?[I,R]:[R,I]:[void 0,void 0]),[I,R]),B=It($a.getFetchTokenQuery(null===(a=S[Lw.CURRENCY_A])||void 0===a?void 0:a.chainId,null===(s=S[Lw.CURRENCY_A])||void 0===s?void 0:s.address,g)),P=It($a.getFetchTokenQuery(null===(l=S[Lw.CURRENCY_B])||void 0===l?void 0:l.chainId,null===(d=S[Lw.CURRENCY_B])||void 0===d?void 0:d.address,g)),D=lt((()=>{var e,t,n,r,i,o;return{[Lw.CURRENCY_A]:S[Lw.CURRENCY_A]?(null===(e=B.data)||void 0===e?void 0:e.balance)?rk.fromRawAmount(S[Lw.CURRENCY_A],tn.BigInt(null===(t=B.data)||void 0===t?void 0:t.balance.multipliedBy(Math.pow(10,null!==(n=S[Lw.CURRENCY_A].decimals)&&void 0!==n?n:18)).toString())):rk.fromRawAmount(S[Lw.CURRENCY_A],0):void 0,[Lw.CURRENCY_B]:S[Lw.CURRENCY_B]?(null===(r=P.data)||void 0===r?void 0:r.balance)?rk.fromRawAmount(S[Lw.CURRENCY_B],tn.BigInt(null===(i=P.data)||void 0===i?void 0:i.balance.multipliedBy(Math.pow(10,null!==(o=S[Lw.CURRENCY_B].decimals)&&void 0!==o?o:18)).toString())):rk.fromRawAmount(S[Lw.CURRENCY_B],0):void 0}}),[S,null===(c=B.data)||void 0===c?void 0:c.balance,null===(u=P.data)||void 0===u?void 0:u.balance]),[N,F]=Rj(S[Lw.CURRENCY_A],S[Lw.CURRENCY_B],x),W=N===Ij.NOT_EXISTS,V=Boolean(L&&M&&!L.equals(M)),U=lt((()=>{var e;if(!W)return F&&M?F.priceOf(M):void 0;{const t=Zj(k,V?M:O);if(t&&M&&O){const n=Zj("1",V?O:M),r=n&&t?new sk(n.currency,t.currency,n.quotient,t.quotient):void 0;return null!==(e=V?null==r?void 0:r.invert():r)&&void 0!==e?e:void 0}}}),[W,k,V,O,M,F]),H=lt((()=>{const e=U?QC(U.numerator,U.denominator):void 0;return U&&e&&!(tn.greaterThanOrEqual(e,BC.MIN_SQRT_RATIO)&&tn.lessThan(e,BC.MAX_SQRT_RATIO))}),[U]),q=lt((()=>{if(I&&R&&x&&U&&!H){const e=$C(U),t=BC.getSqrtRatioAtTick(e);return new rj(I,R,x,t,tn.BigInt(0),e,[])}}),[x,H,U,I,R]),Z=null!=F?F:q,z=lt((()=>({[Mw.LOWER]:x?KC(BC.MIN_TICK,Ak[x]):void 0,[Mw.UPPER]:x?KC(BC.MAX_TICK,Ak[x]):void 0})),[x]),Q=lt((()=>({[Mw.LOWER]:"number"==typeof(null==t?void 0:t.tickLower)?t.tickLower:V&&"boolean"==typeof w||!V&&"boolean"==typeof A?z[Mw.LOWER]:V?zj(O,M,x,w.toString()):zj(M,O,x,A.toString()),[Mw.UPPER]:"number"==typeof(null==t?void 0:t.tickUpper)?t.tickUpper:!V&&"boolean"==typeof w||V&&"boolean"==typeof A?z[Mw.UPPER]:V?zj(O,M,x,A.toString()):zj(M,O,x,w.toString())})),[t,x,V,A,w,z,M,O]),{[Mw.LOWER]:G,[Mw.UPPER]:Y}=Q||{},X=lt((()=>({[Mw.LOWER]:x&&G===z.LOWER,[Mw.UPPER]:x&&Y===z.UPPER})),[z,G,Y,x]),J=Boolean("number"==typeof G&&"number"==typeof Y&&G>=Y),K=lt((()=>({[Mw.LOWER]:Nj(M,O,z.LOWER),[Mw.UPPER]:Nj(M,O,z.UPPER)})),[M,O,z.LOWER,z.UPPER]),_=lt((()=>({[Mw.LOWER]:Nj(M,O,Q[Mw.LOWER]),[Mw.UPPER]:Nj(M,O,Q[Mw.UPPER])})),[M,O,Q]),{[Mw.LOWER]:$,[Mw.UPPER]:ee}=_,te=Boolean(!J&&U&&$&&ee&&(U.lessThan($)||U.greaterThan(ee))),ne=Zj(b,S[v]),re=lt((()=>{const e=null==ne?void 0:ne.wrapped,t=E===Lw.CURRENCY_B?T:C;if(ne&&e&&"number"==typeof G&&"number"==typeof Y&&Z){if(te||J)return;const n=e.currency.equals(Z.token0)?ij.fromAmount0({pool:Z,tickLower:G,tickUpper:Y,amount0:ne.quotient,useFullPrecision:!0}):ij.fromAmount1({pool:Z,tickLower:G,tickUpper:Y,amount1:ne.quotient}),r=e.currency.equals(Z.token0)?n.amount1:n.amount0;return t&&rk.fromRawAmount(t,r.quotient)}}),[ne,te,E,T,C,G,Y,Z,J]),ie=lt((()=>({[Lw.CURRENCY_A]:v===Lw.CURRENCY_A?ne:re,[Lw.CURRENCY_B]:v===Lw.CURRENCY_A?re:ne})),[re,ne,v]),oe=Boolean("number"==typeof Y&&Z&&Z.tickCurrent>=Y),ae=Boolean("number"==typeof G&&Z&&Z.tickCurrent<=G),se=J||Boolean(oe&&Z&&I&&Z.token0.equals(I)||ae&&Z&&I&&Z.token1.equals(I)),le=J||Boolean(oe&&Z&&R&&Z.token0.equals(R)||ae&&Z&&R&&Z.token1.equals(R)),{inputTax:de,outputTax:ce}=function(e,t,n){const[{inputTax:r,outputTax:i},o]=ct({inputTax:xk,outputTax:xk});return{inputTax:r,outputTax:i}}((null==C?void 0:C.isToken)&&C.address,(null==T?void 0:T.isToken)&&T.address),ue=lt((()=>{var e,t;if(!Z||!I||!R||"number"!=typeof G||"number"!=typeof Y||J)return;const n=oe?gk:null===(e=null==ie?void 0:ie[I.equals(Z.token0)?Lw.CURRENCY_A:Lw.CURRENCY_B])||void 0===e?void 0:e.quotient,r=ae?gk:null===(t=null==ie?void 0:ie[I.equals(Z.token0)?Lw.CURRENCY_B:Lw.CURRENCY_A])||void 0===t?void 0:t.quotient;return void 0!==n&&void 0!==r?ij.fromAmounts({pool:Z,tickLower:G,tickUpper:Y,amount0:n,amount1:r,useFullPrecision:!0}):void 0}),[ie,Z,I,R,oe,ae,J,G,Y]);let pe;g||(pe=r._({id:"r7ScnQ",message:"Connect to a wallet"})),N===Ij.INVALID&&(pe=null!=pe?pe:r._({id:"R7D79P",message:"Invalid pair"})),H&&(pe=null!=pe?pe:r._({id:"HXBqgG",message:"Invalid price input"})),(ie[Lw.CURRENCY_A]||se)&&(ie[Lw.CURRENCY_B]||le)||(pe=null!=pe?pe:r._({id:"iPMIoT",message:"Enter an amount"}));const{[Lw.CURRENCY_A]:he,[Lw.CURRENCY_B]:me}=ie;he&&(null===(p=null==D?void 0:D[Lw.CURRENCY_A])||void 0===p?void 0:p.lessThan(he))&&(pe=r._({id:"m6RmA/",message:"Insufficient {0} balance",values:{0:null===(h=S[Lw.CURRENCY_A])||void 0===h?void 0:h.symbol}})),me&&(null===(m=null==D?void 0:D[Lw.CURRENCY_B])||void 0===m?void 0:m.lessThan(me))&&(pe=r._({id:"m6RmA/",message:"Insufficient {0} balance",values:{0:null===(f=S[Lw.CURRENCY_B])||void 0===f?void 0:f.symbol}}));const fe=de.greaterThan(0)||ce.greaterThan(0),ge=N===Ij.INVALID||fe;return{dependentField:E,currencies:S,pool:F,poolState:N,currencyBalances:D,parsedAmounts:ie,ticks:Q,price:U,pricesAtTicks:_,pricesAtLimit:K,position:ue,noLiquidity:W,errorMessage:pe,invalidPool:ge,invalidRange:J,outOfRange:te,depositADisabled:se,depositBDisabled:le,invertPrice:V,ticksAtLimit:X,isTaxed:fe}}function Gj(e,t){switch(t.type){case Hj.UpdateBaseToken:{const n=t.payload;return Object.assign(Object.assign({},e),{baseToken:Pj(n)})}case Hj.UpdateDefaultBaseToken:{const n=t.payload;return e.baseToken?e:Object.assign(Object.assign({},e),{baseToken:Pj(n)})}case Hj.UpdateQuoteToken:{const n=t.payload;return Object.assign(Object.assign({},e),{quoteToken:Pj(n)})}case Hj.UpdateDefaultQuoteToken:{const n=t.payload;return e.quoteToken?e:Object.assign(Object.assign({},e),{quoteToken:Pj(n)})}case Hj.UpdateBaseTokenAndClearQuoteToken:{const n=t.payload;return Object.assign(Object.assign({},e),{baseToken:Pj(n),quoteToken:null})}case Hj.UpdateFeeAmount:return Object.assign(Object.assign({},e),{feeAmount:t.payload});case Hj.ToggleRate:{const{baseToken:t,quoteToken:n}=e;return Object.assign(Object.assign({},e),{baseToken:n,quoteToken:t})}case Hj.setFullRange:return Object.assign(Object.assign({},e),{leftRangeTypedValue:!0,rightRangeTypedValue:!0});case Hj.typeStartPriceInput:return Object.assign(Object.assign({},e),{startPriceTypedValue:t.payload.typedValue});case Hj.typeLeftRangeInput:return Object.assign(Object.assign({},e),{leftRangeTypedValue:t.payload.typedValue});case Hj.typeRightRangeInput:return Object.assign(Object.assign({},e),{rightRangeTypedValue:t.payload.typedValue});case Hj.typeInput:{const{payload:{field:n,typedValue:r,noLiquidity:i}}=t;return i?(e.independentField,Object.assign(Object.assign({},e),{independentField:n,typedValue:r})):Object.assign(Object.assign({},e),{independentField:n,typedValue:r})}default:throw Error("Unknown action: "+t.type)}}function Yj({noLiquidity:e,dispatch:t}){return{onFieldAInput:ut((n=>{t({type:Hj.typeInput,payload:{field:Lw.CURRENCY_A,typedValue:n,noLiquidity:!0===e}})}),[t,e]),onFieldBInput:ut((n=>{t({type:Hj.typeInput,payload:{field:Lw.CURRENCY_B,typedValue:n,noLiquidity:!0===e}})}),[t,e]),onLeftRangeInput:ut((e=>{t({type:Hj.typeLeftRangeInput,payload:{typedValue:e}})}),[t]),onRightRangeInput:ut((e=>{t({type:Hj.typeRightRangeInput,payload:{typedValue:e}})}),[t]),onStartPriceInput:ut((e=>{t({type:Hj.typeStartPriceInput,payload:{typedValue:e}})}),[t])}}function Xj(e){return e?Jw[e]:void 0}function Jj(e,t){const n=Xj(t),r=lt((()=>e?e.map((e=>[e])):[]),[e]),i=It(ts.getPositions(t,n,r)),o=i.isLoading,a=i.error,s=lt((()=>{var t;if(!o&&!a&&e)return null===(t=i.data)||void 0===t?void 0:t.map(((t,n)=>({tokenId:e[n],fee:t.fee,feeGrowthInside0LastX128:t.feeGrowthInside0LastX128.toString(),feeGrowthInside1LastX128:t.feeGrowthInside1LastX128.toString(),liquidity:t.liquidity.toString(),nonce:t.nonce.toString(),operator:t.operator,tickLower:t.tickLower,tickUpper:t.tickUpper,token0:t.token0,token1:t.token1,tokensOwed0:t.tokensOwed0.toString(),tokensOwed1:t.tokensOwed1.toString()})))}),[o,a,i,e]);return{loading:o,positions:null==s?void 0:s.map(((e,t)=>Object.assign(Object.assign({},e),{tokenId:r[t][0]})))}}!function(e){e[e.UpdateBaseToken=0]="UpdateBaseToken",e[e.UpdateDefaultBaseToken=1]="UpdateDefaultBaseToken",e[e.UpdateQuoteToken=2]="UpdateQuoteToken",e[e.UpdateDefaultQuoteToken=3]="UpdateDefaultQuoteToken",e[e.UpdateBaseTokenAndClearQuoteToken=4]="UpdateBaseTokenAndClearQuoteToken",e[e.UpdateFeeAmount=5]="UpdateFeeAmount",e[e.ToggleRate=6]="ToggleRate",e[e.setFullRange=7]="setFullRange",e[e.typeStartPriceInput=8]="typeStartPriceInput",e[e.typeLeftRangeInput=9]="typeLeftRangeInput",e[e.typeRightRangeInput=10]="typeRightRangeInput",e[e.typeInput=11]="typeInput"}(Hj||(Hj={}));const Kj=tn.exponentiate(tn.BigInt(10),tn.BigInt(16));function _j(e){if(e)return e.currency.isNative?tn.greaterThan(e.quotient,Kj)?rk.fromRawAmount(e.currency,tn.subtract(e.quotient,Kj)):rk.fromRawAmount(e.currency,tn.BigInt(0)):e}const $j=1e4,eT=100*$j;function tT(e){const t=Math.floor(Number(e)*$j);return new ak(t,eT)}const nT=({token:e,amount:t})=>{var n;const r=g();return Os.jsxs(f,{sx:{py:8,display:"flex",alignItems:"center",gap:6,typography:"h5",color:r.palette.text.primary},children:[Os.jsx(ey,{address:null!==(n=null==e?void 0:e.address)&&void 0!==n?n:"",chainId:null==e?void 0:e.chainId,noShowChain:!0,width:24,height:24,marginRight:0}),Os.jsx(f,{children:null==e?void 0:e.symbol}),Os.jsx(f,{sx:{ml:"auto"},children:An({input:null==t?void 0:t.toSignificant(),decimals:null==e?void 0:e.decimals})})]})},rT=({chainId:e,baseToken:t,quoteToken:n,feeAmount:o,tokenId:a,onClose:s})=>{var l,d;const{isMobile:c}=wy(),u=g(),p=Hy(),h=Rt(),{account:m}=hf(),{position:y,loading:x}=function(e,t){var n;const r=Jj(e?[e]:void 0,t);return{loading:r.loading,position:null===(n=r.positions)||void 0===n?void 0:n[0]}}(a,e),v=!!y&&!x,{position:b}=function(e,t,n){const r=lt((()=>t?Pj(t):void 0),[t]),i=lt((()=>n?Pj(n):void 0),[n]),[,o]=Rj(null!=r?r:void 0,null!=i?i:void 0,null==e?void 0:e.fee);let a;return o&&e&&(a=new ij({pool:o,liquidity:e.liquidity.toString(),tickLower:e.tickLower,tickUpper:e.tickUpper})),{position:a,pool:null!=o?o:void 0}}(y,t,n),[A,w]=ct("stake"),[k,C]=ct(!1),[j,T]=ct(Iw),[E,S]=ft(Gj,{baseToken:Pj(t),quoteToken:Pj(n),feeAmount:o,independentField:Lw.CURRENCY_A,typedValue:"",startPriceTypedValue:"",leftRangeTypedValue:"",rightRangeTypedValue:""}),{independentField:I,typedValue:R,startPriceTypedValue:L}=E,{pool:M,ticks:O,dependentField:B,price:P,pricesAtTicks:D,pricesAtLimit:N,parsedAmounts:F,currencyBalances:W,position:V,noLiquidity:U,currencies:q,errorMessage:Z,invalidPool:Q,invalidRange:Y,outOfRange:X,depositADisabled:J,depositBDisabled:K,invertPrice:_,ticksAtLimit:$,isTaxed:ee}=Qj({state:E,existingPosition:b}),{position:te,liquidityPercentage:re,liquidityValue0:ie,liquidityValue1:oe,feeValue0:ae,feeValue1:se,error:le}=function({percent:e,position:t,asWETH:n,baseToken:i,quoteToken:o}){const{account:a,chainId:s}=hf(),[l,d]=lt((()=>[null==i?void 0:i.wrapped,null==o?void 0:o.wrapped]),[i,o]),[c,u]=lt((()=>l&&d?l.sortsBefore(d)?[l,d]:[d,l]:[void 0,void 0]),[l,d]),[,p]=Rj(null!=c?c:void 0,null!=u?u:void 0,null==t?void 0:t.fee),h=lt((()=>p&&(null==t?void 0:t.liquidity)&&"number"==typeof(null==t?void 0:t.tickLower)&&"number"==typeof(null==t?void 0:t.tickUpper)?new ij({pool:p,liquidity:t.liquidity.toString(),tickLower:t.tickLower,tickUpper:t.tickUpper}):void 0),[p,t]),m=new ak(e,100),f=h?m.multiply(h.amount0.quotient).quotient:void 0,g=h?m.multiply(h.amount1.quotient).quotient:void 0,y=c&&f?rk.fromRawAmount(c,f):void 0,x=u&&g?rk.fromRawAmount(u,g):void 0,v=!(!p||!t)&&(p.tickCurrent<t.tickLower||p.tickCurrent>t.tickUpper);let b;return a||(b=r._({id:"r7ScnQ",message:"Connect to a wallet"})),0===e&&(b=null!=b?b:r._({id:"Sta9CR",message:"Enter a percent"})),{position:h,liquidityPercentage:m,liquidityValue0:y,liquidityValue1:x,feeValue0:void 0,feeValue1:void 0,outOfRange:v,error:b}}({position:y,asWETH:void 0,percent:j,baseToken:E.baseToken,quoteToken:E.quoteToken}),de="0"===(null==y?void 0:y.liquidity),[ce,ue]=function({chainId:e,pool:t,tokenId:n,asWETH:r}){var i;const o=Xj(e),a=null===(i=ne.from(n))||void 0===i?void 0:i.toHexString(),s=It(ts.getOwner(e,o,n)),l=It(ts.getCollect(e,o,a,s.data&&Array.isArray(s.data)?s.data[0]:void 0));return t&&l&&l.data&&l.data.amount0&&l.data.amount1?[rk.fromRawAmount(t.token0,l.data.amount0.toString()),rk.fromRawAmount(t.token1,l.data.amount1.toString())]:[void 0,void 0]}({pool:null!=M?M:void 0,tokenId:a,asWETH:!1,chainId:e}),he=ue,me=ce;lt((()=>{var e;return null===(e=_?null==P?void 0:P.invert():P)||void 0===e?void 0:e.toSignificant()}),[_,P]);const{onFieldAInput:fe,onFieldBInput:ge,onLeftRangeInput:ye,onRightRangeInput:xe,onStartPriceInput:ve}=Yj({noLiquidity:U,dispatch:S}),{slipper:be,setSlipper:Ae,slipperValue:we,resetSlipper:ke}=Ew({address:void 0,type:"AMMV3"}),Ce=!Z&&!Y,je=lt((()=>{var e,t;return{[I]:R,[B]:null!==(t=null===(e=F[B])||void 0===e?void 0:e.toSignificant(6))&&void 0!==t?t:""}}),[B,I,F,R]),Te=lt((()=>[Lw.CURRENCY_A,Lw.CURRENCY_B].reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:_j(W[t])})),{})),[W]),Ee=EA(Dj(null===(l=F[Lw.CURRENCY_A])||void 0===l?void 0:l.currency),{contractAddress:Jw[e],overrideBalance:W[Lw.CURRENCY_A]?new i(W[Lw.CURRENCY_A].toSignificant()):void 0,amount:F[Lw.CURRENCY_A]?new i(F[Lw.CURRENCY_A].toSignificant()):void 0}),Se=EA(Dj(null===(d=F[Lw.CURRENCY_B])||void 0===d?void 0:d.currency),{contractAddress:Jw[e],overrideBalance:W[Lw.CURRENCY_B]?new i(W[Lw.CURRENCY_B].toSignificant()):void 0,amount:F[Lw.CURRENCY_B]?new i(F[Lw.CURRENCY_B].toSignificant()):void 0}),{[Mw.LOWER]:Ie,[Mw.UPPER]:Re}=O,{[Mw.LOWER]:Le,[Mw.UPPER]:Me}=D,{deadLine:Oe}=pf(),Be=Ot({mutationFn:()=>Fn(void 0,void 0,void 0,(function*(){if(!m||!e||!V)return;if(!E.baseToken||!E.quoteToken)return;const t=Math.ceil(Date.now()/1e3)+(null!=Oe?Oe:600),n=E.baseToken.isNative?E.baseToken:E.quoteToken.isNative?E.quoteToken:void 0;try{const{calldata:i,value:o}=fj.addCallParameters(V,{tokenId:a,slippageTolerance:tT(100*we),deadline:t.toString(),useNative:n});let l={to:Jw[e],data:i,value:o};(yield p.execute(r._({id:"OBdohg",message:"Add Liquidity"}),Object.assign({opcode:By.TX},l),{early:!1,metadata:{[Ey.addAMMV3Pool]:"1"}}))===Sy.Success&&(C(!1),setTimeout((()=>{null==s||s()}),100)),h.invalidateQueries({queryKey:[pe,"ammv3"],refetchType:"all"})}catch(e){console.error("onAddMutation",e)}}))}),Pe=Ot({mutationFn:()=>Fn(void 0,void 0,void 0,(function*(){if(!(m&&e&&te&&re&&ie&&oe))return;const t=Math.ceil(Date.now()/1e3)+(null!=Oe?Oe:600);try{const{calldata:n,value:i}=fj.removeCallParameters(te,{tokenId:a.toString(),liquidityPercentage:re,slippageTolerance:tT(100*we),deadline:t.toString(),collectOptions:{expectedCurrencyOwed0:null!=ae?ae:rk.fromRawAmount(ie.currency,0),expectedCurrencyOwed1:null!=se?se:rk.fromRawAmount(oe.currency,0),recipient:m}});let o={to:Jw[e],data:n,value:i};(yield p.execute(r._({id:"3XBvkd",message:"Remove Liquidity"}),Object.assign({opcode:By.TX},o),{early:!1,metadata:{[Ey.removeAMMV3Pool]:"1"}}))===Sy.Success&&setTimeout((()=>{null==s||s()}),100),h.invalidateQueries({queryKey:[pe,"ammv3"],refetchType:"all"})}catch(e){console.error("onRemoveMutation",e)}}))}),De=Ot({mutationFn:()=>Fn(void 0,void 0,void 0,(function*(){if(m&&e&&M)try{const{calldata:t,value:n}=fj.collectCallParameters({tokenId:a.toString(),expectedCurrencyOwed0:null!=ce?ce:rk.fromRawAmount(M.token0,0),expectedCurrencyOwed1:null!=ue?ue:rk.fromRawAmount(M.token1,0),recipient:m});let i={to:Jw[e],data:t,value:n};(yield p.execute(r._({id:"zXCpR0",message:"Claim Rewards"}),Object.assign({opcode:By.TX},i),{early:!1,metadata:{[Ey.claimAMMV3Pool]:"1"}}))===Sy.Success&&setTimeout((()=>{null==s||s()}),100),h.invalidateQueries({queryKey:[pe,"ammv3"],refetchType:"all"})}catch(e){console.error("onClaimMutation",e)}}))}),Ne=lt((()=>{var t,n,i,o;const a=[{key:"stake",value:r._({id:"m16xKo",message:"Add"})},{key:"unstake",value:r._({id:"t/YqKh",message:"Remove"})},{key:"claim",value:r._({id:"hom7qf",message:"Claim"})}];return Os.jsxs(f,{sx:{borderRadius:16,backgroundColor:u.palette.background.paper},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:20,py:24,borderTopLeftRadius:16,borderTopRightRadius:16,backgroundColor:u.palette.background.paper},children:[Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:u.palette.text.primary},children:r._({id:"E6MqGy",message:"Add liquidity"})}),s?Os.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,borderRadius:"50%",borderWidth:1,color:"text.secondary",cursor:"pointer"},children:Os.jsx(f,{component:As.Error,sx:{width:16,height:16},onClick:()=>{s()}})}):void 0]}),v&&b&&Os.jsx(f,{sx:{mx:20,mb:16},children:Os.jsx(vj,{position:b,inRange:!X})}),Os.jsxs(H,{value:A,onChange:(e,t)=>{w(t)},children:[Os.jsx(G,{tabs:a,variant:"inPaper",tabsListSx:{mx:20}}),Os.jsxs(z,{value:"stake",children:[v&&b&&Os.jsx(f,{sx:{mt:16,mx:20},children:Os.jsx(wj,{position:b,title:r._({id:"3VUfrF",message:"Selected Range"}),ticksAtLimit:$})}),Os.jsxs(f,{sx:{mt:16,mx:20,display:"flex",flexDirection:"column",alignItems:"stretch",gap:12},children:[Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:u.palette.text.secondary,textAlign:"left"},children:r._({id:"BRi+RY",message:"Add more liquidity"})}),Os.jsxs(f,{children:[Os.jsx(Yw,{value:je[Lw.CURRENCY_A],onUserInput:fe,maxAmount:Te[Lw.CURRENCY_A],balance:W[Lw.CURRENCY_A],currency:null!==(t=q[Lw.CURRENCY_A])&&void 0!==t?t:null,locked:J}),Os.jsx(zy,{}),Os.jsx(Yw,{value:je[Lw.CURRENCY_B],onUserInput:ge,maxAmount:Te[Lw.CURRENCY_B],balance:W[Lw.CURRENCY_B],currency:null!==(n=q[Lw.CURRENCY_B])&&void 0!==n?n:null,locked:K})]}),Os.jsx(Sw,{value:be,onChange:Ae,disabled:!1,type:"AMMV3"})]}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",px:20,py:16,borderBottomLeftRadius:16,borderBottomRightRadius:16,backgroundColor:u.palette.background.paper},children:Os.jsx(qw,{chainId:e,approvalA:Ee,approvalB:Se,parsedAmounts:F,isValid:Ce,depositADisabled:J,depositBDisabled:K,errorMessage:Z,setShowConfirm:C})}),Os.jsx(Ej,{parsedAmounts:F,position:V,existingPosition:void 0,priceLower:Le,priceUpper:Me,outOfRange:X,ticksAtLimit:$,on:k,onClose:()=>{C(!1)},onConfirm:Be.mutate,loading:Be.isPending})]}),Os.jsxs(z,{value:"unstake",children:[Os.jsxs(f,{sx:{mt:16,mx:20,display:"flex",flexDirection:"column",alignItems:"stretch",gap:12},children:[Os.jsx(bw,{disabled:!1,value:j,onChange:e=>T(e)}),Os.jsx(Sw,{value:be,onChange:Ae,disabled:!1,type:"AMMV3"})]}),Os.jsxs(f,{sx:{mt:16,mx:20,display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[Os.jsx(f,{sx:{typography:"body2",color:u.palette.text.secondary},children:"Receive"}),Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4},children:[Os.jsxs(f,{sx:{typography:"body1",fontWeight:600,color:u.palette.text.primary},children:[Os.jsx(f,{component:"span",sx:{color:u.palette.primary.main},children:ie?An({input:ie.toExact(),decimals:ie.currency.decimals}):"-"})," ",null===(i=null==ie?void 0:ie.currency)||void 0===i?void 0:i.symbol]}),Os.jsxs(f,{sx:{typography:"body1",fontWeight:600,color:u.palette.text.primary},children:[Os.jsx(f,{component:"span",sx:{color:u.palette.primary.main},children:oe?An({input:oe.toExact(),decimals:oe.currency.decimals}):"-"})," ",null===(o=null==oe?void 0:oe.currency)||void 0===o?void 0:o.symbol]})]})]}),Os.jsx(f,{sx:{mt:20,display:"flex",alignItems:"center",px:20,py:16,borderBottomLeftRadius:16,borderBottomRightRadius:16,backgroundColor:u.palette.background.paper},children:Os.jsx(kj,{chainId:e,disabled:de||0===j||!ie,removed:de,error:le,onConfirm:Pe.mutate,isLoading:Pe.isPending})})]}),Os.jsxs(z,{value:"claim",children:[Os.jsxs(f,{sx:{mx:20,mt:16,borderRadius:12,borderWidth:1,borderStyle:"solid",borderColor:u.palette.border.main},children:[Os.jsx(f,{sx:{py:12,px:20,typography:"body1",color:u.palette.text.primary,borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:u.palette.border.main},children:r._({id:"tu/fxg",message:"Claim fees"})}),Os.jsxs(f,{sx:{p:20},children:[Os.jsx(nT,{token:null==he?void 0:he.currency,amount:he}),Os.jsx(nT,{token:null==me?void 0:me.currency,amount:me})]})]}),Os.jsx(f,{sx:{mx:20,mt:16,typography:"h6",color:u.palette.text.secondary},children:r._({id:"Joa5Dk",message:"*Collecting fees will withdraw currently available fees for you."})}),Os.jsx(f,{sx:{mt:20,display:"flex",alignItems:"center",px:20,py:16,borderBottomLeftRadius:16,borderBottomRightRadius:16,backgroundColor:u.palette.background.paper},children:Os.jsx(Zw,{chainId:e,disabled:De.isPending,onConfirm:De.mutate,isLoading:De.isPending})})]})]})]})}),[Ee,Se,e,q,W,J,K,le,Z,b,me,he,je,v,Ce,ie,oe,Te,Be.isPending,Be.mutate,De.isPending,De.mutate,s,fe,ge,Pe.isPending,Pe.mutate,A,X,F,V,Le,Me,de,Ae,k,j,be,u.palette.background.paper,u.palette.border.main,u.palette.primary.main,u.palette.text.primary,u.palette.text.secondary,$]);return c?Os.jsx(yy,{open:null!=t&&null!=n,onClose:s,scope:!c,modal:c,id:"pool-operate",children:Ne}):Ne};const iT=({outOfRange:e})=>{const t=g();return Os.jsx(A,{title:e?r._({id:"i3Z+/Z",message:"Out of range"}):r._({id:"vOyUlD",message:"In range"}),children:Os.jsx(f,{sx:{display:"flex",alignItems:"center"},children:e?Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.583252 12.5416L6.99992 1.45825L13.4166 12.5416H0.583252ZM11.3924 11.3749L6.9999 3.78575L2.6074 11.3749H11.3924ZM7.58328 9.62492H6.41661V10.7916H7.58328V9.62492ZM6.41661 6.12492H7.58328V8.45825H6.41661V6.12492Z",fill:t.palette.warning.main})}):Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",children:Os.jsx("circle",{cx:"4",cy:"4",r:"4",fill:t.palette.success.main})})})})},oT=({p:e,currency0:t,currency1:n,onClickManage:i})=>{const o=g(),[,a]=Rj(null!=t?t:void 0,null!=n?n:void 0,e.fee),s=lt((()=>{if(a)return new ij({pool:a,liquidity:e.liquidity.toString(),tickLower:e.tickLower,tickUpper:e.tickUpper})}),[e.liquidity,e.tickLower,e.tickUpper,a]),l=(d=e.fee,c=e.tickLower,u=e.tickUpper,lt((()=>({[Mw.LOWER]:d&&c?c===KC(BC.MIN_TICK,Ak[d]):void 0,[Mw.UPPER]:d&&u?u===KC(BC.MAX_TICK,Ak[d]):void 0})),[d,c,u]));var d,c,u;const p=null==s?void 0:s.token0PriceLower,h=null==s?void 0:s.token0PriceUpper,m=null==s?void 0:s.amount1.currency,y=null==s?void 0:s.amount0.currency,x=!!a&&(a.tickCurrent<e.tickLower||a.tickCurrent>=e.tickUpper),v=t==t?null==s?void 0:s.pool.priceOf(null==s?void 0:s.pool.token0):null==s?void 0:s.pool.priceOf(null==s?void 0:s.pool.token1);return Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:24,px:20,py:20,pb:12,borderRadius:12,backgroundColor:o.palette.background.paperContrast},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:4},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,typography:"h5",color:o.palette.text.primary},children:[Os.jsx(f,{children:Os.jsxs(Os.Fragment,{children:[Os.jsxs("span",{children:[bj({price:p,atLimit:l,direction:Mw.LOWER})," "]}),null==m?void 0:m.symbol]})}),Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:Os.jsx("path",{d:"M15.75 9.50293L12.75 12.5029L11.7 11.4529L12.8813 10.2529L5.11875 10.2529L6.3 11.4529L5.25 12.5029L2.25 9.50293L5.25 6.50293L6.31875 7.55293L5.11875 8.75293L12.8813 8.75293L11.7 7.55293L12.75 6.50293L15.75 9.50293Z",fill:"currentColor",fillOpacity:"0.5"})}),Os.jsx(f,{children:Os.jsxs(Os.Fragment,{children:[Os.jsxs("span",{children:[bj({price:h,atLimit:l,direction:Mw.UPPER})," "]}),null==m?void 0:m.symbol]})})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4},children:[Os.jsx(iT,{outOfRange:x}),Os.jsxs(f,{sx:{typography:"h6",color:o.palette.text.secondary},children:[r._({id:"DWd30U",message:"Current price"}),": ",`${An({input:null==v?void 0:v.toSignificant()})}`," ",null==m?void 0:m.symbol," per ",null==y?void 0:y.symbol]})]})]}),Os.jsx(T,{variant:T.Variant.outlined,size:T.Size.small,fullWidth:!0,onClick:i,children:r._({id:"wckWOP",message:"Manage"})})]})};function aT(e){const{EmptyDataIcon:t}=pf();return t?Os.jsx(t,{...e}):Os.jsx(Y,{...e})}function sT({sx:t,hasSearch:n,emptyText:r}){return Os.jsxs(f,{sx:Object.assign({display:"flex",flexDirection:"column",gap:12,justifyContent:"center",alignItems:"center",typography:"body2",fontWeight:500,color:"text.secondary",textAlign:"center"},t),children:[Os.jsx(aT,{hasSearch:n,sx:{width:60,height:60,borderRadius:12}}),Os.jsx(f,{children:null!=r?r:Os.jsx(e,{id:"AxPAXW",message:"No results found"})})]})}const lT=({chainId:e,baseToken:t,quoteToken:n,feeAmount:i,onClose:o,handleGoToAddLiquidityV3:a})=>{const{isMobile:s}=wy(),l=g(),{account:d}=hf(),{positions:c,loading:u}=function(e,t){const n=Xj(t),{isLoading:r,data:i}=It(ts.getBalanceOf(t,n,null!=e?e:void 0)),o=lt((()=>{if(e&&i&&i.isFinite()){const t=[];for(let n=0;n<i.toNumber();n++)t.push([e,n]);return t}return[]}),[e,i]),a=It(ts.getTokenOfOwnerByIndex(t,n,o)),s=a.isLoading,l=lt((()=>e&&a.data?a.data.map((e=>{if(Array.isArray(e)&&e.length>0)return e[0].toString()})):[]),[e,a]),{positions:d,loading:c}=Jj(l,t);return{loading:s||r||c,positions:d}}(d,e),p=lt((()=>t?Pj(t):void 0),[t]),h=lt((()=>n?Pj(n):void 0),[n]),[m,y]=lt((()=>[null==p?void 0:p.wrapped,null==h?void 0:h.wrapped]),[p,h]),[x,v]=lt((()=>m&&y?m.sortsBefore(y)?[m,y]:[y,m]:[void 0,void 0]),[m,y]),b=lt((()=>{if(void 0!==c)return c.filter((e=>Oj(null==x?void 0:x.address,e.token0)&&Oj(null==v?void 0:v.address,e.token1)&&e.fee===i))}),[i,c,null==x?void 0:x.address,null==v?void 0:v.address]),[A,w]=ct(null),k=lt((()=>{var e;return Os.jsxs(f,{sx:{p:20,display:"flex",flexDirection:"column",gap:16,borderRadius:16,backgroundColor:l.palette.background.paper,minHeight:480},children:[Os.jsxs(f,{sx:{pb:16,borderBottomColor:l.palette.border.main,borderBottomStyle:"solid",borderBottomWidth:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Os.jsxs(f,{sx:{typography:"body1",fontWeight:600,color:l.palette.text.primary},children:[r._({id:"Gs02OK",message:"My Positions"})," (",null!==(e=null==b?void 0:b.length)&&void 0!==e?e:0,")"]}),o?Os.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,borderRadius:"50%",borderWidth:1,color:"text.secondary",cursor:"pointer"},children:Os.jsx(f,{component:As.Error,sx:{width:16,height:16},onClick:()=>{o()}})}):void 0]}),b&&b.length>0?Os.jsxs(Os.Fragment,{children:[null==b?void 0:b.map((e=>Os.jsx(oT,{p:e,currency0:p,currency1:h,onClickManage:()=>{w(e)}},e.tokenId))),Os.jsxs(T,{size:T.Size.big,variant:T.Variant.second,onClick:()=>{a({from:t.address,to:n.address,fee:String(i)})},sx:{gap:8},children:[Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:Os.jsx("path",{d:"M19 13H13V19H11V13H5V11H11V5H13V11H19V13Z",fill:"currentColor"})}),r._({id:"FQ4aT9",message:"Add Position"})]})]}):Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{mt:100,display:"flex",flexDirection:"column",alignItems:"center",gap:12},children:[Os.jsx(aT,{sx:{width:60,height:60,borderRadius:24/105*60}}),Os.jsx(f,{sx:{typography:"body1",color:l.palette.text.secondary},children:r._({id:"/6L4mj",message:"Your position is empty"})})]}),Os.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:void 0!==b&&0===b.length?Os.jsx(T,{size:T.Size.small,onClick:()=>{a({from:t.address,to:n.address,fee:String(i)})},children:r._({id:"FQ4aT9",message:"Add Position"})}):Os.jsx(sb,{size:T.Size.small})})]})]})}),[l.palette.background.paper,l.palette.border.main,l.palette.text.primary,l.palette.text.secondary,b,o,p,h,a,t.address,n.address,i]);return null!==A?Os.jsx(rT,{baseToken:t,quoteToken:n,feeAmount:i,tokenId:A.tokenId,chainId:e,onClose:()=>{w(null)}}):s?Os.jsx(yy,{open:null!=t&&null!=n,onClose:o,scope:!s,modal:s,id:"pool-operate",children:k}):k};var dT,cT,uT;function pT(){return pT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pT.apply(null,arguments)}!function(e){e[e.Liquidity=1]="Liquidity",e[e.Mining=2]="Mining"}(dT||(dT={}));const hT=e=>ot.createElement("svg",pT({width:60,height:60,viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ot.createElement("g",{opacity:.5},ot.createElement("mask",{id:"mask0_3521_179418",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:60,height:60},cT||(cT=ot.createElement("rect",{width:60,height:60,rx:16,fill:"white"}))),uT||(uT=ot.createElement("g",{mask:"url(#mask0_3521_179418)"},ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 30.0352H60V16.0352C60 7.1986 52.8366 0.0351562 44 0.0351562H16C7.16344 0.0351562 0 7.1986 0 16.0352V30.0352Z",fill:"#727272",fillOpacity:.4}),ot.createElement("path",{d:"M29.4643 4H16C9.37258 4 4 9.37258 4 16V27H27.1154L31.7914 18.7271L23.1831 13.6634L29.4643 4Z",fill:"#727272",fillOpacity:.4}),ot.createElement("path",{d:"M31.7101 27H56V16C56 9.37258 50.6274 4 44 4H34.0384L34.1766 4.08987L28.8164 12.3364L37.2081 17.2727L31.7101 27Z",fill:"#727272",fillOpacity:.4}),ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 44C0 52.8366 7.16344 60 16 60H44C52.8366 60 60 52.8366 60 44V30H0V44Z",fill:"#ABABAB",fillOpacity:.4}),ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M59.4395 44.8861C59.4395 53.0965 52.7625 59.7526 44.5257 59.7526C36.2891 59.7526 29.6118 53.0965 29.6118 44.8861C29.6118 36.6756 36.2891 30.0195 44.5257 30.0195C52.7625 30.0195 59.4395 36.6756 59.4395 44.8861Z",fill:"#727272",fillOpacity:.4}),ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.8277 44.8665C29.8277 53.077 23.1507 59.7331 14.9139 59.7331C6.67727 59.7331 0 53.077 0 44.8665C0 36.6561 6.67727 30 14.9139 30C23.1507 30 29.8277 36.6561 29.8277 44.8665Z",fill:"#727272",fillOpacity:.4}),ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M51.9177 44.8883C51.9177 48.958 48.6082 52.257 44.5255 52.257C40.4431 52.257 37.1333 48.958 37.1333 44.8883C37.1333 40.8186 40.4431 37.5195 44.5255 37.5195C48.6082 37.5195 51.9177 40.8186 51.9177 44.8883Z",fill:"#444446"})))));function mT({sx:t,refresh:n}){return Os.jsxs(f,{sx:u({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},t),children:[Os.jsx(f,{component:hT,sx:{display:"inline-block",width:60,height:60,mb:12}}),Os.jsx(f,{sx:{typography:"body2",width:252,textAlign:"center"},children:Os.jsx(f,{component:"span",sx:{color:"text.secondary"},children:Os.jsx(e,{id:"Vmw6BM",message:"Something went wrong…<0>Refresh again</0>",components:{0:Os.jsx(I,{component:"span",color:"primary.main",weak:!0,sx:{cursor:"pointer"},onClick:()=>{n()}})}})})})]})}function fT(e,t,n,r){return"CLASSICAL"===r&&e&&t&&e.isEqualTo(t)?e.times(`1e${n}`).minus(1).div(`1e${n}`):e}function gT(e,t){return e.lte(0)?new o(0):t.div(e)}function yT(e,t,n,r,i,a,s){const l=i&&function(e){return-1!==["0x9D9793e1E18CDEe6cf63818315D55244f73EC006","0x0D04146B2Fe5d267629a7eb341Fb4388DcdBD22f","0x3D9d765b0fbAf594F90F07bc42889473e6613C7A","0x3854BdcB1a7cBA4b1A5f9a7C8719e247Df4c42c6","0xA46F5eC3219f956d14C6816Ef9cf6CaBf13bdD77","0xB16f2Ff8E8499E31B257d2A02D25e8956Ae6aFe7"].findIndex((t=>t.toLowerCase()===e.toLowerCase()))}(i);let d,c;const u="CLASSICAL"===a?r:n;if(e&&t&&u&&void 0!==s){if(c=gT(t,u),d=e.times(c),"CLASSICAL"===a&&l){if(!r)return[void 0,void 0];d.gt(r)&&n&&(c=gT(t,o.min(r,n)),d=d.times(c))}return[c,d.dp(Number(s),o.ROUND_DOWN)]}return[void 0,void 0]}function xT({account:e,pool:t}){var n,r;const{chainId:i,address:a,type:s,baseTokenDecimals:l,quoteTokenDecimals:d,baseLpTokenDecimals:c,quoteLpTokenDecimals:u}=null!=t?t:{},p=It(es.getTotalBaseLpQuery(i,a,s,c)),h=It(es.getTotalQuoteLpQuery(i,a,s,u)),m=It(es.getUserBaseLpQuery(i,a,s,c,e)),f=It(es.getUserQuoteLpQuery(i,a,s,u,e)),g=It(es.getReserveLpQuery(i,a,s,l,d)),y=It(es.getClassicalTargetQuery(i,a,s,l,d)),x=p.data,v=h.data,{baseReserve:b,quoteReserve:A}=g.data||{},w=null===(n=y.data)||void 0===n?void 0:n.baseTarget,k=null===(r=y.data)||void 0===r?void 0:r.quoteTarget,C="DPP"===s,j=C?b:fT(m.data,x,c,s),T=C?A:fT(f.data,v,u,s),[E,S]=C?[new o(1),b]:yT(j,x,b,w,a,s,l);let I,R;if(A){let e=h.data;e||h.isLoading||h.error||!x||(e=x);const t=f.isFetched&&!f.error&&null===T?j:T;C?(I=new o(1),R=A):f.isLoading||f.error||y.error||t?[I,R]=yT(t,e,A,k,a,s,d):R=new o(0)}const L=m.isLoading||f.isLoading,M=m.isError||f.isError,O=()=>{m.refetch(),f.refetch(),p.refetch(),h.refetch(),g.refetch(),y.refetch()},B=L||p.isLoading||h.isLoading||g.isLoading||y.isLoading,P=M||p.isError||h.isError||g.isError||y.isError,D="DVM"===(null==t?void 0:t.type)&&(!A||A.isZero());return{totalBaseLpBalance:x,totalQuoteLpBalance:v,baseReserve:b,quoteReserve:A,classicalBaseTarget:w,classicalQuoteTarget:k,userBaseLpBalance:j,userQuoteLpBalance:T,userBaseLpToTokenBalance:S,userQuoteLpToTokenBalance:R,baseLpToTokenProportion:E,quoteLpToTokenProportion:I,isSinglePool:D,userLpBalanceLoading:L,userLpToTokenBalanceLoading:B,userLpBalanceError:M,userLpToTokenBalanceError:P,userLpToTokenBalanceRefetch:O,error:P,loading:B,refetch:O}}function vT({pool:e,baseAmount:t,quoteAmount:n}){const[r,o,a,s,l,d]=at.useMemo((()=>{var t,n;const{baseToken:r,quoteToken:i}=e||{};let o=!1;if(!r||!i)return[void 0,void 0,void 0,void 0,void 0,o];const a=r.chainId,s=ue[a],l=(null===(t=s.address)||void 0===t?void 0:t.toLowerCase())===r.address.toLowerCase(),d=(null===(n=s.address)||void 0===n?void 0:n.toLowerCase())===i.address.toLowerCase(),c=l?s.wrappedTokenAddress:r.address,u=d?s.wrappedTokenAddress:i.address,p=new rn(r.chainId,c,r.decimals,r.symbol,r.name),h=new rn(i.chainId,u,i.decimals,i.symbol,i.name);o=!p.sortsBefore(h);const[m,f]=o?[h,p]:[p,h];return[a,null==e?void 0:e.type,null==e?void 0:e.address,m,f,o]}),[e]),c=es.getReserveLpQuery(r,a,o,null==s?void 0:s.decimals,null==l?void 0:l.decimals),u="AMMV2"===o,p=It(Object.assign(Object.assign({},c),{enabled:!!c.enabled&&u})),h=es.getTotalBaseLpQuery(r,a,o,18),m=It(Object.assign(Object.assign({},h),{enabled:!!h.enabled&&u})),{account:f}=hf(),g=es.getUserBaseLpQuery(r,a,o,18,f),y=It(Object.assign(Object.assign({},g),{enabled:!!g.enabled&&u})),x=at.useMemo((()=>p.isFetched&&!!p.data&&m.isFetched&&!!m.data),[p.isFetched,p.data,m.isFetched,m.data]),[v,b]=at.useMemo((()=>{var e;if(!s||!l||!1===x)return[null,null];const{baseReserve:t,quoteReserve:n}=null!==(e=p.data)&&void 0!==e?e:{baseReserve:0,quoteReserve:0},r=on.fromRawAmount(s,jn(t,s.decimals).toString()),i=on.fromRawAmount(l,jn(n,l.decimals).toString());let o=r,a=i;d&&(o=i,a=r);const c=new ln(o,a);if(o.equalTo(0)||a.equalTo(0))return[c,null];const u=a.divide(o);return[c,new an(o.currency,a.currency,u.denominator,u.numerator)]}),[s,l,p.data,d]),[A,w]=at.useMemo((()=>x?b?[new i(b.toSignificant()),new i(b.invert().toSignificant())]:[void 0,void 0]:t&&n?[new i(n).div(t),new i(t).div(n)]:[void 0,void 0]),[b,x,t,n]),k=m.data,C=x?m.data&&s?jn(m.data,18).toString():"":"0";let j,T;const E=d?l:s,S=d?s:l;if((null==v?void 0:v.liquidityToken)&&C&&k&&E&&S){const e=on.fromRawAmount(null==v?void 0:v.liquidityToken,C);if(void 0!==t&&void 0!==n){if(Number(t)&&Number(n)){const r=on.fromRawAmount(E,jn(t,E.decimals).toString()),i=on.fromRawAmount(S,jn(n,S.decimals).toString()),o=null==v?void 0:v.getLiquidityMinted(e,r,i);T=Tn(o.quotient.toString(),18),j=T.div(k.plus(T)).times(100)}}else T=y.data||void 0,T&&(j=T.div(k).times(100))}else x||(j=new i(100));let I="-";return(null==e?void 0:e.baseToken)&&e.quoteToken&&(I=j?`${bn({input:j,showDecimals:2,roundingMode:i.ROUND_HALF_UP})}%`:"0%"),{isRearTokenA:d,pair:v,price:A,invertedPrice:w,reserveQuery:p,totalBaseLpQuery:m,liquidityMinted:T,poolTokenPercentage:j,shareOfPool:I,isExists:x}}function bT({pool:e,maxBaseAmount:t,maxQuoteAmount:n,isRemove:r}){var o,a,s;const[l,d]=at.useState(""),[c,u]=at.useState(""),p=!e||"AMMV2"!==e.type&&"AMMV3"!==e.type,h=It(es.getPMMStateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(o=null==e?void 0:e.baseToken)||void 0===o?void 0:o.decimals,null===(a=null==e?void 0:e.quoteToken)||void 0===a?void 0:a.decimals)),m=()=>{d(""),u("")},f=null==e?void 0:e.type,g=vT({pool:e,baseAmount:l,quoteAmount:c});let y=null===(s=h.data)||void 0===s?void 0:s.midPrice,x=new i(NaN),v=!1,b=!1;const A=h.data;if(e)if(A){const t=A.pmmParamsBG.i,n=A.pmmParamsBG.b,r=A.pmmParamsBG.q;b=("DSP"===e.type||"GSP"===e.type)&&(r.eq(0)||n.eq(0)),v="DVM"===e.type&&new i(r).eq(0),x=b?t:v?i(1):r.div(n)}else"AMMV2"===f&&(y=g.isRearTokenA?g.invertedPrice:g.price,x=y||new i(1));const w=at.useRef(x);if(!e||x.isNaN())return{baseAmount:l,quoteAmount:c,handleChangeBaseAmount:()=>{},handleChangeQuoteAmount:()=>{},reset:m};const k=!v&&!le.utils.singleSideLp(e.type),C=e.baseToken.decimals,j=e.quoteToken.decimals,T=e=>{if(e){let i=x.multipliedBy(e).dp(j).toString();n&&r&&(n.lte(i)||(null==t?void 0:t.lte(0)))&&(i=n.toString()),u(i)}else u(e)};!k||w.current&&x.isEqualTo(w.current)||(w.current=x,T(l));let E=!1;E=!!e&&le.utils.singleSideLp(e.type)?!l&&!c:v?!l:!l||!c;const S=p?h:g.reserveQuery;return{baseAmount:l,quoteAmount:c,handleChangeBaseAmount:e=>{let t=Cn(e,C);null===t&&(t=l),d(t),k&&T(t)},handleChangeQuoteAmount:e=>{let o=Cn(e,j);null===o&&(o=c),u(o),k&&(e=>{if(e){let o=new i(e).div(x).dp(C).toString();t&&r&&(t.lte(o)||(null==n?void 0:n.lte(0)))&&(o=t.toString()),d(o)}else d(e)})(o)},reset:m,addPortion:x,amountLoading:S.isLoading,amountError:S.isError,amountRefetch:S.refetch,amountCheckedDisabled:E,midPrice:y,uniV2Pair:g}}function AT({pool:t,addPortion:n,midPrice:r,shareOfPool:o}){var a,s,l,d,c,u;const p=g(),[h,m]=ct(!1);let y="";if(n&&r){const e=new i(1).div(n.plus(1)),o=new i(n).div(n.plus(1)),l=e.times(r),d=l.plus(o);y=n?`${Bn({input:l.div(d)})} ${null===(a=null==t?void 0:t.baseToken)||void 0===a?void 0:a.symbol} + ${Bn({input:o.div(d)})} ${null===(s=null==t?void 0:t.quoteToken)||void 0===s?void 0:s.symbol}`:""}const x=h?null===(l=null==t?void 0:t.quoteToken)||void 0===l?void 0:l.symbol:null===(d=null==t?void 0:t.baseToken)||void 0===d?void 0:d.symbol,v=h&&r?new i(1).div(r):r,b=h?null===(c=null==t?void 0:t.baseToken)||void 0===c?void 0:c.symbol:null===(u=null==t?void 0:t.quoteToken)||void 0===u?void 0:u.symbol;return Os.jsxs(f,{sx:{mt:20,border:"solid 1px",borderColor:"border.main",borderRadius:8},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,height:36,typography:"body2"},children:[Os.jsx(f,{sx:{color:"text.secondary",whiteSpace:"nowrap"},children:Os.jsx(e,{id:"kNeEXg",message:"Current Price"})}),Os.jsxs(D,{sx:{display:"flex",alignItems:"center",fontWeight:600,ml:8,overflow:"hidden"},loading:!t,loadingProps:{width:50},children:[Os.jsx(A,{title:`1 ${x} = ${v?bn({input:v}):""} ${b}`,children:r?Os.jsx(f,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:`1 ${x} = ${v?bn({input:v}):""} ${b}`}):Os.jsxs(f,{children:[`1 ${x} = `,Os.jsx(D,{loading:!0,loadingProps:{width:30},component:"span",sx:{display:"inline-block"}}),` ${b}`]})}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",ml:4,width:18,height:18,cursor:"pointer",backgroundColor:"background.paperDarkContrast",borderRadius:"50%","&:hover":{backgroundColor:C(p.palette.text.primary,.04)}},onClick:()=>m((e=>!e)),children:Os.jsx(f,{component:As.Switch,sx:{width:18,height:18}})})]})]}),"AMMV2"===(null==t?void 0:t.type)?Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,minHeight:36,typography:"body2",borderStyle:"solid",borderWidth:p.spacing(1,0,0),borderColor:"border.main"},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",color:"text.secondary",whiteSpace:"nowrap"},children:Os.jsx(e,{id:"NEQTCn",message:"Share Of Pool"})}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",fontWeight:600,textAlign:"right",ml:8,overflow:"hidden"},children:o})]}):Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,minHeight:36,typography:"body2",borderStyle:"solid",borderWidth:p.spacing(1,0,0),borderColor:"border.main"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",color:"text.secondary",whiteSpace:"nowrap"},children:[Os.jsx(e,{id:"22Xs8M",message:"Deposit Ratio"}),Os.jsx(P,{ml:4,title:Os.jsx(e,{id:"I0yi1d",message:"Deposit ratio is determined by the current assets ratio in the pool. The ratio does not represent the exchange price"})})]}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",fontWeight:600,textAlign:"right",ml:8,overflow:"hidden"},children:t&&le.utils.singleSideLp(t.type)?Os.jsx(e,{id:"Kb3KaW",message:"Any Ratio"}):Os.jsx(Os.Fragment,{children:Os.jsx(A,{title:y,children:Os.jsx(f,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:y})})})})]})]})}function wT({lqAndDodoCompareText:t,baseToken:n,quoteToken:i,midPrice:o}){const a=o?bn({input:o}):"";return Os.jsxs(f,{sx:{p:10,mb:12,backgroundColor:"background.paperDarkContrast",borderRadius:12},children:[Os.jsxs(f,{sx:{typography:"body2",display:"flex",alignItems:"center",justifyContent:"center",color:"error.main",fontWeight:600,mb:10,textAlign:"center"},children:[Os.jsx(f,{component:As.Alarm,sx:{mr:4}}),r._({id:"YUyuNp",message:"{lqAndDodoCompareText} Price Difference",values:{lqAndDodoCompareText:t}})]}),Os.jsxs(f,{sx:{typography:"h6",color:"text.secondary",textAlign:"center"},children:[Os.jsx(e,{id:"ZhEBp4",message:"Current liquidity pool token price"}),` 1 ${null==n?void 0:n.symbol} = ${a} ${null==i?void 0:i.symbol} ${r._({id:"uaKP0s",message:"differs from the price quoted by DODO by {lqAndDodoCompareText}",values:{lqAndDodoCompareText:t}})}`]})]})}function kT({status:t,children:n,buttonProps:r}){return!t.needShowTokenStatusButton&&n?Os.jsx(Os.Fragment,{children:n}):t.insufficientBalance?Os.jsx(T,{fullWidth:!0,disabled:!0,...r,children:Os.jsx(e,{id:"znqB4T",message:"Insufficient balance"})}):Os.jsx(T,{fullWidth:!0,isLoading:t.isApproving,onClick:t.submitApprove,disabled:t.insufficientBalance,...r,children:t.isApproving?Os.jsx(e,{id:"j2Uisd",message:"Approving"}):t.approveTitle})}function CT({chainId:t,baseTokenStatus:n,quoteTokenStatus:r,children:i}){const{runningRequests:o}=Vy(),{account:a,chainId:s}=At();if(!a||t!==s)return Os.jsx(sb,{chainId:t,fullWidth:!0});const l=o.some((e=>{var t,n;return(null===(t=e.metadata)||void 0===t?void 0:t[Ey.addLiquidity])||(null===(n=e.metadata)||void 0===n?void 0:n[Ey.removeLiquidity])})),d=[];n.needShowTokenStatusButton&&d.push(Os.jsx(kT,{status:n})),r.needShowTokenStatusButton&&!n.isApproving&&d.push(Os.jsx(kT,{status:r}));const c=d.length;return 2===c?Os.jsx(f,{sx:{display:"flex","& > button":{flex:1,"&:last-child":{ml:8}}},children:d.map((e=>e))}):1===c?d[0]:l?Os.jsx(T,{fullWidth:!0,disabled:!0,isLoading:!0,children:Os.jsx(e,{id:"UbRKMZ",message:"Pending"})}):Os.jsx(Os.Fragment,{children:i})}function jT({baseToken:e,quoteToken:t}){const{toFiatPrice:n,fromFiatPrice:r}=Yv({fromToken:null!=e?e:null,toToken:null!=t?t:null});return function({fromToken:e,toToken:t,fromFiatPrice:n,toFiatPrice:r,reverse:i,showDecimals:o=1}){const a={comparePrice:null,comparePriceText:"",loading:!0};return e&&t&&n&&r?(i?(a.loading=!1,a.comparePrice=r.div(n),a.comparePriceText=`1 ${xs(t)} = ${bn({input:a.comparePrice,showDecimals:o})} ${xs(e)}`):(a.loading=!1,a.comparePrice=n.div(r),a.comparePriceText=`1 ${xs(e)} = ${bn({input:a.comparePrice,showDecimals:o})} ${xs(t)}`),a):a}({fromToken:e,toToken:t,fromFiatPrice:r?new i(r):void 0,toFiatPrice:n?new i(n):void 0})}const TT=(e,t,n)=>{const{comparePrice:r}=jT({baseToken:e,quoteToken:t}),o=lt((()=>{if(!(n&&r&&r.toNumber()&&n.toNumber()))return 0;const e=r.minus(n);return Math.abs(e.div(r).toNumber())}),[n,r]),a=lt((()=>`${Mn(new i(o).times(100))}%`),[o]);return{lqAndDodoCompare:o,lqAndDodoCompareText:a,midPrice:n,isShowCompare:o>.01,isWarnCompare:o>.03}};function ET(t){const{ConfirmComponent:n}=pf();if(n)return Os.jsx(n,{...t});const{open:r,onClose:i,title:o,children:a,singleBtn:s,danger:l,singleBtnText:d,cancelText:c,confirmText:u,disabledConfirm:p,confirmLoading:h,isManualClose:m,onConfirm:g,modal:y}=t;return Os.jsx(yy,{open:r,onClose:i,title:o,modal:y,children:Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1},children:[Os.jsx(f,{sx:{typography:"body2",color:o?"text.secondary":"text.primary",textAlign:"center",wordBreak:"break-all",mt:20,px:36},children:a}),s?Os.jsx(f,{sx:{px:20},children:Os.jsx(T,{fullWidth:!0,variant:T.Variant.outlined,danger:l,sx:{mt:32,mb:20},onClick:()=>{i()},children:d||Os.jsx(e,{id:"DPfwMq",message:"Done"})})}):Os.jsxs(f,{sx:{mt:24,mb:20,mx:20,display:"flex",alignItems:"center","& > button":{flex:1}},children:[Os.jsx(T,{variant:T.Variant.second,onClick:()=>{i()},children:c||Os.jsx(e,{id:"dEgA5A",message:"Cancel"})}),Os.jsx(T,{sx:{ml:8},variant:T.Variant.outlined,danger:l,disabled:p,isLoading:h,onClick:()=>{g&&g(),m||i()},children:u||Os.jsx(e,{id:"7VpPHA",message:"Confirm"})})]})]})})}function ST(e){if(!e&&"number"!=typeof e)return e;let t="";return t=i.isBigNumber(e)?e.toString(16):new i(e).toString(16),t.length%2?"0x0"+t:"0x"+t}function IT(e){return ST(jn(e,18))}function RT(e,t,n){const r=new i(e),o=new i(t),a=r.minus(o),s=r.gt(o),l=r.lt(o);return{now:o,target:r,isChange:s||l,change:a,changeText:(l?"":"+")+bn({input:a,showDecimals:n>6?6:4,showPrecisionDecimals:2}),isAdd:s,isRemove:l}}const LT=e=>Fn(void 0,[e],void 0,(function*({chainId:e,account:t,srcPool:n,baseToken:r,quoteToken:o,baseAmount:a,quoteAmount:s,feeRate:l,initPrice:d,slippageCoefficient:c,ddl:u,SLIPPAGE_PROTECTION:p}){const h=e?ue[e]:void 0,m=function({srcPool:e,newPool:t}){if(!e)return null;const{baseToken:n,quoteToken:r,baseAmount:o,quoteAmount:a}=t,{baseReserve:s,quoteReserve:l}=e;return{baseAmount:RT(o,s,n.decimals),quoteAmount:RT(a,l,r.decimals),feeRate:RT(new i(t.feeRate).div(100),e.feeRate,6),initPrice:RT(t.initPrice,e.i,10),slippageCoefficient:RT(t.slippageCoefficient||"1",e.k,4)}}({srcPool:n,newPool:{baseToken:r,quoteToken:o,baseAmount:a,quoteAmount:s,feeRate:l,initPrice:d,slippageCoefficient:c}});if(!(t&&e&&m&&n))return null;const f=Number(r.decimals),g=Number(o.decimals);let y;const x=m.slippageCoefficient.target;try{const t=r.symbol===(null==h?void 0:h.symbol),a=o.symbol===(null==h?void 0:h.symbol);if(m.baseAmount.isRemove&&m.quoteAmount.isRemove){const t=[yield es.getDPPOwnerProxyAddressQuery(e,n.address).queryFn(),m.feeRate.target.multipliedBy(1e4).toNumber(),m.initPrice.target.toNumber(),x.toNumber(),re(m.baseAmount.change.abs().dp(f,i.ROUND_FLOOR).toString(),f).toString(),re(m.quoteAmount.change.abs().dp(g,i.ROUND_FLOOR).toString(),g).toString(),re(m.baseAmount.now.multipliedBy(1-p).dp(f,i.ROUND_FLOOR).toString(),f).toString(),re(m.quoteAmount.now.multipliedBy(1-p).dp(g,i.ROUND_FLOOR).toString(),g).toString(),f,g];y=yield le.encode.removeDPPPoolABI(...t)}else{const t=[e,n.address,m.feeRate.target.multipliedBy(1e4).toNumber(),m.initPrice.target.toNumber(),x.toNumber(),m.baseAmount.isAdd?re(m.baseAmount.change.abs().dp(f,i.ROUND_FLOOR).toString(),f).toString():"0",m.quoteAmount.isAdd?re(m.quoteAmount.change.abs().dp(g,i.ROUND_FLOOR).toString(),g).toString():"0",m.baseAmount.isAdd?"0":re(m.baseAmount.change.abs().dp(f,i.ROUND_FLOOR).toString(),f).toString(),m.quoteAmount.isAdd?"0":re(m.quoteAmount.change.abs().dp(g,i.ROUND_FLOOR).toString(),g).toString(),re(m.baseAmount.now.multipliedBy(1-p).dp(f,i.ROUND_FLOOR).toString(),f).toString(),re(m.quoteAmount.now.multipliedBy(1-p).dp(g,i.ROUND_FLOOR).toString(),g).toString(),0,f,g,Math.ceil(Date.now()/1e3)+(null!=u?u:600)];y=yield le.encode.resetDPPPoolABI(...t)}return t&&m.baseAmount.isAdd&&(y.value=IT(m.baseAmount.change)),a&&m.quoteAmount.isAdd&&(y.value=IT(m.quoteAmount.change)),y}catch(e){throw console.error("2.0 resetDPPPool error",e),new Error(`2.0 resetDPPPool error;ERROR:${e}`)}})),MT=(e,t,n)=>t?e&&"0"!==e?n?t.minus(e).toString():t.plus(e).toString():t.toString():e;function OT({pool:e}){var t,n;const{account:r}=At(),o=Hy(),a=It(es.getPMMStateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(t=null==e?void 0:e.baseToken)||void 0===t?void 0:t.decimals,null===(n=null==e?void 0:e.quoteToken)||void 0===n?void 0:n.decimals)),s=It(es.getLPFeeRateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type)),{deadLine:l}=pf(),d=Ot({mutationFn:t=>Fn(this,[t],void 0,(function*({baseAmount:t,quoteAmount:n,isRemove:d=!1,feeRate:c,initPrice:u,slippageCoefficient:p,txTitle:h,submittedBack:m}){var f;if(!e)throw new Error("pool is undefined");const g=s.data;if(!g)throw new Error("lpFeeRate is undefined");if(!a.data)throw new Error("pmmStateQuery.data is undefined");const{pmmParamsBG:y,baseReserve:x,quoteReserve:v}=a.data,b=y.i.toNumber(),A=y.k.toNumber(),w=yield LT({account:r,chainId:null==e?void 0:e.chainId,SLIPPAGE_PROTECTION:Tw,srcPool:Object.assign(Object.assign({},e),{baseReserve:x,quoteReserve:v,i:b,k:A,feeRate:g.times(100).toString()}),baseToken:null==e?void 0:e.baseToken,quoteToken:null==e?void 0:e.quoteToken,baseAmount:MT(t,x?new i(x):void 0,d),quoteAmount:MT(n,v?new i(v):void 0,d),feeRate:null!=c?c:g.times(100).toString(),initPrice:null!=u?u:String(b),slippageCoefficient:null!=p?p:String(A),ddl:l});if(!w)throw new Error(`modify pool failed: ${e.address}`);return o.execute(h,Object.assign(Object.assign({opcode:By.TX},w),{value:null!==(f=w.value)&&void 0!==f?f:0}),{metadata:{[d?Ey.removeLiquidity:Ey.addLiquidity]:!0},submittedBack:m})}))});return{modifyDPPMutation:d}}const BT=e=>{const{account:t,chainId:n}=hf(),r=Hy(),o=Rt(),{deadLine:a}=pf(),{modifyDPPMutation:s}=OT({pool:e}),l=Ot({mutationFn:s=>Fn(void 0,void 0,void 0,(function*(){var l,d,c,u,p;if(!e||!t||!s.balanceInfo)return;const{isRemove:h,baseAmount:m,quoteAmount:f,slippageProtection:g,balanceInfo:y,SLIPPAGE_PROTECTION:x,submittedBack:v,successBack:b,txTitle:A,withdrawInfo:w}=s,k=!h,{address:C,type:j,baseToken:T,quoteToken:E}=e,S=T.address.toLowerCase(),I=E.address.toLowerCase(),R=ue[n].address.toLowerCase(),L=R===S,M=R===I,O="DSP"===j||"GSP"===j,B="CLASSICAL"===j,P=C.toLocaleLowerCase(),D=new i(m),N=new i(f),F=D.isNaN(),W=N.isNaN(),V=+T.decimals,U=+E.decimals,H=T.symbol,q=E.symbol,Z=g;let z,Q=F?"0":re(D.multipliedBy(1-Z).dp(V,i.ROUND_FLOOR).toString(),V).toString(),G=W?"0":re(N.multipliedBy(1-Z).dp(U,i.ROUND_FLOOR).toString(),U).toString();try{if(k)if(B){const e=!F&&(null==y?void 0:y.classicalBaseTarget)&&y.classicalBaseTarget.gt(0)&&y.totalBaseLpBalance?re(D.multipliedBy(y.totalBaseLpBalance).multipliedBy(1-x).div(y.classicalBaseTarget).dp(V,i.ROUND_FLOOR).toString(),V).toString():"0",t=!W&&(null==y?void 0:y.classicalBaseTarget)&&y.totalQuoteLpBalance&&y.classicalQuoteTarget&&y.classicalQuoteTarget.gt(0)?re(N.multipliedBy(y.totalQuoteLpBalance).multipliedBy(1-x).div(y.classicalQuoteTarget).dp(U,i.ROUND_FLOOR).toString(),U).toString():"0",r=[n,P,F?"0":re(D.dp(V,i.ROUND_FLOOR).toString(),V).toString(),W?"0":re(N.dp(U,i.ROUND_FLOOR).toString(),U).toString(),e,t,L?1:M?2:0,Math.ceil(Date.now()/1e3)+(null!=a?a:600)];z=yield le.encode.addClassicalLiquidityABI(...r)}else{const e=[n,P,F?"0":re(D.dp(V,i.ROUND_FLOOR).toString(),V).toString(),W?"0":re(N.dp(U,i.ROUND_FLOOR).toString(),U).toString(),Q,G,L?1:M?2:0,Math.ceil(Date.now()/1e3)+(null!=a?a:600)];z=O?yield le.encode.addDSPLiquidityABI(...e):yield le.encode.addDVMLiquidityABI(...e)}else if(B){if("base"===(F?"quote":"base")){const e=D.dp(V,i.ROUND_FLOOR).toString(),t=w&&w.receiveAmountBg?re(w.receiveAmountBg.multipliedBy(1-Z).dp(V,i.ROUND_FLOOR).toString(),V).toString():Q,r=[n,P,re(e,V).toString(),t];z=yield le.encode.removeClassicalBaseABI(...r)}else{const e=N.dp(U,i.ROUND_FLOOR).toString(),t=w&&w.receiveAmountBg?re(w.receiveAmountBg.multipliedBy(1-Z).dp(U,i.ROUND_FLOOR).toString(),U).toString():G,r=[n,P,re(e,U).toString(),t];z=yield le.encode.removeClassicalQuoteABI(...r)}}else{if(!((null==y?void 0:y.baseReserve)&&y.quoteReserve&&y.totalBaseLpBalance&&y.userBaseLpBalance&&y.userBaseLpToTokenBalance))return;let e=new i(0);if(null===(l=y.totalBaseLpBalance)||void 0===l?void 0:l.lte(0))e=y.userBaseLpBalance||new i(0);else if(y.baseReserve.gt(0)&&y.quoteReserve.eq(0)){let t=D;D.gte(y.userBaseLpToTokenBalance)&&(t=y.userBaseLpToTokenBalance),e=t.multipliedBy(y.totalBaseLpBalance).div(y.baseReserve)}else if(y.baseReserve.gt(0)&&y.quoteReserve.gt(0)){let t=D;D.gte(y.userBaseLpToTokenBalance)&&(t=y.userBaseLpToTokenBalance);let n,r=N;if(y.userQuoteLpToTokenBalance&&N.gte(y.userQuoteLpToTokenBalance)&&(r=y.userQuoteLpToTokenBalance),r.gt(0)&&(null===(d=y.userQuoteLpToTokenBalance)||void 0===d?void 0:d.gt(0))&&(n=r.div(y.userQuoteLpToTokenBalance)),t.gt(0)&&y.userBaseLpToTokenBalance.gt(0)&&(n=t.div(y.userBaseLpToTokenBalance)),(null==n?void 0:n.gte(1))&&(n=new i(1)),!n)return;e=n.multipliedBy(y.userBaseLpBalance);const o=e.dp(V,i.ROUND_FLOOR).div(y.totalBaseLpBalance);t=o.multipliedBy(y.baseReserve).dp(V,i.ROUND_FLOOR),r=o.multipliedBy(y.quoteReserve).dp(U,i.ROUND_FLOOR),Q=re(t.multipliedBy(1-Z).dp(V,i.ROUND_FLOOR).toString(),V).toString(),G=re(r.multipliedBy(1-Z).dp(U,i.ROUND_FLOOR).toString(),U).toString()}const r=L||M,o=[n,P,t,e.isNaN()?"0":re(e.dp(V,i.ROUND_FLOOR).toString(),V).toString(),Q,G,r,Math.ceil(Date.now()/1e3)+(null!=a?a:600)];z=O?yield le.encode.removeDSPLiquidityABI(...o):yield le.encode.removeDVMLiquidityABI(...o)}}catch(e){throw new Error(`v2 addDVMLiquidity or removeDVMLiquidity or removeDSPLiquidity error: ${e}`)}if(z&&z.data){const i={};if(m){const r=null===(c=o.getQueryData($a.getFetchTokenQuery(n,T.address,t).queryKey))||void 0===c?void 0:c.balance;r&&(i[T.address]=r.toString()),e.baseLpToken&&(null==y?void 0:y.userBaseLpBalance)&&(i[e.baseLpToken.id]=y.userBaseLpBalance.toString())}if(f){const r=null===(u=o.getQueryData($a.getFetchTokenQuery(n,E.address,t).queryKey))||void 0===u?void 0:u.balance;r&&(i[E.address]=r.toString()),e.quoteLpToken&&(null==y?void 0:y.userQuoteLpBalance)&&(i[e.quoteLpToken.id]=y.userQuoteLpBalance.toString())}try{let e;k&&L&&(z.value=IT(F?"0":D)),k&&M&&(z.value=IT(W?"0":N)),F||(e=`${D.toString()}${H}`),W||(e=F?`${N.toString()}${q}`:`${e} & ${N.toString()}${q}`);(yield r.execute(A,Object.assign(Object.assign({opcode:By.TX},z),{value:null!==(p=z.value)&&void 0!==p?p:0}),{subtitle:e,metadata:{[k?Ey.addLiquidity:Ey.removeLiquidity]:!0,logBalance:i},submittedBack:v}))===Sy.Success&&b&&b()}catch(e){throw Error(`v2 sendTransaction error: ${e}`)}}}))}),d="DPP"===(null==e?void 0:e.type)?s:l;return at.useEffect((()=>{d.reset()}),[e]),{operateLiquidityMutation:d}};function PT(e){var{sx:t,label:n,children:r}=e,i=Nn(e,["sx","label","children"]);return Os.jsxs(f,{sx:Object.assign({display:"flex",justifyContent:"space-between"},t),...i,children:[Os.jsx(f,{children:n}),Os.jsx(f,{sx:{textAlign:"right",fontWeight:600},children:r})]})}var DT=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}},NT={"text/plain":"Text","text/html":"Url",default:"Text"};var FT,WT,VT=function(e,t){var n,r,i,o,a,s,l=!1;t||(t={}),n=t.debug||!1;try{if(i=DT(),o=document.createRange(),a=document.getSelection(),(s=document.createElement("span")).textContent=e,s.ariaHidden="true",s.style.all="unset",s.style.position="fixed",s.style.top=0,s.style.clip="rect(0, 0, 0, 0)",s.style.whiteSpace="pre",s.style.webkitUserSelect="text",s.style.MozUserSelect="text",s.style.msUserSelect="text",s.style.userSelect="text",s.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=NT[t.format]||NT.default;window.clipboardData.setData(i,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(s),o.selectNodeContents(s),a.addRange(o),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!0}catch(i){n&&console.error("unable to copy using execCommand: ",i),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),l=!0}catch(i){n&&console.error("unable to copy using clipboardData: ",i),n&&console.error("falling back to prompt"),r=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(r,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(o):a.removeAllRanges()),s&&document.body.removeChild(s),i()}return l},UT=vr(VT);function HT({copyText:e,size:t,sx:n,componentProps:i,onClick:o,children:a}){var s;const[l,d]=at.useState(!1);return Os.jsx(j,{title:r._({id:"6V3Ea3",message:"Copied"}),open:l,onClose:()=>d(!1),arrow:!1,children:Os.jsxs(f,{...i,component:null!==(s=null==i?void 0:i.component)&&void 0!==s?s:y,onClick:t=>{if(null==i?void 0:i.onClick)return i.onClick(t);t.stopPropagation(),e&&(UT(e),d(!0)),o&&o()},sx:Object.assign({cursor:"pointer"},null==i?void 0:i.sx),children:[Os.jsx(f,{component:As.Copy,sx:Object.assign({width:t||"auto",height:t||"auto"},n)}),a]})})}function qT({truncate:e,address:t,disabledAddress:n,sx:r,handleOpen:i,addressHoverColor:o,addressHoverShowIcon:a}){return n?Os.jsx(f,{children:e?us(t):t}):Os.jsx(X,{lineSx:{bottom:-1},lineColor:null!=o?o:(null==r?void 0:r.color)||"",hoverSx:{color:"addressHoverColor","& svg":{display:"inline-block"}},className:"truncate-address-link",children:Os.jsxs(f,{onClick:e=>{null==i||i(e,"address")},sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[e?us(t):t,a?Os.jsx(f,{component:As.ArrowRight,sx:{display:"none",width:14,height:14}}):""]})})}function ZT({address:e,truncate:t,showCopy:n,size:r="medium",iconSize:i,iconSpace:o,sx:a,iconDarkHover:s,disabledAddress:l,addressHoverColor:d,addressHoverShowIcon:c,customChainId:u,handleOpen:p,onAddressClick:h,onShareClick:m}){const y=g(),x="medium"===r,v=s?Q:I,b=e=>{let t=e?12:8;return o&&(t=o),s&&(t-=3),t},A="big"===r?"h5":x?"body1":"body2",{chainId:w}=At(),k=null!=u?u:w,C=(t,n)=>{p?p(t,n):k&&(t.stopPropagation(),window.open(ps(k,e,"address")))},j=i||(x?16:14);return Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",typography:A,color:y.palette.text.primary,lineHeight:"normal"},a||{}),children:[Os.jsx(qT,{truncate:t,address:e,disabledAddress:l,sx:a,typography:A,handleOpen:null!=h?h:C,addressHoverColor:d,addressHoverShowIcon:c}),Os.jsx(v,{sx:{display:"inline-flex",ml:b(x),cursor:"pointer"},onClick:e=>{C(e,"icon")},children:Os.jsx(f,{component:As.ArrowTopRightBorder,sx:{width:j,height:j}})}),n?Os.jsx(HT,{size:j,copyText:e,componentProps:{component:v,sx:{ml:b(x)}}}):null,!!m&&Os.jsx(v,{sx:{display:"inline-flex",ml:b(x),cursor:"pointer"},onClick:e=>{m(e)},children:Os.jsx(f,{component:As.Share,sx:{width:j,height:j,ml:b(x)}})})]})}function zT({baseToken:e,quoteToken:t,midPrice:n,loading:r,disabled:o}){const a=g(),[s,l]=ct(!1),d=s?null==t?void 0:t.symbol:null==e?void 0:e.symbol,c=s&&n?new i(1).div(n):n,u=s?null==e?void 0:e.symbol:null==t?void 0:t.symbol;return Os.jsxs(D,{sx:{display:"flex",alignItems:"center",fontWeight:600,overflow:"hidden"},loading:r,loadingProps:{width:50},children:[e&&t?Os.jsx(A,{title:`1 ${d} = ${c?bn({input:c}):""} ${u}`,children:n?Os.jsx(f,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:`1 ${d} = ${c?bn({input:c}):""} ${u}`}):Os.jsxs(f,{children:[`1 ${d} = `,Os.jsx(D,{loading:r,loadingProps:{width:30},component:"span",sx:{display:"inline-block"},children:"-"}),` ${u}`]})}):"-",Os.jsx(f,{sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"center",ml:4,width:18,height:18,backgroundColor:"background.paperDarkContrast",borderRadius:"50%"},!o&&{cursor:"pointer","&:hover":{backgroundColor:C(a.palette.text.primary,.04)}}),onClick:()=>{o||l((e=>!e))},children:Os.jsx(f,{component:As.Switch,sx:{width:18,height:18}})})]})}function QT({baseToken:t,quoteToken:n,loading:r,midPrice:i,shareOfPool:o,sx:a}){const s=g(),l=!t||!n;return Os.jsxs(f,{sx:Object.assign({mt:20,border:"solid 1px",borderColor:"border.main",borderRadius:8},a),children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,height:36,typography:"body2"},children:[Os.jsx(f,{sx:{color:"text.secondary",whiteSpace:"nowrap"},children:Os.jsx(e,{id:"kNeEXg",message:"Current Price"})}),Os.jsx(zT,{baseToken:t,quoteToken:n,loading:r,disabled:l,midPrice:i})]}),Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,minHeight:36,typography:"body2",borderStyle:"solid",borderWidth:s.spacing(1,0,0),borderColor:"border.main"},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",color:"text.secondary",whiteSpace:"nowrap"},children:Os.jsx(e,{id:"SbBMxj",message:"Share of pool"})}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",fontWeight:600,textAlign:"right",ml:8,overflow:"hidden"},children:Os.jsx(D,{sx:{display:"flex",alignItems:"center",fontWeight:600,overflow:"hidden"},loading:r,loadingProps:{width:50},children:o||"-%"})})]})]})}function GT({open:t,onClose:n,slippage:r,baseToken:i,quoteToken:o,baseAmount:a,quoteAmount:s,lpAmount:l,fee:d,price:c,shareOfPool:u,pairAddress:p,createMutation:h}){const m=g(),{isMobile:y}=wy();return Os.jsx(yy,{modal:!0,open:t,onClose:n,title:l?Os.jsx(e,{id:"AeZIvT",message:"You will receive"}):Os.jsx(e,{id:"aM1tos",message:"You are creating a pool"}),children:Os.jsxs(f,{sx:{px:20,py:24,borderTopWidth:1,width:y?"100%":420},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,typography:"h3"},children:[Os.jsx(Cj,{width:24,height:24,tokens:i&&o?[i,o]:[],chainId:null==i?void 0:i.chainId}),l?An({input:l,decimals:18}):""]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,fontWeight:600},children:[Os.jsx(e,{id:"syToc5",message:"{0}/{1} Pool Tokens",values:{0:null==i?void 0:i.symbol,1:null==o?void 0:o.symbol}}),Os.jsx(f,{sx:{px:4,py:2,fontSize:10,lineHeight:1,backgroundColor:C(m.palette.purple.main,.1),color:m.palette.purple.main,borderRadius:4},children:Os.jsx(e,{id:"rbsyJM",message:"AMM V2"})})]})]}),Os.jsx(f,{sx:{mt:16,typography:"h6",color:"text.secondary",textAlign:"center"},children:Os.jsx(e,{id:"rQ9c+8",message:"Output is estimated. If the price changes by more than {0} your transaction will revert.",values:{0:Bn({input:r})}})}),Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:12,mt:20,p:20,typography:"body2",borderRadius:12,backgroundColor:m.palette.background.paperContrast},children:[Os.jsx(PT,{label:Os.jsx(e,{id:"YG004A",message:"{0} deposited",values:{0:null==i?void 0:i.symbol}}),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",lineHeight:1},children:[Os.jsx(ey,{width:18,height:18,marginRight:4,token:i}),An({input:a,decimals:null==i?void 0:i.decimals})]})}),Os.jsx(PT,{label:Os.jsx(e,{id:"YG004A",message:"{0} deposited",values:{0:null==o?void 0:o.symbol}}),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(ey,{width:18,height:18,marginRight:4,token:o}),An({input:s,decimals:null==o?void 0:o.decimals})]})}),Os.jsx(PT,{label:Os.jsx(e,{id:"EU3wU4",message:"Fee tier"}),children:Bn({input:d})}),Os.jsx(PT,{label:Os.jsx(e,{id:"fqDzSu",message:"Rate"}),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(ey,{width:18,height:18,marginRight:4,token:i}),Os.jsx(zT,{baseToken:i,quoteToken:o,midPrice:c})]})}),Os.jsx(PT,{label:Os.jsx(e,{id:"SbBMxj",message:"Share of pool"}),children:u}),Os.jsx(PT,{label:Os.jsx(e,{id:"ESQO1L",message:"Pool address"}),children:Os.jsx(ZT,{showCopy:!1,address:null!=p?p:"",customChainId:null==i?void 0:i.chainId,truncate:!0,iconSpace:4,sx:{typography:"body2"}})})]}),Os.jsx(T,{fullWidth:!0,size:T.Size.big,sx:{mt:20},isLoading:h.isPending,onClick:()=>{h.mutate()},children:h.isPending?Os.jsx(e,{id:"pwUZo2",message:"Confirming..."}):Os.jsx(e,{id:"7VpPHA",message:"Confirm"})})]})})}function YT({baseToken:e,quoteToken:t,baseAmount:o,quoteAmount:a,slippage:s,fee:l,isExists:d,successBack:c,submittedBack:u}){const p=Hy(),{account:h}=hf();n();const{deadLine:m}=pf();return Ot({mutationFn:()=>Fn(this,void 0,void 0,(function*(){var n,f;if(!e||!t)throw new Error("token is undefined");if(!h)throw new Error("account is undefined");if(!l)throw new Error("fee is undefined");const g=e.chainId,y=ue[g].address.toLowerCase(),x=Ce(g),v=Ie(g),b=!x,A=x||v;if(!A)throw new Error("AMMV2 contract address is not valid.");let w="",k="0x0";const C=e.address.toLowerCase()===y,j=t.address.toLowerCase()===y,T=jn(o,e.decimals),E=jn(a,t.decimals),S=T.times(1-s).dp(0,i.ROUND_FLOOR),I=E.times(1-s).dp(0,i.ROUND_FLOOR),R=jn(l,4).toString(),L=Math.ceil(Date.now()/1e3)+(null!=m?m:600);try{if(C){const e=t.address,r=E.toString(),i=I.toString(),o=S.toString();k=null!==(n=ST(T))&&void 0!==n?n:"",w=b?Re(e,r,i,o,h,L):Le(e,R,r,i,o,h,L)}else if(j){const t=e.address,n=T.toString(),r=S.toString(),i=I.toString();k=null!==(f=ST(E))&&void 0!==f?f:"",w=b?Re(t,n,r,i,h,L):Le(t,R,n,r,i,h,L)}else w=b?Me(e.address,t.address,T.toString(),E.toString(),S.toString(),I.toString(),h,L):Oe(e.address,t.address,R,T.toString(),E.toString(),S.toString(),I.toString(),h,L)}catch(e){throw console.error("encodeUniswapV2Router02AddLiquidity error",e),e}return yield p.execute(d?r._({id:"E6MqGy",message:"Add liquidity"}):r._({id:"L37FfW",message:"Create AMM V2 Position"}),{opcode:By.TX,to:A,data:w,value:k},{metadata:{[d?Ey.addLiquidityAMMV2Position:Ey.createAMMV2Position]:!0},successBack:c,submittedBack:u})}))})}function XT({submittedBack:e,onlyShowSide:t,pool:n,balanceInfo:i}){var o,a,s,l,d,c;const{account:u}=At(),{baseAmount:p,quoteAmount:h,handleChangeBaseAmount:m,handleChangeQuoteAmount:g,addPortion:y,midPrice:x,amountLoading:v,amountCheckedDisabled:b,uniV2Pair:A,reset:w}=bT({pool:n}),k=It(es.getFeeRateQuery(null==n?void 0:n.chainId,null==n?void 0:n.address,null==n?void 0:n.type,u)),C=null===(d=null===(a=null===(o=k.data)||void 0===o?void 0:o.mtFeeRate)||void 0===a?void 0:a.plus(null!==(l=null===(s=k.data)||void 0===s?void 0:s.lpFeeRate)&&void 0!==l?l:0))||void 0===d?void 0:d.toNumber(),j="AMMV2"===(null==n?void 0:n.type),[E,S]=at.useState(!1),{slipper:I,setSlipper:R,slipperValue:L,resetSlipper:M}=Ew({address:null==n?void 0:n.address,type:null==n?void 0:n.type}),O=zw(n);at.useEffect((()=>{(null==n?void 0:n.address)!==(null==O?void 0:O.address)&&(w(),M())}),[n]);const B=le.utils.canOperateLiquidity(null==n?void 0:n.type,void 0,null==n?void 0:n.creator,u),[P,N]=at.useState(!1),{isShowCompare:F,lqAndDodoCompareText:W,isWarnCompare:V}=TT(null==n?void 0:n.baseToken,null==n?void 0:n.quoteToken,x),U=j&&n.chainId?Ce(n.chainId)||Ie(n.chainId):void 0,H=EA(null==n?void 0:n.baseToken,{amount:p,contractAddress:U}),q=EA(null==n?void 0:n.quoteToken,{amount:h,contractAddress:U}),Z=H.insufficientBalance||q.insufficientBalance,{isSinglePool:z}=i,Q=!n||Z||!x||!!i.loading||!!i.error||b||k.isLoading;let G=j?r._({id:"bwSQI0",message:"Supply"}):r._({id:"m16xKo",message:"Add"});Z&&(G=r._({id:"znqB4T",message:"Insufficient balance"}));const Y=()=>{w(),M(),e&&e()},{operateLiquidityMutation:X}=BT(n),J=()=>{j?S(!0):X.mutate({txTitle:r._({id:"OBdohg",message:"Add Liquidity"}),isRemove:!1,baseAmount:p,quoteAmount:h,slippageProtection:L,balanceInfo:i,SLIPPAGE_PROTECTION:Tw,submittedBack:Y})},K=YT({baseToken:null==n?void 0:n.baseToken,quoteToken:null==n?void 0:n.quoteToken,baseAmount:p,quoteAmount:h,fee:C,isExists:!0,slippage:L,submittedBack:()=>{Y(),S(!1)}});return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{pt:20,pb:18,px:20},children:["quote"===t?"":Os.jsx(Qy,{amt:p,token:null==n?void 0:n.baseToken,canClickBalance:!0,showPercentage:!0,onInputChange:m,readOnly:i.loading||!B}),t?"":Os.jsx(Zy,{}),"base"===t?"":Os.jsx(Qy,{amt:h,token:null==n?void 0:n.quoteToken,canClickBalance:!0,showPercentage:!0,onInputChange:g,readOnly:i.loading||!B||z}),Os.jsxs(D,{loading:i.loading||v,sx:{mt:8},children:[Os.jsx(Sw,{value:I,onChange:R,disabled:!B,type:null==n?void 0:n.type}),Os.jsx(AT,{pool:n,addPortion:y,midPrice:x,shareOfPool:null==A?void 0:A.shareOfPool})]})]}),Os.jsxs(f,{sx:{px:20,py:16,position:"sticky",bottom:0,borderStyle:"solid",borderWidth:"1px 0 0",borderColor:"border.main",backgroundColor:"background.paper"},children:[F&&Os.jsx(wT,{baseToken:null==n?void 0:n.baseToken,quoteToken:null==n?void 0:n.quoteToken,lqAndDodoCompareText:W,midPrice:x}),n?Os.jsx(CT,{chainId:n.chainId,baseTokenStatus:H,quoteTokenStatus:q,children:Os.jsx(T,{fullWidth:!0,disabled:Q,danger:V,isLoading:X.isPending||K.isPending,onClick:()=>{Q||(V?N(!0):J())},children:G})}):Os.jsx(T,{fullWidth:!0,disabled:!0,children:G})]}),Os.jsx(ET,{open:P,onClose:()=>N(!1),title:r._({id:"bEsfUQ",message:"Confirm submission"}),onConfirm:J,modal:!0,children:Os.jsxs(f,{children:[Os.jsx(f,{children:r._({id:"JaeUyE",message:"Price discrepancy {lqAndDodoCompareText} between liquidity pool and the quote price on DODO.",values:{lqAndDodoCompareText:W}})}),Os.jsx(f,{children:r._({id:"vXvgFK",message:"There is risk of being arbitraged if adding this liquidity."})})]})}),Os.jsx(FA,{message:null===(c=X.error)||void 0===c?void 0:c.message,onClose:()=>X.reset()}),j&&!!n&&Os.jsx(GT,{open:E,onClose:()=>S(!1),slippage:L,baseToken:n.baseToken,baseAmount:p,quoteToken:n.quoteToken,quoteAmount:h,fee:C,price:null==A?void 0:A.price,lpAmount:null==A?void 0:A.liquidityMinted,shareOfPool:null==A?void 0:A.shareOfPool,pairAddress:n.address,createMutation:K})]})}function JT({chainId:e,address:t,token:n,quoteToken:r,lpBalance:i,lpBalanceLoading:o,balanceNeedUpdateLoading:a,tokenBalanceList:s}){var l;const d=r?`${null==n?void 0:n.symbol}/${r.symbol}`:null!==(l=null==n?void 0:n.symbol)&&void 0!==l?l:"";return Os.jsxs(f,{sx:{display:"flex"},children:[n?Os.jsx(f,{sx:{position:"relative",top:2},children:r?Os.jsx(Cj,{tokens:[n,r],chainId:e,width:18,mr:4}):Os.jsx(ey,{address:n.address,width:18,height:18,chainId:e,url:n.logoURI,marginRight:4,noShowChain:!0})}):Os.jsx(w,{width:32,height:32,sx:{mr:4}}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",wordBreak:"break-all"},children:[Os.jsx(D,{loading:o,loadingProps:{width:30},sx:{display:"flex",alignItems:"center",mr:2},children:a?Os.jsx(x,{}):bn({input:i||"-"})}),`${d} LP`,!!(null==s?void 0:s.length)&&Os.jsx(A,{title:Os.jsx(f,{sx:{display:"flex",flexDirection:"column",gap:8},children:s.map((e=>Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2",fontWeight:600,color:"text.primary"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(ey,{address:e.token.address,chainId:e.token.chainId,width:14,height:14,url:e.token.logoURI,marginRight:4,noShowChain:!0}),e.token.symbol]}),Os.jsxs(D,{loading:e.loading,children:[!e.balance||e.balance.isZero()||e.balance.isNaN()?"":"~",e.balance?bn({input:e.balance}):""]})]},e.token.address)))}),sx:{padding:20,width:256},children:Os.jsx(I,{component:As.DetailBorder,sx:{ml:4,width:16,height:16}})}),Os.jsx(f,{component:"a",target:"_blank",rel:"noopener noreferrer",href:e?ps(e,t,"address"):"",sx:{display:"inline-flex",height:14},children:Os.jsx(I,{component:As.ArrowTopRightBorder,sx:{ml:4,width:14,height:14}})})]})]},t)}function KT({loading:t,hidePoolInfo:n,pool:r,balanceInfo:o}){var a,s,l,d,c,u,p;const h=g(),m=t||!r,x=!!r&&le.utils.singleSideLp(r.type),{isTokenLoading:v}=qy(),{account:b}=hf(),w=It(es.getFeeRateQuery(null==r?void 0:r.chainId,null==r?void 0:r.address,null==r?void 0:r.type,b)),k=null===(s=null===(a=w.data)||void 0===a?void 0:a.lpFeeRate)||void 0===s?void 0:s.plus(null!==(d=null===(l=w.data)||void 0===l?void 0:l.mtFeeRate)&&void 0!==d?d:0);let C=!1,j=!1;r&&(o.userBaseLpBalance&&r.baseLpToken&&(C=v(r.baseLpToken.id,o.userBaseLpBalance)),o.userQuoteLpBalance&&r.quoteLpToken&&(j=v(r.quoteLpToken.id,o.userQuoteLpBalance)));const T="AMMV2"===(null==r?void 0:r.type);return Os.jsxs(f,{sx:{mt:16,mx:20,border:"solid 1px",borderColor:"border.main",borderRadius:12},children:[n?"":Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:h.spacing(12,20),borderStyle:"solid",borderColor:"border.main",borderWidth:h.spacing(0,0,1)},children:[Os.jsxs(f,{children:[Os.jsxs(D,{loading:m,loadingSx:{width:100,mb:4},sx:{display:"flex",alignItems:"center",gap:4,typography:"body2",fontWeight:600},children:[null===(c=null==r?void 0:r.baseToken)||void 0===c?void 0:c.symbol,"/",null===(u=null==r?void 0:r.quoteToken)||void 0===u?void 0:u.symbol,"AMMV2"===(null==r?void 0:r.type)&&Os.jsx(D,{loading:w.isLoading,loadingProps:{width:30},sx:{typography:"h6"},children:Os.jsx(A,{title:Os.jsxs(f,{sx:{typography:"h6","& > b":{fontWeight:600,color:"primary.main"}},children:["🌟",Os.jsx("b",{children:Os.jsx(e,{id:"e38JNU",message:"Tips:"})})," ",Os.jsx(e,{id:"1ABiXc",message:"By adding liquidity you’ll earn <0>{0}</0> of all trades on this pair proportional to your share of the pool. Fees are added to the pool, accrue in real time and can be claimed by withdrawing your liquidity.",values:{0:Bn({input:k})},components:{0:Os.jsx("b",{})}})]}),sx:{maxWidth:240},children:Os.jsx(f,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.disabled"},children:Bn({input:k})})})})]}),Os.jsx(D,{loading:m,children:Os.jsx(ZT,{address:null!==(p=null==r?void 0:r.address)&&void 0!==p?p:"",truncate:!0,iconSize:14,iconSpace:4,customChainId:null==r?void 0:r.chainId,sx:{typography:"h6",color:"text.secondary"}})})]}),(null==r?void 0:r.address)&&!T?Os.jsxs(f,{component:y,sx:{typography:"body2",display:"flex",alignItems:"center",color:"text.secondary"},onClick:()=>{fw.getState().push({type:pw.PoolDetail,params:{chainId:r.chainId,address:r.address}})},children:[Os.jsx(e,{id:"URmyfc",message:"Details"}),Os.jsx(f,{component:As.ArrowRight,sx:{ml:4,position:"relative",top:1.2,width:16,height:16}})]}):""]}),Os.jsxs(f,{sx:{p:h.spacing(12,20)},children:[Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"YHc3B+",message:"My Liquidity"})}),Os.jsx(f,{sx:{mt:12},children:Os.jsx(D,{loading:m,loadingSx:{width:100},children:x?Os.jsxs(Os.Fragment,{children:[Os.jsx(JT,{chainId:null==r?void 0:r.chainId,address:null==r?void 0:r.address,token:null==r?void 0:r.baseToken,lpBalance:null==o?void 0:o.userBaseLpBalance,lpBalanceLoading:o.userLpBalanceLoading,balanceNeedUpdateLoading:C,tokenBalanceList:r?[{token:r.baseToken,balance:null==o?void 0:o.userBaseLpToTokenBalance,loading:o.userLpToTokenBalanceLoading}]:void 0}),Os.jsx(JT,{chainId:null==r?void 0:r.chainId,address:null==r?void 0:r.address,token:null==r?void 0:r.quoteToken,lpBalance:null==o?void 0:o.userQuoteLpBalance,lpBalanceLoading:o.userLpBalanceLoading,balanceNeedUpdateLoading:j,tokenBalanceList:r?[{token:r.quoteToken,balance:null==o?void 0:o.userQuoteLpToTokenBalance,loading:o.userLpToTokenBalanceLoading}]:void 0})]}):Os.jsx(JT,{chainId:null==r?void 0:r.chainId,address:null==r?void 0:r.address,token:null==r?void 0:r.baseToken,quoteToken:null==r?void 0:r.quoteToken,lpBalance:o.userBaseLpBalance,lpBalanceLoading:o.userLpBalanceLoading,balanceNeedUpdateLoading:C,tokenBalanceList:r?[{token:r.baseToken,balance:o.userBaseLpToTokenBalance||new i(0),loading:o.userLpToTokenBalanceLoading},{token:r.quoteToken,balance:o.userQuoteLpToTokenBalance||new i(0),loading:o.userLpToTokenBalanceLoading}]:void 0})})})]})]})}!function(e){e[e.Add=1]="Add",e[e.Remove=2]="Remove"}(FT||(FT={})),function(e){e[e.base=1]="base",e[e.quote=2]="quote"}(WT||(WT={}));const _T=e=>{const[t,n]=at.useState(WT.base);let r,i;return e&&le.utils.singleSideLp(e.type)&&(r=t===WT.base,i=r?e.baseToken:e.quoteToken),{isBase:r,checkToken:i,checkTokenType:t,setCheckToken:n}},$T=({pool:e,isBase:t,baseAmount:n,quoteAmount:r})=>{var o,a;const s="CLASSICAL"===(null==e?void 0:e.type),l=t||void 0===t,d=null===(o=null==e?void 0:e.baseToken)||void 0===o?void 0:o.decimals,c=null===(a=null==e?void 0:e.quoteToken)||void 0===a?void 0:a.decimals,u=It(Object.assign(Object.assign({},es.getWithdrawBasePenaltyQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,n&&void 0!==d?re(new i(n).dp(d,i.ROUND_FLOOR).toString(),d).toString():"",d)),{enabled:!!e&&!!n&&s&&l})),p=It(Object.assign(Object.assign({},es.getWithdrawBasePenaltyQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,r&&void 0!==c?re(new i(r).dp(c,i.ROUND_FLOOR).toString(),c).toString():"",c)),{enabled:!!e&&!!r&&s&&!l}));let h,m="",f="",g="",y="",x="",v=!1,b=null;if(e){const t=vs(e.baseToken.decimals),o=vs(e.quoteToken.decimals);if(g=bn({input:n,showDecimals:t}),y=bn({input:r,showDecimals:o}),s)if(v=l?u.isLoading:p.isLoading,b=l?u.error:p.error,l){if(u.data){m=bn({input:u.data,showDecimals:t}),x=m;const e=new i(n).minus(u.data);g=e.gt(0)?bn({input:e,showDecimals:t}):"-",h=e}}else if(p.data){f=bn({input:p.data,showDecimals:o}),x=f;const e=new i(r).minus(p.data);g=e.gt(0)?bn({input:e,showDecimals:t}):"-",h=e}}let A=[];return e&&(s?t?A.push({amount:g||"0",symbol:e.baseToken.symbol}):A.push({amount:y||"0",symbol:e.quoteToken.symbol}):(A.push({amount:g||"0",symbol:e.baseToken.symbol}),A.push({amount:y||"0",symbol:e.quoteToken.symbol}))),{withdrawFee:x,baseWithdrawFee:m,quoteWithdrawFee:f,receiveBaseAmount:g,receiveQuoteAmount:y,receiveAmountBg:h,receiveList:A,loading:v,error:b}};function eE({token:e,pool:t,sx:n,value:r,onChange:i,selectedValue:o,lpBalance:a,balanceMax:s,balanceInfo:l,loading:d}){var c;const u=null==t?void 0:t.chainId;return Os.jsxs(f,{sx:n,children:[Os.jsxs(f,{sx:{typography:"h5",display:"flex",alignItems:"center",justifyContent:"space-between",fontWeight:600},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[e?Os.jsx(J,{checked:r===o,onChange:()=>i(r),sx:{mr:16}}):"",Os.jsx(f,{sx:{display:"flex",alignItems:"center"},children:e?Os.jsx(Os.Fragment,{children:Os.jsx(ey,{address:e.address,width:24,height:24,chainId:e.chainId||u,url:e.logoURI,noShowChain:!0})}):t&&Os.jsx(Cj,{tokens:[t.baseToken,t.quoteToken],chainId:(null===(c=t.baseToken)||void 0===c?void 0:c.chainId)||u,width:24,height:24})})]}),Os.jsxs(f,{sx:{textAlign:"right"},children:[e?`${e.symbol} LP `:t&&`${t.baseToken.symbol}\n ${t.quoteToken.symbol}\n LP `,d?Os.jsx(f,{component:x,sx:{ml:4,position:"relative",top:3}}):a&&bn({input:a})||""]})]}),Os.jsx(f,{sx:{typography:"body2",mt:5,color:"text.secondary",textAlign:"right"},children:e?Os.jsxs(Os.Fragment,{children:[d?Os.jsx(f,{component:x,sx:{ml:4,position:"relative",top:3}}):`≈ ${s&&bn({input:s})||""}`,` ${e.symbol}`]}):t&&l&&l.userBaseLpToTokenBalance&&l.userQuoteLpToTokenBalance?Os.jsxs(Os.Fragment,{children:[d?Os.jsx(f,{component:x,sx:{position:"relative",top:4}}):bn({input:l.userBaseLpToTokenBalance}),` ${null==t?void 0:t.baseToken.symbol} + `,d?Os.jsx(f,{component:x,sx:{position:"relative",top:4}}):bn({input:l.userQuoteLpToTokenBalance}),` ${null==t?void 0:t.quoteToken.symbol}`]}):""})]})}function tE({pool:e,checkTokenType:t,setCheckToken:n,balanceInfo:r,baseTokenBalanceUpdateLoading:i,quoteBalanceUpdateLoading:o}){if(!e)return null;const a=le.utils.singleSideLp(e.type);return Os.jsx(Os.Fragment,{children:a?Os.jsxs(Os.Fragment,{children:[Os.jsx(eE,{token:e.baseToken,selectedValue:t,onChange:n,value:WT.base,lpBalance:r&&r.userBaseLpBalance,balanceMax:r&&r.userBaseLpToTokenBalance,loading:i}),Os.jsx(eE,{selectedValue:t,onChange:n,sx:{mt:13},token:e.quoteToken,value:WT.quote,lpBalance:r&&r.userQuoteLpBalance,balanceMax:r&&r.userQuoteLpToTokenBalance,loading:o})]}):Os.jsx(eE,{pool:e,value:t,onChange:n,lpBalance:r&&r.userBaseLpBalance,balanceInfo:r,loading:i||o})})}function nE({submittedBack:t,onlyShowSide:o,pool:a,balanceInfo:s}){var l,d,c,u,p,h,m,g,y,x,v;const{account:b}=At(),A=s.userBaseLpToTokenBalance,w=s.userQuoteLpToTokenBalance,k=s.loading,{slipper:C,setSlipper:j,slipperValue:E,resetSlipper:S}=Ew({address:null==a?void 0:a.address}),{isBase:I,checkToken:R,checkTokenType:L,setCheckToken:M}=_T(a),{baseAmount:O,quoteAmount:B,handleChangeBaseAmount:P,handleChangeQuoteAmount:N,addPortion:F,midPrice:W,amountLoading:V,amountCheckedDisabled:U,uniV2Pair:H,reset:q}=bT({pool:a,maxBaseAmount:A,maxQuoteAmount:w}),[Z,z]=at.useState(""),[Q,G]=at.useState("");at.useEffect((()=>{const e=setTimeout((()=>{z(O)}),80);return()=>clearTimeout(e)}),[O]),at.useEffect((()=>{const e=setTimeout((()=>{G(B)}),80);return()=>clearTimeout(e)}),[B]);const Y=e=>{P(e)},X=e=>{N(e)},J="AMMV2"===(null==a?void 0:a.type),_=(null==a?void 0:a.chainId)?ue[a.chainId]:void 0,$=null===(l=null==_?void 0:_.address)||void 0===l?void 0:l.toLowerCase(),ee=null===(d=null==_?void 0:_.wrappedTokenAddress)||void 0===d?void 0:d.toLowerCase(),te=!!a&&[$,ee].includes(a.baseToken.address.toLowerCase()),ne=!!a&&[$,ee].includes(a.quoteToken.address.toLowerCase()),re=J&&a&&(te||ne),[ie,oe]=at.useState(!1),ae=re&&te&&!ie&&_?a?Object.assign(Object.assign({},a.baseToken),{symbol:_.symbol,address:_.address}):void 0:null==a?void 0:a.baseToken,se=re&&ne&&!ie&&_?a?Object.assign(Object.assign({},a.quoteToken),{symbol:_.symbol,address:_.address}):void 0:null==a?void 0:a.quoteToken,de=$T({pool:a?Object.assign(Object.assign({},a),{baseToken:ae,quoteToken:se}):a,isBase:I,baseAmount:Z,quoteAmount:Q}),{mode:ce,modeOptions:pe,handleChangeMode:he,sliderPercentage:fe,handleChangeSliderPercentage:ge,resetPercentage:ye}=function({isBase:e,pool:t,baseOverride:n,quoteOverride:i,resetAmount:o,handleChangeBaseAmount:a,handleChangeQuoteAmount:s}){const[l,d]=at.useState(Rw.percentage),[c,u]=at.useState(Iw),p=at.useRef(null),h=()=>{p.current&&clearTimeout(p.current)},m=()=>{h(),u(Iw)};return at.useEffect((()=>h),[]),{mode:l,modeOptions:[{key:Rw.quantity,value:r._({id:"PIYEqF",message:"Quantity model"})},{key:Rw.percentage,value:r._({id:"x4QVeW",message:"Percentage to remove"})}],handleChangeMode:e=>{d(e),o(),m()},sliderPercentage:c,handleChangeSliderPercentage:r=>{if(h(),r!==c&&u(r),!t)return;const o=100===r,l=()=>{if(t)if(e||void 0===e){if(n){let e=n.toString();o||(e=kn(n.times(r/100),t.baseToken.decimals)),a(e)}}else if(i){let e=i.toString();o||(e=kn(i.times(r/100),t.quoteToken.decimals)),s(e)}};o?l():p.current=setTimeout(l,100)},resetPercentage:m}}({isBase:I,pool:a,baseOverride:A,quoteOverride:w,resetAmount:q,handleChangeBaseAmount:Y,handleChangeQuoteAmount:X});at.useEffect((()=>{q(),ye()}),[L]);const xe=zw(a);at.useEffect((()=>{(null==a?void 0:a.address)!==(null==xe?void 0:xe.address)&&(q(),S(),he(Rw.percentage),ge(Iw))}),[a]),at.useEffect((()=>{ce===Rw.percentage&&ge(fe)}),[null==A?void 0:A.toString(),null==w?void 0:w.toString()]);const ve=le.utils.canOperateLiquidity(null==a?void 0:a.type,void 0,null==a?void 0:a.creator,b),[be,Ae]=at.useState(!1),{isShowCompare:we,lqAndDodoCompareText:ke,isWarnCompare:je}=TT(null==a?void 0:a.baseToken,null==a?void 0:a.quoteToken,W),Te=It(es.getFeeRateQuery(null==a?void 0:a.chainId,null==a?void 0:a.address,null==a?void 0:a.type,b)),Ee=null===(m=null===(u=null===(c=Te.data)||void 0===c?void 0:c.mtFeeRate)||void 0===u?void 0:u.plus(null!==(h=null===(p=Te.data)||void 0===p?void 0:p.lpFeeRate)&&void 0!==h?h:0))||void 0===m?void 0:m.toNumber(),{baseTokenStatus:Se,quoteTokenStatus:Re}=function({pool:e,baseAmount:t,quoteAmount:n,balanceInfo:r}){var o,a,s,l,d;const{chainId:c,baseToken:u,quoteToken:p}=null!=e?e:{};let h="";const m="AMMV2"===(null==e?void 0:e.type);c&&(h=null!==(o=me[c].DODO_V1_PAIR_PROXY)&&void 0!==o?o:"",m&&(h=Ce(c)||Ie(e.chainId)));const f=null!==(s=null===(a=null==e?void 0:e.baseLpToken)||void 0===a?void 0:a.id)&&void 0!==s?s:"",g=null!==(d=null===(l=null==e?void 0:e.quoteLpToken)||void 0===l?void 0:l.id)&&void 0!==d?d:"",y="CLASSICAL"===(null==e?void 0:e.type);return{baseTokenStatus:EA(u?Object.assign(Object.assign({},u),{symbol:y?u.symbol+" LP":`${u.symbol}/${null==p?void 0:p.symbol} LP`,address:f}):void 0,{amount:m&&r.userBaseLpToTokenBalance&&r.userBaseLpBalance?new i(t).div(r.userBaseLpToTokenBalance).times(r.userBaseLpBalance).toString():t,skipQuery:!h||!f||!y&&!m,contractAddress:h,overrideBalance:m?r.userBaseLpBalance:r.userBaseLpToTokenBalance}),quoteTokenStatus:EA(p?Object.assign(Object.assign({},p),{address:g}):void 0,{amount:n,skipQuery:!h||!g||!y,contractAddress:h,overrideBalance:r.userQuoteLpToTokenBalance})}}({pool:a,baseAmount:O,quoteAmount:B,balanceInfo:s}),Le=Se.insufficientBalance||Re.insufficientBalance,{isSinglePool:Me}=s,Oe=!a||Le||!W||!!s.loading||!!s.error||U||!!de.error||de.loading||!!(null===(g=de.receiveAmountBg)||void 0===g?void 0:g.lte(0))||Te.isLoading,Fe=Le?r._({id:"znqB4T",message:"Insufficient balance"}):r._({id:"t/YqKh",message:"Remove"}),We=()=>{q(),S(),t&&t()},Ve=null===(y=null==H?void 0:H.pair)||void 0===y?void 0:y.liquidityToken.decimals,Ue=null===(x=s.userBaseLpBalance)||void 0===x?void 0:x.times(fe/100),He=Ue&&void 0!==Ve?jn(Ue,Ve).toString():"",{operateLiquidityMutation:qe}=BT(a),Ze=function({baseToken:e,quoteToken:t,baseAmount:o,quoteAmount:a,liquidityAmount:s,slippage:l,fee:d,submittedBack:c}){const u=Hy(),{account:p}=hf();n();const{deadLine:h}=pf();return Ot({mutationFn:()=>Fn(this,void 0,void 0,(function*(){if(!e||!t)throw new Error("token is undefined");if(!p)throw new Error("account is undefined");if(!d)throw new Error("fee is undefined");const n=e.chainId,m=ue[n].address.toLowerCase(),f=Ce(n),g=Ie(n),y=!f,x=f||g;if(!x)throw new Error("AMMV2 contract address is not valid.");let v="";const b=e.address.toLowerCase()===m,A=t.address.toLowerCase()===m,w=jn(new i(o).times(1-l),e.decimals),k=jn(new i(a).times(1-l),t.decimals),C=jn(d,4).toString(),j=Math.ceil(Date.now()/1e3)+(null!=h?h:600);try{if(b){const e=t.address,n=k.toString(),r=w.toString();v=y?Be(e,s,n,r,p,j):Pe(e,C,s,n,r,p,j)}else if(A){const t=e.address,n=w.toString(),r=k.toString();v=y?Be(t,s,n,r,p,j):Pe(t,C,s,n,r,p,j)}else v=y?De(e.address,t.address,s,w.toString(),k.toString(),p,j):Ne(e.address,t.address,C,s,w.toString(),k.toString(),p,j)}catch(e){throw console.error("encodeUniswapV2Router02RemoveLiquidity error",e),e}return yield u.execute(r._({id:"cJtosk",message:"Remove liquidity"}),{opcode:By.TX,to:x,data:v,value:"0x0"},{metadata:{[Ey.removeLiqidityAMMV2Position]:!0},submittedBack:c})}))})}({baseToken:ae,quoteToken:se,baseAmount:O,quoteAmount:B,liquidityAmount:He,slippage:E,fee:Ee,submittedBack:We}),ze=()=>{if(J)return Ze.mutate();qe.mutate({txTitle:r._({id:"3XBvkd",message:"Remove Liquidity"}),isRemove:!0,baseAmount:O,quoteAmount:B,slippageProtection:E,balanceInfo:s,SLIPPAGE_PROTECTION:Tw,submittedBack:We})};return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{pb:18,px:20},children:[!J&&Os.jsxs(f,{sx:{mt:20,borderStyle:"solid",borderWidth:1,borderRadius:12},children:[Os.jsx(K,{value:ce,options:pe,onChange:(e,t)=>he(t),popupOffset:0,sx:{px:20,py:12,width:"100%",backgroundColor:"transparent",color:"text.primary"}}),!!a&&le.utils.singleSideLp(a.type)&&Os.jsx(f,{sx:{pt:20,pb:13,px:20,borderStyle:"solid",borderWidth:"1px 0 0"},children:Os.jsx(tE,{pool:a,balanceInfo:s,checkTokenType:L,setCheckToken:M,baseTokenBalanceUpdateLoading:!1,quoteBalanceUpdateLoading:!1})})]}),Os.jsx(f,{sx:{pt:20},children:ce===Rw.percentage?Os.jsx(bw,{disabled:s.loading||!ve,value:fe,onChange:ge}):R?Os.jsx(Qy,{amt:I?O:B,token:R,canClickBalance:!0,showPercentage:!0,onInputChange:I?Y:X,readOnly:s.loading||!ve,overrideBalance:I?A:w,overrideBalanceLoading:k}):Os.jsxs(Os.Fragment,{children:[Os.jsx(Qy,{amt:O,token:null==a?void 0:a.baseToken,canClickBalance:!0,showPercentage:!0,onInputChange:Y,readOnly:s.loading||!ve,overrideBalance:A,overrideBalanceLoading:k}),o?"":Os.jsx(Zy,{}),"base"===o?"":Os.jsx(Qy,{amt:B,token:null==a?void 0:a.quoteToken,canClickBalance:!0,showPercentage:!0,onInputChange:X,readOnly:s.loading||!ve||Me,overrideBalance:w,overrideBalanceLoading:k})]})}),Os.jsxs(D,{loading:s.loading||V,sx:{mt:8},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"flex-end",gap:8},children:[J&&re&&Os.jsx(f,{sx:{px:12,py:4,borderRadius:20,borderWidth:1,backgroundColor:"transparent",color:"primary.main",cursor:"pointer",typography:"body2","&:hover":{backgroundColor:"hover.default"}},component:"button",onClick:()=>oe((e=>!e)),children:Os.jsx(e,{id:"/k7Ttv",message:"Receive {0}",values:{0:ie?null==_?void 0:_.symbol:null==_?void 0:_.wrappedTokenSymbol}})}),Os.jsx(Sw,{value:C,onChange:j,disabled:!ve,type:null==a?void 0:a.type,sx:{margin:0}})]}),Os.jsx(AT,{pool:a,addPortion:F,midPrice:W,shareOfPool:null==H?void 0:H.shareOfPool})]}),!!a&&Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",mt:20,mb:14},children:[Os.jsx(f,{sx:{typography:"body2",color:"text.secondary",position:"relative",top:2},children:Os.jsx(e,{id:"lDgVWA",message:"Receive"})}),Os.jsx(f,{sx:{textAlign:"right"},children:de.receiveList.map(((e,t)=>Os.jsxs(f,{sx:{mt:t>0?4:0},children:[Os.jsxs(D,{component:"span",loading:de.loading,loadingSx:{mr:8,width:100},sx:{display:"inline-block",typography:"h5",fontWeight:600,color:de.receiveBaseAmount&&"0"!==de.receiveBaseAmount?"primary.main":"text.primary"},children:[e.amount," "]}),Os.jsx(f,{component:"span",sx:{typography:"body2"},children:e.symbol})]},e.symbol)))})]})]}),Os.jsxs(f,{sx:{px:20,py:16,position:"sticky",bottom:0,borderStyle:"solid",borderWidth:"1px 0 0",borderColor:"border.main",backgroundColor:"background.paper"},children:[we&&Os.jsx(wT,{baseToken:null==a?void 0:a.baseToken,quoteToken:null==a?void 0:a.quoteToken,lqAndDodoCompareText:ke,midPrice:W}),a?Os.jsx(CT,{chainId:a.chainId,baseTokenStatus:Se,quoteTokenStatus:Re,children:Os.jsx(T,{fullWidth:!0,disabled:Oe,danger:je,isLoading:qe.isPending||Ze.isPending,onClick:()=>{Oe||(je?Ae(!0):ze())},children:Fe})}):Os.jsx(T,{fullWidth:!0,disabled:!0,children:Fe})]}),Os.jsx(ET,{open:be,onClose:()=>Ae(!1),title:r._({id:"bEsfUQ",message:"Confirm submission"}),onConfirm:ze,modal:!0,children:Os.jsxs(f,{children:[Os.jsx(f,{children:r._({id:"JaeUyE",message:"Price discrepancy {lqAndDodoCompareText} between liquidity pool and the quote price on DODO.",values:{lqAndDodoCompareText:ke}})}),Os.jsx(f,{children:r._({id:"vXvgFK",message:"There is risk of being arbitraged if adding this liquidity."})})]})}),Os.jsx(FA,{message:null===(v=qe.error)||void 0===v?void 0:v.message,onClose:()=>qe.reset()})]})}function rE({pool:e,operate:t,hidePoolInfo:r,errorRefetch:i,submittedBack:o}){var a,s,l,d,c,u;const{operateTab:p,operateTabs:h,handleChangeTab:m}=function(e=FT.Add){const{i18n:t}=n(),[r,i]=at.useState(e),o=at.useMemo((()=>[{key:FT.Add,value:t._({id:"m16xKo",message:"Add"})},{key:FT.Remove,value:t._({id:"t/YqKh",message:"Remove"})}]),[t._]);return at.useEffect((()=>{i(e)}),[e]),{operateTab:r,operateTabs:o,handleChangeTab:e=>{i(e)}}}(t),{account:f}=At(),g=xT({account:f,pool:e?{chainId:e.chainId,address:e.address,type:e.type,baseTokenDecimals:e.baseToken.decimals,quoteTokenDecimals:e.quoteToken.decimals,baseLpTokenDecimals:null!==(s=null===(a=e.baseLpToken)||void 0===a?void 0:a.decimals)&&void 0!==s?s:18,quoteLpTokenDecimals:null!==(d=null===(l=e.quoteLpToken)||void 0===l?void 0:l.decimals)&&void 0!==d?d:18}:void 0}),y=It(es.getPMMStateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(c=null==e?void 0:e.baseToken)||void 0===c?void 0:c.decimals,null===(u=null==e?void 0:e.quoteToken)||void 0===u?void 0:u.decimals));return g.error||y.error||i?Os.jsx(mT,{refresh:()=>{g.error&&g.refetch(),y.error&&y.refetch(),i&&i()},sx:{my:40,height:"100%"}}):Os.jsxs(Os.Fragment,{children:[Os.jsx(KT,{pool:e,balanceInfo:g,hidePoolInfo:r}),Os.jsxs(H,{value:p,onChange:(e,t)=>{m(t)},children:[Os.jsx(G,{tabs:h,variant:"inPaper",tabsListSx:{mt:16,mx:20}}),Os.jsx(z,{value:FT.Add,children:Os.jsx(XT,{pool:e,balanceInfo:g,submittedBack:o})}),Os.jsx(z,{value:FT.Remove,children:Os.jsx(nE,{pool:e,balanceInfo:g,submittedBack:o})})]})]})}const iE=new ge({contractRequests:Ka});function oE({chainId:e,address:t,showName:n,size:r,offset:i,rightContent:o}){const a=Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:i},children:[Os.jsx(ey,{chainId:e,address:t,width:r,height:r,noShowChain:!0,marginRight:0}),n]});return o?Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a,o]}):a}function aE({miningItem:e}){var t,n;const{account:r}=At(),o=null!==(t=null==e?void 0:e.rewardTokenInfos)&&void 0!==t?t:[],a=[],s=[];if(e){const t=e.version,i=null!==(n=e.miningContractAddress)&&void 0!==n?n:"";o.forEach((n=>{var o,l,d,c,u,p,h,m,f;const g={address:null!==(o=null==n?void 0:n.address)&&void 0!==o?o:"",decimals:null==n?void 0:n.decimals,symbol:null!==(l=null==n?void 0:n.symbol)&&void 0!==l?l:"",usdPrice:null!==(d=null==n?void 0:n.price)&&void 0!==d?d:""};if("3"===t)a.push(g),s.push(iE.getPendingRewardQuery(e.chainId,i,r,g.address,g.decimals,t));else switch(e.type){case"classical":a.push(g),s.push(iE.getPendingRewardQuery(e.chainId,i,r,null!==(u=null===(c=e.baseLpToken)||void 0===c?void 0:c.address)&&void 0!==u?u:"",g.decimals,"2")),a.push(g),s.push(iE.getPendingRewardQuery(e.chainId,i,r,null!==(h=null===(p=e.quoteLpToken)||void 0===p?void 0:p.address)&&void 0!==h?h:"",g.decimals,"2"));break;case"vdodo":case"single":a.push(g),s.push(iE.getPendingRewardQuery(e.chainId,i,r,null!==(f=null===(m=e.baseToken)||void 0===m?void 0:m.address)&&void 0!==f?f:"",g.decimals,"2"));break;default:throw new Error(`type: ${e.type} is not valid.`)}}))}return St({queries:s,combine:e=>{let t=new i(0),n=new i(0);return{data:e.map(((e,r)=>{const i=a[r],o=e.data;if(o){t=o.plus(t);const e=null==i?void 0:i.usdPrice;e&&(n=n.plus(o.times(e)))}return Object.assign(Object.assign({},i),{amount:o})})),pending:e.some((e=>e.isPending)),error:e.some((e=>e.isError)),totalReward:t,totalRewardUSD:n,refetch:()=>{e.forEach((e=>e.refetch()))}}}})}function sE({value:e,label:t,tokenList:n,loading:r}){const i=g();return Os.jsxs(f,{sx:{flexGrow:0,flexShrink:1,width:"30%"},children:[Os.jsx(f,{sx:{typography:"h6",color:i.palette.text.secondary},children:t}),Os.jsxs(f,{sx:{mt:8,typography:"body1",fontWeight:600,color:i.palette.text.primary,display:"flex",alignItems:"center",gap:4},children:[Os.jsx(D,{loading:r,loadingProps:{width:30},children:e?`$${An({input:e,decimals:2})}`:"-"}),Os.jsx(A,{placement:"top",title:Os.jsx(f,{sx:{display:"flex",flexDirection:"column",gap:8,width:190,color:"text.primary",fontWeight:600},children:n.map((e=>{var t;return Os.jsx(oE,{chainId:e.chainId,address:e.address,showName:null!==(t=e.symbolEle)&&void 0!==t?t:e.symbol,rightContent:e.amount,size:20,offset:6},e.address+e.chainId)}))}),children:Os.jsx(f,{component:y,sx:{display:"flex",alignItems:"center",color:i.palette.text.secondary,width:16,height:16,"&:hover":{color:"text.primary"}},children:Os.jsx(As.DetailBorder,{})})})]})]})}function lE({chainId:t,loading:n,miningItem:i,miningContractAddress:o,stakedTokenUSD:a,stakedTokenUSDLoading:s,miningTitle:l,associatedMineSectionShort:d,stakedTokenList:c,isEnded:u}){var p,h;const m=g(),y=aE({miningItem:i});return Os.jsxs(f,{sx:{backgroundColor:m.palette.background.paper,borderRadius:8,borderColor:m.palette.border.main,borderStyle:"solid",borderWidth:1,mb:20},children:[d?null:Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{py:12,px:20,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(D,{loading:n,loadingProps:{width:100},children:Os.jsx(Cj,{width:24,tokens:c,gap:-6,chainId:t,mr:4,showChainLogo:!1})}),Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4},children:[Os.jsx(f,{sx:{color:m.palette.text.primary,typography:"body2",fontWeight:600,display:"flex",alignItems:"center"},children:null!=l?l:"-"}),u&&Os.jsx(f,{sx:{backgroundColor:m.palette.border.disabled,borderRadius:4,typography:"h6",fontWeight:500,px:8,color:m.palette.text.disabled},children:Os.jsx(e,{id:"237hSL",message:"Ended"})})]}),Os.jsx(ZT,{size:"small",truncate:!0,address:null!=o?o:"",iconSpace:4,sx:{color:m.palette.text.secondary,typography:"h6"},customChainId:t})]})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",color:m.palette.text.secondary,typography:"h6",cursor:"pointer"},onClick:()=>{fw.getState().push({type:pw.MiningDetail,params:{address:o,chainId:t}})},children:[Os.jsx(e,{id:"URmyfc",message:"Details"}),Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:Os.jsx("path",{d:"M7.5 4.5L6.4425 5.5575L9.8775 9L6.4425 12.4425L7.5 13.5L12 9L7.5 4.5Z",fill:"currentColor"})})]})]}),Os.jsx(f,{sx:{width:"100%",height:"1px",backgroundColor:m.palette.border.main}})]}),Os.jsxs(f,{sx:{py:12,px:20,display:"flex",alignItems:"center",gap:20},children:[Os.jsx(sE,{value:a,label:r._({id:"luOvdJ",message:"My Staked"}),tokenList:c,loading:n||s}),Os.jsx(f,{sx:{width:"1px",height:30,backgroundColor:m.palette.border.main,flexGrow:0,flexShrink:0}}),Os.jsx(sE,{value:y.totalRewardUSD,label:r._({id:"4cJ0hF",message:"Rewards"}),tokenList:null!==(h=null===(p=y.data)||void 0===p?void 0:p.map((e=>Object.assign(Object.assign({chainId:t},e),{name:e.symbol,amount:An({input:e.amount,decimals:e.decimals})}))))&&void 0!==h?h:[],loading:y.pending||n})]})]})}const dE=({miningItem:e,successBack:t})=>{const{account:n}=hf(),i=Hy();return Ot({mutationFn:()=>Fn(void 0,void 0,void 0,(function*(){const o=yield Fn(void 0,void 0,void 0,(function*(){if(!n||!(null==e?void 0:e.miningContractAddress))return null;let t="";const r=yield ge.encode.claimAllMining(e.miningContractAddress);if(r&&r.data)return r.value=0,r;throw t="invalid data",new Error(t)}));if(!o)return;return yield i.execute(r._({id:"hom7qf",message:"Claim"}),Object.assign({opcode:By.TX},o),{metadata:{[Ey.claimMining]:"1"},successBack:t})}))})};function cE({miningItem:t}){const n=aE({miningItem:t}),r=dE({miningItem:t,successBack:()=>{n.refetch()}});return Os.jsx(sb,{includeButton:!0,fullWidth:!0,chainId:null==t?void 0:t.chainId,children:Os.jsx(T,{fullWidth:!0,isLoading:r.isPending,disabled:n.totalReward.isZero(),onClick:()=>{r.mutate()},children:r.isPending?Os.jsx(e,{id:"KvG1xW",message:"Claiming"}):Os.jsx(e,{id:"dUdltF",message:"One-Click Claim"})})})}function uE({tokenSymbol:e,goLpLink:t}){const n=g();return Os.jsxs(X,{sx:{color:n.palette.text.secondary,typography:"h6",display:"flex",alignItems:"center"},component:y,onClick:t,children:[r._({id:"dJqd5x",message:"Get {tokenSymbol}",values:{tokenSymbol:e}}),Os.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{d:"M5.83324 3.88867L5.01074 4.71117L7.68241 7.38867L5.01074 10.0662L5.83324 10.8887L9.33324 7.38867L5.83324 3.88867Z",fill:"currentColor"})})]})}function pE({miningItem:t,loading:n,sx:r}){const o=g(),a=aE({miningItem:t});return Os.jsxs(f,{sx:Object.assign({borderWidth:1,borderRadius:12},r),children:[Os.jsxs(f,{sx:{typography:"body1",color:o.palette.text.secondary,display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:12},children:[Os.jsx(e,{id:"4cJ0hF",message:"Rewards"}),":",Os.jsx(D,{loading:n||a.pending,loadingProps:{width:100},sx:{color:o.palette.text.primary,fontWeight:600},children:a.pending||a.error?"-":`$${An({input:a.totalRewardUSD,decimals:2})}`})]}),Os.jsxs(f,{sx:{borderTopWidth:1,px:20,pt:4,pb:8},children:[(n||a.pending)&&Os.jsx(D,{loading:n,loadingProps:{width:150}}),!n&&!a.pending&&!!t&&a.data.map((e=>Os.jsxs(f,{sx:{mt:16,display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[e.address&&e.symbol&&Os.jsx(oE,{chainId:t.chainId,address:e.address,showName:e.symbol,size:24,offset:6}),Os.jsxs(f,{sx:{ml:"auto"},children:[Os.jsx(f,{sx:{typography:"h5",textAlign:"right"},children:An({input:e.amount,decimals:e.decimals})}),Os.jsx(f,{sx:{mt:2,typography:"body2",color:o.palette.text.secondary,textAlign:"right"},children:e.usdPrice&&e.amount?`≈ $${An({input:new i(e.amount).multipliedBy(e.usdPrice).dp(4,i.ROUND_DOWN),decimals:4})}`:"-"})]})]},e.address)))]})]})}const hE=({miningItem:e,amount:t,submittedBack:n,successBack:o,logBalance:a})=>{const{chainId:s,account:l}=hf(),d=Hy(),c=ue[s];return Ot({mutationFn:()=>Fn(void 0,void 0,void 0,(function*(){const s=yield Fn(void 0,void 0,void 0,(function*(){var n,r;if(!(l&&e&&e.baseToken&&e.miningContractAddress))return null;let o="";const a=new i(t),s=Number(e.baseToken.decimals),d=yield ge.encode.depositMining(e.miningContractAddress,a,s);if(!d||!d.data)throw o="invalid data",new Error(o);try{return t&&(null===(r=null===(n=e.baseLpToken)||void 0===n?void 0:n.address)||void 0===r?void 0:r.toLocaleLowerCase())===c.address.toLocaleLowerCase()?d.value=IT(a):d.value=0,d}catch(e){throw console.error("2.0 sendTransaction error",e),o=`2.0 sendTransaction error; ERROR: ${e}`,new Error(o)}}));if(!s)return;return yield d.execute(r._({id:"JYKRJS",message:"Stake"}),Object.assign({opcode:By.TX},s),{metadata:{[Ey.stakeMining]:"1",logBalance:a},submittedBack:n,successBack:o})}))})};function mE({goLpLink:t,amount:n,miningItem:i,balanceInfo:o,submittedBack:a,successBack:s,logBalance:l}){var d,c,u,p;const h=hE({miningItem:i,amount:n,submittedBack:a,successBack:s,logBalance:l}),m=i?`${null===(d=i.baseToken)||void 0===d?void 0:d.symbol}-${null===(c=i.quoteToken)||void 0===c?void 0:c.symbol} LP`:"",f=EA(i?bs(Object.assign(Object.assign({},i.baseLpToken),{symbol:m}),i.chainId):null,{contractAddress:null!==(u=null==i?void 0:i.miningContractAddress)&&void 0!==u?u:"",overrideBalance:o.userBaseLpBalance,amount:n});return t&&m&&(null===(p=o.userBaseLpBalance)||void 0===p?void 0:p.isZero())?Os.jsx(T,{fullWidth:!0,onClick:()=>t(),children:r._({id:"dJqd5x",message:"Get {tokenSymbol}",values:{tokenSymbol:m}})}):Os.jsx(sb,{includeButton:!0,fullWidth:!0,chainId:null==i?void 0:i.chainId,children:Os.jsx(kT,{status:f,children:Os.jsx(T,{fullWidth:!0,isLoading:h.isPending,disabled:!Number(n),onClick:()=>{h.mutate()},children:h.isPending?Os.jsx(e,{id:"KsqhWn",message:"Staking"}):Os.jsx(e,{id:"JYKRJS",message:"Stake"})})})})}const fE=({miningItem:e,amount:t,submittedBack:n,successBack:o,logBalance:a})=>{const{account:s}=hf(),l=Hy();return Ot({mutationFn:()=>Fn(void 0,void 0,void 0,(function*(){const d=yield Fn(void 0,void 0,void 0,(function*(){if(!(s&&e&&e.baseToken&&e.miningContractAddress))return null;let n="";const r=new i(t),o=Number(e.baseToken.decimals),a=yield ge.encode.withdrawMining(e.miningContractAddress,r,o);if(a&&a.data)return a.value=0,a;throw n="invalid data",new Error(n)}));if(!d)return;return yield l.execute(r._({id:"OFjZGo",message:"Unstake"}),Object.assign({opcode:By.TX},d),{metadata:{[Ey.unstakeMining]:"1",logBalance:a},submittedBack:n,successBack:o})}))})};function gE({amount:t,miningItem:n,overrideBalance:r,submittedBack:i,successBack:o,logBalance:a}){var s,l;const d=fE({miningItem:n,amount:t,submittedBack:i,successBack:o,logBalance:a}),c=n?`${null===(s=n.baseToken)||void 0===s?void 0:s.symbol}-${null===(l=n.quoteToken)||void 0===l?void 0:l.symbol} LP`:"",u=EA(n?bs(Object.assign(Object.assign({},n.baseLpToken),{symbol:c}),n.chainId):null,{overrideBalance:r,amount:t,skipQuery:!0});return Os.jsx(sb,{includeButton:!0,fullWidth:!0,chainId:null==n?void 0:n.chainId,children:Os.jsx(kT,{status:u,children:Os.jsx(T,{fullWidth:!0,isLoading:d.isPending,disabled:!Number(t),onClick:()=>{d.mutate()},children:d.isPending?Os.jsx(e,{id:"1gWStS",message:"Unstaking"}):Os.jsx(e,{id:"OFjZGo",message:"Unstake"})})})})}function yE(e){var{sx:t}=e,n=Nn(e,["sx"]);const r=g();return Os.jsx(f,{sx:Object.assign({paddingTop:20,backgroundColor:r.palette.background.paper,position:"sticky",bottom:0},t),...n})}function xE({chainId:e,poolAddress:t,status:n,loading:o,operateType:a,setOperateType:s,miningItem:l,associatedMineSectionVisible:d,goLpLink:c}){var u,p,h,m,y,x,v,b,A,w,k,C,j,T,E,S,I;const R=g(),{account:L}=At(),{miningContractAddress:M}=null!=l?l:{},O=bs(null==l?void 0:l.baseToken,e),B=bs(null==l?void 0:l.quoteToken,e),[P,D]=at.useState(""),[N,F]=at.useState(""),W=[{key:"stake",value:r._({id:"JYKRJS",message:"Stake"})},{key:"unstake",value:r._({id:"OFjZGo",message:"Unstake"})},{key:"claim",value:r._({id:"hom7qf",message:"Claim"})}],V=l&&O&&B&&["classical","lptoken"].includes(null!==(u=l.type)&&void 0!==u?u:"")?{chainId:e,address:t,type:"lptoken"===l.type?"DSP":"CLASSICAL",baseToken:O,quoteToken:B}:void 0,U=xT({account:L,pool:l&&O&&B&&l.baseLpToken&&l.quoteLpToken&&["classical","lptoken"].includes(null!==(p=l.type)&&void 0!==p?p:"")?{chainId:e,address:t,type:"lptoken"===l.type?"DSP":"CLASSICAL",baseTokenDecimals:O.decimals,quoteTokenDecimals:B.decimals,baseLpTokenDecimals:null!==(h=l.baseLpToken.decimals)&&void 0!==h?h:18,quoteLpTokenDecimals:null!==(m=l.quoteLpToken.decimals)&&void 0!==m?m:18}:void 0}),q=It(es.getPMMStateQuery(null==V?void 0:V.chainId,null==V?void 0:V.address,null==V?void 0:V.type,null===(y=null==V?void 0:V.baseToken)||void 0===y?void 0:y.decimals,null===(x=null==V?void 0:V.quoteToken)||void 0===x?void 0:x.decimals)),Z=It(iE.getLpStakedBalance(null==l?void 0:l.chainId,(null==l?void 0:l.miningContractAddress)||void 0,L,null!==(b=null===(v=null==l?void 0:l.baseLpToken)||void 0===v?void 0:v.address)&&void 0!==b?b:"",null===(A=null==l?void 0:l.baseToken)||void 0===A?void 0:A.decimals,null==l?void 0:l.version)),Q=Z.isLoading||q.isLoading;let Y,X,J;if(Z.data&&U.baseLpToTokenProportion&&U.quoteLpToTokenProportion&&!q.isLoading){const e=null===(w=null==l?void 0:l.baseToken)||void 0===w?void 0:w.price,t=null===(k=null==l?void 0:l.quoteToken)||void 0===k?void 0:k.price,n=null===(C=q.data)||void 0===C?void 0:C.midPrice;X=Z.data.times(U.baseLpToTokenProportion),J=Z.data.times(U.quoteLpToTokenProportion),n?t?Y=X.times(n).plus(J).times(t):e&&(Y=J.times(n).plus(X).times(e)):e&&t&&(Y=X.times(e).plus(J.times(t)))}const K=O&&B?[Object.assign(Object.assign({},O),{amount:An({input:X,decimals:O.decimals})}),Object.assign(Object.assign({},B),{amount:An({input:J,decimals:B.decimals})})]:[],_=O&&B?`${O.symbol}-${B.symbol} LP`:"- LP",$=n===ye.ended,ee=(null===(j=null==l?void 0:l.baseLpToken)||void 0===j?void 0:j.address)&&U.userBaseLpBalance?{[null===(T=null==l?void 0:l.baseLpToken)||void 0===T?void 0:T.address]:U.userBaseLpBalance.toString()}:{},te=()=>{U.refetch(),q.refetch(),Z.refetch()};return Os.jsx(Os.Fragment,{children:Os.jsxs(f,{sx:{paddingTop:20,borderTopLeftRadius:16,borderTopRightRadius:16,backgroundColor:R.palette.background.paper,px:20,paddingBottom:0,borderBottomLeftRadius:0,borderBottomRightRadius:0},children:[d&&Os.jsx(lE,{chainId:e,miningContractAddress:null!=M?M:"",loading:o,miningItem:l,stakedTokenUSD:Y,stakedTokenUSDLoading:Q,miningTitle:null!==(E=null==l?void 0:l.title)&&void 0!==E?E:"",stakedTokenList:K}),Os.jsxs(H,{value:a,onChange:(e,t)=>{s(t)},children:[Os.jsx(G,{tabs:W,variant:"inPaper",tabsListSx:{mt:16}}),Os.jsxs(z,{value:"stake",children:[Os.jsxs(f,{sx:{mt:20,borderColor:R.palette.border.main,borderWidth:1,borderStyle:"solid",borderRadius:12,display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:16},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(Cj,{width:K.length>1?20:28,tokens:K,chainId:e}),Os.jsx(f,{sx:{ml:8,typography:"body1",color:R.palette.text.primary,fontWeight:600},children:_})]}),!!c&&Os.jsx(uE,{tokenSymbol:_,goLpLink:c})]}),Os.jsx(Qy,{showPercentage:!0,hideToken:!0,inputTypography:"h1",balanceText:r._({id:"RxHSET",message:"LP Balance:"}),overrideBalance:U.userBaseLpBalance||new i("-"),overrideBalanceLoading:U.loading,amt:P,canClickBalance:!0,onInputChange:e=>{D(e)},readOnly:$||o,token:O,checkLogBalance:ee,occupiedChainId:e,chainId:e,sx:{mt:20,borderWidth:1}}),Os.jsx(yE,{children:Os.jsx(mE,{miningItem:l,balanceInfo:U,amount:P,goLpLink:c,submittedBack:()=>D(""),successBack:te,logBalance:ee})})]}),Os.jsxs(z,{value:"unstake",children:[Os.jsx(Qy,{showPercentage:!0,hideToken:!0,inputTypography:"h1",balanceText:r._({id:"RxHSET",message:"LP Balance:"}),overrideBalance:Z.data||new i("-"),overrideBalanceLoading:Z.isLoading,amt:$?null!==(I=null===(S=Z.data)||void 0===S?void 0:S.toString())&&void 0!==I?I:"":N,onInputChange:e=>{F(e)},canClickBalance:!0,readOnly:$||o,token:O,checkLogBalance:ee,occupiedChainId:e,chainId:e,sx:{mt:20,borderWidth:1}}),Os.jsx(yE,{children:Os.jsx(gE,{miningItem:l,overrideBalance:Z.data,amount:N,submittedBack:()=>F(""),successBack:te,logBalance:ee})})]}),Os.jsxs(z,{value:"claim",children:[Os.jsx(pE,{miningItem:l,loading:o,sx:{mt:20}}),Os.jsx(yE,{children:Os.jsx(cE,{miningItem:l})})]})]})]})})}function vE({chainId:e,account:t,poolAddress:n,goLpLink:r}){var i,o,a;const s=QA().getQuery(ge.graphql.fetchMiningList,{where:{chainIds:[e],user:t,filterState:{address:n}}}),l=It(Object.assign(Object.assign({},s),{enabled:!!n})),d=null===(a=null===(o=null===(i=l.data)||void 0===i?void 0:i.mining_list)||void 0===o?void 0:o.list)||void 0===a?void 0:a[0],{status:c}=function({miningItem:e}){var t,n;let r=ye.active,i=[];if(null==e?void 0:e.rewardTokenInfos)if("classical"!==e.type){const o=ge.utils.getMiningStatusByTimestamp({startTime:null!==(t=e.startTime)&&void 0!==t?t:"",endTime:null!==(n=e.endTime)&&void 0!==n?n:"",rewardTokenInfoList:e.rewardTokenInfos.map((e=>{var t,n;return{startTime:null!==(t=null==e?void 0:e.startTime)&&void 0!==t?t:"",endTime:null!==(n=null==e?void 0:e.endTime)&&void 0!==n?n:""}}))});r=o.status,i.push(o)}else if(e.rewardQuoteTokenInfos){i=[e.rewardTokenInfos,e.rewardQuoteTokenInfos].map((t=>{var n,r;return ge.utils.getMiningStatusByTimestamp({startTime:null!==(n=e.startTime)&&void 0!==n?n:"",endTime:null!==(r=e.endTime)&&void 0!==r?r:"",rewardTokenInfoList:t.map((e=>{var t,n;return{startTime:null!==(t=null==e?void 0:e.startTime)&&void 0!==t?t:"",endTime:null!==(n=null==e?void 0:e.endTime)&&void 0!==n?n:""}}))})}));const[{status:t},{status:n}]=i;ye.active,(t===ye.upcoming&&n===ye.upcoming||t===ye.upcoming&&n===ye.ended||t===ye.ended&&n===ye.upcoming)&&ye.upcoming,t===ye.ended&&n===ye.ended&&ye.ended}return{status:r,miningStatusList:i}}({miningItem:d}),[u,p]=at.useState(c===ye.ended?"unstake":"stake");return Os.jsx(xE,{chainId:e,loading:l.isLoading||l.isPending,operateType:u,setOperateType:p,associatedMineSectionVisible:!0,miningItem:d,status:c,goLpLink:r,poolAddress:n})}const bE=()=>{const t=g();return Os.jsx(A,{placement:"top-end",leaveDelay:100,title:Os.jsx(f,{sx:{maxWidth:240,color:t.palette.warning.main,typography:"h6",fontWeight:500,"&>a":{textDecoration:"underline",color:t.palette.warning.main},"&>a:hover":{color:C(t.palette.warning.main,.5)}},children:Os.jsx(e,{id:"QtgfjM",message:"The creator of the liquidity pool can adjust the liquidity distribution by modifying the market-making price parameters. <0>Learn more</0>",components:{0:Os.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://docs.dodoex.io/en/product/pmm-algorithm"})}})}),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:2,py:4,px:8,borderRadius:8,backgroundColor:C(t.palette.warning.main,.1),color:t.palette.warning.main,typography:"h6",fontWeight:500,lineHeight:"16px",cursor:"help"},children:[Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:Os.jsx("path",{d:"M8.00008 10.6666C8.18897 10.6666 8.3473 10.6027 8.47508 10.4749C8.60286 10.3471 8.66675 10.1888 8.66675 9.99992C8.66675 9.81103 8.60286 9.6527 8.47508 9.52492C8.3473 9.39714 8.18897 9.33325 8.00008 9.33325C7.81119 9.33325 7.65286 9.39714 7.52508 9.52492C7.3973 9.6527 7.33341 9.81103 7.33341 9.99992C7.33341 10.1888 7.3973 10.3471 7.52508 10.4749C7.65286 10.6027 7.81119 10.6666 8.00008 10.6666ZM7.33341 7.99992H8.66675V4.66659H7.33341V7.99992ZM8.00008 14.6666C6.45564 14.2777 5.18064 13.3916 4.17508 12.0083C3.16953 10.6249 2.66675 9.08881 2.66675 7.39992V3.33325L8.00008 1.33325L13.3334 3.33325V7.39992C13.3334 9.08881 12.8306 10.6249 11.8251 12.0083C10.8195 13.3916 9.54453 14.2777 8.00008 14.6666ZM8.00008 13.2666C9.15564 12.8999 10.1112 12.1666 10.8667 11.0666C11.6223 9.96659 12.0001 8.74436 12.0001 7.39992V4.24992L8.00008 2.74992L4.00008 4.24992V7.39992C4.00008 8.74436 4.37786 9.96659 5.13341 11.0666C5.88897 12.1666 6.84453 12.8999 8.00008 13.2666Z",fill:"currentColor"})}),Os.jsx(e,{id:"iDGO1l",message:"Disclaimer"})]})})};function AE({onClose:e,pool:t,address:i,operate:o,chainId:a,hasMining:s,hidePoolInfo:l,sx:d}){var c,u,p,h,m,g,y,x,v;const{account:b}=At(),A=a?Gr[a]:"",w=QA(),k=It(Object.assign(Object.assign({},w.getQuery(le.graphql.fetchPoolList,{where:{id:null!==(c=null==i?void 0:i.toLocaleLowerCase())&&void 0!==c?c:"",chain:A}})),{enabled:!!i&&!!a})),j=null===(p=null===(u=k.data)||void 0===u?void 0:u.pairs)||void 0===p?void 0:p[0],T=j&&a?function(e,t){var n,r,i,o,a,s;if(e)return{address:e.id,chainId:t,baseToken:ns(e.baseToken,t),quoteToken:ns(e.quoteToken,t),type:e.type,creator:e.creator,baseLpToken:{id:null===(n=e.baseLpToken)||void 0===n?void 0:n.id,decimals:Number(null!==(i=null===(r=e.baseLpToken)||void 0===r?void 0:r.decimals)&&void 0!==i?i:18)},quoteLpToken:{id:null===(o=e.quoteLpToken)||void 0===o?void 0:o.id,decimals:Number(null!==(s=null===(a=e.quoteLpToken)||void 0===a?void 0:a.decimals)&&void 0!==s?s:18)}}}(j,a):void 0,E=i&&a?T:t,S=k.error?k.refetch:void 0,{poolOrMiningTab:I,poolOrMiningTabs:R,handleChangeTab:L}=function({hasMining:e}){const{i18n:t}=n(),[r,i]=at.useState(dT.Liquidity);return{poolOrMiningTab:r,poolOrMiningTabs:at.useMemo((()=>{const n=[{key:dT.Liquidity,value:t._({id:"6y2TB3",message:"Liquidity"})},{key:dT.Mining,value:t._({id:"Sti4vy",message:"Mining"})}];return e?n:n.slice(0,1)}),[t._,e]),handleChangeTab:e=>{i(e)}}}({hasMining:s}),M=xT({account:b,pool:E?{chainId:E.chainId,address:E.address,type:E.type,baseTokenDecimals:E.baseToken.decimals,quoteTokenDecimals:E.quoteToken.decimals,baseLpTokenDecimals:null!==(m=null===(h=E.baseLpToken)||void 0===h?void 0:h.decimals)&&void 0!==m?m:18,quoteLpTokenDecimals:null!==(y=null===(g=E.quoteLpToken)||void 0===g?void 0:g.decimals)&&void 0!==y?y:18}:void 0}),O=!!(null===(x=M.userBaseLpBalance)||void 0===x?void 0:x.gt(0))||!!(null===(v=M.userQuoteLpBalance)||void 0===v?void 0:v.gt(0)),B=null!=a?a:null==E?void 0:E.chainId,P=null!=i?i:null==E?void 0:E.address;return Os.jsx(f,{sx:d,children:Os.jsxs(H,{value:I,onChange:(e,t)=>{L(t)},sx:{display:"flex",flexDirection:"column",overflow:"hidden",height:"100%"},children:[Os.jsx(_,{tabs:R,tabsListSx:Object.assign({mx:20,justifyContent:e?"space-between":"flex-start"},s&&O?{"& button:last-child":{position:"relative","&::before":{content:`"${r._({id:"TY5fM3",message:"LP Tokens"})}"`,position:"absolute",top:16,right:20,px:8,py:2,borderRadius:12,transform:"scale(0.66667) translateX(100%)",transformOrigin:"right top",backgroundColor:C("#DABB1B",.2),color:"#DABB1B"}}}:{}),rightSlot:Os.jsxs(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",gap:12},children:["GSP"===(null==E?void 0:E.type)&&Os.jsx(bE,{}),e?Os.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,borderRadius:"50%",borderWidth:1,color:"text.secondary",cursor:"pointer"},children:Os.jsx(f,{component:As.Error,sx:{width:16,height:16},onClick:()=>{e()}})}):void 0]})}),Os.jsx(z,{value:dT.Liquidity,sx:{flex:1,overflowY:"auto"},children:Os.jsx(rE,{pool:E,operate:o,hidePoolInfo:l,errorRefetch:S,submittedBack:()=>{s&&L(dT.Mining)}})}),Os.jsx(z,{value:dT.Mining,sx:{flex:1,overflowY:"auto"},children:B&&P?Os.jsx(vE,{chainId:B,account:b,poolAddress:P,goLpLink:()=>{L(dT.Liquidity)}}):""})]})})}function wE(e){var{modal:t}=e,n=Nn(e,["modal"]);const{isMobile:r}=wy();return Os.jsx(yy,{open:!!n.pool||!!n.address,onClose:n.onClose,scope:!r,modal:t,id:"pool-operate",children:Os.jsx(AE,{...n})})}function kE({chainId:t,baseToken:n,quoteToken:r,apy:o,hasQuote:a,hasMining:s,sx:l,children:d}){if(!n)return null;const c=a?[{token:n,transactionApy:null==o?void 0:o.transactionBaseApy,miningApy:null==o?void 0:o.miningBaseApy},{token:r,transactionApy:null==o?void 0:o.transactionQuoteApy,miningApy:null==o?void 0:o.miningQuoteApy}]:[{transactionApy:null==o?void 0:o.transactionBaseApy,miningApy:null==o?void 0:o.miningBaseApy,metromMiningApy:null==o?void 0:o.metromMiningApy}];return Os.jsx(A,{children:null!=d?d:Os.jsx(I,{component:As.QuestionBorder,sx:Object.assign({width:15,height:15},l)}),title:Os.jsx(f,{sx:{width:236},children:c.map(((o,a)=>{var l,d,c,u,p;return Os.jsxs(f,{sx:{mt:0===a?0:20},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body2",fontWeight:600,color:"text.primary"},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center"},children:o.token?Os.jsxs(Os.Fragment,{children:[Os.jsx(ey,{width:14,height:14,marginRight:4,address:o.token.address,url:o.token.logoURI,chainId:t,noShowChain:!0}),o.token.symbol]}):Os.jsxs(Os.Fragment,{children:[Os.jsx(Cj,{tokens:[n,r],width:14,mr:4,chainId:t}),n.symbol,"/",null==r?void 0:r.symbol]})}),Os.jsx(f,{children:Pn(new i(null!==(c=o.transactionApy)&&void 0!==c?c:0).plus(null!==(u=o.miningApy)&&void 0!==u?u:0).plus(null!==(p=o.metromMiningApy)&&void 0!==p?p:0))})]}),Os.jsxs(f,{sx:{mt:8,display:"flex",justifyContent:"space-between",typography:"h6",color:"text.secondary"},children:[Os.jsx("span",{children:Os.jsx(e,{id:"OnDEky",message:"LP Fee"})}),Os.jsx("span",{children:o.transactionApy?Pn(new i(o.transactionApy)):"-"})]}),s?Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",typography:"h6",color:"text.secondary"},children:[Os.jsx("span",{children:Os.jsx(e,{id:"pSQ1lM",message:"MT Fee"})}),Os.jsx("span",{children:o.miningApy?Pn(new i(o.miningApy)):"-"})]}):"",o.metromMiningApy&&Number(o.metromMiningApy)>0&&Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",typography:"h6",color:"text.secondary"},children:[Os.jsx("span",{children:Os.jsx(e,{id:"Sti4vy",message:"Mining"})}),Os.jsx("span",{children:o.metromMiningApy?Pn(new i(o.metromMiningApy)):"-"})]})]},null!==(d=null===(l=o.token)||void 0===l?void 0:l.address)&&void 0!==d?d:1)}))})})}function CE({children:e,sx:t,gap:n=20,repeatBaseForLargeScreen:r=3}){const{isMobile:i,minDevice:o}=wy();let a={};if(i)a={display:"flex",flexDirection:"column",gap:n};else{let e=2;[1418,1761,2104].some(((t,n)=>{if(o(t))return e=r+n,!0})),a={display:"grid",gap:n,gridTemplateColumns:`repeat(${e}, 1fr)`}}return Os.jsx(f,{sx:Object.assign(Object.assign({},a),t),children:e})}function jE({sx:t}){const{supportAMMV2:n,supportAMMV3:r}=pf(),i=n||r;return Os.jsxs(f,{sx:Object.assign({px:20,pt:20,pb:12,backgroundColor:"background.paper",borderRadius:16},t),children:[Os.jsx(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[Os.jsx(Cj,{width:24,tokens:[],mr:6,showChainLogo:!0}),Os.jsx(w,{variant:"rounded",height:20,width:88})]})}),Os.jsxs(f,{sx:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",rowGap:20,mt:44,"& > div:nth-child(odd)":{pr:20},"& > div:nth-child(even)":{position:"relative",pl:20,"&::before":{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",display:"inline-block",content:'""',height:24,width:"1px",backgroundColor:"border.main"}}},children:[i&&Os.jsxs(f,{children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",gap:4,whiteSpace:"nowrap"},children:Os.jsx(w,{variant:"rounded",height:24,width:100})}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"1Qz63U",message:"Pool Type"})})]}),Os.jsxs(f,{children:[Os.jsx(w,{variant:"rounded",height:24,width:100}),Os.jsx(f,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:Os.jsx(e,{id:"rSayea",message:"APY"})})]}),Os.jsxs(f,{children:[Os.jsx(w,{variant:"rounded",height:24,width:100}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"FHKsZF",message:"TVL"})})]}),i&&Os.jsxs(f,{children:[Os.jsx(w,{variant:"rounded",height:24,width:100}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"Q8W3SC",message:"Volume (1D)"})})]})]}),Os.jsx(w,{variant:"rounded",height:32,sx:{mt:20}})]})}function TE(e){var t;const[n,r]=at.useState(null!==(t=null==e?void 0:e.tokens)&&void 0!==t?t:[]),[i,o]=at.useState([]);at.useEffect((()=>{e&&(r(e.tokens),o(e.lqList))}),[e]);const[a,s]=at.useMemo((()=>{const[e,t]=n;return[null==e?void 0:e.symbol,null==t?void 0:t.symbol]}),[n]);return{filterTokens:n,filterASymbol:a,filterBSymbol:s,filterAddressLqList:i,handleDeleteToken:t=>{r((n=>{const r=[...n],i=r.indexOf(t);return-1!==i&&r.splice(i,1),e&&e.onChangeFilterTokens(r),r}))},handleChangeFilterTokens:t=>{o([]),r(t),e&&(e.onChangeFilterTokens(t),e.onChangeFilterAddressLqList([]))},handleChangeFilterAddress:t=>{o(t),r([]),e&&(e.onChangeFilterTokens([]),e.onChangeFilterAddressLqList(t))}}}var EE,SE;function IE(){return IE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IE.apply(null,arguments)}const RE=e=>ot.createElement("svg",IE({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),EE||(EE=ot.createElement("circle",{cx:16,cy:16,r:16,fill:"#FFE804"})),SE||(SE=ot.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 12.25H12.25V8.5H8.5V12.25ZM14.125 23.5H17.875V19.75H14.125V23.5ZM12.25 23.5H8.5V19.75H12.25V23.5ZM8.5 17.875H12.25V14.125H8.5V17.875ZM17.875 17.875H14.125V14.125H17.875V17.875ZM19.75 8.5V12.25H23.5V8.5H19.75ZM17.875 12.25H14.125V8.5H17.875V12.25ZM19.75 17.875H23.5V14.125H19.75V17.875ZM23.5 23.5H19.75V19.75H23.5V23.5Z",fill:"#1A1A1B"}))),LE="_default";function ME({value:e,onChange:t,placeholder:n,options:r,sx:i,readOnly:o,valueOnlyIcon:a}){const s=g();return Os.jsx(K,{value:null!=e?e:LE,onChange:(n,r)=>{const i="number"==typeof e&&r?Number(r):r;t(i===LE?void 0:i)},disabled:o,sx:u({padding:s.spacing(8,12),"& .MuiSelect-select.MuiSelect-select.MuiSelect-select":{display:"flex",alignItems:"center",gap:8,padding:s.spacing(8,12,8,12),minHeight:"auto",backgroundColor:"transparent",color:"text.primary",borderRadius:8,typography:"body2",fontWeight:600,borderStyle:"solid",borderWidth:1,borderColor:"divider","& svg, & img":{width:24,height:24},'&:hover, &[aria-expanded="true"]':{backgroundColor:"background.paper"},"&.Mui-readOnly":{color:"text.disabled"}},"& .MuiSelect-icon":{color:o?"text.disabled":"text.primary"},"& .MuiOutlinedInput-notchedOutline":{display:"none"}},i),renderValue:t=>{if(!(null==t?void 0:t.value)||t.value===LE)return Os.jsx(f,{sx:{color:"text.secondary"},children:null!=n?n:""});const i=r.find((t=>t.key===e));return i?Os.jsxs(Os.Fragment,{children:[i.logo,a?"":i.value]}):null},options:[...r]})}function OE({isMobileStyle:e,chain:t,isLastItem:n,logoWidth:r,mobileLogoWidth:i,sx:o}){const a=g();return e?Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",py:18,borderTop:`1px solid ${a.palette.border.main}`,borderBottom:n?`1px solid ${a.palette.border.main}`:"none"},o),children:[Os.jsx(f,{component:null==t?void 0:t.logo,sx:{width:i,height:i}}),Os.jsx(f,{component:"span",className:"name",sx:{marginLeft:8},children:null==t?void 0:t.name})]}):Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(f,{component:null==t?void 0:t.logo,sx:{width:r,height:r}}),Os.jsx(f,{component:"span",className:"name",sx:{marginLeft:8},children:null==t?void 0:t.name})]})}const BE=-1;function PE({chainId:t,setChainId:r,logoWidth:i=24,mobileLogoWidth:o=32,mainLogoWidth:a=24,mainMobileLogoWidth:s=18,notShowAllChain:l,valueOnlyIcon:d,sx:c}){const u=function(){const{chainId:e}=At(),t=lt((()=>{const t=new Map;let n;return _g.forEach(((r,i)=>{if(r.mainnet){if(e!==r.chainId)return;n=r.mainnet}t.set(i,Object.assign({},r))})),void 0!==n&&t.delete(n),Array.from(t.values())}),[e]);return t}(),[p,h]=at.useState(!1),{isMobile:m}=wy(),{i18n:g}=n(),x=at.useCallback((()=>{const e=void 0===t?u[0]:u.find((e=>e.chainId===t));if(d){if(void 0===t||!e)return"";const n=m?o:a;return Os.jsx(f,{component:null==e?void 0:e.logo,sx:{width:n,height:n}})}return void 0!==t||l?e?Os.jsx(OE,{isMobileStyle:m,chain:e,logoWidth:a,mobileLogoWidth:s}):null:Os.jsx(OE,{isMobileStyle:m,chain:{chainId:BE,logo:RE,name:g._({id:"pY/ok7",message:"All chains"})},logoWidth:a,mobileLogoWidth:s,sx:{border:"none"}})}),[t,u,l,d,m,g._]),v=at.useMemo((()=>{const e=[];return l||e.push({key:BE,value:Os.jsx(OE,{isMobileStyle:m,chain:{chainId:BE,logo:RE,name:g._({id:"pY/ok7",message:"All chains"})},logoWidth:i,mobileLogoWidth:o})}),u.forEach(((t,n)=>{e.push({key:t.chainId,value:Os.jsx(OE,{isLastItem:n===u.length-1,isMobileStyle:m,chain:t,logoWidth:i,mobileLogoWidth:o})})})),e}),[m,i,o,u,l]);return m?Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{component:y,onClick:()=>h(!0),sx:Object.assign({display:"flex",alignItems:"center",backgroundColor:"background.tag",color:"text.primary",borderRadius:8,border:"none",px:8,height:32,fontWeight:600,typography:"body2"},c),children:[Os.jsx(f,{sx:{pr:5},children:x()}),Os.jsx(f,{component:As.CaretUp,sx:{width:12,height:12,transform:"rotate(180deg)"}})]}),Os.jsx(yy,{open:p,title:Os.jsx(e,{id:"lJvbHq",message:"Select Network"}),onClose:()=>h(!1),id:"select-chain",modal:!0,children:Os.jsx(f,{sx:{mb:20},children:v.map((e=>Os.jsxs(f,{onClick:()=>{const t=e.key;r(t===BE?void 0:Number(t)),h(!1)},sx:{position:"relative",px:20,"&:active":{backgroundColor:"hover.default"},"&:hover":{backgroundColor:"hover.default"},cursor:"pointer"},children:[e.value,(t?e.key===t:e.key===BE)&&Os.jsx(f,{sx:{position:"absolute",left:0,top:24,height:20,width:2,backgroundColor:"text.primary"}})]},e.key)))})})]}):Os.jsx(ME,{value:null!=t?t:BE,onChange:e=>{v.some((t=>String(t.key)===String(e)))&&r(e===BE?void 0:e)},placeholder:g._({id:"lJvbHq",message:"Select Network"}),options:v,valueOnlyIcon:d,sx:Object.assign({px:8,height:32,fontWeight:600,typography:"body2",backgroundColor:"background.tag",color:"text.primary"},c)})}function DE({list:t,onClick:n}){return Os.jsx(Os.Fragment,{children:null==t?void 0:t.map((t=>{var r,o,a,s;if(!(null==t?void 0:t.pair))return null;const l=t.pair,d=ns(l.baseToken,l.chainId),c=ns(l.quoteToken,l.chainId),u=l.apy?Pn(new i(null===(r=l.apy)||void 0===r?void 0:r.transactionBaseApy).plus(null!==(a=null===(o=l.apy)||void 0===o?void 0:o.miningBaseApy)&&void 0!==a?a:0)):void 0,p=le.utils.singleSideLp(l.type)&&l.apy?Pn(new i(l.apy.transactionQuoteApy).plus(null!==(s=l.apy.miningQuoteApy)&&void 0!==s?s:0)):void 0;return d&&c?Os.jsxs(f,{onClick:n,sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:10,py:20,borderRadius:8,cursor:"pointer","&:hover":{backgroundColor:"custom.background.listHover"}},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(Cj,{tokens:[d,c],chainId:l.chainId,width:24,mr:10}),Os.jsxs(f,{sx:{typography:"h5"},children:[d.symbol,"/",c.symbol]})]}),Os.jsxs(f,{children:[Os.jsxs(f,{sx:{color:"custom.status.green.default",fontWeight:600},children:[u,p?`/${p}`:""]}),Os.jsx(f,{sx:{mt:2,typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"rSayea",message:"APY"})})]})]},l.id):null}))})}function NE({lqList:e,onDeleteTag:t,sx:n}){var r;if(!(null==e?void 0:e.length))return null;if(!(null===(r=e[0])||void 0===r?void 0:r.pair))return null;const{pair:i}=e[0],o=ns(i.baseToken,i.chainId),a=ns(i.quoteToken,i.chainId);return o&&a?Os.jsxs(f,{sx:Object.assign({typography:"body2",display:"inline-flex",alignItems:"center",px:8,mr:8,borderRadius:8,fontWeight:600,height:32,backgroundColor:"hover.default"},n),children:[Os.jsx(Cj,{tokens:[o,a],chainId:o.chainId,width:20,mr:8}),o.symbol,"+",a.symbol,Os.jsx(f,{component:As.Error,sx:{ml:4,width:16,height:16,cursor:"pointer",color:"text.secondary",position:"relative",top:1.5},onClick:()=>t()})]}):null}function FE({tags:e,onDeleteTag:t,sx:n}){return e.length?Os.jsx(f,{sx:Object.assign({display:"inline-flex",alignItems:"center"},n),children:e.map((e=>Os.jsxs(f,{sx:{typography:"body2",display:"flex",alignItems:"center",px:8,mr:8,borderRadius:8,fontWeight:600,height:32,backgroundColor:"hover.default"},children:[Os.jsx(ey,{address:e.address,width:20,height:20,chainId:e.chainId,url:e.logoURI,noShowChain:!0,marginRight:8}),e.symbol,Os.jsx(f,{component:As.Error,sx:{ml:4,width:16,height:16,cursor:"pointer",color:"text.secondary",position:"relative",top:1.5},onClick:()=>t(e)})]},e.address)))}):null}function WE({text:e,onClick:t}){const n=g();return Os.jsxs(f,{sx:{typography:"body2",display:"inline-flex",alignItems:"center",p:n.spacing(0,4,0,8),width:"max-content",height:32,backgroundColor:"hover.default",borderWidth:1,borderRadius:8,cursor:"pointer"},onClick:t,children:[e,Os.jsx(f,{component:As.ArrowBack,sx:{ml:2,width:16,height:16,transform:"rotate(180deg)"}})]})}function VE(t){var{sx:n,children:r,empty:i,loading:o,hasMore:a,loadMore:s,loadMoreLoading:l}=t,d=Nn(t,["sx","children","empty","loading","hasMore","loadMore","loadMoreLoading"]);const c=g();return Os.jsxs(f,{sx:Object.assign({position:"relative",flex:1,overflowY:"auto"},n),...d,children:[Os.jsx(f,{component:"table",sx:Object.assign({width:"100%",borderCollapse:"collapse","& th":{p:24,typography:"body1",textAlign:"left",color:"text.secondary"},"& td":{px:24,py:20},"& thead":{position:"sticky",top:0,zIndex:2,backgroundColor:"background.paper"}},!i&&!o&&{"& th:last-child, & td:last-child":{position:"sticky",right:0,zIndex:1,backgroundColor:"background.paper","&::before":{content:'""',position:"absolute",top:0,bottom:0,left:1,width:"1px",boxShadow:`${"dark"===c.palette.mode?"#1A1A1B":C("#1A1A1B",.1)} -2px 0px 4px 0px`}}}),children:r}),a&&Os.jsx(y,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:64,width:"100%",borderStyle:"solid",borderColor:"border.main",borderWidth:c.spacing(1,0,0,0),typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},onClick:s,children:l?Os.jsx(x,{}):Os.jsxs(Os.Fragment,{children:[Os.jsx(e,{id:"yQ2kGp",message:"Load more"}),Os.jsx(f,{component:As.ArrowRight,sx:{transform:"rotate(90deg)"}})]})})]})}const UE=e=>Object.keys(new Array(e+1).join(","));function HE(e){return null!=e&&""!==e}function qE({token:e,size:t="small",sx:n,children:i}){const[o,a]=ct(!1),{provider:s,chainId:l}=At(),d=cx(e.chainId);return Os.jsxs(f,{sx:u({margin:"0",border:"none",padding:"0",background:"none",cursor:"pointer","&:focus":{outline:"none"},"&:active":{outline:"none"}},n),onClick:t=>Fn(this,void 0,void 0,(function*(){if(t.stopPropagation(),void 0!==e.chainId&&e.chainId!==l&&d){if(!(yield d()))return}if(o)return;a(!0);const{result:n,failMsg:i}=yield function(e,t){return Fn(this,void 0,void 0,(function*(){if(!e)return{result:!1};try{return{result:yield e.send("wallet_watchAsset",{type:"ERC20",options:{address:t.address,symbol:t.symbol,decimals:t.decimals,image:t.logoURI}})}}catch(e){return console.error(e),{result:!1,failMsg:null==e?void 0:e.message}}}))}(s,e);n?mv.getState().toast({message:r._({id:"DupCvC",message:"Added successful"}),type:"success",timeout:3e3}):mv.getState().toast({message:`${r._({id:"v4wgrk",message:"Failed to add"})}${i?`: ${i}`:""}`,type:"error"}),a(!1)})),component:"button",children:[Os.jsx(f,{component:ef,sx:Object.assign({},"medium"===t?{width:16,height:16}:{width:14,height:14})}),i]})}var ZE;function zE(){return zE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zE.apply(null,arguments)}const QE=e=>ot.createElement("svg",zE({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ZE||(ZE=ot.createElement("path",{d:"M5.6036 4.12761C5.50037 4.20906 5.3708 4.24967 5.23958 4.24169C5.10836 4.23372 4.98466 4.17773 4.89203 4.08438C4.7994 3.99103 4.74433 3.86685 4.7373 3.73549C4.73026 3.60413 4.77177 3.47477 4.8539 3.37205L5.96239 2.25211C6.46737 1.76405 7.14372 1.494 7.84575 1.5001C8.54779 1.50621 9.21934 1.78798 9.71577 2.28474C10.2122 2.78151 10.4938 3.4535 10.4999 4.156C10.506 4.85851 10.2361 5.5353 9.74839 6.04062L8.60241 7.16592C8.55441 7.22201 8.49533 7.26757 8.4289 7.29974C8.36246 7.3319 8.29009 7.34997 8.21635 7.35282C8.1426 7.35567 8.06906 7.34324 8.00034 7.3163C7.93162 7.28936 7.86921 7.2485 7.81702 7.19627C7.76483 7.14405 7.724 7.0816 7.69707 7.01284C7.67015 6.94407 7.65772 6.87048 7.66057 6.79668C7.66342 6.72289 7.68148 6.65047 7.71363 6.58399C7.74577 6.51751 7.7913 6.4584 7.84736 6.41036L8.97191 5.28506C9.25568 4.98032 9.41017 4.57725 9.40283 4.16078C9.39549 3.74431 9.22689 3.34695 8.93255 3.05242C8.63821 2.75788 8.24111 2.58917 7.82491 2.58182C7.40872 2.57447 7.00592 2.72906 6.70138 3.01302L5.6036 4.12761ZM6.34259 7.93755C6.38819 7.87582 6.44652 7.82461 6.51361 7.7874C6.58071 7.75018 6.65501 7.72783 6.73149 7.72185C6.80798 7.71586 6.88485 7.7264 6.95691 7.75273C7.02897 7.77906 7.09453 7.82058 7.14917 7.87447C7.2038 7.92836 7.24622 7.99337 7.27356 8.06509C7.3009 8.13682 7.31252 8.21358 7.30764 8.29019C7.30275 8.3668 7.28148 8.44147 7.24525 8.50913C7.20902 8.5768 7.15869 8.63589 7.09765 8.68239L5.96774 9.81305C5.45894 10.2708 4.7943 10.5163 4.11029 10.4992C3.42627 10.482 2.77479 10.2034 2.2896 9.72061C1.80441 9.23784 1.52232 8.58752 1.50127 7.90316C1.48021 7.2188 1.72179 6.55234 2.17638 6.04062L3.30629 4.93139C3.3504 4.86735 3.4079 4.81369 3.47482 4.77413C3.54174 4.73456 3.61646 4.71005 3.69379 4.70229C3.77113 4.69453 3.84922 4.70371 3.92266 4.72919C3.99609 4.75466 4.0631 4.79583 4.11904 4.84983C4.17497 4.90384 4.21849 4.96937 4.24657 5.0419C4.27464 5.11442 4.28661 5.19219 4.28163 5.2698C4.27665 5.34742 4.25484 5.42302 4.21773 5.49135C4.18062 5.55969 4.12908 5.61912 4.06671 5.66552L2.93144 6.79618C2.64767 7.10092 2.49318 7.50398 2.50052 7.92045C2.50786 8.33692 2.67647 8.73428 2.97081 9.02882C3.26515 9.32335 3.66224 9.49207 4.07844 9.49942C4.49463 9.50676 4.89743 9.35217 5.20197 9.06821L6.34259 7.93755ZM5.00919 7.76072C4.96119 7.81681 4.90211 7.86237 4.83567 7.89454C4.76924 7.9267 4.69687 7.94477 4.62312 7.94763C4.54937 7.95048 4.47583 7.93804 4.40711 7.9111C4.33839 7.88416 4.27598 7.8433 4.2238 7.79108C4.17161 7.73885 4.13077 7.6764 4.10385 7.60764C4.07693 7.53887 4.0645 7.46528 4.06735 7.39149C4.0702 7.31769 4.08826 7.24528 4.1204 7.17879C4.15255 7.11231 4.19808 7.0532 4.25413 7.00516L6.90487 4.35267C7.00731 4.26488 7.13909 4.21901 7.27386 4.22422C7.40863 4.22943 7.53648 4.28533 7.63185 4.38077C7.72722 4.4762 7.78309 4.60413 7.7883 4.73899C7.7935 4.87385 7.74766 5.00572 7.65993 5.10823L5.00919 7.76072Z",fill:"currentColor"})));function GE({loading:e,empty:t,hasSearch:n,children:r,refetch:i}){return e?Os.jsx(f,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",gap:24,px:24,height:320},children:UE(4).map(((e,t)=>Os.jsx(w,{width:"100%",height:45},t)))}):i?Os.jsx(mT,{refresh:i,sx:{height:320}}):t?Os.jsx(sT,{hasSearch:n,sx:{height:320}}):Os.jsx(Os.Fragment,{children:r})}function YE({show:e,onClick:t}){const n=g();return Os.jsx(f,{component:y,sx:{padding:n.spacing(4,8),transform:e?"rotate(180deg)":"none",transition:"all 100ms"},onClick:t,children:Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.58398 11.376C8.78189 11.6728 9.21811 11.6728 9.41603 11.376L12.4818 6.77735C12.7033 6.44507 12.4651 6 12.0657 6H5.93426C5.53491 6 5.29672 6.44507 5.51823 6.77735L8.58398 11.376Z",fill:"currentColor"})})})}function XE({isMobile:e,statusText:t,statusColor:n,time:r,alphaColor:i,sx:o}){const a=g(),s=C(n,.1),l=i?C(n,i):n;return Os.jsxs(f,{sx:Object.assign({display:"flex",flexDirection:"column",alignItems:e?"center":"flex-start",gap:2,typography:"h6",color:"text.secondary"},o),children:[Os.jsx(f,{sx:{padding:a.spacing(4,8),borderRadius:4,backgroundColor:s,color:l,textAlign:"center"},children:t}),r]})}function JE({chainId:e}){const t=_g.get(e);return t?Os.jsx(f,{sx:{display:"flex",alignItems:"center",gap:8,px:8,py:4,borderRadius:4,backgroundColor:"background.paperDarkContrast",typography:"h6"},children:Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{component:t.logo,sx:{width:16,height:16}}),t.name]})}):null}function KE({token:e,amount:t,showChain:n,hideLogo:r,canAddMetamask:i,sx:o}){var a,s;let l="";n&&(l=null!==(s=null===(a=_g.get(e.chainId))||void 0===a?void 0:a.name)&&void 0!==s?s:"");const d=An({input:t,decimals:e.decimals});return Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",gap:4},o),children:[!r&&Os.jsx(ey,{address:e.address,chainId:e.chainId,width:20,height:20}),Os.jsxs(f,{sx:{fontWeight:600},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,wordBreak:"break-word"},children:[`${d} ${e.symbol}`,i&&Os.jsx(qE,{token:e})]}),!!l&&Os.jsxs(f,{sx:{display:"inline-flex",alignItems:"center",gap:2,typography:"h6",fontWeight:500,color:"text.secondary"},children:[l,Os.jsx(QE,{})]})]})]})}function _E({address:t,chainId:n,hideName:r,sx:i}){const o=g(),a=QA(),{onlyChainId:s}=pf(),l=It(Object.assign({},a.getQuery(xe.graphql.fetchLiquidityLpPartnerRewards,{where:{chainId:s||void 0}})));if(!t)return null;const d=[];return("string"==typeof t?[t]:Array.from(new Set(t)).filter((e=>!!e))).forEach((e=>{var t,r,i;e&&(null===(i=null===(r=null===(t=l.data)||void 0===t?void 0:t.liquidity_getLpPartnerRewards)||void 0===r?void 0:r.partnerRewards)||void 0===i||i.some((t=>{var r,i,o,a,s,c,u,p,h,m,f,g,y,x;if((null==t?void 0:t.chainId)===n&&(null===(r=null==t?void 0:t.pool)||void 0===r?void 0:r.toLocaleLowerCase())===e.toLocaleLowerCase()){const e=null===(a=null===(o=null===(i=l.data)||void 0===i?void 0:i.liquidity_getLpPartnerRewards)||void 0===o?void 0:o.partnerInfos)||void 0===a?void 0:a.find((e=>(null==e?void 0:e.partner)===t.partner));if(!e)return;d.push({partner:{name:null!==(s=null==e?void 0:e.partner)&&void 0!==s?s:"",logo:null!==(c=null==e?void 0:e.logo)&&void 0!==c?c:"",introduction:null!==(u=null==e?void 0:e.introduction)&&void 0!==u?u:"",link:null!==(p=null==e?void 0:e.link)&&void 0!==p?p:"",extra:null!==(h=null==e?void 0:e.extra)&&void 0!==h?h:{},background:(null===(m=null==e?void 0:e.theme)||void 0===m?void 0:m[0])||void 0,color:(null===(f=null==e?void 0:e.theme)||void 0===f?void 0:f[1])||void 0},reward:null!==(g=null==t?void 0:t.reward)&&void 0!==g?g:"",type:null!==(y=null==t?void 0:t.type)&&void 0!==y?y:"stakelp",sort:null!==(x=null==e?void 0:e.sort)&&void 0!==x?x:Number.MAX_SAFE_INTEGER})}})))})),(null==d?void 0:d.length)?(d.sort(((e,t)=>e.sort-t.sort)),Os.jsx(f,{sx:Object.assign({display:"flex",alignItems:"center",gap:4},i),children:d.map((t=>Os.jsx(A,{leaveDelay:100,title:Os.jsxs(f,{sx:{maxWidth:240,whiteSpace:"pre-wrap"},children:[t.partner.introduction,!!t.partner.link&&Os.jsxs(f,{component:"a",target:"_blank",href:t.partner.link,rel:"noopener noreferrer",sx:{display:"flex",alignItems:"center",gap:4,color:"primary.main","&:hover":{opacity:.5}},children:[Os.jsx(e,{id:"zwWKhA",message:"Learn more"})," ",Os.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.91667 2.91667V11.0833H11.0833V7H12.25V11.0833C12.25 11.725 11.725 12.25 11.0833 12.25H2.91667C2.26917 12.25 1.75 11.725 1.75 11.0833V2.91667C1.75 2.275 2.26917 1.75 2.91667 1.75H7V2.91667H2.91667ZM8.16667 2.91667V1.75H12.25V5.83333H11.0833V3.73917L5.34917 9.47333L4.52667 8.65083L10.2608 2.91667H8.16667Z",fill:"currentColor"})})]})]}),children:Os.jsxs(y,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,p:o.spacing(0,4),height:20,borderRadius:4,background:t.partner.background,color:t.partner.color,whiteSpace:"nowrap"},children:[Os.jsx(f,{component:"img",src:t.partner.logo,alt:t.partner.name,sx:{width:14,height:14,borderRadius:"50%"}}),!r&&!!t.reward&&Os.jsx(f,{sx:{fontSize:"10px",fontWeight:600},children:t.reward})]})},t.partner.name+t.reward)))})):null}function $E({chainId:e,address:t}){const{isMobile:n}=wy();return Os.jsx(f,{component:"button",onClick:n=>{n.stopPropagation(),fw.getState().push({type:pw.PoolDetail,params:{chainId:e,address:t}})},sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:8,cursor:"pointer",flexShrink:0,height:36,color:"text.primary","&:hover":{opacity:.5}},n?{width:64,backgroundColor:"background.tag"}:{width:40,backgroundColor:"transparent",borderWidth:1}),children:Os.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{d:"M5.83333 14.1667H7.5V8.33333H5.83333V14.1667ZM9.16667 14.1667H10.8333V5.83333H9.16667V14.1667ZM12.5 14.1667H14.1667V10.8333H12.5V14.1667ZM4.16667 17.5C3.70833 17.5 3.31597 17.3368 2.98958 17.0104C2.66319 16.684 2.5 16.2917 2.5 15.8333V4.16667C2.5 3.70833 2.66319 3.31597 2.98958 2.98958C3.31597 2.66319 3.70833 2.5 4.16667 2.5H15.8333C16.2917 2.5 16.684 2.66319 17.0104 2.98958C17.3368 3.31597 17.5 3.70833 17.5 4.16667V15.8333C17.5 16.2917 17.3368 16.684 17.0104 17.0104C16.684 17.3368 16.2917 17.5 15.8333 17.5H4.16667ZM4.16667 15.8333H15.8333V4.16667H4.16667V15.8333Z",fill:"currentColor"})})})}const eS={[bk.LOWEST]:{label:"0.01%"},[bk.LOW_200]:{label:"0.02%"},[bk.LOW_300]:{label:"0.03%"},[bk.LOW_400]:{label:"0.04%"},[bk.LOW]:{label:"0.05%"},[bk.MEDIUM]:{label:"0.30%"},[bk.HIGH]:{label:"1.00%"}},tS=({sx:t,isRightTop:n,isReverseColor:r})=>{const i=g();return Os.jsx(f,{sx:Object.assign(Object.assign(Object.assign({display:"inline-flex",padding:"2px 4px",alignItems:"center",gap:"4px",borderRadius:4,background:C(i.palette.warning.main,.1),color:i.palette.warning.main,fontSize:"10px",fontWeight:600,lineHeight:"14px"},n?{position:"absolute",top:-14,right:0,background:`linear-gradient(0deg, ${i.palette.warning.main}1A 0%, ${i.palette.warning.main}1A 100%), ${i.palette.background.paper}`}:void 0),r?{background:"light"===i.palette.mode?"linear-gradient(0deg, var(--label-warning, rgba(177, 86, 0, 0.10)) 0%, var(--label-warning, rgba(177, 86, 0, 0.10)) 100%), #FFF":"linear-gradient(0deg, #FFFFFF, #FFFFFF),linear-gradient(0deg, rgba(235, 141, 39, 0.1), rgba(235, 141, 39, 0.1))",zIndex:1}:void 0),t),children:Os.jsx(e,{id:"y5rS9U",message:"Migrate"})})};function nS({sx:t,value:n,onChange:i,searchAddress:o}){const[a,s]=at.useState(!1),{isMobile:l}=wy();return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{component:y,sx:Object.assign(Object.assign({typography:"body2",display:"flex",alignItems:"center",justifyContent:"flex-start",px:12,height:32,backgroundColor:"background.tag",color:"text.secondary",borderRadius:8,fontWeight:600},l?{}:{minWidth:220}),t),onClick:()=>s(!0),children:[Os.jsx(f,{component:As.Search,sx:{width:16,height:16,mr:8,flexShrink:0}}),Os.jsx(e,{id:"A1taO8",message:"Search"})]}),Os.jsx(ky,{value:n,open:a,multiple:!0,title:Os.jsx(e,{id:"o8aMNm",message:"Select a liquidity pool"}),searchPlaceholder:r._({id:"4nzwq3",message:"Search by token or pool address"}),onClose:()=>{s(!1)},onTokenChange:e=>{if(Array.isArray(e)){if(e.length>2){const t=[e[0],e[2]];i(t)}else i(e);s(!1)}},searchOtherAddress:e=>o(e,(()=>s(!1))),modal:!0})]})}function rS({lqList:t,setOperatePool:n,getMigrationPairAndMining:r,supportAMM:o}){const a=g(),{onSharePool:s}=pf();return Os.jsx(Os.Fragment,{children:null==t?void 0:t.map((t=>{var l,d,c,u,p,h,m,g,y,x;if(!(null==t?void 0:t.pair))return null;const v=t.pair,b=ns(v.baseToken,v.chainId),w=ns(v.quoteToken,v.chainId),k=v.apy?Pn(new i(null===(l=v.apy)||void 0===l?void 0:l.transactionBaseApy).plus(null!==(c=null===(d=v.apy)||void 0===d?void 0:d.miningBaseApy)&&void 0!==c?c:0)):void 0,j=le.utils.singleSideLp(v.type)&&v.apy?Pn(new i(v.apy.transactionQuoteApy).plus(null!==(u=v.apy.miningQuoteApy)&&void 0!==u?u:0)):void 0,E=!!(null===(p=v.miningAddress)||void 0===p?void 0:p[0]),S=!!(null===(h=v.apy)||void 0===h?void 0:h.metromMiningApy)&&Number(null===(m=v.apy)||void 0===m?void 0:m.metromMiningApy)>0,I=v.type,R=os(I),L="AMMV2"===I,M="AMMV3"===I,O=null==r?void 0:r({address:v.id,chainId:v.chainId});return Os.jsxs(f,{sx:{px:20,pt:20,pb:12,backgroundColor:"background.paper",borderRadius:16},className:"gradient-card-border",onClick:()=>{o||fw.getState().push({type:pw.PoolDetail,params:{chainId:v.chainId,address:v.id}})},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[b&&w?Os.jsx(Cj,{tokens:[b,w],width:24,mr:6,chainId:v.chainId,showChainLogo:!0}):"",Os.jsxs(f,{sx:{typography:"body2",fontWeight:600},children:[`${null==b?void 0:b.symbol}/${null==w?void 0:w.symbol}`,!!s&&Os.jsx(f,{component:As.Share,sx:{ml:2,width:12,height:12},onClick:()=>s({chainId:v.chainId,baseToken:b,quoteToken:w,poolId:v.id,apy:v.apy,isSingle:le.utils.singleSideLp(v.type)})}),Os.jsx(_E,{address:v.id,chainId:v.chainId})]}),!!O&&Os.jsx(tS,{})]}),E||S?Os.jsxs(f,{sx:{p:8,typography:"h6",fontWeight:"bold",background:`linear-gradient(180deg, ${C(a.palette.secondary.main,.3)} 0%, ${C(a.palette.purple.main,.3)} 100%)`,borderRadius:8,color:"purple.main",whiteSpace:"nowrap"},children:["✨ ",Os.jsx(e,{id:"Sti4vy",message:"Mining"})]}):""]}),Os.jsxs(f,{sx:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",rowGap:20,mt:44,"& > div:nth-child(odd)":{pr:20},"& > div:nth-child(even)":{position:"relative",pl:20,"&::before":{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",display:"inline-block",content:'""',height:24,width:"1px",backgroundColor:"border.main"}}},children:[o&&Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,whiteSpace:"nowrap"},children:[R,Os.jsx(A,{title:Os.jsx(e,{id:"O6RUgz",message:"Fee rate"}),children:Os.jsx(f,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary"},children:M?null!==(y=null===(g=eS[v.lpFeeRate])||void 0===g?void 0:g.label)&&void 0!==y?y:"-":Bn({input:new i(null!==(x=v.lpFeeRate)&&void 0!==x?x:0).plus(v.mtFeeRate?Tn(v.mtFeeRate,L?4:18):0)})})})]}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"1Qz63U",message:"Pool Type"})})]}),Os.jsxs(f,{children:[Os.jsxs(f,{sx:{typography:"h5",color:"success.main"},children:[k,j?`/${j}`:""]}),Os.jsxs(f,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:[Os.jsx(e,{id:"rSayea",message:"APY"}),Os.jsx(kE,{chainId:v.chainId,apy:v.apy,baseToken:b,quoteToken:w,hasQuote:!!j,hasMining:E,sx:{width:14,height:14}})]})]}),Os.jsxs(f,{children:[Os.jsxs(f,{sx:{typography:"h5"},children:["$",On(new i(v.tvl))]}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"FHKsZF",message:"TVL"})})]}),o&&Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4},children:["$",bn({input:v.volume24H||0})]}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"Q8W3SC",message:"Volume (1D)"})})]})]}),Os.jsxs(f,{sx:{mt:20,display:"flex",gap:"8px"},children:[Os.jsx(T,{fullWidth:!0,size:T.Size.small,onClick:e=>{e.stopPropagation(),n({pool:rs(t),hasMining:E})},children:Os.jsx(e,{id:"m16xKo",message:"Add"})}),o&&"PMM"===R&&Os.jsx($E,{chainId:v.chainId,address:v.id})]})]},v.id+v.chainId)}))})}function iS({lqList:t,loading:n,operatePool:o,setOperatePool:a,getMigrationPairAndMining:s,hasMore:l,loadMore:d,loadMoreLoading:c,supportAMM:u}){const p=g(),{onSharePool:h}=pf();return Os.jsxs(VE,{hasMore:l,loadMore:d,loadMoreLoading:c,empty:!(null==t?void 0:t.length),loading:n,children:[Os.jsx(f,{component:"thead",children:Os.jsxs(f,{component:"tr",children:[Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"AxdOHo",message:"Pair"})}),u&&Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"1Qz63U",message:"Pool Type"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"FHKsZF",message:"TVL"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"rSayea",message:"APY"})}),u&&Os.jsx("th",{children:Os.jsx(e,{id:"Q8W3SC",message:"Volume (1D)"})}),Os.jsx(f,{component:"th",sx:{width:80}})]})}),Os.jsx(f,{component:"tbody",children:null==t?void 0:t.map((t=>{var n,l,d,c,m,g,y,x,v,b,w,k,C;if(!(null==t?void 0:t.pair))return null;const j=t.pair,E=ns(j.baseToken,j.chainId),S=ns(j.quoteToken,j.chainId),I=j.apy?Pn(new i(null===(n=j.apy)||void 0===n?void 0:n.transactionBaseApy).plus(null!==(d=null===(l=j.apy)||void 0===l?void 0:l.miningBaseApy)&&void 0!==d?d:0).plus(null!==(m=null===(c=j.apy)||void 0===c?void 0:c.metromMiningApy)&&void 0!==m?m:0)):void 0,R=le.utils.singleSideLp(j.type)&&j.apy?Pn(new i(j.apy.transactionQuoteApy).plus(null!==(g=j.apy.miningQuoteApy)&&void 0!==g?g:0)):void 0;let L="";if((null===(y=null==o?void 0:o.pool)||void 0===y?void 0:y.address)===j.id||(null==o?void 0:o.address)===j.id)if(o.operate===FT.Remove)L=r._({id:"0+31GV",message:"Removing"});else L=r._({id:"1yHVE+",message:"Adding"});const M=!!(null===(x=j.miningAddress)||void 0===x?void 0:x[0]),O=!!(null===(v=j.apy)||void 0===v?void 0:v.metromMiningApy)&&Number(null===(b=j.apy)||void 0===b?void 0:b.metromMiningApy)>0,B=j.type,P=os(B),D="AMMV2"===B,N="AMMV3"===B,F=p.palette.background.tag,W=null==s?void 0:s({address:j.id,chainId:j.chainId});return Os.jsxs(f,{component:"tr",sx:{["&:hover td"+(L?", & td":"")]:{backgroundImage:`linear-gradient(${F}, ${F})`}},children:[Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[E&&S?Os.jsx(Cj,{tokens:[E,S],width:24,mr:10,chainId:j.chainId,showChainLogo:!0}):"",Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,typography:"body2",fontWeight:600},children:[`${null==E?void 0:E.symbol}/${null==S?void 0:S.symbol}`,Os.jsx(_E,{address:j.id,chainId:j.chainId}),!!W&&Os.jsx(tS,{})]}),Os.jsx(ZT,{address:j.id,customChainId:j.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:14,iconSpace:4,onShareClick:h?()=>h({chainId:j.chainId,baseToken:E,quoteToken:S,poolId:j.id,apy:j.apy,isSingle:le.utils.singleSideLp(j.type)}):void 0,sx:{typography:"h6",color:"text.secondary"},disabledAddress:u,onAddressClick:()=>{fw.getState().push({type:pw.PoolDetail,params:{chainId:j.chainId,address:j.id}})}})]})]})}),u&&Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4},children:[Os.jsx(f,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary",whiteSpace:"nowrap"},children:P}),Os.jsx(A,{title:Os.jsx(e,{id:"O6RUgz",message:"Fee rate"}),children:Os.jsx(f,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary"},children:N?null!==(k=null===(w=eS[j.lpFeeRate])||void 0===w?void 0:w.label)&&void 0!==k?k:"-":Bn({input:new i(null!==(C=j.lpFeeRate)&&void 0!==C?C:0).plus(j.mtFeeRate?Tn(j.mtFeeRate,D?4:18):0)})})})]})}),Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{typography:"body2"},title:j.tvl?`$${bn({input:j.tvl})}`:void 0,children:["$",On(new i(j.tvl))]})}),Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[M||O?Os.jsx(A,{title:r._({id:"Sti4vy",message:"Mining"}),children:Os.jsxs(f,{component:"span",sx:{typography:"body2",color:"success.main"},children:["✨"," "]})}):"",Os.jsx(kE,{chainId:j.chainId,apy:j.apy,baseToken:E,quoteToken:S,hasQuote:!!R,hasMining:M,children:Os.jsxs(f,{component:"span",sx:{typography:"body2",fontWeight:600,display:"flex",alignItems:"center",width:"max-content",color:"success.main",cursor:"auto"},children:[I,R?`/${R}`:""]})})]})}),u&&Os.jsxs(f,{component:"td",children:["$",bn({input:j.volume24H||0})]}),Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"8px"},children:[u&&"PMM"===P&&Os.jsx($E,{chainId:j.chainId,address:j.id}),L?Os.jsx(WE,{text:L,onClick:()=>a(null)}):Os.jsx(T,{size:T.Size.small,onClick:()=>{a({pool:rs(t),hasMining:M})},children:r._({id:"m16xKo",message:"Add"})})]})})]},j.id+j.chainId)}))})]})}function oS({scrollParentRef:e,filterChainIds:t,activeChainId:n,handleChangeActiveChainId:r,operatePool:i,setOperatePool:o,tokenAndPoolFilter:a,getMigrationPairAndMining:s}){var l,d;g();const{onlyChainId:u,supportAMMV2:p,supportAMMV3:h,notSupportPMM:m}=pf(),{minDevice:y,isMobile:x}=wy(),v=Rt(),{filterTokens:b,filterASymbol:A,filterBSymbol:w,filterAddressLqList:k,handleDeleteToken:C,handleChangeFilterTokens:j,handleChangeFilterAddress:T}=TE(a),E=m?[]:["CLASSICAL","DVM","DSP","GSP"];p&&E.push("AMMV2"),h&&E.push("AMMV3");const S={chainIds:t,pageSize:x?4:8,filterState:{viewOnlyOwn:!1,filterTypes:E}},I=QA(),R=I.getInfiniteQuery(le.graphql.fetchLiquidityList,"currentPage",{where:Object.assign(Object.assign({},S),{filterState:Object.assign({filterASymbol:A,filterBSymbol:w},S.filterState)})}),L=Bt(Object.assign(Object.assign({},R),{initialPageParam:1,getNextPageParam:e=>{var t;const{currentPage:n,totalCount:r,pageSize:i}=null!==(t=e.liquidity_list)&&void 0!==t?t:{};if(!n||!r||!i)return null;let o=Math.floor(r/i);return r%i&&(o+=1),n>=o?null:n+1}}));let M=[];const O=!!(null==k?void 0:k.length);O?M=[...k]:null===(l=L.data)||void 0===l||l.pages.forEach((e=>{var t,n;null===(n=null===(t=e.liquidity_list)||void 0===t?void 0:t.lqList)||void 0===n||n.forEach((e=>{null==M||M.push(e)}))}));const B=L.hasNextPage&&!O;return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:Object.assign(Object.assign({py:16,display:"flex",gap:8},y(475)?{}:{flexDirection:"column"}),x?{}:{px:20,borderBottomWidth:1}),children:[Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",gap:8},y(475)?{}:{"& > button":{flex:1}}),children:[!u&&Os.jsx(PE,{chainId:n,setChainId:r}),null!==(d=null==a?void 0:a.element)&&void 0!==d?d:Os.jsx(nS,{value:b,onChange:j,searchAddress:(e,t)=>Fn(this,void 0,void 0,(function*(){var n;const r=I.getInfiniteQuery(le.graphql.fetchLiquidityList,"currentPage",{where:Object.assign(Object.assign({},S),{filterState:Object.assign({address:e},S.filterState)})}),i=null===(n=(yield v.fetchQuery(r)).liquidity_list)||void 0===n?void 0:n.lqList;return(null==i?void 0:i.length)?Os.jsx(DE,{list:i,onClick:()=>{T(i),t()}}):null}))})]}),(O||!!b.length)&&Os.jsxs(f,{sx:{my:0},children:[O?Os.jsx(NE,{lqList:k,onDeleteTag:()=>T([])}):"",Os.jsx(FE,{tags:b,onDeleteTag:C})]})]}),x?Os.jsx(dn,{hasMore:B,threshold:300,loadMore:c((()=>{L.hasNextPage&&!L.isFetching&&L.fetchNextPage()}),500),useWindow:!1,getScrollParent:()=>e.current||null,loader:Os.jsx(jE,{sx:{mt:20}},"loader"),children:Os.jsxs(CE,{children:[L.isLoading?Os.jsx(jE,{}):"",!L.isLoading&&!(null==M?void 0:M.length)&&!L.error&&Os.jsx(sT,{sx:{mt:40},hasSearch:!!(n&&!u||A||w)}),!!L.error&&Os.jsx(mT,{refresh:L.refetch,sx:{mt:40}}),Os.jsx(rS,{lqList:M,setOperatePool:o,supportAMM:p||h,getMigrationPairAndMining:s})]})}):Os.jsxs(Os.Fragment,{children:[Os.jsx(iS,{lqList:M,loading:L.isLoading,operatePool:i,setOperatePool:o,hasMore:B,loadMoreLoading:L.isFetchingNextPage,loadMore:()=>{L.hasNextPage&&!L.isFetching&&L.fetchNextPage()},supportAMM:p||h,getMigrationPairAndMining:s}),Os.jsx(GE,{loading:L.isLoading,refetch:L.error?L.refetch:void 0,empty:!(null==M?void 0:M.length),hasSearch:!!(n&&!u||A||w)})]})]})}function aS({onClick:e,title:t,desc:n}){const r=g();return Os.jsx(f,{sx:{mx:20,px:0,py:14,borderTop:`1px solid ${r.palette.border.main}`,[r.breakpoints.up("tablet")]:{maxWidth:236,borderTop:"none",mx:0,px:16,py:8}},children:Os.jsxs(y,{onClick:e,sx:{width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:0,p:0,borderRadius:8,textAlign:"left","&:hover":{backgroundColor:r.palette.background.tag},[r.breakpoints.up("tablet")]:{p:8}},children:[Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:r.palette.text.primary},children:t}),Os.jsx(f,{sx:{typography:"h6",fontWeight:500,color:r.palette.text.secondary},children:n})]})})}const sS=t=>{const n=g(),{isMobile:r}=wy(),{account:i}=hf(),{supportAMMV2:o,supportAMMV3:a,notSupportPMM:s}=pf(),[l,d]=at.useState(!1),c={[pw.CreatePool]:!s,[pw.createPoolAMMV2]:!!o,[pw.createPoolAMMV3]:!!a},u=Object.entries(c).filter((([e,t])=>!0===t)),p=1===u.length?u[0][0]:void 0;if(!p){const t=Os.jsxs(Os.Fragment,{children:[!s&&Os.jsx(aS,{onClick:()=>{fw.getState().push({type:pw.CreatePool})},title:Os.jsx(e,{id:"Eif7f6",message:"PMM Pool"}),desc:Os.jsx(e,{id:"TmTsab",message:"Fexible customization, take full control of liquidity"})}),o&&Os.jsx(aS,{onClick:()=>{fw.getState().push({type:pw.createPoolAMMV2})},title:Os.jsx(e,{id:"lNYomJ",message:"AMM V2 Position"}),desc:Os.jsx(e,{id:"lLbR0m",message:"Simple, full-range liquidity"})}),a&&Os.jsx(aS,{onClick:()=>{fw.getState().push({type:pw.createPoolAMMV3})},title:Os.jsx(e,{id:"sVlqoo",message:"AMM V3 Position"}),desc:Os.jsx(e,{id:"EkAv3P",message:"Concentrated liquidity, higher efficiency"})})]});return r?Os.jsxs(Os.Fragment,{children:[Os.jsxs(T,{variant:T.Variant.outlined,fullWidth:r&&!!i,onClick:()=>{d(!0)},sx:{height:40},children:[Os.jsx(f,{component:As.Plus,sx:{mr:4}}),Os.jsx(e,{id:"p2jbcE",message:"Create Pool"})]}),Os.jsx(yy,{open:l,title:Os.jsx(e,{id:"p2jbcE",message:"Create Pool"}),onClose:()=>{d(!1)},modal:!0,children:Os.jsx(f,{sx:{mb:0},children:t})})]}):Os.jsx(A,{arrow:!1,leaveDelay:300,placement:r?"bottom":"bottom-end",sx:{p:0,backgroundColor:"background.paper"},title:Os.jsx(f,{children:t}),children:Os.jsxs(f,{sx:{width:r?"100%":"auto",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:10,pl:8,pr:16,py:7,borderRadius:8,borderWidth:1,borderColor:n.palette.primary.main,typography:"body1",fontWeight:600,color:n.palette.primary.main,cursor:"pointer","&:hover":{backgroundColor:C(n.palette.primary.main,.1)}},children:[Os.jsx(f,{component:As.Plus}),Os.jsx(e,{id:"p2jbcE",message:"Create Pool"})]})})}return Os.jsxs(T,{variant:T.Variant.outlined,fullWidth:r,onClick:()=>{fw.getState().push({type:p})},sx:{height:40},children:[Os.jsx(f,{component:As.Plus,sx:{mr:4}}),Os.jsx(e,{id:"p2jbcE",message:"Create Pool"})]})},lS="DODO_WIDGET_POOL_LIST_TAB",dS="DODO_WIDGET_POOLS_LIST_FILTER_CHAIN";var cS;!function(e){e.addLiquidity="add-liquidity",e.myLiquidity="my-liquidity",e.myCreated="my-created"}(cS||(cS={}));const uS=(e,t,n)=>{let i=r._({id:"TJBHlP",message:"Standard"}),o=n.palette.purple.main;switch(e){case"DSP":i=r._({id:"J7M/DA",message:"Pegged"}),o=n.palette.success.main;break;case"DPP":i=r._({id:"zwBp5t",message:"Private"}),o=n.palette.error.main}"DVM"===e&&(!t||t.isZero())&&(i=r._({id:"S8G1qk",message:"Single"}),o=n.palette.warning.main);return{typeLabel:i,typeColor:o,typeBgColor:C(o,.1)}};function pS({account:t,list:n,setOperatePool:r}){const o=g();return Os.jsx(Os.Fragment,{children:null==n?void 0:n.map((n=>{var a,s,l,d,c;if(!n)return null;const u=null!==(a=n.pairAddress)&&void 0!==a?a:"",p=n.chainId,h=n.poolType,m={chainId:p,address:null!==(s=n.baseAddress)&&void 0!==s?s:"",symbol:null!==(l=n.baseSymbol)&&void 0!==l?l:""},g={chainId:p,address:null!==(d=n.quoteAddress)&&void 0!==d?d:"",symbol:null!==(c=n.quoteSymbol)&&void 0!==c?c:""},{typeLabel:x,typeColor:v,typeBgColor:b}=uS(h,n.quoteReserve?new i(n.quoteReserve):null,o);return Os.jsxs(f,{sx:{px:20,pt:20,pb:12,backgroundColor:"background.paper",borderRadius:16},className:"gradient-card-border",onClick:()=>{fw.getState().push({type:pw.PoolDetail,params:{chainId:p,address:u}})},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[m&&g?Os.jsx(Cj,{tokens:[m,g],width:24,mr:8,chainId:p,showChainLogo:!0}):"",Os.jsx(f,{sx:{typography:"body2",fontWeight:600},children:us(u)}),"DPP"===h&&Os.jsx(Q,{sx:{ml:2},component:y,onClick:e=>{e.stopPropagation(),fw.getState().push({type:pw.ModifyPool,params:{chainId:p,address:u}})},children:Os.jsx(f,{component:As.Edit,sx:{width:12,height:12,cursor:"pointer"}})})]}),Os.jsx(f,{sx:{typography:"h6",width:"max-content",p:8,borderRadius:8,backgroundColor:b,color:v},children:x})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",mt:44},children:[Os.jsxs(f,{children:[Os.jsxs(f,{sx:{typography:"h5"},children:["$",n.tvl?On(new i(n.tvl)):"-"]}),Os.jsx(f,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:Os.jsx(e,{id:"FHKsZF",message:"TVL"})})]}),Os.jsx(f,{sx:{display:"inline-block",mx:20,height:24,width:"1px",backgroundColor:"custom.border.default"}}),Os.jsxs(f,{children:[Os.jsxs(f,{sx:{typography:"h5"},children:["$",n.totalFee?On(new i(n.totalFee)):"-"]}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"hCBYHP",message:"Total Fee Revenue"})})]})]}),Os.jsxs(f,{sx:{mt:20,display:"flex",gap:"8px"},children:[!!t&&Os.jsx(T,{fullWidth:!0,variant:T.Variant.outlined,size:T.Size.small,onClick:e=>{e.stopPropagation(),r({address:u,operate:FT.Remove,chainId:p})},children:Os.jsx(e,{id:"t/YqKh",message:"Remove"})}),Os.jsx(T,{fullWidth:!0,size:T.Size.small,onClick:e=>{e.stopPropagation(),r({address:u,operate:FT.Add,chainId:p})},children:Os.jsx(e,{id:"m16xKo",message:"Add"})})]})]},u+p)}))})}function hS({account:t,list:n,loading:o,operatePool:a,setOperatePool:s}){const l=g(),d=fw();return Os.jsxs(VE,{empty:!(null==n?void 0:n.length),loading:o,children:[Os.jsx(f,{component:"thead",children:Os.jsxs(f,{component:"tr",children:[Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"AxdOHo",message:"Pair"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"FHKsZF",message:"TVL"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"hCBYHP",message:"Total Fee Revenue"})}),Os.jsx(f,{component:"th",sx:{width:160}})]})}),Os.jsx(f,{component:"tbody",children:null==n?void 0:n.map((n=>{var o,c,u,p,h,m;if(!n)return null;const g="DPP"===n.poolType,y=null!==(o=n.pairAddress)&&void 0!==o?o:"",x=n.chainId,v=n.poolType,b={chainId:x,address:null!==(c=n.baseAddress)&&void 0!==c?c:"",symbol:null!==(u=n.baseSymbol)&&void 0!==u?u:""},A={chainId:x,address:null!==(p=n.quoteAddress)&&void 0!==p?p:"",symbol:null!==(h=n.quoteSymbol)&&void 0!==h?h:""},{typeLabel:w,typeColor:k,typeBgColor:j}=uS(v,n.quoteReserve?new i(n.quoteReserve):null,l);let E="";if((null===(m=null==a?void 0:a.pool)||void 0===m?void 0:m.address)===y||(null==a?void 0:a.address)===y)if((null==a?void 0:a.operate)===FT.Remove)E=r._({id:"0+31GV",message:"Removing"});else E=r._({id:"1yHVE+",message:"Adding"});const S=l.palette.background.tag;return Os.jsxs(f,{component:"tr",sx:{["&:hover td"+(E?", & td":"")]:{backgroundImage:`linear-gradient(${S}, ${S})`}},children:[Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[b&&A?Os.jsx(Cj,{tokens:[b,A],width:24,mr:10,chainId:x,showChainLogo:!0}):"",Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsxs(X,{lineSx:{bottom:-1},lineColor:"primary.main",hoverSx:{color:"primary.main","& svg":{display:"inline-block"}},className:"truncate-address-link",sx:{display:"flex",alignItems:"center"},children:[Os.jsx(f,{sx:{typography:"body2",fontWeight:600},onClick:()=>{d.push({type:pw.PoolDetail,params:{chainId:x,address:y}})},children:us(y)}),Os.jsx(f,{component:As.ArrowRight,sx:{display:"none",width:14,height:14}})]}),g?Os.jsx(f,{sx:{typography:"h6",px:8,py:2,ml:8,borderStyle:"solid",borderWidth:1,borderColor:"text.primary",borderRadius:4,whiteSpace:"nowrap",cursor:"pointer","&:hover":{backgroundColor:C(l.palette.text.primary,.1)}},onClick:()=>{d.push({type:pw.ModifyPool,params:{chainId:x,address:y}})},children:Os.jsx(e,{id:"ePK91l",message:"Edit"})}):""]}),Os.jsx(f,{sx:{typography:"h6",width:"max-content",mt:2,px:8,py:2,borderRadius:12,backgroundColor:j,color:k},children:w})]})]})}),Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{typography:"body2"},title:n.tvl?`$${bn({input:n.tvl})}`:void 0,children:["$",n.tvl?On(new i(n.tvl)):"-"]})}),Os.jsx(f,{component:"td",children:Os.jsxs(f,{title:n.totalFee?`$${bn({input:n.totalFee})}`:"",sx:{typography:"body2",fontWeight:600},children:["$",n.totalFee?On(new i(n.totalFee)):"-"]})}),Os.jsx(f,{component:"td",children:Os.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"8px"},children:E?Os.jsx(WE,{text:E,onClick:()=>s(null)}):Os.jsxs(Os.Fragment,{children:[!!t&&Os.jsx(T,{variant:T.Variant.outlined,size:T.Size.small,onClick:e=>{e.stopPropagation(),s({operate:FT.Remove,chainId:x,address:y})},children:Os.jsx(e,{id:"t/YqKh",message:"Remove"})}),Os.jsx(T,{size:T.Size.small,onClick:()=>{s({chainId:x,address:y})},children:r._({id:"m16xKo",message:"Add"})})]})})})]},y+x)}))})]})}function mS({account:t,filterChainIds:n,activeChainId:r,handleChangeActiveChainId:i,operatePool:o,setOperatePool:a}){var s,l,d,c,u,p;const{isMobile:h}=wy(),{onlyChainId:m}=pf(),g={limit:1e3,page:1,owner:t},y=QA().getQuery(le.graphql.fetchDashboardPairList,{where:g}),x=It(Object.assign({},y)),v=null!==(p=n?null===(d=null===(l=null===(s=x.data)||void 0===s?void 0:s.dashboard_pairs_list)||void 0===l?void 0:l.list)||void 0===d?void 0:d.filter((e=>{var t;return n.includes(null!==(t=null==e?void 0:e.chainId)&&void 0!==t?t:0)})):null===(u=null===(c=x.data)||void 0===c?void 0:c.dashboard_pairs_list)||void 0===u?void 0:u.list)&&void 0!==p?p:[],[b,A]=at.useState(!1),w=b?v.filter((e=>!!Number(null==e?void 0:e.tvl))):v;return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:Object.assign({py:16,display:"flex",justifyContent:"space-between",gap:8},h?{}:{px:20,borderBottomWidth:1}),children:[!m&&Os.jsx(PE,{chainId:r,setChainId:i}),Os.jsxs(f,{component:"label",sx:{display:"flex",alignItems:"center",gap:8,typography:"body2",cursor:"pointer",color:"text.secondary"},children:[Os.jsx(S,{sx:{top:-1},size:16,checked:b,onChange:e=>{const{checked:t}=e.target;A(t)}}),Os.jsx(e,{id:"eVZ7bY",message:"Hide TVL=0 pools"})]})]}),h?Os.jsxs(CE,{children:[x.isLoading?Os.jsx(jE,{}):"",!x.isLoading&&!(null==w?void 0:w.length)&&!x.error&&Os.jsx(sT,{sx:{mt:40},hasSearch:!!r&&!m}),!!x.error&&Os.jsx(mT,{refresh:x.refetch,sx:{mt:40}}),Os.jsx(pS,{account:t,list:w,setOperatePool:a})]}):Os.jsxs(Os.Fragment,{children:[Os.jsx(hS,{account:t,list:w,loading:x.isLoading,operatePool:o,setOperatePool:a}),Os.jsx(GE,{loading:x.isLoading,refetch:x.error?x.refetch:void 0,empty:!(null==w?void 0:w.length),hasSearch:!!r&&!m})]})]})}const fS=({onlyV3:e,setOnlyV3:t,sx:n})=>{const i=g(),{notSupportPMM:o}=pf();return Os.jsx(f,{component:y,onClick:()=>t(!e),sx:Object.assign({display:"flex",alignItems:"center",p:2,borderRadius:8,backgroundColor:i.palette.border.main},n),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",width:"100%",[i.breakpoints.up("tablet")]:{width:194}},children:[Os.jsx(f,{sx:Object.assign({flex:1,width:0,pt:4,pb:5,borderRadius:6,textAlign:"center",typography:"body2",whiteSpace:"nowrap"},e?{color:i.palette.text.primary,backgroundColor:i.palette.background.paper}:{color:i.palette.text.secondary,backgroundColor:"transparent"}),children:r._({id:"yoR+O6",message:"V3"})}),Os.jsx(f,{sx:Object.assign({flex:1,width:0,pt:4,pb:5,borderRadius:6,textAlign:"center",typography:"body2",whiteSpace:"nowrap"},e?{color:i.palette.text.secondary,backgroundColor:"transparent"}:{color:i.palette.text.primary,backgroundColor:i.palette.background.paper}),children:o?"V2":r._({id:"eK6I8d",message:"V2 & PMM"})})]})})};function gS({account:t,lqList:n,setOperatePool:r,getMigrationPairAndMining:o,supportAMM:a}){const s=g();return Os.jsx(Os.Fragment,{children:null==n?void 0:n.map((n=>{var l,d,c,u,p,h,m,g,y,x,v,b,w,k,j,E,S,I,R;if(!(null==n?void 0:n.pair))return null;const L=n.pair,M=ns(L.baseToken,L.chainId),O=ns(L.quoteToken,L.chainId),B=le.utils.singleSideLp(L.type),P=L.apy?Pn(new i(null===(l=L.apy)||void 0===l?void 0:l.transactionBaseApy).plus(null!==(c=null===(d=L.apy)||void 0===d?void 0:d.miningBaseApy)&&void 0!==c?c:0).plus(null!==(p=null===(u=L.apy)||void 0===u?void 0:u.metromMiningApy)&&void 0!==p?p:0)):"0%",D=B&&L.apy?Pn(new i(L.apy.transactionQuoteApy).plus(null!==(h=L.apy.miningQuoteApy)&&void 0!==h?h:0)):void 0;let N,F;(null===(m=n.liquidityPositions)||void 0===m?void 0:m.length)&&n.liquidityPositions.forEach((e=>{var t,n,r,o,a;if(null==e?void 0:e.liquidityTokenBalance){const s=null===(t=e.id)||void 0===t?void 0:t.split("-");if(2===(null==s?void 0:s.length)){const t=s[1].toLocaleLowerCase();if((null===(r=null===(n=null==L?void 0:L.baseLpToken)||void 0===n?void 0:n.id)||void 0===r?void 0:r.toLocaleLowerCase())===t)return void(N=new i(e.liquidityTokenBalance));(null===(a=null===(o=null==L?void 0:L.quoteLpToken)||void 0===o?void 0:o.id)||void 0===a?void 0:a.toLocaleLowerCase())===t&&(F=new i(e.liquidityTokenBalance))}}}));const W=!!(null===(g=L.miningAddress)||void 0===g?void 0:g[0]),V=!!(null===(y=L.apy)||void 0===y?void 0:y.metromMiningApy)&&Number(null===(x=L.apy)||void 0===x?void 0:x.metromMiningApy)>0,U=null===(v=n.liquidityPositions)||void 0===v?void 0:v[0],H=L.type,q=os(H),Z="AMMV2"===H,z="AMMV3"===H,Q=null==o?void 0:o({address:L.id,chainId:L.chainId});return Os.jsxs(f,{sx:{px:20,pt:20,pb:12,backgroundColor:"background.paper",borderRadius:16},className:"gradient-card-border",onClick:()=>{a||fw.getState().push({type:pw.PoolDetail,params:{chainId:L.chainId,address:L.id}})},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[M&&O?Os.jsx(Cj,{tokens:[M,O],width:24,mr:6,chainId:L.chainId,showChainLogo:!0}):"",Os.jsxs(f,{sx:{typography:"body2",fontWeight:600},children:[`${null==M?void 0:M.symbol}/${null==O?void 0:O.symbol}`,Os.jsx(_E,{address:L.id,chainId:L.chainId})]}),!!Q&&Os.jsx(tS,{})]}),W||V?Os.jsxs(f,{sx:{p:8,typography:"h6",fontWeight:"bold",background:`linear-gradient(180deg, ${C(s.palette.secondary.main,.3)} 0%, ${C(s.palette.purple.main,.3)} 100%)`,borderRadius:8,color:"purple.main",whiteSpace:"nowrap"},children:["✨ ",Os.jsx(e,{id:"Sti4vy",message:"Mining"})]}):""]}),Os.jsxs(f,{sx:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",rowGap:20,mt:44,"& > div:nth-child(odd)":{pr:20},"& > div:nth-child(even)":{position:"relative",pl:20,"&::before":{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",display:"inline-block",content:'""',height:24,width:"1px",backgroundColor:"border.main"}}},children:[a&&Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,whiteSpace:"nowrap"},children:[q,Os.jsx(A,{title:Os.jsx(e,{id:"O6RUgz",message:"Fee rate"}),children:Os.jsx(f,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary"},children:z?null!==(w=null===(b=eS[L.lpFeeRate])||void 0===b?void 0:b.label)&&void 0!==w?w:"-":Bn({input:new i(null!==(k=L.lpFeeRate)&&void 0!==k?k:0).plus(L.mtFeeRate?Tn(L.mtFeeRate,Z?4:18):0)})})})]}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"1Qz63U",message:"Pool Type"})})]}),z?null:Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{children:[Os.jsxs(f,{sx:{typography:"h5",color:"success.main"},children:[P,D?`/${D}`:""]}),Os.jsxs(f,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:[Os.jsx(e,{id:"rSayea",message:"APY"}),Os.jsx(kE,{chainId:L.chainId,apy:L.apy,baseToken:M,quoteToken:O,hasQuote:!!D,hasMining:W,sx:{width:14,height:14}})]})]}),Os.jsxs(f,{children:[Os.jsxs(f,{sx:{typography:"h5"},children:["$",On(new i(L.tvl||0))]}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"FHKsZF",message:"TVL"})})]})]}),"AMMV2"===H&&Os.jsxs(f,{children:[Os.jsx(f,{sx:{typography:"h5"},children:Bn({input:null===(E=null===(j=n.liquidityPositions)||void 0===j?void 0:j[0])||void 0===E?void 0:E.poolShare})}),Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"h3PbRN",message:"My Pool Share"})})]}),Os.jsxs(f,{children:[Os.jsx(f,{sx:{typography:"h5",display:"flex",alignItems:"center",fontWeight:"bold"},children:z?(null==U?void 0:U.liquidityUSD)?`$${An({input:U.liquidityUSD,decimals:2})}`:"-":Os.jsxs(Os.Fragment,{children:[B?Os.jsx(ey,{address:null==M?void 0:M.address,chainId:L.chainId,url:null==M?void 0:M.logoURI,width:18,height:18,sx:{mr:4}}):Os.jsx(Cj,{tokens:M&&O?[M,O]:[],width:18,mr:4,showChainLogo:!1,chainId:L.chainId}),N?bn({input:N}):"",B&&Os.jsxs(Os.Fragment,{children:[" / ",Os.jsx(ey,{address:null==O?void 0:O.address,chainId:L.chainId,url:null==O?void 0:O.logoURI,width:18,height:18,sx:{mx:4}}),F?bn({input:F}):"0"]})]})}),Os.jsx(f,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:Os.jsx(e,{id:"YHc3B+",message:"My Liquidity"})})]}),z&&Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,color:"text.primary"},children:[Os.jsx(iT,{outOfRange:null!==(S=null==U?void 0:U.outOfRange)&&void 0!==S&&S}),Os.jsx(f,{children:Os.jsxs(Os.Fragment,{children:[Os.jsxs("span",{children:[bj({price:null===(I=null==U?void 0:U.priceRange)||void 0===I?void 0:I.token0LowerPrice,atLimit:{},direction:Mw.LOWER})," "]}),null==M?void 0:M.symbol]})}),Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:Os.jsx("path",{d:"M15.75 9.50293L12.75 12.5029L11.7 11.4529L12.8813 10.2529L5.11875 10.2529L6.3 11.4529L5.25 12.5029L2.25 9.50293L5.25 6.50293L6.31875 7.55293L5.11875 8.75293L12.8813 8.75293L11.7 7.55293L12.75 6.50293L15.75 9.50293Z",fill:"currentColor",fillOpacity:"0.5"})}),Os.jsx(f,{children:Os.jsxs(Os.Fragment,{children:[Os.jsxs("span",{children:[bj({price:null===(R=null==U?void 0:U.priceRange)||void 0===R?void 0:R.token1LowerPrice,atLimit:{},direction:Mw.UPPER})," "]}),null==M?void 0:M.symbol]})})]}),Os.jsx(f,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:Os.jsx(e,{id:"YA4hwj",message:"Price Range"})})]})]}),Os.jsxs(f,{sx:{mt:20,display:"flex",gap:"8px"},children:[z?null:!!t&&Os.jsx(T,{fullWidth:!0,variant:T.Variant.outlined,size:T.Size.small,onClick:e=>{e.stopPropagation(),r({operate:FT.Remove,pool:is(n),hasMining:W})},children:Os.jsx(e,{id:"t/YqKh",message:"Remove"})}),Os.jsx(T,{fullWidth:!0,size:T.Size.small,onClick:e=>{e.stopPropagation(),r({operate:FT.Add,pool:is(n),hasMining:W})},children:Os.jsx(e,{id:"J/hVSQ",message:"{0}",values:{0:z?"Manage":"Add"}})}),a&&"PMM"===q&&Os.jsx($E,{chainId:L.chainId,address:L.id})]})]},z?null==U?void 0:U.id:L.id+L.chainId)}))})}function yS({account:t,lqList:n,loading:o,operatePool:a,setOperatePool:s,supportAMM:l,onlyV3:d,getMigrationPairAndMining:c}){const u=g();return Os.jsxs(VE,{empty:!(null==n?void 0:n.length),loading:o,children:[Os.jsx(f,{component:"thead",children:Os.jsxs(f,{component:"tr",children:[Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"AxdOHo",message:"Pair"})}),l&&Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"1Qz63U",message:"Pool Type"})}),d?null:Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"FHKsZF",message:"TVL"})}),d?null:Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"rSayea",message:"APY"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"YHc3B+",message:"My Liquidity"})}),d?Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"YA4hwj",message:"Price Range"})}):null,Os.jsx(f,{component:"th",sx:{width:210}})]})}),Os.jsx(f,{component:"tbody",children:null==n?void 0:n.map((n=>{var o,p,h,m,g,y,x,v,b,w,k,C,j,E,S,I,R,L,M,O,B;if(!(null==n?void 0:n.pair))return null;const P=n.pair,D=ns(P.baseToken,P.chainId),N=ns(P.quoteToken,P.chainId),F=le.utils.singleSideLp(P.type),W=P.apy?Pn(new i(null===(o=P.apy)||void 0===o?void 0:o.transactionBaseApy).plus(null!==(h=null===(p=P.apy)||void 0===p?void 0:p.miningBaseApy)&&void 0!==h?h:0)):void 0,V=F&&P.apy?Pn(new i(P.apy.transactionQuoteApy).plus(null!==(m=P.apy.miningQuoteApy)&&void 0!==m?m:0)):void 0;let U,H;(null===(g=n.liquidityPositions)||void 0===g?void 0:g.length)&&n.liquidityPositions.forEach((e=>{var t,n,r,o,a;if(null==e?void 0:e.liquidityTokenBalance){const s=null===(t=e.id)||void 0===t?void 0:t.split("-");if(2===(null==s?void 0:s.length)){const t=s[1].toLocaleLowerCase();if((null===(r=null===(n=null==P?void 0:P.baseLpToken)||void 0===n?void 0:n.id)||void 0===r?void 0:r.toLocaleLowerCase())===t)return void(U=new i(e.liquidityTokenBalance));(null===(a=null===(o=null==P?void 0:P.quoteLpToken)||void 0===o?void 0:o.id)||void 0===a?void 0:a.toLocaleLowerCase())===t&&(H=new i(e.liquidityTokenBalance))}}}));const q=null===(y=n.liquidityPositions)||void 0===y?void 0:y[0],Z=P.type,z=os(Z),Q="AMMV2"===Z,G="AMMV3"===Z;let Y="";if(G)(null===(b=null===(v=null===(x=null==a?void 0:a.pool)||void 0===x?void 0:x.liquidityPositions)||void 0===v?void 0:v[0])||void 0===b?void 0:b.id)===(null==q?void 0:q.id)&&(Y=r._({id:"p3607o",message:"Managing"}));else if((null===(w=null==a?void 0:a.pool)||void 0===w?void 0:w.address)===P.id||(null==a?void 0:a.address)===P.id)if(a.operate===FT.Remove)Y=r._({id:"0+31GV",message:"Removing"});else Y=r._({id:"1yHVE+",message:"Adding"});const X=!!(null===(k=P.miningAddress)||void 0===k?void 0:k[0]),J=!!(null===(C=P.apy)||void 0===C?void 0:C.metromMiningApy)&&Number(null===(j=P.apy)||void 0===j?void 0:j.metromMiningApy)>0,K=u.palette.background.tag,_=null==c?void 0:c({address:P.id,chainId:P.chainId});return Os.jsxs(f,{component:"tr",sx:{["&:hover td"+(Y?", & td":"")]:{backgroundImage:`linear-gradient(${K}, ${K})`}},children:[Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[D&&N?Os.jsx(Cj,{tokens:[D,N],width:24,mr:10,chainId:P.chainId,showChainLogo:!0}):"",Os.jsxs(f,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,typography:"body2",fontWeight:600},children:[`${null==D?void 0:D.symbol}/${null==N?void 0:N.symbol}`,Os.jsx(_E,{address:P.id,chainId:P.chainId}),!!_&&Os.jsx(tS,{})]}),Os.jsx(ZT,{address:P.id,customChainId:P.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:14,iconSpace:4,disabledAddress:l,onAddressClick:()=>{fw.getState().push({type:pw.PoolDetail,params:{chainId:P.chainId,address:P.id}})},sx:{typography:"h6",color:"text.secondary"}})]})]})}),l&&Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4},children:[Os.jsx(f,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary",whiteSpace:"nowrap"},children:z}),Os.jsx(A,{title:Os.jsx(e,{id:"O6RUgz",message:"Fee rate"}),children:Os.jsx(f,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary"},children:G?null!==(S=null===(E=eS[P.lpFeeRate])||void 0===E?void 0:E.label)&&void 0!==S?S:"-":Bn({input:new i(null!==(I=P.lpFeeRate)&&void 0!==I?I:0).plus(P.mtFeeRate?Tn(P.mtFeeRate,Q?4:18):0)})})})]})}),G?null:Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{typography:"body2"},title:P.tvl?`$${bn({input:P.tvl||0})}`:void 0,children:["$",On(new i(P.tvl||0))]})}),G?null:Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[X||J?Os.jsx(A,{title:r._({id:"Sti4vy",message:"Mining"}),children:Os.jsxs(f,{component:"span",sx:{typography:"body2",color:"success.main"},children:["✨"," "]})}):"",Os.jsx(kE,{chainId:P.chainId,apy:P.apy,baseToken:D,quoteToken:N,hasQuote:!!V,hasMining:X,children:Os.jsxs(f,{component:"span",sx:{typography:"body2",fontWeight:600,display:"flex",alignItems:"center",width:"max-content",color:"success.main",cursor:"auto"},children:[W||"0%",V?`/${V}`:""]})})]})}),Os.jsx(f,{component:"td",children:Os.jsx(f,{sx:{display:"flex",alignItems:"center"},children:G?(null==q?void 0:q.liquidityUSD)?`$${An({input:q.liquidityUSD,decimals:2})}`:"-":Os.jsxs(Os.Fragment,{children:[F?Os.jsx(ey,{address:null==D?void 0:D.address,chainId:P.chainId,url:null==D?void 0:D.logoURI,width:24,height:24,noShowChain:!0,sx:{mr:4}}):Os.jsx(Cj,{tokens:D&&N?[D,N]:[],width:24,mr:4,showChainLogo:!1,chainId:P.chainId}),U?bn({input:U}):"-",F&&Os.jsxs(Os.Fragment,{children:[" / ",Os.jsx(ey,{address:null==N?void 0:N.address,chainId:P.chainId,url:null==N?void 0:N.logoURI,width:24,height:24,noShowChain:!0,sx:{mx:4}}),H?bn({input:H}):"0"]}),Q&&Os.jsx(A,{title:Os.jsx(e,{id:"NXZdrO",message:"My pool share"}),children:Os.jsx(f,{sx:{ml:4,px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary"},children:Bn({input:null===(L=null===(R=n.liquidityPositions)||void 0===R?void 0:R[0])||void 0===L?void 0:L.poolShare})})})]})})}),d?Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4,color:"text.primary"},children:[Os.jsx(iT,{outOfRange:null!==(M=null==q?void 0:q.outOfRange)&&void 0!==M&&M}),Os.jsx(f,{children:Os.jsxs(Os.Fragment,{children:[Os.jsxs("span",{children:[bj({price:null===(O=null==q?void 0:q.priceRange)||void 0===O?void 0:O.token0LowerPrice,atLimit:{},direction:Mw.LOWER})," "]}),null==D?void 0:D.symbol]})}),Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:Os.jsx("path",{d:"M15.75 9.50293L12.75 12.5029L11.7 11.4529L12.8813 10.2529L5.11875 10.2529L6.3 11.4529L5.25 12.5029L2.25 9.50293L5.25 6.50293L6.31875 7.55293L5.11875 8.75293L12.8813 8.75293L11.7 7.55293L12.75 6.50293L15.75 9.50293Z",fill:"currentColor",fillOpacity:"0.5"})}),Os.jsx(f,{children:Os.jsxs(Os.Fragment,{children:[Os.jsxs("span",{children:[bj({price:null===(B=null==q?void 0:q.priceRange)||void 0===B?void 0:B.token0UpperPrice,atLimit:{},direction:Mw.UPPER})," "]}),null==D?void 0:D.symbol]})})]})}):null,Os.jsx(f,{component:"td",children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"8px"},children:[l&&"PMM"===z&&Os.jsx($E,{chainId:P.chainId,address:P.id}),Y?Os.jsx(WE,{text:Y,onClick:()=>s(null)}):Os.jsxs(Os.Fragment,{children:[G?null:!!t&&Os.jsxs(T,{variant:T.Variant.outlined,size:T.Size.small,onClick:e=>{e.stopPropagation(),s({operate:FT.Remove,pool:is(n),hasMining:X})},children:[Os.jsx(e,{id:"t/YqKh",message:"Remove"}),!!_&&Os.jsx(tS,{isRightTop:!0})]}),Os.jsx(T,{size:T.Size.small,onClick:()=>{s({pool:is(n),hasMining:X})},children:G?r._({id:"wckWOP",message:"Manage"}):r._({id:"m16xKo",message:"Add"})})]})]})})]},G?null==q?void 0:q.id:P.id+P.chainId)}))})]})}function xS({account:e,filterChainIds:t,activeChainId:n,handleChangeActiveChainId:r,operatePool:i,setOperatePool:o,getMigrationPairAndMining:a,tokenAndPoolFilter:s}){var l,d,c,u,p,h,m,y;g();const{minDevice:x,isMobile:v}=wy(),b=Rt(),{onlyChainId:A,supportAMMV2:w,supportAMMV3:k,notSupportPMM:C}=pf(),[j,T]=at.useState(!1),{filterTokens:E,filterASymbol:S,filterBSymbol:I,filterAddressLqList:R,handleDeleteToken:L,handleChangeFilterTokens:M,handleChangeFilterAddress:O}=TE(s);let B=C?[]:["CLASSICAL","DVM","DSP","GSP","DPP"];w&&B.push("AMMV2"),k&&j&&(B=["AMMV3"]);const P={currentPage:1,pageSize:1e3,user:e,filterState:{viewOnlyOwn:!0,filterTypes:B}},D=QA(),N=D.getQuery(le.graphql.fetchMyLiquidityList,{where:Object.assign(Object.assign({},P),{filterState:Object.assign({filterASymbol:S,filterBSymbol:I},P.filterState)})}),F=It(Object.assign({},N));let W=null!==(c=null===(d=null===(l=F.data)||void 0===l?void 0:l.liquidity_list)||void 0===d?void 0:d.lqList)&&void 0!==c?c:[];const V=!!(null==R?void 0:R.length);V?W=[...R]:t&&(W=null!==(m=null===(h=null===(p=null===(u=F.data)||void 0===u?void 0:u.liquidity_list)||void 0===p?void 0:p.lqList)||void 0===h?void 0:h.filter((e=>{var n,r;return t.includes(null!==(r=null===(n=null==e?void 0:e.pair)||void 0===n?void 0:n.chainId)&&void 0!==r?r:0)})))&&void 0!==m?m:[]);return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:Object.assign(Object.assign({py:16,display:"flex",gap:8},x(475)?{}:{flexDirection:"column"}),v?{}:{px:20,borderBottomWidth:1}),children:[Os.jsxs(f,{sx:Object.assign(Object.assign({display:"flex",alignItems:"center",gap:8},x(475)?{}:{"& > button":{flex:1,flexBasis:"100%"}}),v?{flexWrap:"wrap"}:{}),children:[!A&&Os.jsx(PE,{chainId:n,setChainId:r,sx:{justifyContent:"space-between"}}),k&&Os.jsx(fS,{onlyV3:j,setOnlyV3:T,sx:v?{flexGrow:1,flexBasis:"100%"}:void 0}),null!==(y=null==s?void 0:s.element)&&void 0!==y?y:Os.jsx(nS,{value:E,onChange:M,searchAddress:(e,t)=>Fn(this,void 0,void 0,(function*(){var n;const r=D.getInfiniteQuery(le.graphql.fetchLiquidityList,"currentPage",{where:Object.assign(Object.assign({},P),{filterState:Object.assign({address:e},P.filterState)})}),i=null===(n=(yield b.fetchQuery(r)).liquidity_list)||void 0===n?void 0:n.lqList;return(null==i?void 0:i.length)?Os.jsx(DE,{list:i,onClick:()=>{O(i),t()}}):null}))})]}),(V||!!E.length)&&Os.jsxs(f,{sx:{my:0},children:[V?Os.jsx(NE,{lqList:R,onDeleteTag:()=>O([])}):"",Os.jsx(FE,{tags:E,onDeleteTag:L})]})]}),v?Os.jsxs(CE,{children:[F.isLoading?Os.jsx(jE,{}):"",!F.isLoading&&!(null==W?void 0:W.length)&&!F.error&&Os.jsx(sT,{sx:{mt:40},hasSearch:!!(n&&!A||S||I)}),!!F.error&&Os.jsx(mT,{refresh:F.refetch,sx:{mt:40}}),Os.jsx(gS,{account:e,lqList:W,setOperatePool:o,supportAMM:w||k,getMigrationPairAndMining:a})]}):Os.jsxs(Os.Fragment,{children:[Os.jsx(yS,{account:e,lqList:W,loading:F.isLoading,operatePool:i,setOperatePool:o,supportAMM:w||k,onlyV3:j,getMigrationPairAndMining:a}),Os.jsx(GE,{loading:F.isLoading,refetch:F.error?F.refetch:void 0,empty:!(null==W?void 0:W.length),hasSearch:!!(n&&!A||S||I)})]})]})}var vS,bS;function AS(){return AS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},AS.apply(null,arguments)}const wS=e=>ot.createElement("svg",AS({width:66,height:64,viewBox:"0 0 66 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),vS||(vS=ot.createElement("rect",{width:64,height:60.1342,fill:"url(#pattern0)"})),bS||(bS=ot.createElement("defs",null,ot.createElement("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:1,height:1},ot.createElement("use",{xlinkHref:"#image0_2465_53170",transform:"matrix(0.00671141 0 0 0.00714286 -0.503356 -0.9)"})),ot.createElement("image",{id:"image0_2465_53170",width:300,height:300,xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAADWuSURBVHgB7Z0JeFRVtu9XhYQwJRQzhulE5gYliPNEofc16rtXQvu10O1rCfdrW/F9V+Daer3dtyXwerDt9gLv2TYOLYFuVOhWwBm7NYUDICIEARkCphCCMicECAkk9fZ/n9qVk0pVxqqkEv6/79uc+dSpJOfPWmuvvbYIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGkrdJOCCFO5qs2UrUNQgghcc7JQCOEkLgmQzV/oHmExB0JQggxePCP2+0OrpP4goJFSBXjMzIyBE0xSUjcQcEipAoPxCozMxPrUC23EEJIHAKV8q9cudJfUFBg4ljZQgghcYalWoFlWX7DrFmzjGjNEkIIiQM8qi1Q7STECpaV4eTJk37lHhrRyhXb2vIIIYQ0E4hJzVRtpdi5Vn7VI+hXMatqYuVk8eLFfo/HY4QrVMAsIYSQGODMsfLDosrJydGWVH1AbCuMcM0UQgiJEVnisK7Q4PZlZWVFtLCys7O1FSY1rSuPkGbHJYQ0HktsN8sszb66gGAUq1bkaL7AsrmAxTVebOHJVBaX5ObmCpaGsWPHSl5eHla9qi1RbVUzPyMhpAFAhPBiZ4kdnF6s2hZxWCh1tQEp4k9Nrt+5gVYgthWDz4LL5Qk8QyyxJNBLaFxERy9hlpC4gRYWcWKJLRCwPDLEIRRKdKRre5Hv9BQZmCLSP1Vtq31KkILHsI31+nDgVGBZUrXEPrM8WFJ1LAAsG5g7a8W2ePIkutaOR7XcBQsWyLRp06Rbt27Yl6PadCFxQ6KQix2P2EmTGIpiYQdE57o0kev72eI0SonUgFSJKuZ+td33VJnI9mO2cO04Km617ll/SD/vnMApXrFFBSLmk6bhRVu1apVnzJgxZt8SIXEFBevixCO2SE1Tze0UqNvToy9OjQXPhWfSjKjav65Q5N2v9NKz43gw+O0VW7xWS+Mtr7Ver9fjiGN5hcQVdAkvLjxiWyceiMFtSpymKCEY3bP+rly8Aevri3YiT3+gfMT9epdPbKGZKw23ujxix88kcI8JQuIKCtbFgSV2EFsL1X2Xi/xkTOsVqVBcyk/ocZntPi54W/lxH+rdsLLQUTBXGgY6FNyB67KFxBUUrLYPetqyUxLF/ci1SqzGSJvEiFZiZ2VWHVVf+G9B4fKJbSn56nmrHLFdZVzjFRJXULDaNnD/sm/pI/LfN4v06S2tAlhKO45V9SQa4LqidxLLcLRTFmPPsbZ4gRwVip/7qhYwn9qcLHbPYl14xK7rPlZI3EHBartosXpwqAhatwEiCXHcxYJY1PNKTpbvtnsHawOpFAjGP3xVzQ6ClEtFOqdVbcPamvB/gqLVEEuLxCEUrLaJpVrBpP4iv1LxqqQOKl51icQtsKjuWiVSJsnyne98R/r37y+9evWS1NTqanT06FE5deqU7Nu3T7788kstXC/eUd3iat9VpPtl1e8P0Rr7mApqnWUgvbXDab7aJlmq3fZ/xymhShJJ7qJEq6PELTPeEzlSkSpTp06V4cOHS/fu3SU5uWaPQOfOnfWxwYMHa2HbkPelfFNSIZlDQ87rV33breJaZedVQGqnFvKFqp0T0iphieS2SUaaEqh+AZGKZ1cQpLZXglJWplt9gaUFUUOGvZN2HcKfn2FVrQpptTBx9CKg8oLENfNuUi7hyjJZtmyZdgdNgyA5LS24hGgHDx7UDS4h4lhOknsIacNQsNooh0pFPjsucpV6gS/EuQME4dl4rwq471Jt50FZv+FgrecjK/++G0WmjqiZS9ahe/hrVm4S0gagYLVhfv6FyOJrlGuo1iuUldUuzn/byLqfEhiCg0A8egvNAGi4fkhpGJgSOeG1y8DwLuHCd0SWrBXSBqBgtVFSVLC9RAWap39qi1bS0fjuKQwlUq5VJJCDBcEKBWI1a6ltxYVUfyCtEAbd2ygp6r+ixdfa6xCtv+4VKT0pbRKIVWgqQ9FZkdlLbbG67VIVJ7tRSBuAgtWGGZFqixZ6C/9LuYc3rhT5cJ+0KYxYGVcQQoXs9vR/E3nxA1uoFt/edsZNXuzQJWzjQKwgWqtUHPuZfBUjetd2jx6+2i4l05pfZKdYoVLD6k324GeIFgLzC2+Nn1I5JDpQsC4SMvvbDcL1lwLlKr0v8niyLVooM4OhLq1JvJDRXqTiXM+8JeL90m6pge9z9whHHS3SpqBgXWQY4dp1SuTPPpGP9tvpBAAvuSnkF481sjAYet0hkQ2H7YYhNwDPPDdCmgNpW1CwLlIQ38I4Q4B8rc9O2MunPrMbMNURRvWoWq8trSBaQJiKy+2KDTuUKO04XpXmAEzxwVmXt363ljQMChbRyaVoEhiTB+GCBQYRgxWDcsROIBBGuPQkFO3tdT0ZRUA8uravLiQQG4iQobjM3ncwzCQUTtDbCXG98xKRy/qITBjGuNTFDAWLiBvxKyUGJcrNOlukxEtsAftRetU5ELBDKphdWGo3ZNKXqPbRCTvfq6SRw3+M4PVRf4njlBD9S18RjIOESKWqfWmdqs7FIO4uFKuLGgoWkfOBoTu9Bldtl50WKS0WOaeWZWdsARlRD7GAqIUjUYlQF0cyaKiVdLxACKkTChaRM8fthrpZHVXvWxdlXSWq9V4OgcEA6vJz9vLUYbuBzj2qD64e3LVq/XxZ1ThGXZOridZRvFedILGHfwIkCCwrNCNGEIjkziIdutgClpRsL+GayWH7WL9Rtd9zz4dCSNSgYJGIwHKCW4gWDriKX220hSzS9YREEwpW2yRPBcWnFap4Ur9OElPg8jVX+ZqmuIQm10zqNxEFiVM4lrBtkqNaEcYPEjtVYoUtWDnS+FmhSRzAmu5tE9g8h5WVlQkr69a+0uKgFldySuTjpfWQEcTS2rWXBoGE03veUHG5cj1bznShYLVqKFhtF7g+rt0l4sH4QcxNiAkpWoqoCFZqw4oQPv+FPWbyqJ1qMUs1lvFr5VCw2jZe1faXXJDMv/jsHUjKbAnhioZg4fr6CNa6QqVOH4gs3a46Bir0Lp/Y1hVp5VCwWh7M4vKtxA5YWh7VLAy1+eCwnbWuM8mbUbiiYmF1VUHXWv5ijVBhLGRpck8ZOHCgHDt2DIdgXW0V0uqhYLUslmo7VUPiwAaJHftVyxo6dKi0T+0h63wnBBYXxgwCjNeLtXhFQ7A6KcFyhfzFQqSeV1L0wN9F/rzDFqqJEyfKfffdJ2+99ZacPXvWJ7Su2gxMa2hZzBx5k1RbILHDi7Z//37PlClT5IorrpBvvvlGtm/fLv/1xQl9wlXdA4Og1XJ4asvGuyLSrqrEzHolVO8U2AOoO3XqJAPTB8r/njxZRoywZ7H46KOPjHWVLaTNwKnqW5Yc1aaJ3XOVLrHtwbJUKxg7dqwWLMPp06dFCZn4fD759tsqzxSiBfHqFxiI3FQR00NzapkEI9xYQoxL3FliL+HO5p+tqubQoUMH/T0wA/S4ceO0aDl5+OGHIVg+sX+upI1AwWpZtliWlQGxUEwQ2xKKJQvat28/E1aWWtY4WF5eLsePH9fWF9rJkyerzcZsSr1gRh4TvHfOMI39qQ6b3Vlp4Swy/rpVbaPUjHMarz1f28J06kKgMkRp9Wfr27dvsMGKSktLkz59+kg4YF298MILWG2OnylpRihYLYelWsGCBQskOztbioqKFoodHI4lbnymimW5b7755npdYETsxIkTUlJSohussjNnzjRoavl6PZzbXaNBoLCEReVkwIABkpgYPqIRsK5WqdXJQtoUjGG1HB78M378eN1Wr14N1zDWggWXc2F+fv4cuIYpKeGj4AkJCXqKeAgSLLFLLrlEt3BAwCBqaEAFucXlcul7tGvXTi8hLFiiGSBCZgkxChWk2ujSpUtEsVq1apWJXc0W0uaghdVyFCh30CooKBCv1ysTJsB70S9ZLIPvQFtZSoDcd9xxR42DEBlYNUZcKisr5cKFC+L3+2uci2NGlEAkEakvuJ9T1CIRybqCUP3mN7/BMkfYM9gmYVpD8wPB+KNqHriDGRkZonRL1q5di8D3bYFzkDMUqyHFuG9H5dZ5YDWFWlkdO3aUzp07B7dhLUGUIBDOBgErLS3VYgahwXZFRYVeN9tm3TRzPwDrzVhm586d0w37cF1SUuToPqyrSJbhsmXLZNcuPWgQriCH4LRBKFjNA0TqftWeCLRr58+fLw888EDwhMzMTN1Lt3XrVo/afExsl3Gs2AJTJNEVMCSTPqBEqwNys5xAMCIJghNjWaHhGggX2vnz53UzYuRsOA5XE0CcIHDmXhBBuJ9oRtTCgUB7OCsM1lUg0J6j2hKJLeb3iV8gfkc+oUA2C3QJY4cldkxqvATyrWBJTZo0SWbNmqXXw4EewyVLlmg3Ec0BNqJpOeDZ5sMtDI1P9e/fv1bRqA1jXYVzIUPjWA0Fca5IsbTnn39ePv74Y6wijcEnDQciNFPs3xsSeRdEuA+O5ypLz7rhhht0B8Qnn3yC/dmqzRUSUxh0jx2ZYr8AGo/HI1lZWTrAHkmsAILQgwYN0udgXfUeVjss0ROsHNXmbNmyxR0qAgicO93ChtAUQaoLuIPhgHUVECsIhk8ajqVa7pgxYyzVZN++fRAhdIJMDnO/3IkTJ1oPPvhg8HmQAjJjxoxsdEBITesuW+zEYPzuvGLH1nxCGgUtrNiSEWiTAksLOyFeixcvriFcCxcuNCkO2MQ/6JpfG1g2Vag8Yovo+MBzuJ0HTW8gxHLYsGHayoo3IgXbEbt677338PMx7llDyRk8ePC05557LrjjmWeekVdffbXGieiQwOc5gUjv3r27motvGDJkiBhxw/3WrFnjCzwnXchGQAsrtuQFWk5gWwuYcvWQVmDl5ubqoDuYO3euFiux/xeeK9FLeJyjWpZqVkoXtwwfnKHaGL00lJwult37tqi2VT788EPd8FwQVpN+0NKY9IhwwCIUWwB80jgGYfyhk+9+97taYF566aXgvl/84hfSp29/Wbdhk1x/7ZXB/XCDA728Mm/ePC1Se/fulccff1z/XiFy4NFHH0Wc0lJxyiyJfW9wm4SC1bwYAfMqKyp39uzZWrQQtwqIVTSTHT2qLVbNunKMRx64d44WKYhWbRz61ifLXlsguetWi+nFjAfhiqWrqShCLMpJQYFPevW+RIqK7f1nS8+Ju0eanC69oHtHIwFLCh0DcBNNZn7ocQmxbkn9oWC1DD7VpitLKxeB9cDQHBCtZMf5qs1K62vJvEcWCwSrvuCaRx5cIPd8b5a8/l6OLFo6Vz/f1KlTa7x8zUmMBWvha6+9lonvh0A6rKOVq9+UTind5be/X6hPSEpKluuUVXX3XZOkUyc7yfXgwUKdBtKjR/dgJ4Ny+SQvL08H4wO9voK4GMA24mMKzsLYSBjDajl0AqfqMXQjeXT16tWwvMZK08A9V6rmued7M5VVlV3Dojp02Ceb8rxquT+4L6WzchWHjAlrgcHi+vFPJ+glUi+MC9vc1KOH0CdNG+iMXlPTS6iB0MAiQi/gLbf+D/n5zx7T+8+eLZU33/67vJ/7kUz70RTtHuLZMBBbqscb3er6TIigipGJEkWIVjR+zxcttLBaDvxR5ykLyxOwsPKkaUBpclXLmPfoYrnzu1nBAyWni5Sbt1ByP1ml4lS1fwyuu3PitKBVBotr+aIt8uOHJ+hhL6ClRCvGLAg0S7Ut06ZNc9977736ACyj+++/X1tLZ0vPy4pXV0v/fmny8KwHZNhQe7ps5JIFgEnmNRvK0spSVpepyLFVGLtqErSwWhadCxVYRw/eamk8sKwyQ8Xq9TU58rtnZkvJmSJtPd353WlKuFbD0spz9+w7u2vXnrmD+veS8rLSaiVmcA/EvSBYBojWpq1enZ5RW2pGLEDAHe4XXC6kMCDQjpIyKDGDtIZdu3b5JDqlZCzVCpTFWy2N4sknn5Td+T5JbN9Zjh0+KMntq786yM4/ePAgVtFhki0kJlCwWhZLquIZjU14BOgJzH7kwfk69gRgVUGoEIeCUMFFxDGs35TZDccXWiMyFiRKQsGY0UPF3dV+ORF72bx5s+Tn50taH8Sz5suEGzKD94Ro7S/cpbvwmzMQ/8UXX8i7774rSYnt5X/elikDB1iybXuevLVmlTnFJ9ERLHypk88++6zu7TP88te/kwOFR2TIP98oXaxeNS7qkZoqO99fJx8uWY7NLIl9tv1FCYfmtCxwE7LEftl+K43DUm2ViVkBIyzrNr0rE67PlBeeypUbrrpNWQUddCxq8Sv6o55VFpYvQVyz+vbuoWJEdn0s5GOlp6freuj5+3bJ6nfx3rm0i4jrcZ/X3v6TfP21r9lcQwSxV65cKSOGj5K3Xs2Ve6ZkyU3Xe+SfbrlNzpWVyabNuro0hAYZ6hhM2JRhTLjWs3PnTuuqq67SO15++WXZnLdDRmR6ZMT3bpHUS3rXaNaQwTLKc52cLPxGCnfme6Txv09SC5xIteVBz2BThnTkwm0zYgUgVohVwaWbP29ltUA6gu4BfJFuiLwiiBFcP1hRi5ZmK0vNNhhMzyPcxw0bYlmG3gZJtLCsYFFBrLAEzzy/UC67Kl3++Hy1kBDc65NiW62I5+EgzMOGKut01Zu36p577tFDqZYuXVp0wLdLWVa9I15wodIeFzn4Gl3NlWkLMYJB95ZnlTSeLNWsR2bMD4oS3EAjVk4RMyBJNECdmdYQK4hWTg7iYLOCCadwEWFxISUDwtaQWlYNBZ+BSg6wEhMq7e/42OOztVDBNXzwvplyo7K24B5+fdAnX2zfinVLrVvbduR5xDE8SuyODZ/YwW+vBDo+wnwszkE+nCVVw6GYihAHULBaN3MgHibGhAA7kj7t4HpW2AtKTp80q/UaGgLRQg7WokWLZPbjk+XtZfZ7C0GEJQcrC4mlsQDWFdxBfFbv7pYcK1R+7IsLtVj958Nz5LGfZgfPvWx0hm4QMUPxqSJbyA4oIduRp9a3ZigRy1D7cdIcx0flSPhxiGbbEhIX0CVsvWSpZiF2ZUCSp6JIxbCKICaIV0UDJFRClOBOBj5DW1hoECxYQLHAVKsw4ovv86elC2TksAx56CfZdV7fNdWtra8fqpjXE/MWyA+nZgX3z1CW2WMPZxuBwwEo8TRpJJWVfiGxh4LVepkG98zkS8G6CsSn0E04Vq37pjwwVudeRQMzPAcWHIL6AJYPxMqRqR9VUIwPYmVSK5BLhu/41OMr5fABpTA7RL7xqaDVEZGzp1QcqTzyvWBpPTgzS3UmWPLxP7Zoofp4vVfeerfazydHAqWrQ0lO7iSnC4/J8V2+sO2bHXulcFu+nNz/jSQmtRcSG+gStk4s0dnss4I7ApaPT6q60ycoYVk5e87kjHmP5uj8q4aAYnuhg41vu+02eeWVV7RwQKwglkh9gJVl5gOMFhBBiOGEGyYF90F89Wc6csPOnbGbASN42ndUAqPCau2S7CUmX/3hv07WAfuXXlwpy1YskSd+n63jX3AtwbLlOfLSCv2jw/jLatUUOnToYvW3hsnelR/JXvlI6mKgNVK+yudE07GAgtU60X7MlWPG641AIihWsx3nYAdKCOQ+/mRWRlqfQaFjCsccLfR1c3frJUePHpHSsyXVPgBVQ5GY6Rw/CFFCgB1WFgQL3DlRBeVXPKHFJZrBd2O1maoSu/fm6e8YriPBCSoxh4oYrE/EsX798xzZvdunxeqJefOVW1gl+HAdBylB+81Tcy2xrdRssQPuGefOnV58ofyU/Mejj0pd5G3dKjmLXxQSGyhYrZNJTksj95OVZv/akPNgJWjR0pbWI4u1dRRg1ZmSIkEr/Do/4geZnkKTJHrttdfq2BIy3u041nid9oAM+Whmv+N+6Dww33HTF/ZXw5jHhgLrE8J3x4Rpcsc96ZJ5e5ZM+ZdZ2o3slCpazJRQ6WUAqDFMUgsbGFOI0jD1Gfxd8NVeKTunqzngWp+QqELBap1kOOtZoRSM2N30vjDnQrQmK/dwixItt67GMGOBfvERxF7057l6Of2W+ZLeq7oYHCn2yYr183SZGfQUwsIyorRp69pg4B3CgnhTNAULFpvzO5oOBOe++mAss3n35miRxfpP7pkjxcdFtyMnfPL9H4+VisoLulKDqYvVp08fCwKFbHcMXK4vuAeG9Jw+fRq9IZxqLMpQsFofeGPdxh3ECxkIgq+t47oiJVZuDGQOJpKOsXv7UI3hrU0L5ff3fi6dO1TlPI4aMF6uHjpJHl9+ix74bGrRw/XDy28yAxDHCinl3GRwv/R+Vc+CsZD4nIZiLDNjCYbGwLL+bYJ07NRBMBQnUgnmhoB7YND0M888A7cSOV4cohNF2EvY+rDwj3npHGVittRyTTaue+H3udI52S0n9/rl2M5KOV9albl+5JRP3ty8sMaFOP8/Jr0mCf4Owcx2WB7Oqg/Dh2QEB01HCwhWtQz9RqZobNqaG3QtUVHV5KzZx2yLC+5eNMTKcNdddxlLLUcanmVPaoGC1fqw8I+xNhzCsb+Wa8bjRcVLe2CdLVSJHV1yaGOllJ7wB127HQfCG2m9u1oyYfS9QcFCPAtWnUlviIWFFYrTKmoIyOwPBu7VzwrZ+gZ0VkCoTIG9aII67gFXEgFGS0hUoGC1PrTZYawPx9jAvFrOtzAIuqTQL8kpLul9mUvclr2EtQUgaBCsM+fCC096rwwdV4IwmQA83DSAHkgQzQTScJUgzOc1BCOq4Th0uKBB8amGACFEfXdljVpij2vk+MIoQMFqfbgbGMvR5kVa30FSViLSoUfVgY7dXcrCstfNPc+Uh3/Brd62lQLXz4hJqJsW7Yx3p9jASsK2Q6AbdI9wwgXrK5Zln9PS0uSpp56CeFliW1qkiVCwWh+N/p+68nzkYylduuplJAurc4eu0pxASA4eLAg+s3Hl0MnQEIwlapZO4cJ3Dp18IpqgbDJK1Pzyl7/EpkeqijWSRkLBan34Guga+fAPXtTOvUXOHq4a8wYXsUN3ex0BadA71Qp7k6PF+ja6hzDW8SoAK+7Qt/t1nA0xN1NvPpDCUW/QIWAsQViR1WrZd+lmJoWICUePHtWjBTBlGGJaYiekNnq8IqFgtUqqWQmdgwaXFeF0n2pFyJvq3MelLZYj2yqlyIeeQr90H2IXnd291+5k/OnScfLbVd+TNz9fKNsPeKXgSJ62ugqO2oIGt8/0CJpAeMkZu2RNNDPdYWGdKSuSz79cq0VLirvqcYUYnlNbXCoUCB3cSFxzZYanWu/mlZeP198Fk4DA0kLZZXw/NAxNQl2wplBeXi7Hjx/XPxfU1goE97OENBoKVuvDh39MLMfRexbJVdQnoFQyXtq0qxN07OqCslr6XuHS67BAYLmgp/Daa8dLsX+/LM79d5mz/FYtYPc+3UMWf/Dv+mYYS4gkUf3ZgbgX7ouXMpqCZcYm7lCiiWc9ss0vw5Pu1J+FzPXzpfW7j3El0SM44fpJ1QQPHQ2w2v7whz9oYYFFdPjwYd0KCwvlwIEDsn//fr2OfTgO6xKCVl8xO3XqlD43NTXVpDp4hDQaJo62PvTbpl+6PuJMpkRUPDTA41FtpXop3eZFR432lH4u1apOQkIljiMfK2g1qW1YIyZ9AQFqxHzwgqNIoDNHCrNGR7u+O8QPSaqf5a+WKdfbCapIZP3ncTP1WMZupZfLhFHTJLGjSFJH0UukaiSphvWERHu/ycSHYM+fa8e9zeBt7MfP4/Enp+tcrB49ekjPnj31OVhiLKXZZ7ZBcbFtUaInsFu3bnXOmQihI9GBgtX60KK0e+9WscvLjDf7sZLjOE9PTIEYzvzslcFJUc3MORAmCNErbzwjW/ZslGlTHq2W64Tzwk3Aanrq7hyTFdyHWFMsJqSAlYXyyNsPrJXRA+zveff1j8vGvavl6Xf+VbuqELALQWvLH2hVQLj+edxD8vLaecFKrPg5oAoEfn5wM0f1Hy+LlyxQ931ddu/+BJcZn7Pal4JgDRgwQD/X8OHD9RJuH2Z6rk20YGFB+GI8GexFAX+CrQ+fICb1hVdvOIQlM3DcEjvvJxvF/ZDdDiEylhisqTunD5cH5/yL/K+Hb5J3PlohyR06St6eT2Vj4J61YeprGTEzllgspv0y5ZdXrKsqeY/M+7l3vy9W7zHabZ3x3GBZ/Om/yxs7npId33rl0Kk91e5ReUHk9stnSid13f97Vn33a2bKzVdP0tVSX19jj5pJrnRLr66W6SH1iV1eppvYs0phJh4MIJ+uYlwLd+/e7V29enURpv2CVYZZoo3FFQkE3jG5BwWr6XDWnNbJSCUUGffcNUtvoOdr01YvAkhwCxcpEbN++/OXBccx0w2YPWcyEi9hnV2XkNCuOLFjR5/fX+k7c7p4RPfubqnwV8jaT9+RXt3TJL3/8IgfvOjP2eI7sNt2LZVYrvtsjazxviI33nhj1K0svOho6ze/r4VqWNq1ej/GO04cc7/u0Tx25oCUuook/9insvXQ3+XT/a/JP/Y8L19+u1b2HN0gR0771Hc7r8Xik+2vii/fJ/ff/KKyjMrk6eWztbX10ru/lbyCNXK+QueRQR3fdTwGVMwntmWL/VA5zIizVgmYZ+PGje7rrrtOUlJSatQPM+CzcQwTsWJORWnapCMXNRSs1olbiU+mGcgL1yYwddcIuDy//fkrujvfgHpQgVlvfqBaXmVlhffksW9WF5048qkSrFnDhqTLqJHDpPz8ecld/45YSrD6hUlORXD+VwtnBGaHztL7Fr/yhBw+vl8X94sF/fv317WxvHnL9RCh9N5V3wvrnu/cKxfOXZB3NyxSwfDTq7p06fafyjA6fLr82LmjZ3zur45v7gAhO3G+UNzde8uRswWybu9fJWPIRLlt7APi8ifIkeL9TrF6op6P5lNt7fnz5x9AvhUsTEz0Gg70OKIXEtYYpr0XClajoY3aOoFfplMVgDPeBDFxBsRBoBqpVxxTqAfw4T4nTpxQFkA7GZLeX7p07ih/UFbUkePf1PhQuJP6MyZWpRLhGWI9CzRK2yDNAXErNKRaACxfzJ2t9+G7nD1dMn3fnrxV+3ZvnrV315YJe3du6XbhXKVy7SonuFyVs1yudgs7dursLU88U/Tmjv+Wv2x+TNblr5CzZUVmfshsaRh6Fp6vv/46ZnXtSXUYdG+d6OmpVG+Zx1T+tGex8crjv5uup8QymIoEUj0g7yRPCZYHKxCtUSMvlc/zdskf/jJH5s58LngSrCtYaWagNDB15P9p4r0SSxDHQhFBBOBz85ZI7o6wFVtQaqJGgpbPl4d9XgkR6/7WEE95WZm7rKzUJ5HHYdaHvGPHjlmwokjsoUvYetlfXn4uK61Punb/7F6/Yh1PSuubHqxQgC78bTs34KX9QYT7jFXuyrUul0sPJYFoIeaye99uGTX0SundI02fNOX+sXrwMcTQWHCIi0lChdxxxx2C62MJYkDolbvssst0OgGedejQodrdQq6TYobUc+oycKrohIrfnUJCWVPr4tyuYncZ119/fZ0xPMSwPvvsM6zSJWwkdAlbL14046YBWFkQLkx6aoaj2IX2arUg9CwPmzdvli1b7Gz3/mm9tHCtePtZvQ2X0q6nPieY+mCsK5RMjrVYOUGcaNy4cbohmRPJnWJbjz5pIZSFVa/zIFjSNGvuooeC1bqZC9Ewddph+SA5EqkGZl7CwFCUSNVI4U9at956q96AaL399ttSUlIifXp1F9/BPVqsIIqw4pwTQOicLtUzdvnll0tzAWvK7/cLYkZLly6VHTt2mEMtabHAJdTPVBtLliwxAfcFQhpN8/3XSGIFMtkzUfo4aP28l6OztzHOMDBQerrUjGHh5FwlVhZKH//sZz+Tbdu2SXJyspSVlcklaf2ltLRcik4e0fc1+VzAiFhmZqaMHj1akpKSpF27dtLYOA6uxT0wU09FRUXYcyBUe/bs0WkBsKrMc4otVtnScsAPRNAwA2MF0TmARFLDmTNndO9gwLpq6Wdt9VCwWh5L7D9605xxGJMDVFtsBtcUqJiVe/mzVVWSjWgFwP/qoRMi5Kg27YUXXtAv2JEjR+Shhx7SQ1C6d+8edA9Npnxw9hrlYsJ6GzVqlEyYMEGfj5gSrC1kdEO0IDqRxAvHSkvt1HSMr+vcuXPwGAQIPZZO0PuG6ep37typx/V17dpVfzasq+LiYpiPYyU+yBLbvbak5rhOPCfMYK+QJkHBal4ssf+oERH3SP1L5+peQdXw33RBYOl1HPeolouUhnmPLg7uhEuICSYC8Sz8ky1V7mHBD37wA/nhD38YPB+z47z//vvBbWTKww0MVjfF/ZRYlZw9Lnfffbf07t1bWzqwkJDJDSsJwXFsR0qihGBBHAF6/3CeETjj8mGAMQZYo6GaAkQLQ2IwIw2WmBAjPz8fP5Oxwqm0LiooWLEHbzsSlzIlMFIfLzp6u7CEdYMlLA1jbeCFxksKKwIWBwLNiJGgDApcjABGxJCTtTZw/zkQGJPqYID7hpQER4VQXOu+8sortcWCe8IdNPdG2oKZ2dlgxMpUiYB1hIqayMGCG4TWmGoNECeIklkiSdTU28K90TOIBjEEn3/+uXzwwQdYzRLOSHPRQcGKHRAqzE03C+vI2EY3POa5w4uO7brK8yI7etOmTfrFNcmZRlxMg4gF8AU+040p7DF0JhT07KGMjCMYr9GzyvSx9EBqlFwJHfSMKp96aI+yrBCgx3OhGYExQLDQtW+W+ofg6Oo3QoSlKdNiEi5xjRE+832xD1ZXIFalx+w995zODcsROy5HLjIoWLEB1g4Uw4Ibc80118jIkSP1AVMAz0ztbgb4RgJuEXqhMFYvFIgGrA0EqxHj+fTTT4PHIEDImaptthlYSwjMh2bGO0EPJNIkEKNCvhXiVbCuYJkZjIXkbEaMQjPAIWBOUUODSEXKYUJRPbiJAGKlRMsn9mBkn8Qvltg13CGqTGOIIhSs6AOhmoXeM8SH4PqFAy85eo8Qw6lNtHAeRAvuW+jceRAGBKRxPV54uJKwuv7xj3/I9u3b9TmIaznzp+oLguvoDcRy0KBBcvPNN+s4Feo/RXMOv9qAEKN8C0BKwLp167CaJfHvCuaIHQbwii2uJEpQsKIHTAT8r+oJDWZHAhYSBAcCANEJR6goOTl48KAWvXBiBvF66aWXgkF0e8DytLA1rgywuHI/Xq3cxlUm4VRbVkhfMOVREHOLFFCPJrCqYF0BhyuInrZZEt9YqhUkpaTK+RKdgQ/B8gqJChSs6AGxykROk0nErA9GdBBYDhfTqk2wanMXAdyx9957T5YvX26Gr2gwbAcWl7P3T7dAQB3WITLYER+D4CGNANsAwuXMM4oViFshfoXvgCTRgCuIXsF6D79pIXJUmzZx1fvywY8mQ7Rag8i2Gjj4OTqgWy7zxz/+cYPECiD4DtFB8Lqhc+RBzExJ33DgnnANIVZw6SBsEKGvvvpKjhbvlR35dnoBeilHjh4s466+TD/PLbfcoq9BjlZCQjvdWwm3EOP34KLB4nHGsKINrCuTxwU3MFAgD5ZKvIuVpdq09MlTpNvI0dLn6hvk4PvvwDXMlvh/9lYBBavpWKpl33nnnTJpkh6WF6x/hGZePLhsiFOFi/9AJCAszlmVDWbevNDrTOA+kmBBrF577TVZv369DpaPHTtWPwumnIp0DY5jOnqIxLJlyyQxqb30GzhMCr/eIx9++KFMmTJFnwdXLdaCBZDKgTQGsTPEfRL/ePDP6H97RG8My/oJBAu/0CzhkJyoQMFqOtmwUCBYEBC4eBCTSJneZnIFpzUF9wdWDEbyw4JB6gIG9gKTiImgc3p6ulx66aU6eRLDU3CvcOIDsUL8CmIFi2/GjBn62SCKaOFiXuazkHaBYTrHj5+QAekjJUmJVmrXHnLiWFV9rFiXUjGC5SBHWgdzel99vXTuN0BvmPUzhQfwPxkFKwpQsJqGpdo0BNjRo4WcKQAxMkNWTIDambtksriNBQEXDcD9SkpK1pZNQju78k/l2XKprER2+HFt/Rh69eold911lxY2Z0wpVKwQUwMmhQLPiJgYRCtcz+Sbb76pZ3m5pP+lWqxagjCC1RpAr4mV/r2p1XamT54q25/+nUdqDrsijYCC1TSQb6WzsBE4h0jBQgknBBAvNIjZihUrdINl1bFTivTs3V86p7jrJRBl50ql9GyJEr9iWbRokd4HYULPJGJhf/3rX7UIIg5lxMpgUiggWEa0nD1+b769RvK277Ofp4tbWopWKlj6bwFWlZPe16jtp/VqltDKajIUrKYxHu4gBv06s9Fr4+WXX9YWEISq38BBatmwnCbMcIOG+uTnz5drVw09eRisDNcR1tFNN92kY1awtkKfCWKKHkkIFo5DYM1zrfjr38QaPFrfuyVp6ozLLcR498hRQXfQAAELpDiMEdJkKFhNw0LWN156BM7rAtUGIFawXuBy1YnLXySVKtic4PJhTHC1Q+K3khKT3H0uGZTRLiFBTpw4qsci/vrXv9bJqnA5zbCZUNFCYB/Pi3gbLL433nhDPxficAMGDZE1f/cKaTAZ6BUMR6C30COkyVCwmoa7X79+tYoVAtQQBrSNGzfqfT371CJuECm/a6GyM7x7d+Z5pXY8YqdUeJA7BRfQxLPMVO8QLbh9oc8IEUM87fnnn9fDe+BW3nfffVJaek4+/HiDXrYUrdAltFRzdwqxrgyd+g8w55AmQsFqIrVlfSOmBEsHogWrRgfhk9pHjlW5ZNWFUv90n29LXcFZj9gxkWko74JewHD5XxAt9A5CtMznO58b4w+NWJl4V8eOHeTmG6+lldUI2ivXr479DLw3EQpW0yhylHupBkTCCAWsGSyPHz8uF1Tc6VTxcZ0qEMLcvTs3Z0tk8MeOwC4SET1w/xBYR0InWiRgeaFn0IxHNCBm9frrr1cTK8P4m66jYDUMLULlJafqdR5pPBSsprF227ZtNQYBwv0zmevGNQMQB4gE0hjQ0wfRQvBdOUA5+3bVECtL7K5yqFFmYN2NXCwMk0GSKkTLCCOsOOdnGcxsMwiywwXEMyGDffXq1TpmNX369GANKlNdQZd66dNTvj1cv8kVYk3ffoPHd0hJEd+uPJ/EJ7oybOE/3rGGT/tJjYNHNupB2z4hTYaC1TRWKQtrJiokmKoMJnkUFlU4AVm4cKE8+eSTOp5VWGyXA05IaBcs7hfAcl4DkYLQ3H777br3z4kJqJtYlen1c2LKuCD14k9/+pPO5/r+978vmJoqMHW6dhdN2Rfki40aOTRuBEv1iuYkSoIMGTHOC3GvkIq1cSheC5Uwzf/0sYdkmBItDM05f+qUbHv6d0awWGwwClCwmgZqHRUp98ptBAvCAdGKVH0Bca2rr75aJ30iBQHW1pEjR9wnT550o1QwcrlMJVIIFZYIQsNCijSdllO0IDjhOgE6deoky//2phwq/Fp+9KMfycCBA7Ww4lxcHxqLgyu5ZetOOXEynrwYv0f9BDwQr8EjrlDCVTk3joQLOVbugpXL56gWeswrnHwiKlCwmgbe5oXKwppjrCwzIDlSfSsIFo4NHjxYN1MFwVRtwHa4ayEqOG5EJtxxfLZxRZ0CBIsK9dqTO6ZK956XyIVKl3Yhw1WAcHLVlRlxG8tSwpWlhCsrzoQrW+xhRBiK0y2wzyssLxM1OC9h08H/rD7EhUwMqDYRgLsVbhyfGVuIOFM4IFIQQgiSGRAdinFBIWwAHQJ4rl/96ldS6U+QlECgf8eXe1Wg3qpzpuIhg9Ml3gkIV8GQEVfMkfjAJ3bdruxA8wqJGhSsplPUOcU9F67dH//4R72jtoqckQQLFhEExNQ9D0eoIIVi3EGIHjLfMW0XguvIXO83cGgwneJs6TkpKi6pcb2pP2UYMtiS7t3cOhWjOWlkpnv2kJFXzBfSpqFLGAUu6XephSEyyGmqLX5VF7CgIEbhyswA0+OHiguRXEOUMM7JydHjCU15mHDDf5AcetnokcHEVlOuxgBRxf0HK9E6HJiWK+7xy6yhI65w5+/azAkq2igUrCiB2BBALSm86AhshwNWUOjEDAa4hXD5TC9jOCBqOIbzQmNlSJnAEBu4gngeWFaoABGOwkPfamsP4mfcWDw3RBHbZm7A0rNntGWW2EKVGxqK6kXMGjL8iq17d2/mQOM2CAUrGrhU8N1fJVqoxOD1evW4vtBywrUJlhlCY3oaIwXuYWUhGRTnYR2DnyFUqOOOvK5Bg0fXWfkBQ2/Wrd8gqSldItbHQgdBWfkF2f5lvh5wjVpdKJHcXJgJKBoB4lkUrDYIY1hRwF/h8pl1iFbvSwbpdACUTEbvnCnGB0ycKlIRPGPlwLqJhCnct3LlSpk6dar+jJLTpdr9c8aq6qK83O4pjBRzw2eMHWu7twkJiTpTvznJz8+vfShTJFziHjq0kX45iWtoYUWBivIKb2LHBFhZ2o8zGeym9AsastzRUC0UIGYULgYFsYqUwgBXD1N4Yf5BpFEAu0zNsAaXqQGwzuqarbl3L7uiKUQDn4sZdJoD1HGHu5pScwhTvfC3k5Yr6EViBgUrCvh8eUWqWx1d2cGudbzgfZSlBYsLwrX2w4+0cGE4DSZzwMSq1113nd6G22imqQcInKOnDOKE8jWoTAqBOhIIficmJdcZowril9mudpVevz8h1wiqobS0VNZ+tF72feWTwsJvgxUaund3S7+0vjJ61AgdmAcQxMKv83VOl8kdixUobIiZfmBdGTe7obgqOG6vLcJpvqKEZWW4E5NdueJyRXRFzpQUq0B3kZSfK1Uv5VmpLxAlWFIQjfpWJvWL3+cS//S9u+wSNYNHXFHgilDiZED/NOnatYuKZ6Xo7aPHjqueweNy6lSJTmsw2e4QXjRM+4WhPbEA7jIGZsONbqzliO++b9eW+E8iIw2GghVFrBEZVqLftbI20TKgTjvKHVdWVEiFWr9wvix4DAKV0C5RkpM7SpKewLSd1JtAPa0L5yoXwPIzu5UFWKPI1NDBltw20SMdkpPD3mr7l7vlk/Wfa+EyGNFCLM7j8TQ6hSMUdDLAekMrLz8vfdIGNaFMc+UEI9SkbUHBigFDhmfM8rtcM13isqS5iCBUQAupJBQ49yUnt5eHHqw7XWnvXp+sfGNNtX0ozYypv1AqxwzyhnA1dF5FiJSZlANjJbENSxKdFk2YAGPu3l21lukhrRgKVgwZPCIjy+VKmIRBu0pMoh4Ehuuj7rva5apcVZtFEU6wQOadE7WVFYlzKpb07pq1kr+vIOxx1PUqKT6hS+UAXZZGiZapDoFtZ1DfDF2C2wehMiVtjMuLmFxjXMAgKl7H/Ku2DQWrmRgyIsPjcsmYysqEdJfLP0b5Z1a9LTBlPaGmu8vlyvNXyn5xVeZViHjrO+BXx9c6KsHy1+w5w/CboUMs6dWzhxIX2zUsLi6RAwe/kc1btmnRqgu4t6VnTqugfYl2c2GBOV1cJ6HuLtw+5Hg1yO0NAcKdkOCfnP9lXp6QNg0Fq4WBmEgHcSeGBMQvmIJvyiAJdfEaA9xUcSU061g7CBlK5hgwq09ThKkGepIO11xaVRcPFKyLCLiGSS6Z5Pe7MrW1VY/OgfjE71VW6qrzpbIkGmJOWg8UrIscY+FV26msOuxTtpBHua3T1J+JR1oavx8VDFfr2YTYA3jRQsEidQJRa9dePMql9CD+1iwCpgRK9bSqmFTl2opzsoqWFAEULNIohn4nI6Pyguo4SEjIUB0CblvIdLUES3UuuOvqFdWJrZgcNjBJrPpD3O+XShU8l7zzZzGumwJFCGkBEDsTQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIQ3l/wMvNv557ac0YgAAAABJRU5ErkJggg=="}))));function kS(e){var{sx:t}=e,n=Nn(e,["sx"]);return Os.jsx(z,{...n,sx:Object.assign(Object.assign({},t),{display:"flex",flexDirection:"column",overflow:"hidden"})})}function CS({params:t,scrollRef:i,tokenAndPoolFilter:o,operatePMMPoolElement:a,operatePool:s,onOperatePool:l,getMigrationPairAndMining:d}){var c,u,p;const{isMobile:h}=wy(),m=g(),y=pf((e=>e.noDocumentLink)),x=at.useRef(null),{account:v}=At(),{poolTab:b,tabs:A,handleChangePoolTab:w}=function({account:e,paramsTab:t}){const{i18n:r}=n(),[i,o]=at.useState(cS.addLiquidity),{supportAMMV2:a,supportAMMV3:s,notSupportPMM:l}=pf(),d=at.useMemo((()=>{const e=[{key:cS.addLiquidity,value:r._({id:"OBdohg",message:"Add Liquidity"})},{key:cS.myLiquidity,value:r._({id:"YHc3B+",message:"My Liquidity"})}];return l||e.push({key:cS.myCreated,value:a||s?r._({id:"zcVtwU",message:"My Pools (PMM)"}):r._({id:"fZFkP1",message:"My Pools"})}),e}),[r._,a,s,l]),c=at.useRef(!1);at.useEffect((()=>{const t=sessionStorage.getItem(lS);e&&t&&!c.current&&(c.current=!0,o(t))}),[e]);const u=e=>{o(e),sessionStorage.setItem(lS,e)};return at.useEffect((()=>{t&&u(t)}),[t]),{poolTab:i,tabs:d,handleChangePoolTab:u}}({account:v,paramsTab:null==t?void 0:t.tab}),{activeChainId:k,filterChainIds:j,handleChangeActiveChainId:T}=function(){const{chainId:e}=At(),{onlyChainId:t,defaultChainId:n}=pf(),[r,i]=at.useState(t),o=at.useMemo((()=>void 0!==r?[r]:$g(e)?void 0:Object.values(oe).filter((e=>!!Number(e)))),[e,r]);return at.useEffect((()=>{const e=Number(sessionStorage.getItem(dS));e&&i(e)}),[]),at.useEffect((()=>{!sessionStorage.getItem(dS)&&n&&i(n)}),[n]),{activeChainId:r,filterChainIds:o,handleChangeActiveChainId:e=>{void 0===e?sessionStorage.removeItem(dS):sessionStorage.setItem(dS,String(e)),i(e)}}}(),[E,S]=at.useState(s||null),I=e=>{if(l){if(l(e))return}S(e)};return at.useEffect((()=>{S(s||null)}),[s]),Os.jsxs(xw,{sx:Object.assign({},h?{p:20}:{display:"flex",gap:12,flex:1}),ref:x,children:[Os.jsxs(H,{value:b,onChange:(e,t)=>{w(t)},sx:h?{}:{display:"flex",flexDirection:"column",borderRadius:16,backgroundColor:"background.paper",flex:1,overflow:"hidden",height:"max-content",maxHeight:"100%"},className:h?void 0:"gradient-card-border",children:[Os.jsxs(f,{sx:Object.assign({},h?Object.assign({},!v&&{pb:20,display:"flex",justifyContent:"space-between",borderStyle:"solid",borderWidth:"0 0 1px"}):{display:"flex",justifyContent:"space-between",p:20,borderBottomWidth:1}),children:[v?Os.jsx(_,{tabs:A,variant:"rounded",tabsListSx:Object.assign({justifyContent:"space-between"},h?{mb:16}:{borderBottomWidth:0}),tabSx:h?void 0:{mb:0}}):Os.jsxs(f,{sx:{display:"flex",alignItems:"center",fontWeight:600},children:[h?"":Os.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,backgroundColor:C(m.palette.secondary.main,.3),borderRadius:6,mr:4,color:"warning.main"},children:Os.jsx(f,{component:As.Fee,sx:{width:16,height:16}})}),Os.jsx(e,{id:"OBdohg",message:"Add Liquidity"})]}),Os.jsx(sS,{})]}),Os.jsx(kS,{value:cS.addLiquidity,sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:Os.jsx(oS,{account:v,filterChainIds:j,scrollParentRef:null!=i?i:x,activeChainId:k,handleChangeActiveChainId:T,operatePool:E,setOperatePool:I,tokenAndPoolFilter:o,getMigrationPairAndMining:d})}),Os.jsx(kS,{value:cS.myLiquidity,children:Os.jsx(xS,{account:v,filterChainIds:j,activeChainId:k,handleChangeActiveChainId:T,operatePool:E,setOperatePool:I,tokenAndPoolFilter:o,getMigrationPairAndMining:d})}),Os.jsx(kS,{value:cS.myCreated,children:Os.jsx(mS,{account:v,filterChainIds:j,activeChainId:k,handleChangeActiveChainId:T,operatePool:E,setOperatePool:I})})]}),Os.jsxs(f,{sx:{position:"relative",width:h?"100%":y&&!E?"auto":375},children:[!y&&Os.jsx(gw,{title:r._({id:"6y2TB3",message:"Liquidity"}),desc:r._({id:"QNrpkx",message:"Classical AMM-like pool. Suitable for most assets."}),linkTo:"https://docs.dodoex.io/product/tutorial/how-to-provide-liquidity",LeftImage:wS,sx:Object.assign(Object.assign({},h&&{mt:20}),!!E&&{display:"none"})}),"AMMV3"===(null===(c=null==E?void 0:E.pool)||void 0===c?void 0:c.type)&&E.pool.chainId?b===cS.myLiquidity&&(null===(p=null===(u=E.pool.liquidityPositions)||void 0===u?void 0:u[0])||void 0===p?void 0:p.tokenId)?Os.jsx(rT,{baseToken:E.pool.baseToken,quoteToken:E.pool.quoteToken,feeAmount:Number(E.pool.lpFeeRate),tokenId:E.pool.liquidityPositions[0].tokenId,chainId:E.pool.chainId,onClose:()=>I(null)}):Os.jsx(lT,{chainId:E.pool.chainId,baseToken:E.pool.baseToken,quoteToken:E.pool.quoteToken,feeAmount:Number(E.pool.lpFeeRate),onClose:()=>I(null),handleGoToAddLiquidityV3:e=>{fw.getState().push({type:pw.createPoolAMMV3,params:e})}}):Os.jsx(Os.Fragment,{children:null!=a?a:Os.jsx(Os.Fragment,{children:h?Os.jsx(wE,{account:v,onClose:()=>I(null),modal:h,...E}):Os.jsx(f,{sx:{position:"absolute",top:E?0:"100%",height:E?"max-content":0,transition:`all ${my}ms`,zIndex:20,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",borderRadius:16,maxHeight:"max-content"},children:Os.jsx(AE,{account:v,onClose:()=>I(null),...E,sx:{width:375,height:"max-content",backgroundColor:"background.paper",borderRadius:16,overflow:"hidden"}})})})})]})]})}function jS({sx:t,onClick:n}){const r=g();return Os.jsxs(I,{onClick:()=>{n?n():fw.getState().back()},sx:u({display:"inline-flex",alignItems:"center",cursor:"pointer","& > svg":{mr:10}},t),children:[Os.jsx(f,{sx:{color:r.palette.text.secondary,width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",borderColor:r.palette.border.main,borderStyle:"solid",borderWidth:1,borderRadius:"50%",backgroundColor:r.palette.background.paper,mr:6},children:Os.jsx(As.ArrowBack,{})}),Os.jsx(e,{id:"CKyk7Q",message:"Go back"})]})}var TS,ES,SS,IS,RS,LS,MS,OS,BS,PS,DS,NS,FS;function WS(){return WS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},WS.apply(null,arguments)}const VS=e=>ot.createElement("svg",WS({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),TS||(TS=ot.createElement("rect",{x:28.5,y:214,width:40,height:6,fill:"url(#paint0_linear_5229_28889)"})),ES||(ES=ot.createElement("rect",{x:88.5,y:208,width:40,height:12,fill:"url(#paint1_linear_5229_28889)"})),SS||(SS=ot.createElement("rect",{x:148.5,y:201,width:40,height:19,fill:"url(#paint2_linear_5229_28889)"})),IS||(IS=ot.createElement("rect",{x:208.5,y:188,width:40,height:32,fill:"url(#paint3_linear_5229_28889)"})),RS||(RS=ot.createElement("rect",{x:268.5,y:170,width:40,height:50,fill:"url(#paint4_linear_5229_28889)"})),LS||(LS=ot.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint5_linear_5229_28889)"})),MS||(MS=ot.createElement("rect",{width:40,height:6,transform:"matrix(-1 0 0 1 708.5 214)",fill:"url(#paint6_linear_5229_28889)"})),OS||(OS=ot.createElement("rect",{width:40,height:12,transform:"matrix(-1 0 0 1 648.5 208)",fill:"url(#paint7_linear_5229_28889)"})),BS||(BS=ot.createElement("rect",{width:40,height:19,transform:"matrix(-1 0 0 1 588.5 201)",fill:"url(#paint8_linear_5229_28889)"})),PS||(PS=ot.createElement("rect",{width:40,height:32,transform:"matrix(-1 0 0 1 528.5 188)",fill:"url(#paint9_linear_5229_28889)"})),DS||(DS=ot.createElement("rect",{width:40,height:50,transform:"matrix(-1 0 0 1 468.5 170)",fill:"url(#paint10_linear_5229_28889)"})),NS||(NS=ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint11_linear_5229_28889)"})),FS||(FS=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_5229_28889",x1:48.5,y1:214,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint1_linear_5229_28889",x1:108.5,y1:208,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint2_linear_5229_28889",x1:168.5,y1:201,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint3_linear_5229_28889",x1:228.5,y1:188,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint4_linear_5229_28889",x1:288.5,y1:170,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint5_linear_5229_28889",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint6_linear_5229_28889",x1:20,y1:0,x2:20,y2:6,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint7_linear_5229_28889",x1:20,y1:0,x2:20,y2:12,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint8_linear_5229_28889",x1:20,y1:0,x2:20,y2:19,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint9_linear_5229_28889",x1:20,y1:0,x2:20,y2:32,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint10_linear_5229_28889",x1:20,y1:0,x2:20,y2:50,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint11_linear_5229_28889",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})))));var US,HS,qS,ZS,zS,QS,GS,YS,XS,JS,KS,_S,$S;function eI(){return eI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eI.apply(null,arguments)}const tI=e=>ot.createElement("svg",eI({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),US||(US=ot.createElement("rect",{x:28.5,y:214,width:40,height:6,fill:"url(#paint0_linear_3900_354238)"})),HS||(HS=ot.createElement("rect",{x:88.5,y:208,width:40,height:12,fill:"url(#paint1_linear_3900_354238)"})),qS||(qS=ot.createElement("rect",{x:148.5,y:201,width:40,height:19,fill:"url(#paint2_linear_3900_354238)"})),ZS||(ZS=ot.createElement("rect",{x:208.5,y:188,width:40,height:32,fill:"url(#paint3_linear_3900_354238)"})),zS||(zS=ot.createElement("rect",{x:268.5,y:170,width:40,height:50,fill:"url(#paint4_linear_3900_354238)"})),QS||(QS=ot.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint5_linear_3900_354238)"})),GS||(GS=ot.createElement("rect",{width:40,height:6,transform:"matrix(-1 0 0 1 708.5 214)",fill:"url(#paint6_linear_3900_354238)"})),YS||(YS=ot.createElement("rect",{width:40,height:12,transform:"matrix(-1 0 0 1 648.5 208)",fill:"url(#paint7_linear_3900_354238)"})),XS||(XS=ot.createElement("rect",{width:40,height:19,transform:"matrix(-1 0 0 1 588.5 201)",fill:"url(#paint8_linear_3900_354238)"})),JS||(JS=ot.createElement("rect",{width:40,height:32,transform:"matrix(-1 0 0 1 528.5 188)",fill:"url(#paint9_linear_3900_354238)"})),KS||(KS=ot.createElement("rect",{width:40,height:50,transform:"matrix(-1 0 0 1 468.5 170)",fill:"url(#paint10_linear_3900_354238)"})),_S||(_S=ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint11_linear_3900_354238)"})),$S||($S=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_3900_354238",x1:48.5,y1:214,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint1_linear_3900_354238",x1:108.5,y1:208,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint2_linear_3900_354238",x1:168.5,y1:201,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint3_linear_3900_354238",x1:228.5,y1:188,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint4_linear_3900_354238",x1:288.5,y1:170,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint5_linear_3900_354238",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint6_linear_3900_354238",x1:20,y1:0,x2:20,y2:6,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint7_linear_3900_354238",x1:20,y1:0,x2:20,y2:12,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint8_linear_3900_354238",x1:20,y1:0,x2:20,y2:19,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint9_linear_3900_354238",x1:20,y1:0,x2:20,y2:32,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint10_linear_3900_354238",x1:20,y1:0,x2:20,y2:50,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint11_linear_3900_354238",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})))));var nI,rI,iI,oI,aI,sI,lI,dI,cI,uI,pI,hI,mI,fI;function gI(){return gI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gI.apply(null,arguments)}const yI=e=>ot.createElement("svg",gI({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),nI||(nI=ot.createElement("g",{clipPath:"url(#clip0_5057_344879)"},ot.createElement("rect",{x:-10.5,y:160,width:40,height:60,fill:"url(#paint0_linear_5057_344879)"}),ot.createElement("rect",{x:49.5,y:120,width:40,height:100,fill:"url(#paint1_linear_5057_344879)"}),ot.createElement("rect",{x:109.5,y:60,width:40,height:160,fill:"url(#paint2_linear_5057_344879)"}),ot.createElement("rect",{x:169.5,width:40,height:220,fill:"url(#paint3_linear_5057_344879)"}),ot.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 549.5 200)",fill:"url(#paint4_linear_5057_344879)"}),ot.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 489.5 180)",fill:"url(#paint5_linear_5057_344879)"}),ot.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 429.5 160)",fill:"url(#paint6_linear_5057_344879)"}),ot.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 369.5 120)",fill:"url(#paint7_linear_5057_344879)"}),ot.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 309.5 60)",fill:"url(#paint8_linear_5057_344879)"}),ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 249.5 0)",fill:"url(#paint9_linear_5057_344879)"}))),rI||(rI=ot.createElement("rect",{x:28.5,y:200,width:40,height:20,fill:"url(#paint10_linear_5057_344879)"})),iI||(iI=ot.createElement("rect",{x:88.5,y:180,width:40,height:40,fill:"url(#paint11_linear_5057_344879)"})),oI||(oI=ot.createElement("rect",{x:148.5,y:160,width:40,height:60,fill:"url(#paint12_linear_5057_344879)"})),aI||(aI=ot.createElement("rect",{x:208.5,y:120,width:40,height:100,fill:"url(#paint13_linear_5057_344879)"})),sI||(sI=ot.createElement("rect",{x:268.5,y:60,width:40,height:160,fill:"url(#paint14_linear_5057_344879)"})),lI||(lI=ot.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint15_linear_5057_344879)"})),dI||(dI=ot.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint16_linear_5057_344879)"})),cI||(cI=ot.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint17_linear_5057_344879)"})),uI||(uI=ot.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint18_linear_5057_344879)"})),pI||(pI=ot.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint19_linear_5057_344879)"})),hI||(hI=ot.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint20_linear_5057_344879)"})),mI||(mI=ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint21_linear_5057_344879)"})),fI||(fI=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_5057_344879",x1:9.5,y1:160,x2:9.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint1_linear_5057_344879",x1:69.5,y1:120,x2:69.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint2_linear_5057_344879",x1:129.5,y1:60,x2:129.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint3_linear_5057_344879",x1:189.5,y1:0,x2:189.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint4_linear_5057_344879",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint5_linear_5057_344879",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint6_linear_5057_344879",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint7_linear_5057_344879",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint8_linear_5057_344879",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint9_linear_5057_344879",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"white",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint10_linear_5057_344879",x1:48.5,y1:200,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint11_linear_5057_344879",x1:108.5,y1:180,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint12_linear_5057_344879",x1:168.5,y1:160,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint13_linear_5057_344879",x1:228.5,y1:120,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint14_linear_5057_344879",x1:288.5,y1:60,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint15_linear_5057_344879",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint16_linear_5057_344879",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint17_linear_5057_344879",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint18_linear_5057_344879",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint19_linear_5057_344879",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint20_linear_5057_344879",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint21_linear_5057_344879",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("clipPath",{id:"clip0_5057_344879"},ot.createElement("rect",{width:737,height:220,fill:"white"})))));var xI,vI,bI,AI,wI,kI,CI,jI,TI,EI,SI,II,RI,LI;function MI(){return MI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MI.apply(null,arguments)}const OI=e=>ot.createElement("svg",MI({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),xI||(xI=ot.createElement("g",{clipPath:"url(#clip0_5057_344817)"},ot.createElement("rect",{x:-10.5,y:160,width:40,height:60,fill:"url(#paint0_linear_5057_344817)"}),ot.createElement("rect",{x:49.5,y:120,width:40,height:100,fill:"url(#paint1_linear_5057_344817)"}),ot.createElement("rect",{x:109.5,y:60,width:40,height:160,fill:"url(#paint2_linear_5057_344817)"}),ot.createElement("rect",{x:169.5,width:40,height:220,fill:"url(#paint3_linear_5057_344817)"}),ot.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 549.5 200)",fill:"url(#paint4_linear_5057_344817)"}),ot.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 489.5 180)",fill:"url(#paint5_linear_5057_344817)"}),ot.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 429.5 160)",fill:"url(#paint6_linear_5057_344817)"}),ot.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 369.5 120)",fill:"url(#paint7_linear_5057_344817)"}),ot.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 309.5 60)",fill:"url(#paint8_linear_5057_344817)"}),ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 249.5 0)",fill:"url(#paint9_linear_5057_344817)"}))),vI||(vI=ot.createElement("rect",{x:28.5,y:200,width:40,height:20,fill:"url(#paint10_linear_5057_344817)"})),bI||(bI=ot.createElement("rect",{x:88.5,y:180,width:40,height:40,fill:"url(#paint11_linear_5057_344817)"})),AI||(AI=ot.createElement("rect",{x:148.5,y:160,width:40,height:60,fill:"url(#paint12_linear_5057_344817)"})),wI||(wI=ot.createElement("rect",{x:208.5,y:120,width:40,height:100,fill:"url(#paint13_linear_5057_344817)"})),kI||(kI=ot.createElement("rect",{x:268.5,y:60,width:40,height:160,fill:"url(#paint14_linear_5057_344817)"})),CI||(CI=ot.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint15_linear_5057_344817)"})),jI||(jI=ot.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint16_linear_5057_344817)"})),TI||(TI=ot.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint17_linear_5057_344817)"})),EI||(EI=ot.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint18_linear_5057_344817)"})),SI||(SI=ot.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint19_linear_5057_344817)"})),II||(II=ot.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint20_linear_5057_344817)"})),RI||(RI=ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint21_linear_5057_344817)"})),LI||(LI=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_5057_344817",x1:9.5,y1:160,x2:9.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint1_linear_5057_344817",x1:69.5,y1:120,x2:69.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint2_linear_5057_344817",x1:129.5,y1:60,x2:129.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint3_linear_5057_344817",x1:189.5,y1:0,x2:189.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint4_linear_5057_344817",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint5_linear_5057_344817",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint6_linear_5057_344817",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint7_linear_5057_344817",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint8_linear_5057_344817",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint9_linear_5057_344817",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),ot.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint10_linear_5057_344817",x1:48.5,y1:200,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint11_linear_5057_344817",x1:108.5,y1:180,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint12_linear_5057_344817",x1:168.5,y1:160,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint13_linear_5057_344817",x1:228.5,y1:120,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint14_linear_5057_344817",x1:288.5,y1:60,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint15_linear_5057_344817",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint16_linear_5057_344817",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint17_linear_5057_344817",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint18_linear_5057_344817",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint19_linear_5057_344817",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint20_linear_5057_344817",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint21_linear_5057_344817",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("clipPath",{id:"clip0_5057_344817"},ot.createElement("rect",{width:737,height:220,fill:"white"})))));var BI,PI,DI,NI,FI,WI,VI,UI,HI,qI,ZI,zI,QI;function GI(){return GI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},GI.apply(null,arguments)}const YI=e=>ot.createElement("svg",GI({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),BI||(BI=ot.createElement("rect",{x:28.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),PI||(PI=ot.createElement("rect",{x:88.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),DI||(DI=ot.createElement("rect",{x:148.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),NI||(NI=ot.createElement("rect",{x:208.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),FI||(FI=ot.createElement("rect",{x:268.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),WI||(WI=ot.createElement("rect",{x:328.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),VI||(VI=ot.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint0_linear_5229_28865)"})),UI||(UI=ot.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint1_linear_5229_28865)"})),HI||(HI=ot.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint2_linear_5229_28865)"})),qI||(qI=ot.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint3_linear_5229_28865)"})),ZI||(ZI=ot.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint4_linear_5229_28865)"})),zI||(zI=ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint5_linear_5229_28865)"})),QI||(QI=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_5229_28865",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint1_linear_5229_28865",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint2_linear_5229_28865",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint3_linear_5229_28865",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint4_linear_5229_28865",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint5_linear_5229_28865",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})))));var XI,JI,KI,_I,$I,eR,tR,nR,rR,iR,oR,aR,sR;function lR(){return lR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lR.apply(null,arguments)}const dR=e=>ot.createElement("svg",lR({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),XI||(XI=ot.createElement("rect",{x:28.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),JI||(JI=ot.createElement("rect",{x:88.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),KI||(KI=ot.createElement("rect",{x:148.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),_I||(_I=ot.createElement("rect",{x:208.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),$I||($I=ot.createElement("rect",{x:268.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),eR||(eR=ot.createElement("rect",{x:328.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),tR||(tR=ot.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint0_linear_3900_354262)"})),nR||(nR=ot.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint1_linear_3900_354262)"})),rR||(rR=ot.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint2_linear_3900_354262)"})),iR||(iR=ot.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint3_linear_3900_354262)"})),oR||(oR=ot.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint4_linear_3900_354262)"})),aR||(aR=ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint5_linear_3900_354262)"})),sR||(sR=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_3900_354262",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint1_linear_3900_354262",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint2_linear_3900_354262",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint3_linear_3900_354262",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint4_linear_3900_354262",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint5_linear_3900_354262",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})))));var cR,uR,pR,hR,mR,fR,gR,yR,xR,vR,bR,AR,wR;function kR(){return kR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kR.apply(null,arguments)}const CR=e=>ot.createElement("svg",kR({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),cR||(cR=ot.createElement("rect",{x:28.5,y:200,width:40,height:20,fill:"url(#paint0_linear_5229_28987)"})),uR||(uR=ot.createElement("rect",{x:88.5,y:180,width:40,height:40,fill:"url(#paint1_linear_5229_28987)"})),pR||(pR=ot.createElement("rect",{x:148.5,y:160,width:40,height:60,fill:"url(#paint2_linear_5229_28987)"})),hR||(hR=ot.createElement("rect",{x:208.5,y:120,width:40,height:100,fill:"url(#paint3_linear_5229_28987)"})),mR||(mR=ot.createElement("rect",{x:268.5,y:60,width:40,height:160,fill:"url(#paint4_linear_5229_28987)"})),fR||(fR=ot.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint5_linear_5229_28987)"})),gR||(gR=ot.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint6_linear_5229_28987)"})),yR||(yR=ot.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint7_linear_5229_28987)"})),xR||(xR=ot.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint8_linear_5229_28987)"})),vR||(vR=ot.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint9_linear_5229_28987)"})),bR||(bR=ot.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint10_linear_5229_28987)"})),AR||(AR=ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint11_linear_5229_28987)"})),wR||(wR=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_5229_28987",x1:48.5,y1:200,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint1_linear_5229_28987",x1:108.5,y1:180,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint2_linear_5229_28987",x1:168.5,y1:160,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint3_linear_5229_28987",x1:228.5,y1:120,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint4_linear_5229_28987",x1:288.5,y1:60,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint5_linear_5229_28987",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint6_linear_5229_28987",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint7_linear_5229_28987",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint8_linear_5229_28987",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint9_linear_5229_28987",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint10_linear_5229_28987",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint11_linear_5229_28987",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})))));var jR,TR,ER,SR,IR,RR,LR,MR,OR,BR,PR,DR,NR;function FR(){return FR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FR.apply(null,arguments)}const WR=e=>ot.createElement("svg",FR({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),jR||(jR=ot.createElement("rect",{x:28.5,y:200,width:40,height:20,fill:"url(#paint0_linear_4437_25449)"})),TR||(TR=ot.createElement("rect",{x:88.5,y:180,width:40,height:40,fill:"url(#paint1_linear_4437_25449)"})),ER||(ER=ot.createElement("rect",{x:148.5,y:160,width:40,height:60,fill:"url(#paint2_linear_4437_25449)"})),SR||(SR=ot.createElement("rect",{x:208.5,y:120,width:40,height:100,fill:"url(#paint3_linear_4437_25449)"})),IR||(IR=ot.createElement("rect",{x:268.5,y:60,width:40,height:160,fill:"url(#paint4_linear_4437_25449)"})),RR||(RR=ot.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint5_linear_4437_25449)"})),LR||(LR=ot.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint6_linear_4437_25449)"})),MR||(MR=ot.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint7_linear_4437_25449)"})),OR||(OR=ot.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint8_linear_4437_25449)"})),BR||(BR=ot.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint9_linear_4437_25449)"})),PR||(PR=ot.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint10_linear_4437_25449)"})),DR||(DR=ot.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint11_linear_4437_25449)"})),NR||(NR=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_4437_25449",x1:48.5,y1:200,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint1_linear_4437_25449",x1:108.5,y1:180,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint2_linear_4437_25449",x1:168.5,y1:160,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint3_linear_4437_25449",x1:228.5,y1:120,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint4_linear_4437_25449",x1:288.5,y1:60,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint5_linear_4437_25449",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint6_linear_4437_25449",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint7_linear_4437_25449",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint8_linear_4437_25449",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint9_linear_4437_25449",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint10_linear_4437_25449",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),ot.createElement("linearGradient",{id:"paint11_linear_4437_25449",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),ot.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})))));var VR,UR;function HR(){const e="https://docs.dodoex.io/product/tutorial/how-to-create-pools#learn-more-about-the-characteristics-of-different-pool-models",t=[{version:UR.standard,title:r._({id:"TJBHlP",message:"Standard"}),description:r._({id:"QNrpkx",message:"Classical AMM-like pool. Suitable for most assets."}),exampleImgUrl:WR,exampleDarkImgUrl:CR,docUrl:e,initPriceLabel:r._({id:"d2CZvA",message:"Initial Price"}),initPriceTips:r._({id:"5OKrbq",message:"Since this pool uses the PMM algorithm, which is different from the normal AMM pool mechanism, the initial price calculation is also different from AMM."}),initPriceTipsLink:"https://docs.dodoex.io/en/product/dodo-v2-pools/dodo-vending-machine/dvm-initial-price-formula-explanation"},{version:UR.pegged,title:r._({id:"J7M/DA",message:"Pegged"}),description:r._({id:"RvYEUJ",message:"Suitable for synthetic assets. The liquidity is super concentrated at some price like Curve Finance."}),exampleImgUrl:tI,exampleDarkImgUrl:VS,docUrl:e,initPriceLabel:r._({id:"4ogEAw",message:"Pegged Exchange Rate"}),initPriceTips:r._({id:"M9dIDb",message:"The pegged exchange rate refers to the exchange rate between two token assets where one's value is pegged/fixed by the other. For example, the pegged exchange rate between the US Dollar and USDT is 1."})},{version:UR.singleToken,title:r._({id:"34w3mT",message:"Single-Token"}),description:r._({id:"a1AzKr",message:"For those who are looking to sell tokens and only need ask-side liquidity."}),exampleImgUrl:dR,exampleDarkImgUrl:YI,docUrl:e,initPriceLabel:r._({id:"d2CZvA",message:"Initial Price"}),initPriceTips:r._({id:"HGf8fG",message:"You can set the minimum selling price for single-token pools."})},{version:UR.marketMakerPool,title:r._({id:"4vKwIV",message:"Private Pool"}),description:r._({id:"pKjCsP",message:"100% use your own funds and enjoy the maximum degree of flexibility."}),exampleImgUrl:OI,exampleDarkImgUrl:yI,docUrl:e,initPriceLabel:r._({id:"CeLrge",message:"Mid Price"}),initPriceTips:r._({id:"GGPOuT",message:"set current mid price"})}],n=t.reduce(((e,t)=>(e[t.version]=t,e)),{});return{versionList:t,versionMap:n,subPeggedVersionList:qR()}}function qR(){return[{version:VR.DSP,title:r._({id:"D1bhHv",message:"The pool’s market-making price is fixed"}),description:r._({id:"lgE483",message:"Once created, the price cannot be changed. This option applies to assets like ETH-WETH."})},{version:VR.GSP,title:r._({id:"LVzIav",message:"The pool’s market-making price can be adjusted"}),description:r._({id:"KkjUUb",message:"Once created, you can adjust the pool’s market-making price at any time. This option is suitable for assets with fluctuating pegged prices. Adjusting the pool’s market-making price allows for more competitive quotes."})}]}function ZR(){return qR().reduce(((e,t)=>(e[t.version]=t,e)),{})}!function(e){e.DSP="dsp",e.GSP="gsp"}(VR||(VR={})),function(e){e.standard="standard",e.singleToken="single-token",e.pegged="pagged",e.marketMakerPool="market-maker-pool"}(UR||(UR={}));const zR="0.3",QR=.01,GR=10,YR="1",XR="0.0000000000001",JR=1e8,KR="1",_R="0.0001",$R="0.1",eL=8;function tL({selectedVersion:e,quoteToken:t,initPrice:n,midPrice:r}){return e===UR.standard?!r||r.isZero()?null:An({input:r,decimals:t.decimals}):An({input:n,decimals:t.decimals})}function nL({initPrice:e}){const t=new i(e);if(!t.isFinite()||t.lte(0))return{base:null,quote:null};const n=new i(1),r=n.dividedBy(n.plus(t)).dp(eL,i.ROUND_DOWN);return{base:r,quote:n.minus(r).dp(eL,i.ROUND_DOWN)}}function rL({chainId:e,baseToken:t,quoteToken:n}){const r=ue[e];return!(!t||!n)&&(!(!ds(t.address,r.address)||!ds(n.address,r.wrappedTokenAddress))||!(!ds(t.address,r.wrappedTokenAddress)||!ds(n.address,r.address)))}function iL({title:e,children:t,isWaiting:n}){const r=g();return Os.jsxs(f,{sx:{padding:16,borderRadius:8,backgroundColor:r.palette.background.paper,flexGrow:1,flexBasis:"100%"},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",gap:8,typography:"h5"},children:n?"-":t}),Os.jsx(f,{sx:{typography:"h6",fontWeight:500,color:r.palette.text.secondary,mt:8},children:e})]})}function oL({status:t,selectedVersion:n,baseToken:r,quoteToken:i,initPrice:o,slippageCoefficient:a,midPrice:s,sx:l}){var d;const{versionMap:c}=HR(),u="waiting"===t,{initPriceLabel:p}=c[n];return r&&i?Os.jsx(Os.Fragment,{children:Os.jsxs(f,{sx:Object.assign({mt:0,display:"flex",alignItems:"stretch",gap:12,opacity:u?.5:1},l),children:[Os.jsxs(iL,{title:Os.jsx(e,{id:"fSFt4a",message:"Token Pair"}),isWaiting:u,children:[Os.jsx(Cj,{width:24,height:24,tokens:[r,i]}),r.symbol,"-",i.symbol]}),Os.jsx(iL,{title:Os.jsx(e,{id:"sjn3tj",message:"Slippage Coefficient"}),isWaiting:u,children:a}),Os.jsxs(iL,{title:p,isWaiting:u,children:["1 ",r.symbol," = ",null!==(d=tL({midPrice:s,quoteToken:i,selectedVersion:n,initPrice:o}))&&void 0!==d?d:"-"," ",i.symbol]})]})}):null}var aL,sL;function lL(){return lL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lL.apply(null,arguments)}const dL=e=>ot.createElement("svg",lL({width:54,height:32,viewBox:"0 0 54 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),aL||(aL=ot.createElement("g",{clipPath:"url(#clip0_5251_29079)"},ot.createElement("path",{d:"M41.2736 0.409826C33.3354 1.31458 28.4933 23.304 27.1777 32H54.0001V0.0303594C53.1946 0.0303459 46.2675 -0.159361 41.2736 0.409826Z",fill:"url(#paint0_linear_5251_29079)"}),ot.createElement("path",{d:"M27 31.7932C28.3204 23.1499 33.2469 1.97641 41.3084 0.583249C43.491 0.206055 53.1916 0.206014 54 0.206056",stroke:"#EC5A7D",strokeWidth:.206452,strokeLinecap:"square",strokeLinejoin:"round"}),ot.createElement("path",{d:"M12.7264 0.409826C20.6646 1.31458 25.5067 23.304 26.8223 32H-0.000102997V0.0303594C0.805374 0.0303459 7.73247 -0.159361 12.7264 0.409826Z",fill:"url(#paint1_linear_5251_29079)"}),ot.createElement("path",{d:"M27 31.7932C25.6796 23.1499 20.7531 1.97641 12.6916 0.583249C10.509 0.206055 0.808383 0.206014 2.38419e-07 0.206056",stroke:"#2FBA90",strokeWidth:.206452,strokeLinecap:"square",strokeLinejoin:"round"}))),sL||(sL=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_5251_29079",x1:54.0001,y1:5.72231,x2:54.0001,y2:31.0514,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#EC5A7D",stopOpacity:.3}),ot.createElement("stop",{offset:1,stopColor:"#EC5A7D",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint1_linear_5251_29079",x1:-10303e-8,y1:5.72231,x2:-10372e-8,y2:31.0514,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#2FBA90",stopOpacity:.3}),ot.createElement("stop",{offset:1,stopColor:"#2FBA90",stopOpacity:0})),ot.createElement("clipPath",{id:"clip0_5251_29079"},ot.createElement("rect",{width:54,height:32,fill:"white"})))));var cL,uL;function pL(){return pL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pL.apply(null,arguments)}const hL=e=>ot.createElement("svg",pL({width:54,height:32,viewBox:"0 0 54 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),cL||(cL=ot.createElement("g",{clipPath:"url(#clip0_5251_28999)"},ot.createElement("path",{d:"M41.2736 0.409826C33.3354 1.31458 28.4933 23.304 27.1777 32H54.0001V0.0303594C53.1946 0.0303459 46.2675 -0.159361 41.2736 0.409826Z",fill:"url(#paint0_linear_5251_28999)"}),ot.createElement("path",{d:"M27 31.7932C28.3204 23.1499 33.2469 1.97641 41.3084 0.583249C43.491 0.206055 53.1916 0.206014 54 0.206056",stroke:"#FF6187",strokeWidth:.206452,strokeLinecap:"square",strokeLinejoin:"round"}),ot.createElement("path",{d:"M12.7264 0.409826C20.6646 1.31458 25.5067 23.304 26.8223 32H-0.000102997V0.0303594C0.805374 0.0303459 7.73247 -0.159361 12.7264 0.409826Z",fill:"url(#paint1_linear_5251_28999)"}),ot.createElement("path",{d:"M27 31.7932C25.6796 23.1499 20.7531 1.97641 12.6916 0.583249C10.509 0.206055 0.808383 0.206014 2.38419e-07 0.206056",stroke:"#55F9C7",strokeWidth:.206452,strokeLinecap:"square",strokeLinejoin:"round"}))),uL||(uL=ot.createElement("defs",null,ot.createElement("linearGradient",{id:"paint0_linear_5251_28999",x1:54.0001,y1:5.72231,x2:54.0001,y2:31.0514,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#FF6187",stopOpacity:.3}),ot.createElement("stop",{offset:1,stopColor:"#FF6187",stopOpacity:0})),ot.createElement("linearGradient",{id:"paint1_linear_5251_28999",x1:-10303e-8,y1:5.72231,x2:-10372e-8,y2:31.0514,gradientUnits:"userSpaceOnUse"},ot.createElement("stop",{stopColor:"#55F9C7",stopOpacity:.3}),ot.createElement("stop",{offset:1,stopColor:"#55F9C7",stopOpacity:0})),ot.createElement("clipPath",{id:"clip0_5251_28999"},ot.createElement("rect",{width:54,height:32,fill:"white"})))));function mL({height:e,text:t}){return Os.jsx(sT,{sx:{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",height:e||261},emptyText:t||r._({id:"uiuMDr",message:"Enter parameters to view the yield curve"})})}const fL=at.lazy((()=>import("./index-JG6WMPGu.js"))),gL=at.lazy((()=>import("./index-iFj85-kA.js")));var yL,xL;function vL({baseToken:t,quoteToken:n,pmmParams:i,pmmModel:o,midPrice:a}){var s,l;const d=g(),{isMobile:c}=wy(),[u,p]=at.useState(yL.depth),h=at.useRef(null),[m,y]=at.useState(0),x=null!==(s=null==t?void 0:t.symbol)&&void 0!==s?s:"",v=null!==(l=null==n?void 0:n.symbol)&&void 0!==l?l:"";at.useEffect((()=>{const e=()=>{h&&h.current&&y(h.current.offsetWidth)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[h,a]);const b=u===yL.depth;if(!a||a.isNaN())return Os.jsx(mL,{height:c?261:b?665:494});const A=d.palette.success.main,w=d.palette.error.main,k=[{key:yL.liquidity,value:r._({id:"6y2TB3",message:"Liquidity"})},{key:yL.depth,value:r._({id:"n25Lml",message:"Depth"})}];return Os.jsxs(f,{ref:h,sx:{mt:2,"& input":{backgroundColor:"background.input",borderStyle:"solid",borderWidth:"1px",borderColor:"border.main",borderRadius:8,color:"text.primary",overflow:"hidden"},"& .operate-btn-wrapper button":{backgroundColor:"background.paperContrast",color:"text.primary"}},children:[Os.jsxs(H,{value:u,onChange:(e,t)=>{p(t)},children:[Os.jsx(G,{tabs:k,variant:"tag",tabsListSx:{ml:"auto"}}),Os.jsx(f,{sx:Object.assign({typography:"h6",mt:8,mb:14,color:"text.secondary"},c?{transform:"scale(0.66667)",transformOrigin:"top left"}:{}),children:Os.jsx(e,{id:"tyGEMJ",message:"Amounts"})}),Os.jsx(z,{value:yL.depth,children:m&&Os.jsx(at.Suspense,{children:Os.jsx(fL,{width:m,height:c?261:364,chartId:"create-pool-depth-chart",baseTokenSymbol:x,quoteTokenSymbol:v,pmmModel:o,pmmParams:i,midPrice:a,colorMap:{grid:"light"===d.palette.mode?"#E4E4E4":void 0,midPriceLine:"light"===d.palette.mode?"#E4E4E4":void 0,leftBg:[0,C(A,.04),1,C(A,.3)],leftLine:A,rightBg:[0,C(w,.04),1,C(w,.3)],rightLine:w,tooltipBg:d.palette.background.paperContrast,tooltipColor:d.palette.text.primary},notShowAmountInput:c})})}),Os.jsx(z,{value:yL.liquidity,children:Os.jsx(at.Suspense,{children:Os.jsx(gL,{width:m,height:c?261:364,baseTokenSymbol:x,quoteTokenSymbol:v,pmmModel:o,pmmParams:i,midPrice:a,notShowTipText:!0,colorMap:{grid:"light"===d.palette.mode?"#E4E4E4":void 0,midPriceLine:"light"===d.palette.mode?"#E4E4E4":void 0,leftBg:[0,C(A,.04),1,C(A,.3)],leftLine:A,rightBg:[0,C(w,.04),1,C(w,.3)],rightLine:w,tooltipBg:d.palette.background.paperContrast,tooltipColor:d.palette.text.primary,textColor:d.palette.text.secondary}})})})]}),Os.jsx(f,{sx:Object.assign({typography:"h6",mt:6,color:"text.secondary"},c?{transform:"scale(0.66667)",transformOrigin:"top left"}:{}),children:Os.jsx(e,{id:"DZULmp",message:"Swap Rate"})}),b?"":Os.jsxs(f,{sx:{typography:"h6",mt:24,color:"text.secondary",textAlign:"center"},children:["* ",r._({id:"DuVAxN",message:"The area of the chart indicates the buy/sell volume of {baseSymbol} that can be carried by the market when the current price changes to the hover price.",values:{baseSymbol:x}})]})]})}!function(e){e[e.liquidity=1]="liquidity",e[e.depth=2]="depth"}(yL||(yL={})),function(e){e[e.standard=1]="standard",e[e.singleToken=2]="singleToken",e[e.pagged=3]="pagged",e[e.marketMaker=4]="marketMaker"}(xL||(xL={}));const bL=({selectedVersion:e,baseAmount:t,quoteAmount:n,initPrice:r,slippageCoefficient:i})=>{const o=lt((()=>{const o=[UR.standard,UR.singleToken].includes(e),a=e===UR.singleToken;if(!t||!a&&!n)return;const s=Number(r),l=Number(t),d=Number(n),c=Number(i);return{i:s,k:c,b:l,b0:l,q:d,q0:0!==c&&o?0:d,R:0!==c&&o?1:0}}),[t,r,n,e,i]),a=lt((()=>{if(o)return ve(o)}),[o]),s=lt((()=>{if(a)return a.getMidPrice()}),[a]);return{pmmParams:o,pmmModel:a,midPrice:s}};function AL({selectedVersion:e,baseToken:t,quoteToken:n,initPrice:i,slippageCoefficient:o,baseAmount:a,quoteAmount:s}){const l=g(),{isMobile:d}=wy(),[c,u]=at.useState(!1),{pmmParams:p,pmmModel:h,midPrice:m}=bL({selectedVersion:e,baseAmount:a,quoteAmount:s,initPrice:i,slippageCoefficient:o});if(!d)return null;const x=r._({id:"FQfStS",message:"Emulator"}),v=r._({id:"9D2g7k",message:"The liquidity of DODO is continuous, which is different from the discrete liquidity of UniV3. The ticks shown in the illustration are for demonstration purposes only."});return Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{sx:{mx:20,mb:8},children:Os.jsxs(f,{sx:{width:"100%",px:20,py:16,borderRadius:12,borderWidth:1,borderStyle:"solid",borderColor:l.palette.border.main,display:"flex",alignItems:"center",justifyContent:"space-between"},component:y,onClick:()=>u(!0),children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",color:l.palette.text.secondary,typography:"body1",fontWeight:600},children:[x,Os.jsx(P,{title:v,ml:4,sx:{width:14,height:14}})]}),!m||m.isNaN()?Os.jsx(f,{sx:{py:5,typography:"body1"},children:"-"}):"light"===l.palette.mode?Os.jsx(dL,{width:"52",height:"32"}):Os.jsx(hL,{width:"52",height:"32"})]})}),Os.jsx(yy,{open:c,onClose:()=>u(!1),modal:!0,title:Os.jsxs(f,{children:[x,Os.jsx(P,{title:v,ml:4})]}),children:Os.jsx(f,{sx:{px:28,pb:20,maxHeight:"calc(80vh - 134px)",overflowY:"auto",overflowX:"hidden"},children:Os.jsx(vL,{baseToken:t,quoteToken:n,pmmParams:p,pmmModel:h,midPrice:m})})})]})}function wL({color:e,backgroundColor:t,tagKey:n}){return Os.jsx(f,{sx:{ml:8,px:8,py:2,borderRadius:4,backgroundColor:t,color:e,typography:"h6",fontWeight:500},children:n})}function kL({isWaiting:t,feeRate:n}){const i=g();return Os.jsxs(f,{sx:{padding:16,borderRadius:8,backgroundColor:i.palette.background.paper,width:"50%",opacity:t?.5:1},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",typography:"h5",fontWeight:600},children:t?"-":Os.jsxs(Os.Fragment,{children:[n||"-","%",n===zR&&Os.jsx(wL,{tagKey:r._({id:"/+c6tU",message:"99% Default"}),color:i.palette.purple.main,backgroundColor:C(i.palette.purple.main,.1)})]})}),Os.jsx(f,{sx:{typography:"h6",fontWeight:500,color:i.palette.text.secondary,mt:8},children:Os.jsx(e,{id:"Y7rVy0",message:"Fee Rate"})})]})}function CL({isWaiting:t,selectedVersion:n,baseToken:r,quoteToken:i,initPrice:o,slippageCoefficient:a,baseAmount:s,quoteAmount:l,peggedBaseTokenRatio:d,peggedQuoteTokenRatio:c}){const u=g(),{pmmParams:p,pmmModel:h,midPrice:m}=bL({selectedVersion:n,baseAmount:s,quoteAmount:l,initPrice:o,slippageCoefficient:a});return Os.jsxs(Os.Fragment,{children:[!t&&Os.jsx(vL,{baseToken:r,quoteToken:i,pmmParams:p,pmmModel:h,midPrice:m}),Os.jsxs(f,{sx:{mt:t?0:20,padding:16,borderRadius:8,backgroundColor:u.palette.background.paper,width:"50%",opacity:t?.5:1},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",typography:"h5",fontWeight:600},children:t?"-":Os.jsxs(Os.Fragment,{children:[d,"% ",null==r?void 0:r.symbol," : ",c,"% ",null==i?void 0:i.symbol]})}),Os.jsx(f,{sx:{typography:"h6",fontWeight:500,color:u.palette.text.secondary,mt:8},children:Os.jsx(e,{id:"eK0eiF",message:"Initial asset ratio"})})]})]})}function jL({title:e,children:t,isWaiting:n}){const r=g();return Os.jsxs(f,{sx:{padding:16,borderRadius:8,backgroundColor:r.palette.background.paper,flexGrow:1,flexBasis:"100%"},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",gap:8,typography:"h5"},children:n?"-":t}),Os.jsx(f,{sx:{typography:"h6",fontWeight:500,color:r.palette.text.secondary,mt:8},children:e})]})}function TL({status:e,selectedVersion:t,baseToken:n,quoteToken:i,initPrice:o,slippageCoefficient:a,baseAmount:s,quoteAmount:l}){var d;const{pmmParams:c,pmmModel:u,midPrice:p}=bL({selectedVersion:t,baseAmount:s,quoteAmount:l,initPrice:o,slippageCoefficient:a}),{versionMap:h}=HR(),m="waiting"===e,{initPriceLabel:g}=h[t];return Os.jsxs(Os.Fragment,{children:["running"===e&&Os.jsx(vL,{baseToken:n,quoteToken:i,pmmParams:c,pmmModel:u,midPrice:p}),Os.jsxs(f,{sx:{mt:20,display:"flex",alignItems:"stretch",gap:12,opacity:m?.5:1},children:[Os.jsx(jL,{title:r._({id:"fSFt4a",message:"Token Pair"}),isWaiting:m,children:n&&i?Os.jsxs(Os.Fragment,{children:[Os.jsx(Cj,{width:24,tokens:[n,i],chainId:n.chainId}),n.symbol,"-",i.symbol]}):""}),Os.jsx(jL,{title:g,isWaiting:m,children:n&&i?Os.jsxs(Os.Fragment,{children:["1 ",n.symbol,"=",null!==(d=tL({midPrice:p,quoteToken:i,selectedVersion:t,initPrice:o}))&&void 0!==d?d:"-"," ",i.symbol]}):""}),Os.jsx(jL,{title:r._({id:"sjn3tj",message:"Slippage Coefficient"}),isWaiting:m,children:a})]})]})}function EL({isWaiting:t,selectedSubPeggedVersion:n}){var r,i;const o=g(),a=ZR();return Os.jsxs(f,{sx:{padding:16,borderRadius:8,backgroundColor:o.palette.background.paper,width:"50%",opacity:t?.5:1},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",typography:"h5",fontWeight:600},children:t?"-":n&&null!==(i=null===(r=a[n])||void 0===r?void 0:r.title)&&void 0!==i?i:"-"}),Os.jsx(f,{sx:{typography:"h6",fontWeight:500,color:o.palette.text.secondary,mt:8},children:Os.jsx(e,{id:"XPiFIY",message:"Can the pool price be adjusted?"})})]})}function SL({index:e,titleKey:t,status:n}){const r=g(),{isMobile:i}=wy();return Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{sx:Object.assign({mt:28,mb:28,borderTopColor:"divider",borderTopStyle:"solid",borderTopWidth:1},i?{mt:12,mb:12,display:1===e?"none":"block"}:{})}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",mb:20},children:[Os.jsx(f,{sx:{display:"flex",width:"20px",height:"20px",justifyContent:"center",alignItems:"center",flexShrink:0,borderRadius:"50%",backgroundColor:"waiting"===n?r.palette.background.paperDarkContrast:r.palette.secondary.main,typography:"h6",fontWeight:600,textAlign:"center",color:"waiting"===n?r.palette.text.disabled:r.palette.secondary.contrastText},children:"completed"===n?Os.jsx(Os.Fragment,{children:Os.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{d:"M12.7596 3.55566L5.92549 10.3897L3.23957 7.71418L1.77734 9.17641L5.92549 13.3246L14.2218 5.02826L12.7596 3.55566Z",fill:"currentColor"})})}):e}),Os.jsx(f,{sx:{ml:8,typography:"body1",fontWeight:600,color:"waiting"===n?r.palette.text.disabled:r.palette.text.primary},children:t})]})]})}function IL({currentStep:e,isPeggedVersion:t}){const n=g(),{isMobile:i}=wy();let o="",a="",s="";switch(e){case 0:o=r._({id:"hdIg7i",message:"Select Pool Version"}),s=r._({id:"AOhRo6",message:"DODO provides a variety of pool versions to suit your needs."});break;case 1:o=r._({id:"lsg9Mi",message:"Parameter Settings"});break;case 2:t?o=r._({id:"6lss/t",message:"Pricing Model"}):(o=r._({id:"Y7rVy0",message:"Fee Rate"}),a=r._({id:"2vjOqX",message:"Pools with lower transaction fees will attract more traders."}));break;case 3:if(!t)throw new Error("type is error");o=r._({id:"Y7rVy0",message:"Fee Rate"}),a=r._({id:"2vjOqX",message:"Pools with lower transaction fees will attract more traders."});break;case 4:if(!t)throw new Error("type is error");o=r._({id:"3ggd2j",message:"Asset ratio within the pool"});break;default:throw new Error(`Invalid Step ${e}`)}return Os.jsxs(f,{sx:Object.assign({position:"sticky",top:0,py:20,px:20,backgroundColor:n.palette.background.paper,zIndex:1},i?{}:{position:"static",borderTopLeftRadius:16,borderTopRightRadius:16}),children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(f,{sx:{typography:"h5",color:n.palette.text.primary,fontWeight:600},children:o}),a&&Os.jsx(P,{title:a,sx:{width:16,height:16}}),Os.jsx(f,{sx:{marginLeft:"auto",display:"flex",alignItems:"center",gap:12},children:(t?[0,1,2,3,4]:[0,1,2]).map((t=>Os.jsx(f,{sx:{width:12,height:12,borderRadius:12,background:e>=t?n.palette.secondary.main:C(n.palette.primary.main,.1)}},t)))})]}),s&&Os.jsx(f,{sx:{mt:8,typography:"body2",color:n.palette.text.secondary},children:s})]})}function RL({versionItem:t,status:n}){const r=g(),{noDocumentLink:i}=pf(),o="light"===r.palette.mode;return"completed"===n?Os.jsxs(f,{sx:{backgroundColor:r.palette.background.paper,borderRadius:8,width:"50%",padding:16},children:[Os.jsx(f,{sx:{typography:"h5",fontWeight:600,color:r.palette.text.primary},children:t.title}),Os.jsx(f,{sx:{typography:"h6",fontWeight:500,mt:8,color:r.palette.text.secondary},children:t.description})]}):Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(f,{sx:{typography:"h4",fontWeight:600},children:t.title}),!i&&Os.jsxs(f,{sx:{ml:8,display:"flex",padding:"2px 8px",justifyContent:"center",alignItems:"center",gap:"2px",color:r.palette.text.disabled,backgroundColor:r.palette.background.paperDarkContrast,borderRadius:4,typography:"h6"},component:"a",href:t.docUrl,target:"_blank",rel:"noreferrer",children:[Os.jsx(e,{id:"TGi+jm",message:"Doc"}),Os.jsx("svg",{width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.91667 3.41667V11.5833H11.0833V7.5H12.25V11.5833C12.25 12.225 11.725 12.75 11.0833 12.75H2.91667C2.26917 12.75 1.75 12.225 1.75 11.5833V3.41667C1.75 2.775 2.26917 2.25 2.91667 2.25H7V3.41667H2.91667ZM8.16667 3.41667V2.25H12.25V6.33333H11.0833V4.23917L5.34917 9.97333L4.52667 9.15083L10.2608 3.41667H8.16667Z",fill:"currentColor"})})]})]}),Os.jsx(f,{sx:{position:"relative",width:"100%",minHeight:220},children:Os.jsx(f,{component:o?t.exampleImgUrl:t.exampleDarkImgUrl,sx:{marginTop:20,width:"100%"}})})]})}function LL({side:e,tokenList:t,occupyToken:n,needFindToken:r,chainId:i}){var o,a;let s=null,l=null;const d=t.filter((t=>!(t.side&&t.side!==e||i&&t.chainId!==i)));return d.length&&(r&&(s=null!==(o=d.find((e=>e.address===(null==r?void 0:r.address)&&e.chainId===r.chainId)))&&void 0!==o?o:null,l=s),l||(n?l=null!==(a=d.find((e=>e.address!==n.address)))&&void 0!==a?a:null:[l]=d)),{findToken:s,defaultToken:l}}function ML(){const{account:e,chainId:t}=hf(),n=fw((e=>{var t;return null===(t=e.page)||void 0===t?void 0:t.params}));return function({chainId:e,account:t,defaultBaseToken:n,defaultQuoteToken:r,tokenListInclude:i}={}){const{autoConnectLoading:o}=yf(),{tokenList:a}=Jc(),s=LL({side:"from",needFindToken:n,tokenList:a,chainId:e}),l=It(Object.assign({},$a.getFetchTokenQuery(i?void 0:e,null==n?void 0:n.address,t))),d=It(Object.assign({},$a.getFetchTokenQuery(i?void 0:e,null==r?void 0:r.address,t)));let c=null,u=o;o||(c=s.defaultToken,l.data&&(c=l.data,u=l.isLoading));let p=null,h=o;o||(p=LL({side:"to",needFindToken:r,occupyToken:c,tokenList:a,chainId:e}).defaultToken,d.data&&(p=d.data,h=d.isLoading));return{defaultBaseToken:c,defaultQuoteToken:p,defaultBaseTokenLoading:u,defaultQuoteTokenLoading:h}}({chainId:t,account:e,defaultBaseToken:(null==n?void 0:n.fromAddress)?{address:null==n?void 0:n.fromAddress,chainId:t}:void 0,defaultQuoteToken:(null==n?void 0:n.toAddress)?{address:null==n?void 0:n.toAddress,chainId:t}:void 0})}function OL({tokens:e}){const{apikey:t}=pf(),n=Gv(Ha.fiatPrice);return It({enabled:!!e.length,queryKey:["fetch","fetchFiatPrice",e],queryFn:()=>Fn(this,void 0,void 0,(function*(){const r=yield Ut.post(n,{networks:e.map((e=>ys(e.chainId))),addresses:e.map((e=>e.address)),symbols:e.map((e=>e.symbol)),isCache:!0},t?{headers:{apikey:t}}:void 0),i=new Map;return r.data.data&&r.data.data.forEach((e=>{const t=Number(e.price);!Number.isNaN(t)&&t>0&&i.set(e.address,t)})),i}))})}const BL=({selectedVersion:e})=>e===UR.pegged?["0.0001","0.0005","0.002"]:["0.5","0.01","1"];var PL;function DL(e,t){return!e||null==t||e.isNaN()?"":e.dp(t,i.ROUND_DOWN).toString()}function NL({state:e,fixedRatioPrice:t}){const{selectedVersion:n,baseToken:r,quoteToken:o,baseAmount:a,isFixedRatio:s,leftTokenAddress:l}=e;if(!r||!o)throw new Error("token is required");const d=l===(null==r?void 0:r.address),c=n===UR.standard,u=n===UR.pegged,p=new i(t);let h=c?XR:d?t:!p.isNaN()&&p.gt(0)?new i(1).div(p).dp(d?o.decimals:r.decimals).toString():YR;if(c){const e=18-r.decimals+o.decimals;e<String(XR).split(".")[1].length&&(h=new i(1).div(10**e).toString())}if(u){const n=nL({initPrice:h}),r=n.base?n.base.multipliedBy(100).toString():"",i=n.quote?n.quote.multipliedBy(100).toString():"";return Object.assign(Object.assign({},e),{initPrice:h,fixedRatioPrice:t,peggedBaseTokenRatio:r,peggedQuoteTokenRatio:i})}if(c&&s){const n=new i(a);if(!n.isNaN()&&!p.isNaN()&&p.gt(0)){const i=d?n.multipliedBy(p):n.div(p);return Object.assign(Object.assign({},e),{initPrice:h,fixedRatioPrice:t,baseAmount:DL(n,r.decimals),quoteAmount:DL(i,o.decimals)})}}return Object.assign(Object.assign({},e),{initPrice:h,fixedRatioPrice:t})}function FL(e,t){var n;switch(t.type){case PL.SetCurrentStep:{const{payload:n}=t;return e.selectedVersion===UR.pegged?Object.assign(Object.assign({},e),{currentStep:n>=4?4:n<=0?0:n}):Object.assign(Object.assign({},e),{currentStep:n>=2?2:n<=0?0:n})}case PL.SelectNewVersion:{const{payload:r}=t;if(r===e.selectedVersion)return e;let i,o=KR;r===UR.pegged&&(o=_R,i=VR.DSP);let a=XR;r===UR.singleToken?a="":r!==UR.standard&&(a=YR);let s=!0;return r===UR.singleToken&&(s=!1),Object.assign(Object.assign({},e),{baseAmount:"",quoteAmount:"",isFixedRatio:s,initPrice:a,fixedRatioPrice:r===UR.singleToken?"":YR,slippageCoefficient:o,isSlippageCoefficientCustomized:!BL({selectedVersion:t.payload}).includes(o),selectedVersion:t.payload,selectedSubPeggedVersion:i,leftTokenAddress:null===(n=e.baseToken)||void 0===n?void 0:n.address})}case PL.SelectNewSubPeggedVersion:return Object.assign(Object.assign({},e),{selectedSubPeggedVersion:t.payload});case PL.UpdateBaseToken:{const n=t.payload;return Object.assign(Object.assign({},e),{baseToken:n,baseAmount:"",leftTokenAddress:null==n?void 0:n.address})}case PL.UpdateQuoteToken:{const{baseToken:n}=e;return Object.assign(Object.assign({},e),{quoteToken:t.payload,quoteAmount:"",leftTokenAddress:null==n?void 0:n.address})}case PL.SwitchTokens:{const{selectedVersion:t,baseToken:n,quoteToken:r,baseAmount:i,quoteAmount:o}=e;return t===UR.singleToken?Object.assign(Object.assign({},e),{baseToken:r,quoteToken:n,leftTokenAddress:null==r?void 0:r.address}):Object.assign(Object.assign({},e),{baseToken:r,quoteToken:n,baseAmount:o,quoteAmount:i,leftTokenAddress:null==r?void 0:r.address})}case PL.UpdateBaseAmount:{const n=t.payload,{selectedVersion:r,quoteToken:o,fixedRatioPrice:a,isFixedRatio:s,peggedBaseTokenRatio:l}=e;if(!o)throw new Error("token is required");const d=new i(n);if(r===UR.pegged){const t=new i(l).div(100).dp(eL,i.ROUND_DOWN);if(!t.isFinite()||t.lt(0))return Object.assign(Object.assign({},e),{baseAmount:n,quoteAmount:""});const r=d.div(t).minus(d);return Object.assign(Object.assign({},e),{baseAmount:n,quoteAmount:DL(r,o.decimals)})}if(r===UR.standard&&s&&a){if(!n)return Object.assign(Object.assign({},e),{baseAmount:n,quoteAmount:n});const t=function(e,t){const n=new be;return n.B=new i(e.baseAmount),n.i=new i(e.initPrice),n.k=new i(e.slippageCoefficient),n.RStatus=1,n.getQuoteByMidPrice(t)}(Object.assign(Object.assign({},e),{baseAmount:n}),new i(a));return Object.assign(Object.assign({},e),{baseAmount:n,quoteAmount:DL(t,o.decimals)})}return Object.assign(Object.assign({},e),{baseAmount:n})}case PL.UpdateQuoteAmount:{const n=t.payload,{selectedVersion:r,baseToken:o,fixedRatioPrice:a,isFixedRatio:s,leftTokenAddress:l,peggedQuoteTokenRatio:d}=e;if(!o)throw new Error("token is required");const c=l===(null==o?void 0:o.address),u=new i(n);if(r===UR.pegged){const t=new i(d).div(100).dp(eL,i.ROUND_DOWN);if(!t.isFinite()||t.lt(0))return Object.assign(Object.assign({},e),{baseAmount:"",quoteAmount:n});const r=u.div(t).minus(u);return Object.assign(Object.assign({},e),{baseAmount:DL(r,o.decimals),quoteAmount:n})}if(r===UR.standard&&s){const t=new i(a),r=t.gt(0)?c?u.div(t):u.multipliedBy(t):void 0;return Object.assign(Object.assign({},e),{baseAmount:DL(r,o.decimals),quoteAmount:n})}return Object.assign(Object.assign({},e),{quoteAmount:n})}case PL.UpdateIsFixedRatio:return Object.assign(Object.assign({},e),{isFixedRatio:t.payload});case PL.InitFixedRatioPrice:{const{leftTokenAddress:n,baseToken:r,quoteToken:o}=e;if(!r||!o)throw new Error("token is required");const a=n===(null==r?void 0:r.address),{baseTokenFiatPrice:s,quoteTokenFiatPrice:l}=t.payload,d=s&&l?new i(s).div(l):void 0,c=s&&l?new i(l).div(s):void 0,u=a?d:c,p=a?o.decimals:r.decimals;return u&&!u.isNaN()?NL({state:e,fixedRatioPrice:u.dp(p,i.ROUND_DOWN).toString()}):e}case PL.UpdateFixedRatioPrice:return NL({state:e,fixedRatioPrice:t.payload});case PL.ToggleLeftToken:{const{baseToken:t,quoteToken:n,fixedRatioPrice:r}=e;if(!t||!n)throw new Error("token is required");const o=e.leftTokenAddress===(null==t?void 0:t.address),a=o?null==n?void 0:n.address:null==t?void 0:t.address,s=new i(r);if(!s.isNaN()&&s.gt(0)){const r=new i(1).div(s).dp(o?t.decimals:n.decimals);return NL({state:Object.assign(Object.assign({},e),{leftTokenAddress:a}),fixedRatioPrice:r.toString()})}return Object.assign(Object.assign({},e),{leftTokenAddress:a})}case PL.UpdateSlippageCoefficient:return Object.assign(Object.assign({},e),{slippageCoefficient:t.payload});case PL.UpdateIsSlippageCoefficientCustomized:return Object.assign(Object.assign({},e),{isSlippageCoefficientCustomized:t.payload});case PL.UpdateFeeRate:return Object.assign(Object.assign({},e),{feeRate:t.payload});case PL.UpdateIsFeeRateCustomized:return Object.assign(Object.assign({},e),{isFeeRateCustomized:t.payload});case PL.InitEditParameters:return function(e,t){const{baseToken:n,quoteToken:r}=t;return n&&r?Object.assign(Object.assign({},e),{baseToken:n,quoteToken:r,leftTokenAddress:null==n?void 0:n.address,slippageCoefficient:"",initPrice:"",fixedRatioPrice:"",feeRate:"",isFixedRatio:!1}):e}(e,t.payload);case PL.UpdatePeggedBaseTokenRatio:{if(!e.quoteToken)throw new Error("token is required");const n=t.payload,r=new i(n).dp(eL-2,i.ROUND_DOWN);if(!r.isFinite()||r.lt(0))return Object.assign(Object.assign({},e),{peggedBaseTokenRatio:"",peggedQuoteTokenRatio:"",baseAmount:"",quoteAmount:""});const o=new i(100).minus(r).dp(eL-2,i.ROUND_DOWN),a=r.lte(0)?"0":e.baseAmount,s=new i(a),l=s.div(r.div(100)).minus(s);return Object.assign(Object.assign({},e),{peggedBaseTokenRatio:n,peggedQuoteTokenRatio:o.lt(0)?"0":o.toString(),baseAmount:a,quoteAmount:DL(l,e.quoteToken.decimals)})}case PL.UpdatePeggedQuoteTokenRatio:{if(!e.baseToken)throw new Error("token is required");const n=t.payload,r=new i(n).dp(eL-2,i.ROUND_DOWN);if(!r.isFinite()||r.lt(0))return Object.assign(Object.assign({},e),{peggedBaseTokenRatio:"",peggedQuoteTokenRatio:n,baseAmount:"",quoteAmount:""});const o=new i(100).minus(r).dp(eL-2,i.ROUND_DOWN),a=r.lte(0)?"0":e.quoteAmount,s=new i(a),l=s.div(r.div(100)).minus(s);return Object.assign(Object.assign({},e),{peggedBaseTokenRatio:o.lt(0)?"0":o.toString(),peggedQuoteTokenRatio:n,baseAmount:DL(l,e.baseToken.decimals),quoteAmount:a})}default:throw Error("Unknown action: "+t.type)}}function WL({isSingleTokenVersion:e,leftTokenAddress:t,baseToken:n,quoteToken:r,dispatch:o}){var a,s;const l=OL({tokens:lt((()=>n&&r?[n,r]:[]),[n,r])}),d=t===(null==n?void 0:n.address),c=n?null===(a=l.data)||void 0===a?void 0:a.get(n.address):void 0,u=r?null===(s=l.data)||void 0===s?void 0:s.get(r.address):void 0,p=lt((()=>{const e=c&&u?new i(c).div(u):void 0,t=c&&u?new i(u).div(c):void 0;return d?e:t}),[c,d,u]),h=!p||p.isNaN(),m=!l.isLoading&&!l.isPending&&h;return gt((()=>{m&&o({type:PL.UpdateIsFixedRatio,payload:!1})}),[o,m]),gt((()=>{e||c&&o({type:PL.InitFixedRatioPrice,payload:{baseTokenFiatPrice:c,quoteTokenFiatPrice:u}})}),[c,o,e,u]),{fiatPriceLoading:l.isLoading||l.isPending,currentPrice:p,isErrorPrice:m,isNullPrice:h}}function VL({label:e,value:t}){return Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",mb:16},children:[Os.jsx(f,{sx:{color:"text.secondary",mr:8},children:e}),Os.jsx(f,{sx:{textAlign:"right",wordBreak:"break-all"},children:t})]})}function UL({on:e,onClose:t,state:n,onConfirm:i,isModify:o,loading:a}){var s,l,d,c,u,p,h;const{chainId:m}=hf(),{versionMap:g}=HR(),{isMobile:y}=wy(),{title:x,initPriceLabel:v}=g[n.selectedVersion],{midPrice:b}=bL({selectedVersion:n.selectedVersion,baseAmount:n.baseAmount,quoteAmount:n.quoteAmount,initPrice:n.initPrice,slippageCoefficient:n.slippageCoefficient}),A=ZR(),w=n.selectedVersion===UR.pegged;return Os.jsx(yy,{open:e,onClose:t,modal:!0,title:o?r._({id:"dzV+zO",message:"Modify Confirmation"}):r._({id:"tnRI9r",message:"Pool Creation Confirmation"}),children:Os.jsxs(f,{sx:{flex:1,px:20,pb:20,display:"flex",flexDirection:"column",justifyContent:"space-between",width:y?void 0:420},children:[Os.jsxs(f,{sx:{pt:40,px:8},children:[Os.jsx(VL,{label:r._({id:"eE0JZ4",message:"Version"}),value:x}),Os.jsx(VL,{label:r._({id:"7m5+6j",message:"Initial Tokens"}),value:Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:[Os.jsx(ey,{address:null===(s=n.baseToken)||void 0===s?void 0:s.address,chainId:m,marginRight:8,width:18,height:18}),n.baseAmount||"-"," ",null===(l=n.baseToken)||void 0===l?void 0:l.symbol]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",mt:4},children:[Os.jsx(ey,{address:null===(d=n.quoteToken)||void 0===d?void 0:d.address,chainId:m,marginRight:8,width:18,height:18}),n.quoteAmount||"-"," ",null===(c=n.quoteToken)||void 0===c?void 0:c.symbol]})]})}),Os.jsx(VL,{label:r._({id:"sjn3tj",message:"Slippage Coefficient"}),value:n.slippageCoefficient}),Os.jsx(VL,{label:v,value:n.baseToken&&n.quoteToken?`1 ${n.baseToken.symbol} = ${tL({midPrice:b,quoteToken:n.quoteToken,selectedVersion:n.selectedVersion,initPrice:n.initPrice})} ${n.quoteToken.symbol}`:""}),w&&Os.jsx(VL,{label:r._({id:"6lss/t",message:"Pricing Model"}),value:n.selectedSubPeggedVersion?null===(u=A[n.selectedSubPeggedVersion])||void 0===u?void 0:u.title:"-"}),Os.jsx(VL,{label:r._({id:"Y7rVy0",message:"Fee Rate"}),value:`${n.feeRate}%`}),w&&Os.jsx(VL,{label:r._({id:"eK0eiF",message:"Initial asset ratio"}),value:Os.jsxs(Os.Fragment,{children:[n.peggedBaseTokenRatio,"% ",null===(p=n.baseToken)||void 0===p?void 0:p.symbol," : ",n.peggedQuoteTokenRatio,"% ",null===(h=n.quoteToken)||void 0===h?void 0:h.symbol]})})]}),Os.jsx(T,{fullWidth:!0,isLoading:a,sx:{mt:30},onClick:i,children:o?r._({id:"7VpPHA",message:"Confirm"}):r._({id:"hYgDIe",message:"Create"})})]})})}!function(e){e[e.SetCurrentStep=1]="SetCurrentStep",e[e.SelectNewVersion=2]="SelectNewVersion",e[e.SelectNewSubPeggedVersion=3]="SelectNewSubPeggedVersion",e[e.UpdateBaseToken=4]="UpdateBaseToken",e[e.UpdateQuoteToken=5]="UpdateQuoteToken",e[e.SwitchTokens=6]="SwitchTokens",e[e.UpdateBaseAmount=7]="UpdateBaseAmount",e[e.UpdateQuoteAmount=8]="UpdateQuoteAmount",e[e.UpdateIsFixedRatio=9]="UpdateIsFixedRatio",e[e.UpdateFixedRatioPrice=10]="UpdateFixedRatioPrice",e[e.InitFixedRatioPrice=11]="InitFixedRatioPrice",e[e.ToggleLeftToken=12]="ToggleLeftToken",e[e.UpdateSlippageCoefficient=13]="UpdateSlippageCoefficient",e[e.UpdateIsSlippageCoefficientCustomized=14]="UpdateIsSlippageCoefficientCustomized",e[e.UpdateFeeRate=15]="UpdateFeeRate",e[e.UpdateIsFeeRateCustomized=16]="UpdateIsFeeRateCustomized",e[e.InitEditParameters=17]="InitEditParameters",e[e.UpdatePeggedBaseTokenRatio=18]="UpdatePeggedBaseTokenRatio",e[e.UpdatePeggedQuoteTokenRatio=19]="UpdatePeggedQuoteTokenRatio"}(PL||(PL={}));const HL=({selectedVersion:e,selectedSubPeggedVersion:t,baseToken:n,quoteToken:r,baseAmount:o,quoteAmount:a,feeRate:s,initPrice:l,slippageCoefficient:d})=>{const{chainId:c,account:u}=hf(),{deadLine:p}=pf(),h=ue[c];return{getCreateParams:()=>Fn(void 0,void 0,void 0,(function*(){if(!u||!n||!r)return null;let m="";const f=Number(n.decimals),g=Number(r.decimals),y=new i(s),x=e===UR.marketMakerPool,v=e===UR.standard,b=e===UR.pegged,A=e===UR.pegged&&t===VR.GSP,w={decimals:f,address:n.address},k={decimals:g,address:r.address},C=re(o,f).toString(),j=re(a||"0",g).toString(),T=x?y.times(100).toNumber():y.times(80).toNumber();let E=x&&v?new i(a).div(o).dp(g,i.ROUND_DOWN).toString():new i(l).toString();if(v){const e=18-n.decimals+r.decimals;e<String(XR).split(".")[1].length&&(E=new i(1).div(10**e).toString())}const S=Number(d||(b?"0.1":"1")),I=Math.ceil(Date.now()/1e3)+(null!=p?p:3600);let R;const L=[c,w,k,C,j,T,E,S,I];try{e===UR.standard||e===UR.singleToken?R=yield le.encode.createDVMPoolABI(...L):x?R=yield le.encode.createDPPPoolABI(...L):b?R=yield le.encode.createDSPPoolABI(...L):A&&(R=yield le.encode.createGSPPoolABI(c,u,w,k,C,j,T,E,S,I))}catch(e){throw console.error("2.0 CreatePool createPrams error",L,e),m=`2.0 CreatePool createPrams error; ERROR: ${e}`,new Error(m)}if(!R||!R.data)throw m="invalid data",new Error(m);try{const e=h.address.toLocaleLowerCase();return o&&n.address.toLocaleUpperCase()===e?R.value=IT(o):a&&r.address===e?R.value=IT(a):R.value=0,R}catch(e){throw console.error("2.0 sendTransaction error",e),m=`2.0 sendTransaction error; ERROR: ${e}`,new Error(m)}}))}},qL=({chainId:t,baseToken:n,quoteToken:r})=>{const i=g();return rL({chainId:t,baseToken:n,quoteToken:r})?Os.jsx(f,{sx:{mb:12,py:8,px:12,borderRadius:8,backgroundColor:C(i.palette.error.main,.1),color:i.palette.error.main,textAlign:"center",typography:"h6",fontWeight:500},children:Os.jsx(e,{id:"peTryP",message:"{0}-{1} is not supported. Please select another pair.",values:{0:null==n?void 0:n.symbol,1:null==r?void 0:r.symbol}})}):null};function ZL({state:t,dispatch:n,openConfirm:o,isPeggedVersion:a,isStandardVersion:s,isSingleTokenVersion:l,fiatPriceLoading:d}){var c,u;const{currentStep:p,selectedVersion:h,baseToken:m,quoteToken:f,baseAmount:g,quoteAmount:y,initPrice:x,slippageCoefficient:v,feeRate:b}=t,A=new i(g||0),w=new i(y||0),k=EA(m,{amount:g}),C=EA(f,{amount:y}),j={variant:T.Variant.contained},E=rL({chainId:null!==(u=null===(c=t.baseToken)||void 0===c?void 0:c.chainId)&&void 0!==u?u:1,baseToken:m,quoteToken:f}),S=r._({id:"hXzOVo",message:"Next"}),I=Os.jsx(T,{fullWidth:!0,disabled:!0,...j,children:S}),R=Os.jsx(T,{variant:T.Variant.contained,fullWidth:!0,onClick:o,children:Os.jsx(e,{id:"hYgDIe",message:"Create"})});if(0===p)return Os.jsx(T,{fullWidth:!0,...j,onClick:()=>{n({type:PL.SetCurrentStep,payload:1})},children:S});const L=!m||A.isNaN()||A.lte(0),M=!f||w.isNaN()||w.lte(0);if(1===p){if(E)return I;if(a){if(!m||!f)return I}else{if(L)return I;if(k.needShowTokenStatusButton||k.insufficientBalance)return Os.jsx(kT,{status:k,buttonProps:j});if(!l){if(M)return I;if(C.needShowTokenStatusButton||C.insufficientBalance)return Os.jsx(kT,{status:C,buttonProps:j})}if(!s){if(!f)return I;const e=new i(x),t=Math.min(f.decimals,16);if(!x||e.isNaN()||e.lt(`1e-${t}`)||e.gt(JR))return I;const n=new i(v);if(!v||n.isNaN()||n.lt(0)||n.gt(h===UR.pegged?$R:KR))return I}if(d)return I;if(rL({chainId:m.chainId,baseToken:m,quoteToken:f}))return I}return Os.jsx(T,{fullWidth:!0,...j,onClick:()=>{n({type:PL.SetCurrentStep,payload:2})},children:S})}const O=new i(b),B=!b||O.isNaN()||O.lt(QR)||O.gt(GR);return 2===p?a?Os.jsx(T,{fullWidth:!0,...j,onClick:()=>{n({type:PL.SetCurrentStep,payload:3})},children:S}):B?I:R:3===p?B?I:Os.jsx(T,{fullWidth:!0,...j,onClick:()=>{n({type:PL.SetCurrentStep,payload:4})},children:S}):4===p?L||M?I:k.needShowTokenStatusButton||k.insufficientBalance?Os.jsx(kT,{status:k,buttonProps:j}):C.needShowTokenStatusButton||C.insufficientBalance?Os.jsx(kT,{status:C,buttonProps:j}):R:null}function zL({state:t,dispatch:n,isPeggedVersion:i,isStandardVersion:o,isSingleTokenVersion:a,fiatPriceLoading:s}){const{currentStep:l}=t,d=g(),{isMobile:c}=wy(),u=Hy(),{onlyChainId:p,chainId:h}=hf(),[m,y]=ct(!1),{getCreateParams:x}=HL(t),v=Ot({mutationFn:()=>Fn(this,void 0,void 0,(function*(){const e=yield x();if(!e)return;(yield u.execute(r._({id:"8OiU8L",message:"Pool Creation"}),Object.assign({opcode:By.TX,desc:"Create pool"},e),{early:!0,metadata:{[t.selectedVersion===UR.marketMakerPool?Ey.createDPPPool:t.selectedVersion===UR.pegged?t.selectedSubPeggedVersion===VR.DSP?Ey.createDSPPool:Ey.createGSPPool:Ey.createDVMPool]:"1"}}))===Sy.Submitted&&setTimeout((()=>{fw.getState().push({type:pw.Pool,params:{tab:cS.myCreated}})}),100)}))});return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:Object.assign({position:"sticky",left:0,right:0,bottom:0,backgroundColor:d.palette.background.paperContrast,px:20,py:20},c?{}:{position:"static",backgroundColor:"transparent",py:0}),children:[1==l&&Os.jsx(qL,{chainId:h,baseToken:t.baseToken,quoteToken:t.quoteToken}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[0===l&&c&&Os.jsx(T,{variant:T.Variant.second,fullWidth:!0,onClick:()=>{fw.getState().back()},children:Os.jsx(e,{id:"dEgA5A",message:"Cancel"})}),l>0&&Os.jsx(T,{variant:T.Variant.second,fullWidth:!0,onClick:()=>{n({type:PL.SetCurrentStep,payload:l-1})},children:Os.jsx(e,{id:"iH8pgl",message:"Back"})}),Os.jsx(sb,{chainId:p,variant:T.Variant.contained,fullWidth:!0,includeButton:!0,children:Os.jsx(ZL,{state:t,dispatch:n,openConfirm:()=>{y(!0)},isPeggedVersion:i,isStandardVersion:o,isSingleTokenVersion:a,fiatPriceLoading:s})})]})]}),Os.jsx(UL,{on:m,onClose:()=>y(!1),state:t,isModify:!1,onConfirm:v.mutate,loading:v.isPending})]})}function QL({selected:e}){const t=g();return Os.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{marginLeft:"auto",flexShrink:0},children:[Os.jsx("rect",{x:"0.5",y:"0.5",width:"17",height:"17",rx:"8.5",stroke:e?t.palette.success.main:t.palette.text.secondary}),e&&Os.jsx("rect",{x:"4.5",y:"4.5",width:"9",height:"9",rx:"4.5",fill:t.palette.success.main,stroke:t.palette.success.main})]})}function GL({title:e,subTitle:t,description:n,selected:r,onClick:i,children:o,sx:a,titleSx:s}){const l=g(),d="light"===l.palette.mode;return Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",p:20,backgroundColor:l.palette.background.tag,borderWidth:1,borderColor:r?l.palette.primary.main:"transparent",borderStyle:"solid",borderRadius:12,flexWrap:"wrap",justifyContent:"flex-start",textAlign:"left","&:hover":{borderColor:l.palette.primary.main}},a),component:y,onClick:i,children:[Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between",typography:"caption",pr:2,color:r?d?l.palette.text.primary:l.palette.primary.main:l.palette.text.primary},s),children:[e,t,Os.jsx(QL,{selected:r})]}),Os.jsx(f,{sx:{mt:8,typography:"body2",width:"100%",textAlign:"left",color:r?d?l.palette.text.primary:l.palette.primary.main:l.palette.text.secondary},children:n}),o]})}function YL({errorMsg:e,isCustomized:t,onClick:n,value:i,onChange:o}){const a=g(),s=lt((()=>!(!i||"0"===i||Number(i))),[i]);return Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{sx:{py:12,px:20,backgroundColor:a.palette.background.paper,borderColor:t&&e||s?a.palette.error.main:t?a.palette.primary.main:a.palette.border.main,borderWidth:1,borderStyle:"solid",borderRadius:12,display:"flex",alignItems:"center"},onClick:n,children:Os.jsx(hy,{value:t?i:"",onChange:o,suffix:Os.jsx(QL,{selected:t}),placeholder:r._({id:"8Tg/JR",message:"Custom"}),sx:{backgroundColor:"transparent","& input":{typography:"body1",height:36,lineHeight:"36px",p:a.spacing(0),color:a.palette.text.primary,"&::placeholder":{color:a.palette.text.disabled,fontWeight:600,typography:"body1",lineHeight:1,position:"relative"}}}})}),e&&Os.jsx(f,{sx:{typography:"h6",color:"error.main",mt:6},children:e})]})}const XL=()=>[{title:"0.01%",description:r._({id:"yzjPpo",message:"Fees will be the same as in most other pools."}),value:"0.01"},{title:"0.3%",description:r._({id:"OJOe+K",message:"Set the fee to the same as most other pools"}),value:zR,tag:"99% Default"},{title:"1%",description:"Most suitable for swapping exotic assets.",value:"1"}];function JL(){const e=g();return lt((()=>XL().map((t=>t.value===zR?Object.assign(Object.assign({},t),{tagBackgroundColor:C(e.palette.purple.main,.1),tagColor:e.palette.purple.main}):t))),[e.palette.purple.main])}const KL=e=>{if(!e)return"";const t=new i(e);return t.isNaN()||!t.lt(QR)&&!t.gt(GR)?"":r._({id:"GSt7YT",message:"The fee rate must be between 0.01% to 10%"})},_L=(e,t)=>{if(!e)return"";const n=new i(e);if(!n.isNaN()&&(n.lt(0)||n.gt(t===UR.pegged?$R:KR)))switch(t){case UR.standard:case UR.singleToken:case UR.marketMakerPool:return r._({id:"3U+Oti",message:"he slippage coefficient needs to be greater than or equal to 0, and less than or equal to 1."});case UR.pegged:return r._({id:"LDprZB",message:"The slippage coefficient needs to be greater than 0, and less than 0.1."})}return""};function $L({dispatch:t,feeRate:n,isFeeRateCustomized:r}){const i=g(),o=JL(),a=lt((()=>KL(n)||""),[n]);return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:12,px:20},children:[o.map((e=>{const o=!r&&n===e.value;return Os.jsx(GL,{title:e.title,description:e.description,onClick:()=>{t({type:PL.UpdateIsFeeRateCustomized,payload:!1}),t({type:PL.UpdateFeeRate,payload:e.value})},selected:o,subTitle:e.tag?Os.jsx(wL,{color:e.tagColor,backgroundColor:e.tagBackgroundColor,tagKey:e.tag}):void 0,sx:{backgroundColor:i.palette.background.paper,borderColor:o?i.palette.primary.main:i.palette.border.main}},e.value)})),Os.jsx(f,{sx:{mt:8},children:Os.jsx(YL,{errorMsg:a,isCustomized:r,onClick:()=>{t({type:PL.UpdateFeeRate,payload:""}),t({type:PL.UpdateIsFeeRateCustomized,payload:!0})},value:n,onChange:e=>{t({type:PL.UpdateFeeRate,payload:e})}})})]}),Os.jsx(f,{sx:{typography:"body2",mt:20,color:"text.secondary",px:20},children:Os.jsx(e,{id:"0b0AkA",message:"* Please note that the Fee Rate cannot be modified after the pool is created"})})]})}function eM({on:t,onClose:n,onConfirm:i}){return Os.jsx(ET,{open:t,onClose:n,onConfirm:i,title:r._({id:"t+LmjM",message:"Initial Price Alert"}),modal:!0,children:Os.jsx(e,{id:"yXm1vH",message:"The initial price is different from the current market price, which may cause your pool to be arbitraged"})})}const tM=({title:e,children:t,sx:n})=>{const r=g();return Os.jsxs(f,{sx:Object.assign({mx:20,display:"flex",flexDirection:"column",alignItems:"stretch",gap:12},n),children:[Os.jsx(f,{sx:{typography:"body2",color:r.palette.text.primary,fontWeight:500,display:"flex",alignItems:"center"},children:e}),t]})};function nM({selectedVersion:t,isStandardVersion:n,isSingleTokenVersion:o,isFixedRatio:a,leftTokenAddress:s,baseToken:l,quoteToken:d,fixedRatioPrice:c,dispatch:u,priceInfo:p}){const h=g(),[m,x]=ct(!1),{versionMap:v}=HR(),{initPriceLabel:b,initPriceTips:k,initPriceTipsLink:j}=v[t],T=s===(null==l?void 0:l.address),E=T?null==l?void 0:l.symbol:null==d?void 0:d.symbol,R=T?null==d?void 0:d.symbol:null==l?void 0:l.symbol,{currentPrice:L,isErrorPrice:M,isNullPrice:O,fiatPriceLoading:B}=p,D=T?null==d?void 0:d.decimals:null==l?void 0:l.decimals,N=lt((()=>{if(!d)return"";const e=function(e,t,n){if(!t)return"";const o=new i(t),a=Math.min(n,16),s=Number(`1e-${a}`);if(e!==UR.standard&&!o.isNaN()&&(o.lt(s)||o.gt(JR))){const t=s.toFixed(a);switch(e){case UR.pegged:case UR.singleToken:return r._({id:"P4iKEj",message:"The initial price needs to be greater than {min} and less than 100,000,000",values:{min:t}});case UR.marketMakerPool:return r._({id:"kdzjmC",message:"The mid price needs to be greater than {min} and less than 100,000,000",values:{min:t}})}}return""}(t,c,d.decimals);return e||""}),[c,d,t]),F=lt((()=>!(!c||"0"===c||Number(c))),[c]);return Os.jsxs(Os.Fragment,{children:[Os.jsx(tM,{title:Os.jsxs(Os.Fragment,{children:[b,k&&Os.jsx(P,{title:Os.jsxs(Os.Fragment,{children:[k,j?Os.jsxs(Os.Fragment,{children:["\n",Os.jsxs(f,{component:"a",href:j,target:"_blank",rel:"noopener noreferrer",sx:{color:"primary.main",textDecoration:"underline"},onClick:e=>{e.stopPropagation()},children:[Os.jsx(e,{id:"NgeSlx",message:"Learn More"}),">"]})]}):""]}),ml:4,sx:{width:14,height:14,alignItems:"center"}})]}),sx:{mt:20},children:Os.jsxs(f,{sx:{pt:n?11:19,px:19,pb:11,borderWidth:1,borderStyle:"solid",borderColor:N||F?"error.main":h.palette.background.input,borderRadius:8,backgroundColor:h.palette.background.input,display:"flex",flexDirection:"column",alignItems:"stretch",gap:20},children:[n?null:Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{typography:"body2",color:h.palette.text.primary,display:"flex",alignItems:"center"},children:[Os.jsxs(f,{sx:{fontWeight:600,color:h.palette.text.disabled,flexShrink:0},children:["1 ",null!=E?E:"-"," ="]}),Os.jsx(hy,{value:c,onChange:e=>{u({type:PL.UpdateFixedRatioPrice,payload:e})},readOnly:a,sx:{pl:0,pr:0,mt:0,flex:"1 1 auto","& input":{textAlign:"right",typography:"h5",height:25,py:0,px:8,color:h.palette.text.primary,"&::placeholder":{color:h.palette.text.disabled}}}}),Os.jsx(f,{sx:{typography:"body2",fontWeight:600,color:h.palette.text.disabled,flexShrink:0},children:null!=R?R:"-"}),Os.jsx(f,{sx:{display:"flex",alignItems:"center"},component:y,onClick:()=>{u({type:PL.ToggleLeftToken})},children:Os.jsx(I,{weak:!0,component:As.Switch,sx:{marginLeft:8,p:h.spacing(2),color:h.palette.text.primary,backgroundColor:C(h.palette.primary.main,.1),borderRadius:"50%"}})})]}),N&&Os.jsx(f,{sx:{typography:"h6",color:"error.main",mt:-14},children:N})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:n?"flex-start":"flex-end",typography:"h6",color:h.palette.text.primary,fontWeight:500},children:["=",Os.jsx(e,{id:"pdZiL7",message:"Current Market Price:"})," ",B?Os.jsx(w,{sx:{borderRadius:4},width:50,height:17}):O?Os.jsx(A,{title:Os.jsx(e,{id:"mObS+5",message:"Failed to get price of the token"}),children:Os.jsx(f,{component:As.Warn,sx:{width:14,height:14,color:h.palette.error.main,typography:"h6"}})}):An({input:L,decimals:D})," ",R,M||o?null:Os.jsx(S,{checked:a,onChange:e=>{if(e.target.checked){if(u({type:PL.UpdateIsFixedRatio,payload:!0}),!D)throw new Error("currentTokenDecimals is undefined");L&&!L.isNaN()&&u({type:PL.UpdateFixedRatioPrice,payload:L.dp(D,i.ROUND_DOWN).toString()})}else x(!0)},sx:{ml:8}})]})]})}),Os.jsx(eM,{on:m,onClose:()=>x(!1),onConfirm:()=>{u({type:PL.UpdateIsFixedRatio,payload:!1})}})]})}function rM({selectedVersion:e,selectedSubPeggedVersion:t,baseToken:n,quoteToken:r,initPrice:i,dispatch:o}){var a;const s=g(),{versionMap:l,subPeggedVersionList:d}=HR(),{initPriceLabel:c}=l[e];return n&&r?Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{mt:8,display:"flex",flexDirection:"column",alignItems:"center",gap:4},children:[Os.jsx(f,{sx:{typography:"body2",color:s.palette.text.secondary,fontWeight:500},children:c}),Os.jsxs(f,{sx:{typography:"h5",color:s.palette.text.primary,fontWeight:600},children:["1 ",null==n?void 0:n.symbol,"=",null!==(a=tL({midPrice:void 0,quoteToken:r,selectedVersion:e,initPrice:i}))&&void 0!==a?a:"-"," ",r.symbol]})]}),Os.jsx(f,{sx:{mt:20,display:"flex",flexDirection:"column",gap:12,px:20},children:d.map((e=>{const n=t===e.version;return Os.jsx(GL,{title:e.title,description:e.description,onClick:()=>{o({type:PL.SelectNewSubPeggedVersion,payload:e.version})},selected:n,subTitle:void 0,sx:{backgroundColor:s.palette.background.paper,borderColor:n?s.palette.primary.main:s.palette.border.main},titleSx:{typography:"body1",fontWeight:600}},e.version)}))})]}):null}function iM({title:e,value:t,onChange:n}){const r=g();return Os.jsxs(f,{sx:{flexGrow:1,flexShrink:1,flexBasis:"50%",display:"flex",alignItems:"center",px:15,py:7,borderWidth:1,borderStyle:"solid",borderColor:r.palette.border.main,borderRadius:8,backgroundColor:r.palette.background.input},children:[Os.jsx(f,{sx:{color:r.palette.text.primary,typography:"body1",fontWeight:500,flexShrink:0},children:e}),Os.jsx(hy,{value:t,onChange:n,suffix:"%",placeholder:"0",sx:{mt:0,display:"flex",alignItems:"center",width:"100%",typography:"h5",lineHeight:"32px",color:r.palette.text.disabled,"& input":{textAlign:"right",py:0,px:8,color:r.palette.text.primary,"&::placeholder":{opacity:1,color:r.palette.text.disabled,fontWeight:600,typography:"h5",lineHeight:1,position:"relative"}}}})]})}const oM=({baseToken:t,quoteToken:n,initPrice:r,peggedBaseTokenRatio:o,peggedQuoteTokenRatio:a,baseAmount:s,quoteAmount:l,dispatch:d})=>{var c,u;const p=g(),[h,m]=lt((()=>{const{base:e,quote:t}=nL({initPrice:r});return[e?e.multipliedBy(100).toString():null,t?t.multipliedBy(100).toString():null]}),[r]),y=""===o&&""===a,[x,v]=lt((()=>{var e,o;const a=null!==(e=null==t?void 0:t.decimals)&&void 0!==e?e:0,d=null!==(o=null==n?void 0:n.decimals)&&void 0!==o?o:0,c=new i(s).dp(a,i.ROUND_DOWN).multipliedBy(`1e${a}`),u=new i(l).dp(d,i.ROUND_DOWN).multipliedBy(`1e${d}`),p=new i(r).multipliedBy(`1e${18-a+d}`).dp(0,i.ROUND_DOWN),h=u.lt(c.multipliedBy(p).div(1e18))?u.multipliedBy(1e18).div(p):c,m=new i(1001);if(m.gt(h))return[new i(1),"100%"];const f=m.dividedBy(h);return[f,Bn({input:f})]}),[s,null==t?void 0:t.decimals,r,l,null==n?void 0:n.decimals]),b=lt((()=>!!x.lte("0.0000000001")||null!=h&&o===h&&null!=m&&a===m),[x,o,a,h,m]),A=`${null==t?void 0:t.symbol}:${null==n?void 0:n.symbol}=${h}%:${m}%`;return Os.jsxs(tM,{title:Os.jsx(e,{id:"OuSseo",message:"Ratio Settings"}),children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:4},children:[Os.jsx(iM,{title:null!==(c=null==t?void 0:t.symbol)&&void 0!==c?c:"",value:o,onChange:e=>{d({type:PL.UpdatePeggedBaseTokenRatio,payload:e})}}),Os.jsx(f,{sx:{color:p.palette.text.primary,typography:"body2",fontWeight:500,width:14,flexShrink:0,flexGrow:0,textAlign:"center"},children:":"}),Os.jsx(iM,{title:null!==(u=null==n?void 0:n.symbol)&&void 0!==u?u:"",value:a,onChange:e=>{d({type:PL.UpdatePeggedQuoteTokenRatio,payload:e})}})]}),Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:20,px:19,pt:19,pb:11,borderRadius:16,borderWidth:1,borderColor:b||y?p.palette.border.main:"transparent",borderStyle:"solid",backgroundColor:b||y?p.palette.background.paper:C(p.palette.warning.main,.1)},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[y?null:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8,color:b?p.palette.text.primary:p.palette.warning.main,typography:"body1",fontWeight:600},children:[b?null:Os.jsx(As.Warn,{}),Os.jsx(e,{id:"x3muNy",message:"Liquidity Burn Ratio"}),": ",v]}),Os.jsx(f,{sx:{color:p.palette.text.secondary,typography:"h6",textAlign:"center","&>strong":{color:b?p.palette.text.primary:p.palette.warning.main}},children:y?Os.jsx(e,{id:"pQJBKk",message:"The closer the provided asset ratio is to the recommended ratio ({recommendRatioText}), the smaller the portion burned.",values:{recommendRatioText:A}}):Os.jsx(e,{id:"ZlQ83E",message:"<0>{lostRatio}</0> of the initial liquidity you provide will be burned. <1/>The closer the provided asset ratio is to the recommended ratio ({recommendRatioText}), the smaller the portion burned.",values:{lostRatio:v,recommendRatioText:A},components:{0:Os.jsx("strong",{}),1:Os.jsx("br",{})}})})]}),y||!b?Os.jsx(T,{variant:T.Variant.outlined,fullWidth:!0,size:T.Size.small,onClick:()=>{d({type:PL.UpdatePeggedBaseTokenRatio,payload:null!=h?h:""})},sx:{border:`solid 1px ${p.palette.text.primary}`,color:p.palette.text.primary,"&:hover":{background:C(p.palette.text.primary,.1)}},children:Os.jsx(e,{id:"NjdGps",message:"Use the recommended ratio"})}):null]})]})};function aM({open:e,onClose:t,afterClose:n,title:r,titleCenter:i,rightSlot:o,canBack:a=!0,children:s,width:l=420,height:d,testId:c}){const u=g(),{isMobile:p}=wy();return Os.jsx(E,{open:e,onClose:t,container:p?document.querySelector(`.${Ev}`):void 0,disableEnforceFocus:!0,children:Os.jsxs(f,{sx:Object.assign({backgroundColor:"background.paper",display:"flex",height:d,flexDirection:"column",justifyContent:"center",alignItems:"center",outline:0,overflow:"hidden","& > div":{width:"100%"}},p?{width:"100%",borderRadius:u.spacing(16,16,0,0)}:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:l,maxWidth:"95%",minHeight:200,maxHeight:"80%",borderRadius:16}),"data-testid":c,children:[r?Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:i?"center":"space-between",p:20,width:"100%",boxSizing:"border-box"},children:[Os.jsx(f,{sx:{display:"flex",alignItems:"center",typography:"caption"},children:r}),o,!o&&a&&Os.jsx(f,{component:As.Error,sx:{color:"text.secondary",cursor:"pointer"},onClick:()=>{t&&t(),null==n||n()}})]}):"",s]})})}var sM;function lM(){return lM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lM.apply(null,arguments)}const dM=e=>ot.createElement("svg",lM({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),sM||(sM=ot.createElement("g",{id:"ICON/18px/arrow/\\xE6\\x94\\xB6\\xE8\\xB5\\xB7/Dark"},ot.createElement("path",{id:"\\xE4\\xB8\\x89\\xE8\\xA7\\x92\\xE5\\xBD\\xA2",fillRule:"evenodd",clipRule:"evenodd",d:"M6.58398 12.376C6.78189 12.6728 7.21811 12.6728 7.41603 12.376L10.4818 7.77735C10.7033 7.44507 10.4651 7 10.0657 7H3.93426C3.53491 7 3.29672 7.44507 3.51823 7.77735L6.58398 12.376Z",fill:"currentColor"}))));function cM({dispatch:t,slippageCoefficient:n,selectedVersion:i,isCustomized:o,isStandardVersion:a}){const s=g(),[l,d]=ct(!1),[c,u]=ct(n),p=function({selectedVersion:e}){const t=g();return lt((()=>{const n=t.palette.background.paperDarkContrast,i=t.palette.text.disabled,o=t.palette.purple.main,a=C(o,.1);return e===UR.pegged?[{tag:"",description:r._({id:"PPqGw9",message:"Applicable to pegged assets with a fixed price and no fluctuation"}),value:"0",title:"K=0",tagBackgroundColor:"transparent",tagColor:"transparent"},{tag:r._({id:"nTWWCZ",message:"Low"}),description:r._({id:"L4nQwl",message:"Suitable for stablecoins with price fluctuations within 0.5%"}),value:"0.0001",title:"K=0.0001",tagBackgroundColor:a,tagColor:o},{tag:r._({id:"agPptk",message:"Medium"}),description:r._({id:"FrP5tr",message:"Suitable for stablecoins with price fluctuations within 2%"}),value:"0.0005",title:"K=0.0005",tagBackgroundColor:n,tagColor:i},{tag:r._({id:"yx/fMc",message:"High"}),description:r._({id:"bC0iyq",message:"Suitable for stablecoins with price fluctuations within 10%"}),value:"0.002",title:"K=0.002",tagBackgroundColor:n,tagColor:i}]:[{tag:r._({id:"agPptk",message:"Medium"}),description:r._({id:"VXTSOE",message:"Suitable for most situations."}),value:"0.5",title:"K=0.5",tagBackgroundColor:n,tagColor:i},{tag:r._({id:"nTWWCZ",message:"Low"}),description:r._({id:"DPi/hO",message:"Results in a relatively fixed price."}),value:"0.01",title:"K=0.01",tagBackgroundColor:n,tagColor:i},{tag:r._({id:"yx/fMc",message:"High"}),description:r._({id:"fKYdE9",message:"Results in a more volatile price."}),value:"1",title:"K=1",tagBackgroundColor:a,tagColor:o}]}),[e,t.palette])}({selectedVersion:i}),[h,m]=ct(n);h!==n&&(m(n),u(n));const x=lt((()=>{const e=_L(c,i);return null!=e?e:""}),[i,c]),v=lt((()=>!(!c||"0"===c||Number(c))),[c]),b=Boolean(x)||v||o&&!c;return Os.jsxs(Os.Fragment,{children:[Os.jsx(tM,{title:Os.jsxs(Os.Fragment,{children:[Os.jsx(e,{id:"sjn3tj",message:"Slippage Coefficient"}),Os.jsx(P,{title:r._({id:"+/wf6Z",message:"The smaller the slippage coefficient, the lower the slippage for traders, and the deeper the market depth."}),ml:4,sx:{width:14,height:14}})]}),sx:{mt:20},children:Os.jsxs(f,{component:y,sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:20,py:8,color:s.palette.text.primary,borderRadius:8,backgroundColor:s.palette.background.input,"&:hover":{backgroundColor:s.palette.hover.default},"&[disabled]>svg":{color:s.palette.text.disabled}},disabled:a,onClick:a?void 0:()=>{d(!0)},children:[Os.jsx(f,{sx:{typography:"h5",fontWeight:600,lineHeight:"32px"},children:n}),Os.jsx(f,{component:dM,sx:{flexShrink:0,width:18,height:18}})]})}),Os.jsx(aM,{open:l,onClose:()=>d(!1),title:Os.jsxs(f,{children:[Os.jsx(e,{id:"sjn3tj",message:"Slippage Coefficient"}),Os.jsx(P,{title:r._({id:"+/wf6Z",message:"The smaller the slippage coefficient, the lower the slippage for traders, and the deeper the market depth."}),ml:8})]}),children:Os.jsxs(f,{sx:{flex:1,overflowY:"auto"},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:12,p:s.spacing(8,28,28)},children:[p.map((e=>{const n=!o&&c===e.value;return Os.jsx(GL,{title:e.title,description:e.description,onClick:()=>{t({type:PL.UpdateIsSlippageCoefficientCustomized,payload:!1}),u(e.value)},selected:n,subTitle:e.tag?Os.jsx(wL,{color:e.tagColor,backgroundColor:e.tagBackgroundColor,tagKey:e.tag}):void 0,sx:{backgroundColor:s.palette.background.paper,borderColor:n?s.palette.primary.main:s.palette.border.main},titleSx:{typography:"body1"}},e.value)})),Os.jsx(f,{sx:{mt:8},children:Os.jsx(YL,{errorMsg:x,isCustomized:o,onClick:()=>{o||u(""),t({type:PL.UpdateIsSlippageCoefficientCustomized,payload:!0})},value:c,onChange:e=>{u(e)}})})]}),Os.jsx(f,{sx:{position:"sticky",bottom:0,px:20,py:16,backgroundColor:"background.paperContrast"},children:Os.jsx(T,{fullWidth:!0,disabled:b,onClick:()=>{t({type:PL.UpdateSlippageCoefficient,payload:c}),d(!1)},children:Os.jsx(e,{id:"7VpPHA",message:"Confirm"})})})]})})]})}function uM({token:t,oppositeTokenAddress:n,dispatch:r,tokenSelectOnChange:i}){var o;const a=g(),{chainId:s,account:l}=At(),[d,c]=at.useState(!1),u=It(Object.assign({},$a.getFetchTokenQuery(s,null==t?void 0:t.address,l)));return t?Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{component:y,sx:{display:"flex",alignItems:"center",px:20,py:8,borderRadius:8,backgroundColor:a.palette.background.input,"&:hover":{backgroundColor:a.palette.hover.default}},onClick:()=>{c(!0)},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[Os.jsx(ey,{address:t.address,marginRight:0,width:24,height:24,chainId:t.chainId||s,noShowChain:!0,sx:{flexShrink:0}}),Os.jsx(f,{sx:{typography:"h5",color:a.palette.text.primary,fontWeight:600,lineHeight:"32px",flexShrink:0},children:t.symbol}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",typography:"h6",fontWeight:500,color:a.palette.text.secondary,wordBreak:"break-all"},children:["(",Os.jsx(e,{id:"fsBGk0",message:"Balance"}),": ",!t.address||u.isLoading?Os.jsx(x,{}):An({input:null===(o=u.data)||void 0===o?void 0:o.balance,decimals:t.decimals}),")"]})]}),Os.jsx(f,{component:dM,sx:{flexShrink:0,ml:"auto",width:18,height:18}})]}),Os.jsx(ky,{value:t,open:d,chainId:s,occupiedAddrs:[n],occupiedChainId:t.chainId,onClose:()=>{c(!1)},onTokenChange:(e,t)=>{if(!Array.isArray(e)){if(t)return r({type:PL.SwitchTokens}),void c(!1);i(e),c(!1)}},modal:!0})]}):null}const pM=({baseToken:t,quoteToken:n,dispatch:r})=>{var i,o;return Os.jsxs(tM,{title:Os.jsx(e,{id:"dmiCGN",message:"Select Token Pair"}),children:[Os.jsx(uM,{token:t,oppositeTokenAddress:null!==(i=null==n?void 0:n.address)&&void 0!==i?i:"",dispatch:r,tokenSelectOnChange:e=>{r({type:PL.UpdateBaseToken,payload:e})}}),Os.jsx(uM,{token:n,oppositeTokenAddress:null!==(o=null==t?void 0:t.address)&&void 0!==o?o:"",dispatch:r,tokenSelectOnChange:e=>{r({type:PL.UpdateQuoteToken,payload:e})}})]})};function hM({selectedVersion:e,dispatch:t}){const n=g(),{isMobile:r}=wy(),{versionList:i}=HR(),o="light"===n.palette.mode;return Os.jsx(f,{sx:{display:"flex",flexDirection:"column",gap:12,px:20},children:i.map((n=>{const i=e===n.version;return Os.jsx(GL,{title:n.title,description:n.description,onClick:()=>{t({type:PL.SelectNewVersion,payload:n.version})},selected:i,children:r&&i&&Os.jsx(f,{component:o?n.exampleImgUrl:n.exampleDarkImgUrl,sx:{mt:28,width:"100%",height:88.1}})},n.version)}))})}function mM(){const{defaultBaseToken:t,defaultQuoteToken:n}=ML(),{chainId:o}=hf(),[a,s]=at.useReducer(FL,{currentStep:0,selectedVersion:UR.standard,baseToken:t,quoteToken:n,baseAmount:"",quoteAmount:"",isFixedRatio:!0,initPrice:XR,fixedRatioPrice:YR,leftTokenAddress:null==t?void 0:t.address,feeRate:zR,isFeeRateCustomized:!1,slippageCoefficient:KR,isSlippageCoefficientCustomized:!1,peggedBaseTokenRatio:"",peggedQuoteTokenRatio:""});!t||a.baseToken&&a.baseToken.chainId===o||s({type:PL.UpdateBaseToken,payload:t}),!n||a.quoteToken&&a.quoteToken.chainId===o||s({type:PL.UpdateQuoteToken,payload:n});const{isMobile:l}=wy(),{versionMap:d}=HR(),c=d[a.selectedVersion],u=a.selectedVersion===UR.singleToken,p=a.selectedVersion===UR.standard,h=a.selectedVersion===UR.pegged,m=u?a.quoteToken:a.baseToken,g=u?a.baseToken:a.quoteToken,y=WL({isSingleTokenVersion:u,leftTokenAddress:a.leftTokenAddress,baseToken:a.baseToken,quoteToken:a.quoteToken,dispatch:s}),x=new i(a.peggedBaseTokenRatio).div(100).dp(eL,i.ROUND_DOWN),v=new i(a.peggedQuoteTokenRatio).div(100).dp(eL,i.ROUND_DOWN),b=h&&x.lte(0),A=h&&v.lte(0),w=Os.jsxs(f,{sx:{px:20},children:[Os.jsx(Qy,{canClickBalance:!0,showPercentage:!0,amt:u?a.quoteAmount:a.baseAmount,onInputChange:u?void 0:e=>{s({type:u?PL.UpdateQuoteAmount:PL.UpdateBaseAmount,payload:e})},readOnly:u||b,inputReadonlyTooltip:b?r._({id:"t3d3/V",message:"ratio is 0"}):void 0,token:m,occupiedAddrs:g?[g.address]:void 0,occupiedChainId:o,chainId:o,onTokenChange:h?void 0:(e,t)=>{s(t?{type:PL.SwitchTokens}:{type:u?PL.UpdateQuoteToken:PL.UpdateBaseToken,payload:e})}}),Os.jsx(zy,{}),Os.jsx(Qy,{canClickBalance:!0,showPercentage:!0,amt:u?a.baseAmount:a.quoteAmount,onInputChange:e=>{s({type:u?PL.UpdateBaseAmount:PL.UpdateQuoteAmount,payload:e})},readOnly:p&&a.isFixedRatio&&!!a.fixedRatioPrice||A,inputReadonlyTooltip:A?r._({id:"t3d3/V",message:"ratio is 0"}):r._({id:"5QDjef",message:"The token amount is calculated by initial price."}),token:g,occupiedAddrs:m?[m.address]:void 0,occupiedChainId:o,chainId:o,onTokenChange:(e,t)=>{s(t?{type:PL.SwitchTokens}:{type:u?PL.UpdateBaseToken:PL.UpdateQuoteToken,payload:e})}})]});return Os.jsx(xw,{children:Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"flex-start",height:"100%"},l?{}:{height:"auto",overflowX:"auto"}),children:[l?null:Os.jsxs(f,{sx:{mr:12,flexGrow:1,display:"block",overflow:"hidden"},children:[Os.jsx(jS,{}),Os.jsx(f,{sx:{mt:28,typography:"h4",fontWeight:600,color:"text.primary"},children:Os.jsx(e,{id:"pHQq+U",message:"Pool Setup"})}),Os.jsx(SL,{titleKey:r._({id:"hdIg7i",message:"Select Pool Version"}),index:1,status:0===a.currentStep?"running":"completed"}),Os.jsx(RL,{versionItem:c,status:0===a.currentStep?"running":"completed"},c.version),Os.jsx(SL,{titleKey:r._({id:"lsg9Mi",message:"Parameter Settings"}),index:2,status:0===a.currentStep?"waiting":1===a.currentStep?"running":"completed"}),h?Os.jsx(oL,{status:0===a.currentStep?"waiting":1===a.currentStep?"running":"completed",baseToken:a.baseToken,quoteToken:a.quoteToken,initPrice:a.initPrice,slippageCoefficient:a.slippageCoefficient,selectedVersion:a.selectedVersion,midPrice:void 0}):Os.jsx(TL,{status:0===a.currentStep?"waiting":1===a.currentStep?"running":"completed",baseToken:a.baseToken,quoteToken:a.quoteToken,initPrice:a.initPrice,slippageCoefficient:a.slippageCoefficient,selectedVersion:a.selectedVersion,baseAmount:a.baseAmount,quoteAmount:a.quoteAmount}),h&&Os.jsxs(Os.Fragment,{children:[Os.jsx(SL,{titleKey:r._({id:"6lss/t",message:"Pricing Model"}),index:3,status:a.currentStep>2?"completed":2===a.currentStep?"running":"waiting"}),Os.jsx(EL,{isWaiting:a.currentStep<2,selectedSubPeggedVersion:a.selectedSubPeggedVersion})]}),Os.jsx(SL,{titleKey:r._({id:"Y7rVy0",message:"Fee Rate"}),index:3,status:2===a.currentStep?"running":"waiting"}),Os.jsx(kL,{isWaiting:a.currentStep<(h?3:2),feeRate:a.feeRate}),h&&Os.jsxs(Os.Fragment,{children:[Os.jsx(SL,{titleKey:r._({id:"3ggd2j",message:"Asset ratio within the pool"}),index:5,status:a.currentStep>4?"completed":4===a.currentStep?"running":"waiting"}),Os.jsx(CL,{isWaiting:a.currentStep<4,baseToken:a.baseToken,quoteToken:a.quoteToken,initPrice:a.initPrice,slippageCoefficient:a.slippageCoefficient,selectedVersion:a.selectedVersion,baseAmount:a.baseAmount,quoteAmount:a.quoteAmount,peggedBaseTokenRatio:a.peggedBaseTokenRatio,peggedQuoteTokenRatio:a.peggedQuoteTokenRatio})]})]}),Os.jsxs(f,{sx:Object.assign({flexGrow:1,flexShrink:0,flexBasis:375,borderRadius:0,backgroundColor:"background.paper",minHeight:"100%"},l?{}:{pb:20,borderRadius:16,flexGrow:0,minHeight:"auto",height:"100%",position:"sticky",top:"28px",overflowY:"hidden"}),children:[Os.jsx(IL,{currentStep:a.currentStep,isPeggedVersion:h}),0===a.currentStep&&Os.jsx(hM,{selectedVersion:a.selectedVersion,dispatch:s}),1===a.currentStep&&Os.jsxs(Os.Fragment,{children:[h?Os.jsx(Os.Fragment,{children:Os.jsx(pM,{baseToken:a.baseToken,quoteToken:a.quoteToken,dispatch:s})}):Os.jsxs(Os.Fragment,{children:[Os.jsx(AL,{baseToken:a.baseToken,quoteToken:a.quoteToken,initPrice:a.initPrice,slippageCoefficient:a.slippageCoefficient,selectedVersion:a.selectedVersion,baseAmount:a.baseAmount,quoteAmount:a.quoteAmount}),w]}),Os.jsx(cM,{dispatch:s,slippageCoefficient:a.slippageCoefficient,selectedVersion:a.selectedVersion,isCustomized:a.isSlippageCoefficientCustomized,isStandardVersion:p}),Os.jsx(nM,{selectedVersion:a.selectedVersion,isFixedRatio:a.isFixedRatio,leftTokenAddress:a.leftTokenAddress,baseToken:a.baseToken,quoteToken:a.quoteToken,fixedRatioPrice:a.fixedRatioPrice,dispatch:s,isStandardVersion:p,isSingleTokenVersion:u,priceInfo:y})]}),h&&2===a.currentStep&&Os.jsx(rM,{selectedVersion:a.selectedVersion,selectedSubPeggedVersion:a.selectedSubPeggedVersion,baseToken:a.baseToken,quoteToken:a.quoteToken,initPrice:a.initPrice,dispatch:s}),a.currentStep===(h?3:2)&&Os.jsx($L,{dispatch:s,feeRate:a.feeRate,isFeeRateCustomized:a.isFeeRateCustomized}),h&&4===a.currentStep&&Os.jsxs(Os.Fragment,{children:[Os.jsx(AL,{baseToken:a.baseToken,quoteToken:a.quoteToken,initPrice:a.initPrice,slippageCoefficient:a.slippageCoefficient,selectedVersion:a.selectedVersion,baseAmount:a.baseAmount,quoteAmount:a.quoteAmount}),Os.jsx(oM,{dispatch:s,baseToken:a.baseToken,quoteToken:a.quoteToken,peggedBaseTokenRatio:a.peggedBaseTokenRatio,peggedQuoteTokenRatio:a.peggedQuoteTokenRatio,initPrice:a.initPrice,baseAmount:a.baseAmount,quoteAmount:a.quoteAmount}),Os.jsx(tM,{title:Os.jsx(e,{id:"E4LM3N",message:"Add Initial Liquidity"}),sx:{mt:20},children:Os.jsx(f,{sx:{mx:-20},children:w})})]}),Os.jsx(f,{sx:Object.assign({pb:160},l?{}:{pb:28})}),Os.jsx(zL,{state:a,dispatch:s,isPeggedVersion:h,isStandardVersion:p,isSingleTokenVersion:u,fiatPriceLoading:y.fiatPriceLoading})]})]})})}function fM({open:t,onClose:n,title:r,children:i,singleBtn:o,danger:a,singleBtnText:s,cancelText:l,confirmText:d,disabledConfirm:c,confirmLoading:u,isManualClose:p,onConfirm:h}){const m=aM;return Os.jsx(m,{open:t,onClose:n,title:Os.jsx(f,{sx:{textAlign:"center"},children:r}),canBack:!1,titleCenter:!0,children:Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,width:"100%"},children:[Os.jsx(f,{sx:{typography:"body2",color:r?"text.secondary":"text.primary",textAlign:"center",wordBreak:"break-all",mt:20,px:36},children:i}),o?Os.jsx(f,{sx:{px:20},children:Os.jsx(T,{fullWidth:!0,variant:T.Variant.outlined,danger:a,sx:{mt:32,mb:20},onClick:()=>{n()},children:s||Os.jsx(e,{id:"DPfwMq",message:"Done"})})}):Os.jsxs(f,{sx:{mt:24,mb:20,mx:20,display:"flex",alignItems:"center","& > button":{flex:1}},children:[Os.jsx(T,{variant:T.Variant.second,onClick:()=>{n()},children:l||Os.jsx(e,{id:"dEgA5A",message:"Cancel"})}),Os.jsx(T,{sx:{ml:8},variant:T.Variant.outlined,danger:a,disabled:c,isLoading:u,onClick:()=>{h&&h(),p||n()},children:d||Os.jsx(e,{id:"7VpPHA",message:"Confirm"})})]})]})})}function gM({open:t,onClose:n,alertContent:i,onConfirm:o}){const a=g(),[s,l]=at.useState(!1),d=r._({id:"LQU+Dm",message:"Risk Disclaimer"});return Os.jsx(aM,{open:t,onClose:n,title:d,canBack:!1,titleCenter:!0,children:Os.jsxs(f,{sx:{flex:1,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[Os.jsx(f,{sx:{mb:20,mx:20,maxHeight:275,overflowY:"auto",borderWidth:1,borderRadius:10,borderStyle:"solid",borderColor:"border.main",p:a.spacing(20),typography:"body2",backgroundColor:a.palette.background.input,color:a.palette.text.primary,textAlign:"left"},children:i}),Os.jsxs(f,{sx:{padding:20,pt:12,backgroundColor:a.palette.background.paperContrast},children:[Os.jsxs(f,{component:"label",sx:{display:"flex",alignItems:"center",gap:8,typography:"body2",cursor:"pointer",color:"text.secondary",textAlign:"left","& a":{fontWeight:600,color:"primary.main","&:hover":{textDecoration:"underline"}}},children:[Os.jsx(S,{sx:{top:-1},checked:s,onChange:e=>{const{checked:t}=e.target;l(t)}}),Os.jsx(f,{children:Os.jsx(e,{id:"dqWPbT",message:"I have read, understand, and agree to the <0>Terms of Service</0>.",components:{0:Os.jsx("a",{href:"https://docs.dodoex.io/home/terms-of-service",target:"_blank",rel:"noopener noreferrer"})}})})]}),Os.jsx(f,{sx:{mt:12,display:"flex",alignItems:"center"},children:Os.jsx(T,{sx:{},disabled:!s,fullWidth:!0,onClick:()=>{l(!1),null==o||o()},children:Os.jsx(e,{id:"7VpPHA",message:"Confirm"})})})]})]})})}function yM({id:e,chainId:t}){var n,r,o,a,s,l,d,c,u,p,h,m,f;const g=t?Gr[t]:"",y=QA().getQuery(le.graphql.fetchPool,{id:e||"",where:{refreshNow:!1,chain:g},liquidityWhere:{chain:g,refreshNow:!1,filterState:{address:e}}}),x=It(Object.assign(Object.assign({},y),{enabled:!!e})),{pair:v,liquidity_list:b}=null!==(n=x.data)&&void 0!==n?n:{},A=null===(o=null===(r=null==b?void 0:b.lqList)||void 0===r?void 0:r[0])||void 0===o?void 0:o.pair;return Object.assign(Object.assign({},x),{poolDetail:v&&t?Object.assign(Object.assign({},v),{address:v.id,type:v.type,chainId:t,baseToken:ns(v.baseToken,t),quoteToken:ns(v.quoteToken,t),miningAddress:null!==(s=null===(a=null==A?void 0:A.miningAddress)||void 0===a?void 0:a[0])&&void 0!==s?s:"",apy:null==A?void 0:A.apy,baseApy:(null==A?void 0:A.apy)?Pn(new i(null!==(l=A.apy.transactionBaseApy)&&void 0!==l?l:0).plus(null!==(d=A.apy.miningBaseApy)&&void 0!==d?d:0)):void 0,quoteApy:Number(null===(c=null==A?void 0:A.apy)||void 0===c?void 0:c.transactionQuoteApy)||Number(null===(u=null==A?void 0:A.apy)||void 0===u?void 0:u.miningQuoteApy)?Pn(new i(null!==(h=null===(p=null==A?void 0:A.apy)||void 0===p?void 0:p.transactionQuoteApy)&&void 0!==h?h:0).plus(null!==(f=null===(m=null==A?void 0:A.apy)||void 0===m?void 0:m.miningQuoteApy)&&void 0!==f?f:0)):void 0,isCpPool:!1,cpAddress:void 0,cpLiquidator:void 0,cpCreator:void 0,cpCreatedAtTimestamp:void 0}):null})}function xM({disabled:t,chainId:n,baseStatus:r,quoteStatus:i,onClick:o}){const{account:a}=At();return a?r.needShowTokenStatusButton||i.needShowTokenStatusButton?Os.jsx(kT,{status:r.needShowTokenStatusButton?r:i,buttonProps:{variant:T.Variant.contained,fullWidth:!0}}):Os.jsx(T,{variant:T.Variant.contained,fullWidth:!0,disabled:t,onClick:()=>o(),children:Os.jsx(e,{id:"7VpPHA",message:"Confirm"})}):Os.jsx(sb,{chainId:n,variant:T.Variant.contained,fullWidth:!0,includeButton:!0})}function vM({state:t,pool:n,loading:o}){var a,s;const{baseToken:l,quoteToken:d,baseAmount:c,quoteAmount:u,initPrice:p,slippageCoefficient:h,feeRate:m}=t,y=It(es.getPMMStateQuery(null==n?void 0:n.chainId,null==n?void 0:n.address,null==n?void 0:n.type,null===(a=null==n?void 0:n.baseToken)||void 0===a?void 0:a.decimals,null===(s=null==n?void 0:n.quoteToken)||void 0===s?void 0:s.decimals)),x=g(),{isMobile:v}=wy(),{account:b}=At(),A=fw(),[w,k]=at.useState(!1),C=y.data&&c?new i(c).minus(y.data.baseReserve):void 0,j=y.data&&u?new i(u).minus(y.data.quoteReserve):void 0,E=null==C?void 0:C.lt(0),S=EA(l,{amount:C}),I=EA(d,{amount:j});let R=!n||o||!c||Number(c)<0||!u||Number(u)<0;if(!R&&d){const e=new i(p),t=Math.min(d.decimals,16);(!p||e.isNaN()||e.lt(`1e-${t}`)||e.gt(JR))&&(R=!0);const n=new i(h);(!h||n.isNaN()||n.lt(0)||n.gt(KR))&&(R=!0);const r=new i(m);(!m||r.isNaN()||r.lt(0)||r.gt(GR))&&(R=!0)}const{modifyDPPMutation:L}=OT({pool:n||void 0});return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:Object.assign(Object.assign({position:"sticky",left:0,right:0,bottom:0,backgroundColor:x.palette.background.paperContrast,px:20,py:20},v?{}:{position:"static",backgroundColor:"transparent",py:0}),{display:"flex",alignItems:"center",gap:8}),children:[v&&!!b&&Os.jsx(T,{variant:T.Variant.second,fullWidth:!0,onClick:()=>{A.back()},children:Os.jsx(e,{id:"dEgA5A",message:"Cancel"})}),Os.jsx(xM,{disabled:R,chainId:null==n?void 0:n.chainId,baseStatus:S,quoteStatus:I,onClick:()=>k(!0)})]}),Os.jsx(UL,{on:w,onClose:()=>k(!1),state:t,isModify:!0,loading:L.isPending,onConfirm:()=>{var e,n;L.mutate({txTitle:r._({id:"KRnA5J",message:"Set pool parameters"}),baseAmount:null!==(e=null==C?void 0:C.toString())&&void 0!==e?e:"",quoteAmount:null!==(n=null==j?void 0:j.toString())&&void 0!==n?n:"",isRemove:E,feeRate:t.feeRate,initPrice:t.initPrice,slippageCoefficient:t.slippageCoefficient,submittedBack:()=>{k(!1),A.push({type:pw.Pool,params:{tab:cS.myCreated}})}})}})]})}function bM({dispatch:t,feeRate:n,isCustomized:i}){const o=g(),[a,s]=at.useState(!1),[l,d]=at.useState(n),c=JL();!l&&n&&d(n);const u=KL(l),p=!(!l||"0"===l||Number(l)),h=Boolean(u)||p||i&&!l;return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:20,px:20},children:[Os.jsxs(f,{sx:{fontWeight:500,display:"flex",alignItems:"center"},children:[Os.jsx(e,{id:"Y7rVy0",message:"Fee Rate"}),Os.jsx(P,{title:r._({id:"2vjOqX",message:"Pools with lower transaction fees will attract more traders."}),ml:8,size:16})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",ml:12},children:[n,"%",Os.jsx(T,{variant:T.Variant.tag,sx:{ml:12,fontSize:12},onClick:()=>s(!0),children:Os.jsx(e,{id:"ePK91l",message:"Edit"})})]})]}),Os.jsx(aM,{open:a,onClose:()=>s(!1),title:Os.jsxs(f,{children:[Os.jsx(e,{id:"Y7rVy0",message:"Fee Rate"}),Os.jsx(P,{title:r._({id:"2vjOqX",message:"Pools with lower transaction fees will attract more traders."}),ml:8})]}),children:Os.jsxs(f,{sx:{flex:1,overflowY:"auto"},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:12,p:o.spacing(8,28,28)},children:[c.map((e=>{const n=!i&&l===e.value;return Os.jsx(GL,{title:e.title,description:e.description,onClick:()=>{t({type:PL.UpdateIsFeeRateCustomized,payload:!1}),d(e.value)},selected:n,subTitle:e.tag?Os.jsx(wL,{color:e.tagColor,backgroundColor:e.tagBackgroundColor,tagKey:e.tag}):void 0,sx:{backgroundColor:o.palette.background.paper,borderColor:n?o.palette.primary.main:o.palette.border.main}},e.value)})),Os.jsx(f,{sx:{mt:8},children:Os.jsx(YL,{errorMsg:u,isCustomized:i,onClick:()=>{i||d(""),t({type:PL.UpdateIsFeeRateCustomized,payload:!0})},value:l,onChange:e=>{d(e)}})})]}),Os.jsx(f,{sx:{position:"sticky",bottom:0,px:20,py:16,backgroundColor:"background.paperContrast"},children:Os.jsx(T,{fullWidth:!0,disabled:h,onClick:()=>{t({type:PL.UpdateFeeRate,payload:l}),s(!1)},children:Os.jsx(e,{id:"7VpPHA",message:"Confirm"})})})]})})]})}function AM({titleKey:e}){const t=g();return Os.jsxs(Os.Fragment,{children:[Os.jsx(f,{sx:{mt:28,mb:28,borderTopColor:"divider",borderTopStyle:"solid",borderTopWidth:1}}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",mb:20},children:Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:t.palette.text.primary},children:e})})]})}function wM({params:t}){var n,i,o,a;const s=g(),{isMobile:l}=wy(),{chainId:d}=hf(),[c,u]=at.useState(!1),[p,h]=at.useReducer(FL,{currentStep:0,selectedVersion:UR.marketMakerPool,baseToken:null,quoteToken:null,baseAmount:"",quoteAmount:"",isFixedRatio:!0,initPrice:YR,fixedRatioPrice:YR,leftTokenAddress:void 0,feeRate:zR,isFeeRateCustomized:!1,slippageCoefficient:KR,isSlippageCoefficientCustomized:!1,peggedBaseTokenRatio:"",peggedQuoteTokenRatio:""});at.useEffect((()=>{u(!window.localStorage.getItem(dx.PoolEditPage))}),[]);const[m,y]=at.useState("inital"),x=yM({id:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}),{poolDetail:v}=x,b=Nn(x,["poolDetail"]);b.isPending||b.error||v||"inital"!==m||y("open"),!p.baseToken&&(null==v?void 0:v.baseToken)&&h({type:PL.InitEditParameters,payload:v});const A=It(es.getPMMStateQuery(null==v?void 0:v.chainId,null==v?void 0:v.address,null==v?void 0:v.type,null===(n=null==v?void 0:v.baseToken)||void 0===n?void 0:n.decimals,null===(i=null==v?void 0:v.quoteToken)||void 0===i?void 0:i.decimals));if(!p.slippageCoefficient&&(null===(a=null===(o=A.data)||void 0===o?void 0:o.pmmParamsBG)||void 0===a?void 0:a.k)){const e=A.data.pmmParamsBG.k.toString(),t=!BL({selectedVersion:p.selectedVersion}).includes(e);h({type:PL.UpdateSlippageCoefficient,payload:e}),h({type:PL.UpdateIsSlippageCoefficientCustomized,payload:t})}!p.baseAmount&&A.data&&(h({type:PL.UpdateBaseAmount,payload:A.data.baseReserve.toString()}),h({type:PL.UpdateQuoteAmount,payload:A.data.quoteReserve.toString()})),!p.fixedRatioPrice&&A.data&&h({type:PL.UpdateFixedRatioPrice,payload:A.data.pmmParamsBG.i.toString()});const k=It(es.getLPFeeRateQuery(null==v?void 0:v.chainId,null==v?void 0:v.address,null==v?void 0:v.type));if(!p.feeRate&&k.data){const e=k.data.times(100).toString(),t=-1===XL().findIndex((t=>t.value===e));h({type:PL.UpdateFeeRate,payload:e}),h({type:PL.UpdateIsFeeRateCustomized,payload:t})}const C=p.selectedVersion===UR.singleToken,j=p.selectedVersion===UR.standard,T=WL({isSingleTokenVersion:C,leftTokenAddress:p.leftTokenAddress,baseToken:p.baseToken,quoteToken:p.quoteToken,dispatch:h}),{versionMap:E}=HR(),S=E[p.selectedVersion],I=!(null==v?void 0:v.baseToken),R=Os.jsx(w,{variant:"rounded",width:210,height:60,sx:{padding:16,borderRadius:8}}),L=Os.jsx(w,{variant:"rounded",height:167,sx:{mx:20,borderRadius:16}});return Os.jsxs(Os.Fragment,{children:[Os.jsx(xw,{children:Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"flex-start"},l?{height:"100%"}:{height:"auto"}),children:[l?null:Os.jsxs(f,{sx:{mr:12,flexGrow:1,display:"block"},children:[Os.jsx(jS,{}),Os.jsx(f,{sx:{mt:28,typography:"h5",fontWeight:600,color:"text.primary"},children:Os.jsx(e,{id:"pHQq+U",message:"Pool Setup"})}),Os.jsx(AM,{titleKey:r._({id:"hdIg7i",message:"Select Pool Version"})}),Os.jsx(RL,{versionItem:S,status:"completed"},S.version),Os.jsx(AM,{titleKey:r._({id:"lsg9Mi",message:"Parameter Settings"})}),I?R:Os.jsx(TL,{status:"running",baseToken:p.baseToken,quoteToken:p.quoteToken,initPrice:p.initPrice,slippageCoefficient:p.slippageCoefficient,selectedVersion:p.selectedVersion,baseAmount:p.baseAmount,quoteAmount:p.quoteAmount}),Os.jsx(AM,{titleKey:r._({id:"Y7rVy0",message:"Fee Rate"})}),I?R:Os.jsx(kL,{isWaiting:!1,feeRate:p.feeRate})]}),Os.jsxs(f,{sx:Object.assign({flexGrow:1,flexShrink:0,flexBasis:375,backgroundColor:"background.paper"},l?{width:"100%",borderRadius:0,minHeight:"100%"}:{pb:20,borderRadius:16,flexGrow:0,minHeight:"auto"}),children:[Os.jsx(f,{sx:Object.assign({top:0,py:20,px:20,backgroundColor:s.palette.background.paper,zIndex:1},l?{position:"sticky"}:{position:"static",borderTopLeftRadius:16,borderTopRightRadius:16}),children:Os.jsx(f,{sx:{display:"flex",alignItems:"center"},children:Os.jsx(f,{sx:{typography:"h5",color:s.palette.text.primary,fontWeight:600},children:Os.jsx(e,{id:"6XYkjc",message:"Edit Parameter Settings"})})})}),I?null:Os.jsx(AL,{baseToken:p.baseToken,quoteToken:p.quoteToken,initPrice:p.initPrice,slippageCoefficient:p.slippageCoefficient,selectedVersion:p.selectedVersion,baseAmount:p.baseAmount,quoteAmount:p.quoteAmount}),I?L:Os.jsxs(f,{sx:{px:20},children:[Os.jsx(Qy,{canClickBalance:!0,showPercentage:!0,amt:p.baseAmount,onInputChange:e=>{h({type:PL.UpdateBaseAmount,payload:e})},readOnly:C,token:p.baseToken,occupiedAddrs:p.quoteToken?[p.quoteToken.address]:void 0,occupiedChainId:d,chainId:d}),Os.jsx(zy,{}),Os.jsx(Qy,{canClickBalance:!0,showPercentage:!0,amt:p.quoteAmount,onInputChange:e=>{h({type:PL.UpdateQuoteAmount,payload:e})},token:p.quoteToken,occupiedAddrs:p.baseToken?[p.baseToken.address]:void 0,occupiedChainId:d,chainId:d})]}),I?null:Os.jsxs(Os.Fragment,{children:[p.selectedVersion!==UR.standard&&Os.jsx(cM,{dispatch:h,slippageCoefficient:p.slippageCoefficient,selectedVersion:p.selectedVersion,isCustomized:p.isSlippageCoefficientCustomized,isStandardVersion:j}),Os.jsx(nM,{selectedVersion:p.selectedVersion,isFixedRatio:p.isFixedRatio,leftTokenAddress:p.leftTokenAddress,baseToken:p.baseToken,quoteToken:p.quoteToken,fixedRatioPrice:p.fixedRatioPrice,dispatch:h,isStandardVersion:j,isSingleTokenVersion:C,priceInfo:T}),Os.jsx(bM,{dispatch:h,feeRate:p.feeRate,isCustomized:p.isFeeRateCustomized})]}),Os.jsx(f,{sx:{pb:160,[s.breakpoints.up("tablet")]:{pb:28}}}),Os.jsx(vM,{state:p,pool:v,loading:I})]})]})}),Os.jsx(fM,{singleBtn:!0,open:"open"===m,onClose:()=>y("close"),onConfirm:()=>y("close"),title:r._({id:"Da1+Da",message:"Pool not found. Please switch to another network and retry."})}),Os.jsx(gM,{open:c,onClose:()=>{u(!1)},onConfirm:()=>{window.localStorage.setItem(dx.PoolEditPage,"1"),u(!1)},alertContent:Os.jsx(e,{id:"Y9QDtD",message:"You are making changes to the liquidity of a private pool. This is a highly discretionary operation that may cause substantial inflows/outflows of funds and changes in market prices. Please make sure you are fully aware of the implications of each parameter modification."})})]})}function kM(e){return null==e?0:new i(e).dp(4,i.ROUND_DOWN).toNumber()}function CM({unit:t,data:n,masterKey:r,sumKey:o}){const a=g(),s=at.useRef(null),[l,d]=at.useState(null),[c,u]=at.useState(0);at.useEffect((()=>{const e=()=>{s&&s.current&&u(s.current.offsetWidth)};return setTimeout(e,100),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[s]);const p="light"===a.palette.mode?a.palette.secondary.main:a.palette.primary.main,h="#ff9553",m=n[n.length-2],y="date";let x=[];if(null==n?void 0:n.length){let e=n[0][r];n.forEach((t=>{t[r]>e&&(e=t[r])})),x=e?[0,Math.ceil(e/3),Math.ceil(e/3*2),e]:[0]}let v=0;x.forEach((e=>{const t=Mn(new i(e));let n=t.replace(".","").length;t.indexOf(".")>-1&&(n+=.11),n>v&&(v=n)}));const b=10*v+2;return Os.jsxs(f,{ref:s,sx:{position:"relative"},children:[Os.jsxs(f,{sx:{minHeight:62,mb:10},children:[Os.jsxs(f,{sx:{typography:"caption",mb:8},children:[t||Os.jsx("span",{children:" "}),bn({input:null==m?void 0:m[o]})]}),Os.jsx(f,{sx:{color:"text.secondary"},children:Wt(null==m?void 0:m[y]).format("LL")})]}),Os.jsxs(Yt,{width:c,height:364,data:n,margin:{top:5,right:10,left:0,bottom:5},children:[Os.jsx("defs",{children:n.map(((e,t)=>Os.jsxs("linearGradient",{id:`colorBar${e.date}`,x1:"0",x2:"0",y1:"0",y2:"1",children:[Os.jsx("stop",{offset:"0%",stopColor:t===n.length-1?h:p}),Os.jsx("stop",{offset:"100%",stopColor:C(t===n.length-1?h:p,.04)})]},e.date)))}),Os.jsx(Zt,{hide:!0,dataKey:y,axisLine:!1,tickFormatter:e=>Wt(e).format("MM-DD")}),Os.jsx(zt,{orientation:"right",axisLine:!1,ticks:x,width:b,tickFormatter:e=>Mn(new i(e))}),Os.jsx(Xt,{isAnimationActive:!1,content:({active:t,payload:n,label:r})=>{if(!(t&&n&&n.length))return null;const i=Wt(r).format("YYYY-MM-DD")===Wt().format("YYYY-MM-DD");return Os.jsxs(f,{sx:{px:10,py:12,maxWidth:240,borderRadius:8,backgroundColor:"background.paperContrast",typography:"h6",color:"text.secondary"},children:[Os.jsx(f,{sx:{mr:8},children:Wt(r).format("MM-DD HH:mm")}),Os.jsx(f,{children:n[0].value}),i?Os.jsx(f,{children:Os.jsx(e,{id:"ubzjDN",message:"Real Time"})}):""]})},cursor:!1,coordinate:{x:0,y:0}}),Os.jsx(Jt,{dataKey:r,onMouseMove:e=>{d(e[y])},onMouseLeave:()=>{d(null)},children:n.map((e=>Os.jsx(Kt,{fill:`url(#colorBar${e.date})`},e.date)))}),l&&Os.jsx(_t,{x:l,stroke:p,strokeDasharray:"3 3"})]})]})}var jM,TM;function EM({poolDetail:e,chart24hDataFirst:t}){var n,o,a,s,l,d,c,u;const[p,h]=at.useState(t?jM.volume:jM.depth),m={key:jM.depth,value:r._({id:"n25Lml",message:"Depth"})},g=[{key:jM.volume,value:r._({id:"/cF7Rs",message:"Volume"})},{key:jM.feeRevenue,value:r._({id:"9QjAGB",message:"FeeRevenue"})},{key:jM.traders,value:r._({id:"qDhDFK",message:"Traders"})}];t?g.push(m):g.splice(0,0,m);const y=function({address:e,chainId:t,day:n}){var r,o,a;const s=t?Gr[t]:"",l=QA().getQuery(le.graphql.fetchPoolDayData,{where:{pair_address:null!=e?e:"",chain:s,day:n}}),d=It(Object.assign(Object.assign({},l),{enabled:!!e&&!!t})),c=null!==(a=null===(o=null===(r=d.data)||void 0===r?void 0:r.dashboard_pairs_day_data)||void 0===o?void 0:o.map((e=>{var t,n;return{volume:kM(null==e?void 0:e.volumeUsd),fee:kM(new i(null!==(t=null==e?void 0:e.feeUsd)&&void 0!==t?t:0).plus(null!==(n=null==e?void 0:e.mtFeeUsd)&&void 0!==n?n:0).toString()),traders:(null==e?void 0:e.addresses)?Number(e.addresses):0,date:(null==e?void 0:e.timestamp)?1e3*(null==e?void 0:e.timestamp):0,tvl:kM(null==e?void 0:e.tvlUsd)}})))&&void 0!==a?a:[];return Object.assign(Object.assign({},d),{dayDataList:c})}({chainId:null==e?void 0:e.chainId,address:null==e?void 0:e.address,day:30}),x=It(es.getPMMStateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(n=null==e?void 0:e.baseToken)||void 0===n?void 0:n.decimals,null===(o=null==e?void 0:e.quoteToken)||void 0===o?void 0:o.decimals)),{pmmParamsBG:v}=null!==(a=x.data)&&void 0!==a?a:{},b=v?{i:v.i.toNumber(),k:v.k.toNumber(),b:v.b.toNumber(),b0:v.b0.toNumber(),q:v.q.toNumber(),q0:v.k.isEqualTo(0)?v.q.toNumber():v.q0.toNumber(),R:v.k.isEqualTo(0)?0:v.R}:void 0,A=b?ve(b):void 0,[w,k]=at.useState(!1),C=w&&(null===(s=x.data)||void 0===s?void 0:s.midPrice)?new i(1).div(null===(l=x.data)||void 0===l?void 0:l.midPrice):null===(d=x.data)||void 0===d?void 0:d.midPrice;return Os.jsx(f,{sx:{mt:{mobile:24,tablet:52}},children:Os.jsxs(H,{value:p,onChange:(e,t)=>h(t),children:[Os.jsx(_,{tabs:g,variant:"rounded",tabsListSx:{borderWidth:0}}),p===jM.depth&&(null==e?void 0:e.baseToken)&&(null==e?void 0:e.quoteToken)?Os.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:Os.jsx(SM,{baseToken:null==e?void 0:e.baseToken,quoteToken:null==e?void 0:e.quoteToken,midPrice:C,isSwitchMidPrice:w,setIsSwitchMidPrice:k,showMidPrice:p===jM.depth})}):"",Os.jsx(z,{value:jM.depth,children:Os.jsx(vL,{baseToken:null!==(c=null==e?void 0:e.baseToken)&&void 0!==c?c:null,quoteToken:null!==(u=null==e?void 0:e.quoteToken)&&void 0!==u?u:null,pmmParams:b,pmmModel:A,midPrice:C})}),Os.jsx(z,{value:jM.volume,children:Os.jsx(CM,{data:y.dayDataList,masterKey:"volume",sumKey:"volume",unit:"$"})}),Os.jsx(z,{value:jM.feeRevenue,children:Os.jsx(CM,{data:y.dayDataList,masterKey:"fee",sumKey:"fee",unit:"$"})}),Os.jsx(z,{value:jM.traders,children:Os.jsx(CM,{data:y.dayDataList,masterKey:"traders",sumKey:"traders",unit:""})})]})})}function SM({baseToken:e,quoteToken:t,midPrice:n,isSwitchMidPrice:r,setIsSwitchMidPrice:i,showMidPrice:o}){const a=null==e?void 0:e.symbol,s=null==t?void 0:t.symbol,l=r?s:a,d=r?a:s;return Os.jsx(f,{sx:{display:"flex",alignItems:"center"},children:o?Os.jsxs(f,{sx:{mt:4,typography:"body2",color:"text.secondary",wordBreak:"break-all",display:"flex"},children:[`1 ${l} = ${n?bn({input:n,showDecimals:16}):"-"} ${d}`,Os.jsx(I,{weak:!0,sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:14,height:14,position:"relative",top:1.5,ml:9,cursor:"pointer",borderRadius:"50%",backgroundColor:"background.paperDarkContrast",p:0},onClick:()=>i((e=>!e)),children:Os.jsx(f,{component:As.Switch})})]}):""})}function IM({poolDetail:t}){var n,r,o;const{isMobile:a}=wy(),s=g(),l=null==t?void 0:t.chainId;null===(o=It(es.getPMMStateQuery(null==t?void 0:t.chainId,null==t?void 0:t.address,null==t?void 0:t.type,null===(n=null==t?void 0:t.baseToken)||void 0===n?void 0:n.decimals,null===(r=null==t?void 0:t.quoteToken)||void 0===r?void 0:r.decimals)).data)||void 0===o||o.midPrice;const d=function({pool:e}){var t,n,r,o,a,s,l;const{chainId:d,address:c,type:u,baseToken:p,quoteToken:h}=e||{},m=null!=c?c:"",f=d?Gr[d]:"",g=null==p?void 0:p.decimals,y=null==h?void 0:h.decimals,x=It(es.getPMMStateQuery(d,c,u,null==p?void 0:p.decimals,null==h?void 0:h.decimals)),v=null===(t=x.data)||void 0===t?void 0:t.midPrice,b=It(es.getTotalBaseLpQuery(d,c,u,g)),A=It(es.getTotalQuoteLpQuery(d,c,u,y)),w=It(es.getReserveLpQuery(d,c,u,g,y)),k=It(es.getClassicalTargetQuery(d,c,u,g,y)),C=b.data;let j=A.data;j||A.isLoading||A.error||!C||(j=C);const{baseReserve:T,quoteReserve:E}=w.data||{},S=null===(n=k.data)||void 0===n?void 0:n.baseTarget,I=null===(r=k.data)||void 0===r?void 0:r.quoteTarget,R=OL({tokens:h?[h]:[]}),L=QA(),M=It(Object.assign(Object.assign({},L.getQuery(le.graphql.fetchLiquidityPositions,{id:m,where:{pair:m,liquidityTokenBalance_not:"0",chain:f,refreshNow:!0},miningWhere:{pair:m,liquidityTokenInMining_not:"0",chain:f},first:1e3,orderBy:"liquidityTokenBalance",orderDirection:"desc"})),{enabled:!!c})),{balance:O,mining:B,pair:P}=null!==(o=M.data)&&void 0!==o?o:{};let D=[];const N=h?null===(a=R.data)||void 0===a?void 0:a.get(h.address):void 0;if(O&&B&&P){const{baseLpToken:e,quoteLpToken:t}=P,n=new Map,r=(null==e?void 0:e.id)===(null==t?void 0:t.id);for(const o of O){const{id:a,liquidityTokenBalance:s}=o,l=new i(null!=s?s:0),[d,p]=a.split("-");let h={id:d,baseSupplied:new i(0),quoteSupplied:new i(0)};n.has(h.id)?h=n.get(h.id):n.set(h.id,h);const[,m]=yT(l,C,T,S,c,u,g);m&&(r||p===(null==e?void 0:e.id))&&(h.baseSupplied=m);const[,f]=yT(l,j,E,I,c,u,y);f&&(r||p===(null==t?void 0:t.id))&&(h.quoteSupplied=f)}for(const o of B){const{id:a,liquidityTokenInMining:s}=o,l=new i(null!=s?s:0),[d,p]=a.split("-"),[,h]=yT(l,C,T,S,c,u,g),[,m]=yT(l,j,E,I,c,u,y);if(n.has(d)){const i=n.get(d);h&&(r||p===(null==e?void 0:e.id))&&(i.baseSupplied=h.plus(i.baseSupplied)),m&&(r||p===(null==t?void 0:t.id))&&(i.quoteSupplied=m.plus(i.quoteSupplied))}else{const o={id:d,baseSupplied:new i(0),quoteSupplied:new i(0)};h&&(r||p===(null==e?void 0:e.id))&&(o.baseSupplied=h),m&&(r||p===(null==t?void 0:t.id))&&(o.quoteSupplied=m),n.set(o.id,o)}}const o=(null!==(s=null==p?void 0:p.decimals)&&void 0!==s?s:0)>6?6:4,a=(null!==(l=null==h?void 0:h.decimals)&&void 0!==l?l:0)>6?6:4,d=N;n.forEach((e=>{var t,n;D.push({userId:e.id,baseSupplied:e.baseSupplied?bn({input:e.baseSupplied,showDecimals:o}):"0",quoteSupplied:e.quoteSupplied?bn({input:e.quoteSupplied,showDecimals:a}):"0",baseTokenAddress:null!==(t=null==p?void 0:p.address)&&void 0!==t?t:"",quoteTokenAddress:null!==(n=null==h?void 0:h.address)&&void 0!==n?n:"",baseTokenSymbol:Dn(p),quoteTokenSymbol:Dn(h),sharePercentage:v&&T?bn({input:v.multipliedBy(e.baseSupplied||0).plus(e.quoteSupplied||0).div(v.multipliedBy(T).plus(null!=E?E:0)).multipliedBy(100),showDecimals:2}):"",dollarValue:null!=d&&v?`$${bn({input:v.multipliedBy(e.baseSupplied||0).plus(e.quoteSupplied||0).multipliedBy(d),showDecimals:2})}`:"-",dollarValueBN:v?v.multipliedBy(e.baseSupplied||0).plus(e.quoteSupplied||0):i(0)})})),D.sort(((e,t)=>t.dollarValueBN.gt(e.dollarValueBN)?1:-1))}const F=[x,b,A,k,w,R,M],W=function(e){const t=[];if(e.forEach((e=>{e.error&&t.push(e.refetch)})),t.length)return()=>{t.forEach((e=>e()))}}(F),V=F.some((e=>e.isLoading));return Object.assign(Object.assign({},M),{isLoading:V,errorRefetch:W,list:D})}({pool:t}),[c,u]=at.useState(1),p=c*(a?4:8),h=d.list,m=p<h.length,x=h.slice(0,p);return Os.jsx(f,{sx:{display:"flex",flexDirection:"column"},children:Os.jsx(GE,{refetch:d.error?d.refetch:void 0,loading:d.isLoading&&!(null==x?void 0:x.length),empty:!(null==x?void 0:x.length),children:!!(null==x?void 0:x.length)&&Os.jsxs(f,{children:[Os.jsx(f,{sx:{overflowX:"auto",minHeight:244},children:Os.jsxs(f,{component:"table",sx:{minWidth:"100%"},children:[Os.jsx(f,{component:"thead",sx:{position:"sticky",top:0},children:Os.jsxs(f,{component:"tr",sx:{"& th":{p:24,borderBottomWidth:1,typography:"body1",lineHeight:1,textAlign:"left",whiteSpace:"nowrap"}},children:[Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"JlIjZf",message:"Liquidity Provider"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"C1qIFl",message:"Liquidity Supplied"})}),Os.jsx(f,{component:"th",sx:{"&&":{textAlign:"right"}},children:Os.jsx(e,{id:"me2dmq",message:"Value (USD)"})}),Os.jsx(f,{component:"th",sx:{"&&":{textAlign:"right"}},children:Os.jsx(e,{id:"Z8lGw6",message:"Share"})})]})}),Os.jsx(f,{component:"tbody",children:null==x?void 0:x.map((e=>Os.jsxs(f,{component:"tr",sx:{"& td":{px:24,py:20,whiteSpace:"nowrap"}},children:[Os.jsx("td",{children:Os.jsx(f,{sx:{display:"flex",alignItems:"center"},children:Os.jsx(ZT,{address:e.userId,customChainId:l,truncate:!0})})}),Os.jsxs("td",{children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[Os.jsx(ey,{address:e.baseTokenAddress,chainId:l,width:18,height:18}),`${e.baseSupplied} ${e.baseTokenSymbol}`]}),Os.jsxs(f,{sx:{mt:4,display:"flex",alignItems:"center",gap:8},children:[Os.jsx(ey,{address:e.quoteTokenAddress,chainId:l,width:18,height:18}),`${e.quoteSupplied} ${e.quoteTokenSymbol}`]})]}),Os.jsx(f,{component:"td",sx:{textAlign:"right"},children:e.dollarValue}),Os.jsx(f,{component:"td",sx:{textAlign:"right"},children:`${e.sharePercentage}%`})]},e.userId)))})]})}),m&&Os.jsxs(y,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:64,width:"100%",borderStyle:"solid",borderColor:"border.main",borderWidth:s.spacing(1,0,0,0),typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},onClick:()=>u((e=>e+1)),children:[Os.jsx(e,{id:"yQ2kGp",message:"Load more"}),Os.jsx(f,{component:As.ArrowRight,sx:{transform:"rotate(90deg)"}})]})]})})})}function RM({address:e,chainId:t}){var n;const r=QA(),i=t?Gr[t]:"",o=r.getQuery(le.graphql.fetchPoolDashboard,{where:{pair_address:null!=e?e:"",chain:i}}),a=It(Object.assign(Object.assign({},o),{enabled:!!e&&!!t})),s=null===(n=a.data)||void 0===n?void 0:n.dashboard_pairs_detail;return Object.assign(Object.assign({},a),{dashboard:s})}function LM(e,t){if(!e)return"";const n=Wt(e);return n.isValid()?n.format("YYYY/MM/DD HH:mm:ss"):""}function MM({chainId:e,address:t,symbol:n,amount:r,sx:i}){return Os.jsxs(f,{sx:u({display:"flex",justifyContent:"flex-end",alignItems:"center"},i),children:[t&&Os.jsx(f,{sx:{height:16,flexBasis:16,flexGrow:0,flexShrink:0,mr:4},children:Os.jsx(ey,{width:16,height:16,address:t,chainId:e})}),Os.jsxs(f,{sx:{textAlign:"right",display:"flex",alignItems:"center"},children:[r," ",Os.jsx(f,{sx:{display:"inline-block",maxWidth:"6em",minWidth:"auto",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"text-bottom"},title:n,children:n})]})]})}function OM({chainId:e,baseToken:t,quoteToken:n,baseAmount:r,quoteAmount:i,vertical:o}){const{isMobile:a}=wy();return Os.jsxs(f,{sx:{mt:4,display:"flex",justifyContent:"flex-end",flexDirection:o?"column":"row",alignItems:o?"flex-end":"center",flexWrap:"wrap",typography:a?"h6":"body1"},children:[t?Os.jsx(MM,{chainId:e,address:null==t?void 0:t.address,amount:r,symbol:null==t?void 0:t.symbol}):"-",o?"":Os.jsx(f,{sx:{mx:10},children:"/"}),n?Os.jsx(MM,{chainId:e,address:null==n?void 0:n.address,amount:i,symbol:null==n?void 0:n.symbol,sx:{mt:o?4:0}}):"-"]})}function BM({label:e,children:t,pairsStatLoading:n,poolDetailLoading:r}){const{isMobile:i}=wy();return Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between"},children:[Os.jsx(f,{sx:{color:"text.secondary",minWidth:"5em",typography:i?"h6":"body1"},children:e}),Os.jsx(f,{sx:u({textAlign:"right",overflow:"hidden","& .title":{typography:i?"body1":"caption",width:"100%"}},n&&!r||!n&&r?{ml:8,flex:1,display:"flex",flexDirection:"column",alignItems:"flex-end","& .title":{display:"flex",justifyContent:"flex-end"}}:{}),children:t})]})}function PM({sx:e}){return Os.jsx(w,{sx:Object.assign({width:"100%",maxWidth:237,height:22},e)})}function DM({detail:e,lpFeeRate:t,mtFeeRate:n}){const{isMobile:o}=wy();return"DPP"===(null==e?void 0:e.type)?null:e&&t&&n?Os.jsxs(f,{sx:{color:"text.secondary",typography:o?"h6":"body1"},children:[Os.jsx("span",{children:"LP "}),Os.jsx("span",{children:Bn({input:t,showDecimals:6})}),Os.jsxs("span",{children:[" / ",r._({id:"7C/BwI",message:"Community Treasury"})," "]}),Os.jsx("span",{children:Bn({input:new i(null!=n?n:0).toNumber(),showDecimals:6})})]}):Os.jsx(PM,{sx:{mt:4}})}function NM({detail:e}){var t,n,o,a,s,l,d,c,u,p,h,m,y,x,v,b,A,w,k,C,j,T,E,S,I,R,L;const M=g(),{isMobile:O}=wy(),{baseToken:B,quoteToken:P}=null!=e?e:{},D="DPP"===(null==e?void 0:e.type),N="DSP"===(null==e?void 0:e.type)||"GSP"===(null==e?void 0:e.type),F="CLASSICAL"===(null==e?void 0:e.type),W=RM({address:null==e?void 0:e.address,chainId:null==e?void 0:e.chainId}),V=W.dashboard,U=W.isLoading,H=It(es.getPMMStateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(t=null==e?void 0:e.baseToken)||void 0===t?void 0:t.decimals,null===(n=null==e?void 0:e.quoteToken)||void 0===n?void 0:n.decimals)),q=U?Os.jsx(PM,{}):null===(null==V?void 0:V.totalVolume)||void 0===(null==V?void 0:V.totalVolume)?"-":`$${bn({input:new i(null==V?void 0:V.totalVolume),showDecimals:2})}`,Z=U?Os.jsx(PM,{}):V&&(HE(V.totalFee)||HE(V.totalMtFee))?`$${bn({input:new i(V.totalFee||0).plus(V.totalMtFee||0),showDecimals:2})}`:"-",{account:z}=At(),Q=It(es.getFeeRateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,z)),G=null===(o=Q.data)||void 0===o?void 0:o.mtFeeRate,Y=null===(a=Q.data)||void 0===a?void 0:a.lpFeeRate,X=null==G?void 0:G.plus(null!=Y?Y:0),J=!e,K=It(es.getClassicalTargetQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(s=null==e?void 0:e.baseToken)||void 0===s?void 0:s.decimals,null===(l=null==e?void 0:e.quoteToken)||void 0===l?void 0:l.decimals));return Os.jsxs(f,{sx:Object.assign({pb:30,position:"relative",overflow:"hidden"},O?{backgroundColor:"background.paper",p:20}:{mt:32}),children:[Os.jsxs(f,{sx:{flex:"1 0 50%","& > div + div":{mt:10},"&::after":{content:'""',display:"block",my:20,width:"100%",height:"1px",backgroundColor:"border.main"}},children:[Os.jsx(BM,{label:r._({id:"l4Za6X",message:"Total Swap Volume"}),pairsStatLoading:U,children:Os.jsx("div",{className:"title",children:q})}),U||!e?Os.jsx(PM,{sx:{mt:4}}):Os.jsx(OM,{chainId:e.chainId,baseToken:e.baseToken,quoteToken:e.quoteToken,baseAmount:bn({input:null!==(d=null==V?void 0:V.baseVolumeCumulative)&&void 0!==d?d:0,showDecimals:2}),quoteAmount:bn({input:null!==(c=null==V?void 0:V.quoteVolumeCumulative)&&void 0!==c?c:0,showDecimals:2})}),Os.jsx(BM,{label:r._({id:"Z033WN",message:"Total Swap Fee"}),pairsStatLoading:U,children:Os.jsx("div",{className:"title",children:Z})}),U||!e?Os.jsx(PM,{sx:{mt:4}}):Os.jsx(OM,{chainId:e.chainId,baseToken:e.baseToken,quoteToken:e.quoteToken,baseAmount:bn({input:new i(null!==(u=null==V?void 0:V.baseFee)&&void 0!==u?u:0).plus(null!==(p=null==V?void 0:V.baseMtFee)&&void 0!==p?p:0),showDecimals:2}),quoteAmount:bn({input:new i(null!==(h=null==V?void 0:V.quoteFee)&&void 0!==h?h:0).plus(null!==(m=null==V?void 0:V.quoteMtFee)&&void 0!==m?m:0),showDecimals:2})}),Os.jsx(BM,{label:r._({id:"/BbUJ6",message:"Total Number of Traders"}),pairsStatLoading:U,children:U?Os.jsx(PM,{sx:{mt:4}}):bn({input:null!==(y=null==V?void 0:V.txUsers)&&void 0!==y?y:0,showDecimals:0})})]}),Os.jsxs(f,{sx:{flex:"1 0 50%",overflow:"hidden","& > div + div":{mt:10}},children:[Os.jsx(BM,{label:r._({id:"UE2beD",message:"Creator"}),poolDetailLoading:!e,children:e?e.isCpPool?Os.jsx(ZT,{address:null!==(x=e.cpCreator)&&void 0!==x?x:"",truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}}):Os.jsx(ZT,{address:null!==(v=e.creator)&&void 0!==v?v:"",truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}}):Os.jsx(PM,{})}),(null==e?void 0:e.isCpPool)||(null==e?void 0:e.owner)?Os.jsx(BM,{label:r._({id:"LtI9AS",message:"Owner"}),poolDetailLoading:J,children:J?Os.jsx(PM,{}):(null==e?void 0:e.isCpPool)?Os.jsx(ZT,{address:null==e?void 0:e.cpCreator,truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}}):Os.jsx(ZT,{address:null!==(b=e.owner)&&void 0!==b?b:"",truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}})}):"",Os.jsx(BM,{label:r._({id:"52uNwk",message:"Creation Time"}),poolDetailLoading:J,children:J?Os.jsx(PM,{}):LM(1e3*Number((null==e?void 0:e.isCpPool)?e.cpCreatedAtTimestamp||0:e.createdAtTimestamp||0))||"-"}),(null==e?void 0:e.isCpPool)?Os.jsxs(Os.Fragment,{children:[Os.jsx(BM,{label:r._({id:"cDWXuq",message:"Settler"}),poolDetailLoading:J,children:J?Os.jsx(PM,{}):Os.jsx(ZT,{address:(null==e?void 0:e.cpLiquidator)||"",truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}})}),Os.jsx(BM,{label:r._({id:"JuzN3b",message:"Related CrowdPooling"}),poolDetailLoading:J,children:J?Os.jsx(PM,{}):Os.jsx(ZT,{address:null==e?void 0:e.cpAddress,truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}})})]}):void 0,Os.jsxs(BM,{label:r._({id:"Y7rVy0",message:"Fee Rate"}),poolDetailLoading:J,children:[Os.jsx("div",{className:"detail-title",style:{textAlign:"right"},children:Bn({input:null==X?void 0:X.toNumber(),showDecimals:6})}),Os.jsx(DM,{detail:e,lpFeeRate:Y,mtFeeRate:G})]}),Os.jsx(BM,{label:r._({id:"sjn3tj",message:"Slippage Coefficient"}),poolDetailLoading:J,children:J?Os.jsx(PM,{}):null===(w=null===(A=H.data)||void 0===A?void 0:A.pmmParamsBG)||void 0===w?void 0:w.k.toString()}),Os.jsx(BM,{poolDetailLoading:J,label:F?r._({id:"d8YnVj",message:"Guide Price"}):D?r._({id:"CeLrge",message:"Mid Price"}):N?r._({id:"4ogEAw",message:"Pegged Exchange Rate"}):r._({id:"jjuKOj",message:"Min Price"}),children:J?Os.jsx(PM,{}):null!==B&&(N?`1 ${null==B?void 0:B.symbol} = ${null===(j=null===(C=null===(k=H.data)||void 0===k?void 0:k.pmmParamsBG)||void 0===C?void 0:C.i)||void 0===j?void 0:j.toString()} ${null==P?void 0:P.symbol}`:null===(S=null===(E=null===(T=H.data)||void 0===T?void 0:T.pmmParamsBG)||void 0===E?void 0:E.i)||void 0===S?void 0:S.toString())||"-"}),F&&Os.jsxs(Os.Fragment,{children:[Os.jsx(BM,{label:r._({id:"JR7wWw",message:"Equilibrium target"}),poolDetailLoading:J,children:J?Os.jsx(PM,{}):Os.jsx(Os.Fragment,{children:null===(L=null===(R=null===(I=H.data)||void 0===I?void 0:I.pmmParamsBG)||void 0===R?void 0:R.k)||void 0===L?void 0:L.toString()})}),K.data?Os.jsx(OM,{vertical:!0,chainId:e.chainId,baseToken:e.baseToken,quoteToken:e.quoteToken,baseAmount:bn({input:K.data.baseTarget,showDecimals:2}),quoteAmount:bn({input:K.data.quoteTarget,showDecimals:2})}):""]})]})]})}function FM(e,t){if(!e)return"";const n=Wt(e);return n.isValid()?n.format("YYYY/MM/DD HH:mm:ss"):""}function WM({amountOut:e,amountIn:t,fromTokenSymbol:n,toTokenSymbol:r}){const[i,o]=at.useState(!1),a=bn({input:t/e,showDecimals:2}),s=bn({input:e/t,showDecimals:2});return Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:["1 ",i?r:n," = ",i?a:s," ",i?n:r,Os.jsx(f,{sx:{ml:10,width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",backgroundColor:"background.paperContrast",borderRadius:"50%"},onClick:()=>o((e=>!e)),children:Os.jsx(f,{component:As.Switch})})]})}function VM({poolDetail:t}){var n,r,o;const{isMobile:a}=wy(),s=g(),{account:l,chainId:d}=At(),c=It(es.getFeeRateQuery(null==t?void 0:t.chainId,null==t?void 0:t.address,null==t?void 0:t.type,l)),u=null===(n=c.data)||void 0===n?void 0:n.mtFeeRate,p=null===(r=c.data)||void 0===r?void 0:r.lpFeeRate,h=null==u?void 0:u.plus(null!=p?p:0),m=function({chainId:e,address:t,first:n=50}){var r;const i=e?Gr[e]:"",o=QA().getQuery(le.graphql.fetchPoolSwapList,{first:n,orderBy:"timestamp",orderDirection:"desc",where:{pair:t,chain:i}}),a=It(Object.assign(Object.assign({},o),{enabled:!!t})),s=null===(r=a.data)||void 0===r?void 0:r.swaps;return Object.assign(Object.assign({},a),{swapList:s})}({address:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}),[x,v]=at.useState(1),b=x*(a?4:8),A=null!==(o=m.swapList)&&void 0!==o?o:[],w=b<A.length,k=A.slice(0,b);return Os.jsx(f,{sx:{display:"flex",flexDirection:"column"},children:Os.jsx(GE,{refetch:m.error?m.refetch:void 0,loading:m.isLoading,empty:!(null==k?void 0:k.length),children:!!(null==k?void 0:k.length)&&Os.jsxs(f,{children:[Os.jsx(f,{sx:{overflowX:"auto",minHeight:244},children:Os.jsxs(f,{component:"table",sx:{minWidth:"100%"},children:[Os.jsx(f,{component:"thead",sx:{position:"sticky",top:0},children:Os.jsxs(f,{component:"tr",sx:{"& th":{p:24,borderBottomWidth:1,typography:"body1",lineHeight:1,textAlign:"left",whiteSpace:"nowrap"}},children:[Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"LhMjLm",message:"Time"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"UPXmW+",message:"Trader"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"v4nCHK",message:"Paid"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"fZ5Vnu",message:"Received"})}),Os.jsx(f,{component:"th",children:Os.jsx(e,{id:"a7u1N9",message:"Price"})}),Os.jsx(f,{component:"th",sx:{"&&":{textAlign:"right"}},children:Os.jsx(e,{id:"Y7rVy0",message:"Fee Rate"})}),Os.jsx(f,{component:"th",sx:{"&&":{textAlign:"right"}},children:Os.jsx(e,{id:"PLUB/s",message:"Fee"})})]})}),Os.jsx(f,{component:"tbody",children:null==k?void 0:k.map((e=>Os.jsxs(f,{component:"tr",sx:{"& td":{px:24,py:20,whiteSpace:"nowrap"}},children:[Os.jsx("td",{children:FM(1e3*e.timestamp)}),Os.jsx("td",{children:Os.jsx(ZT,{address:e.from,truncate:!0})}),Os.jsx("td",{children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[Os.jsx(ey,{address:e.fromToken.id,chainId:d,width:18,height:18}),`${bn({input:e.amountIn,showDecimals:2})} ${e.fromToken.symbol}`]})}),Os.jsx("td",{children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[Os.jsx(ey,{address:e.toToken.id,chainId:d,width:18,height:18}),`${bn({input:e.amountOut,showDecimals:2})} ${e.toToken.symbol}`]})}),Os.jsx("td",{children:Os.jsx(WM,{amountOut:e.amountOut,amountIn:e.amountIn,fromTokenSymbol:e.fromToken.symbol,toTokenSymbol:e.toToken.symbol})}),Os.jsx(f,{component:"td",sx:{textAlign:"right"},children:Bn({input:h})}),Os.jsx(f,{component:"td",sx:{textAlign:"right"},children:`${bn({input:new i(e.amountOut).times(null!=h?h:0)})} ${e.toToken.symbol}`})]},e.id)))})]})}),w&&Os.jsxs(y,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:64,width:"100%",borderStyle:"solid",borderColor:"border.main",borderWidth:s.spacing(1,0,0,0),typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},onClick:()=>v((e=>e+1)),children:[Os.jsx(e,{id:"yQ2kGp",message:"Load more"}),Os.jsx(f,{component:As.ArrowRight,sx:{transform:"rotate(90deg)"}})]})]})})})}function UM({poolDetail:e}){const{isMobile:t}=wy(),[n,i]=at.useState(TM.parameters),o=[{key:TM.parameters,value:r._({id:"F18WP3",message:"Parameters"})},{key:TM.swaps,value:r._({id:"EatqP4",message:"Swaps"})}];return e&&"DPP"!==(null==e?void 0:e.type)&&o.push({key:TM.liquidityProviders,value:r._({id:"juypHV",message:"Liquidity Providers"})}),Os.jsx(f,{sx:Object.assign({mt:24,backgroundColor:"background.paper",borderRadius:16,overflow:"hidden"},t?{}:{mt:32,px:20}),children:Os.jsxs(H,{value:n,onChange:(e,t)=>i(t),children:[Os.jsx(_,{tabs:o}),Os.jsx(z,{value:TM.parameters,children:Os.jsx(NM,{detail:e})}),Os.jsx(z,{value:TM.swaps,children:Os.jsx(VM,{poolDetail:e})}),Os.jsx(z,{value:TM.liquidityProviders,children:Os.jsx(IM,{poolDetail:e})})]})})}function HM(){return Os.jsx(w,{variant:"rounded",sx:{width:90}})}function qM({poolDetail:t}){var n,o;g();const{isMobile:a}=wy(),s=RM({address:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}),l=s.dashboard,d=[{description:r._({id:"Gr2anW",message:"Traders (24H)"}),text:s.isLoading?Os.jsx(HM,{}):null===(null==l?void 0:l.txUserNear24h)||void 0===(null==l?void 0:l.txUserNear24h)?"-":Mn(new i(null==l?void 0:l.txUserNear24h))},{description:r._({id:"sTnImq",message:"Total Liquidity"}),text:s.isLoading?Os.jsx(HM,{}):null===(null==l?void 0:l.tvl)||void 0===(null==l?void 0:l.tvl)?"-":`$${Mn(new i(null==l?void 0:l.tvl))}`},{description:r._({id:"p7/w10",message:"Volume (24H)"}),text:s.isLoading?Os.jsx(HM,{}):null===(null==l?void 0:l.volume)||void 0===(null==l?void 0:l.volume)?"-":`$${Mn(new i(null==l?void 0:l.volume))}`},{description:r._({id:"7X40pG",message:"Fees (24H)"}),text:s.isLoading?Os.jsx(HM,{}):null!==!(null==l?void 0:l.feeNear24h)||(null==l?void 0:l.mtFeeNear24h)?`$${Mn(new i(null!==(n=null==l?void 0:l.feeNear24h)&&void 0!==n?n:0).plus(null!==(o=null==l?void 0:l.mtFeeNear24h)&&void 0!==o?o:0))}`:"-",question:s.isLoading?void 0:Os.jsxs(f,{sx:{width:198},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsx(e,{id:"OnDEky",message:"LP Fee"}),Os.jsx(f,{children:(null==l?void 0:l.feeNear24h)?`$${Mn(new i(null==l?void 0:l.feeNear24h))}`:"-"})]}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsx(e,{id:"pSQ1lM",message:"MT Fee"}),Os.jsx(f,{children:(null==l?void 0:l.mtFeeNear24h)?`$${Mn(new i(null==l?void 0:l.mtFeeNear24h))}`:"-"})]})]})}];return Os.jsx(f,{sx:Object.assign({display:"grid",gap:12},a?{mt:24,gridTemplateColumns:"repeat(2, 1fr)"}:{mt:32,gridTemplateColumns:"repeat(4, 1fr)"}),children:d.map((e=>Os.jsxs(f,{sx:{borderRadius:8,p:16,backgroundColor:"background.paper"},children:[Os.jsx(f,{sx:{typography:"caption",fontWeight:600,lineHeight:1,mb:2},children:e.text}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",typography:"h6",color:"text.secondary",gap:4},children:[e.description,e.question?Os.jsx(Ov,{title:e.question}):""]})]},e.description)))})}function ZM({poolDetail:t,loading:n}){var i,o,a,s;const{address:l}=null!=t?t:{},d=g(),c=fw(),{account:u}=hf(),{isMobile:p}=wy(),h=u&&"DPP"===(null==t?void 0:t.type)&&(null===(i=null==t?void 0:t.owner)||void 0===i?void 0:i.toLocaleLowerCase())===u.toLocaleLowerCase(),{supportAMMV2:m,onSharePool:x}=pf();return Os.jsxs(f,{sx:Object.assign({},p?{pt:24}:{pt:20,display:"flex",alignItems:"center",justifyContent:"space-between"}),children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[(null==t?void 0:t.baseToken)?Os.jsx(Cj,{tokens:[t.baseToken,t.quoteToken],chainId:t.chainId,width:36,mr:8}):Os.jsx(w,{variant:"circular",sx:{width:36,height:36,mr:8}}),Os.jsxs(f,{children:[Os.jsxs(f,{sx:{typography:"h4"},children:[(null==t?void 0:t.baseToken)?`${null===(o=t.baseToken)||void 0===o?void 0:o.symbol} / ${null===(a=t.quoteToken)||void 0===a?void 0:a.symbol}`:"-",m&&Os.jsx(f,{component:"span",sx:{position:"relative",top:-4,ml:4,px:4,py:2,borderRadius:4,fontSize:10,lineHeight:1,fontWeight:600,backgroundColor:C(d.palette.purple.main,.1),color:d.palette.purple.main},children:"PMM"}),Os.jsx(_E,{address:l,chainId:null==t?void 0:t.chainId,hideName:p,sx:{display:"inline-flex",ml:8}}),h&&!p?Os.jsx(f,{component:y,sx:{typography:"h6",px:8,py:2,ml:8,borderStyle:"solid",borderWidth:1,borderRadius:4,borderColor:"primary.main",color:"primary.main",whiteSpace:"nowrap","&:hover":{backgroundColor:"primary.main",color:"primary.contrastText"}},onClick:()=>{c.push({type:pw.ModifyPool,params:{address:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}})},children:Os.jsx(e,{id:"ePK91l",message:"Edit"})}):""]}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",mr:12},children:Os.jsx(ZT,{address:null!=l?l:"",truncate:!0,showCopy:!0,iconDarkHover:!0,"data-key":"link",sx:{typography:"body2",color:"text.secondary"},iconSize:14,iconSpace:6,customChainId:null==t?void 0:t.chainId,onShareClick:x&&t?()=>x({chainId:t.chainId,baseToken:t.baseToken,quoteToken:t.quoteToken,poolId:l,apy:t.apy,isSingle:le.utils.singleSideLp(t.type)}):void 0})})]})]}),Os.jsxs(f,{sx:p?{display:"flex",alignItems:"center",mt:24}:{textAlign:"right"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",color:"success.main",typography:"h4"},children:[(null==t?void 0:t.miningAddress)?Os.jsx(A,{title:r._({id:"B3mhDR",message:"Add liquidity to obtain LP tokens for mining"}),children:Os.jsx("span",{children:"✨ "})}):"",Os.jsx(D,{loading:n,loadingSx:{width:100},children:null!==(s=null==t?void 0:t.baseApy)&&void 0!==s?s:"0%"}),(null==t?void 0:t.quoteApy)?`/${null==t?void 0:t.quoteApy}`:""]}),Os.jsx(f,{sx:Object.assign({typography:"body2"},p?{ml:4}:{}),children:Os.jsx(e,{id:"rSayea",message:"APY"})})]})]})}function zM({chainId:e,shortNumber:t,pieSize:n="default",baseReserve:r=new i(1),baseAmount:o=new i(1),quoteAmount:a=new i(0),baseTokenSymbol:s="-",quoteTokenSymbol:l="-",quoteTokenDecimals:d=18,baseTokenDecimals:c=18,baseTokenAddress:u,quoteTokenAddress:p,baseTvlRate:h,quoteTvlRate:m,disabledAmount:y,disabledRate:x,disabledPercentage:v,loading:b,sx:A,pieRadius:k}){const C=g(),j="small"===n,T=j?6:16,E=k||(j?23:30),S=c>6?6:c>4?4:2,I=d>6?6:d>4?4:2,R=t?Mn(new i(r)):bn({input:r,showDecimals:S}),L=t?Mn(new i(a)):bn({input:a,showDecimals:I});let M=o.plus(a);M=M.lte(0)?new i(1):M;const O=h||o.div(M).multipliedBy(100).toFixed(2),B=m||a.div(M).multipliedBy(100).toFixed(2),P=o.lte(0)&&a.lte(0),D=C.palette.purple.main,N=C.palette.secondary.main,F=[{name:"base",value:P?1:o.toNumber(),color:D},{name:"quote",value:P?1:a.toNumber(),color:N}];return Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",flexDirection:"column"},A||{}),children:[Os.jsx("div",{children:v?"":b?Os.jsx(w,{width:46,height:46,variant:"circular"}):Os.jsx($t,{width:2*E,height:2*E,children:Os.jsx(en,{isAnimationActive:!1,dataKey:"value",data:F,labelLine:!1,label:!1,outerRadius:E,fill:N,children:F.map(((e,t)=>Os.jsx(Kt,{fill:e.color,strokeWidth:0},`cell-${t}`)))})})}),Os.jsxs(f,{className:"symbol-wrapper",sx:{display:"flex",flexDirection:"column",justifyContent:"center",ml:0,mt:20,width:"100%","& > div":{paddingLeft:"16px",position:"relative","&::before":{content:'""',width:"6px",height:"6px",position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)",backgroundColor:C.palette.purple.main,borderRadius:"50%"},"&:last-child::before":{backgroundColor:N},"&> span.symbol":{display:"inline-block",maxWidth:"6em",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"text-bottom"}}},children:[b?Os.jsx(w,{width:237,sx:{borderRadius:4}}):Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsxs(f,{children:[Os.jsx("div",{className:"symbol",title:s,children:s}),u?Os.jsx(ZT,{address:u,customChainId:e,truncate:!0,showCopy:!0,size:"small",iconSpace:4,sx:{typography:"h6",color:"text.secondary"}}):""]}),Os.jsxs(f,{sx:{textAlign:"right"},children:[y?"":`${R} `,v||x?"":Os.jsxs(f,{sx:{color:"text.secondary",typography:"h6",fontWeight:600},children:[" ",`(${O}%)`]})]})]}),b?Os.jsx(w,{width:237,sx:{borderRadius:4,marginTop:`${T}px`}}):Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:`${T}px`},children:[Os.jsxs(f,{children:[Os.jsx("span",{className:"symbol",title:l,children:l}),p?Os.jsx(ZT,{address:p,customChainId:e,truncate:!0,showCopy:!0,size:"small",iconSpace:4,sx:{typography:"h6",color:"text.secondary"}}):""]}),Os.jsxs(f,{sx:{textAlign:"right"},children:[y?"":`${L} `,v||x?"":Os.jsxs(f,{sx:{color:"text.secondary",typography:"h6",fontWeight:600},children:[" ",`(${B}%)`]})]})]})]})]})}function QM({poolDetail:t}){var n,r,o,a,s,l,d,c,u;const p=g(),{isMobile:h}=wy(),m=It(es.getPMMStateQuery(null==t?void 0:t.chainId,null==t?void 0:t.address,null==t?void 0:t.type,null===(n=null==t?void 0:t.baseToken)||void 0===n?void 0:n.decimals,null===(r=null==t?void 0:t.quoteToken)||void 0===r?void 0:r.decimals)),y=null===(o=m.data)||void 0===o?void 0:o.midPrice,x=It(es.getReserveLpQuery(null==t?void 0:t.chainId,null==t?void 0:t.address,null==t?void 0:t.type,null===(a=null==t?void 0:t.baseToken)||void 0===a?void 0:a.decimals,null===(s=null==t?void 0:t.quoteToken)||void 0===s?void 0:s.decimals)),{baseReserve:v,quoteReserve:b}=x.data||{},A=v&&y?null==y?void 0:y.multipliedBy(v):void 0,k=b&&y?new i(b):void 0;let C=A&&k?null==A?void 0:A.plus(k):void 0;C=!C||C.lte(0)?new i(1):C;const j=A&&A.div(C).multipliedBy(100).toFixed(2),T=k&&k.div(C).multipliedBy(100).toFixed(2);return console.log("je",null==v?void 0:v.toString(),null==b?void 0:b.toString(),null==A?void 0:A.toString(),null==k?void 0:k.toString(),null==y?void 0:y.toString()),Os.jsxs(f,{sx:{mt:h?24:32},children:[Os.jsx(f,{sx:{fontWeight:600},children:Os.jsx(e,{id:"sTnImq",message:"Total Liquidity"})}),Os.jsxs(f,{sx:{display:"flex",mt:16,backgroundColor:"background.paper",borderRadius:16,overflowX:"auto"},children:[Os.jsx(f,{sx:{flex:h?1:void 0,padding:h?p.spacing(20,30,20,20):p.spacing(20,30,16)},children:Os.jsx(zM,{pieRadius:36,baseReserve:v,baseAmount:A,baseTokenDecimals:null===(l=null==t?void 0:t.baseToken)||void 0===l?void 0:l.decimals,quoteAmount:k,baseTvlRate:j,quoteTvlRate:T,chainId:null==t?void 0:t.chainId,quoteTokenDecimals:(null===(d=null==t?void 0:t.quoteToken)||void 0===d?void 0:d.decimals)||void 0,baseTokenSymbol:Dn(null==t?void 0:t.baseToken),quoteTokenSymbol:Dn(null==t?void 0:t.quoteToken),baseTokenAddress:h?null===(c=null==t?void 0:t.baseToken)||void 0===c?void 0:c.address:"",quoteTokenAddress:h?null===(u=null==t?void 0:t.quoteToken)||void 0===u?void 0:u.address:"",shortNumber:!0,disabledRate:!h,disabledAmount:!h,loading:m.isLoading||x.isLoading,sx:h?{typography:"body2",fontWeight:600}:{"& .symbol-wrapper":{display:"flex",alignItems:"center",flexDirection:"row","& > div, & > span":{mt:0,"&:last-child":{ml:16}},"& .MuiSkeleton-root":{width:"40px !important"}}}})}),h?"":Os.jsxs(f,{component:"table",sx:{flex:1,fontWeight:600,borderStyle:"solid",borderColor:"border.main",borderWidth:"0 0 0 1px","& thead":{typography:"h6",color:"text.secondary","& th":{textAlign:"right",px:20,py:16,borderStyle:"solid",borderColor:"border.main",borderWidth:"0 0 1px","&:first-child":{textAlign:"left"}}},"& tbody":{typography:"body2",textAlign:"right","& td":{px:20,py:0,"&:first-child":{textAlign:"left"}}}},children:[Os.jsx("thead",{children:Os.jsxs("tr",{children:[Os.jsx("th",{children:Os.jsx(e,{id:"bUUVED",message:"Asset"})}),Os.jsx("th",{children:Os.jsx(e,{id:"hcNa1G",message:"Token Amount"})}),Os.jsx("th",{children:Os.jsx(e,{id:"iaocTt",message:"Ratio"})})]})}),Os.jsxs("tbody",{children:[Os.jsxs("tr",{children:[Os.jsx("td",{children:t?Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(ey,{address:t.baseToken.address,width:24,height:24,marginRight:4,chainId:t.chainId}),Os.jsxs(f,{children:[t.baseToken.symbol,Os.jsx(ZT,{address:t.baseToken.address,truncate:!0,showCopy:!0,size:"small",iconSpace:4,customChainId:t.chainId,sx:{typography:"h6",color:"text.secondary"}})]})]}):Os.jsx(w,{width:100,height:24})}),Os.jsx("td",{children:t?Mn(new i(t.baseReserve)):Os.jsx(w,{width:50,height:24,sx:{display:"inline-block"}})}),Os.jsx("td",{children:m.isLoading?Os.jsx(w,{width:50,height:24,sx:{display:"inline-block"}}):`${null!=j?j:"-"}%`})]}),Os.jsxs("tr",{children:[Os.jsx("td",{children:t?Os.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[Os.jsx(ey,{address:t.quoteToken.address,width:24,height:24,marginRight:4,chainId:t.chainId}),Os.jsxs(f,{children:[t.quoteToken.symbol,Os.jsx(ZT,{address:t.quoteToken.address,truncate:!0,showCopy:!0,size:"small",iconSpace:4,customChainId:t.chainId,sx:{typography:"h6",color:"text.secondary"}})]})]}):Os.jsx(w,{width:100,height:24})}),Os.jsx("td",{children:t?Mn(new i(t.quoteReserve)):Os.jsx(w,{width:50,height:24,sx:{display:"inline-block"}})}),Os.jsx("td",{children:m.isLoading?Os.jsx(w,{width:50,height:24,sx:{display:"inline-block"}}):`${null!=T?T:"-"}%`})]})]})]})]})]})}function GM({params:t}){var n,i,o,a,s,l,d;const c=fw(),{isMobile:u}=wy(),{account:p}=hf(),h=g(),m=yM({id:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}),{poolDetail:y}=m,x=Nn(m,["poolDetail"]),[v,b]=at.useState("inital");x.isPending||x.error||y||"inital"!==v||b("open");const A=y&&"DPP"===y.type&&p&&(null===(n=y.owner)||void 0===n?void 0:n.toLocaleLowerCase())===p.toLocaleLowerCase(),w=y&&"DPP"!==y.type||p&&(null==y?void 0:y.owner)&&y.owner.toLocaleLowerCase()===p.toLocaleLowerCase(),[k,C]=at.useState();y&&void 0===k&&!u&&C(FT.Add);const j=k&&y?Object.assign(Object.assign({},y),{baseLpToken:{id:null===(i=y.baseLpToken)||void 0===i?void 0:i.id,decimals:Number(null!==(a=null===(o=y.baseLpToken)||void 0===o?void 0:o.decimals)&&void 0!==a?a:18)},quoteLpToken:{id:null===(s=y.quoteLpToken)||void 0===s?void 0:s.id,decimals:Number(null!==(d=null===(l=y.quoteLpToken)||void 0===l?void 0:l.decimals)&&void 0!==d?d:18)}}):void 0,E=!!(null==y?void 0:y.miningAddress);return Os.jsxs(xw,{sx:u?{p:h.spacing(28,20,w?108:0)}:{p:h.spacing(28,40,40)},children:[Os.jsx(jS,{onClick:()=>{c.push({type:pw.Pool})}}),Os.jsxs(f,{sx:u?{}:{display:"flex",gap:12,overflow:"hidden"},children:[Os.jsxs(f,{sx:{flex:1,overflow:"hidden"},children:[Os.jsx(ZM,{poolDetail:y,loading:x.isPending}),Os.jsx(EM,{poolDetail:y,chart24hDataFirst:!0}),Os.jsx(qM,{poolDetail:y}),Os.jsx(QM,{poolDetail:y}),Os.jsx(UM,{poolDetail:y})]}),u?Os.jsx(wE,{account:p,pool:j,operate:k,hasMining:E,modal:!0,onClose:()=>{C(void 0)}}):Os.jsx(AE,{account:p,operate:k,hasMining:E,sx:{width:375,height:"max-content",backgroundColor:"background.paper",borderRadius:16,overflow:"hidden"},pool:j,hidePoolInfo:!0})]}),Os.jsx(fM,{singleBtn:!0,open:"open"===v,onClose:()=>b("close"),onConfirm:()=>b("close"),title:r._({id:"Da1+Da",message:"Pool not found. Please switch to another network and retry."})}),u&&w&&Os.jsx(Os.Fragment,{children:Os.jsxs(f,{sx:{position:"fixed",bottom:0,left:0,right:0,p:20,display:"grid",gap:"8px",gridTemplateColumns:A?"repeat(3, 1fr)":"repeat(2, 1fr)",backgroundColor:"background.paperContrast"},children:[A?Os.jsx(T,{variant:T.Variant.second,onClick:()=>{fw.getState().push({type:pw.ModifyPool,params:{chainId:y.chainId,address:y.address}})},children:Os.jsx(e,{id:"ePK91l",message:"Edit"})}):"",Os.jsx(T,{variant:T.Variant.second,onClick:()=>{C(FT.Remove)},children:Os.jsx(e,{id:"t/YqKh",message:"Remove"})}),Os.jsx(T,{onClick:()=>{C(FT.Add)},children:Os.jsx(e,{id:"m16xKo",message:"Add"})})]})})]})}function YM({title:e,disabled:t,children:n}){return Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:12,opacity:t?.3:void 0},children:[Os.jsx(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",fontWeight:600},children:e}),n]})}function XM({token:t,chainId:n,showChainLogo:r,readonly:i,showChainName:o,logoSize:a=24,chainLogoSize:s=12,side:l,occupiedToken:d,defaultLoadBalance:c,notTokenPickerModal:u,border:p,borderBold:h,px:m=20,py:x=8,highlightDefault:v,onTokenClick:b,onTokenChange:A}){var w,k;const{onlyChainId:C}=pf(),j=n||C,T=g(),[E,S]=at.useState(!1),I=(null==t?void 0:t.chainId)?_g.get(t.chainId):null,R=o&&!!I;return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{component:y,sx:Object.assign(Object.assign(Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,color:T.palette.text.primary,typography:R?"body2":"body1",fontWeight:600,px:m,py:x,"&:focus-visible":{opacity:.5}},!!p&&{border:`solid 1px ${T.palette.border.main}`,borderRadius:8,"&:hover":{backgroundColor:T.palette.hover.default}}),!!h&&{border:`solid 3px ${T.palette.text.primary}`,backgroundColor:"background.input"}),!(!v||t)&&{backgroundColor:T.palette.primary.main,color:T.palette.primary.contrastText,"&:hover":{opacity:.8}}),onClick:()=>{i||S(!0)},"data-testid":ly,children:[!!(null==t?void 0:t.address)&&Os.jsx(ey,{url:null==t?void 0:t.logoURI,address:null!==(w=null==t?void 0:t.address)&&void 0!==w?w:"",chainId:null==t?void 0:t.chainId,noShowChain:!r,width:a,height:a,chainSize:s,logoOffset:10,marginRight:0}),Os.jsxs(f,{sx:{flex:1},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(null==t?void 0:t.address)?Os.jsx(Os.Fragment,{children:Os.jsx(f,{children:null!==(k=null==t?void 0:t.symbol)&&void 0!==k?k:"-"})}):Os.jsx(e,{id:"sIPJGT",message:"SELECT TOKEN"}),!i&&Os.jsx(f,{component:"svg",width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",sx:{flexShrink:0},children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.58398 12.376C6.78189 12.6728 7.21811 12.6728 7.41603 12.376L10.4818 7.77735C10.7033 7.44507 10.4651 7 10.0657 7H3.93426C3.53491 7 3.29672 7.44507 3.51823 7.77735L6.58398 12.376Z",fill:"currentColor"})})]}),!!R&&Os.jsxs(f,{sx:{display:"flex",alignItems:"center",typography:"h6",color:"text.secondary"},children:[I.name,Os.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{d:"M5.6036 4.12761C5.50037 4.20906 5.3708 4.24967 5.23958 4.24169C5.10836 4.23372 4.98466 4.17773 4.89203 4.08438C4.7994 3.99103 4.74433 3.86685 4.7373 3.73549C4.73026 3.60413 4.77177 3.47477 4.8539 3.37205L5.96239 2.25211C6.46737 1.76405 7.14372 1.494 7.84575 1.5001C8.54779 1.50621 9.21934 1.78798 9.71577 2.28474C10.2122 2.78151 10.4938 3.4535 10.4999 4.156C10.506 4.85851 10.2361 5.5353 9.74839 6.04062L8.60241 7.16592C8.55441 7.22201 8.49533 7.26757 8.4289 7.29974C8.36246 7.3319 8.29009 7.34997 8.21635 7.35282C8.1426 7.35567 8.06906 7.34324 8.00034 7.3163C7.93162 7.28936 7.86921 7.2485 7.81702 7.19627C7.76483 7.14405 7.724 7.0816 7.69707 7.01284C7.67015 6.94407 7.65772 6.87048 7.66057 6.79668C7.66342 6.72289 7.68148 6.65047 7.71363 6.58399C7.74577 6.51751 7.7913 6.4584 7.84736 6.41036L8.97191 5.28506C9.25568 4.98032 9.41017 4.57725 9.40283 4.16078C9.39549 3.74431 9.22689 3.34695 8.93255 3.05242C8.63821 2.75788 8.24111 2.58917 7.82491 2.58182C7.40872 2.57447 7.00592 2.72906 6.70138 3.01302L5.6036 4.12761ZM6.34259 7.93755C6.38819 7.87582 6.44652 7.82461 6.51361 7.7874C6.58071 7.75018 6.65501 7.72783 6.73149 7.72185C6.80798 7.71586 6.88485 7.7264 6.95691 7.75273C7.02897 7.77906 7.09453 7.82058 7.14917 7.87447C7.2038 7.92836 7.24622 7.99337 7.27356 8.06509C7.3009 8.13682 7.31252 8.21358 7.30764 8.29019C7.30275 8.3668 7.28148 8.44147 7.24525 8.50913C7.20902 8.5768 7.15869 8.63589 7.09765 8.68239L5.96774 9.81305C5.45894 10.2708 4.7943 10.5163 4.11029 10.4992C3.42627 10.482 2.77479 10.2034 2.2896 9.72061C1.80441 9.23784 1.52232 8.58752 1.50127 7.90316C1.48021 7.2188 1.72179 6.55234 2.17638 6.04062L3.30629 4.93139C3.3504 4.86735 3.4079 4.81369 3.47482 4.77413C3.54174 4.73456 3.61646 4.71005 3.69379 4.70229C3.77113 4.69453 3.84922 4.70371 3.92266 4.72919C3.99609 4.75466 4.0631 4.79583 4.11904 4.84983C4.17497 4.90384 4.21849 4.96937 4.24657 5.0419C4.27464 5.11442 4.28661 5.19219 4.28163 5.2698C4.27665 5.34742 4.25484 5.42302 4.21773 5.49135C4.18062 5.55969 4.12908 5.61912 4.06671 5.66552L2.93144 6.79618C2.64767 7.10092 2.49318 7.50398 2.50052 7.92045C2.50786 8.33692 2.67647 8.73428 2.97081 9.02882C3.26515 9.32335 3.66224 9.49207 4.07844 9.49942C4.49463 9.50676 4.89743 9.35217 5.20197 9.06821L6.34259 7.93755ZM5.00919 7.76072C4.96119 7.81681 4.90211 7.86237 4.83567 7.89454C4.76924 7.9267 4.69687 7.94477 4.62312 7.94763C4.54937 7.95048 4.47583 7.93804 4.40711 7.9111C4.33839 7.88416 4.27598 7.8433 4.2238 7.79108C4.17161 7.73885 4.13077 7.6764 4.10385 7.60764C4.07693 7.53887 4.0645 7.46528 4.06735 7.39149C4.0702 7.31769 4.08826 7.24528 4.1204 7.17879C4.15255 7.11231 4.19808 7.0532 4.25413 7.00516L6.90487 4.35267C7.00731 4.26488 7.13909 4.21901 7.27386 4.22422C7.40863 4.22943 7.53648 4.28533 7.63185 4.38077C7.72722 4.4762 7.78309 4.60413 7.7883 4.73899C7.7935 4.87385 7.74766 5.00572 7.65993 5.10823L5.00919 7.76072Z",fill:"currentColor"})})]})]})]}),Os.jsx(ky,{value:t,open:E,side:l,chainId:j,occupiedAddrs:d?[d.address]:void 0,occupiedChainId:null==d?void 0:d.chainId,defaultLoadBalance:c,onClose:()=>{S(!1),b&&b()},onTokenChange:(e,t)=>{S(!1),setTimeout((()=>{!Array.isArray(e)&&A&&A(e,t)}),my)},modal:!u})]})}!function(e){e[e.depth=1]="depth",e[e.volume=2]="volume",e[e.feeRevenue=3]="feeRevenue",e[e.traders=4]="traders"}(jM||(jM={})),function(e){e[e.parameters=1]="parameters",e[e.swaps=2]="swaps",e[e.liquidityProviders=3]="liquidityProviders"}(TM||(TM={}));const JM=1e-4;function KM({disabled:t,fee:n,onChange:r,feeList:o,hasCustom:a}){const s=g(),[l,d]=at.useState(!1),[c,u]=at.useState(!1),[p,h]=at.useState(""),{isMobile:m}=wy(),x=!o.includes(n),b=x||c,A=!c&&x&&!!p&&new i(p).div(100).lt(JM),w=t||A;return Os.jsxs(f,{sx:{opacity:t?.3:void 0,fontWeight:600},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:20,py:12,borderWidth:1,borderRadius:12},children:[Os.jsx(e,{id:"tMMG40",message:"{0}% fee tier",values:{0:n?new i(n).times(100).toString():"-"}}),Os.jsx(y,{sx:{px:16,py:7,border:`solid 1px ${s.palette.text.primary}`,borderRadius:8,fontWeight:600,color:"text.primary",cursor:w?"default":"pointer",opacity:A?.3:1},disabled:w,onClick:()=>{w||d((e=>!e))},children:l?Os.jsx(e,{id:"vLyv1R",message:"Hide"}):Os.jsx(e,{id:"ePK91l",message:"Edit"})})]}),l&&Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:Object.assign({mt:12},m?{display:"grid",gap:8,gridTemplateColumns:"repeat(2, 1fr)"}:{display:"flex",alignItems:"center",gap:8,"& > label":{flex:1}}),children:[o.map((e=>{const t=n===e&&!b;return Os.jsxs(f,{component:"label",sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:12,borderWidth:1,borderRadius:12,cursor:"pointer"},t&&{borderColor:s.palette.primary.main}),children:[100*e,"%",Os.jsx(J,{size:18,checked:t,onChange:(t,n)=>{n&&r(e)}})]},e)})),a&&Os.jsxs(f,{component:"label",sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:12,borderWidth:1,borderRadius:12,cursor:"pointer",color:A?s.palette.error.main:"text.primary"},b&&{borderColor:s.palette.primary.main}),onClick:()=>{u(!0),h("")},children:[c?Os.jsx(v,{value:p,autoFocus:!0,onChange:e=>{const t=e.target.value;isNaN(Number(t))||h(t)},onBlur:()=>{const e=Number(p),t=e?new i(e).div(100).toNumber():e;t&&t<JM?r(0):p&&(e||0===e)&&r(t),u(!1)},sx:{p:0,flex:1,height:"100%",border:"none",backgroundColor:"none"},inputSx:{p:0}}):Os.jsx(Os.Fragment,{children:x?(new i(n).times(100).toNumber()||p)+"%":Os.jsx(e,{id:"8Tg/JR",message:"Custom"})}),Os.jsx(J,{size:18,checked:b,sx:{flexShrink:0}})]})]}),A&&Os.jsxs(f,{sx:{mt:12,display:"flex",alignItems:"center",gap:8,p:8,borderRadius:8,typography:"h6",backgroundColor:C(s.palette.error.main,.1),color:s.palette.error.main},children:[Os.jsx(f,{component:As.ErrorBorder,sx:{width:18,height:18}}),Os.jsx(e,{id:"LHxwaD",message:"The fee tier should greater than {0}%",values:{0:100*JM}})]})]})]})}function _M({sx:t,disabled:n,slippage:r,onChangeSlippage:o}){const a=g(),s=r===ww,[l,d]=ct(s?"":new i(r).times(100).toNumber());return Os.jsx(A,{disabled:n,onlyClick:!0,title:Os.jsxs(f,{sx:{backgroundColor:a.palette.background.paper,padding:a.spacing(16,20),borderRadius:16,width:375,maxWidth:"90vw",boxSizing:"border-box"},children:[Os.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2",color:"text.primary"},children:[Os.jsx("span",{children:Os.jsx(e,{id:"lqTDfd",message:"Slippage Tolerance"})}),Os.jsxs("span",{children:[s?Cw:r&&new i(r).times(100).toNumber(),"%"]})]}),Os.jsxs(f,{sx:{mt:16,display:"flex",alignItems:"center",margin:a.spacing(16,0,0,0)},children:[Os.jsx(Aw,{sx:{borderRadius:8,whiteSpace:"nowrap"},onClick:()=>{d(""),o(ww)},active:s}),Os.jsx(v,{placeholder:String(Cw),value:l,onChange:e=>{const{value:t}=e.target;d(t),o(t?new i(t).div(100).toNumber():ww)},onBlur:()=>{(!s&&new i(r).gt(.1)||new i(r).lte(0))&&(d(10),o(.1))},suffix:Os.jsx(f,{sx:{mr:16},children:"%"}),sx:{ml:8,"& input":{px:16,py:0,height:"39px"}}})]})]}),sx:{p:0},arrow:!1,placement:"bottom-end",children:Os.jsx(Q,{sx:Object.assign({width:"max-content",alignItems:"right",margin:a.spacing(0,0,0,"auto"),p:a.spacing(4,12),borderRadius:20,backgroundColor:"background.paperDarkContrast",cursor:"pointer"},t),children:Os.jsx(f,{component:As.Setting,sx:{width:18,height:18,"& path:last-child":{fill:a.palette.text.primary}}})})})}function $M({statuses:t,children:n,buttonProps:r}){var i;if(!t.find((e=>e.needShowTokenStatusButton))&&n)return Os.jsx(Os.Fragment,{children:n});const o=t.find((e=>e.insufficientBalance));if(o)return Os.jsx(T,{fullWidth:!0,disabled:!0,...r,children:Os.jsx(e,{id:"m6RmA/",message:"Insufficient {0} balance",values:{0:null===(i=o.token)||void 0===i?void 0:i.symbol}})});const a=t.some((e=>e.isApproving));return Os.jsx(f,{sx:{display:"flex",alignItems:"center",gap:4},children:t.map(((t,n)=>{var i,o;let s="";return t.isApproving?s=Os.jsx(e,{id:"j2Uisd",message:"Approving"}):(t.needReset||t.needApprove)&&(s=t.approveTitle),s?Os.jsx(T,{fullWidth:!0,isLoading:t.isApproving,onClick:t.submitApprove,disabled:t.insufficientBalance||a,...r,children:s},null!==(o=null===(i=t.token)||void 0===i?void 0:i.symbol)&&void 0!==o?o:n):null}))})}function eO({isExists:t,pair:n,pairAddress:r}){var o,a,s;const{isBalanceLoading:l,isDepositedLoading:d,balance:c,token0Deposited:u,token1Deposited:p,poolTokenPercentage:h}=function({pairAddress:e,pair:t}){var n;const{account:r}=hf(),o=null===(n=null==t?void 0:t.liquidityToken)||void 0===n?void 0:n.chainId,a=It(Object.assign(Object.assign({},We(o,e,r)),{retry:!1})),s=It(Object.assign(Object.assign({},Ve(o,e)),{retry:!1})),[l,d,c]=at.useMemo((()=>{if(!t||!a.data||!s.data||s.data<a.data)return[void 0,void 0,void 0];const e=on.fromRawAmount(t.liquidityToken,s.data.toString()),n=on.fromRawAmount(t.liquidityToken,a.data.toString());return[new sn(a.data.toString(),s.data.toString()),t.getLiquidityValue(t.token0,e,n,!1),t.getLiquidityValue(t.token1,e,n,!1)]}),[a.data,s.data,t]);return{isBalanceLoading:a.isLoading,isDepositedLoading:a.isLoading||s.isLoading,balance:a.data&&t?Tn(a.data.toString(),t.liquidityToken.decimals):void 0,poolTokenPercentage:l?new i(l.toSignificant(6)):void 0,token0Deposited:d?new i(d.toSignificant()):void 0,token1Deposited:c?new i(c.toSignificant()):void 0}}({pairAddress:r,pair:n}),m=h?`${bn({input:h,showDecimals:2,roundingMode:i.ROUND_HALF_UP})}%`:void 0;return t&&n?Os.jsxs(f,{sx:{px:20,py:12,borderWidth:1,borderRadius:8},children:[Os.jsx(f,{sx:{typography:"h6",color:"text.secondary"},children:Os.jsx(e,{id:"YHc3B+",message:"My Liquidity"})}),Os.jsxs(f,{sx:{mt:12,display:"flex",alignItems:"center"},children:[Os.jsx(Cj,{width:18,height:18,tokens:[n.token0,n.token1],mr:4}),Os.jsx(D,{loading:l,loadingProps:{width:50},sx:{mr:4},children:An({input:c,decimals:null===(o=n.liquidityToken)||void 0===o?void 0:o.decimals})}),`${n.token0.symbol}/${n.token1.symbol} LP`,Os.jsx(A,{title:Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:10,typography:"body2",color:"text.primary"},children:[Os.jsx(oE,{address:n.token0.address,chainId:n.token0.chainId,showName:null!==(a=n.token0.symbol)&&void 0!==a?a:"",size:14,offset:4,rightContent:Os.jsx(D,{loading:d,loadingProps:{width:50},children:An({input:u,decimals:n.token0.decimals})})}),Os.jsx(oE,{address:n.token1.address,chainId:n.token1.chainId,showName:null!==(s=n.token1.symbol)&&void 0!==s?s:"",size:14,offset:4,rightContent:Os.jsx(D,{loading:d,loadingProps:{width:50},children:An({input:p,decimals:n.token1.decimals})})}),Os.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsx(e,{id:"c4miqE",message:"Pool share"}),Os.jsx(D,{loading:d,loadingProps:{width:50},children:m})]})]}),sx:{padding:20,width:256},children:Os.jsx(I,{component:As.DetailBorder,sx:{ml:4,width:16,height:16,cursor:"pointer"}})}),Os.jsx(f,{component:"a",target:"_blank",rel:"noopener noreferrer",href:ps(n.liquidityToken.chainId,n.liquidityToken.address,"address"),sx:{ml:4,display:"inline-flex",height:16},children:Os.jsx(I,{component:As.ArrowTopRightBorder,sx:{width:16,height:16}})})]})]}):null}function tO(){var t,n,r;const[o,a]=at.useState(.003),[s,l]=at.useState(),[d,c]=at.useState(),[u,p]=at.useState(""),[h,m]=at.useState(""),[g,y]=at.useState(ww),x=g===ww?new i(Cw).div(100).toNumber():g,{isMobile:v}=wy(),{onlyChainId:b}=pf(),A=at.useMemo((()=>b||(null==s?void 0:s.chainId)||(null==d?void 0:d.chainId)),[b,s,d]),{pairAddress:w,pair:k,price:C,isInvalidPair:j,invertedPrice:E,priceLoading:S,liquidityMinted:I,shareOfPool:R,isExists:L}=function({baseToken:e,quoteToken:t,baseAmount:n,quoteAmount:r,fee:i}){const[o,a,s]=at.useMemo((()=>{var n,r;if(!e||!t)return[null,null,!1];const i=ue[e.chainId],o=(null===(n=i.address)||void 0===n?void 0:n.toLowerCase())===e.address.toLowerCase(),a=(null===(r=i.address)||void 0===r?void 0:r.toLowerCase())===t.address.toLowerCase(),s=o?i.wrappedTokenAddress:e.address,l=a?i.wrappedTokenAddress:t.address,d=s.toLowerCase()===l.toLowerCase();return d?[null,null,!0]:[new rn(e.chainId,s,e.decimals,e.symbol,e.name),new rn(t.chainId,l,t.decimals,t.symbol,t.name),d]}),[e,t]),l=at.useMemo((()=>{if(!o||!a||void 0===i)return;const e=o.chainId,t=e?ke(e)||Fe(e):void 0;return t?fs({factoryAddress:t,tokenA:o,tokenB:a,fee:i}):void 0}),[o,a,i]),{pair:d,price:c,invertedPrice:u,reserveQuery:p,liquidityMinted:h,shareOfPool:m,isExists:f}=vT({pool:e&&t&&l?{baseToken:e,quoteToken:t,type:"AMMV2",address:l}:void 0,baseAmount:n,quoteAmount:r});return{pairAddress:l,pair:d,isInvalidPair:s,price:c,invertedPrice:u,priceLoading:p.isLoading,liquidityMinted:h,shareOfPool:m,isExists:f}}({baseToken:s,quoteToken:d,baseAmount:u,quoteAmount:h,fee:o}),M=zw(C);if(C&&u&&!C.isEqualTo(null!=M?M:0)&&L){const e=C.times(u).dp(null!==(t=null==d?void 0:d.decimals)&&void 0!==t?t:18);e.isEqualTo(h)||m(e.toString())}const O=A?Ce(A)||Ie(A):void 0,B=EA(s,{amount:u,contractAddress:O}),P=EA(d,{amount:h,contractAddress:O}),[D,N]=at.useState(!1),F=!s||!d,W=()=>{fw.getState().push({type:pw.Pool})},V=YT({baseToken:s,quoteToken:d,baseAmount:u,quoteAmount:h,fee:o,isExists:L,slippage:x,successBack:()=>{fw.getState().push({type:pw.Pool,params:{tab:cS.myLiquidity}})}});return Os.jsxs(xw,{children:[Os.jsxs(f,{sx:{mx:"auto",borderRadius:v?0:16,backgroundColor:"background.paper",width:v?"100%":600,position:"relative",overflow:"hidden"},children:[v?Os.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:20,pb:0},children:Os.jsx(jS,{onClick:W})}):Os.jsxs(f,{sx:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center",px:20,py:24,typography:"caption"},children:[Os.jsx(f,{component:As.ArrowBack,sx:{position:"absolute",left:20,cursor:"pointer"},onClick:W}),Os.jsx(e,{id:"E6MqGy",message:"Add liquidity"})]}),Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:20,pt:24,px:20,pb:20},children:[Os.jsx(eO,{pair:k,pairAddress:w,isExists:L}),Os.jsxs(YM,{title:Os.jsx(e,{id:"nxRg31",message:"Select pair"}),children:[Os.jsxs(f,{sx:{display:"grid",gridTemplateColumns:v?"repeat(1, 1fr)":"repeat(2, 1fr)",gap:12},children:[Os.jsx(XM,{border:!0,highlightDefault:!0,chainId:A,token:s,onTokenChange:(e,t)=>{t?(l(d),c(s),p(""),m("")):(l(e),p(""))},occupiedToken:d}),Os.jsx(XM,{border:!0,highlightDefault:!0,chainId:A,token:d,onTokenChange:(e,t)=>{t?(l(d),c(s)):(c(e),m(""))},occupiedToken:s})]}),(!A||as(A))&&Os.jsx(KM,{fee:o,onChange:a,feeList:[1e-4,5e-4,.003],hasCustom:!0,disabled:F})]}),Os.jsx(YM,{title:Os.jsx(e,{id:"MU9s7M",message:"Deposit amounts"}),disabled:F,children:Os.jsxs(f,{children:[Os.jsx(Qy,{sx:{mb:4,pb:28,minHeight:"auto"},token:s,amt:u,defaultLoadBalance:!0,onInputChange:e=>{var t;p(e);const n=Number(e);L&&C&&n&&m(C.times(e).dp(null!==(t=null==d?void 0:d.decimals)&&void 0!==t?t:18).toString())},showMaxBtn:!0,occupiedAddrs:[null!==(n=null==d?void 0:d.address)&&void 0!==n?n:""],occupiedChainId:null==d?void 0:d.chainId,notTokenPickerModal:!0,showPercentage:!0,readOnly:F}),Os.jsx(Bv,{plus:!0}),Os.jsx(Qy,{sx:{pb:20,minHeight:"auto"},token:d,amt:h,defaultLoadBalance:!0,onInputChange:e=>{var t;m(e);const n=Number(e);L&&E&&n&&p(E.times(e).dp(null!==(t=null==s?void 0:s.decimals)&&void 0!==t?t:18).toString())},showMaxBtn:!0,occupiedAddrs:[null!==(r=null==s?void 0:s.address)&&void 0!==r?r:""],occupiedChainId:null==s?void 0:s.chainId,notTokenPickerModal:!0,showPercentage:!0,readOnly:F}),Os.jsx(_M,{slippage:g,onChangeSlippage:y,disabled:F,sx:{mt:8}}),Os.jsx(QT,{baseToken:s,quoteToken:d,loading:S,midPrice:C,shareOfPool:R}),!!L&&Os.jsxs(f,{sx:{mt:20,p:20,borderRadius:16,backgroundColor:"background.paperContrast",typography:"h6",textAlign:"center","& > b":{fontWeight:600,color:"primary.main"}},children:["🌟",Os.jsx("b",{children:Os.jsx(e,{id:"e38JNU",message:"Tips:"})})," ",Os.jsx(e,{id:"1ABiXc",message:"By adding liquidity you’ll earn <0>{0}</0> of all trades on this pair proportional to your share of the pool. Fees are added to the pool, accrue in real time and can be claimed by withdrawing your liquidity.",values:{0:Bn({input:o})},components:{0:Os.jsx("b",{})}})]})]})})]}),Os.jsx(f,{sx:{py:16,px:20,borderTopWidth:1},children:Os.jsx(sb,{fullWidth:!0,includeButton:!0,size:T.Size.big,disabled:F,chainId:A,children:Os.jsx($M,{statuses:[B,P],buttonProps:{size:T.Size.big},children:Os.jsx(T,{fullWidth:!0,size:T.Size.big,disabled:!(s&&d&&u&&h&&!j&&o),onClick:()=>N(!0),children:j?Os.jsx(e,{id:"R7D79P",message:"Invalid pair"}):Os.jsx(e,{id:"bwSQI0",message:"Supply"})})})})})]}),Os.jsx(GT,{open:D,onClose:()=>N(!1),slippage:x,baseToken:s,baseAmount:u,quoteToken:d,quoteAmount:h,fee:o,price:C,lpAmount:I,shareOfPool:R,pairAddress:w,createMutation:V})]})}const nO=({disabled:e,feeAmount:t,dispatch:n})=>{const i=g(),{isMobile:o}=wy(),[a,s]=ct(!1);return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:12,borderWidth:1,borderStyle:"solid",borderColor:i.palette.border.main,borderRadius:12},e?{opacity:.3}:void 0),children:[Os.jsx(f,{sx:{typography:"h5",color:i.palette.text.primary},children:t?`${eS[t].label} ${r._({id:"fxRyGG",message:"fee tier"})}`:r._({id:"EU3wU4",message:"Fee tier"})}),Os.jsx(T,{size:T.Size.small,variant:T.Variant.outlined,disabled:e,onClick:()=>s((e=>!e)),sx:{color:i.palette.text.primary,border:`solid 1px ${i.palette.text.primary}`},children:a?r._({id:"vLyv1R",message:"Hide"}):r._({id:"ePK91l",message:"Edit"})})]}),a&&Os.jsx(f,{sx:Object.assign({},o?{display:"grid",gap:8,gridTemplateColumns:"repeat(2, 1fr)"}:{display:"flex",alignItems:"center",gap:8}),children:[bk.LOWEST,bk.LOW,bk.MEDIUM,bk.HIGH].map((r=>{const o=t===r;return Os.jsxs(T,{size:T.Size.middle,variant:T.Variant.outlined,disabled:e,onClick:()=>{n({type:Hj.UpdateFeeAmount,payload:r})},sx:{flexBasis:"50%",flexShrink:1,flexGrow:1,justifyContent:"space-between",px:20,color:i.palette.text.primary,borderRadius:12,borderColor:o?i.palette.primary.main:i.palette.border.main,[i.breakpoints.up("tablet")]:{flexBasis:"25%"}},children:[eS[r].label,o?Os.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[Os.jsx("rect",{x:"0.5",y:"0.5",width:"17",height:"17",rx:"8.5",stroke:i.palette.primary.main}),Os.jsx("rect",{x:"4.5",y:"4.5",width:"9",height:"9",rx:"4.5",fill:i.palette.primary.main,stroke:i.palette.primary.main})]}):Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:Os.jsx("rect",{x:"0.5",y:"0.5",width:"17",height:"17",rx:"8.5",stroke:i.palette.text.secondary})})]},r)}))})]})},rO={neutral1:"#222222",neutral2:"#7D7D7D",accent1:"#FC72FF",critical:"FF5F52",white:"#FFFFFF",surface3:"#22222212",opacity:{hover:.6,click:.4,disabled:.5,enabled:1}},iO=({series:e,xScale:t,yScale:n,xValue:r,yValue:i,fill:o})=>lt((()=>{var a;return Os.jsx(f,{component:"path",opacity:.5,stroke:null!=o?o:rO.accent1,fill:null!=o?o:rO.accent1,d:null!==(a=cn().curve(un).x((e=>t(r(e)))).y1((e=>n(i(e)))).y0(n(0))(e.filter((e=>{const n=t(r(e));return n>0&&n<=window.innerWidth}))))&&void 0!==a?a:void 0})}),[o,e,t,r,n,i]),oO=({axisGenerator:e})=>Os.jsx("g",{ref:t=>{t&&hn(t).call(e).call((e=>e.select(".domain").remove()))}}),aO=({xScale:e,innerHeight:t,offset:n=0})=>lt((()=>Os.jsx(f,{component:"g",transform:`translate(0, ${t+n})`,sx:{"& line":{display:"none"},"& text":{color:rO.neutral2,transform:"translateY(5px)"}},children:Os.jsx(oO,{axisGenerator:pn(e).ticks(6)})})),[t,n,e]),sO=e=>["M 0 0",`v ${e}`,"m 1 0","V 0","M 0 1","h 12","q 2 0, 2 2","v 22","q 0 2 -2 2","h -12","z"].join(" "),lO=()=>["m 5 7","v 14","M 0 0","m 9 7","v 14","z"].join(" "),dO=({color:e,size:t=10,margin:n=10})=>Os.jsx("polygon",{points:`0 0, ${t} ${t}, 0 ${t}`,transform:` translate(${t+n}, ${n}) rotate(45) `,fill:e,stroke:e,strokeWidth:"4",strokeLinejoin:"round"});const cO=({color:e,d:t})=>Os.jsx(f,{component:"path",cursor:"ew-resize",pointerEvents:"none",strokeWidth:3,stroke:e,fill:e,d:t}),uO=({d:e})=>Os.jsx(f,{component:"path",cursor:"ew-resize",pointerEvents:"none",stroke:rO.white,opacity:rO.opacity.hover,d:e}),pO=({visible:e,transform:t,children:n})=>Os.jsx(f,{component:"g",opacity:e?"1":"0",transform:t,sx:{transition:"opacity 300ms"},children:n}),hO=({y:e,x:t,height:n,width:r,rx:i})=>Os.jsx(f,{component:"rect",fill:rO.surface3,y:e,x:t,height:n,width:r,rx:i}),mO=({y:e,transform:t,dominantBaseline:n,children:r})=>Os.jsx(f,{component:"text",y:e,textAnchor:"middle",fontSize:"13px",fill:rO.neutral1,transform:t,dominantBaseline:n,children:r}),fO=(e,t,n)=>{const r=e.map((e=>n(e).toFixed(1))),i=t.map((e=>n(e).toFixed(1)));return r.every(((e,t)=>e===i[t]))},gO=({id:e,xScale:t,interactive:n,brushLabelValue:r,brushExtent:i,setBrushExtent:o,innerWidth:a,innerHeight:s,westHandleColor:l,eastHandleColor:d})=>{const c=dt(null),u=dt(null),[p,h]=ct(i),[m,f]=ct(!1),[g,y]=ct(!1),x=function(e){const t=dt();return st((()=>{t.current=e}),[e]),t.current}(i),v=ut((e=>{const{type:n,selection:r,mode:a}=e;if(!r)return void h(null);const s=r.map(t.invert);"end"!==n||fO(i,s,t)||o(s,a),h(s)}),[t,i,o]);st((()=>{h(i)}),[i]),st((()=>{c.current&&(u.current=mn().extent([[Math.max(2,t(0)),0],[a-2,s]]).handleSize(30).filter((()=>n)).on("brush end",v),u.current(hn(c.current)),x&&fO(i,x,t)&&hn(c.current).transition().call(u.current.move,i.map(t)),hn(c.current).selectAll(".selection").attr("stroke","none").attr("fill-opacity","0.1").attr("fill",`url(#${e}-gradient-selection)`))}),[i,v,e,s,a,n,x,t]),st((()=>{c.current&&u.current&&u.current.move(hn(c.current),i.map(t))}),[i,t]),st((()=>{f(!0);const e=setTimeout((()=>f(!1)),1500);return()=>clearTimeout(e)}),[p]);const b=p&&t(p[0])>20,A=p&&t(p[1])>a-20,w=p&&(t(p[0])<0||t(p[1])<0),k=p&&(t(p[0])>a||t(p[1])>a),C=p&&t(p[0])>=0&&t(p[0])<=a,j=p&&t(p[1])>=0&&t(p[1])<=a;return lt((()=>Os.jsxs(Os.Fragment,{children:[Os.jsxs("defs",{children:[Os.jsxs("linearGradient",{id:`${e}-gradient-selection`,x1:"0%",y1:"100%",x2:"100%",y2:"100%",children:[Os.jsx("stop",{stopColor:l}),Os.jsx("stop",{stopColor:d,offset:"1"})]}),Os.jsx("clipPath",{id:`${e}-brush-clip`,children:Os.jsx("rect",{x:"0",y:"0",width:a,height:s})})]}),Os.jsx("g",{ref:c,clipPath:`url(#${e}-brush-clip)`,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)}),p&&Os.jsxs(Os.Fragment,{children:[C?Os.jsxs("g",{transform:`translate(${Math.max(0,t(p[0]))}, 0), scale(${b?"-1":"1"}, 1)`,children:[Os.jsxs("g",{children:[Os.jsx(cO,{color:l,d:sO(s)}),Os.jsx(uO,{d:lO()})]}),Os.jsxs(pO,{transform:`translate(50,0), scale(${b?"1":"-1"}, 1)`,visible:m||g,children:[Os.jsx(hO,{y:"0",x:"-30",height:"30",width:"60",rx:"8"}),Os.jsx(mO,{transform:"scale(-1, 1)",y:"15",dominantBaseline:"middle",children:r("w",p[0])})]})]}):null,j?Os.jsxs("g",{transform:`translate(${t(p[1])}, 0), scale(${A?"-1":"1"}, 1)`,children:[Os.jsxs("g",{children:[Os.jsx(cO,{color:d,d:sO(s)}),Os.jsx(uO,{d:lO()})]}),Os.jsxs(pO,{transform:`translate(50,0), scale(${A?"-1":"1"}, 1)`,visible:m||g,children:[Os.jsx(hO,{y:"0",x:"-30",height:"30",width:"60",rx:"8"}),Os.jsx(mO,{y:"15",dominantBaseline:"middle",children:r("e",p[1])})]})]}):null,w&&Os.jsx(dO,{color:l}),k&&Os.jsx("g",{transform:`translate(${a}, 0) scale(-1, 1)`,children:Os.jsx(dO,{color:d})})]})]})),[r,d,j,A,b,g,e,s,a,p,k,m,w,l,C,t])},yO=({value:e,xScale:t,innerHeight:n})=>lt((()=>Os.jsx(f,{component:"line",x1:t(e),y1:"0",x2:t(e),y2:n,sx:{opacity:.5,strokeWidth:2,stroke:rO.neutral1,fill:"none"}})),[e,t,n]);function xO({svg:e,xScale:t,setZoom:n,width:r,height:i,resetBrush:o,showResetButton:a,zoomLevels:s}){const l=dt(),[d,c,u,p]=lt((()=>[()=>e&&l.current&&hn(e).transition().call(l.current.scaleBy,2),()=>e&&l.current&&hn(e).transition().call(l.current.scaleBy,.5),()=>e&&l.current&&hn(e).transition().call(l.current.scaleTo,.5),()=>e&&l.current&&hn(e).call(l.current.transform,fn.translate(0,0).scale(1)).transition().call(l.current.scaleTo,.5)]),[e]);return st((()=>{e&&(l.current=gn().scaleExtent([s.min,s.max]).extent([[0,0],[r,i]]).on("zoom",(({transform:e})=>n(e))),hn(e).call(l.current))}),[i,r,n,e,t,l,s,s.max,s.min]),st((()=>{u()}),[u,s]),Os.jsxs(f,{sx:{display:"grid",gridTemplateColumns:`repeat(${a?3:2}, 1fr)`,gridGap:"6px",position:"absolute",top:"-32px",right:0},children:[a&&Os.jsx(T,{size:T.Size.small,sx:{borderRadius:16},onClick:()=>{o(),p()},disabled:!1,children:Os.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Os.jsx("polyline",{points:"1 4 1 10 7 10"}),Os.jsx("polyline",{points:"23 20 23 14 17 14"}),Os.jsx("path",{d:"M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15"})]})}),Os.jsx(T,{size:T.Size.small,sx:{borderRadius:16},onClick:d,disabled:!1,children:Os.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Os.jsx("circle",{cx:"11",cy:"11",r:"8"}),Os.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),Os.jsx("line",{x1:"11",y1:"8",x2:"11",y2:"14"}),Os.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}),Os.jsx(T,{size:T.Size.small,sx:{borderRadius:16},onClick:c,disabled:!1,children:Os.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Os.jsx("circle",{cx:"11",cy:"11",r:"8"}),Os.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),Os.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})})]})}const vO=e=>e.price0,bO=e=>e.activeLiquidity;function AO({id:e="liquidityChartRangeInput",data:{series:t,current:n},ticksAtLimit:r,styles:i,dimensions:{width:o,height:a},margins:s,interactive:l=!0,brushDomain:d,brushLabels:c,onBrushDomainChange:u,zoomLevels:p}){const h=dt(null),[m,g]=ct(null),[y,x]=lt((()=>[a-s.top-s.bottom,o-s.left-s.right]),[o,a,s]),{xScale:v,yScale:b}=lt((()=>{const e={xScale:yn().domain([n*p.initialMin,n*p.initialMax]).range([0,x]),yScale:yn().domain([0,xn(t,bO)]).range([y,0])};if(m){const t=m.rescaleX(e.xScale);e.xScale.domain(t.domain())}return e}),[n,p.initialMin,p.initialMax,x,t,y,m]);return st((()=>{g(null)}),[p]),st((()=>{d||u(v.domain(),void 0)}),[d,u,v]),Os.jsxs(Os.Fragment,{children:[Os.jsx(xO,{svg:h.current,xScale:v,setZoom:g,width:x,height:a,resetBrush:()=>{u([n*p.initialMin,n*p.initialMax],"reset")},showResetButton:Boolean(r[Mw.LOWER]||r[Mw.UPPER]),zoomLevels:p}),Os.jsxs("svg",{width:"100%",height:"100%",viewBox:`0 0 ${o} ${a}`,style:{overflow:"visible"},children:[Os.jsxs("defs",{children:[Os.jsx("clipPath",{id:`${e}-chart-clip`,children:Os.jsx("rect",{x:"0",y:"0",width:x,height:a})}),d&&Os.jsx("mask",{id:`${e}-chart-area-mask`,children:Os.jsx("rect",{fill:"white",x:v(d[0]),y:"0",width:v(d[1])-v(d[0]),height:y})})]}),Os.jsxs("g",{transform:`translate(${s.left},${s.top})`,children:[Os.jsxs("g",{clipPath:`url(#${e}-chart-clip)`,children:[Os.jsx(iO,{series:t,xScale:v,yScale:b,xValue:vO,yValue:bO}),d&&Os.jsx("g",{mask:`url(#${e}-chart-area-mask)`,children:Os.jsx(iO,{series:t,xScale:v,yScale:b,xValue:vO,yValue:bO,fill:i.area.selection})}),Os.jsx(yO,{value:n,xScale:v,innerHeight:y}),Os.jsx(aO,{xScale:v,innerHeight:y})]}),Os.jsx(f,{component:"rect",width:x,height:a,ref:h,sx:{fill:"transparent",cursor:"grab","&:active":{cursor:"grabbing"}}}),Os.jsx(gO,{id:e,xScale:v,interactive:l,brushLabelValue:c,brushExtent:null!=d?d:v.domain(),innerWidth:x,innerHeight:y,setBrushExtent:u,westHandleColor:i.brush.handle.west,eastHandleColor:i.brush.handle.east})]})]})]})}const wO=8;function kO(e,t,n,r,i,o){var a,s,l,d,c;let u=Object.assign({},n),p=[];for(let n=i+(o?1:-1);o?n<r.length:n>=0;o?n++:n--){const i=Number(null===(a=r[n])||void 0===a?void 0:a.tickIdx),h=_C(e,t,i),m={liquidityActive:u.liquidityActive,tick:i,liquidityNet:tn.BigInt(null!==(l=null===(s=r[n])||void 0===s?void 0:s.liquidityNet)&&void 0!==l?l:""),price0:h.toFixed(wO),sdkPrice:h};o?m.liquidityActive=tn.add(u.liquidityActive,tn.BigInt(null!==(c=null===(d=r[n])||void 0===d?void 0:d.liquidityNet)&&void 0!==c?c:0)):!o&&tn.notEqual(u.liquidityNet,tn.BigInt(0))&&(m.liquidityActive=tn.subtract(u.liquidityActive,u.liquidityNet)),p.push(m),u=m}return o||(p=p.reverse()),p}const CO=8,jO=(e,t)=>e&&t?Math.floor(e/Ak[t])*Ak[t]:void 0,TO=1e3;function EO(e,t,n,r){const[i,o]=ct(0),[a,s]=ct([]),{data:l,error:d,isLoading:c}=function(e,t,n,r=0,i){var o;const a=QA(),s=e&&t&&n?rj.getAddress(null==e?void 0:e.wrapped,null==t?void 0:t.wrapped,n,void 0,i?Xw[i]:void 0):void 0,l=a.getQuery(de.graphql.AllV3TicksDocument,{skip:r,first:TO,where:{chain:i?Gr[i]:void 0,poolAddress:null!==(o=null==s?void 0:s.toLowerCase())&&void 0!==o?o:void 0,refreshNow:!0,schemaName:"ammv3"}});return It(Object.assign(Object.assign({},l),{enabled:!0}))}(e,t,n,i,r),u=null==l?void 0:l.ticks;return st((()=>{(null==u?void 0:u.length)&&(s((e=>[...e,...u])),(null==u?void 0:u.length)===TO&&o((e=>e+TO)))}),[u]),{isLoading:c||(null==u?void 0:u.length)===TO,error:d,ticks:a}}function SO({currencyA:e,currencyB:t,feeAmount:n}){const{isLoading:r,error:i,data:o}=function(e,t,n,r){var i,o,a;const{chainId:s}=hf(),l=Rj(e,t,n),d=null===(i=l[1])||void 0===i?void 0:i.liquidity,c=null===(o=l[1])||void 0===o?void 0:o.sqrtRatioX96,u=null===(a=l[1])||void 0===a?void 0:a.tickCurrent,p=lt((()=>jO(u,n)),[u,n]),{isLoading:h,error:m,ticks:f}=EO(e,t,n,s);return lt((()=>{var n,r,i,o,a;if(!e||!t||void 0===p||l[0]!==Ij.EXISTS||!f||0===f.length||h)return{isLoading:h||l[0]===Ij.LOADING,error:m,activeTick:p,data:void 0};const s=null==e?void 0:e.wrapped,g=null==t?void 0:t.wrapped,y=f.findIndex((e=>(null==e?void 0:e.tickIdx)&&e.tickIdx>p))-1;if(y<0)return console.log("usePoolTickData","usePoolActiveLiquidity","TickData pivot not found",{token0:s.address,token1:g.address,chainId:s.chainId}),{isLoading:h,error:m,activeTick:p,data:void 0};const x=_C(s,g,p),v={liquidityActive:tn.BigInt(null!==(r=null===(n=l[1])||void 0===n?void 0:n.liquidity)&&void 0!==r?r:0),tick:p,liquidityNet:Number(null===(i=f[y])||void 0===i?void 0:i.tickIdx)===p?tn.BigInt(null!==(a=null===(o=f[y])||void 0===o?void 0:o.liquidityNet)&&void 0!==a?a:0):tn.BigInt(0),price0:x.toFixed(CO),sdkPrice:x},b=kO(s,g,v,f,y,!0),A=kO(s,g,v,f,y,!1).concat(v).concat(b);return{isLoading:h,error:m,currentTick:u,activeTick:p,liquidity:d,sqrtPriceX96:c,data:A}}),[e,t,p,l,f,h,m,u,d,c])}(e,t,n),a=ut((()=>{if(!(null==o?void 0:o.length))return;const e=[];for(let t=0;t<o.length;t++){const n=o[t],r={activeLiquidity:parseFloat(n.liquidityActive.toString()),price0:parseFloat(n.price0)};r.activeLiquidity>0&&e.push(r)}return e}),[o]);return lt((()=>({isLoading:r,error:i,formattedData:r?void 0:a()})),[r,i,a])}const IO={initialMin:.999,initialMax:1.001,min:1e-5,max:1.5},RO={[bk.LOWEST]:IO,[bk.LOW_200]:IO,[bk.LOW_300]:IO,[bk.LOW_400]:IO,[bk.LOW]:IO,[bk.MEDIUM]:{initialMin:.5,initialMax:2,min:1e-5,max:20},[bk.HIGH]:{initialMin:.5,initialMax:2,min:1e-5,max:20}};function LO({message:e,icon:t}){return Os.jsxs(Nw,{style:{height:"100%",justifyContent:"center"},children:[t,e&&Os.jsx(f,{sx:{mt:20,p:10,typography:"caption",textAlign:"center"},children:e})]})}function MO(){return Os.jsx(D,{})}function OO({currencyA:t,currencyB:n,feeAmount:r,ticksAtLimit:i,price:o,priceLower:a,priceUpper:s,onLeftRangeInput:l,onRightRangeInput:d,interactive:c}){const u=t&&n&&(null==t?void 0:t.wrapped.sortsBefore(null==n?void 0:n.wrapped)),{isLoading:p,error:h,formattedData:m}=SO({currencyA:t,currencyB:n,feeAmount:r}),g=ut(((e,t)=>{let n=Number(e[0]);const r=Number(e[1]);n<=0&&(n=1/10**6),(!i[u?Mw.LOWER:Mw.UPPER]||"handle"===t||"reset"===t)&&n>0&&l(n.toFixed(6)),(!i[u?Mw.UPPER:Mw.LOWER]||"reset"===t)&&r>0&&r<1e35&&d(r.toFixed(6))}),[u,l,d,i]);c=c&&Boolean(null==m?void 0:m.length);const y=lt((()=>{const e=u?a:null==s?void 0:s.invert(),t=u?s:null==a?void 0:a.invert();return e&&t?[parseFloat(null==e?void 0:e.toSignificant(6)),parseFloat(null==t?void 0:t.toSignificant(6))]:void 0}),[u,a,s]),x=ut(((e,t)=>{if(!o)return"";if("w"===e&&i[u?Mw.LOWER:Mw.UPPER])return"0";if("e"===e&&i[u?Mw.UPPER:Mw.LOWER])return"∞";const n=(t<o?-1:1)*((Math.max(t,o)-Math.min(t,o))/o)*100;return o?`${An({input:n,decimals:2})}%`:""}),[u,o,i]),v=!t||!n||void 0===m&&!p&&!h;return Os.jsx(Fw,{gap:"md",style:{minHeight:"200px"},children:v?Os.jsx(LO,{message:Os.jsx(e,{id:"OZUH85",message:"Your position will appear here."}),icon:Os.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"56",height:"56",viewBox:"0 0 24 24",fill:"none",stroke:rO.neutral1,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Os.jsx("polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}),Os.jsx("path",{d:"M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"})]})}):p?Os.jsx(MO,{}):h?Os.jsx(LO,{message:Os.jsx(e,{id:"79D0qY",message:"Liquidity data not available."}),icon:Os.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"56",height:"56",viewBox:"0 0 24 24",fill:"none",stroke:rO.neutral2,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Os.jsx("path",{d:"M22.61 16.95A5 5 0 0 0 18 10h-1.26a8 8 0 0 0-7.05-6M5 5a8 8 0 0 0 4 15h9a5 5 0 0 0 1.7-.3"}),Os.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})}):m&&0!==m.length&&o?Os.jsx(f,{sx:{position:"relative",width:"100%",maxHeight:"200px",justifyContent:"center",alignContent:"center"},children:Os.jsx(AO,{data:{series:m,current:o},dimensions:{width:560,height:200},margins:{top:10,right:2,bottom:20,left:0},styles:{area:{selection:rO.accent1},brush:{handle:{west:rO.critical,east:rO.accent1}}},interactive:c,brushLabels:x,brushDomain:y,onBrushDomainChange:g,zoomLevels:RO[null!=r?r:bk.MEDIUM],ticksAtLimit:i})}):Os.jsx(LO,{message:Os.jsx(e,{id:"rH6vg9",message:"There is no liquidity data."}),icon:Os.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"56",height:"56",viewBox:"0 0 24 24",fill:"none",stroke:rO.neutral2,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Os.jsx("line",{x1:"18",y1:"20",x2:"18",y2:"10"}),Os.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"4"}),Os.jsx("line",{x1:"6",y1:"20",x2:"6",y2:"14"})]})})})}const BO=({value:t,decrement:n,increment:r,decrementDisabled:i=!1,incrementDisabled:o=!1,locked:a,onUserInput:s,title:l,tokenA:d,tokenB:c})=>{const u=g(),[p,h]=ct(!1),[m,y]=ct(""),[x,v]=ct(!1),[b,A]=ct(!1),w=ut((()=>{v(!1),h(!1),s(m)}),[m,s]),k=ut((()=>{v(!1),s(n())}),[n,s]),C=ut((()=>{v(!1),s(r())}),[r,s]);return st((()=>{m===t||x||setTimeout((()=>{y(t),A(!0),setTimeout((function(){A(!1)}),1800)}),0)}),[m,x,t]),Os.jsx(f,{onFocus:()=>{v(!0),h(!0)},onBlur:w,sx:{width:"100%",py:12,px:20,borderRadius:16,backgroundColor:u.palette.background.input},children:Os.jsxs(f,{sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:[Os.jsx(f,{sx:{typography:"body2",fontWeight:600,color:u.palette.text.primary},children:l}),Os.jsx(f,{sx:{mt:4,typography:"h6",fontWeight:500,color:u.palette.text.secondary},children:Os.jsx(e,{id:"1/LP4K",message:"{tokenB} per {tokenA}",values:{tokenB:c,tokenA:d}})}),Os.jsx(hy,{sx:{mt:12},value:m,onChange:e=>{y(e)},readOnly:a})]}),Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:8},children:[!a&&Os.jsx(T,{size:T.Size.small,onClick:C,disabled:o,sx:{px:4,backgroundColor:u.palette.background.paper,"&[disabled]":{cursor:"default"}},children:Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{d:"M14.25 9.75H9.75V14.25H8.25V9.75H3.75V8.25H8.25V3.75H9.75V8.25H14.25V9.75Z",fill:i?u.palette.text.disabled:u.palette.text.primary})})}),!a&&Os.jsx(T,{size:T.Size.small,onClick:k,disabled:i,sx:{px:4,backgroundColor:u.palette.background.paper,"&[disabled]":{cursor:"default"}},children:Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("rect",{x:"3.75",y:"8.25",width:"10.5",height:"1.5",fill:i?u.palette.text.disabled:u.palette.text.primary})})})]})]})})},PO=({priceLower:t,priceUpper:n,onLeftRangeInput:r,onRightRangeInput:i,getDecrementLower:o,getIncrementLower:a,getDecrementUpper:s,getIncrementUpper:l,currencyA:d,currencyB:c,feeAmount:u,ticksAtLimit:p})=>{var h,m,g,y;const x=null===(h=null!=d?d:void 0)||void 0===h?void 0:h.wrapped,v=null===(m=null!=c?c:void 0)||void 0===m?void 0:m.wrapped,b=x&&v&&x.sortsBefore(v),A=b?t:null==n?void 0:n.invert(),w=b?n:null==t?void 0:t.invert();return Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:8},children:[Os.jsx(BO,{value:p[b?Mw.LOWER:Mw.UPPER]?"0":null!==(g=null==A?void 0:A.toSignificant(8))&&void 0!==g?g:"",onUserInput:r,decrement:b?o:l,increment:b?a:s,decrementDisabled:void 0===A||p[b?Mw.LOWER:Mw.UPPER],incrementDisabled:void 0===A||p[b?Mw.LOWER:Mw.UPPER],feeAmount:u,label:A?`${null==c?void 0:c.symbol}`:"-",title:Os.jsx(e,{id:"uEoBVI",message:"Low price"}),tokenA:null==d?void 0:d.symbol,tokenB:null==c?void 0:c.symbol}),Os.jsx(BO,{value:p[b?Mw.UPPER:Mw.LOWER]?"∞":null!==(y=null==w?void 0:w.toSignificant(8))&&void 0!==y?y:"",onUserInput:i,decrement:b?s:a,increment:b?l:o,incrementDisabled:void 0===w||p[b?Mw.UPPER:Mw.LOWER],decrementDisabled:void 0===w||p[b?Mw.UPPER:Mw.LOWER],feeAmount:u,label:w?`${null==c?void 0:c.symbol}`:"-",tokenA:null==d?void 0:d.symbol,tokenB:null==c?void 0:c.symbol,title:Os.jsx(e,{id:"kAC8rT",message:"High price"})})]})};var DO;function NO(){return NO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NO.apply(null,arguments)}const FO=e=>ot.createElement("svg",NO({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),DO||(DO=ot.createElement("g",{id:"ICON/18px/arrow/\\xE6\\x94\\xB6\\xE8\\xB5\\xB7/Dark"},ot.createElement("path",{id:"\\xE4\\xB8\\x89\\xE8\\xA7\\x92\\xE5\\xBD\\xA2",fillRule:"evenodd",clipRule:"evenodd",d:"M6.58398 12.376C6.78189 12.6728 7.21811 12.6728 7.41603 12.376L10.4818 7.77735C10.7033 7.44507 10.4651 7 10.0657 7H3.93426C3.53491 7 3.29672 7.44507 3.51823 7.77735L6.58398 12.376Z",fill:"currentColor"}))));function WO({token:e,oppositeTokenAddress:t,dispatch:n,tokenSelectOnChange:i}){const o=g(),{chainId:a}=hf(),[s,l]=ct(!1);return Os.jsxs(Os.Fragment,{children:[Os.jsxs(f,{component:y,sx:{flexBasis:"100%",flexGrow:1,flexShrink:1,display:"flex",alignItems:"center",px:20,py:8,borderRadius:12,borderWidth:1,borderStyle:"solid",borderColor:e?o.palette.border.main:o.palette.primary.main,color:e?o.palette.text.primary:o.palette.primary.contrastText,backgroundColor:e?"transparent":o.palette.primary.main,"&:hover":{borderColor:e?o.palette.border.main:o.palette.primary.main,opacity:.8},[o.breakpoints.up("tablet")]:{flexBasis:"50%"}},onClick:()=>{l(!0)},children:[e?Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8},children:[Os.jsx(ey,{address:e.address,marginRight:0,width:24,height:24,chainId:e.chainId||a,noShowChain:!0,sx:{flexShrink:0}}),Os.jsx(f,{sx:{typography:"h5",fontWeight:600,lineHeight:"32px",flexShrink:0},children:e.symbol})]}):Os.jsx(f,{sx:{typography:"h5",fontWeight:600,lineHeight:"32px",flexShrink:0},children:r._({id:"0RrIzN",message:"Select token"})}),Os.jsx(f,{component:FO,sx:{flexShrink:0,ml:"auto",width:18,height:18}})]}),Os.jsx(ky,{value:Dj(e),open:s,chainId:a,occupiedAddrs:[t],occupiedChainId:null==e?void 0:e.chainId,onClose:()=>{l(!1)},onTokenChange:(e,t)=>{if(!Array.isArray(e)){if(t)return n({type:Hj.UpdateBaseTokenAndClearQuoteToken,payload:e}),void l(!1);i(e),l(!1)}},modal:!0})]})}const VO=({baseToken:e,quoteToken:t,dispatch:n})=>{var r,i;const o=g();return Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap",[o.breakpoints.up("tablet")]:{flexWrap:"nowrap"}},children:[Os.jsx(WO,{token:e,oppositeTokenAddress:null!==(r=null==t?void 0:t.address)&&void 0!==r?r:"",dispatch:n,tokenSelectOnChange:e=>{n({type:Hj.UpdateBaseToken,payload:e})}}),Os.jsx(WO,{token:t,oppositeTokenAddress:null!==(i=null==e?void 0:e.address)&&void 0!==i?i:"",dispatch:n,tokenSelectOnChange:e=>{n({type:Hj.UpdateQuoteToken,payload:e})}})]})};function UO({params:e,handleGoBack:t,handleGoToPoolList:n}){var o,a,s,l,d,c,u,p,h,m;const{chainId:x,account:v}=hf(),b=g(),A=Hy(),{isMobile:w}=wy(),k=It(Object.assign({},$a.getFetchTokenQuery(x,null==e?void 0:e.from,v))),j=It(Object.assign({},$a.getFetchTokenQuery(x,null==e?void 0:e.to,v))),[E,S]=ft(Gj,{baseToken:null,quoteToken:null,feeAmount:(null==e?void 0:e.fee)?Number(null==e?void 0:e.fee):void 0,independentField:Lw.CURRENCY_A,typedValue:"",startPriceTypedValue:"",leftRangeTypedValue:"",rightRangeTypedValue:""});st((()=>{k.data&&S({type:Hj.UpdateDefaultBaseToken,payload:k.data})}),[k]),st((()=>{j.data&&S({type:Hj.UpdateDefaultQuoteToken,payload:j.data})}),[j]);const{independentField:I,typedValue:R,startPriceTypedValue:L}=E,{pool:M,ticks:O,dependentField:B,price:P,pricesAtTicks:D,pricesAtLimit:N,parsedAmounts:F,currencyBalances:W,position:V,noLiquidity:U,currencies:H,errorMessage:q,invalidPool:Z,invalidRange:z,outOfRange:Q,depositADisabled:G,depositBDisabled:Y,invertPrice:X,ticksAtLimit:J,isTaxed:K}=Qj({state:E}),_=lt((()=>{var e;return null===(e=X?null==P?void 0:P.invert():P)||void 0===e?void 0:e.toSignificant()}),[X,P]),{onFieldAInput:$,onFieldBInput:ee,onLeftRangeInput:te,onRightRangeInput:ne,onStartPriceInput:re}=Yj({noLiquidity:U,dispatch:S}),{slipper:ie,setSlipper:oe,slipperValue:ae,resetSlipper:se}=Ew({address:void 0,type:"AMMV3"}),le=!q&&!z,[de,ce]=ct(!1),ue={[I]:R,[B]:null!==(a=null===(o=F[B])||void 0===o?void 0:o.toSignificant(6))&&void 0!==a?a:""},pe=[Lw.CURRENCY_A,Lw.CURRENCY_B].reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:_j(W[t])})),{}),he=EA(Dj(null===(s=F[Lw.CURRENCY_A])||void 0===s?void 0:s.currency),{contractAddress:Jw[x],overrideBalance:W[Lw.CURRENCY_A]?new i(W[Lw.CURRENCY_A].toSignificant()):void 0,amount:F[Lw.CURRENCY_A]?new i(F[Lw.CURRENCY_A].toSignificant()):void 0}),me=EA(Dj(null===(l=F[Lw.CURRENCY_B])||void 0===l?void 0:l.currency),{contractAddress:Jw[x],overrideBalance:W[Lw.CURRENCY_B]?new i(W[Lw.CURRENCY_B].toSignificant()):void 0,amount:F[Lw.CURRENCY_B]?new i(F[Lw.CURRENCY_B].toSignificant()):void 0}),{[Mw.LOWER]:fe,[Mw.UPPER]:ge}=O,{[Mw.LOWER]:ye,[Mw.UPPER]:xe}=D,{getDecrementLower:ve,getIncrementLower:be,getDecrementUpper:Ae,getIncrementUpper:we,getSetFullRange:ke}=function({tickLower:e,tickUpper:t,pool:n,state:r,dispatch:i}){const{baseToken:o,quoteToken:a,feeAmount:s}=r,l=lt((()=>null==o?void 0:o.wrapped),[o]),d=lt((()=>null==a?void 0:a.wrapped),[a]);return{getDecrementLower:ut((()=>l&&d&&"number"==typeof e&&s?_C(l,d,e-Ak[s]).toSignificant(5,void 0,_w.ROUND_UP):"number"!=typeof e&&l&&d&&s&&n?_C(l,d,n.tickCurrent-Ak[s]).toSignificant(5,void 0,_w.ROUND_UP):""),[l,d,e,s,n]),getIncrementLower:ut((()=>l&&d&&"number"==typeof e&&s?_C(l,d,e+Ak[s]).toSignificant(5,void 0,_w.ROUND_UP):"number"!=typeof e&&l&&d&&s&&n?_C(l,d,n.tickCurrent+Ak[s]).toSignificant(5,void 0,_w.ROUND_UP):""),[l,d,e,s,n]),getDecrementUpper:ut((()=>l&&d&&"number"==typeof t&&s?_C(l,d,t-Ak[s]).toSignificant(5,void 0,_w.ROUND_UP):"number"!=typeof t&&l&&d&&s&&n?_C(l,d,n.tickCurrent-Ak[s]).toSignificant(5,void 0,_w.ROUND_UP):""),[l,d,t,s,n]),getIncrementUpper:ut((()=>l&&d&&"number"==typeof t&&s?_C(l,d,t+Ak[s]).toSignificant(5,void 0,_w.ROUND_UP):"number"!=typeof t&&l&&d&&s&&n?_C(l,d,n.tickCurrent+Ak[s]).toSignificant(5,void 0,_w.ROUND_UP):""),[l,d,t,s,n]),getSetFullRange:ut((()=>{i({type:Hj.setFullRange,payload:void 0})}),[i])}}({tickLower:fe,tickUpper:ge,pool:M,state:E,dispatch:S}),Ce=ut((()=>{ke();const e=N[Mw.LOWER];e&&te(e.toSignificant(5));const t=N[Mw.UPPER];t&&ne(t.toSignificant(5))}),[ke,te,ne,N]),{deadLine:je}=pf(),Te=Ot({mutationFn:()=>Fn(this,void 0,void 0,(function*(){if(!v||!x||!V)return;if(!E.baseToken||!E.quoteToken)return;const e=Math.ceil(Date.now()/1e3)+(null!=je?je:600),t=E.baseToken.isNative?E.baseToken:E.quoteToken.isNative?E.quoteToken:void 0;try{const{calldata:i,value:o}=fj.addCallParameters(V,{slippageTolerance:tT(100*ae),recipient:v,deadline:e.toString(),useNative:t,createPool:U});let a={to:Jw[x],data:i,value:o};(yield A.execute(r._({id:"8OiU8L",message:"Pool Creation"}),Object.assign({opcode:By.TX},a),{early:!1,metadata:{[Ey.createAMMV3Pool]:"1"}}))===Sy.Success&&setTimeout((()=>{n()}),100)}catch(e){console.error("onAddMutation",e)}}))});return Os.jsx(xw,{children:Os.jsxs(f,{sx:{mx:"auto",borderRadius:w?0:16,backgroundColor:"background.paper",width:w?"100%":600,display:"flex",flexDirection:"column",alignItems:"stretch"},children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",px:20,py:24,borderTopLeftRadius:16,borderTopRightRadius:16,backgroundColor:b.palette.background.paper},children:[Os.jsx(f,{component:y,onClick:t,sx:{flexGrow:0,flexShrink:0,display:"flex",alignItems:"center",color:b.palette.text.primary,width:24,height:24},children:Os.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",children:Os.jsx("path",{d:"M20 11.5H7.83L13.42 5.91L12 4.5L4 12.5L12 20.5L13.41 19.09L7.83 13.5H20V11.5Z",fill:"currentColor"})})}),Os.jsx(f,{sx:{flexGrow:1,textAlign:"center",typography:"caption",color:b.palette.text.primary},children:r._({id:"E6MqGy",message:"Add liquidity"})}),Os.jsx(f,{sx:{flexGrow:0,flexShrink:0,width:24,height:24}})]}),Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:20,p:20},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:12},children:[Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:b.palette.text.primary,textAlign:"left"},children:r._({id:"nxRg31",message:"Select pair"})}),Os.jsx(VO,{baseToken:E.baseToken,quoteToken:E.quoteToken,dispatch:S}),Os.jsx(nO,{disabled:!E.baseToken||!E.quoteToken,feeAmount:E.feeAmount,dispatch:S})]}),Os.jsxs(Hw,{disabled:!E.feeAmount||Z,children:[Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:b.palette.text.primary,textAlign:"left"},children:r._({id:"5CZbyC",message:"Set price range"})}),Boolean(E.baseToken&&E.quoteToken)&&Os.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:8,width:"100%",[b.breakpoints.up("tablet")]:{ml:"auto",width:"auto"}},children:[Os.jsx(T,{size:T.Size.small,variant:T.Variant.outlined,onClick:Ce,sx:Object.assign({py:4,px:12,height:26,typography:"h6",fontWeight:600},w?{flexGrow:0,flexShrink:1,flexBasis:"50%"}:void 0),children:r._({id:"5IHTSS",message:"Full range"})}),Os.jsx(Aj,{baseToken:E.baseToken,quoteToken:E.quoteToken,handleRateToggle:()=>{var e,t,n,r,i;J[Mw.LOWER]||J[Mw.UPPER]||(te(null!==(t=null===(e=X?ye:null==xe?void 0:xe.invert())||void 0===e?void 0:e.toSignificant(6))&&void 0!==t?t:""),ne(null!==(r=null===(n=X?xe:null==ye?void 0:ye.invert())||void 0===n?void 0:n.toSignificant(6))&&void 0!==r?r:""),$(null!==(i=ue[Lw.CURRENCY_B])&&void 0!==i?i:"")),S({type:Hj.ToggleRate,payload:void 0})},sx:w?{flexGrow:0,flexShrink:1,flexBasis:"50%"}:void 0})]})]}),Os.jsx(PO,{priceLower:ye,priceUpper:xe,getDecrementLower:ve,getIncrementLower:be,getDecrementUpper:Ae,getIncrementUpper:we,onLeftRangeInput:te,onRightRangeInput:ne,currencyA:E.baseToken,currencyB:E.quoteToken,feeAmount:E.feeAmount,ticksAtLimit:J}),Q&&Os.jsx(Dw,{children:r._({id:"b+KjnH",message:"Your position will not earn fees or be used in trades until the market price moves into your range."})}),z&&Os.jsx(Dw,{children:r._({id:"Jh223O",message:"Invalid range selected. The min price must be lower than the max price."})})]}),U?Os.jsxs(Hw,{children:[Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:b.palette.text.primary,textAlign:"left"},children:r._({id:"zeSosD",message:"Starting price"})}),Os.jsx(f,{sx:{p:8,borderRadius:8,backgroundColor:C(b.palette.primary.main,.1),typography:"h6",color:b.palette.primary.main},children:r._({id:"X6T02b",message:"This pool must be initialized before you can add liquidity. To initialize, select a starting price for the pool. Then, enter your liquidity price range and deposit amount. Gas fees will be higher than usual due to the initialization transaction."})}),Os.jsx(f,{sx:{px:16,py:12,borderRadius:8,borderWidth:1,borderColor:b.palette.border.main,borderStyle:"solid"},children:Os.jsx(hy,{sx:{backgroundColor:"transparent"},value:L,onChange:re})})]}):Os.jsxs(Hw,{disabled:!E.feeAmount||Z,children:[Os.jsxs(f,{sx:{typography:"body1",fontWeight:600,color:b.palette.text.primary,textAlign:"left"},children:[r._({id:"DWd30U",message:"Current price"}),Os.jsxs(f,{children:[_," ",r._({id:"b2jAb+",message:"per"})," ",null!==(c=null===(d=E.baseToken)||void 0===d?void 0:d.symbol)&&void 0!==c?c:""]})]}),Os.jsx(OO,{currencyA:null!==(u=E.baseToken)&&void 0!==u?u:void 0,currencyB:null!==(p=E.quoteToken)&&void 0!==p?p:void 0,feeAmount:E.feeAmount,ticksAtLimit:J,price:P?parseFloat((X?P.invert():P).toSignificant(8)):void 0,priceLower:ye,priceUpper:xe,onLeftRangeInput:te,onRightRangeInput:ne,interactive:!0})]}),Os.jsxs(Hw,{disabled:Z||z||U&&!L,children:[Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:b.palette.text.primary,textAlign:"left"},children:r._({id:"MU9s7M",message:"Deposit amounts"})}),Os.jsxs(f,{children:[Os.jsx(Yw,{value:ue[Lw.CURRENCY_A],onUserInput:$,maxAmount:pe[Lw.CURRENCY_A],balance:W[Lw.CURRENCY_A],currency:null!==(h=H[Lw.CURRENCY_A])&&void 0!==h?h:null,locked:G}),Os.jsx(zy,{}),Os.jsx(Yw,{value:ue[Lw.CURRENCY_B],onUserInput:ee,maxAmount:pe[Lw.CURRENCY_B],balance:W[Lw.CURRENCY_B],currency:null!==(m=H[Lw.CURRENCY_B])&&void 0!==m?m:null,locked:Y})]}),Os.jsx(Sw,{value:ie,onChange:oe,disabled:!1,type:"AMMV3"})]})]}),Os.jsx(f,{sx:{display:"flex",alignItems:"center",px:20,py:16,borderBottomLeftRadius:16,borderBottomRightRadius:16,backgroundColor:b.palette.background.paper},children:Os.jsx(qw,{chainId:x,approvalA:he,approvalB:me,parsedAmounts:F,isValid:le,depositADisabled:G,depositBDisabled:Y,errorMessage:q,setShowConfirm:ce})}),Os.jsx(Ej,{parsedAmounts:F,position:V,existingPosition:void 0,priceLower:ye,priceUpper:xe,outOfRange:Q,ticksAtLimit:J,on:de,onClose:()=>{ce(!1)},onConfirm:Te.mutate,loading:Te.isPending})]})})}function HO({removed:e,inRange:t}){const n=g(),i={py:4,px:8,color:n.palette.success.main,borderRadius:4,backgroundColor:C(n.palette.success.main,.1),typography:"h6"};return e?Os.jsx(A,{title:r._({id:"MZPP7t",message:"Your position has 0 liquidity, and is not earning fees."}),children:Os.jsx(f,{sx:Object.assign(Object.assign({},i),{color:n.palette.warning.main,backgroundColor:C(n.palette.warning.main,.1)}),children:r._({id:"D87pha",message:"Closed"})})}):t?Os.jsx(A,{title:r._({id:"aIvv/z",message:"The price of this pool is within your selected range. Your position is currently earning fees."}),children:Os.jsx(f,{sx:i,children:r._({id:"vOyUlD",message:"In range"})})}):Os.jsx(A,{title:r._({id:"IwiTcw",message:"The price of this pool is outside of your selected range. Your position is not currently earning fees."}),children:Os.jsx(f,{sx:Object.assign(Object.assign({},i),{color:n.palette.error.main,backgroundColor:C(n.palette.error.main,.1)}),children:r._({id:"i3Z+/Z",message:"Out of range"})})})}function qO(e,t=3){if(void 0===e)return"";const n=Number(e),r=1/10**t;return 0===n||n<1e-7?"0":n<r?`< ${r}`:n<1?(Math.floor(n/r)*r).toFixed(t):n<100?(Math.floor(100*n)/100).toString():n<1e4?Math.floor(n).toString():n<1e15?String(Math.floor(100*n)/100):"∞"}const ZO=({baseToken:e,quoteToken:t,handleRateToggle:n,sx:r})=>{const i=g(),o=e&&t&&ms(e,t);return Os.jsx(f,{component:y,onClick:n,sx:Object.assign({display:"flex",alignItems:"center",p:1,borderRadius:8,backgroundColor:i.palette.border.main},r),children:Os.jsxs(f,{sx:{display:"flex",alignItems:"center",width:"100%",[i.breakpoints.up("tablet")]:{width:"auto"}},children:[Os.jsx(f,{sx:Object.assign({flexGrow:1,flexShrink:1,flexBasis:"50%",px:12,py:4,borderRadius:7,textAlign:"center",typography:"h6",whiteSpace:"nowrap"},o?{color:i.palette.text.primary,backgroundColor:i.palette.background.paper}:{color:i.palette.text.secondary,backgroundColor:"transparent"}),children:o?e.symbol:null==t?void 0:t.symbol}),Os.jsx(f,{sx:Object.assign({flexGrow:1,flexShrink:1,flexBasis:"50%",px:12,py:4,borderRadius:7,textAlign:"center",typography:"h6",whiteSpace:"nowrap"},o?{color:i.palette.text.secondary,backgroundColor:"transparent"}:{color:i.palette.text.primary,backgroundColor:i.palette.background.paper}),children:o?t.symbol:null==e?void 0:e.symbol})]})})},zO={xs:"4px",sm:"8px",md:"12px",lg:"24px",xl:"32px"},QO=({children:e,sx:t})=>(g(),Os.jsx(f,{sx:Object.assign({display:"flex",flexDirection:"column",gap:20,px:20,py:20,borderRadius:12},t),children:e})),GO=({children:e,border:t,sx:n})=>{const r=g();return Os.jsx(QO,{sx:Object.assign(Object.assign({},n),t?{borderWidth:2,borderColor:r.palette.background.paperContrast}:{backgroundColor:r.palette.background.paperContrast}),children:e})},YO=({children:e})=>{const t=g();return Os.jsxs(f,{sx:{p:8,borderRadius:8,backgroundColor:C(t.palette.warning.main,.1),display:"flex",alignItems:"center",gap:8},children:[Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 16.125L9 1.875L17.25 16.125H0.75ZM14.6475 14.625L8.99998 4.86749L3.35247 14.625H14.6475ZM9.75004 12.375H8.25003V13.875H9.75004V12.375ZM8.25003 7.875H9.75004V10.875H8.25003V7.875Z",fill:t.palette.warning.main})}),Os.jsx(f,{sx:{typography:"h6",color:t.palette.warning.main,textAlign:"left"},children:e})]})};function XO({gap:e,flex:t,children:n,style:r}){return Os.jsx(f,{sx:Object.assign(Object.assign(Object.assign({display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:e&&zO[e]||e},t&&{flex:t}),{width:"100%",alignItems:"center"}),r),children:n})}function JO({gap:e,justify:t,grow:n,children:r,style:i}){return Os.jsx(f,{sx:Object.assign({display:"grid",gridAutoRows:"auto",gridRowGap:e&&zO[e]||e,justifyItems:t,flexGrow:n&&1},i),children:r})}function KO({gap:e,children:t,sx:n}){return Os.jsx(f,{sx:Object.assign({width:"100%",display:"flex",padding:0,alignItems:"center",justifyContent:"flex-start",gap:e&&zO[e]||e},n),children:t})}function _O({children:e,style:t}){return Os.jsx(KO,{sx:Object.assign({justifyContent:"space-between"},t),children:e})}function $O({gap:e,justify:t,children:n,sx:r}){return Os.jsx(KO,{sx:Object.assign({position:"relative",width:"fit-content",margin:`-${e}`},r),children:n})}function eB({children:e,disabled:t,sx:n}){return Os.jsx(KO,{sx:Object.assign({display:"flex",flexDirection:"column",alignItems:"stretch",gap:12,opacity:t?.2:1,pointerEvents:t?"none":"auto"},n),children:e})}const tB=tn.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),nB=tn.BigInt(0),rB=tn.BigInt(1),iB=tn.exponentiate(tn.BigInt(2),tn.BigInt(96)),oB=tn.exponentiate(iB,tn.BigInt(2)),aB=tn.BigInt(2),sB=[128,64,32,16,8,4,2,1].map((e=>[e,tn.exponentiate(aB,tn.BigInt(e))]));function lB(e,t){return tn.signedRightShift(tn.multiply(e,tn.BigInt(t)),tn.BigInt(128))}const dB=tn.exponentiate(tn.BigInt(2),tn.BigInt(32));class cB{constructor(){}static getSqrtRatioAtTick(e){nn(e>=cB.MIN_TICK&&e<=cB.MAX_TICK&&Number.isInteger(e),"TICK");const t=e<0?-1*e:e;let n=1&t?tn.BigInt("0xfffcb933bd6fad37aa2d162d1a594001"):tn.BigInt("0x100000000000000000000000000000000");return 2&t&&(n=lB(n,"0xfff97272373d413259a46990580e213a")),4&t&&(n=lB(n,"0xfff2e50f5f656932ef12357cf3c7fdcc")),8&t&&(n=lB(n,"0xffe5caca7e10e4e61c3624eaa0941cd0")),16&t&&(n=lB(n,"0xffcb9843d60f6159c9db58835c926644")),32&t&&(n=lB(n,"0xff973b41fa98c081472e6896dfb254c0")),64&t&&(n=lB(n,"0xff2ea16466c96a3843ec78b326b52861")),128&t&&(n=lB(n,"0xfe5dee046a99a2a811c461f1969c3053")),256&t&&(n=lB(n,"0xfcbe86c7900a88aedcffc83b479aa3a4")),512&t&&(n=lB(n,"0xf987a7253ac413176f2b074cf7815e54")),1024&t&&(n=lB(n,"0xf3392b0822b70005940c7a398e4b70f3")),2048&t&&(n=lB(n,"0xe7159475a2c29b7443b29c7fa6e889d9")),4096&t&&(n=lB(n,"0xd097f3bdfd2022b8845ad8f792aa5825")),8192&t&&(n=lB(n,"0xa9f746462d870fdf8a65dc1f90e061e5")),16384&t&&(n=lB(n,"0x70d869a156d2a1b890bb3df62baf32f7")),32768&t&&(n=lB(n,"0x31be135f97d08fd981231505542fcfa6")),65536&t&&(n=lB(n,"0x9aa508b5b7a84e1c677de54f3e99bc9")),131072&t&&(n=lB(n,"0x5d6af8dedb81196699c329225ee604")),262144&t&&(n=lB(n,"0x2216e584f5fa1ea926041bedfe98")),524288&t&&(n=lB(n,"0x48a170391f7dc42444e8fa2")),e>0&&(n=tn.divide(tB,n)),tn.greaterThan(tn.remainder(n,dB),nB)?tn.add(tn.divide(n,dB),rB):tn.divide(n,dB)}static getTickAtSqrtRatio(e){nn(tn.greaterThanOrEqual(e,cB.MIN_SQRT_RATIO)&&tn.lessThan(e,cB.MAX_SQRT_RATIO),"SQRT_RATIO");const t=tn.leftShift(e,tn.BigInt(32)),n=function(e){nn(tn.greaterThan(e,nB),"ZERO"),nn(tn.lessThanOrEqual(e,tB),"MAX");let t=0;for(const[n,r]of sB)tn.greaterThanOrEqual(e,r)&&(e=tn.signedRightShift(e,tn.BigInt(n)),t+=n);return t}(t);let r;r=tn.greaterThanOrEqual(tn.BigInt(n),tn.BigInt(128))?tn.signedRightShift(t,tn.BigInt(n-127)):tn.leftShift(t,tn.BigInt(127-n));let i=tn.leftShift(tn.subtract(tn.BigInt(n),tn.BigInt(128)),tn.BigInt(64));for(let e=0;e<14;e++){r=tn.signedRightShift(tn.multiply(r,r),tn.BigInt(127));const t=tn.signedRightShift(r,tn.BigInt(128));i=tn.bitwiseOr(i,tn.leftShift(t,tn.BigInt(63-e))),r=tn.signedRightShift(r,t)}const o=tn.multiply(i,tn.BigInt("255738958999603826347141")),a=tn.toNumber(tn.signedRightShift(tn.subtract(o,tn.BigInt("3402992956809132418596140100660247210")),tn.BigInt(128))),s=tn.toNumber(tn.signedRightShift(tn.add(o,tn.BigInt("291339464771989622907027621153398088495")),tn.BigInt(128)));return a===s?a:tn.lessThanOrEqual(cB.getSqrtRatioAtTick(s),e)?s:a}}cB.MIN_TICK=-887272,cB.MAX_TICK=-cB.MIN_TICK,cB.MIN_SQRT_RATIO=tn.BigInt("4295128739"),cB.MAX_SQRT_RATIO=tn.BigInt("1461446703485210103287273052203988822378723970342");const uB=tn.BigInt(Number.MAX_SAFE_INTEGER),pB=tn.BigInt(0),hB=tn.BigInt(1),mB=tn.BigInt(2);function fB(e,t){const n=tn.leftShift(tn.BigInt(e),tn.BigInt(192)),r=tn.BigInt(t);return function(e){if(nn(tn.greaterThanOrEqual(e,pB),"NEGATIVE"),tn.lessThan(e,uB))return tn.BigInt(Math.floor(Math.sqrt(tn.toNumber(e))));let t,n;for(t=e,n=tn.add(tn.divide(e,mB),hB);tn.lessThan(n,t);)t=n,n=tn.divide(tn.add(tn.divide(e,n),n),mB);return t}(tn.divide(n,r))}var gB;!function(e){e[e.ROUND_DOWN=0]="ROUND_DOWN",e[e.ROUND_HALF_UP=1]="ROUND_HALF_UP",e[e.ROUND_UP=2]="ROUND_UP"}(gB||(gB={}));const yB={[gB.ROUND_DOWN]:i.ROUND_DOWN,[gB.ROUND_HALF_UP]:i.ROUND_HALF_UP,[gB.ROUND_UP]:i.ROUND_UP},xB={[gB.ROUND_DOWN]:i.ROUND_DOWN,[gB.ROUND_HALF_UP]:i.ROUND_HALF_UP,[gB.ROUND_UP]:i.ROUND_UP};let vB=class e{constructor(e,t=tn.BigInt(1)){this.numerator=tn.BigInt(e),this.denominator=tn.BigInt(t)}static tryParseFraction(t){if(t instanceof tn||"number"==typeof t||"string"==typeof t)return new e(t);if("numerator"in t&&"denominator"in t)return t;throw new Error("Could not parse fraction")}get quotient(){return tn.divide(this.numerator,this.denominator)}get remainder(){return new e(tn.remainder(this.numerator,this.denominator),this.denominator)}invert(){return new e(this.denominator,this.numerator)}add(t){const n=e.tryParseFraction(t);return tn.equal(this.denominator,n.denominator)?new e(tn.add(this.numerator,n.numerator),this.denominator):new e(tn.add(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator)),tn.multiply(this.denominator,n.denominator))}subtract(t){const n=e.tryParseFraction(t);return tn.equal(this.denominator,n.denominator)?new e(tn.subtract(this.numerator,n.numerator),this.denominator):new e(tn.subtract(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator)),tn.multiply(this.denominator,n.denominator))}lessThan(t){const n=e.tryParseFraction(t);return tn.lessThan(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator))}equalTo(t){const n=e.tryParseFraction(t);return tn.equal(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator))}greaterThan(t){const n=e.tryParseFraction(t);return tn.greaterThan(tn.multiply(this.numerator,n.denominator),tn.multiply(n.numerator,this.denominator))}multiply(t){const n=e.tryParseFraction(t);return new e(tn.multiply(this.numerator,n.numerator),tn.multiply(this.denominator,n.denominator))}divide(t){const n=e.tryParseFraction(t);return new e(tn.multiply(this.numerator,n.denominator),tn.multiply(this.denominator,n.numerator))}toSignificant(e,t={decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0},n=gB.ROUND_HALF_UP){nn(Number.isInteger(e),`${e} is not an integer.`),nn(e>0,`${e} is not positive.`);const r=yB[n],o=new i(this.numerator.toString()).div(this.denominator.toString()).precision(e,r);return o.toFormat(o.decimalPlaces(),r,t)}toFixed(e,t={decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0},n=gB.ROUND_HALF_UP){nn(Number.isInteger(e),`${e} is not an integer.`),nn(e>=0,`${e} is negative.`);const r=xB[n];return new i(this.numerator.toString()).decimalPlaces(e,r).div(this.denominator.toString()).toFormat(e,r,t)}get asFraction(){return new e(this.numerator,this.denominator)}};const bB=new vB(tn.BigInt(100));function AB(e){return new wB(e.numerator,e.denominator)}class wB extends vB{constructor(){super(...arguments),this.isPercent=!0}add(e){return AB(super.add(e))}subtract(e){return AB(super.subtract(e))}multiply(e){return AB(super.multiply(e))}divide(e){return AB(super.divide(e))}toSignificant(e=5,t,n){return super.multiply(bB).toSignificant(e,t,n)}toFixed(e=2,t,n){return super.multiply(bB).toFixed(e,t,n)}}class kB extends vB{constructor(...e){let t,n,r,i;[t,n,r,i]=e,super(i,r),this.baseCurrency=t,this.quoteCurrency=n,this.scalar=new vB(tn.exponentiate(tn.BigInt(10),tn.BigInt(t.decimals)),tn.exponentiate(tn.BigInt(10),tn.BigInt(n.decimals)))}invert(){return new kB(this.quoteCurrency,this.baseCurrency,this.numerator,this.denominator)}multiply(e){const t=super.multiply(e);return new kB(this.baseCurrency,e.quoteCurrency,t.denominator,t.numerator)}get adjustedForDecimals(){return super.multiply(this.scalar)}toSignificant(e=6,t,n){return this.adjustedForDecimals.toSignificant(e,t,n)}toFixed(e=4,t,n){return this.adjustedForDecimals.toFixed(e,t,n)}}function CB(e){const t=ms(e.baseCurrency,e.quoteCurrency),n=t?fB(e.numerator,e.denominator):fB(e.denominator,e.numerator);let r=cB.getTickAtSqrtRatio(n);const i=jB(e.baseCurrency,e.quoteCurrency,r+1);return t?e.lessThan(i)||r++:e.greaterThan(i)||r++,r}function jB(e,t,n){const r=cB.getSqrtRatioAtTick(Number(n)),i=tn.multiply(r,r);return ms(e,t)?new kB(e,t,oB,i):new kB(e,t,i,oB)}function TB(e,t,n){if(!e||!t||void 0===n)return;const r=cB.getSqrtRatioAtTick(Number(n)),o=tn.multiply(r,r),a=10**t.decimals/10**e.decimals;return ms(e,t)?new i(o.toString()).div(oB.toString()).div(a).toString():new i(oB.toString()).div(o.toString()).div(a).toString()}const EB=[oe.MAINNET,oe.ARBITRUM_ONE,oe.SEPOLIA,oe.TAIKO],SB={v3CoreFactoryAddress:"0x3d2A7Bac4E8439ABe86B58324695e921a5FC0987",nonfungiblePositionManagerAddress:"0x483E5c0f309577f79b0a19cE65E332DD388aD7A8"},IB=Object.assign({},SB),RB=Object.assign({},SB),LB={v3CoreFactoryAddress:"0x3d2A7Bac4E8439ABe86B58324695e921a5FC0987",nonfungiblePositionManagerAddress:"0x483E5c0f309577f79b0a19cE65E332DD388aD7A8"},MB={[oe.MAINNET]:IB,[oe.ARBITRUM_ONE]:RB,[oe.SEPOLIA]:LB,[oe.TAIKO]:LB};var OB,BB;Object.assign({},EB.reduce(((e,t)=>(e[t]=MB[t].v3CoreFactoryAddress,e)),{})),Object.assign({},EB.reduce(((e,t)=>{const n=MB[t].nonfungiblePositionManagerAddress;return n&&(e[t]=n),e}),{})),function(e){e[e.EXACT_INPUT=0]="EXACT_INPUT",e[e.EXACT_OUTPUT=1]="EXACT_OUTPUT"}(OB||(OB={})),function(e){e[e.ROUND_DOWN=0]="ROUND_DOWN",e[e.ROUND_HALF_UP=1]="ROUND_HALF_UP",e[e.ROUND_UP=2]="ROUND_UP"}(BB||(BB={})),tn.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const PB={[BB.ROUND_DOWN]:i.ROUND_DOWN,[BB.ROUND_HALF_UP]:i.ROUND_HALF_UP,[BB.ROUND_UP]:i.ROUND_UP},DB={[BB.ROUND_DOWN]:i.ROUND_DOWN,[BB.ROUND_HALF_UP]:i.ROUND_HALF_UP,[BB.ROUND_UP]:i.ROUND_UP};class NB{constructor(e,t=tn.BigInt(1)){this.numerator=tn.BigInt(e),this.denominator=tn.BigInt(t)}static tryParseFraction(e){if(e instanceof tn||"number"==typeof e||"string"==typeof e)return new NB(e);if("numerator"in e&&"denominator"in e)return e;throw new Error("Could not parse fraction")}get quotient(){return tn.divide(this.numerator,this.denominator)}get remainder(){return new NB(tn.remainder(this.numerator,this.denominator),this.denominator)}invert(){return new NB(this.denominator,this.numerator)}add(e){const t=NB.tryParseFraction(e);return tn.equal(this.denominator,t.denominator)?new NB(tn.add(this.numerator,t.numerator),this.denominator):new NB(tn.add(tn.multiply(this.numerator,t.denominator),tn.multiply(t.numerator,this.denominator)),tn.multiply(this.denominator,t.denominator))}subtract(e){const t=NB.tryParseFraction(e);return tn.equal(this.denominator,t.denominator)?new NB(tn.subtract(this.numerator,t.numerator),this.denominator):new NB(tn.subtract(tn.multiply(this.numerator,t.denominator),tn.multiply(t.numerator,this.denominator)),tn.multiply(this.denominator,t.denominator))}lessThan(e){const t=NB.tryParseFraction(e);return tn.lessThan(tn.multiply(this.numerator,t.denominator),tn.multiply(t.numerator,this.denominator))}equalTo(e){const t=NB.tryParseFraction(e);return tn.equal(tn.multiply(this.numerator,t.denominator),tn.multiply(t.numerator,this.denominator))}greaterThan(e){const t=NB.tryParseFraction(e);return tn.greaterThan(tn.multiply(this.numerator,t.denominator),tn.multiply(t.numerator,this.denominator))}multiply(e){const t=NB.tryParseFraction(e);return new NB(tn.multiply(this.numerator,t.numerator),tn.multiply(this.denominator,t.denominator))}divide(e){const t=NB.tryParseFraction(e);return new NB(tn.multiply(this.numerator,t.denominator),tn.multiply(this.denominator,t.numerator))}toSignificant(e,t={decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0},n=BB.ROUND_HALF_UP){nn(Number.isInteger(e),`${e} is not an integer.`),nn(e>0,`${e} is not positive.`);const r=PB[n],o=new i(this.numerator.toString()).div(this.denominator.toString()).precision(e,r);return o.toFormat(o.decimalPlaces(),r,t)}toFixed(e,t={decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0},n=BB.ROUND_HALF_UP){nn(Number.isInteger(e),`${e} is not an integer.`),nn(e>=0,`${e} is negative.`);const r=DB[n];return new i(this.numerator.toString()).decimalPlaces(e,r).div(this.denominator.toString()).toFormat(e,r,t)}get asFraction(){return new NB(this.numerator,this.denominator)}}new NB(tn.BigInt(100));class FB{constructor(e,t,n,r){nn(Number.isSafeInteger(e),"CHAIN_ID"),nn(t>=0&&t<255&&Number.isInteger(t),"DECIMALS"),this.chainId=e,this.decimals=t,this.symbol=n,this.name=r}}const WB=/^0x[0-9a-fA-F]{40}$/;class VB extends FB{constructor(e,t,n,r,i,o,a,s){super(e,n,r,i),this.isNative=!1,this.isToken=!0,this.address=o?function(e){if(WB.test(e))return e;throw new Error(`${e} is not a valid address.`)}(t):function(e){try{return Vr(e)}catch(t){throw new Error(`${e} is not a valid address.`)}}(t),a&&nn(a.gte(ne.from(0)),"NON-NEGATIVE FOT FEES"),s&&nn(s.gte(ne.from(0)),"NON-NEGATIVE FOT FEES"),this.buyFeeBps=a,this.sellFeeBps=s}equals(e){return e.isToken&&this.chainId===e.chainId&&this.address.toLowerCase()===e.address.toLowerCase()}sortsBefore(e){return nn(this.chainId===e.chainId,"CHAIN_IDS"),nn(this.address.toLowerCase()!==e.address.toLowerCase(),"ADDRESSES"),this.address.toLowerCase()<e.address.toLowerCase()}get wrapped(){return this}}tn.BigInt(Number.MAX_SAFE_INTEGER),tn.BigInt(0),tn.BigInt(1),tn.BigInt(2);class UB{constructor(e){const t=ue[e];this.chainId=e,this.decimals=t.decimals,this.name=t.name,this.symbol=t.symbol,this.isNative=!0,this.isToken=!1,this.address=HB(this.chainId)}equals(e){return e.isNative&&e.chainId===this.chainId}get wrapped(){const e=ue[this.chainId];return new VB(this.chainId,e.wrappedTokenAddress,e.decimals,e.wrappedTokenSymbol,e.name)}static onChain(e){var t;return null!==(t=this._cachedNativeCurrency[e])&&void 0!==t?t:this._cachedNativeCurrency[e]=new UB(e)}}function HB(e){return ue[e].address}UB._cachedNativeCurrency={};const qB=(e,t)=>!t||function(e,t){const n=null==e?void 0:e.toLowerCase(),r=null==t?void 0:t.toLowerCase();return null!==n&&null!==r&&n===r}(t,HB(e));function ZB(e){if(!e)return;const{name:t,chainId:n,address:r,decimals:i,symbol:o}=e;return function(e,t){return!qB(e,t)}(n,r)?new VB(n,r,i,null!=o?o:void 0,null!=t?t:void 0):new UB(n)}const zB=({token0:t,token1:n,token0Price:r,tickLower:o,tickUpper:a,title:s,border:l})=>{const d=g(),[c,u]=ct(t),p=c.address===t.address,h=p?n:t,m=ZB(t),y=ZB(n),x=r?p?r:new i(1).div(r).toString():void 0,v=TB(t,n,o),b=TB(t,n,a),A=void 0===o||void 0===a,w=ut((()=>{u(h)}),[h]);return Os.jsxs(JO,{gap:"md",children:[Os.jsxs(_O,{children:[s?Os.jsx(f,{sx:{typography:"body1",fontWeight:600,color:d.palette.text.secondary},children:s}):Os.jsx("div",{}),Os.jsx(ZO,{baseToken:p?m:y,quoteToken:p?y:m,handleRateToggle:w})]}),Os.jsxs(_O,{children:[Os.jsxs(GO,{sx:{width:"48%",py:12,gap:12},border:l,children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:4},children:[Os.jsx(f,{sx:{color:d.palette.text.primary,typography:"body2"},children:Os.jsx(e,{id:"EQs1sJ",message:"Min price"})}),Os.jsx(f,{sx:{color:d.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"7Z4WfS",message:"{0} per {1}",values:{0:h.symbol,1:c.symbol}})})]}),Os.jsx(D,{loading:A,loadingProps:{width:100},sx:{color:d.palette.text.primary,typography:"caption"},children:qO(v,6)}),Os.jsx(f,{sx:{color:d.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"WgTuci",message:"Your position will be 100% composed of {0} at this price",values:{0:null==c?void 0:c.symbol}})})]}),Os.jsxs(GO,{sx:{width:"48%",py:12,gap:12},border:l,children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:4},children:[Os.jsx(f,{sx:{color:d.palette.text.primary,typography:"body2"},children:Os.jsx(e,{id:"5etEUX",message:"Max price"})}),Os.jsx(f,{sx:{color:d.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"7Z4WfS",message:"{0} per {1}",values:{0:h.symbol,1:c.symbol}})})]}),Os.jsx(D,{loading:A,loadingProps:{width:100},sx:{color:d.palette.text.primary,typography:"caption"},children:qO(b,6)}),Os.jsx(f,{sx:{color:d.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"WgTuci",message:"Your position will be 100% composed of {0} at this price",values:{0:null==h?void 0:h.symbol}})})]})]}),Os.jsxs(GO,{sx:{py:12,flexDirection:"row",alignItems:"center",justifyContent:"space-between"},border:l,children:[Os.jsxs(JO,{gap:"4px",justify:"flex-start",children:[Os.jsx(f,{sx:{color:d.palette.text.primary,typography:"body2"},children:Os.jsx(e,{id:"DWd30U",message:"Current price"})}),Os.jsx(f,{sx:{color:d.palette.text.secondary,typography:"h6"},children:Os.jsx(e,{id:"7Z4WfS",message:"{0} per {1}",values:{0:h.symbol,1:c.symbol}})})]}),Os.jsx(D,{loading:!r,loadingProps:{width:100},sx:{color:d.palette.text.primary,typography:"caption"},children:`${An({input:x})} `})]})]})},QB=({token0:e,token1:t,liquidity:n,amount0:r,amount1:i,price:o,tickLower:a,tickUpper:s,title:l,inRange:d})=>{var c,u;const p=!!n&&0===n;return Os.jsxs(JO,{gap:"md",style:{marginTop:"0.5rem"},children:[Os.jsxs(_O,{style:{gap:4},children:[Os.jsxs($O,{children:[Os.jsx(Cj,{chainId:null==e?void 0:e.chainId,tokens:e&&t?[{address:e.address},{address:t.address}]:[],mr:8}),Os.jsxs(f,{sx:{typography:"h5"},children:[null==e?void 0:e.symbol," / ",null==t?void 0:t.symbol]})]}),Os.jsx(HO,{removed:p,inRange:d})]}),Os.jsx(GO,{children:Os.jsxs(JO,{gap:"md",children:[Os.jsxs(_O,{children:[Os.jsxs($O,{children:[Os.jsx(ey,{address:null!==(c=null==e?void 0:e.address)&&void 0!==c?c:"",chainId:null==e?void 0:e.chainId,noShowChain:!0,width:32,height:32,marginRight:0}),Os.jsx(f,{sx:{ml:8},children:null==e?void 0:e.symbol})]}),Os.jsx($O,{children:Os.jsx(f,{sx:{mr:8},children:An({input:r,decimals:null==e?void 0:e.decimals})})})]}),Os.jsxs(_O,{children:[Os.jsxs($O,{children:[Os.jsx(ey,{address:null!==(u=null==t?void 0:t.address)&&void 0!==u?u:"",chainId:null==t?void 0:t.chainId,noShowChain:!0,width:32,height:32,marginRight:0}),Os.jsx(f,{ml:"8px",children:null==t?void 0:t.symbol})]}),Os.jsx($O,{children:Os.jsx(f,{mr:"8px",children:An({input:i,decimals:null==t?void 0:t.decimals})})})]})]})}),!!e&&!!t&&!!o&&void 0!==a&&void 0!==s&&Os.jsx(zB,{title:l,token0:e,token1:t,token0Price:o,tickLower:a,tickUpper:s})]})},GB=({on:e,onClose:t,onConfirm:n,loading:i,token0:o,token1:a,liquidity:s,amount0:l,amount1:d,price:c,tickLower:u,tickUpper:p,title:h,inRange:m})=>{const{isMobile:g}=wy();return Os.jsx(yy,{open:e,onClose:t,modal:!0,title:null!=h?h:r._({id:"E6MqGy",message:"Add liquidity"}),height:683,children:Os.jsxs(f,{sx:{flex:1,px:20,pb:24,display:"flex",flexDirection:"column",justifyContent:"space-between",width:g?void 0:420},children:[Os.jsx(f,{sx:{pt:0,px:0},children:Os.jsx(QB,{token0:o,token1:a,price:c,tickLower:u,tickUpper:p,liquidity:s,amount0:l,amount1:d,inRange:m,title:r._({id:"3VUfrF",message:"Selected Range"})})}),Os.jsx(T,{size:T.Size.big,fullWidth:!0,isLoading:i,sx:{mt:20},onClick:n,children:r._({id:"7VpPHA",message:"Confirm"})})]})})};class YB{constructor(){}static mulDivRoundingUp(e,t,n){const r=tn.multiply(e,t);let i=tn.divide(r,n);return tn.notEqual(tn.remainder(r,n),nB)&&(i=tn.add(i,rB)),i}}const XB=tn.subtract(tn.exponentiate(tn.BigInt(2),tn.BigInt(160)),rB);function JB(e,t){const n=tn.multiply(e,t);return tn.bitwiseAnd(n,tB)}class KB{constructor(){}static getAmount0Delta(e,t,n,r){tn.greaterThan(e,t)&&([e,t]=[t,e]);const i=tn.leftShift(n,tn.BigInt(96)),o=tn.subtract(t,e);return r?YB.mulDivRoundingUp(YB.mulDivRoundingUp(i,o,t),rB,e):tn.divide(tn.divide(tn.multiply(i,o),t),e)}static getAmount1Delta(e,t,n,r){return tn.greaterThan(e,t)&&([e,t]=[t,e]),r?YB.mulDivRoundingUp(n,tn.subtract(t,e),iB):tn.divide(tn.multiply(n,tn.subtract(t,e)),iB)}static getNextSqrtPriceFromInput(e,t,n,r){return nn(tn.greaterThan(e,nB)),nn(tn.greaterThan(t,nB)),r?this.getNextSqrtPriceFromAmount0RoundingUp(e,t,n,!0):this.getNextSqrtPriceFromAmount1RoundingDown(e,t,n,!0)}static getNextSqrtPriceFromOutput(e,t,n,r){return nn(tn.greaterThan(e,nB)),nn(tn.greaterThan(t,nB)),r?this.getNextSqrtPriceFromAmount1RoundingDown(e,t,n,!1):this.getNextSqrtPriceFromAmount0RoundingUp(e,t,n,!1)}static getNextSqrtPriceFromAmount0RoundingUp(e,t,n,r){if(tn.equal(n,nB))return e;const i=tn.leftShift(t,tn.BigInt(96));if(r){const t=JB(n,e);if(tn.equal(tn.divide(t,n),e)){const n=function(e,t){const n=tn.add(e,t);return tn.bitwiseAnd(n,tB)}(i,t);if(tn.greaterThanOrEqual(n,i))return YB.mulDivRoundingUp(i,e,n)}return YB.mulDivRoundingUp(i,rB,tn.add(tn.divide(i,e),n))}{const t=JB(n,e);nn(tn.equal(tn.divide(t,n),e)),nn(tn.greaterThan(i,t));const r=tn.subtract(i,t);return YB.mulDivRoundingUp(i,e,r)}}static getNextSqrtPriceFromAmount1RoundingDown(e,t,n,r){if(r){const r=tn.lessThanOrEqual(n,XB)?tn.divide(tn.leftShift(n,tn.BigInt(96)),t):tn.divide(tn.multiply(n,iB),t);return tn.add(e,r)}{const r=YB.mulDivRoundingUp(n,iB,t);return nn(tn.greaterThan(e,r)),tn.subtract(e,r)}}}function _B(e,t,n){tn.greaterThan(e,t)&&([e,t]=[t,e]);const r=tn.divide(tn.multiply(e,t),iB);return tn.divide(tn.multiply(tn.BigInt(n),r),tn.subtract(t,e))}function $B(e,t,n){tn.greaterThan(e,t)&&([e,t]=[t,e]);const r=tn.multiply(tn.multiply(tn.BigInt(n),e),t),i=tn.multiply(iB,tn.subtract(t,e));return tn.divide(r,i)}function eP(e,t,n){return tn.greaterThan(e,t)&&([e,t]=[t,e]),tn.divide(tn.multiply(tn.BigInt(n),iB),tn.subtract(t,e))}function tP({sqrtRatioX96:e,tickLower:t,tickUpper:n,amount0:r,amount1:i,useFullPrecision:o}){return function(e,t,n,r,i,o){tn.greaterThan(t,n)&&([t,n]=[n,t]);const a=o?$B:_B;if(tn.lessThanOrEqual(e,t))return a(t,n,r);if(tn.lessThan(e,n)){const o=a(e,n,r),s=eP(t,e,i);return tn.lessThan(o,s)?o:s}return eP(t,n,i)}(e,cB.getSqrtRatioAtTick(t),cB.getSqrtRatioAtTick(n),r,i,o)}function nP({tickCurrent:e,tickLower:t,tickUpper:n,liquidity:r,roundUp:i}){const o=tn.BigInt(r.toString());if(e<t){return KB.getAmount0Delta(cB.getSqrtRatioAtTick(t),cB.getSqrtRatioAtTick(n),o,!!i)}if(e<n){const t=cB.getSqrtRatioAtTick(e);return KB.getAmount0Delta(t,cB.getSqrtRatioAtTick(n),o,!!i)}return nB}function rP({tickCurrent:e,tickLower:t,tickUpper:n,liquidity:r,roundUp:i}){const o=tn.BigInt(r.toString());if(e<t)return nB;if(e<n){const n=cB.getSqrtRatioAtTick(e);return KB.getAmount1Delta(cB.getSqrtRatioAtTick(t),n,o,!!i)}return KB.getAmount1Delta(cB.getSqrtRatioAtTick(t),cB.getSqrtRatioAtTick(n),o,!!i)}function iP({baseToken:e,quoteToken:t,sqrtRatioX96:n,tickCurrent:r,tickLower:i,tickUpper:o}){const[a,s]=at.useState(""),[l,d]=at.useState(""),c=!(!e||!t)&&ms(e,t),u=!e||!t||void 0===n||void 0===r||void 0===i||void 0===o,p=(a,s)=>{if(u)throw new Error("parma is undefined");const l=s?c:!c,d=c?e.decimals:t.decimals,p=c?t.decimals:e.decimals;if(l){const e=function({sqrtRatioX96:e,tickCurrent:t,tickLower:n,tickUpper:r,amount0:i,useFullPrecision:o}){const a=tP({sqrtRatioX96:e,tickLower:n,tickUpper:r,amount0:i,amount1:tB,useFullPrecision:o});return{amount0:nP({tickCurrent:t,tickLower:n,tickUpper:r,liquidity:a}),amount1:rP({tickCurrent:t,tickLower:n,tickUpper:r,liquidity:a})}}({sqrtRatioX96:n,tickCurrent:r,tickLower:i,tickUpper:o,amount0:rt(a,d).toString(),useFullPrecision:!0});return{amount0:Tn(e.amount0.toString(),d),amount1:Tn(e.amount1.toString(),p)}}{const e=function({sqrtRatioX96:e,tickCurrent:t,tickLower:n,tickUpper:r,amount1:i}){const o=tP({sqrtRatioX96:e,tickLower:n,tickUpper:r,amount0:tB,amount1:i,useFullPrecision:!0});return{amount0:nP({tickCurrent:t,tickLower:n,tickUpper:r,liquidity:o}),amount1:rP({tickCurrent:t,tickLower:n,tickUpper:r,liquidity:o})}}({sqrtRatioX96:n,tickCurrent:r,tickLower:i,tickUpper:o,amount1:rt(a,p).toString()});return{amount0:Tn(e.amount0.toString(),d),amount1:Tn(e.amount1.toString(),p)}}};return{readonly:u,baseAmount:a,quoteAmount:l,handleChangeBaseAmount:e=>{if(s(e),Number(e)){const t=p(e,!0);d(String(c?t.amount1:t.amount0))}},handleChangeQuoteAmount:e=>{if(d(e),Number(e)){const t=p(e,!1);s(String(c?t.amount0:t.amount1))}},handleBlurBaseAmount:e=>{if(Number(e)){const t=p(e,!0);s(String(c?t.amount0:t.amount1))}},handleBlurQuoteAmount:e=>{if(Number(e)){const t=p(e,!1);d(String(c?t.amount1:t.amount0))}},reset:()=>{s(""),d("")}}}function oP(e){let t=tn.BigInt(e).toString(16);return t.length%2!=0&&(t=`0${t}`),`0x${t}`}function aP(){const e=Hy();return Ot({mutationFn:t=>Fn(this,[t],void 0,(function*({createPool:t,recipient:n,deployer:i,pool:o,tokenId:a,amount0:s,amount1:l,tickLower:d,tickUpper:c,amount0Min:u,amount1Min:p,successBack:h}){if(!(null==o?void 0:o.token0Wrapped)||!o.token1Wrapped)return;const m=[],f=null!=i?i:Jv,g=Math.ceil(Date.now()/1e3)+600,y=t?r._({id:"8OiU8L",message:"Pool Creation"}):r._({id:"OBdohg",message:"Add Liquidity"});try{if(n&&t){if(!o.currentSqrt)throw new Error("currentSqrt is undefined");m.push(Ue(o.token0Wrapped.address,o.token1Wrapped.address,f,o.currentSqrt,"0x"))}if(n)m.push(He({token0:o.token0Wrapped.address,token1:o.token1Wrapped.address,deployer:f,tickLower:d,tickUpper:c,amount0Desired:oP(s),amount1Desired:oP(l),amount0Min:u,amount1Min:p,recipient:n,deadline:g}));else{if(!a)throw new Error("tokenId is undefined");m.push(qe({tokenId:oP(a),amount0Desired:oP(s),amount1Desired:oP(l),amount0Min:u,amount1Min:p,deadline:g}))}let r=oP(0);if(o.isBaseTokenNative||o.isQuoteTokenNative){let e=s;(o.isRearTokenA?o.isBaseTokenNative:o.isQuoteTokenNative)&&(e=l),Number(e)>0&&m.push(Ze()),r=oP(e)}return e.execute(y,{opcode:By.TX,to:ze(o.chainId),value:r,data:Qe(m)},{early:!1,metadata:{[t?Ey.createAlgebraPool:Ey.addAlgebraPool]:"1"},successBack:h})}catch(e){console.error(e),mv.getState().toast({message:`${y} error: ${e}`,type:"error"})}}))})}function sP({baseToken:e,quoteToken:t,startPriceTypedValue:n}){var r,i;const o=function({baseToken:e,quoteToken:t}){return at.useMemo((()=>{var n,r;let i=!1,o=!1,a=!1;if(!e||!t)return{chainId:void 0,isRearTokenA:!1,token0:void 0,token1:void 0,token0Wrapped:void 0,token1Wrapped:void 0,isBaseTokenNative:o,isQuoteTokenNative:a};const s=e.chainId,l=ue[s];o=(null===(n=l.address)||void 0===n?void 0:n.toLowerCase())===e.address.toLowerCase(),a=(null===(r=l.address)||void 0===r?void 0:r.toLowerCase())===t.address.toLowerCase();const d=o?Object.assign(Object.assign({},e),{address:l.wrappedTokenAddress,symbol:l.wrappedTokenSymbol}):e,c=a?Object.assign(Object.assign({},t),{address:l.wrappedTokenAddress,symbol:l.wrappedTokenSymbol}):t;i=!ms(d,c);const[u,p,h,m]=i?[t,e,c,d]:[e,t,d,c];return{chainId:s,isRearTokenA:i,token0:u,token1:p,token0Wrapped:h,token1Wrapped:m,isBaseTokenNative:o,isQuoteTokenNative:a}}),[e,t])}({baseToken:e,quoteToken:t});let a;o.token0&&o.token1&&o.token0Wrapped.address!==o.token1Wrapped.address&&(a=function({tokenA:e,tokenB:t,poolDeployer:n,initCodeHashManualOverride:r}){const[i,o]=ms(e,t)?[e,t]:[t,e];return Hr(n,Ua(["bytes"],[tt.encode(["address","address"],[i.address,o.address])]),r)}({tokenA:o.token0Wrapped,tokenB:o.token1Wrapped,poolDeployer:null!==(r=ss[o.chainId])&&void 0!==r?r:"",initCodeHashManualOverride:null!==(i=ls[o.chainId])&&void 0!==i?i:""}));const s=It(Ge(o.chainId,a)),l=It(Ye(o.chainId,a)),d=It(Xe(o.chainId,a)),c=!!s.data||!!l.data||void 0!==d.data;let u,p,h;const m=s.data?Number(s.data):60;if(l.data)u=Number(l.data.tick),p=cB.getSqrtRatioAtTick(u).toString(),h=l.data&&o.token0Wrapped&&o.token1Wrapped?jB(o.token0Wrapped,o.token1Wrapped,l.data.tick):void 0;else if(t&&e&&Number(n)){const r=jn(n,t.decimals).toString(),i=jn(1,e.decimals).toString();h=new kB(e,t,i,r),o.isRearTokenA&&(h=h.invert()),u=CB(h),p=cB.getSqrtRatioAtTick(u).toString()}return Object.assign({isExists:c,address:a,fetchTickSpacing:s,fetchGlobalState:l,fetchLiquidity:d,currentTick:u,currentSqrt:p,price:h,reversePrice:undefined,tickSpacing:m},o)}const lP=1e4,dP=100*lP;function cP(e){const t=Math.floor(Number(e)*lP);return new wB(t,dP)}function uP(e,t){const n=ms(e.baseCurrency,e.quoteCurrency)?e:e.invert(),r=n.asFraction.multiply(new wB(1).subtract(t)),i=n.asFraction.multiply(t.add(1));let o=fB(r.numerator,r.denominator);tn.lessThanOrEqual(o,cB.MIN_SQRT_RATIO)&&(o=tn.add(cB.MIN_SQRT_RATIO,tn.BigInt(1)));let a=fB(i.numerator,i.denominator);return tn.greaterThanOrEqual(a,cB.MAX_SQRT_RATIO)&&(a=tn.subtract(cB.MAX_SQRT_RATIO,tn.BigInt(1))),{sqrtRatioX96Lower:o,sqrtRatioX96Upper:a}}function pP(e,t,n,r,i,o,a,s){const l=cB.getSqrtRatioAtTick(Number(e)),d=jB(i,o,e),{sqrtRatioX96Upper:c,sqrtRatioX96Lower:u}=uP(d,t),p=tP({sqrtRatioX96:l,tickLower:n,tickUpper:r,amount0:a,amount1:s,useFullPrecision:!1});return{amount0:nP({tickCurrent:cB.getTickAtSqrtRatio(c),tickLower:n,tickUpper:r,liquidity:p,roundUp:!0}),amount1:rP({tickCurrent:cB.getTickAtSqrtRatio(u),tickLower:n,tickUpper:r,liquidity:p,roundUp:!0})}}var hP,mP;!function(e){e.CURRENCY_A="CURRENCY_A",e.CURRENCY_B="CURRENCY_B"}(hP||(hP={})),function(e){e.LOWER="LOWER",e.UPPER="UPPER"}(mP||(mP={}));const fP=({value:t,decrement:n,increment:r,decrementDisabled:i=!1,incrementDisabled:o=!1,locked:a,onUserInput:s,title:l,tokenA:d,tokenB:c,border:u})=>{const p=g(),[h,m]=ct(!1),[y,x]=ct(""),[v,b]=ct(!1),[A,w]=ct(!1),k=ut((()=>{b(!1),m(!1),s(y)}),[y,s]),C=ut((()=>{b(!1),s(n())}),[n,s]),j=ut((()=>{b(!1),s(r())}),[r,s]);return st((()=>{y===t||v||setTimeout((()=>{x(t),w(!0),setTimeout((function(){w(!1)}),1800)}),0)}),[y,v,t]),Os.jsx(f,{onFocus:()=>{b(!0),m(!0)},onBlur:k,sx:Object.assign({width:"100%",py:12,px:20,borderRadius:16,backgroundColor:p.palette.background.input},u&&{borderWidth:3,borderColor:"text.primary"}),children:Os.jsxs(f,{sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",flex:1},children:[Os.jsx(f,{sx:{typography:"body2",fontWeight:600,color:p.palette.text.primary},children:l}),Os.jsx(f,{sx:{mt:4,typography:"h6",fontWeight:500,color:p.palette.text.secondary},children:Os.jsx(e,{id:"1/LP4K",message:"{tokenB} per {tokenA}",values:{tokenB:c,tokenA:d}})}),Os.jsx(hy,{sx:{mt:12},value:y,onChange:e=>{x(e)},readOnly:a})]}),Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:8},children:[!a&&Os.jsx(T,{size:T.Size.small,onClick:j,disabled:o,sx:{px:4,backgroundColor:p.palette.background.paper,"&[disabled]":{cursor:"default"}},children:Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("path",{d:"M14.25 9.75H9.75V14.25H8.25V9.75H3.75V8.25H8.25V3.75H9.75V8.25H14.25V9.75Z",fill:i?p.palette.text.disabled:p.palette.text.primary})})}),!a&&Os.jsx(T,{size:T.Size.small,onClick:C,disabled:i,sx:{px:4,backgroundColor:p.palette.background.paper,"&[disabled]":{cursor:"default"}},children:Os.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Os.jsx("rect",{x:"3.75",y:"8.25",width:"10.5",height:"1.5",fill:i?p.palette.text.disabled:p.palette.text.primary})})})]})]})})},gP=({priceLower:t,priceUpper:n,onLeftRangeInput:r,onRightRangeInput:i,getDecrementLower:o,getIncrementLower:a,getDecrementUpper:s,getIncrementUpper:l,tokenA:d,tokenB:c,ticksAtLimit:u,isSorted:p,border:h})=>{var m,g;const y=p?t:null==n?void 0:n.invert(),x=p?n:null==t?void 0:t.invert();return Os.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:8},children:[Os.jsx(fP,{value:u[p?mP.LOWER:mP.UPPER]?"0":null!==(m=null==y?void 0:y.toSignificant(8))&&void 0!==m?m:"",onUserInput:r,decrement:p?o:l,increment:p?a:s,decrementDisabled:void 0===y||u[p?mP.LOWER:mP.UPPER],incrementDisabled:void 0===y||u[p?mP.LOWER:mP.UPPER],label:y?`${null==c?void 0:c.symbol}`:"-",title:Os.jsx(e,{id:"uEoBVI",message:"Low price"}),tokenA:null==d?void 0:d.symbol,tokenB:null==c?void 0:c.symbol,border:h}),Os.jsx(fP,{value:u[p?mP.UPPER:mP.LOWER]?"∞":null!==(g=null==x?void 0:x.toSignificant(8))&&void 0!==g?g:"",onUserInput:i,decrement:p?s:a,increment:p?l:o,incrementDisabled:void 0===x||u[p?mP.UPPER:mP.LOWER],decrementDisabled:void 0===x||u[p?mP.UPPER:mP.LOWER],label:x?`${null==c?void 0:c.symbol}`:"-",tokenA:null==d?void 0:d.symbol,tokenB:null==c?void 0:c.symbol,title:Os.jsx(e,{id:"kAC8rT",message:"High price"}),border:h})]})};function yP(e,t){nn(Number.isInteger(e)&&Number.isInteger(t),"INTEGERS"),nn(t>0,"TICK_SPACING"),nn(e>=cB.MIN_TICK&&e<=cB.MAX_TICK,"TICK_BOUND");const n=Math.round(e/t)*t;return n<cB.MIN_TICK?n+t:n>cB.MAX_TICK?n-t:n}function xP(e,t,n,r){if(!e||!t||!n||void 0===r)return;const i=function(e,t,n){var r;if(!e||!t||!n)return;if(!n.match(/^\d*\.?\d+$/))return;const[i,o]=n.split("."),a=null!==(r=null==o?void 0:o.length)&&void 0!==r?r:0,s=tn.BigInt((null!=i?i:"")+(null!=o?o:""));return new kB(e,t,tn.multiply(tn.BigInt(10**a),tn.BigInt(10**e.decimals)),tn.multiply(s,tn.BigInt(10**t.decimals)))}(e,t,n);if(!i)return;let o;const a=fB(i.numerator,i.denominator);return o=tn.greaterThanOrEqual(a,cB.MAX_SQRT_RATIO)?cB.MAX_TICK:tn.lessThanOrEqual(a,cB.MIN_SQRT_RATIO)?cB.MIN_TICK:CB(i),yP(o,r)}var vP,bP={exports:{}},AP={};var wP,kP={};
32
32
  /**
33
33
  * @license React
34
34
  * use-sync-external-store-shim.development.js