@stonecrop/graphql-client 0.6.3 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/graphql-client.js +1115 -1349
- package/dist/graphql-client.js.map +1 -1
- package/dist/graphql-client.umd.cjs +40 -39
- package/dist/graphql-client.umd.cjs.map +1 -1
- package/package.json +17 -17
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
(function(K,ge){typeof exports=="object"&&typeof module<"u"?ge(exports):typeof define=="function"&&define.amd?define(["exports"],ge):(K=typeof globalThis<"u"?globalThis:K||self,ge(K["@stonecrop/graphql-client"]={}))})(this,(function(K){"use strict";function ge(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in e)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var ce=9e15,ee=1e9,Ue="0123456789abcdef",we="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ae="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",qe={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ce,maxE:ce,crypto:!1},it,W,O=!0,Oe="[DecimalError] ",te=Oe+"Invalid argument: ",rt=Oe+"Precision limit exceeded",st=Oe+"crypto unavailable",ot="[object Decimal]",q=Math.floor,F=Math.pow,Mt=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Bt=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Ut=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,at=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,J=1e7,A=7,qt=9007199254740991,Vt=we.length-1,Ve=Ae.length-1,g={toStringTag:ot};g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),v(e)},g.ceil=function(){return v(new this.constructor(this),this.e+1,2)},g.clampedTo=g.clamp=function(e,t){var n,i=this,r=i.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(te+t);return n=i.cmp(e),n<0?e:i.cmp(t)>0?t:new r(i)},g.comparedTo=g.cmp=function(e){var t,n,i,r,s=this,o=s.d,a=(e=new s.constructor(e)).d,u=s.s,c=e.s;if(!o||!a)return!u||!c?NaN:u!==c?u:o===a?0:!o^u<0?1:-1;if(!o[0]||!a[0])return o[0]?u:a[0]?-c:0;if(u!==c)return u;if(s.e!==e.e)return s.e>e.e^u<0?1:-1;for(i=o.length,r=a.length,t=0,n=i<r?i:r;t<n;++t)if(o[t]!==a[t])return o[t]>a[t]^u<0?1:-1;return i===r?0:i>r^u<0?1:-1},g.cosine=g.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())+A,i.rounding=1,n=jt(i,dt(i,n)),i.precision=e,i.rounding=t,v(W==2||W==3?n.neg():n,e,t,!0)):new i(1):new i(NaN)},g.cubeRoot=g.cbrt=function(){var e,t,n,i,r,s,o,a,u,c,l=this,f=l.constructor;if(!l.isFinite()||l.isZero())return new f(l);for(O=!1,s=l.s*F(l.s*l,1/3),!s||Math.abs(s)==1/0?(n=B(l.d),e=l.e,(s=(e-n.length+1)%3)&&(n+=s==1||s==-2?"0":"00"),s=F(n,1/3),e=q((e+1)/3)-(e%3==(e<0?-1:2)),s==1/0?n="5e"+e:(n=s.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),i=new f(n),i.s=l.s):i=new f(s.toString()),o=(e=f.precision)+3;;)if(a=i,u=a.times(a).times(a),c=u.plus(l),i=S(c.plus(l).times(a),c.plus(u),o+2,1),B(a.d).slice(0,o)===(n=B(i.d)).slice(0,o))if(n=n.slice(o-3,o+1),n=="9999"||!r&&n=="4999"){if(!r&&(v(a,e+1,0),a.times(a).times(a).eq(l))){i=a;break}o+=4,r=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(v(i,e+1,1),t=!i.times(i).times(i).eq(l));break}return O=!0,v(i,e,f.rounding,t)},g.decimalPlaces=g.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-q(this.e/A))*A,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},g.dividedBy=g.div=function(e){return S(this,new this.constructor(e))},g.dividedToIntegerBy=g.divToInt=function(e){var t=this,n=t.constructor;return v(S(t,new n(e),0,1,1),n.precision,n.rounding)},g.equals=g.eq=function(e){return this.cmp(e)===0},g.floor=function(){return v(new this.constructor(this),this.e+1,3)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){var t=this.cmp(e);return t==1||t===0},g.hyperbolicCosine=g.cosh=function(){var e,t,n,i,r,s=this,o=s.constructor,a=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return a;n=o.precision,i=o.rounding,o.precision=n+Math.max(s.e,s.sd())+4,o.rounding=1,r=s.d.length,r<32?(e=Math.ceil(r/3),t=(1/De(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),s=ue(o,1,s.times(t),new o(1),!0);for(var u,c=e,l=new o(8);c--;)u=s.times(s),s=a.minus(u.times(l.minus(u.times(l))));return v(s,o.precision=n,o.rounding=i,!0)},g.hyperbolicSine=g.sinh=function(){var e,t,n,i,r=this,s=r.constructor;if(!r.isFinite()||r.isZero())return new s(r);if(t=s.precision,n=s.rounding,s.precision=t+Math.max(r.e,r.sd())+4,s.rounding=1,i=r.d.length,i<3)r=ue(s,2,r,r,!0);else{e=1.4*Math.sqrt(i),e=e>16?16:e|0,r=r.times(1/De(5,e)),r=ue(s,2,r,r,!0);for(var o,a=new s(5),u=new s(16),c=new s(20);e--;)o=r.times(r),r=r.times(a.plus(o.times(u.times(o).plus(c))))}return s.precision=t,s.rounding=n,v(r,t,n,!0)},g.hyperbolicTangent=g.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,S(n.sinh(),n.cosh(),i.precision=e,i.rounding=t)):new i(n.s)},g.inverseCosine=g.acos=function(){var e,t=this,n=t.constructor,i=t.abs().cmp(1),r=n.precision,s=n.rounding;return i!==-1?i===0?t.isNeg()?z(n,r,s):new n(0):new n(NaN):t.isZero()?z(n,r+4,s).times(.5):(n.precision=r+6,n.rounding=1,t=t.asin(),e=z(n,r+4,s).times(.5),n.precision=r,n.rounding=s,e.minus(t))},g.inverseHyperbolicCosine=g.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,O=!1,n=n.times(n).minus(1).sqrt().plus(n),O=!0,i.precision=e,i.rounding=t,n.ln()):new i(n)},g.inverseHyperbolicSine=g.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,O=!1,n=n.times(n).plus(1).sqrt().plus(n),O=!0,i.precision=e,i.rounding=t,n.ln())},g.inverseHyperbolicTangent=g.atanh=function(){var e,t,n,i,r=this,s=r.constructor;return r.isFinite()?r.e>=0?new s(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(e=s.precision,t=s.rounding,i=r.sd(),Math.max(i,e)<2*-r.e-1?v(new s(r),e,t,!0):(s.precision=n=i-r.e,r=S(r.plus(1),new s(1).minus(r),n+e,1),s.precision=e+4,s.rounding=1,r=r.ln(),s.precision=e,s.rounding=t,r.times(.5))):new s(NaN)},g.inverseSine=g.asin=function(){var e,t,n,i,r=this,s=r.constructor;return r.isZero()?new s(r):(t=r.abs().cmp(1),n=s.precision,i=s.rounding,t!==-1?t===0?(e=z(s,n+4,i).times(.5),e.s=r.s,e):new s(NaN):(s.precision=n+6,s.rounding=1,r=r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(),s.precision=n,s.rounding=i,r.times(2)))},g.inverseTangent=g.atan=function(){var e,t,n,i,r,s,o,a,u,c=this,l=c.constructor,f=l.precision,d=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&f+4<=Ve)return o=z(l,f+4,d).times(.25),o.s=c.s,o}else{if(!c.s)return new l(NaN);if(f+4<=Ve)return o=z(l,f+4,d).times(.5),o.s=c.s,o}for(l.precision=a=f+10,l.rounding=1,n=Math.min(28,a/A+2|0),e=n;e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(O=!1,t=Math.ceil(a/A),i=1,u=c.times(c),o=new l(c),r=c;e!==-1;)if(r=r.times(u),s=o.minus(r.div(i+=2)),r=r.times(u),o=s.plus(r.div(i+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===s.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),O=!0,v(o,l.precision=f,l.rounding=d,!0)},g.isFinite=function(){return!!this.d},g.isInteger=g.isInt=function(){return!!this.d&&q(this.e/A)>this.d.length-2},g.isNaN=function(){return!this.s},g.isNegative=g.isNeg=function(){return this.s<0},g.isPositive=g.isPos=function(){return this.s>0},g.isZero=function(){return!!this.d&&this.d[0]===0},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n,i,r,s,o,a,u,c=this,l=c.constructor,f=l.precision,d=l.rounding,N=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=c.d,c.s<0||!n||!n[0]||c.eq(1))return new l(n&&!n[0]?-1/0:c.s!=1?NaN:n?0:1/0);if(t)if(n.length>1)s=!0;else{for(r=n[0];r%10===0;)r/=10;s=r!==1}if(O=!1,a=f+N,o=ie(c,a),i=t?be(l,a+10):ie(e,a),u=S(o,i,a,1),Ee(u.d,r=f,d))do if(a+=10,o=ie(c,a),i=t?be(l,a+10):ie(e,a),u=S(o,i,a,1),!s){+B(u.d).slice(r+1,r+15)+1==1e14&&(u=v(u,f+1,0));break}while(Ee(u.d,r+=10,d));return O=!0,v(u,f,d)},g.minus=g.sub=function(e){var t,n,i,r,s,o,a,u,c,l,f,d,N=this,T=N.constructor;if(e=new T(e),!N.d||!e.d)return!N.s||!e.s?e=new T(NaN):N.d?e.s=-e.s:e=new T(e.d||N.s!==e.s?N:NaN),e;if(N.s!=e.s)return e.s=-e.s,N.plus(e);if(c=N.d,d=e.d,a=T.precision,u=T.rounding,!c[0]||!d[0]){if(d[0])e.s=-e.s;else if(c[0])e=new T(N);else return new T(u===3?-0:0);return O?v(e,a,u):e}if(n=q(e.e/A),l=q(N.e/A),c=c.slice(),s=l-n,s){for(f=s<0,f?(t=c,s=-s,o=d.length):(t=d,n=l,o=c.length),i=Math.max(Math.ceil(a/A),o)+2,s>i&&(s=i,t.length=1),t.reverse(),i=s;i--;)t.push(0);t.reverse()}else{for(i=c.length,o=d.length,f=i<o,f&&(o=i),i=0;i<o;i++)if(c[i]!=d[i]){f=c[i]<d[i];break}s=0}for(f&&(t=c,c=d,d=t,e.s=-e.s),o=c.length,i=d.length-o;i>0;--i)c[o++]=0;for(i=d.length;i>s;){if(c[--i]<d[i]){for(r=i;r&&c[--r]===0;)c[r]=J-1;--c[r],c[i]+=J}c[i]-=d[i]}for(;c[--o]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(e.d=c,e.e=_e(c,n),O?v(e,a,u):e):new T(u===3?-0:0)},g.modulo=g.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]?v(new i(n),i.precision,i.rounding):(O=!1,i.modulo==9?(t=S(n,e.abs(),0,3,1),t.s*=e.s):t=S(n,e,0,i.modulo,1),t=t.times(e),O=!0,n.minus(t))},g.naturalExponential=g.exp=function(){return je(this)},g.naturalLogarithm=g.ln=function(){return ie(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s,v(e)},g.plus=g.add=function(e){var t,n,i,r,s,o,a,u,c,l,f=this,d=f.constructor;if(e=new d(e),!f.d||!e.d)return!f.s||!e.s?e=new d(NaN):f.d||(e=new d(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(c=f.d,l=e.d,a=d.precision,u=d.rounding,!c[0]||!l[0])return l[0]||(e=new d(f)),O?v(e,a,u):e;if(s=q(f.e/A),i=q(e.e/A),c=c.slice(),r=s-i,r){for(r<0?(n=c,r=-r,o=l.length):(n=l,i=s,o=c.length),s=Math.ceil(a/A),o=s>o?s+1:o+1,r>o&&(r=o,n.length=1),n.reverse();r--;)n.push(0);n.reverse()}for(o=c.length,r=l.length,o-r<0&&(r=o,n=l,l=c,c=n),t=0;r;)t=(c[--r]=c[r]+l[r]+t)/J|0,c[r]%=J;for(t&&(c.unshift(t),++i),o=c.length;c[--o]==0;)c.pop();return e.d=c,e.e=_e(c,i),O?v(e,a,u):e},g.precision=g.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(te+e);return n.d?(t=ct(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},g.round=function(){var e=this,t=e.constructor;return v(new t(e),e.e+1,t.rounding)},g.sine=g.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())+A,i.rounding=1,n=Ht(i,dt(i,n)),i.precision=e,i.rounding=t,v(W>2?n.neg():n,e,t,!0)):new i(NaN)},g.squareRoot=g.sqrt=function(){var e,t,n,i,r,s,o=this,a=o.d,u=o.e,c=o.s,l=o.constructor;if(c!==1||!a||!a[0])return new l(!c||c<0&&(!a||a[0])?NaN:a?o:1/0);for(O=!1,c=Math.sqrt(+o),c==0||c==1/0?(t=B(a),(t.length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=q((u+1)/2)-(u<0||u%2),c==1/0?t="5e"+u:(t=c.toExponential(),t=t.slice(0,t.indexOf("e")+1)+u),i=new l(t)):i=new l(c.toString()),n=(u=l.precision)+3;;)if(s=i,i=s.plus(S(o,s,n+2,1)).times(.5),B(s.d).slice(0,n)===(t=B(i.d)).slice(0,n))if(t=t.slice(n-3,n+1),t=="9999"||!r&&t=="4999"){if(!r&&(v(s,u+1,0),s.times(s).eq(o))){i=s;break}n+=4,r=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(v(i,u+1,1),e=!i.times(i).eq(o));break}return O=!0,v(i,u,l.rounding,e)},g.tangent=g.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=S(n,new i(1).minus(n.times(n)).sqrt(),e+10,0),i.precision=e,i.rounding=t,v(W==2||W==4?n.neg():n,e,t,!0)):new i(NaN)},g.times=g.mul=function(e){var t,n,i,r,s,o,a,u,c,l=this,f=l.constructor,d=l.d,N=(e=new f(e)).d;if(e.s*=l.s,!d||!d[0]||!N||!N[0])return new f(!e.s||d&&!d[0]&&!N||N&&!N[0]&&!d?NaN:!d||!N?e.s/0:e.s*0);for(n=q(l.e/A)+q(e.e/A),u=d.length,c=N.length,u<c&&(s=d,d=N,N=s,o=u,u=c,c=o),s=[],o=u+c,i=o;i--;)s.push(0);for(i=c;--i>=0;){for(t=0,r=u+i;r>i;)a=s[r]+N[i]*d[r-i-1]+t,s[r--]=a%J|0,t=a/J|0;s[r]=(s[r]+t)%J|0}for(;!s[--o];)s.pop();return t?++n:s.shift(),e.d=s,e.e=_e(s,n),O?v(e,f.precision,f.rounding):e},g.toBinary=function(e,t){return He(this,2,e,t)},g.toDecimalPlaces=g.toDP=function(e,t){var n=this,i=n.constructor;return n=new i(n),e===void 0?n:(H(e,0,ee),t===void 0?t=i.rounding:H(t,0,8),v(n,e+n.e+1,t))},g.toExponential=function(e,t){var n,i=this,r=i.constructor;return e===void 0?n=Z(i,!0):(H(e,0,ee),t===void 0?t=r.rounding:H(t,0,8),i=v(new r(i),e+1,t),n=Z(i,!0,e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},g.toFixed=function(e,t){var n,i,r=this,s=r.constructor;return e===void 0?n=Z(r):(H(e,0,ee),t===void 0?t=s.rounding:H(t,0,8),i=v(new s(r),e+r.e+1,t),n=Z(i,!1,e+i.e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},g.toFraction=function(e){var t,n,i,r,s,o,a,u,c,l,f,d,N=this,T=N.d,E=N.constructor;if(!T)return new E(N);if(c=n=new E(1),i=u=new E(0),t=new E(i),s=t.e=ct(T)-N.e-1,o=s%A,t.d[0]=F(10,o<0?A+o:o),e==null)e=s>0?t:c;else{if(a=new E(e),!a.isInt()||a.lt(c))throw Error(te+a);e=a.gt(t)?s>0?t:c:a}for(O=!1,a=new E(B(T)),l=E.precision,E.precision=s=T.length*A*2;f=S(a,t,0,1,1),r=n.plus(f.times(i)),r.cmp(e)!=1;)n=i,i=r,r=c,c=u.plus(f.times(r)),u=r,r=t,t=a.minus(f.times(r)),a=r;return r=S(e.minus(n),i,0,1,1),u=u.plus(r.times(c)),n=n.plus(r.times(i)),u.s=c.s=N.s,d=S(c,i,s,1).minus(N).abs().cmp(S(u,n,s,1).minus(N).abs())<1?[c,i]:[u,n],E.precision=l,O=!0,d},g.toHexadecimal=g.toHex=function(e,t){return He(this,16,e,t)},g.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:H(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]?(O=!1,n=S(n,e,0,t,1).times(e),O=!0,v(n)):(e.s=n.s,n=e),n},g.toNumber=function(){return+this},g.toOctal=function(e,t){return He(this,8,e,t)},g.toPower=g.pow=function(e){var t,n,i,r,s,o,a=this,u=a.constructor,c=+(e=new u(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new u(F(+a,c));if(a=new u(a),a.eq(1))return a;if(i=u.precision,s=u.rounding,e.eq(1))return v(a,i,s);if(t=q(e.e/A),t>=e.d.length-1&&(n=c<0?-c:c)<=qt)return r=ut(u,a,n,i),e.s<0?new u(1).div(r):v(r,i,s);if(o=a.s,o<0){if(t<e.d.length-1)return new u(NaN);if((e.d[t]&1)==0&&(o=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=o,a}return n=F(+a,c),t=n==0||!isFinite(n)?q(c*(Math.log("0."+B(a.d))/Math.LN10+a.e+1)):new u(n+"").e,t>u.maxE+1||t<u.minE-1?new u(t>0?o/0:0):(O=!1,u.rounding=a.s=1,n=Math.min(12,(t+"").length),r=je(e.times(ie(a,i+n)),i),r.d&&(r=v(r,i+5,1),Ee(r.d,i,s)&&(t=i+10,r=v(je(e.times(ie(a,t+n)),t),t+5,1),+B(r.d).slice(i+1,i+15)+1==1e14&&(r=v(r,i+1,0)))),r.s=o,O=!0,u.rounding=s,v(r,i,s))},g.toPrecision=function(e,t){var n,i=this,r=i.constructor;return e===void 0?n=Z(i,i.e<=r.toExpNeg||i.e>=r.toExpPos):(H(e,1,ee),t===void 0?t=r.rounding:H(t,0,8),i=v(new r(i),e,t),n=Z(i,e<=i.e||i.e<=r.toExpNeg,e)),i.isNeg()&&!i.isZero()?"-"+n:n},g.toSignificantDigits=g.toSD=function(e,t){var n=this,i=n.constructor;return e===void 0?(e=i.precision,t=i.rounding):(H(e,1,ee),t===void 0?t=i.rounding:H(t,0,8)),v(new i(n),e,t)},g.toString=function(){var e=this,t=e.constructor,n=Z(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},g.truncated=g.trunc=function(){return v(new this.constructor(this),this.e+1,1)},g.valueOf=g.toJSON=function(){var e=this,t=e.constructor,n=Z(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};function B(e){var t,n,i,r=e.length-1,s="",o=e[0];if(r>0){for(s+=o,t=1;t<r;t++)i=e[t]+"",n=A-i.length,n&&(s+=ne(n)),s+=i;o=e[t],i=o+"",n=A-i.length,n&&(s+=ne(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}function H(e,t,n){if(e!==~~e||e<t||e>n)throw Error(te+e)}function Ee(e,t,n,i){var r,s,o,a;for(s=e[0];s>=10;s/=10)--t;return--t<0?(t+=A,r=0):(r=Math.ceil((t+1)/A),t%=A),s=F(10,A-t),a=e[r]%s|0,i==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),o=n<4&&a==99999||n>3&&a==49999||a==5e4||a==0):o=(n<4&&a+1==s||n>3&&a+1==s/2)&&(e[r+1]/s/100|0)==F(10,t-2)-1||(a==s/2||a==0)&&(e[r+1]/s/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),o=(i||n<4)&&a==9999||!i&&n>3&&a==4999):o=((i||n<4)&&a+1==s||!i&&n>3&&a+1==s/2)&&(e[r+1]/s/1e3|0)==F(10,t-3)-1,o}function Ie(e,t,n){for(var i,r=[0],s,o=0,a=e.length;o<a;){for(s=r.length;s--;)r[s]*=t;for(r[0]+=Ue.indexOf(e.charAt(o++)),i=0;i<r.length;i++)r[i]>n-1&&(r[i+1]===void 0&&(r[i+1]=0),r[i+1]+=r[i]/n|0,r[i]%=n)}return r.reverse()}function jt(e,t){var n,i,r;if(t.isZero())return t;i=t.d.length,i<32?(n=Math.ceil(i/3),r=(1/De(4,n)).toString()):(n=16,r="2.3283064365386962890625e-10"),e.precision+=n,t=ue(e,1,t.times(r),new e(1));for(var s=n;s--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}var S=(function(){function e(i,r,s){var o,a=0,u=i.length;for(i=i.slice();u--;)o=i[u]*r+a,i[u]=o%s|0,a=o/s|0;return a&&i.unshift(a),i}function t(i,r,s,o){var a,u;if(s!=o)u=s>o?1:-1;else for(a=u=0;a<s;a++)if(i[a]!=r[a]){u=i[a]>r[a]?1:-1;break}return u}function n(i,r,s,o){for(var a=0;s--;)i[s]-=a,a=i[s]<r[s]?1:0,i[s]=a*o+i[s]-r[s];for(;!i[0]&&i.length>1;)i.shift()}return function(i,r,s,o,a,u){var c,l,f,d,N,T,E,x,_,V,b,k,X,$,re,pe,G,ve,Y,j,me=i.constructor,oe=i.s==r.s?1:-1,h=i.d,m=r.d;if(!h||!h[0]||!m||!m[0])return new me(!i.s||!r.s||(h?m&&h[0]==m[0]:!m)?NaN:h&&h[0]==0||!m?oe*0:oe/0);for(u?(N=1,l=i.e-r.e):(u=J,N=A,l=q(i.e/N)-q(r.e/N)),Y=m.length,G=h.length,_=new me(oe),V=_.d=[],f=0;m[f]==(h[f]||0);f++);if(m[f]>(h[f]||0)&&l--,s==null?($=s=me.precision,o=me.rounding):a?$=s+(i.e-r.e)+1:$=s,$<0)V.push(1),T=!0;else{if($=$/N+2|0,f=0,Y==1){for(d=0,m=m[0],$++;(f<G||d)&&$--;f++)re=d*u+(h[f]||0),V[f]=re/m|0,d=re%m|0;T=d||f<G}else{for(d=u/(m[0]+1)|0,d>1&&(m=e(m,d,u),h=e(h,d,u),Y=m.length,G=h.length),pe=Y,b=h.slice(0,Y),k=b.length;k<Y;)b[k++]=0;j=m.slice(),j.unshift(0),ve=m[0],m[1]>=u/2&&++ve;do d=0,c=t(m,b,Y,k),c<0?(X=b[0],Y!=k&&(X=X*u+(b[1]||0)),d=X/ve|0,d>1?(d>=u&&(d=u-1),E=e(m,d,u),x=E.length,k=b.length,c=t(E,b,x,k),c==1&&(d--,n(E,Y<x?j:m,x,u))):(d==0&&(c=d=1),E=m.slice()),x=E.length,x<k&&E.unshift(0),n(b,E,k,u),c==-1&&(k=b.length,c=t(m,b,Y,k),c<1&&(d++,n(b,Y<k?j:m,k,u))),k=b.length):c===0&&(d++,b=[0]),V[f++]=d,c&&b[0]?b[k++]=h[pe]||0:(b=[h[pe]],k=1);while((pe++<G||b[0]!==void 0)&&$--);T=b[0]!==void 0}V[0]||V.shift()}if(N==1)_.e=l,it=T;else{for(f=1,d=V[0];d>=10;d/=10)f++;_.e=f+l*N-1,v(_,a?s+_.e+1:s,o,T)}return _}})();function v(e,t,n,i){var r,s,o,a,u,c,l,f,d,N=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(r=1,a=f[0];a>=10;a/=10)r++;if(s=t-r,s<0)s+=A,o=t,l=f[d=0],u=l/F(10,r-o-1)%10|0;else if(d=Math.ceil((s+1)/A),a=f.length,d>=a)if(i){for(;a++<=d;)f.push(0);l=u=0,r=1,s%=A,o=s-A+1}else break e;else{for(l=a=f[d],r=1;a>=10;a/=10)r++;s%=A,o=s-A+r,u=o<0?0:l/F(10,r-o-1)%10|0}if(i=i||t<0||f[d+1]!==void 0||(o<0?l:l%F(10,r-o-1)),c=n<4?(u||i)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||i||n==6&&(s>0?o>0?l/F(10,r-o):0:f[d-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,c?(t-=e.e+1,f[0]=F(10,(A-t%A)%A),e.e=-t||0):f[0]=e.e=0,e;if(s==0?(f.length=d,a=1,d--):(f.length=d+1,a=F(10,A-s),f[d]=o>0?(l/F(10,r-o)%F(10,o)|0)*a:0),c)for(;;)if(d==0){for(s=1,o=f[0];o>=10;o/=10)s++;for(o=f[0]+=a,a=1;o>=10;o/=10)a++;s!=a&&(e.e++,f[0]==J&&(f[0]=1));break}else{if(f[d]+=a,f[d]!=J)break;f[d--]=0,a=1}for(s=f.length;f[--s]===0;)f.pop()}return O&&(e.e>N.maxE?(e.d=null,e.e=NaN):e.e<N.minE&&(e.e=0,e.d=[0])),e}function Z(e,t,n){if(!e.isFinite())return ht(e);var i,r=e.e,s=B(e.d),o=s.length;return t?(n&&(i=n-o)>0?s=s.charAt(0)+"."+s.slice(1)+ne(i):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):r<0?(s="0."+ne(-r-1)+s,n&&(i=n-o)>0&&(s+=ne(i))):r>=o?(s+=ne(r+1-o),n&&(i=n-r-1)>0&&(s=s+"."+ne(i))):((i=r+1)<o&&(s=s.slice(0,i)+"."+s.slice(i)),n&&(i=n-o)>0&&(r+1===o&&(s+="."),s+=ne(i))),s}function _e(e,t){var n=e[0];for(t*=A;n>=10;n/=10)t++;return t}function be(e,t,n){if(t>Vt)throw O=!0,n&&(e.precision=n),Error(rt);return v(new e(we),t,1,!0)}function z(e,t,n){if(t>Ve)throw Error(rt);return v(new e(Ae),t,n,!0)}function ct(e){var t=e.length-1,n=t*A+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 ne(e){for(var t="";e--;)t+="0";return t}function ut(e,t,n,i){var r,s=new e(1),o=Math.ceil(i/A+4);for(O=!1;;){if(n%2&&(s=s.times(t),pt(s.d,o)&&(r=!0)),n=q(n/2),n===0){n=s.d.length-1,r&&s.d[n]===0&&++s.d[n];break}t=t.times(t),pt(t.d,o)}return O=!0,s}function lt(e){return e.d[e.d.length-1]&1}function ft(e,t,n){for(var i,r=new e(t[0]),s=0;++s<t.length;)if(i=new e(t[s]),i.s)r[n](i)&&(r=i);else{r=i;break}return r}function je(e,t){var n,i,r,s,o,a,u,c=0,l=0,f=0,d=e.constructor,N=d.rounding,T=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(O=!1,u=T):u=t,a=new d(.03125);e.e>-2;)e=e.times(a),f+=5;for(i=Math.log(F(2,f))/Math.LN10*2+5|0,u+=i,n=s=o=new d(1),d.precision=u;;){if(s=v(s.times(e),u,1),n=n.times(++l),a=o.plus(S(s,n,u,1)),B(a.d).slice(0,u)===B(o.d).slice(0,u)){for(r=f;r--;)o=v(o.times(o),u,1);if(t==null)if(c<3&&Ee(o.d,u-i,N,c))d.precision=u+=10,n=s=a=new d(1),l=0,c++;else return v(o,d.precision=T,N,O=!0);else return d.precision=T,o}o=a}}function ie(e,t){var n,i,r,s,o,a,u,c,l,f,d,N=1,T=10,E=e,x=E.d,_=E.constructor,V=_.rounding,b=_.precision;if(E.s<0||!x||!x[0]||!E.e&&x[0]==1&&x.length==1)return new _(x&&!x[0]?-1/0:E.s!=1?NaN:x?0:E);if(t==null?(O=!1,l=b):l=t,_.precision=l+=T,n=B(x),i=n.charAt(0),Math.abs(s=E.e)<15e14){for(;i<7&&i!=1||i==1&&n.charAt(1)>3;)E=E.times(e),n=B(E.d),i=n.charAt(0),N++;s=E.e,i>1?(E=new _("0."+n),s++):E=new _(i+"."+n.slice(1))}else return c=be(_,l+2,b).times(s+""),E=ie(new _(i+"."+n.slice(1)),l-T).plus(c),_.precision=b,t==null?v(E,b,V,O=!0):E;for(f=E,u=o=E=S(E.minus(1),E.plus(1),l,1),d=v(E.times(E),l,1),r=3;;){if(o=v(o.times(d),l,1),c=u.plus(S(o,new _(r),l,1)),B(c.d).slice(0,l)===B(u.d).slice(0,l))if(u=u.times(2),s!==0&&(u=u.plus(be(_,l+2,b).times(s+""))),u=S(u,new _(N),l,1),t==null)if(Ee(u.d,l-T,V,a))_.precision=l+=T,c=o=E=S(f.minus(1),f.plus(1),l,1),d=v(E.times(E),l,1),r=a=1;else return v(u,_.precision=b,V,O=!0);else return _.precision=b,u;u=c,r+=2}}function ht(e){return String(e.s*e.s/0)}function $e(e,t){var n,i,r;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(r=t.length;t.charCodeAt(r-1)===48;--r);if(t=t.slice(i,r),t){if(r-=i,e.e=n=n-i-1,e.d=[],i=(n+1)%A,n<0&&(i+=A),i<r){for(i&&e.d.push(+t.slice(0,i)),r-=A;i<r;)e.d.push(+t.slice(i,i+=A));t=t.slice(i),i=A-t.length}else i-=r;for(;i--;)t+="0";e.d.push(+t),O&&(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 $t(e,t){var n,i,r,s,o,a,u,c,l;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),at.test(t))return $e(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Bt.test(t))n=16,t=t.toLowerCase();else if(Mt.test(t))n=2;else if(Ut.test(t))n=8;else throw Error(te+t);for(s=t.search(/p/i),s>0?(u=+t.slice(s+1),t=t.substring(2,s)):t=t.slice(2),s=t.indexOf("."),o=s>=0,i=e.constructor,o&&(t=t.replace(".",""),a=t.length,s=a-s,r=ut(i,new i(n),s,s*2)),c=Ie(t,n,J),l=c.length-1,s=l;c[s]===0;--s)c.pop();return s<0?new i(e.s*0):(e.e=_e(c,l),e.d=c,O=!1,o&&(e=S(e,r,a*4)),u&&(e=e.times(Math.abs(u)<54?F(2,u):le.pow(2,u))),O=!0,e)}function Ht(e,t){var n,i=t.d.length;if(i<3)return t.isZero()?t:ue(e,2,t,t);n=1.4*Math.sqrt(i),n=n>16?16:n|0,t=t.times(1/De(5,n)),t=ue(e,2,t,t);for(var r,s=new e(5),o=new e(16),a=new e(20);n--;)r=t.times(t),t=t.times(s.plus(r.times(o.times(r).minus(a))));return t}function ue(e,t,n,i,r){var s,o,a,u,c=e.precision,l=Math.ceil(c/A);for(O=!1,u=n.times(n),a=new e(i);;){if(o=S(a.times(u),new e(t++*t++),c,1),a=r?i.plus(o):i.minus(o),i=S(o.times(u),new e(t++*t++),c,1),o=a.plus(i),o.d[l]!==void 0){for(s=l;o.d[s]===a.d[s]&&s--;);if(s==-1)break}s=a,a=i,i=o,o=s}return O=!0,o.d.length=l+1,o}function De(e,t){for(var n=e;--t;)n*=e;return n}function dt(e,t){var n,i=t.s<0,r=z(e,e.precision,1),s=r.times(.5);if(t=t.abs(),t.lte(s))return W=i?4:1,t;if(n=t.divToInt(r),n.isZero())W=i?3:2;else{if(t=t.minus(n.times(r)),t.lte(s))return W=lt(n)?i?2:3:i?4:1,t;W=lt(n)?i?1:4:i?3:2}return t.minus(r).abs()}function He(e,t,n,i){var r,s,o,a,u,c,l,f,d,N=e.constructor,T=n!==void 0;if(T?(H(n,1,ee),i===void 0?i=N.rounding:H(i,0,8)):(n=N.precision,i=N.rounding),!e.isFinite())l=ht(e);else{for(l=Z(e),o=l.indexOf("."),T?(r=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):r=t,o>=0&&(l=l.replace(".",""),d=new N(1),d.e=l.length-o,d.d=Ie(Z(d),10,r),d.e=d.d.length),f=Ie(l,10,r),s=u=f.length;f[--u]==0;)f.pop();if(!f[0])l=T?"0p+0":"0";else{if(o<0?s--:(e=new N(e),e.d=f,e.e=s,e=S(e,d,n,i,0,r),f=e.d,s=e.e,c=it),o=f[n],a=r/2,c=c||f[n+1]!==void 0,c=i<4?(o!==void 0||c)&&(i===0||i===(e.s<0?3:2)):o>a||o===a&&(i===4||c||i===6&&f[n-1]&1||i===(e.s<0?8:7)),f.length=n,c)for(;++f[--n]>r-1;)f[n]=0,n||(++s,f.unshift(1));for(u=f.length;!f[u-1];--u);for(o=0,l="";o<u;o++)l+=Ue.charAt(f[o]);if(T){if(u>1)if(t==16||t==8){for(o=t==16?4:3,--u;u%o;u++)l+="0";for(f=Ie(l,r,t),u=f.length;!f[u-1];--u);for(o=1,l="1.";o<u;o++)l+=Ue.charAt(f[o])}else l=l.charAt(0)+"."+l.slice(1);l=l+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)l="0"+l;l="0."+l}else if(++s>u)for(s-=u;s--;)l+="0";else s<u&&(l=l.slice(0,s)+"."+l.slice(s))}l=(t==16?"0x":t==2?"0b":t==8?"0o":"")+l}return e.s<0?"-"+l:l}function pt(e,t){if(e.length>t)return e.length=t,!0}function Gt(e){return new this(e).abs()}function Yt(e){return new this(e).acos()}function Jt(e){return new this(e).acosh()}function zt(e,t){return new this(e).plus(t)}function Qt(e){return new this(e).asin()}function Xt(e){return new this(e).asinh()}function Zt(e){return new this(e).atan()}function Wt(e){return new this(e).atanh()}function Kt(e,t){e=new this(e),t=new this(t);var n,i=this.precision,r=this.rounding,s=i+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=z(this,s,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?z(this,i,r):new this(0),n.s=e.s):!e.d||t.isZero()?(n=z(this,s,1).times(.5),n.s=e.s):t.s<0?(this.precision=s,this.rounding=1,n=this.atan(S(e,t,s,1)),t=z(this,s,1),this.precision=i,this.rounding=r,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(S(e,t,s,1)),n}function en(e){return new this(e).cbrt()}function tn(e){return v(e=new this(e),e.e+1,2)}function nn(e,t,n){return new this(e).clamp(t,n)}function rn(e){if(!e||typeof e!="object")throw Error(Oe+"Object expected");var t,n,i,r=e.defaults===!0,s=["precision",1,ee,"rounding",0,8,"toExpNeg",-ce,0,"toExpPos",0,ce,"maxE",0,ce,"minE",-ce,0,"modulo",0,9];for(t=0;t<s.length;t+=3)if(n=s[t],r&&(this[n]=qe[n]),(i=e[n])!==void 0)if(q(i)===i&&i>=s[t+1]&&i<=s[t+2])this[n]=i;else throw Error(te+n+": "+i);if(n="crypto",r&&(this[n]=qe[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(st);else this[n]=!1;else throw Error(te+n+": "+i);return this}function sn(e){return new this(e).cos()}function on(e){return new this(e).cosh()}function mt(e){var t,n,i;function r(s){var o,a,u,c=this;if(!(c instanceof r))return new r(s);if(c.constructor=r,gt(s)){c.s=s.s,O?!s.d||s.e>r.maxE?(c.e=NaN,c.d=null):s.e<r.minE?(c.e=0,c.d=[0]):(c.e=s.e,c.d=s.d.slice()):(c.e=s.e,c.d=s.d?s.d.slice():s.d);return}if(u=typeof s,u==="number"){if(s===0){c.s=1/s<0?-1:1,c.e=0,c.d=[0];return}if(s<0?(s=-s,c.s=-1):c.s=1,s===~~s&&s<1e7){for(o=0,a=s;a>=10;a/=10)o++;O?o>r.maxE?(c.e=NaN,c.d=null):o<r.minE?(c.e=0,c.d=[0]):(c.e=o,c.d=[s]):(c.e=o,c.d=[s]);return}else if(s*0!==0){s||(c.s=NaN),c.e=NaN,c.d=null;return}return $e(c,s.toString())}else if(u!=="string")throw Error(te+s);return(a=s.charCodeAt(0))===45?(s=s.slice(1),c.s=-1):(a===43&&(s=s.slice(1)),c.s=1),at.test(s)?$e(c,s):$t(c,s)}if(r.prototype=g,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=rn,r.clone=mt,r.isDecimal=gt,r.abs=Gt,r.acos=Yt,r.acosh=Jt,r.add=zt,r.asin=Qt,r.asinh=Xt,r.atan=Zt,r.atanh=Wt,r.atan2=Kt,r.cbrt=en,r.ceil=tn,r.clamp=nn,r.cos=sn,r.cosh=on,r.div=an,r.exp=cn,r.floor=un,r.hypot=ln,r.ln=fn,r.log=hn,r.log10=pn,r.log2=dn,r.max=mn,r.min=gn,r.mod=En,r.mul=Nn,r.pow=yn,r.random=Tn,r.round=vn,r.sign=wn,r.sin=An,r.sinh=On,r.sqrt=In,r.sub=_n,r.sum=bn,r.tan=Dn,r.tanh=Cn,r.trunc=xn,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 r.config(e),r}function an(e,t){return new this(e).div(t)}function cn(e){return new this(e).exp()}function un(e){return v(e=new this(e),e.e+1,3)}function ln(){var e,t,n=new this(0);for(O=!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 O=!0,new this(1/0);n=t}return O=!0,n.sqrt()}function gt(e){return e instanceof le||e&&e.toStringTag===ot||!1}function fn(e){return new this(e).ln()}function hn(e,t){return new this(e).log(t)}function dn(e){return new this(e).log(2)}function pn(e){return new this(e).log(10)}function mn(){return ft(this,arguments,"lt")}function gn(){return ft(this,arguments,"gt")}function En(e,t){return new this(e).mod(t)}function Nn(e,t){return new this(e).mul(t)}function yn(e,t){return new this(e).pow(t)}function Tn(e){var t,n,i,r,s=0,o=new this(1),a=[];if(e===void 0?e=this.precision:H(e,1,ee),i=Math.ceil(e/A),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(i));s<i;)r=t[s],r>=429e7?t[s]=crypto.getRandomValues(new Uint32Array(1))[0]:a[s++]=r%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(i*=4);s<i;)r=t[s]+(t[s+1]<<8)+(t[s+2]<<16)+((t[s+3]&127)<<24),r>=214e7?crypto.randomBytes(4).copy(t,s):(a.push(r%1e7),s+=4);s=i/4}else throw Error(st);else for(;s<i;)a[s++]=Math.random()*1e7|0;for(i=a[--s],e%=A,i&&e&&(r=F(10,A-e),a[s]=(i/r|0)*r);a[s]===0;s--)a.pop();if(s<0)n=0,a=[0];else{for(n=-1;a[0]===0;n-=A)a.shift();for(i=1,r=a[0];r>=10;r/=10)i++;i<A&&(n-=A-i)}return o.e=n,o.d=a,o}function vn(e){return v(e=new this(e),e.e+1,this.rounding)}function wn(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function An(e){return new this(e).sin()}function On(e){return new this(e).sinh()}function In(e){return new this(e).sqrt()}function _n(e,t){return new this(e).sub(t)}function bn(){var e=0,t=arguments,n=new this(t[e]);for(O=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return O=!0,v(n,this.precision,this.rounding)}function Dn(e){return new this(e).tan()}function Cn(e){return new this(e).tanh()}function xn(e){return v(e=new this(e),e.e+1,1)}g[Symbol.for("nodejs.util.inspect.custom")]=g.toString,g[Symbol.toStringTag]="Decimal";var le=g.constructor=mt(qe);we=new le(we),Ae=new le(Ae);const Ge=JSON,Sn=e=>e.toUpperCase(),kn=e=>{const t={};return e.forEach((n,i)=>{t[i]=n}),t},Rn=(e,t,n)=>e.document?e:{document:e,variables:t,requestHeaders:n,signal:void 0},Ln=(e,t,n)=>e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0},Pn=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0};function Ce(e,t){if(!!!e)throw new Error(t)}function Fn(e){return typeof e=="object"&&e!==null}function Mn(e,t){if(!!!e)throw new Error("Unexpected invariant triggered.")}const Bn=/\r\n|[\n\r]/g;function Ye(e,t){let n=0,i=1;for(const r of e.body.matchAll(Bn)){if(typeof r.index=="number"||Mn(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function Un(e){return Et(e.source,Ye(e.source,e.start))}function Et(e,t){const n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,o=t.line+s,a=t.line===1?n:0,u=t.column+a,c=`${e.name}:${o}:${u}
|
|
2
|
-
`,l=i.split(/\r\n|[\n\r]/g),f=l[r];if(f.length>120){const
|
|
3
|
-
`)}function qn(e){const t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class
|
|
1
|
+
(function(H,j){typeof exports=="object"&&typeof module<"u"?j(exports):typeof define=="function"&&define.amd?define(["exports"],j):(H=typeof globalThis<"u"?globalThis:H||self,j(H["@stonecrop/graphql-client"]={}))})(this,(function(H){"use strict";var j=9e15,J=1e9,xe="0123456789abcdef",le="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",fe="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",_e={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-j,maxE:j,crypto:!1},Qe,Y,I=!0,he="[DecimalError] ",Q=he+"Invalid argument: ",ze=he+"Precision limit exceeded",Ze=he+"crypto unavailable",Xe="[object Decimal]",L=Math.floor,C=Math.pow,Ft=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Mt=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Pt=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,We=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,B=1e7,v=7,qt=9007199254740991,Bt=le.length-1,Se=fe.length-1,p={toStringTag:Xe};p.absoluteValue=p.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),T(e)},p.ceil=function(){return T(new this.constructor(this),this.e+1,2)},p.clampedTo=p.clamp=function(e,t){var n,i=this,r=i.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(Q+t);return n=i.cmp(e),n<0?e:i.cmp(t)>0?t:new r(i)},p.comparedTo=p.cmp=function(e){var t,n,i,r,s=this,o=s.d,a=(e=new s.constructor(e)).d,u=s.s,c=e.s;if(!o||!a)return!u||!c?NaN:u!==c?u:o===a?0:!o^u<0?1:-1;if(!o[0]||!a[0])return o[0]?u:a[0]?-c:0;if(u!==c)return u;if(s.e!==e.e)return s.e>e.e^u<0?1:-1;for(i=o.length,r=a.length,t=0,n=i<r?i:r;t<n;++t)if(o[t]!==a[t])return o[t]>a[t]^u<0?1:-1;return i===r?0:i>r^u<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())+v,i.rounding=1,n=Ut(i,rt(i,n)),i.precision=e,i.rounding=t,T(Y==2||Y==3?n.neg():n,e,t,!0)):new i(1):new i(NaN)},p.cubeRoot=p.cbrt=function(){var e,t,n,i,r,s,o,a,u,c,l=this,f=l.constructor;if(!l.isFinite()||l.isZero())return new f(l);for(I=!1,s=l.s*C(l.s*l,1/3),!s||Math.abs(s)==1/0?(n=b(l.d),e=l.e,(s=(e-n.length+1)%3)&&(n+=s==1||s==-2?"0":"00"),s=C(n,1/3),e=L((e+1)/3)-(e%3==(e<0?-1:2)),s==1/0?n="5e"+e:(n=s.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),i=new f(n),i.s=l.s):i=new f(s.toString()),o=(e=f.precision)+3;;)if(a=i,u=a.times(a).times(a),c=u.plus(l),i=D(c.plus(l).times(a),c.plus(u),o+2,1),b(a.d).slice(0,o)===(n=b(i.d)).slice(0,o))if(n=n.slice(o-3,o+1),n=="9999"||!r&&n=="4999"){if(!r&&(T(a,e+1,0),a.times(a).times(a).eq(l))){i=a;break}o+=4,r=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(T(i,e+1,1),t=!i.times(i).times(i).eq(l));break}return I=!0,T(i,e,f.rounding,t)},p.decimalPlaces=p.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-L(this.e/v))*v,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},p.dividedBy=p.div=function(e){return D(this,new this.constructor(e))},p.dividedToIntegerBy=p.divToInt=function(e){var t=this,n=t.constructor;return T(D(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 T(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,r,s=this,o=s.constructor,a=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return a;n=o.precision,i=o.rounding,o.precision=n+Math.max(s.e,s.sd())+4,o.rounding=1,r=s.d.length,r<32?(e=Math.ceil(r/3),t=(1/Ee(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),s=ee(o,1,s.times(t),new o(1),!0);for(var u,c=e,l=new o(8);c--;)u=s.times(s),s=a.minus(u.times(l.minus(u.times(l))));return T(s,o.precision=n,o.rounding=i,!0)},p.hyperbolicSine=p.sinh=function(){var e,t,n,i,r=this,s=r.constructor;if(!r.isFinite()||r.isZero())return new s(r);if(t=s.precision,n=s.rounding,s.precision=t+Math.max(r.e,r.sd())+4,s.rounding=1,i=r.d.length,i<3)r=ee(s,2,r,r,!0);else{e=1.4*Math.sqrt(i),e=e>16?16:e|0,r=r.times(1/Ee(5,e)),r=ee(s,2,r,r,!0);for(var o,a=new s(5),u=new s(16),c=new s(20);e--;)o=r.times(r),r=r.times(a.plus(o.times(u.times(o).plus(c))))}return s.precision=t,s.rounding=n,T(r,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,D(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,r=t.rounding;return n!==-1?n===0?e.isNeg()?G(t,i,r):new t(0):new t(NaN):e.isZero()?G(t,i+4,r).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=r,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,I=!1,n=n.times(n).minus(1).sqrt().plus(n),I=!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,I=!1,n=n.times(n).plus(1).sqrt().plus(n),I=!0,i.precision=e,i.rounding=t,n.ln())},p.inverseHyperbolicTangent=p.atanh=function(){var e,t,n,i,r=this,s=r.constructor;return r.isFinite()?r.e>=0?new s(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(e=s.precision,t=s.rounding,i=r.sd(),Math.max(i,e)<2*-r.e-1?T(new s(r),e,t,!0):(s.precision=n=i-r.e,r=D(r.plus(1),new s(1).minus(r),n+e,1),s.precision=e+4,s.rounding=1,r=r.ln(),s.precision=e,s.rounding=t,r.times(.5))):new s(NaN)},p.inverseSine=p.asin=function(){var e,t,n,i,r=this,s=r.constructor;return r.isZero()?new s(r):(t=r.abs().cmp(1),n=s.precision,i=s.rounding,t!==-1?t===0?(e=G(s,n+4,i).times(.5),e.s=r.s,e):new s(NaN):(s.precision=n+6,s.rounding=1,r=r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(),s.precision=n,s.rounding=i,r.times(2)))},p.inverseTangent=p.atan=function(){var e,t,n,i,r,s,o,a,u,c=this,l=c.constructor,f=l.precision,h=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&f+4<=Se)return o=G(l,f+4,h).times(.25),o.s=c.s,o}else{if(!c.s)return new l(NaN);if(f+4<=Se)return o=G(l,f+4,h).times(.5),o.s=c.s,o}for(l.precision=a=f+10,l.rounding=1,n=Math.min(28,a/v+2|0),e=n;e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(I=!1,t=Math.ceil(a/v),i=1,u=c.times(c),o=new l(c),r=c;e!==-1;)if(r=r.times(u),s=o.minus(r.div(i+=2)),r=r.times(u),o=s.plus(r.div(i+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===s.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),I=!0,T(o,l.precision=f,l.rounding=h,!0)},p.isFinite=function(){return!!this.d},p.isInteger=p.isInt=function(){return!!this.d&&L(this.e/v)>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,r,s,o,a,u,c=this,l=c.constructor,f=l.precision,h=l.rounding,m=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=c.d,c.s<0||!n||!n[0]||c.eq(1))return new l(n&&!n[0]?-1/0:c.s!=1?NaN:n?0:1/0);if(t)if(n.length>1)s=!0;else{for(r=n[0];r%10===0;)r/=10;s=r!==1}if(I=!1,a=f+m,o=Z(c,a),i=t?me(l,a+10):Z(e,a),u=D(o,i,a,1),oe(u.d,r=f,h))do if(a+=10,o=Z(c,a),i=t?me(l,a+10):Z(e,a),u=D(o,i,a,1),!s){+b(u.d).slice(r+1,r+15)+1==1e14&&(u=T(u,f+1,0));break}while(oe(u.d,r+=10,h));return I=!0,T(u,f,h)},p.minus=p.sub=function(e){var t,n,i,r,s,o,a,u,c,l,f,h,m=this,N=m.constructor;if(e=new N(e),!m.d||!e.d)return!m.s||!e.s?e=new N(NaN):m.d?e.s=-e.s:e=new N(e.d||m.s!==e.s?m:NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(c=m.d,h=e.d,a=N.precision,u=N.rounding,!c[0]||!h[0]){if(h[0])e.s=-e.s;else if(c[0])e=new N(m);else return new N(u===3?-0:0);return I?T(e,a,u):e}if(n=L(e.e/v),l=L(m.e/v),c=c.slice(),s=l-n,s){for(f=s<0,f?(t=c,s=-s,o=h.length):(t=h,n=l,o=c.length),i=Math.max(Math.ceil(a/v),o)+2,s>i&&(s=i,t.length=1),t.reverse(),i=s;i--;)t.push(0);t.reverse()}else{for(i=c.length,o=h.length,f=i<o,f&&(o=i),i=0;i<o;i++)if(c[i]!=h[i]){f=c[i]<h[i];break}s=0}for(f&&(t=c,c=h,h=t,e.s=-e.s),o=c.length,i=h.length-o;i>0;--i)c[o++]=0;for(i=h.length;i>s;){if(c[--i]<h[i]){for(r=i;r&&c[--r]===0;)c[r]=B-1;--c[r],c[i]+=B}c[i]-=h[i]}for(;c[--o]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(e.d=c,e.e=pe(c,n),I?T(e,a,u):e):new N(u===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]?T(new i(n),i.precision,i.rounding):(I=!1,i.modulo==9?(t=D(n,e.abs(),0,3,1),t.s*=e.s):t=D(n,e,0,i.modulo,1),t=t.times(e),I=!0,n.minus(t))},p.naturalExponential=p.exp=function(){return Ce(this)},p.naturalLogarithm=p.ln=function(){return Z(this)},p.negated=p.neg=function(){var e=new this.constructor(this);return e.s=-e.s,T(e)},p.plus=p.add=function(e){var t,n,i,r,s,o,a,u,c,l,f=this,h=f.constructor;if(e=new h(e),!f.d||!e.d)return!f.s||!e.s?e=new h(NaN):f.d||(e=new h(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(c=f.d,l=e.d,a=h.precision,u=h.rounding,!c[0]||!l[0])return l[0]||(e=new h(f)),I?T(e,a,u):e;if(s=L(f.e/v),i=L(e.e/v),c=c.slice(),r=s-i,r){for(r<0?(n=c,r=-r,o=l.length):(n=l,i=s,o=c.length),s=Math.ceil(a/v),o=s>o?s+1:o+1,r>o&&(r=o,n.length=1),n.reverse();r--;)n.push(0);n.reverse()}for(o=c.length,r=l.length,o-r<0&&(r=o,n=l,l=c,c=n),t=0;r;)t=(c[--r]=c[r]+l[r]+t)/B|0,c[r]%=B;for(t&&(c.unshift(t),++i),o=c.length;c[--o]==0;)c.pop();return e.d=c,e.e=pe(c,i),I?T(e,a,u):e},p.precision=p.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Q+e);return n.d?(t=Ke(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},p.round=function(){var e=this,t=e.constructor;return T(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())+v,i.rounding=1,n=jt(i,rt(i,n)),i.precision=e,i.rounding=t,T(Y>2?n.neg():n,e,t,!0)):new i(NaN)},p.squareRoot=p.sqrt=function(){var e,t,n,i,r,s,o=this,a=o.d,u=o.e,c=o.s,l=o.constructor;if(c!==1||!a||!a[0])return new l(!c||c<0&&(!a||a[0])?NaN:a?o:1/0);for(I=!1,c=Math.sqrt(+o),c==0||c==1/0?(t=b(a),(t.length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=L((u+1)/2)-(u<0||u%2),c==1/0?t="5e"+u:(t=c.toExponential(),t=t.slice(0,t.indexOf("e")+1)+u),i=new l(t)):i=new l(c.toString()),n=(u=l.precision)+3;;)if(s=i,i=s.plus(D(o,s,n+2,1)).times(.5),b(s.d).slice(0,n)===(t=b(i.d)).slice(0,n))if(t=t.slice(n-3,n+1),t=="9999"||!r&&t=="4999"){if(!r&&(T(s,u+1,0),s.times(s).eq(o))){i=s;break}n+=4,r=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(T(i,u+1,1),e=!i.times(i).eq(o));break}return I=!0,T(i,u,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=D(n,new i(1).minus(n.times(n)).sqrt(),e+10,0),i.precision=e,i.rounding=t,T(Y==2||Y==4?n.neg():n,e,t,!0)):new i(NaN)},p.times=p.mul=function(e){var t,n,i,r,s,o,a,u,c,l=this,f=l.constructor,h=l.d,m=(e=new f(e)).d;if(e.s*=l.s,!h||!h[0]||!m||!m[0])return new f(!e.s||h&&!h[0]&&!m||m&&!m[0]&&!h?NaN:!h||!m?e.s/0:e.s*0);for(n=L(l.e/v)+L(e.e/v),u=h.length,c=m.length,u<c&&(s=h,h=m,m=s,o=u,u=c,c=o),s=[],o=u+c,i=o;i--;)s.push(0);for(i=c;--i>=0;){for(t=0,r=u+i;r>i;)a=s[r]+m[i]*h[r-i-1]+t,s[r--]=a%B|0,t=a/B|0;s[r]=(s[r]+t)%B|0}for(;!s[--o];)s.pop();return t?++n:s.shift(),e.d=s,e.e=pe(s,n),I?T(e,f.precision,f.rounding):e},p.toBinary=function(e,t){return ke(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:(M(e,0,J),t===void 0?t=i.rounding:M(t,0,8),T(n,e+n.e+1,t))},p.toExponential=function(e,t){var n,i=this,r=i.constructor;return e===void 0?n=$(i,!0):(M(e,0,J),t===void 0?t=r.rounding:M(t,0,8),i=T(new r(i),e+1,t),n=$(i,!0,e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},p.toFixed=function(e,t){var n,i,r=this,s=r.constructor;return e===void 0?n=$(r):(M(e,0,J),t===void 0?t=s.rounding:M(t,0,8),i=T(new s(r),e+r.e+1,t),n=$(i,!1,e+i.e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},p.toFraction=function(e){var t,n,i,r,s,o,a,u,c,l,f,h,m=this,N=m.d,E=m.constructor;if(!N)return new E(m);if(c=n=new E(1),i=u=new E(0),t=new E(i),s=t.e=Ke(N)-m.e-1,o=s%v,t.d[0]=C(10,o<0?v+o:o),e==null)e=s>0?t:c;else{if(a=new E(e),!a.isInt()||a.lt(c))throw Error(Q+a);e=a.gt(t)?s>0?t:c:a}for(I=!1,a=new E(b(N)),l=E.precision,E.precision=s=N.length*v*2;f=D(a,t,0,1,1),r=n.plus(f.times(i)),r.cmp(e)!=1;)n=i,i=r,r=c,c=u.plus(f.times(r)),u=r,r=t,t=a.minus(f.times(r)),a=r;return r=D(e.minus(n),i,0,1,1),u=u.plus(r.times(c)),n=n.plus(r.times(i)),u.s=c.s=m.s,h=D(c,i,s,1).minus(m).abs().cmp(D(u,n,s,1).minus(m).abs())<1?[c,i]:[u,n],E.precision=l,I=!0,h},p.toHexadecimal=p.toHex=function(e,t){return ke(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:M(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]?(I=!1,n=D(n,e,0,t,1).times(e),I=!0,T(n)):(e.s=n.s,n=e),n},p.toNumber=function(){return+this},p.toOctal=function(e,t){return ke(this,8,e,t)},p.toPower=p.pow=function(e){var t,n,i,r,s,o,a=this,u=a.constructor,c=+(e=new u(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new u(C(+a,c));if(a=new u(a),a.eq(1))return a;if(i=u.precision,s=u.rounding,e.eq(1))return T(a,i,s);if(t=L(e.e/v),t>=e.d.length-1&&(n=c<0?-c:c)<=qt)return r=et(u,a,n,i),e.s<0?new u(1).div(r):T(r,i,s);if(o=a.s,o<0){if(t<e.d.length-1)return new u(NaN);if((e.d[t]&1)==0&&(o=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=o,a}return n=C(+a,c),t=n==0||!isFinite(n)?L(c*(Math.log("0."+b(a.d))/Math.LN10+a.e+1)):new u(n+"").e,t>u.maxE+1||t<u.minE-1?new u(t>0?o/0:0):(I=!1,u.rounding=a.s=1,n=Math.min(12,(t+"").length),r=Ce(e.times(Z(a,i+n)),i),r.d&&(r=T(r,i+5,1),oe(r.d,i,s)&&(t=i+10,r=T(Ce(e.times(Z(a,t+n)),t),t+5,1),+b(r.d).slice(i+1,i+15)+1==1e14&&(r=T(r,i+1,0)))),r.s=o,I=!0,u.rounding=s,T(r,i,s))},p.toPrecision=function(e,t){var n,i=this,r=i.constructor;return e===void 0?n=$(i,i.e<=r.toExpNeg||i.e>=r.toExpPos):(M(e,1,J),t===void 0?t=r.rounding:M(t,0,8),i=T(new r(i),e,t),n=$(i,e<=i.e||i.e<=r.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):(M(e,1,J),t===void 0?t=i.rounding:M(t,0,8)),T(new i(n),e,t)},p.toString=function(){var e=this,t=e.constructor,n=$(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},p.truncated=p.trunc=function(){return T(new this.constructor(this),this.e+1,1)},p.valueOf=p.toJSON=function(){var e=this,t=e.constructor,n=$(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};function b(e){var t,n,i,r=e.length-1,s="",o=e[0];if(r>0){for(s+=o,t=1;t<r;t++)i=e[t]+"",n=v-i.length,n&&(s+=z(n)),s+=i;o=e[t],i=o+"",n=v-i.length,n&&(s+=z(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}function M(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Q+e)}function oe(e,t,n,i){var r,s,o,a;for(s=e[0];s>=10;s/=10)--t;return--t<0?(t+=v,r=0):(r=Math.ceil((t+1)/v),t%=v),s=C(10,v-t),a=e[r]%s|0,i==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),o=n<4&&a==99999||n>3&&a==49999||a==5e4||a==0):o=(n<4&&a+1==s||n>3&&a+1==s/2)&&(e[r+1]/s/100|0)==C(10,t-2)-1||(a==s/2||a==0)&&(e[r+1]/s/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),o=(i||n<4)&&a==9999||!i&&n>3&&a==4999):o=((i||n<4)&&a+1==s||!i&&n>3&&a+1==s/2)&&(e[r+1]/s/1e3|0)==C(10,t-3)-1,o}function de(e,t,n){for(var i,r=[0],s,o=0,a=e.length;o<a;){for(s=r.length;s--;)r[s]*=t;for(r[0]+=xe.indexOf(e.charAt(o++)),i=0;i<r.length;i++)r[i]>n-1&&(r[i+1]===void 0&&(r[i+1]=0),r[i+1]+=r[i]/n|0,r[i]%=n)}return r.reverse()}function Ut(e,t){var n,i,r;if(t.isZero())return t;i=t.d.length,i<32?(n=Math.ceil(i/3),r=(1/Ee(4,n)).toString()):(n=16,r="2.3283064365386962890625e-10"),e.precision+=n,t=ee(e,1,t.times(r),new e(1));for(var s=n;s--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}var D=(function(){function e(i,r,s){var o,a=0,u=i.length;for(i=i.slice();u--;)o=i[u]*r+a,i[u]=o%s|0,a=o/s|0;return a&&i.unshift(a),i}function t(i,r,s,o){var a,u;if(s!=o)u=s>o?1:-1;else for(a=u=0;a<s;a++)if(i[a]!=r[a]){u=i[a]>r[a]?1:-1;break}return u}function n(i,r,s,o){for(var a=0;s--;)i[s]-=a,a=i[s]<r[s]?1:0,i[s]=a*o+i[s]-r[s];for(;!i[0]&&i.length>1;)i.shift()}return function(i,r,s,o,a,u){var c,l,f,h,m,N,E,R,y,P,A,_,X,q,se,Ae,ue,He,V,ye,De=i.constructor,Je=i.s==r.s?1:-1,F=i.d,x=r.d;if(!F||!F[0]||!x||!x[0])return new De(!i.s||!r.s||(F?x&&F[0]==x[0]:!x)?NaN:F&&F[0]==0||!x?Je*0:Je/0);for(u?(m=1,l=i.e-r.e):(u=B,m=v,l=L(i.e/m)-L(r.e/m)),V=x.length,ue=F.length,y=new De(Je),P=y.d=[],f=0;x[f]==(F[f]||0);f++);if(x[f]>(F[f]||0)&&l--,s==null?(q=s=De.precision,o=De.rounding):a?q=s+(i.e-r.e)+1:q=s,q<0)P.push(1),N=!0;else{if(q=q/m+2|0,f=0,V==1){for(h=0,x=x[0],q++;(f<ue||h)&&q--;f++)se=h*u+(F[f]||0),P[f]=se/x|0,h=se%x|0;N=h||f<ue}else{for(h=u/(x[0]+1)|0,h>1&&(x=e(x,h,u),F=e(F,h,u),V=x.length,ue=F.length),Ae=V,A=F.slice(0,V),_=A.length;_<V;)A[_++]=0;ye=x.slice(),ye.unshift(0),He=x[0],x[1]>=u/2&&++He;do h=0,c=t(x,A,V,_),c<0?(X=A[0],V!=_&&(X=X*u+(A[1]||0)),h=X/He|0,h>1?(h>=u&&(h=u-1),E=e(x,h,u),R=E.length,_=A.length,c=t(E,A,R,_),c==1&&(h--,n(E,V<R?ye:x,R,u))):(h==0&&(c=h=1),E=x.slice()),R=E.length,R<_&&E.unshift(0),n(A,E,_,u),c==-1&&(_=A.length,c=t(x,A,V,_),c<1&&(h++,n(A,V<_?ye:x,_,u))),_=A.length):c===0&&(h++,A=[0]),P[f++]=h,c&&A[0]?A[_++]=F[Ae]||0:(A=[F[Ae]],_=1);while((Ae++<ue||A[0]!==void 0)&&q--);N=A[0]!==void 0}P[0]||P.shift()}if(m==1)y.e=l,Qe=N;else{for(f=1,h=P[0];h>=10;h/=10)f++;y.e=f+l*m-1,T(y,a?s+y.e+1:s,o,N)}return y}})();function T(e,t,n,i){var r,s,o,a,u,c,l,f,h,m=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(r=1,a=f[0];a>=10;a/=10)r++;if(s=t-r,s<0)s+=v,o=t,l=f[h=0],u=l/C(10,r-o-1)%10|0;else if(h=Math.ceil((s+1)/v),a=f.length,h>=a)if(i){for(;a++<=h;)f.push(0);l=u=0,r=1,s%=v,o=s-v+1}else break e;else{for(l=a=f[h],r=1;a>=10;a/=10)r++;s%=v,o=s-v+r,u=o<0?0:l/C(10,r-o-1)%10|0}if(i=i||t<0||f[h+1]!==void 0||(o<0?l:l%C(10,r-o-1)),c=n<4?(u||i)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||i||n==6&&(s>0?o>0?l/C(10,r-o):0:f[h-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,c?(t-=e.e+1,f[0]=C(10,(v-t%v)%v),e.e=-t||0):f[0]=e.e=0,e;if(s==0?(f.length=h,a=1,h--):(f.length=h+1,a=C(10,v-s),f[h]=o>0?(l/C(10,r-o)%C(10,o)|0)*a:0),c)for(;;)if(h==0){for(s=1,o=f[0];o>=10;o/=10)s++;for(o=f[0]+=a,a=1;o>=10;o/=10)a++;s!=a&&(e.e++,f[0]==B&&(f[0]=1));break}else{if(f[h]+=a,f[h]!=B)break;f[h--]=0,a=1}for(s=f.length;f[--s]===0;)f.pop()}return I&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e<m.minE&&(e.e=0,e.d=[0])),e}function $(e,t,n){if(!e.isFinite())return it(e);var i,r=e.e,s=b(e.d),o=s.length;return t?(n&&(i=n-o)>0?s=s.charAt(0)+"."+s.slice(1)+z(i):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):r<0?(s="0."+z(-r-1)+s,n&&(i=n-o)>0&&(s+=z(i))):r>=o?(s+=z(r+1-o),n&&(i=n-r-1)>0&&(s=s+"."+z(i))):((i=r+1)<o&&(s=s.slice(0,i)+"."+s.slice(i)),n&&(i=n-o)>0&&(r+1===o&&(s+="."),s+=z(i))),s}function pe(e,t){var n=e[0];for(t*=v;n>=10;n/=10)t++;return t}function me(e,t,n){if(t>Bt)throw I=!0,n&&(e.precision=n),Error(ze);return T(new e(le),t,1,!0)}function G(e,t,n){if(t>Se)throw Error(ze);return T(new e(fe),t,n,!0)}function Ke(e){var t=e.length-1,n=t*v+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 z(e){for(var t="";e--;)t+="0";return t}function et(e,t,n,i){var r,s=new e(1),o=Math.ceil(i/v+4);for(I=!1;;){if(n%2&&(s=s.times(t),st(s.d,o)&&(r=!0)),n=L(n/2),n===0){n=s.d.length-1,r&&s.d[n]===0&&++s.d[n];break}t=t.times(t),st(t.d,o)}return I=!0,s}function tt(e){return e.d[e.d.length-1]&1}function nt(e,t,n){for(var i,r,s=new e(t[0]),o=0;++o<t.length;){if(r=new e(t[o]),!r.s){s=r;break}i=s.cmp(r),(i===n||i===0&&s.s===n)&&(s=r)}return s}function Ce(e,t){var n,i,r,s,o,a,u,c=0,l=0,f=0,h=e.constructor,m=h.rounding,N=h.precision;if(!e.d||!e.d[0]||e.e>17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(I=!1,u=N):u=t,a=new h(.03125);e.e>-2;)e=e.times(a),f+=5;for(i=Math.log(C(2,f))/Math.LN10*2+5|0,u+=i,n=s=o=new h(1),h.precision=u;;){if(s=T(s.times(e),u,1),n=n.times(++l),a=o.plus(D(s,n,u,1)),b(a.d).slice(0,u)===b(o.d).slice(0,u)){for(r=f;r--;)o=T(o.times(o),u,1);if(t==null)if(c<3&&oe(o.d,u-i,m,c))h.precision=u+=10,n=s=a=new h(1),l=0,c++;else return T(o,h.precision=N,m,I=!0);else return h.precision=N,o}o=a}}function Z(e,t){var n,i,r,s,o,a,u,c,l,f,h,m=1,N=10,E=e,R=E.d,y=E.constructor,P=y.rounding,A=y.precision;if(E.s<0||!R||!R[0]||!E.e&&R[0]==1&&R.length==1)return new y(R&&!R[0]?-1/0:E.s!=1?NaN:R?0:E);if(t==null?(I=!1,l=A):l=t,y.precision=l+=N,n=b(R),i=n.charAt(0),Math.abs(s=E.e)<15e14){for(;i<7&&i!=1||i==1&&n.charAt(1)>3;)E=E.times(e),n=b(E.d),i=n.charAt(0),m++;s=E.e,i>1?(E=new y("0."+n),s++):E=new y(i+"."+n.slice(1))}else return c=me(y,l+2,A).times(s+""),E=Z(new y(i+"."+n.slice(1)),l-N).plus(c),y.precision=A,t==null?T(E,A,P,I=!0):E;for(f=E,u=o=E=D(E.minus(1),E.plus(1),l,1),h=T(E.times(E),l,1),r=3;;){if(o=T(o.times(h),l,1),c=u.plus(D(o,new y(r),l,1)),b(c.d).slice(0,l)===b(u.d).slice(0,l))if(u=u.times(2),s!==0&&(u=u.plus(me(y,l+2,A).times(s+""))),u=D(u,new y(m),l,1),t==null)if(oe(u.d,l-N,P,a))y.precision=l+=N,c=o=E=D(f.minus(1),f.plus(1),l,1),h=T(E.times(E),l,1),r=a=1;else return T(u,y.precision=A,P,I=!0);else return y.precision=A,u;u=c,r+=2}}function it(e){return String(e.s*e.s/0)}function ge(e,t){var n,i,r;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(r=t.length;t.charCodeAt(r-1)===48;--r);if(t=t.slice(i,r),t){if(r-=i,e.e=n=n-i-1,e.d=[],i=(n+1)%v,n<0&&(i+=v),i<r){for(i&&e.d.push(+t.slice(0,i)),r-=v;i<r;)e.d.push(+t.slice(i,i+=v));t=t.slice(i),i=v-t.length}else i-=r;for(;i--;)t+="0";e.d.push(+t),I&&(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 Vt(e,t){var n,i,r,s,o,a,u,c,l;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),We.test(t))return ge(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Mt.test(t))n=16,t=t.toLowerCase();else if(Ft.test(t))n=2;else if(Pt.test(t))n=8;else throw Error(Q+t);for(s=t.search(/p/i),s>0?(u=+t.slice(s+1),t=t.substring(2,s)):t=t.slice(2),s=t.indexOf("."),o=s>=0,i=e.constructor,o&&(t=t.replace(".",""),a=t.length,s=a-s,r=et(i,new i(n),s,s*2)),c=de(t,n,B),l=c.length-1,s=l;c[s]===0;--s)c.pop();return s<0?new i(e.s*0):(e.e=pe(c,l),e.d=c,I=!1,o&&(e=D(e,r,a*4)),u&&(e=e.times(Math.abs(u)<54?C(2,u):te.pow(2,u))),I=!0,e)}function jt(e,t){var n,i=t.d.length;if(i<3)return t.isZero()?t:ee(e,2,t,t);n=1.4*Math.sqrt(i),n=n>16?16:n|0,t=t.times(1/Ee(5,n)),t=ee(e,2,t,t);for(var r,s=new e(5),o=new e(16),a=new e(20);n--;)r=t.times(t),t=t.times(s.plus(r.times(o.times(r).minus(a))));return t}function ee(e,t,n,i,r){var s,o,a,u,c=e.precision,l=Math.ceil(c/v);for(I=!1,u=n.times(n),a=new e(i);;){if(o=D(a.times(u),new e(t++*t++),c,1),a=r?i.plus(o):i.minus(o),i=D(o.times(u),new e(t++*t++),c,1),o=a.plus(i),o.d[l]!==void 0){for(s=l;o.d[s]===a.d[s]&&s--;);if(s==-1)break}s=a,a=i,i=o,o=s}return I=!0,o.d.length=l+1,o}function Ee(e,t){for(var n=e;--t;)n*=e;return n}function rt(e,t){var n,i=t.s<0,r=G(e,e.precision,1),s=r.times(.5);if(t=t.abs(),t.lte(s))return Y=i?4:1,t;if(n=t.divToInt(r),n.isZero())Y=i?3:2;else{if(t=t.minus(n.times(r)),t.lte(s))return Y=tt(n)?i?2:3:i?4:1,t;Y=tt(n)?i?1:4:i?3:2}return t.minus(r).abs()}function ke(e,t,n,i){var r,s,o,a,u,c,l,f,h,m=e.constructor,N=n!==void 0;if(N?(M(n,1,J),i===void 0?i=m.rounding:M(i,0,8)):(n=m.precision,i=m.rounding),!e.isFinite())l=it(e);else{for(l=$(e),o=l.indexOf("."),N?(r=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):r=t,o>=0&&(l=l.replace(".",""),h=new m(1),h.e=l.length-o,h.d=de($(h),10,r),h.e=h.d.length),f=de(l,10,r),s=u=f.length;f[--u]==0;)f.pop();if(!f[0])l=N?"0p+0":"0";else{if(o<0?s--:(e=new m(e),e.d=f,e.e=s,e=D(e,h,n,i,0,r),f=e.d,s=e.e,c=Qe),o=f[n],a=r/2,c=c||f[n+1]!==void 0,c=i<4?(o!==void 0||c)&&(i===0||i===(e.s<0?3:2)):o>a||o===a&&(i===4||c||i===6&&f[n-1]&1||i===(e.s<0?8:7)),f.length=n,c)for(;++f[--n]>r-1;)f[n]=0,n||(++s,f.unshift(1));for(u=f.length;!f[u-1];--u);for(o=0,l="";o<u;o++)l+=xe.charAt(f[o]);if(N){if(u>1)if(t==16||t==8){for(o=t==16?4:3,--u;u%o;u++)l+="0";for(f=de(l,r,t),u=f.length;!f[u-1];--u);for(o=1,l="1.";o<u;o++)l+=xe.charAt(f[o])}else l=l.charAt(0)+"."+l.slice(1);l=l+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)l="0"+l;l="0."+l}else if(++s>u)for(s-=u;s--;)l+="0";else s<u&&(l=l.slice(0,s)+"."+l.slice(s))}l=(t==16?"0x":t==2?"0b":t==8?"0o":"")+l}return e.s<0?"-"+l:l}function st(e,t){if(e.length>t)return e.length=t,!0}function $t(e){return new this(e).abs()}function Gt(e){return new this(e).acos()}function Yt(e){return new this(e).acosh()}function Ht(e,t){return new this(e).plus(t)}function Jt(e){return new this(e).asin()}function Qt(e){return new this(e).asinh()}function zt(e){return new this(e).atan()}function Zt(e){return new this(e).atanh()}function Xt(e,t){e=new this(e),t=new this(t);var n,i=this.precision,r=this.rounding,s=i+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=G(this,s,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?G(this,i,r):new this(0),n.s=e.s):!e.d||t.isZero()?(n=G(this,s,1).times(.5),n.s=e.s):t.s<0?(this.precision=s,this.rounding=1,n=this.atan(D(e,t,s,1)),t=G(this,s,1),this.precision=i,this.rounding=r,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(D(e,t,s,1)),n}function Wt(e){return new this(e).cbrt()}function Kt(e){return T(e=new this(e),e.e+1,2)}function en(e,t,n){return new this(e).clamp(t,n)}function tn(e){if(!e||typeof e!="object")throw Error(he+"Object expected");var t,n,i,r=e.defaults===!0,s=["precision",1,J,"rounding",0,8,"toExpNeg",-j,0,"toExpPos",0,j,"maxE",0,j,"minE",-j,0,"modulo",0,9];for(t=0;t<s.length;t+=3)if(n=s[t],r&&(this[n]=_e[n]),(i=e[n])!==void 0)if(L(i)===i&&i>=s[t+1]&&i<=s[t+2])this[n]=i;else throw Error(Q+n+": "+i);if(n="crypto",r&&(this[n]=_e[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(Ze);else this[n]=!1;else throw Error(Q+n+": "+i);return this}function nn(e){return new this(e).cos()}function rn(e){return new this(e).cosh()}function ot(e){var t,n,i;function r(s){var o,a,u,c=this;if(!(c instanceof r))return new r(s);if(c.constructor=r,at(s)){c.s=s.s,I?!s.d||s.e>r.maxE?(c.e=NaN,c.d=null):s.e<r.minE?(c.e=0,c.d=[0]):(c.e=s.e,c.d=s.d.slice()):(c.e=s.e,c.d=s.d?s.d.slice():s.d);return}if(u=typeof s,u==="number"){if(s===0){c.s=1/s<0?-1:1,c.e=0,c.d=[0];return}if(s<0?(s=-s,c.s=-1):c.s=1,s===~~s&&s<1e7){for(o=0,a=s;a>=10;a/=10)o++;I?o>r.maxE?(c.e=NaN,c.d=null):o<r.minE?(c.e=0,c.d=[0]):(c.e=o,c.d=[s]):(c.e=o,c.d=[s]);return}if(s*0!==0){s||(c.s=NaN),c.e=NaN,c.d=null;return}return ge(c,s.toString())}if(u==="string")return(a=s.charCodeAt(0))===45?(s=s.slice(1),c.s=-1):(a===43&&(s=s.slice(1)),c.s=1),We.test(s)?ge(c,s):Vt(c,s);if(u==="bigint")return s<0?(s=-s,c.s=-1):c.s=1,ge(c,s.toString());throw Error(Q+s)}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=tn,r.clone=ot,r.isDecimal=at,r.abs=$t,r.acos=Gt,r.acosh=Yt,r.add=Ht,r.asin=Jt,r.asinh=Qt,r.atan=zt,r.atanh=Zt,r.atan2=Xt,r.cbrt=Wt,r.ceil=Kt,r.clamp=en,r.cos=nn,r.cosh=rn,r.div=sn,r.exp=on,r.floor=an,r.hypot=cn,r.ln=un,r.log=ln,r.log10=hn,r.log2=fn,r.max=dn,r.min=pn,r.mod=mn,r.mul=gn,r.pow=En,r.random=Nn,r.round=Tn,r.sign=wn,r.sin=vn,r.sinh=In,r.sqrt=On,r.sub=An,r.sum=yn,r.tan=Dn,r.tanh=xn,r.trunc=_n,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 r.config(e),r}function sn(e,t){return new this(e).div(t)}function on(e){return new this(e).exp()}function an(e){return T(e=new this(e),e.e+1,3)}function cn(){var e,t,n=new this(0);for(I=!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 I=!0,new this(1/0);n=t}return I=!0,n.sqrt()}function at(e){return e instanceof te||e&&e.toStringTag===Xe||!1}function un(e){return new this(e).ln()}function ln(e,t){return new this(e).log(t)}function fn(e){return new this(e).log(2)}function hn(e){return new this(e).log(10)}function dn(){return nt(this,arguments,-1)}function pn(){return nt(this,arguments,1)}function mn(e,t){return new this(e).mod(t)}function gn(e,t){return new this(e).mul(t)}function En(e,t){return new this(e).pow(t)}function Nn(e){var t,n,i,r,s=0,o=new this(1),a=[];if(e===void 0?e=this.precision:M(e,1,J),i=Math.ceil(e/v),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(i));s<i;)r=t[s],r>=429e7?t[s]=crypto.getRandomValues(new Uint32Array(1))[0]:a[s++]=r%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(i*=4);s<i;)r=t[s]+(t[s+1]<<8)+(t[s+2]<<16)+((t[s+3]&127)<<24),r>=214e7?crypto.randomBytes(4).copy(t,s):(a.push(r%1e7),s+=4);s=i/4}else throw Error(Ze);else for(;s<i;)a[s++]=Math.random()*1e7|0;for(i=a[--s],e%=v,i&&e&&(r=C(10,v-e),a[s]=(i/r|0)*r);a[s]===0;s--)a.pop();if(s<0)n=0,a=[0];else{for(n=-1;a[0]===0;n-=v)a.shift();for(i=1,r=a[0];r>=10;r/=10)i++;i<v&&(n-=v-i)}return o.e=n,o.d=a,o}function Tn(e){return T(e=new this(e),e.e+1,this.rounding)}function wn(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function vn(e){return new this(e).sin()}function In(e){return new this(e).sinh()}function On(e){return new this(e).sqrt()}function An(e,t){return new this(e).sub(t)}function yn(){var e=0,t=arguments,n=new this(t[e]);for(I=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return I=!0,T(n,this.precision,this.rounding)}function Dn(e){return new this(e).tan()}function xn(e){return new this(e).tanh()}function _n(e){return T(e=new this(e),e.e+1,1)}p[Symbol.for("nodejs.util.inspect.custom")]=p.toString,p[Symbol.toStringTag]="Decimal";var te=p.constructor=ot(_e);le=new te(le),fe=new te(fe);class W extends Error{response;request;constructor(t,n){const i=`${W.extractMessage(t)}: ${JSON.stringify({response:t,request:n})}`;super(i),Object.setPrototypeOf(this,W.prototype),this.response=t,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,W)}static extractMessage(t){return t.errors?.[0]?.message??`GraphQL Error (Code: ${String(t.status)})`}}const ct=e=>e.toUpperCase(),Re=e=>typeof e=="function"?e():e,ut=(e,t)=>e.map((n,i)=>[n,t[i]]),ne=e=>{let t={};return e instanceof Headers?t=Sn(e):Array.isArray(e)?e.forEach(([n,i])=>{n&&i!==void 0&&(t[n]=i)}):e&&(t=e),t},Sn=e=>{const t={};return e.forEach((n,i)=>{t[i]=n}),t},Cn=e=>{try{const t=e();return kn(t)?t.catch(n=>lt(n)):t}catch(t){return lt(t)}},lt=e=>e instanceof Error?e:new Error(String(e)),kn=e=>typeof e=="object"&&e!==null&&"then"in e&&typeof e.then=="function"&&"catch"in e&&typeof e.catch=="function"&&"finally"in e&&typeof e.finally=="function",be=e=>{throw new Error(`Unhandled case: ${String(e)}`)},Ne=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Rn=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0},bn=(e,t,n)=>e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0};function Te(e,t){if(!!!e)throw new Error(t)}function Ln(e){return typeof e=="object"&&e!==null}function Fn(e,t){if(!!!e)throw new Error("Unexpected invariant triggered.")}const Mn=/\r\n|[\n\r]/g;function Le(e,t){let n=0,i=1;for(const r of e.body.matchAll(Mn)){if(typeof r.index=="number"||Fn(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function Pn(e){return ft(e.source,Le(e.source,e.start))}function ft(e,t){const n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,o=t.line+s,a=t.line===1?n:0,u=t.column+a,c=`${e.name}:${o}:${u}
|
|
2
|
+
`,l=i.split(/\r\n|[\n\r]/g),f=l[r];if(f.length>120){const h=Math.floor(u/80),m=u%80,N=[];for(let E=0;E<f.length;E+=80)N.push(f.slice(E,E+80));return c+ht([[`${o} |`,N[0]],...N.slice(1,h+1).map(E=>["|",E]),["|","^".padStart(m)],["|",N[h+1]]])}return c+ht([[`${o-1} |`,l[r-1]],[`${o} |`,f],["|","^".padStart(u)],[`${o+1} |`,l[r+1]]])}function ht(e){const t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(`
|
|
3
|
+
`)}function qn(e){const t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class Fe extends Error{constructor(t,...n){var i,r,s;const{nodes:o,source:a,positions:u,path:c,originalError:l,extensions:f}=qn(n);super(t),this.name="GraphQLError",this.path=c??void 0,this.originalError=l??void 0,this.nodes=dt(Array.isArray(o)?o:o?[o]:void 0);const h=dt((i=this.nodes)===null||i===void 0?void 0:i.map(N=>N.loc).filter(N=>N!=null));this.source=a??(h==null||(r=h[0])===null||r===void 0?void 0:r.source),this.positions=u??h?.map(N=>N.start),this.locations=u&&a?u.map(N=>Le(a,N)):h?.map(N=>Le(N.source,N.start));const m=Ln(l?.extensions)?l?.extensions:void 0;this.extensions=(s=f??m)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),l!=null&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Fe):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(t+=`
|
|
4
4
|
|
|
5
|
-
`+
|
|
5
|
+
`+Pn(n.loc));else if(this.source&&this.locations)for(const n of this.locations)t+=`
|
|
6
6
|
|
|
7
|
-
`+
|
|
7
|
+
`+ft(this.source,n);return t}toJSON(){const t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}function dt(e){return e===void 0||e.length===0?void 0:e}function k(e,t,n){return new Fe(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Bn{constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class pt{constructor(t,n,i,r,s,o){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=s,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const mt={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},Un=new Set(Object.keys(mt));function gt(e){const t=e?.kind;return typeof t=="string"&&Un.has(t)}var ie;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(ie||(ie={}));var Me;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(Me||(Me={}));var w;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",e.TYPE_COORDINATE="TypeCoordinate",e.MEMBER_COORDINATE="MemberCoordinate",e.ARGUMENT_COORDINATE="ArgumentCoordinate",e.DIRECTIVE_COORDINATE="DirectiveCoordinate",e.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate"})(w||(w={}));function Pe(e){return e===9||e===32}function ae(e){return e>=48&&e<=57}function Et(e){return e>=97&&e<=122||e>=65&&e<=90}function Nt(e){return Et(e)||e===95}function Vn(e){return Et(e)||ae(e)||e===95}function jn(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let o=0;o<e.length;++o){var s;const a=e[o],u=$n(a);u!==a.length&&(i=(s=i)!==null&&s!==void 0?s:o,r=o,o!==0&&u<n&&(n=u))}return e.map((o,a)=>a===0?o:o.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}function $n(e){let t=0;for(;t<e.length&&Pe(e.charCodeAt(t));)++t;return t}function Gn(e,t){const n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=i.length===1,s=i.length>1&&i.slice(1).every(m=>m.length===0||Pe(m.charCodeAt(0))),o=n.endsWith('\\"""'),a=e.endsWith('"')&&!o,u=e.endsWith("\\"),c=a||u,l=!r||e.length>70||c||s||o;let f="";const h=r&&Pe(e.charCodeAt(0));return(l&&!h||s)&&(f+=`
|
|
8
8
|
`),f+=n,(l||c)&&(f+=`
|
|
9
|
-
`),'"""'+f+'"""'}var
|
|
10
|
-
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw
|
|
11
|
-
`));return e.line+=u.length-1,e.lineStart=r,l}if(c===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){a+=n.slice(o,s),o=s+1,s+=4;continue}if(c===10||c===13){a+=n.slice(o,s),u.push(a),c===13&&n.charCodeAt(s+1)===10?s+=2:++s,a="",o=s,r=s;continue}if(
|
|
9
|
+
`),'"""'+f+'"""'}var d;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.DOT=".",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(d||(d={}));class Yn{constructor(t){const n=new pt(d.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==d.EOF)do if(t.next)t=t.next;else{const n=Jn(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===d.COMMENT);return t}}function Hn(e){return e===d.BANG||e===d.DOLLAR||e===d.AMP||e===d.PAREN_L||e===d.PAREN_R||e===d.DOT||e===d.SPREAD||e===d.COLON||e===d.EQUALS||e===d.AT||e===d.BRACKET_L||e===d.BRACKET_R||e===d.BRACE_L||e===d.PIPE||e===d.BRACE_R}function re(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function we(e,t){return Tt(e.charCodeAt(t))&&wt(e.charCodeAt(t+1))}function Tt(e){return e>=55296&&e<=56319}function wt(e){return e>=56320&&e<=57343}function K(e,t){const n=e.source.body.codePointAt(t);if(n===void 0)return d.EOF;if(n>=32&&n<=126){const i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function S(e,t,n,i,r){const s=e.line,o=1+n-e.lineStart;return new pt(t,n,i,s,o,r)}function Jn(e,t){const n=e.source.body,i=n.length;let r=t;for(;r<i;){const s=n.charCodeAt(r);switch(s){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:n.charCodeAt(r+1)===10?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return Qn(e,r);case 33:return S(e,d.BANG,r,r+1);case 36:return S(e,d.DOLLAR,r,r+1);case 38:return S(e,d.AMP,r,r+1);case 40:return S(e,d.PAREN_L,r,r+1);case 41:return S(e,d.PAREN_R,r,r+1);case 46:if(n.charCodeAt(r+1)===46&&n.charCodeAt(r+2)===46)return S(e,d.SPREAD,r,r+3);break;case 58:return S(e,d.COLON,r,r+1);case 61:return S(e,d.EQUALS,r,r+1);case 64:return S(e,d.AT,r,r+1);case 91:return S(e,d.BRACKET_L,r,r+1);case 93:return S(e,d.BRACKET_R,r,r+1);case 123:return S(e,d.BRACE_L,r,r+1);case 124:return S(e,d.PIPE,r,r+1);case 125:return S(e,d.BRACE_R,r,r+1);case 34:return n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34?ei(e,r):Zn(e,r)}if(ae(s)||s===45)return zn(e,r,s);if(Nt(s))return ti(e,r);throw k(e.source,r,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:re(s)||we(n,r)?`Unexpected character: ${K(e,r)}.`:`Invalid character: ${K(e,r)}.`)}return S(e,d.EOF,i,i)}function Qn(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const s=n.charCodeAt(r);if(s===10||s===13)break;if(re(s))++r;else if(we(n,r))r+=2;else break}return S(e,d.COMMENT,t,r,n.slice(t+1,r))}function zn(e,t,n){const i=e.source.body;let r=t,s=n,o=!1;if(s===45&&(s=i.charCodeAt(++r)),s===48){if(s=i.charCodeAt(++r),ae(s))throw k(e.source,r,`Invalid number, unexpected digit after 0: ${K(e,r)}.`)}else r=qe(e,r,s),s=i.charCodeAt(r);if(s===46&&(o=!0,s=i.charCodeAt(++r),r=qe(e,r,s),s=i.charCodeAt(r)),(s===69||s===101)&&(o=!0,s=i.charCodeAt(++r),(s===43||s===45)&&(s=i.charCodeAt(++r)),r=qe(e,r,s),s=i.charCodeAt(r)),s===46||Nt(s))throw k(e.source,r,`Invalid number, expected digit but got: ${K(e,r)}.`);return S(e,o?d.FLOAT:d.INT,t,r,i.slice(t,r))}function qe(e,t,n){if(!ae(n))throw k(e.source,t,`Invalid number, expected digit but got: ${K(e,t)}.`);const i=e.source.body;let r=t+1;for(;ae(i.charCodeAt(r));)++r;return r}function Zn(e,t){const n=e.source.body,i=n.length;let r=t+1,s=r,o="";for(;r<i;){const a=n.charCodeAt(r);if(a===34)return o+=n.slice(s,r),S(e,d.STRING,t,r+1,o);if(a===92){o+=n.slice(s,r);const u=n.charCodeAt(r+1)===117?n.charCodeAt(r+2)===123?Xn(e,r):Wn(e,r):Kn(e,r);o+=u.value,r+=u.size,s=r;continue}if(a===10||a===13)break;if(re(a))++r;else if(we(n,r))r+=2;else throw k(e.source,r,`Invalid character within String: ${K(e,r)}.`)}throw k(e.source,r,"Unterminated string.")}function Xn(e,t){const n=e.source.body;let i=0,r=3;for(;r<12;){const s=n.charCodeAt(t+r++);if(s===125){if(r<5||!re(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|ce(s),i<0)break}throw k(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}function Wn(e,t){const n=e.source.body,i=vt(n,t+2);if(re(i))return{value:String.fromCodePoint(i),size:6};if(Tt(i)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){const r=vt(n,t+8);if(wt(r))return{value:String.fromCodePoint(i,r),size:12}}throw k(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function vt(e,t){return ce(e.charCodeAt(t))<<12|ce(e.charCodeAt(t+1))<<8|ce(e.charCodeAt(t+2))<<4|ce(e.charCodeAt(t+3))}function ce(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Kn(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
|
|
10
|
+
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw k(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function ei(e,t){const n=e.source.body,i=n.length;let r=e.lineStart,s=t+3,o=s,a="";const u=[];for(;s<i;){const c=n.charCodeAt(s);if(c===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){a+=n.slice(o,s),u.push(a);const l=S(e,d.BLOCK_STRING,t,s+3,jn(u).join(`
|
|
11
|
+
`));return e.line+=u.length-1,e.lineStart=r,l}if(c===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){a+=n.slice(o,s),o=s+1,s+=4;continue}if(c===10||c===13){a+=n.slice(o,s),u.push(a),c===13&&n.charCodeAt(s+1)===10?s+=2:++s,a="",o=s,r=s;continue}if(re(c))++s;else if(we(n,s))s+=2;else throw k(e.source,s,`Invalid character within String: ${K(e,s)}.`)}throw k(e.source,s,"Unterminated string.")}function ti(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const s=n.charCodeAt(r);if(Vn(s))++r;else break}return S(e,d.NAME,t,r,n.slice(t,r))}const ni=10,It=2;function Be(e){return ve(e,[])}function ve(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return ii(e,t);default:return String(e)}}function ii(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(ri(e)){const i=e.toJSON();if(i!==e)return typeof i=="string"?i:ve(i,n)}else if(Array.isArray(e))return oi(e,n);return si(e,n)}function ri(e){return typeof e.toJSON=="function"}function si(e,t){const n=Object.entries(e);return n.length===0?"{}":t.length>It?"["+ai(e)+"]":"{ "+n.map(([r,s])=>r+": "+ve(s,t)).join(", ")+" }"}function oi(e,t){if(e.length===0)return"[]";if(t.length>It)return"[Array]";const n=Math.min(ni,e.length),i=e.length-n,r=[];for(let s=0;s<n;++s)r.push(ve(e[s],t));return i===1?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function ai(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){const n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}const ci=globalThis.process&&process.env.NODE_ENV==="production"?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var i;const r=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(i=t.constructor)===null||i===void 0?void 0:i.name;if(r===s){const o=Be(t);throw new Error(`Cannot use ${r} "${o}" from another module or realm.
|
|
12
12
|
|
|
13
13
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
14
14
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -19,41 +19,42 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
19
19
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
20
20
|
versions may have different capabilities and behavior. The data from one
|
|
21
21
|
version used in the function from another could produce confusing and
|
|
22
|
-
spurious results.`)}}return!1};class Ct{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||Ce(!1,`Body must be a string. Received: ${Ze(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||Ce(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ce(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function fi(e){return li(e,Ct)}function hi(e,t){const n=new di(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}class di{constructor(t,n={}){const{lexer:i,...r}=n;if(i)this._lexer=i;else{const s=fi(t)?t:new Ct(t);this._lexer=new Jn(s)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const t=this.expectToken(p.NAME);return this.node(t,{kind:w.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:w.DOCUMENT,definitions:this.many(p.SOF,this.parseDefinition,p.EOF)})}parseDefinition(){if(this.peek(p.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(t&&n.kind===p.BRACE_L)throw M(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(n.kind===p.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(t)throw M(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if(n.value==="extend")return this.parseTypeSystemExtension()}throw this.unexpected(n)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(p.BRACE_L))return this.node(t,{kind:w.OPERATION_DEFINITION,operation:fe.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseDescription(),i=this.parseOperationType();let r;return this.peek(p.NAME)&&(r=this.parseName()),this.node(t,{kind:w.OPERATION_DEFINITION,operation:i,description:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(p.NAME);switch(t.value){case"query":return fe.QUERY;case"mutation":return fe.MUTATION;case"subscription":return fe.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(p.PAREN_L,this.parseVariableDefinition,p.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:w.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(p.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(p.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(p.DOLLAR),this.node(t,{kind:w.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:w.SELECTION_SET,selections:this.many(p.BRACE_L,this.parseSelection,p.BRACE_R)})}parseSelection(){return this.peek(p.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,n=this.parseName();let i,r;return this.expectOptionalToken(p.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:w.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(p.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(p.PAREN_L,n,p.PAREN_R)}parseArgument(t=!1){const n=this._lexer.token,i=this.parseName();return this.expectToken(p.COLON),this.node(n,{kind:w.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(p.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(p.NAME)?this.node(t,{kind:w.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:w.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token,n=this.parseDescription();return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:w.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:w.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){const n=this._lexer.token;switch(n.kind){case p.BRACKET_L:return this.parseList(t);case p.BRACE_L:return this.parseObject(t);case p.INT:return this.advanceLexer(),this.node(n,{kind:w.INT,value:n.value});case p.FLOAT:return this.advanceLexer(),this.node(n,{kind:w.FLOAT,value:n.value});case p.STRING:case p.BLOCK_STRING:return this.parseStringLiteral();case p.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:w.BOOLEAN,value:!0});case"false":return this.node(n,{kind:w.BOOLEAN,value:!1});case"null":return this.node(n,{kind:w.NULL});default:return this.node(n,{kind:w.ENUM,value:n.value})}case p.DOLLAR:if(t)if(this.expectToken(p.DOLLAR),this._lexer.token.kind===p.NAME){const i=this._lexer.token.value;throw M(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:w.STRING,value:t.value,block:t.kind===p.BLOCK_STRING})}parseList(t){const n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:w.LIST,values:this.any(p.BRACKET_L,n,p.BRACKET_R)})}parseObject(t){const n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:w.OBJECT,fields:this.any(p.BRACE_L,n,p.BRACE_R)})}parseObjectField(t){const n=this._lexer.token,i=this.parseName();return this.expectToken(p.COLON),this.node(n,{kind:w.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){const n=[];for(;this.peek(p.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const n=this._lexer.token;return this.expectToken(p.AT),this.node(n,{kind:w.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let n;if(this.expectOptionalToken(p.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(p.BRACKET_R),n=this.node(t,{kind:w.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(p.BANG)?this.node(t,{kind:w.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:w.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(p.STRING)||this.peek(p.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),r=this.many(p.BRACE_L,this.parseOperationTypeDefinition,p.BRACE_R);return this.node(t,{kind:w.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){const t=this._lexer.token,n=this.parseOperationType();this.expectToken(p.COLON);const i=this.parseNamedType();return this.node(t,{kind:w.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:w.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:w.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(p.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(p.BRACE_L,this.parseFieldDefinition,p.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(p.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:w.FIELD_DEFINITION,description:n,name:i,arguments:r,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(p.PAREN_L,this.parseInputValueDef,p.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(p.COLON);const r=this.parseTypeReference();let s;this.expectOptionalToken(p.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(t,{kind:w.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:w.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:o})}parseUnionTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:w.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(p.EQUALS)?this.delimitedMany(p.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:w.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:s})}parseEnumValuesDefinition(){return this.optionalMany(p.BRACE_L,this.parseEnumValueDefinition,p.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:w.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw M(this._lexer.source,this._lexer.token.start,`${ke(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:w.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(p.BRACE_L,this.parseInputValueDef,p.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===p.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.optionalMany(p.BRACE_L,this.parseOperationTypeDefinition,p.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:w.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:w.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:w.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:w.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:w.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:w.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:w.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(p.AT);const i=this.parseName(),r=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(t,{kind:w.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(p.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(ze,n.value))return n;throw this.unexpected(t)}parseSchemaCoordinate(){const t=this._lexer.token,n=this.expectOptionalToken(p.AT),i=this.parseName();let r;!n&&this.expectOptionalToken(p.DOT)&&(r=this.parseName());let s;return(n||r)&&this.expectOptionalToken(p.PAREN_L)&&(s=this.parseName(),this.expectToken(p.COLON),this.expectToken(p.PAREN_R)),n?s?this.node(t,{kind:w.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:s}):this.node(t,{kind:w.DIRECTIVE_COORDINATE,name:i}):r?s?this.node(t,{kind:w.ARGUMENT_COORDINATE,name:i,fieldName:r,argumentName:s}):this.node(t,{kind:w.MEMBER_COORDINATE,name:i,memberName:r}):this.node(t,{kind:w.TYPE_COORDINATE,name:i})}node(t,n){return this._options.noLocation!==!0&&(n.loc=new Vn(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){const n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw M(this._lexer.source,n.start,`Expected ${xt(t)}, found ${ke(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const n=this._lexer.token;if(n.kind===p.NAME&&n.value===t)this.advanceLexer();else throw M(this._lexer.source,n.start,`Expected "${t}", found ${ke(n)}.`)}expectOptionalKeyword(t){const n=this._lexer.token;return n.kind===p.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const n=t??this._lexer.token;return M(this._lexer.source,n.start,`Unexpected ${ke(n)}.`)}any(t,n,i){this.expectToken(t);const r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);const i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){const{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==p.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw M(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function ke(e){const t=e.value;return xt(e.kind)+(t!=null?` "${t}"`:"")}function xt(e){return zn(e)?`"${e}"`:e}function pi(e){return`"${e.replace(mi,gi)}"`}const mi=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function gi(e){return Ei[e.charCodeAt(0)]}const Ei=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],Ni=Object.freeze({});function yi(e,t,n=vt){const i=new Map;for(const _ of Object.values(w))i.set(_,Ti(t,_));let r,s=Array.isArray(e),o=[e],a=-1,u=[],c=e,l,f;const d=[],N=[];do{a++;const _=a===o.length,V=_&&u.length!==0;if(_){if(l=N.length===0?void 0:d[d.length-1],c=f,f=N.pop(),V)if(s){c=c.slice();let k=0;for(const[X,$]of u){const re=X-k;$===null?(c.splice(re,1),k++):c[re]=$}}else{c={...c};for(const[k,X]of u)c[k]=X}a=r.index,o=r.keys,u=r.edits,s=r.inArray,r=r.prev}else if(f){if(l=s?a:o[a],c=f[l],c==null)continue;d.push(l)}let b;if(!Array.isArray(c)){var T,E;wt(c)||Ce(!1,`Invalid AST Node: ${Ze(c)}.`);const k=_?(T=i.get(c.kind))===null||T===void 0?void 0:T.leave:(E=i.get(c.kind))===null||E===void 0?void 0:E.enter;if(b=k?.call(t,c,l,f,d,N),b===Ni)break;if(b===!1){if(!_){d.pop();continue}}else if(b!==void 0&&(u.push([l,b]),!_))if(wt(b))c=b;else{d.pop();continue}}if(b===void 0&&V&&u.push([l,c]),_)d.pop();else{var x;r={inArray:s,index:a,keys:o,edits:u,prev:r},s=Array.isArray(c),o=s?c:(x=n[c.kind])!==null&&x!==void 0?x:[],a=-1,u=[],f&&N.push(f),f=c}}while(r!==void 0);return u.length!==0?u[u.length-1][1]:e}function Ti(e,t){const n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function vi(e){return yi(e,Ai)}const wi=80,Ai={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>y(e.definitions,`
|
|
22
|
+
spurious results.`)}}return!1};class Ot{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||Te(!1,`Body must be a string. Received: ${Be(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||Te(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Te(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function ui(e){return ci(e,Ot)}function li(e,t){const n=new fi(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}class fi{constructor(t,n={}){const{lexer:i,...r}=n;if(i)this._lexer=i;else{const s=ui(t)?t:new Ot(t);this._lexer=new Yn(s)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const t=this.expectToken(d.NAME);return this.node(t,{kind:w.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:w.DOCUMENT,definitions:this.many(d.SOF,this.parseDefinition,d.EOF)})}parseDefinition(){if(this.peek(d.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(t&&n.kind===d.BRACE_L)throw k(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(n.kind===d.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(t)throw k(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if(n.value==="extend")return this.parseTypeSystemExtension()}throw this.unexpected(n)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(d.BRACE_L))return this.node(t,{kind:w.OPERATION_DEFINITION,operation:ie.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseDescription(),i=this.parseOperationType();let r;return this.peek(d.NAME)&&(r=this.parseName()),this.node(t,{kind:w.OPERATION_DEFINITION,operation:i,description:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(d.NAME);switch(t.value){case"query":return ie.QUERY;case"mutation":return ie.MUTATION;case"subscription":return ie.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(d.PAREN_L,this.parseVariableDefinition,d.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:w.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(d.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(d.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(d.DOLLAR),this.node(t,{kind:w.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:w.SELECTION_SET,selections:this.many(d.BRACE_L,this.parseSelection,d.BRACE_R)})}parseSelection(){return this.peek(d.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,n=this.parseName();let i,r;return this.expectOptionalToken(d.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:w.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(d.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(d.PAREN_L,n,d.PAREN_R)}parseArgument(t=!1){const n=this._lexer.token,i=this.parseName();return this.expectToken(d.COLON),this.node(n,{kind:w.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(d.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(d.NAME)?this.node(t,{kind:w.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:w.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token,n=this.parseDescription();return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:w.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:w.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){const n=this._lexer.token;switch(n.kind){case d.BRACKET_L:return this.parseList(t);case d.BRACE_L:return this.parseObject(t);case d.INT:return this.advanceLexer(),this.node(n,{kind:w.INT,value:n.value});case d.FLOAT:return this.advanceLexer(),this.node(n,{kind:w.FLOAT,value:n.value});case d.STRING:case d.BLOCK_STRING:return this.parseStringLiteral();case d.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:w.BOOLEAN,value:!0});case"false":return this.node(n,{kind:w.BOOLEAN,value:!1});case"null":return this.node(n,{kind:w.NULL});default:return this.node(n,{kind:w.ENUM,value:n.value})}case d.DOLLAR:if(t)if(this.expectToken(d.DOLLAR),this._lexer.token.kind===d.NAME){const i=this._lexer.token.value;throw k(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:w.STRING,value:t.value,block:t.kind===d.BLOCK_STRING})}parseList(t){const n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:w.LIST,values:this.any(d.BRACKET_L,n,d.BRACKET_R)})}parseObject(t){const n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:w.OBJECT,fields:this.any(d.BRACE_L,n,d.BRACE_R)})}parseObjectField(t){const n=this._lexer.token,i=this.parseName();return this.expectToken(d.COLON),this.node(n,{kind:w.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){const n=[];for(;this.peek(d.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const n=this._lexer.token;return this.expectToken(d.AT),this.node(n,{kind:w.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let n;if(this.expectOptionalToken(d.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(d.BRACKET_R),n=this.node(t,{kind:w.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(d.BANG)?this.node(t,{kind:w.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:w.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(d.STRING)||this.peek(d.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),r=this.many(d.BRACE_L,this.parseOperationTypeDefinition,d.BRACE_R);return this.node(t,{kind:w.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){const t=this._lexer.token,n=this.parseOperationType();this.expectToken(d.COLON);const i=this.parseNamedType();return this.node(t,{kind:w.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:w.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:w.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(d.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(d.BRACE_L,this.parseFieldDefinition,d.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(d.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:w.FIELD_DEFINITION,description:n,name:i,arguments:r,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(d.PAREN_L,this.parseInputValueDef,d.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(d.COLON);const r=this.parseTypeReference();let s;this.expectOptionalToken(d.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(t,{kind:w.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:w.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:o})}parseUnionTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:w.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(d.EQUALS)?this.delimitedMany(d.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:w.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:s})}parseEnumValuesDefinition(){return this.optionalMany(d.BRACE_L,this.parseEnumValueDefinition,d.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:w.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw k(this._lexer.source,this._lexer.token.start,`${Ie(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:w.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(d.BRACE_L,this.parseInputValueDef,d.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===d.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.optionalMany(d.BRACE_L,this.parseOperationTypeDefinition,d.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:w.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:w.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:w.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:w.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:w.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:w.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:w.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(d.AT);const i=this.parseName(),r=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(t,{kind:w.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(d.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(Me,n.value))return n;throw this.unexpected(t)}parseSchemaCoordinate(){const t=this._lexer.token,n=this.expectOptionalToken(d.AT),i=this.parseName();let r;!n&&this.expectOptionalToken(d.DOT)&&(r=this.parseName());let s;return(n||r)&&this.expectOptionalToken(d.PAREN_L)&&(s=this.parseName(),this.expectToken(d.COLON),this.expectToken(d.PAREN_R)),n?s?this.node(t,{kind:w.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:s}):this.node(t,{kind:w.DIRECTIVE_COORDINATE,name:i}):r?s?this.node(t,{kind:w.ARGUMENT_COORDINATE,name:i,fieldName:r,argumentName:s}):this.node(t,{kind:w.MEMBER_COORDINATE,name:i,memberName:r}):this.node(t,{kind:w.TYPE_COORDINATE,name:i})}node(t,n){return this._options.noLocation!==!0&&(n.loc=new Bn(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){const n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw k(this._lexer.source,n.start,`Expected ${At(t)}, found ${Ie(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const n=this._lexer.token;if(n.kind===d.NAME&&n.value===t)this.advanceLexer();else throw k(this._lexer.source,n.start,`Expected "${t}", found ${Ie(n)}.`)}expectOptionalKeyword(t){const n=this._lexer.token;return n.kind===d.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const n=t??this._lexer.token;return k(this._lexer.source,n.start,`Unexpected ${Ie(n)}.`)}any(t,n,i){this.expectToken(t);const r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);const i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){const{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==d.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw k(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function Ie(e){const t=e.value;return At(e.kind)+(t!=null?` "${t}"`:"")}function At(e){return Hn(e)?`"${e}"`:e}function hi(e){return`"${e.replace(di,pi)}"`}const di=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function pi(e){return mi[e.charCodeAt(0)]}const mi=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],gi=Object.freeze({});function Ei(e,t,n=mt){const i=new Map;for(const y of Object.values(w))i.set(y,Ni(t,y));let r,s=Array.isArray(e),o=[e],a=-1,u=[],c=e,l,f;const h=[],m=[];do{a++;const y=a===o.length,P=y&&u.length!==0;if(y){if(l=m.length===0?void 0:h[h.length-1],c=f,f=m.pop(),P)if(s){c=c.slice();let _=0;for(const[X,q]of u){const se=X-_;q===null?(c.splice(se,1),_++):c[se]=q}}else{c={...c};for(const[_,X]of u)c[_]=X}a=r.index,o=r.keys,u=r.edits,s=r.inArray,r=r.prev}else if(f){if(l=s?a:o[a],c=f[l],c==null)continue;h.push(l)}let A;if(!Array.isArray(c)){var N,E;gt(c)||Te(!1,`Invalid AST Node: ${Be(c)}.`);const _=y?(N=i.get(c.kind))===null||N===void 0?void 0:N.leave:(E=i.get(c.kind))===null||E===void 0?void 0:E.enter;if(A=_?.call(t,c,l,f,h,m),A===gi)break;if(A===!1){if(!y){h.pop();continue}}else if(A!==void 0&&(u.push([l,A]),!y))if(gt(A))c=A;else{h.pop();continue}}if(A===void 0&&P&&u.push([l,c]),y)h.pop();else{var R;r={inArray:s,index:a,keys:o,edits:u,prev:r},s=Array.isArray(c),o=s?c:(R=n[c.kind])!==null&&R!==void 0?R:[],a=-1,u=[],f&&m.push(f),f=c}}while(r!==void 0);return u.length!==0?u[u.length-1][1]:e}function Ni(e,t){const n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function Ti(e){return Ei(e,vi)}const wi=80,vi={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>g(e.definitions,`
|
|
23
23
|
|
|
24
|
-
`)},OperationDefinition:{leave(e){const t=
|
|
25
|
-
`,
|
|
24
|
+
`)},OperationDefinition:{leave(e){const t=Ue(e.variableDefinitions)?O(`(
|
|
25
|
+
`,g(e.variableDefinitions,`
|
|
26
26
|
`),`
|
|
27
|
-
)`):
|
|
28
|
-
`)+
|
|
29
|
-
`)+e+": "+t+
|
|
30
|
-
`,
|
|
27
|
+
)`):O("(",g(e.variableDefinitions,", "),")"),n=O("",e.description,`
|
|
28
|
+
`)+g([e.operation,g([e.name,t]),g(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:i,description:r})=>O("",r,`
|
|
29
|
+
`)+e+": "+t+O(" = ",n)+O(" ",g(i," "))},SelectionSet:{leave:({selections:e})=>U(e)},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:r}){const s=O("",e,": ")+t;let o=s+O("(",g(n,", "),")");return o.length>wi&&(o=s+O(`(
|
|
30
|
+
`,Oe(g(n,`
|
|
31
31
|
`)),`
|
|
32
|
-
)`)),
|
|
33
|
-
`)+`fragment ${e}${
|
|
34
|
-
`)+
|
|
35
|
-
`)+
|
|
36
|
-
`)+
|
|
37
|
-
`)+t+(
|
|
38
|
-
`,
|
|
32
|
+
)`)),g([o,g(i," "),r]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+O(" ",g(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>g(["...",O("on ",e),g(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:i,selectionSet:r,description:s})=>O("",s,`
|
|
33
|
+
`)+`fragment ${e}${O("(",g(n,", "),")")} on ${t} ${O("",g(i," ")," ")}`+r},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?Gn(e):hi(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+g(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+g(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+O("(",g(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>O("",e,`
|
|
34
|
+
`)+g(["schema",g(t," "),U(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>O("",e,`
|
|
35
|
+
`)+g(["scalar",t,g(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>O("",e,`
|
|
36
|
+
`)+g(["type",t,O("implements ",g(n," & ")),g(i," "),U(r)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:i,directives:r})=>O("",e,`
|
|
37
|
+
`)+t+(Ue(n)?O(`(
|
|
38
|
+
`,Oe(g(n,`
|
|
39
39
|
`)),`
|
|
40
|
-
)`):
|
|
41
|
-
`)+
|
|
42
|
-
`)+
|
|
43
|
-
`)+
|
|
44
|
-
`)+
|
|
45
|
-
`)+
|
|
46
|
-
`)+
|
|
47
|
-
`)+"directive @"+t+(
|
|
48
|
-
`,
|
|
40
|
+
)`):O("(",g(n,", "),")"))+": "+i+O(" ",g(r," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:i,directives:r})=>O("",e,`
|
|
41
|
+
`)+g([t+": "+n,O("= ",i),g(r," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>O("",e,`
|
|
42
|
+
`)+g(["interface",t,O("implements ",g(n," & ")),g(i," "),U(r)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:i})=>O("",e,`
|
|
43
|
+
`)+g(["union",t,g(n," "),O("= ",g(i," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:i})=>O("",e,`
|
|
44
|
+
`)+g(["enum",t,g(n," "),U(i)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>O("",e,`
|
|
45
|
+
`)+g([t,g(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:i})=>O("",e,`
|
|
46
|
+
`)+g(["input",t,g(n," "),U(i)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:i,locations:r})=>O("",e,`
|
|
47
|
+
`)+"directive @"+t+(Ue(n)?O(`(
|
|
48
|
+
`,Oe(g(n,`
|
|
49
49
|
`)),`
|
|
50
|
-
)`):
|
|
51
|
-
`,
|
|
50
|
+
)`):O("(",g(n,", "),")"))+(i?" repeatable":"")+" on "+g(r," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>g(["extend schema",g(e," "),U(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>g(["extend scalar",e,g(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>g(["extend type",e,O("implements ",g(t," & ")),g(n," "),U(i)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>g(["extend interface",e,O("implements ",g(t," & ")),g(n," "),U(i)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>g(["extend union",e,g(t," "),O("= ",g(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>g(["extend enum",e,g(t," "),U(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>g(["extend input",e,g(t," "),U(n)]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>g([e,O(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>g([e,O(".",t),O("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>g(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>g(["@",e,O("(",t,":)")])}};function g(e,t=""){var n;return(n=e?.filter(i=>i).join(t))!==null&&n!==void 0?n:""}function U(e){return O(`{
|
|
51
|
+
`,Oe(g(e,`
|
|
52
52
|
`)),`
|
|
53
|
-
}`)}function
|
|
54
|
-
`))}function
|
|
55
|
-
`)))!==null&&t!==void 0?t:!1}const
|
|
56
|
-
|
|
53
|
+
}`)}function O(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function Oe(e){return O(" ",e.replace(/\n/g,`
|
|
54
|
+
`))}function Ue(e){var t;return(t=e?.some(n=>n.includes(`
|
|
55
|
+
`)))!==null&&t!==void 0?t:!1}const yt="Accept",Ve="Content-Type",je="application/json",Dt="application/graphql-response+json",xt=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),Ii=e=>{const t=e.toLowerCase();return t.includes(Dt)||t.includes(je)},_t=e=>{try{if(Array.isArray(e))return{_tag:"Batch",executionResults:e.map(St)};if(Ne(e))return{_tag:"Single",executionResult:St(e)};throw new Error(`Invalid execution result: result is not object or array.
|
|
56
|
+
Got:
|
|
57
|
+
${String(e)}`)}catch(t){return t}},St=e=>{if(typeof e!="object"||e===null)throw new Error("Invalid execution result: result is not object");let t,n,i;if("errors"in e){if(!Ne(e.errors)&&!Array.isArray(e.errors))throw new Error("Invalid execution result: errors is not plain object OR array");t=e.errors}if("data"in e){if(!Ne(e.data)&&e.data!==null)throw new Error("Invalid execution result: data is not plain object");n=e.data}if("extensions"in e){if(!Ne(e.extensions))throw new Error("Invalid execution result: extensions is not plain object");i=e.extensions}return{data:n,errors:t,extensions:i}},Oi=e=>e._tag==="Batch"?e.executionResults.some(Ct):Ct(e.executionResult),Ct=e=>Array.isArray(e.errors)?e.errors.length>0:!!e.errors,kt=e=>typeof e=="object"&&e!==null&&"kind"in e&&e.kind===w.OPERATION_DEFINITION,Ai=e=>{let t;const n=e.definitions.filter(kt);return n.length===1&&(t=n[0].name?.value),t},yi=e=>{let t=!1;const n=e.definitions.filter(kt);return n.length===1&&(t=n[0].operation==="mutation"),t},$e=(e,t)=>{const n=typeof e=="string"||"kind"in e?e:String(e),i=typeof n=="string"?n:Ti(n);let r=!1,s;if(t)return{expression:i,isMutation:r,operationName:s};const o=Cn(()=>typeof n=="string"?li(n):n);return o instanceof Error?{expression:i,isMutation:r,operationName:s}:(s=Ai(o),r=yi(o),{expression:i,operationName:s,isMutation:r})},Ge=JSON,Ye=async e=>{const t={...e,method:e.request._tag==="Single"?e.request.document.isMutation?"POST":ct(e.method??"post"):e.request.hasMutations?"POST":ct(e.method??"post"),fetchOptions:{...e.fetchOptions,errorPolicy:e.fetchOptions.errorPolicy??"none"}},i=await xi(t.method)(t),r=await i.text();let s;try{s=Di(r,i.headers.get(Ve),e.fetchOptions.jsonSerializer??Ge)}catch(a){s=a}const o={status:i.status,headers:i.headers,body:r};if(!i.ok){if(s instanceof Error)return new W({...o},{query:e.request._tag==="Single"?e.request.document.expression:e.request.query,variables:e.request.variables});const a=s._tag==="Batch"?{...s.executionResults,...o}:{...s.executionResult,...o};return new W(a,{query:e.request._tag==="Single"?e.request.document.expression:e.request.query,variables:e.request.variables})}if(s instanceof Error)throw s;if(Oi(s)&&t.fetchOptions.errorPolicy==="none"){const a=s._tag==="Batch"?{...s.executionResults,...o}:{...s.executionResult,...o};return new W(a,{query:e.request._tag==="Single"?e.request.document.expression:e.request.query,variables:e.request.variables})}switch(s._tag){case"Single":return{...o,...Rt(t)(s.executionResult)};case"Batch":return{...o,data:s.executionResults.map(Rt(t))};default:be(s)}},Rt=e=>t=>({extensions:t.extensions,data:t.data,errors:e.fetchOptions.errorPolicy==="all"?t.errors:void 0}),Di=(e,t,n)=>t&&Ii(t)?_t(n.parse(e)):_t(e),xi=e=>async t=>{const n=new Headers(t.headers);let i=null,r;n.has(yt)||n.set(yt,[Dt,je].join(", ")),e==="POST"?(r=(t.fetchOptions.jsonSerializer??Ge).stringify(_i(t)),typeof r=="string"&&!n.has(Ve)&&n.set(Ve,je)):i=Si(t);const s={method:e,headers:n,body:r,...t.fetchOptions};let o=new URL(t.url),a=s;if(t.middleware){const c=await Promise.resolve(t.middleware({...s,url:t.url,operationName:t.request._tag==="Single"?t.request.document.operationName:void 0,variables:t.request.variables})),{url:l,...f}=c;o=new URL(l),a=f}return i&&i.forEach((c,l)=>{o.searchParams.append(l,c)}),await(t.fetch??fetch)(o,a)},_i=e=>{switch(e.request._tag){case"Single":return{query:e.request.document.expression,variables:e.request.variables,operationName:e.request.document.operationName};case"Batch":return ut(e.request.query,e.request.variables??[]).map(([t,n])=>({query:t,variables:n}));default:throw be(e.request)}},Si=e=>{const t=e.fetchOptions.jsonSerializer??Ge,n=new URLSearchParams;switch(e.request._tag){case"Single":return n.append("query",xt(e.request.document.expression)),e.request.variables&&n.append("variables",t.stringify(e.request.variables)),e.request.document.operationName&&n.append("operationName",e.request.document.operationName),n;case"Batch":{const i=e.request.variables?.map(o=>t.stringify(o))??[],r=e.request.query.map(xt),s=ut(r,i).map(([o,a])=>({query:o,variables:a}));return n.append("query",t.stringify(s)),n}default:throw be(e.request)}};class Ci{url;requestConfig;constructor(t,n={}){this.url=t,this.requestConfig=n}rawRequest=async(...t)=>{const[n,i,r]=t,s=bn(n,i,r),{headers:o,fetch:a=globalThis.fetch,method:u="POST",requestMiddleware:c,responseMiddleware:l,excludeOperationName:f,...h}=this.requestConfig,{url:m}=this;s.signal!==void 0&&(h.signal=s.signal);const N=$e(s.query,f),E=await Ye({url:m,request:{_tag:"Single",document:N,variables:s.variables},headers:{...ne(Re(o)),...ne(s.requestHeaders)},fetch:a,method:u,fetchOptions:h,middleware:c});if(l&&await l(E,{operationName:N.operationName,variables:i,url:this.url}),E instanceof Error)throw E;return E};async request(t,...n){const[i,r]=n,s=ki(t,i,r),{headers:o,fetch:a=globalThis.fetch,method:u="POST",requestMiddleware:c,responseMiddleware:l,excludeOperationName:f,...h}=this.requestConfig,{url:m}=this;s.signal!==void 0&&(h.signal=s.signal);const N=$e(s.document,f),E=await Ye({url:m,request:{_tag:"Single",document:N,variables:s.variables},headers:{...ne(Re(o)),...ne(s.requestHeaders)},fetch:a,method:u,fetchOptions:h,middleware:c});if(l&&await l(E,{operationName:N.operationName,variables:s.variables,url:this.url}),E instanceof Error)throw E;return E.data}async batchRequests(t,n){const i=Rn(t,n),{headers:r,excludeOperationName:s,...o}=this.requestConfig;i.signal!==void 0&&(o.signal=i.signal);const a=i.documents.map(({document:h})=>$e(h,s)),u=a.map(({expression:h})=>h),c=a.some(({isMutation:h})=>h),l=i.documents.map(({variables:h})=>h),f=await Ye({url:this.url,request:{_tag:"Batch",operationName:void 0,query:u,hasMutations:c,variables:l},headers:{...ne(Re(r)),...ne(i.requestHeaders)},fetch:this.requestConfig.fetch??globalThis.fetch,method:this.requestConfig.method||"POST",fetchOptions:o,middleware:this.requestConfig.requestMiddleware});if(this.requestConfig.responseMiddleware&&await this.requestConfig.responseMiddleware(f,{operationName:void 0,variables:l,url:this.url}),f instanceof Error)throw f;return f.data}setHeaders(t){return this.requestConfig.headers=t,this}setHeader(t,n){const{headers:i}=this.requestConfig;return i?i[t]=n:this.requestConfig.headers={[t]:n},this}setEndpoint(t){return this.url=t,this}}const ki=(e,t,n)=>e.document?e:{document:e,variables:t,requestHeaders:n,signal:void 0},bt=(e,...t)=>e.reduce((n,i,r)=>`${n}${i}${r in t?String(t[r]):""}`,""),Lt={getMeta:bt`
|
|
57
58
|
query getDoctype($doctype: String!) {
|
|
58
59
|
getMeta(doctype: $doctype) {
|
|
59
60
|
id
|
|
@@ -63,7 +64,7 @@ spurious results.`)}}return!1};class Ct{constructor(t,n="GraphQL request",i={lin
|
|
|
63
64
|
actions
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
|
-
`},
|
|
67
|
+
`},Ri=bt`
|
|
67
68
|
type Doctype {
|
|
68
69
|
id: ID!
|
|
69
70
|
name: String!
|
|
@@ -109,5 +110,5 @@ spurious results.`)}}return!1};class Ct{constructor(t,n="GraphQL request",i={lin
|
|
|
109
110
|
query: Query
|
|
110
111
|
mutation: Mutation
|
|
111
112
|
}
|
|
112
|
-
`,
|
|
113
|
+
`,bi=e=>JSON.parse(e,(t,n)=>{if(typeof n=="string")try{return JSON.parse(n,(i,r)=>typeof r=="string"&&!isNaN(Number(r))?new te(r):r)}catch{return n}else if(!isNaN(Number(n)))return new te(n);return n}),Li={getMeta:async(e,t)=>{const n=new Ci(t||"/graphql",{fetch:window.fetch,jsonSerializer:{stringify:r=>JSON.stringify(r),parse:bi}}),{getMeta:i}=await n.request({document:Lt.getMeta,variables:{doctype:e}});return i}};H.methods=Li,H.queries=Lt,H.typeDefs=Ri,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})}));
|
|
113
114
|
//# sourceMappingURL=graphql-client.umd.cjs.map
|