@stonecrop/graphql-client 0.6.2 → 0.6.3
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.
|
@@ -1,20 +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"}))}/*!
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* https://github.com/MikeMcl/decimal.js
|
|
5
|
-
* Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
6
|
-
* MIT Licence
|
|
7
|
-
*/var ce=9e15,ee=1e9,Ue="0123456789abcdef",Te="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ae="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",qe={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ce,maxE:ce,crypto:!1},nt,W,I=!0,Ie="[DecimalError] ",te=Ie+"Invalid argument: ",it=Ie+"Precision limit exceeded",rt=Ie+"crypto unavailable",st="[object Decimal]",q=Math.floor,P=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,ot=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,J=1e7,T=7,qt=9007199254740991,Vt=Te.length-1,Ve=Ae.length-1,g={toStringTag:st};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())+T,i.rounding=1,n=jt(i,ht(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(I=!1,s=l.s*P(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=P(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=C(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 I=!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/T))*T,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},g.dividedBy=g.div=function(e){return C(this,new this.constructor(e))},g.dividedToIntegerBy=g.divToInt=function(e){var t=this,n=t.constructor;return v(C(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,C(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,I=!1,n=n.times(n).minus(1).sqrt().plus(n),I=!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,I=!1,n=n.times(n).plus(1).sqrt().plus(n),I=!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=C(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/T+2|0),e=n;e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(I=!1,t=Math.ceil(a/T),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,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/T)>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,y=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+y,o=ie(c,a),i=t?_e(l,a+10):ie(e,a),u=C(o,i,a,1),Ee(u.d,r=f,d))do if(a+=10,o=ie(c,a),i=t?_e(l,a+10):ie(e,a),u=C(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 I=!0,v(u,f,d)},g.minus=g.sub=function(e){var t,n,i,r,s,o,a,u,c,l,f,d,y=this,N=y.constructor;if(e=new N(e),!y.d||!e.d)return!y.s||!e.s?e=new N(NaN):y.d?e.s=-e.s:e=new N(e.d||y.s!==e.s?y:NaN),e;if(y.s!=e.s)return e.s=-e.s,y.plus(e);if(c=y.d,d=e.d,a=N.precision,u=N.rounding,!c[0]||!d[0]){if(d[0])e.s=-e.s;else if(c[0])e=new N(y);else return new N(u===3?-0:0);return I?v(e,a,u):e}if(n=q(e.e/T),l=q(y.e/T),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/T),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=be(c,n),I?v(e,a,u):e):new N(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):(I=!1,i.modulo==9?(t=C(n,e.abs(),0,3,1),t.s*=e.s):t=C(n,e,0,i.modulo,1),t=t.times(e),I=!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)),I?v(e,a,u):e;if(s=q(f.e/T),i=q(e.e/T),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/T),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=be(c,i),I?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=at(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())+T,i.rounding=1,n=Ht(i,ht(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(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=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(C(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 I=!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=C(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,y=(e=new f(e)).d;if(e.s*=l.s,!d||!d[0]||!y||!y[0])return new f(!e.s||d&&!d[0]&&!y||y&&!y[0]&&!d?NaN:!d||!y?e.s/0:e.s*0);for(n=q(l.e/T)+q(e.e/T),u=d.length,c=y.length,u<c&&(s=d,d=y,y=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]+y[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=be(s,n),I?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,y=this,N=y.d,E=y.constructor;if(!N)return new E(y);if(c=n=new E(1),i=u=new E(0),t=new E(i),s=t.e=at(N)-y.e-1,o=s%T,t.d[0]=P(10,o<0?T+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(I=!1,a=new E(B(N)),l=E.precision,E.precision=s=N.length*T*2;f=C(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=C(e.minus(n),i,0,1,1),u=u.plus(r.times(c)),n=n.plus(r.times(i)),u.s=c.s=y.s,d=C(c,i,s,1).minus(y).abs().cmp(C(u,n,s,1).minus(y).abs())<1?[c,i]:[u,n],E.precision=l,I=!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]?(I=!1,n=C(n,e,0,t,1).times(e),I=!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(P(+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/T),t>=e.d.length-1&&(n=c<0?-c:c)<=qt)return r=ct(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=P(+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):(I=!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,I=!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=T-i.length,n&&(s+=ne(n)),s+=i;o=e[t],i=o+"",n=T-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+=T,r=0):(r=Math.ceil((t+1)/T),t%=T),s=P(10,T-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)==P(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)==P(10,t-3)-1,o}function Oe(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 C=(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,y,N,E,x,O,V,b,k,Q,$,re,pe,G,ve,Y,j,me=i.constructor,oe=i.s==r.s?1:-1,h=i.d,p=r.d;if(!h||!h[0]||!p||!p[0])return new me(!i.s||!r.s||(h?p&&h[0]==p[0]:!p)?NaN:h&&h[0]==0||!p?oe*0:oe/0);for(u?(y=1,l=i.e-r.e):(u=J,y=T,l=q(i.e/y)-q(r.e/y)),Y=p.length,G=h.length,O=new me(oe),V=O.d=[],f=0;p[f]==(h[f]||0);f++);if(p[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),N=!0;else{if($=$/y+2|0,f=0,Y==1){for(d=0,p=p[0],$++;(f<G||d)&&$--;f++)re=d*u+(h[f]||0),V[f]=re/p|0,d=re%p|0;N=d||f<G}else{for(d=u/(p[0]+1)|0,d>1&&(p=e(p,d,u),h=e(h,d,u),Y=p.length,G=h.length),pe=Y,b=h.slice(0,Y),k=b.length;k<Y;)b[k++]=0;j=p.slice(),j.unshift(0),ve=p[0],p[1]>=u/2&&++ve;do d=0,c=t(p,b,Y,k),c<0?(Q=b[0],Y!=k&&(Q=Q*u+(b[1]||0)),d=Q/ve|0,d>1?(d>=u&&(d=u-1),E=e(p,d,u),x=E.length,k=b.length,c=t(E,b,x,k),c==1&&(d--,n(E,Y<x?j:p,x,u))):(d==0&&(c=d=1),E=p.slice()),x=E.length,x<k&&E.unshift(0),n(b,E,k,u),c==-1&&(k=b.length,c=t(p,b,Y,k),c<1&&(d++,n(b,Y<k?j:p,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)&&$--);N=b[0]!==void 0}V[0]||V.shift()}if(y==1)O.e=l,nt=N;else{for(f=1,d=V[0];d>=10;d/=10)f++;O.e=f+l*y-1,v(O,a?s+O.e+1:s,o,N)}return O}})();function v(e,t,n,i){var r,s,o,a,u,c,l,f,d,y=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+=T,o=t,l=f[d=0],u=l/P(10,r-o-1)%10|0;else if(d=Math.ceil((s+1)/T),a=f.length,d>=a)if(i){for(;a++<=d;)f.push(0);l=u=0,r=1,s%=T,o=s-T+1}else break e;else{for(l=a=f[d],r=1;a>=10;a/=10)r++;s%=T,o=s-T+r,u=o<0?0:l/P(10,r-o-1)%10|0}if(i=i||t<0||f[d+1]!==void 0||(o<0?l:l%P(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/P(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]=P(10,(T-t%T)%T),e.e=-t||0):f[0]=e.e=0,e;if(s==0?(f.length=d,a=1,d--):(f.length=d+1,a=P(10,T-s),f[d]=o>0?(l/P(10,r-o)%P(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 I&&(e.e>y.maxE?(e.d=null,e.e=NaN):e.e<y.minE&&(e.e=0,e.d=[0])),e}function Z(e,t,n){if(!e.isFinite())return ft(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 be(e,t){var n=e[0];for(t*=T;n>=10;n/=10)t++;return t}function _e(e,t,n){if(t>Vt)throw I=!0,n&&(e.precision=n),Error(it);return v(new e(Te),t,1,!0)}function z(e,t,n){if(t>Ve)throw Error(it);return v(new e(Ae),t,n,!0)}function at(e){var t=e.length-1,n=t*T+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 ct(e,t,n,i){var r,s=new e(1),o=Math.ceil(i/T+4);for(I=!1;;){if(n%2&&(s=s.times(t),dt(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),dt(t.d,o)}return I=!0,s}function ut(e){return e.d[e.d.length-1]&1}function lt(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,y=d.rounding,N=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?(I=!1,u=N):u=t,a=new d(.03125);e.e>-2;)e=e.times(a),f+=5;for(i=Math.log(P(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(C(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,y,c))d.precision=u+=10,n=s=a=new d(1),l=0,c++;else return v(o,d.precision=N,y,I=!0);else return d.precision=N,o}o=a}}function ie(e,t){var n,i,r,s,o,a,u,c,l,f,d,y=1,N=10,E=e,x=E.d,O=E.constructor,V=O.rounding,b=O.precision;if(E.s<0||!x||!x[0]||!E.e&&x[0]==1&&x.length==1)return new O(x&&!x[0]?-1/0:E.s!=1?NaN:x?0:E);if(t==null?(I=!1,l=b):l=t,O.precision=l+=N,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),y++;s=E.e,i>1?(E=new O("0."+n),s++):E=new O(i+"."+n.slice(1))}else return c=_e(O,l+2,b).times(s+""),E=ie(new O(i+"."+n.slice(1)),l-N).plus(c),O.precision=b,t==null?v(E,b,V,I=!0):E;for(f=E,u=o=E=C(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(C(o,new O(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(_e(O,l+2,b).times(s+""))),u=C(u,new O(y),l,1),t==null)if(Ee(u.d,l-N,V,a))O.precision=l+=N,c=o=E=C(f.minus(1),f.plus(1),l,1),d=v(E.times(E),l,1),r=a=1;else return v(u,O.precision=b,V,I=!0);else return O.precision=b,u;u=c,r+=2}}function ft(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)%T,n<0&&(i+=T),i<r){for(i&&e.d.push(+t.slice(0,i)),r-=T;i<r;)e.d.push(+t.slice(i,i+=T));t=t.slice(i),i=T-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 $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"),ot.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=ct(i,new i(n),s,s*2)),c=Oe(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=be(c,l),e.d=c,I=!1,o&&(e=C(e,r,a*4)),u&&(e=e.times(Math.abs(u)<54?P(2,u):le.pow(2,u))),I=!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/T);for(I=!1,u=n.times(n),a=new e(i);;){if(o=C(a.times(u),new e(t++*t++),c,1),a=r?i.plus(o):i.minus(o),i=C(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 De(e,t){for(var n=e;--t;)n*=e;return n}function ht(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=ut(n)?i?2:3:i?4:1,t;W=ut(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,y=e.constructor,N=n!==void 0;if(N?(H(n,1,ee),i===void 0?i=y.rounding:H(i,0,8)):(n=y.precision,i=y.rounding),!e.isFinite())l=ft(e);else{for(l=Z(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(".",""),d=new y(1),d.e=l.length-o,d.d=Oe(Z(d),10,r),d.e=d.d.length),f=Oe(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 y(e),e.d=f,e.e=s,e=C(e,d,n,i,0,r),f=e.d,s=e.e,c=nt),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(N){if(u>1)if(t==16||t==8){for(o=t==16?4:3,--u;u%o;u++)l+="0";for(f=Oe(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 dt(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 Xt(e){return new this(e).asin()}function Qt(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(C(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(C(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(Ie+"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(rt);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 pt(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,mt(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}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),ot.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=pt,r.isDecimal=mt,r.abs=Gt,r.acos=Yt,r.acosh=Jt,r.add=zt,r.asin=Xt,r.asinh=Qt,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=yn,r.pow=Nn,r.random=wn,r.round=vn,r.sign=Tn,r.sin=An,r.sinh=In,r.sqrt=On,r.sub=bn,r.sum=_n,r.tan=Dn,r.tanh=Sn,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(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 mt(e){return e instanceof le||e&&e.toStringTag===st||!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 lt(this,arguments,"lt")}function gn(){return lt(this,arguments,"gt")}function En(e,t){return new this(e).mod(t)}function yn(e,t){return new this(e).mul(t)}function Nn(e,t){return new this(e).pow(t)}function wn(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/T),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(rt);else for(;s<i;)a[s++]=Math.random()*1e7|0;for(i=a[--s],e%=T,i&&e&&(r=P(10,T-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-=T)a.shift();for(i=1,r=a[0];r>=10;r/=10)i++;i<T&&(n-=T-i)}return o.e=n,o.d=a,o}function vn(e){return v(e=new this(e),e.e+1,this.rounding)}function Tn(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 In(e){return new this(e).sinh()}function On(e){return new this(e).sqrt()}function bn(e,t){return new this(e).sub(t)}function _n(){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,v(n,this.precision,this.rounding)}function Dn(e){return new this(e).tan()}function Sn(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=pt(qe);Te=new le(Te),Ae=new le(Ae);const Ge=JSON,Cn=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},Fn=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0};function Se(e,t){if(!!!e)throw new Error(t)}function Pn(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 gt(e.source,Ye(e.source,e.start))}function gt(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}
|
|
8
|
-
`,l=i.split(/\r\n|[\n\r]/g),f=l[r];if(f.length>120){const d=Math.floor(u/80),y=u%80,N=[];for(let E=0;E<f.length;E+=80)N.push(f.slice(E,E+80));return c+Et([[`${o} |`,N[0]],...N.slice(1,d+1).map(E=>["|",E]),["|","^".padStart(y)],["|",N[d+1]]])}return c+Et([[`${o-1} |`,l[r-1]],[`${o} |`,f],["|","^".padStart(u)],[`${o+1} |`,l[r+1]]])}function Et(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(`
|
|
9
|
-
`)}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 Je 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=yt(Array.isArray(o)?o:o?[o]:void 0);const d=yt((i=this.nodes)===null||i===void 0?void 0:i.map(N=>N.loc).filter(N=>N!=null));this.source=a??(d==null||(r=d[0])===null||r===void 0?void 0:r.source),this.positions=u??d?.map(N=>N.start),this.locations=u&&a?u.map(N=>Ye(a,N)):d?.map(N=>Ye(N.source,N.start));const y=Pn(l?.extensions)?l?.extensions:void 0;this.extensions=(s=f??y)!==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,Je):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+=`
|
|
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 d=Math.floor(u/80),N=u%80,T=[];for(let E=0;E<f.length;E+=80)T.push(f.slice(E,E+80));return c+Nt([[`${o} |`,T[0]],...T.slice(1,d+1).map(E=>["|",E]),["|","^".padStart(N)],["|",T[d+1]]])}return c+Nt([[`${o-1} |`,l[r-1]],[`${o} |`,f],["|","^".padStart(u)],[`${o+1} |`,l[r+1]]])}function Nt(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 Je 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=yt(Array.isArray(o)?o:o?[o]:void 0);const d=yt((i=this.nodes)===null||i===void 0?void 0:i.map(T=>T.loc).filter(T=>T!=null));this.source=a??(d==null||(r=d[0])===null||r===void 0?void 0:r.source),this.positions=u??d?.map(T=>T.start),this.locations=u&&a?u.map(T=>Ye(a,T)):d?.map(T=>Ye(T.source,T.start));const N=Fn(l?.extensions)?l?.extensions:void 0;this.extensions=(s=f??N)!==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,Je):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+=`
|
|
10
4
|
|
|
11
5
|
`+Un(n.loc));else if(this.source&&this.locations)for(const n of this.locations)t+=`
|
|
12
6
|
|
|
13
|
-
`+
|
|
7
|
+
`+Et(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 yt(e){return e===void 0||e.length===0?void 0:e}function M(e,t,n){return new Je(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Vn{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 Tt{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 vt={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"]},jn=new Set(Object.keys(vt));function wt(e){const t=e?.kind;return typeof t=="string"&&jn.has(t)}var fe;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(fe||(fe={}));var ze;(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"})(ze||(ze={}));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 Qe(e){return e===9||e===32}function Ne(e){return e>=48&&e<=57}function At(e){return e>=97&&e<=122||e>=65&&e<=90}function Ot(e){return At(e)||e===95}function $n(e){return At(e)||Ne(e)||e===95}function Hn(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=Gn(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 Gn(e){let t=0;for(;t<e.length&&Qe(e.charCodeAt(t));)++t;return t}function Yn(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(N=>N.length===0||Qe(N.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 d=r&&Qe(e.charCodeAt(0));return(l&&!d||s)&&(f+=`
|
|
14
8
|
`),f+=n,(l||c)&&(f+=`
|
|
15
|
-
`),'"""'+f+'"""'}var
|
|
16
|
-
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw M(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function ni(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=
|
|
17
|
-
`));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(he(c))++s;else if(xe(n,s))s+=2;else throw M(e.source,s,`Invalid character within String: ${se(e,s)}.`)}throw M(e.source,s,"Unterminated string.")}function ii(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const s=n.charCodeAt(r);if($n(s))++r;else break}return
|
|
9
|
+
`),'"""'+f+'"""'}var p;(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"})(p||(p={}));class Jn{constructor(t){const n=new Tt(p.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!==p.EOF)do if(t.next)t=t.next;else{const n=Qn(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===p.COMMENT);return t}}function zn(e){return e===p.BANG||e===p.DOLLAR||e===p.AMP||e===p.PAREN_L||e===p.PAREN_R||e===p.DOT||e===p.SPREAD||e===p.COLON||e===p.EQUALS||e===p.AT||e===p.BRACKET_L||e===p.BRACKET_R||e===p.BRACE_L||e===p.PIPE||e===p.BRACE_R}function he(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function xe(e,t){return It(e.charCodeAt(t))&&_t(e.charCodeAt(t+1))}function It(e){return e>=55296&&e<=56319}function _t(e){return e>=56320&&e<=57343}function se(e,t){const n=e.source.body.codePointAt(t);if(n===void 0)return p.EOF;if(n>=32&&n<=126){const i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function P(e,t,n,i,r){const s=e.line,o=1+n-e.lineStart;return new Tt(t,n,i,s,o,r)}function Qn(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 Xn(e,r);case 33:return P(e,p.BANG,r,r+1);case 36:return P(e,p.DOLLAR,r,r+1);case 38:return P(e,p.AMP,r,r+1);case 40:return P(e,p.PAREN_L,r,r+1);case 41:return P(e,p.PAREN_R,r,r+1);case 46:if(n.charCodeAt(r+1)===46&&n.charCodeAt(r+2)===46)return P(e,p.SPREAD,r,r+3);break;case 58:return P(e,p.COLON,r,r+1);case 61:return P(e,p.EQUALS,r,r+1);case 64:return P(e,p.AT,r,r+1);case 91:return P(e,p.BRACKET_L,r,r+1);case 93:return P(e,p.BRACKET_R,r,r+1);case 123:return P(e,p.BRACE_L,r,r+1);case 124:return P(e,p.PIPE,r,r+1);case 125:return P(e,p.BRACE_R,r,r+1);case 34:return n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34?ni(e,r):Wn(e,r)}if(Ne(s)||s===45)return Zn(e,r,s);if(Ot(s))return ii(e,r);throw M(e.source,r,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:he(s)||xe(n,r)?`Unexpected character: ${se(e,r)}.`:`Invalid character: ${se(e,r)}.`)}return P(e,p.EOF,i,i)}function Xn(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(he(s))++r;else if(xe(n,r))r+=2;else break}return P(e,p.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),Ne(s))throw M(e.source,r,`Invalid number, unexpected digit after 0: ${se(e,r)}.`)}else r=Xe(e,r,s),s=i.charCodeAt(r);if(s===46&&(o=!0,s=i.charCodeAt(++r),r=Xe(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=Xe(e,r,s),s=i.charCodeAt(r)),s===46||Ot(s))throw M(e.source,r,`Invalid number, expected digit but got: ${se(e,r)}.`);return P(e,o?p.FLOAT:p.INT,t,r,i.slice(t,r))}function Xe(e,t,n){if(!Ne(n))throw M(e.source,t,`Invalid number, expected digit but got: ${se(e,t)}.`);const i=e.source.body;let r=t+1;for(;Ne(i.charCodeAt(r));)++r;return r}function Wn(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),P(e,p.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?Kn(e,r):ei(e,r):ti(e,r);o+=u.value,r+=u.size,s=r;continue}if(a===10||a===13)break;if(he(a))++r;else if(xe(n,r))r+=2;else throw M(e.source,r,`Invalid character within String: ${se(e,r)}.`)}throw M(e.source,r,"Unterminated string.")}function Kn(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||!he(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|ye(s),i<0)break}throw M(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}function ei(e,t){const n=e.source.body,i=bt(n,t+2);if(he(i))return{value:String.fromCodePoint(i),size:6};if(It(i)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){const r=bt(n,t+8);if(_t(r))return{value:String.fromCodePoint(i,r),size:12}}throw M(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function bt(e,t){return ye(e.charCodeAt(t))<<12|ye(e.charCodeAt(t+1))<<8|ye(e.charCodeAt(t+2))<<4|ye(e.charCodeAt(t+3))}function ye(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function ti(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 M(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function ni(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=P(e,p.BLOCK_STRING,t,s+3,Hn(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(he(c))++s;else if(xe(n,s))s+=2;else throw M(e.source,s,`Invalid character within String: ${se(e,s)}.`)}throw M(e.source,s,"Unterminated string.")}function ii(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const s=n.charCodeAt(r);if($n(s))++r;else break}return P(e,p.NAME,t,r,n.slice(t,r))}const ri=10,Dt=2;function Ze(e){return Se(e,[])}function Se(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return si(e,t);default:return String(e)}}function si(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(oi(e)){const i=e.toJSON();if(i!==e)return typeof i=="string"?i:Se(i,n)}else if(Array.isArray(e))return ci(e,n);return ai(e,n)}function oi(e){return typeof e.toJSON=="function"}function ai(e,t){const n=Object.entries(e);return n.length===0?"{}":t.length>Dt?"["+ui(e)+"]":"{ "+n.map(([r,s])=>r+": "+Se(s,t)).join(", ")+" }"}function ci(e,t){if(e.length===0)return"[]";if(t.length>Dt)return"[Array]";const n=Math.min(ri,e.length),i=e.length-n,r=[];for(let s=0;s<n;++s)r.push(Se(e[s],t));return i===1?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function ui(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 li=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=Ze(t);throw new Error(`Cannot use ${r} "${o}" from another module or realm.
|
|
18
12
|
|
|
19
13
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
20
14
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -25,35 +19,41 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
25
19
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
26
20
|
versions may have different capabilities and behavior. The data from one
|
|
27
21
|
version used in the function from another could produce confusing and
|
|
28
|
-
spurious results.`)}}return!1};class Dt{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||Se(!1,`Body must be a string. Received: ${Ze(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||Se(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Se(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function fi(e){return li(e,Dt)}function hi(e,t){return new di(e,t).parseDocument()}class di{constructor(t,n={}){const i=fi(t)?t:new Dt(t);this._lexer=new Jn(i),this._options=n,this._tokenCounter=0}parseName(){const t=this.expectToken(m.NAME);return this.node(t,{kind:A.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:A.DOCUMENT,definitions:this.many(m.SOF,this.parseDefinition,m.EOF)})}parseDefinition(){if(this.peek(m.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===m.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()}if(t)throw M(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(m.BRACE_L))return this.node(t,{kind:A.OPERATION_DEFINITION,operation:fe.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let i;return this.peek(m.NAME)&&(i=this.parseName()),this.node(t,{kind:A.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(m.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(m.PAREN_L,this.parseVariableDefinition,m.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:A.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(m.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(m.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(m.DOLLAR),this.node(t,{kind:A.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:A.SELECTION_SET,selections:this.many(m.BRACE_L,this.parseSelection,m.BRACE_R)})}parseSelection(){return this.peek(m.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,n=this.parseName();let i,r;return this.expectOptionalToken(m.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:A.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(m.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(m.PAREN_L,n,m.PAREN_R)}parseArgument(t=!1){const n=this._lexer.token,i=this.parseName();return this.expectToken(m.COLON),this.node(n,{kind:A.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(m.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(m.NAME)?this.node(t,{kind:A.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:A.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:A.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:A.FRAGMENT_DEFINITION,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 m.BRACKET_L:return this.parseList(t);case m.BRACE_L:return this.parseObject(t);case m.INT:return this.advanceLexer(),this.node(n,{kind:A.INT,value:n.value});case m.FLOAT:return this.advanceLexer(),this.node(n,{kind:A.FLOAT,value:n.value});case m.STRING:case m.BLOCK_STRING:return this.parseStringLiteral();case m.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:A.BOOLEAN,value:!0});case"false":return this.node(n,{kind:A.BOOLEAN,value:!1});case"null":return this.node(n,{kind:A.NULL});default:return this.node(n,{kind:A.ENUM,value:n.value})}case m.DOLLAR:if(t)if(this.expectToken(m.DOLLAR),this._lexer.token.kind===m.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:A.STRING,value:t.value,block:t.kind===m.BLOCK_STRING})}parseList(t){const n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:A.LIST,values:this.any(m.BRACKET_L,n,m.BRACKET_R)})}parseObject(t){const n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:A.OBJECT,fields:this.any(m.BRACE_L,n,m.BRACE_R)})}parseObjectField(t){const n=this._lexer.token,i=this.parseName();return this.expectToken(m.COLON),this.node(n,{kind:A.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){const n=[];for(;this.peek(m.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const n=this._lexer.token;return this.expectToken(m.AT),this.node(n,{kind:A.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let n;if(this.expectOptionalToken(m.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(m.BRACKET_R),n=this.node(t,{kind:A.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(m.BANG)?this.node(t,{kind:A.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:A.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(m.STRING)||this.peek(m.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(m.BRACE_L,this.parseOperationTypeDefinition,m.BRACE_R);return this.node(t,{kind:A.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){const t=this._lexer.token,n=this.parseOperationType();this.expectToken(m.COLON);const i=this.parseNamedType();return this.node(t,{kind:A.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:A.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:A.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(m.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(m.BRACE_L,this.parseFieldDefinition,m.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(m.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:A.FIELD_DEFINITION,description:n,name:i,arguments:r,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(m.PAREN_L,this.parseInputValueDef,m.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(m.COLON);const r=this.parseTypeReference();let s;this.expectOptionalToken(m.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(t,{kind:A.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:A.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:A.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(m.EQUALS)?this.delimitedMany(m.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:A.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:s})}parseEnumValuesDefinition(){return this.optionalMany(m.BRACE_L,this.parseEnumValueDefinition,m.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:A.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:A.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(m.BRACE_L,this.parseInputValueDef,m.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===m.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(m.BRACE_L,this.parseOperationTypeDefinition,m.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:A.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:A.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:A.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:A.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:A.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:A.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:A.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(m.AT);const i=this.parseName(),r=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(t,{kind:A.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(m.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)}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 ${St(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===m.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===m.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(t!==void 0&&n.kind!==m.EOF&&(++this._tokenCounter,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 St(e.kind)+(t!=null?` "${t}"`:"")}function St(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"],yi=Object.freeze({});function Ni(e,t,n=wt){const i=new Map;for(const O of Object.values(A))i.set(O,wi(t,O));let r,s=Array.isArray(e),o=[e],a=-1,u=[],c=e,l,f;const d=[],y=[];do{a++;const O=a===o.length,V=O&&u.length!==0;if(O){if(l=y.length===0?void 0:d[d.length-1],c=f,f=y.pop(),V)if(s){c=c.slice();let k=0;for(const[Q,$]of u){const re=Q-k;$===null?(c.splice(re,1),k++):c[re]=$}}else{c=Object.defineProperties({},Object.getOwnPropertyDescriptors(c));for(const[k,Q]of u)c[k]=Q}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 N,E;vt(c)||Se(!1,`Invalid AST Node: ${Ze(c)}.`);const k=O?(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(b=k?.call(t,c,l,f,d,y),b===yi)break;if(b===!1){if(!O){d.pop();continue}}else if(b!==void 0&&(u.push([l,b]),!O))if(vt(b))c=b;else{d.pop();continue}}if(b===void 0&&V&&u.push([l,c]),O)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&&y.push(f),f=c}}while(r!==void 0);return u.length!==0?u[u.length-1][1]:e}function wi(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 Ni(e,Ai)}const Ti=80,Ai={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>w(e.definitions,`
|
|
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,`
|
|
29
23
|
|
|
30
|
-
`)},OperationDefinition:{leave(e){const t=
|
|
31
|
-
`,
|
|
24
|
+
`)},OperationDefinition:{leave(e){const t=We(e.variableDefinitions)?I(`(
|
|
25
|
+
`,y(e.variableDefinitions,`
|
|
26
|
+
`),`
|
|
27
|
+
)`):I("(",y(e.variableDefinitions,", "),")"),n=I("",e.description,`
|
|
28
|
+
`)+y([e.operation,y([e.name,t]),y(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:i,description:r})=>I("",r,`
|
|
29
|
+
`)+e+": "+t+I(" = ",n)+I(" ",y(i," "))},SelectionSet:{leave:({selections:e})=>Q(e)},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:r}){const s=I("",e,": ")+t;let o=s+I("(",y(n,", "),")");return o.length>wi&&(o=s+I(`(
|
|
30
|
+
`,Re(y(n,`
|
|
32
31
|
`)),`
|
|
33
|
-
)`)),
|
|
34
|
-
`)
|
|
35
|
-
`)+
|
|
36
|
-
`)+
|
|
37
|
-
`)+t
|
|
38
|
-
|
|
32
|
+
)`)),y([o,y(i," "),r]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+I(" ",y(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>y(["...",I("on ",e),y(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:i,selectionSet:r,description:s})=>I("",s,`
|
|
33
|
+
`)+`fragment ${e}${I("(",y(n,", "),")")} on ${t} ${I("",y(i," ")," ")}`+r},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?Yn(e):pi(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+y(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+y(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+I("(",y(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>I("",e,`
|
|
34
|
+
`)+y(["schema",y(t," "),Q(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>I("",e,`
|
|
35
|
+
`)+y(["scalar",t,y(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>I("",e,`
|
|
36
|
+
`)+y(["type",t,I("implements ",y(n," & ")),y(i," "),Q(r)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:i,directives:r})=>I("",e,`
|
|
37
|
+
`)+t+(We(n)?I(`(
|
|
38
|
+
`,Re(y(n,`
|
|
39
39
|
`)),`
|
|
40
|
-
)`):
|
|
41
|
-
`)+
|
|
42
|
-
`)+
|
|
43
|
-
`)+
|
|
44
|
-
`)+
|
|
45
|
-
`)+
|
|
46
|
-
`)+
|
|
47
|
-
`)+"directive @"+t+(
|
|
48
|
-
`,Re(
|
|
40
|
+
)`):I("(",y(n,", "),")"))+": "+i+I(" ",y(r," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:i,directives:r})=>I("",e,`
|
|
41
|
+
`)+y([t+": "+n,I("= ",i),y(r," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>I("",e,`
|
|
42
|
+
`)+y(["interface",t,I("implements ",y(n," & ")),y(i," "),Q(r)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:i})=>I("",e,`
|
|
43
|
+
`)+y(["union",t,y(n," "),I("= ",y(i," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:i})=>I("",e,`
|
|
44
|
+
`)+y(["enum",t,y(n," "),Q(i)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>I("",e,`
|
|
45
|
+
`)+y([t,y(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:i})=>I("",e,`
|
|
46
|
+
`)+y(["input",t,y(n," "),Q(i)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:i,locations:r})=>I("",e,`
|
|
47
|
+
`)+"directive @"+t+(We(n)?I(`(
|
|
48
|
+
`,Re(y(n,`
|
|
49
49
|
`)),`
|
|
50
|
-
)`):
|
|
51
|
-
`,Re(
|
|
50
|
+
)`):I("(",y(n,", "),")"))+(i?" repeatable":"")+" on "+y(r," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>y(["extend schema",y(e," "),Q(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>y(["extend scalar",e,y(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>y(["extend type",e,I("implements ",y(t," & ")),y(n," "),Q(i)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>y(["extend interface",e,I("implements ",y(t," & ")),y(n," "),Q(i)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>y(["extend union",e,y(t," "),I("= ",y(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>y(["extend enum",e,y(t," "),Q(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>y(["extend input",e,y(t," "),Q(n)]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>y([e,I(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>y([e,I(".",t),I("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>y(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>y(["@",e,I("(",t,":)")])}};function y(e,t=""){var n;return(n=e?.filter(i=>i).join(t))!==null&&n!==void 0?n:""}function Q(e){return I(`{
|
|
51
|
+
`,Re(y(e,`
|
|
52
52
|
`)),`
|
|
53
|
-
}`)}function
|
|
54
|
-
`))}function
|
|
55
|
-
`)))!==null&&t!==void 0?t:!1}const
|
|
56
|
-
`)===0?R.substr(1,R.length):R}).forEach(function(R){var L=R.split(":"),
|
|
53
|
+
}`)}function I(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function Re(e){return I(" ",e.replace(/\n/g,`
|
|
54
|
+
`))}function We(e){var t;return(t=e?.some(n=>n.includes(`
|
|
55
|
+
`)))!==null&&t!==void 0?t:!1}const St=e=>{let t;const n=e.definitions.filter(i=>i.kind==="OperationDefinition");return n.length===1&&(t=n[0]?.name?.value),t},Ke=e=>{if(typeof e=="string"){let n;try{const i=hi(e);n=St(i)}catch{}return{query:e,operationName:n}}const t=St(e);return{query:vi(e),operationName:t}};class Te extends Error{constructor(t,n){const i=`${Te.extractMessage(t)}: ${JSON.stringify({response:t,request:n})}`;super(i),Object.setPrototypeOf(this,Te.prototype),this.response=t,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Te)}static extractMessage(t){return t.errors?.[0]?.message??`GraphQL Error (Code: ${t.status})`}}var Le=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pe={exports:{}},kt;function Ii(){return kt||(kt=1,(function(e,t){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Le<"u"&&Le,i=(function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s})();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof Le<"u"&&Le||{},u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function c(h){return h&&DataView.prototype.isPrototypeOf(h)}if(u.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(h){return h&&l.indexOf(Object.prototype.toString.call(h))>-1};function d(h){if(typeof h!="string"&&(h=String(h)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(h)||h==="")throw new TypeError('Invalid character in header field name: "'+h+'"');return h.toLowerCase()}function N(h){return typeof h!="string"&&(h=String(h)),h}function T(h){var m={next:function(){var D=h.shift();return{done:D===void 0,value:D}}};return u.iterable&&(m[Symbol.iterator]=function(){return m}),m}function E(h){this.map={},h instanceof E?h.forEach(function(m,D){this.append(D,m)},this):Array.isArray(h)?h.forEach(function(m){if(m.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+m.length);this.append(m[0],m[1])},this):h&&Object.getOwnPropertyNames(h).forEach(function(m){this.append(m,h[m])},this)}E.prototype.append=function(h,m){h=d(h),m=N(m);var D=this.map[h];this.map[h]=D?D+", "+m:m},E.prototype.delete=function(h){delete this.map[d(h)]},E.prototype.get=function(h){return h=d(h),this.has(h)?this.map[h]:null},E.prototype.has=function(h){return this.map.hasOwnProperty(d(h))},E.prototype.set=function(h,m){this.map[d(h)]=N(m)},E.prototype.forEach=function(h,m){for(var D in this.map)this.map.hasOwnProperty(D)&&h.call(m,this.map[D],D,this)},E.prototype.keys=function(){var h=[];return this.forEach(function(m,D){h.push(D)}),T(h)},E.prototype.values=function(){var h=[];return this.forEach(function(m){h.push(m)}),T(h)},E.prototype.entries=function(){var h=[];return this.forEach(function(m,D){h.push([D,m])}),T(h)},u.iterable&&(E.prototype[Symbol.iterator]=E.prototype.entries);function x(h){if(!h._noBody){if(h.bodyUsed)return Promise.reject(new TypeError("Already read"));h.bodyUsed=!0}}function _(h){return new Promise(function(m,D){h.onload=function(){m(h.result)},h.onerror=function(){D(h.error)}})}function V(h){var m=new FileReader,D=_(m);return m.readAsArrayBuffer(h),D}function b(h){var m=new FileReader,D=_(m),R=/charset=([A-Za-z0-9_-]+)/.exec(h.type),L=R?R[1]:"utf-8";return m.readAsText(h,L),D}function k(h){for(var m=new Uint8Array(h),D=new Array(m.length),R=0;R<m.length;R++)D[R]=String.fromCharCode(m[R]);return D.join("")}function X(h){if(h.slice)return h.slice(0);var m=new Uint8Array(h.byteLength);return m.set(new Uint8Array(h)),m.buffer}function $(){return this.bodyUsed=!1,this._initBody=function(h){this.bodyUsed=this.bodyUsed,this._bodyInit=h,h?typeof h=="string"?this._bodyText=h:u.blob&&Blob.prototype.isPrototypeOf(h)?this._bodyBlob=h:u.formData&&FormData.prototype.isPrototypeOf(h)?this._bodyFormData=h:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)?this._bodyText=h.toString():u.arrayBuffer&&u.blob&&c(h)?(this._bodyArrayBuffer=X(h.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(h)||f(h))?this._bodyArrayBuffer=X(h):this._bodyText=h=Object.prototype.toString.call(h):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof h=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var h=x(this);if(h)return h;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var h=x(this);return h||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(u.blob)return this.blob().then(V);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var h=x(this);if(h)return h;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(k(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(ve)}),this.json=function(){return this.text().then(JSON.parse)},this}var re=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function pe(h){var m=h.toUpperCase();return re.indexOf(m)>-1?m:h}function G(h,m){if(!(this instanceof G))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');m=m||{};var D=m.body;if(h instanceof G){if(h.bodyUsed)throw new TypeError("Already read");this.url=h.url,this.credentials=h.credentials,m.headers||(this.headers=new E(h.headers)),this.method=h.method,this.mode=h.mode,this.signal=h.signal,!D&&h._bodyInit!=null&&(D=h._bodyInit,h.bodyUsed=!0)}else this.url=String(h);if(this.credentials=m.credentials||this.credentials||"same-origin",(m.headers||!this.headers)&&(this.headers=new E(m.headers)),this.method=pe(m.method||this.method||"GET"),this.mode=m.mode||this.mode||null,this.signal=m.signal||this.signal||(function(){if("AbortController"in a){var C=new AbortController;return C.signal}})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&D)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(D),(this.method==="GET"||this.method==="HEAD")&&(m.cache==="no-store"||m.cache==="no-cache")){var R=/([?&])_=[^&]*/;if(R.test(this.url))this.url=this.url.replace(R,"$1_="+new Date().getTime());else{var L=/\?/;this.url+=(L.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}G.prototype.clone=function(){return new G(this,{body:this._bodyInit})};function ve(h){var m=new FormData;return h.trim().split("&").forEach(function(D){if(D){var R=D.split("="),L=R.shift().replace(/\+/g," "),C=R.join("=").replace(/\+/g," ");m.append(decodeURIComponent(L),decodeURIComponent(C))}}),m}function Y(h){var m=new E,D=h.replace(/\r?\n[\t ]+/g," ");return D.split("\r").map(function(R){return R.indexOf(`
|
|
56
|
+
`)===0?R.substr(1,R.length):R}).forEach(function(R){var L=R.split(":"),C=L.shift().trim();if(C){var Be=L.join(":").trim();try{m.append(C,Be)}catch(nt){console.warn("Response "+nt.message)}}}),m}$.call(G.prototype);function j(h,m){if(!(this instanceof j))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(m||(m={}),this.type="default",this.status=m.status===void 0?200:m.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=m.statusText===void 0?"":""+m.statusText,this.headers=new E(m.headers),this.url=m.url||"",this._initBody(h)}$.call(j.prototype),j.prototype.clone=function(){return new j(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new E(this.headers),url:this.url})},j.error=function(){var h=new j(null,{status:200,statusText:""});return h.ok=!1,h.status=0,h.type="error",h};var me=[301,302,303,307,308];j.redirect=function(h,m){if(me.indexOf(m)===-1)throw new RangeError("Invalid status code");return new j(null,{status:m,headers:{location:h}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(m,D){this.message=m,this.name=D;var R=Error(m);this.stack=R.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function oe(h,m){return new Promise(function(D,R){var L=new G(h,m);if(L.signal&&L.signal.aborted)return R(new o.DOMException("Aborted","AbortError"));var C=new XMLHttpRequest;function Be(){C.abort()}C.onload=function(){var U={statusText:C.statusText,headers:Y(C.getAllResponseHeaders()||"")};L.url.indexOf("file://")===0&&(C.status<200||C.status>599)?U.status=200:U.status=C.status,U.url="responseURL"in C?C.responseURL:U.headers.get("X-Request-URL");var ae="response"in C?C.response:C.responseText;setTimeout(function(){D(new j(ae,U))},0)},C.onerror=function(){setTimeout(function(){R(new TypeError("Network request failed"))},0)},C.ontimeout=function(){setTimeout(function(){R(new TypeError("Network request timed out"))},0)},C.onabort=function(){setTimeout(function(){R(new o.DOMException("Aborted","AbortError"))},0)};function nt(U){try{return U===""&&a.location.href?a.location.href:U}catch{return U}}if(C.open(L.method,nt(L.url),!0),L.credentials==="include"?C.withCredentials=!0:L.credentials==="omit"&&(C.withCredentials=!1),"responseType"in C&&(u.blob?C.responseType="blob":u.arrayBuffer&&(C.responseType="arraybuffer")),m&&typeof m.headers=="object"&&!(m.headers instanceof E||a.Headers&&m.headers instanceof a.Headers)){var Ft=[];Object.getOwnPropertyNames(m.headers).forEach(function(U){Ft.push(d(U)),C.setRequestHeader(U,N(m.headers[U]))}),L.headers.forEach(function(U,ae){Ft.indexOf(ae)===-1&&C.setRequestHeader(ae,U)})}else L.headers.forEach(function(U,ae){C.setRequestHeader(ae,U)});L.signal&&(L.signal.addEventListener("abort",Be),C.onreadystatechange=function(){C.readyState===4&&L.signal.removeEventListener("abort",Be)}),C.send(typeof L._bodyInit>"u"?null:L._bodyInit)})}return oe.polyfill=!0,a.fetch||(a.fetch=oe,a.Headers=E,a.Request=G,a.Response=j),o.Headers=E,o.Request=G,o.Response=j,o.fetch=oe,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=n.fetch?n:i;t=r.fetch,t.default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t})(Pe,Pe.exports)),Pe.exports}var Fe=Ii();const Me=Oi(Fe),_i=ge({__proto__:null,default:Me},[Fe]),de=e=>{let t={};return e&&(typeof Headers<"u"&&e instanceof Headers||_i&&Fe.Headers&&e instanceof Fe.Headers?t=kn(e):Array.isArray(e)?e.forEach(([n,i])=>{n&&i!==void 0&&(t[n]=i)}):t=e),t},Rt=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),bi=e=>{if(!Array.isArray(e.query)){const i=e,r=[`query=${encodeURIComponent(Rt(i.query))}`];return e.variables&&r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`),i.operationName&&r.push(`operationName=${encodeURIComponent(i.operationName)}`),r.join("&")}if(typeof e.variables<"u"&&!Array.isArray(e.variables))throw new Error("Cannot create query with given variable type, array expected");const t=e,n=e.query.reduce((i,r,s)=>(i.push({query:Rt(r),variables:t.variables?t.jsonSerializer.stringify(t.variables[s]):void 0}),i),[]);return`query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`},Di=e=>async t=>{const{url:n,query:i,variables:r,operationName:s,fetch:o,fetchOptions:a,middleware:u}=t,c={...t.headers};let l="",f;e==="POST"?(f=xi(i,r,s,a.jsonSerializer),typeof f=="string"&&(c["Content-Type"]="application/json")):l=bi({query:i,variables:r,operationName:s,jsonSerializer:a.jsonSerializer??Ge});const d={method:e,headers:c,body:f,...a};let N=n,T=d;if(u){const E=await Promise.resolve(u({...d,url:n,operationName:s,variables:r})),{url:x,..._}=E;N=x,T=_}return l&&(N=`${N}?${l}`),await o(N,T)};class Ci{constructor(t,n={}){this.url=t,this.requestConfig=n,this.rawRequest=async(...i)=>{const[r,s,o]=i,a=Ln(r,s,o),{headers:u,fetch:c=Me,method:l="POST",requestMiddleware:f,responseMiddleware:d,...N}=this.requestConfig,{url:T}=this;a.signal!==void 0&&(N.signal=a.signal);const{operationName:E}=Ke(a.query);return et({url:T,query:a.query,variables:a.variables,headers:{...de(tt(u)),...de(a.requestHeaders)},operationName:E,fetch:c,method:l,fetchOptions:N,middleware:f}).then(x=>(d&&d(x),x)).catch(x=>{throw d&&d(x),x})}}async request(t,...n){const[i,r]=n,s=Rn(t,i,r),{headers:o,fetch:a=Me,method:u="POST",requestMiddleware:c,responseMiddleware:l,...f}=this.requestConfig,{url:d}=this;s.signal!==void 0&&(f.signal=s.signal);const{query:N,operationName:T}=Ke(s.document);return et({url:d,query:N,variables:s.variables,headers:{...de(tt(o)),...de(s.requestHeaders)},operationName:T,fetch:a,method:u,fetchOptions:f,middleware:c}).then(E=>(l&&l(E),E.data)).catch(E=>{throw l&&l(E),E})}batchRequests(t,n){const i=Pn(t,n),{headers:r,...s}=this.requestConfig;i.signal!==void 0&&(s.signal=i.signal);const o=i.documents.map(({document:u})=>Ke(u).query),a=i.documents.map(({variables:u})=>u);return et({url:this.url,query:o,variables:a,headers:{...de(tt(r)),...de(i.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??Me,method:this.requestConfig.method||"POST",fetchOptions:s,middleware:this.requestConfig.requestMiddleware}).then(u=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(u),u.data)).catch(u=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(u),u})}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 et=async e=>{const{query:t,variables:n,fetchOptions:i}=e,r=Di(Sn(e.method??"post")),s=Array.isArray(e.query),o=await r(e),a=await Si(o,i.jsonSerializer??Ge),u=Array.isArray(a)?!a.some(({data:l})=>!l):!!a.data,c=Array.isArray(a)||!a.errors||Array.isArray(a.errors)&&!a.errors.length||i.errorPolicy==="all"||i.errorPolicy==="ignore";if(o.ok&&c&&u){const{errors:l,...f}=(Array.isArray(a),a),d=i.errorPolicy==="ignore"?f:a;return{...s?{data:d}:d,headers:o.headers,status:o.status}}else{const l=typeof a=="string"?{error:a}:a;throw new Te({...l,status:o.status,headers:o.headers},{query:t,variables:n})}},xi=(e,t,n,i)=>{const r=i??Ge;if(!Array.isArray(e))return r.stringify({query:e,variables:t,operationName:n});if(typeof t<"u"&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");const s=e.reduce((o,a,u)=>(o.push({query:a,variables:t?t[u]:void 0}),o),[]);return r.stringify(s)},Si=async(e,t)=>{let n;return e.headers.forEach((i,r)=>{r.toLowerCase()==="content-type"&&(n=i)}),n&&(n.toLowerCase().startsWith("application/json")||n.toLowerCase().startsWith("application/graphql+json")||n.toLowerCase().startsWith("application/graphql-response+json"))?t.parse(await e.text()):e.text()},tt=e=>typeof e=="function"?e():e,Lt=(e,...t)=>e.reduce((n,i,r)=>`${n}${i}${r in t?String(t[r]):""}`,""),Pt={getMeta:Lt`
|
|
57
57
|
query getDoctype($doctype: String!) {
|
|
58
58
|
getMeta(doctype: $doctype) {
|
|
59
59
|
id
|
|
@@ -109,5 +109,5 @@ spurious results.`)}}return!1};class Dt{constructor(t,n="GraphQL request",i={lin
|
|
|
109
109
|
query: Query
|
|
110
110
|
mutation: Mutation
|
|
111
111
|
}
|
|
112
|
-
`,Ri=e=>JSON.parse(e,(t,n)=>{if(typeof n=="string")try{return JSON.parse(n,(i,r)=>typeof r=="string"&&!isNaN(Number(r))?new le(r):r)}catch{return n}else if(!isNaN(Number(n)))return new le(n);return n}),Li={getMeta:async(e,t)=>{const n=new
|
|
112
|
+
`,Ri=e=>JSON.parse(e,(t,n)=>{if(typeof n=="string")try{return JSON.parse(n,(i,r)=>typeof r=="string"&&!isNaN(Number(r))?new le(r):r)}catch{return n}else if(!isNaN(Number(n)))return new le(n);return n}),Li={getMeta:async(e,t)=>{const n=new Ci(t||"/graphql",{fetch:window.fetch,jsonSerializer:{stringify:r=>JSON.stringify(r),parse:Ri}}),{getMeta:i}=await n.request({document:Pt.getMeta,variables:{doctype:e}});return i}};K.methods=Li,K.queries=Pt,K.typeDefs=ki,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})}));
|
|
113
113
|
//# sourceMappingURL=graphql-client.umd.cjs.map
|