@raydium-io/raydium-sdk-v2
Version:
An SDK for building applications on top of Raydium.
1 lines • 71.2 kB
JavaScript
var Hn=Object.create;var Fe=Object.defineProperty,zn=Object.defineProperties,Zn=Object.getOwnPropertyDescriptor,Yn=Object.getOwnPropertyDescriptors,jn=Object.getOwnPropertyNames,Ut=Object.getOwnPropertySymbols,Qn=Object.getPrototypeOf,Ht=Object.prototype.hasOwnProperty,Jn=Object.prototype.propertyIsEnumerable;var Xt=(e,t,n)=>t in e?Fe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,q=(e,t)=>{for(var n in t||(t={}))Ht.call(t,n)&&Xt(e,n,t[n]);if(Ut)for(var n of Ut(t))Jn.call(t,n)&&Xt(e,n,t[n]);return e},U=(e,t)=>zn(e,Yn(t));var $n=(e,t)=>{for(var n in t)Fe(e,n,{get:t[n],enumerable:!0})},zt=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of jn(t))!Ht.call(e,o)&&o!==n&&Fe(e,o,{get:()=>t[o],enumerable:!(i=Zn(t,o))||i.enumerable});return e};var G=(e,t,n)=>(n=e!=null?Hn(Qn(e)):{},zt(t||!e||!e.__esModule?Fe(n,"default",{value:e,enumerable:!0}):n,e)),ei=e=>zt(Fe({},"__esModule",{value:!0}),e);var go={};$n(go,{anchorDataBuf:()=>H,buyExactInInstruction:()=>no,buyExactOutInstruction:()=>io,claimCreatorFee:()=>fo,claimPlatformFee:()=>uo,claimPlatformFeeFromVault:()=>mo,claimVestedToken:()=>so,createPlatformConfig:()=>co,createPlatformVestingAccountIns:()=>yo,createVestingAccount:()=>ao,initialize:()=>$r,initializeV2:()=>eo,initializeWithToken2022:()=>to,removePlatformCurveParamInstruction:()=>bo,sellExactInInstruction:()=>ro,sellExactOut:()=>oo,updatePlatformConfig:()=>lo,updatePlatformCurveParamInstruction:()=>po});module.exports=ei(go);var ni=require("@solana/web3.js");var Oe=require("lodash");var pt=class{constructor(t){this.logLevel=t.logLevel!==void 0?t.logLevel:0,this.name=t.name}set level(t){this.logLevel=t}get time(){return Date.now().toString()}get moduleName(){return this.name}isLogLevel(t){return t<=this.logLevel}error(...t){return this.isLogLevel(0)?(console.error(this.time,this.name,"sdk logger error",...t),this):this}logWithError(...t){let n=t.map(i=>typeof i=="object"?JSON.stringify(i):i).join(", ");throw new Error(n)}warning(...t){return this.isLogLevel(1)?(console.warn(this.time,this.name,"sdk logger warning",...t),this):this}info(...t){return this.isLogLevel(2)?(console.info(this.time,this.name,"sdk logger info",...t),this):this}debug(...t){return this.isLogLevel(3)?(console.debug(this.time,this.name,"sdk logger debug",...t),this):this}},Zt={},ti={};function Q(e){let t=(0,Oe.get)(Zt,e);if(!t){let n=(0,Oe.get)(ti,e);t=new pt({name:e,logLevel:n}),(0,Oe.set)(Zt,e,t)}return t}var He=require("@solana/spl-token"),xo=Q("Raydium_accountInfo_util");var de=G(require("bn.js"));var Ie=9e15,ke=1e9,bt="0123456789abcdef",je="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Qe="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",yt={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Ie,maxE:Ie,crypto:!1},$t,pe,S=!0,$e="[DecimalError] ",we=$e+"Invalid argument: ",en=$e+"Precision limit exceeded",tn=$e+"crypto unavailable",nn="[object Decimal]",j=Math.floor,X=Math.pow,ii=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,ri=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,oi=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,rn=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ae=1e7,B=7,si=9007199254740991,ai=je.length-1,gt=Qe.length-1,p={toStringTag:nn};p.absoluteValue=p.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),k(e)};p.ceil=function(){return k(new this.constructor(this),this.e+1,2)};p.clampedTo=p.clamp=function(e,t){var n,i=this,o=i.constructor;if(e=new o(e),t=new o(t),!e.s||!t.s)return new o(NaN);if(e.gt(t))throw Error(we+t);return n=i.cmp(e),n<0?e:i.cmp(t)>0?t:new o(i)};p.comparedTo=p.cmp=function(e){var t,n,i,o,r=this,s=r.d,a=(e=new r.constructor(e)).d,c=r.s,u=e.s;if(!s||!a)return!c||!u?NaN:c!==u?c:s===a?0:!s^c<0?1:-1;if(!s[0]||!a[0])return s[0]?c:a[0]?-u:0;if(c!==u)return c;if(r.e!==e.e)return r.e>e.e^c<0?1:-1;for(i=s.length,o=a.length,t=0,n=i<o?i:o;t<n;++t)if(s[t]!==a[t])return s[t]>a[t]^c<0?1:-1;return i===o?0:i>o^c<0?1:-1};p.cosine=p.cos=function(){var e,t,n=this,i=n.constructor;return n.d?n.d[0]?(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+B,i.rounding=1,n=ui(i,cn(i,n)),i.precision=e,i.rounding=t,k(pe==2||pe==3?n.neg():n,e,t,!0)):new i(1):new i(NaN)};p.cubeRoot=p.cbrt=function(){var e,t,n,i,o,r,s,a,c,u,l=this,m=l.constructor;if(!l.isFinite()||l.isZero())return new m(l);for(S=!1,r=l.s*X(l.s*l,1/3),!r||Math.abs(r)==1/0?(n=z(l.d),e=l.e,(r=(e-n.length+1)%3)&&(n+=r==1||r==-2?"0":"00"),r=X(n,1/3),e=j((e+1)/3)-(e%3==(e<0?-1:2)),r==1/0?n="5e"+e:(n=r.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),i=new m(n),i.s=l.s):i=new m(r.toString()),s=(e=m.precision)+3;;)if(a=i,c=a.times(a).times(a),u=c.plus(l),i=E(u.plus(l).times(a),u.plus(c),s+2,1),z(a.d).slice(0,s)===(n=z(i.d)).slice(0,s))if(n=n.slice(s-3,s+1),n=="9999"||!o&&n=="4999"){if(!o&&(k(a,e+1,0),a.times(a).times(a).eq(l))){i=a;break}s+=4,o=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(k(i,e+1,1),t=!i.times(i).times(i).eq(l));break}return S=!0,k(i,e,m.rounding,t)};p.decimalPlaces=p.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-j(this.e/B))*B,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n};p.dividedBy=p.div=function(e){return E(this,new this.constructor(e))};p.dividedToIntegerBy=p.divToInt=function(e){var t=this,n=t.constructor;return k(E(t,new n(e),0,1,1),n.precision,n.rounding)};p.equals=p.eq=function(e){return this.cmp(e)===0};p.floor=function(){return k(new this.constructor(this),this.e+1,3)};p.greaterThan=p.gt=function(e){return this.cmp(e)>0};p.greaterThanOrEqualTo=p.gte=function(e){var t=this.cmp(e);return t==1||t===0};p.hyperbolicCosine=p.cosh=function(){var e,t,n,i,o,r=this,s=r.constructor,a=new s(1);if(!r.isFinite())return new s(r.s?1/0:NaN);if(r.isZero())return a;n=s.precision,i=s.rounding,s.precision=n+Math.max(r.e,r.sd())+4,s.rounding=1,o=r.d.length,o<32?(e=Math.ceil(o/3),t=(1/tt(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),r=Se(s,1,r.times(t),new s(1),!0);for(var c,u=e,l=new s(8);u--;)c=r.times(r),r=a.minus(c.times(l.minus(c.times(l))));return k(r,s.precision=n,s.rounding=i,!0)};p.hyperbolicSine=p.sinh=function(){var e,t,n,i,o=this,r=o.constructor;if(!o.isFinite()||o.isZero())return new r(o);if(t=r.precision,n=r.rounding,r.precision=t+Math.max(o.e,o.sd())+4,r.rounding=1,i=o.d.length,i<3)o=Se(r,2,o,o,!0);else{e=1.4*Math.sqrt(i),e=e>16?16:e|0,o=o.times(1/tt(5,e)),o=Se(r,2,o,o,!0);for(var s,a=new r(5),c=new r(16),u=new r(20);e--;)s=o.times(o),o=o.times(a.plus(s.times(c.times(s).plus(u))))}return r.precision=t,r.rounding=n,k(o,t,n,!0)};p.hyperbolicTangent=p.tanh=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+7,i.rounding=1,E(n.sinh(),n.cosh(),i.precision=e,i.rounding=t)):new i(n.s)};p.inverseCosine=p.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),i=t.precision,o=t.rounding;return n!==-1?n===0?e.isNeg()?ce(t,i,o):new t(0):new t(NaN):e.isZero()?ce(t,i+4,o).times(.5):(t.precision=i+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=i,t.rounding=o,e.times(2))};p.inverseHyperbolicCosine=p.acosh=function(){var e,t,n=this,i=n.constructor;return n.lte(1)?new i(n.eq(1)?0:NaN):n.isFinite()?(e=i.precision,t=i.rounding,i.precision=e+Math.max(Math.abs(n.e),n.sd())+4,i.rounding=1,S=!1,n=n.times(n).minus(1).sqrt().plus(n),S=!0,i.precision=e,i.rounding=t,n.ln()):new i(n)};p.inverseHyperbolicSine=p.asinh=function(){var e,t,n=this,i=n.constructor;return!n.isFinite()||n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,i.rounding=1,S=!1,n=n.times(n).plus(1).sqrt().plus(n),S=!0,i.precision=e,i.rounding=t,n.ln())};p.inverseHyperbolicTangent=p.atanh=function(){var e,t,n,i,o=this,r=o.constructor;return o.isFinite()?o.e>=0?new r(o.abs().eq(1)?o.s/0:o.isZero()?o:NaN):(e=r.precision,t=r.rounding,i=o.sd(),Math.max(i,e)<2*-o.e-1?k(new r(o),e,t,!0):(r.precision=n=i-o.e,o=E(o.plus(1),new r(1).minus(o),n+e,1),r.precision=e+4,r.rounding=1,o=o.ln(),r.precision=e,r.rounding=t,o.times(.5))):new r(NaN)};p.inverseSine=p.asin=function(){var e,t,n,i,o=this,r=o.constructor;return o.isZero()?new r(o):(t=o.abs().cmp(1),n=r.precision,i=r.rounding,t!==-1?t===0?(e=ce(r,n+4,i).times(.5),e.s=o.s,e):new r(NaN):(r.precision=n+6,r.rounding=1,o=o.div(new r(1).minus(o.times(o)).sqrt().plus(1)).atan(),r.precision=n,r.rounding=i,o.times(2)))};p.inverseTangent=p.atan=function(){var e,t,n,i,o,r,s,a,c,u=this,l=u.constructor,m=l.precision,f=l.rounding;if(u.isFinite()){if(u.isZero())return new l(u);if(u.abs().eq(1)&&m+4<=gt)return s=ce(l,m+4,f).times(.25),s.s=u.s,s}else{if(!u.s)return new l(NaN);if(m+4<=gt)return s=ce(l,m+4,f).times(.5),s.s=u.s,s}for(l.precision=a=m+10,l.rounding=1,n=Math.min(28,a/B+2|0),e=n;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(S=!1,t=Math.ceil(a/B),i=1,c=u.times(u),s=new l(u),o=u;e!==-1;)if(o=o.times(c),r=s.minus(o.div(i+=2)),o=o.times(c),s=r.plus(o.div(i+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===r.d[e]&&e--;);return n&&(s=s.times(2<<n-1)),S=!0,k(s,l.precision=m,l.rounding=f,!0)};p.isFinite=function(){return!!this.d};p.isInteger=p.isInt=function(){return!!this.d&&j(this.e/B)>this.d.length-2};p.isNaN=function(){return!this.s};p.isNegative=p.isNeg=function(){return this.s<0};p.isPositive=p.isPos=function(){return this.s>0};p.isZero=function(){return!!this.d&&this.d[0]===0};p.lessThan=p.lt=function(e){return this.cmp(e)<0};p.lessThanOrEqualTo=p.lte=function(e){return this.cmp(e)<1};p.logarithm=p.log=function(e){var t,n,i,o,r,s,a,c,u=this,l=u.constructor,m=l.precision,f=l.rounding,b=5;if(e==null)e=new l(10),t=!0;else{if(e=new l(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(n=u.d,u.s<0||!n||!n[0]||u.eq(1))return new l(n&&!n[0]?-1/0:u.s!=1?NaN:n?0:1/0);if(t)if(n.length>1)r=!0;else{for(o=n[0];o%10===0;)o/=10;r=o!==1}if(S=!1,a=m+b,s=Pe(u,a),i=t?Je(l,a+10):Pe(e,a),c=E(s,i,a,1),We(c.d,o=m,f))do if(a+=10,s=Pe(u,a),i=t?Je(l,a+10):Pe(e,a),c=E(s,i,a,1),!r){+z(c.d).slice(o+1,o+15)+1==1e14&&(c=k(c,m+1,0));break}while(We(c.d,o+=10,f));return S=!0,k(c,m,f)};p.minus=p.sub=function(e){var t,n,i,o,r,s,a,c,u,l,m,f,b=this,h=b.constructor;if(e=new h(e),!b.d||!e.d)return!b.s||!e.s?e=new h(NaN):b.d?e.s=-e.s:e=new h(e.d||b.s!==e.s?b:NaN),e;if(b.s!=e.s)return e.s=-e.s,b.plus(e);if(u=b.d,f=e.d,a=h.precision,c=h.rounding,!u[0]||!f[0]){if(f[0])e.s=-e.s;else if(u[0])e=new h(b);else return new h(c===3?-0:0);return S?k(e,a,c):e}if(n=j(e.e/B),l=j(b.e/B),u=u.slice(),r=l-n,r){for(m=r<0,m?(t=u,r=-r,s=f.length):(t=f,n=l,s=u.length),i=Math.max(Math.ceil(a/B),s)+2,r>i&&(r=i,t.length=1),t.reverse(),i=r;i--;)t.push(0);t.reverse()}else{for(i=u.length,s=f.length,m=i<s,m&&(s=i),i=0;i<s;i++)if(u[i]!=f[i]){m=u[i]<f[i];break}r=0}for(m&&(t=u,u=f,f=t,e.s=-e.s),s=u.length,i=f.length-s;i>0;--i)u[s++]=0;for(i=f.length;i>r;){if(u[--i]<f[i]){for(o=i;o&&u[--o]===0;)u[o]=ae-1;--u[o],u[i]+=ae}u[i]-=f[i]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--n;return u[0]?(e.d=u,e.e=et(u,n),S?k(e,a,c):e):new h(c===3?-0:0)};p.modulo=p.mod=function(e){var t,n=this,i=n.constructor;return e=new i(e),!n.d||!e.s||e.d&&!e.d[0]?new i(NaN):!e.d||n.d&&!n.d[0]?k(new i(n),i.precision,i.rounding):(S=!1,i.modulo==9?(t=E(n,e.abs(),0,3,1),t.s*=e.s):t=E(n,e,0,i.modulo,1),t=t.times(e),S=!0,n.minus(t))};p.naturalExponential=p.exp=function(){return Pt(this)};p.naturalLogarithm=p.ln=function(){return Pe(this)};p.negated=p.neg=function(){var e=new this.constructor(this);return e.s=-e.s,k(e)};p.plus=p.add=function(e){var t,n,i,o,r,s,a,c,u,l,m=this,f=m.constructor;if(e=new f(e),!m.d||!e.d)return!m.s||!e.s?e=new f(NaN):m.d||(e=new f(e.d||m.s===e.s?m:NaN)),e;if(m.s!=e.s)return e.s=-e.s,m.minus(e);if(u=m.d,l=e.d,a=f.precision,c=f.rounding,!u[0]||!l[0])return l[0]||(e=new f(m)),S?k(e,a,c):e;if(r=j(m.e/B),i=j(e.e/B),u=u.slice(),o=r-i,o){for(o<0?(n=u,o=-o,s=l.length):(n=l,i=r,s=u.length),r=Math.ceil(a/B),s=r>s?r+1:s+1,o>s&&(o=s,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(s=u.length,o=l.length,s-o<0&&(o=s,n=l,l=u,u=n),t=0;o;)t=(u[--o]=u[o]+l[o]+t)/ae|0,u[o]%=ae;for(t&&(u.unshift(t),++i),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=et(u,i),S?k(e,a,c):e};p.precision=p.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(we+e);return n.d?(t=on(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t};p.round=function(){var e=this,t=e.constructor;return k(new t(e),e.e+1,t.rounding)};p.sine=p.sin=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+B,i.rounding=1,n=li(i,cn(i,n)),i.precision=e,i.rounding=t,k(pe>2?n.neg():n,e,t,!0)):new i(NaN)};p.squareRoot=p.sqrt=function(){var e,t,n,i,o,r,s=this,a=s.d,c=s.e,u=s.s,l=s.constructor;if(u!==1||!a||!a[0])return new l(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(S=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=z(a),(t.length+c)%2==0&&(t+="0"),u=Math.sqrt(t),c=j((c+1)/2)-(c<0||c%2),u==1/0?t="5e"+c:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+c),i=new l(t)):i=new l(u.toString()),n=(c=l.precision)+3;;)if(r=i,i=r.plus(E(s,r,n+2,1)).times(.5),z(r.d).slice(0,n)===(t=z(i.d)).slice(0,n))if(t=t.slice(n-3,n+1),t=="9999"||!o&&t=="4999"){if(!o&&(k(r,c+1,0),r.times(r).eq(s))){i=r;break}n+=4,o=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(k(i,c+1,1),e=!i.times(i).eq(s));break}return S=!0,k(i,c,l.rounding,e)};p.tangent=p.tan=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+10,i.rounding=1,n=n.sin(),n.s=1,n=E(n,new i(1).minus(n.times(n)).sqrt(),e+10,0),i.precision=e,i.rounding=t,k(pe==2||pe==4?n.neg():n,e,t,!0)):new i(NaN)};p.times=p.mul=function(e){var t,n,i,o,r,s,a,c,u,l=this,m=l.constructor,f=l.d,b=(e=new m(e)).d;if(e.s*=l.s,!f||!f[0]||!b||!b[0])return new m(!e.s||f&&!f[0]&&!b||b&&!b[0]&&!f?NaN:!f||!b?e.s/0:e.s*0);for(n=j(l.e/B)+j(e.e/B),c=f.length,u=b.length,c<u&&(r=f,f=b,b=r,s=c,c=u,u=s),r=[],s=c+u,i=s;i--;)r.push(0);for(i=u;--i>=0;){for(t=0,o=c+i;o>i;)a=r[o]+b[i]*f[o-i-1]+t,r[o--]=a%ae|0,t=a/ae|0;r[o]=(r[o]+t)%ae|0}for(;!r[--s];)r.pop();return t?++n:r.shift(),e.d=r,e.e=et(r,n),S?k(e,m.precision,m.rounding):e};p.toBinary=function(e,t){return wt(this,2,e,t)};p.toDecimalPlaces=p.toDP=function(e,t){var n=this,i=n.constructor;return n=new i(n),e===void 0?n:(te(e,0,ke),t===void 0?t=i.rounding:te(t,0,8),k(n,e+n.e+1,t))};p.toExponential=function(e,t){var n,i=this,o=i.constructor;return e===void 0?n=le(i,!0):(te(e,0,ke),t===void 0?t=o.rounding:te(t,0,8),i=k(new o(i),e+1,t),n=le(i,!0,e+1)),i.isNeg()&&!i.isZero()?"-"+n:n};p.toFixed=function(e,t){var n,i,o=this,r=o.constructor;return e===void 0?n=le(o):(te(e,0,ke),t===void 0?t=r.rounding:te(t,0,8),i=k(new r(o),e+o.e+1,t),n=le(i,!1,e+i.e+1)),o.isNeg()&&!o.isZero()?"-"+n:n};p.toFraction=function(e){var t,n,i,o,r,s,a,c,u,l,m,f,b=this,h=b.d,y=b.constructor;if(!h)return new y(b);if(u=n=new y(1),i=c=new y(0),t=new y(i),r=t.e=on(h)-b.e-1,s=r%B,t.d[0]=X(10,s<0?B+s:s),e==null)e=r>0?t:u;else{if(a=new y(e),!a.isInt()||a.lt(u))throw Error(we+a);e=a.gt(t)?r>0?t:u:a}for(S=!1,a=new y(z(h)),l=y.precision,y.precision=r=h.length*B*2;m=E(a,t,0,1,1),o=n.plus(m.times(i)),o.cmp(e)!=1;)n=i,i=o,o=u,u=c.plus(m.times(o)),c=o,o=t,t=a.minus(m.times(o)),a=o;return o=E(e.minus(n),i,0,1,1),c=c.plus(o.times(u)),n=n.plus(o.times(i)),c.s=u.s=b.s,f=E(u,i,r,1).minus(b).abs().cmp(E(c,n,r,1).minus(b).abs())<1?[u,i]:[c,n],y.precision=l,S=!0,f};p.toHexadecimal=p.toHex=function(e,t){return wt(this,16,e,t)};p.toNearest=function(e,t){var n=this,i=n.constructor;if(n=new i(n),e==null){if(!n.d)return n;e=new i(1),t=i.rounding}else{if(e=new i(e),t===void 0?t=i.rounding:te(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(S=!1,n=E(n,e,0,t,1).times(e),S=!0,k(n)):(e.s=n.s,n=e),n};p.toNumber=function(){return+this};p.toOctal=function(e,t){return wt(this,8,e,t)};p.toPower=p.pow=function(e){var t,n,i,o,r,s,a=this,c=a.constructor,u=+(e=new c(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new c(X(+a,u));if(a=new c(a),a.eq(1))return a;if(i=c.precision,r=c.rounding,e.eq(1))return k(a,i,r);if(t=j(e.e/B),t>=e.d.length-1&&(n=u<0?-u:u)<=si)return o=sn(c,a,n,i),e.s<0?new c(1).div(o):k(o,i,r);if(s=a.s,s<0){if(t<e.d.length-1)return new c(NaN);if((e.d[t]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return n=X(+a,u),t=n==0||!isFinite(n)?j(u*(Math.log("0."+z(a.d))/Math.LN10+a.e+1)):new c(n+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?s/0:0):(S=!1,c.rounding=a.s=1,n=Math.min(12,(t+"").length),o=Pt(e.times(Pe(a,i+n)),i),o.d&&(o=k(o,i+5,1),We(o.d,i,r)&&(t=i+10,o=k(Pt(e.times(Pe(a,t+n)),t),t+5,1),+z(o.d).slice(i+1,i+15)+1==1e14&&(o=k(o,i+1,0)))),o.s=s,S=!0,c.rounding=r,k(o,i,r))};p.toPrecision=function(e,t){var n,i=this,o=i.constructor;return e===void 0?n=le(i,i.e<=o.toExpNeg||i.e>=o.toExpPos):(te(e,1,ke),t===void 0?t=o.rounding:te(t,0,8),i=k(new o(i),e,t),n=le(i,e<=i.e||i.e<=o.toExpNeg,e)),i.isNeg()&&!i.isZero()?"-"+n:n};p.toSignificantDigits=p.toSD=function(e,t){var n=this,i=n.constructor;return e===void 0?(e=i.precision,t=i.rounding):(te(e,1,ke),t===void 0?t=i.rounding:te(t,0,8)),k(new i(n),e,t)};p.toString=function(){var e=this,t=e.constructor,n=le(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n};p.truncated=p.trunc=function(){return k(new this.constructor(this),this.e+1,1)};p.valueOf=p.toJSON=function(){var e=this,t=e.constructor,n=le(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};function z(e){var t,n,i,o=e.length-1,r="",s=e[0];if(o>0){for(r+=s,t=1;t<o;t++)i=e[t]+"",n=B-i.length,n&&(r+=ge(n)),r+=i;s=e[t],i=s+"",n=B-i.length,n&&(r+=ge(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return r+s}function te(e,t,n){if(e!==~~e||e<t||e>n)throw Error(we+e)}function We(e,t,n,i){var o,r,s,a;for(r=e[0];r>=10;r/=10)--t;return--t<0?(t+=B,o=0):(o=Math.ceil((t+1)/B),t%=B),r=X(10,B-t),a=e[o]%r|0,i==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=n<4&&a==99999||n>3&&a==49999||a==5e4||a==0):s=(n<4&&a+1==r||n>3&&a+1==r/2)&&(e[o+1]/r/100|0)==X(10,t-2)-1||(a==r/2||a==0)&&(e[o+1]/r/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(i||n<4)&&a==9999||!i&&n>3&&a==4999):s=((i||n<4)&&a+1==r||!i&&n>3&&a+1==r/2)&&(e[o+1]/r/1e3|0)==X(10,t-3)-1,s}function Ze(e,t,n){for(var i,o=[0],r,s=0,a=e.length;s<a;){for(r=o.length;r--;)o[r]*=t;for(o[0]+=bt.indexOf(e.charAt(s++)),i=0;i<o.length;i++)o[i]>n-1&&(o[i+1]===void 0&&(o[i+1]=0),o[i+1]+=o[i]/n|0,o[i]%=n)}return o.reverse()}function ui(e,t){var n,i,o;if(t.isZero())return t;i=t.d.length,i<32?(n=Math.ceil(i/3),o=(1/tt(4,n)).toString()):(n=16,o="2.3283064365386962890625e-10"),e.precision+=n,t=Se(e,1,t.times(o),new e(1));for(var r=n;r--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=n,t}var E=function(){function e(i,o,r){var s,a=0,c=i.length;for(i=i.slice();c--;)s=i[c]*o+a,i[c]=s%r|0,a=s/r|0;return a&&i.unshift(a),i}function t(i,o,r,s){var a,c;if(r!=s)c=r>s?1:-1;else for(a=c=0;a<r;a++)if(i[a]!=o[a]){c=i[a]>o[a]?1:-1;break}return c}function n(i,o,r,s){for(var a=0;r--;)i[r]-=a,a=i[r]<o[r]?1:0,i[r]=a*s+i[r]-o[r];for(;!i[0]&&i.length>1;)i.shift()}return function(i,o,r,s,a,c){var u,l,m,f,b,h,y,I,K,F,C,N,L,W,oe,J,$,se,D,ue,ee=i.constructor,ft=i.s==o.s?1:-1,Y=i.d,v=o.d;if(!Y||!Y[0]||!v||!v[0])return new ee(!i.s||!o.s||(Y?v&&Y[0]==v[0]:!v)?NaN:Y&&Y[0]==0||!v?ft*0:ft/0);for(c?(b=1,l=i.e-o.e):(c=ae,b=B,l=j(i.e/b)-j(o.e/b)),D=v.length,$=Y.length,K=new ee(ft),F=K.d=[],m=0;v[m]==(Y[m]||0);m++);if(v[m]>(Y[m]||0)&&l--,r==null?(W=r=ee.precision,s=ee.rounding):a?W=r+(i.e-o.e)+1:W=r,W<0)F.push(1),h=!0;else{if(W=W/b+2|0,m=0,D==1){for(f=0,v=v[0],W++;(m<$||f)&&W--;m++)oe=f*c+(Y[m]||0),F[m]=oe/v|0,f=oe%v|0;h=f||m<$}else{for(f=c/(v[0]+1)|0,f>1&&(v=e(v,f,c),Y=e(Y,f,c),D=v.length,$=Y.length),J=D,C=Y.slice(0,D),N=C.length;N<D;)C[N++]=0;ue=v.slice(),ue.unshift(0),se=v[0],v[1]>=c/2&&++se;do f=0,u=t(v,C,D,N),u<0?(L=C[0],D!=N&&(L=L*c+(C[1]||0)),f=L/se|0,f>1?(f>=c&&(f=c-1),y=e(v,f,c),I=y.length,N=C.length,u=t(y,C,I,N),u==1&&(f--,n(y,D<I?ue:v,I,c))):(f==0&&(u=f=1),y=v.slice()),I=y.length,I<N&&y.unshift(0),n(C,y,N,c),u==-1&&(N=C.length,u=t(v,C,D,N),u<1&&(f++,n(C,D<N?ue:v,N,c))),N=C.length):u===0&&(f++,C=[0]),F[m++]=f,u&&C[0]?C[N++]=Y[J]||0:(C=[Y[J]],N=1);while((J++<$||C[0]!==void 0)&&W--);h=C[0]!==void 0}F[0]||F.shift()}if(b==1)K.e=l,$t=h;else{for(m=1,f=F[0];f>=10;f/=10)m++;K.e=m+l*b-1,k(K,a?r+K.e+1:r,s,h)}return K}}();function k(e,t,n,i){var o,r,s,a,c,u,l,m,f,b=e.constructor;e:if(t!=null){if(m=e.d,!m)return e;for(o=1,a=m[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=B,s=t,l=m[f=0],c=l/X(10,o-s-1)%10|0;else if(f=Math.ceil((r+1)/B),a=m.length,f>=a)if(i){for(;a++<=f;)m.push(0);l=c=0,o=1,r%=B,s=r-B+1}else break e;else{for(l=a=m[f],o=1;a>=10;a/=10)o++;r%=B,s=r-B+o,c=s<0?0:l/X(10,o-s-1)%10|0}if(i=i||t<0||m[f+1]!==void 0||(s<0?l:l%X(10,o-s-1)),u=n<4?(c||i)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||i||n==6&&(r>0?s>0?l/X(10,o-s):0:m[f-1])%10&1||n==(e.s<0?8:7)),t<1||!m[0])return m.length=0,u?(t-=e.e+1,m[0]=X(10,(B-t%B)%B),e.e=-t||0):m[0]=e.e=0,e;if(r==0?(m.length=f,a=1,f--):(m.length=f+1,a=X(10,B-r),m[f]=s>0?(l/X(10,o-s)%X(10,s)|0)*a:0),u)for(;;)if(f==0){for(r=1,s=m[0];s>=10;s/=10)r++;for(s=m[0]+=a,a=1;s>=10;s/=10)a++;r!=a&&(e.e++,m[0]==ae&&(m[0]=1));break}else{if(m[f]+=a,m[f]!=ae)break;m[f--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop()}return S&&(e.e>b.maxE?(e.d=null,e.e=NaN):e.e<b.minE&&(e.e=0,e.d=[0])),e}function le(e,t,n){if(!e.isFinite())return un(e);var i,o=e.e,r=z(e.d),s=r.length;return t?(n&&(i=n-s)>0?r=r.charAt(0)+"."+r.slice(1)+ge(i):s>1&&(r=r.charAt(0)+"."+r.slice(1)),r=r+(e.e<0?"e":"e+")+e.e):o<0?(r="0."+ge(-o-1)+r,n&&(i=n-s)>0&&(r+=ge(i))):o>=s?(r+=ge(o+1-s),n&&(i=n-o-1)>0&&(r=r+"."+ge(i))):((i=o+1)<s&&(r=r.slice(0,i)+"."+r.slice(i)),n&&(i=n-s)>0&&(o+1===s&&(r+="."),r+=ge(i))),r}function et(e,t){var n=e[0];for(t*=B;n>=10;n/=10)t++;return t}function Je(e,t,n){if(t>ai)throw S=!0,n&&(e.precision=n),Error(en);return k(new e(je),t,1,!0)}function ce(e,t,n){if(t>gt)throw Error(en);return k(new e(Qe),t,n,!0)}function on(e){var t=e.length-1,n=t*B+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function ge(e){for(var t="";e--;)t+="0";return t}function sn(e,t,n,i){var o,r=new e(1),s=Math.ceil(i/B+4);for(S=!1;;){if(n%2&&(r=r.times(t),Qt(r.d,s)&&(o=!0)),n=j(n/2),n===0){n=r.d.length-1,o&&r.d[n]===0&&++r.d[n];break}t=t.times(t),Qt(t.d,s)}return S=!0,r}function jt(e){return e.d[e.d.length-1]&1}function an(e,t,n){for(var i,o,r=new e(t[0]),s=0;++s<t.length;){if(o=new e(t[s]),!o.s){r=o;break}i=r.cmp(o),(i===n||i===0&&r.s===n)&&(r=o)}return r}function Pt(e,t){var n,i,o,r,s,a,c,u=0,l=0,m=0,f=e.constructor,b=f.rounding,h=f.precision;if(!e.d||!e.d[0]||e.e>17)return new f(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(S=!1,c=h):c=t,a=new f(.03125);e.e>-2;)e=e.times(a),m+=5;for(i=Math.log(X(2,m))/Math.LN10*2+5|0,c+=i,n=r=s=new f(1),f.precision=c;;){if(r=k(r.times(e),c,1),n=n.times(++l),a=s.plus(E(r,n,c,1)),z(a.d).slice(0,c)===z(s.d).slice(0,c)){for(o=m;o--;)s=k(s.times(s),c,1);if(t==null)if(u<3&&We(s.d,c-i,b,u))f.precision=c+=10,n=r=a=new f(1),l=0,u++;else return k(s,f.precision=h,b,S=!0);else return f.precision=h,s}s=a}}function Pe(e,t){var n,i,o,r,s,a,c,u,l,m,f,b=1,h=10,y=e,I=y.d,K=y.constructor,F=K.rounding,C=K.precision;if(y.s<0||!I||!I[0]||!y.e&&I[0]==1&&I.length==1)return new K(I&&!I[0]?-1/0:y.s!=1?NaN:I?0:y);if(t==null?(S=!1,l=C):l=t,K.precision=l+=h,n=z(I),i=n.charAt(0),Math.abs(r=y.e)<15e14){for(;i<7&&i!=1||i==1&&n.charAt(1)>3;)y=y.times(e),n=z(y.d),i=n.charAt(0),b++;r=y.e,i>1?(y=new K("0."+n),r++):y=new K(i+"."+n.slice(1))}else return u=Je(K,l+2,C).times(r+""),y=Pe(new K(i+"."+n.slice(1)),l-h).plus(u),K.precision=C,t==null?k(y,C,F,S=!0):y;for(m=y,c=s=y=E(y.minus(1),y.plus(1),l,1),f=k(y.times(y),l,1),o=3;;){if(s=k(s.times(f),l,1),u=c.plus(E(s,new K(o),l,1)),z(u.d).slice(0,l)===z(c.d).slice(0,l))if(c=c.times(2),r!==0&&(c=c.plus(Je(K,l+2,C).times(r+""))),c=E(c,new K(b),l,1),t==null)if(We(c.d,l-h,F,a))K.precision=l+=h,u=s=y=E(m.minus(1),m.plus(1),l,1),f=k(y.times(y),l,1),o=a=1;else return k(c,K.precision=C,F,S=!0);else return K.precision=C,c;c=u,o+=2}}function un(e){return String(e.s*e.s/0)}function Ye(e,t){var n,i,o;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(i=t.search(/e/i))>0?(n<0&&(n=i),n+=+t.slice(i+1),t=t.substring(0,i)):n<0&&(n=t.length),i=0;t.charCodeAt(i)===48;i++);for(o=t.length;t.charCodeAt(o-1)===48;--o);if(t=t.slice(i,o),t){if(o-=i,e.e=n=n-i-1,e.d=[],i=(n+1)%B,n<0&&(i+=B),i<o){for(i&&e.d.push(+t.slice(0,i)),o-=B;i<o;)e.d.push(+t.slice(i,i+=B));t=t.slice(i),i=B-t.length}else i-=o;for(;i--;)t+="0";e.d.push(+t),S&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function ci(e,t){var n,i,o,r,s,a,c,u,l;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),rn.test(t))return Ye(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(ri.test(t))n=16,t=t.toLowerCase();else if(ii.test(t))n=2;else if(oi.test(t))n=8;else throw Error(we+t);for(r=t.search(/p/i),r>0?(c=+t.slice(r+1),t=t.substring(2,r)):t=t.slice(2),r=t.indexOf("."),s=r>=0,i=e.constructor,s&&(t=t.replace(".",""),a=t.length,r=a-r,o=sn(i,new i(n),r,r*2)),u=Ze(t,n,ae),l=u.length-1,r=l;u[r]===0;--r)u.pop();return r<0?new i(e.s*0):(e.e=et(u,l),e.d=u,S=!1,s&&(e=E(e,o,a*4)),c&&(e=e.times(Math.abs(c)<54?X(2,c):nt.pow(2,c))),S=!0,e)}function li(e,t){var n,i=t.d.length;if(i<3)return t.isZero()?t:Se(e,2,t,t);n=1.4*Math.sqrt(i),n=n>16?16:n|0,t=t.times(1/tt(5,n)),t=Se(e,2,t,t);for(var o,r=new e(5),s=new e(16),a=new e(20);n--;)o=t.times(t),t=t.times(r.plus(o.times(s.times(o).minus(a))));return t}function Se(e,t,n,i,o){var r,s,a,c,u=1,l=e.precision,m=Math.ceil(l/B);for(S=!1,c=n.times(n),a=new e(i);;){if(s=E(a.times(c),new e(t++*t++),l,1),a=o?i.plus(s):i.minus(s),i=E(s.times(c),new e(t++*t++),l,1),s=a.plus(i),s.d[m]!==void 0){for(r=m;s.d[r]===a.d[r]&&r--;);if(r==-1)break}r=a,a=i,i=s,s=r,u++}return S=!0,s.d.length=m+1,s}function tt(e,t){for(var n=e;--t;)n*=e;return n}function cn(e,t){var n,i=t.s<0,o=ce(e,e.precision,1),r=o.times(.5);if(t=t.abs(),t.lte(r))return pe=i?4:1,t;if(n=t.divToInt(o),n.isZero())pe=i?3:2;else{if(t=t.minus(n.times(o)),t.lte(r))return pe=jt(n)?i?2:3:i?4:1,t;pe=jt(n)?i?1:4:i?3:2}return t.minus(o).abs()}function wt(e,t,n,i){var o,r,s,a,c,u,l,m,f,b=e.constructor,h=n!==void 0;if(h?(te(n,1,ke),i===void 0?i=b.rounding:te(i,0,8)):(n=b.precision,i=b.rounding),!e.isFinite())l=un(e);else{for(l=le(e),s=l.indexOf("."),h?(o=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):o=t,s>=0&&(l=l.replace(".",""),f=new b(1),f.e=l.length-s,f.d=Ze(le(f),10,o),f.e=f.d.length),m=Ze(l,10,o),r=c=m.length;m[--c]==0;)m.pop();if(!m[0])l=h?"0p+0":"0";else{if(s<0?r--:(e=new b(e),e.d=m,e.e=r,e=E(e,f,n,i,0,o),m=e.d,r=e.e,u=$t),s=m[n],a=o/2,u=u||m[n+1]!==void 0,u=i<4?(s!==void 0||u)&&(i===0||i===(e.s<0?3:2)):s>a||s===a&&(i===4||u||i===6&&m[n-1]&1||i===(e.s<0?8:7)),m.length=n,u)for(;++m[--n]>o-1;)m[n]=0,n||(++r,m.unshift(1));for(c=m.length;!m[c-1];--c);for(s=0,l="";s<c;s++)l+=bt.charAt(m[s]);if(h){if(c>1)if(t==16||t==8){for(s=t==16?4:3,--c;c%s;c++)l+="0";for(m=Ze(l,o,t),c=m.length;!m[c-1];--c);for(s=1,l="1.";s<c;s++)l+=bt.charAt(m[s])}else l=l.charAt(0)+"."+l.slice(1);l=l+(r<0?"p":"p+")+r}else if(r<0){for(;++r;)l="0"+l;l="0."+l}else if(++r>c)for(r-=c;r--;)l+="0";else r<c&&(l=l.slice(0,r)+"."+l.slice(r))}l=(t==16?"0x":t==2?"0b":t==8?"0o":"")+l}return e.s<0?"-"+l:l}function Qt(e,t){if(e.length>t)return e.length=t,!0}function mi(e){return new this(e).abs()}function di(e){return new this(e).acos()}function fi(e){return new this(e).acosh()}function pi(e,t){return new this(e).plus(t)}function bi(e){return new this(e).asin()}function yi(e){return new this(e).asinh()}function gi(e){return new this(e).atan()}function Pi(e){return new this(e).atanh()}function wi(e,t){e=new this(e),t=new this(t);var n,i=this.precision,o=this.rounding,r=i+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=ce(this,r,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?ce(this,i,o):new this(0),n.s=e.s):!e.d||t.isZero()?(n=ce(this,r,1).times(.5),n.s=e.s):t.s<0?(this.precision=r,this.rounding=1,n=this.atan(E(e,t,r,1)),t=ce(this,r,1),this.precision=i,this.rounding=o,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(E(e,t,r,1)),n}function ki(e){return new this(e).cbrt()}function Ai(e){return k(e=new this(e),e.e+1,2)}function Ti(e,t,n){return new this(e).clamp(t,n)}function hi(e){if(!e||typeof e!="object")throw Error($e+"Object expected");var t,n,i,o=e.defaults===!0,r=["precision",1,ke,"rounding",0,8,"toExpNeg",-Ie,0,"toExpPos",0,Ie,"maxE",0,Ie,"minE",-Ie,0,"modulo",0,9];for(t=0;t<r.length;t+=3)if(n=r[t],o&&(this[n]=yt[n]),(i=e[n])!==void 0)if(j(i)===i&&i>=r[t+1]&&i<=r[t+2])this[n]=i;else throw Error(we+n+": "+i);if(n="crypto",o&&(this[n]=yt[n]),(i=e[n])!==void 0)if(i===!0||i===!1||i===0||i===1)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(tn);else this[n]=!1;else throw Error(we+n+": "+i);return this}function Bi(e){return new this(e).cos()}function xi(e){return new this(e).cosh()}function ln(e){var t,n,i;function o(r){var s,a,c,u=this;if(!(u instanceof o))return new o(r);if(u.constructor=o,Jt(r)){u.s=r.s,S?!r.d||r.e>o.maxE?(u.e=NaN,u.d=null):r.e<o.minE?(u.e=0,u.d=[0]):(u.e=r.e,u.d=r.d.slice()):(u.e=r.e,u.d=r.d?r.d.slice():r.d);return}if(c=typeof r,c==="number"){if(r===0){u.s=1/r<0?-1:1,u.e=0,u.d=[0];return}if(r<0?(r=-r,u.s=-1):u.s=1,r===~~r&&r<1e7){for(s=0,a=r;a>=10;a/=10)s++;S?s>o.maxE?(u.e=NaN,u.d=null):s<o.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[r]):(u.e=s,u.d=[r]);return}if(r*0!==0){r||(u.s=NaN),u.e=NaN,u.d=null;return}return Ye(u,r.toString())}if(c==="string")return(a=r.charCodeAt(0))===45?(r=r.slice(1),u.s=-1):(a===43&&(r=r.slice(1)),u.s=1),rn.test(r)?Ye(u,r):ci(u,r);if(c==="bigint")return r<0?(r=-r,u.s=-1):u.s=1,Ye(u,r.toString());throw Error(we+r)}if(o.prototype=p,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=hi,o.clone=ln,o.isDecimal=Jt,o.abs=mi,o.acos=di,o.acosh=fi,o.add=pi,o.asin=bi,o.asinh=yi,o.atan=gi,o.atanh=Pi,o.atan2=wi,o.cbrt=ki,o.ceil=Ai,o.clamp=Ti,o.cos=Bi,o.cosh=xi,o.div=Ii,o.exp=Si,o.floor=Ci,o.hypot=Ki,o.ln=Ni,o.log=Li,o.log10=Mi,o.log2=Ri,o.max=Fi,o.min=Oi,o.mod=Wi,o.mul=Ei,o.pow=vi,o.random=_i,o.round=Vi,o.sign=Di,o.sin=qi,o.sinh=Gi,o.sqrt=Ui,o.sub=Xi,o.sum=Hi,o.tan=zi,o.tanh=Zi,o.trunc=Yi,e===void 0&&(e={}),e&&e.defaults!==!0)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<i.length;)e.hasOwnProperty(n=i[t++])||(e[n]=this[n]);return o.config(e),o}function Ii(e,t){return new this(e).div(t)}function Si(e){return new this(e).exp()}function Ci(e){return k(e=new this(e),e.e+1,3)}function Ki(){var e,t,n=new this(0);for(S=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return S=!0,new this(1/0);n=t}return S=!0,n.sqrt()}function Jt(e){return e instanceof nt||e&&e.toStringTag===nn||!1}function Ni(e){return new this(e).ln()}function Li(e,t){return new this(e).log(t)}function Ri(e){return new this(e).log(2)}function Mi(e){return new this(e).log(10)}function Fi(){return an(this,arguments,-1)}function Oi(){return an(this,arguments,1)}function Wi(e,t){return new this(e).mod(t)}function Ei(e,t){return new this(e).mul(t)}function vi(e,t){return new this(e).pow(t)}function _i(e){var t,n,i,o,r=0,s=new this(1),a=[];if(e===void 0?e=this.precision:te(e,1,ke),i=Math.ceil(e/B),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(i));r<i;)o=t[r],o>=429e7?t[r]=crypto.getRandomValues(new Uint32Array(1))[0]:a[r++]=o%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(i*=4);r<i;)o=t[r]+(t[r+1]<<8)+(t[r+2]<<16)+((t[r+3]&127)<<24),o>=214e7?crypto.randomBytes(4).copy(t,r):(a.push(o%1e7),r+=4);r=i/4}else throw Error(tn);else for(;r<i;)a[r++]=Math.random()*1e7|0;for(i=a[--r],e%=B,i&&e&&(o=X(10,B-e),a[r]=(i/o|0)*o);a[r]===0;r--)a.pop();if(r<0)n=0,a=[0];else{for(n=-1;a[0]===0;n-=B)a.shift();for(i=1,o=a[0];o>=10;o/=10)i++;i<B&&(n-=B-i)}return s.e=n,s.d=a,s}function Vi(e){return k(e=new this(e),e.e+1,this.rounding)}function Di(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function qi(e){return new this(e).sin()}function Gi(e){return new this(e).sinh()}function Ui(e){return new this(e).sqrt()}function Xi(e,t){return new this(e).sub(t)}function Hi(){var e=0,t=arguments,n=new this(t[e]);for(S=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return S=!0,k(n,this.precision,this.rounding)}function zi(e){return new this(e).tan()}function Zi(e){return new this(e).tanh()}function Yi(e){return k(e=new this(e),e.e+1,1)}p[Symbol.for("nodejs.util.inspect.custom")]=p.toString;p[Symbol.toStringTag]="Decimal";var nt=p.constructor=ln(yt);je=new nt(je);Qe=new nt(Qe);var bn=G(require("big.js")),er=G(require("bn.js"));var mn=G(require("toformat")),ji=mn.default,Ee=ji;var ve=G(require("big.js")),fn=G(require("bn.js")),pn=G(require("decimal.js-light"));var Ce=G(require("bn.js"));var dn=9007199254740991;function me(e){let t=Q("Raydium_parseBigNumberish");if(e instanceof Ce.default)return e;if(typeof e=="string"){if(e.match(/^-?[0-9]+$/))return new Ce.default(e);t.logWithError(`invalid BigNumberish string: ${e}`)}return typeof e=="number"?(e%1&&t.logWithError(`BigNumberish number underflow: ${e}`),(e>=dn||e<=-dn)&&t.logWithError(`BigNumberish number overflow: ${e}`),new Ce.default(String(e))):typeof e=="bigint"?new Ce.default(e.toString()):(t.error(`invalid BigNumberish value: ${e}`),new Ce.default(0))}var it=Q("module/fraction"),kt=Ee(ve.default),_e=Ee(pn.default),Ji={[0]:_e.ROUND_DOWN,[1]:_e.ROUND_HALF_UP,[2]:_e.ROUND_UP},$i={[0]:ve.default.roundDown,[1]:ve.default.roundHalfUp,[2]:ve.default.roundUp},_=class{constructor(t,n=new fn.default(1)){this.numerator=me(t),this.denominator=me(n)}get quotient(){return this.numerator.div(this.denominator)}invert(){return new _(this.denominator,this.numerator)}add(t){let n=t instanceof _?t:new _(me(t));return this.denominator.eq(n.denominator)?new _(this.numerator.add(n.numerator),this.denominator):new _(this.numerator.mul(n.denominator).add(n.numerator.mul(this.denominator)),this.denominator.mul(n.denominator))}sub(t){let n=t instanceof _?t:new _(me(t));return this.denominator.eq(n.denominator)?new _(this.numerator.sub(n.numerator),this.denominator):new _(this.numerator.mul(n.denominator).sub(n.numerator.mul(this.denominator)),this.denominator.mul(n.denominator))}mul(t){let n=t instanceof _?t:new _(me(t));return new _(this.numerator.mul(n.numerator),this.denominator.mul(n.denominator))}div(t){let n=t instanceof _?t:new _(me(t));return new _(this.numerator.mul(n.denominator),this.denominator.mul(n.numerator))}toSignificant(t,n={groupSeparator:""},i=1){Number.isInteger(t)||it.logWithError(`${t} is not an integer.`),t<=0&&it.logWithError(`${t} is not positive.`),_e.set({precision:t+1,rounding:Ji[i]});let o=new _e(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(t);return o.toFormat(o.decimalPlaces(),n)}toFixed(t,n={groupSeparator:""},i=1){return Number.isInteger(t)||it.logWithError(`${t} is not an integer.`),t<0&&it.logWithError(`${t} is negative.`),kt.DP=t,kt.RM=$i[i]||1,new kt(this.numerator.toString()).div(this.denominator.toString()).toFormat(t,n)}isZero(){return this.numerator.isZero()}};var Xo=Q("Raydium_amount"),Ho=Ee(bn.default);var yn=require("@solana/web3.js"),At=require("@solana/spl-token"),Tt={chainId:101,address:yn.PublicKey.default.toBase58(),programId:At.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"SOL",name:"solana",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}},Ae={chainId:101,address:"So11111111111111111111111111111111111111112",programId:At.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"WSOL",name:"Wrapped SOL",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}};var ot=require("@solana/web3.js");var O=require("@solana/web3.js"),gn=require("@solana/spl-token");function ht({pubkey:e,isSigner:t=!1,isWritable:n=!0}){return{pubkey:e,isWritable:n,isSigner:t}}var jo=[ht({pubkey:gn.TOKEN_PROGRAM_ID,isWritable:!1}),ht({pubkey:O.SystemProgram.programId,isWritable:!1}),ht({pubkey:O.SYSVAR_RENT_PUBKEY,isWritable:!1})];function Pn({publicKey:e,transformSol:t}){let n=wn(e.toString());if(n instanceof O.PublicKey)return t&&n.equals(Ve)?ze:n;if(t&&n.toString()===Ve.toBase58())return ze;if(typeof n=="string"){if(n===O.PublicKey.default.toBase58())return O.PublicKey.default;try{return new O.PublicKey(n)}catch{throw new Error("invalid public key")}}throw new Error("invalid public key")}function wn(e){try{return new O.PublicKey(e)}catch{return e}}var nr=new O.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),ir=new O.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),rt=new O.PublicKey("SysvarRent111111111111111111111111111111111"),Qo=new O.PublicKey("SysvarC1ock11111111111111111111111111111111"),De=new O.PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),Jo=new O.PublicKey("Sysvar1nstructions1111111111111111111111111"),$o=O.SystemProgram.programId,es=new O.PublicKey("4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"),ts=new O.PublicKey("Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS"),ns=new O.PublicKey("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"),is=new O.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),rs=new O.PublicKey("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),os=new O.PublicKey("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"),ss=new O.PublicKey("7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"),as=new O.PublicKey("USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX"),us=new O.PublicKey("NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa"),cs=new O.PublicKey("ANAxByE6G2WjFp7A4NqtWYXb3mgruyzZYg3spfxe6Lbo"),ls=new O.PublicKey("7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs"),ze=new O.PublicKey("So11111111111111111111111111111111111111112"),Ve=O.PublicKey.default;var Bt=class{constructor({mint:t,decimals:n,symbol:i,name:o,skipMint:r=!1,isToken2022:s=!1}){if(t===Ve.toBase58()||t instanceof ot.PublicKey&&Ve.equals(t)){this.decimals=Ae.decimals,this.symbol=Ae.symbol,this.name=Ae.name,this.mint=new ot.PublicKey(Ae.address),this.isToken2022=!1;return}this.decimals=n,this.symbol=i||t.toString().substring(0,6),this.name=o||t.toString().substring(0,6),this.mint=r?ot.PublicKey.default:Pn({publicKey:t}),this.isToken2022=s}equals(t){return this===t?!0:this.mint.equals(t.mint)}},Te=Bt;Te.WSOL=new Bt(U(q({},Ae),{mint:Ae.address}));var xt=class{constructor({decimals:t,symbol:n="UNKNOWN",name:i="UNKNOWN"}){this.decimals=t,this.symbol=n,this.name=i}equals(t){return this===t}},st=xt;st.SOL=new xt(Tt);var kn=G(require("bn.js"));var ks=new _(new kn.default(100));var Is=Q("Raydium_price");var rr=new de.default(0),$s=new de.default(1),ea=new de.default(2),ta=new de.default(3),na=new de.default(5),tr=new de.default(10),ia=new de.default(100),ra=new de.default(1e3),oa=new de.default(1e4);var sr=require("@solana/web3.js"),ar=require("@solana/spl-token");var Be=require("@solana/web3.js");var or=require("@solana/spl-token"),Pa=Q("Raydium_txUtil");function ut(e,t){let[n,i]=Be.PublicKey.findProgramAddressSync(e,t);return{publicKey:n,nonce:i}}var A=require("@solana/web3.js"),Ta=new A.PublicKey("EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q"),ha=new A.PublicKey("CBuCnLe26faBpcBP2fktp4rp8abpcAnTWft6ZrP5Q4T"),Ba=new A.PublicKey("9KEPoZmtHUrBbhWN1v1KWLMkkvwY6WLtAVUCPRtRjP4z"),xa=new A.PublicKey("FarmqiPv5eAj3j1GMdMCMUGXqPUvmquZtMy86QH6rzhG"),Ia=new A.PublicKey("CLaimxFqjHzgTJtAGHU47NPhg6qrc5sCnpC4tBLyABQS"),Sa=new A.PublicKey("srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"),Ca=new A.PublicKey("9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"),Ka=new A.PublicKey("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"),Na=new A.PublicKey("5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h"),La=new A.PublicKey("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),ur=new A.PublicKey("CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"),cr=new A.PublicKey("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),lr=new A.PublicKey("kN1kEznaF5Xbd8LYuqtEFcxzWSBk5Fv6ygX6SqEGJVy"),Ra=new A.PublicKey("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),Ma=new A.PublicKey("routeUGWgWzqBWFcrCfv8tritsqukccJPu3q5GPP3xS"),Fa=new A.PublicKey("7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"),Oa=new A.PublicKey("6FJon3QE27qgPVggARueB22hLvoh22VzJpXv4rBEoSLF"),Wa=new A.PublicKey("CC12se5To1CdEuw7fDS27B7Geo5jJyL7t5UK2B44NgiH"),Ea=new A.PublicKey("9HzJyW1qZsEiSfMUf6L2jo3CcTKAyBmSyKdwQeYisHrC"),va=new A.PublicKey("DropEU8AvevN3UrXWXTMuz3rqnMczQVNjq3kcSdW2SQi"),_a=new A.PublicKey("CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"),Va=new A.PublicKey("GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL"),Da=new A.PublicKey("DNXgeM9EiiaAbaWvwjHj9fQQLAX5ZsfHyvmYUNRAdNC8"),qa=new A.PublicKey("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),Ga=new A.PublicKey("3f7GcQFG397GAaEnv51zR6tsTVihYRydnydDD1cXekxH"),Ua=new A.PublicKey("LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"),Xa=new A.PublicKey("WLHv2UAZm6z4KyaaELi5pjdbJh6RESMva1Rnn8pJVVh"),Ha=new A.PublicKey("DRay6fNdQ5J82H7xV6uq2aV3mNrUZ1J4PgSKsWgptcm6"),za=new A.PublicKey("5xqNaZXX5eUi4p5HU4oz9i5QnwRNT2y6oN7yyn4qENeq"),Za=new A.PublicKey("4Bu96XjU84XjPDSpveTVf6LYGCkfW5FK7SNkREWcEfV4"),Ya=new A.PublicKey("6s1xP3hpbAfFoNtUNF8mfHsjr2Bd97JxFJRWLbL6aHuX");var ja={OPEN_BOOK_PROGRAM:new A.PublicKey("EoTcMgcDRTJVZDMZWBoU6rhYHZfkNTVEAfz3uUJRcYGj"),SERUM_PROGRAM_ID_V3:new A.PublicKey("Ray1111111111111111111111111111111111111111"),AMM_V4:new A.PublicKey("DRaya7Kj3aMWQSy19kSjvmuwq9docCHofyP9kanQGaav"),AMM_STABLE:new A.PublicKey("DRayDdXc1NZQ9C3hRWmoSf8zK4iapgMnjdNZWrfwsP8m"),CLMM_PROGRAM_ID:new A.PublicKey("DRayAUgENGQBKVaX8owNhgzkEDyoHTGVEGHVJT1E9pfH"),CLMM_LOCK_PROGRAM_ID:new A.PublicKey("DRay25Usp3YJAi7beckgpGUC7mGJ2cR1AVPxhYfwVCUX"),CLMM_LOCK_AUTH_ID:new A.PublicKey("6Aoh8h2Lw2m5UGxYR8AdAL87jTWYeKoxM52mJRzfYwN"),CREATE_CPMM_POOL_PROGRAM:new A.PublicKey("DRaycpLY18LhpbydsBWbVJtxpNv9oXPgjRSfpF2bWpYb"),CREATE_CPMM_POOL_AUTH:new A.PublicKey("CXniRufdq5xL8t8jZAPxsPZDpuudwuJSPWnbcD5Y5Nxq"),CREATE_CPMM_POOL_FEE_ACC:new A.PublicKey("3oE58BKVt8KuYkGxx8zBojugnymWmBiyafWgMrnb6eYy"),LOCK_CPMM_PROGRAM:new A.PublicKey("DRay25Usp3YJAi7beckgpGUC7mGJ2cR1AVPxhYfwVCUX"),LOCK_CPMM_AUTH:new A.PublicKey("7qWVV8UY2bRJfDLP4s37YzBPKUkVB46DStYJBpYbQzu3"),UTIL1216:A.PublicKey.default,Router:new A.PublicKey("DRaybByLpbUL57LJARs3j8BitTxVfzBg351EaMr5UTCd"),FARM_PROGRAM_ID_V3:new A.PublicKey("DRayWyrLmEW5KEeqs8kdTMMaBabapqagaBC7KWpGtJeZ"),FARM_PROGRAM_ID_V4:new A.PublicKey("Ray1111111111111111111111111111111111111111"),FARM_PROGRAM_ID_V5:new A.PublicKey("DRayiCGSZgku1GTK6rXD6mVDdingXy6APAH1R6R5L2LC"),FARM_PROGRAM_ID_V6:new A.PublicKey("DRayzbYakXs45ELHkzH6vC3fuhQqTAnv5A68gdFuvZyZ"),LAUNCHPAD_PROGRAM:new A.PublicKey("DRay6fNdQ5J82H7xV6uq2aV3mNrUZ1J4PgSKsWgptcm6"),LAUNCHPAD_AUTH:new A.PublicKey("5xqNaZXX5eUi4p5HU4oz9i5QnwRNT2y6oN7yyn4qENeq"),LAUNCHPAD_PLATFORM:new A.PublicKey("2Jx4KTDrVSdWNazuGpcA8n3ZLTRGGBDxAWhuKe2Xcj2a"),LAUNCHPAD_CONFIG:new A.PublicKey("7ZR4zD7PYfY2XxoG1Gxcy2EgEeGYrpxrwzPuwdUBssEt"),FEE_DESTINATION_ID:new A.PublicKey("9y8ENuuZ3b19quffx9hQvRVygG5ky6snHfRvGpuSfeJy"),MODEL_DATA_PUBKEY:new A.PublicKey("Ray1111111111111111111111111111111111111111")};var mr=G(require("bn.js"));var Tn=require("@solana/web3.js");var Ke=require("@solana/web3.js"),pr=G(require("axios"));var br=require("@solana/web3.js"),yr=G(require("bn.js"));var hn=G(require("bn.js")),Bu=new hn.default(1e6);var Sn=require("@solana/web3.js"),Ne=G(require("bn.js"));var T=require("@solana/buffer-layout"),Kt=T.Layout,Bn=T.Structure;var Nt=T.UInt;var xn=T.u8,be=T.u16;var Lt=T.u32;var ye=T.s32;var In=T.seq;var ne=T.blob;var Rt=T.offset;var Le=class extends Kt{constructor(n,i,o){super(n,o);this.blob=ne(n),this.signed=i}decode(n,i=0){let o=new Ne.default(this.blob.decode(n,i),10,"le");return this.signed?o.fromTwos(this.span*8).clone():o}encode(n,i,o=0){return typeof n=="number"&&(n=new Ne.default(n)),this.signed&&(n=n.toTwos(this.span*8)),this.blob.encode(n.toArrayLike(Buffer,"le",this.span),i,o)}};function g(e){return new Nt(1,e)}function Re(e){return new Nt(4,e)}function d(e){return new Le(8,!1,e)}function V(e){return new Le(16,!1,e)}function Cn(e){return new Le(8,!0,e)}function Kn(e){return new Le(16,!0,e)}var xe=class extends Kt{constructor(n,i,o,r){super(n.span,r);this.layout=n,this.decoder=i,this.encoder=o}decode(n,i){return this.decoder(this.layout.decode(n,i))}encode(n,i,o){return this.layout.encode(this.encoder(n),i,o)}getSpan(n,i){return this.layout.getSpan(n,i)}};function P(e){return new xe(ne(32),t=>new Sn.PublicKey(t),t=>t.toBuffer(),e)}function Ft(e){return new xe(xn(),gr,Pr,e)}function gr(e){if(e===0)return!1;if(e===1)return!0;throw new Error("Invalid bool: "+e)}function Pr(e){return e?1:0}function Nn(e,t){let n=Lt("length"),i=w([n,R(e,Rt(n,-n.span),"values")]);return new xe(i,({values:o})=>o,o=>({values:o}),t)}function wr(e){let t=Lt("length"),n=w([t,ne(Rt(t,-t.span),"data")]);return new xe(n,({data:i})=>i,i=>({data:i}),e)}function Z(e){return new xe(wr(),t=>t.toString("utf-8"),t=>Buffer.from(t,"utf-8"),e)}var Mt=class extends Bn{decode(t,n){return super.decode(t,n)}};function w(e,t,n){return new Mt(e,t,n)}function R(e,t,n){let i,o=typeof t=="number"?t:(0,Ne.isBN)(t)?t.toNumber():new Proxy(t,{get(r,s){if(!i){let a=Reflect.get(r,"count");i=(0,Ne.isBN)(a)?a.toNumber():a,Reflect.set(r,"count",i)}return Reflect.get(r,s)},set(r,s,a){return s==="count"&&(i=a),Reflect.set(r,s,a)}});return In(e,o,n)}var re=require("@solana/spl-token"),M=require("@solana/web3.js"),fe=G(require("bn.js"));var ec=w([d(),d("epoch"),g("curveType"),be("index"),d("migrateFee"),d("tradeFeeRate"),d("maxShareFeeRate"),d("minSupplyA"),d("maxLockRate"),d("minSellRateA"),d("minMigrateRateA"),d("minFundRaisingB"),P("mintB"),P("protocolFeeOwner"),P("migrateFeeOwner"),P("migrateToAmmWallet"),P("migrateToCpmmWallet"),R(d(),16)]),kr=w([d("totalLockedAmount"),d("cliffPeriod"),d("unlockPeriod"),d("startTime"),d("totalAllocatedShare")]),tc=w([d(),d("epoch"),g("bump"),g("status"),g("mintDecimalsA"),g("mintDecimalsB"),g("migrateType"),d("supply"),d("totalSellA"),d("virtualA"),d("virtualB"),d("realA"),d("realB"),d("totalFundRaisingB"),d("protocolFee"),d("platformFee"),d("migrateFee"),kr.replicate("vestingSchedule"),P("configId"),P("platformId"),P("mintA"),P("mintB"),P("vaultA"),P("vaultB"),P("creator"),g("mintProgramFlag"),g("cpmmCreatorFeeOn"),d("platformVestingShare"),R(g(),54)]),nc=w([d(),d("epoch"),P("poolId"),P("beneficiary"),d("claimedAmount"),d("tokenShareAmount"),R(d(),8)]),Ot=w([g("migrateType"),g("migrateCpmmFeeOn"),d("supply"),d("totalSellA"),d("totalFundRaisingB"),d("totalLockedAmount"),d("cliffPeriod"),d("unlockPeriod")]),Ar=w([d("epoch"),g("index"),P("configId"),Ot.replicate("bondingCurveParam"),R(d(),50)]),ic=w([d(),d("epoch"),P("platformClaimFeeWallet"),P("platformLockNftWallet"),d("platformScale"),d("creatorScale"),d("burnScale"),d("feeRate"),R(g(),64,"name"),R(g(),256,"web"),R(g(),256,"img"),P("cpConfigId"),d("creatorFeeRate"),P("transferFeeExtensionAuth"),P("platformVestingWallet"),d("platformVestingScale"),P("platformCpCreator"),R(g(),108),Nn(Ar,"platformCurve")]);var Qr=require("@solana/web3.js"),Jr=G(require("bn.js"));var dt=require("@solana/spl-token");var Tr=require("@solana/web3.js"),Ln=require("@solana/spl-token");var mt=require("@solana/web3.js"),jr=G(require("bn.js"));var qt=require("@solana/spl-token");var vr=G(require("bn.js"));var ie=G(require("bn.js")),Wt=new ie.default(0),Rn=new ie.default(1),Mn=new ie.default(-1),ct=new ie.default(1).shln(64),Fn=new ie.default(1).shln(128),hr=ct.sub(Rn);var Br=Fn.subn(1),Me=-443636,Ge=-Me,Et=new ie.default("4295048016"),vt=new ie.default("79226673521066979257578248091"),gc=new ie.default("4295048017"),Pc=new ie.default("79226673521066979257578248090");var xr=new ie.default(10).pow(new ie.default(6));var wc=new ie.default("18446744073700000000");var Er=G(require("bn.js"));var xc=Buffer.from("amm_con