@spritz-finance/api-client 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENCE +15 -0
- package/README.md +161 -21
- package/dist/spritz-api-client.d.ts +191 -19
- package/dist/spritz-api-client.js +97 -32
- package/dist/spritz-api-client.js.map +1 -1
- package/dist/spritz-api-client.mjs +97 -32
- package/dist/spritz-api-client.mjs.map +1 -1
- package/package.json +9 -5
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`),
|
|
3
|
-
`)}function
|
|
1
|
+
"use strict";var at=require("axios"),Ai=Object.getOwnPropertyNames,Z=(e,n)=>function(){return n||(0,e[Ai(e)[0]])((n={exports:{}}).exports,n),n.exports};function xe(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xe=function(t){return typeof t}:xe=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xe(e)}function oe(e){return xe(e)=="object"&&e!==null}var ot=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",G=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function In(e,n){for(var t=/\r\n|[\n\r]/g,i=1,r=n+1,a;(a=t.exec(e.body))&&a.index<n;)i+=1,r=n+1-(a.index+a[0].length);return{line:i,column:r}}function Di(e){return st(e.source,In(e.source,e.start))}function st(e,n){var t=e.locationOffset.column-1,i=qe(t)+e.body,r=n.line-1,a=e.locationOffset.line-1,u=n.line+a,o=n.line===1?t:0,s=n.column+o,l="".concat(e.name,":").concat(u,":").concat(s,`
|
|
2
|
+
`),g=i.split(/\r\n|[\n\r]/g),E=g[r];if(E.length>120){for(var y=Math.floor(s/80),d=s%80,N=[],w=0;w<E.length;w+=80)N.push(E.slice(w,w+80));return l+ut([["".concat(u),N[0]]].concat(N.slice(1,y+1).map(function(O){return["",O]}),[[" ",qe(d-1)+"^"],["",N[y+1]]]))}return l+ut([["".concat(u-1),g[r-1]],["".concat(u),E],["",qe(s-1)+"^"],["".concat(u+1),g[r+1]]])}function ut(e){var n=e.filter(function(i){i[0];var r=i[1];return r!==void 0}),t=Math.max.apply(Math,n.map(function(i){var r=i[0];return r.length}));return n.map(function(i){var r=i[0],a=i[1];return Oi(t,r)+(a?" | "+a:" |")}).join(`
|
|
3
|
+
`)}function qe(e){return Array(e+1).join(" ")}function Oi(e,n){return qe(e-n.length)+n}function Ce(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ce=function(t){return typeof t}:Ce=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ce(e)}function ct(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,i)}return t}function _i(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?ct(Object(t),!0).forEach(function(i){Fi(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ct(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Fi(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Li(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function lt(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ri(e,n,t){return n&<(e.prototype,n),t&<(e,t),e}function Pi(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&Ae(e,n)}function Ui(e){var n=dt();return function(){var i=De(e),r;if(n){var a=De(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return ft(this,r)}}function ft(e,n){return n&&(Ce(n)==="object"||typeof n=="function")?n:we(e)}function we(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wn(e){var n=typeof Map=="function"?new Map:void 0;return wn=function(i){if(i===null||!Bi(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n<"u"){if(n.has(i))return n.get(i);n.set(i,r)}function r(){return je(i,arguments,De(this).constructor)}return r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Ae(r,i)},wn(e)}function je(e,n,t){return dt()?je=Reflect.construct:je=function(r,a,u){var o=[null];o.push.apply(o,a);var s=Function.bind.apply(r,o),l=new s;return u&&Ae(l,u.prototype),l},je.apply(null,arguments)}function dt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Bi(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Ae(e,n){return Ae=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},Ae(e,n)}function De(e){return De=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},De(e)}var U=function(e){Pi(t,e);var n=Ui(t);function t(i,r,a,u,o,s,l){var g,E,y,d;Li(this,t),d=n.call(this,i),d.name="GraphQLError",d.originalError=s??void 0,d.nodes=vt(Array.isArray(r)?r:r?[r]:void 0);for(var N=[],w=0,O=(D=d.nodes)!==null&&D!==void 0?D:[];w<O.length;w++){var D,P=O[w],L=P.loc;L!=null&&N.push(L)}N=vt(N),d.source=a??((g=N)===null||g===void 0?void 0:g[0].source),d.positions=u??((E=N)===null||E===void 0?void 0:E.map(function(c){return c.start})),d.locations=u&&a?u.map(function(c){return In(a,c)}):(y=N)===null||y===void 0?void 0:y.map(function(c){return In(c.source,c.start)}),d.path=o??void 0;var f=s?.extensions;return l==null&&oe(f)?d.extensions=_i({},f):d.extensions=l??{},Object.defineProperties(we(d),{message:{enumerable:!0},locations:{enumerable:d.locations!=null},path:{enumerable:d.path!=null},extensions:{enumerable:d.extensions!=null&&Object.keys(d.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),s!=null&&s.stack?(Object.defineProperty(we(d),"stack",{value:s.stack,writable:!0,configurable:!0}),ft(d)):(Error.captureStackTrace?Error.captureStackTrace(we(d),t):Object.defineProperty(we(d),"stack",{value:Error().stack,writable:!0,configurable:!0}),d)}return Ri(t,[{key:"toString",value:function(){return Vi(this)}},{key:G,get:function(){return"Object"}}]),t}(wn(Error));function vt(e){return e===void 0||e.length===0?void 0:e}function Vi(e){var n=e.message;if(e.nodes)for(var t=0,i=e.nodes;t<i.length;t++){var r=i[t];r.loc&&(n+=`
|
|
4
4
|
|
|
5
|
-
`+
|
|
5
|
+
`+Di(r.loc))}else if(e.source&&e.locations)for(var a=0,u=e.locations;a<u.length;a++){var o=u[a];n+=`
|
|
6
6
|
|
|
7
|
-
`+
|
|
7
|
+
`+st(e.source,o)}return n}var h=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function Oe(e,n){var t=!!e;if(!t)throw new Error(n??"Unexpected invariant triggered.")}var Mi=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,An=Mi;function H(e){var n=e.prototype.toJSON;typeof n=="function"||Oe(0),e.prototype.inspect=n,An&&(e.prototype[An]=n)}var xi=function(){function e(t,i,r){this.start=t.start,this.end=i.end,this.startToken=t,this.endToken=i,this.source=r}var n=e.prototype;return n.toJSON=function(){return{start:this.start,end:this.end}},e}();H(xi);var qi=function(){function e(t,i,r,a,u,o,s){this.kind=t,this.start=i,this.end=r,this.line=a,this.column=u,this.value=s,this.prev=o,this.next=null}var n=e.prototype;return n.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();H(qi);function Dn(e){return e!=null&&typeof e.kind=="string"}function Ge(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ge=function(t){return typeof t}:Ge=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ge(e)}var Ci=10,pt=2;function F(e){return $e(e,[])}function $e(e,n){switch(Ge(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return e===null?"null":ji(e,n);default:return String(e)}}function ji(e,n){if(n.indexOf(e)!==-1)return"[Circular]";var t=[].concat(n,[e]),i=Qi(e);if(i!==void 0){var r=i.call(e);if(r!==e)return typeof r=="string"?r:$e(r,t)}else if(Array.isArray(e))return $i(e,t);return Gi(e,t)}function Gi(e,n){var t=Object.keys(e);if(t.length===0)return"{}";if(n.length>pt)return"["+Ji(e)+"]";var i=t.map(function(r){var a=$e(e[r],n);return r+": "+a});return"{ "+i.join(", ")+" }"}function $i(e,n){if(e.length===0)return"[]";if(n.length>pt)return"[Array]";for(var t=Math.min(Ci,e.length),i=e.length-t,r=[],a=0;a<t;++a)r.push($e(e[a],n));return i===1?r.push("... 1 more item"):i>1&&r.push("... ".concat(i," more items")),"["+r.join(", ")+"]"}function Qi(e){var n=e[String(An)];if(typeof n=="function")return n;if(typeof e.inspect=="function")return e.inspect}function Ji(e){var n=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(n==="Object"&&typeof e.constructor=="function"){var t=e.constructor.name;if(typeof t=="string"&&t!=="")return t}return n}function _(e,n){var t=!!e;if(!t)throw new Error(n)}function Qe(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qe=function(t){return typeof t}:Qe=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qe(e)}var ee=function(n,t){if(n instanceof t)return!0;if(Qe(n)==="object"&&n!==null){var i,r=t.prototype[Symbol.toStringTag],a=Symbol.toStringTag in n?n[Symbol.toStringTag]:(i=n.constructor)===null||i===void 0?void 0:i.name;if(r===a){var u=F(n);throw new Error("Cannot use ".concat(r,' "').concat(u,`" from another module or realm.
|
|
8
8
|
|
|
9
9
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
10
10
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -15,31 +15,31 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
15
15
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
16
16
|
versions may have different capabilities and behavior. The data from one
|
|
17
17
|
version used in the function from another could produce confusing and
|
|
18
|
-
spurious results.`))}}return!1};function
|
|
19
|
-
`)===-1,r=e[0]===" "||e[0]===" ",a=e[e.length-1]==='"',
|
|
20
|
-
`+
|
|
21
|
-
`+
|
|
22
|
-
`),'"""'+
|
|
18
|
+
spurious results.`))}}return!1};function mt(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Hi(e,n,t){return n&&mt(e.prototype,n),t&&mt(e,t),e}(function(){function e(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof n=="string"||_(0,"Body must be a string. Received: ".concat(F(n),".")),this.body=n,this.name=t,this.locationOffset=i,this.locationOffset.line>0||_(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||_(0,"column in locationOffset is 1-indexed and must be positive.")}return Hi(e,[{key:G,get:function(){return"Source"}}]),e})();var R=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function zi(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=e.indexOf(`
|
|
19
|
+
`)===-1,r=e[0]===" "||e[0]===" ",a=e[e.length-1]==='"',u=e[e.length-1]==="\\",o=!i||a||u||t,s="";return o&&!(i&&r)&&(s+=`
|
|
20
|
+
`+n),s+=n?e.replace(/\n/g,`
|
|
21
|
+
`+n):e,o&&(s+=`
|
|
22
|
+
`),'"""'+s.replace(/"""/g,'\\"""')+'"""'}var Yi={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["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:["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"]},Xi=Object.freeze({});function ht(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Yi,i=void 0,r=Array.isArray(e),a=[e],u=-1,o=[],s=void 0,l=void 0,g=void 0,E=[],y=[],d=e;do{u++;var N=u===a.length,w=N&&o.length!==0;if(N){if(l=y.length===0?void 0:E[E.length-1],s=g,g=y.pop(),w){if(r)s=s.slice();else{for(var O={},D=0,P=Object.keys(s);D<P.length;D++){var L=P[D];O[L]=s[L]}s=O}for(var f=0,c=0;c<o.length;c++){var S=o[c][0],v=o[c][1];r&&(S-=f),r&&v===null?(s.splice(S,1),f++):s[S]=v}}u=i.index,a=i.keys,o=i.edits,r=i.inArray,i=i.prev}else{if(l=g?r?u:a[u]:void 0,s=g?g[l]:d,s==null)continue;g&&E.push(l)}var b=void 0;if(!Array.isArray(s)){if(!Dn(s))throw new Error("Invalid AST Node: ".concat(F(s),"."));var A=On(n,s.kind,N);if(A){if(b=A.call(n,s,l,g,E,y),b===Xi)break;if(b===!1){if(!N){E.pop();continue}}else if(b!==void 0&&(o.push([l,b]),!N))if(Dn(b))s=b;else{E.pop();continue}}}if(b===void 0&&w&&o.push([l,s]),N)E.pop();else{var m;i={inArray:r,index:u,keys:a,edits:o,prev:i},r=Array.isArray(s),a=r?s:(m=t[s.kind])!==null&&m!==void 0?m:[],u=-1,o=[],g&&y.push(g),g=s}}while(i!==void 0);return o.length!==0&&(d=o[o.length-1][1]),d}function On(e,n,t){var i=e[n];if(i){if(!t&&typeof i=="function")return i;var r=t?i.leave:i.enter;if(typeof r=="function")return r}else{var a=t?e.leave:e.enter;if(a){if(typeof a=="function")return a;var u=a[n];if(typeof u=="function")return u}}}var Ki=Array.prototype.find?function(e,n){return Array.prototype.find.call(e,n)}:function(e,n){for(var t=0;t<e.length;t++){var i=e[t];if(n(i))return i}},yt=Ki,Wi=Object.values||function(e){return Object.keys(e).map(function(n){return e[n]})},se=Wi,Zi=Object.entries||function(e){return Object.keys(e).map(function(n){return[n,e[n]]})},_e=Zi;function gt(e,n){return e.reduce(function(t,i){return t[n(i)]=i,t},Object.create(null))}function Je(e,n){for(var t=Object.create(null),i=0,r=_e(e);i<r.length;i++){var a=r[i],u=a[0],o=a[1];t[u]=n(o,u)}return t}function j(e){if(Object.getPrototypeOf(e)===null)return e;for(var n=Object.create(null),t=0,i=_e(e);t<i.length;t++){var r=i[t],a=r[0],u=r[1];n[a]=u}return n}function _n(e,n,t){return e.reduce(function(i,r){return i[n(r)]=t(r),i},Object.create(null))}var er=5;function nr(e,n){var t=typeof e=="string"?[e,n]:[void 0,e],i=t[0],r=t[1],a=" Did you mean ";i&&(a+=i+" ");var u=r.map(function(l){return'"'.concat(l,'"')});switch(u.length){case 0:return"";case 1:return a+u[0]+"?";case 2:return a+u[0]+" or "+u[1]+"?"}var o=u.slice(0,er),s=o.pop();return a+o.join(", ")+", or "+s+"?"}function kt(e){return e}function tr(e,n){for(var t=0,i=0;t<e.length&&i<n.length;){var r=e.charCodeAt(t),a=n.charCodeAt(i);if(He(r)&&He(a)){var u=0;do++t,u=u*10+r-Fn,r=e.charCodeAt(t);while(He(r)&&u>0);var o=0;do++i,o=o*10+a-Fn,a=n.charCodeAt(i);while(He(a)&&o>0);if(u<o)return-1;if(u>o)return 1}else{if(r<a)return-1;if(r>a)return 1;++t,++i}}return e.length-n.length}var Fn=48,ir=57;function He(e){return!isNaN(e)&&Fn<=e&&e<=ir}function rr(e,n){for(var t=Object.create(null),i=new ar(e),r=Math.floor(e.length*.4)+1,a=0;a<n.length;a++){var u=n[a],o=i.measure(u,r);o!==void 0&&(t[u]=o)}return Object.keys(t).sort(function(s,l){var g=t[s]-t[l];return g!==0?g:tr(s,l)})}var ar=function(){function e(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=St(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}var n=e.prototype;return n.measure=function(i,r){if(this._input===i)return 0;var a=i.toLowerCase();if(this._inputLowerCase===a)return 1;var u=St(a),o=this._inputArray;if(u.length<o.length){var s=u;u=o,o=s}var l=u.length,g=o.length;if(!(l-g>r)){for(var E=this._rows,y=0;y<=g;y++)E[0][y]=y;for(var d=1;d<=l;d++){for(var N=E[(d-1)%3],w=E[d%3],O=w[0]=d,D=1;D<=g;D++){var P=u[d-1]===o[D-1]?0:1,L=Math.min(N[D]+1,w[D-1]+1,N[D-1]+P);if(d>1&&D>1&&u[d-1]===o[D-2]&&u[d-2]===o[D-1]){var f=E[(d-2)%3][D-2];L=Math.min(L,f+1)}L<O&&(O=L),w[D]=L}if(O>r)return}var c=E[l%3][g];return c<=r?c:void 0}},e}();function St(e){for(var n=e.length,t=new Array(n),i=0;i<n;++i)t[i]=e.charCodeAt(i);return t}function ne(e){return ht(e,{leave:sr})}var or=80,sr={Name:function(n){return n.value},Variable:function(n){return"$"+n.name},Document:function(n){return k(n.definitions,`
|
|
23
23
|
|
|
24
24
|
`)+`
|
|
25
|
-
`},OperationDefinition:function(
|
|
26
|
-
`,
|
|
25
|
+
`},OperationDefinition:function(n){var t=n.operation,i=n.name,r=B("(",k(n.variableDefinitions,", "),")"),a=k(n.directives," "),u=n.selectionSet;return!i&&!a&&!r&&t==="query"?u:k([t,k([i,r]),a,u]," ")},VariableDefinition:function(n){var t=n.variable,i=n.type,r=n.defaultValue,a=n.directives;return t+": "+i+B(" = ",r)+B(" ",k(a," "))},SelectionSet:function(n){var t=n.selections;return Y(t)},Field:function(n){var t=n.alias,i=n.name,r=n.arguments,a=n.directives,u=n.selectionSet,o=B("",t,": ")+i,s=o+B("(",k(r,", "),")");return s.length>or&&(s=o+B(`(
|
|
26
|
+
`,ze(k(r,`
|
|
27
27
|
`)),`
|
|
28
|
-
)`)),
|
|
29
|
-
`,
|
|
28
|
+
)`)),k([s,k(a," "),u]," ")},Argument:function(n){var t=n.name,i=n.value;return t+": "+i},FragmentSpread:function(n){var t=n.name,i=n.directives;return"..."+t+B(" ",k(i," "))},InlineFragment:function(n){var t=n.typeCondition,i=n.directives,r=n.selectionSet;return k(["...",B("on ",t),k(i," "),r]," ")},FragmentDefinition:function(n){var t=n.name,i=n.typeCondition,r=n.variableDefinitions,a=n.directives,u=n.selectionSet;return"fragment ".concat(t).concat(B("(",k(r,", "),")")," ")+"on ".concat(i," ").concat(B("",k(a," ")," "))+u},IntValue:function(n){var t=n.value;return t},FloatValue:function(n){var t=n.value;return t},StringValue:function(n,t){var i=n.value,r=n.block;return r?zi(i,t==="description"?"":" "):JSON.stringify(i)},BooleanValue:function(n){var t=n.value;return t?"true":"false"},NullValue:function(){return"null"},EnumValue:function(n){var t=n.value;return t},ListValue:function(n){var t=n.values;return"["+k(t,", ")+"]"},ObjectValue:function(n){var t=n.fields;return"{"+k(t,", ")+"}"},ObjectField:function(n){var t=n.name,i=n.value;return t+": "+i},Directive:function(n){var t=n.name,i=n.arguments;return"@"+t+B("(",k(i,", "),")")},NamedType:function(n){var t=n.name;return t},ListType:function(n){var t=n.type;return"["+t+"]"},NonNullType:function(n){var t=n.type;return t+"!"},SchemaDefinition:z(function(e){var n=e.directives,t=e.operationTypes;return k(["schema",k(n," "),Y(t)]," ")}),OperationTypeDefinition:function(n){var t=n.operation,i=n.type;return t+": "+i},ScalarTypeDefinition:z(function(e){var n=e.name,t=e.directives;return k(["scalar",n,k(t," ")]," ")}),ObjectTypeDefinition:z(function(e){var n=e.name,t=e.interfaces,i=e.directives,r=e.fields;return k(["type",n,B("implements ",k(t," & ")),k(i," "),Y(r)]," ")}),FieldDefinition:z(function(e){var n=e.name,t=e.arguments,i=e.type,r=e.directives;return n+(Tt(t)?B(`(
|
|
29
|
+
`,ze(k(t,`
|
|
30
30
|
`)),`
|
|
31
|
-
)`):
|
|
32
|
-
`,
|
|
31
|
+
)`):B("(",k(t,", "),")"))+": "+i+B(" ",k(r," "))}),InputValueDefinition:z(function(e){var n=e.name,t=e.type,i=e.defaultValue,r=e.directives;return k([n+": "+t,B("= ",i),k(r," ")]," ")}),InterfaceTypeDefinition:z(function(e){var n=e.name,t=e.interfaces,i=e.directives,r=e.fields;return k(["interface",n,B("implements ",k(t," & ")),k(i," "),Y(r)]," ")}),UnionTypeDefinition:z(function(e){var n=e.name,t=e.directives,i=e.types;return k(["union",n,k(t," "),i&&i.length!==0?"= "+k(i," | "):""]," ")}),EnumTypeDefinition:z(function(e){var n=e.name,t=e.directives,i=e.values;return k(["enum",n,k(t," "),Y(i)]," ")}),EnumValueDefinition:z(function(e){var n=e.name,t=e.directives;return k([n,k(t," ")]," ")}),InputObjectTypeDefinition:z(function(e){var n=e.name,t=e.directives,i=e.fields;return k(["input",n,k(t," "),Y(i)]," ")}),DirectiveDefinition:z(function(e){var n=e.name,t=e.arguments,i=e.repeatable,r=e.locations;return"directive @"+n+(Tt(t)?B(`(
|
|
32
|
+
`,ze(k(t,`
|
|
33
33
|
`)),`
|
|
34
|
-
)`):
|
|
35
|
-
`)}}function
|
|
36
|
-
`,
|
|
34
|
+
)`):B("(",k(t,", "),")"))+(i?" repeatable":"")+" on "+k(r," | ")}),SchemaExtension:function(n){var t=n.directives,i=n.operationTypes;return k(["extend schema",k(t," "),Y(i)]," ")},ScalarTypeExtension:function(n){var t=n.name,i=n.directives;return k(["extend scalar",t,k(i," ")]," ")},ObjectTypeExtension:function(n){var t=n.name,i=n.interfaces,r=n.directives,a=n.fields;return k(["extend type",t,B("implements ",k(i," & ")),k(r," "),Y(a)]," ")},InterfaceTypeExtension:function(n){var t=n.name,i=n.interfaces,r=n.directives,a=n.fields;return k(["extend interface",t,B("implements ",k(i," & ")),k(r," "),Y(a)]," ")},UnionTypeExtension:function(n){var t=n.name,i=n.directives,r=n.types;return k(["extend union",t,k(i," "),r&&r.length!==0?"= "+k(r," | "):""]," ")},EnumTypeExtension:function(n){var t=n.name,i=n.directives,r=n.values;return k(["extend enum",t,k(i," "),Y(r)]," ")},InputObjectTypeExtension:function(n){var t=n.name,i=n.directives,r=n.fields;return k(["extend input",t,k(i," "),Y(r)]," ")}};function z(e){return function(n){return k([n.description,e(n)],`
|
|
35
|
+
`)}}function k(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(n=e?.filter(function(i){return i}).join(t))!==null&&n!==void 0?n:""}function Y(e){return B(`{
|
|
36
|
+
`,ze(k(e,`
|
|
37
37
|
`)),`
|
|
38
|
-
}`)}function
|
|
39
|
-
`))}function
|
|
40
|
-
`)!==-1}function $n(e){return e!=null&&e.some(yi)}function pn(e,t){switch(e.kind){case l.NULL:return null;case l.INT:return parseInt(e.value,10);case l.FLOAT:return parseFloat(e.value);case l.STRING:case l.ENUM:case l.BOOLEAN:return e.value;case l.LIST:return e.values.map(function(n){return pn(n,t)});case l.OBJECT:return fn(e.fields,function(n){return n.name.value},function(n){return pn(n.value,t)});case l.VARIABLE:return t?.[e.name.value]}Te(0,"Unexpected value node: "+S(e))}function Yn(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function ie(e,t,n){return t&&Yn(e.prototype,t),n&&Yn(e,n),e}function zn(e){return Ne(e)||q(e)||V(e)||z(e)||X(e)||ee(e)||ke(e)||re(e)}function gi(e){if(!zn(e))throw new Error("Expected ".concat(S(e)," to be a GraphQL type."));return e}function Ne(e){return J(e,ne)}function q(e){return J(e,H)}function V(e){return J(e,Zn)}function z(e){return J(e,et)}function X(e){return J(e,Ge)}function ee(e){return J(e,nt)}function ke(e){return J(e,D)}function re(e){return J(e,h)}function ae(e){return Ne(e)||X(e)||ee(e)||mn(e)&&ae(e.ofType)}function Be(e){return Ne(e)||q(e)||V(e)||z(e)||X(e)||mn(e)&&Be(e.ofType)}function Ti(e){return Ne(e)||X(e)}function vn(e){return q(e)||V(e)||z(e)}function Si(e){return V(e)||z(e)}function D(e){if(this instanceof D)this.ofType=gi(e);else return new D(e)}D.prototype.toString=function(){return"["+String(this.ofType)+"]"},D.prototype.toJSON=function(){return this.toString()},Object.defineProperty(D.prototype,U,{get:function(){return"GraphQLList"}}),B(D);function h(e){if(this instanceof h)this.ofType=ki(e);else return new h(e)}h.prototype.toString=function(){return String(this.ofType)+"!"},h.prototype.toJSON=function(){return this.toString()},Object.defineProperty(h.prototype,U,{get:function(){return"GraphQLNonNull"}}),B(h);function mn(e){return ke(e)||re(e)}function Ni(e){return zn(e)&&!re(e)}function ki(e){if(!Ni(e))throw new Error("Expected ".concat(S(e)," to be a GraphQL nullable type."));return e}function Ei(e){if(e)return re(e)?e.ofType:e}function Ee(e){if(e){for(var t=e;mn(t);)t=t.ofType;return t}}function Pe(e){return typeof e=="function"?e():e}function oe(e){return e&&e.length>0?e:void 0}var ne=function(){function e(n){var i,r,a,s=(i=n.parseValue)!==null&&i!==void 0?i:qn;this.name=n.name,this.description=n.description,this.specifiedByUrl=n.specifiedByUrl,this.serialize=(r=n.serialize)!==null&&r!==void 0?r:qn,this.parseValue=s,this.parseLiteral=(a=n.parseLiteral)!==null&&a!==void 0?a:function(o,u){return s(pn(o,u))},this.extensions=n.extensions&&x(n.extensions),this.astNode=n.astNode,this.extensionASTNodes=oe(n.extensionASTNodes),typeof n.name=="string"||g(0,"Must provide name."),n.specifiedByUrl==null||typeof n.specifiedByUrl=="string"||g(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat(S(n.specifiedByUrl),".")),n.serialize==null||typeof n.serialize=="function"||g(0,"".concat(this.name,' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.')),n.parseLiteral&&(typeof n.parseValue=="function"&&typeof n.parseLiteral=="function"||g(0,"".concat(this.name,' must provide both "parseValue" and "parseLiteral" functions.')))}var t=e.prototype;return t.toConfig=function(){var i;return{name:this.name,description:this.description,specifiedByUrl:this.specifiedByUrl,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},ie(e,[{key:U,get:function(){return"GraphQLScalarType"}}]),e}();B(ne);var H=function(){function e(n){this.name=n.name,this.description=n.description,this.isTypeOf=n.isTypeOf,this.extensions=n.extensions&&x(n.extensions),this.astNode=n.astNode,this.extensionASTNodes=oe(n.extensionASTNodes),this._fields=Hn.bind(void 0,n),this._interfaces=Xn.bind(void 0,n),typeof n.name=="string"||g(0,"Must provide name."),n.isTypeOf==null||typeof n.isTypeOf=="function"||g(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat(S(n.isTypeOf),"."))}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},t.toConfig=function(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Kn(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes||[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},ie(e,[{key:U,get:function(){return"GraphQLObjectType"}}]),e}();B(H);function Xn(e){var t,n=(t=Pe(e.interfaces))!==null&&t!==void 0?t:[];return Array.isArray(n)||g(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),n}function Hn(e){var t=Pe(e.fields);return se(t)||g(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),Ue(t,function(n,i){var r;se(n)||g(0,"".concat(e.name,".").concat(i," field config must be an object.")),!("isDeprecated"in n)||g(0,"".concat(e.name,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),n.resolve==null||typeof n.resolve=="function"||g(0,"".concat(e.name,".").concat(i," field resolver must be a function if ")+"provided, but got: ".concat(S(n.resolve),"."));var a=(r=n.args)!==null&&r!==void 0?r:{};se(a)||g(0,"".concat(e.name,".").concat(i," args must be an object with argument names as keys."));var s=Se(a).map(function(o){var u=o[0],c=o[1];return{name:u,description:c.description,type:c.type,defaultValue:c.defaultValue,deprecationReason:c.deprecationReason,extensions:c.extensions&&x(c.extensions),astNode:c.astNode}});return{name:i,description:n.description,type:n.type,args:s,resolve:n.resolve,subscribe:n.subscribe,isDeprecated:n.deprecationReason!=null,deprecationReason:n.deprecationReason,extensions:n.extensions&&x(n.extensions),astNode:n.astNode}})}function se(e){return W(e)&&!Array.isArray(e)}function Kn(e){return Ue(e,function(t){return{description:t.description,type:t.type,args:Wn(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}})}function Wn(e){return fn(e,function(t){return t.name},function(t){return{description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}})}var Zn=function(){function e(n){this.name=n.name,this.description=n.description,this.resolveType=n.resolveType,this.extensions=n.extensions&&x(n.extensions),this.astNode=n.astNode,this.extensionASTNodes=oe(n.extensionASTNodes),this._fields=Hn.bind(void 0,n),this._interfaces=Xn.bind(void 0,n),typeof n.name=="string"||g(0,"Must provide name."),n.resolveType==null||typeof n.resolveType=="function"||g(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(S(n.resolveType),"."))}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},t.toConfig=function(){var i;return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Kn(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},ie(e,[{key:U,get:function(){return"GraphQLInterfaceType"}}]),e}();B(Zn);var et=function(){function e(n){this.name=n.name,this.description=n.description,this.resolveType=n.resolveType,this.extensions=n.extensions&&x(n.extensions),this.astNode=n.astNode,this.extensionASTNodes=oe(n.extensionASTNodes),this._types=Ii.bind(void 0,n),typeof n.name=="string"||g(0,"Must provide name."),n.resolveType==null||typeof n.resolveType=="function"||g(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(S(n.resolveType),"."))}var t=e.prototype;return t.getTypes=function(){return typeof this._types=="function"&&(this._types=this._types()),this._types},t.toConfig=function(){var i;return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},ie(e,[{key:U,get:function(){return"GraphQLUnionType"}}]),e}();B(et);function Ii(e){var t=Pe(e.types);return Array.isArray(t)||g(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),t}var Ge=function(){function e(n){this.name=n.name,this.description=n.description,this.extensions=n.extensions&&x(n.extensions),this.astNode=n.astNode,this.extensionASTNodes=oe(n.extensionASTNodes),this._values=bi(this.name,n.values),this._valueLookup=new Map(this._values.map(function(i){return[i.value,i]})),this._nameLookup=Qn(this._values,function(i){return i.name}),typeof n.name=="string"||g(0,"Must provide name.")}var t=e.prototype;return t.getValues=function(){return this._values},t.getValue=function(i){return this._nameLookup[i]},t.serialize=function(i){var r=this._valueLookup.get(i);if(r===void 0)throw new b('Enum "'.concat(this.name,'" cannot represent value: ').concat(S(i)));return r.name},t.parseValue=function(i){if(typeof i!="string"){var r=S(i);throw new b('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(r,".")+je(this,r))}var a=this.getValue(i);if(a==null)throw new b('Value "'.concat(i,'" does not exist in "').concat(this.name,'" enum.')+je(this,i));return a.value},t.parseLiteral=function(i,r){if(i.kind!==l.ENUM){var a=$(i);throw new b('Enum "'.concat(this.name,'" cannot represent non-enum value: ').concat(a,".")+je(this,a),i)}var s=this.getValue(i.value);if(s==null){var o=$(i);throw new b('Value "'.concat(o,'" does not exist in "').concat(this.name,'" enum.')+je(this,o),i)}return s.value},t.toConfig=function(){var i,r=fn(this.getValues(),function(a){return a.name},function(a){return{description:a.description,value:a.value,deprecationReason:a.deprecationReason,extensions:a.extensions,astNode:a.astNode}});return{name:this.name,description:this.description,values:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},ie(e,[{key:U,get:function(){return"GraphQLEnumType"}}]),e}();B(Ge);function je(e,t){var n=e.getValues().map(function(r){return r.name}),i=pi(t,n);return li("the enum value",i)}function bi(e,t){return se(t)||g(0,"".concat(e," values must be an object with value names as keys.")),Se(t).map(function(n){var i=n[0],r=n[1];return se(r)||g(0,"".concat(e,".").concat(i,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat(S(r),".")),!("isDeprecated"in r)||g(0,"".concat(e,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),{name:i,description:r.description,value:r.value!==void 0?r.value:i,isDeprecated:r.deprecationReason!=null,deprecationReason:r.deprecationReason,extensions:r.extensions&&x(r.extensions),astNode:r.astNode}})}var nt=function(){function e(n){this.name=n.name,this.description=n.description,this.extensions=n.extensions&&x(n.extensions),this.astNode=n.astNode,this.extensionASTNodes=oe(n.extensionASTNodes),this._fields=Ai.bind(void 0,n),typeof n.name=="string"||g(0,"Must provide name.")}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.toConfig=function(){var i,r=Ue(this.getFields(),function(a){return{description:a.description,type:a.type,defaultValue:a.defaultValue,deprecationReason:a.deprecationReason,extensions:a.extensions,astNode:a.astNode}});return{name:this.name,description:this.description,fields:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},ie(e,[{key:U,get:function(){return"GraphQLInputObjectType"}}]),e}();B(nt);function Ai(e){var t=Pe(e.fields);return se(t)||g(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),Ue(t,function(n,i){return!("resolve"in n)||g(0,"".concat(e.name,".").concat(i," field has a resolve property, but Input Types cannot define resolvers.")),{name:i,description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions&&x(n.extensions),astNode:n.astNode}})}var Oi=Array.from||function(e,t,n){if(e==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");var i=e[_n];if(typeof i=="function"){for(var r=i.call(e),a=[],s,o=0;!(s=r.next()).done;++o)if(a.push(t.call(n,s.value,o)),o>9999999)throw new TypeError("Near-infinite iteration.");return a}var u=e.length;if(typeof u=="number"&&u>=0&&u%1===0){for(var c=[],p=0;p<u;++p)Object.prototype.hasOwnProperty.call(e,p)&&c.push(t.call(n,e[p],p));return c}return[]},Di=Oi,wi=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},Ie=wi;function Ce(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ce=function(n){return typeof n}:Ce=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ce(e)}function Fi(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(p){return p};if(e==null||Ce(e)!=="object")return null;if(Array.isArray(e))return e.map(t);var n=e[_n];if(typeof n=="function"){for(var i=n.call(e),r=[],a,s=0;!(a=i.next()).done;++s)r.push(t(a.value,s));return r}var o=e.length;if(typeof o=="number"&&o>=0&&o%1===0){for(var u=[],c=0;c<o;++c){if(!Object.prototype.hasOwnProperty.call(e,c))return null;u.push(t(e[String(c)],c))}return u}return null}var _i=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},Qe=_i,hn=2147483647,yn=-2147483648;function Li(e){var t=be(e);if(typeof t=="boolean")return t?1:0;var n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),!Qe(n))throw new b("Int cannot represent non-integer value: ".concat(S(t)));if(n>hn||n<yn)throw new b("Int cannot represent non 32-bit signed integer value: "+S(t));return n}function Ri(e){if(!Qe(e))throw new b("Int cannot represent non-integer value: ".concat(S(e)));if(e>hn||e<yn)throw new b("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var xi=new ne({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize:Li,parseValue:Ri,parseLiteral:function(t){if(t.kind!==l.INT)throw new b("Int cannot represent non-integer value: ".concat($(t)),t);var n=parseInt(t.value,10);if(n>hn||n<yn)throw new b("Int cannot represent non 32-bit signed integer value: ".concat(t.value),t);return n}});function Ui(e){var t=be(e);if(typeof t=="boolean")return t?1:0;var n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),!Ie(n))throw new b("Float cannot represent non numeric value: ".concat(S(t)));return n}function Vi(e){if(!Ie(e))throw new b("Float cannot represent non numeric value: ".concat(S(e)));return e}var Mi=new ne({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize:Ui,parseValue:Vi,parseLiteral:function(t){if(t.kind!==l.FLOAT&&t.kind!==l.INT)throw new b("Float cannot represent non numeric value: ".concat($(t)),t);return parseFloat(t.value)}});function be(e){if(W(e)){if(typeof e.valueOf=="function"){var t=e.valueOf();if(!W(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function Bi(e){var t=be(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(Ie(t))return t.toString();throw new b("String cannot represent value: ".concat(S(e)))}function Pi(e){if(typeof e!="string")throw new b("String cannot represent a non string value: ".concat(S(e)));return e}var O=new ne({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize:Bi,parseValue:Pi,parseLiteral:function(t){if(t.kind!==l.STRING)throw new b("String cannot represent a non string value: ".concat($(t)),t);return t.value}});function Gi(e){var t=be(e);if(typeof t=="boolean")return t;if(Ie(t))return t!==0;throw new b("Boolean cannot represent a non boolean value: ".concat(S(t)))}function ji(e){if(typeof e!="boolean")throw new b("Boolean cannot represent a non boolean value: ".concat(S(e)));return e}var M=new ne({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:Gi,parseValue:ji,parseLiteral:function(t){if(t.kind!==l.BOOLEAN)throw new b("Boolean cannot represent a non boolean value: ".concat($(t)),t);return t.value}});function Ci(e){var t=be(e);if(typeof t=="string")return t;if(Qe(t))return String(t);throw new b("ID cannot represent value: ".concat(S(e)))}function Qi(e){if(typeof e=="string")return e;if(Qe(e))return e.toString();throw new b("ID cannot represent value: ".concat(S(e)))}var tt=new ne({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize:Ci,parseValue:Qi,parseLiteral:function(t){if(t.kind!==l.STRING&&t.kind!==l.INT)throw new b("ID cannot represent a non-string and non-integer value: "+$(t),t);return t.value}}),it=Object.freeze([O,xi,Mi,M,tt]);function Ae(e,t){if(re(t)){var n=Ae(e,t.ofType);return n?.kind===l.NULL?null:n}if(e===null)return{kind:l.NULL};if(e===void 0)return null;if(ke(t)){var i=t.ofType,r=Fi(e);if(r!=null){for(var a=[],s=0;s<r.length;s++){var o=r[s],u=Ae(o,i);u!=null&&a.push(u)}return{kind:l.LIST,values:a}}return Ae(e,i)}if(ee(t)){if(!W(e))return null;for(var c=[],p=0,m=Z(t.getFields());p<m.length;p++){var y=m[p],d=Ae(e[y.name],y.type);d&&c.push({kind:l.OBJECT_FIELD,name:{kind:l.NAME,value:y.name},value:d})}return{kind:l.OBJECT,fields:c}}if(Ti(t)){var v=t.serialize(e);if(v==null)return null;if(typeof v=="boolean")return{kind:l.BOOLEAN,value:v};if(typeof v=="number"&&Ie(v)){var T=String(v);return rt.test(T)?{kind:l.INT,value:T}:{kind:l.FLOAT,value:T}}if(typeof v=="string")return X(t)?{kind:l.ENUM,value:v}:t===tt&&rt.test(v)?{kind:l.INT,value:v}:{kind:l.STRING,value:v};throw new TypeError("Cannot convert value to AST: ".concat(S(v),"."))}Te(0,"Unexpected input type: "+S(t))}var rt=/^-?(?:0|[1-9][0-9]*)$/,gn=new H({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:function(){return{description:{type:O,resolve:function(n){return n.description}},types:{description:"A list of all types supported by this server.",type:new h(new D(new h(j))),resolve:function(n){return Z(n.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new h(j),resolve:function(n){return n.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:j,resolve:function(n){return n.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:j,resolve:function(n){return n.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new h(new D(new h(at))),resolve:function(n){return n.getDirectives()}}}}}),at=new H({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
38
|
+
}`)}function B(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return n!=null&&n!==""?e+n+t:""}function ze(e){return B(" ",e.replace(/\n/g,`
|
|
39
|
+
`))}function ur(e){return e.indexOf(`
|
|
40
|
+
`)!==-1}function Tt(e){return e!=null&&e.some(ur)}function Ln(e,n){switch(e.kind){case h.NULL:return null;case h.INT:return parseInt(e.value,10);case h.FLOAT:return parseFloat(e.value);case h.STRING:case h.ENUM:case h.BOOLEAN:return e.value;case h.LIST:return e.values.map(function(t){return Ln(t,n)});case h.OBJECT:return _n(e.fields,function(t){return t.name.value},function(t){return Ln(t.value,n)});case h.VARIABLE:return n?.[e.name.value]}Oe(0,"Unexpected value node: "+F(e))}function Nt(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function fe(e,n,t){return n&&Nt(e.prototype,n),t&&Nt(e,t),e}function bt(e){return Fe(e)||W(e)||$(e)||te(e)||ie(e)||ue(e)||Le(e)||de(e)}function cr(e){if(!bt(e))throw new Error("Expected ".concat(F(e)," to be a GraphQL type."));return e}function Fe(e){return ee(e,ce)}function W(e){return ee(e,re)}function $(e){return ee(e,Dt)}function te(e){return ee(e,Ot)}function ie(e){return ee(e,Ke)}function ue(e){return ee(e,_t)}function Le(e){return ee(e,q)}function de(e){return ee(e,I)}function ve(e){return Fe(e)||ie(e)||ue(e)||Pn(e)&&ve(e.ofType)}function Ye(e){return Fe(e)||W(e)||$(e)||te(e)||ie(e)||Pn(e)&&Ye(e.ofType)}function lr(e){return Fe(e)||ie(e)}function Rn(e){return W(e)||$(e)||te(e)}function fr(e){return $(e)||te(e)}function q(e){if(this instanceof q)this.ofType=cr(e);else return new q(e)}q.prototype.toString=function(){return"["+String(this.ofType)+"]"},q.prototype.toJSON=function(){return this.toString()},Object.defineProperty(q.prototype,G,{get:function(){return"GraphQLList"}}),H(q);function I(e){if(this instanceof I)this.ofType=vr(e);else return new I(e)}I.prototype.toString=function(){return String(this.ofType)+"!"},I.prototype.toJSON=function(){return this.toString()},Object.defineProperty(I.prototype,G,{get:function(){return"GraphQLNonNull"}}),H(I);function Pn(e){return Le(e)||de(e)}function dr(e){return bt(e)&&!de(e)}function vr(e){if(!dr(e))throw new Error("Expected ".concat(F(e)," to be a GraphQL nullable type."));return e}function pr(e){if(e)return de(e)?e.ofType:e}function Re(e){if(e){for(var n=e;Pn(n);)n=n.ofType;return n}}function Xe(e){return typeof e=="function"?e():e}function pe(e){return e&&e.length>0?e:void 0}var ce=function(){function e(t){var i,r,a,u=(i=t.parseValue)!==null&&i!==void 0?i:kt;this.name=t.name,this.description=t.description,this.specifiedByUrl=t.specifiedByUrl,this.serialize=(r=t.serialize)!==null&&r!==void 0?r:kt,this.parseValue=u,this.parseLiteral=(a=t.parseLiteral)!==null&&a!==void 0?a:function(o,s){return u(Ln(o,s))},this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),typeof t.name=="string"||_(0,"Must provide name."),t.specifiedByUrl==null||typeof t.specifiedByUrl=="string"||_(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat(F(t.specifiedByUrl),".")),t.serialize==null||typeof t.serialize=="function"||_(0,"".concat(this.name,' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.')),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||_(0,"".concat(this.name,' must provide both "parseValue" and "parseLiteral" functions.')))}var n=e.prototype;return n.toConfig=function(){var i;return{name:this.name,description:this.description,specifiedByUrl:this.specifiedByUrl,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLScalarType"}}]),e}();H(ce);var re=function(){function e(t){this.name=t.name,this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._fields=It.bind(void 0,t),this._interfaces=Et.bind(void 0,t),typeof t.name=="string"||_(0,"Must provide name."),t.isTypeOf==null||typeof t.isTypeOf=="function"||_(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat(F(t.isTypeOf),"."))}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},n.toConfig=function(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:wt(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes||[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLObjectType"}}]),e}();H(re);function Et(e){var n,t=(n=Xe(e.interfaces))!==null&&n!==void 0?n:[];return Array.isArray(t)||_(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),t}function It(e){var n=Xe(e.fields);return me(n)||_(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),Je(n,function(t,i){var r;me(t)||_(0,"".concat(e.name,".").concat(i," field config must be an object.")),!("isDeprecated"in t)||_(0,"".concat(e.name,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),t.resolve==null||typeof t.resolve=="function"||_(0,"".concat(e.name,".").concat(i," field resolver must be a function if ")+"provided, but got: ".concat(F(t.resolve),"."));var a=(r=t.args)!==null&&r!==void 0?r:{};me(a)||_(0,"".concat(e.name,".").concat(i," args must be an object with argument names as keys."));var u=_e(a).map(function(o){var s=o[0],l=o[1];return{name:s,description:l.description,type:l.type,defaultValue:l.defaultValue,deprecationReason:l.deprecationReason,extensions:l.extensions&&j(l.extensions),astNode:l.astNode}});return{name:i,description:t.description,type:t.type,args:u,resolve:t.resolve,subscribe:t.subscribe,isDeprecated:t.deprecationReason!=null,deprecationReason:t.deprecationReason,extensions:t.extensions&&j(t.extensions),astNode:t.astNode}})}function me(e){return oe(e)&&!Array.isArray(e)}function wt(e){return Je(e,function(n){return{description:n.description,type:n.type,args:At(n.args),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}})}function At(e){return _n(e,function(n){return n.name},function(n){return{description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}})}var Dt=function(){function e(t){this.name=t.name,this.description=t.description,this.resolveType=t.resolveType,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._fields=It.bind(void 0,t),this._interfaces=Et.bind(void 0,t),typeof t.name=="string"||_(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||_(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(F(t.resolveType),"."))}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},n.toConfig=function(){var i;return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:wt(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLInterfaceType"}}]),e}();H(Dt);var Ot=function(){function e(t){this.name=t.name,this.description=t.description,this.resolveType=t.resolveType,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._types=mr.bind(void 0,t),typeof t.name=="string"||_(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||_(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(F(t.resolveType),"."))}var n=e.prototype;return n.getTypes=function(){return typeof this._types=="function"&&(this._types=this._types()),this._types},n.toConfig=function(){var i;return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLUnionType"}}]),e}();H(Ot);function mr(e){var n=Xe(e.types);return Array.isArray(n)||_(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),n}var Ke=function(){function e(t){this.name=t.name,this.description=t.description,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._values=hr(this.name,t.values),this._valueLookup=new Map(this._values.map(function(i){return[i.value,i]})),this._nameLookup=gt(this._values,function(i){return i.name}),typeof t.name=="string"||_(0,"Must provide name.")}var n=e.prototype;return n.getValues=function(){return this._values},n.getValue=function(i){return this._nameLookup[i]},n.serialize=function(i){var r=this._valueLookup.get(i);if(r===void 0)throw new U('Enum "'.concat(this.name,'" cannot represent value: ').concat(F(i)));return r.name},n.parseValue=function(i){if(typeof i!="string"){var r=F(i);throw new U('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(r,".")+We(this,r))}var a=this.getValue(i);if(a==null)throw new U('Value "'.concat(i,'" does not exist in "').concat(this.name,'" enum.')+We(this,i));return a.value},n.parseLiteral=function(i,r){if(i.kind!==h.ENUM){var a=ne(i);throw new U('Enum "'.concat(this.name,'" cannot represent non-enum value: ').concat(a,".")+We(this,a),i)}var u=this.getValue(i.value);if(u==null){var o=ne(i);throw new U('Value "'.concat(o,'" does not exist in "').concat(this.name,'" enum.')+We(this,o),i)}return u.value},n.toConfig=function(){var i,r=_n(this.getValues(),function(a){return a.name},function(a){return{description:a.description,value:a.value,deprecationReason:a.deprecationReason,extensions:a.extensions,astNode:a.astNode}});return{name:this.name,description:this.description,values:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLEnumType"}}]),e}();H(Ke);function We(e,n){var t=e.getValues().map(function(r){return r.name}),i=rr(n,t);return nr("the enum value",i)}function hr(e,n){return me(n)||_(0,"".concat(e," values must be an object with value names as keys.")),_e(n).map(function(t){var i=t[0],r=t[1];return me(r)||_(0,"".concat(e,".").concat(i,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat(F(r),".")),!("isDeprecated"in r)||_(0,"".concat(e,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),{name:i,description:r.description,value:r.value!==void 0?r.value:i,isDeprecated:r.deprecationReason!=null,deprecationReason:r.deprecationReason,extensions:r.extensions&&j(r.extensions),astNode:r.astNode}})}var _t=function(){function e(t){this.name=t.name,this.description=t.description,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._fields=yr.bind(void 0,t),typeof t.name=="string"||_(0,"Must provide name.")}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.toConfig=function(){var i,r=Je(this.getFields(),function(a){return{description:a.description,type:a.type,defaultValue:a.defaultValue,deprecationReason:a.deprecationReason,extensions:a.extensions,astNode:a.astNode}});return{name:this.name,description:this.description,fields:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLInputObjectType"}}]),e}();H(_t);function yr(e){var n=Xe(e.fields);return me(n)||_(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),Je(n,function(t,i){return!("resolve"in t)||_(0,"".concat(e.name,".").concat(i," field has a resolve property, but Input Types cannot define resolvers.")),{name:i,description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions&&j(t.extensions),astNode:t.astNode}})}var gr=Array.from||function(e,n,t){if(e==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");var i=e[ot];if(typeof i=="function"){for(var r=i.call(e),a=[],u,o=0;!(u=r.next()).done;++o)if(a.push(n.call(t,u.value,o)),o>9999999)throw new TypeError("Near-infinite iteration.");return a}var s=e.length;if(typeof s=="number"&&s>=0&&s%1===0){for(var l=[],g=0;g<s;++g)Object.prototype.hasOwnProperty.call(e,g)&&l.push(n.call(t,e[g],g));return l}return[]},kr=gr,Sr=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},Pe=Sr;function Ze(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ze=function(t){return typeof t}:Ze=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ze(e)}function Tr(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(g){return g};if(e==null||Ze(e)!=="object")return null;if(Array.isArray(e))return e.map(n);var t=e[ot];if(typeof t=="function"){for(var i=t.call(e),r=[],a,u=0;!(a=i.next()).done;++u)r.push(n(a.value,u));return r}var o=e.length;if(typeof o=="number"&&o>=0&&o%1===0){for(var s=[],l=0;l<o;++l){if(!Object.prototype.hasOwnProperty.call(e,l))return null;s.push(n(e[String(l)],l))}return s}return null}var Nr=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},en=Nr,Un=2147483647,Bn=-2147483648;function br(e){var n=Ue(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!en(t))throw new U("Int cannot represent non-integer value: ".concat(F(n)));if(t>Un||t<Bn)throw new U("Int cannot represent non 32-bit signed integer value: "+F(n));return t}function Er(e){if(!en(e))throw new U("Int cannot represent non-integer value: ".concat(F(e)));if(e>Un||e<Bn)throw new U("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var Ir=new ce({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize:br,parseValue:Er,parseLiteral:function(n){if(n.kind!==h.INT)throw new U("Int cannot represent non-integer value: ".concat(ne(n)),n);var t=parseInt(n.value,10);if(t>Un||t<Bn)throw new U("Int cannot represent non 32-bit signed integer value: ".concat(n.value),n);return t}});function wr(e){var n=Ue(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!Pe(t))throw new U("Float cannot represent non numeric value: ".concat(F(n)));return t}function Ar(e){if(!Pe(e))throw new U("Float cannot represent non numeric value: ".concat(F(e)));return e}var Dr=new ce({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize:wr,parseValue:Ar,parseLiteral:function(n){if(n.kind!==h.FLOAT&&n.kind!==h.INT)throw new U("Float cannot represent non numeric value: ".concat(ne(n)),n);return parseFloat(n.value)}});function Ue(e){if(oe(e)){if(typeof e.valueOf=="function"){var n=e.valueOf();if(!oe(n))return n}if(typeof e.toJSON=="function")return e.toJSON()}return e}function Or(e){var n=Ue(e);if(typeof n=="string")return n;if(typeof n=="boolean")return n?"true":"false";if(Pe(n))return n.toString();throw new U("String cannot represent value: ".concat(F(e)))}function _r(e){if(typeof e!="string")throw new U("String cannot represent a non string value: ".concat(F(e)));return e}var V=new ce({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize:Or,parseValue:_r,parseLiteral:function(n){if(n.kind!==h.STRING)throw new U("String cannot represent a non string value: ".concat(ne(n)),n);return n.value}});function Fr(e){var n=Ue(e);if(typeof n=="boolean")return n;if(Pe(n))return n!==0;throw new U("Boolean cannot represent a non boolean value: ".concat(F(n)))}function Lr(e){if(typeof e!="boolean")throw new U("Boolean cannot represent a non boolean value: ".concat(F(e)));return e}var Q=new ce({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:Fr,parseValue:Lr,parseLiteral:function(n){if(n.kind!==h.BOOLEAN)throw new U("Boolean cannot represent a non boolean value: ".concat(ne(n)),n);return n.value}});function Rr(e){var n=Ue(e);if(typeof n=="string")return n;if(en(n))return String(n);throw new U("ID cannot represent value: ".concat(F(e)))}function Pr(e){if(typeof e=="string")return e;if(en(e))return e.toString();throw new U("ID cannot represent value: ".concat(F(e)))}var Ft=new ce({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize:Rr,parseValue:Pr,parseLiteral:function(n){if(n.kind!==h.STRING&&n.kind!==h.INT)throw new U("ID cannot represent a non-string and non-integer value: "+ne(n),n);return n.value}}),Lt=Object.freeze([V,Ir,Dr,Q,Ft]);function Be(e,n){if(de(n)){var t=Be(e,n.ofType);return t?.kind===h.NULL?null:t}if(e===null)return{kind:h.NULL};if(e===void 0)return null;if(Le(n)){var i=n.ofType,r=Tr(e);if(r!=null){for(var a=[],u=0;u<r.length;u++){var o=r[u],s=Be(o,i);s!=null&&a.push(s)}return{kind:h.LIST,values:a}}return Be(e,i)}if(ue(n)){if(!oe(e))return null;for(var l=[],g=0,E=se(n.getFields());g<E.length;g++){var y=E[g],d=Be(e[y.name],y.type);d&&l.push({kind:h.OBJECT_FIELD,name:{kind:h.NAME,value:y.name},value:d})}return{kind:h.OBJECT,fields:l}}if(lr(n)){var N=n.serialize(e);if(N==null)return null;if(typeof N=="boolean")return{kind:h.BOOLEAN,value:N};if(typeof N=="number"&&Pe(N)){var w=String(N);return Rt.test(w)?{kind:h.INT,value:w}:{kind:h.FLOAT,value:w}}if(typeof N=="string")return ie(n)?{kind:h.ENUM,value:N}:n===Ft&&Rt.test(N)?{kind:h.INT,value:N}:{kind:h.STRING,value:N};throw new TypeError("Cannot convert value to AST: ".concat(F(N),"."))}Oe(0,"Unexpected input type: "+F(n))}var Rt=/^-?(?:0|[1-9][0-9]*)$/,Vn=new re({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:function(){return{description:{type:V,resolve:function(t){return t.description}},types:{description:"A list of all types supported by this server.",type:new I(new q(new I(X))),resolve:function(t){return se(t.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new I(X),resolve:function(t){return t.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:X,resolve:function(t){return t.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:X,resolve:function(t){return t.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new I(new q(new I(Pt))),resolve:function(t){return t.getDirectives()}}}}}),Pt=new re({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
41
41
|
|
|
42
|
-
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:function(){return{name:{type:new h(O),resolve:function(n){return n.name}},description:{type:O,resolve:function(n){return n.description}},isRepeatable:{type:new h(M),resolve:function(n){return n.isRepeatable}},locations:{type:new h(new D(new h(ot))),resolve:function(n){return n.locations}},args:{type:new h(new D(new h(qe))),args:{includeDeprecated:{type:M,defaultValue:!1}},resolve:function(n,i){var r=i.includeDeprecated;return r?n.args:n.args.filter(function(a){return a.deprecationReason==null})}}}}}),ot=new Ge({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:k.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:k.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:k.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:k.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:k.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:k.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:k.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:k.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:k.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:k.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:k.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:k.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:k.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:k.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:k.UNION,description:"Location adjacent to a union definition."},ENUM:{value:k.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:k.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:k.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:k.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),j=new H({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByUrl`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:function(){return{kind:{type:new h(ct),resolve:function(n){if(Ne(n))return F.SCALAR;if(q(n))return F.OBJECT;if(V(n))return F.INTERFACE;if(z(n))return F.UNION;if(X(n))return F.ENUM;if(ee(n))return F.INPUT_OBJECT;if(ke(n))return F.LIST;if(re(n))return F.NON_NULL;Te(0,'Unexpected type: "'.concat(S(n),'".'))}},name:{type:O,resolve:function(n){return n.name!==void 0?n.name:void 0}},description:{type:O,resolve:function(n){return n.description!==void 0?n.description:void 0}},specifiedByUrl:{type:O,resolve:function(n){return n.specifiedByUrl!==void 0?n.specifiedByUrl:void 0}},fields:{type:new D(new h(st)),args:{includeDeprecated:{type:M,defaultValue:!1}},resolve:function(n,i){var r=i.includeDeprecated;if(q(n)||V(n)){var a=Z(n.getFields());return r?a:a.filter(function(s){return s.deprecationReason==null})}}},interfaces:{type:new D(new h(j)),resolve:function(n){if(q(n)||V(n))return n.getInterfaces()}},possibleTypes:{type:new D(new h(j)),resolve:function(n,i,r,a){var s=a.schema;if(Si(n))return s.getPossibleTypes(n)}},enumValues:{type:new D(new h(ut)),args:{includeDeprecated:{type:M,defaultValue:!1}},resolve:function(n,i){var r=i.includeDeprecated;if(X(n)){var a=n.getValues();return r?a:a.filter(function(s){return s.deprecationReason==null})}}},inputFields:{type:new D(new h(qe)),args:{includeDeprecated:{type:M,defaultValue:!1}},resolve:function(n,i){var r=i.includeDeprecated;if(ee(n)){var a=Z(n.getFields());return r?a:a.filter(function(s){return s.deprecationReason==null})}}},ofType:{type:j,resolve:function(n){return n.ofType!==void 0?n.ofType:void 0}}}}}),st=new H({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:function(){return{name:{type:new h(O),resolve:function(n){return n.name}},description:{type:O,resolve:function(n){return n.description}},args:{type:new h(new D(new h(qe))),args:{includeDeprecated:{type:M,defaultValue:!1}},resolve:function(n,i){var r=i.includeDeprecated;return r?n.args:n.args.filter(function(a){return a.deprecationReason==null})}},type:{type:new h(j),resolve:function(n){return n.type}},isDeprecated:{type:new h(M),resolve:function(n){return n.deprecationReason!=null}},deprecationReason:{type:O,resolve:function(n){return n.deprecationReason}}}}}),qe=new H({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:function(){return{name:{type:new h(O),resolve:function(n){return n.name}},description:{type:O,resolve:function(n){return n.description}},type:{type:new h(j),resolve:function(n){return n.type}},defaultValue:{type:O,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(n){var i=n.type,r=n.defaultValue,a=Ae(r,i);return a?$(a):null}},isDeprecated:{type:new h(M),resolve:function(n){return n.deprecationReason!=null}},deprecationReason:{type:O,resolve:function(n){return n.deprecationReason}}}}}),ut=new H({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:function(){return{name:{type:new h(O),resolve:function(n){return n.name}},description:{type:O,resolve:function(n){return n.description}},isDeprecated:{type:new h(M),resolve:function(n){return n.deprecationReason!=null}},deprecationReason:{type:O,resolve:function(n){return n.deprecationReason}}}}}),F=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"}),ct=new Ge({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:F.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:F.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:F.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:F.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:F.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:F.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:F.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:F.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),lt={name:"__schema",type:new h(gn),description:"Access the current type schema of this server.",args:[],resolve:function(t,n,i,r){var a=r.schema;return a},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},ft={name:"__type",type:j,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new h(O),defaultValue:void 0,deprecationReason:void 0,extensions:void 0,astNode:void 0}],resolve:function(t,n,i,r){var a=n.name,s=r.schema;return s.getType(a)},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},dt={name:"__typename",type:new h(O),description:"The name of the current Object type at runtime.",args:[],resolve:function(t,n,i,r){var a=r.parentType;return a.name},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},pt=Object.freeze([gn,at,ot,j,st,qe,ut,ct]);function vt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function qi(e,t,n){return t&&vt(e.prototype,t),n&&vt(e,n),e}function Ji(e){return J(e,ue)}var ue=function(){function e(n){var i,r;this.name=n.name,this.description=n.description,this.locations=n.locations,this.isRepeatable=(i=n.isRepeatable)!==null&&i!==void 0?i:!1,this.extensions=n.extensions&&x(n.extensions),this.astNode=n.astNode,n.name||g(0,"Directive must be named."),Array.isArray(n.locations)||g(0,"@".concat(n.name," locations must be an Array."));var a=(r=n.args)!==null&&r!==void 0?r:{};W(a)&&!Array.isArray(a)||g(0,"@".concat(n.name," args must be an object with argument names as keys.")),this.args=Se(a).map(function(s){var o=s[0],u=s[1];return{name:o,description:u.description,type:u.type,defaultValue:u.defaultValue,deprecationReason:u.deprecationReason,extensions:u.extensions&&x(u.extensions),astNode:u.astNode}})}var t=e.prototype;return t.toConfig=function(){return{name:this.name,description:this.description,locations:this.locations,args:Wn(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},t.toString=function(){return"@"+this.name},t.toJSON=function(){return this.toString()},qi(e,[{key:U,get:function(){return"GraphQLDirective"}}]),e}();B(ue);var $i=new ue({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[k.FIELD,k.FRAGMENT_SPREAD,k.INLINE_FRAGMENT],args:{if:{type:new h(M),description:"Included when true."}}}),Yi=new ue({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[k.FIELD,k.FRAGMENT_SPREAD,k.INLINE_FRAGMENT],args:{if:{type:new h(M),description:"Skipped when true."}}}),zi="No longer supported",Xi=new ue({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[k.FIELD_DEFINITION,k.ARGUMENT_DEFINITION,k.INPUT_FIELD_DEFINITION,k.ENUM_VALUE],args:{reason:{type:O,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:zi}}}),Hi=new ue({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[k.SCALAR],args:{url:{type:new h(O),description:"The URL that specifies the behaviour of this scalar."}}}),Ki=Object.freeze([$i,Yi,Xi,Hi]);function mt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Wi(e,t,n){return t&&mt(e.prototype,t),n&&mt(e,n),e}(function(){function e(n){var i;this.__validationErrors=n.assumeValid===!0?[]:void 0,W(n)||g(0,"Must provide configuration object."),!n.types||Array.isArray(n.types)||g(0,'"types" must be Array if provided but got: '.concat(S(n.types),".")),!n.directives||Array.isArray(n.directives)||g(0,'"directives" must be Array if provided but got: '+"".concat(S(n.directives),".")),this.description=n.description,this.extensions=n.extensions&&x(n.extensions),this.astNode=n.astNode,this.extensionASTNodes=n.extensionASTNodes,this._queryType=n.query,this._mutationType=n.mutation,this._subscriptionType=n.subscription,this._directives=(i=n.directives)!==null&&i!==void 0?i:Ki;var r=new Set(n.types);if(n.types!=null)for(var a=0,s=n.types;a<s.length;a++){var o=s[a];r.delete(o),C(o,r)}this._queryType!=null&&C(this._queryType,r),this._mutationType!=null&&C(this._mutationType,r),this._subscriptionType!=null&&C(this._subscriptionType,r);for(var u=0,c=this._directives;u<c.length;u++){var p=c[u];if(Ji(p))for(var m=0,y=p.args;m<y.length;m++){var d=y[m];C(d.type,r)}}C(gn,r),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var v=0,T=Di(r);v<T.length;v++){var E=T[v];if(E!=null){var N=E.name;if(N||g(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[N]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(N,'".'));if(this._typeMap[N]=E,V(E))for(var R=0,w=E.getInterfaces();R<w.length;R++){var _=w[R];if(V(_)){var I=this._implementationsMap[_.name];I===void 0&&(I=this._implementationsMap[_.name]={objects:[],interfaces:[]}),I.interfaces.push(E)}}else if(q(E))for(var Q=0,Y=E.getInterfaces();Q<Y.length;Q++){var L=Y[Q];if(V(L)){var te=this._implementationsMap[L.name];te===void 0&&(te=this._implementationsMap[L.name]={objects:[],interfaces:[]}),te.objects.push(E)}}}}}var t=e.prototype;return t.getQueryType=function(){return this._queryType},t.getMutationType=function(){return this._mutationType},t.getSubscriptionType=function(){return this._subscriptionType},t.getTypeMap=function(){return this._typeMap},t.getType=function(i){return this.getTypeMap()[i]},t.getPossibleTypes=function(i){return z(i)?i.getTypes():this.getImplementations(i).objects},t.getImplementations=function(i){var r=this._implementationsMap[i.name];return r??{objects:[],interfaces:[]}},t.isPossibleType=function(i,r){return this.isSubType(i,r)},t.isSubType=function(i,r){var a=this._subTypeMap[i.name];if(a===void 0){if(a=Object.create(null),z(i))for(var s=0,o=i.getTypes();s<o.length;s++){var u=o[s];a[u.name]=!0}else{for(var c=this.getImplementations(i),p=0,m=c.objects;p<m.length;p++){var y=m[p];a[y.name]=!0}for(var d=0,v=c.interfaces;d<v.length;d++){var T=v[d];a[T.name]=!0}}this._subTypeMap[i.name]=a}return a[r.name]!==void 0},t.getDirectives=function(){return this._directives},t.getDirective=function(i){return Cn(this.getDirectives(),function(r){return r.name===i})},t.toConfig=function(){var i;return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Z(this.getTypeMap()),directives:this.getDirectives().slice(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[],assumeValid:this.__validationErrors!==void 0}},Wi(e,[{key:U,get:function(){return"GraphQLSchema"}}]),e})();function C(e,t){var n=Ee(e);if(!t.has(n)){if(t.add(n),z(n))for(var i=0,r=n.getTypes();i<r.length;i++){var a=r[i];C(a,t)}else if(q(n)||V(n)){for(var s=0,o=n.getInterfaces();s<o.length;s++){var u=o[s];C(u,t)}for(var c=0,p=Z(n.getFields());c<p.length;c++){var m=p[c];C(m.type,t);for(var y=0,d=m.args;y<d.length;y++){var v=d[y];C(v.type,t)}}}else if(ee(n))for(var T=0,E=Z(n.getFields());T<E.length;T++){var N=E[T];C(N.type,t)}}return t}function Je(e,t){var n;if(t.kind===l.LIST_TYPE)return n=Je(e,t.type),n&&new D(n);if(t.kind===l.NON_NULL_TYPE)return n=Je(e,t.type),n&&new h(n);if(t.kind===l.NAMED_TYPE)return e.getType(t.name.value);Te(0,"Unexpected type node: "+S(t))}var Zi=function(){function e(n,i,r){this._schema=n,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=i??er,r&&(ae(r)&&this._inputTypeStack.push(r),vn(r)&&this._parentTypeStack.push(r),Be(r)&&this._typeStack.push(r))}var t=e.prototype;return t.getType=function(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]},t.getParentType=function(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]},t.getInputType=function(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]},t.getParentInputType=function(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]},t.getFieldDef=function(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]},t.getDefaultValue=function(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]},t.getDirective=function(){return this._directive},t.getArgument=function(){return this._argument},t.getEnumValue=function(){return this._enumValue},t.enter=function(i){var r=this._schema;switch(i.kind){case l.SELECTION_SET:{var a=Ee(this.getType());this._parentTypeStack.push(vn(a)?a:void 0);break}case l.FIELD:{var s=this.getParentType(),o,u;s&&(o=this._getFieldDef(r,s,i),o&&(u=o.type)),this._fieldDefStack.push(o),this._typeStack.push(Be(u)?u:void 0);break}case l.DIRECTIVE:this._directive=r.getDirective(i.name.value);break;case l.OPERATION_DEFINITION:{var c;switch(i.operation){case"query":c=r.getQueryType();break;case"mutation":c=r.getMutationType();break;case"subscription":c=r.getSubscriptionType();break}this._typeStack.push(q(c)?c:void 0);break}case l.INLINE_FRAGMENT:case l.FRAGMENT_DEFINITION:{var p=i.typeCondition,m=p?Je(r,p):Ee(this.getType());this._typeStack.push(Be(m)?m:void 0);break}case l.VARIABLE_DEFINITION:{var y=Je(r,i.type);this._inputTypeStack.push(ae(y)?y:void 0);break}case l.ARGUMENT:{var d,v,T,E=(d=this.getDirective())!==null&&d!==void 0?d:this.getFieldDef();E&&(v=Cn(E.args,function(L){return L.name===i.name.value}),v&&(T=v.type)),this._argument=v,this._defaultValueStack.push(v?v.defaultValue:void 0),this._inputTypeStack.push(ae(T)?T:void 0);break}case l.LIST:{var N=Ei(this.getInputType()),R=ke(N)?N.ofType:N;this._defaultValueStack.push(void 0),this._inputTypeStack.push(ae(R)?R:void 0);break}case l.OBJECT_FIELD:{var w=Ee(this.getInputType()),_,I;ee(w)&&(I=w.getFields()[i.name.value],I&&(_=I.type)),this._defaultValueStack.push(I?I.defaultValue:void 0),this._inputTypeStack.push(ae(_)?_:void 0);break}case l.ENUM:{var Q=Ee(this.getInputType()),Y;X(Q)&&(Y=Q.getValue(i.value)),this._enumValue=Y;break}}},t.leave=function(i){switch(i.kind){case l.SELECTION_SET:this._parentTypeStack.pop();break;case l.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case l.DIRECTIVE:this._directive=null;break;case l.OPERATION_DEFINITION:case l.INLINE_FRAGMENT:case l.FRAGMENT_DEFINITION:this._typeStack.pop();break;case l.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case l.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case l.LIST:case l.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case l.ENUM:this._enumValue=null;break}},e}();function er(e,t,n){var i=n.name.value;if(i===lt.name&&e.getQueryType()===t)return lt;if(i===ft.name&&e.getQueryType()===t)return ft;if(i===dt.name&&vn(t))return dt;if(q(t)||V(t))return t.getFields()[i]}function nr(e,t){return{enter:function(i){e.enter(i);var r=ln(t,i.kind,!1);if(r){var a=r.apply(t,arguments);return a!==void 0&&(e.leave(i),cn(a)&&e.enter(a)),a}},leave:function(i){var r=ln(t,i.kind,!0),a;return r&&(a=r.apply(t,arguments)),e.leave(i),a}}}[].concat(it,pt).map(function(e){return e.name});var K;function ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}K={},ce(K,l.SCALAR_TYPE_DEFINITION,l.SCALAR_TYPE_EXTENSION),ce(K,l.OBJECT_TYPE_DEFINITION,l.OBJECT_TYPE_EXTENSION),ce(K,l.INTERFACE_TYPE_DEFINITION,l.INTERFACE_TYPE_EXTENSION),ce(K,l.UNION_TYPE_DEFINITION,l.UNION_TYPE_EXTENSION),ce(K,l.ENUM_TYPE_DEFINITION,l.ENUM_TYPE_EXTENSION),ce(K,l.INPUT_OBJECT_TYPE_DEFINITION,l.INPUT_OBJECT_TYPE_EXTENSION);function ht(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var yt=function(){function e(n,i){this._ast=n,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=i}var t=e.prototype;return t.reportError=function(i){this._onError(i)},t.getDocument=function(){return this._ast},t.getFragment=function(i){var r=this._fragments;return r||(this._fragments=r=this.getDocument().definitions.reduce(function(a,s){return s.kind===l.FRAGMENT_DEFINITION&&(a[s.name.value]=s),a},Object.create(null))),r[i]},t.getFragmentSpreads=function(i){var r=this._fragmentSpreads.get(i);if(!r){r=[];for(var a=[i];a.length!==0;)for(var s=a.pop(),o=0,u=s.selections;o<u.length;o++){var c=u[o];c.kind===l.FRAGMENT_SPREAD?r.push(c):c.selectionSet&&a.push(c.selectionSet)}this._fragmentSpreads.set(i,r)}return r},t.getRecursivelyReferencedFragments=function(i){var r=this._recursivelyReferencedFragments.get(i);if(!r){r=[];for(var a=Object.create(null),s=[i.selectionSet];s.length!==0;)for(var o=s.pop(),u=0,c=this.getFragmentSpreads(o);u<c.length;u++){var p=c[u],m=p.name.value;if(a[m]!==!0){a[m]=!0;var y=this.getFragment(m);y&&(r.push(y),s.push(y.selectionSet))}}this._recursivelyReferencedFragments.set(i,r)}return r},e}();(function(e){ht(t,e);function t(i,r,a){var s;return s=e.call(this,i,a)||this,s._schema=r,s}var n=t.prototype;return n.getSchema=function(){return this._schema},t})(yt),function(e){ht(t,e);function t(i,r,a,s){var o;return o=e.call(this,r,s)||this,o._schema=i,o._typeInfo=a,o._variableUsages=new Map,o._recursiveVariableUsages=new Map,o}var n=t.prototype;return n.getSchema=function(){return this._schema},n.getVariableUsages=function(r){var a=this._variableUsages.get(r);if(!a){var s=[],o=new Zi(this._schema);jn(r,nr(o,{VariableDefinition:function(){return!1},Variable:function(c){s.push({node:c,type:o.getInputType(),defaultValue:o.getDefaultValue()})}})),a=s,this._variableUsages.set(r,a)}return a},n.getRecursiveVariableUsages=function(r){var a=this._recursiveVariableUsages.get(r);if(!a){a=this.getVariableUsages(r);for(var s=0,o=this.getRecursivelyReferencedFragments(r);s<o.length;s++){var u=o[s];a=a.concat(this.getVariableUsages(u))}this._recursiveVariableUsages.set(r,a)}return a},n.getType=function(){return this._typeInfo.getType()},n.getParentType=function(){return this._typeInfo.getParentType()},n.getInputType=function(){return this._typeInfo.getInputType()},n.getParentInputType=function(){return this._typeInfo.getParentInputType()},n.getFieldDef=function(){return this._typeInfo.getFieldDef()},n.getDirective=function(){return this._typeInfo.getDirective()},n.getArgument=function(){return this._typeInfo.getArgument()},n.getEnumValue=function(){return this._typeInfo.getEnumValue()},t}(yt),Qn(it.concat(pt),function(e){return e.name});const tr={staging:{graphEndpoint:"https://api-staging.spritz.finance/graphql"},production:{graphEndpoint:"https://api.spritz.finance/graphql"}};class Oe extends Error{date;constructor(t,...n){super(...n),Error.captureStackTrace&&Error.captureStackTrace(this,Oe),this.name="SpritzApiError",this.message=t,this.date=new Date}}const ir=e=>Fn.create(e);class rr{client;constructor(t,n){this.client=ir({baseURL:tr[t].graphEndpoint,headers:{"Content-Type":"application/json",Authorization:"Bearer "+n}})}async query({query:t,variables:n}){try{const i=await this.client.post("",{query:$(t),variables:n,operationName:t?.definitions?.[0]?.name?.value});if(i.data.errors)throw new Oe(`Spritz GraphQL Error: ${i.data.errors[0].message}`);return i.data.data}catch(i){if(Fn.isAxiosError(i)){const r=i.response?.data.Message??i.response?.data.message;throw new Oe(`Spritz Request Error: ${r}`)}else throw new Oe(`Spritz Request Error: ${i.message}`)}}}var $e={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PayableAccountFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PayableAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountSubType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ownedByUser"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"USBankAccountDetails"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"routingNumber"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logo"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:501}};$e.loc.source={body:`fragment PayableAccountFragment on PayableAccount {
|
|
42
|
+
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:function(){return{name:{type:new I(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},isRepeatable:{type:new I(Q),resolve:function(t){return t.isRepeatable}},locations:{type:new I(new q(new I(Ut))),resolve:function(t){return t.locations}},args:{type:new I(new q(new I(nn))),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var r=i.includeDeprecated;return r?t.args:t.args.filter(function(a){return a.deprecationReason==null})}}}}}),Ut=new Ke({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:R.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:R.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:R.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:R.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:R.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:R.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:R.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:R.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:R.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:R.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:R.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:R.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:R.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:R.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:R.UNION,description:"Location adjacent to a union definition."},ENUM:{value:R.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:R.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:R.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:R.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),X=new re({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByUrl`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:function(){return{kind:{type:new I(Mt),resolve:function(t){if(Fe(t))return C.SCALAR;if(W(t))return C.OBJECT;if($(t))return C.INTERFACE;if(te(t))return C.UNION;if(ie(t))return C.ENUM;if(ue(t))return C.INPUT_OBJECT;if(Le(t))return C.LIST;if(de(t))return C.NON_NULL;Oe(0,'Unexpected type: "'.concat(F(t),'".'))}},name:{type:V,resolve:function(t){return t.name!==void 0?t.name:void 0}},description:{type:V,resolve:function(t){return t.description!==void 0?t.description:void 0}},specifiedByUrl:{type:V,resolve:function(t){return t.specifiedByUrl!==void 0?t.specifiedByUrl:void 0}},fields:{type:new q(new I(Bt)),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var r=i.includeDeprecated;if(W(t)||$(t)){var a=se(t.getFields());return r?a:a.filter(function(u){return u.deprecationReason==null})}}},interfaces:{type:new q(new I(X)),resolve:function(t){if(W(t)||$(t))return t.getInterfaces()}},possibleTypes:{type:new q(new I(X)),resolve:function(t,i,r,a){var u=a.schema;if(fr(t))return u.getPossibleTypes(t)}},enumValues:{type:new q(new I(Vt)),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var r=i.includeDeprecated;if(ie(t)){var a=t.getValues();return r?a:a.filter(function(u){return u.deprecationReason==null})}}},inputFields:{type:new q(new I(nn)),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var r=i.includeDeprecated;if(ue(t)){var a=se(t.getFields());return r?a:a.filter(function(u){return u.deprecationReason==null})}}},ofType:{type:X,resolve:function(t){return t.ofType!==void 0?t.ofType:void 0}}}}}),Bt=new re({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:function(){return{name:{type:new I(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},args:{type:new I(new q(new I(nn))),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var r=i.includeDeprecated;return r?t.args:t.args.filter(function(a){return a.deprecationReason==null})}},type:{type:new I(X),resolve:function(t){return t.type}},isDeprecated:{type:new I(Q),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:V,resolve:function(t){return t.deprecationReason}}}}}),nn=new re({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:function(){return{name:{type:new I(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},type:{type:new I(X),resolve:function(t){return t.type}},defaultValue:{type:V,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(t){var i=t.type,r=t.defaultValue,a=Be(r,i);return a?ne(a):null}},isDeprecated:{type:new I(Q),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:V,resolve:function(t){return t.deprecationReason}}}}}),Vt=new re({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:function(){return{name:{type:new I(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},isDeprecated:{type:new I(Q),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:V,resolve:function(t){return t.deprecationReason}}}}}),C=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"}),Mt=new Ke({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:C.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:C.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:C.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:C.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:C.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:C.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:C.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:C.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),xt={name:"__schema",type:new I(Vn),description:"Access the current type schema of this server.",args:[],resolve:function(n,t,i,r){var a=r.schema;return a},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},qt={name:"__type",type:X,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new I(V),defaultValue:void 0,deprecationReason:void 0,extensions:void 0,astNode:void 0}],resolve:function(n,t,i,r){var a=t.name,u=r.schema;return u.getType(a)},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},Ct={name:"__typename",type:new I(V),description:"The name of the current Object type at runtime.",args:[],resolve:function(n,t,i,r){var a=r.parentType;return a.name},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},jt=Object.freeze([Vn,Pt,Ut,X,Bt,nn,Vt,Mt]);function Gt(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ur(e,n,t){return n&&Gt(e.prototype,n),t&&Gt(e,t),e}function Br(e){return ee(e,he)}var he=function(){function e(t){var i,r;this.name=t.name,this.description=t.description,this.locations=t.locations,this.isRepeatable=(i=t.isRepeatable)!==null&&i!==void 0?i:!1,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,t.name||_(0,"Directive must be named."),Array.isArray(t.locations)||_(0,"@".concat(t.name," locations must be an Array."));var a=(r=t.args)!==null&&r!==void 0?r:{};oe(a)&&!Array.isArray(a)||_(0,"@".concat(t.name," args must be an object with argument names as keys.")),this.args=_e(a).map(function(u){var o=u[0],s=u[1];return{name:o,description:s.description,type:s.type,defaultValue:s.defaultValue,deprecationReason:s.deprecationReason,extensions:s.extensions&&j(s.extensions),astNode:s.astNode}})}var n=e.prototype;return n.toConfig=function(){return{name:this.name,description:this.description,locations:this.locations,args:At(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},n.toString=function(){return"@"+this.name},n.toJSON=function(){return this.toString()},Ur(e,[{key:G,get:function(){return"GraphQLDirective"}}]),e}();H(he);var Vr=new he({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[R.FIELD,R.FRAGMENT_SPREAD,R.INLINE_FRAGMENT],args:{if:{type:new I(Q),description:"Included when true."}}}),Mr=new he({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[R.FIELD,R.FRAGMENT_SPREAD,R.INLINE_FRAGMENT],args:{if:{type:new I(Q),description:"Skipped when true."}}}),xr="No longer supported",qr=new he({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[R.FIELD_DEFINITION,R.ARGUMENT_DEFINITION,R.INPUT_FIELD_DEFINITION,R.ENUM_VALUE],args:{reason:{type:V,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:xr}}}),Cr=new he({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[R.SCALAR],args:{url:{type:new I(V),description:"The URL that specifies the behaviour of this scalar."}}}),jr=Object.freeze([Vr,Mr,qr,Cr]);function $t(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Gr(e,n,t){return n&&$t(e.prototype,n),t&&$t(e,t),e}(function(){function e(t){var i;this.__validationErrors=t.assumeValid===!0?[]:void 0,oe(t)||_(0,"Must provide configuration object."),!t.types||Array.isArray(t.types)||_(0,'"types" must be Array if provided but got: '.concat(F(t.types),".")),!t.directives||Array.isArray(t.directives)||_(0,'"directives" must be Array if provided but got: '+"".concat(F(t.directives),".")),this.description=t.description,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes,this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(i=t.directives)!==null&&i!==void 0?i:jr;var r=new Set(t.types);if(t.types!=null)for(var a=0,u=t.types;a<u.length;a++){var o=u[a];r.delete(o),K(o,r)}this._queryType!=null&&K(this._queryType,r),this._mutationType!=null&&K(this._mutationType,r),this._subscriptionType!=null&&K(this._subscriptionType,r);for(var s=0,l=this._directives;s<l.length;s++){var g=l[s];if(Br(g))for(var E=0,y=g.args;E<y.length;E++){var d=y[E];K(d.type,r)}}K(Vn,r),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var N=0,w=kr(r);N<w.length;N++){var O=w[N];if(O!=null){var D=O.name;if(D||_(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[D]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(D,'".'));if(this._typeMap[D]=O,$(O))for(var P=0,L=O.getInterfaces();P<L.length;P++){var f=L[P];if($(f)){var c=this._implementationsMap[f.name];c===void 0&&(c=this._implementationsMap[f.name]={objects:[],interfaces:[]}),c.interfaces.push(O)}}else if(W(O))for(var S=0,v=O.getInterfaces();S<v.length;S++){var b=v[S];if($(b)){var A=this._implementationsMap[b.name];A===void 0&&(A=this._implementationsMap[b.name]={objects:[],interfaces:[]}),A.objects.push(O)}}}}}var n=e.prototype;return n.getQueryType=function(){return this._queryType},n.getMutationType=function(){return this._mutationType},n.getSubscriptionType=function(){return this._subscriptionType},n.getTypeMap=function(){return this._typeMap},n.getType=function(i){return this.getTypeMap()[i]},n.getPossibleTypes=function(i){return te(i)?i.getTypes():this.getImplementations(i).objects},n.getImplementations=function(i){var r=this._implementationsMap[i.name];return r??{objects:[],interfaces:[]}},n.isPossibleType=function(i,r){return this.isSubType(i,r)},n.isSubType=function(i,r){var a=this._subTypeMap[i.name];if(a===void 0){if(a=Object.create(null),te(i))for(var u=0,o=i.getTypes();u<o.length;u++){var s=o[u];a[s.name]=!0}else{for(var l=this.getImplementations(i),g=0,E=l.objects;g<E.length;g++){var y=E[g];a[y.name]=!0}for(var d=0,N=l.interfaces;d<N.length;d++){var w=N[d];a[w.name]=!0}}this._subTypeMap[i.name]=a}return a[r.name]!==void 0},n.getDirectives=function(){return this._directives},n.getDirective=function(i){return yt(this.getDirectives(),function(r){return r.name===i})},n.toConfig=function(){var i;return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:se(this.getTypeMap()),directives:this.getDirectives().slice(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[],assumeValid:this.__validationErrors!==void 0}},Gr(e,[{key:G,get:function(){return"GraphQLSchema"}}]),e})();function K(e,n){var t=Re(e);if(!n.has(t)){if(n.add(t),te(t))for(var i=0,r=t.getTypes();i<r.length;i++){var a=r[i];K(a,n)}else if(W(t)||$(t)){for(var u=0,o=t.getInterfaces();u<o.length;u++){var s=o[u];K(s,n)}for(var l=0,g=se(t.getFields());l<g.length;l++){var E=g[l];K(E.type,n);for(var y=0,d=E.args;y<d.length;y++){var N=d[y];K(N.type,n)}}}else if(ue(t))for(var w=0,O=se(t.getFields());w<O.length;w++){var D=O[w];K(D.type,n)}}return n}function tn(e,n){var t;if(n.kind===h.LIST_TYPE)return t=tn(e,n.type),t&&new q(t);if(n.kind===h.NON_NULL_TYPE)return t=tn(e,n.type),t&&new I(t);if(n.kind===h.NAMED_TYPE)return e.getType(n.name.value);Oe(0,"Unexpected type node: "+F(n))}var $r=function(){function e(t,i,r){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=i??Qr,r&&(ve(r)&&this._inputTypeStack.push(r),Rn(r)&&this._parentTypeStack.push(r),Ye(r)&&this._typeStack.push(r))}var n=e.prototype;return n.getType=function(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]},n.getParentType=function(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]},n.getInputType=function(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]},n.getParentInputType=function(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]},n.getFieldDef=function(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]},n.getDefaultValue=function(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]},n.getDirective=function(){return this._directive},n.getArgument=function(){return this._argument},n.getEnumValue=function(){return this._enumValue},n.enter=function(i){var r=this._schema;switch(i.kind){case h.SELECTION_SET:{var a=Re(this.getType());this._parentTypeStack.push(Rn(a)?a:void 0);break}case h.FIELD:{var u=this.getParentType(),o,s;u&&(o=this._getFieldDef(r,u,i),o&&(s=o.type)),this._fieldDefStack.push(o),this._typeStack.push(Ye(s)?s:void 0);break}case h.DIRECTIVE:this._directive=r.getDirective(i.name.value);break;case h.OPERATION_DEFINITION:{var l;switch(i.operation){case"query":l=r.getQueryType();break;case"mutation":l=r.getMutationType();break;case"subscription":l=r.getSubscriptionType();break}this._typeStack.push(W(l)?l:void 0);break}case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:{var g=i.typeCondition,E=g?tn(r,g):Re(this.getType());this._typeStack.push(Ye(E)?E:void 0);break}case h.VARIABLE_DEFINITION:{var y=tn(r,i.type);this._inputTypeStack.push(ve(y)?y:void 0);break}case h.ARGUMENT:{var d,N,w,O=(d=this.getDirective())!==null&&d!==void 0?d:this.getFieldDef();O&&(N=yt(O.args,function(b){return b.name===i.name.value}),N&&(w=N.type)),this._argument=N,this._defaultValueStack.push(N?N.defaultValue:void 0),this._inputTypeStack.push(ve(w)?w:void 0);break}case h.LIST:{var D=pr(this.getInputType()),P=Le(D)?D.ofType:D;this._defaultValueStack.push(void 0),this._inputTypeStack.push(ve(P)?P:void 0);break}case h.OBJECT_FIELD:{var L=Re(this.getInputType()),f,c;ue(L)&&(c=L.getFields()[i.name.value],c&&(f=c.type)),this._defaultValueStack.push(c?c.defaultValue:void 0),this._inputTypeStack.push(ve(f)?f:void 0);break}case h.ENUM:{var S=Re(this.getInputType()),v;ie(S)&&(v=S.getValue(i.value)),this._enumValue=v;break}}},n.leave=function(i){switch(i.kind){case h.SELECTION_SET:this._parentTypeStack.pop();break;case h.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case h.DIRECTIVE:this._directive=null;break;case h.OPERATION_DEFINITION:case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:this._typeStack.pop();break;case h.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case h.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.LIST:case h.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.ENUM:this._enumValue=null;break}},e}();function Qr(e,n,t){var i=t.name.value;if(i===xt.name&&e.getQueryType()===n)return xt;if(i===qt.name&&e.getQueryType()===n)return qt;if(i===Ct.name&&Rn(n))return Ct;if(W(n)||$(n))return n.getFields()[i]}function Jr(e,n){return{enter:function(i){e.enter(i);var r=On(n,i.kind,!1);if(r){var a=r.apply(n,arguments);return a!==void 0&&(e.leave(i),Dn(a)&&e.enter(a)),a}},leave:function(i){var r=On(n,i.kind,!0),a;return r&&(a=r.apply(n,arguments)),e.leave(i),a}}}[].concat(Lt,jt).map(function(e){return e.name});var ae;function ye(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}ae={},ye(ae,h.SCALAR_TYPE_DEFINITION,h.SCALAR_TYPE_EXTENSION),ye(ae,h.OBJECT_TYPE_DEFINITION,h.OBJECT_TYPE_EXTENSION),ye(ae,h.INTERFACE_TYPE_DEFINITION,h.INTERFACE_TYPE_EXTENSION),ye(ae,h.UNION_TYPE_DEFINITION,h.UNION_TYPE_EXTENSION),ye(ae,h.ENUM_TYPE_DEFINITION,h.ENUM_TYPE_EXTENSION),ye(ae,h.INPUT_OBJECT_TYPE_DEFINITION,h.INPUT_OBJECT_TYPE_EXTENSION);function Qt(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n}var Jt=function(){function e(t,i){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=i}var n=e.prototype;return n.reportError=function(i){this._onError(i)},n.getDocument=function(){return this._ast},n.getFragment=function(i){var r=this._fragments;return r||(this._fragments=r=this.getDocument().definitions.reduce(function(a,u){return u.kind===h.FRAGMENT_DEFINITION&&(a[u.name.value]=u),a},Object.create(null))),r[i]},n.getFragmentSpreads=function(i){var r=this._fragmentSpreads.get(i);if(!r){r=[];for(var a=[i];a.length!==0;)for(var u=a.pop(),o=0,s=u.selections;o<s.length;o++){var l=s[o];l.kind===h.FRAGMENT_SPREAD?r.push(l):l.selectionSet&&a.push(l.selectionSet)}this._fragmentSpreads.set(i,r)}return r},n.getRecursivelyReferencedFragments=function(i){var r=this._recursivelyReferencedFragments.get(i);if(!r){r=[];for(var a=Object.create(null),u=[i.selectionSet];u.length!==0;)for(var o=u.pop(),s=0,l=this.getFragmentSpreads(o);s<l.length;s++){var g=l[s],E=g.name.value;if(a[E]!==!0){a[E]=!0;var y=this.getFragment(E);y&&(r.push(y),u.push(y.selectionSet))}}this._recursivelyReferencedFragments.set(i,r)}return r},e}();(function(e){Qt(n,e);function n(i,r,a){var u;return u=e.call(this,i,a)||this,u._schema=r,u}var t=n.prototype;return t.getSchema=function(){return this._schema},n})(Jt),function(e){Qt(n,e);function n(i,r,a,u){var o;return o=e.call(this,r,u)||this,o._schema=i,o._typeInfo=a,o._variableUsages=new Map,o._recursiveVariableUsages=new Map,o}var t=n.prototype;return t.getSchema=function(){return this._schema},t.getVariableUsages=function(r){var a=this._variableUsages.get(r);if(!a){var u=[],o=new $r(this._schema);ht(r,Jr(o,{VariableDefinition:function(){return!1},Variable:function(l){u.push({node:l,type:o.getInputType(),defaultValue:o.getDefaultValue()})}})),a=u,this._variableUsages.set(r,a)}return a},t.getRecursiveVariableUsages=function(r){var a=this._recursiveVariableUsages.get(r);if(!a){a=this.getVariableUsages(r);for(var u=0,o=this.getRecursivelyReferencedFragments(r);u<o.length;u++){var s=o[u];a=a.concat(this.getVariableUsages(s))}this._recursiveVariableUsages.set(r,a)}return a},t.getType=function(){return this._typeInfo.getType()},t.getParentType=function(){return this._typeInfo.getParentType()},t.getInputType=function(){return this._typeInfo.getInputType()},t.getParentInputType=function(){return this._typeInfo.getParentInputType()},t.getFieldDef=function(){return this._typeInfo.getFieldDef()},t.getDirective=function(){return this._typeInfo.getDirective()},t.getArgument=function(){return this._typeInfo.getArgument()},t.getEnumValue=function(){return this._typeInfo.getEnumValue()},n}(Jt),gt(Lt.concat(jt),function(e){return e.name});const Hr={staging:{graphEndpoint:"https://api-staging.spritz.finance/graphql"},production:{graphEndpoint:"https://api.spritz.finance/graphql"}};let Mn=class Ii extends Error{date;constructor(n,...t){super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Ii),this.name="SpritzApiError",this.message=n,this.date=new Date}};const zr=e=>at.create(e);class Yr{client;constructor(n,t,i){this.client=zr({baseURL:Hr[n].graphEndpoint,headers:{"Content-Type":"application/json",Authorization:"Bearer "+t,...i?{"X-INTEGRATION-KEY":i}:{}}})}async query({query:n,variables:t}){try{const i=await this.client.post("",{query:ne(n),variables:t,operationName:n?.definitions?.[0]?.name?.value});if(i.data.errors)throw new Mn(`Spritz GraphQL Error: ${i.data.errors[0].message}`);return i.data.data}catch(i){if(at.isAxiosError(i)){const r=i.response?.data.Message??i.response?.data.message;throw new Mn(`Spritz Request Error: ${r}`)}else throw new Mn(`Spritz Request Error: ${i.message}`)}}}var rn={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PayableAccountFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PayableAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountSubType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ownedByUser"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"USBankAccountDetails"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"routingNumber"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logo"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:501}};rn.loc.source={body:`fragment PayableAccountFragment on PayableAccount {
|
|
43
43
|
id
|
|
44
44
|
name
|
|
45
45
|
userId
|
|
@@ -68,14 +68,14 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
|
|
|
68
68
|
currency
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function
|
|
71
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function an(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){an(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){an(i,n)}),e.definitions&&e.definitions.forEach(function(i){an(i,n)})}var xn={};(function(){rn.definitions.forEach(function(n){if(n.name){var t=new Set;an(n,t),xn[n.name.value]=t}})})();function Ht(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Xr(e,n){var t={kind:e.kind,definitions:[Ht(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=xn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=xn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=Ht(e,o);s&&t.definitions.push(s)}),t}Xr(rn,"PayableAccountFragment");var ge={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateUSBankAccount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createUSAccountInput"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"USBankAccountInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createUSBankAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"createUSAccountInput"},value:{kind:"Variable",name:{kind:"Name",value:"createUSAccountInput"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PayableAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:241}};ge.loc.source={body:`#import "../queries/payableAccountFragment.graphql"
|
|
72
72
|
|
|
73
73
|
mutation CreateUSBankAccount($createUSAccountInput: USBankAccountInput!) {
|
|
74
74
|
createUSBankAccount(createUSAccountInput: $createUSAccountInput) {
|
|
75
75
|
...PayableAccountFragment
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
78
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var zt={};function Kr(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return zt[t]?!1:(zt[t]=!0,!0)})}ge.definitions=ge.definitions.concat(Kr(rn.definitions));function on(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){on(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){on(i,n)}),e.definitions&&e.definitions.forEach(function(i){on(i,n)})}var qn={};(function(){ge.definitions.forEach(function(n){if(n.name){var t=new Set;on(n,t),qn[n.name.value]=t}})})();function Yt(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Wr(e,n){var t={kind:e.kind,definitions:[Yt(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=qn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=qn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=Yt(e,o);s&&t.definitions.push(s)}),t}Wr(ge,"CreateUSBankAccount");var ke={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"BankAccountFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountSubType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ownedByUser"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"USBankAccountDetails"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"routingNumber"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logo"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:495}};ke.loc.source={body:`fragment BankAccountFragment on BankAccount {
|
|
79
79
|
id
|
|
80
80
|
name
|
|
81
81
|
userId
|
|
@@ -104,28 +104,93 @@ mutation CreateUSBankAccount($createUSAccountInput: USBankAccountInput!) {
|
|
|
104
104
|
currency
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function
|
|
107
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function sn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){sn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){sn(i,n)}),e.definitions&&e.definitions.forEach(function(i){sn(i,n)})}var Cn={};(function(){ke.definitions.forEach(function(n){if(n.name){var t=new Set;sn(n,t),Cn[n.name.value]=t}})})();function Xt(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Zr(e,n){var t={kind:e.kind,definitions:[Xt(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Cn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=Cn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=Xt(e,o);s&&t.definitions.push(s)}),t}Zr(ke,"BankAccountFragment");var Se={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RenameBankAccount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"accountId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"renamePayableAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"accountId"},value:{kind:"Variable",name:{kind:"Name",value:"accountId"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BankAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:218}};Se.loc.source={body:`#import "../queries/bankAccountFragment.graphql"
|
|
108
108
|
|
|
109
109
|
mutation RenameBankAccount($accountId: String!, $name: String!) {
|
|
110
110
|
renamePayableAccount(accountId: $accountId, name: $name) {
|
|
111
111
|
...BankAccountFragment
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
114
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Kt={};function ea(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Kt[t]?!1:(Kt[t]=!0,!0)})}Se.definitions=Se.definitions.concat(ea(ke.definitions));function un(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){un(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){un(i,n)}),e.definitions&&e.definitions.forEach(function(i){un(i,n)})}var jn={};(function(){Se.definitions.forEach(function(n){if(n.name){var t=new Set;un(n,t),jn[n.name.value]=t}})})();function Wt(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function na(e,n){var t={kind:e.kind,definitions:[Wt(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=jn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=jn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=Wt(e,o);s&&t.definitions.push(s)}),t}na(Se,"RenameBankAccount");var Te={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteBankAccount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"accountId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletePayableAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"accountId"},value:{kind:"Variable",name:{kind:"Name",value:"accountId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BankAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:189}};Te.loc.source={body:`#import "../queries/bankAccountFragment.graphql"
|
|
115
115
|
|
|
116
116
|
mutation DeleteBankAccount($accountId: String!) {
|
|
117
117
|
deletePayableAccount(accountId: $accountId) {
|
|
118
118
|
...BankAccountFragment
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
121
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Zt={};function ta(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Zt[t]?!1:(Zt[t]=!0,!0)})}Te.definitions=Te.definitions.concat(ta(ke.definitions));function cn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){cn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){cn(i,n)}),e.definitions&&e.definitions.forEach(function(i){cn(i,n)})}var Gn={};(function(){Te.definitions.forEach(function(n){if(n.name){var t=new Set;cn(n,t),Gn[n.name.value]=t}})})();function ei(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function ia(e,n){var t={kind:e.kind,definitions:[ei(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Gn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=Gn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=ei(e,o);s&&t.definitions.push(s)}),t}ia(Te,"DeleteBankAccount");var Ne={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserBankAccounts"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userBankAccounts"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BankAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:128}};Ne.loc.source={body:`#import "./bankAccountFragment.graphql"
|
|
122
122
|
|
|
123
123
|
query UserBankAccounts {
|
|
124
124
|
userBankAccounts {
|
|
125
125
|
...BankAccountFragment
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
128
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var ni={};function ra(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return ni[t]?!1:(ni[t]=!0,!0)})}Ne.definitions=Ne.definitions.concat(ra(ke.definitions));function ln(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){ln(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){ln(i,n)}),e.definitions&&e.definitions.forEach(function(i){ln(i,n)})}var $n={};(function(){Ne.definitions.forEach(function(n){if(n.name){var t=new Set;ln(n,t),$n[n.name.value]=t}})})();function ti(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function aa(e,n){var t={kind:e.kind,definitions:[ti(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=$n[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=$n[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=ti(e,o);s&&t.definitions.push(s)}),t}aa(Ne,"UserBankAccounts");var Qn=(e=>(e.CHECKBOOK="CHECKBOOK",e.METHOD_FI="METHOD_FI",e))(Qn||{}),ii=(e=>(e.Business="Business",e.Checking="Checking",e.Savings="Savings",e))(ii||{}),Jn=(e=>(e.USBankAccount="USBankAccount",e))(Jn||{}),ri=(e=>(e.COMPLETED="COMPLETED",e.CONFIRMED="CONFIRMED",e.CREATED="CREATED",e.FAILED="FAILED",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.TRANSACTION_FAILED="TRANSACTION_FAILED",e.TRANSACTION_PENDING="TRANSACTION_PENDING",e))(ri||{}),ai=(e=>(e.ACTIVE="ACTIVE",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.LOADING="LOADING",e.UNAVAILABLE="UNAVAILABLE",e.UNINITIALIZED="UNINITIALIZED",e))(ai||{}),oi=(e=>(e.BankAccount="BankAccount",e.Bill="Bill",e.DebitCard="DebitCard",e))(oi||{}),si=(e=>(e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.REVERSAL_IN_PROGRESS="REVERSAL_IN_PROGRESS",e.REVERSED="REVERSED",e.SCHEDULED="SCHEDULED",e.SENT="SENT",e))(si||{});const oa={[Jn.USBankAccount]:e=>({query:ge,variables:{createUSAccountInput:e},response:"createUSBankAccount"})},sa=(e,n)=>oa[e]?.(n)??null;class ua{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:Ne}))?.userBankAccounts??null}async rename(n,t){return(await this.client.query({query:Se,variables:{accountId:n,name:t}}))?.renamePayableAccount??null}async delete(n){return(await this.client.query({query:Te,variables:{accountId:n}}))?.deletePayableAccount??null}async create(n,t){const i=sa(n,t);if(!i)throw new Error("Invalid bank account type");return(await this.client.query({query:i.query,variables:i.variables}))?.[i.response]??null}}var Ve={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Payment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]}]}}],loc:{start:0,end:122}};Ve.loc.source={body:`fragment PaymentFragment on Payment {
|
|
129
|
+
id
|
|
130
|
+
userId
|
|
131
|
+
status
|
|
132
|
+
accountId
|
|
133
|
+
amount
|
|
134
|
+
feeAmount
|
|
135
|
+
createdAt
|
|
136
|
+
}
|
|
137
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function fn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){fn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){fn(i,n)}),e.definitions&&e.definitions.forEach(function(i){fn(i,n)})}var Hn={};(function(){Ve.definitions.forEach(function(n){if(n.name){var t=new Set;fn(n,t),Hn[n.name.value]=t}})})();function ui(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function ca(e,n){var t={kind:e.kind,definitions:[ui(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Hn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=Hn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=ui(e,o);s&&t.definitions.push(s)}),t}ca(Ve,"PaymentFragment");var be={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PaymentRequestPayment"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"paymentRequestId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"paymentForPaymentRequest"},arguments:[{kind:"Argument",name:{kind:"Name",value:"paymentRequestId"},value:{kind:"Variable",name:{kind:"Name",value:"paymentRequestId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentFragment"},directives:[]}]}}]}}],loc:{start:0,end:198}};be.loc.source={body:`#import "./paymentFragment.graphql"
|
|
138
|
+
|
|
139
|
+
query PaymentRequestPayment($paymentRequestId: String!) {
|
|
140
|
+
paymentForPaymentRequest(paymentRequestId: $paymentRequestId) {
|
|
141
|
+
...PaymentFragment
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var ci={};function la(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return ci[t]?!1:(ci[t]=!0,!0)})}be.definitions=be.definitions.concat(la(Ve.definitions));function dn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){dn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){dn(i,n)}),e.definitions&&e.definitions.forEach(function(i){dn(i,n)})}var zn={};(function(){be.definitions.forEach(function(n){if(n.name){var t=new Set;dn(n,t),zn[n.name.value]=t}})})();function li(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function fa(e,n){var t={kind:e.kind,definitions:[li(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=zn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=zn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=li(e,o);s&&t.definitions.push(s)}),t}fa(be,"PaymentRequestPayment");var Ee={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AccountPayments"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"accountId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"paymentsForAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"accountId"},value:{kind:"Variable",name:{kind:"Name",value:"accountId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentFragment"},directives:[]}]}}]}}],loc:{start:0,end:165}};Ee.loc.source={body:`#import "./paymentFragment.graphql"
|
|
145
|
+
|
|
146
|
+
query AccountPayments($accountId: String!) {
|
|
147
|
+
paymentsForAccount(accountId: $accountId) {
|
|
148
|
+
...PaymentFragment
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var fi={};function da(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return fi[t]?!1:(fi[t]=!0,!0)})}Ee.definitions=Ee.definitions.concat(da(Ve.definitions));function vn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){vn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){vn(i,n)}),e.definitions&&e.definitions.forEach(function(i){vn(i,n)})}var Yn={};(function(){Ee.definitions.forEach(function(n){if(n.name){var t=new Set;vn(n,t),Yn[n.name.value]=t}})})();function di(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function va(e,n){var t={kind:e.kind,definitions:[di(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Yn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=Yn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=di(e,o);s&&t.definitions.push(s)}),t}va(Ee,"AccountPayments");class pa{client;constructor(n){this.client=n}async listForAccount(n){return(await this.client.query({query:Ee,variables:{accountId:n}}))?.paymentsForAccount??[]}async getForPaymentRequest(n){return(await this.client.query({query:be,variables:{paymentRequestId:n}}))?.paymentForPaymentRequest??null}}var pn={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentRequestFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"DirectPayment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]}]}}],loc:{start:0,end:161}};pn.loc.source={body:`fragment PaymentRequestFragment on DirectPayment {
|
|
152
|
+
id
|
|
153
|
+
userId
|
|
154
|
+
accountId
|
|
155
|
+
status
|
|
156
|
+
amount
|
|
157
|
+
feeAmount
|
|
158
|
+
amountDue
|
|
159
|
+
network
|
|
160
|
+
createdAt
|
|
161
|
+
}
|
|
162
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function mn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){mn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){mn(i,n)}),e.definitions&&e.definitions.forEach(function(i){mn(i,n)})}var Xn={};(function(){pn.definitions.forEach(function(n){if(n.name){var t=new Set;mn(n,t),Xn[n.name.value]=t}})})();function vi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function ma(e,n){var t={kind:e.kind,definitions:[vi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Xn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=Xn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=vi(e,o);s&&t.definitions.push(s)}),t}ma(pn,"PaymentRequestFragment");var le={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreatePaymentRequest"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createDirectPaymentInput"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreateDirectPaymentInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createDirectPayment"},arguments:[{kind:"Argument",name:{kind:"Name",value:"createDirectPaymentInput"},value:{kind:"Variable",name:{kind:"Name",value:"createDirectPaymentInput"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentRequestFragment"},directives:[]}]}}]}}],loc:{start:0,end:260}};le.loc.source={body:`#import "../queries/paymentRequestFragment.graphql"
|
|
163
|
+
|
|
164
|
+
mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInput!) {
|
|
165
|
+
createDirectPayment(createDirectPaymentInput: $createDirectPaymentInput) {
|
|
166
|
+
...PaymentRequestFragment
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var pi={};function ha(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return pi[t]?!1:(pi[t]=!0,!0)})}le.definitions=le.definitions.concat(ha(pn.definitions));function hn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){hn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){hn(i,n)}),e.definitions&&e.definitions.forEach(function(i){hn(i,n)})}var Kn={};(function(){le.definitions.forEach(function(n){if(n.name){var t=new Set;hn(n,t),Kn[n.name.value]=t}})})();function mi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function ya(e,n){var t={kind:e.kind,definitions:[mi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Kn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=Kn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=mi(e,o);s&&t.definitions.push(s)}),t}ya(le,"CreatePaymentRequest");var yn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetSpritzPayParams"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"tokenAddress"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"amount"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"reference"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"network"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spritzPayParams"},arguments:[{kind:"Argument",name:{kind:"Name",value:"tokenAddress"},value:{kind:"Variable",name:{kind:"Name",value:"tokenAddress"}}},{kind:"Argument",name:{kind:"Name",value:"amount"},value:{kind:"Variable",name:{kind:"Name",value:"amount"}}},{kind:"Argument",name:{kind:"Name",value:"reference"},value:{kind:"Variable",name:{kind:"Name",value:"reference"}}},{kind:"Argument",name:{kind:"Name",value:"network"},value:{kind:"Variable",name:{kind:"Name",value:"network"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contractAddress"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"method"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"calldata"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"requiredTokenInput"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"suggestedGasLimit"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:399}};yn.loc.source={body:`query GetSpritzPayParams(
|
|
170
|
+
$tokenAddress: String!
|
|
171
|
+
$amount: Float!
|
|
172
|
+
$reference: String!
|
|
173
|
+
$network: String!
|
|
174
|
+
) {
|
|
175
|
+
spritzPayParams(
|
|
176
|
+
tokenAddress: $tokenAddress
|
|
177
|
+
amount: $amount
|
|
178
|
+
reference: $reference
|
|
179
|
+
network: $network
|
|
180
|
+
) {
|
|
181
|
+
contractAddress
|
|
182
|
+
method
|
|
183
|
+
calldata
|
|
184
|
+
value
|
|
185
|
+
requiredTokenInput
|
|
186
|
+
suggestedGasLimit
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function gn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){gn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){gn(i,n)}),e.definitions&&e.definitions.forEach(function(i){gn(i,n)})}var Wn={};(function(){yn.definitions.forEach(function(n){if(n.name){var t=new Set;gn(n,t),Wn[n.name.value]=t}})})();function hi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function ga(e,n){var t={kind:e.kind,definitions:[hi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Wn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=Wn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=hi(e,o);s&&t.definitions.push(s)}),t}ga(yn,"GetSpritzPayParams");var yi=Z({"node_modules/@noble/hashes/_assert.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.output=e.exists=e.hash=e.bytes=e.bool=e.number=void 0;function n(s){if(!Number.isSafeInteger(s)||s<0)throw new Error(`Wrong positive integer: ${s}`)}e.number=n;function t(s){if(typeof s!="boolean")throw new Error(`Expected boolean, not ${s}`)}e.bool=t;function i(s,...l){if(!(s instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length>0&&!l.includes(s.length))throw new TypeError(`Expected Uint8Array of length ${l}, not of length=${s.length}`)}e.bytes=i;function r(s){if(typeof s!="function"||typeof s.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");n(s.outputLen),n(s.blockLen)}e.hash=r;function a(s,l=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(l&&s.finished)throw new Error("Hash#digest() has already been called")}e.exists=a;function u(s,l){i(s);const g=l.outputLen;if(s.length<g)throw new Error(`digestInto() expects output buffer of length at least ${g}`)}e.output=u;var o={number:n,bool:t,bytes:i,hash:r,exists:a,output:u};e.default=o}}),ka=Z({"node_modules/@noble/hashes/crypto.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=void 0,e.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0}}),Zn=Z({"node_modules/@noble/hashes/utils.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.isLE=e.rotr=e.createView=e.u32=e.u8=void 0;var n=ka(),t=f=>new Uint8Array(f.buffer,f.byteOffset,f.byteLength);e.u8=t;var i=f=>new Uint32Array(f.buffer,f.byteOffset,Math.floor(f.byteLength/4));e.u32=i;var r=f=>new DataView(f.buffer,f.byteOffset,f.byteLength);e.createView=r;var a=(f,c)=>f<<32-c|f>>>c;if(e.rotr=a,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!e.isLE)throw new Error("Non little-endian hardware is not supported");var u=Array.from({length:256},(f,c)=>c.toString(16).padStart(2,"0"));function o(f){if(!(f instanceof Uint8Array))throw new Error("Uint8Array expected");let c="";for(let S=0;S<f.length;S++)c+=u[f[S]];return c}e.bytesToHex=o;function s(f){if(typeof f!="string")throw new TypeError("hexToBytes: expected string, got "+typeof f);if(f.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const c=new Uint8Array(f.length/2);for(let S=0;S<c.length;S++){const v=S*2,b=f.slice(v,v+2),A=Number.parseInt(b,16);if(Number.isNaN(A)||A<0)throw new Error("Invalid byte sequence");c[S]=A}return c}e.hexToBytes=s;var l=async()=>{};e.nextTick=l;async function g(f,c,S){let v=Date.now();for(let b=0;b<f;b++){S(b);const A=Date.now()-v;A>=0&&A<c||(await(0,e.nextTick)(),v+=A)}}e.asyncLoop=g;function E(f){if(typeof f!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof f}`);return new TextEncoder().encode(f)}e.utf8ToBytes=E;function y(f){if(typeof f=="string"&&(f=E(f)),!(f instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof f})`);return f}e.toBytes=y;function d(...f){if(!f.every(v=>v instanceof Uint8Array))throw new Error("Uint8Array list expected");if(f.length===1)return f[0];const c=f.reduce((v,b)=>v+b.length,0),S=new Uint8Array(c);for(let v=0,b=0;v<f.length;v++){const A=f[v];S.set(A,b),b+=A.length}return S}e.concatBytes=d;var N=class{clone(){return this._cloneInto()}};e.Hash=N;var w=f=>Object.prototype.toString.call(f)==="[object Object]"&&f.constructor===Object;function O(f,c){if(c!==void 0&&(typeof c!="object"||!w(c)))throw new TypeError("Options should be object or undefined");return Object.assign(f,c)}e.checkOpts=O;function D(f){const c=v=>f().update(y(v)).digest(),S=f();return c.outputLen=S.outputLen,c.blockLen=S.blockLen,c.create=()=>f(),c}e.wrapConstructor=D;function P(f){const c=(v,b)=>f(b).update(y(v)).digest(),S=f({});return c.outputLen=S.outputLen,c.blockLen=S.blockLen,c.create=v=>f(v),c}e.wrapConstructorWithOpts=P;function L(f=32){if(n.crypto&&typeof n.crypto.getRandomValues=="function")return n.crypto.getRandomValues(new Uint8Array(f));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=L}}),gi=Z({"node_modules/ethereum-cryptography/utils.js"(e,n){var t=e&&e.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=e.wrapHash=e.equalsBytes=e.hexToBytes=e.bytesToUtf8=e.utf8ToBytes=e.createView=e.concatBytes=e.toHex=e.bytesToHex=e.assertBytes=e.assertBool=void 0;var i=t(yi()),r=Zn(),a=i.default.bool;e.assertBool=a;var u=i.default.bytes;e.assertBytes=u;var o=Zn();Object.defineProperty(e,"bytesToHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(e,"concatBytes",{enumerable:!0,get:function(){return o.concatBytes}}),Object.defineProperty(e,"createView",{enumerable:!0,get:function(){return o.createView}}),Object.defineProperty(e,"utf8ToBytes",{enumerable:!0,get:function(){return o.utf8ToBytes}});function s(y){if(!(y instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof y}`);return new TextDecoder().decode(y)}e.bytesToUtf8=s;function l(y){const d=y.startsWith("0x")?y.substring(2):y;return(0,r.hexToBytes)(d)}e.hexToBytes=l;function g(y,d){if(y.length!==d.length)return!1;for(let N=0;N<y.length;N++)if(y[N]!==d[N])return!1;return!0}e.equalsBytes=g;function E(y){return d=>(i.default.bytes(d),y(d))}e.wrapHash=E,e.crypto=(()=>{const y=typeof self=="object"&&"crypto"in self?self.crypto:void 0,d=typeof n<"u"&&typeof n.require=="function"&&n.require.bind(n);return{node:d&&!y?d("crypto"):void 0,web:y}})()}});/*! Bundled license information:
|
|
190
|
+
|
|
191
|
+
@noble/hashes/utils.js:
|
|
192
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
193
|
+
*/var Sa=Z({"node_modules/@noble/hashes/_u64.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.add=e.toBig=e.split=e.fromBig=void 0;var n=BigInt(2**32-1),t=BigInt(32);function i(m,p=!1){return p?{h:Number(m&n),l:Number(m>>t&n)}:{h:Number(m>>t&n)|0,l:Number(m&n)|0}}e.fromBig=i;function r(m,p=!1){let T=new Uint32Array(m.length),M=new Uint32Array(m.length);for(let x=0;x<m.length;x++){const{h:J,l:En}=i(m[x],p);[T[x],M[x]]=[J,En]}return[T,M]}e.split=r;var a=(m,p)=>BigInt(m>>>0)<<t|BigInt(p>>>0);e.toBig=a;var u=(m,p,T)=>m>>>T,o=(m,p,T)=>m<<32-T|p>>>T,s=(m,p,T)=>m>>>T|p<<32-T,l=(m,p,T)=>m<<32-T|p>>>T,g=(m,p,T)=>m<<64-T|p>>>T-32,E=(m,p,T)=>m>>>T-32|p<<64-T,y=(m,p)=>p,d=(m,p)=>m,N=(m,p,T)=>m<<T|p>>>32-T,w=(m,p,T)=>p<<T|m>>>32-T,O=(m,p,T)=>p<<T-32|m>>>64-T,D=(m,p,T)=>m<<T-32|p>>>64-T;function P(m,p,T,M){const x=(p>>>0)+(M>>>0);return{h:m+T+(x/2**32|0)|0,l:x|0}}e.add=P;var L=(m,p,T)=>(m>>>0)+(p>>>0)+(T>>>0),f=(m,p,T,M)=>p+T+M+(m/2**32|0)|0,c=(m,p,T,M)=>(m>>>0)+(p>>>0)+(T>>>0)+(M>>>0),S=(m,p,T,M,x)=>p+T+M+x+(m/2**32|0)|0,v=(m,p,T,M,x)=>(m>>>0)+(p>>>0)+(T>>>0)+(M>>>0)+(x>>>0),b=(m,p,T,M,x,J)=>p+T+M+x+J+(m/2**32|0)|0,A={fromBig:i,split:r,toBig:e.toBig,shrSH:u,shrSL:o,rotrSH:s,rotrSL:l,rotrBH:g,rotrBL:E,rotr32H:y,rotr32L:d,rotlSH:N,rotlSL:w,rotlBH:O,rotlBL:D,add:P,add3L:L,add3H:f,add4L:c,add4H:S,add5H:b,add5L:v};e.default=A}}),Ta=Z({"node_modules/@noble/hashes/sha3.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.shake256=e.shake128=e.keccak_512=e.keccak_384=e.keccak_256=e.keccak_224=e.sha3_512=e.sha3_384=e.sha3_256=e.sha3_224=e.Keccak=e.keccakP=void 0;var n=yi(),t=Sa(),i=Zn(),[r,a,u]=[[],[],[]],o=BigInt(0),s=BigInt(1),l=BigInt(2),g=BigInt(7),E=BigInt(256),y=BigInt(113);for(let c=0,S=s,v=1,b=0;c<24;c++){[v,b]=[b,(2*v+3*b)%5],r.push(2*(5*b+v)),a.push((c+1)*(c+2)/2%64);let A=o;for(let m=0;m<7;m++)S=(S<<s^(S>>g)*y)%E,S&l&&(A^=s<<(s<<BigInt(m))-s);u.push(A)}var[d,N]=t.default.split(u,!0),w=(c,S,v)=>v>32?t.default.rotlBH(c,S,v):t.default.rotlSH(c,S,v),O=(c,S,v)=>v>32?t.default.rotlBL(c,S,v):t.default.rotlSL(c,S,v);function D(c,S=24){const v=new Uint32Array(10);for(let b=24-S;b<24;b++){for(let p=0;p<10;p++)v[p]=c[p]^c[p+10]^c[p+20]^c[p+30]^c[p+40];for(let p=0;p<10;p+=2){const T=(p+8)%10,M=(p+2)%10,x=v[M],J=v[M+1],En=w(x,J,1)^v[T],wi=O(x,J,1)^v[T+1];for(let Me=0;Me<50;Me+=10)c[p+Me]^=En,c[p+Me+1]^=wi}let A=c[2],m=c[3];for(let p=0;p<24;p++){const T=a[p],M=w(A,m,T),x=O(A,m,T),J=r[p];A=c[J],m=c[J+1],c[J]=M,c[J+1]=x}for(let p=0;p<50;p+=10){for(let T=0;T<10;T++)v[T]=c[p+T];for(let T=0;T<10;T++)c[p+T]^=~v[(T+2)%10]&v[(T+4)%10]}c[0]^=d[b],c[1]^=N[b]}v.fill(0)}e.keccakP=D;var P=class extends i.Hash{constructor(c,S,v,b=!1,A=24){if(super(),this.blockLen=c,this.suffix=S,this.outputLen=v,this.enableXOF=b,this.rounds=A,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,n.default.number(v),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,i.u32)(this.state)}keccak(){D(this.state32,this.rounds),this.posOut=0,this.pos=0}update(c){n.default.exists(this);const{blockLen:S,state:v}=this;c=(0,i.toBytes)(c);const b=c.length;for(let A=0;A<b;){const m=Math.min(S-this.pos,b-A);for(let p=0;p<m;p++)v[this.pos++]^=c[A++];this.pos===S&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:c,suffix:S,pos:v,blockLen:b}=this;c[v]^=S,S&128&&v===b-1&&this.keccak(),c[b-1]^=128,this.keccak()}writeInto(c){n.default.exists(this,!1),n.default.bytes(c),this.finish();const S=this.state,{blockLen:v}=this;for(let b=0,A=c.length;b<A;){this.posOut>=v&&this.keccak();const m=Math.min(v-this.posOut,A-b);c.set(S.subarray(this.posOut,this.posOut+m),b),this.posOut+=m,b+=m}return c}xofInto(c){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(c)}xof(c){return n.default.number(c),this.xofInto(new Uint8Array(c))}digestInto(c){if(n.default.output(c,this),this.finished)throw new Error("digest() was already called");return this.writeInto(c),this.destroy(),c}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(c){const{blockLen:S,suffix:v,outputLen:b,rounds:A,enableXOF:m}=this;return c||(c=new P(S,v,b,m,A)),c.state32.set(this.state32),c.pos=this.pos,c.posOut=this.posOut,c.finished=this.finished,c.rounds=A,c.suffix=v,c.outputLen=b,c.enableXOF=m,c.destroyed=this.destroyed,c}};e.Keccak=P;var L=(c,S,v)=>(0,i.wrapConstructor)(()=>new P(S,c,v));e.sha3_224=L(6,144,224/8),e.sha3_256=L(6,136,256/8),e.sha3_384=L(6,104,384/8),e.sha3_512=L(6,72,512/8),e.keccak_224=L(1,144,224/8),e.keccak_256=L(1,136,256/8),e.keccak_384=L(1,104,384/8),e.keccak_512=L(1,72,512/8);var f=(c,S,v)=>(0,i.wrapConstructorWithOpts)((b={})=>new P(S,c,b.dkLen===void 0?v:b.dkLen,!0));e.shake128=f(31,168,128/8),e.shake256=f(31,136,256/8)}}),Na=Z({"node_modules/ethereum-cryptography/keccak.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.keccak512=e.keccak384=e.keccak256=e.keccak224=void 0;var n=Ta(),t=gi();e.keccak224=(0,t.wrapHash)(n.keccak_224),e.keccak256=(()=>{const i=(0,t.wrapHash)(n.keccak_256);return i.create=n.keccak_256.create,i})(),e.keccak384=(0,t.wrapHash)(n.keccak_384),e.keccak512=(0,t.wrapHash)(n.keccak_512)}}),ba=Z({"optimize-deps:ethereum-cryptography/keccak"(e,n){n.exports=Na()}}),Ea=ba(),Ia=Z({"optimize-deps:ethereum-cryptography/utils"(e,n){n.exports=gi()}}),wa=Ia();function Aa(e){let n="0x";for(const t of e){const i=t.toString(16);n+=i.length===1?`0${i}`:i}return n}const Da=e=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(e))return!1;const n=e.slice(2),t=wa.utf8ToBytes(n.toLowerCase()),i=Aa(Ea.keccak256(t)).slice(2);for(let r=0;r<40;r+=1)if(parseInt(i[r],16)>7&&n[r].toUpperCase()!==n[r]||parseInt(i[r],16)<=7&&n[r].toLowerCase()!==n[r])return!1;return!0};function Oa(e){return/^0x[0-9a-f]{40}$/i.test(e)?/^0x[0-9a-f]{40}$/.test(e)||/^(0x|0X)[0-9A-F]{40}$/.test(e)?!0:Da(e):!1}const et=e=>Math.round((e+Number.EPSILON)*100)/100;class _a{client;constructor(n){this.client=n}async create(n){return(await this.client.query({query:le,variables:{createDirectPaymentInput:{...n,amount:et(n.amount),provider:Qn.CHECKBOOK}}}))?.createDirectPayment}async transactionPrice(n){return(await this.client.query({query:le,variables:{amount:et(n)}}))?.transactionPrice??0}async getWeb3PaymentParams(n){if(!Oa(n.paymentTokenAddress))throw new Error("Invalid token address");return(await this.client.query({query:yn,variables:{amount:et(n.paymentRequest.amountDue),network:n.paymentRequest.network,tokenAddress:n.paymentTokenAddress,reference:n.paymentRequest.id}}))?.spritzPayParams}}var kn={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"UserFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sub"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"firstName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"picture"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timezone"},arguments:[],directives:[]}]}}],loc:{start:0,end:135}};kn.loc.source={body:`fragment UserFragment on User {
|
|
129
194
|
id
|
|
130
195
|
sub
|
|
131
196
|
email
|
|
@@ -136,14 +201,14 @@ query UserBankAccounts {
|
|
|
136
201
|
createdAt
|
|
137
202
|
timezone
|
|
138
203
|
}
|
|
139
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function
|
|
204
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function Sn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Sn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Sn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Sn(i,n)})}var nt={};(function(){kn.definitions.forEach(function(n){if(n.name){var t=new Set;Sn(n,t),nt[n.name.value]=t}})})();function ki(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Fa(e,n){var t={kind:e.kind,definitions:[ki(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=nt[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=nt[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=ki(e,o);s&&t.definitions.push(s)}),t}Fa(kn,"UserFragment");var Ie={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"CurrentUser"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"UserFragment"},directives:[]}]}}]}}],loc:{start:0,end:95}};Ie.loc.source={body:`#import "./userFragment.graphql"
|
|
140
205
|
|
|
141
206
|
query CurrentUser {
|
|
142
207
|
me {
|
|
143
208
|
...UserFragment
|
|
144
209
|
}
|
|
145
210
|
}
|
|
146
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
211
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Si={};function La(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Si[t]?!1:(Si[t]=!0,!0)})}Ie.definitions=Ie.definitions.concat(La(kn.definitions));function Tn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Tn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Tn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Tn(i,n)})}var tt={};(function(){Ie.definitions.forEach(function(n){if(n.name){var t=new Set;Tn(n,t),tt[n.name.value]=t}})})();function Ti(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Ra(e,n){var t={kind:e.kind,definitions:[Ti(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=tt[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=tt[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=Ti(e,o);s&&t.definitions.push(s)}),t}Ra(Ie,"CurrentUser");var Nn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserVerification"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"verification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"identity"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"firstName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"completedAt"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:297}};Nn.loc.source={body:`query UserVerification {
|
|
147
212
|
verification {
|
|
148
213
|
userId
|
|
149
214
|
identity {
|
|
@@ -159,5 +224,5 @@ query CurrentUser {
|
|
|
159
224
|
}
|
|
160
225
|
}
|
|
161
226
|
}
|
|
162
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function
|
|
227
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function bn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){bn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){bn(i,n)}),e.definitions&&e.definitions.forEach(function(i){bn(i,n)})}var it={};(function(){Nn.definitions.forEach(function(n){if(n.name){var t=new Set;bn(n,t),it[n.name.value]=t}})})();function Ni(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Pa(e,n){var t={kind:e.kind,definitions:[Ni(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=it[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=it[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=Ni(e,o);s&&t.definitions.push(s)}),t}Pa(Nn,"UserVerification");class Ua{client;constructor(n){this.client=n}async getCurrentUser(){return(await this.client.query({query:Ie}))?.me??null}async getUserVerification(){return(await this.client.query({query:Nn}))?.verification??null}}class rt{client;user;bankAccount;paymentRequest;payment;static initialize({environment:n,apiKey:t,integrationKey:i}){const r=new rt;return r.init(n,t,i),r}init(n,t,i){this.client=new Yr(n,t,i),this.user=new Ua(this.client),this.bankAccount=new ua(this.client),this.paymentRequest=new _a(this.client),this.payment=new pa(this.client)}}var bi=(e=>(e.Staging="staging",e.Production="production",e))(bi||{}),Ei=(e=>(e.Ethereum="ethereum",e.Polygon="polygon",e.Optimism="optimism",e.Arbitrum="arbitrum",e.Binance="binance-smart-chain",e.Avalanche="avalanche",e.Bitcoin="bitcoin",e.BitcoinTestnet="bitcoin-testnet",e.Dash="dash",e.DashTestnet="dash-testnet",e))(Ei||{});exports.AccountProvider=Qn,exports.BankAccountSubType=ii,exports.BankAccountType=Jn,exports.DirectPaymentStatus=ri,exports.Environment=bi,exports.ModuleStatus=ai,exports.PayableAccountType=oi,exports.PaymentNetwork=Ei,exports.PaymentStatus=si,exports.SpritzApiClient=rt;
|
|
163
228
|
//# sourceMappingURL=spritz-api-client.js.map
|