@spritz-finance/api-client 0.15.0 → 0.16.0

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.
@@ -39,7 +39,7 @@ spurious results.`))}}return!1};function xp(e,n){for(var t=0;t<n.length;t++){var
39
39
  `))}function Gp(e){return e.indexOf(`
40
40
  `)!==-1}function lc(e){return e!=null&&e.some(Gp)}function Tr(e,n){switch(e.kind){case C.NULL:return null;case C.INT:return parseInt(e.value,10);case C.FLOAT:return parseFloat(e.value);case C.STRING:case C.ENUM:case C.BOOLEAN:return e.value;case C.LIST:return e.values.map(function(t){return Tr(t,n)});case C.OBJECT:return Fr(e.fields,function(t){return t.name.value},function(t){return Tr(t.value,n)});case C.VARIABLE:return n?.[e.name.value]}Tt(0,"Unexpected value node: "+J(e))}function Jp(e,n){for(var t=0;t<n.length;t++){var u=n[t];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(e,u.key,u)}}function Ln(e,n,t){return n&&Jp(e.prototype,n),e}function dc(e){return zt(e)||Ve(e)||xe(e)||an(e)||on(e)||An(e)||Ut(e)||Zn(e)}function Hp(e){if(!dc(e))throw new Error("Expected ".concat(J(e)," to be a GraphQL type."));return e}function zt(e){return He(e,_n)}function Ve(e){return He(e,sn)}function xe(e){return He(e,hc)}function an(e){return He(e,gc)}function on(e){return He(e,_i)}function An(e){return He(e,Ec)}function Ut(e){return He(e,ce)}function Zn(e){return He(e,j)}function Vn(e){return zt(e)||on(e)||An(e)||zr(e)&&Vn(e.ofType)}function wi(e){return zt(e)||Ve(e)||xe(e)||an(e)||on(e)||zr(e)&&wi(e.ofType)}function Kp(e){return zt(e)||on(e)}function Or(e){return Ve(e)||xe(e)||an(e)}function Qp(e){return xe(e)||an(e)}function ce(e){if(this instanceof ce)this.ofType=Hp(e);else return new ce(e)}ce.prototype.toString=function(){return"["+String(this.ofType)+"]"},ce.prototype.toJSON=function(){return this.toString()},Object.defineProperty(ce.prototype,$e,{get:function(){return"GraphQLList"}}),ze(ce);function j(e){if(this instanceof j)this.ofType=Yp(e);else return new j(e)}j.prototype.toString=function(){return String(this.ofType)+"!"},j.prototype.toJSON=function(){return this.toString()},Object.defineProperty(j.prototype,$e,{get:function(){return"GraphQLNonNull"}}),ze(j);function zr(e){return Ut(e)||Zn(e)}function Wp(e){return dc(e)&&!Zn(e)}function Yp(e){if(!Wp(e))throw new Error("Expected ".concat(J(e)," to be a GraphQL nullable type."));return e}function Xp(e){if(e)return Zn(e)?e.ofType:e}function Pt(e){if(e){for(var n=e;zr(n);)n=n.ofType;return n}}function Ai(e){return typeof e=="function"?e():e}function qn(e){return e&&e.length>0?e:void 0}var _n=function(){function e(t){var u,i,r,a=(u=t.parseValue)!==null&&u!==void 0?u:sc;this.name=t.name,this.description=t.description,this.specifiedByUrl=t.specifiedByUrl,this.serialize=(i=t.serialize)!==null&&i!==void 0?i:sc,this.parseValue=a,this.parseLiteral=(r=t.parseLiteral)!==null&&r!==void 0?r:function(o,s){return a(Tr(o,s))},this.extensions=t.extensions&&_e(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=qn(t.extensionASTNodes),typeof t.name=="string"||q(0,"Must provide name."),t.specifiedByUrl==null||typeof t.specifiedByUrl=="string"||q(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat(J(t.specifiedByUrl),".")),t.serialize==null||typeof t.serialize=="function"||q(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"||q(0,"".concat(this.name,' must provide both "parseValue" and "parseLiteral" functions.')))}var n=e.prototype;return n.toConfig=function(){var u;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:(u=this.extensionASTNodes)!==null&&u!==void 0?u:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},Ln(e,[{key:$e,get:function(){return"GraphQLScalarType"}}]),e}();ze(_n);var sn=function(){function e(t){this.name=t.name,this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=t.extensions&&_e(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=qn(t.extensionASTNodes),this._fields=mc.bind(void 0,t),this._interfaces=fc.bind(void 0,t),typeof t.name=="string"||q(0,"Must provide name."),t.isTypeOf==null||typeof t.isTypeOf=="function"||q(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat(J(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:vc(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()},Ln(e,[{key:$e,get:function(){return"GraphQLObjectType"}}]),e}();ze(sn);function fc(e){var n,t=(n=Ai(e.interfaces))!==null&&n!==void 0?n:[];return Array.isArray(t)||q(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),t}function mc(e){var n=Ai(e.fields);return Mn(n)||q(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),Di(n,function(t,u){var i;Mn(t)||q(0,"".concat(e.name,".").concat(u," field config must be an object.")),!("isDeprecated"in t)||q(0,"".concat(e.name,".").concat(u,' should provide "deprecationReason" instead of "isDeprecated".')),t.resolve==null||typeof t.resolve=="function"||q(0,"".concat(e.name,".").concat(u," field resolver must be a function if ")+"provided, but got: ".concat(J(t.resolve),"."));var r=(i=t.args)!==null&&i!==void 0?i:{};Mn(r)||q(0,"".concat(e.name,".").concat(u," args must be an object with argument names as keys."));var a=Ot(r).map(function(o){var s=o[0],c=o[1];return{name:s,description:c.description,type:c.type,defaultValue:c.defaultValue,deprecationReason:c.deprecationReason,extensions:c.extensions&&_e(c.extensions),astNode:c.astNode}});return{name:u,description:t.description,type:t.type,args:a,resolve:t.resolve,subscribe:t.subscribe,isDeprecated:t.deprecationReason!=null,deprecationReason:t.deprecationReason,extensions:t.extensions&&_e(t.extensions),astNode:t.astNode}})}function Mn(e){return Bn(e)&&!Array.isArray(e)}function vc(e){return Di(e,function(n){return{description:n.description,type:n.type,args:pc(n.args),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}})}function pc(e){return Fr(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 hc=function(){function e(t){this.name=t.name,this.description=t.description,this.resolveType=t.resolveType,this.extensions=t.extensions&&_e(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=qn(t.extensionASTNodes),this._fields=mc.bind(void 0,t),this._interfaces=fc.bind(void 0,t),typeof t.name=="string"||q(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||q(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(J(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 u;return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:vc(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(u=this.extensionASTNodes)!==null&&u!==void 0?u:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},Ln(e,[{key:$e,get:function(){return"GraphQLInterfaceType"}}]),e}();ze(hc);var gc=function(){function e(t){this.name=t.name,this.description=t.description,this.resolveType=t.resolveType,this.extensions=t.extensions&&_e(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=qn(t.extensionASTNodes),this._types=eh.bind(void 0,t),typeof t.name=="string"||q(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||q(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(J(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 u;return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(u=this.extensionASTNodes)!==null&&u!==void 0?u:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},Ln(e,[{key:$e,get:function(){return"GraphQLUnionType"}}]),e}();ze(gc);function eh(e){var n=Ai(e.types);return Array.isArray(n)||q(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),n}var _i=function(){function e(t){this.name=t.name,this.description=t.description,this.extensions=t.extensions&&_e(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=qn(t.extensionASTNodes),this._values=nh(this.name,t.values),this._valueLookup=new Map(this._values.map(function(u){return[u.value,u]})),this._nameLookup=oc(this._values,function(u){return u.name}),typeof t.name=="string"||q(0,"Must provide name.")}var n=e.prototype;return n.getValues=function(){return this._values},n.getValue=function(u){return this._nameLookup[u]},n.serialize=function(u){var i=this._valueLookup.get(u);if(i===void 0)throw new ne('Enum "'.concat(this.name,'" cannot represent value: ').concat(J(u)));return i.name},n.parseValue=function(u){if(typeof u!="string"){var i=J(u);throw new ne('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(i,".")+Ci(this,i))}var r=this.getValue(u);if(r==null)throw new ne('Value "'.concat(u,'" does not exist in "').concat(this.name,'" enum.')+Ci(this,u));return r.value},n.parseLiteral=function(u,i){if(u.kind!==C.ENUM){var r=Ke(u);throw new ne('Enum "'.concat(this.name,'" cannot represent non-enum value: ').concat(r,".")+Ci(this,r),u)}var a=this.getValue(u.value);if(a==null){var o=Ke(u);throw new ne('Value "'.concat(o,'" does not exist in "').concat(this.name,'" enum.')+Ci(this,o),u)}return a.value},n.toConfig=function(){var u,i=Fr(this.getValues(),function(r){return r.name},function(r){return{description:r.description,value:r.value,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}});return{name:this.name,description:this.description,values:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(u=this.extensionASTNodes)!==null&&u!==void 0?u:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},Ln(e,[{key:$e,get:function(){return"GraphQLEnumType"}}]),e}();ze(_i);function Ci(e,n){var t=e.getValues().map(function(i){return i.name}),u=Zp(n,t);return Rp("the enum value",u)}function nh(e,n){return Mn(n)||q(0,"".concat(e," values must be an object with value names as keys.")),Ot(n).map(function(t){var u=t[0],i=t[1];return Mn(i)||q(0,"".concat(e,".").concat(u,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat(J(i),".")),!("isDeprecated"in i)||q(0,"".concat(e,".").concat(u,' should provide "deprecationReason" instead of "isDeprecated".')),{name:u,description:i.description,value:i.value!==void 0?i.value:u,isDeprecated:i.deprecationReason!=null,deprecationReason:i.deprecationReason,extensions:i.extensions&&_e(i.extensions),astNode:i.astNode}})}var Ec=function(){function e(t){this.name=t.name,this.description=t.description,this.extensions=t.extensions&&_e(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=qn(t.extensionASTNodes),this._fields=th.bind(void 0,t),typeof t.name=="string"||q(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 u,i=Di(this.getFields(),function(r){return{description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}});return{name:this.name,description:this.description,fields:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(u=this.extensionASTNodes)!==null&&u!==void 0?u:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},Ln(e,[{key:$e,get:function(){return"GraphQLInputObjectType"}}]),e}();ze(Ec);function th(e){var n=Ai(e.fields);return Mn(n)||q(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),Di(n,function(t,u){return!("resolve"in t)||q(0,"".concat(e.name,".").concat(u," field has a resolve property, but Input Types cannot define resolvers.")),{name:u,description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions&&_e(t.extensions),astNode:t.astNode}})}var ih=Array.from||function(e,n,t){if(e==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");var u=e[Ws];if(typeof u=="function"){for(var i=u.call(e),r=[],a,o=0;!(a=i.next()).done;++o)if(r.push(n.call(t,a.value,o)),o>9999999)throw new TypeError("Near-infinite iteration.");return r}var s=e.length;if(typeof s=="number"&&s>=0&&s%1===0){for(var c=[],l=0;l<s;++l)Object.prototype.hasOwnProperty.call(e,l)&&c.push(n.call(t,e[l],l));return c}return[]},uh=ih,rh=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},Rt=rh;function $i(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$i=function(t){return typeof t}:$i=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$i(e)}function ah(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(l){return l};if(e==null||$i(e)!=="object")return null;if(Array.isArray(e))return e.map(n);var t=e[Ws];if(typeof t=="function"){for(var u=t.call(e),i=[],r,a=0;!(r=u.next()).done;++a)i.push(n(r.value,a));return i}var o=e.length;if(typeof o=="number"&&o>=0&&o%1===0){for(var s=[],c=0;c<o;++c){if(!Object.prototype.hasOwnProperty.call(e,c))return null;s.push(n(e[String(c)],c))}return s}return null}var oh=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},xi=oh,Ur=2147483647,Pr=-2147483648;function sh(e){var n=jt(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!xi(t))throw new ne("Int cannot represent non-integer value: ".concat(J(n)));if(t>Ur||t<Pr)throw new ne("Int cannot represent non 32-bit signed integer value: "+J(n));return t}function ch(e){if(!xi(e))throw new ne("Int cannot represent non-integer value: ".concat(J(e)));if(e>Ur||e<Pr)throw new ne("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var lh=new _n({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:sh,parseValue:ch,parseLiteral:function(n){if(n.kind!==C.INT)throw new ne("Int cannot represent non-integer value: ".concat(Ke(n)),n);var t=parseInt(n.value,10);if(t>Ur||t<Pr)throw new ne("Int cannot represent non 32-bit signed integer value: ".concat(n.value),n);return t}});function dh(e){var n=jt(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!Rt(t))throw new ne("Float cannot represent non numeric value: ".concat(J(n)));return t}function fh(e){if(!Rt(e))throw new ne("Float cannot represent non numeric value: ".concat(J(e)));return e}var mh=new _n({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:dh,parseValue:fh,parseLiteral:function(n){if(n.kind!==C.FLOAT&&n.kind!==C.INT)throw new ne("Float cannot represent non numeric value: ".concat(Ke(n)),n);return parseFloat(n.value)}});function jt(e){if(Bn(e)){if(typeof e.valueOf=="function"){var n=e.valueOf();if(!Bn(n))return n}if(typeof e.toJSON=="function")return e.toJSON()}return e}function vh(e){var n=jt(e);if(typeof n=="string")return n;if(typeof n=="boolean")return n?"true":"false";if(Rt(n))return n.toString();throw new ne("String cannot represent value: ".concat(J(e)))}function ph(e){if(typeof e!="string")throw new ne("String cannot represent a non string value: ".concat(J(e)));return e}var ie=new _n({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:vh,parseValue:ph,parseLiteral:function(n){if(n.kind!==C.STRING)throw new ne("String cannot represent a non string value: ".concat(Ke(n)),n);return n.value}});function hh(e){var n=jt(e);if(typeof n=="boolean")return n;if(Rt(n))return n!==0;throw new ne("Boolean cannot represent a non boolean value: ".concat(J(n)))}function gh(e){if(typeof e!="boolean")throw new ne("Boolean cannot represent a non boolean value: ".concat(J(e)));return e}var Ie=new _n({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:hh,parseValue:gh,parseLiteral:function(n){if(n.kind!==C.BOOLEAN)throw new ne("Boolean cannot represent a non boolean value: ".concat(Ke(n)),n);return n.value}});function Eh(e){var n=jt(e);if(typeof n=="string")return n;if(xi(n))return String(n);throw new ne("ID cannot represent value: ".concat(J(e)))}function yh(e){if(typeof e=="string")return e;if(xi(e))return e.toString();throw new ne("ID cannot represent value: ".concat(J(e)))}var yc=new _n({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:Eh,parseValue:yh,parseLiteral:function(n){if(n.kind!==C.STRING&&n.kind!==C.INT)throw new ne("ID cannot represent a non-string and non-integer value: "+Ke(n),n);return n.value}}),bc=Object.freeze([ie,lh,mh,Ie,yc]);function Lt(e,n){if(Zn(n)){var t=Lt(e,n.ofType);return t?.kind===C.NULL?null:t}if(e===null)return{kind:C.NULL};if(e===void 0)return null;if(Ut(n)){var u=n.ofType,i=ah(e);if(i!=null){for(var r=[],a=0;a<i.length;a++){var o=i[a],s=Lt(o,u);s!=null&&r.push(s)}return{kind:C.LIST,values:r}}return Lt(e,u)}if(An(n)){if(!Bn(e))return null;for(var c=[],l=0,f=wn(n.getFields());l<f.length;l++){var m=f[l],d=Lt(e[m.name],m.type);d&&c.push({kind:C.OBJECT_FIELD,name:{kind:C.NAME,value:m.name},value:d})}return{kind:C.OBJECT,fields:c}}if(Kp(n)){var v=n.serialize(e);if(v==null)return null;if(typeof v=="boolean")return{kind:C.BOOLEAN,value:v};if(typeof v=="number"&&Rt(v)){var h=String(v);return kc.test(h)?{kind:C.INT,value:h}:{kind:C.FLOAT,value:h}}if(typeof v=="string")return on(n)?{kind:C.ENUM,value:v}:n===yc&&kc.test(v)?{kind:C.INT,value:v}:{kind:C.STRING,value:v};throw new TypeError("Cannot convert value to AST: ".concat(J(v),"."))}Tt(0,"Unexpected input type: "+J(n))}var kc=/^-?(?:0|[1-9][0-9]*)$/,Rr=new sn({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:ie,resolve:function(t){return t.description}},types:{description:"A list of all types supported by this server.",type:new j(new ce(new j(Re))),resolve:function(t){return wn(t.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new j(Re),resolve:function(t){return t.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Re,resolve:function(t){return t.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Re,resolve:function(t){return t.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new j(new ce(new j(Dc))),resolve:function(t){return t.getDirectives()}}}}}),Dc=new sn({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 j(ie),resolve:function(t){return t.name}},description:{type:ie,resolve:function(t){return t.description}},isRepeatable:{type:new j(Ie),resolve:function(t){return t.isRepeatable}},locations:{type:new j(new ce(new j(Sc))),resolve:function(t){return t.locations}},args:{type:new j(new ce(new j(Ii))),args:{includeDeprecated:{type:Ie,defaultValue:!1}},resolve:function(t,u){var i=u.includeDeprecated;return i?t.args:t.args.filter(function(r){return r.deprecationReason==null})}}}}}),Sc=new _i({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."}}}),Re=new sn({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 j(Ac),resolve:function(t){if(zt(t))return fe.SCALAR;if(Ve(t))return fe.OBJECT;if(xe(t))return fe.INTERFACE;if(an(t))return fe.UNION;if(on(t))return fe.ENUM;if(An(t))return fe.INPUT_OBJECT;if(Ut(t))return fe.LIST;if(Zn(t))return fe.NON_NULL;Tt(0,'Unexpected type: "'.concat(J(t),'".'))}},name:{type:ie,resolve:function(t){return t.name!==void 0?t.name:void 0}},description:{type:ie,resolve:function(t){return t.description!==void 0?t.description:void 0}},specifiedByUrl:{type:ie,resolve:function(t){return t.specifiedByUrl!==void 0?t.specifiedByUrl:void 0}},fields:{type:new ce(new j(Bc)),args:{includeDeprecated:{type:Ie,defaultValue:!1}},resolve:function(t,u){var i=u.includeDeprecated;if(Ve(t)||xe(t)){var r=wn(t.getFields());return i?r:r.filter(function(a){return a.deprecationReason==null})}}},interfaces:{type:new ce(new j(Re)),resolve:function(t){if(Ve(t)||xe(t))return t.getInterfaces()}},possibleTypes:{type:new ce(new j(Re)),resolve:function(t,u,i,r){var a=r.schema;if(Qp(t))return a.getPossibleTypes(t)}},enumValues:{type:new ce(new j(wc)),args:{includeDeprecated:{type:Ie,defaultValue:!1}},resolve:function(t,u){var i=u.includeDeprecated;if(on(t)){var r=t.getValues();return i?r:r.filter(function(a){return a.deprecationReason==null})}}},inputFields:{type:new ce(new j(Ii)),args:{includeDeprecated:{type:Ie,defaultValue:!1}},resolve:function(t,u){var i=u.includeDeprecated;if(An(t)){var r=wn(t.getFields());return i?r:r.filter(function(a){return a.deprecationReason==null})}}},ofType:{type:Re,resolve:function(t){return t.ofType!==void 0?t.ofType:void 0}}}}}),Bc=new sn({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 j(ie),resolve:function(t){return t.name}},description:{type:ie,resolve:function(t){return t.description}},args:{type:new j(new ce(new j(Ii))),args:{includeDeprecated:{type:Ie,defaultValue:!1}},resolve:function(t,u){var i=u.includeDeprecated;return i?t.args:t.args.filter(function(r){return r.deprecationReason==null})}},type:{type:new j(Re),resolve:function(t){return t.type}},isDeprecated:{type:new j(Ie),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:ie,resolve:function(t){return t.deprecationReason}}}}}),Ii=new sn({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 j(ie),resolve:function(t){return t.name}},description:{type:ie,resolve:function(t){return t.description}},type:{type:new j(Re),resolve:function(t){return t.type}},defaultValue:{type:ie,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(t){var u=t.type,i=t.defaultValue,r=Lt(i,u);return r?Ke(r):null}},isDeprecated:{type:new j(Ie),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:ie,resolve:function(t){return t.deprecationReason}}}}}),wc=new sn({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 j(ie),resolve:function(t){return t.name}},description:{type:ie,resolve:function(t){return t.description}},isDeprecated:{type:new j(Ie),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:ie,resolve:function(t){return t.deprecationReason}}}}}),fe=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"}),Ac=new _i({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:fe.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:fe.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:fe.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:fe.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:fe.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:fe.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:fe.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:fe.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),_c={name:"__schema",type:new j(Rr),description:"Access the current type schema of this server.",args:[],resolve:function(n,t,u,i){var r=i.schema;return r},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},Cc={name:"__type",type:Re,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new j(ie),defaultValue:void 0,deprecationReason:void 0,extensions:void 0,astNode:void 0}],resolve:function(n,t,u,i){var r=t.name,a=i.schema;return a.getType(r)},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},$c={name:"__typename",type:new j(ie),description:"The name of the current Object type at runtime.",args:[],resolve:function(n,t,u,i){var r=i.parentType;return r.name},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},xc=Object.freeze([Rr,Dc,Sc,Re,Bc,Ii,wc,Ac]);function bh(e,n){for(var t=0;t<n.length;t++){var u=n[t];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(e,u.key,u)}}function kh(e,n,t){return n&&bh(e.prototype,n),e}function Dh(e){return He(e,Gn)}var Gn=function(){function e(t){var u,i;this.name=t.name,this.description=t.description,this.locations=t.locations,this.isRepeatable=(u=t.isRepeatable)!==null&&u!==void 0?u:!1,this.extensions=t.extensions&&_e(t.extensions),this.astNode=t.astNode,t.name||q(0,"Directive must be named."),Array.isArray(t.locations)||q(0,"@".concat(t.name," locations must be an Array."));var r=(i=t.args)!==null&&i!==void 0?i:{};Bn(r)&&!Array.isArray(r)||q(0,"@".concat(t.name," args must be an object with argument names as keys.")),this.args=Ot(r).map(function(a){var o=a[0],s=a[1];return{name:o,description:s.description,type:s.type,defaultValue:s.defaultValue,deprecationReason:s.deprecationReason,extensions:s.extensions&&_e(s.extensions),astNode:s.astNode}})}var n=e.prototype;return n.toConfig=function(){return{name:this.name,description:this.description,locations:this.locations,args:pc(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},n.toString=function(){return"@"+this.name},n.toJSON=function(){return this.toString()},kh(e,[{key:$e,get:function(){return"GraphQLDirective"}}]),e}();ze(Gn);var Sh=new Gn({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 j(Ie),description:"Included when true."}}}),Bh=new Gn({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 j(Ie),description:"Skipped when true."}}}),wh="No longer supported",Ah=new Gn({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:ie,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:wh}}}),_h=new Gn({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[K.SCALAR],args:{url:{type:new j(ie),description:"The URL that specifies the behaviour of this scalar."}}}),Ch=Object.freeze([Sh,Bh,Ah,_h]);function $h(e,n){for(var t=0;t<n.length;t++){var u=n[t];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(e,u.key,u)}}function xh(e,n,t){return n&&$h(e.prototype,n),e}(function(){function e(t){var u;this.__validationErrors=t.assumeValid===!0?[]:void 0,Bn(t)||q(0,"Must provide configuration object."),!t.types||Array.isArray(t.types)||q(0,'"types" must be Array if provided but got: '.concat(J(t.types),".")),!t.directives||Array.isArray(t.directives)||q(0,'"directives" must be Array if provided but got: '+"".concat(J(t.directives),".")),this.description=t.description,this.extensions=t.extensions&&_e(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes,this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(u=t.directives)!==null&&u!==void 0?u:Ch;var i=new Set(t.types);if(t.types!=null)for(var r=0,a=t.types;r<a.length;r++){var o=a[r];i.delete(o),je(o,i)}this._queryType!=null&&je(this._queryType,i),this._mutationType!=null&&je(this._mutationType,i),this._subscriptionType!=null&&je(this._subscriptionType,i);for(var s=0,c=this._directives;s<c.length;s++){var l=c[s];if(Dh(l))for(var f=0,m=l.args;f<m.length;f++){var d=m[f];je(d.type,i)}}je(Rr,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var v=0,h=uh(i);v<h.length;v++){var b=h[v];if(b!=null){var E=b.name;if(E||q(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[E]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(E,'".'));if(this._typeMap[E]=b,xe(b))for(var g=0,k=b.getInterfaces();g<k.length;g++){var _=k[g];if(xe(_)){var B=this._implementationsMap[_.name];B===void 0&&(B=this._implementationsMap[_.name]={objects:[],interfaces:[]}),B.interfaces.push(b)}}else if(Ve(b))for(var G=0,V=b.getInterfaces();G<V.length;G++){var F=V[G];if(xe(F)){var y=this._implementationsMap[F.name];y===void 0&&(y=this._implementationsMap[F.name]={objects:[],interfaces:[]}),y.objects.push(b)}}}}}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(u){return this.getTypeMap()[u]},n.getPossibleTypes=function(u){return an(u)?u.getTypes():this.getImplementations(u).objects},n.getImplementations=function(u){var i=this._implementationsMap[u.name];return i??{objects:[],interfaces:[]}},n.isPossibleType=function(u,i){return this.isSubType(u,i)},n.isSubType=function(u,i){var r=this._subTypeMap[u.name];if(r===void 0){if(r=Object.create(null),an(u))for(var a=0,o=u.getTypes();a<o.length;a++){var s=o[a];r[s.name]=!0}else{for(var c=this.getImplementations(u),l=0,f=c.objects;l<f.length;l++){var m=f[l];r[m.name]=!0}for(var d=0,v=c.interfaces;d<v.length;d++){var h=v[d];r[h.name]=!0}}this._subTypeMap[u.name]=r}return r[i.name]!==void 0},n.getDirectives=function(){return this._directives},n.getDirective=function(u){return ac(this.getDirectives(),function(i){return i.name===u})},n.toConfig=function(){var u;return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:wn(this.getTypeMap()),directives:this.getDirectives().slice(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(u=this.extensionASTNodes)!==null&&u!==void 0?u:[],assumeValid:this.__validationErrors!==void 0}},xh(e,[{key:$e,get:function(){return"GraphQLSchema"}}]),e})();function je(e,n){var t=Pt(e);if(!n.has(t)){if(n.add(t),an(t))for(var u=0,i=t.getTypes();u<i.length;u++){var r=i[u];je(r,n)}else if(Ve(t)||xe(t)){for(var a=0,o=t.getInterfaces();a<o.length;a++){var s=o[a];je(s,n)}for(var c=0,l=wn(t.getFields());c<l.length;c++){var f=l[c];je(f.type,n);for(var m=0,d=f.args;m<d.length;m++){var v=d[m];je(v.type,n)}}}else if(An(t))for(var h=0,b=wn(t.getFields());h<b.length;h++){var E=b[h];je(E.type,n)}}return n}function Fi(e,n){var t;if(n.kind===C.LIST_TYPE)return t=Fi(e,n.type),t&&new ce(t);if(n.kind===C.NON_NULL_TYPE)return t=Fi(e,n.type),t&&new j(t);if(n.kind===C.NAMED_TYPE)return e.getType(n.name.value);Tt(0,"Unexpected type node: "+J(n))}var Ih=function(){function e(t,u,i){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=u??Fh,i&&(Vn(i)&&this._inputTypeStack.push(i),Or(i)&&this._parentTypeStack.push(i),wi(i)&&this._typeStack.push(i))}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(u){var i=this._schema;switch(u.kind){case C.SELECTION_SET:{var r=Pt(this.getType());this._parentTypeStack.push(Or(r)?r:void 0);break}case C.FIELD:{var a=this.getParentType(),o,s;a&&(o=this._getFieldDef(i,a,u),o&&(s=o.type)),this._fieldDefStack.push(o),this._typeStack.push(wi(s)?s:void 0);break}case C.DIRECTIVE:this._directive=i.getDirective(u.name.value);break;case C.OPERATION_DEFINITION:{var c;switch(u.operation){case"query":c=i.getQueryType();break;case"mutation":c=i.getMutationType();break;case"subscription":c=i.getSubscriptionType();break}this._typeStack.push(Ve(c)?c:void 0);break}case C.INLINE_FRAGMENT:case C.FRAGMENT_DEFINITION:{var l=u.typeCondition,f=l?Fi(i,l):Pt(this.getType());this._typeStack.push(wi(f)?f:void 0);break}case C.VARIABLE_DEFINITION:{var m=Fi(i,u.type);this._inputTypeStack.push(Vn(m)?m:void 0);break}case C.ARGUMENT:{var d,v,h,b=(d=this.getDirective())!==null&&d!==void 0?d:this.getFieldDef();b&&(v=ac(b.args,function(F){return F.name===u.name.value}),v&&(h=v.type)),this._argument=v,this._defaultValueStack.push(v?v.defaultValue:void 0),this._inputTypeStack.push(Vn(h)?h:void 0);break}case C.LIST:{var E=Xp(this.getInputType()),g=Ut(E)?E.ofType:E;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Vn(g)?g:void 0);break}case C.OBJECT_FIELD:{var k=Pt(this.getInputType()),_,B;An(k)&&(B=k.getFields()[u.name.value],B&&(_=B.type)),this._defaultValueStack.push(B?B.defaultValue:void 0),this._inputTypeStack.push(Vn(_)?_:void 0);break}case C.ENUM:{var G=Pt(this.getInputType()),V;on(G)&&(V=G.getValue(u.value)),this._enumValue=V;break}}},n.leave=function(u){switch(u.kind){case C.SELECTION_SET:this._parentTypeStack.pop();break;case C.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case C.DIRECTIVE:this._directive=null;break;case C.OPERATION_DEFINITION:case C.INLINE_FRAGMENT:case C.FRAGMENT_DEFINITION:this._typeStack.pop();break;case C.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case C.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case C.LIST:case C.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case C.ENUM:this._enumValue=null;break}},e}();function Fh(e,n,t){var u=t.name.value;if(u===_c.name&&e.getQueryType()===n)return _c;if(u===Cc.name&&e.getQueryType()===n)return Cc;if(u===$c.name&&Or(n))return $c;if(Ve(n)||xe(n))return n.getFields()[u]}function Nh(e,n){return{enter:function(u){e.enter(u);var i=Ir(n,u.kind,!1);if(i){var r=i.apply(n,arguments);return r!==void 0&&(e.leave(u),xr(r)&&e.enter(r)),r}},leave:function(u){var i=Ir(n,u.kind,!0),r;return i&&(r=i.apply(n,arguments)),e.leave(u),r}}}[].concat(bc,xc).map(function(e){return e.name});var cn;function Jn(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}cn={},Jn(cn,C.SCALAR_TYPE_DEFINITION,C.SCALAR_TYPE_EXTENSION),Jn(cn,C.OBJECT_TYPE_DEFINITION,C.OBJECT_TYPE_EXTENSION),Jn(cn,C.INTERFACE_TYPE_DEFINITION,C.INTERFACE_TYPE_EXTENSION),Jn(cn,C.UNION_TYPE_DEFINITION,C.UNION_TYPE_EXTENSION),Jn(cn,C.ENUM_TYPE_DEFINITION,C.ENUM_TYPE_EXTENSION),Jn(cn,C.INPUT_OBJECT_TYPE_DEFINITION,C.INPUT_OBJECT_TYPE_EXTENSION);function Ic(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n}var Fc=function(){function e(t,u){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=u}var n=e.prototype;return n.reportError=function(u){this._onError(u)},n.getDocument=function(){return this._ast},n.getFragment=function(u){var i=this._fragments;return i||(this._fragments=i=this.getDocument().definitions.reduce(function(r,a){return a.kind===C.FRAGMENT_DEFINITION&&(r[a.name.value]=a),r},Object.create(null))),i[u]},n.getFragmentSpreads=function(u){var i=this._fragmentSpreads.get(u);if(!i){i=[];for(var r=[u];r.length!==0;)for(var a=r.pop(),o=0,s=a.selections;o<s.length;o++){var c=s[o];c.kind===C.FRAGMENT_SPREAD?i.push(c):c.selectionSet&&r.push(c.selectionSet)}this._fragmentSpreads.set(u,i)}return i},n.getRecursivelyReferencedFragments=function(u){var i=this._recursivelyReferencedFragments.get(u);if(!i){i=[];for(var r=Object.create(null),a=[u.selectionSet];a.length!==0;)for(var o=a.pop(),s=0,c=this.getFragmentSpreads(o);s<c.length;s++){var l=c[s],f=l.name.value;if(r[f]!==!0){r[f]=!0;var m=this.getFragment(f);m&&(i.push(m),a.push(m.selectionSet))}}this._recursivelyReferencedFragments.set(u,i)}return i},e}();(function(e){Ic(n,e);function n(u,i,r){var a;return a=e.call(this,u,r)||this,a._schema=i,a}var t=n.prototype;return t.getSchema=function(){return this._schema},n})(Fc),function(e){Ic(n,e);function n(u,i,r,a){var o;return o=e.call(this,i,a)||this,o._schema=u,o._typeInfo=r,o._variableUsages=new Map,o._recursiveVariableUsages=new Map,o}var t=n.prototype;return t.getSchema=function(){return this._schema},t.getVariableUsages=function(i){var r=this._variableUsages.get(i);if(!r){var a=[],o=new Ih(this._schema);rc(i,Nh(o,{VariableDefinition:function(){return!1},Variable:function(c){a.push({node:c,type:o.getInputType(),defaultValue:o.getDefaultValue()})}})),r=a,this._variableUsages.set(i,r)}return r},t.getRecursiveVariableUsages=function(i){var r=this._recursiveVariableUsages.get(i);if(!r){r=this.getVariableUsages(i);for(var a=0,o=this.getRecursivelyReferencedFragments(i);a<o.length;a++){var s=o[a];r=r.concat(this.getVariableUsages(s))}this._recursiveVariableUsages.set(i,r)}return r},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}(Fc),oc(bc.concat(xc),function(e){return e.name});const Nc=e=>e instanceof Error?e:typeof e=="string"?new Error(e):new Error(String(e)),Th=()=>typeof globalThis.window<"u"&&typeof globalThis.window.document<"u"&&typeof globalThis.navigator<"u",jr={staging:{baseEndpoint:"https://api-staging.spritz.finance",graphEndpoint:"https://api-staging.spritz.finance/router/graph",restEndpoint:"https://sandbox.spritz.finance"},production:{baseEndpoint:"https://api.spritz.finance",graphEndpoint:"https://api.spritz.finance/router/graph",restEndpoint:"https://platform.spritz.finance"}},Oh=(e,n)=>{if(typeof n!="number"||!Number.isInteger(n))throw new Error(`${e} must be an integer`);if(n<0)throw new Error(`${e} must be a positive integer`);return n};function zh(e){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Lr(e,n){if(!e||typeof e!="object"||!(n in e))return;const t=e[n];if(typeof t=="string"&&t.length>0)return t}class Tc extends Error{timestamp;headers;constructor(n,t){super(n),this.name="SpritzApiError",this.message=n,this.headers=t??{},this.timestamp=new Date().toISOString()}}class Be extends Error{status;error;headers;timestamp;constructor(n,t,u,i){super(Be.makeMessage(t,u)),this.status=n,this.error=t,this.headers=i,this.timestamp=new Date().toISOString()}static makeMessage(n,t){const u=Lr(n,"detail");if(u)return u;const i=Lr(n,"title");return i||Lr(n,"message")||(n!==void 0?zh(n):t||"Unknown error occurred")}static generate(n,t,u,i){return n?n===400?new zc(n,t,u,i):n===401?new Uc(n,t,u,i):n===403?new Pc(n,t,u,i):n===404?new Rc(n,t,u,i):n===409?new jc(n,t,u,i):n===422?new Lc(n,t,u,i):n===429?new Zc(n,t,u,i):n>=500?new Vc(n,t,u,i):new Be(n,t,u,i):new Ni({cause:Nc(t)})}}class Uh extends Be{status=void 0;constructor({message:n}={}){super(void 0,void 0,n||"Request was aborted.",void 0)}}class Ni extends Be{status=void 0;constructor({message:n,cause:t}){super(void 0,void 0,n||"Connection error.",void 0),t&&(this.cause=t)}}class Oc extends Ni{constructor(){super({message:"Request timed out."})}}class zc extends Be{name="BadRequestError";status=400}class Uc extends Be{name="AuthenticationError";status=401}class Pc extends Be{name="PermissionDeniedError";status=403}class Rc extends Be{name="NotFoundError";status=404}class jc extends Be{name="ConflictError";status=409}class Lc extends Be{name="UnprocessableEntityError";status=422}class Zc extends Be{name="RateLimitError";status=429}class Vc extends Be{name="InternalServerError"}const Ph=e=>{try{return JSON.parse(e)}catch{return}},qc=10,Mc=100;function Rh(e){if(!e||!e.definitions)throw new Error("Invalid GraphQL query: missing definitions");const n=e.definitions.filter(r=>r.kind==="OperationDefinition");if(n.length>1)throw new Error("Invalid GraphQL query: multiple operations not allowed");if(n.length===0)throw new Error("Invalid GraphQL query: no operation definition found");const t=n[0],u=jh(t);if(u>qc)throw new Error(`GraphQL query too deep: ${u} levels (max: ${qc})`);const i=Lh(t);if(i>Mc)throw new Error(`GraphQL query too complex: ${i} fields (max: ${Mc})`);if(t.operation!=="query"&&t.operation!=="mutation")throw new Error(`Invalid GraphQL operation type: ${t.operation}`)}function jh(e){function n(t){let u=0;for(const i of t.selections)if(i.kind==="Field"&&i.selectionSet){const r=1+n(i.selectionSet);u=Math.max(u,r)}else if(i.kind==="InlineFragment"&&i.selectionSet){const r=n(i.selectionSet);u=Math.max(u,r)}else i.kind==="FragmentSpread"&&(u=Math.max(u,1));return u}return n(e.selectionSet)}function Lh(e){function n(t){let u=0;for(const i of t.selections)u+=1,i.kind==="Field"&&i.selectionSet||i.kind==="InlineFragment"&&i.selectionSet?u+=n(i.selectionSet):i.kind==="FragmentSpread"&&(u+=5);return u}return n(e.selectionSet)}function Zh(e){if(!e)return;const n=Object.create(null);for(const[t,u]of Object.entries(e)){if(!Vh(t))throw new Error(`Invalid GraphQL variable name: ${t}`);if(t==="__proto__"||t==="constructor"||t==="prototype")throw new Error(`Invalid property name: ${t}`);n[t]=Zr(u)}return n}function Vh(e){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e)}function Gc(e){return Array.from(e).filter(n=>{const t=n.charCodeAt(0);return t>31&&t!==127}).join("")}function Zr(e){if(e==null)return e;if(typeof e=="string")return Gc(e);if(typeof e=="number"||typeof e=="boolean")return e;if(Array.isArray(e))return e.map(Zr);if(typeof e=="object"){const n=Object.create(null);for(const[t,u]of Object.entries(e)){if(t.includes("__proto__")||t.includes("constructor"))throw new Error(`Invalid property name: ${t}`);n[t]=Zr(u)}return n}return Gc(String(e))}const qh="sha256=";function Jc(e){return Array.from(new Uint8Array(e)).map(n=>n.toString(16).padStart(2,"0")).join("")}async function Mh(e){const n=new TextEncoder().encode(e),t=await crypto.subtle.digest("SHA-256",n);return Jc(t)}async function Gh(e,n){const t=new TextEncoder,u=await crypto.subtle.importKey("raw",t.encode(e),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),i=await crypto.subtle.sign("HMAC",u,t.encode(n));return Jc(i)}const Jh=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDFFF]/g,Hh="\uFFFD";function Kh(e){return e.replace(Jh,n=>n.length===2?n:Hh)}function Hc(e){return encodeURIComponent(Kh(e)).replace(/'/g,"%27")}function Kc(e){const n=[...e];return n.length===0?"":n.sort(([t],[u])=>t<u?-1:t>u?1:0).map(([t,u])=>`${Hc(t)}=${Hc(u)}`).join("&")}function Qh(e){return Kc(e.searchParams)}function Wh(e){const n=Qh(e);return n===""?e.pathname:`${e.pathname}?${n}`}async function Yh(e,n,t){const u=t.body?await Mh(t.body):"",i=`${n}.${t.method.toUpperCase()}.${t.path}.${u}`,r=await Gh(e,i);return`${qh}${r}`}async function Xh(e,n,t,u,i){const r=new URL(u),a=Wh(r),o=Date.now(),s=await Yh(n,o,{method:t,path:a,body:i});return{"X-Integrator-Key":e,"X-Signature":s,"X-Timestamp":String(o)}}async function Vr(e){const{response:n}=e;return n.headers.get("content-type")?.includes("application/json")?{response:await n.json(),headers:e.headers}:{response:await n.text(),headers:e.headers}}class eg{baseGraphURL;baseRestURL;baseRestApiURL;timeout;apiKey;integrationKey;integratorSecret;constructor({environment:n,timeout:t=3e5,apiKey:u,integrationKey:i,integratorSecret:r}){this.apiKey=u,this.integrationKey=i,this.integratorSecret=r,this.baseGraphURL=jr[n].graphEndpoint,this.baseRestURL=jr[n].baseEndpoint,this.baseRestApiURL=jr[n].restEndpoint,this.timeout=Oh("timeout",t)}async query({query:n,variables:t}){Rh(n);const u=Zh(t);return this.sendQuery({query:n,variables:u}).then(i=>Vr(i)).then(({response:i,headers:r})=>{if(i.data)return i.data;if(i.errors){const a=i.errors[0]??{message:"Unknown error"};throw new Tc(a.message,r)}else throw new Error("Unknown error")})}async request({method:n,path:t,body:u=void 0}){return this.sendRequest({method:n,path:t,body:u}).then(i=>Vr(i)).then(({response:i})=>i)}async restApi({method:n,path:t,body:u=void 0,query:i,headers:r}){return this.sendRestApiRequest({method:n,path:t,body:u,...i?{query:i}:{},...r?{headers:r}:{}}).then(a=>Vr(a)).then(({response:a})=>a)}async sendQuery({query:n,variables:t}){const{url:u,req:i,timeout:r}=this.buildGraphRequest({query:n,variables:t});return this.sendHTTPRequest({url:u,req:i,timeout:r})}async sendRequest({method:n,path:t,body:u}){const{url:i,req:r,timeout:a}=this.buildRestRequest(n,t,u);return this.sendHTTPRequest({url:i,req:r,timeout:a})}async sendRestApiRequest({method:n,path:t,body:u,query:i,headers:r}){const{url:a,req:o,timeout:s}=this.buildRestRequest(n,t,u,this.baseRestApiURL,i,r);if(this.integrationKey&&this.integratorSecret){const c=await Xh(this.integrationKey,this.integratorSecret,n,a,o.body??null),{"X-INTEGRATION-KEY":l,...f}=o.headers;o.headers={...f,...c}}return this.sendHTTPRequest({url:a,req:o,timeout:s})}async sendHTTPRequest({url:n,req:t,timeout:u}){const i=new AbortController,r=await this.fetchWithTimeout(n,t,u,i).catch(Nc);if(r instanceof Error)throw r.name==="AbortError"?new Oc:new Ni({cause:r});const a=this.getResponseHeaders(r.headers);if(!r.ok){const o=await r.text().catch(()=>"Unknown error"),s=Ph(o);throw this.makeStatusError(r.status,s,s?void 0:o,a)}return{response:r,controller:i,headers:a}}getResponseHeaders(n){const t=n.get("x-amzn-trace-id"),u=n.get("x-amzn-requestid");return{traceId:t,requestId:u}}async fetchWithTimeout(n,t,u,i){const{signal:r,...a}=t||{},o=AbortSignal.timeout(u),s=r?AbortSignal.any([r,o,i.signal]):AbortSignal.any([o,i.signal]);return fetch(n,{...a,signal:s})}buildGraphRequest({query:n,variables:t}){const u={query:Ke(n),variables:t,operationName:n?.definitions?.[0]?.name?.value},i=u?JSON.stringify(u,null,2):null,r=this.calculateContentLength(i),a=this.timeout,o={...r&&{"Content-Length":r},...this.defaultHeaders()},s=Object.fromEntries(Object.entries(o).filter(([l,f])=>f!==null)),c={method:"POST",...i?{body:i}:{},headers:s};return{url:this.baseGraphURL,req:c,timeout:a}}buildRestRequest(n,t,u,i,r,a){const o=u?JSON.stringify(u):null,s=this.calculateContentLength(o),c=this.timeout,l={...s&&{"Content-Length":s},...this.defaultHeaders(),...a??{}},f=Object.fromEntries(Object.entries(l).filter(([b,E])=>E!==null)),m={method:n,...o?{body:o}:{},headers:f},d=i??this.baseRestURL,v=t.startsWith("/")?t:"/"+t,h=new URL(v,d);if(r){const b=Object.entries(r).filter(g=>g[1]!==void 0).map(([g,k])=>[g,String(k)]),E=Kc(b);E&&(h.search=`?${E}`)}return{url:h.toString(),req:m,timeout:c}}defaultHeaders(){return{Accept:"application/json","Content-Type":"application/json",...this.authHeaders()}}calculateContentLength(n){if(typeof n=="string"){if(typeof Buffer<"u")return Buffer.byteLength(n,"utf8").toString();if(typeof TextEncoder<"u")return new TextEncoder().encode(n).length.toString()}return null}authHeaders(){return{Authorization:"Bearer "+this.apiKey,...this.integrationKey?{"X-INTEGRATION-KEY":this.integrationKey}:{}}}makeStatusError(n,t,u,i){return Be.generate(n,t,u,i)}}function ng(e){if(!(!e||typeof e!="object"))return e}function tg(e,n){return e.replace(/\{([^}]+)\}/g,(t,u)=>{if(!n||!(u in n))throw new Error(`Missing path parameter: ${u}`);const i=n[u];if(i==null)throw new Error(`Missing path parameter: ${u}`);return encodeURIComponent(String(i))})}function ig(e){if(!e)return;const n=[];for(const[t,u]of Object.entries(e))if(u!==void 0){if(typeof u!="string"&&typeof u!="number"&&typeof u!="boolean")throw new Error(`Unsupported query parameter value for ${t}`);n.push([t,u])}return n.length>0?Object.fromEntries(n):void 0}function ug(e){if(!e)return;const n=[];for(const[t,u]of Object.entries(e))if(u!==void 0){if(typeof u!="string"||u.length===0)throw new Error(`Unsupported header value for ${t}`);n.push([t,u])}return n.length>0?Object.fromEntries(n):void 0}function Q(e,n,...[t]){const u=ng(t?.params),i=tg(e,u),r=ig(t?.query),a=ug(t?.headers),o=t?.body;return{method:n,path:i,...o!==void 0?{body:o}:{},...r?{query:r}:{},...a?{headers:a}:{}}}class rg{client;constructor(n){this.client=n}async list(n){return this.client.restApi(Q("/v1/integrator/ach-debit/returns","get",n?{query:n}:void 0))}async get(n){return this.client.restApi(Q("/v1/integrator/ach-debit/returns/{returnId}","get",{params:{returnId:n}}))}}class ag{client;constructor(n){this.client=n}async list(){return this.client.restApi(Q("/v1/bank-accounts/","get"))}async get(n){return this.client.restApi(Q("/v1/bank-accounts/{accountId}","get",{params:{accountId:n}}))}async create(n){return this.client.restApi(Q("/v1/bank-accounts/","post",{body:n}))}async delete(n){return this.client.restApi(Q("/v1/bank-accounts/{accountId}","delete",{params:{accountId:n}}))}async createLinkToken(n){return this.client.restApi(Q("/v1/bank-accounts/link-token","post",n?{body:n}:void 0))}async completeLinking(n){return this.client.restApi(Q("/v1/bank-accounts/link-complete","post",{body:n}))}}var Zt={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"BillFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Bill"}},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:"originator"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"payable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verifying"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"openedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentDueDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentMinimumAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastStatementBalance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"remainingStatementBalance"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"dataSync"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"lastSync"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"syncStatus"},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:"paymentAddresses"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:588}};Zt.loc.source={body:`fragment BillFragment on Bill {
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 j(ie),resolve:function(t){return t.name}},description:{type:ie,resolve:function(t){return t.description}},isRepeatable:{type:new j(Ie),resolve:function(t){return t.isRepeatable}},locations:{type:new j(new ce(new j(Sc))),resolve:function(t){return t.locations}},args:{type:new j(new ce(new j(Ii))),args:{includeDeprecated:{type:Ie,defaultValue:!1}},resolve:function(t,u){var i=u.includeDeprecated;return i?t.args:t.args.filter(function(r){return r.deprecationReason==null})}}}}}),Sc=new _i({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."}}}),Re=new sn({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 j(Ac),resolve:function(t){if(zt(t))return fe.SCALAR;if(Ve(t))return fe.OBJECT;if(xe(t))return fe.INTERFACE;if(an(t))return fe.UNION;if(on(t))return fe.ENUM;if(An(t))return fe.INPUT_OBJECT;if(Ut(t))return fe.LIST;if(Zn(t))return fe.NON_NULL;Tt(0,'Unexpected type: "'.concat(J(t),'".'))}},name:{type:ie,resolve:function(t){return t.name!==void 0?t.name:void 0}},description:{type:ie,resolve:function(t){return t.description!==void 0?t.description:void 0}},specifiedByUrl:{type:ie,resolve:function(t){return t.specifiedByUrl!==void 0?t.specifiedByUrl:void 0}},fields:{type:new ce(new j(Bc)),args:{includeDeprecated:{type:Ie,defaultValue:!1}},resolve:function(t,u){var i=u.includeDeprecated;if(Ve(t)||xe(t)){var r=wn(t.getFields());return i?r:r.filter(function(a){return a.deprecationReason==null})}}},interfaces:{type:new ce(new j(Re)),resolve:function(t){if(Ve(t)||xe(t))return t.getInterfaces()}},possibleTypes:{type:new ce(new j(Re)),resolve:function(t,u,i,r){var a=r.schema;if(Qp(t))return a.getPossibleTypes(t)}},enumValues:{type:new ce(new j(wc)),args:{includeDeprecated:{type:Ie,defaultValue:!1}},resolve:function(t,u){var i=u.includeDeprecated;if(on(t)){var r=t.getValues();return i?r:r.filter(function(a){return a.deprecationReason==null})}}},inputFields:{type:new ce(new j(Ii)),args:{includeDeprecated:{type:Ie,defaultValue:!1}},resolve:function(t,u){var i=u.includeDeprecated;if(An(t)){var r=wn(t.getFields());return i?r:r.filter(function(a){return a.deprecationReason==null})}}},ofType:{type:Re,resolve:function(t){return t.ofType!==void 0?t.ofType:void 0}}}}}),Bc=new sn({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 j(ie),resolve:function(t){return t.name}},description:{type:ie,resolve:function(t){return t.description}},args:{type:new j(new ce(new j(Ii))),args:{includeDeprecated:{type:Ie,defaultValue:!1}},resolve:function(t,u){var i=u.includeDeprecated;return i?t.args:t.args.filter(function(r){return r.deprecationReason==null})}},type:{type:new j(Re),resolve:function(t){return t.type}},isDeprecated:{type:new j(Ie),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:ie,resolve:function(t){return t.deprecationReason}}}}}),Ii=new sn({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 j(ie),resolve:function(t){return t.name}},description:{type:ie,resolve:function(t){return t.description}},type:{type:new j(Re),resolve:function(t){return t.type}},defaultValue:{type:ie,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(t){var u=t.type,i=t.defaultValue,r=Lt(i,u);return r?Ke(r):null}},isDeprecated:{type:new j(Ie),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:ie,resolve:function(t){return t.deprecationReason}}}}}),wc=new sn({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 j(ie),resolve:function(t){return t.name}},description:{type:ie,resolve:function(t){return t.description}},isDeprecated:{type:new j(Ie),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:ie,resolve:function(t){return t.deprecationReason}}}}}),fe=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"}),Ac=new _i({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:fe.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:fe.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:fe.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:fe.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:fe.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:fe.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:fe.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:fe.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),_c={name:"__schema",type:new j(Rr),description:"Access the current type schema of this server.",args:[],resolve:function(n,t,u,i){var r=i.schema;return r},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},Cc={name:"__type",type:Re,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new j(ie),defaultValue:void 0,deprecationReason:void 0,extensions:void 0,astNode:void 0}],resolve:function(n,t,u,i){var r=t.name,a=i.schema;return a.getType(r)},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},$c={name:"__typename",type:new j(ie),description:"The name of the current Object type at runtime.",args:[],resolve:function(n,t,u,i){var r=i.parentType;return r.name},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},xc=Object.freeze([Rr,Dc,Sc,Re,Bc,Ii,wc,Ac]);function bh(e,n){for(var t=0;t<n.length;t++){var u=n[t];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(e,u.key,u)}}function kh(e,n,t){return n&&bh(e.prototype,n),e}function Dh(e){return He(e,Gn)}var Gn=function(){function e(t){var u,i;this.name=t.name,this.description=t.description,this.locations=t.locations,this.isRepeatable=(u=t.isRepeatable)!==null&&u!==void 0?u:!1,this.extensions=t.extensions&&_e(t.extensions),this.astNode=t.astNode,t.name||q(0,"Directive must be named."),Array.isArray(t.locations)||q(0,"@".concat(t.name," locations must be an Array."));var r=(i=t.args)!==null&&i!==void 0?i:{};Bn(r)&&!Array.isArray(r)||q(0,"@".concat(t.name," args must be an object with argument names as keys.")),this.args=Ot(r).map(function(a){var o=a[0],s=a[1];return{name:o,description:s.description,type:s.type,defaultValue:s.defaultValue,deprecationReason:s.deprecationReason,extensions:s.extensions&&_e(s.extensions),astNode:s.astNode}})}var n=e.prototype;return n.toConfig=function(){return{name:this.name,description:this.description,locations:this.locations,args:pc(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},n.toString=function(){return"@"+this.name},n.toJSON=function(){return this.toString()},kh(e,[{key:$e,get:function(){return"GraphQLDirective"}}]),e}();ze(Gn);var Sh=new Gn({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 j(Ie),description:"Included when true."}}}),Bh=new Gn({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 j(Ie),description:"Skipped when true."}}}),wh="No longer supported",Ah=new Gn({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:ie,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:wh}}}),_h=new Gn({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[K.SCALAR],args:{url:{type:new j(ie),description:"The URL that specifies the behaviour of this scalar."}}}),Ch=Object.freeze([Sh,Bh,Ah,_h]);function $h(e,n){for(var t=0;t<n.length;t++){var u=n[t];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(e,u.key,u)}}function xh(e,n,t){return n&&$h(e.prototype,n),e}(function(){function e(t){var u;this.__validationErrors=t.assumeValid===!0?[]:void 0,Bn(t)||q(0,"Must provide configuration object."),!t.types||Array.isArray(t.types)||q(0,'"types" must be Array if provided but got: '.concat(J(t.types),".")),!t.directives||Array.isArray(t.directives)||q(0,'"directives" must be Array if provided but got: '+"".concat(J(t.directives),".")),this.description=t.description,this.extensions=t.extensions&&_e(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes,this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(u=t.directives)!==null&&u!==void 0?u:Ch;var i=new Set(t.types);if(t.types!=null)for(var r=0,a=t.types;r<a.length;r++){var o=a[r];i.delete(o),je(o,i)}this._queryType!=null&&je(this._queryType,i),this._mutationType!=null&&je(this._mutationType,i),this._subscriptionType!=null&&je(this._subscriptionType,i);for(var s=0,c=this._directives;s<c.length;s++){var l=c[s];if(Dh(l))for(var f=0,m=l.args;f<m.length;f++){var d=m[f];je(d.type,i)}}je(Rr,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var v=0,h=uh(i);v<h.length;v++){var b=h[v];if(b!=null){var E=b.name;if(E||q(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[E]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(E,'".'));if(this._typeMap[E]=b,xe(b))for(var g=0,k=b.getInterfaces();g<k.length;g++){var _=k[g];if(xe(_)){var B=this._implementationsMap[_.name];B===void 0&&(B=this._implementationsMap[_.name]={objects:[],interfaces:[]}),B.interfaces.push(b)}}else if(Ve(b))for(var G=0,V=b.getInterfaces();G<V.length;G++){var F=V[G];if(xe(F)){var y=this._implementationsMap[F.name];y===void 0&&(y=this._implementationsMap[F.name]={objects:[],interfaces:[]}),y.objects.push(b)}}}}}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(u){return this.getTypeMap()[u]},n.getPossibleTypes=function(u){return an(u)?u.getTypes():this.getImplementations(u).objects},n.getImplementations=function(u){var i=this._implementationsMap[u.name];return i??{objects:[],interfaces:[]}},n.isPossibleType=function(u,i){return this.isSubType(u,i)},n.isSubType=function(u,i){var r=this._subTypeMap[u.name];if(r===void 0){if(r=Object.create(null),an(u))for(var a=0,o=u.getTypes();a<o.length;a++){var s=o[a];r[s.name]=!0}else{for(var c=this.getImplementations(u),l=0,f=c.objects;l<f.length;l++){var m=f[l];r[m.name]=!0}for(var d=0,v=c.interfaces;d<v.length;d++){var h=v[d];r[h.name]=!0}}this._subTypeMap[u.name]=r}return r[i.name]!==void 0},n.getDirectives=function(){return this._directives},n.getDirective=function(u){return ac(this.getDirectives(),function(i){return i.name===u})},n.toConfig=function(){var u;return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:wn(this.getTypeMap()),directives:this.getDirectives().slice(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(u=this.extensionASTNodes)!==null&&u!==void 0?u:[],assumeValid:this.__validationErrors!==void 0}},xh(e,[{key:$e,get:function(){return"GraphQLSchema"}}]),e})();function je(e,n){var t=Pt(e);if(!n.has(t)){if(n.add(t),an(t))for(var u=0,i=t.getTypes();u<i.length;u++){var r=i[u];je(r,n)}else if(Ve(t)||xe(t)){for(var a=0,o=t.getInterfaces();a<o.length;a++){var s=o[a];je(s,n)}for(var c=0,l=wn(t.getFields());c<l.length;c++){var f=l[c];je(f.type,n);for(var m=0,d=f.args;m<d.length;m++){var v=d[m];je(v.type,n)}}}else if(An(t))for(var h=0,b=wn(t.getFields());h<b.length;h++){var E=b[h];je(E.type,n)}}return n}function Fi(e,n){var t;if(n.kind===C.LIST_TYPE)return t=Fi(e,n.type),t&&new ce(t);if(n.kind===C.NON_NULL_TYPE)return t=Fi(e,n.type),t&&new j(t);if(n.kind===C.NAMED_TYPE)return e.getType(n.name.value);Tt(0,"Unexpected type node: "+J(n))}var Ih=function(){function e(t,u,i){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=u??Fh,i&&(Vn(i)&&this._inputTypeStack.push(i),Or(i)&&this._parentTypeStack.push(i),wi(i)&&this._typeStack.push(i))}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(u){var i=this._schema;switch(u.kind){case C.SELECTION_SET:{var r=Pt(this.getType());this._parentTypeStack.push(Or(r)?r:void 0);break}case C.FIELD:{var a=this.getParentType(),o,s;a&&(o=this._getFieldDef(i,a,u),o&&(s=o.type)),this._fieldDefStack.push(o),this._typeStack.push(wi(s)?s:void 0);break}case C.DIRECTIVE:this._directive=i.getDirective(u.name.value);break;case C.OPERATION_DEFINITION:{var c;switch(u.operation){case"query":c=i.getQueryType();break;case"mutation":c=i.getMutationType();break;case"subscription":c=i.getSubscriptionType();break}this._typeStack.push(Ve(c)?c:void 0);break}case C.INLINE_FRAGMENT:case C.FRAGMENT_DEFINITION:{var l=u.typeCondition,f=l?Fi(i,l):Pt(this.getType());this._typeStack.push(wi(f)?f:void 0);break}case C.VARIABLE_DEFINITION:{var m=Fi(i,u.type);this._inputTypeStack.push(Vn(m)?m:void 0);break}case C.ARGUMENT:{var d,v,h,b=(d=this.getDirective())!==null&&d!==void 0?d:this.getFieldDef();b&&(v=ac(b.args,function(F){return F.name===u.name.value}),v&&(h=v.type)),this._argument=v,this._defaultValueStack.push(v?v.defaultValue:void 0),this._inputTypeStack.push(Vn(h)?h:void 0);break}case C.LIST:{var E=Xp(this.getInputType()),g=Ut(E)?E.ofType:E;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Vn(g)?g:void 0);break}case C.OBJECT_FIELD:{var k=Pt(this.getInputType()),_,B;An(k)&&(B=k.getFields()[u.name.value],B&&(_=B.type)),this._defaultValueStack.push(B?B.defaultValue:void 0),this._inputTypeStack.push(Vn(_)?_:void 0);break}case C.ENUM:{var G=Pt(this.getInputType()),V;on(G)&&(V=G.getValue(u.value)),this._enumValue=V;break}}},n.leave=function(u){switch(u.kind){case C.SELECTION_SET:this._parentTypeStack.pop();break;case C.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case C.DIRECTIVE:this._directive=null;break;case C.OPERATION_DEFINITION:case C.INLINE_FRAGMENT:case C.FRAGMENT_DEFINITION:this._typeStack.pop();break;case C.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case C.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case C.LIST:case C.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case C.ENUM:this._enumValue=null;break}},e}();function Fh(e,n,t){var u=t.name.value;if(u===_c.name&&e.getQueryType()===n)return _c;if(u===Cc.name&&e.getQueryType()===n)return Cc;if(u===$c.name&&Or(n))return $c;if(Ve(n)||xe(n))return n.getFields()[u]}function Nh(e,n){return{enter:function(u){e.enter(u);var i=Ir(n,u.kind,!1);if(i){var r=i.apply(n,arguments);return r!==void 0&&(e.leave(u),xr(r)&&e.enter(r)),r}},leave:function(u){var i=Ir(n,u.kind,!0),r;return i&&(r=i.apply(n,arguments)),e.leave(u),r}}}[].concat(bc,xc).map(function(e){return e.name});var cn;function Jn(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}cn={},Jn(cn,C.SCALAR_TYPE_DEFINITION,C.SCALAR_TYPE_EXTENSION),Jn(cn,C.OBJECT_TYPE_DEFINITION,C.OBJECT_TYPE_EXTENSION),Jn(cn,C.INTERFACE_TYPE_DEFINITION,C.INTERFACE_TYPE_EXTENSION),Jn(cn,C.UNION_TYPE_DEFINITION,C.UNION_TYPE_EXTENSION),Jn(cn,C.ENUM_TYPE_DEFINITION,C.ENUM_TYPE_EXTENSION),Jn(cn,C.INPUT_OBJECT_TYPE_DEFINITION,C.INPUT_OBJECT_TYPE_EXTENSION);function Ic(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n}var Fc=function(){function e(t,u){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=u}var n=e.prototype;return n.reportError=function(u){this._onError(u)},n.getDocument=function(){return this._ast},n.getFragment=function(u){var i=this._fragments;return i||(this._fragments=i=this.getDocument().definitions.reduce(function(r,a){return a.kind===C.FRAGMENT_DEFINITION&&(r[a.name.value]=a),r},Object.create(null))),i[u]},n.getFragmentSpreads=function(u){var i=this._fragmentSpreads.get(u);if(!i){i=[];for(var r=[u];r.length!==0;)for(var a=r.pop(),o=0,s=a.selections;o<s.length;o++){var c=s[o];c.kind===C.FRAGMENT_SPREAD?i.push(c):c.selectionSet&&r.push(c.selectionSet)}this._fragmentSpreads.set(u,i)}return i},n.getRecursivelyReferencedFragments=function(u){var i=this._recursivelyReferencedFragments.get(u);if(!i){i=[];for(var r=Object.create(null),a=[u.selectionSet];a.length!==0;)for(var o=a.pop(),s=0,c=this.getFragmentSpreads(o);s<c.length;s++){var l=c[s],f=l.name.value;if(r[f]!==!0){r[f]=!0;var m=this.getFragment(f);m&&(i.push(m),a.push(m.selectionSet))}}this._recursivelyReferencedFragments.set(u,i)}return i},e}();(function(e){Ic(n,e);function n(u,i,r){var a;return a=e.call(this,u,r)||this,a._schema=i,a}var t=n.prototype;return t.getSchema=function(){return this._schema},n})(Fc),function(e){Ic(n,e);function n(u,i,r,a){var o;return o=e.call(this,i,a)||this,o._schema=u,o._typeInfo=r,o._variableUsages=new Map,o._recursiveVariableUsages=new Map,o}var t=n.prototype;return t.getSchema=function(){return this._schema},t.getVariableUsages=function(i){var r=this._variableUsages.get(i);if(!r){var a=[],o=new Ih(this._schema);rc(i,Nh(o,{VariableDefinition:function(){return!1},Variable:function(c){a.push({node:c,type:o.getInputType(),defaultValue:o.getDefaultValue()})}})),r=a,this._variableUsages.set(i,r)}return r},t.getRecursiveVariableUsages=function(i){var r=this._recursiveVariableUsages.get(i);if(!r){r=this.getVariableUsages(i);for(var a=0,o=this.getRecursivelyReferencedFragments(i);a<o.length;a++){var s=o[a];r=r.concat(this.getVariableUsages(s))}this._recursiveVariableUsages.set(i,r)}return r},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}(Fc),oc(bc.concat(xc),function(e){return e.name});const Nc=e=>e instanceof Error?e:typeof e=="string"?new Error(e):new Error(String(e)),Th=()=>typeof globalThis.window<"u"&&typeof globalThis.window.document<"u"&&typeof globalThis.navigator<"u",jr={staging:{baseEndpoint:"https://api-staging.spritz.finance",graphEndpoint:"https://api-staging.spritz.finance/router/graph",restEndpoint:"https://sandbox.spritz.finance"},production:{baseEndpoint:"https://api.spritz.finance",graphEndpoint:"https://api.spritz.finance/router/graph",restEndpoint:"https://platform.spritz.finance"}},Oh=(e,n)=>{if(typeof n!="number"||!Number.isInteger(n))throw new Error(`${e} must be an integer`);if(n<0)throw new Error(`${e} must be a positive integer`);return n};function zh(e){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Lr(e,n){if(!e||typeof e!="object"||!(n in e))return;const t=e[n];if(typeof t=="string"&&t.length>0)return t}class Tc extends Error{timestamp;headers;constructor(n,t){super(n),this.name="SpritzApiError",this.message=n,this.headers=t??{},this.timestamp=new Date().toISOString()}}class Be extends Error{status;error;headers;timestamp;constructor(n,t,u,i){super(Be.makeMessage(t,u)),this.status=n,this.error=t,this.headers=i,this.timestamp=new Date().toISOString()}static makeMessage(n,t){const u=Lr(n,"detail");if(u)return u;const i=Lr(n,"title");return i||Lr(n,"message")||(n!==void 0?zh(n):t||"Unknown error occurred")}static generate(n,t,u,i){return n?n===400?new zc(n,t,u,i):n===401?new Uc(n,t,u,i):n===403?new Pc(n,t,u,i):n===404?new Rc(n,t,u,i):n===409?new jc(n,t,u,i):n===422?new Lc(n,t,u,i):n===429?new Zc(n,t,u,i):n>=500?new Vc(n,t,u,i):new Be(n,t,u,i):new Ni({cause:Nc(t)})}}class Uh extends Be{status=void 0;constructor({message:n}={}){super(void 0,void 0,n||"Request was aborted.",void 0)}}class Ni extends Be{status=void 0;constructor({message:n,cause:t}){super(void 0,void 0,n||"Connection error.",void 0),t&&(this.cause=t)}}class Oc extends Ni{constructor(){super({message:"Request timed out."})}}class zc extends Be{name="BadRequestError";status=400}class Uc extends Be{name="AuthenticationError";status=401}class Pc extends Be{name="PermissionDeniedError";status=403}class Rc extends Be{name="NotFoundError";status=404}class jc extends Be{name="ConflictError";status=409}class Lc extends Be{name="UnprocessableEntityError";status=422}class Zc extends Be{name="RateLimitError";status=429}class Vc extends Be{name="InternalServerError"}const Ph=e=>{try{return JSON.parse(e)}catch{return}},qc=10,Mc=100;function Rh(e){if(!e||!e.definitions)throw new Error("Invalid GraphQL query: missing definitions");const n=e.definitions.filter(r=>r.kind==="OperationDefinition");if(n.length>1)throw new Error("Invalid GraphQL query: multiple operations not allowed");if(n.length===0)throw new Error("Invalid GraphQL query: no operation definition found");const t=n[0],u=jh(t);if(u>qc)throw new Error(`GraphQL query too deep: ${u} levels (max: ${qc})`);const i=Lh(t);if(i>Mc)throw new Error(`GraphQL query too complex: ${i} fields (max: ${Mc})`);if(t.operation!=="query"&&t.operation!=="mutation")throw new Error(`Invalid GraphQL operation type: ${t.operation}`)}function jh(e){function n(t){let u=0;for(const i of t.selections)if(i.kind==="Field"&&i.selectionSet){const r=1+n(i.selectionSet);u=Math.max(u,r)}else if(i.kind==="InlineFragment"&&i.selectionSet){const r=n(i.selectionSet);u=Math.max(u,r)}else i.kind==="FragmentSpread"&&(u=Math.max(u,1));return u}return n(e.selectionSet)}function Lh(e){function n(t){let u=0;for(const i of t.selections)u+=1,i.kind==="Field"&&i.selectionSet||i.kind==="InlineFragment"&&i.selectionSet?u+=n(i.selectionSet):i.kind==="FragmentSpread"&&(u+=5);return u}return n(e.selectionSet)}function Zh(e){if(!e)return;const n=Object.create(null);for(const[t,u]of Object.entries(e)){if(!Vh(t))throw new Error(`Invalid GraphQL variable name: ${t}`);if(t==="__proto__"||t==="constructor"||t==="prototype")throw new Error(`Invalid property name: ${t}`);n[t]=Zr(u)}return n}function Vh(e){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e)}function Gc(e){return Array.from(e).filter(n=>{const t=n.charCodeAt(0);return t>31&&t!==127}).join("")}function Zr(e){if(e==null)return e;if(typeof e=="string")return Gc(e);if(typeof e=="number"||typeof e=="boolean")return e;if(Array.isArray(e))return e.map(Zr);if(typeof e=="object"){const n=Object.create(null);for(const[t,u]of Object.entries(e)){if(t.includes("__proto__")||t.includes("constructor"))throw new Error(`Invalid property name: ${t}`);n[t]=Zr(u)}return n}return Gc(String(e))}const qh="sha256=";function Jc(e){return Array.from(new Uint8Array(e)).map(n=>n.toString(16).padStart(2,"0")).join("")}async function Mh(e){const n=new TextEncoder().encode(e),t=await crypto.subtle.digest("SHA-256",n);return Jc(t)}async function Gh(e,n){const t=new TextEncoder,u=await crypto.subtle.importKey("raw",t.encode(e),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),i=await crypto.subtle.sign("HMAC",u,t.encode(n));return Jc(i)}const Jh=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDFFF]/g,Hh="\uFFFD";function Kh(e){return e.replace(Jh,n=>n.length===2?n:Hh)}function Hc(e){return encodeURIComponent(Kh(e)).replace(/'/g,"%27")}function Kc(e){const n=[...e];return n.length===0?"":n.sort(([t],[u])=>t<u?-1:t>u?1:0).map(([t,u])=>`${Hc(t)}=${Hc(u)}`).join("&")}function Qh(e){return Kc(e.searchParams)}function Wh(e){const n=Qh(e);return n===""?e.pathname:`${e.pathname}?${n}`}async function Yh(e,n,t){const u=t.body?await Mh(t.body):"",i=`${n}.${t.method.toUpperCase()}.${t.path}.${u}`,r=await Gh(e,i);return`${qh}${r}`}async function Xh(e,n,t,u,i){const r=new URL(u),a=Wh(r),o=Date.now(),s=await Yh(n,o,{method:t,path:a,body:i});return{"X-Integrator-Key":e,"X-Signature":s,"X-Timestamp":String(o)}}async function Vr(e){const{response:n}=e;return n.headers.get("content-type")?.includes("application/json")?{response:await n.json(),headers:e.headers}:{response:await n.text(),headers:e.headers}}class eg{baseGraphURL;baseRestURL;baseRestApiURL;timeout;apiKey;integrationKey;integratorSecret;constructor({environment:n,timeout:t=3e5,apiKey:u,integrationKey:i,integratorSecret:r}){this.apiKey=u,this.integrationKey=i,this.integratorSecret=r,this.baseGraphURL=jr[n].graphEndpoint,this.baseRestURL=jr[n].baseEndpoint,this.baseRestApiURL=jr[n].restEndpoint,this.timeout=Oh("timeout",t)}async query({query:n,variables:t}){Rh(n);const u=Zh(t);return this.sendQuery({query:n,variables:u}).then(i=>Vr(i)).then(({response:i,headers:r})=>{if(i.data)return i.data;if(i.errors){const a=i.errors[0]??{message:"Unknown error"};throw new Tc(a.message,r)}else throw new Error("Unknown error")})}async request({method:n,path:t,body:u=void 0}){return this.sendRequest({method:n,path:t,body:u}).then(i=>Vr(i)).then(({response:i})=>i)}get usesIntegratorAuth(){return!!(this.integrationKey&&this.integratorSecret)}async restApi({method:n,path:t,body:u=void 0,query:i,headers:r}){return this.sendRestApiRequest({method:n,path:t,body:u,...i?{query:i}:{},...r?{headers:r}:{}}).then(a=>Vr(a)).then(({response:a})=>a)}async sendQuery({query:n,variables:t}){const{url:u,req:i,timeout:r}=this.buildGraphRequest({query:n,variables:t});return this.sendHTTPRequest({url:u,req:i,timeout:r})}async sendRequest({method:n,path:t,body:u}){const{url:i,req:r,timeout:a}=this.buildRestRequest(n,t,u);return this.sendHTTPRequest({url:i,req:r,timeout:a})}async sendRestApiRequest({method:n,path:t,body:u,query:i,headers:r}){const{url:a,req:o,timeout:s}=this.buildRestRequest(n,t,u,this.baseRestApiURL,i,r);if(this.integrationKey&&this.integratorSecret){const c=await Xh(this.integrationKey,this.integratorSecret,n,a,o.body??null),{"X-INTEGRATION-KEY":l,...f}=o.headers;o.headers={...f,...c}}return this.sendHTTPRequest({url:a,req:o,timeout:s})}async sendHTTPRequest({url:n,req:t,timeout:u}){const i=new AbortController,r=await this.fetchWithTimeout(n,t,u,i).catch(Nc);if(r instanceof Error)throw r.name==="AbortError"?new Oc:new Ni({cause:r});const a=this.getResponseHeaders(r.headers);if(!r.ok){const o=await r.text().catch(()=>"Unknown error"),s=Ph(o);throw this.makeStatusError(r.status,s,s?void 0:o,a)}return{response:r,controller:i,headers:a}}getResponseHeaders(n){const t=n.get("x-amzn-trace-id"),u=n.get("x-amzn-requestid");return{traceId:t,requestId:u}}async fetchWithTimeout(n,t,u,i){const{signal:r,...a}=t||{},o=AbortSignal.timeout(u),s=r?AbortSignal.any([r,o,i.signal]):AbortSignal.any([o,i.signal]);return fetch(n,{...a,signal:s})}buildGraphRequest({query:n,variables:t}){const u={query:Ke(n),variables:t,operationName:n?.definitions?.[0]?.name?.value},i=u?JSON.stringify(u,null,2):null,r=this.calculateContentLength(i),a=this.timeout,o={...r&&{"Content-Length":r},...this.defaultHeaders()},s=Object.fromEntries(Object.entries(o).filter(([l,f])=>f!==null)),c={method:"POST",...i?{body:i}:{},headers:s};return{url:this.baseGraphURL,req:c,timeout:a}}buildRestRequest(n,t,u,i,r,a){const o=u?JSON.stringify(u):null,s=this.calculateContentLength(o),c=this.timeout,l={...s&&{"Content-Length":s},...this.defaultHeaders(),...a??{}},f=Object.fromEntries(Object.entries(l).filter(([b,E])=>E!==null)),m={method:n,...o?{body:o}:{},headers:f},d=i??this.baseRestURL,v=t.startsWith("/")?t:"/"+t,h=new URL(v,d);if(r){const b=Object.entries(r).filter(g=>g[1]!==void 0).map(([g,k])=>[g,String(k)]),E=Kc(b);E&&(h.search=`?${E}`)}return{url:h.toString(),req:m,timeout:c}}defaultHeaders(){return{Accept:"application/json","Content-Type":"application/json",...this.authHeaders()}}calculateContentLength(n){if(typeof n=="string"){if(typeof Buffer<"u")return Buffer.byteLength(n,"utf8").toString();if(typeof TextEncoder<"u")return new TextEncoder().encode(n).length.toString()}return null}authHeaders(){return{Authorization:"Bearer "+this.apiKey,...this.integrationKey?{"X-INTEGRATION-KEY":this.integrationKey}:{}}}makeStatusError(n,t,u,i){return Be.generate(n,t,u,i)}}function ng(e){if(!(!e||typeof e!="object"))return e}function tg(e,n){return e.replace(/\{([^}]+)\}/g,(t,u)=>{if(!n||!(u in n))throw new Error(`Missing path parameter: ${u}`);const i=n[u];if(i==null)throw new Error(`Missing path parameter: ${u}`);return encodeURIComponent(String(i))})}function ig(e){if(!e)return;const n=[];for(const[t,u]of Object.entries(e))if(u!==void 0){if(typeof u!="string"&&typeof u!="number"&&typeof u!="boolean")throw new Error(`Unsupported query parameter value for ${t}`);n.push([t,u])}return n.length>0?Object.fromEntries(n):void 0}function ug(e){if(!e)return;const n=[];for(const[t,u]of Object.entries(e))if(u!==void 0){if(typeof u!="string"||u.length===0)throw new Error(`Unsupported header value for ${t}`);n.push([t,u])}return n.length>0?Object.fromEntries(n):void 0}function Q(e,n,...[t]){const u=ng(t?.params),i=tg(e,u),r=ig(t?.query),a=ug(t?.headers),o=t?.body;return{method:n,path:i,...o!==void 0?{body:o}:{},...r?{query:r}:{},...a?{headers:a}:{}}}class rg{client;constructor(n){this.client=n}async list(n){return this.client.restApi(Q("/v1/integrator/ach-debit/returns","get",n?{query:n}:void 0))}async get(n){return this.client.restApi(Q("/v1/integrator/ach-debit/returns/{returnId}","get",{params:{returnId:n}}))}}class ag{client;constructor(n){this.client=n}async list(){return this.client.restApi(Q("/v1/bank-accounts/","get"))}async get(n){return this.client.restApi(Q("/v1/bank-accounts/{accountId}","get",{params:{accountId:n}}))}async create(n){return this.client.restApi(Q("/v1/bank-accounts/","post",{body:n}))}async delete(n){return this.client.restApi(Q("/v1/bank-accounts/{accountId}","delete",{params:{accountId:n}}))}async createLinkToken(n){return this.client.restApi(Q("/v1/bank-accounts/link-token","post",n?{body:n}:void 0))}async completeLinking(n){return this.client.restApi(Q("/v1/bank-accounts/link-complete","post",{body:n}))}}var Zt={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"BillFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Bill"}},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:"originator"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"payable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verifying"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"openedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentDueDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentMinimumAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastStatementBalance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"remainingStatementBalance"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"dataSync"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"lastSync"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"syncStatus"},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:"paymentAddresses"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:588}};Zt.loc.source={body:`fragment BillFragment on Bill {
43
43
  id
44
44
  name
45
45
  userId
@@ -259,28 +259,28 @@ query UserDebitCards {
259
259
  ...DebitCardFragment
260
260
  }
261
261
  }
262
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Nm={};function nE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Nm[t]?!1:(Nm[t]=!0,!0)})}ut.definitions=ut.definitions.concat(nE(Eu.definitions));function bu(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(u){bu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){bu(u,n)}),e.definitions&&e.definitions.forEach(function(u){bu(u,n)})}var qo={};(function(){ut.definitions.forEach(function(n){if(n.name){var t=new Set;bu(n,t),qo[n.name.value]=t}})})();function Tm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function tE(e,n){var t={kind:e.kind,definitions:[Tm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=qo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=qo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Tm(e,o);s&&t.definitions.push(s)}),t}tE(ut,"UserDebitCards");const iE=/^4[0-9]{12}(?:[0-9]{3})?$/,uE=/^5[1-5][0-9]{14}$/,rE=Wn.object({name:Wn.string().min(1,"Name is required").nullable().optional(),cardNumber:Wn.string().min(1,"Card number is required").transform(e=>e.replace(/[^\d]/g,"")).refine(e=>(iE.test(e)||uE.test(e))&&e.length===16,"Card must be a valid 16-digit Visa or Mastercard number"),expirationDate:Wn.string().min(1,"Expiration date is required").regex(/^(0[1-9]|1[0-2])\/\d{2}$/,"Expiration date must be in MM/YY format")});class aE{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:ut}))?.debitCards??[]}async rename(n,t){return(await this.client.query({query:hu,variables:{accountId:n,name:t}}))?.renamePayableAccount??null}async delete(n){return(await this.client.query({query:Cn,variables:{accountId:n}}))?.deletePayableAccount??null}async create(n){try{const t=rE.parse(n);return(await this.client.query({query:vu,variables:{createDebitCardInput:{...n,cardNumber:t.cardNumber}}}))?.createDebitCard??null}catch(t){throw t instanceof Wn.ZodError?new Error(t.issues[0]?.message??"Input validation failure"):t}}}function Om(e){const n=e?.idempotencyKey;if(typeof n!="string"||n.length===0)throw new Error("idempotencyKey is required to create a deposit");return{"idempotency-key":n}}class oE{client;constructor(n){this.client=n}async prepare(n){return this.client.restApi(Q("/v1/deposits/direct/prepare","post",{body:n}))}async create(n,t){return this.client.restApi(Q("/v1/deposits/direct","post",{body:n,headers:Om(t)}))}async list(n){return this.client.restApi(Q("/v1/deposits/","get",n?{query:n}:void 0))}async get(n){return this.client.restApi(Q("/v1/deposits/{depositId}","get",{params:{depositId:n}}))}}class sE{client;constructor(n){this.client=n}async list(){return this.client.restApi(Q("/v1/funding-sources/","get"))}async get(n){return this.client.restApi(Q("/v1/funding-sources/{fundingSourceId}","get",{params:{fundingSourceId:n}}))}async getDepositLimits(n){return this.client.restApi(Q("/v1/funding-sources/{fundingSourceId}/deposit-limits","get",{params:{fundingSourceId:n}}))}}var ei={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PayableAccountInstitutionFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PayableAccountInstitution"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},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:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logo"},arguments:[],directives:[]}]}}],loc:{start:0,end:126}};ei.loc.source={body:`fragment PayableAccountInstitutionFragment on PayableAccountInstitution {
262
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Nm={};function nE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Nm[t]?!1:(Nm[t]=!0,!0)})}ut.definitions=ut.definitions.concat(nE(Eu.definitions));function bu(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(u){bu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){bu(u,n)}),e.definitions&&e.definitions.forEach(function(u){bu(u,n)})}var qo={};(function(){ut.definitions.forEach(function(n){if(n.name){var t=new Set;bu(n,t),qo[n.name.value]=t}})})();function Tm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function tE(e,n){var t={kind:e.kind,definitions:[Tm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=qo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=qo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Tm(e,o);s&&t.definitions.push(s)}),t}tE(ut,"UserDebitCards");const iE=/^4[0-9]{12}(?:[0-9]{3})?$/,uE=/^5[1-5][0-9]{14}$/,rE=Wn.object({name:Wn.string().min(1,"Name is required").nullable().optional(),cardNumber:Wn.string().min(1,"Card number is required").transform(e=>e.replace(/[^\d]/g,"")).refine(e=>(iE.test(e)||uE.test(e))&&e.length===16,"Card must be a valid 16-digit Visa or Mastercard number"),expirationDate:Wn.string().min(1,"Expiration date is required").regex(/^(0[1-9]|1[0-2])\/\d{2}$/,"Expiration date must be in MM/YY format")});class aE{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:ut}))?.debitCards??[]}async rename(n,t){return(await this.client.query({query:hu,variables:{accountId:n,name:t}}))?.renamePayableAccount??null}async delete(n){return(await this.client.query({query:Cn,variables:{accountId:n}}))?.deletePayableAccount??null}async create(n){try{const t=rE.parse(n);return(await this.client.query({query:vu,variables:{createDebitCardInput:{...n,cardNumber:t.cardNumber}}}))?.createDebitCard??null}catch(t){throw t instanceof Wn.ZodError?new Error(t.issues[0]?.message??"Input validation failure"):t}}}function oE(e,n){if(!e.usesIntegratorAuth)return;const t=n.clientIp;if(typeof t!="string"||t.length===0)throw new Error("clientIp is required to create a deposit with integrator HMAC credentials: pass the public address your edge observed for the authorizing client")}function Om(e){const n=e?.idempotencyKey;if(typeof n!="string"||n.length===0)throw new Error("idempotencyKey is required to create a deposit");return{"idempotency-key":n}}class sE{client;constructor(n){this.client=n}async prepare(n){return this.client.restApi(Q("/v1/deposits/direct/prepare","post",{body:n}))}async create(n,t){return oE(this.client,n),this.client.restApi(Q("/v1/deposits/direct","post",{body:n,headers:Om(t)}))}async list(n){return this.client.restApi(Q("/v1/deposits/","get",n?{query:n}:void 0))}async get(n){return this.client.restApi(Q("/v1/deposits/{depositId}","get",{params:{depositId:n}}))}}class cE{client;constructor(n){this.client=n}async list(){return this.client.restApi(Q("/v1/funding-sources/","get"))}async get(n){return this.client.restApi(Q("/v1/funding-sources/{fundingSourceId}","get",{params:{fundingSourceId:n}}))}async getDepositLimits(n){return this.client.restApi(Q("/v1/funding-sources/{fundingSourceId}/deposit-limits","get",{params:{fundingSourceId:n}}))}}var ei={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PayableAccountInstitutionFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PayableAccountInstitution"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},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:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logo"},arguments:[],directives:[]}]}}],loc:{start:0,end:126}};ei.loc.source={body:`fragment PayableAccountInstitutionFragment on PayableAccountInstitution {
263
263
  id
264
264
  country
265
265
  currency
266
266
  name
267
267
  logo
268
268
  }
269
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function ku(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(u){ku(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){ku(u,n)}),e.definitions&&e.definitions.forEach(function(u){ku(u,n)})}var Mo={};(function(){ei.definitions.forEach(function(n){if(n.name){var t=new Set;ku(n,t),Mo[n.name.value]=t}})})();function zm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function cE(e,n){var t={kind:e.kind,definitions:[zm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Mo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Mo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=zm(e,o);s&&t.definitions.push(s)}),t}cE(ei,"PayableAccountInstitutionFragment");var rt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PopularBillInstitutions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"billType"}},type:{kind:"NamedType",name:{kind:"Name",value:"BillType"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"popularUSBillInstitutions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"billType"},value:{kind:"Variable",name:{kind:"Name",value:"billType"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PayableAccountInstitutionFragment"},directives:[]}]}}]}}],loc:{start:0,end:214}};rt.loc.source={body:`#import "./payableAccountInstitutionFragment.graphql"
269
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function ku(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(u){ku(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){ku(u,n)}),e.definitions&&e.definitions.forEach(function(u){ku(u,n)})}var Mo={};(function(){ei.definitions.forEach(function(n){if(n.name){var t=new Set;ku(n,t),Mo[n.name.value]=t}})})();function zm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function lE(e,n){var t={kind:e.kind,definitions:[zm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Mo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Mo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=zm(e,o);s&&t.definitions.push(s)}),t}lE(ei,"PayableAccountInstitutionFragment");var rt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PopularBillInstitutions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"billType"}},type:{kind:"NamedType",name:{kind:"Name",value:"BillType"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"popularUSBillInstitutions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"billType"},value:{kind:"Variable",name:{kind:"Name",value:"billType"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PayableAccountInstitutionFragment"},directives:[]}]}}]}}],loc:{start:0,end:214}};rt.loc.source={body:`#import "./payableAccountInstitutionFragment.graphql"
270
270
 
271
271
  query PopularBillInstitutions($billType: BillType) {
272
272
  popularUSBillInstitutions(billType: $billType) {
273
273
  ...PayableAccountInstitutionFragment
274
274
  }
275
275
  }
276
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Um={};function lE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Um[t]?!1:(Um[t]=!0,!0)})}rt.definitions=rt.definitions.concat(lE(ei.definitions));function Du(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(u){Du(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Du(u,n)}),e.definitions&&e.definitions.forEach(function(u){Du(u,n)})}var Go={};(function(){rt.definitions.forEach(function(n){if(n.name){var t=new Set;Du(n,t),Go[n.name.value]=t}})})();function Pm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function dE(e,n){var t={kind:e.kind,definitions:[Pm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Go[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Go[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Pm(e,o);s&&t.definitions.push(s)}),t}dE(rt,"PopularBillInstitutions");var at={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchUSBillInstitutions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"billType"}},type:{kind:"NamedType",name:{kind:"Name",value:"BillType"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchUSBillInstitutions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"searchTerm"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}},{kind:"Argument",name:{kind:"Name",value:"billType"},value:{kind:"Variable",name:{kind:"Name",value:"billType"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PayableAccountInstitutionFragment"},directives:[]}]}}]}}],loc:{start:0,end:261}};at.loc.source={body:`#import "./payableAccountInstitutionFragment.graphql"
276
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Um={};function dE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Um[t]?!1:(Um[t]=!0,!0)})}rt.definitions=rt.definitions.concat(dE(ei.definitions));function Du(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(u){Du(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Du(u,n)}),e.definitions&&e.definitions.forEach(function(u){Du(u,n)})}var Go={};(function(){rt.definitions.forEach(function(n){if(n.name){var t=new Set;Du(n,t),Go[n.name.value]=t}})})();function Pm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function fE(e,n){var t={kind:e.kind,definitions:[Pm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Go[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Go[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Pm(e,o);s&&t.definitions.push(s)}),t}fE(rt,"PopularBillInstitutions");var at={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchUSBillInstitutions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"billType"}},type:{kind:"NamedType",name:{kind:"Name",value:"BillType"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchUSBillInstitutions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"searchTerm"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}},{kind:"Argument",name:{kind:"Name",value:"billType"},value:{kind:"Variable",name:{kind:"Name",value:"billType"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PayableAccountInstitutionFragment"},directives:[]}]}}]}}],loc:{start:0,end:261}};at.loc.source={body:`#import "./payableAccountInstitutionFragment.graphql"
277
277
 
278
278
  query SearchUSBillInstitutions($searchTerm: String!, $billType: BillType) {
279
279
  searchUSBillInstitutions(searchTerm: $searchTerm, billType: $billType) {
280
280
  ...PayableAccountInstitutionFragment
281
281
  }
282
282
  }
283
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Rm={};function fE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Rm[t]?!1:(Rm[t]=!0,!0)})}at.definitions=at.definitions.concat(fE(ei.definitions));function Su(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(u){Su(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Su(u,n)}),e.definitions&&e.definitions.forEach(function(u){Su(u,n)})}var Jo={};(function(){at.definitions.forEach(function(n){if(n.name){var t=new Set;Su(n,t),Jo[n.name.value]=t}})})();function jm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function mE(e,n){var t={kind:e.kind,definitions:[jm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Jo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Jo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=jm(e,o);s&&t.definitions.push(s)}),t}mE(at,"SearchUSBillInstitutions");class vE{client;constructor(n){this.client=n}async popularUSBillInstitutions(n){return(await this.client.query({query:rt,variables:{billType:n??null}}))?.popularUSBillInstitutions??[]}async searchUSBillInstitutions(n,t){return(await this.client.query({query:at,variables:{searchTerm:n,billType:t??null}}))?.searchUSBillInstitutions??[]}}class pE{client;constructor(n){this.client=n}async bypassKyc(n){return this.client.restApi(Q("/v1/sandbox/bypass-kyc","post",{body:n??{country:"US"}}))}async createDepositWithReturn(n,t){return this.client.restApi(Q("/v1/sandbox/deposits/direct","post",{body:n,headers:Om(t)}))}async deleteFundingSource(n){return this.client.restApi(Q("/v1/sandbox/funding-sources/{fundingSourceId}","delete",{params:{fundingSourceId:n}}))}}class hE{client;constructor(n){this.client=n}async refund(n,t){return this.client.restApi(Q("/v1/off-ramps/{offRampId}/refund","post",{params:{offRampId:n},body:t}))}}var Bu={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"OnrampPaymentFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnRampPayment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},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:"depositInstructions"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAddress"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankBeneficiaryName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankRoutingNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentMethod"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"depositMessage"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"token"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]}]}}],loc:{start:0,end:369}};Bu.loc.source={body:`fragment OnrampPaymentFragment on OnRampPayment {
283
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Rm={};function mE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Rm[t]?!1:(Rm[t]=!0,!0)})}at.definitions=at.definitions.concat(mE(ei.definitions));function Su(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(u){Su(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Su(u,n)}),e.definitions&&e.definitions.forEach(function(u){Su(u,n)})}var Jo={};(function(){at.definitions.forEach(function(n){if(n.name){var t=new Set;Su(n,t),Jo[n.name.value]=t}})})();function jm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function vE(e,n){var t={kind:e.kind,definitions:[jm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Jo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Jo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=jm(e,o);s&&t.definitions.push(s)}),t}vE(at,"SearchUSBillInstitutions");class pE{client;constructor(n){this.client=n}async popularUSBillInstitutions(n){return(await this.client.query({query:rt,variables:{billType:n??null}}))?.popularUSBillInstitutions??[]}async searchUSBillInstitutions(n,t){return(await this.client.query({query:at,variables:{searchTerm:n,billType:t??null}}))?.searchUSBillInstitutions??[]}}class hE{client;constructor(n){this.client=n}async bypassKyc(n){return this.client.restApi(Q("/v1/sandbox/bypass-kyc","post",{body:n??{country:"US"}}))}async createDepositWithReturn(n,t){return this.client.restApi(Q("/v1/sandbox/deposits/direct","post",{body:n,headers:Om(t)}))}async deleteFundingSource(n){return this.client.restApi(Q("/v1/sandbox/funding-sources/{fundingSourceId}","delete",{params:{fundingSourceId:n}}))}}class gE{client;constructor(n){this.client=n}async refund(n,t){return this.client.restApi(Q("/v1/off-ramps/{offRampId}/refund","post",{params:{offRampId:n},body:t}))}}var Bu={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"OnrampPaymentFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnRampPayment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},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:"depositInstructions"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAddress"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankBeneficiaryName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankRoutingNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentMethod"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"depositMessage"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"token"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]}]}}],loc:{start:0,end:369}};Bu.loc.source={body:`fragment OnrampPaymentFragment on OnRampPayment {
284
284
  id
285
285
  amount
286
286
  feeAmount
@@ -301,14 +301,14 @@ query SearchUSBillInstitutions($searchTerm: String!, $billType: BillType) {
301
301
  status
302
302
  createdAt
303
303
  }
304
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function wu(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(u){wu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){wu(u,n)}),e.definitions&&e.definitions.forEach(function(u){wu(u,n)})}var Ho={};(function(){Bu.definitions.forEach(function(n){if(n.name){var t=new Set;wu(n,t),Ho[n.name.value]=t}})})();function Lm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function gE(e,n){var t={kind:e.kind,definitions:[Lm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ho[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Ho[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Lm(e,o);s&&t.definitions.push(s)}),t}gE(Bu,"OnrampPaymentFragment");var ot={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateOnrampPayment"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createOnrampPaymentInput"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreateOnrampPaymentInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createOnrampPayment"},arguments:[{kind:"Argument",name:{kind:"Name",value:"createOnrampPaymentInput"},value:{kind:"Variable",name:{kind:"Name",value:"createOnrampPaymentInput"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"OnrampPaymentFragment"},directives:[]}]}}]}}],loc:{start:0,end:257}};ot.loc.source={body:`#import "../queries/onrampPaymentFragment.graphql"
304
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function wu(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(u){wu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){wu(u,n)}),e.definitions&&e.definitions.forEach(function(u){wu(u,n)})}var Ho={};(function(){Bu.definitions.forEach(function(n){if(n.name){var t=new Set;wu(n,t),Ho[n.name.value]=t}})})();function Lm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function EE(e,n){var t={kind:e.kind,definitions:[Lm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ho[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Ho[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Lm(e,o);s&&t.definitions.push(s)}),t}EE(Bu,"OnrampPaymentFragment");var ot={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateOnrampPayment"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createOnrampPaymentInput"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreateOnrampPaymentInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createOnrampPayment"},arguments:[{kind:"Argument",name:{kind:"Name",value:"createOnrampPaymentInput"},value:{kind:"Variable",name:{kind:"Name",value:"createOnrampPaymentInput"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"OnrampPaymentFragment"},directives:[]}]}}]}}],loc:{start:0,end:257}};ot.loc.source={body:`#import "../queries/onrampPaymentFragment.graphql"
305
305
 
306
306
  mutation CreateOnrampPayment($createOnrampPaymentInput: CreateOnrampPaymentInput!) {
307
307
  createOnrampPayment(createOnrampPaymentInput: $createOnrampPaymentInput) {
308
308
  ...OnrampPaymentFragment
309
309
  }
310
310
  }
311
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Zm={};function EE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Zm[t]?!1:(Zm[t]=!0,!0)})}ot.definitions=ot.definitions.concat(EE(Bu.definitions));function Au(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(u){Au(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Au(u,n)}),e.definitions&&e.definitions.forEach(function(u){Au(u,n)})}var Ko={};(function(){ot.definitions.forEach(function(n){if(n.name){var t=new Set;Au(n,t),Ko[n.name.value]=t}})})();function Vm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function yE(e,n){var t={kind:e.kind,definitions:[Vm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ko[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Ko[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Vm(e,o);s&&t.definitions.push(s)}),t}yE(ot,"CreateOnrampPayment");class bE{client;constructor(n){this.client=n}async create(n){return(await this.client.query({query:ot,variables:{createOnrampPaymentInput:n}}))?.createOnrampPayment}async list(n){return this.client.restApi(Q("/v1/on-ramps/","get",n?{query:n}:void 0))}async get(n){return this.client.restApi(Q("/v1/on-ramps/{onRampId}","get",{params:{onRampId:n}}))}}var _u={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"FullBridgeUser"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BridgeUser"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"kycStatus"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tosLink"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tosStatus"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"signedAgreementId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"hasAcceptedTos"},arguments:[],directives:[]}]}}],loc:{start:0,end:151}};_u.loc.source={body:`fragment FullBridgeUser on BridgeUser {
311
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Zm={};function yE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Zm[t]?!1:(Zm[t]=!0,!0)})}ot.definitions=ot.definitions.concat(yE(Bu.definitions));function Au(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(u){Au(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Au(u,n)}),e.definitions&&e.definitions.forEach(function(u){Au(u,n)})}var Ko={};(function(){ot.definitions.forEach(function(n){if(n.name){var t=new Set;Au(n,t),Ko[n.name.value]=t}})})();function Vm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function bE(e,n){var t={kind:e.kind,definitions:[Vm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ko[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Ko[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Vm(e,o);s&&t.definitions.push(s)}),t}bE(ot,"CreateOnrampPayment");class kE{client;constructor(n){this.client=n}async create(n){return(await this.client.query({query:ot,variables:{createOnrampPaymentInput:n}}))?.createOnrampPayment}async list(n){return this.client.restApi(Q("/v1/on-ramps/","get",n?{query:n}:void 0))}async get(n){return this.client.restApi(Q("/v1/on-ramps/{onRampId}","get",{params:{onRampId:n}}))}}var _u={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"FullBridgeUser"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BridgeUser"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"kycStatus"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tosLink"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tosStatus"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"signedAgreementId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"hasAcceptedTos"},arguments:[],directives:[]}]}}],loc:{start:0,end:151}};_u.loc.source={body:`fragment FullBridgeUser on BridgeUser {
312
312
  id
313
313
  kycStatus
314
314
  tosLink
@@ -318,14 +318,14 @@ mutation CreateOnrampPayment($createOnrampPaymentInput: CreateOnrampPaymentInput
318
318
  error
319
319
  hasAcceptedTos
320
320
  }
321
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Cu(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(u){Cu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Cu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Cu(u,n)})}var Qo={};(function(){_u.definitions.forEach(function(n){if(n.name){var t=new Set;Cu(n,t),Qo[n.name.value]=t}})})();function qm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function kE(e,n){var t={kind:e.kind,definitions:[qm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Qo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Qo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=qm(e,o);s&&t.definitions.push(s)}),t}kE(_u,"FullBridgeUser");var st={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AcceptTermsOfService"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"agreementId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"setBridgeUserAgreementId"},arguments:[{kind:"Argument",name:{kind:"Name",value:"agreementId"},value:{kind:"Variable",name:{kind:"Name",value:"agreementId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"FullBridgeUser"},directives:[]}]}}]}}],loc:{start:0,end:196}};st.loc.source={body:`#import "../queries/bridgeUserFragment.graphql"
321
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Cu(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(u){Cu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Cu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Cu(u,n)})}var Qo={};(function(){_u.definitions.forEach(function(n){if(n.name){var t=new Set;Cu(n,t),Qo[n.name.value]=t}})})();function qm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function DE(e,n){var t={kind:e.kind,definitions:[qm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Qo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Qo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=qm(e,o);s&&t.definitions.push(s)}),t}DE(_u,"FullBridgeUser");var st={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AcceptTermsOfService"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"agreementId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"setBridgeUserAgreementId"},arguments:[{kind:"Argument",name:{kind:"Name",value:"agreementId"},value:{kind:"Variable",name:{kind:"Name",value:"agreementId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"FullBridgeUser"},directives:[]}]}}]}}],loc:{start:0,end:196}};st.loc.source={body:`#import "../queries/bridgeUserFragment.graphql"
322
322
 
323
323
  mutation AcceptTermsOfService($agreementId: String!) {
324
324
  setBridgeUserAgreementId(agreementId: $agreementId) {
325
325
  ...FullBridgeUser
326
326
  }
327
327
  }
328
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Mm={};function DE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Mm[t]?!1:(Mm[t]=!0,!0)})}st.definitions=st.definitions.concat(DE(_u.definitions));function $u(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(u){$u(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){$u(u,n)}),e.definitions&&e.definitions.forEach(function(u){$u(u,n)})}var Wo={};(function(){st.definitions.forEach(function(n){if(n.name){var t=new Set;$u(n,t),Wo[n.name.value]=t}})})();function Gm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function SE(e,n){var t={kind:e.kind,definitions:[Gm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Wo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Wo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Gm(e,o);s&&t.definitions.push(s)}),t}SE(st,"AcceptTermsOfService");class BE{client;constructor(n){this.client=n}async acceptTermsOfService(n){return(await this.client.query({query:st,variables:{agreementId:n}})).setBridgeUserAgreementId}}var ni={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"VirtualAccountFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BridgeVirtualAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"token"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"deposited"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"microdeposits"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"depositInstructions"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bankAccountNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAddress"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankRoutingNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentMethod"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:306}};ni.loc.source={body:`fragment VirtualAccountFragment on BridgeVirtualAccount {
328
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Mm={};function SE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Mm[t]?!1:(Mm[t]=!0,!0)})}st.definitions=st.definitions.concat(SE(_u.definitions));function $u(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(u){$u(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){$u(u,n)}),e.definitions&&e.definitions.forEach(function(u){$u(u,n)})}var Wo={};(function(){st.definitions.forEach(function(n){if(n.name){var t=new Set;$u(n,t),Wo[n.name.value]=t}})})();function Gm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function BE(e,n){var t={kind:e.kind,definitions:[Gm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Wo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Wo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Gm(e,o);s&&t.definitions.push(s)}),t}BE(st,"AcceptTermsOfService");class wE{client;constructor(n){this.client=n}async acceptTermsOfService(n){return(await this.client.query({query:st,variables:{agreementId:n}})).setBridgeUserAgreementId}}var ni={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"VirtualAccountFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BridgeVirtualAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"token"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"deposited"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"microdeposits"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"depositInstructions"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bankAccountNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAddress"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankRoutingNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentMethod"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:306}};ni.loc.source={body:`fragment VirtualAccountFragment on BridgeVirtualAccount {
329
329
  id
330
330
  network
331
331
  address
@@ -342,7 +342,7 @@ mutation AcceptTermsOfService($agreementId: String!) {
342
342
  paymentMethod
343
343
  }
344
344
  }
345
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function xu(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(u){xu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){xu(u,n)}),e.definitions&&e.definitions.forEach(function(u){xu(u,n)})}var Yo={};(function(){ni.definitions.forEach(function(n){if(n.name){var t=new Set;xu(n,t),Yo[n.name.value]=t}})})();function Jm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function wE(e,n){var t={kind:e.kind,definitions:[Jm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Yo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Yo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Jm(e,o);s&&t.definitions.push(s)}),t}wE(ni,"VirtualAccountFragment");var ct={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateVirtualAccount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"network"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"address"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"token"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createVirtualAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"createBridgeVirtualAccountInput"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"address"},value:{kind:"Variable",name:{kind:"Name",value:"address"}}},{kind:"ObjectField",name:{kind:"Name",value:"network"},value:{kind:"Variable",name:{kind:"Name",value:"network"}}},{kind:"ObjectField",name:{kind:"Name",value:"token"},value:{kind:"Variable",name:{kind:"Name",value:"token"}}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VirtualAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:313}};ct.loc.source={body:`#import "../queries/virtualAccountFragment.graphql"
345
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function xu(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(u){xu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){xu(u,n)}),e.definitions&&e.definitions.forEach(function(u){xu(u,n)})}var Yo={};(function(){ni.definitions.forEach(function(n){if(n.name){var t=new Set;xu(n,t),Yo[n.name.value]=t}})})();function Jm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function AE(e,n){var t={kind:e.kind,definitions:[Jm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Yo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Yo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Jm(e,o);s&&t.definitions.push(s)}),t}AE(ni,"VirtualAccountFragment");var ct={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateVirtualAccount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"network"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"address"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"token"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createVirtualAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"createBridgeVirtualAccountInput"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"address"},value:{kind:"Variable",name:{kind:"Name",value:"address"}}},{kind:"ObjectField",name:{kind:"Name",value:"network"},value:{kind:"Variable",name:{kind:"Name",value:"network"}}},{kind:"ObjectField",name:{kind:"Name",value:"token"},value:{kind:"Variable",name:{kind:"Name",value:"token"}}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VirtualAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:313}};ct.loc.source={body:`#import "../queries/virtualAccountFragment.graphql"
346
346
 
347
347
  mutation CreateVirtualAccount($network: String!, $address: String!, $token: String!) {
348
348
  createVirtualAccount(
@@ -351,14 +351,14 @@ mutation CreateVirtualAccount($network: String!, $address: String!, $token: Stri
351
351
  ...VirtualAccountFragment
352
352
  }
353
353
  }
354
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Hm={};function AE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Hm[t]?!1:(Hm[t]=!0,!0)})}ct.definitions=ct.definitions.concat(AE(ni.definitions));function Iu(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(u){Iu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Iu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Iu(u,n)})}var Xo={};(function(){ct.definitions.forEach(function(n){if(n.name){var t=new Set;Iu(n,t),Xo[n.name.value]=t}})})();function Km(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function _E(e,n){var t={kind:e.kind,definitions:[Km(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Xo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Xo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Km(e,o);s&&t.definitions.push(s)}),t}_E(ct,"CreateVirtualAccount");var lt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"VirtualAccounts"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"virtualAccounts"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VirtualAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:132}};lt.loc.source={body:`#import "./virtualAccountFragment.graphql"
354
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Hm={};function _E(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Hm[t]?!1:(Hm[t]=!0,!0)})}ct.definitions=ct.definitions.concat(_E(ni.definitions));function Iu(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(u){Iu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Iu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Iu(u,n)})}var Xo={};(function(){ct.definitions.forEach(function(n){if(n.name){var t=new Set;Iu(n,t),Xo[n.name.value]=t}})})();function Km(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function CE(e,n){var t={kind:e.kind,definitions:[Km(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Xo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Xo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Km(e,o);s&&t.definitions.push(s)}),t}CE(ct,"CreateVirtualAccount");var lt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"VirtualAccounts"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"virtualAccounts"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VirtualAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:132}};lt.loc.source={body:`#import "./virtualAccountFragment.graphql"
355
355
 
356
356
  query VirtualAccounts {
357
357
  virtualAccounts {
358
358
  ...VirtualAccountFragment
359
359
  }
360
360
  }
361
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Qm={};function CE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Qm[t]?!1:(Qm[t]=!0,!0)})}lt.definitions=lt.definitions.concat(CE(ni.definitions));function Fu(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(u){Fu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Fu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Fu(u,n)})}var es={};(function(){lt.definitions.forEach(function(n){if(n.name){var t=new Set;Fu(n,t),es[n.name.value]=t}})})();function Wm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function $E(e,n){var t={kind:e.kind,definitions:[Wm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=es[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=es[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Wm(e,o);s&&t.definitions.push(s)}),t}$E(lt,"VirtualAccounts");var Me=(e=>(e.Ethereum="ethereum",e.Polygon="polygon",e.Optimism="optimism",e.Arbitrum="arbitrum",e.Binance="binance-smart-chain",e.Avalanche="avalanche",e.Base="base",e.Bitcoin="bitcoin",e.Dash="dash",e.Tron="tron",e.Solana="solana",e.Sui="sui",e))(Me||{});const Ym={[Me.Ethereum]:["USDC","USDT","DAI","USDP","PYUSD"],[Me.Polygon]:["USDC"],[Me.Base]:["USDC"],[Me.Arbitrum]:["USDC"],[Me.Avalanche]:["USDC"],[Me.Optimism]:["USDC"],[Me.Solana]:["USDC","PYUSD"],[Me.Tron]:["USDT"]};function xE(e){const{network:n,token:t}=e,u=Ym[n];if(!u||!u.includes(t))throw new Error(`Token "${t}" is not supported on network "${n}". Supported tokens for ${n}: ${u?.join(", ")||"none"}`)}class IE{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:lt})).virtualAccounts}async create(n){return xE(n),(await this.client.query({query:ct,variables:{network:n.network,address:n.address,token:n.token}})).createVirtualAccount}}var dt={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:"feeSubsidyAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"deliveryMethod"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentRequestId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyRate"},arguments:[],directives:[]},{kind:"Field",alias:{kind:"Name",value:"failureReason"},name:{kind:"Name",value:"error"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"transaction"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hash"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"from"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"asset"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:369}};dt.loc.source={body:`fragment PaymentFragment on Payment {
361
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Qm={};function $E(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Qm[t]?!1:(Qm[t]=!0,!0)})}lt.definitions=lt.definitions.concat($E(ni.definitions));function Fu(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(u){Fu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Fu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Fu(u,n)})}var es={};(function(){lt.definitions.forEach(function(n){if(n.name){var t=new Set;Fu(n,t),es[n.name.value]=t}})})();function Wm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function xE(e,n){var t={kind:e.kind,definitions:[Wm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=es[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=es[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Wm(e,o);s&&t.definitions.push(s)}),t}xE(lt,"VirtualAccounts");var Me=(e=>(e.Ethereum="ethereum",e.Polygon="polygon",e.Optimism="optimism",e.Arbitrum="arbitrum",e.Binance="binance-smart-chain",e.Avalanche="avalanche",e.Base="base",e.Bitcoin="bitcoin",e.Dash="dash",e.Tron="tron",e.Solana="solana",e.Sui="sui",e))(Me||{});const Ym={[Me.Ethereum]:["USDC","USDT","DAI","USDP","PYUSD"],[Me.Polygon]:["USDC"],[Me.Base]:["USDC"],[Me.Arbitrum]:["USDC"],[Me.Avalanche]:["USDC"],[Me.Optimism]:["USDC"],[Me.Solana]:["USDC","PYUSD"],[Me.Tron]:["USDT"]};function IE(e){const{network:n,token:t}=e,u=Ym[n];if(!u||!u.includes(t))throw new Error(`Token "${t}" is not supported on network "${n}". Supported tokens for ${n}: ${u?.join(", ")||"none"}`)}class FE{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:lt})).virtualAccounts}async create(n){return IE(n),(await this.client.query({query:ct,variables:{network:n.network,address:n.address,token:n.token}})).createVirtualAccount}}var dt={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:"feeSubsidyAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"deliveryMethod"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentRequestId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyRate"},arguments:[],directives:[]},{kind:"Field",alias:{kind:"Name",value:"failureReason"},name:{kind:"Name",value:"error"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"transaction"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hash"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"from"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"asset"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:369}};dt.loc.source={body:`fragment PaymentFragment on Payment {
362
362
  id
363
363
  userId
364
364
  status
@@ -381,28 +381,28 @@ query VirtualAccounts {
381
381
  network
382
382
  }
383
383
  }
384
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Nu(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(u){Nu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Nu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Nu(u,n)})}var ns={};(function(){dt.definitions.forEach(function(n){if(n.name){var t=new Set;Nu(n,t),ns[n.name.value]=t}})})();function Xm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function FE(e,n){var t={kind:e.kind,definitions:[Xm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=ns[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=ns[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Xm(e,o);s&&t.definitions.push(s)}),t}FE(dt,"PaymentFragment");var ft={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}};ft.loc.source={body:`#import "./paymentFragment.graphql"
384
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Nu(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(u){Nu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Nu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Nu(u,n)})}var ns={};(function(){dt.definitions.forEach(function(n){if(n.name){var t=new Set;Nu(n,t),ns[n.name.value]=t}})})();function Xm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function NE(e,n){var t={kind:e.kind,definitions:[Xm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=ns[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=ns[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Xm(e,o);s&&t.definitions.push(s)}),t}NE(dt,"PaymentFragment");var ft={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}};ft.loc.source={body:`#import "./paymentFragment.graphql"
385
385
 
386
386
  query PaymentRequestPayment($paymentRequestId: String!) {
387
387
  paymentForPaymentRequest(paymentRequestId: $paymentRequestId) {
388
388
  ...PaymentFragment
389
389
  }
390
390
  }
391
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var e4={};function NE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return e4[t]?!1:(e4[t]=!0,!0)})}ft.definitions=ft.definitions.concat(NE(dt.definitions));function Tu(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(u){Tu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Tu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Tu(u,n)})}var ts={};(function(){ft.definitions.forEach(function(n){if(n.name){var t=new Set;Tu(n,t),ts[n.name.value]=t}})})();function n4(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function TE(e,n){var t={kind:e.kind,definitions:[n4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=ts[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=ts[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=n4(e,o);s&&t.definitions.push(s)}),t}TE(ft,"PaymentRequestPayment");var mt={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}};mt.loc.source={body:`#import "./paymentFragment.graphql"
391
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var e4={};function TE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return e4[t]?!1:(e4[t]=!0,!0)})}ft.definitions=ft.definitions.concat(TE(dt.definitions));function Tu(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(u){Tu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Tu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Tu(u,n)})}var ts={};(function(){ft.definitions.forEach(function(n){if(n.name){var t=new Set;Tu(n,t),ts[n.name.value]=t}})})();function n4(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function OE(e,n){var t={kind:e.kind,definitions:[n4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=ts[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=ts[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=n4(e,o);s&&t.definitions.push(s)}),t}OE(ft,"PaymentRequestPayment");var mt={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}};mt.loc.source={body:`#import "./paymentFragment.graphql"
392
392
 
393
393
  query AccountPayments($accountId: String!) {
394
394
  paymentsForAccount(accountId: $accountId) {
395
395
  ...PaymentFragment
396
396
  }
397
397
  }
398
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var t4={};function OE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return t4[t]?!1:(t4[t]=!0,!0)})}mt.definitions=mt.definitions.concat(OE(dt.definitions));function Ou(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(u){Ou(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Ou(u,n)}),e.definitions&&e.definitions.forEach(function(u){Ou(u,n)})}var is={};(function(){mt.definitions.forEach(function(n){if(n.name){var t=new Set;Ou(n,t),is[n.name.value]=t}})})();function i4(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function zE(e,n){var t={kind:e.kind,definitions:[i4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=is[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=is[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=i4(e,o);s&&t.definitions.push(s)}),t}zE(mt,"AccountPayments");var vt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"Payment"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"paymentId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"payment"},arguments:[{kind:"Argument",name:{kind:"Name",value:"paymentId"},value:{kind:"Variable",name:{kind:"Name",value:"paymentId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentFragment"},directives:[]}]}}]}}],loc:{start:0,end:146}};vt.loc.source={body:`#import "./paymentFragment.graphql"
398
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var t4={};function zE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return t4[t]?!1:(t4[t]=!0,!0)})}mt.definitions=mt.definitions.concat(zE(dt.definitions));function Ou(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(u){Ou(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Ou(u,n)}),e.definitions&&e.definitions.forEach(function(u){Ou(u,n)})}var is={};(function(){mt.definitions.forEach(function(n){if(n.name){var t=new Set;Ou(n,t),is[n.name.value]=t}})})();function i4(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function UE(e,n){var t={kind:e.kind,definitions:[i4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=is[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=is[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=i4(e,o);s&&t.definitions.push(s)}),t}UE(mt,"AccountPayments");var vt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"Payment"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"paymentId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"payment"},arguments:[{kind:"Argument",name:{kind:"Name",value:"paymentId"},value:{kind:"Variable",name:{kind:"Name",value:"paymentId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentFragment"},directives:[]}]}}]}}],loc:{start:0,end:146}};vt.loc.source={body:`#import "./paymentFragment.graphql"
399
399
 
400
400
  query Payment($paymentId: String!) {
401
401
  payment(paymentId: $paymentId) {
402
402
  ...PaymentFragment
403
403
  }
404
404
  }
405
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var u4={};function UE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return u4[t]?!1:(u4[t]=!0,!0)})}vt.definitions=vt.definitions.concat(UE(dt.definitions));function zu(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(u){zu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){zu(u,n)}),e.definitions&&e.definitions.forEach(function(u){zu(u,n)})}var us={};(function(){vt.definitions.forEach(function(n){if(n.name){var t=new Set;zu(n,t),us[n.name.value]=t}})})();function r4(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function PE(e,n){var t={kind:e.kind,definitions:[r4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=us[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=us[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=r4(e,o);s&&t.definitions.push(s)}),t}PE(vt,"Payment");class RE{client;constructor(n){this.client=n}async listForAccount(n){return(await this.client.query({query:mt,variables:{accountId:n}}))?.paymentsForAccount??[]}async fetchById(n){return(await this.client.query({query:vt,variables:{paymentId:n}}))?.payment??null}async getForPaymentRequest(n){return(await this.client.query({query:ft,variables:{paymentRequestId:n}}))?.paymentForPaymentRequest??null}async getPaymentLimits(n){try{const t=await this.client.restApi(Q("/v1/bank-accounts/{accountId}/payment-limits","get",{params:{accountId:n}}));return{perTransaction:Number(t.transactionLimit),dailyLimit:Number(t.dailyLimit),dailyRemainingVolume:Number(t.dailyRemaining)}}catch{return null}}}var Uu={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:[]},{kind:"Field",name:{kind:"Name",value:"deliveryMethod"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyRate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeSubsidyAmount"},arguments:[],directives:[]}]}}],loc:{start:0,end:268}};Uu.loc.source={body:`fragment PaymentRequestFragment on DirectPayment {
405
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var u4={};function PE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return u4[t]?!1:(u4[t]=!0,!0)})}vt.definitions=vt.definitions.concat(PE(dt.definitions));function zu(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(u){zu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){zu(u,n)}),e.definitions&&e.definitions.forEach(function(u){zu(u,n)})}var us={};(function(){vt.definitions.forEach(function(n){if(n.name){var t=new Set;zu(n,t),us[n.name.value]=t}})})();function r4(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function RE(e,n){var t={kind:e.kind,definitions:[r4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=us[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=us[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=r4(e,o);s&&t.definitions.push(s)}),t}RE(vt,"Payment");class jE{client;constructor(n){this.client=n}async listForAccount(n){return(await this.client.query({query:mt,variables:{accountId:n}}))?.paymentsForAccount??[]}async fetchById(n){return(await this.client.query({query:vt,variables:{paymentId:n}}))?.payment??null}async getForPaymentRequest(n){return(await this.client.query({query:ft,variables:{paymentRequestId:n}}))?.paymentForPaymentRequest??null}async getPaymentLimits(n){try{const t=await this.client.restApi(Q("/v1/bank-accounts/{accountId}/payment-limits","get",{params:{accountId:n}}));return{perTransaction:Number(t.transactionLimit),dailyLimit:Number(t.dailyLimit),dailyRemainingVolume:Number(t.dailyRemaining)}}catch{return null}}}var Uu={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:[]},{kind:"Field",name:{kind:"Name",value:"deliveryMethod"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyRate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeSubsidyAmount"},arguments:[],directives:[]}]}}],loc:{start:0,end:268}};Uu.loc.source={body:`fragment PaymentRequestFragment on DirectPayment {
406
406
  id
407
407
  userId
408
408
  accountId
@@ -418,14 +418,14 @@ query Payment($paymentId: String!) {
418
418
  targetCurrencyRate
419
419
  feeSubsidyAmount
420
420
  }
421
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Pu(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(u){Pu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Pu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Pu(u,n)})}var rs={};(function(){Uu.definitions.forEach(function(n){if(n.name){var t=new Set;Pu(n,t),rs[n.name.value]=t}})})();function a4(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function jE(e,n){var t={kind:e.kind,definitions:[a4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=rs[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=rs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=a4(e,o);s&&t.definitions.push(s)}),t}jE(Uu,"PaymentRequestFragment");var pt={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}};pt.loc.source={body:`#import "../queries/paymentRequestFragment.graphql"
421
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Pu(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(u){Pu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Pu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Pu(u,n)})}var rs={};(function(){Uu.definitions.forEach(function(n){if(n.name){var t=new Set;Pu(n,t),rs[n.name.value]=t}})})();function a4(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function LE(e,n){var t={kind:e.kind,definitions:[a4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=rs[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=rs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=a4(e,o);s&&t.definitions.push(s)}),t}LE(Uu,"PaymentRequestFragment");var pt={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}};pt.loc.source={body:`#import "../queries/paymentRequestFragment.graphql"
422
422
 
423
423
  mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInput!) {
424
424
  createDirectPayment(createDirectPaymentInput: $createDirectPaymentInput) {
425
425
  ...PaymentRequestFragment
426
426
  }
427
427
  }
428
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var o4={};function LE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return o4[t]?!1:(o4[t]=!0,!0)})}pt.definitions=pt.definitions.concat(LE(Uu.definitions));function Ru(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(u){Ru(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Ru(u,n)}),e.definitions&&e.definitions.forEach(function(u){Ru(u,n)})}var as={};(function(){pt.definitions.forEach(function(n){if(n.name){var t=new Set;Ru(n,t),as[n.name.value]=t}})})();function s4(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function ZE(e,n){var t={kind:e.kind,definitions:[s4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=as[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=as[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=s4(e,o);s&&t.definitions.push(s)}),t}ZE(pt,"CreatePaymentRequest");var ju={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetSolanaPayParams"},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:"signer"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"solanaParams"},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:"signer"},value:{kind:"Variable",name:{kind:"Name",value:"signer"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"transactionSerialized"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"transaction"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:320}};ju.loc.source={body:`query GetSolanaPayParams(
428
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var o4={};function ZE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return o4[t]?!1:(o4[t]=!0,!0)})}pt.definitions=pt.definitions.concat(ZE(Uu.definitions));function Ru(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(u){Ru(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Ru(u,n)}),e.definitions&&e.definitions.forEach(function(u){Ru(u,n)})}var as={};(function(){pt.definitions.forEach(function(n){if(n.name){var t=new Set;Ru(n,t),as[n.name.value]=t}})})();function s4(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function VE(e,n){var t={kind:e.kind,definitions:[s4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=as[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=as[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=s4(e,o);s&&t.definitions.push(s)}),t}VE(pt,"CreatePaymentRequest");var ju={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetSolanaPayParams"},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:"signer"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"solanaParams"},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:"signer"},value:{kind:"Variable",name:{kind:"Name",value:"signer"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"transactionSerialized"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"transaction"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:320}};ju.loc.source={body:`query GetSolanaPayParams(
429
429
  $tokenAddress: String!
430
430
  $amount: Float!
431
431
  $reference: String!
@@ -441,7 +441,7 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
441
441
  transaction
442
442
  }
443
443
  }
444
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Lu(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(u){Lu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Lu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Lu(u,n)})}var os={};(function(){ju.definitions.forEach(function(n){if(n.name){var t=new Set;Lu(n,t),os[n.name.value]=t}})})();function c4(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function VE(e,n){var t={kind:e.kind,definitions:[c4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=os[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=os[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=c4(e,o);s&&t.definitions.push(s)}),t}VE(ju,"GetSolanaPayParams");var Zu={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:[]}]}}]}}],loc:{start:0,end:373}};Zu.loc.source={body:`query GetSpritzPayParams(
444
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Lu(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(u){Lu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Lu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Lu(u,n)})}var os={};(function(){ju.definitions.forEach(function(n){if(n.name){var t=new Set;Lu(n,t),os[n.name.value]=t}})})();function c4(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function qE(e,n){var t={kind:e.kind,definitions:[c4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=os[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=os[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=c4(e,o);s&&t.definitions.push(s)}),t}qE(ju,"GetSolanaPayParams");var Zu={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:[]}]}}]}}],loc:{start:0,end:373}};Zu.loc.source={body:`query GetSpritzPayParams(
445
445
  $tokenAddress: String!
446
446
  $amount: Float!
447
447
  $reference: String!
@@ -460,14 +460,14 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
460
460
  requiredTokenInput
461
461
  }
462
462
  }
463
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Vu(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(u){Vu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Vu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Vu(u,n)})}var ss={};(function(){Zu.definitions.forEach(function(n){if(n.name){var t=new Set;Vu(n,t),ss[n.name.value]=t}})})();function l4(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function qE(e,n){var t={kind:e.kind,definitions:[l4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=ss[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=ss[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=l4(e,o);s&&t.definitions.push(s)}),t}qE(Zu,"GetSpritzPayParams");var ht=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function qu(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ti(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function me(e,...n){if(!qu(e))throw new Error("Uint8Array expected");if(n.length>0&&!n.includes(e.length))throw new Error("Uint8Array expected of length "+n+", got length="+e.length)}function ME(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");ti(e.outputLen),ti(e.blockLen)}function gt(e,n=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(n&&e.finished)throw new Error("Hash#digest() has already been called")}function d4(e,n){me(e);const t=n.outputLen;if(e.length<t)throw new Error("digestInto() expects output buffer of length at least "+t)}function GE(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function we(...e){for(let n=0;n<e.length;n++)e[n].fill(0)}function cs(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Ge(e,n){return e<<32-n|e>>>n}function ln(e,n){return e<<n|e>>>32-n>>>0}var JE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function HE(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function KE(e){for(let n=0;n<e.length;n++)e[n]=HE(e[n]);return e}var f4=JE?e=>e:KE,m4=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",QE=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function ii(e){if(me(e),m4)return e.toHex();let n="";for(let t=0;t<e.length;t++)n+=QE[e[t]];return n}var We={_0:48,_9:57,A:65,F:70,a:97,f:102};function v4(e){if(e>=We._0&&e<=We._9)return e-We._0;if(e>=We.A&&e<=We.F)return e-(We.A-10);if(e>=We.a&&e<=We.f)return e-(We.a-10)}function ls(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(m4)return Uint8Array.fromHex(e);const n=e.length,t=n/2;if(n%2)throw new Error("hex string expected, got unpadded hex of length "+n);const u=new Uint8Array(t);for(let i=0,r=0;i<t;i++,r+=2){const a=v4(e.charCodeAt(r)),o=v4(e.charCodeAt(r+1));if(a===void 0||o===void 0){const s=e[r]+e[r+1];throw new Error('hex string expected, got non-hex character "'+s+'" at index '+r)}u[i]=a*16+o}return u}function Mu(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function ui(e){return typeof e=="string"&&(e=Mu(e)),me(e),e}function ke(...e){let n=0;for(let u=0;u<e.length;u++){const i=e[u];me(i),n+=i.length}const t=new Uint8Array(n);for(let u=0,i=0;u<e.length;u++){const r=e[u];t.set(r,i),i+=r.length}return t}var ds=class{};function Je(e){const n=u=>e().update(ui(u)).digest(),t=e();return n.outputLen=t.outputLen,n.blockLen=t.blockLen,n.create=()=>e(),n}function WE(e){const n=(u,i)=>e(i).update(ui(u)).digest(),t=e({});return n.outputLen=t.outputLen,n.blockLen=t.blockLen,n.create=u=>e(u),n}function p4(e=32){if(ht&&typeof ht.getRandomValues=="function")return ht.getRandomValues(new Uint8Array(e));if(ht&&typeof ht.randomBytes=="function")return Uint8Array.from(ht.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}var fs=BigInt(0),ms=BigInt(1);function Gu(e,n){if(typeof n!="boolean")throw new Error(e+" boolean expected, got "+n)}function Ju(e){const n=e.toString(16);return n.length&1?"0"+n:n}function h4(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?fs:BigInt("0x"+e)}function On(e){return h4(ii(e))}function g4(e){return me(e),h4(ii(Uint8Array.from(e).reverse()))}function ri(e,n){return ls(e.toString(16).padStart(n*2,"0"))}function E4(e,n){return ri(e,n).reverse()}function le(e,n,t){let u;if(typeof n=="string")try{u=ls(n)}catch(r){throw new Error(e+" must be hex string or Uint8Array, cause: "+r)}else if(qu(n))u=Uint8Array.from(n);else throw new Error(e+" must be hex string or Uint8Array");const i=u.length;if(typeof t=="number"&&i!==t)throw new Error(e+" of length "+t+" expected, got "+i);return u}var vs=e=>typeof e=="bigint"&&fs<=e;function ps(e,n,t){return vs(e)&&vs(n)&&vs(t)&&n<=e&&e<t}function y4(e,n,t,u){if(!ps(n,t,u))throw new Error("expected valid "+e+": "+t+" <= n < "+u+", got "+n)}function YE(e){let n;for(n=0;e>fs;e>>=ms,n+=1);return n}var Hu=e=>(ms<<BigInt(e))-ms;function XE(e,n,t){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof n!="number"||n<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");const u=d=>new Uint8Array(d),i=d=>Uint8Array.of(d);let r=u(e),a=u(e),o=0;const s=()=>{r.fill(1),a.fill(0),o=0},c=(...d)=>t(a,r,...d),l=(d=u(0))=>{a=c(i(0),d),r=c(),d.length!==0&&(a=c(i(1),d),r=c())},f=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const v=[];for(;d<n;){r=c();const h=r.slice();v.push(h),d+=r.length}return ke(...v)};return(d,v)=>{s(),l(d);let h;for(;!(h=v(f()));)l();return s(),h}}function ey(e){return typeof e=="function"&&Number.isSafeInteger(e.outputLen)}function Ku(e,n,t={}){if(!e||typeof e!="object")throw new Error("expected valid options object");function u(i,r,a){const o=e[i];if(a&&o===void 0)return;const s=typeof o;if(s!==r||o===null)throw new Error(`param "${i}" is invalid: expected ${r}, got ${s}`)}Object.entries(n).forEach(([i,r])=>u(i,r,!1)),Object.entries(t).forEach(([i,r])=>u(i,r,!0))}function b4(e){const n=new WeakMap;return(t,...u)=>{const i=n.get(t);if(i!==void 0)return i;const r=e(t,...u);return n.set(t,r),r}}var Qu=BigInt(2**32-1),k4=BigInt(32);function ny(e,n=!1){return n?{h:Number(e&Qu),l:Number(e>>k4&Qu)}:{h:Number(e>>k4&Qu)|0,l:Number(e&Qu)|0}}function D4(e,n=!1){const t=e.length;let u=new Uint32Array(t),i=new Uint32Array(t);for(let r=0;r<t;r++){const{h:a,l:o}=ny(e[r],n);[u[r],i[r]]=[a,o]}return[u,i]}var S4=(e,n,t)=>e>>>t,B4=(e,n,t)=>e<<32-t|n>>>t,Et=(e,n,t)=>e>>>t|n<<32-t,yt=(e,n,t)=>e<<32-t|n>>>t,Wu=(e,n,t)=>e<<64-t|n>>>t-32,Yu=(e,n,t)=>e>>>t-32|n<<64-t,ty=(e,n,t)=>e<<t|n>>>32-t,iy=(e,n,t)=>n<<t|e>>>32-t,uy=(e,n,t)=>n<<t-32|e>>>64-t,ry=(e,n,t)=>e<<t-32|n>>>64-t;function Ye(e,n,t,u){const i=(n>>>0)+(u>>>0);return{h:e+t+(i/2**32|0)|0,l:i|0}}var ay=(e,n,t)=>(e>>>0)+(n>>>0)+(t>>>0),oy=(e,n,t,u)=>n+t+u+(e/2**32|0)|0,sy=(e,n,t,u)=>(e>>>0)+(n>>>0)+(t>>>0)+(u>>>0),cy=(e,n,t,u,i)=>n+t+u+i+(e/2**32|0)|0,ly=(e,n,t,u,i)=>(e>>>0)+(n>>>0)+(t>>>0)+(u>>>0)+(i>>>0),dy=(e,n,t,u,i,r)=>n+t+u+i+r+(e/2**32|0)|0;/*! Bundled license information:
463
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Vu(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(u){Vu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Vu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Vu(u,n)})}var ss={};(function(){Zu.definitions.forEach(function(n){if(n.name){var t=new Set;Vu(n,t),ss[n.name.value]=t}})})();function l4(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function ME(e,n){var t={kind:e.kind,definitions:[l4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=ss[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=ss[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=l4(e,o);s&&t.definitions.push(s)}),t}ME(Zu,"GetSpritzPayParams");var ht=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function qu(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ti(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function me(e,...n){if(!qu(e))throw new Error("Uint8Array expected");if(n.length>0&&!n.includes(e.length))throw new Error("Uint8Array expected of length "+n+", got length="+e.length)}function GE(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");ti(e.outputLen),ti(e.blockLen)}function gt(e,n=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(n&&e.finished)throw new Error("Hash#digest() has already been called")}function d4(e,n){me(e);const t=n.outputLen;if(e.length<t)throw new Error("digestInto() expects output buffer of length at least "+t)}function JE(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function we(...e){for(let n=0;n<e.length;n++)e[n].fill(0)}function cs(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Ge(e,n){return e<<32-n|e>>>n}function ln(e,n){return e<<n|e>>>32-n>>>0}var HE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function KE(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function QE(e){for(let n=0;n<e.length;n++)e[n]=KE(e[n]);return e}var f4=HE?e=>e:QE,m4=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",WE=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function ii(e){if(me(e),m4)return e.toHex();let n="";for(let t=0;t<e.length;t++)n+=WE[e[t]];return n}var We={_0:48,_9:57,A:65,F:70,a:97,f:102};function v4(e){if(e>=We._0&&e<=We._9)return e-We._0;if(e>=We.A&&e<=We.F)return e-(We.A-10);if(e>=We.a&&e<=We.f)return e-(We.a-10)}function ls(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(m4)return Uint8Array.fromHex(e);const n=e.length,t=n/2;if(n%2)throw new Error("hex string expected, got unpadded hex of length "+n);const u=new Uint8Array(t);for(let i=0,r=0;i<t;i++,r+=2){const a=v4(e.charCodeAt(r)),o=v4(e.charCodeAt(r+1));if(a===void 0||o===void 0){const s=e[r]+e[r+1];throw new Error('hex string expected, got non-hex character "'+s+'" at index '+r)}u[i]=a*16+o}return u}function Mu(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function ui(e){return typeof e=="string"&&(e=Mu(e)),me(e),e}function ke(...e){let n=0;for(let u=0;u<e.length;u++){const i=e[u];me(i),n+=i.length}const t=new Uint8Array(n);for(let u=0,i=0;u<e.length;u++){const r=e[u];t.set(r,i),i+=r.length}return t}var ds=class{};function Je(e){const n=u=>e().update(ui(u)).digest(),t=e();return n.outputLen=t.outputLen,n.blockLen=t.blockLen,n.create=()=>e(),n}function YE(e){const n=(u,i)=>e(i).update(ui(u)).digest(),t=e({});return n.outputLen=t.outputLen,n.blockLen=t.blockLen,n.create=u=>e(u),n}function p4(e=32){if(ht&&typeof ht.getRandomValues=="function")return ht.getRandomValues(new Uint8Array(e));if(ht&&typeof ht.randomBytes=="function")return Uint8Array.from(ht.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}var fs=BigInt(0),ms=BigInt(1);function Gu(e,n){if(typeof n!="boolean")throw new Error(e+" boolean expected, got "+n)}function Ju(e){const n=e.toString(16);return n.length&1?"0"+n:n}function h4(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?fs:BigInt("0x"+e)}function On(e){return h4(ii(e))}function g4(e){return me(e),h4(ii(Uint8Array.from(e).reverse()))}function ri(e,n){return ls(e.toString(16).padStart(n*2,"0"))}function E4(e,n){return ri(e,n).reverse()}function le(e,n,t){let u;if(typeof n=="string")try{u=ls(n)}catch(r){throw new Error(e+" must be hex string or Uint8Array, cause: "+r)}else if(qu(n))u=Uint8Array.from(n);else throw new Error(e+" must be hex string or Uint8Array");const i=u.length;if(typeof t=="number"&&i!==t)throw new Error(e+" of length "+t+" expected, got "+i);return u}var vs=e=>typeof e=="bigint"&&fs<=e;function ps(e,n,t){return vs(e)&&vs(n)&&vs(t)&&n<=e&&e<t}function y4(e,n,t,u){if(!ps(n,t,u))throw new Error("expected valid "+e+": "+t+" <= n < "+u+", got "+n)}function XE(e){let n;for(n=0;e>fs;e>>=ms,n+=1);return n}var Hu=e=>(ms<<BigInt(e))-ms;function ey(e,n,t){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof n!="number"||n<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");const u=d=>new Uint8Array(d),i=d=>Uint8Array.of(d);let r=u(e),a=u(e),o=0;const s=()=>{r.fill(1),a.fill(0),o=0},c=(...d)=>t(a,r,...d),l=(d=u(0))=>{a=c(i(0),d),r=c(),d.length!==0&&(a=c(i(1),d),r=c())},f=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const v=[];for(;d<n;){r=c();const h=r.slice();v.push(h),d+=r.length}return ke(...v)};return(d,v)=>{s(),l(d);let h;for(;!(h=v(f()));)l();return s(),h}}function ny(e){return typeof e=="function"&&Number.isSafeInteger(e.outputLen)}function Ku(e,n,t={}){if(!e||typeof e!="object")throw new Error("expected valid options object");function u(i,r,a){const o=e[i];if(a&&o===void 0)return;const s=typeof o;if(s!==r||o===null)throw new Error(`param "${i}" is invalid: expected ${r}, got ${s}`)}Object.entries(n).forEach(([i,r])=>u(i,r,!1)),Object.entries(t).forEach(([i,r])=>u(i,r,!0))}function b4(e){const n=new WeakMap;return(t,...u)=>{const i=n.get(t);if(i!==void 0)return i;const r=e(t,...u);return n.set(t,r),r}}var Qu=BigInt(2**32-1),k4=BigInt(32);function ty(e,n=!1){return n?{h:Number(e&Qu),l:Number(e>>k4&Qu)}:{h:Number(e>>k4&Qu)|0,l:Number(e&Qu)|0}}function D4(e,n=!1){const t=e.length;let u=new Uint32Array(t),i=new Uint32Array(t);for(let r=0;r<t;r++){const{h:a,l:o}=ty(e[r],n);[u[r],i[r]]=[a,o]}return[u,i]}var S4=(e,n,t)=>e>>>t,B4=(e,n,t)=>e<<32-t|n>>>t,Et=(e,n,t)=>e>>>t|n<<32-t,yt=(e,n,t)=>e<<32-t|n>>>t,Wu=(e,n,t)=>e<<64-t|n>>>t-32,Yu=(e,n,t)=>e>>>t-32|n<<64-t,iy=(e,n,t)=>e<<t|n>>>32-t,uy=(e,n,t)=>n<<t|e>>>32-t,ry=(e,n,t)=>n<<t-32|e>>>64-t,ay=(e,n,t)=>e<<t-32|n>>>64-t;function Ye(e,n,t,u){const i=(n>>>0)+(u>>>0);return{h:e+t+(i/2**32|0)|0,l:i|0}}var oy=(e,n,t)=>(e>>>0)+(n>>>0)+(t>>>0),sy=(e,n,t,u)=>n+t+u+(e/2**32|0)|0,cy=(e,n,t,u)=>(e>>>0)+(n>>>0)+(t>>>0)+(u>>>0),ly=(e,n,t,u,i)=>n+t+u+i+(e/2**32|0)|0,dy=(e,n,t,u,i)=>(e>>>0)+(n>>>0)+(t>>>0)+(u>>>0)+(i>>>0),fy=(e,n,t,u,i,r)=>n+t+u+i+r+(e/2**32|0)|0;/*! Bundled license information:
464
464
 
465
465
  @noble/hashes/esm/utils.js:
466
466
  (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
467
467
 
468
468
  @noble/curves/esm/utils.js:
469
469
  (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
470
- */function fy(e,n,t,u){if(typeof e.setBigUint64=="function")return e.setBigUint64(n,t,u);const i=BigInt(32),r=BigInt(4294967295),a=Number(t>>i&r),o=Number(t&r),s=u?4:0,c=u?0:4;e.setUint32(n+s,a,u),e.setUint32(n+c,o,u)}function Xu(e,n,t){return e&n^~e&t}function w4(e,n,t){return e&n^e&t^n&t}var ai=class extends ds{constructor(e,n,t,u){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=n,this.padOffset=t,this.isLE=u,this.buffer=new Uint8Array(e),this.view=cs(this.buffer)}update(e){gt(this),e=ui(e),me(e);const{view:n,buffer:t,blockLen:u}=this,i=e.length;for(let r=0;r<i;){const a=Math.min(u-this.pos,i-r);if(a===u){const o=cs(e);for(;u<=i-r;r+=u)this.process(o,r);continue}t.set(e.subarray(r,r+a),this.pos),this.pos+=a,r+=a,this.pos===u&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){gt(this),d4(e,this),this.finished=!0;const{buffer:n,view:t,blockLen:u,isLE:i}=this;let{pos:r}=this;n[r++]=128,we(this.buffer.subarray(r)),this.padOffset>u-r&&(this.process(t,0),r=0);for(let l=r;l<u;l++)n[l]=0;fy(t,u-8,BigInt(this.length*8),i),this.process(t,0);const a=cs(e),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const s=o/4,c=this.get();if(s>c.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<s;l++)a.setUint32(4*l,c[l],i)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const t=e.slice(0,n);return this.destroy(),t}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:t,length:u,finished:i,destroyed:r,pos:a}=this;return e.destroyed=r,e.finished=i,e.length=u,e.pos=a,u%n&&e.buffer.set(t),e}clone(){return this._cloneInto()}},dn=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),fn=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),ve=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),pe=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),my=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),mn=new Uint32Array(64),A4=class extends ai{constructor(e=32){super(64,e,8,!1),this.A=dn[0]|0,this.B=dn[1]|0,this.C=dn[2]|0,this.D=dn[3]|0,this.E=dn[4]|0,this.F=dn[5]|0,this.G=dn[6]|0,this.H=dn[7]|0}get(){const{A:e,B:n,C:t,D:u,E:i,F:r,G:a,H:o}=this;return[e,n,t,u,i,r,a,o]}set(e,n,t,u,i,r,a,o){this.A=e|0,this.B=n|0,this.C=t|0,this.D=u|0,this.E=i|0,this.F=r|0,this.G=a|0,this.H=o|0}process(e,n){for(let l=0;l<16;l++,n+=4)mn[l]=e.getUint32(n,!1);for(let l=16;l<64;l++){const f=mn[l-15],m=mn[l-2],d=Ge(f,7)^Ge(f,18)^f>>>3,v=Ge(m,17)^Ge(m,19)^m>>>10;mn[l]=v+mn[l-7]+d+mn[l-16]|0}let{A:t,B:u,C:i,D:r,E:a,F:o,G:s,H:c}=this;for(let l=0;l<64;l++){const f=Ge(a,6)^Ge(a,11)^Ge(a,25),m=c+f+Xu(a,o,s)+my[l]+mn[l]|0,v=(Ge(t,2)^Ge(t,13)^Ge(t,22))+w4(t,u,i)|0;c=s,s=o,o=a,a=r+m|0,r=i,i=u,u=t,t=m+v|0}t=t+this.A|0,u=u+this.B|0,i=i+this.C|0,r=r+this.D|0,a=a+this.E|0,o=o+this.F|0,s=s+this.G|0,c=c+this.H|0,this.set(t,u,i,r,a,o,s,c)}roundClean(){we(mn)}destroy(){this.set(0,0,0,0,0,0,0,0),we(this.buffer)}},vy=class extends A4{constructor(){super(28),this.A=fn[0]|0,this.B=fn[1]|0,this.C=fn[2]|0,this.D=fn[3]|0,this.E=fn[4]|0,this.F=fn[5]|0,this.G=fn[6]|0,this.H=fn[7]|0}},_4=D4(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),py=_4[0],hy=_4[1],vn=new Uint32Array(80),pn=new Uint32Array(80),er=class extends ai{constructor(e=64){super(128,e,16,!1),this.Ah=pe[0]|0,this.Al=pe[1]|0,this.Bh=pe[2]|0,this.Bl=pe[3]|0,this.Ch=pe[4]|0,this.Cl=pe[5]|0,this.Dh=pe[6]|0,this.Dl=pe[7]|0,this.Eh=pe[8]|0,this.El=pe[9]|0,this.Fh=pe[10]|0,this.Fl=pe[11]|0,this.Gh=pe[12]|0,this.Gl=pe[13]|0,this.Hh=pe[14]|0,this.Hl=pe[15]|0}get(){const{Ah:e,Al:n,Bh:t,Bl:u,Ch:i,Cl:r,Dh:a,Dl:o,Eh:s,El:c,Fh:l,Fl:f,Gh:m,Gl:d,Hh:v,Hl:h}=this;return[e,n,t,u,i,r,a,o,s,c,l,f,m,d,v,h]}set(e,n,t,u,i,r,a,o,s,c,l,f,m,d,v,h){this.Ah=e|0,this.Al=n|0,this.Bh=t|0,this.Bl=u|0,this.Ch=i|0,this.Cl=r|0,this.Dh=a|0,this.Dl=o|0,this.Eh=s|0,this.El=c|0,this.Fh=l|0,this.Fl=f|0,this.Gh=m|0,this.Gl=d|0,this.Hh=v|0,this.Hl=h|0}process(e,n){for(let g=0;g<16;g++,n+=4)vn[g]=e.getUint32(n),pn[g]=e.getUint32(n+=4);for(let g=16;g<80;g++){const k=vn[g-15]|0,_=pn[g-15]|0,B=Et(k,_,1)^Et(k,_,8)^S4(k,_,7),G=yt(k,_,1)^yt(k,_,8)^B4(k,_,7),V=vn[g-2]|0,F=pn[g-2]|0,y=Et(V,F,19)^Wu(V,F,61)^S4(V,F,6),$=yt(V,F,19)^Yu(V,F,61)^B4(V,F,6),D=sy(G,$,pn[g-7],pn[g-16]),w=cy(D,B,y,vn[g-7],vn[g-16]);vn[g]=w|0,pn[g]=D|0}let{Ah:t,Al:u,Bh:i,Bl:r,Ch:a,Cl:o,Dh:s,Dl:c,Eh:l,El:f,Fh:m,Fl:d,Gh:v,Gl:h,Hh:b,Hl:E}=this;for(let g=0;g<80;g++){const k=Et(l,f,14)^Et(l,f,18)^Wu(l,f,41),_=yt(l,f,14)^yt(l,f,18)^Yu(l,f,41),B=l&m^~l&v,G=f&d^~f&h,V=ly(E,_,G,hy[g],pn[g]),F=dy(V,b,k,B,py[g],vn[g]),y=V|0,$=Et(t,u,28)^Wu(t,u,34)^Wu(t,u,39),D=yt(t,u,28)^Yu(t,u,34)^Yu(t,u,39),w=t&i^t&a^i&a,I=u&r^u&o^r&o;b=v|0,E=h|0,v=m|0,h=d|0,m=l|0,d=f|0,{h:l,l:f}=Ye(s|0,c|0,F|0,y|0),s=a|0,c=o|0,a=i|0,o=r|0,i=t|0,r=u|0;const T=ay(y,D,I);t=oy(T,F,$,w),u=T|0}({h:t,l:u}=Ye(this.Ah|0,this.Al|0,t|0,u|0)),{h:i,l:r}=Ye(this.Bh|0,this.Bl|0,i|0,r|0),{h:a,l:o}=Ye(this.Ch|0,this.Cl|0,a|0,o|0),{h:s,l:c}=Ye(this.Dh|0,this.Dl|0,s|0,c|0),{h:l,l:f}=Ye(this.Eh|0,this.El|0,l|0,f|0),{h:m,l:d}=Ye(this.Fh|0,this.Fl|0,m|0,d|0),{h:v,l:h}=Ye(this.Gh|0,this.Gl|0,v|0,h|0),{h:b,l:E}=Ye(this.Hh|0,this.Hl|0,b|0,E|0),this.set(t,u,i,r,a,o,s,c,l,f,m,d,v,h,b,E)}roundClean(){we(vn,pn)}destroy(){we(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},gy=class extends er{constructor(){super(48),this.Ah=ve[0]|0,this.Al=ve[1]|0,this.Bh=ve[2]|0,this.Bl=ve[3]|0,this.Ch=ve[4]|0,this.Cl=ve[5]|0,this.Dh=ve[6]|0,this.Dl=ve[7]|0,this.Eh=ve[8]|0,this.El=ve[9]|0,this.Fh=ve[10]|0,this.Fl=ve[11]|0,this.Gh=ve[12]|0,this.Gl=ve[13]|0,this.Hh=ve[14]|0,this.Hl=ve[15]|0}},he=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),ge=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]),Ey=class extends er{constructor(){super(28),this.Ah=he[0]|0,this.Al=he[1]|0,this.Bh=he[2]|0,this.Bl=he[3]|0,this.Ch=he[4]|0,this.Cl=he[5]|0,this.Dh=he[6]|0,this.Dl=he[7]|0,this.Eh=he[8]|0,this.El=he[9]|0,this.Fh=he[10]|0,this.Fl=he[11]|0,this.Gh=he[12]|0,this.Gl=he[13]|0,this.Hh=he[14]|0,this.Hl=he[15]|0}},yy=class extends er{constructor(){super(32),this.Ah=ge[0]|0,this.Al=ge[1]|0,this.Bh=ge[2]|0,this.Bl=ge[3]|0,this.Ch=ge[4]|0,this.Cl=ge[5]|0,this.Dh=ge[6]|0,this.Dl=ge[7]|0,this.Eh=ge[8]|0,this.El=ge[9]|0,this.Fh=ge[10]|0,this.Fl=ge[11]|0,this.Gh=ge[12]|0,this.Gl=ge[13]|0,this.Hh=ge[14]|0,this.Hl=ge[15]|0}},nr=Je(()=>new A4);Je(()=>new vy),Je(()=>new er),Je(()=>new gy),Je(()=>new yy),Je(()=>new Ey);var C4=class extends ds{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,ME(e);const t=ui(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const u=this.blockLen,i=new Uint8Array(u);i.set(t.length>u?e.create().update(t).digest():t);for(let r=0;r<i.length;r++)i[r]^=54;this.iHash.update(i),this.oHash=e.create();for(let r=0;r<i.length;r++)i[r]^=106;this.oHash.update(i),we(i)}update(e){return gt(this),this.iHash.update(e),this}digestInto(e){gt(this),me(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:t,finished:u,destroyed:i,blockLen:r,outputLen:a}=this;return e=e,e.finished=u,e.destroyed=i,e.blockLen=r,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=t._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},$4=(e,n,t)=>new C4(e,n).update(t).digest();$4.create=(e,n)=>new C4(e,n);var Ae=BigInt(0),De=BigInt(1),zn=BigInt(2),by=BigInt(3),x4=BigInt(4),I4=BigInt(5),F4=BigInt(8);function Ee(e,n){const t=e%n;return t>=Ae?t:n+t}function Ne(e,n,t){let u=e;for(;n-- >Ae;)u*=u,u%=t;return u}function N4(e,n){if(e===Ae)throw new Error("invert: expected non-zero number");if(n<=Ae)throw new Error("invert: expected positive modulus, got "+n);let t=Ee(e,n),u=n,i=Ae,r=De;for(;t!==Ae;){const o=u/t,s=u%t,c=i-r*o;u=t,t=s,i=r,r=c}if(u!==De)throw new Error("invert: does not exist");return Ee(i,n)}function T4(e,n){const t=(e.ORDER+De)/x4,u=e.pow(n,t);if(!e.eql(e.sqr(u),n))throw new Error("Cannot find square root");return u}function ky(e,n){const t=(e.ORDER-I4)/F4,u=e.mul(n,zn),i=e.pow(u,t),r=e.mul(n,i),a=e.mul(e.mul(r,zn),i),o=e.mul(r,e.sub(a,e.ONE));if(!e.eql(e.sqr(o),n))throw new Error("Cannot find square root");return o}function Dy(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let n=e-De,t=0;for(;n%zn===Ae;)n/=zn,t++;let u=zn;const i=ir(e);for(;z4(i,u)===1;)if(u++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(t===1)return T4;let r=i.pow(u,n);const a=(n+De)/zn;return function(s,c){if(s.is0(c))return c;if(z4(s,c)!==1)throw new Error("Cannot find square root");let l=t,f=s.mul(s.ONE,r),m=s.pow(c,n),d=s.pow(c,a);for(;!s.eql(m,s.ONE);){if(s.is0(m))return s.ZERO;let v=1,h=s.sqr(m);for(;!s.eql(h,s.ONE);)if(v++,h=s.sqr(h),v===l)throw new Error("Cannot find square root");const b=De<<BigInt(l-v-1),E=s.pow(f,b);l=v,f=s.sqr(E),m=s.mul(m,f),d=s.mul(d,E)}return d}}function Sy(e){return e%x4===by?T4:e%F4===I4?ky:Dy(e)}var By=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function O4(e){const n={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},t=By.reduce((u,i)=>(u[i]="function",u),n);return Ku(e,t),e}function wy(e,n,t){if(t<Ae)throw new Error("invalid exponent, negatives unsupported");if(t===Ae)return e.ONE;if(t===De)return n;let u=e.ONE,i=n;for(;t>Ae;)t&De&&(u=e.mul(u,i)),i=e.sqr(i),t>>=De;return u}function tr(e,n,t=!1){const u=new Array(n.length).fill(t?e.ZERO:void 0),i=n.reduce((a,o,s)=>e.is0(o)?a:(u[s]=a,e.mul(a,o)),e.ONE),r=e.inv(i);return n.reduceRight((a,o,s)=>e.is0(o)?a:(u[s]=e.mul(a,u[s]),e.mul(a,o)),r),u}function z4(e,n){const t=(e.ORDER-De)/zn,u=e.pow(n,t),i=e.eql(u,e.ONE),r=e.eql(u,e.ZERO),a=e.eql(u,e.neg(e.ONE));if(!i&&!r&&!a)throw new Error("invalid Legendre symbol result");return i?1:r?0:-1}function Ay(e,n){n!==void 0&&ti(n);const t=n!==void 0?n:e.toString(2).length,u=Math.ceil(t/8);return{nBitLength:t,nByteLength:u}}function ir(e,n,t=!1,u={}){if(e<=Ae)throw new Error("invalid field: expected ORDER > 0, got "+e);let i,r;if(typeof n=="object"&&n!=null){if(u.sqrt||t)throw new Error("cannot specify opts in two arguments");const l=n;l.BITS&&(i=l.BITS),l.sqrt&&(r=l.sqrt),typeof l.isLE=="boolean"&&(t=l.isLE)}else typeof n=="number"&&(i=n),u.sqrt&&(r=u.sqrt);const{nBitLength:a,nByteLength:o}=Ay(e,i);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const c=Object.freeze({ORDER:e,isLE:t,BITS:a,BYTES:o,MASK:Hu(a),ZERO:Ae,ONE:De,create:l=>Ee(l,e),isValid:l=>{if(typeof l!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof l);return Ae<=l&&l<e},is0:l=>l===Ae,isValidNot0:l=>!c.is0(l)&&c.isValid(l),isOdd:l=>(l&De)===De,neg:l=>Ee(-l,e),eql:(l,f)=>l===f,sqr:l=>Ee(l*l,e),add:(l,f)=>Ee(l+f,e),sub:(l,f)=>Ee(l-f,e),mul:(l,f)=>Ee(l*f,e),pow:(l,f)=>wy(c,l,f),div:(l,f)=>Ee(l*N4(f,e),e),sqrN:l=>l*l,addN:(l,f)=>l+f,subN:(l,f)=>l-f,mulN:(l,f)=>l*f,inv:l=>N4(l,e),sqrt:r||(l=>(s||(s=Sy(e)),s(c,l))),toBytes:l=>t?E4(l,o):ri(l,o),fromBytes:l=>{if(l.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+l.length);return t?g4(l):On(l)},invertBatch:l=>tr(c,l),cmov:(l,f,m)=>m?f:l});return Object.freeze(c)}function U4(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const n=e.toString(2).length;return Math.ceil(n/8)}function P4(e){const n=U4(e);return n+Math.ceil(n/2)}function _y(e,n,t=!1){const u=e.length,i=U4(n),r=P4(n);if(u<16||u<r||u>1024)throw new Error("expected "+r+"-1024 bytes of input, got "+u);const a=t?g4(e):On(e),o=Ee(a,n-De)+De;return t?E4(o,i):ri(o,i)}var bt=BigInt(0),Un=BigInt(1);function oi(e,n){const t=n.negate();return e?t:n}function Cy(e,n,t){const u=a=>a.pz,i=tr(e.Fp,t.map(u));return t.map((a,o)=>a.toAffine(i[o])).map(e.fromAffine)}function R4(e,n){if(!Number.isSafeInteger(e)||e<=0||e>n)throw new Error("invalid window size, expected [1.."+n+"], got W="+e)}function hs(e,n){R4(e,n);const t=Math.ceil(n/e)+1,u=2**(e-1),i=2**e,r=Hu(e),a=BigInt(e);return{windows:t,windowSize:u,mask:r,maxNumber:i,shiftBy:a}}function j4(e,n,t){const{windowSize:u,mask:i,maxNumber:r,shiftBy:a}=t;let o=Number(e&i),s=e>>a;o>u&&(o-=r,s+=Un);const c=n*u,l=c+Math.abs(o)-1,f=o===0,m=o<0,d=n%2!==0;return{nextN:s,offset:l,isZero:f,isNeg:m,isNegF:d,offsetF:c}}function $y(e,n){if(!Array.isArray(e))throw new Error("array expected");e.forEach((t,u)=>{if(!(t instanceof n))throw new Error("invalid point at index "+u)})}function xy(e,n){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((t,u)=>{if(!n.isValid(t))throw new Error("invalid scalar at index "+u)})}var gs=new WeakMap,L4=new WeakMap;function Es(e){return L4.get(e)||1}function Z4(e){if(e!==bt)throw new Error("invalid wNAF")}function Iy(e,n){return{constTimeNegate:oi,hasPrecomputes(t){return Es(t)!==1},unsafeLadder(t,u,i=e.ZERO){let r=t;for(;u>bt;)u&Un&&(i=i.add(r)),r=r.double(),u>>=Un;return i},precomputeWindow(t,u){const{windows:i,windowSize:r}=hs(u,n),a=[];let o=t,s=o;for(let c=0;c<i;c++){s=o,a.push(s);for(let l=1;l<r;l++)s=s.add(o),a.push(s);o=s.double()}return a},wNAF(t,u,i){let r=e.ZERO,a=e.BASE;const o=hs(t,n);for(let s=0;s<o.windows;s++){const{nextN:c,offset:l,isZero:f,isNeg:m,isNegF:d,offsetF:v}=j4(i,s,o);i=c,f?a=a.add(oi(d,u[v])):r=r.add(oi(m,u[l]))}return Z4(i),{p:r,f:a}},wNAFUnsafe(t,u,i,r=e.ZERO){const a=hs(t,n);for(let o=0;o<a.windows&&i!==bt;o++){const{nextN:s,offset:c,isZero:l,isNeg:f}=j4(i,o,a);if(i=s,!l){const m=u[c];r=r.add(f?m.negate():m)}}return Z4(i),r},getPrecomputes(t,u,i){let r=gs.get(u);return r||(r=this.precomputeWindow(u,t),t!==1&&(typeof i=="function"&&(r=i(r)),gs.set(u,r))),r},wNAFCached(t,u,i){const r=Es(t);return this.wNAF(r,this.getPrecomputes(r,t,i),u)},wNAFCachedUnsafe(t,u,i,r){const a=Es(t);return a===1?this.unsafeLadder(t,u,r):this.wNAFUnsafe(a,this.getPrecomputes(a,t,i),u,r)},setWindowSize(t,u){R4(u,n),L4.set(t,u),gs.delete(t)}}}function Fy(e,n,t,u){let i=n,r=e.ZERO,a=e.ZERO;for(;t>bt||u>bt;)t&Un&&(r=r.add(i)),u&Un&&(a=a.add(i)),i=i.double(),t>>=Un,u>>=Un;return{p1:r,p2:a}}function Ny(e,n,t,u){$y(t,e),xy(u,n);const i=t.length,r=u.length;if(i!==r)throw new Error("arrays of points and scalars must have equal length");const a=e.ZERO,o=YE(BigInt(i));let s=1;o>12?s=o-3:o>4?s=o-2:o>0&&(s=2);const c=Hu(s),l=new Array(Number(c)+1).fill(a),f=Math.floor((n.BITS-1)/s)*s;let m=a;for(let d=f;d>=0;d-=s){l.fill(a);for(let h=0;h<r;h++){const b=u[h],E=Number(b>>BigInt(d)&c);l[E]=l[E].add(t[h])}let v=a;for(let h=l.length-1,b=a;h>0;h--)b=b.add(l[h]),v=v.add(b);if(m=m.add(v),d!==0)for(let h=0;h<s;h++)m=m.double()}return m}function V4(e,n){if(n){if(n.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return O4(n),n}else return ir(e)}function Ty(e,n,t={}){if(!n||typeof n!="object")throw new Error(`expected valid ${e} CURVE object`);for(const o of["p","n","h"]){const s=n[o];if(!(typeof s=="bigint"&&s>bt))throw new Error(`CURVE.${o} must be positive bigint`)}const u=V4(n.p,t.Fp),i=V4(n.n,t.Fn),a=["Gx","Gy","a","b"];for(const o of a)if(!u.isValid(n[o]))throw new Error(`CURVE.${o} must be valid field element of CURVE.Fp`);return{Fp:u,Fn:i}}function q4(e){e.lowS!==void 0&&Gu("lowS",e.lowS),e.prehash!==void 0&&Gu("prehash",e.prehash)}var Oy=class extends Error{constructor(e=""){super(e)}},Xe={Err:Oy,_tlv:{encode:(e,n)=>{const{Err:t}=Xe;if(e<0||e>256)throw new t("tlv.encode: wrong tag");if(n.length&1)throw new t("tlv.encode: unpadded data");const u=n.length/2,i=Ju(u);if(i.length/2&128)throw new t("tlv.encode: long form length too big");const r=u>127?Ju(i.length/2|128):"";return Ju(e)+r+i+n},decode(e,n){const{Err:t}=Xe;let u=0;if(e<0||e>256)throw new t("tlv.encode: wrong tag");if(n.length<2||n[u++]!==e)throw new t("tlv.decode: wrong tlv");const i=n[u++],r=!!(i&128);let a=0;if(!r)a=i;else{const s=i&127;if(!s)throw new t("tlv.decode(long): indefinite length not supported");if(s>4)throw new t("tlv.decode(long): byte length is too big");const c=n.subarray(u,u+s);if(c.length!==s)throw new t("tlv.decode: length bytes not complete");if(c[0]===0)throw new t("tlv.decode(long): zero leftmost byte");for(const l of c)a=a<<8|l;if(u+=s,a<128)throw new t("tlv.decode(long): not minimal encoding")}const o=n.subarray(u,u+a);if(o.length!==a)throw new t("tlv.decode: wrong value length");return{v:o,l:n.subarray(u+a)}}},_int:{encode(e){const{Err:n}=Xe;if(e<Pn)throw new n("integer: negative integers are not allowed");let t=Ju(e);if(Number.parseInt(t[0],16)&8&&(t="00"+t),t.length&1)throw new n("unexpected DER parsing assertion: unpadded hex");return t},decode(e){const{Err:n}=Xe;if(e[0]&128)throw new n("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new n("invalid signature integer: unnecessary leading zero");return On(e)}},toSig(e){const{Err:n,_int:t,_tlv:u}=Xe,i=le("signature",e),{v:r,l:a}=u.decode(48,i);if(a.length)throw new n("invalid signature: left bytes after parsing");const{v:o,l:s}=u.decode(2,r),{v:c,l}=u.decode(2,s);if(l.length)throw new n("invalid signature: left bytes after parsing");return{r:t.decode(o),s:t.decode(c)}},hexFromSig(e){const{_tlv:n,_int:t}=Xe,u=n.encode(2,t.encode(e.r)),i=n.encode(2,t.encode(e.s)),r=u+i;return n.encode(48,r)}},Pn=BigInt(0),Se=BigInt(1),en=BigInt(2),kt=BigInt(3),ys=BigInt(4);function zy(e,n,t){function u(i){const r=e.sqr(i),a=e.mul(r,i);return e.add(e.add(a,e.mul(i,n)),t)}return u}function M4(e,n,t){const{BYTES:u}=e;function i(r){let a;if(typeof r=="bigint")a=r;else{let o=le("private key",r);if(n){if(!n.includes(o.length*2))throw new Error("invalid private key");const s=new Uint8Array(u);s.set(o,s.length-o.length),o=s}try{a=e.fromBytes(o)}catch{throw new Error(`invalid private key: expected ui8a of size ${u}, got ${typeof r}`)}}if(t&&(a=e.create(a)),!e.isValidNot0(a))throw new Error("invalid private key: out of range [1..N-1]");return a}return i}function Uy(e,n={}){const{Fp:t,Fn:u}=Ty("weierstrass",e,n),{h:i,n:r}=e;Ku(n,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:a}=n;if(a&&(!t.is0(e.a)||typeof a.beta!="bigint"||typeof a.splitScalar!="function"))throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function');function o(){if(!t.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function s(F,y,$){const{x:D,y:w}=y.toAffine(),I=t.toBytes(D);if(Gu("isCompressed",$),$){o();const T=!t.isOdd(w);return ke(G4(T),I)}else return ke(Uint8Array.of(4),I,t.toBytes(w))}function c(F){me(F);const y=t.BYTES,$=y+1,D=2*y+1,w=F.length,I=F[0],T=F.subarray(1);if(w===$&&(I===2||I===3)){const N=t.fromBytes(T);if(!t.isValid(N))throw new Error("bad point: is not on curve, wrong x");const O=m(N);let P;try{P=t.sqrt(O)}catch(W){const R=W instanceof Error?": "+W.message:"";throw new Error("bad point: is not on curve, sqrt error"+R)}o();const z=t.isOdd(P);return(I&1)===1!==z&&(P=t.neg(P)),{x:N,y:P}}else if(w===D&&I===4){const N=t.fromBytes(T.subarray(y*0,y*1)),O=t.fromBytes(T.subarray(y*1,y*2));if(!d(N,O))throw new Error("bad point: is not on curve");return{x:N,y:O}}else throw new Error(`bad point: got length ${w}, expected compressed=${$} or uncompressed=${D}`)}const l=n.toBytes||s,f=n.fromBytes||c,m=zy(t,e.a,e.b);function d(F,y){const $=t.sqr(y),D=m(F);return t.eql($,D)}if(!d(e.Gx,e.Gy))throw new Error("bad curve params: generator point");const v=t.mul(t.pow(e.a,kt),ys),h=t.mul(t.sqr(e.b),BigInt(27));if(t.is0(t.add(v,h)))throw new Error("bad curve params: a or b");function b(F,y,$=!1){if(!t.isValid(y)||$&&t.is0(y))throw new Error(`bad point coordinate ${F}`);return y}function E(F){if(!(F instanceof B))throw new Error("ProjectivePoint expected")}const g=b4((F,y)=>{const{px:$,py:D,pz:w}=F;if(t.eql(w,t.ONE))return{x:$,y:D};const I=F.is0();y==null&&(y=I?t.ONE:t.inv(w));const T=t.mul($,y),N=t.mul(D,y),O=t.mul(w,y);if(I)return{x:t.ZERO,y:t.ZERO};if(!t.eql(O,t.ONE))throw new Error("invZ was invalid");return{x:T,y:N}}),k=b4(F=>{if(F.is0()){if(n.allowInfinityPoint&&!t.is0(F.py))return;throw new Error("bad point: ZERO")}const{x:y,y:$}=F.toAffine();if(!t.isValid(y)||!t.isValid($))throw new Error("bad point: x or y not field elements");if(!d(y,$))throw new Error("bad point: equation left != right");if(!F.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function _(F,y,$,D,w){return $=new B(t.mul($.px,F),$.py,$.pz),y=oi(D,y),$=oi(w,$),y.add($)}class B{constructor(y,$,D){this.px=b("x",y),this.py=b("y",$,!0),this.pz=b("z",D),Object.freeze(this)}static fromAffine(y){const{x:$,y:D}=y||{};if(!y||!t.isValid($)||!t.isValid(D))throw new Error("invalid affine point");if(y instanceof B)throw new Error("projective point not allowed");return t.is0($)&&t.is0(D)?B.ZERO:new B($,D,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(y){return Cy(B,"pz",y)}static fromBytes(y){return me(y),B.fromHex(y)}static fromHex(y){const $=B.fromAffine(f(le("pointHex",y)));return $.assertValidity(),$}static fromPrivateKey(y){const $=M4(u,n.allowedPrivateKeyLengths,n.wrapPrivateKey);return B.BASE.multiply($(y))}static msm(y,$){return Ny(B,u,y,$)}precompute(y=8,$=!0){return V.setWindowSize(this,y),$||this.multiply(kt),this}_setWindowSize(y){this.precompute(y)}assertValidity(){k(this)}hasEvenY(){const{y}=this.toAffine();if(!t.isOdd)throw new Error("Field doesn't support isOdd");return!t.isOdd(y)}equals(y){E(y);const{px:$,py:D,pz:w}=this,{px:I,py:T,pz:N}=y,O=t.eql(t.mul($,N),t.mul(I,w)),P=t.eql(t.mul(D,N),t.mul(T,w));return O&&P}negate(){return new B(this.px,t.neg(this.py),this.pz)}double(){const{a:y,b:$}=e,D=t.mul($,kt),{px:w,py:I,pz:T}=this;let N=t.ZERO,O=t.ZERO,P=t.ZERO,z=t.mul(w,w),re=t.mul(I,I),W=t.mul(T,T),R=t.mul(w,I);return R=t.add(R,R),P=t.mul(w,T),P=t.add(P,P),N=t.mul(y,P),O=t.mul(D,W),O=t.add(N,O),N=t.sub(re,O),O=t.add(re,O),O=t.mul(N,O),N=t.mul(R,N),P=t.mul(D,P),W=t.mul(y,W),R=t.sub(z,W),R=t.mul(y,R),R=t.add(R,P),P=t.add(z,z),z=t.add(P,z),z=t.add(z,W),z=t.mul(z,R),O=t.add(O,z),W=t.mul(I,T),W=t.add(W,W),z=t.mul(W,R),N=t.sub(N,z),P=t.mul(W,re),P=t.add(P,P),P=t.add(P,P),new B(N,O,P)}add(y){E(y);const{px:$,py:D,pz:w}=this,{px:I,py:T,pz:N}=y;let O=t.ZERO,P=t.ZERO,z=t.ZERO;const re=e.a,W=t.mul(e.b,kt);let R=t.mul($,I),oe=t.mul(D,T),se=t.mul(w,N),de=t.add($,D),X=t.add(I,T);de=t.mul(de,X),X=t.add(R,oe),de=t.sub(de,X),X=t.add($,w);let ye=t.add(I,N);return X=t.mul(X,ye),ye=t.add(R,se),X=t.sub(X,ye),ye=t.add(D,w),O=t.add(T,N),ye=t.mul(ye,O),O=t.add(oe,se),ye=t.sub(ye,O),z=t.mul(re,X),O=t.mul(W,se),z=t.add(O,z),O=t.sub(oe,z),z=t.add(oe,z),P=t.mul(O,z),oe=t.add(R,R),oe=t.add(oe,R),se=t.mul(re,se),X=t.mul(W,X),oe=t.add(oe,se),se=t.sub(R,se),se=t.mul(re,se),X=t.add(X,se),R=t.mul(oe,X),P=t.add(P,R),R=t.mul(ye,X),O=t.mul(de,O),O=t.sub(O,R),R=t.mul(de,oe),z=t.mul(ye,z),z=t.add(z,R),new B(O,P,z)}subtract(y){return this.add(y.negate())}is0(){return this.equals(B.ZERO)}multiply(y){const{endo:$}=n;if(!u.isValidNot0(y))throw new Error("invalid scalar: out of range");let D,w;const I=T=>V.wNAFCached(this,T,B.normalizeZ);if($){const{k1neg:T,k1:N,k2neg:O,k2:P}=$.splitScalar(y),{p:z,f:re}=I(N),{p:W,f:R}=I(P);w=re.add(R),D=_($.beta,z,W,T,O)}else{const{p:T,f:N}=I(y);D=T,w=N}return B.normalizeZ([D,w])[0]}multiplyUnsafe(y){const{endo:$}=n,D=this;if(!u.isValid(y))throw new Error("invalid scalar: out of range");if(y===Pn||D.is0())return B.ZERO;if(y===Se)return D;if(V.hasPrecomputes(this))return this.multiply(y);if($){const{k1neg:w,k1:I,k2neg:T,k2:N}=$.splitScalar(y),{p1:O,p2:P}=Fy(B,D,I,N);return _($.beta,O,P,w,T)}else return V.wNAFCachedUnsafe(D,y)}multiplyAndAddUnsafe(y,$,D){const w=this.multiplyUnsafe($).add(y.multiplyUnsafe(D));return w.is0()?void 0:w}toAffine(y){return g(this,y)}isTorsionFree(){const{isTorsionFree:y}=n;return i===Se?!0:y?y(B,this):V.wNAFCachedUnsafe(this,r).is0()}clearCofactor(){const{clearCofactor:y}=n;return i===Se?this:y?y(B,this):this.multiplyUnsafe(i)}toBytes(y=!0){return Gu("isCompressed",y),this.assertValidity(),l(B,this,y)}toRawBytes(y=!0){return this.toBytes(y)}toHex(y=!0){return ii(this.toBytes(y))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}B.BASE=new B(e.Gx,e.Gy,t.ONE),B.ZERO=new B(t.ZERO,t.ONE,t.ZERO),B.Fp=t,B.Fn=u;const G=u.BITS,V=Iy(B,n.endo?Math.ceil(G/2):G);return B}function G4(e){return Uint8Array.of(e?2:3)}function Py(e,n,t={}){Ku(n,{hash:"function"},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const u=n.randomBytes||p4,i=n.hmac||((D,...w)=>$4(n.hash,D,ke(...w))),{Fp:r,Fn:a}=e,{ORDER:o,BITS:s}=a;function c(D){const w=o>>Se;return D>w}function l(D){return c(D)?a.neg(D):D}function f(D,w){if(!a.isValidNot0(w))throw new Error(`invalid signature ${D}: out of range 1..CURVE.n`)}class m{constructor(w,I,T){f("r",w),f("s",I),this.r=w,this.s=I,T!=null&&(this.recovery=T),Object.freeze(this)}static fromCompact(w){const I=a.BYTES,T=le("compactSignature",w,I*2);return new m(a.fromBytes(T.subarray(0,I)),a.fromBytes(T.subarray(I,I*2)))}static fromDER(w){const{r:I,s:T}=Xe.toSig(le("DER",w));return new m(I,T)}assertValidity(){}addRecoveryBit(w){return new m(this.r,this.s,w)}recoverPublicKey(w){const I=r.ORDER,{r:T,s:N,recovery:O}=this;if(O==null||![0,1,2,3].includes(O))throw new Error("recovery id invalid");if(o*en<I&&O>1)throw new Error("recovery id is ambiguous for h>1 curve");const z=O===2||O===3?T+o:T;if(!r.isValid(z))throw new Error("recovery id 2 or 3 invalid");const re=r.toBytes(z),W=e.fromHex(ke(G4((O&1)===0),re)),R=a.inv(z),oe=k(le("msgHash",w)),se=a.create(-oe*R),de=a.create(N*R),X=e.BASE.multiplyUnsafe(se).add(W.multiplyUnsafe(de));if(X.is0())throw new Error("point at infinify");return X.assertValidity(),X}hasHighS(){return c(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,a.neg(this.s),this.recovery):this}toBytes(w){if(w==="compact")return ke(a.toBytes(this.r),a.toBytes(this.s));if(w==="der")return ls(Xe.hexFromSig(this));throw new Error("invalid format")}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return ii(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return ii(this.toBytes("compact"))}}const d=M4(a,t.allowedPrivateKeyLengths,t.wrapPrivateKey),v={isValidPrivateKey(D){try{return d(D),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const D=o;return _y(u(P4(D)),D)},precompute(D=8,w=e.BASE){return w.precompute(D,!1)}};function h(D,w=!0){return e.fromPrivateKey(D).toBytes(w)}function b(D){if(typeof D=="bigint")return!1;if(D instanceof e)return!0;const I=le("key",D).length,T=r.BYTES,N=T+1,O=2*T+1;if(!(t.allowedPrivateKeyLengths||a.BYTES===N))return I===N||I===O}function E(D,w,I=!0){if(b(D)===!0)throw new Error("first arg must be private key");if(b(w)===!1)throw new Error("second arg must be public key");return e.fromHex(w).multiply(d(D)).toBytes(I)}const g=n.bits2int||function(D){if(D.length>8192)throw new Error("input is too large");const w=On(D),I=D.length*8-s;return I>0?w>>BigInt(I):w},k=n.bits2int_modN||function(D){return a.create(g(D))},_=Hu(s);function B(D){return y4("num < 2^"+s,D,Pn,_),a.toBytes(D)}function G(D,w,I=V){if(["recovered","canonical"].some(de=>de in I))throw new Error("sign() legacy options not supported");const{hash:T}=n;let{lowS:N,prehash:O,extraEntropy:P}=I;N==null&&(N=!0),D=le("msgHash",D),q4(I),O&&(D=le("prehashed msgHash",T(D)));const z=k(D),re=d(w),W=[B(re),B(z)];if(P!=null&&P!==!1){const de=P===!0?u(r.BYTES):P;W.push(le("extraEntropy",de))}const R=ke(...W),oe=z;function se(de){const X=g(de);if(!a.isValidNot0(X))return;const ye=a.inv(X),xt=e.BASE.multiply(X).toAffine(),Rn=a.create(xt.x);if(Rn===Pn)return;const Dn=a.create(ye*a.create(oe+Rn*re));if(Dn===Pn)return;let wr=(xt.x===Rn?0:2)|Number(xt.y&Se),jn=Dn;return N&&c(Dn)&&(jn=l(Dn),wr^=1),new m(Rn,jn,wr)}return{seed:R,k2sig:se}}const V={lowS:n.lowS,prehash:!1},F={lowS:n.lowS,prehash:!1};function y(D,w,I=V){const{seed:T,k2sig:N}=G(D,w,I);return XE(n.hash.outputLen,a.BYTES,i)(T,N)}e.BASE.precompute(8);function $(D,w,I,T=F){const N=D;w=le("msgHash",w),I=le("publicKey",I),q4(T);const{lowS:O,prehash:P,format:z}=T;if("strict"in T)throw new Error("options.strict was renamed to lowS");if(z!==void 0&&!["compact","der","js"].includes(z))throw new Error('format must be "compact", "der" or "js"');const re=typeof N=="string"||qu(N),W=!re&&!z&&typeof N=="object"&&N!==null&&typeof N.r=="bigint"&&typeof N.s=="bigint";if(!re&&!W)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let R,oe;try{if(W)if(z===void 0||z==="js")R=new m(N.r,N.s);else throw new Error("invalid format");if(re){try{z!=="compact"&&(R=m.fromDER(N))}catch(jn){if(!(jn instanceof Xe.Err))throw jn}!R&&z!=="der"&&(R=m.fromCompact(N))}oe=e.fromHex(I)}catch{return!1}if(!R||O&&R.hasHighS())return!1;P&&(w=n.hash(w));const{r:se,s:de}=R,X=k(w),ye=a.inv(de),xt=a.create(X*ye),Rn=a.create(se*ye),Dn=e.BASE.multiplyUnsafe(xt).add(oe.multiplyUnsafe(Rn));return Dn.is0()?!1:a.create(Dn.x)===se}return Object.freeze({getPublicKey:h,getSharedSecret:E,sign:y,verify:$,utils:v,Point:e,Signature:m})}function Ry(e){const n={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},t=e.Fp,u=ir(n.n,e.nBitLength),i={Fp:t,Fn:u,allowedPrivateKeyLengths:e.allowedPrivateKeyLengths,allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,wrapPrivateKey:e.wrapPrivateKey,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes};return{CURVE:n,curveOpts:i}}function jy(e){const{CURVE:n,curveOpts:t}=Ry(e),u={hash:e.hash,hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:n,curveOpts:t,ecdsaOpts:u}}function Ly(e,n){return Object.assign({},n,{ProjectivePoint:n.Point,CURVE:e})}function Zy(e){const{CURVE:n,curveOpts:t,ecdsaOpts:u}=jy(e),i=Uy(n,t),r=Py(i,u,t);return Ly(e,r)}function Vy(e,n){const t=e.ORDER;let u=Pn;for(let v=t-Se;v%en===Pn;v/=en)u+=Se;const i=u,r=en<<i-Se-Se,a=r*en,o=(t-Se)/a,s=(o-Se)/en,c=a-Se,l=r,f=e.pow(n,o),m=e.pow(n,(o+Se)/en);let d=(v,h)=>{let b=f,E=e.pow(h,c),g=e.sqr(E);g=e.mul(g,h);let k=e.mul(v,g);k=e.pow(k,s),k=e.mul(k,E),E=e.mul(k,h),g=e.mul(k,v);let _=e.mul(g,E);k=e.pow(_,l);let B=e.eql(k,e.ONE);E=e.mul(g,m),k=e.mul(_,b),g=e.cmov(E,g,B),_=e.cmov(k,_,B);for(let G=i;G>Se;G--){let V=G-en;V=en<<V-Se;let F=e.pow(_,V);const y=e.eql(F,e.ONE);E=e.mul(g,b),b=e.mul(b,b),F=e.mul(_,b),g=e.cmov(E,g,y),_=e.cmov(F,_,y)}return{isValid:B,value:g}};if(e.ORDER%ys===kt){const v=(e.ORDER-kt)/ys,h=e.sqrt(e.neg(n));d=(b,E)=>{let g=e.sqr(E);const k=e.mul(b,E);g=e.mul(g,k);let _=e.pow(g,v);_=e.mul(_,k);const B=e.mul(_,h),G=e.mul(e.sqr(_),E),V=e.eql(G,b);let F=e.cmov(B,_,V);return{isValid:V,value:F}}}return d}function qy(e,n){O4(e);const{A:t,B:u,Z:i}=n;if(!e.isValid(t)||!e.isValid(u)||!e.isValid(i))throw new Error("mapToCurveSimpleSWU: invalid opts");const r=Vy(e,i);if(!e.isOdd)throw new Error("Field does not have .isOdd()");return a=>{let o,s,c,l,f,m,d,v;o=e.sqr(a),o=e.mul(o,i),s=e.sqr(o),s=e.add(s,o),c=e.add(s,e.ONE),c=e.mul(c,u),l=e.cmov(i,e.neg(s),!e.eql(s,e.ZERO)),l=e.mul(l,t),s=e.sqr(c),m=e.sqr(l),f=e.mul(m,t),s=e.add(s,f),s=e.mul(s,c),m=e.mul(m,l),f=e.mul(m,u),s=e.add(s,f),d=e.mul(o,c);const{isValid:h,value:b}=r(s,m);v=e.mul(o,a),v=e.mul(v,b),d=e.cmov(d,c,h),v=e.cmov(v,b,h);const E=e.isOdd(a)===e.isOdd(v);v=e.cmov(e.neg(v),v,E);const g=tr(e,[l],!0)[0];return d=e.mul(d,g),{x:d,y:v}}}function My(e,n){const t=u=>Zy({...e,hash:u});return{...t(n),create:t}}var Gy=On;function hn(e,n){if(si(e),si(n),e<0||e>=1<<8*n)throw new Error("invalid I2OSP input: "+e);const t=Array.from({length:n}).fill(0);for(let u=n-1;u>=0;u--)t[u]=e&255,e>>>=8;return new Uint8Array(t)}function Jy(e,n){const t=new Uint8Array(e.length);for(let u=0;u<e.length;u++)t[u]=e[u]^n[u];return t}function si(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function Hy(e,n,t,u){me(e),me(n),si(t),n.length>255&&(n=u(ke(Mu("H2C-OVERSIZE-DST-"),n)));const{outputLen:i,blockLen:r}=u,a=Math.ceil(t/i);if(t>65535||a>255)throw new Error("expand_message_xmd: invalid lenInBytes");const o=ke(n,hn(n.length,1)),s=hn(0,r),c=hn(t,2),l=new Array(a),f=u(ke(s,e,c,hn(0,1),o));l[0]=u(ke(f,hn(1,1),o));for(let d=1;d<=a;d++){const v=[Jy(f,l[d-1]),hn(d+1,1),o];l[d]=u(ke(...v))}return ke(...l).slice(0,t)}function Ky(e,n,t,u,i){if(me(e),me(n),si(t),n.length>255){const r=Math.ceil(2*u/8);n=i.create({dkLen:r}).update(Mu("H2C-OVERSIZE-DST-")).update(n).digest()}if(t>65535||n.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:t}).update(e).update(hn(t,2)).update(n).update(hn(n.length,1)).digest()}function J4(e,n,t){Ku(t,{p:"bigint",m:"number",k:"number",hash:"function"});const{p:u,k:i,m:r,hash:a,expand:o,DST:s}=t;if(!qu(s)&&typeof s!="string")throw new Error("DST must be string or uint8array");if(!ey(t.hash))throw new Error("expected valid hash");me(e),si(n);const c=typeof s=="string"?Mu(s):s,l=u.toString(2).length,f=Math.ceil((l+i)/8),m=n*r*f;let d;if(o==="xmd")d=Hy(e,c,m,a);else if(o==="xof")d=Ky(e,c,m,i,a);else if(o==="_internal_pass")d=e;else throw new Error('expand must be "xmd" or "xof"');const v=new Array(n);for(let h=0;h<n;h++){const b=new Array(r);for(let E=0;E<r;E++){const g=f*(E+h*r),k=d.subarray(g,g+f);b[E]=Ee(Gy(k),u)}v[h]=b}return v}function Qy(e,n){const t=n.map(u=>Array.from(u).reverse());return(u,i)=>{const[r,a,o,s]=t.map(f=>f.reduce((m,d)=>e.add(e.mul(m,u),d))),[c,l]=tr(e,[a,s],!0);return u=e.mul(r,c),i=e.mul(i,e.mul(o,l)),{x:u,y:i}}}function Wy(e,n,t){if(typeof n!="function")throw new Error("mapToCurve() must be defined");function u(r){return e.fromAffine(n(r))}function i(r){const a=r.clearCofactor();return a.equals(e.ZERO)?e.ZERO:(a.assertValidity(),a)}return{defaults:t,hashToCurve(r,a){const o=t.DST?t.DST:{},s=Object.assign({},t,o,a),c=J4(r,2,s),l=u(c[0]),f=u(c[1]);return i(l.add(f))},encodeToCurve(r,a){const o=t.encodeDST?t.encodeDST:{},s=Object.assign({},t,o,a),c=J4(r,1,s);return i(u(c[0]))},mapToCurve(r){if(!Array.isArray(r))throw new Error("expected array of bigints");for(const a of r)if(typeof a!="bigint")throw new Error("expected array of bigints");return i(u(r))}}}var nn={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},H4=BigInt(0),ur=BigInt(1),rr=BigInt(2),K4=(e,n)=>(e+n/rr)/n;function Q4(e){const n=nn.p,t=BigInt(3),u=BigInt(6),i=BigInt(11),r=BigInt(22),a=BigInt(23),o=BigInt(44),s=BigInt(88),c=e*e*e%n,l=c*c*e%n,f=Ne(l,t,n)*l%n,m=Ne(f,t,n)*l%n,d=Ne(m,rr,n)*c%n,v=Ne(d,i,n)*d%n,h=Ne(v,r,n)*v%n,b=Ne(h,o,n)*h%n,E=Ne(b,s,n)*b%n,g=Ne(E,o,n)*h%n,k=Ne(g,t,n)*l%n,_=Ne(k,a,n)*v%n,B=Ne(_,u,n)*c%n,G=Ne(B,rr,n);if(!gn.eql(gn.sqr(G),e))throw new Error("Cannot find square root");return G}var gn=ir(nn.p,void 0,void 0,{sqrt:Q4}),ar=My({...nn,Fp:gn,lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const n=nn.n,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),u=-ur*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),r=t,a=BigInt("0x100000000000000000000000000000000"),o=K4(r*e,n),s=K4(-u*e,n);let c=Ee(e-o*t-s*i,n),l=Ee(-o*u-s*r,n);const f=c>a,m=l>a;if(f&&(c=n-c),m&&(l=n-l),c>a||l>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:c,k2neg:m,k2:l}}}},nr),W4={};function or(e,...n){let t=W4[e];if(t===void 0){const u=nr(Uint8Array.from(e,i=>i.charCodeAt(0)));t=ke(u,u),W4[e]=t}return nr(ke(t,...n))}var bs=e=>e.toBytes(!0).slice(1),ks=e=>ri(e,32),Ds=e=>Ee(e,nn.p),ci=e=>Ee(e,nn.n),Ss=ar.Point,Bs=e=>e%rr===H4;function ws(e){let n=ar.utils.normPrivateKeyToScalar(e),t=Ss.fromPrivateKey(n);return{scalar:Bs(t.y)?n:ci(-n),bytes:bs(t)}}function Y4(e){y4("x",e,ur,nn.p);const n=Ds(e*e),t=Ds(n*e+BigInt(7));let u=Q4(t);Bs(u)||(u=Ds(-u));const i=Ss.fromAffine({x:e,y:u});return i.assertValidity(),i}var Dt=On;function X4(...e){return ci(Dt(or("BIP0340/challenge",...e)))}function Yy(e){return ws(e).bytes}function Xy(e,n,t=p4(32)){const u=le("message",e),{bytes:i,scalar:r}=ws(n),a=le("auxRand",t,32),o=ks(r^Dt(or("BIP0340/aux",a))),s=or("BIP0340/nonce",o,i,u),c=ci(Dt(s));if(c===H4)throw new Error("sign failed: k is zero");const{bytes:l,scalar:f}=ws(c),m=X4(l,i,u),d=new Uint8Array(64);if(d.set(l,0),d.set(ks(ci(f+m*r)),32),!ev(d,u,i))throw new Error("sign: Invalid signature produced");return d}function ev(e,n,t){const u=le("signature",e,64),i=le("message",n),r=le("publicKey",t,32);try{const a=Y4(Dt(r)),o=Dt(u.subarray(0,32));if(!ps(o,ur,nn.p))return!1;const s=Dt(u.subarray(32,64));if(!ps(s,ur,nn.n))return!1;const c=X4(ks(o),bs(a),i),l=Ss.BASE.multiplyUnsafe(s).add(a.multiplyUnsafe(ci(-c))),{x:f,y:m}=l.toAffine();return!(l.is0()||!Bs(m)||f!==o)}catch{return!1}}({getPublicKey:Yy,sign:Xy,verify:ev,utils:{randomPrivateKey:ar.utils.randomPrivateKey,lift_x:Y4,pointToBytes:bs,numberToBytesBE:ri,bytesToNumberBE:On,taggedHash:or,mod:Ee}});var eb=Qy(gn,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(n=>BigInt(n)))),nb=qy(gn,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:gn.create(BigInt("-11"))});Wy(ar.Point,e=>{const{x:n,y:t}=nb(gn.create(e[0]));return eb(n,t)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:gn.ORDER,m:1,k:128,expand:"xmd",hash:nr});/*! Bundled license information:
470
+ */function my(e,n,t,u){if(typeof e.setBigUint64=="function")return e.setBigUint64(n,t,u);const i=BigInt(32),r=BigInt(4294967295),a=Number(t>>i&r),o=Number(t&r),s=u?4:0,c=u?0:4;e.setUint32(n+s,a,u),e.setUint32(n+c,o,u)}function Xu(e,n,t){return e&n^~e&t}function w4(e,n,t){return e&n^e&t^n&t}var ai=class extends ds{constructor(e,n,t,u){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=n,this.padOffset=t,this.isLE=u,this.buffer=new Uint8Array(e),this.view=cs(this.buffer)}update(e){gt(this),e=ui(e),me(e);const{view:n,buffer:t,blockLen:u}=this,i=e.length;for(let r=0;r<i;){const a=Math.min(u-this.pos,i-r);if(a===u){const o=cs(e);for(;u<=i-r;r+=u)this.process(o,r);continue}t.set(e.subarray(r,r+a),this.pos),this.pos+=a,r+=a,this.pos===u&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){gt(this),d4(e,this),this.finished=!0;const{buffer:n,view:t,blockLen:u,isLE:i}=this;let{pos:r}=this;n[r++]=128,we(this.buffer.subarray(r)),this.padOffset>u-r&&(this.process(t,0),r=0);for(let l=r;l<u;l++)n[l]=0;my(t,u-8,BigInt(this.length*8),i),this.process(t,0);const a=cs(e),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const s=o/4,c=this.get();if(s>c.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<s;l++)a.setUint32(4*l,c[l],i)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const t=e.slice(0,n);return this.destroy(),t}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:t,length:u,finished:i,destroyed:r,pos:a}=this;return e.destroyed=r,e.finished=i,e.length=u,e.pos=a,u%n&&e.buffer.set(t),e}clone(){return this._cloneInto()}},dn=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),fn=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),ve=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),pe=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),vy=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),mn=new Uint32Array(64),A4=class extends ai{constructor(e=32){super(64,e,8,!1),this.A=dn[0]|0,this.B=dn[1]|0,this.C=dn[2]|0,this.D=dn[3]|0,this.E=dn[4]|0,this.F=dn[5]|0,this.G=dn[6]|0,this.H=dn[7]|0}get(){const{A:e,B:n,C:t,D:u,E:i,F:r,G:a,H:o}=this;return[e,n,t,u,i,r,a,o]}set(e,n,t,u,i,r,a,o){this.A=e|0,this.B=n|0,this.C=t|0,this.D=u|0,this.E=i|0,this.F=r|0,this.G=a|0,this.H=o|0}process(e,n){for(let l=0;l<16;l++,n+=4)mn[l]=e.getUint32(n,!1);for(let l=16;l<64;l++){const f=mn[l-15],m=mn[l-2],d=Ge(f,7)^Ge(f,18)^f>>>3,v=Ge(m,17)^Ge(m,19)^m>>>10;mn[l]=v+mn[l-7]+d+mn[l-16]|0}let{A:t,B:u,C:i,D:r,E:a,F:o,G:s,H:c}=this;for(let l=0;l<64;l++){const f=Ge(a,6)^Ge(a,11)^Ge(a,25),m=c+f+Xu(a,o,s)+vy[l]+mn[l]|0,v=(Ge(t,2)^Ge(t,13)^Ge(t,22))+w4(t,u,i)|0;c=s,s=o,o=a,a=r+m|0,r=i,i=u,u=t,t=m+v|0}t=t+this.A|0,u=u+this.B|0,i=i+this.C|0,r=r+this.D|0,a=a+this.E|0,o=o+this.F|0,s=s+this.G|0,c=c+this.H|0,this.set(t,u,i,r,a,o,s,c)}roundClean(){we(mn)}destroy(){this.set(0,0,0,0,0,0,0,0),we(this.buffer)}},py=class extends A4{constructor(){super(28),this.A=fn[0]|0,this.B=fn[1]|0,this.C=fn[2]|0,this.D=fn[3]|0,this.E=fn[4]|0,this.F=fn[5]|0,this.G=fn[6]|0,this.H=fn[7]|0}},_4=D4(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),hy=_4[0],gy=_4[1],vn=new Uint32Array(80),pn=new Uint32Array(80),er=class extends ai{constructor(e=64){super(128,e,16,!1),this.Ah=pe[0]|0,this.Al=pe[1]|0,this.Bh=pe[2]|0,this.Bl=pe[3]|0,this.Ch=pe[4]|0,this.Cl=pe[5]|0,this.Dh=pe[6]|0,this.Dl=pe[7]|0,this.Eh=pe[8]|0,this.El=pe[9]|0,this.Fh=pe[10]|0,this.Fl=pe[11]|0,this.Gh=pe[12]|0,this.Gl=pe[13]|0,this.Hh=pe[14]|0,this.Hl=pe[15]|0}get(){const{Ah:e,Al:n,Bh:t,Bl:u,Ch:i,Cl:r,Dh:a,Dl:o,Eh:s,El:c,Fh:l,Fl:f,Gh:m,Gl:d,Hh:v,Hl:h}=this;return[e,n,t,u,i,r,a,o,s,c,l,f,m,d,v,h]}set(e,n,t,u,i,r,a,o,s,c,l,f,m,d,v,h){this.Ah=e|0,this.Al=n|0,this.Bh=t|0,this.Bl=u|0,this.Ch=i|0,this.Cl=r|0,this.Dh=a|0,this.Dl=o|0,this.Eh=s|0,this.El=c|0,this.Fh=l|0,this.Fl=f|0,this.Gh=m|0,this.Gl=d|0,this.Hh=v|0,this.Hl=h|0}process(e,n){for(let g=0;g<16;g++,n+=4)vn[g]=e.getUint32(n),pn[g]=e.getUint32(n+=4);for(let g=16;g<80;g++){const k=vn[g-15]|0,_=pn[g-15]|0,B=Et(k,_,1)^Et(k,_,8)^S4(k,_,7),G=yt(k,_,1)^yt(k,_,8)^B4(k,_,7),V=vn[g-2]|0,F=pn[g-2]|0,y=Et(V,F,19)^Wu(V,F,61)^S4(V,F,6),$=yt(V,F,19)^Yu(V,F,61)^B4(V,F,6),D=cy(G,$,pn[g-7],pn[g-16]),w=ly(D,B,y,vn[g-7],vn[g-16]);vn[g]=w|0,pn[g]=D|0}let{Ah:t,Al:u,Bh:i,Bl:r,Ch:a,Cl:o,Dh:s,Dl:c,Eh:l,El:f,Fh:m,Fl:d,Gh:v,Gl:h,Hh:b,Hl:E}=this;for(let g=0;g<80;g++){const k=Et(l,f,14)^Et(l,f,18)^Wu(l,f,41),_=yt(l,f,14)^yt(l,f,18)^Yu(l,f,41),B=l&m^~l&v,G=f&d^~f&h,V=dy(E,_,G,gy[g],pn[g]),F=fy(V,b,k,B,hy[g],vn[g]),y=V|0,$=Et(t,u,28)^Wu(t,u,34)^Wu(t,u,39),D=yt(t,u,28)^Yu(t,u,34)^Yu(t,u,39),w=t&i^t&a^i&a,I=u&r^u&o^r&o;b=v|0,E=h|0,v=m|0,h=d|0,m=l|0,d=f|0,{h:l,l:f}=Ye(s|0,c|0,F|0,y|0),s=a|0,c=o|0,a=i|0,o=r|0,i=t|0,r=u|0;const T=oy(y,D,I);t=sy(T,F,$,w),u=T|0}({h:t,l:u}=Ye(this.Ah|0,this.Al|0,t|0,u|0)),{h:i,l:r}=Ye(this.Bh|0,this.Bl|0,i|0,r|0),{h:a,l:o}=Ye(this.Ch|0,this.Cl|0,a|0,o|0),{h:s,l:c}=Ye(this.Dh|0,this.Dl|0,s|0,c|0),{h:l,l:f}=Ye(this.Eh|0,this.El|0,l|0,f|0),{h:m,l:d}=Ye(this.Fh|0,this.Fl|0,m|0,d|0),{h:v,l:h}=Ye(this.Gh|0,this.Gl|0,v|0,h|0),{h:b,l:E}=Ye(this.Hh|0,this.Hl|0,b|0,E|0),this.set(t,u,i,r,a,o,s,c,l,f,m,d,v,h,b,E)}roundClean(){we(vn,pn)}destroy(){we(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Ey=class extends er{constructor(){super(48),this.Ah=ve[0]|0,this.Al=ve[1]|0,this.Bh=ve[2]|0,this.Bl=ve[3]|0,this.Ch=ve[4]|0,this.Cl=ve[5]|0,this.Dh=ve[6]|0,this.Dl=ve[7]|0,this.Eh=ve[8]|0,this.El=ve[9]|0,this.Fh=ve[10]|0,this.Fl=ve[11]|0,this.Gh=ve[12]|0,this.Gl=ve[13]|0,this.Hh=ve[14]|0,this.Hl=ve[15]|0}},he=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),ge=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]),yy=class extends er{constructor(){super(28),this.Ah=he[0]|0,this.Al=he[1]|0,this.Bh=he[2]|0,this.Bl=he[3]|0,this.Ch=he[4]|0,this.Cl=he[5]|0,this.Dh=he[6]|0,this.Dl=he[7]|0,this.Eh=he[8]|0,this.El=he[9]|0,this.Fh=he[10]|0,this.Fl=he[11]|0,this.Gh=he[12]|0,this.Gl=he[13]|0,this.Hh=he[14]|0,this.Hl=he[15]|0}},by=class extends er{constructor(){super(32),this.Ah=ge[0]|0,this.Al=ge[1]|0,this.Bh=ge[2]|0,this.Bl=ge[3]|0,this.Ch=ge[4]|0,this.Cl=ge[5]|0,this.Dh=ge[6]|0,this.Dl=ge[7]|0,this.Eh=ge[8]|0,this.El=ge[9]|0,this.Fh=ge[10]|0,this.Fl=ge[11]|0,this.Gh=ge[12]|0,this.Gl=ge[13]|0,this.Hh=ge[14]|0,this.Hl=ge[15]|0}},nr=Je(()=>new A4);Je(()=>new py),Je(()=>new er),Je(()=>new Ey),Je(()=>new by),Je(()=>new yy);var C4=class extends ds{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,GE(e);const t=ui(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const u=this.blockLen,i=new Uint8Array(u);i.set(t.length>u?e.create().update(t).digest():t);for(let r=0;r<i.length;r++)i[r]^=54;this.iHash.update(i),this.oHash=e.create();for(let r=0;r<i.length;r++)i[r]^=106;this.oHash.update(i),we(i)}update(e){return gt(this),this.iHash.update(e),this}digestInto(e){gt(this),me(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:t,finished:u,destroyed:i,blockLen:r,outputLen:a}=this;return e=e,e.finished=u,e.destroyed=i,e.blockLen=r,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=t._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},$4=(e,n,t)=>new C4(e,n).update(t).digest();$4.create=(e,n)=>new C4(e,n);var Ae=BigInt(0),De=BigInt(1),zn=BigInt(2),ky=BigInt(3),x4=BigInt(4),I4=BigInt(5),F4=BigInt(8);function Ee(e,n){const t=e%n;return t>=Ae?t:n+t}function Ne(e,n,t){let u=e;for(;n-- >Ae;)u*=u,u%=t;return u}function N4(e,n){if(e===Ae)throw new Error("invert: expected non-zero number");if(n<=Ae)throw new Error("invert: expected positive modulus, got "+n);let t=Ee(e,n),u=n,i=Ae,r=De;for(;t!==Ae;){const o=u/t,s=u%t,c=i-r*o;u=t,t=s,i=r,r=c}if(u!==De)throw new Error("invert: does not exist");return Ee(i,n)}function T4(e,n){const t=(e.ORDER+De)/x4,u=e.pow(n,t);if(!e.eql(e.sqr(u),n))throw new Error("Cannot find square root");return u}function Dy(e,n){const t=(e.ORDER-I4)/F4,u=e.mul(n,zn),i=e.pow(u,t),r=e.mul(n,i),a=e.mul(e.mul(r,zn),i),o=e.mul(r,e.sub(a,e.ONE));if(!e.eql(e.sqr(o),n))throw new Error("Cannot find square root");return o}function Sy(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let n=e-De,t=0;for(;n%zn===Ae;)n/=zn,t++;let u=zn;const i=ir(e);for(;z4(i,u)===1;)if(u++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(t===1)return T4;let r=i.pow(u,n);const a=(n+De)/zn;return function(s,c){if(s.is0(c))return c;if(z4(s,c)!==1)throw new Error("Cannot find square root");let l=t,f=s.mul(s.ONE,r),m=s.pow(c,n),d=s.pow(c,a);for(;!s.eql(m,s.ONE);){if(s.is0(m))return s.ZERO;let v=1,h=s.sqr(m);for(;!s.eql(h,s.ONE);)if(v++,h=s.sqr(h),v===l)throw new Error("Cannot find square root");const b=De<<BigInt(l-v-1),E=s.pow(f,b);l=v,f=s.sqr(E),m=s.mul(m,f),d=s.mul(d,E)}return d}}function By(e){return e%x4===ky?T4:e%F4===I4?Dy:Sy(e)}var wy=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function O4(e){const n={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},t=wy.reduce((u,i)=>(u[i]="function",u),n);return Ku(e,t),e}function Ay(e,n,t){if(t<Ae)throw new Error("invalid exponent, negatives unsupported");if(t===Ae)return e.ONE;if(t===De)return n;let u=e.ONE,i=n;for(;t>Ae;)t&De&&(u=e.mul(u,i)),i=e.sqr(i),t>>=De;return u}function tr(e,n,t=!1){const u=new Array(n.length).fill(t?e.ZERO:void 0),i=n.reduce((a,o,s)=>e.is0(o)?a:(u[s]=a,e.mul(a,o)),e.ONE),r=e.inv(i);return n.reduceRight((a,o,s)=>e.is0(o)?a:(u[s]=e.mul(a,u[s]),e.mul(a,o)),r),u}function z4(e,n){const t=(e.ORDER-De)/zn,u=e.pow(n,t),i=e.eql(u,e.ONE),r=e.eql(u,e.ZERO),a=e.eql(u,e.neg(e.ONE));if(!i&&!r&&!a)throw new Error("invalid Legendre symbol result");return i?1:r?0:-1}function _y(e,n){n!==void 0&&ti(n);const t=n!==void 0?n:e.toString(2).length,u=Math.ceil(t/8);return{nBitLength:t,nByteLength:u}}function ir(e,n,t=!1,u={}){if(e<=Ae)throw new Error("invalid field: expected ORDER > 0, got "+e);let i,r;if(typeof n=="object"&&n!=null){if(u.sqrt||t)throw new Error("cannot specify opts in two arguments");const l=n;l.BITS&&(i=l.BITS),l.sqrt&&(r=l.sqrt),typeof l.isLE=="boolean"&&(t=l.isLE)}else typeof n=="number"&&(i=n),u.sqrt&&(r=u.sqrt);const{nBitLength:a,nByteLength:o}=_y(e,i);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const c=Object.freeze({ORDER:e,isLE:t,BITS:a,BYTES:o,MASK:Hu(a),ZERO:Ae,ONE:De,create:l=>Ee(l,e),isValid:l=>{if(typeof l!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof l);return Ae<=l&&l<e},is0:l=>l===Ae,isValidNot0:l=>!c.is0(l)&&c.isValid(l),isOdd:l=>(l&De)===De,neg:l=>Ee(-l,e),eql:(l,f)=>l===f,sqr:l=>Ee(l*l,e),add:(l,f)=>Ee(l+f,e),sub:(l,f)=>Ee(l-f,e),mul:(l,f)=>Ee(l*f,e),pow:(l,f)=>Ay(c,l,f),div:(l,f)=>Ee(l*N4(f,e),e),sqrN:l=>l*l,addN:(l,f)=>l+f,subN:(l,f)=>l-f,mulN:(l,f)=>l*f,inv:l=>N4(l,e),sqrt:r||(l=>(s||(s=By(e)),s(c,l))),toBytes:l=>t?E4(l,o):ri(l,o),fromBytes:l=>{if(l.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+l.length);return t?g4(l):On(l)},invertBatch:l=>tr(c,l),cmov:(l,f,m)=>m?f:l});return Object.freeze(c)}function U4(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const n=e.toString(2).length;return Math.ceil(n/8)}function P4(e){const n=U4(e);return n+Math.ceil(n/2)}function Cy(e,n,t=!1){const u=e.length,i=U4(n),r=P4(n);if(u<16||u<r||u>1024)throw new Error("expected "+r+"-1024 bytes of input, got "+u);const a=t?g4(e):On(e),o=Ee(a,n-De)+De;return t?E4(o,i):ri(o,i)}var bt=BigInt(0),Un=BigInt(1);function oi(e,n){const t=n.negate();return e?t:n}function $y(e,n,t){const u=a=>a.pz,i=tr(e.Fp,t.map(u));return t.map((a,o)=>a.toAffine(i[o])).map(e.fromAffine)}function R4(e,n){if(!Number.isSafeInteger(e)||e<=0||e>n)throw new Error("invalid window size, expected [1.."+n+"], got W="+e)}function hs(e,n){R4(e,n);const t=Math.ceil(n/e)+1,u=2**(e-1),i=2**e,r=Hu(e),a=BigInt(e);return{windows:t,windowSize:u,mask:r,maxNumber:i,shiftBy:a}}function j4(e,n,t){const{windowSize:u,mask:i,maxNumber:r,shiftBy:a}=t;let o=Number(e&i),s=e>>a;o>u&&(o-=r,s+=Un);const c=n*u,l=c+Math.abs(o)-1,f=o===0,m=o<0,d=n%2!==0;return{nextN:s,offset:l,isZero:f,isNeg:m,isNegF:d,offsetF:c}}function xy(e,n){if(!Array.isArray(e))throw new Error("array expected");e.forEach((t,u)=>{if(!(t instanceof n))throw new Error("invalid point at index "+u)})}function Iy(e,n){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((t,u)=>{if(!n.isValid(t))throw new Error("invalid scalar at index "+u)})}var gs=new WeakMap,L4=new WeakMap;function Es(e){return L4.get(e)||1}function Z4(e){if(e!==bt)throw new Error("invalid wNAF")}function Fy(e,n){return{constTimeNegate:oi,hasPrecomputes(t){return Es(t)!==1},unsafeLadder(t,u,i=e.ZERO){let r=t;for(;u>bt;)u&Un&&(i=i.add(r)),r=r.double(),u>>=Un;return i},precomputeWindow(t,u){const{windows:i,windowSize:r}=hs(u,n),a=[];let o=t,s=o;for(let c=0;c<i;c++){s=o,a.push(s);for(let l=1;l<r;l++)s=s.add(o),a.push(s);o=s.double()}return a},wNAF(t,u,i){let r=e.ZERO,a=e.BASE;const o=hs(t,n);for(let s=0;s<o.windows;s++){const{nextN:c,offset:l,isZero:f,isNeg:m,isNegF:d,offsetF:v}=j4(i,s,o);i=c,f?a=a.add(oi(d,u[v])):r=r.add(oi(m,u[l]))}return Z4(i),{p:r,f:a}},wNAFUnsafe(t,u,i,r=e.ZERO){const a=hs(t,n);for(let o=0;o<a.windows&&i!==bt;o++){const{nextN:s,offset:c,isZero:l,isNeg:f}=j4(i,o,a);if(i=s,!l){const m=u[c];r=r.add(f?m.negate():m)}}return Z4(i),r},getPrecomputes(t,u,i){let r=gs.get(u);return r||(r=this.precomputeWindow(u,t),t!==1&&(typeof i=="function"&&(r=i(r)),gs.set(u,r))),r},wNAFCached(t,u,i){const r=Es(t);return this.wNAF(r,this.getPrecomputes(r,t,i),u)},wNAFCachedUnsafe(t,u,i,r){const a=Es(t);return a===1?this.unsafeLadder(t,u,r):this.wNAFUnsafe(a,this.getPrecomputes(a,t,i),u,r)},setWindowSize(t,u){R4(u,n),L4.set(t,u),gs.delete(t)}}}function Ny(e,n,t,u){let i=n,r=e.ZERO,a=e.ZERO;for(;t>bt||u>bt;)t&Un&&(r=r.add(i)),u&Un&&(a=a.add(i)),i=i.double(),t>>=Un,u>>=Un;return{p1:r,p2:a}}function Ty(e,n,t,u){xy(t,e),Iy(u,n);const i=t.length,r=u.length;if(i!==r)throw new Error("arrays of points and scalars must have equal length");const a=e.ZERO,o=XE(BigInt(i));let s=1;o>12?s=o-3:o>4?s=o-2:o>0&&(s=2);const c=Hu(s),l=new Array(Number(c)+1).fill(a),f=Math.floor((n.BITS-1)/s)*s;let m=a;for(let d=f;d>=0;d-=s){l.fill(a);for(let h=0;h<r;h++){const b=u[h],E=Number(b>>BigInt(d)&c);l[E]=l[E].add(t[h])}let v=a;for(let h=l.length-1,b=a;h>0;h--)b=b.add(l[h]),v=v.add(b);if(m=m.add(v),d!==0)for(let h=0;h<s;h++)m=m.double()}return m}function V4(e,n){if(n){if(n.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return O4(n),n}else return ir(e)}function Oy(e,n,t={}){if(!n||typeof n!="object")throw new Error(`expected valid ${e} CURVE object`);for(const o of["p","n","h"]){const s=n[o];if(!(typeof s=="bigint"&&s>bt))throw new Error(`CURVE.${o} must be positive bigint`)}const u=V4(n.p,t.Fp),i=V4(n.n,t.Fn),a=["Gx","Gy","a","b"];for(const o of a)if(!u.isValid(n[o]))throw new Error(`CURVE.${o} must be valid field element of CURVE.Fp`);return{Fp:u,Fn:i}}function q4(e){e.lowS!==void 0&&Gu("lowS",e.lowS),e.prehash!==void 0&&Gu("prehash",e.prehash)}var zy=class extends Error{constructor(e=""){super(e)}},Xe={Err:zy,_tlv:{encode:(e,n)=>{const{Err:t}=Xe;if(e<0||e>256)throw new t("tlv.encode: wrong tag");if(n.length&1)throw new t("tlv.encode: unpadded data");const u=n.length/2,i=Ju(u);if(i.length/2&128)throw new t("tlv.encode: long form length too big");const r=u>127?Ju(i.length/2|128):"";return Ju(e)+r+i+n},decode(e,n){const{Err:t}=Xe;let u=0;if(e<0||e>256)throw new t("tlv.encode: wrong tag");if(n.length<2||n[u++]!==e)throw new t("tlv.decode: wrong tlv");const i=n[u++],r=!!(i&128);let a=0;if(!r)a=i;else{const s=i&127;if(!s)throw new t("tlv.decode(long): indefinite length not supported");if(s>4)throw new t("tlv.decode(long): byte length is too big");const c=n.subarray(u,u+s);if(c.length!==s)throw new t("tlv.decode: length bytes not complete");if(c[0]===0)throw new t("tlv.decode(long): zero leftmost byte");for(const l of c)a=a<<8|l;if(u+=s,a<128)throw new t("tlv.decode(long): not minimal encoding")}const o=n.subarray(u,u+a);if(o.length!==a)throw new t("tlv.decode: wrong value length");return{v:o,l:n.subarray(u+a)}}},_int:{encode(e){const{Err:n}=Xe;if(e<Pn)throw new n("integer: negative integers are not allowed");let t=Ju(e);if(Number.parseInt(t[0],16)&8&&(t="00"+t),t.length&1)throw new n("unexpected DER parsing assertion: unpadded hex");return t},decode(e){const{Err:n}=Xe;if(e[0]&128)throw new n("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new n("invalid signature integer: unnecessary leading zero");return On(e)}},toSig(e){const{Err:n,_int:t,_tlv:u}=Xe,i=le("signature",e),{v:r,l:a}=u.decode(48,i);if(a.length)throw new n("invalid signature: left bytes after parsing");const{v:o,l:s}=u.decode(2,r),{v:c,l}=u.decode(2,s);if(l.length)throw new n("invalid signature: left bytes after parsing");return{r:t.decode(o),s:t.decode(c)}},hexFromSig(e){const{_tlv:n,_int:t}=Xe,u=n.encode(2,t.encode(e.r)),i=n.encode(2,t.encode(e.s)),r=u+i;return n.encode(48,r)}},Pn=BigInt(0),Se=BigInt(1),en=BigInt(2),kt=BigInt(3),ys=BigInt(4);function Uy(e,n,t){function u(i){const r=e.sqr(i),a=e.mul(r,i);return e.add(e.add(a,e.mul(i,n)),t)}return u}function M4(e,n,t){const{BYTES:u}=e;function i(r){let a;if(typeof r=="bigint")a=r;else{let o=le("private key",r);if(n){if(!n.includes(o.length*2))throw new Error("invalid private key");const s=new Uint8Array(u);s.set(o,s.length-o.length),o=s}try{a=e.fromBytes(o)}catch{throw new Error(`invalid private key: expected ui8a of size ${u}, got ${typeof r}`)}}if(t&&(a=e.create(a)),!e.isValidNot0(a))throw new Error("invalid private key: out of range [1..N-1]");return a}return i}function Py(e,n={}){const{Fp:t,Fn:u}=Oy("weierstrass",e,n),{h:i,n:r}=e;Ku(n,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:a}=n;if(a&&(!t.is0(e.a)||typeof a.beta!="bigint"||typeof a.splitScalar!="function"))throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function');function o(){if(!t.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function s(F,y,$){const{x:D,y:w}=y.toAffine(),I=t.toBytes(D);if(Gu("isCompressed",$),$){o();const T=!t.isOdd(w);return ke(G4(T),I)}else return ke(Uint8Array.of(4),I,t.toBytes(w))}function c(F){me(F);const y=t.BYTES,$=y+1,D=2*y+1,w=F.length,I=F[0],T=F.subarray(1);if(w===$&&(I===2||I===3)){const N=t.fromBytes(T);if(!t.isValid(N))throw new Error("bad point: is not on curve, wrong x");const O=m(N);let P;try{P=t.sqrt(O)}catch(W){const R=W instanceof Error?": "+W.message:"";throw new Error("bad point: is not on curve, sqrt error"+R)}o();const z=t.isOdd(P);return(I&1)===1!==z&&(P=t.neg(P)),{x:N,y:P}}else if(w===D&&I===4){const N=t.fromBytes(T.subarray(y*0,y*1)),O=t.fromBytes(T.subarray(y*1,y*2));if(!d(N,O))throw new Error("bad point: is not on curve");return{x:N,y:O}}else throw new Error(`bad point: got length ${w}, expected compressed=${$} or uncompressed=${D}`)}const l=n.toBytes||s,f=n.fromBytes||c,m=Uy(t,e.a,e.b);function d(F,y){const $=t.sqr(y),D=m(F);return t.eql($,D)}if(!d(e.Gx,e.Gy))throw new Error("bad curve params: generator point");const v=t.mul(t.pow(e.a,kt),ys),h=t.mul(t.sqr(e.b),BigInt(27));if(t.is0(t.add(v,h)))throw new Error("bad curve params: a or b");function b(F,y,$=!1){if(!t.isValid(y)||$&&t.is0(y))throw new Error(`bad point coordinate ${F}`);return y}function E(F){if(!(F instanceof B))throw new Error("ProjectivePoint expected")}const g=b4((F,y)=>{const{px:$,py:D,pz:w}=F;if(t.eql(w,t.ONE))return{x:$,y:D};const I=F.is0();y==null&&(y=I?t.ONE:t.inv(w));const T=t.mul($,y),N=t.mul(D,y),O=t.mul(w,y);if(I)return{x:t.ZERO,y:t.ZERO};if(!t.eql(O,t.ONE))throw new Error("invZ was invalid");return{x:T,y:N}}),k=b4(F=>{if(F.is0()){if(n.allowInfinityPoint&&!t.is0(F.py))return;throw new Error("bad point: ZERO")}const{x:y,y:$}=F.toAffine();if(!t.isValid(y)||!t.isValid($))throw new Error("bad point: x or y not field elements");if(!d(y,$))throw new Error("bad point: equation left != right");if(!F.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function _(F,y,$,D,w){return $=new B(t.mul($.px,F),$.py,$.pz),y=oi(D,y),$=oi(w,$),y.add($)}class B{constructor(y,$,D){this.px=b("x",y),this.py=b("y",$,!0),this.pz=b("z",D),Object.freeze(this)}static fromAffine(y){const{x:$,y:D}=y||{};if(!y||!t.isValid($)||!t.isValid(D))throw new Error("invalid affine point");if(y instanceof B)throw new Error("projective point not allowed");return t.is0($)&&t.is0(D)?B.ZERO:new B($,D,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(y){return $y(B,"pz",y)}static fromBytes(y){return me(y),B.fromHex(y)}static fromHex(y){const $=B.fromAffine(f(le("pointHex",y)));return $.assertValidity(),$}static fromPrivateKey(y){const $=M4(u,n.allowedPrivateKeyLengths,n.wrapPrivateKey);return B.BASE.multiply($(y))}static msm(y,$){return Ty(B,u,y,$)}precompute(y=8,$=!0){return V.setWindowSize(this,y),$||this.multiply(kt),this}_setWindowSize(y){this.precompute(y)}assertValidity(){k(this)}hasEvenY(){const{y}=this.toAffine();if(!t.isOdd)throw new Error("Field doesn't support isOdd");return!t.isOdd(y)}equals(y){E(y);const{px:$,py:D,pz:w}=this,{px:I,py:T,pz:N}=y,O=t.eql(t.mul($,N),t.mul(I,w)),P=t.eql(t.mul(D,N),t.mul(T,w));return O&&P}negate(){return new B(this.px,t.neg(this.py),this.pz)}double(){const{a:y,b:$}=e,D=t.mul($,kt),{px:w,py:I,pz:T}=this;let N=t.ZERO,O=t.ZERO,P=t.ZERO,z=t.mul(w,w),re=t.mul(I,I),W=t.mul(T,T),R=t.mul(w,I);return R=t.add(R,R),P=t.mul(w,T),P=t.add(P,P),N=t.mul(y,P),O=t.mul(D,W),O=t.add(N,O),N=t.sub(re,O),O=t.add(re,O),O=t.mul(N,O),N=t.mul(R,N),P=t.mul(D,P),W=t.mul(y,W),R=t.sub(z,W),R=t.mul(y,R),R=t.add(R,P),P=t.add(z,z),z=t.add(P,z),z=t.add(z,W),z=t.mul(z,R),O=t.add(O,z),W=t.mul(I,T),W=t.add(W,W),z=t.mul(W,R),N=t.sub(N,z),P=t.mul(W,re),P=t.add(P,P),P=t.add(P,P),new B(N,O,P)}add(y){E(y);const{px:$,py:D,pz:w}=this,{px:I,py:T,pz:N}=y;let O=t.ZERO,P=t.ZERO,z=t.ZERO;const re=e.a,W=t.mul(e.b,kt);let R=t.mul($,I),oe=t.mul(D,T),se=t.mul(w,N),de=t.add($,D),X=t.add(I,T);de=t.mul(de,X),X=t.add(R,oe),de=t.sub(de,X),X=t.add($,w);let ye=t.add(I,N);return X=t.mul(X,ye),ye=t.add(R,se),X=t.sub(X,ye),ye=t.add(D,w),O=t.add(T,N),ye=t.mul(ye,O),O=t.add(oe,se),ye=t.sub(ye,O),z=t.mul(re,X),O=t.mul(W,se),z=t.add(O,z),O=t.sub(oe,z),z=t.add(oe,z),P=t.mul(O,z),oe=t.add(R,R),oe=t.add(oe,R),se=t.mul(re,se),X=t.mul(W,X),oe=t.add(oe,se),se=t.sub(R,se),se=t.mul(re,se),X=t.add(X,se),R=t.mul(oe,X),P=t.add(P,R),R=t.mul(ye,X),O=t.mul(de,O),O=t.sub(O,R),R=t.mul(de,oe),z=t.mul(ye,z),z=t.add(z,R),new B(O,P,z)}subtract(y){return this.add(y.negate())}is0(){return this.equals(B.ZERO)}multiply(y){const{endo:$}=n;if(!u.isValidNot0(y))throw new Error("invalid scalar: out of range");let D,w;const I=T=>V.wNAFCached(this,T,B.normalizeZ);if($){const{k1neg:T,k1:N,k2neg:O,k2:P}=$.splitScalar(y),{p:z,f:re}=I(N),{p:W,f:R}=I(P);w=re.add(R),D=_($.beta,z,W,T,O)}else{const{p:T,f:N}=I(y);D=T,w=N}return B.normalizeZ([D,w])[0]}multiplyUnsafe(y){const{endo:$}=n,D=this;if(!u.isValid(y))throw new Error("invalid scalar: out of range");if(y===Pn||D.is0())return B.ZERO;if(y===Se)return D;if(V.hasPrecomputes(this))return this.multiply(y);if($){const{k1neg:w,k1:I,k2neg:T,k2:N}=$.splitScalar(y),{p1:O,p2:P}=Ny(B,D,I,N);return _($.beta,O,P,w,T)}else return V.wNAFCachedUnsafe(D,y)}multiplyAndAddUnsafe(y,$,D){const w=this.multiplyUnsafe($).add(y.multiplyUnsafe(D));return w.is0()?void 0:w}toAffine(y){return g(this,y)}isTorsionFree(){const{isTorsionFree:y}=n;return i===Se?!0:y?y(B,this):V.wNAFCachedUnsafe(this,r).is0()}clearCofactor(){const{clearCofactor:y}=n;return i===Se?this:y?y(B,this):this.multiplyUnsafe(i)}toBytes(y=!0){return Gu("isCompressed",y),this.assertValidity(),l(B,this,y)}toRawBytes(y=!0){return this.toBytes(y)}toHex(y=!0){return ii(this.toBytes(y))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}B.BASE=new B(e.Gx,e.Gy,t.ONE),B.ZERO=new B(t.ZERO,t.ONE,t.ZERO),B.Fp=t,B.Fn=u;const G=u.BITS,V=Fy(B,n.endo?Math.ceil(G/2):G);return B}function G4(e){return Uint8Array.of(e?2:3)}function Ry(e,n,t={}){Ku(n,{hash:"function"},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const u=n.randomBytes||p4,i=n.hmac||((D,...w)=>$4(n.hash,D,ke(...w))),{Fp:r,Fn:a}=e,{ORDER:o,BITS:s}=a;function c(D){const w=o>>Se;return D>w}function l(D){return c(D)?a.neg(D):D}function f(D,w){if(!a.isValidNot0(w))throw new Error(`invalid signature ${D}: out of range 1..CURVE.n`)}class m{constructor(w,I,T){f("r",w),f("s",I),this.r=w,this.s=I,T!=null&&(this.recovery=T),Object.freeze(this)}static fromCompact(w){const I=a.BYTES,T=le("compactSignature",w,I*2);return new m(a.fromBytes(T.subarray(0,I)),a.fromBytes(T.subarray(I,I*2)))}static fromDER(w){const{r:I,s:T}=Xe.toSig(le("DER",w));return new m(I,T)}assertValidity(){}addRecoveryBit(w){return new m(this.r,this.s,w)}recoverPublicKey(w){const I=r.ORDER,{r:T,s:N,recovery:O}=this;if(O==null||![0,1,2,3].includes(O))throw new Error("recovery id invalid");if(o*en<I&&O>1)throw new Error("recovery id is ambiguous for h>1 curve");const z=O===2||O===3?T+o:T;if(!r.isValid(z))throw new Error("recovery id 2 or 3 invalid");const re=r.toBytes(z),W=e.fromHex(ke(G4((O&1)===0),re)),R=a.inv(z),oe=k(le("msgHash",w)),se=a.create(-oe*R),de=a.create(N*R),X=e.BASE.multiplyUnsafe(se).add(W.multiplyUnsafe(de));if(X.is0())throw new Error("point at infinify");return X.assertValidity(),X}hasHighS(){return c(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,a.neg(this.s),this.recovery):this}toBytes(w){if(w==="compact")return ke(a.toBytes(this.r),a.toBytes(this.s));if(w==="der")return ls(Xe.hexFromSig(this));throw new Error("invalid format")}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return ii(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return ii(this.toBytes("compact"))}}const d=M4(a,t.allowedPrivateKeyLengths,t.wrapPrivateKey),v={isValidPrivateKey(D){try{return d(D),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const D=o;return Cy(u(P4(D)),D)},precompute(D=8,w=e.BASE){return w.precompute(D,!1)}};function h(D,w=!0){return e.fromPrivateKey(D).toBytes(w)}function b(D){if(typeof D=="bigint")return!1;if(D instanceof e)return!0;const I=le("key",D).length,T=r.BYTES,N=T+1,O=2*T+1;if(!(t.allowedPrivateKeyLengths||a.BYTES===N))return I===N||I===O}function E(D,w,I=!0){if(b(D)===!0)throw new Error("first arg must be private key");if(b(w)===!1)throw new Error("second arg must be public key");return e.fromHex(w).multiply(d(D)).toBytes(I)}const g=n.bits2int||function(D){if(D.length>8192)throw new Error("input is too large");const w=On(D),I=D.length*8-s;return I>0?w>>BigInt(I):w},k=n.bits2int_modN||function(D){return a.create(g(D))},_=Hu(s);function B(D){return y4("num < 2^"+s,D,Pn,_),a.toBytes(D)}function G(D,w,I=V){if(["recovered","canonical"].some(de=>de in I))throw new Error("sign() legacy options not supported");const{hash:T}=n;let{lowS:N,prehash:O,extraEntropy:P}=I;N==null&&(N=!0),D=le("msgHash",D),q4(I),O&&(D=le("prehashed msgHash",T(D)));const z=k(D),re=d(w),W=[B(re),B(z)];if(P!=null&&P!==!1){const de=P===!0?u(r.BYTES):P;W.push(le("extraEntropy",de))}const R=ke(...W),oe=z;function se(de){const X=g(de);if(!a.isValidNot0(X))return;const ye=a.inv(X),xt=e.BASE.multiply(X).toAffine(),Rn=a.create(xt.x);if(Rn===Pn)return;const Dn=a.create(ye*a.create(oe+Rn*re));if(Dn===Pn)return;let wr=(xt.x===Rn?0:2)|Number(xt.y&Se),jn=Dn;return N&&c(Dn)&&(jn=l(Dn),wr^=1),new m(Rn,jn,wr)}return{seed:R,k2sig:se}}const V={lowS:n.lowS,prehash:!1},F={lowS:n.lowS,prehash:!1};function y(D,w,I=V){const{seed:T,k2sig:N}=G(D,w,I);return ey(n.hash.outputLen,a.BYTES,i)(T,N)}e.BASE.precompute(8);function $(D,w,I,T=F){const N=D;w=le("msgHash",w),I=le("publicKey",I),q4(T);const{lowS:O,prehash:P,format:z}=T;if("strict"in T)throw new Error("options.strict was renamed to lowS");if(z!==void 0&&!["compact","der","js"].includes(z))throw new Error('format must be "compact", "der" or "js"');const re=typeof N=="string"||qu(N),W=!re&&!z&&typeof N=="object"&&N!==null&&typeof N.r=="bigint"&&typeof N.s=="bigint";if(!re&&!W)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let R,oe;try{if(W)if(z===void 0||z==="js")R=new m(N.r,N.s);else throw new Error("invalid format");if(re){try{z!=="compact"&&(R=m.fromDER(N))}catch(jn){if(!(jn instanceof Xe.Err))throw jn}!R&&z!=="der"&&(R=m.fromCompact(N))}oe=e.fromHex(I)}catch{return!1}if(!R||O&&R.hasHighS())return!1;P&&(w=n.hash(w));const{r:se,s:de}=R,X=k(w),ye=a.inv(de),xt=a.create(X*ye),Rn=a.create(se*ye),Dn=e.BASE.multiplyUnsafe(xt).add(oe.multiplyUnsafe(Rn));return Dn.is0()?!1:a.create(Dn.x)===se}return Object.freeze({getPublicKey:h,getSharedSecret:E,sign:y,verify:$,utils:v,Point:e,Signature:m})}function jy(e){const n={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},t=e.Fp,u=ir(n.n,e.nBitLength),i={Fp:t,Fn:u,allowedPrivateKeyLengths:e.allowedPrivateKeyLengths,allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,wrapPrivateKey:e.wrapPrivateKey,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes};return{CURVE:n,curveOpts:i}}function Ly(e){const{CURVE:n,curveOpts:t}=jy(e),u={hash:e.hash,hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:n,curveOpts:t,ecdsaOpts:u}}function Zy(e,n){return Object.assign({},n,{ProjectivePoint:n.Point,CURVE:e})}function Vy(e){const{CURVE:n,curveOpts:t,ecdsaOpts:u}=Ly(e),i=Py(n,t),r=Ry(i,u,t);return Zy(e,r)}function qy(e,n){const t=e.ORDER;let u=Pn;for(let v=t-Se;v%en===Pn;v/=en)u+=Se;const i=u,r=en<<i-Se-Se,a=r*en,o=(t-Se)/a,s=(o-Se)/en,c=a-Se,l=r,f=e.pow(n,o),m=e.pow(n,(o+Se)/en);let d=(v,h)=>{let b=f,E=e.pow(h,c),g=e.sqr(E);g=e.mul(g,h);let k=e.mul(v,g);k=e.pow(k,s),k=e.mul(k,E),E=e.mul(k,h),g=e.mul(k,v);let _=e.mul(g,E);k=e.pow(_,l);let B=e.eql(k,e.ONE);E=e.mul(g,m),k=e.mul(_,b),g=e.cmov(E,g,B),_=e.cmov(k,_,B);for(let G=i;G>Se;G--){let V=G-en;V=en<<V-Se;let F=e.pow(_,V);const y=e.eql(F,e.ONE);E=e.mul(g,b),b=e.mul(b,b),F=e.mul(_,b),g=e.cmov(E,g,y),_=e.cmov(F,_,y)}return{isValid:B,value:g}};if(e.ORDER%ys===kt){const v=(e.ORDER-kt)/ys,h=e.sqrt(e.neg(n));d=(b,E)=>{let g=e.sqr(E);const k=e.mul(b,E);g=e.mul(g,k);let _=e.pow(g,v);_=e.mul(_,k);const B=e.mul(_,h),G=e.mul(e.sqr(_),E),V=e.eql(G,b);let F=e.cmov(B,_,V);return{isValid:V,value:F}}}return d}function My(e,n){O4(e);const{A:t,B:u,Z:i}=n;if(!e.isValid(t)||!e.isValid(u)||!e.isValid(i))throw new Error("mapToCurveSimpleSWU: invalid opts");const r=qy(e,i);if(!e.isOdd)throw new Error("Field does not have .isOdd()");return a=>{let o,s,c,l,f,m,d,v;o=e.sqr(a),o=e.mul(o,i),s=e.sqr(o),s=e.add(s,o),c=e.add(s,e.ONE),c=e.mul(c,u),l=e.cmov(i,e.neg(s),!e.eql(s,e.ZERO)),l=e.mul(l,t),s=e.sqr(c),m=e.sqr(l),f=e.mul(m,t),s=e.add(s,f),s=e.mul(s,c),m=e.mul(m,l),f=e.mul(m,u),s=e.add(s,f),d=e.mul(o,c);const{isValid:h,value:b}=r(s,m);v=e.mul(o,a),v=e.mul(v,b),d=e.cmov(d,c,h),v=e.cmov(v,b,h);const E=e.isOdd(a)===e.isOdd(v);v=e.cmov(e.neg(v),v,E);const g=tr(e,[l],!0)[0];return d=e.mul(d,g),{x:d,y:v}}}function Gy(e,n){const t=u=>Vy({...e,hash:u});return{...t(n),create:t}}var Jy=On;function hn(e,n){if(si(e),si(n),e<0||e>=1<<8*n)throw new Error("invalid I2OSP input: "+e);const t=Array.from({length:n}).fill(0);for(let u=n-1;u>=0;u--)t[u]=e&255,e>>>=8;return new Uint8Array(t)}function Hy(e,n){const t=new Uint8Array(e.length);for(let u=0;u<e.length;u++)t[u]=e[u]^n[u];return t}function si(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function Ky(e,n,t,u){me(e),me(n),si(t),n.length>255&&(n=u(ke(Mu("H2C-OVERSIZE-DST-"),n)));const{outputLen:i,blockLen:r}=u,a=Math.ceil(t/i);if(t>65535||a>255)throw new Error("expand_message_xmd: invalid lenInBytes");const o=ke(n,hn(n.length,1)),s=hn(0,r),c=hn(t,2),l=new Array(a),f=u(ke(s,e,c,hn(0,1),o));l[0]=u(ke(f,hn(1,1),o));for(let d=1;d<=a;d++){const v=[Hy(f,l[d-1]),hn(d+1,1),o];l[d]=u(ke(...v))}return ke(...l).slice(0,t)}function Qy(e,n,t,u,i){if(me(e),me(n),si(t),n.length>255){const r=Math.ceil(2*u/8);n=i.create({dkLen:r}).update(Mu("H2C-OVERSIZE-DST-")).update(n).digest()}if(t>65535||n.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:t}).update(e).update(hn(t,2)).update(n).update(hn(n.length,1)).digest()}function J4(e,n,t){Ku(t,{p:"bigint",m:"number",k:"number",hash:"function"});const{p:u,k:i,m:r,hash:a,expand:o,DST:s}=t;if(!qu(s)&&typeof s!="string")throw new Error("DST must be string or uint8array");if(!ny(t.hash))throw new Error("expected valid hash");me(e),si(n);const c=typeof s=="string"?Mu(s):s,l=u.toString(2).length,f=Math.ceil((l+i)/8),m=n*r*f;let d;if(o==="xmd")d=Ky(e,c,m,a);else if(o==="xof")d=Qy(e,c,m,i,a);else if(o==="_internal_pass")d=e;else throw new Error('expand must be "xmd" or "xof"');const v=new Array(n);for(let h=0;h<n;h++){const b=new Array(r);for(let E=0;E<r;E++){const g=f*(E+h*r),k=d.subarray(g,g+f);b[E]=Ee(Jy(k),u)}v[h]=b}return v}function Wy(e,n){const t=n.map(u=>Array.from(u).reverse());return(u,i)=>{const[r,a,o,s]=t.map(f=>f.reduce((m,d)=>e.add(e.mul(m,u),d))),[c,l]=tr(e,[a,s],!0);return u=e.mul(r,c),i=e.mul(i,e.mul(o,l)),{x:u,y:i}}}function Yy(e,n,t){if(typeof n!="function")throw new Error("mapToCurve() must be defined");function u(r){return e.fromAffine(n(r))}function i(r){const a=r.clearCofactor();return a.equals(e.ZERO)?e.ZERO:(a.assertValidity(),a)}return{defaults:t,hashToCurve(r,a){const o=t.DST?t.DST:{},s=Object.assign({},t,o,a),c=J4(r,2,s),l=u(c[0]),f=u(c[1]);return i(l.add(f))},encodeToCurve(r,a){const o=t.encodeDST?t.encodeDST:{},s=Object.assign({},t,o,a),c=J4(r,1,s);return i(u(c[0]))},mapToCurve(r){if(!Array.isArray(r))throw new Error("expected array of bigints");for(const a of r)if(typeof a!="bigint")throw new Error("expected array of bigints");return i(u(r))}}}var nn={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},H4=BigInt(0),ur=BigInt(1),rr=BigInt(2),K4=(e,n)=>(e+n/rr)/n;function Q4(e){const n=nn.p,t=BigInt(3),u=BigInt(6),i=BigInt(11),r=BigInt(22),a=BigInt(23),o=BigInt(44),s=BigInt(88),c=e*e*e%n,l=c*c*e%n,f=Ne(l,t,n)*l%n,m=Ne(f,t,n)*l%n,d=Ne(m,rr,n)*c%n,v=Ne(d,i,n)*d%n,h=Ne(v,r,n)*v%n,b=Ne(h,o,n)*h%n,E=Ne(b,s,n)*b%n,g=Ne(E,o,n)*h%n,k=Ne(g,t,n)*l%n,_=Ne(k,a,n)*v%n,B=Ne(_,u,n)*c%n,G=Ne(B,rr,n);if(!gn.eql(gn.sqr(G),e))throw new Error("Cannot find square root");return G}var gn=ir(nn.p,void 0,void 0,{sqrt:Q4}),ar=Gy({...nn,Fp:gn,lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const n=nn.n,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),u=-ur*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),r=t,a=BigInt("0x100000000000000000000000000000000"),o=K4(r*e,n),s=K4(-u*e,n);let c=Ee(e-o*t-s*i,n),l=Ee(-o*u-s*r,n);const f=c>a,m=l>a;if(f&&(c=n-c),m&&(l=n-l),c>a||l>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:c,k2neg:m,k2:l}}}},nr),W4={};function or(e,...n){let t=W4[e];if(t===void 0){const u=nr(Uint8Array.from(e,i=>i.charCodeAt(0)));t=ke(u,u),W4[e]=t}return nr(ke(t,...n))}var bs=e=>e.toBytes(!0).slice(1),ks=e=>ri(e,32),Ds=e=>Ee(e,nn.p),ci=e=>Ee(e,nn.n),Ss=ar.Point,Bs=e=>e%rr===H4;function ws(e){let n=ar.utils.normPrivateKeyToScalar(e),t=Ss.fromPrivateKey(n);return{scalar:Bs(t.y)?n:ci(-n),bytes:bs(t)}}function Y4(e){y4("x",e,ur,nn.p);const n=Ds(e*e),t=Ds(n*e+BigInt(7));let u=Q4(t);Bs(u)||(u=Ds(-u));const i=Ss.fromAffine({x:e,y:u});return i.assertValidity(),i}var Dt=On;function X4(...e){return ci(Dt(or("BIP0340/challenge",...e)))}function Xy(e){return ws(e).bytes}function eb(e,n,t=p4(32)){const u=le("message",e),{bytes:i,scalar:r}=ws(n),a=le("auxRand",t,32),o=ks(r^Dt(or("BIP0340/aux",a))),s=or("BIP0340/nonce",o,i,u),c=ci(Dt(s));if(c===H4)throw new Error("sign failed: k is zero");const{bytes:l,scalar:f}=ws(c),m=X4(l,i,u),d=new Uint8Array(64);if(d.set(l,0),d.set(ks(ci(f+m*r)),32),!ev(d,u,i))throw new Error("sign: Invalid signature produced");return d}function ev(e,n,t){const u=le("signature",e,64),i=le("message",n),r=le("publicKey",t,32);try{const a=Y4(Dt(r)),o=Dt(u.subarray(0,32));if(!ps(o,ur,nn.p))return!1;const s=Dt(u.subarray(32,64));if(!ps(s,ur,nn.n))return!1;const c=X4(ks(o),bs(a),i),l=Ss.BASE.multiplyUnsafe(s).add(a.multiplyUnsafe(ci(-c))),{x:f,y:m}=l.toAffine();return!(l.is0()||!Bs(m)||f!==o)}catch{return!1}}({getPublicKey:Xy,sign:eb,verify:ev,utils:{randomPrivateKey:ar.utils.randomPrivateKey,lift_x:Y4,pointToBytes:bs,numberToBytesBE:ri,bytesToNumberBE:On,taggedHash:or,mod:Ee}});var nb=Wy(gn,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(n=>BigInt(n)))),tb=My(gn,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:gn.create(BigInt("-11"))});Yy(ar.Point,e=>{const{x:n,y:t}=tb(gn.create(e[0]));return nb(n,t)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:gn.ORDER,m:1,k:128,expand:"xmd",hash:nr});/*! Bundled license information:
471
471
 
472
472
  @noble/curves/esm/abstract/modular.js:
473
473
  @noble/curves/esm/abstract/curve.js:
@@ -475,10 +475,10 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
475
475
  @noble/curves/esm/_shortw_utils.js:
476
476
  @noble/curves/esm/secp256k1.js:
477
477
  (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
478
- */var tb="0.1.1";function ib(){return tb}var Te=class Hs extends Error{constructor(n,t={}){const u=(()=>{if(t.cause instanceof Hs){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause&&"details"in t.cause&&typeof t.cause.details=="string"?t.cause.details:t.cause?.message?t.cause.message:t.details})(),i=t.cause instanceof Hs&&t.cause.docsPath||t.docsPath,a=`https://oxlib.sh${i??""}`,o=[n||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...u||i?["",u?`Details: ${u}`:void 0,i?`See: ${a}`:void 0]:[]].filter(s=>typeof s=="string").join(`
479
- `);super(o,t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${ib()}`}),this.cause=t.cause,this.details=u,this.docs=a,this.docsPath=i,this.shortMessage=n}walk(n){return nv(this,n)}};function nv(e,n){return n?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?nv(e.cause,n):n?null:e}function ub(e,n){if(uv(e)>n)throw new fb({givenSize:uv(e),maxSize:n})}var tn={zero:48,nine:57,A:65,F:70,a:97,f:102};function tv(e){if(e>=tn.zero&&e<=tn.nine)return e-tn.zero;if(e>=tn.A&&e<=tn.F)return e-(tn.A-10);if(e>=tn.a&&e<=tn.f)return e-(tn.a-10)}function rb(e,n={}){const{dir:t,size:u=32}=n;if(u===0)return e;if(e.length>u)throw new mb({size:e.length,targetSize:u,type:"Bytes"});const i=new Uint8Array(u);for(let r=0;r<u;r++){const a=t==="right";i[a?r:u-r-1]=e[a?r:e.length-r-1]}return i}function As(e,n){if(Cs(e)>n)throw new bb({givenSize:Cs(e),maxSize:n})}function iv(e,n={}){const{dir:t,size:u=32}=n;if(u===0)return e;const i=e.replace("0x","");if(i.length>u*2)throw new kb({size:Math.ceil(i.length/2),targetSize:u,type:"Hex"});return`0x${i[t==="right"?"padEnd":"padStart"](u*2,"0")}`}new TextDecoder;var ab=new TextEncoder;function ob(e){return e instanceof Uint8Array?e:typeof e=="string"?cb(e):sb(e)}function sb(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function cb(e,n={}){const{size:t}=n;let u=e;t&&(As(e,t),u=_s(e,t));let i=u.slice(2);i.length%2&&(i=`0${i}`);const r=i.length/2,a=new Uint8Array(r);for(let o=0,s=0;o<r;o++){const c=tv(i.charCodeAt(s++)),l=tv(i.charCodeAt(s++));if(c===void 0||l===void 0)throw new Te(`Invalid byte sequence ("${i[s-2]}${i[s-1]}" in "${i}").`);a[o]=c*16+l}return a}function lb(e,n={}){const{size:t}=n,u=ab.encode(e);return typeof t=="number"?(ub(u,t),db(u,t)):u}function db(e,n){return rb(e,{dir:"right",size:n})}function uv(e){return e.length}var fb=class extends Te{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},mb=class extends Te{constructor({size:e,targetSize:n,type:t}){super(`${t.charAt(0).toUpperCase()}${t.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}},vb=new TextEncoder,pb=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function rv(...e){return`0x${e.reduce((n,t)=>n+t.replace("0x",""),"")}`}function hb(e,n={}){const t=`0x${Number(e)}`;return typeof n.size=="number"?(As(t,n.size),sr(t,n.size)):t}function av(e,n={}){let t="";for(let i=0;i<e.length;i++)t+=pb[e[i]];const u=`0x${t}`;return typeof n.size=="number"?(As(u,n.size),_s(u,n.size)):u}function gb(e,n={}){const{signed:t,size:u}=n,i=BigInt(e);let r;u?t?r=(1n<<BigInt(u)*8n-1n)-1n:r=2n**(BigInt(u)*8n)-1n:typeof e=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof r=="bigint"&&t?-r-1n:0;if(r&&i>r||i<a){const c=typeof e=="bigint"?"n":"";throw new yb({max:r?`${r}${c}`:void 0,min:`${a}${c}`,signed:t,size:u,value:`${e}${c}`})}const s=`0x${(t&&i<0?(1n<<BigInt(u*8))+BigInt(i):i).toString(16)}`;return u?sr(s,u):s}function Eb(e,n={}){return av(vb.encode(e),n)}function sr(e,n){return iv(e,{dir:"left",size:n})}function _s(e,n){return iv(e,{dir:"right",size:n})}function Cs(e){return Math.ceil((e.length-2)/2)}var yb=class extends Te{constructor({max:e,min:n,signed:t,size:u,value:i}){super(`Number \`${i}\` is not in safe${u?` ${u*8}-bit`:""}${t?" signed":" unsigned"} integer range ${e?`(\`${n}\` to \`${e}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}},bb=class extends Te{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}},kb=class extends Te{constructor({size:e,targetSize:n,type:t}){super(`${t.charAt(0).toUpperCase()}${t.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}},ov="2.31.7",$s={getDocsUrl:({docsBaseUrl:e,docsPath:n="",docsSlug:t})=>n?`${e??"https://viem.sh"}${n}${t?`#${t}`:""}`:void 0,version:`viem@${ov}`},cr=class Ks extends Error{constructor(n,t={}){const u=t.cause instanceof Ks?t.cause.details:t.cause?.message?t.cause.message:t.details,i=t.cause instanceof Ks&&t.cause.docsPath||t.docsPath,r=$s.getDocsUrl?.({...t,docsPath:i}),a=[n||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: ${r}`]:[],...u?[`Details: ${u}`]:[],...$s.version?[`Version: ${$s.version}`]:[]].join(`
480
- `);super(a,t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=u,this.docsPath=i,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=n,this.version=ov}walk(n){return sv(this,n)}};function sv(e,n){return n?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?sv(e.cause,n):n?null:e}function xs(e,{strict:n=!0}={}){return!e||typeof e!="string"?!1:n?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function cv(e){return xs(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var lv=class extends cr{constructor({size:e,targetSize:n,type:t}){super(`${t.charAt(0).toUpperCase()}${t.slice(1).toLowerCase()} size (${e}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};function lr(e,{dir:n,size:t=32}={}){return typeof e=="string"?Db(e,{dir:n,size:t}):Sb(e,{dir:n,size:t})}function Db(e,{dir:n,size:t=32}={}){if(t===null)return e;const u=e.replace("0x","");if(u.length>t*2)throw new lv({size:Math.ceil(u.length/2),targetSize:t,type:"hex"});return`0x${u[n==="right"?"padEnd":"padStart"](t*2,"0")}`}function Sb(e,{dir:n,size:t=32}={}){if(t===null)return e;if(e.length>t)throw new lv({size:e.length,targetSize:t,type:"bytes"});const u=new Uint8Array(t);for(let i=0;i<t;i++){const r=n==="right";u[r?i:t-i-1]=e[r?i:e.length-i-1]}return u}var Bb=class extends cr{constructor({max:e,min:n,signed:t,size:u,value:i}){super(`Number "${i}" is not in safe ${u?`${u*8}-bit ${t?"signed":"unsigned"} `:""}integer range ${e?`(${n} to ${e})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},wb=class extends cr{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}};function dr(e,{size:n}){if(cv(e)>n)throw new wb({givenSize:cv(e),maxSize:n})}function Ab(e,n={}){const{signed:t}=n;n.size&&dr(e,{size:n.size});const u=BigInt(e);if(!t)return u;const i=(e.length-2)/2,r=(1n<<BigInt(i)*8n-1n)-1n;return u<=r?u:u-BigInt(`0x${"f".padStart(i*2,"f")}`)-1n}function _b(e,n={}){return Number(Ab(e,n))}Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function Is(e,n={}){const{signed:t,size:u}=n,i=BigInt(e);let r;u?t?r=(1n<<BigInt(u)*8n-1n)-1n:r=2n**(BigInt(u)*8n)-1n:typeof e=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof r=="bigint"&&t?-r-1n:0;if(r&&i>r||i<a){const s=typeof e=="bigint"?"n":"";throw new Bb({max:r?`${r}${s}`:void 0,min:`${a}${s}`,signed:t,size:u,value:`${e}${s}`})}const o=`0x${(t&&i<0?(1n<<BigInt(u*8))+BigInt(i):i).toString(16)}`;return u?lr(o,{size:u}):o}new TextEncoder;var Cb=new TextEncoder;function $b(e,n={}){return typeof e=="number"||typeof e=="bigint"?Ib(e,n):typeof e=="boolean"?xb(e,n):xs(e)?fv(e,n):mv(e,n)}function xb(e,n={}){const t=new Uint8Array(1);return t[0]=Number(e),typeof n.size=="number"?(dr(t,{size:n.size}),lr(t,{size:n.size})):t}var un={zero:48,nine:57,A:65,F:70,a:97,f:102};function dv(e){if(e>=un.zero&&e<=un.nine)return e-un.zero;if(e>=un.A&&e<=un.F)return e-(un.A-10);if(e>=un.a&&e<=un.f)return e-(un.a-10)}function fv(e,n={}){let t=e;n.size&&(dr(t,{size:n.size}),t=lr(t,{dir:"right",size:n.size}));let u=t.slice(2);u.length%2&&(u=`0${u}`);const i=u.length/2,r=new Uint8Array(i);for(let a=0,o=0;a<i;a++){const s=dv(u.charCodeAt(o++)),c=dv(u.charCodeAt(o++));if(s===void 0||c===void 0)throw new cr(`Invalid byte sequence ("${u[o-2]}${u[o-1]}" in "${u}").`);r[a]=s*16+c}return r}function Ib(e,n){const t=Is(e,n);return fv(t)}function mv(e,n={}){const t=Cb.encode(e);return typeof n.size=="number"?(dr(t,{size:n.size}),lr(t,{dir:"right",size:n.size})):t}var Fb=BigInt(0),li=BigInt(1),Nb=BigInt(2),Tb=BigInt(7),Ob=BigInt(256),zb=BigInt(113),vv=[],pv=[],hv=[];for(let e=0,n=li,t=1,u=0;e<24;e++){[t,u]=[u,(2*t+3*u)%5],vv.push(2*(5*u+t)),pv.push((e+1)*(e+2)/2%64);let i=Fb;for(let r=0;r<7;r++)n=(n<<li^(n>>Tb)*zb)%Ob,n&Nb&&(i^=li<<(li<<BigInt(r))-li);hv.push(i)}var gv=D4(hv,!0),Ub=gv[0],Pb=gv[1],Ev=(e,n,t)=>t>32?uy(e,n,t):ty(e,n,t),yv=(e,n,t)=>t>32?ry(e,n,t):iy(e,n,t);function Rb(e,n=24){const t=new Uint32Array(10);for(let u=24-n;u<24;u++){for(let a=0;a<10;a++)t[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const o=(a+8)%10,s=(a+2)%10,c=t[s],l=t[s+1],f=Ev(c,l,1)^t[o],m=yv(c,l,1)^t[o+1];for(let d=0;d<50;d+=10)e[a+d]^=f,e[a+d+1]^=m}let i=e[2],r=e[3];for(let a=0;a<24;a++){const o=pv[a],s=Ev(i,r,o),c=yv(i,r,o),l=vv[a];i=e[l],r=e[l+1],e[l]=s,e[l+1]=c}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)t[o]=e[a+o];for(let o=0;o<10;o++)e[a+o]^=~t[(o+2)%10]&t[(o+4)%10]}e[0]^=Ub[u],e[1]^=Pb[u]}we(t)}var bv=class ap extends ds{constructor(n,t,u,i=!1,r=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=n,this.suffix=t,this.outputLen=u,this.enableXOF=i,this.rounds=r,ti(u),!(0<n&&n<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=GE(this.state)}clone(){return this._cloneInto()}keccak(){f4(this.state32),Rb(this.state32,this.rounds),f4(this.state32),this.posOut=0,this.pos=0}update(n){gt(this),n=ui(n),me(n);const{blockLen:t,state:u}=this,i=n.length;for(let r=0;r<i;){const a=Math.min(t-this.pos,i-r);for(let o=0;o<a;o++)u[this.pos++]^=n[r++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:n,suffix:t,pos:u,blockLen:i}=this;n[u]^=t,(t&128)!==0&&u===i-1&&this.keccak(),n[i-1]^=128,this.keccak()}writeInto(n){gt(this,!1),me(n),this.finish();const t=this.state,{blockLen:u}=this;for(let i=0,r=n.length;i<r;){this.posOut>=u&&this.keccak();const a=Math.min(u-this.posOut,r-i);n.set(t.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return n}xofInto(n){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(n)}xof(n){return ti(n),this.xofInto(new Uint8Array(n))}digestInto(n){if(d4(n,this),this.finished)throw new Error("digest() was already called");return this.writeInto(n),this.destroy(),n}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,we(this.state)}_cloneInto(n){const{blockLen:t,suffix:u,outputLen:i,rounds:r,enableXOF:a}=this;return n||(n=new ap(t,u,i,a,r)),n.state32.set(this.state32),n.pos=this.pos,n.posOut=this.posOut,n.finished=this.finished,n.rounds=r,n.suffix=u,n.outputLen=i,n.enableXOF=a,n.destroyed=this.destroyed,n}},En=(e,n,t)=>Je(()=>new bv(n,e,t));En(6,144,224/8),En(6,136,256/8),En(6,104,384/8),En(6,72,512/8),En(1,144,224/8);var kv=En(1,136,256/8);En(1,104,384/8),En(1,72,512/8);var Dv=(e,n,t)=>WE((u={})=>new bv(n,e,u.dkLen===void 0?t:u.dkLen,!0));Dv(31,168,128/8),Dv(31,136,256/8);function jb(e,n){return kv(xs(e,{strict:!1})?$b(e):e)}var di=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const t=this.keys().next().value;t&&this.delete(t)}return this}},Lb=/^0x[a-fA-F0-9]{40}$/,Fs=new di(8192);function Zb(e,n){const{strict:t=!0}={},u=`${e}.${t}`;if(Fs.has(u))return Fs.get(u);const i=Lb.test(e)?e.toLowerCase()===e?!0:t?Vb(e)===e:!0:!1;return Fs.set(u,i),i}var Ns=new di(8192);function Vb(e,n){if(Ns.has(`${e}.${n}`))return Ns.get(`${e}.${n}`);const t=e.substring(2).toLowerCase(),u=jb(mv(t)),i=t.split("");for(let a=0;a<40;a+=2)u[a>>1]>>4>=8&&i[a]&&(i[a]=i[a].toUpperCase()),(u[a>>1]&15)>=8&&i[a+1]&&(i[a+1]=i[a+1].toUpperCase());const r=`0x${i.join("")}`;return Ns.set(`${e}.${n}`,r),r}async function qb(e,{address:n,blockTag:t="latest",blockNumber:u}){const i=await e.request({method:"eth_getTransactionCount",params:[n,typeof u=="bigint"?Is(u):t]},{dedupe:!!u});return _b(i)}new di(128),Is(0,{size:32}),new di(8192);var St=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),yn=new Uint32Array(80),Mb=class extends ai{constructor(){super(64,20,8,!1),this.A=St[0]|0,this.B=St[1]|0,this.C=St[2]|0,this.D=St[3]|0,this.E=St[4]|0}get(){const{A:e,B:n,C:t,D:u,E:i}=this;return[e,n,t,u,i]}set(e,n,t,u,i){this.A=e|0,this.B=n|0,this.C=t|0,this.D=u|0,this.E=i|0}process(e,n){for(let o=0;o<16;o++,n+=4)yn[o]=e.getUint32(n,!1);for(let o=16;o<80;o++)yn[o]=ln(yn[o-3]^yn[o-8]^yn[o-14]^yn[o-16],1);let{A:t,B:u,C:i,D:r,E:a}=this;for(let o=0;o<80;o++){let s,c;o<20?(s=Xu(u,i,r),c=1518500249):o<40?(s=u^i^r,c=1859775393):o<60?(s=w4(u,i,r),c=2400959708):(s=u^i^r,c=3395469782);const l=ln(t,5)+s+a+c+yn[o]|0;a=r,r=i,i=ln(u,30),u=t,t=l}t=t+this.A|0,u=u+this.B|0,i=i+this.C|0,r=r+this.D|0,a=a+this.E|0,this.set(t,u,i,r,a)}roundClean(){we(yn)}destroy(){this.set(0,0,0,0,0),we(this.buffer)}};Je(()=>new Mb);var Gb=Math.pow(2,32),Jb=Array.from({length:64},(e,n)=>Math.floor(Gb*Math.abs(Math.sin(n+1)))),fr=St.slice(0,4),Ts=new Uint32Array(16),Hb=class extends ai{constructor(){super(64,16,8,!0),this.A=fr[0]|0,this.B=fr[1]|0,this.C=fr[2]|0,this.D=fr[3]|0}get(){const{A:e,B:n,C:t,D:u}=this;return[e,n,t,u]}set(e,n,t,u){this.A=e|0,this.B=n|0,this.C=t|0,this.D=u|0}process(e,n){for(let a=0;a<16;a++,n+=4)Ts[a]=e.getUint32(n,!0);let{A:t,B:u,C:i,D:r}=this;for(let a=0;a<64;a++){let o,s,c;a<16?(o=Xu(u,i,r),s=a,c=[7,12,17,22]):a<32?(o=Xu(r,u,i),s=(5*a+1)%16,c=[5,9,14,20]):a<48?(o=u^i^r,s=(3*a+5)%16,c=[4,11,16,23]):(o=i^(u|~r),s=7*a%16,c=[6,10,15,21]),o=o+t+Jb[a]+Ts[s],t=r,r=i,i=u,u=u+ln(o,c[a%4])}t=t+this.A|0,u=u+this.B|0,i=i+this.C|0,r=r+this.D|0,this.set(t,u,i,r)}roundClean(){we(Ts)}destroy(){this.set(0,0,0,0),we(this.buffer)}};Je(()=>new Hb);var Kb=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Sv=Uint8Array.from(new Array(16).fill(0).map((e,n)=>n)),Qb=Sv.map(e=>(9*e+5)%16),Bv=(()=>{const t=[[Sv],[Qb]];for(let u=0;u<4;u++)for(let i of t)i.push(i[u].map(r=>Kb[r]));return t})(),wv=Bv[0],Av=Bv[1],_v=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>Uint8Array.from(e)),Wb=wv.map((e,n)=>e.map(t=>_v[n][t])),Yb=Av.map((e,n)=>e.map(t=>_v[n][t])),Xb=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),ek=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function Cv(e,n,t,u){return e===0?n^t^u:e===1?n&t|~n&u:e===2?(n|~t)^u:e===3?n&u|t&~u:n^(t|~u)}var mr=new Uint32Array(16),nk=class extends ai{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:n,h2:t,h3:u,h4:i}=this;return[e,n,t,u,i]}set(e,n,t,u,i){this.h0=e|0,this.h1=n|0,this.h2=t|0,this.h3=u|0,this.h4=i|0}process(e,n){for(let m=0;m<16;m++,n+=4)mr[m]=e.getUint32(n,!0);let t=this.h0|0,u=t,i=this.h1|0,r=i,a=this.h2|0,o=a,s=this.h3|0,c=s,l=this.h4|0,f=l;for(let m=0;m<5;m++){const d=4-m,v=Xb[m],h=ek[m],b=wv[m],E=Av[m],g=Wb[m],k=Yb[m];for(let _=0;_<16;_++){const B=ln(t+Cv(m,i,a,s)+mr[b[_]]+v,g[_])+l|0;t=l,l=s,s=ln(a,10)|0,a=i,i=B}for(let _=0;_<16;_++){const B=ln(u+Cv(d,r,o,c)+mr[E[_]]+h,k[_])+f|0;u=f,f=c,c=ln(o,10)|0,o=r,r=B}}this.set(this.h1+a+c|0,this.h2+s+f|0,this.h3+l+u|0,this.h4+t+r|0,this.h0+i+o|0)}roundClean(){we(mr)}destroy(){this.destroyed=!0,we(this.buffer),this.set(0,0,0,0,0)}};Je(()=>new nk);function tk(e){const{source:n}=e,t=new Map,u=new di(8192),i=new Map,r=({address:a,chainId:o})=>`${a}.${o}`;return{async consume({address:a,chainId:o,client:s}){const c=r({address:a,chainId:o}),l=this.get({address:a,chainId:o,client:s});this.increment({address:a,chainId:o});const f=await l;return await n.set({address:a,chainId:o},f),u.set(c,f),f},async increment({address:a,chainId:o}){const s=r({address:a,chainId:o}),c=t.get(s)??0;t.set(s,c+1)},async get({address:a,chainId:o,client:s}){const c=r({address:a,chainId:o});let l=i.get(c);return l||(l=(async()=>{try{const m=await n.get({address:a,chainId:o,client:s}),d=u.get(c)??0;return d>0&&m<=d?d+1:(u.delete(c),m)}finally{this.reset({address:a,chainId:o})}})(),i.set(c,l)),(t.get(c)??0)+await l},reset({address:a,chainId:o}){const s=r({address:a,chainId:o});t.delete(s),i.delete(s)}}}function ik(){return{async get(e){const{address:n,client:t}=e;return qb(t,{address:n,blockTag:"pending"})},set(){}}}tk({source:ik()});function uk(e,n={}){const{as:t=typeof e=="string"?"Hex":"Bytes"}=n,u=kv(ob(e));return t==="Bytes"?u:av(u)}var rk=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const t=this.keys().next().value;t&&this.delete(t)}return this}},ak={checksum:new rk(8192)},Os=ak.checksum,ok=/^0x[a-fA-F0-9]{40}$/;function $v(e,n={}){const{strict:t=!0}=n;if(!ok.test(e))throw new xv({address:e,cause:new ck});if(t){if(e.toLowerCase()===e)return;if(sk(e)!==e)throw new xv({address:e,cause:new lk})}}function sk(e){if(Os.has(e))return Os.get(e);$v(e,{strict:!1});const n=e.substring(2).toLowerCase(),t=uk(lb(n),{as:"Bytes"}),u=n.split("");for(let r=0;r<40;r+=2)t[r>>1]>>4>=8&&u[r]&&(u[r]=u[r].toUpperCase()),(t[r>>1]&15)>=8&&u[r+1]&&(u[r+1]=u[r+1].toUpperCase());const i=`0x${u.join("")}`;return Os.set(e,i),i}var xv=class extends Te{constructor({address:e,cause:n}){super(`Address "${e}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}},ck=class extends Te{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}},lk=class extends Te{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}},dk=/^(.*)\[([0-9]*)\]$/,fk=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,mk=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function zs(e,n){if(e.length!==n.length)throw new pk({expectedLength:e.length,givenLength:n.length});const t=[];for(let u=0;u<e.length;u++){const i=e[u],r=n[u];t.push(zs.encode(i,r))}return rv(...t)}(function(e){function n(t,u,i=!1){if(t==="address"){const s=u;return $v(s),sr(s.toLowerCase(),i?32:0)}if(t==="string")return Eb(u);if(t==="bytes")return u;if(t==="bool")return sr(hb(u),i?32:1);const r=t.match(mk);if(r){const[s,c,l="256"]=r,f=Number.parseInt(l)/8;return gb(u,{size:i?32:f,signed:c==="int"})}const a=t.match(fk);if(a){const[s,c]=a;if(Number.parseInt(c)!==(u.length-2)/2)throw new vk({expectedSize:Number.parseInt(c),value:u});return _s(u,i?32:0)}const o=t.match(dk);if(o&&Array.isArray(u)){const[s,c]=o,l=[];for(let f=0;f<u.length;f++)l.push(n(c,u[f],!0));return l.length===0?"0x":rv(...l)}throw new hk(t)}e.encode=n})(zs||(zs={}));var vk=class extends Te{constructor({expectedSize:e,value:n}){super(`Size of bytes "${n}" (bytes${Cs(n)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}},pk=class extends Te{constructor({expectedLength:e,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${e}`,`Given length (values): ${n}`].join(`
481
- `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}},hk=class extends Te{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}};function gk(e){if(!/^0[xX][0-9a-fA-F]{40}$/.test(e))return!1;const n="0x"+e.slice(2),t=n.slice(2);return t===t.toLowerCase()||t===t.toUpperCase()?!0:Zb(n)}function Iv(e){try{return new op(e),!0}catch{return!1}}const Fv=e=>Math.round((e+Number.EPSILON)*100)/100;function Ek(e){const n=e.replace(/^data:\w+\/\w+;base64,/,""),t=Buffer.from(n,"base64");return new Uint8Array(t)}class yk{client;constructor(n){this.client=n}async create(n){return(await this.client.query({query:pt,variables:{createDirectPaymentInput:{...n,amount:n.amount}}}))?.createDirectPayment}async getWeb3PaymentParams(n){if(!gk(n.paymentTokenAddress))throw new Error("Invalid token address");return(await this.client.query({query:Zu,variables:{amount:Fv(n.paymentRequest.amountDue),network:n.paymentRequest.network,tokenAddress:n.paymentTokenAddress,reference:n.paymentRequest.id}}))?.spritzPayParams}async getSolanaPaymentParams(n){if(!Iv(n.paymentTokenAddress))throw new Error(`Invalid token address: ${n.paymentTokenAddress}`);if(!Iv(n.signer))throw new Error(`Invalid signer: ${n.signer}`);const t=await this.client.query({query:ju,variables:{amount:Fv(n.paymentRequest.amountDue),tokenAddress:n.paymentTokenAddress,reference:n.paymentRequest.id,signer:n.signer}});return{versionedTransaction:sp.deserialize(Ek(t?.solanaParams?.transactionSerialized??"")),transactionSerialized:t?.solanaParams?.transactionSerialized}}}var Bt={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"VerificationFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Verification"}},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:"canRetry"},arguments:[],directives:[]},{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:"verificationMetadata"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"failureReason"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"details"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"matchedEmail"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:286}};Bt.loc.source={body:`fragment VerificationFragment on Verification {
478
+ */var ib="0.1.1";function ub(){return ib}var Te=class Hs extends Error{constructor(n,t={}){const u=(()=>{if(t.cause instanceof Hs){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause&&"details"in t.cause&&typeof t.cause.details=="string"?t.cause.details:t.cause?.message?t.cause.message:t.details})(),i=t.cause instanceof Hs&&t.cause.docsPath||t.docsPath,a=`https://oxlib.sh${i??""}`,o=[n||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...u||i?["",u?`Details: ${u}`:void 0,i?`See: ${a}`:void 0]:[]].filter(s=>typeof s=="string").join(`
479
+ `);super(o,t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${ub()}`}),this.cause=t.cause,this.details=u,this.docs=a,this.docsPath=i,this.shortMessage=n}walk(n){return nv(this,n)}};function nv(e,n){return n?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?nv(e.cause,n):n?null:e}function rb(e,n){if(uv(e)>n)throw new mb({givenSize:uv(e),maxSize:n})}var tn={zero:48,nine:57,A:65,F:70,a:97,f:102};function tv(e){if(e>=tn.zero&&e<=tn.nine)return e-tn.zero;if(e>=tn.A&&e<=tn.F)return e-(tn.A-10);if(e>=tn.a&&e<=tn.f)return e-(tn.a-10)}function ab(e,n={}){const{dir:t,size:u=32}=n;if(u===0)return e;if(e.length>u)throw new vb({size:e.length,targetSize:u,type:"Bytes"});const i=new Uint8Array(u);for(let r=0;r<u;r++){const a=t==="right";i[a?r:u-r-1]=e[a?r:e.length-r-1]}return i}function As(e,n){if(Cs(e)>n)throw new kb({givenSize:Cs(e),maxSize:n})}function iv(e,n={}){const{dir:t,size:u=32}=n;if(u===0)return e;const i=e.replace("0x","");if(i.length>u*2)throw new Db({size:Math.ceil(i.length/2),targetSize:u,type:"Hex"});return`0x${i[t==="right"?"padEnd":"padStart"](u*2,"0")}`}new TextDecoder;var ob=new TextEncoder;function sb(e){return e instanceof Uint8Array?e:typeof e=="string"?lb(e):cb(e)}function cb(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function lb(e,n={}){const{size:t}=n;let u=e;t&&(As(e,t),u=_s(e,t));let i=u.slice(2);i.length%2&&(i=`0${i}`);const r=i.length/2,a=new Uint8Array(r);for(let o=0,s=0;o<r;o++){const c=tv(i.charCodeAt(s++)),l=tv(i.charCodeAt(s++));if(c===void 0||l===void 0)throw new Te(`Invalid byte sequence ("${i[s-2]}${i[s-1]}" in "${i}").`);a[o]=c*16+l}return a}function db(e,n={}){const{size:t}=n,u=ob.encode(e);return typeof t=="number"?(rb(u,t),fb(u,t)):u}function fb(e,n){return ab(e,{dir:"right",size:n})}function uv(e){return e.length}var mb=class extends Te{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},vb=class extends Te{constructor({size:e,targetSize:n,type:t}){super(`${t.charAt(0).toUpperCase()}${t.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}},pb=new TextEncoder,hb=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function rv(...e){return`0x${e.reduce((n,t)=>n+t.replace("0x",""),"")}`}function gb(e,n={}){const t=`0x${Number(e)}`;return typeof n.size=="number"?(As(t,n.size),sr(t,n.size)):t}function av(e,n={}){let t="";for(let i=0;i<e.length;i++)t+=hb[e[i]];const u=`0x${t}`;return typeof n.size=="number"?(As(u,n.size),_s(u,n.size)):u}function Eb(e,n={}){const{signed:t,size:u}=n,i=BigInt(e);let r;u?t?r=(1n<<BigInt(u)*8n-1n)-1n:r=2n**(BigInt(u)*8n)-1n:typeof e=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof r=="bigint"&&t?-r-1n:0;if(r&&i>r||i<a){const c=typeof e=="bigint"?"n":"";throw new bb({max:r?`${r}${c}`:void 0,min:`${a}${c}`,signed:t,size:u,value:`${e}${c}`})}const s=`0x${(t&&i<0?(1n<<BigInt(u*8))+BigInt(i):i).toString(16)}`;return u?sr(s,u):s}function yb(e,n={}){return av(pb.encode(e),n)}function sr(e,n){return iv(e,{dir:"left",size:n})}function _s(e,n){return iv(e,{dir:"right",size:n})}function Cs(e){return Math.ceil((e.length-2)/2)}var bb=class extends Te{constructor({max:e,min:n,signed:t,size:u,value:i}){super(`Number \`${i}\` is not in safe${u?` ${u*8}-bit`:""}${t?" signed":" unsigned"} integer range ${e?`(\`${n}\` to \`${e}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}},kb=class extends Te{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}},Db=class extends Te{constructor({size:e,targetSize:n,type:t}){super(`${t.charAt(0).toUpperCase()}${t.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}},ov="2.31.7",$s={getDocsUrl:({docsBaseUrl:e,docsPath:n="",docsSlug:t})=>n?`${e??"https://viem.sh"}${n}${t?`#${t}`:""}`:void 0,version:`viem@${ov}`},cr=class Ks extends Error{constructor(n,t={}){const u=t.cause instanceof Ks?t.cause.details:t.cause?.message?t.cause.message:t.details,i=t.cause instanceof Ks&&t.cause.docsPath||t.docsPath,r=$s.getDocsUrl?.({...t,docsPath:i}),a=[n||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: ${r}`]:[],...u?[`Details: ${u}`]:[],...$s.version?[`Version: ${$s.version}`]:[]].join(`
480
+ `);super(a,t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=u,this.docsPath=i,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=n,this.version=ov}walk(n){return sv(this,n)}};function sv(e,n){return n?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?sv(e.cause,n):n?null:e}function xs(e,{strict:n=!0}={}){return!e||typeof e!="string"?!1:n?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function cv(e){return xs(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var lv=class extends cr{constructor({size:e,targetSize:n,type:t}){super(`${t.charAt(0).toUpperCase()}${t.slice(1).toLowerCase()} size (${e}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};function lr(e,{dir:n,size:t=32}={}){return typeof e=="string"?Sb(e,{dir:n,size:t}):Bb(e,{dir:n,size:t})}function Sb(e,{dir:n,size:t=32}={}){if(t===null)return e;const u=e.replace("0x","");if(u.length>t*2)throw new lv({size:Math.ceil(u.length/2),targetSize:t,type:"hex"});return`0x${u[n==="right"?"padEnd":"padStart"](t*2,"0")}`}function Bb(e,{dir:n,size:t=32}={}){if(t===null)return e;if(e.length>t)throw new lv({size:e.length,targetSize:t,type:"bytes"});const u=new Uint8Array(t);for(let i=0;i<t;i++){const r=n==="right";u[r?i:t-i-1]=e[r?i:e.length-i-1]}return u}var wb=class extends cr{constructor({max:e,min:n,signed:t,size:u,value:i}){super(`Number "${i}" is not in safe ${u?`${u*8}-bit ${t?"signed":"unsigned"} `:""}integer range ${e?`(${n} to ${e})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},Ab=class extends cr{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}};function dr(e,{size:n}){if(cv(e)>n)throw new Ab({givenSize:cv(e),maxSize:n})}function _b(e,n={}){const{signed:t}=n;n.size&&dr(e,{size:n.size});const u=BigInt(e);if(!t)return u;const i=(e.length-2)/2,r=(1n<<BigInt(i)*8n-1n)-1n;return u<=r?u:u-BigInt(`0x${"f".padStart(i*2,"f")}`)-1n}function Cb(e,n={}){return Number(_b(e,n))}Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function Is(e,n={}){const{signed:t,size:u}=n,i=BigInt(e);let r;u?t?r=(1n<<BigInt(u)*8n-1n)-1n:r=2n**(BigInt(u)*8n)-1n:typeof e=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof r=="bigint"&&t?-r-1n:0;if(r&&i>r||i<a){const s=typeof e=="bigint"?"n":"";throw new wb({max:r?`${r}${s}`:void 0,min:`${a}${s}`,signed:t,size:u,value:`${e}${s}`})}const o=`0x${(t&&i<0?(1n<<BigInt(u*8))+BigInt(i):i).toString(16)}`;return u?lr(o,{size:u}):o}new TextEncoder;var $b=new TextEncoder;function xb(e,n={}){return typeof e=="number"||typeof e=="bigint"?Fb(e,n):typeof e=="boolean"?Ib(e,n):xs(e)?fv(e,n):mv(e,n)}function Ib(e,n={}){const t=new Uint8Array(1);return t[0]=Number(e),typeof n.size=="number"?(dr(t,{size:n.size}),lr(t,{size:n.size})):t}var un={zero:48,nine:57,A:65,F:70,a:97,f:102};function dv(e){if(e>=un.zero&&e<=un.nine)return e-un.zero;if(e>=un.A&&e<=un.F)return e-(un.A-10);if(e>=un.a&&e<=un.f)return e-(un.a-10)}function fv(e,n={}){let t=e;n.size&&(dr(t,{size:n.size}),t=lr(t,{dir:"right",size:n.size}));let u=t.slice(2);u.length%2&&(u=`0${u}`);const i=u.length/2,r=new Uint8Array(i);for(let a=0,o=0;a<i;a++){const s=dv(u.charCodeAt(o++)),c=dv(u.charCodeAt(o++));if(s===void 0||c===void 0)throw new cr(`Invalid byte sequence ("${u[o-2]}${u[o-1]}" in "${u}").`);r[a]=s*16+c}return r}function Fb(e,n){const t=Is(e,n);return fv(t)}function mv(e,n={}){const t=$b.encode(e);return typeof n.size=="number"?(dr(t,{size:n.size}),lr(t,{dir:"right",size:n.size})):t}var Nb=BigInt(0),li=BigInt(1),Tb=BigInt(2),Ob=BigInt(7),zb=BigInt(256),Ub=BigInt(113),vv=[],pv=[],hv=[];for(let e=0,n=li,t=1,u=0;e<24;e++){[t,u]=[u,(2*t+3*u)%5],vv.push(2*(5*u+t)),pv.push((e+1)*(e+2)/2%64);let i=Nb;for(let r=0;r<7;r++)n=(n<<li^(n>>Ob)*Ub)%zb,n&Tb&&(i^=li<<(li<<BigInt(r))-li);hv.push(i)}var gv=D4(hv,!0),Pb=gv[0],Rb=gv[1],Ev=(e,n,t)=>t>32?ry(e,n,t):iy(e,n,t),yv=(e,n,t)=>t>32?ay(e,n,t):uy(e,n,t);function jb(e,n=24){const t=new Uint32Array(10);for(let u=24-n;u<24;u++){for(let a=0;a<10;a++)t[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const o=(a+8)%10,s=(a+2)%10,c=t[s],l=t[s+1],f=Ev(c,l,1)^t[o],m=yv(c,l,1)^t[o+1];for(let d=0;d<50;d+=10)e[a+d]^=f,e[a+d+1]^=m}let i=e[2],r=e[3];for(let a=0;a<24;a++){const o=pv[a],s=Ev(i,r,o),c=yv(i,r,o),l=vv[a];i=e[l],r=e[l+1],e[l]=s,e[l+1]=c}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)t[o]=e[a+o];for(let o=0;o<10;o++)e[a+o]^=~t[(o+2)%10]&t[(o+4)%10]}e[0]^=Pb[u],e[1]^=Rb[u]}we(t)}var bv=class ap extends ds{constructor(n,t,u,i=!1,r=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=n,this.suffix=t,this.outputLen=u,this.enableXOF=i,this.rounds=r,ti(u),!(0<n&&n<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=JE(this.state)}clone(){return this._cloneInto()}keccak(){f4(this.state32),jb(this.state32,this.rounds),f4(this.state32),this.posOut=0,this.pos=0}update(n){gt(this),n=ui(n),me(n);const{blockLen:t,state:u}=this,i=n.length;for(let r=0;r<i;){const a=Math.min(t-this.pos,i-r);for(let o=0;o<a;o++)u[this.pos++]^=n[r++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:n,suffix:t,pos:u,blockLen:i}=this;n[u]^=t,(t&128)!==0&&u===i-1&&this.keccak(),n[i-1]^=128,this.keccak()}writeInto(n){gt(this,!1),me(n),this.finish();const t=this.state,{blockLen:u}=this;for(let i=0,r=n.length;i<r;){this.posOut>=u&&this.keccak();const a=Math.min(u-this.posOut,r-i);n.set(t.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return n}xofInto(n){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(n)}xof(n){return ti(n),this.xofInto(new Uint8Array(n))}digestInto(n){if(d4(n,this),this.finished)throw new Error("digest() was already called");return this.writeInto(n),this.destroy(),n}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,we(this.state)}_cloneInto(n){const{blockLen:t,suffix:u,outputLen:i,rounds:r,enableXOF:a}=this;return n||(n=new ap(t,u,i,a,r)),n.state32.set(this.state32),n.pos=this.pos,n.posOut=this.posOut,n.finished=this.finished,n.rounds=r,n.suffix=u,n.outputLen=i,n.enableXOF=a,n.destroyed=this.destroyed,n}},En=(e,n,t)=>Je(()=>new bv(n,e,t));En(6,144,224/8),En(6,136,256/8),En(6,104,384/8),En(6,72,512/8),En(1,144,224/8);var kv=En(1,136,256/8);En(1,104,384/8),En(1,72,512/8);var Dv=(e,n,t)=>YE((u={})=>new bv(n,e,u.dkLen===void 0?t:u.dkLen,!0));Dv(31,168,128/8),Dv(31,136,256/8);function Lb(e,n){return kv(xs(e,{strict:!1})?xb(e):e)}var di=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const t=this.keys().next().value;t&&this.delete(t)}return this}},Zb=/^0x[a-fA-F0-9]{40}$/,Fs=new di(8192);function Vb(e,n){const{strict:t=!0}={},u=`${e}.${t}`;if(Fs.has(u))return Fs.get(u);const i=Zb.test(e)?e.toLowerCase()===e?!0:t?qb(e)===e:!0:!1;return Fs.set(u,i),i}var Ns=new di(8192);function qb(e,n){if(Ns.has(`${e}.${n}`))return Ns.get(`${e}.${n}`);const t=e.substring(2).toLowerCase(),u=Lb(mv(t)),i=t.split("");for(let a=0;a<40;a+=2)u[a>>1]>>4>=8&&i[a]&&(i[a]=i[a].toUpperCase()),(u[a>>1]&15)>=8&&i[a+1]&&(i[a+1]=i[a+1].toUpperCase());const r=`0x${i.join("")}`;return Ns.set(`${e}.${n}`,r),r}async function Mb(e,{address:n,blockTag:t="latest",blockNumber:u}){const i=await e.request({method:"eth_getTransactionCount",params:[n,typeof u=="bigint"?Is(u):t]},{dedupe:!!u});return Cb(i)}new di(128),Is(0,{size:32}),new di(8192);var St=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),yn=new Uint32Array(80),Gb=class extends ai{constructor(){super(64,20,8,!1),this.A=St[0]|0,this.B=St[1]|0,this.C=St[2]|0,this.D=St[3]|0,this.E=St[4]|0}get(){const{A:e,B:n,C:t,D:u,E:i}=this;return[e,n,t,u,i]}set(e,n,t,u,i){this.A=e|0,this.B=n|0,this.C=t|0,this.D=u|0,this.E=i|0}process(e,n){for(let o=0;o<16;o++,n+=4)yn[o]=e.getUint32(n,!1);for(let o=16;o<80;o++)yn[o]=ln(yn[o-3]^yn[o-8]^yn[o-14]^yn[o-16],1);let{A:t,B:u,C:i,D:r,E:a}=this;for(let o=0;o<80;o++){let s,c;o<20?(s=Xu(u,i,r),c=1518500249):o<40?(s=u^i^r,c=1859775393):o<60?(s=w4(u,i,r),c=2400959708):(s=u^i^r,c=3395469782);const l=ln(t,5)+s+a+c+yn[o]|0;a=r,r=i,i=ln(u,30),u=t,t=l}t=t+this.A|0,u=u+this.B|0,i=i+this.C|0,r=r+this.D|0,a=a+this.E|0,this.set(t,u,i,r,a)}roundClean(){we(yn)}destroy(){this.set(0,0,0,0,0),we(this.buffer)}};Je(()=>new Gb);var Jb=Math.pow(2,32),Hb=Array.from({length:64},(e,n)=>Math.floor(Jb*Math.abs(Math.sin(n+1)))),fr=St.slice(0,4),Ts=new Uint32Array(16),Kb=class extends ai{constructor(){super(64,16,8,!0),this.A=fr[0]|0,this.B=fr[1]|0,this.C=fr[2]|0,this.D=fr[3]|0}get(){const{A:e,B:n,C:t,D:u}=this;return[e,n,t,u]}set(e,n,t,u){this.A=e|0,this.B=n|0,this.C=t|0,this.D=u|0}process(e,n){for(let a=0;a<16;a++,n+=4)Ts[a]=e.getUint32(n,!0);let{A:t,B:u,C:i,D:r}=this;for(let a=0;a<64;a++){let o,s,c;a<16?(o=Xu(u,i,r),s=a,c=[7,12,17,22]):a<32?(o=Xu(r,u,i),s=(5*a+1)%16,c=[5,9,14,20]):a<48?(o=u^i^r,s=(3*a+5)%16,c=[4,11,16,23]):(o=i^(u|~r),s=7*a%16,c=[6,10,15,21]),o=o+t+Hb[a]+Ts[s],t=r,r=i,i=u,u=u+ln(o,c[a%4])}t=t+this.A|0,u=u+this.B|0,i=i+this.C|0,r=r+this.D|0,this.set(t,u,i,r)}roundClean(){we(Ts)}destroy(){this.set(0,0,0,0),we(this.buffer)}};Je(()=>new Kb);var Qb=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Sv=Uint8Array.from(new Array(16).fill(0).map((e,n)=>n)),Wb=Sv.map(e=>(9*e+5)%16),Bv=(()=>{const t=[[Sv],[Wb]];for(let u=0;u<4;u++)for(let i of t)i.push(i[u].map(r=>Qb[r]));return t})(),wv=Bv[0],Av=Bv[1],_v=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>Uint8Array.from(e)),Yb=wv.map((e,n)=>e.map(t=>_v[n][t])),Xb=Av.map((e,n)=>e.map(t=>_v[n][t])),ek=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),nk=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function Cv(e,n,t,u){return e===0?n^t^u:e===1?n&t|~n&u:e===2?(n|~t)^u:e===3?n&u|t&~u:n^(t|~u)}var mr=new Uint32Array(16),tk=class extends ai{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:n,h2:t,h3:u,h4:i}=this;return[e,n,t,u,i]}set(e,n,t,u,i){this.h0=e|0,this.h1=n|0,this.h2=t|0,this.h3=u|0,this.h4=i|0}process(e,n){for(let m=0;m<16;m++,n+=4)mr[m]=e.getUint32(n,!0);let t=this.h0|0,u=t,i=this.h1|0,r=i,a=this.h2|0,o=a,s=this.h3|0,c=s,l=this.h4|0,f=l;for(let m=0;m<5;m++){const d=4-m,v=ek[m],h=nk[m],b=wv[m],E=Av[m],g=Yb[m],k=Xb[m];for(let _=0;_<16;_++){const B=ln(t+Cv(m,i,a,s)+mr[b[_]]+v,g[_])+l|0;t=l,l=s,s=ln(a,10)|0,a=i,i=B}for(let _=0;_<16;_++){const B=ln(u+Cv(d,r,o,c)+mr[E[_]]+h,k[_])+f|0;u=f,f=c,c=ln(o,10)|0,o=r,r=B}}this.set(this.h1+a+c|0,this.h2+s+f|0,this.h3+l+u|0,this.h4+t+r|0,this.h0+i+o|0)}roundClean(){we(mr)}destroy(){this.destroyed=!0,we(this.buffer),this.set(0,0,0,0,0)}};Je(()=>new tk);function ik(e){const{source:n}=e,t=new Map,u=new di(8192),i=new Map,r=({address:a,chainId:o})=>`${a}.${o}`;return{async consume({address:a,chainId:o,client:s}){const c=r({address:a,chainId:o}),l=this.get({address:a,chainId:o,client:s});this.increment({address:a,chainId:o});const f=await l;return await n.set({address:a,chainId:o},f),u.set(c,f),f},async increment({address:a,chainId:o}){const s=r({address:a,chainId:o}),c=t.get(s)??0;t.set(s,c+1)},async get({address:a,chainId:o,client:s}){const c=r({address:a,chainId:o});let l=i.get(c);return l||(l=(async()=>{try{const m=await n.get({address:a,chainId:o,client:s}),d=u.get(c)??0;return d>0&&m<=d?d+1:(u.delete(c),m)}finally{this.reset({address:a,chainId:o})}})(),i.set(c,l)),(t.get(c)??0)+await l},reset({address:a,chainId:o}){const s=r({address:a,chainId:o});t.delete(s),i.delete(s)}}}function uk(){return{async get(e){const{address:n,client:t}=e;return Mb(t,{address:n,blockTag:"pending"})},set(){}}}ik({source:uk()});function rk(e,n={}){const{as:t=typeof e=="string"?"Hex":"Bytes"}=n,u=kv(sb(e));return t==="Bytes"?u:av(u)}var ak=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const t=this.keys().next().value;t&&this.delete(t)}return this}},ok={checksum:new ak(8192)},Os=ok.checksum,sk=/^0x[a-fA-F0-9]{40}$/;function $v(e,n={}){const{strict:t=!0}=n;if(!sk.test(e))throw new xv({address:e,cause:new lk});if(t){if(e.toLowerCase()===e)return;if(ck(e)!==e)throw new xv({address:e,cause:new dk})}}function ck(e){if(Os.has(e))return Os.get(e);$v(e,{strict:!1});const n=e.substring(2).toLowerCase(),t=rk(db(n),{as:"Bytes"}),u=n.split("");for(let r=0;r<40;r+=2)t[r>>1]>>4>=8&&u[r]&&(u[r]=u[r].toUpperCase()),(t[r>>1]&15)>=8&&u[r+1]&&(u[r+1]=u[r+1].toUpperCase());const i=`0x${u.join("")}`;return Os.set(e,i),i}var xv=class extends Te{constructor({address:e,cause:n}){super(`Address "${e}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}},lk=class extends Te{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}},dk=class extends Te{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}},fk=/^(.*)\[([0-9]*)\]$/,mk=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,vk=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function zs(e,n){if(e.length!==n.length)throw new hk({expectedLength:e.length,givenLength:n.length});const t=[];for(let u=0;u<e.length;u++){const i=e[u],r=n[u];t.push(zs.encode(i,r))}return rv(...t)}(function(e){function n(t,u,i=!1){if(t==="address"){const s=u;return $v(s),sr(s.toLowerCase(),i?32:0)}if(t==="string")return yb(u);if(t==="bytes")return u;if(t==="bool")return sr(gb(u),i?32:1);const r=t.match(vk);if(r){const[s,c,l="256"]=r,f=Number.parseInt(l)/8;return Eb(u,{size:i?32:f,signed:c==="int"})}const a=t.match(mk);if(a){const[s,c]=a;if(Number.parseInt(c)!==(u.length-2)/2)throw new pk({expectedSize:Number.parseInt(c),value:u});return _s(u,i?32:0)}const o=t.match(fk);if(o&&Array.isArray(u)){const[s,c]=o,l=[];for(let f=0;f<u.length;f++)l.push(n(c,u[f],!0));return l.length===0?"0x":rv(...l)}throw new gk(t)}e.encode=n})(zs||(zs={}));var pk=class extends Te{constructor({expectedSize:e,value:n}){super(`Size of bytes "${n}" (bytes${Cs(n)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}},hk=class extends Te{constructor({expectedLength:e,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${e}`,`Given length (values): ${n}`].join(`
481
+ `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}},gk=class extends Te{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}};function Ek(e){if(!/^0[xX][0-9a-fA-F]{40}$/.test(e))return!1;const n="0x"+e.slice(2),t=n.slice(2);return t===t.toLowerCase()||t===t.toUpperCase()?!0:Vb(n)}function Iv(e){try{return new op(e),!0}catch{return!1}}const Fv=e=>Math.round((e+Number.EPSILON)*100)/100;function yk(e){const n=e.replace(/^data:\w+\/\w+;base64,/,""),t=Buffer.from(n,"base64");return new Uint8Array(t)}class bk{client;constructor(n){this.client=n}async create(n){return(await this.client.query({query:pt,variables:{createDirectPaymentInput:{...n,amount:n.amount}}}))?.createDirectPayment}async getWeb3PaymentParams(n){if(!Ek(n.paymentTokenAddress))throw new Error("Invalid token address");return(await this.client.query({query:Zu,variables:{amount:Fv(n.paymentRequest.amountDue),network:n.paymentRequest.network,tokenAddress:n.paymentTokenAddress,reference:n.paymentRequest.id}}))?.spritzPayParams}async getSolanaPaymentParams(n){if(!Iv(n.paymentTokenAddress))throw new Error(`Invalid token address: ${n.paymentTokenAddress}`);if(!Iv(n.signer))throw new Error(`Invalid signer: ${n.signer}`);const t=await this.client.query({query:ju,variables:{amount:Fv(n.paymentRequest.amountDue),tokenAddress:n.paymentTokenAddress,reference:n.paymentRequest.id,signer:n.signer}});return{versionedTransaction:sp.deserialize(yk(t?.solanaParams?.transactionSerialized??"")),transactionSerialized:t?.solanaParams?.transactionSerialized}}}var Bt={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"VerificationFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Verification"}},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:"canRetry"},arguments:[],directives:[]},{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:"verificationMetadata"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"failureReason"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"details"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"matchedEmail"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:286}};Bt.loc.source={body:`fragment VerificationFragment on Verification {
482
482
  userId
483
483
  identity {
484
484
  canRetry
@@ -493,14 +493,14 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
493
493
  }
494
494
  }
495
495
  }
496
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function vr(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(u){vr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){vr(u,n)}),e.definitions&&e.definitions.forEach(function(u){vr(u,n)})}var Us={};(function(){Bt.definitions.forEach(function(n){if(n.name){var t=new Set;vr(n,t),Us[n.name.value]=t}})})();function Nv(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function bk(e,n){var t={kind:e.kind,definitions:[Nv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Us[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Us[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Nv(e,o);s&&t.definitions.push(s)}),t}bk(Bt,"VerificationFragment");var wt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RetryFailedVerification"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"retryFailedVerification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VerificationFragment"},directives:[]}]}}]}}],loc:{start:0,end:156}};wt.loc.source={body:`#import "../queries/verificationFragment.graphql"
496
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function vr(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(u){vr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){vr(u,n)}),e.definitions&&e.definitions.forEach(function(u){vr(u,n)})}var Us={};(function(){Bt.definitions.forEach(function(n){if(n.name){var t=new Set;vr(n,t),Us[n.name.value]=t}})})();function Nv(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function kk(e,n){var t={kind:e.kind,definitions:[Nv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Us[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Us[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Nv(e,o);s&&t.definitions.push(s)}),t}kk(Bt,"VerificationFragment");var wt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RetryFailedVerification"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"retryFailedVerification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VerificationFragment"},directives:[]}]}}]}}],loc:{start:0,end:156}};wt.loc.source={body:`#import "../queries/verificationFragment.graphql"
497
497
 
498
498
  mutation RetryFailedVerification {
499
499
  retryFailedVerification {
500
500
  ...VerificationFragment
501
501
  }
502
502
  }
503
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Tv={};function kk(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Tv[t]?!1:(Tv[t]=!0,!0)})}wt.definitions=wt.definitions.concat(kk(Bt.definitions));function pr(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(u){pr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){pr(u,n)}),e.definitions&&e.definitions.forEach(function(u){pr(u,n)})}var Ps={};(function(){wt.definitions.forEach(function(n){if(n.name){var t=new Set;pr(n,t),Ps[n.name.value]=t}})})();function Ov(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Dk(e,n){var t={kind:e.kind,definitions:[Ov(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ps[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Ps[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Ov(e,o);s&&t.definitions.push(s)}),t}Dk(wt,"RetryFailedVerification");var hr={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"GetVerificationParams"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getVerificationParams"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"inquiryId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sessionToken"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationUrlExpiresAt"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:165}};hr.loc.source={body:`mutation GetVerificationParams {
503
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Tv={};function Dk(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Tv[t]?!1:(Tv[t]=!0,!0)})}wt.definitions=wt.definitions.concat(Dk(Bt.definitions));function pr(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(u){pr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){pr(u,n)}),e.definitions&&e.definitions.forEach(function(u){pr(u,n)})}var Ps={};(function(){wt.definitions.forEach(function(n){if(n.name){var t=new Set;pr(n,t),Ps[n.name.value]=t}})})();function Ov(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Sk(e,n){var t={kind:e.kind,definitions:[Ov(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ps[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Ps[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Ov(e,o);s&&t.definitions.push(s)}),t}Sk(wt,"RetryFailedVerification");var hr={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"GetVerificationParams"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getVerificationParams"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"inquiryId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sessionToken"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationUrlExpiresAt"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:165}};hr.loc.source={body:`mutation GetVerificationParams {
504
504
  getVerificationParams {
505
505
  inquiryId
506
506
  verificationUrl
@@ -508,7 +508,7 @@ mutation RetryFailedVerification {
508
508
  verificationUrlExpiresAt
509
509
  }
510
510
  }
511
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function gr(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(u){gr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){gr(u,n)}),e.definitions&&e.definitions.forEach(function(u){gr(u,n)})}var Rs={};(function(){hr.definitions.forEach(function(n){if(n.name){var t=new Set;gr(n,t),Rs[n.name.value]=t}})})();function zv(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Sk(e,n){var t={kind:e.kind,definitions:[zv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Rs[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Rs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=zv(e,o);s&&t.definitions.push(s)}),t}Sk(hr,"GetVerificationParams");var fi={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:"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:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timezone"},arguments:[],directives:[]}]}}],loc:{start:0,end:105}};fi.loc.source={body:`fragment UserFragment on User {
511
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function gr(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(u){gr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){gr(u,n)}),e.definitions&&e.definitions.forEach(function(u){gr(u,n)})}var Rs={};(function(){hr.definitions.forEach(function(n){if(n.name){var t=new Set;gr(n,t),Rs[n.name.value]=t}})})();function zv(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Bk(e,n){var t={kind:e.kind,definitions:[zv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Rs[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Rs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=zv(e,o);s&&t.definitions.push(s)}),t}Bk(hr,"GetVerificationParams");var fi={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:"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:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timezone"},arguments:[],directives:[]}]}}],loc:{start:0,end:105}};fi.loc.source={body:`fragment UserFragment on User {
512
512
  id
513
513
  email
514
514
  firstName
@@ -516,7 +516,7 @@ mutation RetryFailedVerification {
516
516
  createdAt
517
517
  timezone
518
518
  }
519
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Er(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(u){Er(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Er(u,n)}),e.definitions&&e.definitions.forEach(function(u){Er(u,n)})}var js={};(function(){fi.definitions.forEach(function(n){if(n.name){var t=new Set;Er(n,t),js[n.name.value]=t}})})();function Uv(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Bk(e,n){var t={kind:e.kind,definitions:[Uv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=js[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=js[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Uv(e,o);s&&t.definitions.push(s)}),t}Bk(fi,"UserFragment");var bn={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:[]}]}},{kind:"Field",name:{kind:"Name",value:"verification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VerificationFragment"},directives:[]}]}}]}}],loc:{start:0,end:193}};bn.loc.source={body:`#import "./userFragment.graphql"
519
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Er(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(u){Er(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Er(u,n)}),e.definitions&&e.definitions.forEach(function(u){Er(u,n)})}var js={};(function(){fi.definitions.forEach(function(n){if(n.name){var t=new Set;Er(n,t),js[n.name.value]=t}})})();function Uv(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function wk(e,n){var t={kind:e.kind,definitions:[Uv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=js[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=js[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Uv(e,o);s&&t.definitions.push(s)}),t}wk(fi,"UserFragment");var bn={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:[]}]}},{kind:"Field",name:{kind:"Name",value:"verification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VerificationFragment"},directives:[]}]}}]}}],loc:{start:0,end:193}};bn.loc.source={body:`#import "./userFragment.graphql"
520
520
  #import "./verificationFragment.graphql"
521
521
 
522
522
  query CurrentUser {
@@ -527,7 +527,7 @@ query CurrentUser {
527
527
  ...VerificationFragment
528
528
  }
529
529
  }
530
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Pv={};function Rv(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Pv[t]?!1:(Pv[t]=!0,!0)})}bn.definitions=bn.definitions.concat(Rv(fi.definitions)),bn.definitions=bn.definitions.concat(Rv(Bt.definitions));function yr(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(u){yr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){yr(u,n)}),e.definitions&&e.definitions.forEach(function(u){yr(u,n)})}var Ls={};(function(){bn.definitions.forEach(function(n){if(n.name){var t=new Set;yr(n,t),Ls[n.name.value]=t}})})();function jv(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function wk(e,n){var t={kind:e.kind,definitions:[jv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ls[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Ls[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=jv(e,o);s&&t.definitions.push(s)}),t}wk(bn,"CurrentUser");var kn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserAccess"},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:[]}]}},{kind:"Field",name:{kind:"Name",value:"verification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VerificationFragment"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"bridgeUser"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"kycStatus"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tosLink"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tosStatus"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"signedAgreementId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"hasAcceptedTos"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:356}};kn.loc.source={body:`#import "./userFragment.graphql"
530
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Pv={};function Rv(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Pv[t]?!1:(Pv[t]=!0,!0)})}bn.definitions=bn.definitions.concat(Rv(fi.definitions)),bn.definitions=bn.definitions.concat(Rv(Bt.definitions));function yr(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(u){yr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){yr(u,n)}),e.definitions&&e.definitions.forEach(function(u){yr(u,n)})}var Ls={};(function(){bn.definitions.forEach(function(n){if(n.name){var t=new Set;yr(n,t),Ls[n.name.value]=t}})})();function jv(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Ak(e,n){var t={kind:e.kind,definitions:[jv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ls[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Ls[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=jv(e,o);s&&t.definitions.push(s)}),t}Ak(bn,"CurrentUser");var kn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserAccess"},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:[]}]}},{kind:"Field",name:{kind:"Name",value:"verification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VerificationFragment"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"bridgeUser"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"kycStatus"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tosLink"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tosStatus"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"signedAgreementId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"hasAcceptedTos"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:356}};kn.loc.source={body:`#import "./userFragment.graphql"
531
531
  #import "./verificationFragment.graphql"
532
532
 
533
533
  query UserAccess {
@@ -548,7 +548,7 @@ query UserAccess {
548
548
  hasAcceptedTos
549
549
  }
550
550
  }
551
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Lv={};function Zv(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Lv[t]?!1:(Lv[t]=!0,!0)})}kn.definitions=kn.definitions.concat(Zv(fi.definitions)),kn.definitions=kn.definitions.concat(Zv(Bt.definitions));function br(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(u){br(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){br(u,n)}),e.definitions&&e.definitions.forEach(function(u){br(u,n)})}var Zs={};(function(){kn.definitions.forEach(function(n){if(n.name){var t=new Set;br(n,t),Zs[n.name.value]=t}})})();function Vv(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Ak(e,n){var t={kind:e.kind,definitions:[Vv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Zs[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Zs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Vv(e,o);s&&t.definitions.push(s)}),t}Ak(kn,"UserAccess");var rn=(e=>(e.NotStarted="not_started",e.Pending="pending",e.Completed="completed",e.Failed="failed",e))(rn||{}),Oe=(e=>(e.IdentityVerification="identity_verification",e.TermsAcceptance="terms_acceptance",e.AdditionalVerification="additional_verification",e.RegionalCompliance="regional_compliance",e.RiskEvaluation="risk_evaluation",e.DocumentSubmission="document_submission",e))(Oe||{}),kr=(e=>(e.AchPurchase="ach_purchase",e.WirePurchase="wire_purchase",e))(kr||{}),mi=(e=>(e.UsBankAccount="us_bank_account",e.UsBills="us_bills",e.UsDebitCard="us_debit_card",e.IbanTransfer="iban_transfer",e.UkBankAccount="uk_bank_account",e.CaBankAccount="ca_bank_account",e))(mi||{}),qv=(e=>(e.UsVirtualCard="us_virtual_card",e.UsPhysicalCard="us_physical_card",e))(qv||{}),_k=(e=>(e.Active="Active",e.Error="Error",e.Syncing="Syncing",e.Unavailable="Unavailable",e))(_k||{}),Mv=(e=>(e.AMOUNT_RECEIVED="AMOUNT_RECEIVED",e.TOTAL_AMOUNT="TOTAL_AMOUNT",e))(Mv||{}),Gv=(e=>(e.Business="Business",e.Checking="Checking",e.Savings="Savings",e))(Gv||{}),Jv=(e=>(e.CABankAccount="CABankAccount",e.IbanAccount="IbanAccount",e.UKBankAccount="UKBankAccount",e.USBankAccount="USBankAccount",e))(Jv||{}),Hv=(e=>(e.AutoLoan="AutoLoan",e.CreditCard="CreditCard",e.Loan="Loan",e.MobilePhone="MobilePhone",e.Mortgage="Mortgage",e.StudentLoan="StudentLoan",e.Unknown="Unknown",e.Utility="Utility",e))(Hv||{}),Kv=(e=>(e.Mastercard="Mastercard",e.Visa="Visa",e))(Kv||{}),Qv=(e=>(e.COMPLETED="COMPLETED",e.CONFIRMED="CONFIRMED",e.CREATED="CREATED",e.FAILED="FAILED",e.FAILED_VALIDATION="FAILED_VALIDATION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.TRANSACTION_FAILED="TRANSACTION_FAILED",e.TRANSACTION_PENDING="TRANSACTION_PENDING",e))(Qv||{}),At=(e=>(e.ACTIVE="ACTIVE",e.DISABLED="DISABLED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.LOADING="LOADING",e.RETRY="RETRY",e.UNAVAILABLE="UNAVAILABLE",e.UNDER_REVIEW="UNDER_REVIEW",e.UNINITIALIZED="UNINITIALIZED",e))(At||{}),Ck=(e=>(e.AWAITING_FUNDS="AWAITING_FUNDS",e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.ON_HOLD="ON_HOLD",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.REVERSED="REVERSED",e))(Ck||{}),$k=(e=>(e.Provider="Provider",e.User="User",e))($k||{}),Wv=(e=>(e.BankAccount="BankAccount",e.Bill="Bill",e.DebitCard="DebitCard",e.DigitalAccount="DigitalAccount",e.OneTimePayment="OneTimePayment",e.VirtualCard="VirtualCard",e))(Wv||{}),Yv=(e=>(e.INSTANT="INSTANT",e.SAME_DAY="SAME_DAY",e.STANDARD="STANDARD",e))(Yv||{}),Xv=(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))(Xv||{}),Vs=(e=>(e.USPhysicalDebitCard="USPhysicalDebitCard",e.USVirtualDebitCard="USVirtualDebitCard",e))(Vs||{}),xk=(e=>(e.VerifySms="verify_sms",e.DocumentVerification="documentary_verification",e.RiskCheck="risk_check",e.KycCheck="kyc_check",e.WatchlistScreening="watchlist_screening",e.SelfieCheck="selfie_check",e.AddressInvalid="address_invalid",e.DuplicateIdentity="duplicate_identity",e))(xk||{}),_t=(e=>(e.NotStarted="not_started",e.Verified="verified",e.Failed="failed",e.Disabled="disabled",e))(_t||{});function Ik(e=At.INITIALIZED){switch(e){case At.FAILED:return"failed";case At.ACTIVE:return"verified";case At.DISABLED:return"disabled";case At.RETRY:return"failed";default:return"not_started"}}function ep(e){const n=e?.me??null;if(!n)return null;const t=e?.verification??null,u=t?.identity?.verificationMetadata??null,i=u?.details?.matchedEmail??null,r=u?.failureReason?{failureReason:u.failureReason,details:{matchedEmail:i}}:null;return{...n,verificationStatus:Ik(t?.identity?.status),verificationUrl:t?.identity?.verificationUrl??null,verifiedCountry:t?.identity?.country??null,canRetryVerification:t?.identity?.canRetry??!1,verificationMetadata:r}}function Fk(e,n){return{verified:e===_t.Verified,country:n??null}}function Nk({verificationUrl:e,verificationStatus:n,retryable:t}){if(n!==_t.Verified)return n===_t.Failed?{type:Oe.IdentityVerification,description:"Identity verification failed. Please retry verification.",retryable:t,status:rn.Failed}:n===_t.NotStarted?{type:Oe.IdentityVerification,description:"Verify your identity to unlock features",actionUrl:e,status:rn.NotStarted}:{type:Oe.IdentityVerification,description:"Identity verification pending review",status:rn.Pending}}function Tk(e){try{const n=new URL(e);return n.searchParams.delete("redirect_uri"),n.toString()}catch{return e}}function Ok(e,n){if(!e&&n)return{type:Oe.TermsAcceptance,description:"Please review and accept the terms of service",actionUrl:Tk(n),status:rn.NotStarted}}function zk(e){if(!e)return{type:Oe.IdentityVerification,status:rn.NotStarted};if(!(e.status==="active"||e.status==="approved"))return e.status==="rejected"||e.status==="failed"?{type:Oe.IdentityVerification,status:rn.Failed}:e.status==="pending"||e.status==="in_review"?{type:Oe.IdentityVerification,status:rn.Pending}:{type:Oe.IdentityVerification,status:rn.NotStarted}}function Uk(e){if(!e)return[];if(!["US"].includes(e.toUpperCase()))return[];const n=[];return e.toUpperCase()==="US"&&n.push(kr.AchPurchase,kr.WirePurchase),n}const Pk={US:[mi.UsBankAccount,mi.UsDebitCard],CA:[mi.CaBankAccount]};function Rk(e){return e?Pk[e.toUpperCase()]??[]:[]}function jk(e){if(!e.verified)return{active:!1,features:[],requirements:[]};const n=Rk(e.country??null);return{active:n.length>0,features:n,requirements:[]}}function Lk(e,n){const t=Uk(e.country??null);if(!e.verified)return{active:!1,features:[],requirements:[]};const u=[],i=Ok(n?.hasAcceptedTos??!1,n?.tosLink);i&&u.push(i);const r=zk(n);if(r&&u.push(r),t.length===0)return{active:!1,features:[],requirements:u};const a={active:u.length===0,features:u.length===0?t:[],requirements:u};return i?a.nextRequirement=Oe.TermsAcceptance:r&&(a.nextRequirement=Oe.IdentityVerification),a}function Zk(e,n,t){const u=e?.bridgeUser,i=e?.verification?.identity?.canRetry??!1,r=e?.verification?.identity?.verificationUrl??null,a=Fk(n,t),o=Nk({verificationStatus:n,retryable:i,verificationUrl:r}),s={onramp:Lk(a,u),offramp:jk(a)};return{kycStatus:a,...o&&{kycRequirement:o},capabilities:s}}class Vk{client;constructor(n){this.client=n}async createUser(n){return this.client.request({method:"post",path:"/users/integration",body:n})}async create(n){return this.createUser(n)}async requestApiKey(n){return this.client.request({method:"post",path:"/users/request-key",body:{email:n}})}async authorizeApiKeyWithOTP(n){return this.client.request({method:"post",path:"/users/validate-key",body:n})}async getMe(){return this.client.restApi(Q("/v1/users/me","get"))}async getCurrentUser(){const n=await this.client.query({query:bn});return ep(n)}async retryFailedVerification(){return await this.client.query({query:wt}),this.getCurrentUser()}async getVerificationParams(){return(await this.client.query({query:hr})).getVerificationParams}async getUserAccess(){const n=await this.client.query({query:kn}),t=ep(n),u=t?.verificationStatus??_t.NotStarted,i=t?.verifiedCountry??null;return Zk(n,u,i)}}class qk{client;constructor(n){this.client=n}async createSession(){return this.client.restApi(Q("/v1/users/me/verification-sessions/","post"))}}var vi={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"VirtualDebitCardFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"VirtualCard"}},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:"Field",name:{kind:"Name",value:"mask"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"renderSecret"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"virtualCardType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billingInfo"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"street"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"street2"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"city"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"subdivision"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"postalCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"countryCode"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"paymentAddresses"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:469}};vi.loc.source={body:`fragment VirtualDebitCardFragment on VirtualCard {
551
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Lv={};function Zv(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Lv[t]?!1:(Lv[t]=!0,!0)})}kn.definitions=kn.definitions.concat(Zv(fi.definitions)),kn.definitions=kn.definitions.concat(Zv(Bt.definitions));function br(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(u){br(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){br(u,n)}),e.definitions&&e.definitions.forEach(function(u){br(u,n)})}var Zs={};(function(){kn.definitions.forEach(function(n){if(n.name){var t=new Set;br(n,t),Zs[n.name.value]=t}})})();function Vv(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function _k(e,n){var t={kind:e.kind,definitions:[Vv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Zs[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Zs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Vv(e,o);s&&t.definitions.push(s)}),t}_k(kn,"UserAccess");var rn=(e=>(e.NotStarted="not_started",e.Pending="pending",e.Completed="completed",e.Failed="failed",e))(rn||{}),Oe=(e=>(e.IdentityVerification="identity_verification",e.TermsAcceptance="terms_acceptance",e.AdditionalVerification="additional_verification",e.RegionalCompliance="regional_compliance",e.RiskEvaluation="risk_evaluation",e.DocumentSubmission="document_submission",e))(Oe||{}),kr=(e=>(e.AchPurchase="ach_purchase",e.WirePurchase="wire_purchase",e))(kr||{}),mi=(e=>(e.UsBankAccount="us_bank_account",e.UsBills="us_bills",e.UsDebitCard="us_debit_card",e.IbanTransfer="iban_transfer",e.UkBankAccount="uk_bank_account",e.CaBankAccount="ca_bank_account",e))(mi||{}),qv=(e=>(e.UsVirtualCard="us_virtual_card",e.UsPhysicalCard="us_physical_card",e))(qv||{}),Ck=(e=>(e.Active="Active",e.Error="Error",e.Syncing="Syncing",e.Unavailable="Unavailable",e))(Ck||{}),Mv=(e=>(e.AMOUNT_RECEIVED="AMOUNT_RECEIVED",e.TOTAL_AMOUNT="TOTAL_AMOUNT",e))(Mv||{}),Gv=(e=>(e.Business="Business",e.Checking="Checking",e.Savings="Savings",e))(Gv||{}),Jv=(e=>(e.CABankAccount="CABankAccount",e.IbanAccount="IbanAccount",e.UKBankAccount="UKBankAccount",e.USBankAccount="USBankAccount",e))(Jv||{}),Hv=(e=>(e.AutoLoan="AutoLoan",e.CreditCard="CreditCard",e.Loan="Loan",e.MobilePhone="MobilePhone",e.Mortgage="Mortgage",e.StudentLoan="StudentLoan",e.Unknown="Unknown",e.Utility="Utility",e))(Hv||{}),Kv=(e=>(e.Mastercard="Mastercard",e.Visa="Visa",e))(Kv||{}),Qv=(e=>(e.COMPLETED="COMPLETED",e.CONFIRMED="CONFIRMED",e.CREATED="CREATED",e.FAILED="FAILED",e.FAILED_VALIDATION="FAILED_VALIDATION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.TRANSACTION_FAILED="TRANSACTION_FAILED",e.TRANSACTION_PENDING="TRANSACTION_PENDING",e))(Qv||{}),At=(e=>(e.ACTIVE="ACTIVE",e.DISABLED="DISABLED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.LOADING="LOADING",e.RETRY="RETRY",e.UNAVAILABLE="UNAVAILABLE",e.UNDER_REVIEW="UNDER_REVIEW",e.UNINITIALIZED="UNINITIALIZED",e))(At||{}),$k=(e=>(e.AWAITING_FUNDS="AWAITING_FUNDS",e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.ON_HOLD="ON_HOLD",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.REVERSED="REVERSED",e))($k||{}),xk=(e=>(e.Provider="Provider",e.User="User",e))(xk||{}),Wv=(e=>(e.BankAccount="BankAccount",e.Bill="Bill",e.DebitCard="DebitCard",e.DigitalAccount="DigitalAccount",e.OneTimePayment="OneTimePayment",e.VirtualCard="VirtualCard",e))(Wv||{}),Yv=(e=>(e.INSTANT="INSTANT",e.SAME_DAY="SAME_DAY",e.STANDARD="STANDARD",e))(Yv||{}),Xv=(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))(Xv||{}),Vs=(e=>(e.USPhysicalDebitCard="USPhysicalDebitCard",e.USVirtualDebitCard="USVirtualDebitCard",e))(Vs||{}),Ik=(e=>(e.VerifySms="verify_sms",e.DocumentVerification="documentary_verification",e.RiskCheck="risk_check",e.KycCheck="kyc_check",e.WatchlistScreening="watchlist_screening",e.SelfieCheck="selfie_check",e.AddressInvalid="address_invalid",e.DuplicateIdentity="duplicate_identity",e))(Ik||{}),_t=(e=>(e.NotStarted="not_started",e.Verified="verified",e.Failed="failed",e.Disabled="disabled",e))(_t||{});function Fk(e=At.INITIALIZED){switch(e){case At.FAILED:return"failed";case At.ACTIVE:return"verified";case At.DISABLED:return"disabled";case At.RETRY:return"failed";default:return"not_started"}}function ep(e){const n=e?.me??null;if(!n)return null;const t=e?.verification??null,u=t?.identity?.verificationMetadata??null,i=u?.details?.matchedEmail??null,r=u?.failureReason?{failureReason:u.failureReason,details:{matchedEmail:i}}:null;return{...n,verificationStatus:Fk(t?.identity?.status),verificationUrl:t?.identity?.verificationUrl??null,verifiedCountry:t?.identity?.country??null,canRetryVerification:t?.identity?.canRetry??!1,verificationMetadata:r}}function Nk(e,n){return{verified:e===_t.Verified,country:n??null}}function Tk({verificationUrl:e,verificationStatus:n,retryable:t}){if(n!==_t.Verified)return n===_t.Failed?{type:Oe.IdentityVerification,description:"Identity verification failed. Please retry verification.",retryable:t,status:rn.Failed}:n===_t.NotStarted?{type:Oe.IdentityVerification,description:"Verify your identity to unlock features",actionUrl:e,status:rn.NotStarted}:{type:Oe.IdentityVerification,description:"Identity verification pending review",status:rn.Pending}}function Ok(e){try{const n=new URL(e);return n.searchParams.delete("redirect_uri"),n.toString()}catch{return e}}function zk(e,n){if(!e&&n)return{type:Oe.TermsAcceptance,description:"Please review and accept the terms of service",actionUrl:Ok(n),status:rn.NotStarted}}function Uk(e){if(!e)return{type:Oe.IdentityVerification,status:rn.NotStarted};if(!(e.status==="active"||e.status==="approved"))return e.status==="rejected"||e.status==="failed"?{type:Oe.IdentityVerification,status:rn.Failed}:e.status==="pending"||e.status==="in_review"?{type:Oe.IdentityVerification,status:rn.Pending}:{type:Oe.IdentityVerification,status:rn.NotStarted}}function Pk(e){if(!e)return[];if(!["US"].includes(e.toUpperCase()))return[];const n=[];return e.toUpperCase()==="US"&&n.push(kr.AchPurchase,kr.WirePurchase),n}const Rk={US:[mi.UsBankAccount,mi.UsDebitCard],CA:[mi.CaBankAccount]};function jk(e){return e?Rk[e.toUpperCase()]??[]:[]}function Lk(e){if(!e.verified)return{active:!1,features:[],requirements:[]};const n=jk(e.country??null);return{active:n.length>0,features:n,requirements:[]}}function Zk(e,n){const t=Pk(e.country??null);if(!e.verified)return{active:!1,features:[],requirements:[]};const u=[],i=zk(n?.hasAcceptedTos??!1,n?.tosLink);i&&u.push(i);const r=Uk(n);if(r&&u.push(r),t.length===0)return{active:!1,features:[],requirements:u};const a={active:u.length===0,features:u.length===0?t:[],requirements:u};return i?a.nextRequirement=Oe.TermsAcceptance:r&&(a.nextRequirement=Oe.IdentityVerification),a}function Vk(e,n,t){const u=e?.bridgeUser,i=e?.verification?.identity?.canRetry??!1,r=e?.verification?.identity?.verificationUrl??null,a=Nk(n,t),o=Tk({verificationStatus:n,retryable:i,verificationUrl:r}),s={onramp:Zk(a,u),offramp:Lk(a)};return{kycStatus:a,...o&&{kycRequirement:o},capabilities:s}}class qk{client;constructor(n){this.client=n}async createUser(n){return this.client.request({method:"post",path:"/users/integration",body:n})}async create(n){return this.createUser(n)}async requestApiKey(n){return this.client.request({method:"post",path:"/users/request-key",body:{email:n}})}async authorizeApiKeyWithOTP(n){return this.client.request({method:"post",path:"/users/validate-key",body:n})}async getMe(){return this.client.restApi(Q("/v1/users/me","get"))}async getCurrentUser(){const n=await this.client.query({query:bn});return ep(n)}async retryFailedVerification(){return await this.client.query({query:wt}),this.getCurrentUser()}async getVerificationParams(){return(await this.client.query({query:hr})).getVerificationParams}async getUserAccess(){const n=await this.client.query({query:kn}),t=ep(n),u=t?.verificationStatus??_t.NotStarted,i=t?.verifiedCountry??null;return Vk(n,u,i)}}class Mk{client;constructor(n){this.client=n}async createSession(){return this.client.restApi(Q("/v1/users/me/verification-sessions/","post"))}}var vi={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"VirtualDebitCardFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"VirtualCard"}},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:"Field",name:{kind:"Name",value:"mask"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"renderSecret"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"virtualCardType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billingInfo"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"street"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"street2"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"city"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"subdivision"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"postalCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"countryCode"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"paymentAddresses"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:469}};vi.loc.source={body:`fragment VirtualDebitCardFragment on VirtualCard {
552
552
  id
553
553
  name
554
554
  userId
@@ -578,24 +578,24 @@ query UserAccess {
578
578
  address
579
579
  }
580
580
  }
581
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Dr(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(u){Dr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Dr(u,n)}),e.definitions&&e.definitions.forEach(function(u){Dr(u,n)})}var qs={};(function(){vi.definitions.forEach(function(n){if(n.name){var t=new Set;Dr(n,t),qs[n.name.value]=t}})})();function np(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Mk(e,n){var t={kind:e.kind,definitions:[np(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=qs[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=qs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=np(e,o);s&&t.definitions.push(s)}),t}Mk(vi,"VirtualDebitCardFragment");var Ct={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateUSVirtualDebitCard"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createUSVirtualDebitCard"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VirtualDebitCardFragment"},directives:[]}]}}]}}],loc:{start:0,end:166}};Ct.loc.source={body:`#import "../queries/virtualDebitCardFragment.graphql"
581
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Dr(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(u){Dr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Dr(u,n)}),e.definitions&&e.definitions.forEach(function(u){Dr(u,n)})}var qs={};(function(){vi.definitions.forEach(function(n){if(n.name){var t=new Set;Dr(n,t),qs[n.name.value]=t}})})();function np(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Gk(e,n){var t={kind:e.kind,definitions:[np(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=qs[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=qs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=np(e,o);s&&t.definitions.push(s)}),t}Gk(vi,"VirtualDebitCardFragment");var Ct={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateUSVirtualDebitCard"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createUSVirtualDebitCard"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VirtualDebitCardFragment"},directives:[]}]}}]}}],loc:{start:0,end:166}};Ct.loc.source={body:`#import "../queries/virtualDebitCardFragment.graphql"
582
582
 
583
583
  mutation CreateUSVirtualDebitCard {
584
584
  createUSVirtualDebitCard {
585
585
  ...VirtualDebitCardFragment
586
586
  }
587
587
  }
588
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var tp={};function Gk(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return tp[t]?!1:(tp[t]=!0,!0)})}Ct.definitions=Ct.definitions.concat(Gk(vi.definitions));function Sr(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(u){Sr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Sr(u,n)}),e.definitions&&e.definitions.forEach(function(u){Sr(u,n)})}var Ms={};(function(){Ct.definitions.forEach(function(n){if(n.name){var t=new Set;Sr(n,t),Ms[n.name.value]=t}})})();function ip(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Jk(e,n){var t={kind:e.kind,definitions:[ip(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ms[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Ms[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=ip(e,o);s&&t.definitions.push(s)}),t}Jk(Ct,"CreateUSVirtualDebitCard");var $t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserVirtualDebitCard"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"virtualDebitCard"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VirtualDebitCardFragment"},directives:[]}]}}]}}],loc:{start:0,end:142}};$t.loc.source={body:`#import "./virtualDebitCardFragment.graphql"
588
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var tp={};function Jk(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return tp[t]?!1:(tp[t]=!0,!0)})}Ct.definitions=Ct.definitions.concat(Jk(vi.definitions));function Sr(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(u){Sr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Sr(u,n)}),e.definitions&&e.definitions.forEach(function(u){Sr(u,n)})}var Ms={};(function(){Ct.definitions.forEach(function(n){if(n.name){var t=new Set;Sr(n,t),Ms[n.name.value]=t}})})();function ip(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Hk(e,n){var t={kind:e.kind,definitions:[ip(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ms[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Ms[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=ip(e,o);s&&t.definitions.push(s)}),t}Hk(Ct,"CreateUSVirtualDebitCard");var $t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserVirtualDebitCard"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"virtualDebitCard"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VirtualDebitCardFragment"},directives:[]}]}}]}}],loc:{start:0,end:142}};$t.loc.source={body:`#import "./virtualDebitCardFragment.graphql"
589
589
 
590
590
  query UserVirtualDebitCard {
591
591
  virtualDebitCard {
592
592
  ...VirtualDebitCardFragment
593
593
  }
594
594
  }
595
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var up={};function Hk(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return up[t]?!1:(up[t]=!0,!0)})}$t.definitions=$t.definitions.concat(Hk(vi.definitions));function Br(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(u){Br(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Br(u,n)}),e.definitions&&e.definitions.forEach(function(u){Br(u,n)})}var Gs={};(function(){$t.definitions.forEach(function(n){if(n.name){var t=new Set;Br(n,t),Gs[n.name.value]=t}})})();function rp(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Kk(e,n){var t={kind:e.kind,definitions:[rp(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Gs[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Gs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=rp(e,o);s&&t.definitions.push(s)}),t}Kk($t,"UserVirtualDebitCard");const Qk={[Vs.USVirtualDebitCard]:e=>({query:Ct,variables:void 0,response:"createUSVirtualDebitCard"})},Wk=(e,n)=>Qk[e]?.(n)??null;class Yk{client;constructor(n){this.client=n}async fetch(){return(await this.client.query({query:$t}))?.virtualDebitCard??null}async create(n,t){const u=Wk(n,t);if(!u)throw new Error("Invalid virtual card type");return(await this.client.query({query:u.query,variables:u.variables}))?.[u.response]??null}}function Js(e){const n=e;return{id:e.id,integratorId:n.integratorId??"",failureCount:e.failureCount,events:e.events,url:e.url,createdAt:n.createdAt??"",disabled:e.disabled}}class Xk{client;constructor(n){this.client=n}async create(n){const t=await this.client.restApi(Q("/v1/integrator/webhooks","post",{body:n}));return Js(t)}async update(n,t){const u=await this.client.restApi(Q("/v1/integrator/webhooks/{webhookId}","patch",{params:{webhookId:n},body:t}));return Js(u)}async updateWebhookSecret(n){return{success:(await this.client.restApi(Q("/v1/integrator/webhook-secret","post",{body:{secret:n}}))).secretConfigured}}async list(){return(await this.client.restApi(Q("/v1/integrator/webhooks","get"))).map(Js)}async delete(n){const t=await this.list().then(u=>u.find(i=>i.id===n)).catch(()=>{});return await this.client.restApi(Q("/v1/integrator/webhooks/{webhookId}","delete",{params:{webhookId:n}})),t??{id:n,integratorId:"",failureCount:0,events:[],url:"",createdAt:"",disabled:!0}}}class Qs{environment;apiKey;integrationKey;integratorSecret;client;user;verification;bankAccount;debitCard;deposit;achDebitReturn;fundingSource;paymentRequest;payment;onrampPayment;onramp;offramp;virtualAccounts;virtualCard;bill;institution;sandbox;webhook;constructor(n,t,u,i,r){if(t===void 0&&u===void 0)throw new Error("The integrationKey or apiKey variable appears to be missing or empty. Please ensure you provide it, or when initializing the SpritzApiClient, opt for the integratorKey option.");if(i&&!u)throw new Error("integratorSecret requires integrationKey to be provided. Both are needed for HMAC-signed REST API requests.");if(this.environment=n,this.apiKey=t,this.integrationKey=u,this.integratorSecret=i,!r&&Th())throw new Error(`It seems you're operating within a browser environment.
595
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var up={};function Kk(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return up[t]?!1:(up[t]=!0,!0)})}$t.definitions=$t.definitions.concat(Kk(vi.definitions));function Br(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(u){Br(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Br(u,n)}),e.definitions&&e.definitions.forEach(function(u){Br(u,n)})}var Gs={};(function(){$t.definitions.forEach(function(n){if(n.name){var t=new Set;Br(n,t),Gs[n.name.value]=t}})})();function rp(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Qk(e,n){var t={kind:e.kind,definitions:[rp(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Gs[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Gs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=rp(e,o);s&&t.definitions.push(s)}),t}Qk($t,"UserVirtualDebitCard");const Wk={[Vs.USVirtualDebitCard]:e=>({query:Ct,variables:void 0,response:"createUSVirtualDebitCard"})},Yk=(e,n)=>Wk[e]?.(n)??null;class Xk{client;constructor(n){this.client=n}async fetch(){return(await this.client.query({query:$t}))?.virtualDebitCard??null}async create(n,t){const u=Yk(n,t);if(!u)throw new Error("Invalid virtual card type");return(await this.client.query({query:u.query,variables:u.variables}))?.[u.response]??null}}function Js(e){const n=e;return{id:e.id,integratorId:n.integratorId??"",failureCount:e.failureCount,events:e.events,url:e.url,createdAt:n.createdAt??"",disabled:e.disabled}}class eD{client;constructor(n){this.client=n}async create(n){const t=await this.client.restApi(Q("/v1/integrator/webhooks","post",{body:n}));return Js(t)}async update(n,t){const u=await this.client.restApi(Q("/v1/integrator/webhooks/{webhookId}","patch",{params:{webhookId:n},body:t}));return Js(u)}async updateWebhookSecret(n){return{success:(await this.client.restApi(Q("/v1/integrator/webhook-secret","post",{body:{secret:n}}))).secretConfigured}}async list(){return(await this.client.restApi(Q("/v1/integrator/webhooks","get"))).map(Js)}async delete(n){const t=await this.list().then(u=>u.find(i=>i.id===n)).catch(()=>{});return await this.client.restApi(Q("/v1/integrator/webhooks/{webhookId}","delete",{params:{webhookId:n}})),t??{id:n,integratorId:"",failureCount:0,events:[],url:"",createdAt:"",disabled:!0}}}class Qs{environment;apiKey;integrationKey;integratorSecret;client;user;verification;bankAccount;debitCard;deposit;achDebitReturn;fundingSource;paymentRequest;payment;onrampPayment;onramp;offramp;virtualAccounts;virtualCard;bill;institution;sandbox;webhook;constructor(n,t,u,i,r){if(t===void 0&&u===void 0)throw new Error("The integrationKey or apiKey variable appears to be missing or empty. Please ensure you provide it, or when initializing the SpritzApiClient, opt for the integratorKey option.");if(i&&!u)throw new Error("integratorSecret requires integrationKey to be provided. Both are needed for HMAC-signed REST API requests.");if(this.environment=n,this.apiKey=t,this.integrationKey=u,this.integratorSecret=i,!r&&Th())throw new Error(`It seems you're operating within a browser environment.
596
596
 
597
597
  By default, this is deactivated due to the potential risk of exposing your confidential integrator credentials.
598
598
  If you're aware of these risks and have taken necessary security measures, you can enable the \`dangerouslyAllowBrowser\` option, e.g.,
599
599
 
600
600
  SpritzApiClient.initialize({ apiKey, dangerouslyAllowBrowser: true });
601
- `)}static initialize({environment:n=Ar.Sandbox,apiKey:t,integrationKey:u,integratorSecret:i,dangerouslyAllowBrowser:r=!1}){const a=new Qs(n,t,u,i,r);return a.init(),a}init(){this.client=new eg({environment:this.environment,apiKey:this.apiKey,integrationKey:this.integrationKey,integratorSecret:this.integratorSecret}),this.user=new Vk(this.client),this.verification=new qk(this.client),this.bankAccount=new ag(this.client),this.debitCard=new aE(this.client),this.deposit=new oE(this.client),this.achDebitReturn=new rg(this.client),this.fundingSource=new sE(this.client),this.paymentRequest=new yk(this.client),this.payment=new RE(this.client),this.onrampPayment=new bE(this.client),this.onramp=new BE(this.client),this.offramp=new hE(this.client),this.virtualAccounts=new IE(this.client),this.virtualCard=new Yk(this.client),this.bill=new gg(this.client),this.institution=new vE(this.client),this.sandbox=new pE(this.client),this.webhook=new Xk(this.client)}setApiKey(n){return this.apiKey=n,this.init(),this}}export{Ni as APIConnectionError,Oc as APIConnectionTimeoutError,Be as APIError,Uh as APIUserAbortError,Mv as AmountMode,Uc as AuthenticationError,zc as BadRequestError,Gv as BankAccountSubType,Jv as BankAccountType,Hv as BillType,qv as CardFeatureType,jc as ConflictError,Kv as DebitCardNetwork,Ar as Environment,Vc as InternalServerError,Rc as NotFoundError,mi as OfframpFeatureType,kr as OnrampFeatureType,Wv as PayableAccountType,Yv as PaymentDeliveryMethod,Me as PaymentNetwork,Qv as PaymentRequestStatus,Xv as PaymentStatus,Pc as PermissionDeniedError,Zc as RateLimitError,Oe as RequirementType,Qs as SpritzApiClient,Tc as SpritzApiError,Lc as UnprocessableEntityError,Vs as VirtualCardType,Ym as onrampSupportedTokens};
601
+ `)}static initialize({environment:n=Ar.Sandbox,apiKey:t,integrationKey:u,integratorSecret:i,dangerouslyAllowBrowser:r=!1}){const a=new Qs(n,t,u,i,r);return a.init(),a}init(){this.client=new eg({environment:this.environment,apiKey:this.apiKey,integrationKey:this.integrationKey,integratorSecret:this.integratorSecret}),this.user=new qk(this.client),this.verification=new Mk(this.client),this.bankAccount=new ag(this.client),this.debitCard=new aE(this.client),this.deposit=new sE(this.client),this.achDebitReturn=new rg(this.client),this.fundingSource=new cE(this.client),this.paymentRequest=new bk(this.client),this.payment=new jE(this.client),this.onrampPayment=new kE(this.client),this.onramp=new wE(this.client),this.offramp=new gE(this.client),this.virtualAccounts=new FE(this.client),this.virtualCard=new Xk(this.client),this.bill=new gg(this.client),this.institution=new pE(this.client),this.sandbox=new hE(this.client),this.webhook=new eD(this.client)}setApiKey(n){return this.apiKey=n,this.init(),this}}export{Ni as APIConnectionError,Oc as APIConnectionTimeoutError,Be as APIError,Uh as APIUserAbortError,Mv as AmountMode,Uc as AuthenticationError,zc as BadRequestError,Gv as BankAccountSubType,Jv as BankAccountType,Hv as BillType,qv as CardFeatureType,jc as ConflictError,Kv as DebitCardNetwork,Ar as Environment,Vc as InternalServerError,Rc as NotFoundError,mi as OfframpFeatureType,kr as OnrampFeatureType,Wv as PayableAccountType,Yv as PaymentDeliveryMethod,Me as PaymentNetwork,Qv as PaymentRequestStatus,Xv as PaymentStatus,Pc as PermissionDeniedError,Zc as RateLimitError,Oe as RequirementType,Qs as SpritzApiClient,Tc as SpritzApiError,Lc as UnprocessableEntityError,Vs as VirtualCardType,Ym as onrampSupportedTokens};