@power-plant/alloy-js 0.0.2

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.
Files changed (137) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +265 -0
  3. package/dist/code-Cw63m9E5.d.mts +29 -0
  4. package/dist/code-Cw63m9E5.d.mts.map +1 -0
  5. package/dist/code-DwEnLBw3.d.cts +29 -0
  6. package/dist/code-DwEnLBw3.d.cts.map +1 -0
  7. package/dist/components-Lfo1yjgU.d.cts +57 -0
  8. package/dist/components-Lfo1yjgU.d.cts.map +1 -0
  9. package/dist/components-Lfo1yjgU.d.mts +57 -0
  10. package/dist/components-Lfo1yjgU.d.mts.map +1 -0
  11. package/dist/core/components/index.cjs +1 -0
  12. package/dist/core/components/index.d.cts +5 -0
  13. package/dist/core/components/index.d.mts +5 -0
  14. package/dist/core/components/index.mjs +1 -0
  15. package/dist/core/components/output.cjs +1 -0
  16. package/dist/core/components/output.d.cts +2 -0
  17. package/dist/core/components/output.d.mts +2 -0
  18. package/dist/core/components/output.mjs +2 -0
  19. package/dist/core/components/output.mjs.map +1 -0
  20. package/dist/core/components/single-line-comment.cjs +1 -0
  21. package/dist/core/components/single-line-comment.d.cts +2 -0
  22. package/dist/core/components/single-line-comment.d.mts +2 -0
  23. package/dist/core/components/single-line-comment.mjs +2 -0
  24. package/dist/core/components/single-line-comment.mjs.map +1 -0
  25. package/dist/core/components/source-file.cjs +1 -0
  26. package/dist/core/components/source-file.d.cts +2 -0
  27. package/dist/core/components/source-file.d.mts +2 -0
  28. package/dist/core/components/source-file.mjs +1 -0
  29. package/dist/core/components/spacing.cjs +1 -0
  30. package/dist/core/components/spacing.d.cts +2 -0
  31. package/dist/core/components/spacing.d.mts +2 -0
  32. package/dist/core/components/spacing.mjs +2 -0
  33. package/dist/core/components/spacing.mjs.map +1 -0
  34. package/dist/core/contexts/execution.cjs +1 -0
  35. package/dist/core/contexts/execution.d.cts +2 -0
  36. package/dist/core/contexts/execution.d.mts +2 -0
  37. package/dist/core/contexts/execution.mjs +2 -0
  38. package/dist/core/contexts/execution.mjs.map +1 -0
  39. package/dist/core/contexts/index.cjs +1 -0
  40. package/dist/core/contexts/index.d.cts +5 -0
  41. package/dist/core/contexts/index.d.mts +5 -0
  42. package/dist/core/contexts/index.mjs +1 -0
  43. package/dist/core/contexts/meta.cjs +1 -0
  44. package/dist/core/contexts/meta.d.cts +2 -0
  45. package/dist/core/contexts/meta.d.mts +2 -0
  46. package/dist/core/contexts/meta.mjs +2 -0
  47. package/dist/core/contexts/meta.mjs.map +1 -0
  48. package/dist/core/contexts/schema.cjs +1 -0
  49. package/dist/core/contexts/schema.d.cts +2 -0
  50. package/dist/core/contexts/schema.d.mts +2 -0
  51. package/dist/core/contexts/schema.mjs +2 -0
  52. package/dist/core/contexts/schema.mjs.map +1 -0
  53. package/dist/core/contexts/session.cjs +1 -0
  54. package/dist/core/contexts/session.d.cts +2 -0
  55. package/dist/core/contexts/session.d.mts +2 -0
  56. package/dist/core/contexts/session.mjs +2 -0
  57. package/dist/core/contexts/session.mjs.map +1 -0
  58. package/dist/core/contexts/spec.cjs +1 -0
  59. package/dist/core/contexts/spec.d.cts +23 -0
  60. package/dist/core/contexts/spec.d.cts.map +1 -0
  61. package/dist/core/contexts/spec.d.mts +23 -0
  62. package/dist/core/contexts/spec.d.mts.map +1 -0
  63. package/dist/core/contexts/spec.mjs +2 -0
  64. package/dist/core/contexts/spec.mjs.map +1 -0
  65. package/dist/core/helpers/code.cjs +1 -0
  66. package/dist/core/helpers/code.d.cts +2 -0
  67. package/dist/core/helpers/code.d.mts +2 -0
  68. package/dist/core/helpers/code.mjs +2 -0
  69. package/dist/core/helpers/code.mjs.map +1 -0
  70. package/dist/core/helpers/index.cjs +1 -0
  71. package/dist/core/helpers/index.d.cts +2 -0
  72. package/dist/core/helpers/index.d.mts +2 -0
  73. package/dist/core/helpers/index.mjs +1 -0
  74. package/dist/core/index.cjs +1 -0
  75. package/dist/core/index.d.cts +10 -0
  76. package/dist/core/index.d.mts +10 -0
  77. package/dist/core/index.mjs +1 -0
  78. package/dist/core/types/components.cjs +0 -0
  79. package/dist/core/types/components.d.cts +2 -0
  80. package/dist/core/types/components.d.mts +2 -0
  81. package/dist/core/types/components.mjs +0 -0
  82. package/dist/core/types/index.cjs +1 -0
  83. package/dist/core/types/index.d.cts +2 -0
  84. package/dist/core/types/index.d.mts +2 -0
  85. package/dist/core/types/index.mjs +1 -0
  86. package/dist/execution-CqOWMsST.d.cts +24 -0
  87. package/dist/execution-CqOWMsST.d.cts.map +1 -0
  88. package/dist/execution-CqOWMsST.d.mts +24 -0
  89. package/dist/execution-CqOWMsST.d.mts.map +1 -0
  90. package/dist/index.cjs +47 -0
  91. package/dist/index.d.cts +22 -0
  92. package/dist/index.d.cts.map +1 -0
  93. package/dist/index.d.mts +22 -0
  94. package/dist/index.d.mts.map +1 -0
  95. package/dist/index.mjs +48 -0
  96. package/dist/index.mjs.map +1 -0
  97. package/dist/meta-CDUo2qw9.d.cts +24 -0
  98. package/dist/meta-CDUo2qw9.d.cts.map +1 -0
  99. package/dist/meta-CDUo2qw9.d.mts +24 -0
  100. package/dist/meta-CDUo2qw9.d.mts.map +1 -0
  101. package/dist/output-Cd9yv0DZ.d.cts +25 -0
  102. package/dist/output-Cd9yv0DZ.d.cts.map +1 -0
  103. package/dist/output-D_ovZIyg.d.mts +25 -0
  104. package/dist/output-D_ovZIyg.d.mts.map +1 -0
  105. package/dist/render-Bh6nE1bo.cjs +1 -0
  106. package/dist/render-UH3hN5fr.mjs +2 -0
  107. package/dist/render-UH3hN5fr.mjs.map +1 -0
  108. package/dist/render.cjs +1 -0
  109. package/dist/render.d.cts +22 -0
  110. package/dist/render.d.cts.map +1 -0
  111. package/dist/render.d.mts +22 -0
  112. package/dist/render.d.mts.map +1 -0
  113. package/dist/render.mjs +1 -0
  114. package/dist/schema-pTK0-GHm.d.cts +39 -0
  115. package/dist/schema-pTK0-GHm.d.cts.map +1 -0
  116. package/dist/schema-pTK0-GHm.d.mts +39 -0
  117. package/dist/schema-pTK0-GHm.d.mts.map +1 -0
  118. package/dist/session-CyeJNmog.d.cts +63 -0
  119. package/dist/session-CyeJNmog.d.cts.map +1 -0
  120. package/dist/session-CyeJNmog.d.mts +63 -0
  121. package/dist/session-CyeJNmog.d.mts.map +1 -0
  122. package/dist/single-line-comment-CLBiy5aI.d.mts +20 -0
  123. package/dist/single-line-comment-CLBiy5aI.d.mts.map +1 -0
  124. package/dist/single-line-comment-WhWXKvku.d.cts +20 -0
  125. package/dist/single-line-comment-WhWXKvku.d.cts.map +1 -0
  126. package/dist/source-file-CW1A6SJ9.d.cts +24 -0
  127. package/dist/source-file-CW1A6SJ9.d.cts.map +1 -0
  128. package/dist/source-file-Cn1xO9t5.d.mts +24 -0
  129. package/dist/source-file-Cn1xO9t5.d.mts.map +1 -0
  130. package/dist/source-file-K_2P7eFP.cjs +1 -0
  131. package/dist/source-file-t3itBybg.mjs +2 -0
  132. package/dist/source-file-t3itBybg.mjs.map +1 -0
  133. package/dist/spacing-CGrdAoZW.d.cts +21 -0
  134. package/dist/spacing-CGrdAoZW.d.cts.map +1 -0
  135. package/dist/spacing-CGrdAoZW.d.mts +21 -0
  136. package/dist/spacing-CGrdAoZW.d.mts.map +1 -0
  137. package/package.json +337 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,47 @@
