UNPKG

@raydium-io/raydium-sdk-v2

Version:

An SDK for building applications on top of Raydium.

1 lines 168 kB
var cr=Object.defineProperty,ur=Object.defineProperties;var lr=Object.getOwnPropertyDescriptors;var Ut=Object.getOwnPropertySymbols;var Jn=Object.prototype.hasOwnProperty,$n=Object.prototype.propertyIsEnumerable;var Qn=(i,e,t)=>e in i?cr(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,C=(i,e)=>{for(var t in e||(e={}))Jn.call(e,t)&&Qn(i,t,e[t]);if(Ut)for(var t of Ut(e))$n.call(e,t)&&Qn(i,t,e[t]);return i},G=(i,e)=>ur(i,lr(e));var gt=(i,e)=>{var t={};for(var n in i)Jn.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&Ut)for(var n of Ut(i))e.indexOf(n)<0&&$n.call(i,n)&&(t[n]=i[n]);return t};import{PublicKey as v}from"@solana/web3.js";var bt=9e15,it=1e9,gn="0123456789abcdef",zt="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ht="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",bn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-bt,maxE:bt,crypto:!1},ii,Ye,_=!0,jt="[DecimalError] ",nt=jt+"Invalid argument: ",ri=jt+"Precision limit exceeded",oi=jt+"crypto unavailable",si="[object Decimal]",ke=Math.floor,de=Math.pow,mr=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,dr=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,fr=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ai=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Fe=1e7,E=7,pr=9007199254740991,gr=zt.length-1,yn=Ht.length-1,P={toStringTag:si};P.absoluteValue=P.abs=function(){var i=new this.constructor(this);return i.s<0&&(i.s=1),K(i)};P.ceil=function(){return K(new this.constructor(this),this.e+1,2)};P.clampedTo=P.clamp=function(i,e){var t,n=this,r=n.constructor;if(i=new r(i),e=new r(e),!i.s||!e.s)return new r(NaN);if(i.gt(e))throw Error(nt+e);return t=n.cmp(i),t<0?i:n.cmp(e)>0?e:new r(n)};P.comparedTo=P.cmp=function(i){var e,t,n,r,o=this,s=o.d,a=(i=new o.constructor(i)).d,c=o.s,u=i.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(o.e!==i.e)return o.e>i.e^c<0?1:-1;for(n=s.length,r=a.length,e=0,t=n<r?n:r;e<t;++e)if(s[e]!==a[e])return s[e]>a[e]^c<0?1:-1;return n===r?0:n>r^c<0?1:-1};P.cosine=P.cos=function(){var i,e,t=this,n=t.constructor;return t.d?t.d[0]?(i=n.precision,e=n.rounding,n.precision=i+Math.max(t.e,t.sd())+E,n.rounding=1,t=br(n,di(n,t)),n.precision=i,n.rounding=e,K(Ye==2||Ye==3?t.neg():t,i,e,!0)):new n(1):new n(NaN)};P.cubeRoot=P.cbrt=function(){var i,e,t,n,r,o,s,a,c,u,l=this,m=l.constructor;if(!l.isFinite()||l.isZero())return new m(l);for(_=!1,o=l.s*de(l.s*l,1/3),!o||Math.abs(o)==1/0?(t=ye(l.d),i=l.e,(o=(i-t.length+1)%3)&&(t+=o==1||o==-2?"0":"00"),o=de(t,1/3),i=ke((i+1)/3)-(i%3==(i<0?-1:2)),o==1/0?t="5e"+i:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+i),n=new m(t),n.s=l.s):n=new m(o.toString()),s=(i=m.precision)+3;;)if(a=n,c=a.times(a).times(a),u=c.plus(l),n=$(u.plus(l).times(a),u.plus(c),s+2,1),ye(a.d).slice(0,s)===(t=ye(n.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!r&&t=="4999"){if(!r&&(K(a,i+1,0),a.times(a).times(a).eq(l))){n=a;break}s+=4,r=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(K(n,i+1,1),e=!n.times(n).times(n).eq(l));break}return _=!0,K(n,i,m.rounding,e)};P.decimalPlaces=P.dp=function(){var i,e=this.d,t=NaN;if(e){if(i=e.length-1,t=(i-ke(this.e/E))*E,i=e[i],i)for(;i%10==0;i/=10)t--;t<0&&(t=0)}return t};P.dividedBy=P.div=function(i){return $(this,new this.constructor(i))};P.dividedToIntegerBy=P.divToInt=function(i){var e=this,t=e.constructor;return K($(e,new t(i),0,1,1),t.precision,t.rounding)};P.equals=P.eq=function(i){return this.cmp(i)===0};P.floor=function(){return K(new this.constructor(this),this.e+1,3)};P.greaterThan=P.gt=function(i){return this.cmp(i)>0};P.greaterThanOrEqualTo=P.gte=function(i){var e=this.cmp(i);return e==1||e===0};P.hyperbolicCosine=P.cosh=function(){var i,e,t,n,r,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;t=s.precision,n=s.rounding,s.precision=t+Math.max(o.e,o.sd())+4,s.rounding=1,r=o.d.length,r<32?(i=Math.ceil(r/3),e=(1/Qt(4,i)).toString()):(i=16,e="2.3283064365386962890625e-10"),o=yt(s,1,o.times(e),new s(1),!0);for(var c,u=i,l=new s(8);u--;)c=o.times(o),o=a.minus(c.times(l.minus(c.times(l))));return K(o,s.precision=t,s.rounding=n,!0)};P.hyperbolicSine=P.sinh=function(){var i,e,t,n,r=this,o=r.constructor;if(!r.isFinite()||r.isZero())return new o(r);if(e=o.precision,t=o.rounding,o.precision=e+Math.max(r.e,r.sd())+4,o.rounding=1,n=r.d.length,n<3)r=yt(o,2,r,r,!0);else{i=1.4*Math.sqrt(n),i=i>16?16:i|0,r=r.times(1/Qt(5,i)),r=yt(o,2,r,r,!0);for(var s,a=new o(5),c=new o(16),u=new o(20);i--;)s=r.times(r),r=r.times(a.plus(s.times(c.times(s).plus(u))))}return o.precision=e,o.rounding=t,K(r,e,t,!0)};P.hyperbolicTangent=P.tanh=function(){var i,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(i=n.precision,e=n.rounding,n.precision=i+7,n.rounding=1,$(t.sinh(),t.cosh(),n.precision=i,n.rounding=e)):new n(t.s)};P.inverseCosine=P.acos=function(){var i,e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,o=t.rounding;return n!==-1?n===0?e.isNeg()?Oe(t,r,o):new t(0):new t(NaN):e.isZero()?Oe(t,r+4,o).times(.5):(t.precision=r+6,t.rounding=1,e=e.asin(),i=Oe(t,r+4,o).times(.5),t.precision=r,t.rounding=o,i.minus(e))};P.inverseHyperbolicCosine=P.acosh=function(){var i,e,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(i=n.precision,e=n.rounding,n.precision=i+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,_=!1,t=t.times(t).minus(1).sqrt().plus(t),_=!0,n.precision=i,n.rounding=e,t.ln()):new n(t)};P.inverseHyperbolicSine=P.asinh=function(){var i,e,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(i=n.precision,e=n.rounding,n.precision=i+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,_=!1,t=t.times(t).plus(1).sqrt().plus(t),_=!0,n.precision=i,n.rounding=e,t.ln())};P.inverseHyperbolicTangent=P.atanh=function(){var i,e,t,n,r=this,o=r.constructor;return r.isFinite()?r.e>=0?new o(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(i=o.precision,e=o.rounding,n=r.sd(),Math.max(n,i)<2*-r.e-1?K(new o(r),i,e,!0):(o.precision=t=n-r.e,r=$(r.plus(1),new o(1).minus(r),t+i,1),o.precision=i+4,o.rounding=1,r=r.ln(),o.precision=i,o.rounding=e,r.times(.5))):new o(NaN)};P.inverseSine=P.asin=function(){var i,e,t,n,r=this,o=r.constructor;return r.isZero()?new o(r):(e=r.abs().cmp(1),t=o.precision,n=o.rounding,e!==-1?e===0?(i=Oe(o,t+4,n).times(.5),i.s=r.s,i):new o(NaN):(o.precision=t+6,o.rounding=1,r=r.div(new o(1).minus(r.times(r)).sqrt().plus(1)).atan(),o.precision=t,o.rounding=n,r.times(2)))};P.inverseTangent=P.atan=function(){var i,e,t,n,r,o,s,a,c,u=this,l=u.constructor,m=l.precision,d=l.rounding;if(u.isFinite()){if(u.isZero())return new l(u);if(u.abs().eq(1)&&m+4<=yn)return s=Oe(l,m+4,d).times(.25),s.s=u.s,s}else{if(!u.s)return new l(NaN);if(m+4<=yn)return s=Oe(l,m+4,d).times(.5),s.s=u.s,s}for(l.precision=a=m+10,l.rounding=1,t=Math.min(28,a/E+2|0),i=t;i;--i)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(_=!1,e=Math.ceil(a/E),n=1,c=u.times(u),s=new l(u),r=u;i!==-1;)if(r=r.times(c),o=s.minus(r.div(n+=2)),r=r.times(c),s=o.plus(r.div(n+=2)),s.d[e]!==void 0)for(i=e;s.d[i]===o.d[i]&&i--;);return t&&(s=s.times(2<<t-1)),_=!0,K(s,l.precision=m,l.rounding=d,!0)};P.isFinite=function(){return!!this.d};P.isInteger=P.isInt=function(){return!!this.d&&ke(this.e/E)>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(i){return this.cmp(i)<0};P.lessThanOrEqualTo=P.lte=function(i){return this.cmp(i)<1};P.logarithm=P.log=function(i){var e,t,n,r,o,s,a,c,u=this,l=u.constructor,m=l.precision,d=l.rounding,f=5;if(i==null)i=new l(10),e=!0;else{if(i=new l(i),t=i.d,i.s<0||!t||!t[0]||i.eq(1))return new l(NaN);e=i.eq(10)}if(t=u.d,u.s<0||!t||!t[0]||u.eq(1))return new l(t&&!t[0]?-1/0:u.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)o=!0;else{for(r=t[0];r%10===0;)r/=10;o=r!==1}if(_=!1,a=m+f,s=tt(u,a),n=e?Zt(l,a+10):tt(i,a),c=$(s,n,a,1),Pt(c.d,r=m,d))do if(a+=10,s=tt(u,a),n=e?Zt(l,a+10):tt(i,a),c=$(s,n,a,1),!o){+ye(c.d).slice(r+1,r+15)+1==1e14&&(c=K(c,m+1,0));break}while(Pt(c.d,r+=10,d));return _=!0,K(c,m,d)};P.minus=P.sub=function(i){var e,t,n,r,o,s,a,c,u,l,m,d,f=this,g=f.constructor;if(i=new g(i),!f.d||!i.d)return!f.s||!i.s?i=new g(NaN):f.d?i.s=-i.s:i=new g(i.d||f.s!==i.s?f:NaN),i;if(f.s!=i.s)return i.s=-i.s,f.plus(i);if(u=f.d,d=i.d,a=g.precision,c=g.rounding,!u[0]||!d[0]){if(d[0])i.s=-i.s;else if(u[0])i=new g(f);else return new g(c===3?-0:0);return _?K(i,a,c):i}if(t=ke(i.e/E),l=ke(f.e/E),u=u.slice(),o=l-t,o){for(m=o<0,m?(e=u,o=-o,s=d.length):(e=d,t=l,s=u.length),n=Math.max(Math.ceil(a/E),s)+2,o>n&&(o=n,e.length=1),e.reverse(),n=o;n--;)e.push(0);e.reverse()}else{for(n=u.length,s=d.length,m=n<s,m&&(s=n),n=0;n<s;n++)if(u[n]!=d[n]){m=u[n]<d[n];break}o=0}for(m&&(e=u,u=d,d=e,i.s=-i.s),s=u.length,n=d.length-s;n>0;--n)u[s++]=0;for(n=d.length;n>o;){if(u[--n]<d[n]){for(r=n;r&&u[--r]===0;)u[r]=Fe-1;--u[r],u[n]+=Fe}u[n]-=d[n]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--t;return u[0]?(i.d=u,i.e=Yt(u,t),_?K(i,a,c):i):new g(c===3?-0:0)};P.modulo=P.mod=function(i){var e,t=this,n=t.constructor;return i=new n(i),!t.d||!i.s||i.d&&!i.d[0]?new n(NaN):!i.d||t.d&&!t.d[0]?K(new n(t),n.precision,n.rounding):(_=!1,n.modulo==9?(e=$(t,i.abs(),0,3,1),e.s*=i.s):e=$(t,i,0,n.modulo,1),e=e.times(i),_=!0,t.minus(e))};P.naturalExponential=P.exp=function(){return wn(this)};P.naturalLogarithm=P.ln=function(){return tt(this)};P.negated=P.neg=function(){var i=new this.constructor(this);return i.s=-i.s,K(i)};P.plus=P.add=function(i){var e,t,n,r,o,s,a,c,u,l,m=this,d=m.constructor;if(i=new d(i),!m.d||!i.d)return!m.s||!i.s?i=new d(NaN):m.d||(i=new d(i.d||m.s===i.s?m:NaN)),i;if(m.s!=i.s)return i.s=-i.s,m.minus(i);if(u=m.d,l=i.d,a=d.precision,c=d.rounding,!u[0]||!l[0])return l[0]||(i=new d(m)),_?K(i,a,c):i;if(o=ke(m.e/E),n=ke(i.e/E),u=u.slice(),r=o-n,r){for(r<0?(t=u,r=-r,s=l.length):(t=l,n=o,s=u.length),o=Math.ceil(a/E),s=o>s?o+1:s+1,r>s&&(r=s,t.length=1),t.reverse();r--;)t.push(0);t.reverse()}for(s=u.length,r=l.length,s-r<0&&(r=s,t=l,l=u,u=t),e=0;r;)e=(u[--r]=u[r]+l[r]+e)/Fe|0,u[r]%=Fe;for(e&&(u.unshift(e),++n),s=u.length;u[--s]==0;)u.pop();return i.d=u,i.e=Yt(u,n),_?K(i,a,c):i};P.precision=P.sd=function(i){var e,t=this;if(i!==void 0&&i!==!!i&&i!==1&&i!==0)throw Error(nt+i);return t.d?(e=ci(t.d),i&&t.e+1>e&&(e=t.e+1)):e=NaN,e};P.round=function(){var i=this,e=i.constructor;return K(new e(i),i.e+1,e.rounding)};P.sine=P.sin=function(){var i,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(i=n.precision,e=n.rounding,n.precision=i+Math.max(t.e,t.sd())+E,n.rounding=1,t=wr(n,di(n,t)),n.precision=i,n.rounding=e,K(Ye>2?t.neg():t,i,e,!0)):new n(NaN)};P.squareRoot=P.sqrt=function(){var i,e,t,n,r,o,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(_=!1,u=Math.sqrt(+s),u==0||u==1/0?(e=ye(a),(e.length+c)%2==0&&(e+="0"),u=Math.sqrt(e),c=ke((c+1)/2)-(c<0||c%2),u==1/0?e="5e"+c:(e=u.toExponential(),e=e.slice(0,e.indexOf("e")+1)+c),n=new l(e)):n=new l(u.toString()),t=(c=l.precision)+3;;)if(o=n,n=o.plus($(s,o,t+2,1)).times(.5),ye(o.d).slice(0,t)===(e=ye(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!r&&e=="4999"){if(!r&&(K(o,c+1,0),o.times(o).eq(s))){n=o;break}t+=4,r=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(K(n,c+1,1),i=!n.times(n).eq(s));break}return _=!0,K(n,c,l.rounding,i)};P.tangent=P.tan=function(){var i,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(i=n.precision,e=n.rounding,n.precision=i+10,n.rounding=1,t=t.sin(),t.s=1,t=$(t,new n(1).minus(t.times(t)).sqrt(),i+10,0),n.precision=i,n.rounding=e,K(Ye==2||Ye==4?t.neg():t,i,e,!0)):new n(NaN)};P.times=P.mul=function(i){var e,t,n,r,o,s,a,c,u,l=this,m=l.constructor,d=l.d,f=(i=new m(i)).d;if(i.s*=l.s,!d||!d[0]||!f||!f[0])return new m(!i.s||d&&!d[0]&&!f||f&&!f[0]&&!d?NaN:!d||!f?i.s/0:i.s*0);for(t=ke(l.e/E)+ke(i.e/E),c=d.length,u=f.length,c<u&&(o=d,d=f,f=o,s=c,c=u,u=s),o=[],s=c+u,n=s;n--;)o.push(0);for(n=u;--n>=0;){for(e=0,r=c+n;r>n;)a=o[r]+f[n]*d[r-n-1]+e,o[r--]=a%Fe|0,e=a/Fe|0;o[r]=(o[r]+e)%Fe|0}for(;!o[--s];)o.pop();return e?++t:o.shift(),i.d=o,i.e=Yt(o,t),_?K(i,m.precision,m.rounding):i};P.toBinary=function(i,e){return An(this,2,i,e)};P.toDecimalPlaces=P.toDP=function(i,e){var t=this,n=t.constructor;return t=new n(t),i===void 0?t:(Ie(i,0,it),e===void 0?e=n.rounding:Ie(e,0,8),K(t,i+t.e+1,e))};P.toExponential=function(i,e){var t,n=this,r=n.constructor;return i===void 0?t=Ve(n,!0):(Ie(i,0,it),e===void 0?e=r.rounding:Ie(e,0,8),n=K(new r(n),i+1,e),t=Ve(n,!0,i+1)),n.isNeg()&&!n.isZero()?"-"+t:t};P.toFixed=function(i,e){var t,n,r=this,o=r.constructor;return i===void 0?t=Ve(r):(Ie(i,0,it),e===void 0?e=o.rounding:Ie(e,0,8),n=K(new o(r),i+r.e+1,e),t=Ve(n,!1,i+n.e+1)),r.isNeg()&&!r.isZero()?"-"+t:t};P.toFraction=function(i){var e,t,n,r,o,s,a,c,u,l,m,d,f=this,g=f.d,p=f.constructor;if(!g)return new p(f);if(u=t=new p(1),n=c=new p(0),e=new p(n),o=e.e=ci(g)-f.e-1,s=o%E,e.d[0]=de(10,s<0?E+s:s),i==null)i=o>0?e:u;else{if(a=new p(i),!a.isInt()||a.lt(u))throw Error(nt+a);i=a.gt(e)?o>0?e:u:a}for(_=!1,a=new p(ye(g)),l=p.precision,p.precision=o=g.length*E*2;m=$(a,e,0,1,1),r=t.plus(m.times(n)),r.cmp(i)!=1;)t=n,n=r,r=u,u=c.plus(m.times(r)),c=r,r=e,e=a.minus(m.times(r)),a=r;return r=$(i.minus(t),n,0,1,1),c=c.plus(r.times(u)),t=t.plus(r.times(n)),c.s=u.s=f.s,d=$(u,n,o,1).minus(f).abs().cmp($(c,t,o,1).minus(f).abs())<1?[u,n]:[c,t],p.precision=l,_=!0,d};P.toHexadecimal=P.toHex=function(i,e){return An(this,16,i,e)};P.toNearest=function(i,e){var t=this,n=t.constructor;if(t=new n(t),i==null){if(!t.d)return t;i=new n(1),e=n.rounding}else{if(i=new n(i),e===void 0?e=n.rounding:Ie(e,0,8),!t.d)return i.s?t:i;if(!i.d)return i.s&&(i.s=t.s),i}return i.d[0]?(_=!1,t=$(t,i,0,e,1).times(i),_=!0,K(t)):(i.s=t.s,t=i),t};P.toNumber=function(){return+this};P.toOctal=function(i,e){return An(this,8,i,e)};P.toPower=P.pow=function(i){var e,t,n,r,o,s,a=this,c=a.constructor,u=+(i=new c(i));if(!a.d||!i.d||!a.d[0]||!i.d[0])return new c(de(+a,u));if(a=new c(a),a.eq(1))return a;if(n=c.precision,o=c.rounding,i.eq(1))return K(a,n,o);if(e=ke(i.e/E),e>=i.d.length-1&&(t=u<0?-u:u)<=pr)return r=ui(c,a,t,n),i.s<0?new c(1).div(r):K(r,n,o);if(s=a.s,s<0){if(e<i.d.length-1)return new c(NaN);if((i.d[e]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return t=de(+a,u),e=t==0||!isFinite(t)?ke(u*(Math.log("0."+ye(a.d))/Math.LN10+a.e+1)):new c(t+"").e,e>c.maxE+1||e<c.minE-1?new c(e>0?s/0:0):(_=!1,c.rounding=a.s=1,t=Math.min(12,(e+"").length),r=wn(i.times(tt(a,n+t)),n),r.d&&(r=K(r,n+5,1),Pt(r.d,n,o)&&(e=n+10,r=K(wn(i.times(tt(a,e+t)),e),e+5,1),+ye(r.d).slice(n+1,n+15)+1==1e14&&(r=K(r,n+1,0)))),r.s=s,_=!0,c.rounding=o,K(r,n,o))};P.toPrecision=function(i,e){var t,n=this,r=n.constructor;return i===void 0?t=Ve(n,n.e<=r.toExpNeg||n.e>=r.toExpPos):(Ie(i,1,it),e===void 0?e=r.rounding:Ie(e,0,8),n=K(new r(n),i,e),t=Ve(n,i<=n.e||n.e<=r.toExpNeg,i)),n.isNeg()&&!n.isZero()?"-"+t:t};P.toSignificantDigits=P.toSD=function(i,e){var t=this,n=t.constructor;return i===void 0?(i=n.precision,e=n.rounding):(Ie(i,1,it),e===void 0?e=n.rounding:Ie(e,0,8)),K(new n(t),i,e)};P.toString=function(){var i=this,e=i.constructor,t=Ve(i,i.e<=e.toExpNeg||i.e>=e.toExpPos);return i.isNeg()&&!i.isZero()?"-"+t:t};P.truncated=P.trunc=function(){return K(new this.constructor(this),this.e+1,1)};P.valueOf=P.toJSON=function(){var i=this,e=i.constructor,t=Ve(i,i.e<=e.toExpNeg||i.e>=e.toExpPos);return i.isNeg()?"-"+t:t};function ye(i){var e,t,n,r=i.length-1,o="",s=i[0];if(r>0){for(o+=s,e=1;e<r;e++)n=i[e]+"",t=E-n.length,t&&(o+=et(t)),o+=n;s=i[e],n=s+"",t=E-n.length,t&&(o+=et(t))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function Ie(i,e,t){if(i!==~~i||i<e||i>t)throw Error(nt+i)}function Pt(i,e,t,n){var r,o,s,a;for(o=i[0];o>=10;o/=10)--e;return--e<0?(e+=E,r=0):(r=Math.ceil((e+1)/E),e%=E),o=de(10,E-e),a=i[r]%o|0,n==null?e<3?(e==0?a=a/100|0:e==1&&(a=a/10|0),s=t<4&&a==99999||t>3&&a==49999||a==5e4||a==0):s=(t<4&&a+1==o||t>3&&a+1==o/2)&&(i[r+1]/o/100|0)==de(10,e-2)-1||(a==o/2||a==0)&&(i[r+1]/o/100|0)==0:e<4?(e==0?a=a/1e3|0:e==1?a=a/100|0:e==2&&(a=a/10|0),s=(n||t<4)&&a==9999||!n&&t>3&&a==4999):s=((n||t<4)&&a+1==o||!n&&t>3&&a+1==o/2)&&(i[r+1]/o/1e3|0)==de(10,e-3)-1,s}function Xt(i,e,t){for(var n,r=[0],o,s=0,a=i.length;s<a;){for(o=r.length;o--;)r[o]*=e;for(r[0]+=gn.indexOf(i.charAt(s++)),n=0;n<r.length;n++)r[n]>t-1&&(r[n+1]===void 0&&(r[n+1]=0),r[n+1]+=r[n]/t|0,r[n]%=t)}return r.reverse()}function br(i,e){var t,n,r;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),r=(1/Qt(4,t)).toString()):(t=16,r="2.3283064365386962890625e-10"),i.precision+=t,e=yt(i,1,e.times(r),new i(1));for(var o=t;o--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return i.precision-=t,e}var $=function(){function i(n,r,o){var s,a=0,c=n.length;for(n=n.slice();c--;)s=n[c]*r+a,n[c]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function e(n,r,o,s){var a,c;if(o!=s)c=o>s?1:-1;else for(a=c=0;a<o;a++)if(n[a]!=r[a]){c=n[a]>r[a]?1:-1;break}return c}function t(n,r,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]<r[o]?1:0,n[o]=a*s+n[o]-r[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,r,o,s,a,c){var u,l,m,d,f,g,p,y,b,h,w,A,k,T,x,B,R,M,L,Z,ee=n.constructor,ce=n.s==r.s?1:-1,te=n.d,Y=r.d;if(!te||!te[0]||!Y||!Y[0])return new ee(!n.s||!r.s||(te?Y&&te[0]==Y[0]:!Y)?NaN:te&&te[0]==0||!Y?ce*0:ce/0);for(c?(f=1,l=n.e-r.e):(c=Fe,f=E,l=ke(n.e/f)-ke(r.e/f)),L=Y.length,R=te.length,b=new ee(ce),h=b.d=[],m=0;Y[m]==(te[m]||0);m++);if(Y[m]>(te[m]||0)&&l--,o==null?(T=o=ee.precision,s=ee.rounding):a?T=o+(n.e-r.e)+1:T=o,T<0)h.push(1),g=!0;else{if(T=T/f+2|0,m=0,L==1){for(d=0,Y=Y[0],T++;(m<R||d)&&T--;m++)x=d*c+(te[m]||0),h[m]=x/Y|0,d=x%Y|0;g=d||m<R}else{for(d=c/(Y[0]+1)|0,d>1&&(Y=i(Y,d,c),te=i(te,d,c),L=Y.length,R=te.length),B=L,w=te.slice(0,L),A=w.length;A<L;)w[A++]=0;Z=Y.slice(),Z.unshift(0),M=Y[0],Y[1]>=c/2&&++M;do d=0,u=e(Y,w,L,A),u<0?(k=w[0],L!=A&&(k=k*c+(w[1]||0)),d=k/M|0,d>1?(d>=c&&(d=c-1),p=i(Y,d,c),y=p.length,A=w.length,u=e(p,w,y,A),u==1&&(d--,t(p,L<y?Z:Y,y,c))):(d==0&&(u=d=1),p=Y.slice()),y=p.length,y<A&&p.unshift(0),t(w,p,A,c),u==-1&&(A=w.length,u=e(Y,w,L,A),u<1&&(d++,t(w,L<A?Z:Y,A,c))),A=w.length):u===0&&(d++,w=[0]),h[m++]=d,u&&w[0]?w[A++]=te[B]||0:(w=[te[B]],A=1);while((B++<R||w[0]!==void 0)&&T--);g=w[0]!==void 0}h[0]||h.shift()}if(f==1)b.e=l,ii=g;else{for(m=1,d=h[0];d>=10;d/=10)m++;b.e=m+l*f-1,K(b,a?o+b.e+1:o,s,g)}return b}}();function K(i,e,t,n){var r,o,s,a,c,u,l,m,d,f=i.constructor;e:if(e!=null){if(m=i.d,!m)return i;for(r=1,a=m[0];a>=10;a/=10)r++;if(o=e-r,o<0)o+=E,s=e,l=m[d=0],c=l/de(10,r-s-1)%10|0;else if(d=Math.ceil((o+1)/E),a=m.length,d>=a)if(n){for(;a++<=d;)m.push(0);l=c=0,r=1,o%=E,s=o-E+1}else break e;else{for(l=a=m[d],r=1;a>=10;a/=10)r++;o%=E,s=o-E+r,c=s<0?0:l/de(10,r-s-1)%10|0}if(n=n||e<0||m[d+1]!==void 0||(s<0?l:l%de(10,r-s-1)),u=t<4?(c||n)&&(t==0||t==(i.s<0?3:2)):c>5||c==5&&(t==4||n||t==6&&(o>0?s>0?l/de(10,r-s):0:m[d-1])%10&1||t==(i.s<0?8:7)),e<1||!m[0])return m.length=0,u?(e-=i.e+1,m[0]=de(10,(E-e%E)%E),i.e=-e||0):m[0]=i.e=0,i;if(o==0?(m.length=d,a=1,d--):(m.length=d+1,a=de(10,E-o),m[d]=s>0?(l/de(10,r-s)%de(10,s)|0)*a:0),u)for(;;)if(d==0){for(o=1,s=m[0];s>=10;s/=10)o++;for(s=m[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(i.e++,m[0]==Fe&&(m[0]=1));break}else{if(m[d]+=a,m[d]!=Fe)break;m[d--]=0,a=1}for(o=m.length;m[--o]===0;)m.pop()}return _&&(i.e>f.maxE?(i.d=null,i.e=NaN):i.e<f.minE&&(i.e=0,i.d=[0])),i}function Ve(i,e,t){if(!i.isFinite())return mi(i);var n,r=i.e,o=ye(i.d),s=o.length;return e?(t&&(n=t-s)>0?o=o.charAt(0)+"."+o.slice(1)+et(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i.e<0?"e":"e+")+i.e):r<0?(o="0."+et(-r-1)+o,t&&(n=t-s)>0&&(o+=et(n))):r>=s?(o+=et(r+1-s),t&&(n=t-r-1)>0&&(o=o+"."+et(n))):((n=r+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),t&&(n=t-s)>0&&(r+1===s&&(o+="."),o+=et(n))),o}function Yt(i,e){var t=i[0];for(e*=E;t>=10;t/=10)e++;return e}function Zt(i,e,t){if(e>gr)throw _=!0,t&&(i.precision=t),Error(ri);return K(new i(zt),e,1,!0)}function Oe(i,e,t){if(e>yn)throw Error(ri);return K(new i(Ht),e,t,!0)}function ci(i){var e=i.length-1,t=e*E+1;if(e=i[e],e){for(;e%10==0;e/=10)t--;for(e=i[0];e>=10;e/=10)t++}return t}function et(i){for(var e="";i--;)e+="0";return e}function ui(i,e,t,n){var r,o=new i(1),s=Math.ceil(n/E+4);for(_=!1;;){if(t%2&&(o=o.times(e),ti(o.d,s)&&(r=!0)),t=ke(t/2),t===0){t=o.d.length-1,r&&o.d[t]===0&&++o.d[t];break}e=e.times(e),ti(e.d,s)}return _=!0,o}function ei(i){return i.d[i.d.length-1]&1}function li(i,e,t){for(var n,r=new i(e[0]),o=0;++o<e.length;)if(n=new i(e[o]),n.s)r[t](n)&&(r=n);else{r=n;break}return r}function wn(i,e){var t,n,r,o,s,a,c,u=0,l=0,m=0,d=i.constructor,f=d.rounding,g=d.precision;if(!i.d||!i.d[0]||i.e>17)return new d(i.d?i.d[0]?i.s<0?0:1/0:1:i.s?i.s<0?0:i:0/0);for(e==null?(_=!1,c=g):c=e,a=new d(.03125);i.e>-2;)i=i.times(a),m+=5;for(n=Math.log(de(2,m))/Math.LN10*2+5|0,c+=n,t=o=s=new d(1),d.precision=c;;){if(o=K(o.times(i),c,1),t=t.times(++l),a=s.plus($(o,t,c,1)),ye(a.d).slice(0,c)===ye(s.d).slice(0,c)){for(r=m;r--;)s=K(s.times(s),c,1);if(e==null)if(u<3&&Pt(s.d,c-n,f,u))d.precision=c+=10,t=o=a=new d(1),l=0,u++;else return K(s,d.precision=g,f,_=!0);else return d.precision=g,s}s=a}}function tt(i,e){var t,n,r,o,s,a,c,u,l,m,d,f=1,g=10,p=i,y=p.d,b=p.constructor,h=b.rounding,w=b.precision;if(p.s<0||!y||!y[0]||!p.e&&y[0]==1&&y.length==1)return new b(y&&!y[0]?-1/0:p.s!=1?NaN:y?0:p);if(e==null?(_=!1,l=w):l=e,b.precision=l+=g,t=ye(y),n=t.charAt(0),Math.abs(o=p.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)p=p.times(i),t=ye(p.d),n=t.charAt(0),f++;o=p.e,n>1?(p=new b("0."+t),o++):p=new b(n+"."+t.slice(1))}else return u=Zt(b,l+2,w).times(o+""),p=tt(new b(n+"."+t.slice(1)),l-g).plus(u),b.precision=w,e==null?K(p,w,h,_=!0):p;for(m=p,c=s=p=$(p.minus(1),p.plus(1),l,1),d=K(p.times(p),l,1),r=3;;){if(s=K(s.times(d),l,1),u=c.plus($(s,new b(r),l,1)),ye(u.d).slice(0,l)===ye(c.d).slice(0,l))if(c=c.times(2),o!==0&&(c=c.plus(Zt(b,l+2,w).times(o+""))),c=$(c,new b(f),l,1),e==null)if(Pt(c.d,l-g,h,a))b.precision=l+=g,u=s=p=$(m.minus(1),m.plus(1),l,1),d=K(p.times(p),l,1),r=a=1;else return K(c,b.precision=w,h,_=!0);else return b.precision=w,c;c=u,r+=2}}function mi(i){return String(i.s*i.s/0)}function hn(i,e){var t,n,r;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),n=0;e.charCodeAt(n)===48;n++);for(r=e.length;e.charCodeAt(r-1)===48;--r);if(e=e.slice(n,r),e){if(r-=n,i.e=t=t-n-1,i.d=[],n=(t+1)%E,t<0&&(n+=E),n<r){for(n&&i.d.push(+e.slice(0,n)),r-=E;n<r;)i.d.push(+e.slice(n,n+=E));e=e.slice(n),n=E-e.length}else n-=r;for(;n--;)e+="0";i.d.push(+e),_&&(i.e>i.constructor.maxE?(i.d=null,i.e=NaN):i.e<i.constructor.minE&&(i.e=0,i.d=[0]))}else i.e=0,i.d=[0];return i}function yr(i,e){var t,n,r,o,s,a,c,u,l;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),ai.test(e))return hn(i,e)}else if(e==="Infinity"||e==="NaN")return+e||(i.s=NaN),i.e=NaN,i.d=null,i;if(dr.test(e))t=16,e=e.toLowerCase();else if(mr.test(e))t=2;else if(fr.test(e))t=8;else throw Error(nt+e);for(o=e.search(/p/i),o>0?(c=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),o=e.indexOf("."),s=o>=0,n=i.constructor,s&&(e=e.replace(".",""),a=e.length,o=a-o,r=ui(n,new n(t),o,o*2)),u=Xt(e,t,Fe),l=u.length-1,o=l;u[o]===0;--o)u.pop();return o<0?new n(i.s*0):(i.e=Yt(u,l),i.d=u,_=!1,s&&(i=$(i,r,a*4)),c&&(i=i.times(Math.abs(c)<54?de(2,c):kt.pow(2,c))),_=!0,i)}function wr(i,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:yt(i,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/Qt(5,t)),e=yt(i,2,e,e);for(var r,o=new i(5),s=new i(16),a=new i(20);t--;)r=e.times(e),e=e.times(o.plus(r.times(s.times(r).minus(a))));return e}function yt(i,e,t,n,r){var o,s,a,c,u=1,l=i.precision,m=Math.ceil(l/E);for(_=!1,c=t.times(t),a=new i(n);;){if(s=$(a.times(c),new i(e++*e++),l,1),a=r?n.plus(s):n.minus(s),n=$(s.times(c),new i(e++*e++),l,1),s=a.plus(n),s.d[m]!==void 0){for(o=m;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return _=!0,s.d.length=m+1,s}function Qt(i,e){for(var t=i;--e;)t*=i;return t}function di(i,e){var t,n=e.s<0,r=Oe(i,i.precision,1),o=r.times(.5);if(e=e.abs(),e.lte(o))return Ye=n?4:1,e;if(t=e.divToInt(r),t.isZero())Ye=n?3:2;else{if(e=e.minus(t.times(r)),e.lte(o))return Ye=ei(t)?n?2:3:n?4:1,e;Ye=ei(t)?n?1:4:n?3:2}return e.minus(r).abs()}function An(i,e,t,n){var r,o,s,a,c,u,l,m,d,f=i.constructor,g=t!==void 0;if(g?(Ie(t,1,it),n===void 0?n=f.rounding:Ie(n,0,8)):(t=f.precision,n=f.rounding),!i.isFinite())l=mi(i);else{for(l=Ve(i),s=l.indexOf("."),g?(r=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):r=e,s>=0&&(l=l.replace(".",""),d=new f(1),d.e=l.length-s,d.d=Xt(Ve(d),10,r),d.e=d.d.length),m=Xt(l,10,r),o=c=m.length;m[--c]==0;)m.pop();if(!m[0])l=g?"0p+0":"0";else{if(s<0?o--:(i=new f(i),i.d=m,i.e=o,i=$(i,d,t,n,0,r),m=i.d,o=i.e,u=ii),s=m[t],a=r/2,u=u||m[t+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(i.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&m[t-1]&1||n===(i.s<0?8:7)),m.length=t,u)for(;++m[--t]>r-1;)m[t]=0,t||(++o,m.unshift(1));for(c=m.length;!m[c-1];--c);for(s=0,l="";s<c;s++)l+=gn.charAt(m[s]);if(g){if(c>1)if(e==16||e==8){for(s=e==16?4:3,--c;c%s;c++)l+="0";for(m=Xt(l,r,e),c=m.length;!m[c-1];--c);for(s=1,l="1.";s<c;s++)l+=gn.charAt(m[s])}else l=l.charAt(0)+"."+l.slice(1);l=l+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)l="0"+l;l="0."+l}else if(++o>c)for(o-=c;o--;)l+="0";else o<c&&(l=l.slice(0,o)+"."+l.slice(o))}l=(e==16?"0x":e==2?"0b":e==8?"0o":"")+l}return i.s<0?"-"+l:l}function ti(i,e){if(i.length>e)return i.length=e,!0}function hr(i){return new this(i).abs()}function Ar(i){return new this(i).acos()}function Tr(i){return new this(i).acosh()}function Pr(i,e){return new this(i).plus(e)}function kr(i){return new this(i).asin()}function xr(i){return new this(i).asinh()}function Br(i){return new this(i).atan()}function Ir(i){return new this(i).atanh()}function Sr(i,e){i=new this(i),e=new this(e);var t,n=this.precision,r=this.rounding,o=n+4;return!i.s||!e.s?t=new this(NaN):!i.d&&!e.d?(t=Oe(this,o,1).times(e.s>0?.25:.75),t.s=i.s):!e.d||i.isZero()?(t=e.s<0?Oe(this,n,r):new this(0),t.s=i.s):!i.d||e.isZero()?(t=Oe(this,o,1).times(.5),t.s=i.s):e.s<0?(this.precision=o,this.rounding=1,t=this.atan($(i,e,o,1)),e=Oe(this,o,1),this.precision=n,this.rounding=r,t=i.s<0?t.minus(e):t.plus(e)):t=this.atan($(i,e,o,1)),t}function Cr(i){return new this(i).cbrt()}function Nr(i){return K(i=new this(i),i.e+1,2)}function Kr(i,e,t){return new this(i).clamp(e,t)}function Rr(i){if(!i||typeof i!="object")throw Error(jt+"Object expected");var e,t,n,r=i.defaults===!0,o=["precision",1,it,"rounding",0,8,"toExpNeg",-bt,0,"toExpPos",0,bt,"maxE",0,bt,"minE",-bt,0,"modulo",0,9];for(e=0;e<o.length;e+=3)if(t=o[e],r&&(this[t]=bn[t]),(n=i[t])!==void 0)if(ke(n)===n&&n>=o[e+1]&&n<=o[e+2])this[t]=n;else throw Error(nt+t+": "+n);if(t="crypto",r&&(this[t]=bn[t]),(n=i[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(oi);else this[t]=!1;else throw Error(nt+t+": "+n);return this}function Lr(i){return new this(i).cos()}function Mr(i){return new this(i).cosh()}function fi(i){var e,t,n;function r(o){var s,a,c,u=this;if(!(u instanceof r))return new r(o);if(u.constructor=r,ni(o)){u.s=o.s,_?!o.d||o.e>r.maxE?(u.e=NaN,u.d=null):o.e<r.minE?(u.e=0,u.d=[0]):(u.e=o.e,u.d=o.d.slice()):(u.e=o.e,u.d=o.d?o.d.slice():o.d);return}if(c=typeof o,c==="number"){if(o===0){u.s=1/o<0?-1:1,u.e=0,u.d=[0];return}if(o<0?(o=-o,u.s=-1):u.s=1,o===~~o&&o<1e7){for(s=0,a=o;a>=10;a/=10)s++;_?s>r.maxE?(u.e=NaN,u.d=null):s<r.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[o]):(u.e=s,u.d=[o]);return}else if(o*0!==0){o||(u.s=NaN),u.e=NaN,u.d=null;return}return hn(u,o.toString())}else if(c!=="string")throw Error(nt+o);return(a=o.charCodeAt(0))===45?(o=o.slice(1),u.s=-1):(a===43&&(o=o.slice(1)),u.s=1),ai.test(o)?hn(u,o):yr(u,o)}if(r.prototype=P,r.ROUND_UP=0,r.ROUND_DOWN=1,r.ROUND_CEIL=2,r.ROUND_FLOOR=3,r.ROUND_HALF_UP=4,r.ROUND_HALF_DOWN=5,r.ROUND_HALF_EVEN=6,r.ROUND_HALF_CEIL=7,r.ROUND_HALF_FLOOR=8,r.EUCLID=9,r.config=r.set=Rr,r.clone=fi,r.isDecimal=ni,r.abs=hr,r.acos=Ar,r.acosh=Tr,r.add=Pr,r.asin=kr,r.asinh=xr,r.atan=Br,r.atanh=Ir,r.atan2=Sr,r.cbrt=Cr,r.ceil=Nr,r.clamp=Kr,r.cos=Lr,r.cosh=Mr,r.div=Er,r.exp=Or,r.floor=Fr,r.hypot=Dr,r.ln=_r,r.log=vr,r.log10=Wr,r.log2=qr,r.max=Vr,r.min=Gr,r.mod=Ur,r.mul=Xr,r.pow=zr,r.random=Hr,r.round=Zr,r.sign=jr,r.sin=Yr,r.sinh=Qr,r.sqrt=Jr,r.sub=$r,r.sum=eo,r.tan=to,r.tanh=no,r.trunc=io,i===void 0&&(i={}),i&&i.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)i.hasOwnProperty(t=n[e++])||(i[t]=this[t]);return r.config(i),r}function Er(i,e){return new this(i).div(e)}function Or(i){return new this(i).exp()}function Fr(i){return K(i=new this(i),i.e+1,3)}function Dr(){var i,e,t=new this(0);for(_=!1,i=0;i<arguments.length;)if(e=new this(arguments[i++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return _=!0,new this(1/0);t=e}return _=!0,t.sqrt()}function ni(i){return i instanceof kt||i&&i.toStringTag===si||!1}function _r(i){return new this(i).ln()}function vr(i,e){return new this(i).log(e)}function qr(i){return new this(i).log(2)}function Wr(i){return new this(i).log(10)}function Vr(){return li(this,arguments,"lt")}function Gr(){return li(this,arguments,"gt")}function Ur(i,e){return new this(i).mod(e)}function Xr(i,e){return new this(i).mul(e)}function zr(i,e){return new this(i).pow(e)}function Hr(i){var e,t,n,r,o=0,s=new this(1),a=[];if(i===void 0?i=this.precision:Ie(i,1,it),n=Math.ceil(i/E),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));o<n;)r=e[o],r>=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=r%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);o<n;)r=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((e[o+3]&127)<<24),r>=214e7?crypto.randomBytes(4).copy(e,o):(a.push(r%1e7),o+=4);o=n/4}else throw Error(oi);else for(;o<n;)a[o++]=Math.random()*1e7|0;for(n=a[--o],i%=E,n&&i&&(r=de(10,E-i),a[o]=(n/r|0)*r);a[o]===0;o--)a.pop();if(o<0)t=0,a=[0];else{for(t=-1;a[0]===0;t-=E)a.shift();for(n=1,r=a[0];r>=10;r/=10)n++;n<E&&(t-=E-n)}return s.e=t,s.d=a,s}function Zr(i){return K(i=new this(i),i.e+1,this.rounding)}function jr(i){return i=new this(i),i.d?i.d[0]?i.s:0*i.s:i.s||NaN}function Yr(i){return new this(i).sin()}function Qr(i){return new this(i).sinh()}function Jr(i){return new this(i).sqrt()}function $r(i,e){return new this(i).sub(e)}function eo(){var i=0,e=arguments,t=new this(e[i]);for(_=!1;t.s&&++i<e.length;)t=t.plus(e[i]);return _=!0,K(t,this.precision,this.rounding)}function to(i){return new this(i).tan()}function no(i){return new this(i).tanh()}function io(i){return K(i=new this(i),i.e+1,1)}P[Symbol.for("nodejs.util.inspect.custom")]=P.toString;P[Symbol.toStringTag]="Decimal";var kt=P.constructor=fi(bn);zt=new kt(zt);Ht=new kt(Ht);var S=kt;import{get as pi,set as ro}from"lodash";var Tn=class{constructor(e){this.logLevel=e.logLevel!==void 0?e.logLevel:0,this.name=e.name}set level(e){this.logLevel=e}get time(){return Date.now().toString()}get moduleName(){return this.name}isLogLevel(e){return e<=this.logLevel}error(...e){return this.isLogLevel(0)?(console.error(this.time,this.name,"sdk logger error",...e),this):this}logWithError(...e){let t=e.map(n=>typeof n=="object"?JSON.stringify(n):n).join(", ");throw new Error(t)}warning(...e){return this.isLogLevel(1)?(console.warn(this.time,this.name,"sdk logger warning",...e),this):this}info(...e){return this.isLogLevel(2)?(console.info(this.time,this.name,"sdk logger info",...e),this):this}debug(...e){return this.isLogLevel(3)?(console.debug(this.time,this.name,"sdk logger debug",...e),this):this}},gi={},oo={};function we(i){let e=pi(gi,i);if(!e){let t=pi(oo,i);e=new Tn({name:i,logLevel:t}),ro(gi,i,e)}return e}import{PublicKey as rc}from"@solana/web3.js";import sc from"bn.js";import Ao from"big.js";import nn from"bn.js";import Se from"bn.js";import{PublicKey as Bn}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as so}from"@solana/spl-token";import{PublicKey as re,SystemProgram as bi,SYSVAR_RENT_PUBKEY as ao}from"@solana/web3.js";function Pn({pubkey:i,isSigner:e=!1,isWritable:t=!0}){return{pubkey:i,isWritable:t,isSigner:e}}var ws=[Pn({pubkey:so,isWritable:!1}),Pn({pubkey:bi.programId,isWritable:!1}),Pn({pubkey:ao,isWritable:!1})];function kn({publicKey:i,transformSol:e}){let t=yi(i.toString());if(t instanceof re)return e&&t.equals(xt)?Q:t;if(e&&t.toString()===xt.toBase58())return Q;if(typeof t=="string"){if(t===re.default.toBase58())return re.default;try{return new re(t)}catch{throw new Error("invalid public key")}}throw new Error("invalid public key")}function yi(i){try{return new re(i)}catch{return i}}var Jt=new re("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),hs=new re("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),Bt=new re("SysvarRent111111111111111111111111111111111"),As=new re("SysvarC1ock11111111111111111111111111111111"),wt=new re("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),Ts=new re("Sysvar1nstructions1111111111111111111111111"),Ps=bi.programId,ks=new re("4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"),xs=new re("Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS"),Bs=new re("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"),Is=new re("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),Ss=new re("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),Cs=new re("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"),Ns=new re("7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"),Ks=new re("USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX"),Rs=new re("NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa"),Ls=new re("ANAxByE6G2WjFp7A4NqtWYXb3mgruyzZYg3spfxe6Lbo"),Ms=new re("7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs"),Q=new re("So11111111111111111111111111111111111111112"),xt=re.default;function ut(i){return kn({publicKey:i,transformSol:!0})}import{PublicKey as co}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as wi}from"@solana/spl-token";var xn={chainId:101,address:co.default.toBase58(),programId:wi.toBase58(),decimals:9,symbol:"SOL",name:"solana",logoURI:"https://img.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}},rt={chainId:101,address:"So11111111111111111111111111111111111111112",programId:wi.toBase58(),decimals:9,symbol:"WSOL",name:"Wrapped SOL",logoURI:"https://img.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}};var In=class{constructor({mint:e,decimals:t,symbol:n,name:r,skipMint:o=!1,isToken2022:s=!1}){if(e===xt.toBase58()||e instanceof Bn&&xt.equals(e)){this.decimals=rt.decimals,this.symbol=rt.symbol,this.name=rt.name,this.mint=new Bn(rt.address),this.isToken2022=!1;return}this.decimals=t,this.symbol=n||e.toString().substring(0,6),this.name=r||e.toString().substring(0,6),this.mint=o?Bn.default:kn({publicKey:e}),this.isToken2022=s}equals(e){return this===e?!0:this.mint.equals(e.mint)}},Ge=In;Ge.WSOL=new In(G(C({},rt),{mint:rt.address}));import en from"big.js";import mo from"bn.js";import fo from"decimal.js-light";import uo from"toformat";var lo=uo,It=lo;var $t=we("module/fraction"),Sn=It(en),St=It(fo),po={[0]:St.ROUND_DOWN,[1]:St.ROUND_HALF_UP,[2]:St.ROUND_UP},go={[0]:en.roundDown,[1]:en.roundHalfUp,[2]:en.roundUp},j=class{constructor(e,t=new mo(1)){this.numerator=he(e),this.denominator=he(t)}get quotient(){return this.numerator.div(this.denominator)}invert(){return new j(this.denominator,this.numerator)}add(e){let t=e instanceof j?e:new j(he(e));return this.denominator.eq(t.denominator)?new j(this.numerator.add(t.numerator),this.denominator):new j(this.numerator.mul(t.denominator).add(t.numerator.mul(this.denominator)),this.denominator.mul(t.denominator))}sub(e){let t=e instanceof j?e:new j(he(e));return this.denominator.eq(t.denominator)?new j(this.numerator.sub(t.numerator),this.denominator):new j(this.numerator.mul(t.denominator).sub(t.numerator.mul(this.denominator)),this.denominator.mul(t.denominator))}mul(e){let t=e instanceof j?e:new j(he(e));return new j(this.numerator.mul(t.numerator),this.denominator.mul(t.denominator))}div(e){let t=e instanceof j?e:new j(he(e));return new j(this.numerator.mul(t.denominator),this.denominator.mul(t.numerator))}toSignificant(e,t={groupSeparator:""},n=1){Number.isInteger(e)||$t.logWithError(`${e} is not an integer.`),e<=0&&$t.logWithError(`${e} is not positive.`),St.set({precision:e+1,rounding:po[n]});let r=new St(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(e);return r.toFormat(r.decimalPlaces(),t)}toFixed(e,t={groupSeparator:""},n=1){return Number.isInteger(e)||$t.logWithError(`${e} is not an integer.`),e<0&&$t.logWithError(`${e} is negative.`),Sn.DP=e,Sn.RM=go[n]||1,new Sn(this.numerator.toString()).div(this.denominator.toString()).toFormat(e,t)}isZero(){return this.numerator.isZero()}};var yo=we("Raydium_price"),De=class extends j{constructor(t){let{baseToken:n,quoteToken:r,numerator:o,denominator:s}=t;super(o,s);this.baseToken=n,this.quoteToken=r,this.scalar=new j(Cn(n.decimals),Cn(r.decimals))}get raw(){return new j(this.numerator,this.denominator)}get adjusted(){return super.mul(this.scalar)}invert(){return new De({baseToken:this.quoteToken,quoteToken:this.baseToken,denominator:this.numerator,numerator:this.denominator})}mul(t){this.quoteToken!==t.baseToken&&yo.logWithError("mul token not equals");let n=super.mul(t);return new De({baseToken:this.baseToken,quoteToken:t.quoteToken,denominator:n.denominator,numerator:n.numerator})}toSignificant(t=this.quoteToken.decimals,n,r){return this.adjusted.toSignificant(t,n,r)}toFixed(t=this.quoteToken.decimals,n,r){return this.adjusted.toFixed(t,n,r)}};var Nn=class{constructor({decimals:e,symbol:t="UNKNOWN",name:n="UNKNOWN"}){this.decimals=e,this.symbol=t,this.name=n}equals(e){return this===e}},tn=Nn;tn.SOL=new Nn(xn);import wo from"bn.js";var hi=new j(new wo(100)),ot=class extends j{toSignificant(e=5,t,n){return this.mul(hi).toSignificant(e,t,n)}toFixed(e=2,t,n){return this.mul(hi).toFixed(e,t,n)}};var ho=new Se(0),Na=new Se(1),Ka=new Se(2),Ra=new Se(3),La=new Se(5),Kn=new Se(10),Ma=new Se(100),Ea=new Se(1e3),Oa=new Se(1e4),Ai=9007199254740991;function he(i){let e=we("Raydium_parseBigNumberish");if(i instanceof Se)return i;if(typeof i=="string"){if(i.match(/^-?[0-9]+$/))return new Se(i);e.logWithError(`invalid BigNumberish string: ${i}`)}return typeof i=="number"?(i%1&&e.logWithError(`BigNumberish number underflow: ${i}`),(i>=Ai||i<=-Ai)&&e.logWithError(`BigNumberish number overflow: ${i}`),new Se(String(i))):typeof i=="bigint"?new Se(i.toString()):(e.error(`invalid BigNumberish value: ${i}`),new Se(0))}function Cn(i){return Kn.pow(he(i))}var To=we("Raydium_amount"),Ti=It(Ao);function Po(i,e){let t="0",n="0";if(i.includes(".")){let r=i.split(".");r.length===2?([t,n]=r,n=n.padEnd(e,"0")):To.logWithError(`invalid number string, num: ${i}`)}else t=i;return[t,n.slice(0,e)||n]}var Ae=class extends j{constructor(t,n,r=!0,o){let s=new nn(0),a=Kn.pow(new nn(t.decimals));if(r)s=he(n);else{let c=new nn(0),u=new nn(0);if(typeof n=="string"||typeof n=="number"||typeof n=="bigint"){let[l,m]=Po(n.toString(),t.decimals);c=he(l),u=he(m)}c=c.mul(a),s=c.add(u)}super(s,a);this.logger=we(o||"TokenAmount"),this.token=t}get raw(){return this.numerator}isZero(){return this.raw.isZero()}gt(t){return this.token.equals(t.token)||this.logger.logWithError("gt token not equals"),this.raw.gt(t.raw)}lt(t){return this.token.equals(t.token)||this.logger.logWithError("lt token not equals"),this.raw.lt(t.raw)}add(t){return this.token.equals(t.token)||this.logger.logWithError("add token not equals"),new Ae(this.token,this.raw.add(t.raw))}subtract(t){return this.token.equals(t.token)||this.logger.logWithError("sub token not equals"),new Ae(this.token,this.raw.sub(t.raw))}toSignificant(t=this.token.decimals,n,r=0){return super.toSignificant(t,n,r)}toFixed(t=this.token.decimals,n,r=0){return t>this.token.decimals&&this.logger.logWithError("decimals overflow"),super.toFixed(t,n,r)}toExact(t={groupSeparator:""}){return Ti.DP=this.token.decimals,new Ti(this.numerator.toString()).div(this.denominator.toString()).toFormat(t)}};import{PublicKey as Kt,sendAndConfirmTransaction as En,Transaction as Rt,TransactionMessage as Lt,VersionedTransaction as Mt}from"@solana/web3.js";import Eo from"axios";var ue={CreateAccount:"CreateAccount",InitAccount:"InitAccount",CreateATA:"CreateATA",CloseAccount:"CloseAccount",TransferAmount:"TransferAmount",InitMint:"InitMint",MintTo:"MintTo",InitMarket:"InitMarket",Util1216OwnerClaim:"Util1216OwnerClaim",SetComputeUnitPrice:"SetComputeUnitPrice",SetComputeUnitLimit:"SetComputeUnitLimit",ClmmCreatePool:"ClmmCreatePool",ClmmOpenPosition:"ClmmOpenPosition",ClmmIncreasePosition:"ClmmIncreasePosition",ClmmDecreasePosition:"ClmmDecreasePosition",ClmmClosePosition:"ClmmClosePosition",ClmmSwapBaseIn:"ClmmSwapBaseIn",ClmmSwapBaseOut:"ClmmSwapBaseOut",ClmmInitReward:"ClmmInitReward",ClmmSetReward:"ClmmSetReward",ClmmCollectReward:"ClmmCollectReward",AmmV4Swap:"AmmV4Swap",AmmV4AddLiquidity:"AmmV4AddLiquidity",AmmV4RemoveLiquidity:"AmmV4RemoveLiquidity",AmmV4SimulatePoolInfo:"AmmV4SimulatePoolInfo",AmmV4SwapBaseIn:"AmmV4SwapBaseIn",AmmV4SwapBaseOut:"AmmV4SwapBaseOut",AmmV4CreatePool:"AmmV4CreatePool",AmmV4InitPool:"AmmV4InitPool",AmmV5AddLiquidity:"AmmV5AddLiquidity",AmmV5RemoveLiquidity:"AmmV5RemoveLiquidity",AmmV5SimulatePoolInfo:"AmmV5SimulatePoolInfo",AmmV5SwapBaseIn:"AmmV5SwapBaseIn",AmmV5SwapBaseOut:"AmmV5SwapBaseOut",RouteSwap:"RouteSwap",RouteSwap1:"RouteSwap1",RouteSwap2:"RouteSwap2",FarmV3Deposit:"FarmV3Deposit",FarmV3Withdraw:"FarmV3Withdraw",FarmV3CreateLedger:"FarmV3CreateLedger",FarmV5Deposit:"FarmV5Deposit",FarmV5Withdraw:"FarmV5Withdraw",FarmV5CreateLedger:"FarmV5CreateLedger",FarmV6Deposit:"FarmV6Deposit",FarmV6Withdraw:"FarmV6Withdraw",FarmV6Create:"FarmV6Create",FarmV6Restart:"FarmV6Restart",FarmV6CreatorAddReward:"FarmV6CreatorAddReward",FarmV6CreatorWithdraw:"FarmV6CreatorWithdraw",CpmmCreatePool:"CpmmCreatePool",CpmmAddLiquidity:"CpmmAddLiquidity",CpmmWithdrawLiquidity:"CpmmWithdrawLiquidity",CpmmSwapBaseIn:"CpmmSwapBaseIn",CpmmSwapBaseOut:"CpmmSwapBaseOut"};import{PublicKey as ko,ComputeBudgetProgram as Pi,Transaction as xi,TransactionMessage as xo,Keypair as Bi,VersionedTransaction as Ii}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as Bo}from"@solana/spl-token";var ki=we("Raydium_txUtil"),Si=1644;function rn(i){let e=[],t=[];return i.microLamports&&(e.push(Pi.setComputeUnitPrice({microLamports:i.microLamports})),t.push(ue.SetComputeUnitPrice)),i.units&&(e.push(Pi.setComputeUnitLimit({units:i.units})),t.push(ue.SetComputeUnitLimit)),{instructions:e,instructionTypes:t}}async function ht(i,e){var n,r;let t=e!=null?e:"confirmed";try{return((r=await((n=i.getLatestBlockhash)==null?void 0:n.call(i,{commitment:t})))==null?void 0:r.blockhash)||(await i.getRecentBlockhash(t)).blockhash}catch{return(await i.getRecentBlockhash(t)).blockhash}}function Io(i,e){i.length<1&&ki.logWithError(`no instructions provided: ${i.toString()}`),e.length<1&&ki.logWithError(`no signers provided:, ${e.toString()}`);let t=new xi;t.recentBlockhash="11111111111111111111111111111111",t.feePayer=e[0],t.add(...i);try{return Buffer.from(t.serialize({verifySignatures:!1})).toString("base64").length<Si}catch{return!1}}function Ne(i,e){let[t,n]=ko.findProgramAddressSync(i,e);return{publicKey:t,nonce:n}}function Ct({instructions:i,payer:e,signers:t}){return Io(i,[e,...t])}function Nt({instructions:i,payer:e,lookupTableAddressAccount:t,recentBlockhash:n=Bi.generate().publicKey.toString()}){let o=new xo({payerKey:e,recentBlockhash:n,instructions:i}).compileToV0Message(Object.values(t!=null?t:{}));try{return Buffer.from(new Ii(o).serialize()).toString("base64").length<Si}catch{return!1}}var So=i=>Buffer.isBuffer(i)?i:i instanceof Uint8Array?Buffer.from(i.buffer,i.byteOffset,i.byteLength):Buffer.from(i),Co=i=>{let e=i.serialize({requireAllSignatures:!1,verifySignatures:!1});i instanceof Ii&&(e=So(e));try{return e instanceof Buffer?e.toString("base64"):Buffer.from(e).toString("base64")}catch{return e.toString("base64")}};function lt(i){let e=[];return i.forEach(t=>{t instanceof xi&&(t.recentBlockhash||(t.recentBlockhash=Bo.toBase58()),t.feePayer||(t.feePayer=Bi.generate().publicKey)),e.push(Co(t))}),console.log("simulate tx string:",e),e}import{PublicKey as Ki,AddressLookupTableAccount as on}from"@solana/web3.js";import{PublicKey as Ci}from"@solana/web3.js";import{MINT_SIZE as No,TOKEN_PROGRAM_ID as Ko,getTransferFeeConfig as Ro,unpackMint as Lo}from"@solana/spl-token";var Rn=we("Raydium_accountInfo_util");async function Qe(i,e,t){let{batchRequest:n,commitment:r="confirmed",chunkCount:o=100}=C({batchRequest:!1},t),s=Ln(e,o),a=new Array(s.length).fill([]);if(n){let c=s.map(m=>{let d=i._buildArgs([m.map(f=>f.toBase58())],r,"base64");return{methodName:"getMultipleAccounts",args:d}}),u=Ln(c,10);a=(await(await Promise.all(u.map(async m=>await i._rpcBatchRequest(m)))).flat()).map(m=>(m.error&&Rn.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${m.error.message}`),m.result.value.map(d=>{if(d){let{data:f,executable:g,lamports:p,owner:y,rentEpoch:b}=d;return f.length!==2&&f[1]!=="base64"&&Rn.logWithError("info must be base64 encoded, RPC_ERROR"),{data:Buffer.from(f[0],"base64"),executable:g,lamports:p,owner:new Ci(y),rentEpoch:b}}return null})))}else try{a=await Promise.all(s.map(c=>i.getMultipleAccountsInfo(c,r)))}catch(c){c instanceof Error&&Rn.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${c.message}`)}return a.flat()}async function st(i,e,t){let n=await Qe(i,e.map(r=>r.pubkey),t);return e.map((r,o)=>G(C({},r),{accountInfo:n[o]}))}async function Ni({connection:i,mints:e,config:t}){var o,s,a;if(e.length===0)return{};let n=await st(i,e.map(c=>({pubkey:ut(c)})),t),r={};for(let c of n){if(!c.accountInfo||c.accountInfo.data.length<No){console.log("invalid mint account",c.pubkey.toBase58());continue}let u=Lo(c.pubkey,c.accountInfo,(o=c.accountInfo)==null?void 0:o.owner);r[c.pubkey.toString()]=G(C({},u),{programId:((s=c.accountInfo)==null?void 0:s.owner)||Ko,feeConfig:(a=Ro(u))!=null?a:void 0})}return r[Ci.default.toBase58()]=r[Q.toBase58()],r}async function Mn({connection:i,address:e}){let t=await Qe(i,[...new Set(e.map(r=>r.toString()))].map(r=>new Ki(r))),n={};for(let r=0;r<e.length;r++){let o=t[r],s=e[r];if(!o)continue;let a=new on({key:s,state:on.deserialize(o.data)});n[s.toString()]=a,sn[s.toString()]=a}return n}var sn={"2immgwYNHBbyVQKVGCEkgWpi53bLwWNRMB5G2nbgYV17":new on({key:new Ki("2immgwYNHBbyVQKVGCEkgWpi53bLwWNRMB5G2nbgYV17"),state:on.deserialize(Buffer.from("AQAAAP//////////d49+DAAAAAAAAQZMWvw7GUNJdaccNBVnb57OKakxL2BHLYvhRwVILRsgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMGRm/lIRcy/+ytunLDm+e8jOW7xfcSayxDmzpAAAAABt324ddloZPZy+FGzut5rBy0he1fWzeROoz1hX7/AKkG3fbh7nWP3hhCXbzkbM3athr8TYO5DSf+vfko2KGL/AVKU1D4XciC1hSlVnJ4iilt3x6rq9CmBniISTL07vagBqfVFxksXFEhjMlMPUrxf1ja7gibof1E49vZigAAAAAGp9UXGMd0yShWY5hpHV62i164o5tLbVxzVVshAAAAAIyXJY9OJInxuz0QKRSODYMLWhOZ2v8QhASOe9jb6fhZC3BlsePRfEU4nVJ/awTDzVi4bHMaoP21SbbRvAP4KUbIScv+6Yw2LHF/6K0ZjUPibbSWXCirYPGuuVl7zT789IUPLW4CpHr4JNCatp3ELXDLKMv6JJ+37le50lbBJ2LvDQdRqCgtphMF/imcN7mY5YRx2xE1A3MQ+L4QRaYK9u4GRfZP3LsAd00a+IkCpA22UNQMKdq5BFbJuwuOLqc8zxCTDlqxBG8J0HcxtfogQHDK06ukzfaXiNDKAob1MqBHS9lJxDYCwz8gd5DtFqNSTKG5l1zxIaKpDP/sffi2is1H9aKveyXSu5StXElYRl9SD5As0DHE4N0GLnf84/siiKXVyp4Ez121kLcUui/jLLFZEz/BwZK3Ilf9B9OcsEAeDMKAy2vjGSxQODgBz0QwGA+eP4ZjIjrIAQaXENv31QfLlOdXSRCkaybRniDHF4C8YcwhcvsqrOVuTP4B2Na+9wLdtrB31uz2rtlFI5kahdsnp/d1SrASDInYCtTYtdoke4kX+hoKWcEWM4Tle8pTUkUVv4BxS6fje/EzKBE4Qu9N9LMnrw/JNO0hqMVB4rk/2ou4AB1loQ7FZoPwut2o4KZB+0p9xnbrQKw038qjpHar+PyDwvxBRcu5hpHw3dguezeWv+IwvgW5icu8EGkhGa9AkFPPJT7VMSFb8xowveU=","base64"))})};var an=class{constructor(e){this.instructions=[];this.endInstructions=[];this.lookupTableAddress=[];this.signers=[];this.instructionTypes=[];this.endInstructionTypes=[];this.connection=e.connection,this.feePayer=e.feePayer,this.signAllTransactions=e.signAllTransactions,this.owner=e.own