import{I as e,Y as t,lt as n,s as r,st as i,tt as a}from"./definition-C7QrKMH2.js";var o=new r({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(e){let n=p(e);if(typeof n==`boolean`)return n?1:0;let r=n;if(typeof n==`string`&&n!==``&&(r=Number(n)),typeof r!=`number`||!Number.isInteger(r))throw new i(`Int cannot represent non-integer value: ${t(n)}`);if(r>2147483647||r<-2147483648)throw new i(`Int cannot represent non 32-bit signed integer value: `+t(n));return r},parseValue(e){if(typeof e!=`number`||!Number.isInteger(e))throw new i(`Int cannot represent non-integer value: ${t(e)}`);if(e>2147483647||e<-2147483648)throw new i(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(t){if(t.kind!==a.INT)throw new i(`Int cannot represent non-integer value: ${e(t)}`,{nodes:t});let n=parseInt(t.value,10);if(n>2147483647||n<-2147483648)throw new i(`Int cannot represent non 32-bit signed integer value: ${t.value}`,{nodes:t});return n}}),s=new r({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(e){let n=p(e);if(typeof n==`boolean`)return n?1:0;let r=n;if(typeof n==`string`&&n!==``&&(r=Number(n)),typeof r!=`number`||!Number.isFinite(r))throw new i(`Float cannot represent non numeric value: ${t(n)}`);return r},parseValue(e){if(typeof e!=`number`||!Number.isFinite(e))throw new i(`Float cannot represent non numeric value: ${t(e)}`);return e},parseLiteral(t){if(t.kind!==a.FLOAT&&t.kind!==a.INT)throw new i(`Float cannot represent non numeric value: ${e(t)}`,t);return parseFloat(t.value)}}),c=new r({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(e){let n=p(e);if(typeof n==`string`)return n;if(typeof n==`boolean`)return n?`true`:`false`;if(typeof n==`number`&&Number.isFinite(n))return n.toString();throw new i(`String cannot represent value: ${t(e)}`)},parseValue(e){if(typeof e!=`string`)throw new i(`String cannot represent a non string value: ${t(e)}`);return e},parseLiteral(t){if(t.kind!==a.STRING)throw new i(`String cannot represent a non string value: ${e(t)}`,{nodes:t});return t.value}}),l=new r({name:`Boolean`,description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let n=p(e);if(typeof n==`boolean`)return n;if(Number.isFinite(n))return n!==0;throw new i(`Boolean cannot represent a non boolean value: ${t(n)}`)},parseValue(e){if(typeof e!=`boolean`)throw new i(`Boolean cannot represent a non boolean value: ${t(e)}`);return e},parseLiteral(t){if(t.kind!==a.BOOLEAN)throw new i(`Boolean cannot represent a non boolean value: ${e(t)}`,{nodes:t});return t.value}}),u=new r({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(e){let n=p(e);if(typeof n==`string`)return n;if(Number.isInteger(n))return String(n);throw new i(`ID cannot represent value: ${t(e)}`)},parseValue(e){if(typeof e==`string`)return e;if(typeof e==`number`&&Number.isInteger(e))return e.toString();throw new i(`ID cannot represent value: ${t(e)}`)},parseLiteral(t){if(t.kind!==a.STRING&&t.kind!==a.INT)throw new i(`ID cannot represent a non-string and non-integer value: `+e(t),{nodes:t});return t.value}}),d=Object.freeze([c,o,s,l,u]);function f(e){return d.some(({name:t})=>e.name===t)}function p(e){if(n(e)){if(typeof e.valueOf==`function`){let t=e.valueOf();if(!n(t))return t}if(typeof e.toJSON==`function`)return e.toJSON()}return e}export{f as a,c as i,s as n,d as o,u as r,l as t};
//# sourceMappingURL=scalars-DI3Jri1T.js.map