1
+ const e=require("./source-file-K_2P7eFP.cjs"),t=require("./render-Bh6nE1bo.cjs");let n=require("@power-plant/core");function r(e){return i(e,[])}function i(e,t){switch(typeof e){case`string`:return JSON.stringify(e);case`function`:return e.name?`[function ${e.name}]`:`[function]`;case`object`:return a(e,t);default:return String(e)}}function a(e,t){if(e===null)return`null`;if(t.includes(e))return`[Circular]`;let n=[...t,e];if(o(e)){let t=e.toJSON();if(t!==e)return typeof t==`string`?t:i(t,n)}else if(Array.isArray(e))return c(e,n);return s(e,n)}function o(e){return typeof e.toJSON==`function`}function s(e,t){let n=Object.entries(e);return n.length===0?`{}`:t.length>2?`[`+l(e)+`]`:`{ `+n.map(([e,n])=>e+`: `+i(n,t)).join(`, `)+` }`}function c(e,t){if(e.length===0)return`[]`;if(t.length>2)return`[Array]`;let n=Math.min(10,e.length),r=e.length-n,a=[];for(let r=0;r<n;++r)a.push(i(e[r],t));return r===1?a.push(`... 1 more item`):r>1&&a.push(`... ${r} more items`),`[`+a.join(`, `)+`]`}function l(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,``).replace(/]$/,``);if(t===`Object`&&typeof e.constructor==`function`){let t=e.constructor.name;if(typeof t==`string`&&t!==``)return t}return t}function u(e,t){return e?.__kind===t}let d=u;function f(e){return typeof e==`object`&&!!e}function p(e,t){if(!e)throw Error(t??`Unexpected invariant triggered.`)}const m=/\r\n|[\n\r]/g;function h(e,t){let n=0,r=1;for(let i of e.body.matchAll(m)){if(typeof i.index!=`number`&&p(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function g(e){return ee(e.source,h(e.source,e.start))}function ee(e,t){let n=e.locationOffset.column-1,r=``.padStart(n)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=t.line===1?n:0,c=t.column+s,l=`${e.name}:${o}:${c}\n`,u=r.split(/\r\n|[\n\r]/g),d=u[i];if(d.length>120){let e=Math.floor(c/80),t=c%80,n=[];for(let e=0;e<d.length;e+=80)n.push(d.slice(e,e+80));return l+te([[`${o} |`,n[0]],...n.slice(1,e+1).map(e=>[`|`,e]),[`|`,`^`.padStart(t)],[`|`,n[e+1]]])}return l+te([[`${o-1} |`,u[i-1]],[`${o} |`,d],[`|`,`^`.padStart(c)],[`${o+1} |`,u[i+1]]])}function te(e){let t=e.filter(([e,t])=>t!==void 0),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?` `+t:``)).join(`
2
+ `)}var _=class e extends Error{constructor(t,n={}){let{nodes:r,source:i,positions:a,path:o,originalError:s,cause:c,extensions:l}=n,u=`cause`in n;super(t,u||s!=null?{cause:u?c:s}:void 0),this.name=`GraphQLError`,this.path=o??void 0;let d=s??(c instanceof Error?c:void 0);this.originalError=d,this.nodes=ne(Array.isArray(r)?r:r?[r]:void 0);let p=ne(this.nodes?.map(e=>e.loc).filter(e=>e!=null));this.source=i??p?.[0]?.source,this.positions=a??p?.map(e=>e.start),this.locations=a&&i?a.map(e=>h(i,e)):p?.map(e=>h(e.source,e.start));let m=f(d?.extensions)?d.extensions:void 0;this.extensions=l??m??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),s?.stack==null?Error.captureStackTrace==null?Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0}):Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:s.stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return`GraphQLError`}toString(){let e=this.message;if(this.nodes)for(let t of this.nodes)t.loc&&(e+=`
3
+
4
+ `+g(t.loc));else if(this.source&&this.locations)for(let t of this.locations)e+=`
5
+
6
+ `+ee(this.source,t);return e}toJSON(){let e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}};function ne(e){return e===void 0||e.length===0?void 0:e}function re(e){return ie(`or`,e)}function ie(e,t){switch(t.length===0&&p(!1),t.length){case 1:return t[0];case 2:return t[0]+` `+e+` `+t[1]}let n=t.slice(0,-1),r=t.at(-1);return n.join(`, `)+`, `+e+` `+r}function ae(e){return typeof e==`object`&&typeof e?.[Symbol.iterator]==`function`}function oe(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}function v(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}const se={Name:[],Document:[`definitions`],OperationDefinition:[`description`,`name`,`variableDefinitions`,`directives`,`selectionSet`],VariableDefinition:[`description`,`variable`,`type`,`defaultValue`,`directives`],Variable:[`name`],SelectionSet:[`selections`],Field:[`alias`,`name`,`arguments`,`directives`,`selectionSet`],Argument:[`name`,`value`],FragmentArgument:[`name`,`value`],FragmentSpread:[`name`,`arguments`,`directives`],InlineFragment:[`typeCondition`,`directives`,`selectionSet`],FragmentDefinition:[`description`,`name`,`variableDefinitions`,`typeCondition`,`directives`,`selectionSet`],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:[`values`],ObjectValue:[`fields`],ObjectField:[`name`,`value`],Directive:[`name`,`arguments`],NamedType:[`name`],ListType:[`type`],NonNullType:[`type`],SchemaDefinition:[`description`,`directives`,`operationTypes`],OperationTypeDefinition:[`type`],ScalarTypeDefinition:[`description`,`name`,`directives`],ObjectTypeDefinition:[`description`,`name`,`interfaces`,`directives`,`fields`],FieldDefinition:[`description`,`name`,`arguments`,`type`,`directives`],InputValueDefinition:[`description`,`name`,`type`,`defaultValue`,`directives`],InterfaceTypeDefinition:[`description`,`name`,`interfaces`,`directives`,`fields`],UnionTypeDefinition:[`description`,`name`,`directives`,`types`],EnumTypeDefinition:[`description`,`name`,`directives`,`values`],EnumValueDefinition:[`description`,`name`,`directives`],InputObjectTypeDefinition:[`description`,`name`,`directives`,`fields`],DirectiveDefinition:[`description`,`name`,`arguments`,`directives`,`locations`],SchemaExtension:[`directives`,`operationTypes`],DirectiveExtension:[`name`,`directives`],ScalarTypeExtension:[`name`,`directives`],ObjectTypeExtension:[`name`,`interfaces`,`directives`,`fields`],InterfaceTypeExtension:[`name`,`interfaces`,`directives`,`fields`],UnionTypeExtension:[`name`,`directives`,`types`],EnumTypeExtension:[`name`,`directives`,`values`],InputObjectTypeExtension:[`name`,`directives`,`fields`],TypeCoordinate:[`name`],MemberCoordinate:[`name`,`memberName`],ArgumentCoordinate:[`name`,`fieldName`,`argumentName`],DirectiveCoordinate:[`name`],DirectiveArgumentCoordinate:[`name`,`argumentName`]},ce=new Set(Object.keys(se));function le(e){let t=e?.kind;return typeof t==`string`&&ce.has(t)}const ue={QUERY:`query`,MUTATION:`mutation`,SUBSCRIPTION:`subscription`};var de=e.a({ARGUMENT:()=>ve,ARGUMENT_COORDINATE:()=>et,BOOLEAN:()=>Te,DIRECTIVE:()=>Oe,DIRECTIVE_ARGUMENT_COORDINATE:()=>nt,DIRECTIVE_COORDINATE:()=>tt,DIRECTIVE_DEFINITION:()=>Ue,DIRECTIVE_EXTENSION:()=>Ge,DOCUMENT:()=>pe,ENUM:()=>Ee,ENUM_TYPE_DEFINITION:()=>Be,ENUM_TYPE_EXTENSION:()=>Xe,ENUM_VALUE_DEFINITION:()=>Ve,FIELD:()=>_e,FIELD_DEFINITION:()=>Ie,FLOAT:()=>we,FRAGMENT_ARGUMENT:()=>ye,FRAGMENT_DEFINITION:()=>Se,FRAGMENT_SPREAD:()=>be,INLINE_FRAGMENT:()=>xe,INPUT_OBJECT_TYPE_DEFINITION:()=>He,INPUT_OBJECT_TYPE_EXTENSION:()=>Ze,INPUT_VALUE_DEFINITION:()=>Le,INT:()=>y,INTERFACE_TYPE_DEFINITION:()=>Re,INTERFACE_TYPE_EXTENSION:()=>Je,LIST:()=>S,LIST_TYPE:()=>Ae,MEMBER_COORDINATE:()=>$e,NAME:()=>fe,NAMED_TYPE:()=>ke,NON_NULL_TYPE:()=>je,NULL:()=>x,OBJECT:()=>C,OBJECT_FIELD:()=>De,OBJECT_TYPE_DEFINITION:()=>Fe,OBJECT_TYPE_EXTENSION:()=>qe,OPERATION_DEFINITION:()=>me,OPERATION_TYPE_DEFINITION:()=>Ne,SCALAR_TYPE_DEFINITION:()=>Pe,SCALAR_TYPE_EXTENSION:()=>Ke,SCHEMA_DEFINITION:()=>Me,SCHEMA_EXTENSION:()=>We,SELECTION_SET:()=>ge,STRING:()=>b,TYPE_COORDINATE:()=>Qe,UNION_TYPE_DEFINITION:()=>ze,UNION_TYPE_EXTENSION:()=>Ye,VARIABLE:()=>Ce,VARIABLE_DEFINITION:()=>he});const fe=`Name`,pe=`Document`,me=`OperationDefinition`,he=`VariableDefinition`,ge=`SelectionSet`,_e=`Field`,ve=`Argument`,ye=`FragmentArgument`,be=`FragmentSpread`,xe=`InlineFragment`,Se=`FragmentDefinition`,Ce=`Variable`,y=`IntValue`,we=`FloatValue`,b=`StringValue`,Te=`BooleanValue`,x=`NullValue`,Ee=`EnumValue`,S=`ListValue`,C=`ObjectValue`,De=`ObjectField`,Oe=`Directive`,ke=`NamedType`,Ae=`ListType`,je=`NonNullType`,Me=`SchemaDefinition`,Ne=`OperationTypeDefinition`,Pe=`ScalarTypeDefinition`,Fe=`ObjectTypeDefinition`,Ie=`FieldDefinition`,Le=`InputValueDefinition`,Re=`InterfaceTypeDefinition`,ze=`UnionTypeDefinition`,Be=`EnumTypeDefinition`,Ve=`EnumValueDefinition`,He=`InputObjectTypeDefinition`,Ue=`DirectiveDefinition`,We=`SchemaExtension`,Ge=`DirectiveExtension`,Ke=`ScalarTypeExtension`,qe=`ObjectTypeExtension`,Je=`InterfaceTypeExtension`,Ye=`UnionTypeExtension`,Xe=`EnumTypeExtension`,Ze=`InputObjectTypeExtension`,Qe=`TypeCoordinate`,$e=`MemberCoordinate`,et=`ArgumentCoordinate`,tt=`DirectiveCoordinate`,nt=`DirectiveArgumentCoordinate`;function w(e,t){if(!e)throw Error(t)}function rt(e,t){let[n,r]=t?[e,t]:[void 0,e];if(r.length===0)return``;let i=` Did you mean `;n!=null&&(i+=n+` `);let a=re(r.slice(0,5).map(e=>`"${e}"`));return i+a+`?`}function it(e){return e}function at(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}function ot(e,t){let n=0,r=0;for(;n<e.length&&r<t.length;){let i=e.charCodeAt(n),a=t.charCodeAt(r);if(ct(i)&&ct(a)){let o=0;do++n,o=o*10+i-st,i=e.charCodeAt(n);while(ct(i)&&o>0);let s=0;do++r,s=s*10+a-st,a=t.charCodeAt(r);while(ct(a)&&s>0);if(o<s)return-1;if(o>s)return 1}else{if(i<a)return-1;if(i>a)return 1;++n,++r}}return e.length-t.length}const st=48;function ct(e){return!isNaN(e)&&48<=e&&e<=57}function lt(e,t){let n=Object.create(null),r=new ut(e),i=Math.floor(e.length*.4)+1;for(let e of t){let t=r.measure(e,i);t!==void 0&&(n[e]=t)}return Object.keys(n).sort((e,t)=>{let r=n[e]-n[t];return r===0?ot(e,t):r})}var ut=class{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=dt(this._inputLowerCase),this._rows=[Array(e.length+1).fill(0),Array(e.length+1).fill(0),Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;let n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=dt(n),i=this._inputArray;if(r.length<i.length){let e=r;r=i,i=e}let a=r.length,o=i.length;if(a-o>t)return;let s=this._rows;for(let e=0;e<=o;e++)s[0][e]=e;for(let e=1;e<=a;e++){let n=s[(e-1)%3],a=s[e%3],c=a[0]=e;for(let t=1;t<=o;t++){let o=r[e-1]===i[t-1]?0:1,l=Math.min(n[t]+1,a[t-1]+1,n[t-1]+o);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){let n=s[(e-2)%3][t-2];l=Math.min(l,n+1)}l<c&&(c=l),a[t]=l}if(c>t)return}let c=s[a%3][o];return c<=t?c:void 0}};function dt(e){let t=e.length,n=Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r);return n}function T(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,r]of Object.entries(e))t[n]=r;for(let n of Object.getOwnPropertySymbols(e))t[n]=e[n];return t}function ft(e){return e===9||e===32}function pt(e){return e>=48&&e<=57}function mt(e){return e>=97&&e<=122||e>=65&&e<=90}function ht(e){return mt(e)||e===95}function gt(e){return mt(e)||pt(e)||e===95}function _t(e,t){let n=e.replaceAll(`"""`,`\\"""`),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,a=r.length>1&&r.slice(1).every(e=>e.length===0||ft(e.charCodeAt(0))),o=n.endsWith(`\\"""`),s=e.endsWith(`"`)&&!o,c=e.endsWith(`\\`),l=s||c,u=!t?.minimize&&(!i||e.length>70||l||a||o),d=``,f=i&&ft(e.charCodeAt(0));return(u&&!f||a)&&(d+=`
7
+ `),d+=n,(u||l)&&(d+=`
8
+ `),`"""`+d+`"""`}function vt(e){return`"${e.replace(yt,bt)}"`}const yt=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function bt(e){return xt[e.charCodeAt(0)]}const xt=`\\u0000.\\u0001.\\u0002.\\u0003.\\u0004.\\u0005.\\u0006.\\u0007.\\b.\\t.\\n.\\u000B.\\f.\\r.\\u000E.\\u000F.\\u0010.\\u0011.\\u0012.\\u0013.\\u0014.\\u0015.\\u0016.\\u0017.\\u0018.\\u0019.\\u001A.\\u001B.\\u001C.\\u001D.\\u001E.\\u001F...\\"..........................................................\\\\...................................\\u007F.\\u0080.\\u0081.\\u0082.\\u0083.\\u0084.\\u0085.\\u0086.\\u0087.\\u0088.\\u0089.\\u008A.\\u008B.\\u008C.\\u008D.\\u008E.\\u008F.\\u0090.\\u0091.\\u0092.\\u0093.\\u0094.\\u0095.\\u0096.\\u0097.\\u0098.\\u0099.\\u009A.\\u009B.\\u009C.\\u009D.\\u009E.\\u009F`.split(`.`),St=Object.freeze({});function Ct(e,t,n=se){let i=new Map;for(let e of Object.values(de))i.set(e,wt(t,e));let a,o=Array.isArray(e),s=[e],c=-1,l=[],u=e,d,f,p=[],m=[];do{c++;let e=c===s.length,h=e&&l.length!==0;if(e){if(d=m.length===0?void 0:p[p.length-1],u=f,f=m.pop(),h)if(o){u=u.slice();let e=0;for(let[t,n]of l){let r=t-e;n===null?(u.splice(r,1),e++):u[r]=n}}else{u={...u};for(let[e,t]of l)u[e]=t}c=a.index,s=a.keys,l=a.edits,o=a.inArray,a=a.prev}else if(f!=null){if(d=o?c:s[c],u=f[d],u==null)continue;p.push(d)}let g;if(!Array.isArray(u)){if(le(u)||w(!1,`Invalid AST Node: ${r(u)}.`),g=(e?i.get(u.kind)?.leave:i.get(u.kind)?.enter)?.call(t,u,d,f,p,m),g===St)break;if(g===!1){if(!e){p.pop();continue}}else if(g!==void 0&&(l.push([d,g]),!e))if(le(g))u=g;else{p.pop();continue}}g===void 0&&h&&l.push([d,u]),e?p.pop():(a={inArray:o,index:c,keys:s,edits:l,prev:a},o=Array.isArray(u),s=o?u:n[u.kind]??[],c=-1,l=[],f!=null&&m.push(f),f=u)}while(a!==void 0);return l.length===0?e:l.at(-1)[1]}function wt(e,t){let n=e[t];return typeof n==`object`?n:typeof n==`function`?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function E(e){return Ct(e,Tt)}const Tt={Name:{leave:e=>e.value},Variable:{leave:e=>`$`+e.name},Document:{leave:e=>D(e.definitions,`
9
+
10
+ `)},OperationDefinition:{leave(e){let t=Et(e.variableDefinitions)?k(`(
11
+ `,D(e.variableDefinitions,`
12
+ `),`
13
+ )`):k(`(`,D(e.variableDefinitions,`, `),`)`),n=k(``,e.description,`
14
+ `)+D([e.operation,D([e.name,t]),D(e.directives,` `)],` `);return(n===`query`?``:n+` `)+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:i})=>k(``,i,`
15
+ `)+e+`: `+t+k(` = `,n)+k(` `,D(r,` `))},SelectionSet:{leave:({selections:e})=>O(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){return D([Dt(D([k(``,e,`: `),t],``),n),k(` `,D(r,` `)),k(` `,i)])}},Argument:{leave:({name:e,value:t})=>e+`: `+t},FragmentArgument:{leave:({name:e,value:t})=>e+`: `+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>Dt(`...`+e,t)+k(` `,D(n,` `))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>D([`...`,k(`on `,e),D(t,` `),n],` `)},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i,description:a})=>k(``,a,`
16
+ `)+`fragment ${e}${k(`(`,D(n,`, `),`)`)} on ${t} ${k(``,D(r,` `),` `)}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t===!0?_t(e):vt(e)},BooleanValue:{leave:({value:e})=>e?`true`:`false`},NullValue:{leave:()=>`null`},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{let t=`[`+D(e,`, `)+`]`;return t.length>80?`[
17
+ `+A(D(e,`
18
+ `))+`
19
+ ]`:t}},ObjectValue:{leave:({fields:e})=>{let t=`{ `+D(e,`, `)+` }`;return t.length>80?O(e):t}},ObjectField:{leave:({name:e,value:t})=>e+`: `+t},Directive:{leave:({name:e,arguments:t})=>`@`+e+k(`(`,D(t,`, `),`)`)},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>`[`+e+`]`},NonNullType:{leave:({type:e})=>e+`!`},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>k(``,e,`
20
+ `)+D([`schema`,D(t,` `),O(n)],` `)},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+`: `+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>k(``,e,`
21
+ `)+D([`scalar`,t,D(n,` `)],` `)},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>k(``,e,`
22
+ `)+D([`type`,t,k(`implements `,D(n,` & `)),D(r,` `),O(i)],` `)},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>k(``,e,`
23
+ `)+t+(Et(n)?k(`(
24
+ `,A(D(n,`
25
+ `)),`
26
+ )`):k(`(`,D(n,`, `),`)`))+`: `+r+k(` `,D(i,` `))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>k(``,e,`
27
+ `)+D([t+`: `+n,k(`= `,r),D(i,` `)],` `)},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>k(``,e,`
28
+ `)+D([`interface`,t,k(`implements `,D(n,` & `)),D(r,` `),O(i)],` `)},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>k(``,e,`
29
+ `)+D([`union`,t,D(n,` `),k(`= `,D(r,` | `))],` `)},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>k(``,e,`
30
+ `)+D([`enum`,t,D(n,` `),O(r)],` `)},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>k(``,e,`
31
+ `)+D([t,D(n,` `)],` `)},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>k(``,e,`
32
+ `)+D([`input`,t,D(n,` `),O(r)],` `)},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:r,repeatable:i,locations:a})=>k(``,e,`
33
+ `)+`directive @`+t+(Et(n)?k(`(
34
+ `,A(D(n,`
35
+ `)),`
36
+ )`):k(`(`,D(n,`, `),`)`))+k(` `,D(r,` `))+(i?` repeatable`:``)+` on `+D(a,` | `)},SchemaExtension:{leave:({directives:e,operationTypes:t})=>D([`extend schema`,D(e,` `),O(t)],` `)},ScalarTypeExtension:{leave:({name:e,directives:t})=>D([`extend scalar`,e,D(t,` `)],` `)},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>D([`extend type`,e,k(`implements `,D(t,` & `)),D(n,` `),O(r)],` `)},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>D([`extend interface`,e,k(`implements `,D(t,` & `)),D(n,` `),O(r)],` `)},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>D([`extend union`,e,D(t,` `),k(`= `,D(n,` | `))],` `)},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>D([`extend enum`,e,D(t,` `),O(n)],` `)},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>D([`extend input`,e,D(t,` `),O(n)],` `)},DirectiveExtension:{leave:({name:e,directives:t})=>D([`extend directive @`+e,D(t,` `)],` `)},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>D([e,k(`.`,t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>D([e,k(`.`,t),k(`(`,n,`:)`)])},DirectiveCoordinate:{leave:({name:e})=>D([`@`,e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>D([`@`,e,k(`(`,t,`:)`)])}};function D(e,t=``){return e?.filter(e=>e!==void 0&&e!==``).join(t)??``}function O(e){return k(`{
37
+ `,A(D(e,`
38
+ `)),`
39
+ }`)}function k(e,t,n=``){return t!=null&&t!==``?e+t+n:``}function A(e){return k(` `,e.replaceAll(`
40
+ `,`
41
+ `))}function Et(e){return e?.some(e=>e.includes(`
42
+ `))??!1}function Dt(e,t){let n=e+k(`(`,D(t,`, `),`)`);return n.length>80&&(n=e+k(`(
43
+ `,A(D(t,`
44
+ `)),`
45
+ )`)),n}function Ot(e,t){switch(e.kind){case x:return null;case y:return parseInt(e.value,10);case we:return parseFloat(e.value);case b:case Ee:case Te:return e.value;case S:return e.values.map(e=>Ot(e,t));case C:return at(e.fields,e=>e.name.value,e=>Ot(e.value,t));case Ce:return t?.[e.name.value]}}function j(e){if(e.length===0)throw new _(`Expected name to be a non-empty string.`);for(let t=1;t<e.length;++t)if(!gt(e.charCodeAt(t)))throw new _(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!ht(e.charCodeAt(0)))throw new _(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function kt(e){if(e===`true`||e===`false`||e===`null`)throw new _(`Enum values cannot be named: ${e}`);return j(e)}const At=Symbol(`Scalar`);function jt(e){return d(e,At,z)}const Mt=Symbol(`Object`);function M(e){return d(e,Mt,B)}const Nt=Symbol(`Field`),Pt=Symbol(`Argument`),Ft=Symbol(`Interface`);function N(e){return d(e,Ft,nn)}const It=Symbol(`Union`);function P(e){return d(e,It,rn)}const Lt=Symbol(`Enum`);function Rt(e){return d(e,Lt,on)}const zt=Symbol(`EnumValue`),Bt=Symbol(`InputObject`);function F(e){return d(e,Bt,un)}const Vt=Symbol(`InputField`),Ht=Symbol(`List`);function Ut(e){return d(e,Ht,L)}const Wt=Symbol(`NonNull`);function I(e){return d(e,Wt,R)}function Gt(e){return jt(e)||Rt(e)}function Kt(e){if(!Gt(e))throw Error(`Expected ${r(e)} to be a GraphQL leaf type.`);return e}function qt(e){return N(e)||P(e)}var L=class{constructor(e){this.__kind=Ht,this.ofType=e}get[Symbol.toStringTag](){return`GraphQLList`}toString(){return`[`+String(this.ofType)+`]`}toJSON(){return this.toString()}},R=class{constructor(e){this.__kind=Wt,this.ofType=e}get[Symbol.toStringTag](){return`GraphQLNonNull`}toString(){return String(this.ofType)+`!`}toJSON(){return this.toString()}};function Jt(e){return Ut(e)||I(e)}function Yt(e){if(e){let t=e;for(;Jt(t);)t=t.ofType;return t}}function Xt(e){return typeof e==`function`?e():e}function Zt(e){return typeof e==`function`?e():e}var z=class{constructor(e){this.__kind=At,this.name=j(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=e.serialize??e.coerceOutputValue??it,this.parseValue=e.parseValue??e.coerceInputValue??it,this.parseLiteral=e.parseLiteral??((e,t)=>this.coerceInputValue(Ot(e,t))),this.coerceOutputValue=e.coerceOutputValue??this.serialize,this.coerceInputValue=e.coerceInputValue??this.parseValue,this.coerceInputLiteral=e.coerceInputLiteral,this.valueToLiteral=e.valueToLiteral,this.extensions=T(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.parseLiteral&&(typeof e.parseValue==`function`&&typeof e.parseLiteral==`function`||w(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)),e.coerceInputLiteral&&(typeof e.coerceInputValue==`function`&&typeof e.coerceInputLiteral==`function`||w(!1,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`))}get[Symbol.toStringTag](){return`GraphQLScalarType`}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},B=class{constructor(e){this.__kind=Mt,this.__kind=Mt,this.name=j(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=T(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=$t.bind(void 0,this,e.fields),this._interfaces=Qt.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return`GraphQLObjectType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces==`function`&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:v(this.getFields(),e=>e.toConfig()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function Qt(e){return Xt(e??[])}function $t(e,t){return v(Zt(t),(t,n)=>new en(e,n,t))}var en=class{constructor(e,t,n){this.__kind=Nt,this.parentType=e,this.name=j(t),this.description=n.description,this.type=n.type;let r=n.args;this.args=r?Object.entries(r).map(([e,t])=>new tn(this,e,t)):[],this.resolve=n.resolve,this.subscribe=n.subscribe,this.deprecationReason=n.deprecationReason,this.extensions=T(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return`GraphQLField`}toConfig(){return{description:this.description,type:this.type,args:at(this.args,e=>e.name,e=>e.toConfig()),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??`<meta>`}.${this.name}`}toJSON(){return this.toString()}},tn=class{constructor(e,t,n){this.__kind=Pt,this.parent=e,this.name=j(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=n.deprecationReason,this.extensions=T(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return`GraphQLArgument`}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}},nn=class{constructor(e){this.__kind=Ft,this.name=j(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=T(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=$t.bind(void 0,this,e.fields),this._interfaces=Qt.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return`GraphQLInterfaceType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces==`function`&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:v(this.getFields(),e=>e.toConfig()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},rn=class{constructor(e){this.__kind=It,this.name=j(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=T(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=an.bind(void 0,e.types)}get[Symbol.toStringTag](){return`GraphQLUnionType`}getTypes(){return typeof this._types==`function`&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function an(e){return Xt(e)}var on=class{constructor(e){this.__kind=Lt,this.name=j(e.name),this.description=e.description,this.extensions=T(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values=sn.bind(void 0,this,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return`GraphQLEnumType`}getValues(){return typeof this._values==`function`&&(this._values=this._values()),this._values}getValue(e){return this._nameLookup??=oe(this.getValues(),e=>e.name),this._nameLookup[e]}serialize(e){return this.coerceOutputValue(e)}coerceOutputValue(e){this._valueLookup??=new Map(this.getValues().map(e=>[e.value,e]));let t=this._valueLookup.get(e);if(t===void 0)throw new _(`Enum "${this.name}" cannot represent value: ${r(e)}`);return t.name}parseValue(e,t){return this.coerceInputValue(e,t)}coerceInputValue(e,t){if(typeof e!=`string`){let n=r(e);throw new _(`Enum "${this.name}" cannot represent non-string value: ${n}.`+(t?``:cn(this,n)))}let n=this.getValue(e);if(n==null)throw new _(`Value "${e}" does not exist in "${this.name}" enum.`+(t?``:cn(this,e)));return n.value}parseLiteral(e,t,n){return this.coerceInputLiteral(e,n)}coerceInputLiteral(e,t){if(e.kind!==`EnumValue`){let n=E(e);throw new _(`Enum "${this.name}" cannot represent non-enum value: ${n}.`+(t?``:cn(this,n)),{nodes:e})}let n=this.getValue(e.value);if(n==null){let n=E(e);throw new _(`Value "${n}" does not exist in "${this.name}" enum.`+(t?``:cn(this,n)),{nodes:e})}return n.value}valueToLiteral(e){if(typeof e==`string`&&this.getValue(e))return{kind:Ee,value:e}}toConfig(){return{name:this.name,description:this.description,values:at(this.getValues(),e=>e.name,e=>e.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function sn(e,t){let n=Zt(t);return Object.entries(n).map(([t,n])=>new ln(e,t,n))}function cn(e,t){return rt(`the enum value`,lt(t,e.getValues().map(e=>e.name)))}var ln=class{constructor(e,t,n){this.__kind=zt,this.parentEnum=e,this.name=kt(t),this.description=n.description,this.value=n.value===void 0?t:n.value,this.deprecationReason=n.deprecationReason,this.extensions=T(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return`GraphQLEnumValue`}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}},un=class{constructor(e){this.__kind=Bt,this.name=j(e.name),this.description=e.description,this.extensions=T(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=dn.bind(void 0,this,e.fields)}get[Symbol.toStringTag](){return`GraphQLInputObjectType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}toConfig(){return{name:this.name,description:this.description,fields:v(this.getFields(),e=>e.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}};function dn(e,t){return v(Zt(t),(t,n)=>new fn(e,n,t))}var fn=class{constructor(e,t,n){`resolve`in n&&w(!1,`${e}.${t} field has a resolve property, but Input Types cannot define resolvers.`),this.__kind=Vt,this.parentType=e,this.name=j(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=n.deprecationReason,this.extensions=T(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return`GraphQLInputField`}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}};function pn(e){return I(e.type)&&e.defaultValue===void 0&&e.default===void 0}function V(e,t){if(I(t))return e==null?void 0:V(e,t.ofType);if(e==null)return{kind:x};if(Ut(t)){if(!ae(e))return V(e,t.ofType);let n=[];for(let r of e){let e=V(r,t.ofType);if(!e)return;n.push(e)}return{kind:S,values:n}}if(F(t)){if(!f(e))return;let n=[],r=t.getFields();if(Object.keys(e).some(t=>e[t]!==void 0&&!Object.hasOwn(r,t)))return;for(let r of Object.values(t.getFields()))if(e[r.name]===void 0){if(pn(r))return}else{let t=V(e[r.name],r.type);if(!t)return;n.push({kind:De,name:{kind:fe,value:r.name},value:t})}return{kind:C,fields:n}}let n=Kt(t);if(n.valueToLiteral)try{return n.valueToLiteral(e)}catch{return}return H(e)}function H(e){if(e==null)return{kind:x};switch(typeof e){case`boolean`:return{kind:Te,value:e};case`string`:return{kind:b,value:e,block:!1};case`bigint`:return{kind:y,value:e.toString()};case`number`:{if(!Number.isFinite(e))return{kind:x};let t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:y,value:t}:{kind:we,value:t}}case`object`:{if(ae(e))return{kind:S,values:Array.from(e,H)};let t=e,n=[];for(let e of Object.keys(t)){let r=t[e];r!==void 0&&n.push({kind:De,name:{kind:fe,value:e},value:H(r)})}return{kind:C,fields:n}}}throw TypeError(`Cannot convert value to AST: ${r(e)}.`)}const U={QUERY:`QUERY`,MUTATION:`MUTATION`,SUBSCRIPTION:`SUBSCRIPTION`,FIELD:`FIELD`,FRAGMENT_DEFINITION:`FRAGMENT_DEFINITION`,FRAGMENT_SPREAD:`FRAGMENT_SPREAD`,INLINE_FRAGMENT:`INLINE_FRAGMENT`,VARIABLE_DEFINITION:`VARIABLE_DEFINITION`,FRAGMENT_VARIABLE_DEFINITION:`FRAGMENT_VARIABLE_DEFINITION`,SCHEMA:`SCHEMA`,SCALAR:`SCALAR`,OBJECT:`OBJECT`,FIELD_DEFINITION:`FIELD_DEFINITION`,ARGUMENT_DEFINITION:`ARGUMENT_DEFINITION`,INTERFACE:`INTERFACE`,UNION:`UNION`,ENUM:`ENUM`,ENUM_VALUE:`ENUM_VALUE`,INPUT_OBJECT:`INPUT_OBJECT`,INPUT_FIELD_DEFINITION:`INPUT_FIELD_DEFINITION`,DIRECTIVE_DEFINITION:`DIRECTIVE_DEFINITION`},mn=new z({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.",coerceOutputValue(e){let t=K(e);if(typeof t==`number`)return _n(t);if(typeof t==`boolean`)return+!!t;if(typeof t==`string`)return vn(t);if(typeof t==`bigint`)return yn(t);throw new _(`Int cannot represent non-integer value: ${r(t)}`)},coerceInputValue(e){if(typeof e==`number`)return _n(e);if(typeof e==`bigint`)return yn(e);throw new _(`Int cannot represent non-integer value: ${r(e)}`)},coerceInputLiteral(e){if(e.kind!==`IntValue`)throw new _(`Int cannot represent non-integer value: ${E(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>2147483647||t<-2147483648)throw new _(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t},valueToLiteral(e){if((typeof e==`number`&&Number.isInteger(e)||typeof e==`bigint`)&&e<=2147483647&&e>=-2147483648)return{kind:y,value:String(e)}}}),hn=new z({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).",coerceOutputValue(e){let t=K(e);if(typeof t==`number`)return bn(t);if(typeof t==`boolean`)return+!!t;if(typeof t==`string`)return xn(t);if(typeof t==`bigint`)return Sn(t);throw new _(`Float cannot represent non numeric value: ${r(t)}`)},coerceInputValue(e){if(typeof e==`number`)return bn(e);if(typeof e==`bigint`)return Sn(e);throw new _(`Float cannot represent non numeric value: ${r(e)}`)},coerceInputLiteral(e){if(e.kind!==`FloatValue`&&e.kind!==`IntValue`)throw new _(`Float cannot represent non numeric value: ${E(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){let t=H(e);if(t.kind===`FloatValue`||t.kind===`IntValue`)return t}}),W=new z({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.",coerceOutputValue(e){let t=K(e);if(typeof t==`string`)return t;if(typeof t==`boolean`)return t?`true`:`false`;if(typeof t==`number`)return Cn(t);if(typeof t==`bigint`)return String(t);throw new _(`String cannot represent value: ${r(e)}`)},coerceInputValue(e){if(typeof e!=`string`)throw new _(`String cannot represent a non string value: ${r(e)}`);return e},coerceInputLiteral(e){if(e.kind!==`StringValue`)throw new _(`String cannot represent a non string value: ${E(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=H(e);if(t.kind===`StringValue`)return t}}),G=new z({name:`Boolean`,description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){let t=K(e);if(typeof t==`boolean`)return t;if(typeof t==`number`)return wn(t);if(typeof t==`bigint`)return t!==0n;throw new _(`Boolean cannot represent a non boolean value: ${r(t)}`)},coerceInputValue(e){if(typeof e!=`boolean`)throw new _(`Boolean cannot represent a non boolean value: ${r(e)}`);return e},coerceInputLiteral(e){if(e.kind!==`BooleanValue`)throw new _(`Boolean cannot represent a non boolean value: ${E(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=H(e);if(t.kind===`BooleanValue`)return t}}),gn=new z({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.',coerceOutputValue(e){let t=K(e);if(typeof t==`string`)return t;if(typeof t==`number`)return Tn(t);if(typeof t==`bigint`)return String(t);throw new _(`ID cannot represent value: ${r(e)}`)},coerceInputValue(e){if(typeof e==`string`)return e;if(typeof e==`number`)return Tn(e);if(typeof e==`bigint`)return String(e);throw new _(`ID cannot represent value: ${r(e)}`)},coerceInputLiteral(e){if(e.kind!==`StringValue`&&e.kind!==`IntValue`)throw new _(`ID cannot represent a non-string and non-integer value: `+E(e),{nodes:e});return e.value},valueToLiteral(e){if(typeof e==`string`)return/^-?(?:0|[1-9][0-9]*)$/.test(e)?{kind:y,value:e}:{kind:b,value:e,block:!1};if(typeof e==`number`)return{kind:y,value:Tn(e)};if(typeof e==`bigint`)return{kind:y,value:String(e)}}});Object.freeze([W,mn,hn,G,gn]);function K(e){if(f(e)){if(typeof e.valueOf==`function`){let t=e.valueOf();if(!f(t))return t}if(typeof e.toJSON==`function`)return e.toJSON()}return e}function _n(e){if(!Number.isInteger(e))throw new _(`Int cannot represent non-integer value: ${r(e)}`);if(e>2147483647||e<-2147483648)throw new _(`Int cannot represent non 32-bit signed integer value: ${r(e)}`);return e}function vn(e){if(e===``)throw new _(`Int cannot represent non-integer value: ${r(e)}`);let t=Number(e);if(!Number.isInteger(t))throw new _(`Int cannot represent non-integer value: ${r(e)}`);if(t>2147483647||t<-2147483648)throw new _(`Int cannot represent non 32-bit signed integer value: ${r(e)}`);return t}function yn(e){if(e>2147483647||e<-2147483648)throw new _(`Int cannot represent non 32-bit signed integer value: ${String(e)}`);return Number(e)}function bn(e){if(!Number.isFinite(e))throw new _(`Float cannot represent non numeric value: ${r(e)}`);return e}function xn(e){if(e===``)throw new _(`Float cannot represent non numeric value: ${r(e)}`);let t=Number(e);if(!Number.isFinite(t))throw new _(`Float cannot represent non numeric value: ${r(e)}`);return t}function Sn(e){let t=Number(e);if(!Number.isFinite(t))throw new _(`Float cannot represent non numeric value: ${r(e)} (value is too large)`);if(BigInt(t)!==e)throw new _(`Float cannot represent non numeric value: ${r(e)} (value would lose precision)`);return t}function Cn(e){if(!Number.isFinite(e))throw new _(`String cannot represent value: ${r(e)}`);return String(e)}function wn(e){if(!Number.isFinite(e))throw new _(`Boolean cannot represent a non boolean value: ${r(e)}`);return e!==0}function Tn(e){if(!Number.isInteger(e))throw new _(`ID cannot represent value: ${r(e)}`);return String(e)}const En=Symbol(`Directive`);function Dn(e){return d(e,En,q)}var q=class{constructor(e){this.__kind=En,this.name=j(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.deprecationReason=e.deprecationReason,this.extensions=T(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],Array.isArray(e.locations)||w(!1,`@${this.name} locations must be an Array.`);let t=e.args??{};f(t)&&!Array.isArray(t)||w(!1,`@${this.name} args must be an object with argument names as keys.`),this.args=Object.entries(t).map(([e,t])=>new tn(this,e,t))}get[Symbol.toStringTag](){return`GraphQLDirective`}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:at(this.args,e=>e.name,e=>e.toConfig()),isRepeatable:this.isRepeatable,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return`@`+this.name}toJSON(){return this.toString()}};const On=new q({name:`include`,description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[U.FIELD,U.FRAGMENT_SPREAD,U.INLINE_FRAGMENT],args:{if:{type:new R(G),description:`Included when true.`}}}),kn=new q({name:`skip`,description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[U.FIELD,U.FRAGMENT_SPREAD,U.INLINE_FRAGMENT],args:{if:{type:new R(G),description:`Skipped when true.`}}});new q({name:`defer`,description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[U.FRAGMENT_SPREAD,U.INLINE_FRAGMENT],args:{if:{type:new R(G),description:`Deferred when true or undefined.`,default:{value:!0}},label:{type:W,description:`Unique name`}}}),new q({name:`stream`,description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[U.FIELD],args:{initialCount:{default:{value:0},type:new R(mn),description:`Number of items to return immediately`},if:{type:new R(G),description:`Stream when true or undefined.`,default:{value:!0}},label:{type:W,description:`Unique name`}}});const An=new q({name:`deprecated`,description:`Marks an element of a GraphQL schema as no longer supported.`,locations:[U.FIELD_DEFINITION,U.ARGUMENT_DEFINITION,U.INPUT_FIELD_DEFINITION,U.ENUM_VALUE,U.DIRECTIVE_DEFINITION],args:{reason:{type:new R(W),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/).`,default:{value:`No longer supported`}}}}),jn=new q({name:`specifiedBy`,description:`Exposes a URL that specifies the behavior of this scalar.`,locations:[U.SCALAR],args:{url:{type:new R(W),description:`The URL that specifies the behavior of this scalar.`}}}),Mn=new q({name:`oneOf`,description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[U.INPUT_OBJECT],args:{}});new q({name:`experimental_disableErrorPropagation`,description:`Disables error propagation.`,locations:[U.QUERY,U.MUTATION,U.SUBSCRIPTION]});const Nn=Object.freeze([On,kn,An,jn,Mn]);function J(e,t){if(I(t)){let n=J(e,t.ofType);return n?.kind===`NullValue`?null:n}if(e===null)return{kind:x};if(e===void 0)return null;if(Ut(t)){let n=t.ofType;if(ae(e)){let t=[];for(let r of e){let e=J(r,n);e!=null&&t.push(e)}return{kind:S,values:t}}return J(e,n)}if(F(t)){if(!f(e))return null;let n=[];for(let r of Object.values(t.getFields())){let t=J(e[r.name],r.type);t&&n.push({kind:De,name:{kind:fe,value:r.name},value:t})}return{kind:C,fields:n}}if(Gt(t)){let n=t.coerceOutputValue(e);if(n==null)return null;if(typeof n==`boolean`)return{kind:Te,value:n};if(typeof n==`number`&&Number.isFinite(n)){let e=String(n);return Pn.test(e)?{kind:y,value:e}:{kind:we,value:e}}if(typeof n==`bigint`)return{kind:y,value:String(n)};if(typeof n==`string`)return Rt(t)?{kind:Ee,value:n}:t===gn&&Pn.test(n)?{kind:y,value:n}:{kind:b,value:n};throw TypeError(`Cannot convert value to AST: ${r(n)}.`)}p(!1,`Unexpected input type: `+r(t))}const Pn=/^-?(?:0|[1-9][0-9]*)$/;function Fn(e){let t=e.type,n=e.default;if(n){let e=n.literal??V(n.value,t);return e??p(!1,`Invalid default value`),e}let r=e.defaultValue;if(r!==void 0){let e=J(r,t);return e??p(!1,`Invalid default value`),e}}const In=new B({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:()=>({description:{type:W,resolve:e=>e.description},types:{description:`A list of all types supported by this server.`,type:new R(new L(new R(Y))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:`The type that query operations will be rooted at.`,type:new R(Y),resolve:e=>e.getQueryType()},mutationType:{description:`If this server supports mutation, the type that mutation operations will be rooted at.`,type:Y,resolve:e=>e.getMutationType()},subscriptionType:{description:`If this server support subscription, the type that subscription operations will be rooted at.`,type:Y,resolve:e=>e.getSubscriptionType()},directives:{description:`A list of all directives supported by this server.`,type:new R(new L(new R(Ln))),args:{includeDeprecated:{type:new R(G),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>t===!0?e.getDirectives():e.getDirectives().filter(e=>e.deprecationReason==null)}})}),Ln=new B({name:`__Directive`,description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
46
+
47
+ 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:()=>({name:{type:new R(W),resolve:e=>e.name},description:{type:W,resolve:e=>e.description},isRepeatable:{type:new R(G),resolve:e=>e.isRepeatable},locations:{type:new R(new L(new R(Rn))),resolve:e=>e.locations},args:{type:new R(new L(new R(Bn))),args:{includeDeprecated:{type:new R(G),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter(e=>e.deprecationReason==null)}},isDeprecated:{type:new R(G),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:W,resolve:e=>e.deprecationReason}})}),Rn=new on({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:U.QUERY,description:`Location adjacent to a query operation.`},MUTATION:{value:U.MUTATION,description:`Location adjacent to a mutation operation.`},SUBSCRIPTION:{value:U.SUBSCRIPTION,description:`Location adjacent to a subscription operation.`},FIELD:{value:U.FIELD,description:`Location adjacent to a field.`},FRAGMENT_DEFINITION:{value:U.FRAGMENT_DEFINITION,description:`Location adjacent to a fragment definition.`},FRAGMENT_SPREAD:{value:U.FRAGMENT_SPREAD,description:`Location adjacent to a fragment spread.`},INLINE_FRAGMENT:{value:U.INLINE_FRAGMENT,description:`Location adjacent to an inline fragment.`},VARIABLE_DEFINITION:{value:U.VARIABLE_DEFINITION,description:`Location adjacent to an operation variable definition.`},FRAGMENT_VARIABLE_DEFINITION:{value:U.FRAGMENT_VARIABLE_DEFINITION,description:`Location adjacent to a fragment variable definition.`},SCHEMA:{value:U.SCHEMA,description:`Location adjacent to a schema definition.`},SCALAR:{value:U.SCALAR,description:`Location adjacent to a scalar definition.`},OBJECT:{value:U.OBJECT,description:`Location adjacent to an object type definition.`},FIELD_DEFINITION:{value:U.FIELD_DEFINITION,description:`Location adjacent to a field definition.`},ARGUMENT_DEFINITION:{value:U.ARGUMENT_DEFINITION,description:`Location adjacent to an argument definition.`},INTERFACE:{value:U.INTERFACE,description:`Location adjacent to an interface definition.`},UNION:{value:U.UNION,description:`Location adjacent to a union definition.`},ENUM:{value:U.ENUM,description:`Location adjacent to an enum definition.`},ENUM_VALUE:{value:U.ENUM_VALUE,description:`Location adjacent to an enum value definition.`},INPUT_OBJECT:{value:U.INPUT_OBJECT,description:`Location adjacent to an input object type definition.`},INPUT_FIELD_DEFINITION:{value:U.INPUT_FIELD_DEFINITION,description:`Location adjacent to an input object field definition.`},DIRECTIVE_DEFINITION:{value:U.DIRECTIVE_DEFINITION,description:`Location adjacent to a directive definition.`}}}),Y=new B({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:()=>({kind:{type:new R(Hn),resolve(e){if(jt(e))return X.SCALAR;if(M(e))return X.OBJECT;if(N(e))return X.INTERFACE;if(P(e))return X.UNION;if(Rt(e))return X.ENUM;if(F(e))return X.INPUT_OBJECT;if(Ut(e))return X.LIST;if(I(e))return X.NON_NULL;p(!1,`Unexpected type: "${r(e)}".`)}},name:{type:W,resolve:e=>`name`in e?e.name:void 0},description:{type:W,resolve:e=>`description`in e?e.description:void 0},specifiedByURL:{type:W,resolve:e=>`specifiedByURL`in e?e.specifiedByURL:void 0},fields:{type:new L(new R(zn)),args:{includeDeprecated:{type:new R(G),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(M(e)||N(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter(e=>e.deprecationReason==null)}}},interfaces:{type:new L(new R(Y)),resolve(e){if(M(e)||N(e))return e.getInterfaces()}},possibleTypes:{type:new L(new R(Y)),resolve(e,t,n,{schema:r}){if(qt(e))return r.getPossibleTypes(e)}},enumValues:{type:new L(new R(Vn)),args:{includeDeprecated:{type:new R(G),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(Rt(e)){let n=e.getValues();return t===!0?n:n.filter(e=>e.deprecationReason==null)}}},inputFields:{type:new L(new R(Bn)),args:{includeDeprecated:{type:new R(G),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(F(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter(e=>e.deprecationReason==null)}}},ofType:{type:Y,resolve:e=>`ofType`in e?e.ofType:void 0},isOneOf:{type:G,resolve:e=>{if(F(e))return e.isOneOf}}})}),zn=new B({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:()=>({name:{type:new R(W),resolve:e=>e.name},description:{type:W,resolve:e=>e.description},args:{type:new R(new L(new R(Bn))),args:{includeDeprecated:{type:new R(G),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter(e=>e.deprecationReason==null)}},type:{type:new R(Y),resolve:e=>e.type},isDeprecated:{type:new R(G),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:W,resolve:e=>e.deprecationReason}})}),Bn=new B({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:()=>({name:{type:new R(W),resolve:e=>e.name},description:{type:W,resolve:e=>e.description},type:{type:new R(Y),resolve:e=>e.type},defaultValue:{type:W,description:`A GraphQL-formatted string representing the default value for this input value.`,resolve(e){let t=Fn(e);return t?E(t):null}},isDeprecated:{type:new R(G),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:W,resolve:e=>e.deprecationReason}})}),Vn=new B({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:()=>({name:{type:new R(W),resolve:e=>e.name},description:{type:W,resolve:e=>e.description},isDeprecated:{type:new R(G),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:W,resolve:e=>e.deprecationReason}})}),X={SCALAR:`SCALAR`,OBJECT:`OBJECT`,INTERFACE:`INTERFACE`,UNION:`UNION`,ENUM:`ENUM`,INPUT_OBJECT:`INPUT_OBJECT`,LIST:`LIST`,NON_NULL:`NON_NULL`},Hn=new on({name:`__TypeKind`,description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:X.SCALAR,description:`Indicates this type is a scalar.`},OBJECT:{value:X.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:X.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:X.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:X.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:X.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:X.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:X.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Un=new en(void 0,`__schema`,{type:new R(In),description:`Access the current type schema of this server.`,resolve:(e,t,n,{schema:r})=>r}),Wn=new en(void 0,`__type`,{type:Y,description:`Request the type information of a single type.`,args:{name:{type:new R(W)}},resolve:(e,{name:t},n,{schema:r})=>r.getType(t)}),Gn=new en(void 0,`__typename`,{type:new R(W),description:`The name of the current Object type at runtime.`,resolve:(e,t,n,{parentType:r})=>r.name});Object.freeze([In,Ln,Rn,Y,zn,Bn,Vn,Hn]);function Kn(e){return d(e,qn,Jn)}const qn=Symbol(`Schema`);var Jn=class{constructor(e){this.__kind=qn,this.assumeValid=e.assumeValid??!1,this.__validationErrors=e.assumeValid===!0?[]:void 0,this.description=e.description,this.extensions=T(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??Nn;let t=new Set(e.types);if(e.types!=null)for(let n of e.types)t.delete(n),Z(n,t);this._queryType!=null&&Z(this._queryType,t),this._mutationType!=null&&Z(this._mutationType,t),this._subscriptionType!=null&&Z(this._subscriptionType,t);for(let e of this._directives)if(Dn(e))for(let n of e.args)Z(n.type,t);Z(In,t),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(let e of t){if(e==null)continue;let t=e.name;if(this._typeMap[t]!==void 0)throw Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,N(e)){for(let t of e.getInterfaces())if(N(t)){let n=this._implementationsMap[t.name];n??=this._implementationsMap[t.name]={objects:[],interfaces:[]},n.interfaces.push(e)}}else if(M(e)){for(let t of e.getInterfaces())if(N(t)){let n=this._implementationsMap[t.name];n??=this._implementationsMap[t.name]={objects:[],interfaces:[]},n.objects.push(e)}}}}get[Symbol.toStringTag](){return`GraphQLSchema`}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case ue.QUERY:return this.getQueryType();case ue.MUTATION:return this.getMutationType();case ue.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return P(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap.get(e);if(n===void 0){if(P(e))n=new Set(e.getTypes());else{let t=this.getImplementations(e);n=new Set([...t.objects,...t.interfaces])}this._subTypeMap.set(e,n)}return n.has(t)}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(t=>t.name===e)}getField(e,t){switch(t){case Un.name:return this.getQueryType()===e?Un:void 0;case Wn.name:return this.getQueryType()===e?Wn:void 0;case Gn.name:return Gn}if(`getFields`in e)return e.getFields()[t]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.assumeValid}}};function Z(e,t){let n=Yt(e);if(!t.has(n)){if(t.add(n),P(n))for(let e of n.getTypes())Z(e,t);else if(M(n)||N(n)){for(let e of n.getInterfaces())Z(e,t);for(let e of Object.values(n.getFields())){Z(e.type,t);for(let n of e.args)Z(n.type,t)}}else if(F(n))for(let e of Object.values(n.getFields()))Z(e.type,t)}return t}var Yn;function Q(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var $=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};(Yn=globalThis).__zod_globalConfig??(Yn.__zod_globalConfig={});const Xn=globalThis.__zod_globalConfig;function Zn(e){return e&&Object.assign(Xn,e),Xn}function Qn(e,t){return typeof t==`bigint`?t.toString():t}const $n=Symbol(`evaluating`);function er(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==$n)return r===void 0&&(r=$n,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}const tr=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function nr(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function rr(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}-Number.MAX_VALUE,Number.MAX_VALUE;function ir(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ar(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function or(e){return typeof e==`string`?e:e?.message}function sr(e,t,n){let r=e.message?e.message:or(e.inst?._zod.def?.error?.(e))??or(t?.error?.(e))??or(n.customError?.(e))??or(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function cr(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const lr=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Qn,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ur=Q(`$ZodError`,lr),dr=Q(`$ZodError`,lr,{Parent:Error}),fr=(e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new $;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>sr(e,a,Zn())));throw tr(t,i?.callee),t}return o.value})(dr),pr=(e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>sr(e,a,Zn())));throw tr(t,i?.callee),t}return o.value})(dr),mr=(e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new $;return a.issues.length?{success:!1,error:new(e??ur)(a.issues.map(e=>sr(e,i,Zn())))}:{success:!0,data:a.value}})(dr),hr=(e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>sr(e,i,Zn())))}:{success:!0,data:a.value}})(dr),gr=Q(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),_r={major:4,minor:4,patch:3},vr=Q(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_r;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=ir(e),i;for(let a of t){if(a._zod.def.when){if(ar(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new $;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=ir(e,t))});else{if(e.issues.length===t)continue;r||=ir(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(ir(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new $;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new $;return o.then(e=>t(e,r,a))}return t(o,r,a)}}er(e,`~standard`,()=>({validate:t=>{try{let n=mr(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return hr(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),yr=Q(`$ZodCustom`,(e,t)=>{gr.init(e,t),vr.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>br(t,n,r,e));br(i,n,r,e)}});function br(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(cr(e))}}function xr(e,t,n){let r=rr(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Sr(e,t){let n=Cr(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(cr(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(cr(r))}},e(t.value,t)),t);return n}function Cr(e,t){let n=new gr({check:`custom`,...rr(t)});return n._zod.check=e,n}const wr=Q(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);vr.init(e,t),e.def=t,e.type=t.type,e.parse=(t,n)=>fr(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>mr(e,t,n),e.parseAsync=async(t,n)=>pr(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>hr(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0}),e.with=e.check,e.clone=(t,n)=>nr(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.apply=t=>t(e)}),Tr=Q(`ZodMiniCustom`,(e,t)=>{yr.init(e,t),wr.init(e,t)});function Er(e,t){return xr(Tr,e??(()=>!0),t)}function Dr(e,t){return Sr(e,t)}function Or(e){return e.getQueryType()!=null||e.getMutationType()!=null||e.getSubscriptionType()!=null}const kr=Er(e=>Kn(e)&&Or(e),`Expected a GraphQLSchema instance with at least one root operation type`).check(Dr((e,t)=>{let n=e.getTypeMap();for(let[e,r]of Object.entries(n))r.name!==e&&t.addIssue({code:`custom`,message:`Type map entry "${e}" does not match type name "${r.name}"`,path:[`types`,e]})}));var Ar=(0,n.defineSchema)({meta:{name:`graphql-schema`,title:`GraphQL Schema`,version:`1.0`,description:`A GraphQL schema document used to describe a GraphQL API. This schema is compatible with the GraphQL specification and can be used to validate and generate code from the schema. Some examples of tools that can be used to generate client and/or server libraries, documentation, and other tools are: GraphQL Code Generator, GraphQL Yoga, Apollo Server, and many more.`,spec:e=>{if(e.description)return e.description;let t=[e.getQueryType()?.name,e.getMutationType()?.name,e.getSubscriptionType()?.name].filter(e=>e!=null);return t.length>0?`A GraphQL API schema with ${t.join(`, `)} root operation type${t.length===1?``:`s`}.`:`A GraphQL API schema.`},tags:e=>Object.keys(e.getTypeMap()).filter(e=>!e.startsWith(`__`)),links:e=>{let t=[];for(let n of Object.values(e.getTypeMap()))jt(n)&&n.specifiedByURL&&t.push({href:n.specifiedByURL,description:n.description??`${n.name} scalar specification`});return t}},schema:kr}),jr=(0,n.defineGenerator)({meta:{name:`alloy-js`,description:`A generator that uses Alloy-js to generate source code from a specification.`,version:`1.0`,tags:[`alloy-js`],links:[{description:`Alloy-js Repository`,href:`https://github.com/alloy-framework/alloy`},{description:`Alloy-js Documentation`,href:`https://alloy-framework.github.io/alloy/guides/getting-started/`}]},schema:Ar,generator:async(e,r)=>t.t((0,n.useExecutionContext)(),e,r.template)});module.exports=jr;
@@ -0,0 +1,22 @@
1
+ import { Children } from "@alloy-js/core";
2
+
3
+ //#region src/index.d.ts
4
+ /**
5
+ * The options for the Alloy-js generator.
6
+ */
7
+ interface Options {
8
+ template: Children;
9
+ }
10
+ /**
11
+ * The Alloy-js generator.
12
+ *
13
+ * @see https://alloy-framework.github.io/alloy/guides/getting-started/
14
+ *
15
+ * @param spec - The specification to generate code for.
16
+ * @param options - The options for the generator.
17
+ * @returns A promise that resolves to the generated code.
18
+ */
19
+ declare const _default: import("@power-plant/core").GeneratorConfigObject<any, Options, void>;
20
+ //#endregion
21
+ export { Options, _default as default };
22
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;AA2BA;UAAiB,OAAA;EACf,QAAA,EAAU,QAAQ;AAAA;AAAA;AACnB;;;;;;;;AADmB,cACnB,QAAA"}
@@ -0,0 +1,22 @@
1
+ import { Children } from "@alloy-js/core";
2
+
3
+ //#region src/index.d.ts
4
+ /**
5
+ * The options for the Alloy-js generator.
6
+ */
7
+ interface Options {
8
+ template: Children;
9
+ }
10
+ /**
11
+ * The Alloy-js generator.
12
+ *
13
+ * @see https://alloy-framework.github.io/alloy/guides/getting-started/
14
+ *
15
+ * @param spec - The specification to generate code for.
16
+ * @param options - The options for the generator.
17
+ * @returns A promise that resolves to the generated code.
18
+ */
19
+ declare const _default: import("@power-plant/core").GeneratorConfigObject<any, Options, void>;
20
+ //#endregion
21
+ export { Options, _default as default };
22
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":""}
package/dist/index.mjs ADDED
@@ -0,0 +1,48 @@
1
+ import{t as e}from"./render-UH3hN5fr.mjs";import{defineGenerator as t,defineSchema as n,useExecutionContext as r}from"@power-plant/core";var i=Object.defineProperty,a=(e,t)=>{let n={};for(var r in e)i(n,r,{get:e[r],enumerable:!0});return t||i(n,Symbol.toStringTag,{value:`Module`}),n};function o(e){return s(e,[])}function s(e,t){switch(typeof e){case`string`:return JSON.stringify(e);case`function`:return e.name?`[function ${e.name}]`:`[function]`;case`object`:return c(e,t);default:return String(e)}}function c(e,t){if(e===null)return`null`;if(t.includes(e))return`[Circular]`;let n=[...t,e];if(l(e)){let t=e.toJSON();if(t!==e)return typeof t==`string`?t:s(t,n)}else if(Array.isArray(e))return d(e,n);return u(e,n)}function l(e){return typeof e.toJSON==`function`}function u(e,t){let n=Object.entries(e);return n.length===0?`{}`:t.length>2?`[`+f(e)+`]`:`{ `+n.map(([e,n])=>e+`: `+s(n,t)).join(`, `)+` }`}function d(e,t){if(e.length===0)return`[]`;if(t.length>2)return`[Array]`;let n=Math.min(10,e.length),r=e.length-n,i=[];for(let r=0;r<n;++r)i.push(s(e[r],t));return r===1?i.push(`... 1 more item`):r>1&&i.push(`... ${r} more items`),`[`+i.join(`, `)+`]`}function f(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,``).replace(/]$/,``);if(t===`Object`&&typeof e.constructor==`function`){let t=e.constructor.name;if(typeof t==`string`&&t!==``)return t}return t}function p(e,t){return e?.__kind===t}let m=p;function h(e){return typeof e==`object`&&!!e}function g(e,t){if(!e)throw Error(t??`Unexpected invariant triggered.`)}const ee=/\r\n|[\n\r]/g;function te(e,t){let n=0,r=1;for(let i of e.body.matchAll(ee)){if(typeof i.index!=`number`&&g(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function ne(e){return re(e.source,te(e.source,e.start))}function re(e,t){let n=e.locationOffset.column-1,r=``.padStart(n)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=t.line===1?n:0,c=t.column+s,l=`${e.name}:${o}:${c}\n`,u=r.split(/\r\n|[\n\r]/g),d=u[i];if(d.length>120){let e=Math.floor(c/80),t=c%80,n=[];for(let e=0;e<d.length;e+=80)n.push(d.slice(e,e+80));return l+ie([[`${o} |`,n[0]],...n.slice(1,e+1).map(e=>[`|`,e]),[`|`,`^`.padStart(t)],[`|`,n[e+1]]])}return l+ie([[`${o-1} |`,u[i-1]],[`${o} |`,d],[`|`,`^`.padStart(c)],[`${o+1} |`,u[i+1]]])}function ie(e){let t=e.filter(([e,t])=>t!==void 0),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?` `+t:``)).join(`
2
+ `)}var _=class e extends Error{constructor(t,n={}){let{nodes:r,source:i,positions:a,path:o,originalError:s,cause:c,extensions:l}=n,u=`cause`in n;super(t,u||s!=null?{cause:u?c:s}:void 0),this.name=`GraphQLError`,this.path=o??void 0;let d=s??(c instanceof Error?c:void 0);this.originalError=d,this.nodes=ae(Array.isArray(r)?r:r?[r]:void 0);let f=ae(this.nodes?.map(e=>e.loc).filter(e=>e!=null));this.source=i??f?.[0]?.source,this.positions=a??f?.map(e=>e.start),this.locations=a&&i?a.map(e=>te(i,e)):f?.map(e=>te(e.source,e.start));let p=h(d?.extensions)?d.extensions:void 0;this.extensions=l??p??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),s?.stack==null?Error.captureStackTrace==null?Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0}):Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:s.stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return`GraphQLError`}toString(){let e=this.message;if(this.nodes)for(let t of this.nodes)t.loc&&(e+=`
3
+
4
+ `+ne(t.loc));else if(this.source&&this.locations)for(let t of this.locations)e+=`
5
+
6
+ `+re(this.source,t);return e}toJSON(){let e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}};function ae(e){return e===void 0||e.length===0?void 0:e}function oe(e){return se(`or`,e)}function se(e,t){switch(t.length===0&&g(!1),t.length){case 1:return t[0];case 2:return t[0]+` `+e+` `+t[1]}let n=t.slice(0,-1),r=t.at(-1);return n.join(`, `)+`, `+e+` `+r}function ce(e){return typeof e==`object`&&typeof e?.[Symbol.iterator]==`function`}function le(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}function v(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}const ue={Name:[],Document:[`definitions`],OperationDefinition:[`description`,`name`,`variableDefinitions`,`directives`,`selectionSet`],VariableDefinition:[`description`,`variable`,`type`,`defaultValue`,`directives`],Variable:[`name`],SelectionSet:[`selections`],Field:[`alias`,`name`,`arguments`,`directives`,`selectionSet`],Argument:[`name`,`value`],FragmentArgument:[`name`,`value`],FragmentSpread:[`name`,`arguments`,`directives`],InlineFragment:[`typeCondition`,`directives`,`selectionSet`],FragmentDefinition:[`description`,`name`,`variableDefinitions`,`typeCondition`,`directives`,`selectionSet`],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:[`values`],ObjectValue:[`fields`],ObjectField:[`name`,`value`],Directive:[`name`,`arguments`],NamedType:[`name`],ListType:[`type`],NonNullType:[`type`],SchemaDefinition:[`description`,`directives`,`operationTypes`],OperationTypeDefinition:[`type`],ScalarTypeDefinition:[`description`,`name`,`directives`],ObjectTypeDefinition:[`description`,`name`,`interfaces`,`directives`,`fields`],FieldDefinition:[`description`,`name`,`arguments`,`type`,`directives`],InputValueDefinition:[`description`,`name`,`type`,`defaultValue`,`directives`],InterfaceTypeDefinition:[`description`,`name`,`interfaces`,`directives`,`fields`],UnionTypeDefinition:[`description`,`name`,`directives`,`types`],EnumTypeDefinition:[`description`,`name`,`directives`,`values`],EnumValueDefinition:[`description`,`name`,`directives`],InputObjectTypeDefinition:[`description`,`name`,`directives`,`fields`],DirectiveDefinition:[`description`,`name`,`arguments`,`directives`,`locations`],SchemaExtension:[`directives`,`operationTypes`],DirectiveExtension:[`name`,`directives`],ScalarTypeExtension:[`name`,`directives`],ObjectTypeExtension:[`name`,`interfaces`,`directives`,`fields`],InterfaceTypeExtension:[`name`,`interfaces`,`directives`,`fields`],UnionTypeExtension:[`name`,`directives`,`types`],EnumTypeExtension:[`name`,`directives`,`values`],InputObjectTypeExtension:[`name`,`directives`,`fields`],TypeCoordinate:[`name`],MemberCoordinate:[`name`,`memberName`],ArgumentCoordinate:[`name`,`fieldName`,`argumentName`],DirectiveCoordinate:[`name`],DirectiveArgumentCoordinate:[`name`,`argumentName`]},de=new Set(Object.keys(ue));function fe(e){let t=e?.kind;return typeof t==`string`&&de.has(t)}const pe={QUERY:`query`,MUTATION:`mutation`,SUBSCRIPTION:`subscription`};var me=a({ARGUMENT:()=>xe,ARGUMENT_COORDINATE:()=>rt,BOOLEAN:()=>Oe,DIRECTIVE:()=>je,DIRECTIVE_ARGUMENT_COORDINATE:()=>at,DIRECTIVE_COORDINATE:()=>it,DIRECTIVE_DEFINITION:()=>Ke,DIRECTIVE_EXTENSION:()=>Je,DOCUMENT:()=>ge,ENUM:()=>ke,ENUM_TYPE_DEFINITION:()=>Ue,ENUM_TYPE_EXTENSION:()=>$e,ENUM_VALUE_DEFINITION:()=>We,FIELD:()=>be,FIELD_DEFINITION:()=>ze,FLOAT:()=>De,FRAGMENT_ARGUMENT:()=>Se,FRAGMENT_DEFINITION:()=>Te,FRAGMENT_SPREAD:()=>Ce,INLINE_FRAGMENT:()=>we,INPUT_OBJECT_TYPE_DEFINITION:()=>Ge,INPUT_OBJECT_TYPE_EXTENSION:()=>et,INPUT_VALUE_DEFINITION:()=>Be,INT:()=>y,INTERFACE_TYPE_DEFINITION:()=>Ve,INTERFACE_TYPE_EXTENSION:()=>Ze,LIST:()=>S,LIST_TYPE:()=>Ne,MEMBER_COORDINATE:()=>nt,NAME:()=>he,NAMED_TYPE:()=>Me,NON_NULL_TYPE:()=>Pe,NULL:()=>x,OBJECT:()=>C,OBJECT_FIELD:()=>Ae,OBJECT_TYPE_DEFINITION:()=>Re,OBJECT_TYPE_EXTENSION:()=>Xe,OPERATION_DEFINITION:()=>_e,OPERATION_TYPE_DEFINITION:()=>Ie,SCALAR_TYPE_DEFINITION:()=>Le,SCALAR_TYPE_EXTENSION:()=>Ye,SCHEMA_DEFINITION:()=>Fe,SCHEMA_EXTENSION:()=>qe,SELECTION_SET:()=>ye,STRING:()=>b,TYPE_COORDINATE:()=>tt,UNION_TYPE_DEFINITION:()=>He,UNION_TYPE_EXTENSION:()=>Qe,VARIABLE:()=>Ee,VARIABLE_DEFINITION:()=>ve});const he=`Name`,ge=`Document`,_e=`OperationDefinition`,ve=`VariableDefinition`,ye=`SelectionSet`,be=`Field`,xe=`Argument`,Se=`FragmentArgument`,Ce=`FragmentSpread`,we=`InlineFragment`,Te=`FragmentDefinition`,Ee=`Variable`,y=`IntValue`,De=`FloatValue`,b=`StringValue`,Oe=`BooleanValue`,x=`NullValue`,ke=`EnumValue`,S=`ListValue`,C=`ObjectValue`,Ae=`ObjectField`,je=`Directive`,Me=`NamedType`,Ne=`ListType`,Pe=`NonNullType`,Fe=`SchemaDefinition`,Ie=`OperationTypeDefinition`,Le=`ScalarTypeDefinition`,Re=`ObjectTypeDefinition`,ze=`FieldDefinition`,Be=`InputValueDefinition`,Ve=`InterfaceTypeDefinition`,He=`UnionTypeDefinition`,Ue=`EnumTypeDefinition`,We=`EnumValueDefinition`,Ge=`InputObjectTypeDefinition`,Ke=`DirectiveDefinition`,qe=`SchemaExtension`,Je=`DirectiveExtension`,Ye=`ScalarTypeExtension`,Xe=`ObjectTypeExtension`,Ze=`InterfaceTypeExtension`,Qe=`UnionTypeExtension`,$e=`EnumTypeExtension`,et=`InputObjectTypeExtension`,tt=`TypeCoordinate`,nt=`MemberCoordinate`,rt=`ArgumentCoordinate`,it=`DirectiveCoordinate`,at=`DirectiveArgumentCoordinate`;function w(e,t){if(!e)throw Error(t)}function ot(e,t){let[n,r]=t?[e,t]:[void 0,e];if(r.length===0)return``;let i=` Did you mean `;n!=null&&(i+=n+` `);let a=oe(r.slice(0,5).map(e=>`"${e}"`));return i+a+`?`}function st(e){return e}function ct(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}function lt(e,t){let n=0,r=0;for(;n<e.length&&r<t.length;){let i=e.charCodeAt(n),a=t.charCodeAt(r);if(dt(i)&&dt(a)){let o=0;do++n,o=o*10+i-ut,i=e.charCodeAt(n);while(dt(i)&&o>0);let s=0;do++r,s=s*10+a-ut,a=t.charCodeAt(r);while(dt(a)&&s>0);if(o<s)return-1;if(o>s)return 1}else{if(i<a)return-1;if(i>a)return 1;++n,++r}}return e.length-t.length}const ut=48;function dt(e){return!isNaN(e)&&48<=e&&e<=57}function ft(e,t){let n=Object.create(null),r=new pt(e),i=Math.floor(e.length*.4)+1;for(let e of t){let t=r.measure(e,i);t!==void 0&&(n[e]=t)}return Object.keys(n).sort((e,t)=>{let r=n[e]-n[t];return r===0?lt(e,t):r})}var pt=class{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=mt(this._inputLowerCase),this._rows=[Array(e.length+1).fill(0),Array(e.length+1).fill(0),Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;let n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=mt(n),i=this._inputArray;if(r.length<i.length){let e=r;r=i,i=e}let a=r.length,o=i.length;if(a-o>t)return;let s=this._rows;for(let e=0;e<=o;e++)s[0][e]=e;for(let e=1;e<=a;e++){let n=s[(e-1)%3],a=s[e%3],c=a[0]=e;for(let t=1;t<=o;t++){let o=r[e-1]===i[t-1]?0:1,l=Math.min(n[t]+1,a[t-1]+1,n[t-1]+o);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){let n=s[(e-2)%3][t-2];l=Math.min(l,n+1)}l<c&&(c=l),a[t]=l}if(c>t)return}let c=s[a%3][o];return c<=t?c:void 0}};function mt(e){let t=e.length,n=Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r);return n}function T(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,r]of Object.entries(e))t[n]=r;for(let n of Object.getOwnPropertySymbols(e))t[n]=e[n];return t}function ht(e){return e===9||e===32}function gt(e){return e>=48&&e<=57}function _t(e){return e>=97&&e<=122||e>=65&&e<=90}function vt(e){return _t(e)||e===95}function yt(e){return _t(e)||gt(e)||e===95}function bt(e,t){let n=e.replaceAll(`"""`,`\\"""`),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,a=r.length>1&&r.slice(1).every(e=>e.length===0||ht(e.charCodeAt(0))),o=n.endsWith(`\\"""`),s=e.endsWith(`"`)&&!o,c=e.endsWith(`\\`),l=s||c,u=!t?.minimize&&(!i||e.length>70||l||a||o),d=``,f=i&&ht(e.charCodeAt(0));return(u&&!f||a)&&(d+=`
7
+ `),d+=n,(u||l)&&(d+=`
8
+ `),`"""`+d+`"""`}function xt(e){return`"${e.replace(St,Ct)}"`}const St=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Ct(e){return wt[e.charCodeAt(0)]}const wt=`\\u0000.\\u0001.\\u0002.\\u0003.\\u0004.\\u0005.\\u0006.\\u0007.\\b.\\t.\\n.\\u000B.\\f.\\r.\\u000E.\\u000F.\\u0010.\\u0011.\\u0012.\\u0013.\\u0014.\\u0015.\\u0016.\\u0017.\\u0018.\\u0019.\\u001A.\\u001B.\\u001C.\\u001D.\\u001E.\\u001F...\\"..........................................................\\\\...................................\\u007F.\\u0080.\\u0081.\\u0082.\\u0083.\\u0084.\\u0085.\\u0086.\\u0087.\\u0088.\\u0089.\\u008A.\\u008B.\\u008C.\\u008D.\\u008E.\\u008F.\\u0090.\\u0091.\\u0092.\\u0093.\\u0094.\\u0095.\\u0096.\\u0097.\\u0098.\\u0099.\\u009A.\\u009B.\\u009C.\\u009D.\\u009E.\\u009F`.split(`.`),Tt=Object.freeze({});function Et(e,t,n=ue){let r=new Map;for(let e of Object.values(me))r.set(e,Dt(t,e));let i,a=Array.isArray(e),s=[e],c=-1,l=[],u=e,d,f,p=[],m=[];do{c++;let e=c===s.length,h=e&&l.length!==0;if(e){if(d=m.length===0?void 0:p[p.length-1],u=f,f=m.pop(),h)if(a){u=u.slice();let e=0;for(let[t,n]of l){let r=t-e;n===null?(u.splice(r,1),e++):u[r]=n}}else{u={...u};for(let[e,t]of l)u[e]=t}c=i.index,s=i.keys,l=i.edits,a=i.inArray,i=i.prev}else if(f!=null){if(d=a?c:s[c],u=f[d],u==null)continue;p.push(d)}let g;if(!Array.isArray(u)){if(fe(u)||w(!1,`Invalid AST Node: ${o(u)}.`),g=(e?r.get(u.kind)?.leave:r.get(u.kind)?.enter)?.call(t,u,d,f,p,m),g===Tt)break;if(g===!1){if(!e){p.pop();continue}}else if(g!==void 0&&(l.push([d,g]),!e))if(fe(g))u=g;else{p.pop();continue}}g===void 0&&h&&l.push([d,u]),e?p.pop():(i={inArray:a,index:c,keys:s,edits:l,prev:i},a=Array.isArray(u),s=a?u:n[u.kind]??[],c=-1,l=[],f!=null&&m.push(f),f=u)}while(i!==void 0);return l.length===0?e:l.at(-1)[1]}function Dt(e,t){let n=e[t];return typeof n==`object`?n:typeof n==`function`?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function E(e){return Et(e,Ot)}const Ot={Name:{leave:e=>e.value},Variable:{leave:e=>`$`+e.name},Document:{leave:e=>D(e.definitions,`
9
+
10
+ `)},OperationDefinition:{leave(e){let t=kt(e.variableDefinitions)?k(`(
11
+ `,D(e.variableDefinitions,`
12
+ `),`
13
+ )`):k(`(`,D(e.variableDefinitions,`, `),`)`),n=k(``,e.description,`
14
+ `)+D([e.operation,D([e.name,t]),D(e.directives,` `)],` `);return(n===`query`?``:n+` `)+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:i})=>k(``,i,`
15
+ `)+e+`: `+t+k(` = `,n)+k(` `,D(r,` `))},SelectionSet:{leave:({selections:e})=>O(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){return D([At(D([k(``,e,`: `),t],``),n),k(` `,D(r,` `)),k(` `,i)])}},Argument:{leave:({name:e,value:t})=>e+`: `+t},FragmentArgument:{leave:({name:e,value:t})=>e+`: `+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>At(`...`+e,t)+k(` `,D(n,` `))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>D([`...`,k(`on `,e),D(t,` `),n],` `)},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i,description:a})=>k(``,a,`
16
+ `)+`fragment ${e}${k(`(`,D(n,`, `),`)`)} on ${t} ${k(``,D(r,` `),` `)}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t===!0?bt(e):xt(e)},BooleanValue:{leave:({value:e})=>e?`true`:`false`},NullValue:{leave:()=>`null`},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{let t=`[`+D(e,`, `)+`]`;return t.length>80?`[
17
+ `+A(D(e,`
18
+ `))+`
19
+ ]`:t}},ObjectValue:{leave:({fields:e})=>{let t=`{ `+D(e,`, `)+` }`;return t.length>80?O(e):t}},ObjectField:{leave:({name:e,value:t})=>e+`: `+t},Directive:{leave:({name:e,arguments:t})=>`@`+e+k(`(`,D(t,`, `),`)`)},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>`[`+e+`]`},NonNullType:{leave:({type:e})=>e+`!`},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>k(``,e,`
20
+ `)+D([`schema`,D(t,` `),O(n)],` `)},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+`: `+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>k(``,e,`
21
+ `)+D([`scalar`,t,D(n,` `)],` `)},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>k(``,e,`
22
+ `)+D([`type`,t,k(`implements `,D(n,` & `)),D(r,` `),O(i)],` `)},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>k(``,e,`
23
+ `)+t+(kt(n)?k(`(
24
+ `,A(D(n,`
25
+ `)),`
26
+ )`):k(`(`,D(n,`, `),`)`))+`: `+r+k(` `,D(i,` `))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>k(``,e,`
27
+ `)+D([t+`: `+n,k(`= `,r),D(i,` `)],` `)},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>k(``,e,`
28
+ `)+D([`interface`,t,k(`implements `,D(n,` & `)),D(r,` `),O(i)],` `)},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>k(``,e,`
29
+ `)+D([`union`,t,D(n,` `),k(`= `,D(r,` | `))],` `)},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>k(``,e,`
30
+ `)+D([`enum`,t,D(n,` `),O(r)],` `)},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>k(``,e,`
31
+ `)+D([t,D(n,` `)],` `)},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>k(``,e,`
32
+ `)+D([`input`,t,D(n,` `),O(r)],` `)},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:r,repeatable:i,locations:a})=>k(``,e,`
33
+ `)+`directive @`+t+(kt(n)?k(`(
34
+ `,A(D(n,`
35
+ `)),`
36
+ )`):k(`(`,D(n,`, `),`)`))+k(` `,D(r,` `))+(i?` repeatable`:``)+` on `+D(a,` | `)},SchemaExtension:{leave:({directives:e,operationTypes:t})=>D([`extend schema`,D(e,` `),O(t)],` `)},ScalarTypeExtension:{leave:({name:e,directives:t})=>D([`extend scalar`,e,D(t,` `)],` `)},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>D([`extend type`,e,k(`implements `,D(t,` & `)),D(n,` `),O(r)],` `)},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>D([`extend interface`,e,k(`implements `,D(t,` & `)),D(n,` `),O(r)],` `)},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>D([`extend union`,e,D(t,` `),k(`= `,D(n,` | `))],` `)},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>D([`extend enum`,e,D(t,` `),O(n)],` `)},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>D([`extend input`,e,D(t,` `),O(n)],` `)},DirectiveExtension:{leave:({name:e,directives:t})=>D([`extend directive @`+e,D(t,` `)],` `)},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>D([e,k(`.`,t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>D([e,k(`.`,t),k(`(`,n,`:)`)])},DirectiveCoordinate:{leave:({name:e})=>D([`@`,e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>D([`@`,e,k(`(`,t,`:)`)])}};function D(e,t=``){return e?.filter(e=>e!==void 0&&e!==``).join(t)??``}function O(e){return k(`{
37
+ `,A(D(e,`
38
+ `)),`
39
+ }`)}function k(e,t,n=``){return t!=null&&t!==``?e+t+n:``}function A(e){return k(` `,e.replaceAll(`
40
+ `,`
41
+ `))}function kt(e){return e?.some(e=>e.includes(`
42
+ `))??!1}function At(e,t){let n=e+k(`(`,D(t,`, `),`)`);return n.length>80&&(n=e+k(`(
43
+ `,A(D(t,`
44
+ `)),`
45
+ )`)),n}function jt(e,t){switch(e.kind){case x:return null;case y:return parseInt(e.value,10);case De:return parseFloat(e.value);case b:case ke:case Oe:return e.value;case S:return e.values.map(e=>jt(e,t));case C:return ct(e.fields,e=>e.name.value,e=>jt(e.value,t));case Ee:return t?.[e.name.value]}}function j(e){if(e.length===0)throw new _(`Expected name to be a non-empty string.`);for(let t=1;t<e.length;++t)if(!yt(e.charCodeAt(t)))throw new _(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!vt(e.charCodeAt(0)))throw new _(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function Mt(e){if(e===`true`||e===`false`||e===`null`)throw new _(`Enum values cannot be named: ${e}`);return j(e)}const Nt=Symbol(`Scalar`);function Pt(e){return m(e,Nt,z)}const Ft=Symbol(`Object`);function M(e){return m(e,Ft,B)}const It=Symbol(`Field`),Lt=Symbol(`Argument`),Rt=Symbol(`Interface`);function N(e){return m(e,Rt,on)}const zt=Symbol(`Union`);function P(e){return m(e,zt,sn)}const Bt=Symbol(`Enum`);function Vt(e){return m(e,Bt,ln)}const Ht=Symbol(`EnumValue`),Ut=Symbol(`InputObject`);function F(e){return m(e,Ut,pn)}const Wt=Symbol(`InputField`),Gt=Symbol(`List`);function Kt(e){return m(e,Gt,L)}const qt=Symbol(`NonNull`);function I(e){return m(e,qt,R)}function Jt(e){return Pt(e)||Vt(e)}function Yt(e){if(!Jt(e))throw Error(`Expected ${o(e)} to be a GraphQL leaf type.`);return e}function Xt(e){return N(e)||P(e)}var L=class{constructor(e){this.__kind=Gt,this.ofType=e}get[Symbol.toStringTag](){return`GraphQLList`}toString(){return`[`+String(this.ofType)+`]`}toJSON(){return this.toString()}},R=class{constructor(e){this.__kind=qt,this.ofType=e}get[Symbol.toStringTag](){return`GraphQLNonNull`}toString(){return String(this.ofType)+`!`}toJSON(){return this.toString()}};function Zt(e){return Kt(e)||I(e)}function Qt(e){if(e){let t=e;for(;Zt(t);)t=t.ofType;return t}}function $t(e){return typeof e==`function`?e():e}function en(e){return typeof e==`function`?e():e}var z=class{constructor(e){this.__kind=Nt,this.name=j(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=e.serialize??e.coerceOutputValue??st,this.parseValue=e.parseValue??e.coerceInputValue??st,this.parseLiteral=e.parseLiteral??((e,t)=>this.coerceInputValue(jt(e,t))),this.coerceOutputValue=e.coerceOutputValue??this.serialize,this.coerceInputValue=e.coerceInputValue??this.parseValue,this.coerceInputLiteral=e.coerceInputLiteral,this.valueToLiteral=e.valueToLiteral,this.extensions=T(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.parseLiteral&&(typeof e.parseValue==`function`&&typeof e.parseLiteral==`function`||w(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)),e.coerceInputLiteral&&(typeof e.coerceInputValue==`function`&&typeof e.coerceInputLiteral==`function`||w(!1,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`))}get[Symbol.toStringTag](){return`GraphQLScalarType`}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},B=class{constructor(e){this.__kind=Ft,this.__kind=Ft,this.name=j(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=T(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=nn.bind(void 0,this,e.fields),this._interfaces=tn.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return`GraphQLObjectType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces==`function`&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:v(this.getFields(),e=>e.toConfig()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function tn(e){return $t(e??[])}function nn(e,t){return v(en(t),(t,n)=>new rn(e,n,t))}var rn=class{constructor(e,t,n){this.__kind=It,this.parentType=e,this.name=j(t),this.description=n.description,this.type=n.type;let r=n.args;this.args=r?Object.entries(r).map(([e,t])=>new an(this,e,t)):[],this.resolve=n.resolve,this.subscribe=n.subscribe,this.deprecationReason=n.deprecationReason,this.extensions=T(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return`GraphQLField`}toConfig(){return{description:this.description,type:this.type,args:ct(this.args,e=>e.name,e=>e.toConfig()),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??`<meta>`}.${this.name}`}toJSON(){return this.toString()}},an=class{constructor(e,t,n){this.__kind=Lt,this.parent=e,this.name=j(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=n.deprecationReason,this.extensions=T(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return`GraphQLArgument`}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}},on=class{constructor(e){this.__kind=Rt,this.name=j(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=T(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=nn.bind(void 0,this,e.fields),this._interfaces=tn.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return`GraphQLInterfaceType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces==`function`&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:v(this.getFields(),e=>e.toConfig()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},sn=class{constructor(e){this.__kind=zt,this.name=j(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=T(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=cn.bind(void 0,e.types)}get[Symbol.toStringTag](){return`GraphQLUnionType`}getTypes(){return typeof this._types==`function`&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function cn(e){return $t(e)}var ln=class{constructor(e){this.__kind=Bt,this.name=j(e.name),this.description=e.description,this.extensions=T(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values=un.bind(void 0,this,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return`GraphQLEnumType`}getValues(){return typeof this._values==`function`&&(this._values=this._values()),this._values}getValue(e){return this._nameLookup??=le(this.getValues(),e=>e.name),this._nameLookup[e]}serialize(e){return this.coerceOutputValue(e)}coerceOutputValue(e){this._valueLookup??=new Map(this.getValues().map(e=>[e.value,e]));let t=this._valueLookup.get(e);if(t===void 0)throw new _(`Enum "${this.name}" cannot represent value: ${o(e)}`);return t.name}parseValue(e,t){return this.coerceInputValue(e,t)}coerceInputValue(e,t){if(typeof e!=`string`){let n=o(e);throw new _(`Enum "${this.name}" cannot represent non-string value: ${n}.`+(t?``:dn(this,n)))}let n=this.getValue(e);if(n==null)throw new _(`Value "${e}" does not exist in "${this.name}" enum.`+(t?``:dn(this,e)));return n.value}parseLiteral(e,t,n){return this.coerceInputLiteral(e,n)}coerceInputLiteral(e,t){if(e.kind!==`EnumValue`){let n=E(e);throw new _(`Enum "${this.name}" cannot represent non-enum value: ${n}.`+(t?``:dn(this,n)),{nodes:e})}let n=this.getValue(e.value);if(n==null){let n=E(e);throw new _(`Value "${n}" does not exist in "${this.name}" enum.`+(t?``:dn(this,n)),{nodes:e})}return n.value}valueToLiteral(e){if(typeof e==`string`&&this.getValue(e))return{kind:ke,value:e}}toConfig(){return{name:this.name,description:this.description,values:ct(this.getValues(),e=>e.name,e=>e.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function un(e,t){let n=en(t);return Object.entries(n).map(([t,n])=>new fn(e,t,n))}function dn(e,t){return ot(`the enum value`,ft(t,e.getValues().map(e=>e.name)))}var fn=class{constructor(e,t,n){this.__kind=Ht,this.parentEnum=e,this.name=Mt(t),this.description=n.description,this.value=n.value===void 0?t:n.value,this.deprecationReason=n.deprecationReason,this.extensions=T(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return`GraphQLEnumValue`}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}},pn=class{constructor(e){this.__kind=Ut,this.name=j(e.name),this.description=e.description,this.extensions=T(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=mn.bind(void 0,this,e.fields)}get[Symbol.toStringTag](){return`GraphQLInputObjectType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}toConfig(){return{name:this.name,description:this.description,fields:v(this.getFields(),e=>e.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}};function mn(e,t){return v(en(t),(t,n)=>new hn(e,n,t))}var hn=class{constructor(e,t,n){`resolve`in n&&w(!1,`${e}.${t} field has a resolve property, but Input Types cannot define resolvers.`),this.__kind=Wt,this.parentType=e,this.name=j(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=n.deprecationReason,this.extensions=T(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return`GraphQLInputField`}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}};function gn(e){return I(e.type)&&e.defaultValue===void 0&&e.default===void 0}function V(e,t){if(I(t))return e==null?void 0:V(e,t.ofType);if(e==null)return{kind:x};if(Kt(t)){if(!ce(e))return V(e,t.ofType);let n=[];for(let r of e){let e=V(r,t.ofType);if(!e)return;n.push(e)}return{kind:S,values:n}}if(F(t)){if(!h(e))return;let n=[],r=t.getFields();if(Object.keys(e).some(t=>e[t]!==void 0&&!Object.hasOwn(r,t)))return;for(let r of Object.values(t.getFields()))if(e[r.name]===void 0){if(gn(r))return}else{let t=V(e[r.name],r.type);if(!t)return;n.push({kind:Ae,name:{kind:he,value:r.name},value:t})}return{kind:C,fields:n}}let n=Yt(t);if(n.valueToLiteral)try{return n.valueToLiteral(e)}catch{return}return H(e)}function H(e){if(e==null)return{kind:x};switch(typeof e){case`boolean`:return{kind:Oe,value:e};case`string`:return{kind:b,value:e,block:!1};case`bigint`:return{kind:y,value:e.toString()};case`number`:{if(!Number.isFinite(e))return{kind:x};let t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:y,value:t}:{kind:De,value:t}}case`object`:{if(ce(e))return{kind:S,values:Array.from(e,H)};let t=e,n=[];for(let e of Object.keys(t)){let r=t[e];r!==void 0&&n.push({kind:Ae,name:{kind:he,value:e},value:H(r)})}return{kind:C,fields:n}}}throw TypeError(`Cannot convert value to AST: ${o(e)}.`)}const U={QUERY:`QUERY`,MUTATION:`MUTATION`,SUBSCRIPTION:`SUBSCRIPTION`,FIELD:`FIELD`,FRAGMENT_DEFINITION:`FRAGMENT_DEFINITION`,FRAGMENT_SPREAD:`FRAGMENT_SPREAD`,INLINE_FRAGMENT:`INLINE_FRAGMENT`,VARIABLE_DEFINITION:`VARIABLE_DEFINITION`,FRAGMENT_VARIABLE_DEFINITION:`FRAGMENT_VARIABLE_DEFINITION`,SCHEMA:`SCHEMA`,SCALAR:`SCALAR`,OBJECT:`OBJECT`,FIELD_DEFINITION:`FIELD_DEFINITION`,ARGUMENT_DEFINITION:`ARGUMENT_DEFINITION`,INTERFACE:`INTERFACE`,UNION:`UNION`,ENUM:`ENUM`,ENUM_VALUE:`ENUM_VALUE`,INPUT_OBJECT:`INPUT_OBJECT`,INPUT_FIELD_DEFINITION:`INPUT_FIELD_DEFINITION`,DIRECTIVE_DEFINITION:`DIRECTIVE_DEFINITION`},_n=new z({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.",coerceOutputValue(e){let t=K(e);if(typeof t==`number`)return bn(t);if(typeof t==`boolean`)return+!!t;if(typeof t==`string`)return xn(t);if(typeof t==`bigint`)return Sn(t);throw new _(`Int cannot represent non-integer value: ${o(t)}`)},coerceInputValue(e){if(typeof e==`number`)return bn(e);if(typeof e==`bigint`)return Sn(e);throw new _(`Int cannot represent non-integer value: ${o(e)}`)},coerceInputLiteral(e){if(e.kind!==`IntValue`)throw new _(`Int cannot represent non-integer value: ${E(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>2147483647||t<-2147483648)throw new _(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t},valueToLiteral(e){if((typeof e==`number`&&Number.isInteger(e)||typeof e==`bigint`)&&e<=2147483647&&e>=-2147483648)return{kind:y,value:String(e)}}}),vn=new z({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).",coerceOutputValue(e){let t=K(e);if(typeof t==`number`)return Cn(t);if(typeof t==`boolean`)return+!!t;if(typeof t==`string`)return wn(t);if(typeof t==`bigint`)return Tn(t);throw new _(`Float cannot represent non numeric value: ${o(t)}`)},coerceInputValue(e){if(typeof e==`number`)return Cn(e);if(typeof e==`bigint`)return Tn(e);throw new _(`Float cannot represent non numeric value: ${o(e)}`)},coerceInputLiteral(e){if(e.kind!==`FloatValue`&&e.kind!==`IntValue`)throw new _(`Float cannot represent non numeric value: ${E(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){let t=H(e);if(t.kind===`FloatValue`||t.kind===`IntValue`)return t}}),W=new z({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.",coerceOutputValue(e){let t=K(e);if(typeof t==`string`)return t;if(typeof t==`boolean`)return t?`true`:`false`;if(typeof t==`number`)return En(t);if(typeof t==`bigint`)return String(t);throw new _(`String cannot represent value: ${o(e)}`)},coerceInputValue(e){if(typeof e!=`string`)throw new _(`String cannot represent a non string value: ${o(e)}`);return e},coerceInputLiteral(e){if(e.kind!==`StringValue`)throw new _(`String cannot represent a non string value: ${E(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=H(e);if(t.kind===`StringValue`)return t}}),G=new z({name:`Boolean`,description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){let t=K(e);if(typeof t==`boolean`)return t;if(typeof t==`number`)return Dn(t);if(typeof t==`bigint`)return t!==0n;throw new _(`Boolean cannot represent a non boolean value: ${o(t)}`)},coerceInputValue(e){if(typeof e!=`boolean`)throw new _(`Boolean cannot represent a non boolean value: ${o(e)}`);return e},coerceInputLiteral(e){if(e.kind!==`BooleanValue`)throw new _(`Boolean cannot represent a non boolean value: ${E(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=H(e);if(t.kind===`BooleanValue`)return t}}),yn=new z({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.',coerceOutputValue(e){let t=K(e);if(typeof t==`string`)return t;if(typeof t==`number`)return On(t);if(typeof t==`bigint`)return String(t);throw new _(`ID cannot represent value: ${o(e)}`)},coerceInputValue(e){if(typeof e==`string`)return e;if(typeof e==`number`)return On(e);if(typeof e==`bigint`)return String(e);throw new _(`ID cannot represent value: ${o(e)}`)},coerceInputLiteral(e){if(e.kind!==`StringValue`&&e.kind!==`IntValue`)throw new _(`ID cannot represent a non-string and non-integer value: `+E(e),{nodes:e});return e.value},valueToLiteral(e){if(typeof e==`string`)return/^-?(?:0|[1-9][0-9]*)$/.test(e)?{kind:y,value:e}:{kind:b,value:e,block:!1};if(typeof e==`number`)return{kind:y,value:On(e)};if(typeof e==`bigint`)return{kind:y,value:String(e)}}});Object.freeze([W,_n,vn,G,yn]);function K(e){if(h(e)){if(typeof e.valueOf==`function`){let t=e.valueOf();if(!h(t))return t}if(typeof e.toJSON==`function`)return e.toJSON()}return e}function bn(e){if(!Number.isInteger(e))throw new _(`Int cannot represent non-integer value: ${o(e)}`);if(e>2147483647||e<-2147483648)throw new _(`Int cannot represent non 32-bit signed integer value: ${o(e)}`);return e}function xn(e){if(e===``)throw new _(`Int cannot represent non-integer value: ${o(e)}`);let t=Number(e);if(!Number.isInteger(t))throw new _(`Int cannot represent non-integer value: ${o(e)}`);if(t>2147483647||t<-2147483648)throw new _(`Int cannot represent non 32-bit signed integer value: ${o(e)}`);return t}function Sn(e){if(e>2147483647||e<-2147483648)throw new _(`Int cannot represent non 32-bit signed integer value: ${String(e)}`);return Number(e)}function Cn(e){if(!Number.isFinite(e))throw new _(`Float cannot represent non numeric value: ${o(e)}`);return e}function wn(e){if(e===``)throw new _(`Float cannot represent non numeric value: ${o(e)}`);let t=Number(e);if(!Number.isFinite(t))throw new _(`Float cannot represent non numeric value: ${o(e)}`);return t}function Tn(e){let t=Number(e);if(!Number.isFinite(t))throw new _(`Float cannot represent non numeric value: ${o(e)} (value is too large)`);if(BigInt(t)!==e)throw new _(`Float cannot represent non numeric value: ${o(e)} (value would lose precision)`);return t}function En(e){if(!Number.isFinite(e))throw new _(`String cannot represent value: ${o(e)}`);return String(e)}function Dn(e){if(!Number.isFinite(e))throw new _(`Boolean cannot represent a non boolean value: ${o(e)}`);return e!==0}function On(e){if(!Number.isInteger(e))throw new _(`ID cannot represent value: ${o(e)}`);return String(e)}const kn=Symbol(`Directive`);function An(e){return m(e,kn,q)}var q=class{constructor(e){this.__kind=kn,this.name=j(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.deprecationReason=e.deprecationReason,this.extensions=T(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],Array.isArray(e.locations)||w(!1,`@${this.name} locations must be an Array.`);let t=e.args??{};h(t)&&!Array.isArray(t)||w(!1,`@${this.name} args must be an object with argument names as keys.`),this.args=Object.entries(t).map(([e,t])=>new an(this,e,t))}get[Symbol.toStringTag](){return`GraphQLDirective`}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:ct(this.args,e=>e.name,e=>e.toConfig()),isRepeatable:this.isRepeatable,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return`@`+this.name}toJSON(){return this.toString()}};const jn=new q({name:`include`,description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[U.FIELD,U.FRAGMENT_SPREAD,U.INLINE_FRAGMENT],args:{if:{type:new R(G),description:`Included when true.`}}}),Mn=new q({name:`skip`,description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[U.FIELD,U.FRAGMENT_SPREAD,U.INLINE_FRAGMENT],args:{if:{type:new R(G),description:`Skipped when true.`}}});new q({name:`defer`,description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[U.FRAGMENT_SPREAD,U.INLINE_FRAGMENT],args:{if:{type:new R(G),description:`Deferred when true or undefined.`,default:{value:!0}},label:{type:W,description:`Unique name`}}}),new q({name:`stream`,description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[U.FIELD],args:{initialCount:{default:{value:0},type:new R(_n),description:`Number of items to return immediately`},if:{type:new R(G),description:`Stream when true or undefined.`,default:{value:!0}},label:{type:W,description:`Unique name`}}});const Nn=new q({name:`deprecated`,description:`Marks an element of a GraphQL schema as no longer supported.`,locations:[U.FIELD_DEFINITION,U.ARGUMENT_DEFINITION,U.INPUT_FIELD_DEFINITION,U.ENUM_VALUE,U.DIRECTIVE_DEFINITION],args:{reason:{type:new R(W),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/).`,default:{value:`No longer supported`}}}}),Pn=new q({name:`specifiedBy`,description:`Exposes a URL that specifies the behavior of this scalar.`,locations:[U.SCALAR],args:{url:{type:new R(W),description:`The URL that specifies the behavior of this scalar.`}}}),Fn=new q({name:`oneOf`,description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[U.INPUT_OBJECT],args:{}});new q({name:`experimental_disableErrorPropagation`,description:`Disables error propagation.`,locations:[U.QUERY,U.MUTATION,U.SUBSCRIPTION]});const In=Object.freeze([jn,Mn,Nn,Pn,Fn]);function J(e,t){if(I(t)){let n=J(e,t.ofType);return n?.kind===`NullValue`?null:n}if(e===null)return{kind:x};if(e===void 0)return null;if(Kt(t)){let n=t.ofType;if(ce(e)){let t=[];for(let r of e){let e=J(r,n);e!=null&&t.push(e)}return{kind:S,values:t}}return J(e,n)}if(F(t)){if(!h(e))return null;let n=[];for(let r of Object.values(t.getFields())){let t=J(e[r.name],r.type);t&&n.push({kind:Ae,name:{kind:he,value:r.name},value:t})}return{kind:C,fields:n}}if(Jt(t)){let n=t.coerceOutputValue(e);if(n==null)return null;if(typeof n==`boolean`)return{kind:Oe,value:n};if(typeof n==`number`&&Number.isFinite(n)){let e=String(n);return Ln.test(e)?{kind:y,value:e}:{kind:De,value:e}}if(typeof n==`bigint`)return{kind:y,value:String(n)};if(typeof n==`string`)return Vt(t)?{kind:ke,value:n}:t===yn&&Ln.test(n)?{kind:y,value:n}:{kind:b,value:n};throw TypeError(`Cannot convert value to AST: ${o(n)}.`)}g(!1,`Unexpected input type: `+o(t))}const Ln=/^-?(?:0|[1-9][0-9]*)$/;function Rn(e){let t=e.type,n=e.default;if(n){let e=n.literal??V(n.value,t);return e??g(!1,`Invalid default value`),e}let r=e.defaultValue;if(r!==void 0){let e=J(r,t);return e??g(!1,`Invalid default value`),e}}const zn=new B({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:()=>({description:{type:W,resolve:e=>e.description},types:{description:`A list of all types supported by this server.`,type:new R(new L(new R(Y))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:`The type that query operations will be rooted at.`,type:new R(Y),resolve:e=>e.getQueryType()},mutationType:{description:`If this server supports mutation, the type that mutation operations will be rooted at.`,type:Y,resolve:e=>e.getMutationType()},subscriptionType:{description:`If this server support subscription, the type that subscription operations will be rooted at.`,type:Y,resolve:e=>e.getSubscriptionType()},directives:{description:`A list of all directives supported by this server.`,type:new R(new L(new R(Bn))),args:{includeDeprecated:{type:new R(G),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>t===!0?e.getDirectives():e.getDirectives().filter(e=>e.deprecationReason==null)}})}),Bn=new B({name:`__Directive`,description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
46
+
47
+ 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:()=>({name:{type:new R(W),resolve:e=>e.name},description:{type:W,resolve:e=>e.description},isRepeatable:{type:new R(G),resolve:e=>e.isRepeatable},locations:{type:new R(new L(new R(Vn))),resolve:e=>e.locations},args:{type:new R(new L(new R(Un))),args:{includeDeprecated:{type:new R(G),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter(e=>e.deprecationReason==null)}},isDeprecated:{type:new R(G),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:W,resolve:e=>e.deprecationReason}})}),Vn=new ln({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:U.QUERY,description:`Location adjacent to a query operation.`},MUTATION:{value:U.MUTATION,description:`Location adjacent to a mutation operation.`},SUBSCRIPTION:{value:U.SUBSCRIPTION,description:`Location adjacent to a subscription operation.`},FIELD:{value:U.FIELD,description:`Location adjacent to a field.`},FRAGMENT_DEFINITION:{value:U.FRAGMENT_DEFINITION,description:`Location adjacent to a fragment definition.`},FRAGMENT_SPREAD:{value:U.FRAGMENT_SPREAD,description:`Location adjacent to a fragment spread.`},INLINE_FRAGMENT:{value:U.INLINE_FRAGMENT,description:`Location adjacent to an inline fragment.`},VARIABLE_DEFINITION:{value:U.VARIABLE_DEFINITION,description:`Location adjacent to an operation variable definition.`},FRAGMENT_VARIABLE_DEFINITION:{value:U.FRAGMENT_VARIABLE_DEFINITION,description:`Location adjacent to a fragment variable definition.`},SCHEMA:{value:U.SCHEMA,description:`Location adjacent to a schema definition.`},SCALAR:{value:U.SCALAR,description:`Location adjacent to a scalar definition.`},OBJECT:{value:U.OBJECT,description:`Location adjacent to an object type definition.`},FIELD_DEFINITION:{value:U.FIELD_DEFINITION,description:`Location adjacent to a field definition.`},ARGUMENT_DEFINITION:{value:U.ARGUMENT_DEFINITION,description:`Location adjacent to an argument definition.`},INTERFACE:{value:U.INTERFACE,description:`Location adjacent to an interface definition.`},UNION:{value:U.UNION,description:`Location adjacent to a union definition.`},ENUM:{value:U.ENUM,description:`Location adjacent to an enum definition.`},ENUM_VALUE:{value:U.ENUM_VALUE,description:`Location adjacent to an enum value definition.`},INPUT_OBJECT:{value:U.INPUT_OBJECT,description:`Location adjacent to an input object type definition.`},INPUT_FIELD_DEFINITION:{value:U.INPUT_FIELD_DEFINITION,description:`Location adjacent to an input object field definition.`},DIRECTIVE_DEFINITION:{value:U.DIRECTIVE_DEFINITION,description:`Location adjacent to a directive definition.`}}}),Y=new B({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:()=>({kind:{type:new R(Gn),resolve(e){if(Pt(e))return X.SCALAR;if(M(e))return X.OBJECT;if(N(e))return X.INTERFACE;if(P(e))return X.UNION;if(Vt(e))return X.ENUM;if(F(e))return X.INPUT_OBJECT;if(Kt(e))return X.LIST;if(I(e))return X.NON_NULL;g(!1,`Unexpected type: "${o(e)}".`)}},name:{type:W,resolve:e=>`name`in e?e.name:void 0},description:{type:W,resolve:e=>`description`in e?e.description:void 0},specifiedByURL:{type:W,resolve:e=>`specifiedByURL`in e?e.specifiedByURL:void 0},fields:{type:new L(new R(Hn)),args:{includeDeprecated:{type:new R(G),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(M(e)||N(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter(e=>e.deprecationReason==null)}}},interfaces:{type:new L(new R(Y)),resolve(e){if(M(e)||N(e))return e.getInterfaces()}},possibleTypes:{type:new L(new R(Y)),resolve(e,t,n,{schema:r}){if(Xt(e))return r.getPossibleTypes(e)}},enumValues:{type:new L(new R(Wn)),args:{includeDeprecated:{type:new R(G),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(Vt(e)){let n=e.getValues();return t===!0?n:n.filter(e=>e.deprecationReason==null)}}},inputFields:{type:new L(new R(Un)),args:{includeDeprecated:{type:new R(G),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(F(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter(e=>e.deprecationReason==null)}}},ofType:{type:Y,resolve:e=>`ofType`in e?e.ofType:void 0},isOneOf:{type:G,resolve:e=>{if(F(e))return e.isOneOf}}})}),Hn=new B({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:()=>({name:{type:new R(W),resolve:e=>e.name},description:{type:W,resolve:e=>e.description},args:{type:new R(new L(new R(Un))),args:{includeDeprecated:{type:new R(G),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter(e=>e.deprecationReason==null)}},type:{type:new R(Y),resolve:e=>e.type},isDeprecated:{type:new R(G),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:W,resolve:e=>e.deprecationReason}})}),Un=new B({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:()=>({name:{type:new R(W),resolve:e=>e.name},description:{type:W,resolve:e=>e.description},type:{type:new R(Y),resolve:e=>e.type},defaultValue:{type:W,description:`A GraphQL-formatted string representing the default value for this input value.`,resolve(e){let t=Rn(e);return t?E(t):null}},isDeprecated:{type:new R(G),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:W,resolve:e=>e.deprecationReason}})}),Wn=new B({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:()=>({name:{type:new R(W),resolve:e=>e.name},description:{type:W,resolve:e=>e.description},isDeprecated:{type:new R(G),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:W,resolve:e=>e.deprecationReason}})}),X={SCALAR:`SCALAR`,OBJECT:`OBJECT`,INTERFACE:`INTERFACE`,UNION:`UNION`,ENUM:`ENUM`,INPUT_OBJECT:`INPUT_OBJECT`,LIST:`LIST`,NON_NULL:`NON_NULL`},Gn=new ln({name:`__TypeKind`,description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:X.SCALAR,description:`Indicates this type is a scalar.`},OBJECT:{value:X.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:X.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:X.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:X.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:X.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:X.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:X.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Kn=new rn(void 0,`__schema`,{type:new R(zn),description:`Access the current type schema of this server.`,resolve:(e,t,n,{schema:r})=>r}),qn=new rn(void 0,`__type`,{type:Y,description:`Request the type information of a single type.`,args:{name:{type:new R(W)}},resolve:(e,{name:t},n,{schema:r})=>r.getType(t)}),Jn=new rn(void 0,`__typename`,{type:new R(W),description:`The name of the current Object type at runtime.`,resolve:(e,t,n,{parentType:r})=>r.name});Object.freeze([zn,Bn,Vn,Y,Hn,Un,Wn,Gn]);function Yn(e){return m(e,Xn,Zn)}const Xn=Symbol(`Schema`);var Zn=class{constructor(e){this.__kind=Xn,this.assumeValid=e.assumeValid??!1,this.__validationErrors=e.assumeValid===!0?[]:void 0,this.description=e.description,this.extensions=T(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??In;let t=new Set(e.types);if(e.types!=null)for(let n of e.types)t.delete(n),Z(n,t);this._queryType!=null&&Z(this._queryType,t),this._mutationType!=null&&Z(this._mutationType,t),this._subscriptionType!=null&&Z(this._subscriptionType,t);for(let e of this._directives)if(An(e))for(let n of e.args)Z(n.type,t);Z(zn,t),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(let e of t){if(e==null)continue;let t=e.name;if(this._typeMap[t]!==void 0)throw Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,N(e)){for(let t of e.getInterfaces())if(N(t)){let n=this._implementationsMap[t.name];n??=this._implementationsMap[t.name]={objects:[],interfaces:[]},n.interfaces.push(e)}}else if(M(e)){for(let t of e.getInterfaces())if(N(t)){let n=this._implementationsMap[t.name];n??=this._implementationsMap[t.name]={objects:[],interfaces:[]},n.objects.push(e)}}}}get[Symbol.toStringTag](){return`GraphQLSchema`}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case pe.QUERY:return this.getQueryType();case pe.MUTATION:return this.getMutationType();case pe.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return P(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap.get(e);if(n===void 0){if(P(e))n=new Set(e.getTypes());else{let t=this.getImplementations(e);n=new Set([...t.objects,...t.interfaces])}this._subTypeMap.set(e,n)}return n.has(t)}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(t=>t.name===e)}getField(e,t){switch(t){case Kn.name:return this.getQueryType()===e?Kn:void 0;case qn.name:return this.getQueryType()===e?qn:void 0;case Jn.name:return Jn}if(`getFields`in e)return e.getFields()[t]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.assumeValid}}};function Z(e,t){let n=Qt(e);if(!t.has(n)){if(t.add(n),P(n))for(let e of n.getTypes())Z(e,t);else if(M(n)||N(n)){for(let e of n.getInterfaces())Z(e,t);for(let e of Object.values(n.getFields())){Z(e.type,t);for(let n of e.args)Z(n.type,t)}}else if(F(n))for(let e of Object.values(n.getFields()))Z(e.type,t)}return t}var Qn;function Q(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var $=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};(Qn=globalThis).__zod_globalConfig??(Qn.__zod_globalConfig={});const $n=globalThis.__zod_globalConfig;function er(e){return e&&Object.assign($n,e),$n}function tr(e,t){return typeof t==`bigint`?t.toString():t}const nr=Symbol(`evaluating`);function rr(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==nr)return r===void 0&&(r=nr,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}const ir=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ar(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function or(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}-Number.MAX_VALUE,Number.MAX_VALUE;function sr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function cr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function lr(e){return typeof e==`string`?e:e?.message}function ur(e,t,n){let r=e.message?e.message:lr(e.inst?._zod.def?.error?.(e))??lr(t?.error?.(e))??lr(n.customError?.(e))??lr(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function dr(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const fr=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,tr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},pr=Q(`$ZodError`,fr),mr=Q(`$ZodError`,fr,{Parent:Error}),hr=(e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new $;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>ur(e,a,er())));throw ir(t,i?.callee),t}return o.value})(mr),gr=(e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>ur(e,a,er())));throw ir(t,i?.callee),t}return o.value})(mr),_r=(e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new $;return a.issues.length?{success:!1,error:new(e??pr)(a.issues.map(e=>ur(e,i,er())))}:{success:!0,data:a.value}})(mr),vr=(e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>ur(e,i,er())))}:{success:!0,data:a.value}})(mr),yr=Q(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),br={major:4,minor:4,patch:3},xr=Q(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=br;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=sr(e),i;for(let a of t){if(a._zod.def.when){if(cr(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new $;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=sr(e,t))});else{if(e.issues.length===t)continue;r||=sr(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(sr(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new $;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new $;return o.then(e=>t(e,r,a))}return t(o,r,a)}}rr(e,`~standard`,()=>({validate:t=>{try{let n=_r(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return vr(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Sr=Q(`$ZodCustom`,(e,t)=>{yr.init(e,t),xr.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Cr(t,n,r,e));Cr(i,n,r,e)}});function Cr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(dr(e))}}function wr(e,t,n){let r=or(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Tr(e,t){let n=Er(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(dr(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(dr(r))}},e(t.value,t)),t);return n}function Er(e,t){let n=new yr({check:`custom`,...or(t)});return n._zod.check=e,n}const Dr=Q(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);xr.init(e,t),e.def=t,e.type=t.type,e.parse=(t,n)=>hr(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>_r(e,t,n),e.parseAsync=async(t,n)=>gr(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>vr(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0}),e.with=e.check,e.clone=(t,n)=>ar(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.apply=t=>t(e)}),Or=Q(`ZodMiniCustom`,(e,t)=>{Sr.init(e,t),Dr.init(e,t)});function kr(e,t){return wr(Or,e??(()=>!0),t)}function Ar(e,t){return Tr(e,t)}function jr(e){return e.getQueryType()!=null||e.getMutationType()!=null||e.getSubscriptionType()!=null}var Mr=t({meta:{name:`alloy-js`,description:`A generator that uses Alloy-js to generate source code from a specification.`,version:`1.0`,tags:[`alloy-js`],links:[{description:`Alloy-js Repository`,href:`https://github.com/alloy-framework/alloy`},{description:`Alloy-js Documentation`,href:`https://alloy-framework.github.io/alloy/guides/getting-started/`}]},schema:n({meta:{name:`graphql-schema`,title:`GraphQL Schema`,version:`1.0`,description:`A GraphQL schema document used to describe a GraphQL API. This schema is compatible with the GraphQL specification and can be used to validate and generate code from the schema. Some examples of tools that can be used to generate client and/or server libraries, documentation, and other tools are: GraphQL Code Generator, GraphQL Yoga, Apollo Server, and many more.`,spec:e=>{if(e.description)return e.description;let t=[e.getQueryType()?.name,e.getMutationType()?.name,e.getSubscriptionType()?.name].filter(e=>e!=null);return t.length>0?`A GraphQL API schema with ${t.join(`, `)} root operation type${t.length===1?``:`s`}.`:`A GraphQL API schema.`},tags:e=>Object.keys(e.getTypeMap()).filter(e=>!e.startsWith(`__`)),links:e=>{let t=[];for(let n of Object.values(e.getTypeMap()))Pt(n)&&n.specifiedByURL&&t.push({href:n.specifiedByURL,description:n.description??`${n.name} scalar specification`});return t}},schema:kr(e=>Yn(e)&&jr(e),`Expected a GraphQLSchema instance with at least one root operation type`).check(Ar((e,t)=>{let n=e.getTypeMap();for(let[e,r]of Object.entries(n))r.name!==e&&t.addIssue({code:`custom`,message:`Type map entry "${e}" does not match type name "${r.name}"`,path:[`types`,e]})}))}),generator:async(t,n)=>e(r(),t,n.template)});export{Mr as default};
48
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ import { ComponentContext } from "@alloy-js/core";
2
+ import { MetaConfig } from "@power-plant/core";
3
+
4
+ //#region src/core/contexts/meta.d.ts
5
+ /**
6
+ * The Meta context used in template rendering.
7
+ */
8
+ declare const MetaContext: ComponentContext<Record<string, MetaConfig<any, any>>>;
9
+ /**
10
+ * Hook to access the {@link MetaContext | Meta context}.
11
+ *
12
+ * @returns The Meta context.
13
+ * @throws An error if the Meta context is not set.
14
+ */
15
+ declare function useMeta(): Record<string, MetaConfig<any, any>>;
16
+ /**
17
+ * Hook to safely access the {@link MetaContext | Meta context}.
18
+ *
19
+ * @returns The Meta context or undefined if not set.
20
+ */
21
+ declare function useMetaSafe(): Record<string, MetaConfig<any, any>> | undefined;
22
+ //#endregion
23
+ export { useMeta as n, useMetaSafe as r, MetaContext as t };
24
+ //# sourceMappingURL=meta-CDUo2qw9.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta-CDUo2qw9.d.cts","names":[],"sources":["../src/core/contexts/meta.ts"],"mappings":";;;;;;AAyBA;cAAa,WAAA,EAAa,gBAAA,CACxB,MAAA,SAAe,UAAA;;;;;;;iBASD,OAAA,IAAW,MAAM,SAAS,UAAA;;;;AATf;AAS3B;iBAgBgB,WAAA,IACd,MAAM,SAAS,UAAA"}
@@ -0,0 +1,24 @@
1
+ import { ComponentContext } from "@alloy-js/core";
2
+ import { MetaConfig } from "@power-plant/core";
3
+
4
+ //#region src/core/contexts/meta.d.ts
5
+ /**
6
+ * The Meta context used in template rendering.
7
+ */
8
+ declare const MetaContext: ComponentContext<Record<string, MetaConfig<any, any>>>;
9
+ /**
10
+ * Hook to access the {@link MetaContext | Meta context}.
11
+ *
12
+ * @returns The Meta context.
13
+ * @throws An error if the Meta context is not set.
14
+ */
15
+ declare function useMeta(): Record<string, MetaConfig<any, any>>;
16
+ /**
17
+ * Hook to safely access the {@link MetaContext | Meta context}.
18
+ *
19
+ * @returns The Meta context or undefined if not set.
20
+ */
21
+ declare function useMetaSafe(): Record<string, MetaConfig<any, any>> | undefined;
22
+ //#endregion
23
+ export { useMeta as n, useMetaSafe as r, MetaContext as t };
24
+ //# sourceMappingURL=meta-CDUo2qw9.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta-CDUo2qw9.d.mts","names":[],"sources":["../src/core/contexts/meta.ts"],"mappings":""}
@@ -0,0 +1,25 @@
1
+ import { OutputProps } from "@alloy-js/core";
2
+ import { ExecutionContext, MetaConfig } from "@power-plant/core";
3
+
4
+ //#region src/core/components/output.d.ts
5
+ interface OutputProps$1<TContext extends ExecutionContext<any, any, any> = ExecutionContext<any, any, any>> extends Omit<OutputProps, "basePath"> {
6
+ /**
7
+ * The current execution context.
8
+ */
9
+ context: TContext;
10
+ /**
11
+ * The current meta context.
12
+ */
13
+ meta?: Record<string, MetaConfig<any, TContext["options"]>>;
14
+ /**
15
+ * The current specification.
16
+ */
17
+ spec?: TContext["spec"];
18
+ }
19
+ /**
20
+ * Output component for rendering the execution's output files via templates.
21
+ */
22
+ declare function Output<TContext extends ExecutionContext<any, any, any> = ExecutionContext<any, any, any>>(props: OutputProps$1<TContext>): import("@alloy-js/core").Children;
23
+ //#endregion
24
+ export { OutputProps$1 as n, Output as t };
25
+ //# sourceMappingURL=output-Cd9yv0DZ.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-Cd9yv0DZ.d.cts","names":[],"sources":["../src/core/components/output.tsx"],"mappings":";;;;UA4BiB,aAAA,kBACE,gBAAA,kBAAsC,gBAAA,yBAK/C,IAAA,CAAK,WAAA;;AANf;;EAUE,OAAA,EAAS,QAAA;EATQ;;;EAcjB,IAAA,GAAO,MAAA,SAAe,UAAA,MAAgB,QAAA;EAAA;;;EAKtC,IAAA,GAAO,QAAA;AAAA;;;;iBAMO,MAAA,kBACG,gBAAA,kBAAsC,gBAAA,iBAKvD,KAAA,EAAO,aAAA,CAAY,QAAA,6BAAS,QAAA"}
@@ -0,0 +1,25 @@
1
+ import { OutputProps } from "@alloy-js/core";
2
+ import { ExecutionContext, MetaConfig } from "@power-plant/core";
3
+
4
+ //#region src/core/components/output.d.ts
5
+ interface OutputProps$1<TContext extends ExecutionContext<any, any, any> = ExecutionContext<any, any, any>> extends Omit<OutputProps, "basePath"> {
6
+ /**
7
+ * The current execution context.
8
+ */
9
+ context: TContext;
10
+ /**
11
+ * The current meta context.
12
+ */
13
+ meta?: Record<string, MetaConfig<any, TContext["options"]>>;
14
+ /**
15
+ * The current specification.
16
+ */
17
+ spec?: TContext["spec"];
18
+ }
19
+ /**
20
+ * Output component for rendering the execution's output files via templates.
21
+ */
22
+ declare function Output$1<TContext extends ExecutionContext<any, any, any> = ExecutionContext<any, any, any>>(props: OutputProps$1<TContext>): import("@alloy-js/core").Children;
23
+ //#endregion
24
+ export { OutputProps$1 as n, Output$1 as t };
25
+ //# sourceMappingURL=output-D_ovZIyg.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-D_ovZIyg.d.mts","names":[],"sources":["../src/core/components/output.tsx"],"mappings":""}
@@ -0,0 +1 @@
1
+ const e=require("./source-file-K_2P7eFP.cjs"),t=require("./core/components/output.cjs");require("./core/index.cjs");let n=require("@alloy-js/core/jsx-runtime"),r=require("@alloy-js/core"),i=require("@power-plant/core/utils");require("@stryke/type-checks/is-set-string"),require("@stryke/types/base");let a=require("defu");a=e.o(a,1);const o=e=>{};function s(t,n=e.i()){return e.n(t,n)?e.r(t).replace(e.r(n),``).replace(/^\//,``):t}function c(e,t={}){let{conjunction:n=`and`}=t;if(typeof e==`string`)return e;if(e.length===0)return``;if(e.length===1)return e[0];if(e.length===2)return`${e[0]} ${n} ${e[1]}`;let r=e.pop();return`${e.join(`, `)}, ${n} ${r}`}async function l(e,l,u){let d={},{cwd:f,logger:p}=e,m=await(0,r.renderAsync)((0,n.createComponent)(t.Output,{context:e,spec:l,meta:d,children:u})),h=[];if(await(0,r.traverseOutput)(m,{visitDirectory:o,visitFile:e=>h.push(e)}),!h.length)return p.debug(`No output files were rendered by the Alloy-js components.`),{};p.debug(`Rendering ${h.length} output files from Alloy-js components: ${c(h.map(e=>s(e.path,f)))}.`);let g={};return await(0,r.traverseOutput)(m,{visitDirectory:o,visitFile:e=>{if(`contents`in e){let t=d[e.path]??{};g[e.path]={path:e.path,language:(0,i.getLanguage)(e.path),source:[{content:e.contents,meta:t}]}}else if(e.sourcePath&&g[e.sourcePath]){let t=d[e.path]??{},n=(0,i.getLanguage)(e.path);g[e.path]={...g[e.sourcePath],language:n===`other`?g[e.sourcePath].language:n,path:e.path,source:g[e.sourcePath]?.source?.map(e=>(0,a.default)(e,{meta:t}))??[]}}}}),g}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
@@ -0,0 +1,2 @@
1
+ import{i as e,n as t,r as n}from"./source-file-t3itBybg.mjs";import{Output as r}from"./core/components/output.mjs";import"./core/index.mjs";import{createComponent as i}from"@alloy-js/core/jsx-runtime";import{renderAsync as a,traverseOutput as o}from"@alloy-js/core";import{getLanguage as s}from"@power-plant/core/utils";import"@stryke/type-checks/is-set-string";import"@stryke/types/base";import c from"defu";const l=e=>{};function u(r,i=e()){return t(r,i)?n(r).replace(n(i),``).replace(/^\//,``):r}function d(e,t={}){let{conjunction:n=`and`}=t;if(typeof e==`string`)return e;if(e.length===0)return``;if(e.length===1)return e[0];if(e.length===2)return`${e[0]} ${n} ${e[1]}`;let r=e.pop();return`${e.join(`, `)}, ${n} ${r}`}async function f(e,t,n){let f={},{cwd:p,logger:m}=e,h=await a(i(r,{context:e,spec:t,meta:f,children:n})),g=[];if(await o(h,{visitDirectory:l,visitFile:e=>g.push(e)}),!g.length)return m.debug(`No output files were rendered by the Alloy-js components.`),{};m.debug(`Rendering ${g.length} output files from Alloy-js components: ${d(g.map(e=>u(e.path,p)))}.`);let _={};return await o(h,{visitDirectory:l,visitFile:e=>{if(`contents`in e){let t=f[e.path]??{};_[e.path]={path:e.path,language:s(e.path),source:[{content:e.contents,meta:t}]}}else if(e.sourcePath&&_[e.sourcePath]){let t=f[e.path]??{},n=s(e.path);_[e.path]={..._[e.sourcePath],language:n===`other`?_[e.sourcePath].language:n,path:e.path,source:_[e.sourcePath]?.source?.map(e=>c(e,{meta:t}))??[]}}}}),_}export{f as t};
2
+ //# sourceMappingURL=render-UH3hN5fr.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-UH3hN5fr.mjs","names":[],"sources":[],"mappings":""}
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./render-Bh6nE1bo.cjs");exports.render=e.t;
@@ -0,0 +1,22 @@
1
+ import { Children } from "@alloy-js/core";
2
+ import { ExecutionContext, GeneratorFunctionResult } from "@power-plant/core";
3
+
4
+ //#region src/render.d.ts
5
+ /**
6
+ * A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and register any generated documents on the execution context.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * import { render } from "@power-plant/alloy-js/render";
11
+ *
12
+ * await render(context, spec, <> ... </>);
13
+ * ```
14
+ *
15
+ * @param context - The Power Plant execution context.
16
+ * @param children - The children components to render.
17
+ * @returns A promise that resolves when rendering is complete.
18
+ */
19
+ declare function render<TSpec, TOptions extends object, TReturns = void>(context: ExecutionContext<TSpec, TOptions, TReturns>, spec: TSpec, children: Children): Promise<GeneratorFunctionResult<TSpec, TOptions>>;
20
+ //#endregion
21
+ export { render };
22
+ //# sourceMappingURL=render.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.cts","names":[],"sources":["../src/render.tsx"],"mappings":";;;;;;AA8CA;;;;;;;;;;;;iBAAsB,MAAA,kDACpB,OAAA,EAAS,gBAAA,CAAiB,KAAA,EAAO,QAAA,EAAU,QAAA,GAC3C,IAAA,EAAM,KAAA,EACN,QAAA,EAAU,QAAA,GACT,OAAA,CAAQ,uBAAA,CAAwB,KAAA,EAAO,QAAA"}